:root {
  --bg: #F1EEE8;
  --bg-panel: #E6E2DA;
  --bg-panel2: #141413;
  --border: #D6D2CA;
  --accent: #1A1917;
  --accent-dark: #0A0A09;
  --text: #191917;
  --text-muted: #6B6862;
  --success: #3F7A52;
  --warn: #A57A2E;
  --error: #A4412F;
  --collage-ochre: #C4A274;
  --collage-sage: #8FA38A;
  --collage-dust: #8FA3B8;
  --collage-clay: #BE8B7A;
  --collage-ink: rgba(20, 20, 19, .42);
  --collage-ink-soft: rgba(20, 20, 19, .22);
  --ink-line: #5E5B55;
  --ink-root: #EEE8DC;
  --ink-label: #D9D4CA;
  --ink-value: #B9B3A8;
  --ink-note: #8F8B83;
  --clear: transparent;
  --veil: rgba(20, 20, 19, .48);

  --font-display: "Inter", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --font-body: "Inter", "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --font-serif: "Iowan Old Style", "Charter", Georgia, "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --weight-normal: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;
  --weight-display: 800;
  --text-xs: 12px;
  --text-sm: 14px;
  --text-nav: 15px;
  --text-base: 16px;
  --text-lg: 18px;
  --text-lede: 22px;
  --title-h1: clamp(34px, 3.4vw, 48px);
  --title-h2: clamp(24px, 2.2vw, 32px);
  --title-h3: 22px;
  --radius-xl: 28px;
  --radius-lg: 24px;
  --radius-btn: 12px;
  --radius-sm: 4px;
  --radius-pill: 999px;
  --max: 1440px;
  --reading-max: 860px;
  --content-max: 1200px;
  --header-max: 1280px;
  --gutter: clamp(20px, 4.4vw, 64px);
  --page-pad: max(var(--gutter), calc((100vw - var(--max)) / 2 + var(--gutter)));
  --nav-h: 72px;
  --section-gap: clamp(56px, 7vw, 112px);
  --motion-fast: .2s;
  --motion-tabs: .28s;
  --motion-reveal: .6s;
  --focus-width: 2px;
  --rule: 1px;
  --z-header: 50;
  --z-veil: 40;
  --z-fab: 30;
}
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 24px;
}
html.nav-open { overflow: hidden; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
[hidden] { display: none !important; }
img, svg, video { max-width: 100%; }
img { height: auto; }
button, input, select, textarea { font: inherit; }
button, summary, a { -webkit-tap-highlight-color: var(--clear); }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
a { color: inherit; text-underline-offset: .2em; }
p { margin: 0 0 1.2em; }
h1, h2, h3, h4 {
  margin: 0 0 .7em;
  font-family: var(--font-display);
  line-height: 1.25;
  text-wrap: balance;
  overflow-wrap: break-word;
}
h1 { font-size: var(--title-h1); font-weight: var(--weight-display); letter-spacing: -.012em; }
h2 { font-size: var(--title-h2); font-weight: var(--weight-display); letter-spacing: -.01em; }
h3 { font-size: var(--title-h3); font-weight: var(--weight-bold); }
code, pre, kbd { font-family: var(--font-mono); }
code { font-size: .875em; overflow-wrap: anywhere; }
pre {
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  padding: 24px;
  border-radius: var(--radius-lg);
  background: var(--bg-panel2);
  color: var(--ink-label);
  tab-size: 2;
}
pre code { font-size: var(--text-sm); white-space: pre; overflow-wrap: normal; word-break: normal; }
hr { border: 0; border-top: var(--rule) solid var(--border); margin-block: 32px; }
:focus-visible {
  outline: var(--focus-width) solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}
.dark :focus-visible, .site-footer :focus-visible { outline-color: var(--ink-root); }
::selection { background: var(--accent); color: var(--bg); }
.wrap {
  width: 100%;
  max-width: calc(var(--content-max) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.reading { max-width: calc(var(--reading-max) + var(--gutter) * 2); }
.section { padding-top: var(--section-gap); padding-bottom: var(--section-gap); }
.section-head { margin-bottom: 32px; }
.section-head > :last-child { margin-bottom: 0; }
.grid-two, .grid-three { display: grid; gap: 24px; }
.grid-two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
:where(main, section, article, aside, nav, .wrap, .grid-two, .grid-three) > * { min-width: 0; }
.flow > * + * { margin-top: 24px; }
.muted { color: var(--text-muted); }
.mono, .eyebrow { font-family: var(--font-mono); }
.eyebrow { font-size: var(--text-xs); letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted); }
.serif { font-family: var(--font-serif); }
.lede { font-family: var(--font-serif); font-size: var(--text-lede); line-height: 1.62; }
.keep { white-space: nowrap; }
.dark {
  background: var(--bg-panel2);
  color: var(--ink-root);
  --border: var(--ink-line);
}
.dark .muted, .dark .eyebrow { color: var(--ink-value); }
.dark .btn-ghost { border-color: var(--ink-label); color: var(--ink-root); background: var(--clear); }
.dark .btn-ghost:hover { background: var(--ink-root); color: var(--text); }
.dark .btn-primary { background: var(--bg); color: var(--text); }
.dark .btn-primary:hover { background: var(--bg-panel); color: var(--text); }
.card, .panel {
  padding: clamp(24px, 3vw, 40px);
  border-radius: var(--radius-lg);
  background: var(--bg-panel);
  color: var(--text);
}
.card > :last-child, .panel > :last-child { margin-bottom: 0; }
.card h3 { margin-bottom: 12px; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  max-width: 100%;
  padding: 12px 24px;
  border: var(--rule) solid var(--clear);
  border-radius: var(--radius-btn);
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  line-height: 1.5;
  text-align: center;
  text-decoration: none;
  transition: background-color var(--motion-fast), color var(--motion-fast), transform var(--motion-fast);
}
.btn svg { width: 17px; height: 17px; flex-shrink: 0; }
.btn-primary { background: var(--accent); color: var(--bg); }
.btn-primary:hover, .btn-primary.is-hover { background: var(--accent-dark); color: var(--bg); transform: translateY(-1px); }
.btn-primary:active, .btn-primary.is-active { transform: translateY(0); background: var(--bg-panel2); color: var(--bg); }
.btn-ghost { border-color: var(--accent); background: var(--clear); color: var(--text); }
.btn-ghost:hover { background: var(--bg-panel); color: var(--text); transform: translateY(-1px); }
.btn:disabled, .btn[aria-disabled="true"] { background: var(--bg-panel); color: var(--text-muted); border-color: var(--border); transform: none; }
.btn-small { min-height: 44px; font-size: var(--text-sm); padding: 9px 18px; }
.btn.is-focus { outline: var(--focus-width) solid var(--accent); outline-offset: 3px; }
.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 100;
  padding: 12px 20px;
  background: var(--accent);
  color: var(--bg);
  border-radius: var(--radius-btn);
}
.skip-link:focus { top: 12px; }

/* 页头使用独立宽版心，不继承正文阅读宽度。 */
.masthead { position: relative; z-index: var(--z-header); border-bottom: var(--rule) solid var(--border); background: var(--bg); color: var(--text); }
.masthead-inner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 40px;
  min-height: var(--nav-h);
  width: 100%;
  max-width: min(100%, calc(var(--header-max) + var(--gutter) * 2));
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  flex-shrink: 0;
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: var(--weight-display);
  letter-spacing: -.01em;
  text-decoration: none;
}
.brand-mark { display: block; width: 30px; height: 30px; flex-shrink: 0; }
.desktop-nav { min-width: 0; margin-left: auto; align-self: stretch; }
.tabs {
  display: flex;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 30px;
  height: 100%;
}
.tabs li { display: flex; height: 100%; flex-shrink: 0; }
.tabs a {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 44px;
  font-size: var(--text-nav);
  color: var(--text-muted);
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--motion-fast);
}
.tabs a::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: -1px;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform var(--motion-tabs);
}
.tabs a:hover, .tabs a[aria-current="page"] { color: var(--text); }
.tabs a[aria-current="page"] { font-weight: var(--weight-semibold); }
.tabs a:hover::after, .tabs a[aria-current="page"]::after { transform: scaleX(1); }
.header-tools { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.language-picker { position: relative; }
.lang {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 7px 14px;
  border: var(--rule) solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--clear);
  color: var(--text);
  font-size: var(--text-sm);
  white-space: nowrap;
  text-decoration: none;
}
.lang:hover { background: var(--bg-panel); color: var(--text); }
.language-menu {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  min-width: 180px;
  margin: 0;
  padding: 8px;
  list-style: none;
  border: var(--rule) solid var(--border);
  border-radius: var(--radius-btn);
  background: var(--bg);
  color: var(--text);
}
.language-menu a { display: flex; align-items: center; min-height: 44px; padding: 8px 12px; text-decoration: none; border-radius: var(--radius-sm); }
.language-menu a:hover, .language-menu a[aria-current] { background: var(--bg-panel); color: var(--text); }
.menu-toggle { display: none; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 10px; border: var(--rule) solid var(--border); border-radius: var(--radius-btn); background: var(--bg); color: var(--text); }
.menu-toggle svg { width: 22px; height: 22px; flex-shrink: 0; }
.mobile-drawer { position: absolute; top: 100%; inset-inline: 0; padding: 12px var(--gutter) 24px; max-height: calc(100dvh - var(--nav-h)); overflow-y: auto; overscroll-behavior: contain; background: var(--bg); color: var(--text); border-bottom: var(--rule) solid var(--border); }
.mobile-drawer ul { margin: 0; padding: 0; list-style: none; }
.mobile-drawer a { display: flex; width: 100%; align-items: center; min-height: 48px; padding: 12px 8px; text-decoration: none; border-bottom: var(--rule) solid var(--border); }
.mobile-drawer a[aria-current] { font-weight: var(--weight-bold); }
.drawer-languages { margin-top: 20px; }
.drawer-label { margin: 20px 8px 4px; color: var(--text-muted); font-size: var(--text-sm); }
.nav-veil { position: fixed; inset: var(--nav-h) 0 0; z-index: var(--z-veil); border: 0; padding: 0; background: var(--veil); color: var(--bg); }
.preview-language > summary { list-style: none; cursor: pointer; }
.preview-language > summary::-webkit-details-marker { display: none; }

/* 拍板首屏：左侧排版、右侧字段家谱。 */
.hero {
  position: relative;
  overflow-x: clip;
  display: grid;
  grid-template-columns: minmax(0, 46fr) minmax(0, 54fr);
  grid-template-rows: 1fr repeat(6, auto) 1fr;
  align-content: center;
  min-height: clamp(660px, calc(100svh - var(--nav-h) - 44px), 1000px);
}
.hero > .col-l { grid-column: 1; margin-left: var(--page-pad); margin-right: clamp(32px, 4vw, 60px); }
.hero-kicker { grid-row: 2; margin: 0 0 22px; font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted); }
.hero-title { grid-row: 3; margin: 0; font-size: clamp(30px, 3.4vw, 48px); line-height: 1.2; }
.hero-title .ln { display: block; }
.hero-title .kw { white-space: nowrap; text-decoration-line: underline; text-decoration-thickness: .08em; text-underline-offset: .16em; text-decoration-color: var(--accent); text-decoration-skip-ink: none; }
.hero-actions { grid-row: 4; display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.hero-lede { grid-row: 5; margin: 34px 0 0; max-width: 31em; font-family: var(--font-serif); font-size: clamp(18px, 1.48vw, 21px); line-height: 1.62; color: var(--text-muted); }
.hero-lede strong { color: var(--text); font-weight: var(--weight-semibold); }
.hero-platforms { grid-row: 6; margin-top: 34px; padding-top: 18px; border-top: var(--rule) solid var(--border); display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.plat-label { font-family: var(--font-mono); font-size: 11px; letter-spacing: .12em; color: var(--text-muted); }
.plat-list { display: flex; flex-wrap: wrap; gap: 8px 22px; list-style: none; margin: 0; padding: 0; }
.plat-list a { display: inline-flex; align-items: center; gap: 8px; min-height: 24px; font-size: var(--text-sm); font-weight: var(--weight-medium); text-decoration: none; }
.plat-list svg { width: 16px; height: 16px; flex-shrink: 0; }
.plat-list a:hover { color: var(--text-muted); }
.hero-facts { grid-row: 7; display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 20px 0 0; padding: 0; }
.hero-facts li { font-family: var(--font-mono); font-size: var(--text-xs); line-height: 1; padding: 9px 13px; border-radius: var(--radius-pill); background: var(--bg-panel); color: var(--text); }
.hero-panel { grid-column: 2; grid-row: 1 / -1; position: relative; margin: 16px 16px 16px 0; border-radius: 0 var(--radius-xl) var(--radius-xl) 0; background: var(--bg-panel2); color: var(--ink-root); overflow: hidden; container-type: size; display: grid; place-items: center; }
.tree { position: relative; width: min(calc(100cqw - 64px), calc((100cqh - 64px) * 1.027)); aspect-ratio: 760 / 740; }
.tree > svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.tree-lines { z-index: 1; }
.tree-type { z-index: 3; }
.tree-lines path, .tree-lines line { fill: none; stroke: var(--ink-line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.tree-lines .joint { fill: var(--ink-line); stroke: none; }
.tree-more { animation: more-levels 5.5s ease-in-out infinite alternate; }
@keyframes more-levels { from { opacity: .35; } to { opacity: .9; } }
.t-path { font-family: var(--font-mono); font-size: 11px; letter-spacing: .06em; fill: var(--ink-note); text-anchor: middle; }
.t-root { font-family: var(--font-serif); font-size: 34px; fill: var(--ink-root); text-anchor: middle; }
.t-label { font-family: var(--font-serif); font-size: 25px; fill: var(--ink-label); text-anchor: middle; }
.t-note { font-family: var(--font-mono); font-size: 12.5px; text-anchor: middle; fill: var(--ink-note); }
.t-note .t-val { fill: var(--ink-value); }
.panel-cap { position: absolute; left: 28px; bottom: 22px; margin: 0; font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; color: var(--ink-note); z-index: 4; }

.site-footer { background: var(--bg-panel2); color: var(--ink-label); padding-top: 64px; padding-bottom: 28px; }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1.2fr) minmax(0, .8fr); gap: 40px; }
.footer-brand p { margin-top: 20px; max-width: 25em; font-family: var(--font-serif); color: var(--ink-value); }
.footer-heading { margin: 0 0 18px; font-size: var(--text-sm); font-weight: var(--weight-semibold); color: var(--ink-root); }
.footer-list { list-style: none; padding: 0; margin: 0; }
.footer-list a { display: inline-block; padding-block: 5px; font-size: var(--text-sm); text-decoration: none; }
.footer-list a:hover { color: var(--ink-root); text-decoration: underline; }
.footer-bottom { display: flex; justify-content: space-between; gap: 16px 32px; flex-wrap: wrap; margin-top: 48px; padding-top: 24px; border-top: var(--rule) solid var(--ink-line); font-size: var(--text-xs); color: var(--ink-value); }
.footer-bottom p { margin: 0; }
.footer-legal { display: flex; flex-wrap: wrap; gap: 20px; }

.prose { min-width: 0; }
.prose h2 { margin-top: 2.2em; scroll-margin-top: 28px; }
.prose h3 { margin-top: 1.7em; scroll-margin-top: 28px; }
.prose p, .prose li { line-height: 1.85; }
.prose li + li { margin-top: .5em; }
.prose ul, .prose ol { padding-left: 1.5em; }
.prose a { text-decoration-thickness: var(--rule); }
.reveal { opacity: 1; transform: none; }
html.reveal-ready .reveal:not(.shown) { opacity: 0; transform: translateY(16px); }
html.reveal-ready .reveal { transition: opacity var(--motion-reveal) ease, transform var(--motion-reveal) ease; }
html.reveal-ready .reveal.shown { opacity: 1; transform: none; }

@media (max-width: 1279px) {
  .masthead-inner { gap: 24px; }
  .desktop-nav { display: none; }
  .header-tools { margin-left: auto; }
  .menu-toggle { display: inline-flex; }
  .preview-header .desktop-nav { display: block; order: 4; flex-basis: 100%; width: 100%; margin-left: 0; overflow-x: auto; }
  .preview-header .masthead-inner { flex-wrap: wrap; padding-top: 14px; gap: 12px 16px; }
  .preview-header .tabs { height: 46px; gap: 22px; }
}
@media (min-width: 1280px) {
  .mobile-drawer, .nav-veil { display: none !important; }
}
@media (max-width: 860px) {
  .hero { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; min-height: 0; padding-block: 36px 40px; }
  .hero > .col-l { grid-column: 1; grid-row: auto; margin-inline: var(--gutter); }
  .hero-kicker { order: 1; margin-bottom: 16px; }
  .hero-title { order: 2; font-size: clamp(24px, 7vw, 30px); }
  .hero-actions { order: 3; margin-top: 24px; }
  .hero-lede { order: 4; margin-top: 26px; }
  .hero-platforms { order: 5; margin-top: 26px; }
  .hero-panel { order: 6; grid-column: 1; grid-row: auto; margin: 26px var(--gutter) 0; border-radius: var(--radius-lg); aspect-ratio: 760 / 520; place-items: start center; }
  .hero-facts { order: 7; margin-top: 20px; }
  .tree { width: 100cqw; }
  .tree .lv3, .tree-lines .lv3 { display: none; }
  .panel-cap { display: none; }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; }
  .grid-three { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 768px) {
  h1 { font-size: clamp(24px, 6vw, 30px); }
}
@media (max-width: 640px) {
  .grid-two { grid-template-columns: minmax(0, 1fr); }
  .tilt, [data-tilt] { transform: none !important; }
  .footer-grid { grid-template-columns: minmax(0, 1fr); }
  .hero-title .ln { text-wrap: balance; }
  .hero-actions .btn { padding-inline: 18px; }
  .hero-facts { gap: 6px; }
  .hero-facts li { padding: 9px 10px; font-size: 11px; }
  .brand { font-size: var(--text-base); gap: 8px; }
  .header-tools { gap: 6px; margin-left: auto; }
  .lang { padding-inline: 10px; }
  pre { padding: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html.reveal-ready .reveal:not(.shown) { opacity: 1; transform: none; }
  .tree-more { opacity: .7; }
}