:root {
  color-scheme: light;
  --paper: #f7f5eb;
  --ink: #192a27;
  --muted: #426057;
  --teal: #12675c;
  --rule: #b9c9b5;
  --white: #fffdf6;
  --dark: #102d29;
  --mint: #a0eed0;
  --orange: #ffb175;
  --sans: system-ui, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --serif: Georgia, "Songti SC", "STSong", SimSun, "Noto Serif CJK SC", serif;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { background: var(--paper); margin: 0; color: var(--ink); font: 1rem/1.65 var(--sans); }
.shell { width: min(100% - 2rem, 71rem); margin-inline: auto; }
a { color: var(--teal); text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible, button:focus-visible, summary:focus-visible, h3:focus-visible { outline: 3px solid #238071; outline-offset: 3px; }
.skip { position: absolute; top: 6px; left: 8px; z-index: 1; padding: 8px; background: var(--white); transform: translateY(-200%); }
.skip:focus { transform: none; }
.mast { min-height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 8px; border-bottom: 1px solid var(--rule); }
.brand { display: flex; align-items: center; gap: .55rem; font-weight: 800; color: var(--ink); text-decoration: none; }
.brand-mark { display: grid; place-items: center; background: var(--teal); color: white; width: 1.85rem; height: 1.85rem; border-radius: 50%; font: 1.35rem/1 var(--serif); }
.languages { display: flex; align-items: center; gap: .6rem; font-size: .88rem; }
.languages a { display: inline-flex; align-items: center; min-height: 44px; padding-inline: 4px; }
.languages [aria-current] { color: var(--ink); text-decoration: none; font-weight: 800; }
.hero { padding: clamp(1.75rem, 5vw, 4.7rem) 0 clamp(1.6rem, 3.7vw, 3.6rem); }
.stamp, .eyebrow, .chapter { margin: 0 0 .45rem; color: var(--teal); font-weight: 800; font-size: .78rem; letter-spacing: .06em; }
.stamp { display: flex; align-items: center; gap: .5rem; }
.stamp span { background: var(--teal); width: .5rem; height: .5rem; border-radius: 50%; }
h1, h2 { font-family: var(--serif); line-height: 1.06; letter-spacing: -.037em; margin: 0; }
h1 { font-size: clamp(2.3rem, 6.3vw, 5.7rem); max-width: 13ch; }
html[lang="zh-CN"] h1 { max-width: 17em; }
h1 em { display: block; color: var(--teal); font-style: normal; }
.verdict { margin: 1rem 0 .35rem; color: #24574c; font-size: clamp(1.12rem, 2.6vw, 1.48rem); font-weight: 800; line-height: 1.38; }
.lead { max-width: 65ch; margin: 0; color: var(--muted); }
.hero-links { margin-top: 1rem; display: flex; align-items: center; flex-wrap: wrap; gap: .4rem 1.1rem; }
.hero-links > a { display: inline-flex; align-items: center; min-height: 44px; font-size: .9rem; }
button { font: inherit; color: inherit; cursor: pointer; min-width: 0; }
.primary { background: var(--teal); color: white; text-decoration: none; border-radius: .48rem; border: 1px solid var(--teal); display: inline-flex; align-items: center; justify-content: space-between; gap: .6rem; min-height: 44px; padding: .4rem .85rem; font-weight: 750; line-height: 1.3; }
.primary:hover { background: #0d594e; }
.experiment { border-top: 2px solid var(--teal); scroll-margin-top: 1rem; }
.lab-head { padding: 1rem 0 .85rem; }
h2 { font-size: clamp(1.8rem, 4.1vw, 3.45rem); }
.lab-head > p:last-child, .reading > p:not(.eyebrow) { margin: .45rem 0 0; color: var(--muted); }
.step-nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--rule); border: 1px solid var(--rule); border-radius: .6rem .6rem 0 0; }
.step-nav button { border: 0; padding: .44rem .35rem; min-height: 51px; line-height: 1.15; font-size: clamp(.75rem, 2.8vw, .98rem); background: #edeede; }
.step-nav button:first-child { border-radius: .53rem 0 0 0; }
.step-nav button:last-child { border-radius: 0 .53rem 0 0; }
.step-nav button[aria-current] { background: var(--white); color: #11584d; font-weight: 780; box-shadow: inset 0 -3px var(--teal); }
.step-nav b { display: inline-block; margin-right: .4rem; font-size: .72rem; font-variant-numeric: tabular-nums; color: var(--muted); }
.workbench { display: grid; background: var(--white); border: 1px solid var(--rule); border-top: 0; border-radius: 0 0 .65rem .65rem; }
.plot { margin: 0; padding: .55rem .65rem .65rem; overflow: hidden; background: var(--dark); color: #e3f0e7; }
.plot svg { display: block; width: min(100%, 41rem); margin: 0 auto; }
.strip { fill: #173a33; }
.grid { stroke: #5f8074; stroke-width: 1; fill: none; }
.line { stroke: #8af0ca; stroke-width: 2.5; }
.plot-text { fill: #d1e2d7; font: 20px var(--sans); }
.zeros { fill: var(--mint); }
.selected { fill: none; stroke: #fffdf6; stroke-width: 2.1; }
.candidate { fill: #39261b; stroke: var(--orange); stroke-width: 3; }
.plot figcaption { color: #d1e2d7; margin: .2rem 0; font-size: .8rem; text-align: center; }
.coordinate { margin: .45rem auto 0; padding: .35rem .5rem; background: #1d4038; text-align: center; border-radius: .26rem; font-size: clamp(.76rem, 2.9vw, .95rem); font-variant-numeric: tabular-nums; }
.coordinate strong { display: block; color: white; }
.console { padding: clamp(.85rem, 2vw, 1.5rem); }
.console h3, .evidence-grid h3 { margin: 0; font-size: clamp(1.25rem, 2.5vw, 1.6rem); line-height: 1.18; }
.console p:not(.chapter) { margin: .5rem 0 .75rem; }
.buttons { display: grid; gap: .45rem; margin-top: .7rem; }
.two { grid-template-columns: repeat(2, 1fr); }
.three { grid-template-columns: repeat(3, 1fr); }
.buttons button { min-height: 44px; padding: .4rem .25rem; border: 1px solid #849c8d; background: #f0f5e9; color: #173c34; border-radius: .38rem; font-weight: 700; font-size: .85rem; line-height: 1.28; }
.buttons button:not(:disabled):hover { border-color: var(--teal); background: #e0efdc; }
.buttons button:disabled { opacity: .58; cursor: default; }
.buttons button[aria-pressed="true"] { background: #deeee2; border-color: var(--teal); box-shadow: inset 0 0 0 1px var(--teal); }
.choices button { text-align: left; padding: .45rem .65rem; }
.forward { width: 100%; margin-top: .6rem; }
.feedback:not(:empty) { border-left: 3px solid var(--teal); padding: .5rem .65rem; background: #edf4e9; font-size: .9rem; }
.feedback.orange:not(:empty), .feedback[data-result="finite"]:not(:empty) { border-color: #984819; background: #faeddb; color: #682e12; }
.finish { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0 .75rem; font-size: .88rem; }
.finish a { display: inline-flex; align-items: center; min-height: 44px; }
.finish button { min-height: 44px; padding: 0; border: 0; background: none; color: var(--teal); text-decoration: underline; text-underline-offset: .18em; }
.reading { margin-top: clamp(2.1rem, 5vw, 4rem); scroll-margin-top: 1rem; }
.evidence-grid { display: grid; gap: .75rem; margin-top: 1rem; }
.evidence-grid section { padding: .95rem; background: var(--white); border-top: 2px solid var(--teal); }
.evidence-grid section > span { color: var(--teal); font-weight: 900; letter-spacing: .07em; font-size: .8rem; }
.evidence-grid h3 { margin-top: .3rem; font-size: 1.18rem; }
.evidence-grid section p { margin: .52rem 0 0; }
.faq h2 { margin-bottom: .85rem; }
.faq details { border-top: 1px solid var(--rule); }
.faq details:last-child { border-bottom: 1px solid var(--rule); }
.faq summary { min-height: 44px; padding: .65rem 0; cursor: pointer; font-weight: 760; }
.faq details p { max-width: 70ch; margin: .05rem 0 .9rem; }
.source { border-top: 1px solid var(--rule); margin-top: 2rem; padding: 1rem 0 1.5rem; color: var(--muted); font-size: .87rem; }
.source div { display: flex; flex-wrap: wrap; gap: 0 1rem; }
.source a { min-height: 44px; display: inline-flex; align-items: center; }
.source p { margin: 0; }
@media (min-width: 720px) {
  .shell { width: min(100% - 4rem, 71rem); }
  .workbench { grid-template-columns: minmax(0, 1.42fr) minmax(0, 1fr); }
  .plot { border-radius: 0 0 0 .57rem; min-height: 100%; }
  .evidence-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 380px) {
  .shell { width: calc(100% - 1.4rem); }
  .step-nav b { display: block; margin: 0 0 .18rem; }
  .plot-text { font-size: 22px; }
}

.explanation > p { max-width: 72ch; }
.explanation > p:not(.eyebrow) { margin-top: .75rem; }

/* Keep the answer and the interactive diagram together before the long read. */
.lead-layout { padding-top: clamp(1.2rem, 3.7vw, 3.3rem); min-width: 0; }
.mast { min-height: 54px; }
.hero { min-width: 0; padding: 0; }
.hero h1 { font-size: clamp(2.24rem, 5.6vw, 4.65rem); }
html[lang="en"] .hero h1 { max-width: 15ch; }
.hero .lead { max-width: 56ch; font-size: .92rem; line-height: 1.52; }
.hero .verdict { margin-top: .68rem; font-size: clamp(1.04rem, 2.2vw, 1.34rem); line-height: 1.32; }
.status { margin: .75rem 0 0; border-top: 1px solid var(--rule); text-align: left; }
.status > div { display: grid; grid-template-columns: 7em minmax(0, 1fr); gap: .6rem; align-items: baseline; border-bottom: 1px solid var(--rule); padding: .32rem 0; font-size: .82rem; line-height: 1.36; }
.status dt { font-weight: 820; color: var(--teal); }
.status div:nth-child(2) dt { color: #804615; }
.status dd { margin: 0; }
.source-time { color: var(--muted); font-size: .76rem; margin: .48rem 0 0; }
.source-time time { white-space: nowrap; }
.hero-links { margin: .05rem 0 0; }
.hero-links > a { min-height: 44px; font-size: .82rem; gap: .3rem; }
.experiment { min-width: 0; margin-top: .25rem; }
.lab-head { padding-block: .7rem .6rem; }
.lab-head h2 { font-size: clamp(1.55rem, 3.35vw, 2.65rem); line-height: 1.1; }
.lab-head p:last-child { font-size: .88rem; line-height: 1.43; }
.step-nav button { min-height: 44px; }
.workbench { grid-template-columns: minmax(0, 1fr); }
.plot { border-radius: 0; min-height: 0; }
.console { padding-block: .8rem 1rem; }
.proof-bridge { border: 1px solid #90b39e; background: #f0f6eb; border-radius: .38rem; padding: .57rem .68rem; margin: .45rem 0; }
.proof-bridge h4 { margin: 0; line-height: 1.3; }
.console .proof-bridge p { margin: .3rem 0 0; font-size: .91rem; }
.arithmetic { padding: .8rem 1rem; margin-top: .9rem; border-left: 2px solid var(--teal); background: #e9eee2; }
.arithmetic h3 { margin: 0; line-height: 1.3; font-size: 1.13rem; }
.arithmetic p { margin: .4rem 0 0; max-width: 88ch; }
@media (max-width: 759px) {
  .hero h1 em { display: inline; }
  html[lang="en"] .hero h1 { max-width: 22ch; }
  .hero .verdict { font-size: 1.01rem; }
  .status > div { grid-template-columns: 5.9em minmax(0, 1fr); gap: .35rem; }
  html[lang="zh-CN"] .status > div { grid-template-columns: 4.82em minmax(0, 1fr); }
}
@media (min-width: 760px) {
  .lead-layout { display: grid; grid-template-columns: minmax(0, .94fr) minmax(0, 1.06fr); align-items: start; gap: clamp(1.1rem, 4vw, 3.5rem); }
  .hero h1 { font-size: clamp(2.48rem, 5.35vw, 4.65rem); }
  .experiment { margin-top: 0; }
  .status { margin-top: 1rem; }
  .status > div { padding-block: .5rem; }
  .plot { padding: .4rem .65rem .55rem; }
}
.workbench { border-top: 1px solid var(--rule); border-radius: .65rem; }
.workbench .plot { border-radius: .57rem .57rem 0 0; }
.workbench .step-nav,
.workbench .step-nav button { border-radius: 0; }
.workbench .step-nav { border-inline: 0; }
@media (max-width: 759px) {
  html[lang="zh-CN"] .hero h1 em { display: block; }
}
