:root {
  --bg: #f9f7f4;
  --bg-panel: #ffffff;
  --bg-panel-2: #f3ede8;
  --border: #e7e2dc;
  --accent: #2a2238;
  --accent-dark: #17121f;
  --text: #1c1a20;
  --text-muted: #6b6670;
  --success: #3f8f6b;
  --warn: #b7791f;
  --error: #c2453d;
  --on-accent: #ffffff;
  --clear: transparent;
  --peach: #f6c9a8;
  --rose: #f2b3c4;
  --lavender: #c9b8ef;
  --sky: #a9d4f0;
  --mint: #bfe6cf;
  --peach-a: rgba(246,201,168,.46);
  --rose-a: rgba(242,179,196,.40);
  --lavender-a: rgba(201,184,239,.42);
  --sky-a: rgba(169,212,240,.40);
  --mint-a: rgba(191,230,207,.42);
  --tint-proxy: rgba(201,184,239,.34);
  --tint-direct: rgba(191,230,207,.55);
  --accent-a06: rgba(42,34,56,.06);
  --accent-a08: rgba(42,34,56,.08);
  --accent-a12: rgba(42,34,56,.12);
  --accent-a18: rgba(42,34,56,.18);
  --accent-a26: rgba(42,34,56,.26);
  --ink-a22: rgba(23,18,31,.22);
  --warm-a80: rgba(243,237,232,.80);
  --white-a40: rgba(255,255,255,.40);
  --white-a30: rgba(255,255,255,.30);
  --white-a18: rgba(255,255,255,.18);
  --font-display: "Iowan Old Style","Charter","Palatino Linotype","Source Han Serif SC","Noto Serif CJK SC","Songti SC","STSong",Georgia,serif;
  --font-body: "Inter","Noto Sans SC",-apple-system,BlinkMacSystemFont,"PingFang SC","Hiragino Sans GB","Microsoft YaHei",sans-serif;
  --font-mono: "JetBrains Mono",ui-monospace,"SF Mono",Menlo,Consolas,monospace;
  --r-float: 32px;
  --r-card: 24px;
  --r-pill: 999px;
  --r-shot: 8px;
  --r-icon: 13px;
  --r-mark: 8px;
  --r-chip: 6px;
  --shadow-float: 0 40px 120px var(--accent-a08),0 10px 30px var(--accent-a06),0 1px 2px var(--accent-a06);
  --shadow-pill: 0 6px 12px var(--ink-a22);
  --shadow-btn: 0 10px 24px var(--accent-a18);
  --shadow-tile: 0 6px 18px var(--accent-a12);
  --gutter: 32px;
  --content-width: 1120px;
  --reading-width: 760px;
  --header-width: 1360px;
  --header-height: 64px;
  --section-space: 160px;
  --line: 24px;
  --duration: .25s;
  --ease: ease;
  --size-h1: clamp(34px,2.2vw + 16px,48px);
  --size-h2: clamp(26px,2.6vw,38px);
  --size-h3: 24px;
  --size-body: 16px;
  --size-small: 13px;
  --leading-body: 1.6;
  --tracking-heading: -.02em;
  --focus-width: 3px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 32px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--size-body);
  line-height: var(--leading-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
html.nav-open { overflow: hidden; }
[hidden] { display: none !important; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 4px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button, a { -webkit-tap-highlight-color: var(--accent-a12); }
button:disabled { cursor: not-allowed; }
:focus-visible { outline: var(--focus-width) solid var(--accent); outline-offset: 4px; }
img, svg { max-width: 100%; }
img { display: block; height: auto; }
svg { flex-shrink: 0; }
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: var(--tracking-heading);
  text-wrap: balance;
  line-height: 1.2;
  overflow-wrap: break-word;
}
h1 { font-size: var(--size-h1); line-height: 1.12; }
h2 { font-size: var(--size-h2); }
h3 { font-size: var(--size-h3); }
p { margin-block: 0 1.2em; }
strong { font-weight: 600; }
code, kbd, pre { font-family: var(--font-mono); }
code { font-size: .88em; overflow-wrap: anywhere; }
pre {
  margin-block: 24px;
  padding: 24px;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  background: var(--bg);
  color: var(--text);
  border-radius: var(--r-card);
  font-size: 14px;
  line-height: 1.8;
  tab-size: 2;
}
pre code { font-size: inherit; white-space: pre; overflow-wrap: normal; word-break: normal; }
:where(main, section, article, aside, div, li) { min-width: 0; }
.wrap {
  width: 100%;
  max-width: calc(var(--content-width) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.reading { max-width: calc(var(--reading-width) + var(--gutter) * 2); }
.section { padding-top: var(--section-space); padding-bottom: var(--section-space); }
.section--white { background: var(--bg-panel); color: var(--text); }
.section--fade { background: linear-gradient(180deg,var(--bg-panel),var(--bg-panel-2)); color: var(--text); }
.section-heading { max-width: 760px; margin-bottom: 56px; }
.section-heading h2 { margin-block: 12px 20px; }
.eyebrow { font-family: var(--font-mono); font-size: 12px; letter-spacing: .06em; color: var(--text-muted); }
.muted { color: var(--text-muted); }
.keep { white-space: nowrap; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; z-index: 100; left: 16px; top: 12px;
  padding: 12px 20px; background: var(--accent); color: var(--on-accent);
  border-radius: var(--r-pill); transform: translateY(-160%);
}
.skip-link:focus { transform: none; }
.ico { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 12px 26px; border: 0;
  border-radius: var(--r-pill); font-size: 15.5px; font-weight: 500;
  line-height: 1.5; text-align: center; max-width: 100%;
  transition: transform var(--duration) var(--ease),background var(--duration) var(--ease);
}
.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn:active { transform: translateY(0); }
.btn .ico { width: 17px; height: 17px; flex: none; }
.btn--solid { background: var(--accent); color: var(--on-accent); box-shadow: var(--shadow-btn); }
.btn--solid:hover, .btn--solid.is-hover { background: var(--accent-dark); color: var(--on-accent); }
.btn--line { background: var(--bg-panel); color: var(--text); box-shadow: inset 0 0 0 1px var(--accent-a26); }
.btn--line:hover { box-shadow: inset 0 0 0 1px var(--accent); }
.btn--quiet { background: var(--accent-a06); color: var(--accent); }
.btn:disabled, .btn[aria-disabled="true"] {
  background: var(--bg-panel-2); color: var(--text-muted); box-shadow: none; transform: none;
}
.btn.is-focus { outline: var(--focus-width) solid var(--accent); outline-offset: 4px; }
.card, .panel {
  padding: 32px; background: var(--bg-panel); color: var(--text);
  border-radius: var(--r-card);
}
.panel { border-radius: var(--r-float); box-shadow: var(--shadow-float); }
.card h3, .panel h3 { margin-top: 0; }
.card p:last-child, .panel p:last-child { margin-bottom: 0; }
.grid-two { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 24px; }
.prose { font-size: 16px; line-height: 1.9; }
.prose h2 { margin-top: 80px; margin-bottom: 24px; }
.prose h3 { margin-top: 40px; }
.prose a { text-decoration: underline; text-underline-offset: 3px; }
.prose li { margin-block: 8px; }
.prose :where(ul,ol) { padding-left: 24px; }
.prose blockquote { margin-inline: 0; }
.reveal { opacity: 1; transform: none; }
html.reveal-ready .reveal:not(.shown) { opacity: 0; transform: translateY(18px); }
html.reveal-ready .reveal { transition: opacity .65s ease,transform .65s ease; }
.reveal.shown { opacity: 1; transform: none; }

/* 页头使用独立宽版心，不与阅读版心共用。 */
#site-header { position: relative; z-index: 50; }
.topbar {
  position: relative; z-index: 5; width: 100%;
  max-width: min(100%,calc(var(--header-width) + var(--gutter) * 2));
  min-height: var(--header-height); margin-inline: auto; padding-inline: 40px;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px;
}
.brand { justify-self: start; display: inline-flex; align-items: center; gap: 12px; flex-shrink: 0; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand__mark {
  display: block; width: 30px; height: 30px; flex: none; border-radius: var(--r-mark);
  background: var(--bg-panel); color: var(--text);
  box-shadow: inset 0 0 0 1px var(--border),0 2px 6px var(--accent-a08);
}
.brand__name { font-family: var(--font-display); font-size: 18px; letter-spacing: -.01em; }
.nav { min-width: 0; }
.nav ul { display: flex; align-items: center; list-style: none; margin: 0; padding: 0; gap: 2px; }
.nav a {
  display: inline-flex; align-items: center; gap: 7px; min-height: 36px;
  padding: 6px 13px; border-radius: var(--r-pill); font-size: 14px;
  color: var(--text-muted); white-space: nowrap;
}
.nav a:hover { color: var(--text); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--accent); background: var(--accent-a06); }
.nav .ico { width: 15px; height: 15px; flex: none; }
.header-tools { justify-self: end; display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.language-control { position: relative; }
.lang {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 36px; padding: 6px 14px; border: 0; border-radius: var(--r-pill);
  background: var(--clear); color: var(--text);
  box-shadow: inset 0 0 0 1px var(--border); font-size: 13.5px; white-space: nowrap;
}
.lang .ico { width: 15px; height: 15px; color: var(--text-muted); }
.lang__caret { color: var(--text-muted); font-size: 11px; }
.lang__short { display: none; }
.language-menu {
  position: absolute; z-index: 8; top: calc(100% + 12px); right: 0;
  width: 200px; padding: 8px; margin: 0; list-style: none;
  background: var(--bg-panel); color: var(--text);
  border-radius: var(--r-card); box-shadow: var(--shadow-float);
}
.language-menu a { display: flex; align-items: center; min-height: 44px; padding: 10px 16px; border-radius: var(--r-mark); }
.language-menu a[aria-current] { background: var(--accent-a06); color: var(--accent); }
.menu-toggle {
  display: none; align-items: center; justify-content: center; min-width: 44px; min-height: 44px;
  border: 0; border-radius: var(--r-pill); background: var(--bg-panel); color: var(--accent);
}
.menu-toggle svg { width: 22px; height: 22px; }
.mobile-drawer { display: none; }
.menu-veil { display: none; }
.site-footer {
  position: relative; background: var(--bg); color: var(--text);
  padding-top: 80px; padding-bottom: 32px;
}
.footer-grid { display: grid; grid-template-columns: 1.4fr .8fr 1.2fr .7fr; gap: 48px; }
.footer-brand p { max-width: 340px; margin-top: 24px; color: var(--text-muted); font-size: 14px; }
.footer-title { margin-top: 0; margin-bottom: 20px; font-family: var(--font-display); font-size: 20px; }
.footer-list { list-style: none; padding: 0; margin: 0; }
.footer-list a { display: inline-block; padding-block: 6px; color: var(--text-muted); font-size: 14px; }
.footer-list a:hover { color: var(--accent); }
.footer-bottom { display: flex; flex-wrap: wrap; gap: 16px 32px; justify-content: space-between; margin-top: 64px; color: var(--text-muted); font-size: 12px; }
.footer-bottom p { margin: 0; }
.footer-legal { display: flex; flex-wrap: wrap; gap: 20px; }
@media (max-width: 1279px) {
  .topbar { display: flex; padding-inline: 24px; }
  .topbar > .brand { min-width: 0; flex-shrink: 1; }
  .topbar .brand__name { overflow-wrap: anywhere; }
  .topbar > .nav { display: none; }
  .header-tools { margin-left: auto; }
  .menu-toggle { display: inline-flex; }
  .mobile-drawer:not([hidden]) {
    display: block; position: absolute; z-index: 7; inset-inline: 16px; top: calc(100% + 8px);
    max-height: calc(100dvh - var(--header-height) - 32px); overflow-y: auto; overscroll-behavior: contain;
    padding: 20px; background: var(--bg-panel); color: var(--text);
    border-radius: var(--r-card); box-shadow: var(--shadow-float);
  }
  .mobile-drawer ul { list-style: none; padding: 0; margin: 0; }
  .mobile-drawer a { display: flex; width: 100%; align-items: center; gap: 12px; min-height: 48px; padding: 12px 16px; border-radius: var(--r-mark); }
  .mobile-drawer a[aria-current] { background: var(--accent-a06); color: var(--accent); }
  .mobile-drawer .ico { width: 18px; height: 18px; }
  .drawer-label { margin: 24px 16px 8px; color: var(--text-muted); font-size: 13px; }
  .menu-veil:not([hidden]) { display: block; position: fixed; z-index: 1; inset: var(--header-height) 0 0; border: 0; background: var(--accent-a18); color: var(--text); }
  .footer-grid { grid-template-columns: 1.2fr 1fr; }
}
@media (max-width: 768px) {
  h1 { font-size: clamp(24px,5vw,30px); }
  .grid-two { grid-template-columns: minmax(0,1fr); }
}
@media (max-width: 640px) {
  :root { --gutter: 16px; }
  .wrap { padding-inline: var(--gutter); }
  .topbar { padding-inline: 16px; gap: 8px; }
  .brand { gap: 8px; }
  .brand__name { font-size: 15px; }
  .header-tools { margin-left: auto; gap: 4px; }
  .lang { padding-inline: 10px; min-height: 44px; }
  .lang__full { display: none; }
  .lang__short { display: inline; }
  .lang > .ico { display: none; }
  .card, .panel { padding: 24px; }
  .footer-grid { grid-template-columns: minmax(0,1fr); gap: 32px; }
  .footer-bottom { margin-top: 40px; }
  .tilt, [data-tilt] { transform: none !important; }
  pre { padding: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, html.reveal-ready .reveal { transition: none; }
  .btn:hover, html.reveal-ready .reveal:not(.shown) { transform: none; }
}