:root {
  --c-bg: #FFFFFF;
  --c-panel: #F6F8F7;
  --c-panel-2: #EEF2F0;
  --c-border: #E2E7E4;
  --c-border-strong: #C9D1CC;
  --c-accent: #09BC6C;
  --c-accent-button: #09834C;
  --c-accent-dark: #087A47;
  --c-mint: #D5F5E4;
  --c-text: #101512;
  --c-muted: #5B6560;
  --c-faint: #8B9590;
  --c-success: #12A35A;
  --c-warn: #D98A0B;
  --c-error: #D6453D;
  --c-on-accent: #FFFFFF;
  --c-stage-from: #09BC6C;
  --c-stage-mid: #2E7A55;
  --c-stage-to: #0B1A13;
  --c-stage-glow: rgba(255,255,255,.16);
  --c-stage-edge: rgba(255,255,255,.14);
  --c-on-dark: #FFFFFF;
  --c-on-dark-muted: rgba(255,255,255,.86);
  --c-on-stage-light-muted: rgba(11,26,19,.85);
  --c-link-line: rgba(255,255,255,.55);
  --c-veil: rgba(11,26,19,.36);
  --c-transparent: transparent;

  --font-display: "Inter","Noto Sans SC","PingFang SC","Hiragino Sans GB","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;
  --fs-xs: 12px;
  --fs-sm: 13px;
  --fs-ui: 14px;
  --fs-nav: 15px;
  --fs-body: 16px;
  --fs-lead: 17px;
  --fs-h3: 20px;
  --fs-h2: 28px;
  --fs-h1: clamp(34px,3.4vw,48px);
  --fs-h1-mobile: clamp(24px,4.4vw,30px);
  --weight-normal: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;
  --weight-heavy: 800;
  --weight-display: 900;
  --tracking-title: -.02em;
  --tracking-ui: -.005em;

  --r-ctl: 6px;
  --r-card: 10px;
  --r-stage: 16px;
  --r-tag: 4px;
  --r-pill: 999px;
  --r-dot: 50%;
  --sh-card: 0 1px 2px rgba(16,21,18,.05),0 6px 20px rgba(16,21,18,.06);
  --sh-mid: 0 2px 6px rgba(11,26,19,.12),0 18px 40px rgba(11,26,19,.22);
  --sh-front: 0 4px 10px rgba(11,26,19,.14),0 30px 64px rgba(11,26,19,.30);
  --sh-switch: 0 1px 2px rgba(11,26,19,.25);
  --ring-focus: 0 0 0 3px var(--c-mint);
  --stage-paint: radial-gradient(120% 90% at 8% 0%,var(--c-stage-glow) 0%,var(--c-transparent) 55%),linear-gradient(122deg,var(--c-stage-from) 0%,var(--c-stage-mid) 36%,var(--c-stage-to) 80%);

  --w-content: 1200px;
  --w-header: 1280px;
  --w-reading: 800px;
  --w-stage: 1360px;
  --gutter: 32px;
  --h-nav: 68px;
  --space-section: 80px;
  --motion-fast: .15s;
  --motion-reveal: .5s;
  --ease-reveal: cubic-bezier(.2,.6,.3,1);
  --z-header: 50;
  --z-veil: 1;
  --z-drawer: 3;
  --z-fab: 35;
}

*,*::before,*::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--h-nav) + 24px); }
html.nav-open { overflow: hidden; }
body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  font-weight: var(--weight-normal);
  line-height: 1.6;
  color: var(--c-text);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
}
main,section,article,aside,nav,header,footer,div,li { min-width: 0; }
img,svg,video { max-width: 100%; }
img { display: block; height: auto; }
svg { display: block; flex-shrink: 0; }
a { color: inherit; text-decoration: none; }
button,input,select,textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: var(--c-transparent); border: 0; padding: 0; }
button:disabled { cursor: not-allowed; }
button,a,input,select,textarea,summary { -webkit-tap-highlight-color: var(--c-mint); }
:where(a,button,input,select,textarea,summary):focus-visible {
  outline: 2px solid var(--c-accent-dark);
  outline-offset: 3px;
  border-radius: var(--r-ctl);
}
[hidden] { display: none !important; }
::selection { background: var(--c-mint); color: var(--c-text); }
h1,h2,h3,h4 {
  font-family: var(--font-display);
  font-weight: var(--weight-display);
  line-height: 1.2;
  letter-spacing: var(--tracking-title);
  text-wrap: balance;
  overflow-wrap: break-word;
}
h1 { font-size: var(--fs-h1); line-height: 1.14; margin-bottom: 16px; }
h2 { font-size: var(--fs-h2); margin-bottom: 12px; }
h3 { font-size: var(--fs-h3); margin-bottom: 10px; }
h4 { font-size: var(--fs-body); }
p { overflow-wrap: break-word; }
strong { font-weight: var(--weight-bold); }
small { font-size: var(--fs-sm); }
code,kbd,pre { font-family: var(--font-mono); }
code { font-size: .9em; overflow-wrap: anywhere; }
pre {
  max-width: 100%;
  overflow-x: auto;
  padding: 20px;
  border: 1px solid var(--c-border);
  border-radius: var(--r-card);
  background: var(--c-panel);
  color: var(--c-text);
  tab-size: 2;
}
pre code { overflow-wrap: normal; word-break: normal; white-space: pre; }
hr { border: 0; border-top: 1px solid var(--c-border); }
.wrap {
  width: 100%;
  max-width: calc(var(--w-content) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.reading { max-width: calc(var(--w-reading) + var(--gutter) * 2); }
.section { padding-top: var(--space-section); padding-bottom: var(--space-section); }
.section-panel { background: var(--c-panel); color: var(--c-text); }
.section-intro { color: var(--c-muted); max-width: 65ch; margin-bottom: 28px; }
.muted { color: var(--c-muted); }
.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;
}
.grid { display: grid; gap: 24px; }
.grid > * { min-width: 0; }
.grid-2 { grid-template-columns: repeat(2,minmax(0,1fr)); }
.grid-3 { grid-template-columns: repeat(3,minmax(0,1fr)); }
.grid-4 { grid-template-columns: repeat(4,minmax(0,1fr)); }
.stack > * + * { margin-top: 20px; }
.flow > * + * { margin-top: 12px; }
.prose { min-width: 0; line-height: 1.85; }
.prose :where(p,ul,ol,pre,blockquote,figure,table) { margin-block: 18px; }
.prose :where(ul,ol) { padding-left: 1.5em; }
.prose li + li { margin-top: 8px; }
.prose h2 { margin-top: 48px; }
.prose h3 { margin-top: 30px; }
.prose a:not(.btn) { color: var(--c-accent-dark); text-decoration: underline; text-underline-offset: 3px; }
.prose :not(pre) > code { background: var(--c-panel-2); color: var(--c-text); border-radius: var(--r-tag); padding: .1em .3em; }
.prose img { margin-inline: auto; }
.panel,.surface-card {
  padding: 24px;
  border: 1px solid var(--c-border);
  border-radius: var(--r-card);
  background: var(--c-bg);
  color: var(--c-text);
  box-shadow: var(--sh-card);
}
.panel-soft { background: var(--c-panel); color: var(--c-text); }

.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }
.btn {
  display: inline-flex; justify-content: center; align-items: center; gap: 9px;
  min-height: 48px; padding: 10px 22px; max-width: 100%;
  border: 1px solid var(--c-transparent); border-radius: var(--r-ctl);
  font-size: var(--fs-body); font-weight: var(--weight-bold);
  line-height: 1.4; letter-spacing: var(--tracking-ui); text-align: center;
  transition: background-color var(--motion-fast),border-color var(--motion-fast),color var(--motion-fast);
}
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--c-accent-button); color: var(--c-on-accent); }
.btn-primary:hover,.btn-primary.is-hover { background: var(--c-accent-dark); color: var(--c-on-accent); }
.btn-ghost { background: var(--c-bg); color: var(--c-text); border-color: var(--c-border-strong); font-weight: var(--weight-semibold); }
.btn-ghost:hover,.btn-ghost.is-hover { border-color: var(--c-text); }
.btn-text { color: var(--c-accent-dark); background: var(--c-transparent); padding-inline: 0; }
.btn:disabled,.btn[aria-disabled="true"] { background: var(--c-panel-2); color: var(--c-muted); border-color: var(--c-border); }
.btn.is-focus { outline: 2px solid var(--c-accent-dark); outline-offset: 3px; }
.btn-small { min-height: 40px; font-size: var(--fs-ui); padding: 8px 16px; }

/* 页头使用独立的宽版心，不依赖正文 wrap。 */
.site-head,#site-header {
  position: sticky; top: 0; z-index: var(--z-header);
  background: var(--c-bg); color: var(--c-text);
  box-shadow: inset 0 -1px 0 var(--c-border);
}
.head-shell {
  position: relative; display: flex; align-items: center; gap: 32px;
  width: 100%; max-width: min(100%,calc(var(--w-header) + var(--gutter) * 2));
  min-height: var(--h-nav); margin-inline: auto; padding-inline: var(--gutter);
}
.brand {
  display: inline-flex; align-items: center; gap: 10px; flex-shrink: 0;
  font-family: var(--font-display); font-size: 19px; font-weight: var(--weight-display);
  letter-spacing: var(--tracking-title);
}
.brand-mark { width: 30px; height: 30px; flex-shrink: 0; }
.desktop-nav { margin-left: auto; min-width: 0; align-self: stretch; }
.tabs { display: flex; align-items: center; list-style: none; margin: 0; padding: 0; height: 100%; gap: 0; }
.tabs li { height: 100%; }
.tabs a {
  position: relative; display: flex; align-items: center; height: 100%; min-height: 44px;
  padding: 0 17px; white-space: nowrap; font-size: var(--fs-nav);
  font-weight: var(--weight-medium); color: var(--c-muted);
  transition: color var(--motion-fast);
}
.tabs a:hover { color: var(--c-text); }
.tabs a[aria-current="page"] { color: var(--c-text); font-weight: var(--weight-bold); }
.tabs a[aria-current="page"]::after {
  content: ""; position: absolute; left: 17px; right: 17px; bottom: 0; height: 3px;
  border-radius: var(--r-tag) var(--r-tag) 0 0; background: var(--c-accent); color: var(--c-text);
}
.head-tools { display: flex; align-items: center; gap: 10px; flex-shrink: 0; position: relative; z-index: var(--z-drawer); }
.language { position: relative; }
.lang {
  display: flex; align-items: center; gap: 7px; min-height: 36px; padding: 7px 12px;
  border: 1px solid var(--c-border); border-radius: var(--r-ctl);
  font-size: var(--fs-ui); font-weight: var(--weight-medium);
  color: var(--c-text); background: var(--c-bg); white-space: nowrap;
}
.lang:hover { border-color: var(--c-border-strong); }
.lang svg { width: 16px; height: 16px; color: var(--c-muted); }
.caret { font-size: var(--fs-xs); color: var(--c-muted); }
.lang-short { display: none; }
.language-menu {
  position: absolute; right: 0; top: calc(100% + 10px); width: 190px; padding: 6px;
  border: 1px solid var(--c-border); border-radius: var(--r-card);
  background: var(--c-bg); color: var(--c-text); box-shadow: var(--sh-card);
}
.language-menu a { display: flex; align-items: center; min-height: 44px; padding: 10px 12px; border-radius: var(--r-ctl); }
.language-menu a:hover,.language-menu a[aria-current="true"] { background: var(--c-panel); color: var(--c-accent-dark); }
.menu-toggle {
  display: none; align-items: center; justify-content: center; min-width: 44px; min-height: 44px;
  border: 1px solid var(--c-border); border-radius: var(--r-ctl);
  background: var(--c-bg); color: var(--c-text);
}
.menu-toggle svg { width: 20px; height: 20px; }
.mobile-drawer {
  position: absolute; top: 100%; left: 0; right: 0; z-index: var(--z-drawer);
  max-height: calc(100dvh - var(--h-nav)); overflow-y: auto; overscroll-behavior: contain;
  padding: 16px var(--gutter) 24px; border-bottom: 1px solid var(--c-border);
  background: var(--c-bg); color: var(--c-text); box-shadow: var(--sh-card);
}
.mobile-drawer ul { list-style: none; margin: 0; padding: 0; }
.mobile-drawer a {
  display: flex; align-items: center; width: 100%; min-height: 48px;
  padding: 12px 14px; border-radius: var(--r-ctl);
}
.mobile-drawer a:hover,.mobile-drawer a[aria-current] { background: var(--c-panel); color: var(--c-accent-dark); }
.drawer-label { padding: 18px 14px 6px; font-size: var(--fs-sm); color: var(--c-muted); border-top: 1px solid var(--c-border); margin-top: 12px; }
.menu-veil { position: fixed; inset: var(--h-nav) 0 0; z-index: var(--z-veil); background: var(--c-veil); color: var(--c-on-dark); }

/* 页脚 */
.site-foot,#site-footer { background: var(--c-panel); color: var(--c-text); }
.foot-main { display: grid; grid-template-columns: 1.35fr .8fr 1.3fr .7fr; gap: 40px; padding-top: 56px; padding-bottom: 40px; }
.foot-brand p { max-width: 30ch; margin-top: 16px; font-size: var(--fs-ui); color: var(--c-muted); }
.foot-title { font-size: var(--fs-ui); font-weight: var(--weight-bold); margin-bottom: 12px; }
.foot-links { list-style: none; padding: 0; margin: 0; }
.foot-links a { display: inline-block; padding-block: 6px; font-size: var(--fs-ui); color: var(--c-muted); overflow-wrap: anywhere; }
.foot-links a:hover { color: var(--c-accent-dark); text-decoration: underline; text-underline-offset: 3px; }
.foot-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px; padding-top: 22px; padding-bottom: 28px; border-top: 1px solid var(--c-border); font-size: var(--fs-sm); color: var(--c-muted); }
.legal-links { display: flex; flex-wrap: wrap; gap: 20px; }

/* 默认可见；只有脚本成功初始化的节点才进入淡入准备态。 */
.reveal { opacity: 1; transform: none; }
.reveal.reveal-pending { opacity: 0; transform: translateY(16px); transition: opacity var(--motion-reveal) var(--ease-reveal),transform var(--motion-reveal) var(--ease-reveal); }
.reveal.shown { opacity: 1; transform: none; }
.decorated-section { position: relative; overflow-x: clip; }
.decor-background { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

@media (max-width:1120px) {
  .desktop-nav { display: none; }
  .head-tools { margin-left: auto; }
  .menu-toggle { display: flex; }
  .head-shell { gap: 16px; }
}
@media (min-width:1121px) {
  .mobile-drawer,.menu-veil { display: none !important; }
}
@media (max-width:980px) {
  .grid-3,.grid-4 { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .foot-main { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width:768px) {
  h1 { font-size: var(--fs-h1-mobile); }
}
@media (max-width:640px) {
  :root { --gutter: 16px; --space-section: 52px; --fs-h2: 24px; }
  .grid-2,.grid-3,.grid-4 { grid-template-columns: minmax(0,1fr); }
  .panel,.surface-card { padding: 20px; }
  .tilt,[data-tilt] { transform: none !important; }
  .foot-main { gap: 28px 20px; }
  .foot-brand { grid-column: 1 / -1; }
  .head-shell { gap: 8px; }
  .brand { font-size: var(--fs-lead); gap: 7px; }
  .head-tools { gap: 6px; margin-left: auto; }
  .lang { min-height: 44px; padding-inline: 10px; }
  .lang-full { display: none; }
  .lang-short { display: inline; }
}
@media (prefers-reduced-motion:reduce) {
  html { scroll-behavior: auto; }
  *,*::before,*::after { animation: none !important; transition: none !important; }
  .reveal.reveal-pending { opacity: 1; transform: none; }
}