:root {
  color-scheme: dark;
  --bg: #0c141d;
  --panel: #111e2a;
  --raised: #162635;
  --line: #304253;
  --text: #f2f7fa;
  --soft: #bdcbd6;
  --muted: #a1b5c4;
  --accent: #85e8d5;
  --accent-ink: #062a26;
  --warm: #edc29d;
  --header: 68px;
  --subnav: 55px;
  --gutter: clamp(1rem, 5vw, 5rem);
  --radius: 12px;
  font-family: "Segoe UI", "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif;
  font-synthesis: none;
}
* { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--header) + var(--subnav) + 12px); }
body { margin: 0; min-width: 0; background: var(--bg); color: var(--text); font-size: 1rem; line-height: 1.65; }
button, select { font: inherit; }
a { color: var(--accent); text-underline-offset: .24em; }
button, select, summary { cursor: pointer; }
:where(a, button, summary, select, [tabindex]):focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
:where(h1, h2, h3, h4, p, ol, ul, dl) { margin: 0; }
h1, h2, h3, h4 { font-weight: 600; line-height: 1.15; }
p { overflow-wrap: anywhere; }
[hidden] { display: none !important; }
.wrap { width: min(100% - 2 * var(--gutter), 1240px); margin-inline: auto; }
.visually-hidden { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: fixed; z-index: 10; inset: .5rem auto auto .75rem; transform: translateY(-160%); background: var(--text); color: var(--bg); padding: .6rem 1rem; border-radius: 6px; }
.skip:focus { transform: none; }
.topbar { position: sticky; top: 0; z-index: 5; background: var(--bg); border-bottom: 1px solid var(--line); }
.topbar-inner, .footer .wrap { display: flex; min-height: var(--header); align-items: center; justify-content: space-between; gap: .65rem; }
.wordmark, .top-actions { display: flex; align-items: center; gap: clamp(.5rem, 2vw, 1.25rem); }
.wordmark { min-height: 44px; font-size: 1rem; letter-spacing: -.02em; font-weight: 700; color: var(--text); text-decoration: none; }
.mark { display: inline-flex; align-items: end; gap: 3px; height: 21px; rotate: -12deg; }
.mark i { display: block; width: 3px; border-radius: 1px; background: var(--accent); height: 11px; }
.mark i:nth-child(2) { height: 16px; }
.mark i:nth-child(3) { height: 21px; }
.language { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; white-space: nowrap; }
.action { display: inline-flex; align-items: center; justify-content: center; gap: .65rem; min-height: 44px; padding: .5rem .9rem; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); color: var(--text); line-height: 1.3; font-weight: 600; font-size: .9rem; text-decoration: none; text-align: center; transition: transform 150ms, border-color 150ms, background 150ms; }
.action:hover { transform: translateY(-2px); border-color: var(--accent); }
.action:active { transform: translateY(0); }
.action:disabled { opacity: .55; cursor: default; transform: none; }
.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.primary:hover { background: #b7f5e9; }
.desktop-nav { position: sticky; top: var(--header); z-index: 4; background: var(--panel); border-bottom: 1px solid var(--line); }
.desktop-nav ol, .mobile-nav ol { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: 0; list-style: none; }
.desktop-nav a, .mobile-nav a { display: flex; align-items: center; gap: .36rem; min-height: calc(var(--subnav) - 1px); border-bottom: 2px solid transparent; color: var(--soft); text-decoration: none; font-size: .9rem; line-height: 1.2; }
.desktop-nav a span, .mobile-nav a span { color: var(--muted); font-family: ui-monospace, Consolas, monospace; font-size: .75rem; }
nav a:hover, nav a[aria-current] { color: var(--accent); border-color: var(--accent); }
.mobile-nav { display: none; }
.chapter { border-bottom: 1px solid var(--line); }
.hero-grid { display: grid; grid-template-columns: minmax(0, .93fr) minmax(0, 1fr); align-items: center; column-gap: clamp(2rem, 6vw, 7rem); row-gap: 2.4rem; min-height: min(47rem, calc(100svh - var(--header) - var(--subnav))); padding-block: clamp(2.75rem, 6vh, 5rem) 2.25rem; }
.hero-copy { animation: enter 650ms ease-out both; }
@keyframes enter { from { transform: translateY(8px); } to { transform: none; } }
.eyebrow, .dates, .snapshot-top, .chapter-number, .section-date { color: var(--accent); font-family: ui-monospace, Consolas, "Microsoft JhengHei", monospace; font-size: .84rem; font-weight: 600; letter-spacing: .045em; }
.eyebrow { display: flex; align-items: center; gap: .6rem; }
.pulse { width: .52rem; height: .52rem; background: var(--accent); border-radius: 50%; }
.hero-copy h1 { margin-top: 1.1rem; font-size: clamp(2.85rem, 5.25vw, 5.15rem); letter-spacing: -.062em; line-height: 1.02; text-wrap: balance; }
html[lang="zh-TW"] .hero-copy h1 { letter-spacing: -.045em; }
.hero-lead { margin-top: 1.25rem; max-width: 43ch; color: var(--soft); font-size: clamp(1rem, 1.48vw, 1.2rem); }
.hero-finding { color: var(--text); margin-top: .8rem; max-width: 47ch; font-size: .94rem; }
.dates { color: var(--muted); margin: .9rem 0 1.45rem; letter-spacing: .01em; }
.hero-copy .action { width: fit-content; }
.hero-visual { position: relative; display: grid; align-items: center; min-width: 0; min-height: 23rem; border: 1px solid #375566; border-radius: var(--radius); padding: clamp(1rem, 3vw, 3rem); background-color: #122a37; background-image: linear-gradient(132deg, #103041a0, #172a350a), repeating-linear-gradient(90deg, transparent 0 23px, #a2e7ee13 23px 24px), repeating-linear-gradient(0deg, transparent 0 23px, #a2e7ee13 23px 24px); }
.frame { padding: clamp(.85rem, 2vw, 1.45rem); border: 1px solid #466575; border-radius: var(--radius); background: #101d29; box-shadow: 0 16px 36px #030a11a8; }
.snapshot-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .3rem 1rem; color: var(--muted); }
.snapshot h2 { margin-top: .55rem; font-size: clamp(1.2rem, 2.3vw, 1.8rem); }
.surface-list { display: grid; gap: .85rem; list-style: none; margin: 1rem 0 0; padding: 0; }
.surface-list li div:first-child { display: flex; justify-content: space-between; gap: .4rem; font-weight: 600; font-size: .92rem; }
.surface-list strong { font-variant-numeric: tabular-nums; }
.surface-list small, .snapshot-note { color: var(--muted); font-size: .8rem; line-height: 1.3; }
.sample-bar { display: flex; overflow: hidden; height: .36rem; margin-block: .2rem .15rem; border-radius: 3px; background: #2b3e4e; }
.sample-bar span { width: var(--share); background: var(--accent); }
.sample-bar span + span { background: #689cb3; }
.result-bars { display: grid; gap: .75rem; margin: 0; padding: 0; list-style: none; }
.result-bars li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .32rem .7rem; align-items: center; }
.result-bars .sample-bar { grid-column: 1 / -1; }
.result-bars strong { color: var(--accent); font-family: ui-monospace, Consolas, monospace; }
.snapshot-note { margin-top: 1rem; }
.facts { display: grid; grid-column: 1 / -1; grid-template-columns: repeat(4, minmax(0, 1fr)); border-block: 1px solid var(--line); }
.facts div { display: flex; flex-direction: column-reverse; justify-content: start; align-items: start; gap: .35rem; min-width: 0; padding: .8rem 1rem .9rem; }
.facts div + div { border-inline-start: 1px solid var(--line); }
.facts dt { color: var(--soft); font-size: .86rem; }
.facts dd { margin: 0; font-family: ui-monospace, Consolas, monospace; color: var(--accent); font-size: clamp(1.25rem, 3vw, 2.55rem); font-variant-numeric: tabular-nums; font-weight: 700; line-height: 1.1; letter-spacing: -.055em; }
.overview-context { display: grid; gap: 1.5rem; grid-template-columns: repeat(2, minmax(0, 1fr)); padding-block: 1.75rem clamp(3rem, 7vw, 6rem); }
.overview-context .evidence { grid-column: 1 / -1; }
.chapter:nth-child(even) { background: #0f1822; }
.chapter-layout { display: grid; grid-template-columns: minmax(0, .72fr) minmax(0, 1.4fr); gap: clamp(2rem, 6vw, 6rem); padding-block: clamp(3.5rem, 8vw, 7rem); }
.chapter-heading { align-self: start; }
.chapter-number { color: var(--muted); margin-bottom: .8rem; }
.chapter-number span { color: var(--accent); }
.chapter-heading h2 { font-size: clamp(2.25rem, 4vw, 4rem); letter-spacing: -.055em; text-wrap: balance; }
.chapter-lead { color: var(--soft); max-width: 35ch; margin-top: 1.05rem; font-size: 1.08rem; }
.chapter-content { display: grid; align-content: start; min-width: 0; gap: 1.5rem; }
.research-block, .study-panel { display: grid; gap: .85rem; min-width: 0; }
.research-block h3, .study-panel h3, .evidence h3 { font-size: clamp(1.17rem, 2.2vw, 1.6rem); letter-spacing: -.026em; }
.research-block p, .study-panel p, .evidence dd { color: var(--soft); }
.study-panel { padding: clamp(.75rem, 2vw, 1.4rem); border: 1px solid var(--line); background: var(--panel); border-radius: var(--radius); }
.table-scroll { min-width: 0; overflow: auto; border: 1px solid var(--line); border-radius: 6px; }
table { border-collapse: collapse; width: 100%; text-align: start; font-size: .92rem; color: var(--soft); }
:where(th, td) { padding: .62rem .72rem; text-align: start; vertical-align: top; overflow-wrap: anywhere; }
th { color: var(--text); font-weight: 600; }
thead { background: var(--raised); }
tbody tr + tr { border-top: 1px solid var(--line); }
td { font-variant-numeric: tabular-nums; }
.picker label { color: var(--soft); display: block; margin-bottom: .2rem; }
.picker select { min-height: 44px; max-width: 100%; padding: .35rem .6rem; border: 1px solid #547287; border-radius: 6px; background: var(--raised); color: var(--text); }
.picker h4, .two-up h4 { margin: .7rem 0 .55rem; font-size: 1rem; }
.two-up { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.line-chart { width: 100%; color: var(--muted); }
.line-chart text { fill: currentColor; font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
.chart-table summary { min-height: 44px; color: var(--accent); display: flex; align-items: center; gap: .6rem; }
.chart-table .table-scroll { max-height: 340px; }
.evidence { border-top: 1px solid var(--line); padding-top: 1.25rem; }
.evidence h3 { margin-bottom: .65rem; }
.evidence-item, .diagram, .diagram-text { border-bottom: 1px solid var(--line); }
:where(.evidence-item,.diagram,.diagram-text) summary { display: flex; align-items: center; gap: .65rem; min-height: 48px; padding: .5rem .2rem; list-style: none; color: var(--accent); }
:where(.evidence-item,.diagram,.diagram-text,.chart-table) summary::before { content: "+"; font-family: ui-monospace, Consolas, monospace; font-weight: 700; }
:where(.evidence-item,.diagram,.diagram-text,.chart-table)[open] summary::before { content: "−"; }
summary::-webkit-details-marker { display: none; }
summary small { color: var(--muted); margin-inline-start: auto; text-align: end; font-size: .78rem; line-height: 1.2; }
.evidence dl { display: grid; gap: .65rem; padding: .35rem .25rem 1rem; }
.evidence dl div { display: grid; grid-template-columns: minmax(5rem, .35fr) 1fr; gap: .35rem .7rem; }
.evidence dd { margin: 0; }
.evidence dt { font-weight: 600; }
.source-link { display: inline-flex; align-items: center; min-height: 44px; margin-bottom: .35rem; }
.diagram { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.diagram > summary { padding-inline: .85rem; }
.diagram-content { padding: .5rem .7rem .85rem; }
.diagram iframe { display: block; width: 100%; height: clamp(24rem, 63vh, 42rem); border: 1px solid var(--line); border-radius: 6px; background: #0b141b; }
.diagram-status { margin: .5rem 0; color: var(--soft); }
.diagram-text { padding-bottom: .45rem; }
.diagram-text .research-block + .research-block { margin-top: 1rem; }
.footer { color: var(--muted); }
.footer .wrap { min-height: 100px; }
.presentation-toolbar { background: var(--panel); border-top: 1px solid var(--line); }
.toolbar-inner, .step-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.toolbar-inner { padding-block: .6rem; }
.chapter-count { margin-right: .6rem; color: var(--accent); font-family: ui-monospace, Consolas, monospace; font-weight: 700; }
.shortcuts { margin-left: auto; color: var(--muted); font-size: .85rem; }
.is-presenting { height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.is-presenting :is(.desktop-nav, .mobile-nav, .footer) { display: none; }
.is-presenting main { display: flex; flex: 1; min-height: 0; flex-direction: column; }
.is-presenting article { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; }
.is-presenting .chapter { min-height: 100%; }
.is-presenting .hero-grid { min-height: auto; }
.system-page main { padding-block: 6rem; }
.system-page h1 { margin-bottom: 2rem; }

@media (max-width: 1050px) {
  .desktop-nav a { font-size: .78rem; }
  .desktop-nav a span { display: none; }
}
@media (max-width: 810px) {
  :root { --header: 63px; --subnav: 48px; }
  .desktop-nav { display: none; }
  .mobile-nav { display: block; position: sticky; top: var(--header); z-index: 4; background: var(--panel); border-bottom: 1px solid var(--line); }
  .mobile-nav summary { display: flex; align-items: center; gap: .5rem; min-height: calc(var(--subnav) - 1px); padding-inline: var(--gutter); color: var(--accent); list-style: none; font-weight: 600; }
  .mobile-nav summary::before { content: "☰"; }
  .mobile-nav[open] summary::before { content: "×"; }
  .mobile-nav nav { padding: .1rem var(--gutter) .7rem; max-height: 65vh; overflow-y: auto; }
  .mobile-nav ol { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mobile-nav a { min-height: 44px; }
  .hero-grid { gap: 1.5rem; }
  .hero-visual { min-height: 20rem; }
  .chapter-layout { gap: 1.75rem; }
  .shortcuts { display: none; }
}
@media (max-width: 640px) {
  .hero-grid, .chapter-layout, .overview-context { grid-template-columns: minmax(0, 1fr); }
  .hero-grid { min-height: auto; padding-top: 2.5rem; }
  .hero-lead { max-width: 100%; }
  .hero-visual { min-height: auto; order: 1; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .facts div:nth-child(3) { border-inline-start: 0; }
  .facts div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .chapter-layout { padding-block: 3rem; }
  .chapter-lead { max-width: 100%; }
  .two-up { grid-template-columns: minmax(0, 1fr); }
  .line-chart text { font-size: 18px; }
}
@media (max-width: 385px) {
  .topbar-inner { gap: .4rem; }
  .wordmark { gap: .4rem; font-size: .91rem; }
  .top-actions { gap: .4rem; }
  .language, .mode-button { font-size: .77rem; }
  .mode-button { padding-inline: .38rem; }
  .fullscreen { font-size: .77rem; padding-inline: .4rem; }
  .evidence dl div { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
@media print {
  :root { color-scheme: light; --bg: #fff; --panel: #fff; --raised: #eee; --line: #999; --text: #111; --soft: #222; --muted: #333; --accent: #154341; }
  body.is-presenting { height: auto; display: block; overflow: visible; }
  .is-presenting article, .is-presenting main { display: block; overflow: visible; }
  .is-presenting .chapter[hidden] { display: block !important; }
  :is(.topbar, .desktop-nav, .mobile-nav, .presentation-toolbar, .action, .skip, .diagram iframe, .picker select, .picker label) { display: none !important; }
  .hero-grid, .chapter-layout, .overview-context { display: block; min-height: auto; padding: .6rem 0; }
  .hero-visual, .frame { background: white; box-shadow: none; min-height: 0; margin-bottom: .8rem; }
  .hero-copy h1, .chapter-heading h2 { font-size: 28pt; }
  .research-block, .study-panel, .evidence { margin-top: 1rem; }
  .chapter:nth-child(even) { background: white; }
  details::details-content { content-visibility: visible; height: auto; }
  .picker [data-option][hidden] { display: block !important; }
  .chart-table .table-scroll { max-height: none; }
  .evidence-item, .research-block, .study-panel { break-inside: avoid-page; }
}
