:root {
  color-scheme: light;
  --paper: #f2eee2;
  --ink: #173b35;
  --muted: #4f645a;
  --line: #d7d0be;
  --cream: #faf7ed;
  --teal: #103c37;
  --gold: #ead290;
  --mono: 'Cascadia Mono', Consolas, monospace;
  font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
  color: var(--ink);
  background: var(--paper);
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
button, input { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #a94327; outline-offset: 4px; }
.skip { position: fixed; z-index: 2; top: .6rem; left: 1rem; padding: .7rem 1rem; transform: translateY(-150%); background: var(--cream); }
.skip:focus { transform: none; }
.shell { max-width: 1328px; margin: auto; padding: 0 clamp(16px, 4vw, 56px); }
.mast { min-height: 66px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 750; letter-spacing: .05em; }
.mast-link { text-decoration-thickness: 1px; text-underline-offset: 4px; font-size: .87rem; font-weight: 700; padding: 8px 0; }
.mast-link span { margin-left: .25em; }
.intro { display: flex; justify-content: space-between; align-items: end; gap: 22px; margin: 32px 0 27px; }
.eyebrow { margin: 0 0 12px; color: var(--muted); font: 700 .75rem var(--mono); letter-spacing: .1em; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(2.7rem, 6vw, 5.35rem); line-height: 1.03; letter-spacing: -.06em; font-weight: 850; }
h2 { font-size: 1.16rem; line-height: 1.4; }
.lede { max-width: 315px; color: var(--muted); margin-bottom: 4px; line-height: 1.65; font-size: .95rem; }
.bench { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(310px, 1fr); gap: 16px; }
.plate { display: flex; flex-direction: column; justify-content: space-between; margin: 0; color: #fff4d8; background: radial-gradient(ellipse at 46% 28%, #24534a, #103a37 76%); border: 1px solid #0e372f; border-radius: 16px; padding: 24px; min-width: 0; }
.plate-head, .field-top, .readout-top, .export-title { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.plate-head { padding-bottom: 14px; border-bottom: 1px solid #75928980; }
.plate-head > span { font-size: .78rem; color: #d0e6d5; }
.plate-head i { display: inline-block; width: 7px; height: 7px; margin-right: 4px; border-radius: 50%; background: var(--gold); }
#diagram { width: 100%; height: auto; display: block; margin: 9px 0; }
#pivot-track { cursor: ew-resize; touch-action: none; }
.axis-labels { font: 20px var(--mono); fill: #e4eddf; }
.plate-keys { display: flex; flex-wrap: wrap; gap: 8px 22px; padding: 10px 0; color: #edf3df; font-size: .82rem; }
.plate-keys span { display: inline-flex; align-items: center; gap: 8px; }
.plate-keys b { display: inline-block; width: .6em; height: .6em; }
.square { background: #ef9d74; }
.diamond, .pin { transform: rotate(45deg); }
.diamond { background: #8cccb7; }
.pin { background: var(--gold); }
.plate-foot { font-size: .8rem; line-height: 1.45; color: #c7e0d0; }
.controls { background: var(--cream); border: 1px solid var(--line); border-radius: 16px; padding: 20px; min-width: 0; }
.preset-bar { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 12px 0; }
.preset-bar button { border: 1px solid #bfb9a3; color: var(--ink); background: #f1ecdb; border-radius: 6px; min-height: 36px; padding: 5px 3px; font-size: .8rem; }
.preset-bar button:hover { background: #e6dfc5; }
.preset-bar button[aria-pressed='true'] { background: var(--teal); color: #fff6de; border-color: var(--teal); }
.field { padding: 8px 0; border-top: 1px solid var(--line); }
.field-top label { font-size: .9rem; font-weight: 700; }
.number { display: flex; align-items: center; color: var(--muted); gap: 4px; font: .82rem var(--mono); }
.number input { width: 3.55rem; text-align: right; padding: 5px 6px; min-height: 33px; border-radius: 5px; border: 1px solid #a9aa94; color: var(--ink); background: #fffdf5; }
.number input[aria-invalid='true'] { border-color: #a33a24; }
.error { color: #9a301c; font-size: .78rem; line-height: 1.5; margin-top: 5px; }
.pivot-field output { color: var(--ink); font: 700 .86rem var(--mono); }
input[type='range'] { margin: 5px 0 0; width: 100%; height: 27px; accent-color: #245b49; cursor: ew-resize; }
.weights { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.mass .field-top { flex-wrap: wrap; }
.readout { margin-top: 7px; border-radius: 9px; background: #ece6d0; padding: 12px; }
.readout h3 { font-size: .88rem; }
.readout h3 small { font-weight: 400; color: var(--muted); margin-left: 3px; }
#tendency { font-size: .78rem; color: #7c341e; text-align: right; }
#tendency[data-state='right'], #tendency[data-state='level'], #tendency[data-state='empty'] { color: #215b49; }
.amount { margin: 6px 0 9px; font: .87rem var(--mono); white-space: nowrap; }
.amount strong { font-size: clamp(1.75rem, 3.5vw, 2.55rem); line-height: 1; letter-spacing: -.06em; }
.moments { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin: 0; }
.moments div { border-top: 1px solid #c1baa0; padding-top: 6px; }
.moments dt, .moments dd { margin: 0; font-size: .78rem; }
.moments dd { font: 700 .85rem var(--mono); margin-top: 4px; }
.hint { margin-top: 9px; color: var(--muted); line-height: 1.5; font-size: .79rem; }
.below { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(310px, 1fr); gap: 16px; margin: 16px 0 20px; }
.below section { border: 1px solid var(--line); border-radius: 12px; padding: 16px 20px; }
.below p { color: var(--muted); font-size: .87rem; line-height: 1.6; margin-top: 6px; }
.export { background: #e8e8d6; }
.export-title > span { font: 700 .9rem var(--mono); }
.confirm { display: flex; align-items: center; gap: 8px; min-height: 34px; font-size: .82rem; }
.confirm input { width: 16px; height: 16px; accent-color: var(--teal); }
.export-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; }
.export-actions button { background: var(--teal); color: #fff9e7; border: 1px solid var(--teal); border-radius: 6px; padding: 7px 12px; min-height: 37px; font-weight: 700; font-size: .86rem; }
.export-actions button:hover { background: #225a4f; }
.export-actions button[aria-disabled='true'] { opacity: .72; cursor: wait; }
.export-actions span { color: var(--muted); font-size: .76rem; }
#export-status:empty { display: none; }
#export-status[data-error='true'] { color: #8b311e; }
footer { border-top: 1px solid var(--line); color: var(--muted); font-size: .75rem; padding: 12px 0 18px; }
@media (max-width: 760px) {
  .intro { align-items: start; flex-direction: column; gap: 10px; margin: 24px 0 18px; }
  .bench, .below { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .plate { padding: 13px; }
  .plate-head { padding-bottom: 8px; }
  .controls, .below section { padding: 15px; }
  .below { margin-top: 12px; }
}
