/* ==========================================================================
   科学梦之队 · AHSTU Future Scientists — main website
   Design system: "Scholarly Almanac" — paper, ink, navy plates, cinnabar
   ========================================================================== */
:root {
  --paper: #f3eee3;
  --paper-2: #ebe4d4;
  --card: #faf7f0;
  --ink: #14243a;
  --ink-2: #3a4a5e;
  --ink-3: #6b7686;
  --rule: #b7af9e;
  --rule-soft: rgba(20, 36, 58, .13);
  --navy: #0f1d33;
  --navy-2: #172a45;
  --cinnabar: #b5482a;
  --coral: #e8794f;
  --cream: #f1e8d6;
  --azure: #005aa8;
  --gold: #b88a3e;

  /* Display: Cormorant Garamond (Latin) + 思源宋体 Noto Serif SC (CJK)
     Text:    Source Serif 4 (Latin, optical sizes) + 思源宋体
     UI:      Instrument Sans · Labels: IBM Plex Mono */
  --f-display: "Cormorant Garamond", "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", serif;
  --f-serif: "Source Serif 4", "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", Georgia, serif;
  --f-sans: "Instrument Sans", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, "Microsoft YaHei", monospace;
  --wrap: 1320px;
  --gut: clamp(20px, 5vw, 72px);
  --ease: cubic-bezier(.16, 1, .3, 1);
}

html[data-lang="zh"] [data-l="en"], html[data-lang="en"] [data-l="zh"] { display: none !important; }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 110px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 16px/1.65 var(--f-sans);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  font-kerning: normal; font-feature-settings: "kern", "liga";
  overflow-x: hidden;
}
html[data-lang="zh"] body { line-height: 1.8; }
body::before { /* paper fibre */
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 999; opacity: .5; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='p'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .4 0 0 0 0 .3 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23p)'/%3E%3C/svg%3E");
}
img, canvas, svg { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
::selection { background: var(--navy); color: var(--cream); }
:focus-visible { outline: 2px solid var(--cinnabar); outline-offset: 3px; }

.wrap { max-width: calc(var(--wrap) + var(--gut) * 2); margin: 0 auto; padding: 0 var(--gut); }
.mono { font-family: var(--f-mono); }
.meta, .eyebrow { font: 500 11.5px/1.6 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.eyebrow { color: var(--cinnabar); }
html[data-lang="zh"] .meta, html[data-lang="zh"] .eyebrow { letter-spacing: .16em; }

/* ---------- reveal ---------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity 1s var(--ease), transform 1s var(--ease); transition-delay: var(--d, 0s); }
.reveal.in { opacity: 1; transform: none; }

/* ==========================================================================
   Masthead
   ========================================================================== */
.topbar { border-bottom: 1px solid var(--rule-soft); }
.topbar .wrap { display: flex; justify-content: space-between; align-items: center; gap: 16px; height: 38px; }
.topbar .meta { font-size: 10.5px; }
.topbar__right { display: flex; align-items: center; gap: 18px; }
.langsw { display: flex; align-items: center; gap: 2px; font: 500 11px var(--f-mono); letter-spacing: .1em; }
.langsw button { padding: 4px 8px; color: var(--ink-3); border-radius: 2px; transition: color .3s, background .3s; }
.langsw button:hover { color: var(--ink); }
html[data-lang="zh"] .langsw [data-set="zh"], html[data-lang="en"] .langsw [data-set="en"] { color: var(--paper); background: var(--ink); }
.langsw i { width: 1px; height: 12px; background: var(--rule); margin: 0 4px; }

.masthead { position: sticky; top: 0; z-index: 100; background: rgba(243, 238, 227, .9); backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3); transition: box-shadow .4s; }
.masthead .wrap { display: flex; align-items: center; justify-content: space-between; gap: 24px; height: 84px; }
.masthead::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 5px; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--ink); }
.masthead.is-scrolled { box-shadow: 0 14px 30px -24px rgba(20, 36, 58, .45); }
.brand { display: block; height: 58px; flex: none; transform-origin: left center; transition: transform .45s var(--ease); will-change: transform; }
.masthead.is-scrolled .brand { transform: scale(.84); }
.brand img { height: 100%; width: auto; }
.mnav { display: flex; align-items: center; gap: 4px; }
.mnav a { position: relative; text-decoration: none; padding: 8px 14px; font-size: 15px; font-weight: 500; color: var(--ink-2); transition: color .3s; }
.mnav a::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: 3px; height: 1.5px; background: var(--cinnabar); transform: scaleX(0); transform-origin: left; transition: transform .45s var(--ease); }
.mnav a:hover, .mnav a[aria-current="page"] { color: var(--ink); }
.mnav a:hover::after, .mnav a[aria-current="page"]::after { transform: scaleX(1); }
.mnav a.mnav__join { margin-left: 10px; color: var(--paper); background: var(--cinnabar); border-radius: 2px; padding: 9px 18px; }
.mnav a.mnav__join::after { display: none; }
.mnav a.mnav__join:hover { background: #9c3b20; color: #fff; }
.mburger { display: none; width: 42px; height: 42px; border: 1px solid var(--rule); border-radius: 2px; position: relative; }
.mburger span { position: absolute; left: 11px; right: 11px; height: 1.5px; background: var(--ink); transition: transform .4s var(--ease); }
.mburger span:first-child { top: 16px; } .mburger span:last-child { top: 24px; }
body.mnav-open .mburger span:first-child { transform: translateY(4px) rotate(45deg); }
body.mnav-open .mburger span:last-child { transform: translateY(-4px) rotate(-45deg); }

/* ==========================================================================
   Buttons & links
   ========================================================================== */
.btn { display: inline-flex; align-items: center; gap: 10px; height: 50px; padding: 0 24px; border-radius: 2px; font-weight: 600; font-size: 15px; text-decoration: none; transition: background .3s, color .3s, transform .4s var(--ease), box-shadow .4s; }
.btn--ink { background: var(--navy); color: var(--cream); box-shadow: 0 10px 24px -16px rgba(15, 29, 51, .9); }
.btn--ink:hover { background: var(--navy-2); transform: translateY(-2px); }
.btn--cinnabar { background: var(--cinnabar); color: #fff; }
.btn--cinnabar:hover { background: #9c3b20; transform: translateY(-2px); }
.btn--cream { background: var(--cream); color: var(--navy); }
.btn--cream:hover { background: #fff; transform: translateY(-2px); }
.tlink { font-weight: 600; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 6px; text-decoration-color: var(--rule); transition: text-decoration-color .3s, color .3s; }
.tlink:hover { text-decoration-color: var(--cinnabar); color: var(--cinnabar); }

/* ==========================================================================
   Home — hero
   ========================================================================== */
.hero { padding: clamp(40px, 5.5vw, 90px) 0 0; }
.hero__grid { display: grid; grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr); gap: clamp(28px, 4.5vw, 76px); align-items: center; }
.hero h1 { font-family: var(--f-display); font-weight: 500; font-size: clamp(68px, 8.4vw, 138px); line-height: .88; letter-spacing: -.025em; margin: 22px 0 30px; }
.hero h1 span { display: block; }
.hero h1 em { font-style: italic; font-weight: 500; color: var(--cinnabar); }
html[data-lang="zh"] .hero h1 { font-weight: 900; font-size: clamp(54px, 6.8vw, 108px); letter-spacing: .02em; line-height: 1.08; }
.hero__desc { font-family: var(--f-serif); font-size: clamp(18px, 1.4vw, 21px); line-height: 1.62; font-optical-sizing: auto; color: var(--ink-2); max-width: 30em; margin: 0; }
html[data-lang="zh"] .hero__desc { font-size: clamp(16.5px, 1.25vw, 19px); line-height: 1.95; }
.hero__cta { display: flex; flex-wrap: wrap; align-items: center; gap: 22px; margin-top: 36px; }

.plate { position: relative; background: var(--navy); color: var(--cream); }
.figure { margin: 0; min-width: 0; }
.figure .plate { box-shadow: 0 40px 70px -40px rgba(15, 29, 51, .7), 0 0 0 1px rgba(15, 29, 51, .5); }
.figure canvas { width: 100%; aspect-ratio: 1320 / 850; cursor: crosshair; }
.figure__bar { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 0 0; flex-wrap: wrap; }
.figure figcaption, .figcap { font: 12px/1.6 var(--f-mono); color: var(--ink-3); max-width: 62ch; }
.figcap b, .figure figcaption b { color: var(--ink); font-weight: 600; }
.cseg { display: inline-flex; border: 1px solid var(--rule); border-radius: 2px; font: 500 11.5px var(--f-mono); }
.cseg span { padding: 6px 10px; color: var(--ink-3); border-right: 1px solid var(--rule); }
.cseg button { padding: 6px 12px; color: var(--ink-2); transition: background .3s, color .3s; }
.cseg button + button { border-left: 1px solid var(--rule); }
.cseg button.is-on { background: var(--navy); color: var(--cream); }

.ledger { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: clamp(50px, 6vw, 86px); border-top: 2px solid var(--ink); border-bottom: 1px solid var(--ink); }
.ledger > div { padding: 22px 24px 20px 0; }
.ledger > div + div { padding-left: 24px; border-left: 1px solid var(--rule-soft); }
.ledger b { display: block; font-family: var(--f-display); font-weight: 500; font-size: clamp(46px, 4.6vw, 70px); line-height: 1; letter-spacing: -.02em; font-variant-numeric: lining-nums; }
.ledger span { display: block; margin-top: 10px; font-size: 13.5px; color: var(--ink-3); }

/* ==========================================================================
   Sections
   ========================================================================== */
.sec { display: grid; grid-template-columns: minmax(160px, .32fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 64px); padding: clamp(46px, 6vw, 90px) 0; border-top: 1px solid var(--rule); }
.sec:first-of-type { border-top: 0; }
.sec__label { position: sticky; top: 120px; align-self: start; }
.sec__label .no { font: 500 11.5px var(--f-mono); letter-spacing: .14em; color: var(--cinnabar); }
.sec__label h2 { font-family: var(--f-display); font-weight: 600; font-size: 30px; letter-spacing: -.01em; margin: 8px 0 0; line-height: 1.2; }
html[data-lang="zh"] .sec__label h2 { font-weight: 700; font-size: 24px; letter-spacing: .06em; }
.sec__label p { margin: 12px 0 0; font-size: 14px; color: var(--ink-3); max-width: 18em; }
.sec__label .tlink { display: inline-block; margin-top: 18px; font-size: 14px; }

/* post list */
.pl-item { display: grid; grid-template-columns: minmax(0, 1fr) clamp(220px, 26vw, 360px); gap: clamp(22px, 3.5vw, 54px); padding: 34px 0 38px; border-top: 1px solid var(--rule-soft); }
.pl-item:first-child { border-top: 0; padding-top: 4px; }
.pl-list--archive .pl-item { grid-template-columns: 90px minmax(0, 1fr) clamp(200px, 24vw, 320px); }
.pl-year { font-family: var(--f-display); font-weight: 500; font-size: 40px; line-height: 1; color: var(--ink-3); font-variant-numeric: lining-nums; padding-top: 2px; }
.pl-year--blank { visibility: hidden; }
.pl-item.is-hidden { display: none; }
.pl-title { font-family: var(--f-display); font-weight: 500; font-size: clamp(32px, 3.3vw, 50px); line-height: 1.04; letter-spacing: -.012em; margin: 12px 0 14px; text-wrap: balance; }
html[data-lang="zh"] .pl-title { font-weight: 700; font-size: clamp(24px, 2.4vw, 34px); line-height: 1.38; letter-spacing: .01em; }
.pl-title a { text-decoration: none; background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size .6s var(--ease); }
.pl-title a:hover { background-size: 100% 1px; }
.pl-authors { margin: 0 0 14px; color: var(--ink-3); font-size: 15px; }
.pl-authors b { color: var(--cinnabar); font-weight: 600; }
.pl-sum { margin: 0; max-width: 64ch; font-family: var(--f-serif); font-size: 18.5px; line-height: 1.6; color: var(--ink-2); }
html[data-lang="zh"] .pl-sum { font-size: 16.5px; line-height: 1.95; letter-spacing: .01em; }
.pl-links { display: flex; flex-wrap: wrap; gap: 24px; margin-top: 22px; font-size: 14.5px; font-weight: 600; }
.pl-links a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 6px; text-decoration-color: var(--rule); transition: color .3s, text-decoration-color .3s; }
.pl-links a:hover { color: var(--cinnabar); text-decoration-color: var(--cinnabar); }
.pl-links .pl-read { color: var(--ink); }
.pl-fig { display: block; text-decoration: none; align-self: start; }
.pl-fig canvas { width: 100%; aspect-ratio: 4 / 3; background: var(--navy); box-shadow: 0 24px 40px -30px rgba(15, 29, 51, .8); transition: transform .8s var(--ease); }
.pl-fig:hover canvas { transform: translateY(-4px); }
.pl-field { display: block; margin-top: 10px; font: 11px/1.5 var(--f-mono); letter-spacing: .08em; color: var(--ink-3); text-transform: uppercase; }

/* about */
.statement { font-family: var(--f-display); font-weight: 500; font-size: clamp(30px, 3.3vw, 48px); line-height: 1.22; letter-spacing: -.008em; margin: 0; max-width: 26em; text-wrap: pretty; }
.statement em { font-style: italic; color: var(--cinnabar); }
html[data-lang="zh"] .statement { font-weight: 600; font-size: clamp(22px, 2.3vw, 32px); line-height: 1.75; letter-spacing: .02em; }
html[data-lang="zh"] .statement em { font-style: normal; }
.principles { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: clamp(36px, 4.5vw, 60px); border-top: 1px solid var(--ink); }
.principles > div { padding: 26px 26px 0 0; }
.principles > div + div { padding-left: 26px; border-left: 1px solid var(--rule-soft); }
.principles .rn { font-family: var(--f-display); font-style: italic; font-weight: 500; font-size: 36px; color: var(--cinnabar); line-height: 1; }
.principles h3 { font-family: var(--f-display); font-weight: 600; font-size: 26px; margin: 14px 0 8px; }
html[data-lang="zh"] .principles h3 { font-weight: 700; font-size: 20px; letter-spacing: .04em; }
.principles p { margin: 0; color: var(--ink-2); font-size: 15px; }

/* recruitment banner */
.recruit { position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); align-items: center; gap: 30px; padding: clamp(40px, 5vw, 72px); background: var(--navy); color: var(--cream); isolation: isolate; }
.recruit::before { content: ""; position: absolute; inset: 12px; border: 1px solid rgba(241, 232, 214, .16); pointer-events: none; }
.recruit::after { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(60% 90% at 85% 50%, rgba(95, 132, 173, .35), transparent 70%), repeating-linear-gradient(90deg, rgba(241, 232, 214, .035) 0 1px, transparent 1px 44px), repeating-linear-gradient(0deg, rgba(241, 232, 214, .035) 0 1px, transparent 1px 44px); }
.recruit .eyebrow { color: var(--coral); }
.recruit h3 { font-family: var(--f-display); font-weight: 500; font-size: clamp(40px, 4.6vw, 66px); line-height: 1; letter-spacing: -.02em; margin: 14px 0 16px; }
html[data-lang="zh"] .recruit h3 { font-weight: 700; font-size: clamp(30px, 3.4vw, 48px); line-height: 1.3; letter-spacing: .02em; }
.recruit p { color: rgba(241, 232, 214, .75); max-width: 34em; margin: 0 0 30px; font-size: 16px; }
.recruit__mark { justify-self: center; width: min(100%, 300px); filter: drop-shadow(0 20px 40px rgba(0, 0, 0, .4)); }
.recruit__mark img { width: 100%; height: auto; }

/* contact */
.contact { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border-top: 1px solid var(--ink); }
.contact > div { padding: 26px 26px 6px 0; }
.contact > div + div { padding-left: 26px; border-left: 1px solid var(--rule-soft); }
.contact h3 { font-family: var(--f-display); font-weight: 600; font-size: clamp(30px, 2.8vw, 40px); margin: 10px 0 12px; letter-spacing: -.01em; }
.contact ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 15.5px; }
.contact a { text-underline-offset: 5px; text-decoration-color: var(--rule); }
.contact a:hover { color: var(--cinnabar); }

/* ==========================================================================
   Page header (research index / posts)
   ========================================================================== */
.phead { padding: clamp(44px, 6vw, 96px) 0 clamp(30px, 4vw, 54px); border-bottom: 1px solid var(--rule); }
.crumbs { display: flex; gap: 10px; flex-wrap: wrap; font: 500 11.5px var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 26px; }
.crumbs a { text-decoration: none; } .crumbs a:hover { color: var(--cinnabar); }
.phead h1 { font-family: var(--f-display); font-weight: 500; font-size: clamp(62px, 8vw, 124px); line-height: .9; letter-spacing: -.025em; margin: 0; }
html[data-lang="zh"] .phead h1 { font-weight: 900; font-size: clamp(46px, 5.6vw, 84px); line-height: 1.15; letter-spacing: .02em; }
.phead p { font-family: var(--f-serif); font-size: clamp(18px, 1.5vw, 22px); color: var(--ink-2); max-width: 36em; margin: 22px 0 0; }
html[data-lang="zh"] .phead p { font-size: 17.5px; line-height: 1.95; }
.filters { display: flex; flex-wrap: wrap; gap: 0; border: 1px solid var(--rule); border-radius: 2px; width: max-content; max-width: 100%; margin-top: 34px; }
.filter { padding: 9px 18px; font: 500 12px var(--f-mono); letter-spacing: .08em; color: var(--ink-2); transition: background .3s, color .3s; }
.filter + .filter { border-left: 1px solid var(--rule); }
.filter.is-on { background: var(--navy); color: var(--cream); }

/* article header */
.ahead { padding: clamp(40px, 5vw, 80px) 0 0; }
.ahead__title { font-family: var(--f-display); font-weight: 500; font-size: clamp(44px, 5.4vw, 84px); line-height: 1; letter-spacing: -.02em; margin: 16px 0 0; max-width: 17em; text-wrap: balance; }
.ahead__title em { font-style: italic; color: var(--cinnabar); }
html[data-lang="zh"] .ahead__title { font-weight: 800; font-size: clamp(32px, 3.9vw, 58px); line-height: 1.32; letter-spacing: .015em; }
html[data-lang="zh"] .ahead__title em { font-style: normal; }
.ahead__authors { margin-top: 28px; font-size: 16px; display: flex; flex-wrap: wrap; gap: 6px 22px; }
.ahead__authors sup { font: 500 10px var(--f-mono); color: var(--cinnabar); margin-left: 2px; }
.ahead__authors .ahstu { color: var(--cinnabar); font-weight: 600; }
.ahead__affil { margin-top: 10px; font-size: 13.5px; color: var(--ink-3); line-height: 1.9; }
.ahead__affil sup { font-family: var(--f-mono); color: var(--cinnabar); margin-right: 3px; }
.ahead__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.ahead__actions .btn { height: 44px; padding: 0 18px; font-size: 14px; }
.btn--line { border: 1px solid var(--ink); color: var(--ink); }
.btn--line:hover { background: var(--ink); color: var(--paper); }
.abstract { display: grid; grid-template-columns: minmax(160px, .32fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 64px); margin-top: clamp(40px, 5vw, 70px); padding: 30px 0 34px; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--ink); }
.abstract h2 { font: 500 11.5px var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--cinnabar); margin: 6px 0 0; }
.abstract p { margin: 0; font-family: var(--f-serif); font-size: clamp(19px, 1.55vw, 22.5px); line-height: 1.6; color: var(--ink); max-width: 46em; }
html[data-lang="zh"] .abstract p { font-size: 17.5px; line-height: 2; }
.banner-fig { margin: clamp(36px, 4.5vw, 60px) 0 0; }
.banner-fig canvas { width: 100%; height: clamp(220px, 30vw, 400px); background: var(--navy); }
.banner-radial { margin-top: clamp(36px, 4.5vw, 60px); }
.banner-radial canvas { aspect-ratio: 2.15 / 1; }

/* article body */
.article { display: grid; grid-template-columns: minmax(160px, .32fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 64px); padding: clamp(40px, 5vw, 80px) 0; }
.article > * { min-width: 0; }
.toc { position: sticky; top: 120px; align-self: start; font-size: 14px; }
.toc h4 { font: 500 11px var(--f-mono); letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 14px; }
.toc ol { list-style: none; margin: 0; padding: 0; counter-reset: t; }
.toc li { counter-increment: t; }
.toc a { display: grid; grid-template-columns: 28px 1fr; padding: 7px 0; text-decoration: none; color: var(--ink-3); border-top: 1px solid var(--rule-soft); line-height: 1.4; transition: color .3s; }
.toc a::before { content: counter(t, decimal-leading-zero); font: 500 11px var(--f-mono); padding-top: 2px; }
.toc a:hover { color: var(--ink); }
.toc a.is-active { color: var(--cinnabar); font-weight: 600; }
.toc .progress { height: 2px; background: var(--rule-soft); margin-top: 18px; }
.toc .progress i { display: block; height: 100%; width: 0; background: var(--cinnabar); }

.prose { max-width: 760px; font-family: var(--f-serif); font-size: 18.5px; line-height: 1.72; color: #1d2c40; font-optical-sizing: auto; font-variant-numeric: oldstyle-nums proportional-nums; hanging-punctuation: first; }
html[data-lang="zh"] .prose { font-size: 17px; line-height: 2; letter-spacing: .015em; font-variant-numeric: lining-nums; }
.prose > * + * { margin-top: 1.15em; }
.prose p { margin-bottom: 0; }
.prose h2 { font-family: var(--f-display); font-weight: 600; font-size: clamp(32px, 3vw, 44px); line-height: 1.15; letter-spacing: -.015em; margin: 2.3em 0 0; padding-top: .7em; border-top: 1px solid var(--rule); display: flex; gap: 16px; align-items: baseline; scroll-margin-top: 110px; }
.prose h2 .n { font: 500 12px var(--f-mono); color: var(--cinnabar); letter-spacing: .1em; flex: none; transform: translateY(-5px); }
html[data-lang="zh"] .prose h2 { font-weight: 700; font-size: clamp(23px, 2.3vw, 30px); line-height: 1.45; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-family: var(--f-display); font-weight: 700; font-size: 25px; margin-top: 2em; }
.prose a { color: var(--azure); text-decoration-color: rgba(0, 90, 168, .35); text-underline-offset: 4px; }
.prose a.btn { color: var(--cream); text-decoration: none; }
.prose strong, .prose b { font-weight: 650; color: var(--ink); }
.prose ul, .prose ol { padding-left: 1.3em; } .prose li + li { margin-top: .45em; }
.prose li::marker { color: var(--cinnabar); }
.prose code, .word { font-family: var(--f-mono); font-size: .82em; background: rgba(20, 36, 58, .07); padding: .12em .4em; border-radius: 2px; }
.prose .eq { margin: 1.8em 0; padding: 24px; text-align: center; overflow-x: auto; border-top: 1px solid var(--rule-soft); border-bottom: 1px solid var(--rule-soft); }
.prose .eq math { font-size: 1.22em; }
.eq-cap { display: block; margin-top: 10px; font: 12px var(--f-mono); color: var(--ink-3); }

.tldr { padding: 26px 30px; background: var(--card); border: 1px solid var(--rule-soft); border-left: 4px solid var(--cinnabar); }
.tldr__k { font: 500 11px var(--f-mono); letter-spacing: .16em; text-transform: uppercase; color: var(--cinnabar); margin-bottom: 8px; }
.tldr p { margin: 0; font-family: var(--f-display); font-weight: 500; font-size: clamp(23px, 2vw, 28px); line-height: 1.5; color: var(--ink); }
html[data-lang="zh"] .tldr p { font-family: var(--f-serif); font-size: 18.5px; line-height: 1.9; font-weight: 600; }
.callout { padding: 18px 22px; border-left: 2px solid var(--ink); background: rgba(20, 36, 58, .04); font-family: var(--f-sans); font-size: 15px; line-height: 1.75; }
.callout b { color: var(--cinnabar); }

.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); border-top: 2px solid var(--ink); border-bottom: 1px solid var(--ink); font-family: var(--f-sans); }
.kv > div { padding: 20px 20px 18px 0; }
.kv > div + div { padding-left: 20px; border-left: 1px solid var(--rule-soft); }
.kv b { display: block; font-family: var(--f-display); font-weight: 500; font-size: clamp(36px, 3.2vw, 48px); line-height: 1; letter-spacing: -.02em; white-space: nowrap; color: var(--ink); }
.kv b small { font-size: .45em; color: var(--ink-3); }
.kv span { display: block; margin-top: 8px; font-size: 13px; line-height: 1.5; color: var(--ink-3); }

.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-family: var(--f-sans); font-size: 14.5px; min-width: 520px; border-top: 2px solid var(--ink); border-bottom: 2px solid var(--ink); }
table.t th, table.t td { padding: 12px 14px; text-align: left; }
table.t thead th { font: 500 11px var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); border-bottom: 1px solid var(--ink); }
table.t tbody tr + tr td { border-top: 1px solid var(--rule-soft); }
table.t td.q { color: var(--cinnabar); font-weight: 650; }
table.t caption { caption-side: bottom; text-align: left; padding: 12px 0 0; font: 12.5px/1.6 var(--f-mono); color: var(--ink-3); }

.words { display: grid; gap: 8px; font-family: var(--f-mono); font-size: 15px; padding: 24px 26px; background: var(--navy); color: var(--cream); overflow-x: auto; }
.words div { display: grid; grid-template-columns: 60px auto; gap: 16px; align-items: center; white-space: nowrap; }
.words b { color: var(--coral); font-weight: 600; font-style: italic; font-family: var(--f-display); font-size: 22px; }
.words .d { display: inline-block; width: 1.3em; text-align: center; }
.v0 { color: var(--navy); background: #f1e8d6; } .v1 { background: #5f84ad; } .v2 { background: #20395a; } .v3 { background: #e8794f; } .v4 { background: #b9c9d8; color: var(--navy); }

/* figures: interactive labs on navy plates */
.fig { margin: 2.2em 0; }
.fig__cap { margin-top: 12px; font: 12.5px/1.65 var(--f-mono); color: var(--ink-3); }
.fig__cap b { color: var(--ink); }
.lab { background: var(--navy); color: var(--cream); font-family: var(--f-sans); box-shadow: 0 30px 60px -40px rgba(15, 29, 51, .8); }
.lab__head { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; padding: 16px 22px; border-bottom: 1px solid rgba(241, 232, 214, .1); }
.lab__title { display: flex; align-items: center; gap: 10px; font: 500 11px var(--f-mono); letter-spacing: .16em; text-transform: uppercase; color: var(--coral); }
.lab__title i { width: 7px; height: 7px; background: var(--coral); }
.lab__controls { display: flex; flex-wrap: wrap; gap: 12px 22px; align-items: center; padding: 16px 22px; border-bottom: 1px solid rgba(241, 232, 214, .1); font-size: 14px; }
.lab__body { padding: 18px 22px 20px; }
.seg { display: inline-flex; border: 1px solid rgba(241, 232, 214, .25); border-radius: 2px; }
.seg button { padding: 6px 13px; font-size: 13px; color: rgba(241, 232, 214, .75); transition: background .3s, color .3s; }
.seg button + button { border-left: 1px solid rgba(241, 232, 214, .25); }
.seg button.is-on { background: var(--cream); color: var(--navy); font-weight: 600; }
.range { display: inline-flex; align-items: center; gap: 12px; }
.range label { color: rgba(241, 232, 214, .7); font-family: var(--f-mono); font-size: 13px; }
.range output { font-family: var(--f-mono); color: var(--coral); min-width: 3.4em; }
input[type="range"] { -webkit-appearance: none; appearance: none; width: 150px; height: 2px; background: rgba(241, 232, 214, .3); outline: none; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: var(--coral); border: 3px solid var(--navy); box-shadow: 0 0 0 1px var(--coral); cursor: pointer; }
input[type="range"]::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: var(--coral); border: 3px solid var(--navy); cursor: pointer; }
.btn-sm { padding: 6px 12px; border: 1px solid rgba(241, 232, 214, .25); border-radius: 2px; font-size: 12.5px; color: var(--cream); }
.btn-sm:hover { background: rgba(241, 232, 214, .08); }
.lab canvas.plot { width: 100%; }
.lab__legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 12px; font: 12px var(--f-mono); color: rgba(241, 232, 214, .6); }
.lab__legend span { display: inline-flex; align-items: center; gap: 6px; }
.lab__legend i { width: 11px; height: 11px; }
.lab__note { margin: 10px 0 0; font: 12px var(--f-mono); color: rgba(241, 232, 214, .45); }
.lab__stats { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid rgba(241, 232, 214, .1); }
.lab__stats > div { padding: 14px 20px; }
.lab__stats > div + div { border-left: 1px solid rgba(241, 232, 214, .1); }
.lab__stats small { display: block; font: 10.5px var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: rgba(241, 232, 214, .45); }
.lab__stats b { display: block; font-family: var(--f-display); font-weight: 600; font-size: 32px; color: #fff; margin-top: 2px; }
.lab__stats em { display: block; font: normal 11.5px var(--f-mono); margin-top: 2px; color: rgba(241, 232, 214, .5); }
.lab__stats em.ok { color: #8fd19e; }

.matrix { display: grid; grid-template-columns: auto 1fr 1fr; gap: 0; font-family: var(--f-sans); font-size: 14px; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--ink); }
.matrix .h { font: 500 10.5px var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); padding: 10px 14px; display: flex; align-items: center; }
.matrix .cell { padding: 18px 18px; border-top: 1px solid var(--rule-soft); border-left: 1px solid var(--rule-soft); }
.matrix .cell.mis { background: repeating-linear-gradient(135deg, rgba(181, 72, 42, .07) 0 7px, transparent 7px 14px); }
.matrix .cell b { font-family: var(--f-display); font-size: 30px; font-weight: 600; display: block; }
.matrix .cell small { display: block; font: 10.5px var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.matrix .cell.mis small { color: var(--cinnabar); }
.matrix .cell .r { margin-top: 10px; font-size: 13.5px; color: var(--ink-2); }
.matrix .cell .r strong { font-family: var(--f-mono); font-weight: 600; }

.chart { margin: 2.2em 0; font-family: var(--f-sans); }
.chart svg { width: 100%; height: auto; overflow: visible; }
.chart__cap { margin-top: 12px; font: 12.5px/1.65 var(--f-mono); color: var(--ink-3); }
.chart .axis line { stroke: rgba(20, 36, 58, .35); }
.chart .axis text { font: 11px var(--f-mono); fill: var(--ink-3); }
.chart .grid line { stroke: rgba(20, 36, 58, .08); }
.chart--plate { background: var(--card); border-top: 2px solid var(--ink); border-bottom: 1px solid var(--ink); padding: 22px 6px 14px; }
.bars { display: grid; gap: 12px; }
.bar-row { display: grid; grid-template-columns: 130px 1fr; gap: 16px; align-items: center; font-size: 14px; }
.bar-row > span { text-align: right; color: var(--ink-2); }
.bar { display: flex; height: 32px; background: rgba(20, 36, 58, .06); }
.bar i { display: flex; align-items: center; justify-content: center; font: normal 11.5px var(--f-mono); color: #fff; width: 0; transition: width 1.6s var(--ease); white-space: nowrap; overflow: hidden; }
.chart.in .bar i { width: var(--w); }
.c-mr { background: var(--navy); } .c-dtw { background: var(--gold); } .c-rf { background: var(--cinnabar); }

.refs { font-family: var(--f-sans); font-size: 14px; color: var(--ink-2); padding-left: 1.4em; }
.refs li + li { margin-top: .55em; }
.next-post { display: flex; justify-content: space-between; align-items: center; gap: 18px; flex-wrap: wrap; margin-top: 60px; padding-top: 26px; border-top: 2px solid var(--ink); font-family: var(--f-sans); }

.tip { position: fixed; z-index: 300; pointer-events: none; padding: 6px 10px; background: var(--navy); color: var(--cream); font: 12px var(--f-mono); border: 1px solid rgba(241, 232, 214, .25); transform: translate(-50%, calc(-100% - 12px)); opacity: 0; transition: opacity .15s; white-space: nowrap; }
.tip.show { opacity: 1; }

/* ==========================================================================
   Footer
   ========================================================================== */
.footer { margin-top: clamp(40px, 6vw, 90px); padding: 44px 0 30px; border-top: 2px solid var(--ink); position: relative; }
.footer::before { content: ""; position: absolute; left: 0; right: 0; top: 3px; border-top: 1px solid var(--ink); }
.footer__grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 36px; }
.footer__brand img { height: 74px; width: auto; }
.footer__brand p { margin: 18px 0 0; max-width: 24em; font-size: 14px; color: var(--ink-3); }
.footer h4 { font: 500 11px var(--f-mono); letter-spacing: .16em; text-transform: uppercase; color: var(--cinnabar); margin: 6px 0 14px; }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 14.5px; }
.footer a { text-decoration: none; } .footer a:hover { color: var(--cinnabar); }
.footer__bottom { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 44px; padding-top: 18px; border-top: 1px solid var(--rule-soft); font: 11.5px var(--f-mono); letter-spacing: .06em; color: var(--ink-3); }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1080px) {
  .hero__grid { grid-template-columns: 1fr; }
  .article, .abstract, .sec { grid-template-columns: 1fr; }
  .sec__label { position: static; }
  .toc { display: none; }
  .footer__grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 820px) {
  .topbar .meta { display: none; }
  .topbar .wrap { justify-content: flex-end; }
  .mburger { display: block; }
  .masthead { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--paper); }
  .mnav { position: fixed; inset: 0; z-index: 90; height: 100vh; height: 100dvh; flex-direction: column; justify-content: center; align-items: flex-start; gap: 0; padding: 100px var(--gut) 40px; background: var(--paper); transform: translateY(-100%); visibility: hidden; transition: transform .6s var(--ease), visibility 0s .6s; }
  body.mnav-open .mnav { transform: none; visibility: visible; transition: transform .6s var(--ease), visibility 0s; }
  .mnav a { font-family: var(--f-display); font-weight: 500; font-size: 40px; padding: 10px 0; width: 100%; border-bottom: 1px solid var(--rule-soft); }
  .mnav a::after { display: none; }
  .mnav a.mnav__join { margin: 24px 0 0; font-family: var(--f-sans); font-size: 16px; width: auto; padding: 12px 22px; }
  .masthead .wrap { height: 72px; }
  .brand { height: 46px; position: relative; z-index: 95; }
  .mburger { position: relative; z-index: 95; }
  .ledger { grid-template-columns: 1fr 1fr; }
  .ledger > div:nth-child(3) { padding-left: 0; border-left: 0; }
  .ledger > div:nth-child(n+3) { border-top: 1px solid var(--rule-soft); }
  .pl-item, .pl-list--archive .pl-item { grid-template-columns: 1fr; }
  .pl-fig { order: -1; }
  .pl-year--blank { display: none; }
  .principles, .contact { grid-template-columns: 1fr; }
  .principles > div + div, .contact > div + div { padding-left: 0; border-left: 0; border-top: 1px solid var(--rule-soft); }
  .recruit { grid-template-columns: 1fr; }
  .recruit__mark { width: 160px; justify-self: start; order: -1; }
  .lab__stats { grid-template-columns: 1fr 1fr; }
  .lab__stats > div:nth-child(3) { border-left: 0; }
  .lab__stats > div:nth-child(n+3) { border-top: 1px solid rgba(241, 232, 214, .1); }
}
@media (max-width: 560px) {
  .footer__grid { grid-template-columns: 1fr; }
  .matrix { grid-template-columns: 1fr 1fr; }
  .matrix .h--row, .matrix .h--corner { display: none; }
  .bar-row { grid-template-columns: 1fr; gap: 6px; }
  .bar-row > span { text-align: left; }
  .kv > div:nth-child(odd) { padding-left: 0; border-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- typographic details ---------- */
.pl-meta { font: 500 11.5px/1.6 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
html[data-lang="zh"] .pl-meta { letter-spacing: .12em; }
.ledger b, .kv b, .lab__stats b, .pl-year, .phead h1, .hero h1 { font-variant-numeric: lining-nums; }
.statement, .pl-title, .ahead__title, .hero h1 { font-feature-settings: "kern", "liga", "dlig"; }
.meta, .eyebrow, .crumbs, .langsw, .figure figcaption, .figcap, .fig__cap, .chart__cap { font-feature-settings: "zero" 0; }
html[data-lang="zh"] .hero h1, html[data-lang="zh"] .phead h1, html[data-lang="zh"] .ahead__title, html[data-lang="zh"] .pl-title, html[data-lang="zh"] .statement, html[data-lang="zh"] .recruit h3, html[data-lang="zh"] .prose h2 { font-family: "Noto Serif SC", "Source Han Serif SC", "Songti SC", serif; }
