:root {
  --bg: #F5F6F4;
  --bg-panel: #FFFFFF;
  --bg-panel-2: #E9EBE7;
  --border: #DCDFDA;
  --accent: #2F5D62;
  --accent-dark: #1E3F43;
  --text: #141614;
  --text-muted: #5E625D;
  --success: #2E7D4F;
  --warn: #A86F1A;
  --error: #B3261E;
  --tile-pine: #A8BFBA;
  --tile-clay: #C9A48A;
  --tile-heather: #B3ADC9;
  --paper-soft: #FAFAF8;
  --mute-dot: #C9CDC7;
  --on-ink: #FFFFFF;
  --on-ink-soft: rgba(255,255,255,0.74);
  --ink-line: rgba(255,255,255,0.14);
  --ink-edge: #10282B;
  --edge: rgba(20,22,20,0.18);
  --clear: transparent;
  --veil: rgba(20,22,20,0.3);
  --font-display: "Inter","Noto Sans SC","PingFang SC","Hiragino Sans","Microsoft YaHei","Apple SD Gothic Neo","Malgun Gothic",system-ui,sans-serif;
  --font-body: "Inter","Noto Sans SC","PingFang SC","Hiragino Sans","Microsoft YaHei","Apple SD Gothic Neo","Malgun Gothic",system-ui,sans-serif;
  --font-mono: "JetBrains Mono",ui-monospace,"SFMono-Regular",Menlo,Consolas,monospace;
  --weight-body: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;
  --weight-display: 800;
  --r-pill: 999px;
  --r-shell: 32px;
  --r-tile: 28px;
  --r-window: 16px;
  --r-card: 12px;
  --r-seg: 10px;
  --r-cell: 8px;
  --r-seg-item: 7px;
  --r-circle: 50%;
  --gutter: 48px;
  --content-width: 1200px;
  --reading-width: 800px;
  --header-width: 1280px;
  --header-height: 72px;
  --tile-w: 41.6vw;
  --tile-h: 520px;
  --space-section: 120px;
  --ease: 200ms ease;
  --reveal-duration: 600ms;
  --flat-edge: 0 1px 0 var(--edge);
}
*, *::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: 16px;
  font-weight: var(--weight-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
[hidden] { display: none !important; }
img, svg { max-width: 100%; vertical-align: middle; }
img { height: auto; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: var(--clear); }
button { cursor: pointer; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 4px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
::selection { background: var(--accent); color: var(--on-ink); }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: var(--weight-display); text-wrap: balance; overflow-wrap: break-word; }
h1 { font-size: clamp(34px,3.35vw,48px); line-height: 1.16; letter-spacing: -0.018em; }
h2 { font-size: clamp(26px,2.5vw,36px); line-height: 1.2; letter-spacing: -0.015em; }
h3 { font-size: 22px; line-height: 1.3; }
p { margin: 0 0 1.2em; }
code, pre { font-family: var(--font-mono); }
code { overflow-wrap: anywhere; }
pre {
  max-width: 100%;
  min-width: 0;
  margin: 0;
  padding: 24px 26px;
  overflow-x: auto;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  font-size: 13.5px;
  line-height: 1.8;
  tab-size: 2;
}
pre code { overflow-wrap: normal; word-break: normal; white-space: pre; }
svg, .icon, .facts-dot { flex-shrink: 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(--space-section); padding-bottom: var(--space-section); }
.grid { display: grid; gap: 24px; }
.grid-two { grid-template-columns: repeat(2,minmax(0,1fr)); }
.grid-three { grid-template-columns: repeat(3,minmax(0,1fr)); }
.grid > *, .doc-body > *, .footer-grid > *, .topbar > *, .prose, .prose div { min-width: 0; }
.section-head { margin: 0 auto 36px; text-align: center; max-width: 760px; }
.section-head h2 { margin: 0; }
.section-head p { margin: 14px 0 0; color: var(--text-muted); }
.muted { color: var(--text-muted); }
.accent { color: var(--accent); }
.mono { font-family: var(--font-mono); }
.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 {
  position: absolute; left: 16px; top: 12px; z-index: 100;
  border-radius: var(--r-pill);
  background: var(--accent-dark); color: var(--on-ink);
  font-size: 14px; font-weight: var(--weight-semibold);
  width: 1px; height: 1px; padding: 0; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}
.skip:focus { width: auto; height: auto; padding: 10px 18px; overflow: visible; clip-path: none; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 12px 28px;
  border: 1px solid var(--clear); border-radius: var(--r-pill);
  background: var(--bg-panel); color: var(--text);
  font-family: var(--font-body); font-size: 16px; font-weight: var(--weight-semibold); line-height: 1.3;
  text-align: center; text-decoration: none;
  transition: background-color var(--ease),color var(--ease),border-color var(--ease);
}
.btn svg { width: 18px; height: 18px; }
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--accent-dark); color: var(--on-ink); }
.btn-primary:hover, .btn-primary.is-hover { background: var(--accent); color: var(--on-ink); }
.btn-ghost { background: var(--clear); color: var(--text); border-color: var(--text); padding-inline: 27px; }
.btn-ghost:hover, .btn-ghost.is-hover { background: var(--bg-panel-2); color: var(--text); }
.btn-small { min-height: 44px; padding: 10px 20px; font-size: 14px; }
.btn:focus-visible, .btn.is-focus { outline: 2px solid var(--accent); outline-offset: 4px; }
.btn:disabled, .btn[aria-disabled="true"] { background: var(--bg-panel-2); color: var(--text-muted); border-color: var(--border); cursor: not-allowed; }
.cta { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.card, .panel {
  padding: 28px; border-radius: var(--r-tile);
  background: var(--bg-panel); color: var(--text);
}
.card { border: 1px solid var(--border); }
.panel { background: var(--bg-panel-2); color: var(--text); border-radius: var(--r-shell); }
.card h3 { margin-top: 0; }
.card p:last-child { margin-bottom: 0; }
.surface-white { background: var(--bg-panel); color: var(--text); }
.prose { line-height: 1.85; }
.prose h2 { margin: 2.5em 0 0.8em; }
.prose h3 { margin: 1.8em 0 0.7em; }
.prose li + li { margin-top: 8px; }
.prose pre { margin-block: 24px; }
.prose :not(pre) > code {
  padding: 2px 5px; border-radius: var(--r-cell);
  background: var(--bg-panel-2); color: var(--text);
  font-size: 0.9em;
}
.prose blockquote { margin-inline: 0; }
.prose a { text-decoration: underline; text-underline-offset: 4px; }
.prose img { max-width: 100%; }
section[id], h2[id], h3[id] { scroll-margin-top: 24px; }
.decorated, [data-hero-visual] { overflow-x: clip; }
.reveal { opacity: 1; transform: none; }
html.reveal-ready .reveal:not(.shown) { opacity: 0; transform: translateY(16px); }
html.reveal-ready .reveal { transition: opacity var(--reveal-duration) ease,transform var(--reveal-duration) ease; }
html.reveal-ready .reveal.shown { opacity: 1; transform: none; }

/* 独立宽版心：不复用正文 wrap。 */
#site-header, .preview-header { position: relative; z-index: 40; background: var(--bg); color: var(--text); }
.topbar {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  height: var(--header-height);
  width: 100%; max-width: min(100%,calc(var(--header-width) + var(--gutter) * 2));
  margin-inline: auto; padding-inline: var(--gutter);
}
.brand {
  justify-self: start; display: inline-flex; align-items: center; gap: 10px;
  flex-shrink: 0; color: var(--text); font-family: var(--font-display);
  font-weight: var(--weight-display); font-size: 17px; letter-spacing: -0.01em;
}
.brand:hover { text-decoration: none; }
.brand img { width: 32px; height: 32px; display: block; flex-shrink: 0; }
.nav { min-width: 0; }
.nav ul { display: flex; align-items: center; gap: 36px; list-style: none; margin: 0; padding: 0; }
.nav a {
  display: block; padding: 6px 0; color: var(--text-muted);
  font-size: 15px; font-weight: var(--weight-medium); white-space: nowrap;
  transition: color var(--ease);
}
.nav a:hover { color: var(--text); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--text); font-weight: var(--weight-bold); }
.header-tools { justify-self: end; display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.language { position: relative; }
.lang {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; padding: 0 15px; border: 1px solid var(--border); border-radius: var(--r-pill);
  background: var(--clear); color: var(--text); font-size: 14px; font-weight: var(--weight-medium); line-height: 1;
  white-space: nowrap;
}
.lang:hover { background: var(--bg-panel); color: var(--text); }
.lang svg { width: 15px; height: 15px; color: var(--text-muted); }
.lang-caret { font-size: 10px; color: var(--text-muted); }
.lang-short { display: none; }
.language-menu {
  position: absolute; right: 0; top: calc(100% + 10px); min-width: 180px;
  padding: 8px; margin: 0; list-style: none; border: 1px solid var(--border);
  border-radius: var(--r-window); background: var(--bg-panel); color: var(--text); z-index: 45;
}
.language-menu a { display: flex; align-items: center; min-height: 44px; padding: 10px 14px; color: var(--text); border-radius: var(--r-cell); }
.language-menu a:hover, .language-menu a[aria-current] { background: var(--bg-panel-2); color: var(--text); text-decoration: none; }
.menu-toggle {
  display: none; align-items: center; justify-content: center; min-width: 44px; min-height: 44px;
  border: 1px solid var(--border); border-radius: var(--r-pill); background: var(--bg); color: var(--text);
}
.menu-toggle svg { width: 20px; height: 20px; }
.menu-drawer {
  position: absolute; inset: var(--header-height) 0 auto;
  padding: 16px var(--gutter) 24px; background: var(--bg-panel); color: var(--text);
  border-bottom: 1px solid var(--border);
  max-height: calc(100dvh - var(--header-height)); overflow-y: auto; overscroll-behavior: contain;
  z-index: 42;
}
.menu-drawer ul { list-style: none; margin: 0; padding: 0; }
.menu-drawer a { display: flex; align-items: center; width: 100%; min-height: 46px; padding: 11px 12px; color: var(--text); }
.menu-drawer a:hover, .menu-drawer a[aria-current] { background: var(--bg-panel-2); color: var(--text); border-radius: var(--r-cell); text-decoration: none; }
.drawer-title { margin: 16px 12px 4px; font-size: 13px; color: var(--text-muted); }
.nav-veil { position: fixed; inset: var(--header-height) 0 0; z-index: 30; border: 0; background: var(--veil); color: var(--text); }
.preview-mobile { display: none; }

/* 已确认首屏：静态词条陈列，不添加终端或动画。 */
.hero { padding: 40px 24px 0; text-align: center; overflow-x: clip; }
.facts {
  display: inline-flex; align-items: center; flex-wrap: wrap; justify-content: center;
  margin: 0; padding: 4px; list-style: none; background: var(--bg-panel); color: var(--text-muted);
  border: 1px solid var(--border); border-radius: var(--r-pill);
}
.facts li { display: inline-flex; align-items: center; gap: 7px; padding: 4px 14px; font-size: 13px; line-height: 20px; }
.facts li + li { border-left: 1px solid var(--border); }
.facts b { font-family: var(--font-mono); font-size: 12.5px; font-weight: var(--weight-semibold); color: var(--text); }
.facts-dot { width: 6px; height: 6px; border-radius: var(--r-circle); background: var(--success); color: var(--on-ink); }
.hero-title { margin: 20px auto 0; font-size: clamp(26px,3.35vw,48px); }
.hero-title > span { display: block; }
.hero-title em { font-style: normal; color: var(--accent); }
.hero-lede { margin: 16px auto 0; max-width: 760px; font-size: 17px; line-height: 1.65; color: var(--text-muted); }
.hero-lede strong { color: var(--text); font-weight: var(--weight-semibold); }
.platforms { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 30px; margin: 24px 0 0; padding: 0; list-style: none; }
.platforms a { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: var(--weight-medium); line-height: 22px; color: var(--text-muted); }
.platforms a:hover { color: var(--accent); text-decoration: none; }
.platforms svg { width: 16px; height: 16px; }
.shelf { margin-top: 36px; overflow: hidden; }
.shelf-track { display: grid; grid-template-columns: repeat(3,var(--tile-w)); gap: 16px; justify-content: center; }
.tile { height: var(--tile-h); border-radius: var(--r-tile); display: flex; align-items: flex-start; padding-top: 40px; color: var(--text); min-width: 0; }
.tile-pine { background: var(--tile-pine); justify-content: flex-end; padding-right: 8%; }
.tile-clay { background: var(--tile-clay); justify-content: center; }
.tile-heather { background: var(--tile-heather); justify-content: flex-start; padding-left: 8%; }
.entry { width: 58%; min-width: 0; min-height: 440px; padding: 20px 26px 26px; border-radius: var(--r-card); box-shadow: var(--flat-edge); text-align: left; }
.tile-clay .entry { width: 64%; }
.entry-paper { background: var(--bg-panel); color: var(--text); }
.entry-soft { background: var(--paper-soft); color: var(--text); }
.entry-ink { background: var(--accent-dark); color: var(--on-ink); box-shadow: 0 1px 0 var(--ink-edge); }
.entry-head { display: flex; justify-content: space-between; align-items: center; padding-bottom: 12px; border-bottom: 1px solid var(--border); font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.02em; color: var(--text-muted); }
.entry-ink .entry-head { border-color: var(--ink-line); color: var(--on-ink-soft); }
.entry-term { margin: 18px 0 0; font-family: var(--font-mono); font-weight: var(--weight-bold); font-size: clamp(34px,3.1vw,46px); line-height: 1; letter-spacing: -0.045em; }
.entry-tag { display: inline-block; margin-top: 12px; padding: 2px 10px; border: 1px solid var(--border); border-radius: var(--r-pill); font-size: 12px; line-height: 18px; color: var(--text-muted); }
.entry-ink .entry-tag { border-color: var(--ink-line); color: var(--on-ink-soft); }
.entry-def { margin: 12px 0 0; font-size: 14px; line-height: 1.65; }
.seg { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 4px; margin-top: 18px; padding: 4px; background: var(--bg-panel-2); color: var(--text-muted); border-radius: var(--r-seg); }
.seg span { display: flex; align-items: center; justify-content: center; height: 34px; border-radius: var(--r-seg-item); font-family: var(--font-mono); font-size: 13px; font-weight: var(--weight-medium); }
.seg .is-on { background: var(--accent); color: var(--on-ink); font-weight: var(--weight-semibold); }
.entry-eg { margin-top: 20px; padding-top: 14px; border-top: 1px dashed var(--border); font-family: var(--font-mono); font-size: 12.5px; line-height: 1.8; }
.entry-eg .k, .yaml .k { color: var(--accent); }
.entry-eg .c, .yaml .c { color: var(--text-muted); }
.knobs { margin: 16px 0 0; padding: 0; list-style: none; }
.knobs li { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 40px; border-top: 1px solid var(--ink-line); }
.knobs li:last-child { border-bottom: 1px solid var(--ink-line); }
.knob-name { font-size: 14px; font-weight: var(--weight-semibold); color: var(--on-ink); }
.knob-name small { margin-left: 8px; font-family: var(--font-mono); font-size: 11.5px; font-weight: var(--weight-medium); color: var(--on-ink-soft); }
.knob-key { font-family: var(--font-mono); font-size: 13px; color: var(--on-ink-soft); }
.knob-val { font-family: var(--font-mono); font-size: 13px; font-weight: var(--weight-semibold); color: var(--on-ink); }
.switch { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--on-ink-soft); }
.switch i { position: relative; width: 38px; height: 22px; flex-shrink: 0; border-radius: var(--r-pill); background: var(--tile-pine); color: var(--text); }
.switch i::after { content: ""; position: absolute; top: 3px; right: 3px; width: 16px; height: 16px; border-radius: var(--r-circle); background: var(--on-ink); color: var(--text); }
.syntax { margin: 12px 0 0; font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); }
.syntax b { color: var(--text); font-weight: var(--weight-semibold); }
.rule-grid { margin-top: 14px; border: 1px solid var(--border); border-radius: var(--r-cell); background: var(--bg-panel); color: var(--text); overflow: hidden; }
.rule-row { display: grid; grid-template-columns: 1.35fr 1.15fr 0.8fr; }
.rule-row + .rule-row { border-top: 1px solid var(--border); }
.rule-row span { min-width: 0; padding: 10px; font-family: var(--font-mono); font-size: 12px; line-height: 1.3; overflow-wrap: anywhere; }
.rule-row span + span { border-left: 1px solid var(--border); }
.rule-head span { padding: 7px 10px; background: var(--bg-panel-2); color: var(--text-muted); font-family: var(--font-body); font-size: 11px; font-weight: var(--weight-semibold); }
.pol-proxy { color: var(--accent); font-weight: var(--weight-bold); }

/* 共享页脚 */
.site-footer { padding-top: 64px; padding-bottom: 96px; border-top: 1px solid var(--border); background: var(--bg-panel-2); color: var(--text); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1.4fr 0.8fr; gap: 40px; }
.footer-brand p { margin-top: 18px; max-width: 290px; font-size: 14px; color: var(--text-muted); }
.footer-title { margin: 0 0 18px; font-size: 14px; font-weight: var(--weight-bold); }
.footer-list { list-style: none; margin: 0; padding: 0; }
.footer-list li + li { margin-top: 10px; }
.footer-list a { color: var(--text-muted); font-size: 14px; }
.footer-list a:hover { color: var(--accent); }
.footer-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px 24px; margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--border); font-size: 13px; color: var(--text-muted); }
.footer-legal { display: flex; flex-wrap: wrap; gap: 20px; }
.footer-legal a { color: var(--text-muted); }

@media (max-width:1180px) {
  .nav ul { gap: 24px; }
}
@media (max-width:1100px) {
  .topbar { display: flex; gap: 16px; }
  .topbar > .nav { display: none; }
  .header-tools { margin-left: auto; }
  .menu-toggle { display: inline-flex; }
  .preview-mobile { display: block; }
  .preview-mobile summary { display: flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; cursor: pointer; }
  .preview-mobile nav { position: absolute; inset: var(--header-height) 0 auto; padding: 16px var(--gutter); background: var(--bg-panel); color: var(--text); border-bottom: 1px solid var(--border); max-height: calc(100dvh - var(--header-height)); overflow-y: auto; }
  .preview-mobile nav a { display: flex; align-items: center; min-height: 44px; padding: 10px; color: var(--text); }
}
@media (max-width:900px) {
  :root { --gutter: 20px; --tile-w: 80vw; --tile-h: 470px; --space-section: 80px; }
  .facts { border-radius: var(--r-card); }
  .facts li + li { border-left: 0; }
  .tile-pine, .tile-heather { justify-content: center; padding-left: 0; padding-right: 0; }
  .shelf { padding-inline: var(--gutter); }
  .shelf-track { grid-template-columns: minmax(0, 1fr); }
  .tile { height: auto; padding-block: 32px; }
  .entry, .tile-clay .entry { width: 84%; }
  .footer-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 32px; }
}
@media (max-width:768px) {
  h1, .hero-title { font-size: clamp(24px,4.2vw,30px); }
  .grid-three { grid-template-columns: 1fr; }
}
@media (max-width:640px) {
  :root { --gutter: 16px; --space-section: 64px; }
  .grid-two { grid-template-columns: 1fr; }
  .hero { padding-inline: var(--gutter); padding-top: 28px; }
  .hero-title { line-height: 1.25; }
  .hero-lede { font-size: 15px; }
  .facts li { padding-inline: 8px; font-size: 12px; }
  .facts b { font-size: 12px; }
  .platforms { gap: 10px 18px; }
  .brand { font-size: 15px; gap: 7px; }
  .brand img { width: 28px; height: 28px; }
  .header-tools { gap: 4px; margin-left: auto; }
  .lang { padding-inline: 10px; }
  .lang-full { display: none; }
  .lang-short { display: inline; }
  .card, .panel { padding: 22px; }
  .tilt, [data-tilt] { transform: none !important; }
  .footer-grid { grid-template-columns: 1fr; }
  .entry { padding-inline: 18px; }
  pre { padding: 18px; font-size: 12px; }
}
@media (prefers-reduced-motion:reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  html.reveal-ready .reveal:not(.shown) { opacity: 1; transform: none; }
}