:root {
  color-scheme: light;
  --paper: #efede3;
  --card: #f9f7ee;
  --ink: #202521;
  --muted: #53594e;
  --rule: #c4c3b6;
  --mono: 'Cascadia Mono', 'Consolas', monospace;
  font-family: 'Microsoft YaHei', 'PingFang SC', system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; }
p, h1, h2, h3, figure { margin: 0; }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
button:disabled { cursor: not-allowed; }
:focus-visible { outline: 3px solid #7554a5; outline-offset: 4px; }
code, output { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.shell { max-width: 1352px; padding: 0 clamp(14px, 5vw, 74px); margin: auto; }
.skip { position: fixed; z-index: 1; top: 8px; left: 10px; transform: translateY(-150%); background: white; color: var(--ink); padding: 10px; }
.skip:focus { transform: none; }
.mast { display: flex; align-items: center; justify-content: space-between; min-height: 68px; border-bottom: 1px solid var(--rule); gap: 8px; }
.brand, .mast-mode { display: flex; align-items: center; gap: 9px; }
.brand { font-size: .85rem; font-weight: 700; }
.mast-mode { font-size: .76rem; color: var(--muted); white-space: nowrap; }
.mast-mode span { width: 9px; height: 9px; border: 1px solid #3e5d49; background: #b2cc9f; border-radius: 50%; }
.hero { display: flex; align-items: end; justify-content: space-between; padding: 29px 0 26px; gap: 20px; }
.eyebrow { font: 700 .75rem/1.4 var(--mono); letter-spacing: .13em; color: #505849; }
h1 { margin-top: 4px; font-size: clamp(2.6rem, 5.55vw, 5.25rem); line-height: 1.12; letter-spacing: -.055em; font-weight: 800; }
h1 span { color: #a44232; margin-left: .07em; }
.intro { max-width: 365px; font-size: .94rem; line-height: 1.65; color: var(--muted); padding-bottom: 5px; }
.workspace { display: grid; grid-template-columns: minmax(0, 1.62fr) minmax(320px, 1fr); gap: clamp(12px,2vw,25px); align-items: stretch; }
.stage { display: flex; flex-direction: column; min-width: 0; color: #f8f5e8; background: #171d1b; border: 1px solid #171d1b; border-radius: 11px; overflow: hidden; }
.stage-head { display: flex; align-items: center; gap: 10px; justify-content: space-between; padding: 16px 20px 13px; border-bottom: 1px solid #3e4943; }
.stage-head h2, .panel h2 { font-size: 1rem; font-weight: 800; }
.stage-head > span { color: #bec8be; font: .73rem var(--mono); letter-spacing: .06em; white-space: nowrap; }
#beam-canvas { width: 100%; height: auto; display: block; flex: 1; min-height: 0; object-fit: contain; background: #101613; }
.stage-readout { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 4px 12px; min-height: 48px; padding: 8px 20px; border-top: 1px solid #3e4943; font-size: .82rem; }
.stage-readout > span { display: flex; align-items: center; gap: 9px; }
.stage-readout code { font-size: .78rem; color: #e2e6dc; }
#area-dot { display: inline-block; width: 13px; height: 13px; border-radius: 2px; border: 1px solid #aeb9ac; background: #e078b0; }
.areas { padding: 0 18px 15px; display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); gap: 5px; }
.areas button { min-height: 36px; padding: 1px; font: .74rem var(--mono); background: #232c27; border: 1px solid #56665d; color: #edf3e9; border-radius: 4px; }
.areas button:hover { background: #374339; }
.areas button[aria-pressed=true] { color: #151a16; background: #ddedca; border-color: #ddedca; font-weight: 700; }
.areas button:focus-visible { outline-color: #ead3ff; outline-offset: 2px; }
.panel { min-width: 0; background: var(--card); border: 1px solid var(--rule); border-radius: 11px; padding: 13px clamp(13px,1.65vw,24px) 15px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; gap: 8px; }
.flat { border: 0; background: none; color: #3a493d; text-decoration: underline; text-underline-offset: 3px; padding: 6px 0; min-height: 32px; font-size: .75rem; }
.controls { display: grid; gap: 8px; }
.channel { --channel: #b64433; }
.channel.green { --channel: #287650; }
.channel.blue { --channel: #5053a8; }
.channel > div { display: flex; align-items: center; justify-content: space-between; }
.channel label { color: var(--channel); font: 800 .94rem var(--mono); }
.channel label span { font: 700 .79rem 'Microsoft YaHei', system-ui, sans-serif; margin-left: .15em; }
.channel output { font-weight: 700; font-size: .9rem; }
.channel input { appearance: none; width: 100%; margin: 3px 0 0; height: 22px; display: block; background: transparent; cursor: pointer; }
.channel input::-webkit-slider-runnable-track { height: 5px; background: #d7d9cf; border-radius: 4px; }
.channel input::-webkit-slider-thumb { appearance: none; width: 17px; height: 17px; margin-top: -6px; border: 2px solid var(--card); border-radius: 50%; background: var(--channel); box-shadow: 0 0 0 1px var(--channel); }
.channel input::-moz-range-track { height: 5px; background: #d7d9cf; border-radius: 4px; }
.channel input::-moz-range-thumb { width: 13px; height: 13px; border: 2px solid var(--card); border-radius: 50%; background: var(--channel); box-shadow: 0 0 0 1px var(--channel); }
.goal-control { display: grid; grid-template-columns: auto minmax(0,1fr); align-items: center; gap: 10px; margin: 10px 0; font-size: .79rem; font-weight: 700; }
.goal-control select { width: 100%; min-height: 35px; padding: 5px 7px; border: 1px solid #92958a; border-radius: 5px; background: #fffdf6; color: var(--ink); }
.comparison { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.sample { border: 1px solid #abaea1; border-radius: 5px; overflow: hidden; min-width: 0; }
.sample canvas { width: 100%; height: 40px; display: block; }
.sample div { display: flex; justify-content: space-between; gap: 4px; padding: 5px 7px; font-size: .75rem; white-space: nowrap; background: #fffdf6; }
.difference { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 5px; margin-top: 9px; }
.difference p { font-size: .74rem; white-space: nowrap; }
.difference strong { font: 700 1.45rem var(--mono); vertical-align: middle; margin-right: 2px; }
#deltas { display: flex; gap: 3px; flex-wrap: wrap; }
#deltas code { white-space: nowrap; background: #e8e9dc; border-radius: 3px; padding: 3px 4px; font-size: .72rem; }
.metric { color: var(--muted); font-size: .71rem; margin-top: 4px; line-height: 1.55; }
.science { display: flex; gap: 12px; align-items: baseline; margin: 14px 0 23px; color: #434c3e; font-size: .8rem; line-height: 1.6; border-left: 3px solid #7e9168; padding: 5px 10px; }
.science strong { white-space: nowrap; }
.downloads { padding: 22px 0 13px; border-top: 1px solid var(--rule); }
.downloads h2 { font-size: 1.65rem; margin: 3px 0 6px; }
.downloads header > p:last-child, .products article > p { font-size: .86rem; line-height: 1.6; color: var(--muted); }
.products { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.products article { border: 1px solid var(--rule); background: var(--card); border-radius: 6px; padding: 13px; }
.products article div { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; }
.products article h3 { font-size: 1rem; }
.products article strong { font: 700 .9rem var(--mono); }
.products article p { margin: 7px 0 11px; }
.download { min-height: 38px; padding: 6px 10px; border-radius: 4px; background: #dfeacb; border: 1px solid #70845d; color: #222c1d; font-size: .81rem; font-weight: 700; }
.download:hover:not(:disabled) { background: #c8dcad; }
.download:disabled { background: #e8e8de; color: #55594e; border-color: #a7aa9c; }
.confirm { display: flex; gap: 8px; align-items: start; margin: 12px 0; font-size: .82rem; line-height: 1.5; cursor: pointer; }
.confirm input { flex: 0 0 auto; margin: 1px 0 0; width: 17px; height: 17px; accent-color: #476836; }
.status { min-height: 1.7em; font-size: .85rem; line-height: 1.55; margin-top: 8px; }
.status[data-error=true] { color: #903e30; }
.foot { border-top: 1px solid var(--rule); padding: 13px 0 22px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px 15px; font-size: .75rem; color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 760px) {
  .hero { display: grid; gap: 9px; padding-block: 19px 17px; }
  .intro { padding: 0; }
  .workspace { grid-template-columns: minmax(0,1fr); }
  .science { display: block; }
  .science p { margin-top: 3px; }
}
@media (max-width: 460px) {
  .mast { min-height: 56px; }
  .hero h1 { font-size: 2.72rem; }
  .hero .intro { font-size: .84rem; }
  .stage-head, .stage-readout { padding-inline: 10px; }
  .areas { padding-inline: 8px; }
  .areas button { font-size: .66rem; }
  .products { grid-template-columns: minmax(0,1fr); }
}
