:root {
  color-scheme: light;
  --page: #f9f9f7;
  --surface: #fcfcfb;
  --surface-2: #f2f1ed;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --muted: #898781;
  --grid: #e1e0d9;
  --axis: #c3c2b7;
  --border: rgba(11, 11, 11, 0.10);
  --accent: #2a78d6;
  --s-baseline: #2a78d6;
  --s-new: #eb6834;
  --s-refiner: #1baf7a;
  --s-ref: #898781;
  --warn-bg: #fff6e0;
  --warn-ink: #5c4300;
  --best: #0b0b0b;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --page: #0d0d0d;
    --surface: #1a1a19;
    --surface-2: #232321;
    --ink: #f0efec;
    --ink-2: #c3c2b7;
    --muted: #898781;
    --grid: #2c2c2a;
    --axis: #383835;
    --border: rgba(255, 255, 255, 0.10);
    --accent: #3987e5;
    --s-baseline: #3987e5;
    --s-new: #d95926;
    --s-refiner: #199e70;
    --s-ref: #898781;
    --warn-bg: #2b2414;
    --warn-ink: #f0d9a0;
    --best: #ffffff;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0d0d0d; --surface: #1a1a19; --surface-2: #232321; --ink: #f0efec; --ink-2: #c3c2b7;
  --muted: #898781; --grid: #2c2c2a; --axis: #383835; --border: rgba(255, 255, 255, 0.10);
  --accent: #3987e5; --s-baseline: #3987e5; --s-new: #d95926; --s-refiner: #199e70; --s-ref: #898781;
  --warn-bg: #2b2414; --warn-ink: #f0d9a0; --best: #ffffff;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--page); color: var(--ink);
  font: 15px/1.6 system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 16px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font: 0.9em ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.hero { border-bottom: 1px solid var(--border); background: var(--surface); padding: 40px 0 20px; }
.eyebrow { margin: 0; color: var(--muted); font-size: 13px; letter-spacing: .04em; text-transform: uppercase; }
h1 { margin: 6px 0 8px; font-size: clamp(26px, 4vw, 38px); line-height: 1.15; letter-spacing: -0.01em; }
.lede { margin: 0; max-width: 820px; color: var(--ink-2); }
.meta { margin: 10px 0 0; color: var(--muted); font-size: 13px; }
.toc { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 18px; font-size: 14px; }
.toc a { color: var(--ink-2); }

section { padding: 36px 0 8px; }
.section-head h2 { margin: 0; font-size: 22px; }
.sub { margin: 4px 0 14px; color: var(--ink-2); font-size: 14px; }
h3 { font-size: 16px; margin: 0 0 8px; }

.callout { margin-top: 24px; padding: 16px 20px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.callout ul { margin: 0; padding-left: 20px; }
.callout li { margin: 4px 0; }

.controls { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin: 0 0 12px; font-size: 14px; }
.controls label { display: inline-flex; gap: 6px; align-items: center; color: var(--ink-2); }
select, .btn, .seg button {
  font: inherit; font-size: 14px; color: var(--ink); background: var(--surface);
  border: 1px solid var(--border); border-radius: 8px; padding: 5px 10px; cursor: pointer;
}
select { max-width: 230px; }
.btn:hover, .seg button:hover { background: var(--surface-2); }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 9px; overflow: hidden; }
.seg button { border: 0; border-radius: 0; }
.seg button + button { border-left: 1px solid var(--border); }
.seg button[aria-selected="true"], .seg button[aria-pressed="true"] { background: var(--ink); color: var(--surface); }
.hint { color: var(--muted); font-size: 13px; }

.stage { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 10px; }
.wipe { position: relative; width: 100%; aspect-ratio: 1272 / 720; overflow: hidden; border-radius: 6px; cursor: ew-resize; touch-action: none; user-select: none; background: #000; outline: none; }
.wipe:focus-visible { box-shadow: 0 0 0 3px var(--accent); }
.wipe img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; image-rendering: auto; -webkit-user-drag: none; pointer-events: none; }
.divider { position: absolute; top: 0; bottom: 0; width: 2px; background: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.35); transform: translateX(-1px); pointer-events: none; }
.knob { position: absolute; top: 50%; left: 50%; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.knob::before { content: "‹ ›"; position: absolute; inset: 0; display: grid; place-items: center; font-size: 14px; color: #222; letter-spacing: 2px; }
.tag { position: absolute; top: 10px; padding: 3px 9px; font-size: 13px; border-radius: 6px; background: rgba(0,0,0,.62); color: #fff; pointer-events: none; max-width: 45%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tag-a { left: 10px; } .tag-b { right: 10px; }

.vgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.vgrid figure { margin: 0; }
.vgrid video { width: 100%; aspect-ratio: 1272 / 720; background: #000; border-radius: 6px; display: block; }
.vgrid figcaption { font-size: 13px; color: var(--ink-2); margin-top: 4px; }

.zoom { display: grid; grid-template-columns: minmax(240px, 380px) 1fr; gap: 18px; margin-top: 18px; align-items: start; }
.ref-wrap { position: relative; cursor: crosshair; border-radius: 6px; overflow: hidden; }
.ref-wrap img { width: 100%; display: block; }
.marker { position: absolute; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.5); pointer-events: none; }
.inline { display: inline-flex; gap: 6px; align-items: center; margin-top: 8px; font-size: 14px; color: var(--ink-2); }
.zoom-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.crop { margin: 0; }
.crop div { width: 100%; aspect-ratio: 1; border-radius: 6px; background-repeat: no-repeat; image-rendering: pixelated; border: 1px solid var(--border); }
.crop figcaption { font-size: 12px; color: var(--ink-2); margin-top: 3px; line-height: 1.3; }
.crop .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; vertical-align: 1px; }

.chart-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 14px 6px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--ink-2); padding: 0 4px 6px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.scatter svg { width: 100%; height: auto; display: block; overflow: visible; }
.scatter .gridline { stroke: var(--grid); stroke-width: 1; }
.scatter .axis { stroke: var(--axis); stroke-width: 1; }
.scatter .tick { fill: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.scatter .axis-title { fill: var(--ink-2); font-size: 13px; }
.scatter .lbl { fill: var(--ink-2); font-size: 12px; }
.scatter .ref-line { stroke: var(--muted); stroke-dasharray: 4 4; stroke-width: 1; }
.scatter .ref-txt { fill: var(--muted); font-size: 12px; }
.scatter .pt { stroke: var(--surface); stroke-width: 2; cursor: default; }
.scatter .hit { fill: transparent; cursor: pointer; }

.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
table.data { border-collapse: collapse; width: 100%; font-size: 14px; font-variant-numeric: tabular-nums; }
table.data th, table.data td { padding: 8px 10px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--grid); }
table.data th:first-child, table.data td:first-child { text-align: left; position: sticky; left: 0; background: var(--surface); z-index: 1; }
table.data thead th { font-weight: 600; color: var(--ink-2); font-size: 13px; background: var(--surface); }
table.data thead tr.grp th { color: var(--muted); font-weight: 500; font-size: 12px; border-bottom: 0; padding-bottom: 0; text-align: center; }
table.data thead th.sortable { cursor: pointer; user-select: none; }
table.data thead th.sortable:hover { color: var(--ink); }
table.data thead th[aria-sort="ascending"]::after { content: " ▲"; font-size: 10px; }
table.data thead th[aria-sort="descending"]::after { content: " ▼"; font-size: 10px; }
table.data tbody tr:hover td { background: var(--surface-2); }
table.data td.best { font-weight: 700; color: var(--best); }
table.data tr.ref td { color: var(--muted); }
table.data td.left, table.data th.left { text-align: left; white-space: normal; min-width: 220px; }
.mname { display: inline-flex; align-items: center; gap: 7px; }
.mname i { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.pill { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 99px; border: 1px solid var(--border); color: var(--ink-2); margin-left: 6px; }

.warn { background: var(--warn-bg); color: var(--warn-ink); border-radius: 10px; padding: 10px 14px; margin-bottom: 12px; font-size: 14px; }
.note-card { margin-top: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 18px; }
.note-card ul, .notes-grid ul { margin: 0; padding-left: 20px; }
.note-card li, .notes-grid li { margin: 5px 0; font-size: 14px; }
.notes-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.notes-grid > div { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 18px; }

.tooltip { position: fixed; z-index: 10; pointer-events: none; background: var(--ink); color: var(--surface); font-size: 13px; padding: 7px 10px; border-radius: 8px; max-width: 280px; line-height: 1.45; box-shadow: 0 4px 14px rgba(0,0,0,.2); }
.foot { padding: 30px 16px 40px; color: var(--muted); font-size: 13px; }

@media (max-width: 760px) {
  .zoom, .notes-grid { grid-template-columns: 1fr; }
  .vgrid { grid-template-columns: 1fr; }
  select { max-width: 160px; }
}

/* efficiency: R0 section + collapsed legacy UDM10 timing table */
.eff-h3 { margin: 26px 0 4px; font-size: 18px; }
.eff-proto { margin-top: 8px; font-size: 13px; }
.r0-notes { margin: 10px 0 0; padding-left: 20px; font-size: 14px; color: var(--ink-2); }
.r0-notes li { margin: 4px 0; }
details.eff-old { margin-top: 22px; }
details.eff-old > summary { cursor: pointer; font-weight: 600; font-size: 15px; padding: 6px 0; }
details.eff-old[open] > summary { margin-bottom: 4px; }
.scatter .vlink { stroke-width: 1.5; opacity: .55; }
.scatter .leader { stroke: var(--muted); stroke-width: 1; }
.scatter .pt-v { fill: var(--surface); stroke-width: 2; }
.scatter .lbl-v { fill: var(--muted); }
.scatter-key { margin: 8px 0 0; padding: 0 4px 0 28px; font-size: 13px; color: var(--ink-2); columns: 2 220px; column-gap: 18px; }
.scatter-key li { margin: 2px 0; break-inside: avoid; }
.scatter-key i, .legend i.hollow { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 6px; vertical-align: -1px; }
.scatter-key i.hollow, .legend i.hollow { background: transparent; border: 2px solid; box-sizing: border-box; }
.legend .legend-note { color: var(--muted); }
