:root {
  color-scheme: light;
  --paper: #f4f0e5;
  --warm: #fbf8ef;
  --ink: #233c30;
  --muted: #526052;
  --line: #c9cabb;
  --accent: #87401f;
  --forest: #152a22;
  --light: #f4ebdb;
  --mono: 'Cascadia Mono', Consolas, monospace;
  --serif: Georgia, 'Songti SC', SimSun, serif;
  font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
  color: var(--ink);
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; }
body { margin: 0; }
.wrap { width: min(1320px, calc(100% - 96px)); margin-inline: auto; }
h1, h2, p, dl, dd { margin: 0; }
[hidden] { display: none !important; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
:focus-visible { outline: 3px solid #a74822; outline-offset: 3px; }
.plot :focus-visible { outline-color: #ffd0a1; }
.sr-only, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip:focus { position: fixed; z-index: 2; inset: 12px auto auto 12px; padding: 12px; background: var(--warm); color: var(--ink); }
.mast { border-bottom: 1px solid var(--line); }
.mast-inner { display: flex; align-items: center; gap: 12px; min-height: 70px; }
.mast strong { font-size: 16px; letter-spacing: .08em; display: block; }
.mast span { font: 10px/1.35 var(--mono); letter-spacing: .15em; color: var(--muted); display: block; }
.mast p { margin-left: auto; color: var(--muted); letter-spacing: .14em; font-size: 12px; }
.intro { padding: 34px 0 26px; }
.eyebrow { font: 600 11px/1.5 var(--mono); letter-spacing: .14em; color: var(--accent); }
.intro h1 { font: 700 clamp(32px, 4.1vw, 58px)/1.2 var(--serif); letter-spacing: .025em; margin: 9px 0 11px; }
.intro > p:last-child, .export > div > p:not(.eyebrow) { color: var(--muted); font-size: 14px; line-height: 1.7; }
.workbench { display: grid; grid-template-columns: minmax(0, 1fr) minmax(278px, 304px); gap: 14px; align-items: stretch; }
.plot { min-width: 0; background: var(--forest); color: var(--light); border-radius: 17px; padding: 22px 24px 0; }
.plot-head, .transport { display: flex; align-items: end; justify-content: space-between; gap: 12px; }
.plot .eyebrow { color: #afc8b4; }
h2 { font: 700 25px/1.35 var(--serif); letter-spacing: .045em; margin-top: 3px; }
.time { font: 12px/1.5 var(--mono); color: #bccfbf; white-space: nowrap; padding-bottom: 3px; }
.time span { color: #f8d2a4; }
.screen { margin-top: 13px; border: 1px solid #496457; border-radius: 8px; background: #192e25; overflow: hidden; }
.screen svg { width: 100%; height: auto; display: block; }
.axes { fill: none; stroke: #809885; stroke-width: 1.2; }
.plot-ticks { fill: #c6d6c7; font: 12px var(--mono); }
.transport { align-items: center; padding: 12px 0; }
.transport-actions, .export-actions, .presets { display: flex; flex-wrap: wrap; gap: 7px; }
.transport button, .export-actions button, .presets button, .reset { border: 1px solid; border-radius: 6px; min-height: 42px; padding: 0 13px; font-size: 13px; font-weight: 650; }
.transport button { color: #f4ebdb; background: transparent; border-color: #698075; }
.transport button:hover:not(:disabled) { background: #2b4538; }
#play { color: #283124; background: #ffc58b; border-color: #ffc58b; min-width: 100px; }
#play:hover:not(:disabled) { background: #ffdbb6; }
.transport button:disabled { opacity: .57; }
.transport > p { color: #bbcbbc; font-size: 11px; white-space: nowrap; }
.transport i { vertical-align: 1px; display: inline-block; width: 8px; height: 8px; border-radius: 50%; border: 1px solid #f5d395; }
.transport i + i { margin-left: 5px; background: #ffd9a6; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid #4c6255; }
.stats div { padding: 11px 12px 16px; border-left: 1px solid #4c6255; }
.stats div:first-child { border-left: 0; padding-left: 0; }
.stats dt { color: #bdcfc2; font-size: 11px; line-height: 1.5; }
.stats dd { margin-top: 4px; color: #fae5c8; font: 500 clamp(16px, 2.15vw, 24px)/1.2 var(--mono); }
.controls { background: var(--warm); border: 1px solid var(--line); border-radius: 17px; padding: 22px 19px 17px; min-width: 0; }
.presets { margin: 13px 0 15px; gap: 6px; }
.presets button { flex: 1; padding-inline: 6px; color: var(--ink); background: transparent; border-color: var(--line); white-space: nowrap; }
.presets button:hover, .reset:hover { background: #e8edde; }
.presets button[aria-pressed='true'] { background: #e3eadc; border-color: #758d75; }
.setting { display: grid; grid-template-columns: minmax(0, 1fr) 70px; align-items: center; column-gap: 7px; border-top: 1px solid #dfded1; padding: 9px 0 8px; }
.setting label { font-size: 13px; font-weight: 650; }
.setting label span { color: var(--muted); font: 11px var(--mono); }
.setting input[type='number'] { min-width: 0; width: 100%; height: 32px; padding: 4px 5px; border: 1px solid #969e8c; border-radius: 5px; background: #fffdf7; color: var(--ink); font: 13px var(--mono); }
.setting input[aria-invalid='true'] { border: 2px solid #a23b24; }
.setting input[type='range'] { grid-column: 1 / -1; margin: 5px 0 0; min-width: 0; width: 100%; height: 24px; accent-color: #4e7259; cursor: pointer; }
.bounds { grid-column: 1 / -1; display: flex; justify-content: space-between; color: var(--muted); font: 10px var(--mono); }
.error { grid-column: 1 / -1; margin-top: 5px; color: #a23b24; font-size: 12px; }
.reset { width: 100%; color: var(--ink); background: transparent; border-color: #a0a997; margin-top: 8px; }
.export { margin-top: 14px; border: 1px solid var(--line); border-radius: 14px; padding: 18px 23px; display: flex; justify-content: space-between; gap: 16px; align-items: center; background: #eee9da; }
.export h2 { margin-bottom: 4px; }
.export h2 span { display: inline-block; font: 700 16px var(--mono); color: var(--accent); margin-left: 5px; }
.export-actions { justify-content: flex-end; }
.export-actions button { background: var(--ink); color: var(--warm); border-color: var(--ink); }
.export-actions button:hover:not(:disabled) { background: #395849; }
.export-actions button:disabled { color: #555f53; background: #e1e1d4; border-color: #aab1a1; }
.export-tools { flex: 0 1 350px; text-align: right; }
.export-tools #message { margin-top: 5px; font-size: 12px; }
.model-notes { color: var(--muted); font-size: 13px; line-height: 1.8; padding: 12px 5px 23px; }
.model-notes summary { cursor: pointer; width: fit-content; color: var(--ink); padding-block: 6px; }
.model-notes p { margin: 4px 0 0; overflow-wrap: anywhere; }
@media (max-width: 980px) { .wrap { width: calc(100% - 54px); } }
@media (max-width: 760px) {
  .wrap { width: calc(100% - 32px); }
  .mast-inner { min-height: 61px; }
  .intro { padding: 24px 0 19px; }
  .workbench { grid-template-columns: minmax(0, 1fr); }
  .plot { padding: 15px 13px 0; border-radius: 13px; }
  .screen svg { min-height: 167px; }
  .controls { padding: 15px; }
  .export { flex-direction: column; align-items: stretch; padding: 15px; }
  .export-tools { flex: unset; text-align: left; }
  .export-actions { justify-content: flex-start; }
}
@media (max-width: 375px) {
  h2 { font-size: 22px; }
  .wrap { width: calc(100% - 24px); }
  .transport { gap: 4px; }
  .transport button { padding-inline: 7px; }
  #play { min-width: 81px; }
  .transport > p { font-size: 10px; }
  .stats div { padding-right: 2px; padding-left: 7px; }
}
