:root {
  color-scheme: light;
  --surface: #fcfcfb;
  --surface-2: #f3f2ef;
  --rule: #e2e0db;
  --grid: #e8e6e1;
  --ink: #141413;
  --ink-2: #52514e;
  --ink-3: #7a7974;
  --accent: #2a78d6;
  --series-1: #2a78d6;
  --ref: #9a988f;
  --good: #1a7f37;
  --bad: #c0392b;
  --warn: #a16207;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC", "WenQuanYi Zen Hei", sans-serif;
  --serif: Charter, "Iowan Old Style", Georgia, "Songti SC", "Noto Serif CJK SC", "Source Han Serif SC", "Songti TC", serif;
  --serif-zh: "Songti SC", "Noto Serif CJK SC", "Source Han Serif SC", "STSong", "SimSun", Georgia, serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --surface: #161615; --surface-2: #1f1f1d; --rule: #33332f; --grid: #2b2b28;
    --ink: #f4f3ef; --ink-2: #c3c2b7; --ink-3: #8f8e86;
    --accent: #5598e7; --series-1: #3987e5; --ref: #77756d;
    --good: #4cb36b; --bad: #e66767; --warn: #d39a2c;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --surface: #161615; --surface-2: #1f1f1d; --rule: #33332f; --grid: #2b2b28;
  --ink: #f4f3ef; --ink-2: #c3c2b7; --ink-3: #8f8e86;
  --accent: #5598e7; --series-1: #3987e5; --ref: #77756d;
  --good: #4cb36b; --bad: #e66767; --warn: #d39a2c;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--surface); color: var(--ink); font: 15px/1.55 var(--sans); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }

/* header / nav */
header.top { border-bottom: 1px solid var(--rule); background: var(--surface); position: sticky; top: 0; z-index: 5; }
header.top .wrap { display: flex; align-items: center; gap: 8px 24px; min-height: 52px; flex-wrap: wrap; }
.brand { font-weight: 650; letter-spacing: -0.01em; color: var(--ink); }
.brand small { font-weight: 400; color: var(--ink-3); margin-left: 6px; }
nav { display: flex; gap: 18px; flex-wrap: wrap; font-size: 14px; }
nav a { color: var(--ink-2); padding: 14px 0; border-bottom: 2px solid transparent; }
nav a.on { color: var(--ink); border-bottom-color: var(--ink); }
nav a:hover { text-decoration: none; color: var(--ink); }

.banner { background: #fff4d6; color: #5c4400; border-bottom: 1px solid #ecd9a0; font-size: 13px; padding: 8px 0; }
:root[data-theme="dark"] .banner { background: #3a3014; color: #f1dc9a; border-color: #5a4a1c; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .banner { background: #3a3014; color: #f1dc9a; border-color: #5a4a1c; } }

main { padding: 36px 0 64px; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.015em; }
h1 { font-family: var(--serif); font-weight: 600; font-size: clamp(28px, 4.2vw, 40px); margin: 0 0 8px; }
h2 { font-size: 20px; margin: 44px 0 14px; padding-top: 10px; border-top: 1px solid var(--rule); }
h3 { font-size: 16px; margin: 22px 0 8px; }
.eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-3); margin-bottom: 8px; }
.lede { font-family: var(--serif); font-size: 18px; color: var(--ink-2); max-width: 760px; margin: 0; }
.muted { color: var(--ink-3); }
.small { font-size: 13px; }
.mono { font-family: var(--mono); font-size: 12.5px; }


/* grids & cards */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 760px) { .grid2, .grid3 { grid-template-columns: 1fr; } }
.card { border: 1px solid var(--rule); border-radius: 10px; padding: 16px 18px; background: var(--surface); min-width: 0; }
.card h3 { margin-top: 0; }

/* hypothesis strip */
.hstrip { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.hstrip > * { min-width: 0; }
@media (max-width: 860px) { .hstrip { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .hstrip { grid-template-columns: minmax(0, 1fr); } }
.hcell { border: 1px solid var(--rule); border-radius: 8px; padding: 12px; }
.hcell .hid { font-family: var(--mono); font-size: 12px; color: var(--ink-3); }
.hcell .hname { font-weight: 600; margin: 2px 0 8px; }
.hcell.h0 { border-style: dashed; }
.tally { display: flex; gap: 10px; font-size: 13px; }

/* status marks: icon + label, never color alone */
.st { white-space: nowrap; font-size: 13px; }
.st.sup { color: var(--good); }
.st.cha { color: var(--bad); }
.st.pen { color: var(--ink-3); }

/* tables */
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--rule); vertical-align: top; }
th { font-weight: 600; color: var(--ink-2); font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }
td.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
td.nowrap { white-space: nowrap; }
.tablewrap { overflow-x: auto; }

/* claims */
.claim { padding: 10px 0; border-bottom: 1px solid var(--rule); }
.claim .meta { font-size: 12px; color: var(--ink-3); font-family: var(--mono); }
.tag { display: inline-block; font-family: var(--mono); font-size: 11px; padding: 1px 6px; border-radius: 4px; border: 1px solid var(--rule); color: var(--ink-2); }
.withheld { font-style: italic; color: var(--ink-3); }
a.cite { font-family: var(--mono); font-size: 11.5px; }

/* charts */
.chartcard { border: 1px solid var(--rule); border-radius: 10px; padding: 14px 16px 10px; position: relative; min-width: 0; }
.chartcard .title { font-weight: 600; font-size: 14px; }
.chartcard .sub { font-size: 12px; color: var(--ink-3); }
.chartcard .meta { font-size: 11.5px; color: var(--ink-3); margin-top: 6px; border-top: 1px solid var(--rule); padding-top: 6px; overflow-wrap: anywhere; }
svg.chart { width: 100%; height: auto; display: block; margin-top: 8px; overflow: visible; }
svg.chart .grid { stroke: var(--grid); stroke-width: 1; }
svg.chart .ref { stroke: var(--ref); stroke-width: 1; }
svg.chart .series { fill: none; stroke: var(--series-1); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
svg.chart .end { fill: var(--series-1); stroke: var(--surface); stroke-width: 2; }
svg.chart .tick { fill: var(--ink-3); font-size: 11px; font-family: var(--sans); }
svg.chart .endlabel { fill: var(--ink); font-size: 12px; font-weight: 600; font-family: var(--sans); }
svg.chart .cross { stroke: var(--ink-3); stroke-width: 1; }
.tip { position: absolute; pointer-events: none; background: var(--ink); color: var(--surface); font-size: 12px; padding: 4px 8px; border-radius: 6px; white-space: nowrap; transform: translate(-50%, -120%); z-index: 3; }

/* memo */
.memo { font-family: var(--serif); font-size: 17px; line-height: 1.65; }
.memo > *:not(.tablewrap):not(table) { max-width: 720px; }
.memo h2, .memo h3 { font-family: var(--sans); }
.memo table { font-family: var(--sans); }

/* timeline */
.timeline { border-left: 2px solid var(--rule); margin-left: 6px; padding-left: 20px; }
.tl-item { position: relative; margin-bottom: 28px; }
.tl-item::before { content: ""; position: absolute; left: -27px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--ink-2); }
.tl-item.base::before { background: var(--ink); }
.diff { display: inline-block; font-family: var(--mono); font-size: 13px; }

.evalbadge { display: inline-flex; flex-wrap: wrap; gap: 2px 8px; align-items: center; font-size: 13px; border: 1px solid var(--rule); border-radius: 14px; padding: 4px 12px; max-width: 100%; }
.evalbadge > span { white-space: nowrap; }
footer { border-top: 1px solid var(--rule); padding: 20px 0 40px; font-size: 12.5px; color: var(--ink-3); }
.empty { padding: 18px; border: 1px dashed var(--rule); border-radius: 10px; color: var(--ink-2); }

/* overview: two layers */
.intro { max-width: 760px; color: var(--ink-2); margin: 10px 0 0; }
.why { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--rule); }
.why p { margin: 6px 0; font-size: 14px; }
a.hcell { color: inherit; text-decoration: none; }
a.hcell:hover { border-color: var(--ink-3); }
.rel { padding: 8px 0 4px; border-bottom: 1px solid var(--rule); }
.rel ul { margin: 6px 0 8px; padding-left: 18px; }
.audit-list { list-style: none; margin: 0; padding: 0; font-size: 13.5px; }
.audit-list li { padding: 7px 0; border-bottom: 1px solid var(--rule); }
.audit-list li.next { color: var(--ink-3); }
.legend { display: flex; flex-direction: column; gap: 4px; margin-top: 16px; color: var(--ink-2); }
.tl-item.amend::before { border-style: dashed; }
.tl-item.data::before { width: 8px; height: 8px; left: -25px; top: 8px; }
.tl-item.next::before { border-color: var(--rule); }
@media (max-width: 760px) {
    nav { gap: 14px; }
}

/* ===================== V1.1: bilingual product layer ===================== */
.skip { position: absolute; left: -9999px; top: 0; background: var(--ink); color: var(--surface); padding: 8px 12px; z-index: 20; }
.skip:focus { left: 8px; top: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* language switch: 中文 | EN */
.lang { margin-left: auto; display: flex; align-items: center; gap: 8px; font-size: 14px; }
.lang .cur { font-weight: 650; color: var(--ink); }
.lang a { color: var(--ink-2); padding: 6px 2px; }
.lang .sep { color: var(--rule); }
@media (max-width: 760px) {
  header.top .wrap { gap: 0 16px; }
  .brand { order: 1; padding: 10px 0; }
  .lang { order: 2; }
  nav { order: 3; flex-basis: 100%; gap: 4px 16px; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 2px; -webkit-overflow-scrolling: touch; }
  nav a { padding: 8px 0; white-space: nowrap; }
}

/* home: the answer first */
.hero h1 { margin-bottom: 16px; }
.viewcard { border: 1px solid var(--rule); border-left: 4px solid var(--accent); border-radius: 10px; padding: 20px 22px; background: var(--surface-2); }
.viewcard .headline { font-family: var(--serif); font-size: clamp(19px, 2.6vw, 24px); line-height: 1.35; font-weight: 600; margin: 0 0 10px; }
.viewcard .viewbody { margin: 0 0 12px; color: var(--ink-2); max-width: 78ch; }
.policyline { margin: 0; padding-top: 12px; border-top: 1px solid var(--rule); font-size: 14px; }
.stale { color: var(--warn); margin: 10px 0 0; }
.keyfigs { display: grid; grid-template-columns: 1.6fr repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.fig { border: 1px solid var(--rule); border-radius: 10px; padding: 12px 14px; min-width: 0; }
.fig .label { font-size: 12px; color: var(--ink-3); }
.fig .value { font-size: 24px; font-weight: 650; line-height: 1.2; margin-top: 2px; overflow-wrap: anywhere; }
.fig .value.sm { font-size: 14px; font-weight: 550; line-height: 1.35; }
.hero-fig .value { font-size: 52px; line-height: 1; font-variant-numeric: proportional-nums; }
.fignote { font-size: 12px; color: var(--ink-2); margin-top: 8px; line-height: 1.4; }
@media (max-width: 900px) { .keyfigs { grid-template-columns: 1fr 1fr; } .hero-fig { grid-column: 1 / -1; } }

/* hypothesis states */
.pill { display: inline-flex; gap: 5px; align-items: baseline; font-size: 12.5px; font-weight: 600; padding: 2px 10px; border-radius: 14px; border: 1px solid currentColor; line-height: 1.4; max-width: 100%; }
.tone-good .pill, .pill.tone-good { color: var(--good); }
.tone-warn .pill, .pill.tone-warn { color: var(--warn); }
.tone-bad .pill, .pill.tone-bad { color: var(--bad); }
.tone-alt .pill, .pill.tone-alt { color: var(--ink-2); border-style: dashed; }
.hcell { display: flex; flex-direction: column; gap: 4px; }
.hcell .hstate { margin: 2px 0 4px; }
.hcell .hnote { color: var(--ink-2); }
.hcell.tone-good { border-left: 3px solid var(--good); } .hcell.tone-warn { border-left: 3px solid var(--warn); }
.hcell.tone-bad { border-left: 3px solid var(--bad); } .hcell.tone-alt { border-left: 3px dashed var(--ink-3); }
.hstateline { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 6px 0; }

/* claims: plain-language provenance first, technical lineage on request */
.claim-text { margin: 4px 0 6px; }
.prov { font-size: 12.5px; color: var(--ink-3); display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.prov-line { color: var(--ink-2); }
.prov .more { white-space: nowrap; }
.lens { margin-bottom: 2px; }
.lens-tag { text-transform: uppercase; letter-spacing: 0.06em; font-size: 10.5px; color: var(--accent); border-color: var(--accent); }
details.lineage { margin-top: 6px; font-size: 12.5px; }
details.lineage > summary { cursor: pointer; color: var(--ink-3); list-style-position: inside; }
details.lineage > summary:hover { color: var(--ink); }
details.lineage dl { margin: 8px 0 4px; display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 14px; }
details.lineage dt { color: var(--ink-3); }
details.lineage dd { margin: 0; overflow-wrap: anywhere; }
details.lineage .ref { margin-bottom: 6px; }
details.lineage pre { overflow-x: auto; background: var(--surface-2); padding: 10px; border-radius: 8px; margin: 8px 0 0; }
details.inline { display: inline-block; }
@media (max-width: 560px) { details.lineage dl { grid-template-columns: 1fr; } details.lineage dt { margin-top: 6px; } }
sup.cite a { font-size: 11px; font-family: var(--sans); padding: 0 1px; }

.note { border-left: 3px solid var(--ink-3); background: var(--surface-2); padding: 10px 14px; border-radius: 0 8px 8px 0; font-size: 14px; }
.callout { background: var(--surface-2); border-radius: 8px; padding: 10px 14px; }
.tally { margin: 8px 0 0; }

/* policy context */
table.layers th[scope="row"] { white-space: normal; width: 22%; }
.event { border: 1px solid var(--rule); border-radius: 10px; padding: 16px 18px; margin: 16px 0; }
.event h3 { margin: 2px 0 8px; font-size: 17px; }
.scope { margin: 0 0 10px; }
.scope-before_baseline .tag, .scope-after_baseline .tag { border-style: dashed; }
ol.stages { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; padding: 0; font-size: 12px; }
ol.stages li { padding: 3px 10px; border-radius: 999px; border: 1px solid var(--rule); color: var(--ink-3); }
ol.stages li.done { color: var(--ink); border-color: var(--ink-3); }
ol.stages li.current { background: var(--ink); color: var(--surface); border-color: var(--ink); font-weight: 600; }
dl.eventdl { display: grid; grid-template-columns: 11em minmax(0, 1fr); gap: 8px 16px; margin: 0 0 8px; font-size: 14px; }
dl.eventdl dt { color: var(--ink-3); } dl.eventdl dd { margin: 0; }
@media (max-width: 640px) { dl.eventdl { grid-template-columns: 1fr; gap: 2px; } dl.eventdl dd { margin-bottom: 8px; } }

/* terminal rules in words */
.card.rule { margin: 14px 0; }
ul.rtree, ul.rtree ul { list-style: none; padding-left: 18px; margin: 6px 0; }
ul.rtree { padding-left: 0; }
ul.rtree li { margin: 6px 0; }
.rt { display: flex; gap: 8px; align-items: baseline; }
.mark { font-weight: 700; width: 1.2em; flex: none; }
.mark.ok { color: var(--good); } .mark.no { color: var(--bad); } .mark.pen { color: var(--ink-3); }

/* scenario matrix */
table.scenarios th, table.scenarios td { vertical-align: top; min-width: 11em; font-size: 13px; }
table.scenarios th[scope="row"] { min-width: 7em; background: var(--surface-2); }

/* data sources */
ul.sources { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 0 0 8px; padding: 0; font-size: 14px; }
.src .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; background: var(--good); }
.src.private_pending .dot { background: transparent; border: 2px solid var(--warn); box-sizing: border-box; }
.src.private_pending { color: var(--ink-2); }
.system .intro { margin-bottom: 18px; }
.evalline { margin: 16px 0; }

/* memo */
.memo-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.printbtn { font: inherit; font-size: 13px; padding: 6px 12px; border: 1px solid var(--rule); border-radius: 8px; background: var(--surface); color: var(--ink-2); cursor: pointer; }
.printbtn:hover { border-color: var(--ink-3); color: var(--ink); }
.printonly { display: none; }
.memo table.scenarios { font-family: var(--sans); }
.memo .tablewrap { margin: 16px 0; }
ol.refs { padding-left: 0; list-style-position: inside; font-size: 13.5px; }
ol.refs li { padding: 8px 0; border-bottom: 1px solid var(--rule); }
.memo-refs { max-width: 720px; }

/* root language selector */
body.selector { display: grid; min-height: 100vh; place-items: center; }
.choose { text-align: left; max-width: 640px; padding-top: 40px; padding-bottom: 40px; }
.choose h1 { margin: 10px 0 16px; }
.brandline { font-weight: 650; color: var(--ink-2); }
.choices { display: flex; gap: 12px; margin-top: 28px; }
.btn { display: inline-block; padding: 12px 28px; border: 1px solid var(--ink); border-radius: 10px; color: var(--ink); font-size: 17px; font-weight: 600; }
.btn:hover { background: var(--ink); color: var(--surface); text-decoration: none; }

/* Chinese typography */
html[lang="zh-Hans"] body { line-height: 1.75; }
html[lang="zh-Hans"] h1, html[lang="zh-Hans"] h2, html[lang="zh-Hans"] h3 { letter-spacing: 0; line-height: 1.35; }
html[lang="zh-Hans"] h1 { font-family: var(--serif-zh); }
html[lang="zh-Hans"] .eyebrow { text-transform: none; letter-spacing: 0.04em; }
html[lang="zh-Hans"] th { text-transform: none; letter-spacing: 0; font-size: 12.5px; }
html[lang="zh-Hans"] .lens-tag { text-transform: none; letter-spacing: 0.02em; }
html[lang="zh-Hans"] .viewcard .headline, html[lang="zh-Hans"] .lede, html[lang="zh-Hans"] .memo { font-family: var(--serif-zh); }
html[lang="zh-Hans"] .memo { font-size: 16.5px; line-height: 1.9; }
html[lang="zh-Hans"] .small, html[lang="zh-Hans"] .prov { line-height: 1.65; }

/* long strings never widen the page */
.claim, .card, .event, .rel, .chartcard, td, th { overflow-wrap: anywhere; }
.mono { overflow-wrap: anywhere; }
img, svg { max-width: 100%; }

/* print: the Deep Dive reads like a note, not a web page */
@page { size: A4; margin: 18mm 16mm; }
@media print {
  :root { --surface: #fff; --surface-2: #fff; --ink: #000; --ink-2: #222; --ink-3: #555; --rule: #bbb; --accent: #000; }
  body { font-size: 11pt; background: #fff; }
  header.top, footer .wrap > p + p, nav, .lang, .skip, .printbtn, .banner, details.lineage > summary { display: none !important; }
  header.top { position: static; }
  main { padding: 0; }
  .wrap { max-width: none; padding: 0; }
  .printonly { display: block; }
  .memo { max-width: none; font-size: 11pt; line-height: 1.55; }
  .memo h2 { break-after: avoid; margin-top: 18pt; }
  .memo p, .memo li { orphans: 3; widows: 3; }
  .memo table, .memo tr, .memo-refs li { break-inside: avoid; }
  .tablewrap { overflow: visible; }
  table.scenarios th, table.scenarios td { min-width: 0; font-size: 9pt; }
  details.lineage > *:not(summary) { display: none !important; }
  a { color: #000; text-decoration: none; }
  a[href^="http"]::after { content: none; }
  sup.cite a { color: #000; }
  html[lang="zh-Hans"] .memo { font-size: 10.5pt; line-height: 1.8; }
}

/* anchored sections land below the sticky header (taller on phones, where the nav has its own row) */
[id] { scroll-margin-top: 72px; }
@media (max-width: 760px) { [id] { scroll-margin-top: 112px; } }
