:root {
  --bg: #fdfdfd;
  --bg-panel: #f7f7f7;
  --bg-panel2: #efefef;
  --surface: #ffffff;
  --border: #e6e6e6;
  --border-strong: #d9d9d9;
  --line: #bdbdbd;
  --accent: #3dbf8a;
  --accent-hover: #36b07e;
  --accent-dark: #1f8a5f;
  --accent-soft: #e3f5ec;
  --text: #171717;
  --text-muted: #6b6b6b;
  --success: #2f9e6a;
  --warn: #b7791f;
  --error: #d14343;
  --clear: transparent;
  --veil: rgba(23, 23, 23, .24);
  --radius: 6px;
  --radius-logo: 7px;
  --radius-shot: 10px;
  --radius-pill: 999px;
  --radius-round: 50%;
  --shadow-board: 0 1px 2px rgba(23, 23, 23, .04), 0 10px 24px -14px rgba(23, 23, 23, .12), 0 28px 56px -32px rgba(23, 23, 23, .14);
  --shadow-btn: 0 1px 0 rgba(23, 23, 23, .04);
  --font-display: 'Inter', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans', 'Apple SD Gothic Neo', 'Microsoft YaHei', sans-serif;
  --font-body: 'Inter', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Kaku Gothic ProN', 'Apple SD Gothic Neo', 'Microsoft YaHei', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --weight-regular: 400;
  --weight-medium: 500;
  --tracking-heading: -.025em;
  --tracking-cjk: -.02em;
  --container: 1200px;
  --reading: 800px;
  --header-container: 1280px;
  --gutter: 32px;
  --nav-h: 64px;
  --section-space: 144px;
  --card-gap: 20px;
  --stroke: 1.25;
  --duration-fast: 150ms;
  --duration-reveal: 600ms;
  --ease: cubic-bezier(.2, .65, .3, 1);
  --layer-veil: 30;
  --layer-header: 40;
  --layer-menu: 50;
  --layer-fab: 20;
}
*, *::before, *::after { box-sizing: border-box; }
html { 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;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
main, section, article, aside, nav, div, figure { min-width: 0; }
img, svg { max-width: 100%; }
img { vertical-align: middle; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: var(--clear); }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
a, button { touch-action: manipulation; }
:focus-visible {
  outline: 2px solid var(--accent-dark);
  outline-offset: 3px;
}
[hidden] { display: none !important; }
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: var(--weight-regular);
  letter-spacing: var(--tracking-heading);
  text-wrap: balance;
}
:lang(zh-CN) h1, :lang(zh-CN) h2, :lang(zh-CN) h3,
:lang(zh-TW) h1, :lang(zh-TW) h2, :lang(zh-TW) h3,
:lang(ja) h1, :lang(ja) h2, :lang(ja) h3,
:lang(ko) h1, :lang(ko) h2, :lang(ko) h3 {
  letter-spacing: var(--tracking-cjk);
}
h1 { font-size: clamp(34px, 3.3vw, 48px); line-height: 1.14; }
h2 { font-size: clamp(26px, 2.5vw, 36px); line-height: 1.3; }
h3 { font-size: 21px; line-height: 1.4; }
p { margin-block: 0 1em; }
strong { color: var(--text); font-weight: var(--weight-medium); }
small { font-size: 13px; }
code, pre, kbd { font-family: var(--font-mono); }
code { font-size: .875em; overflow-wrap: anywhere; }
pre {
  max-width: 100%;
  min-width: 0;
  margin-block: 20px;
  padding: 20px;
  overflow-x: auto;
  background: var(--bg-panel);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  line-height: 1.75;
  tab-size: 2;
  -webkit-overflow-scrolling: touch;
}
pre code { white-space: pre; overflow-wrap: normal; word-break: normal; }
ul, ol { padding-inline-start: 1.5em; }
hr { border: 0; border-top: 1px solid var(--border); margin-block: 32px; }
.wrap {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.reading { max-width: calc(var(--reading) + var(--gutter) * 2); }
.section { padding-top: var(--section-space); padding-bottom: var(--section-space); }
.section + .section { padding-top: 0; }
.section-head { max-width: 760px; margin-bottom: 36px; }
.section-head h2 { margin-block: 12px 16px; }
.section-head p, .muted { color: var(--text-muted); }
.kicker {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .04em;
  color: var(--accent-dark);
}
.keep { white-space: nowrap; }
.text-link { text-decoration: underline; text-underline-offset: 4px; }
.text-link:hover { color: var(--accent-dark); }
.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;
  inset-block-start: 8px;
  inset-inline-start: var(--gutter);
  z-index: var(--layer-menu);
  transform: translateY(-160%);
  padding: 10px 16px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--accent-dark);
  border-radius: var(--radius);
}
.skip-link:focus { transform: translateY(0); }
.btn {
  min-height: 44px;
  padding: 10px 18px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 9px;
  max-width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-size: 15px;
  font-weight: var(--weight-medium);
  letter-spacing: -.005em;
  line-height: 1.4;
  box-shadow: var(--shadow-btn);
  transition: background-color var(--duration-fast), border-color var(--duration-fast);
}
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.btn-primary { background: var(--accent); color: var(--text); border-color: var(--accent-dark); }
.btn-primary:hover, .btn-primary.is-hover { background: var(--accent-hover); color: var(--text); }
.btn-ghost { background: var(--surface); color: var(--text); }
.btn-ghost:hover, .btn-ghost.is-hover { border-color: var(--text-muted); }
.btn .arr { color: var(--text-muted); font-weight: var(--weight-regular); }
.btn:active, .btn.is-active { border-color: var(--text); }
.btn:disabled, .btn[aria-disabled="true"] {
  background: var(--bg-panel2);
  color: var(--text-muted);
  border-color: var(--border);
  cursor: not-allowed;
  box-shadow: none;
}
.cta { margin-top: 32px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.card, .panel {
  min-width: 0;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
}
.card { transition: border-color var(--duration-fast); }
.card:hover { border-color: var(--text-muted); }
.card h3, .panel h3 { margin-block: 0 16px; }
.card p, .panel p { color: var(--text-muted); }
.card p:last-child, .panel p:last-child { margin-bottom: 0; }
.grid-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--card-gap); }
.grid-three { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--card-gap); }
.prose { min-width: 0; color: var(--text-muted); line-height: 1.85; }
.prose h2, .prose h3 { color: var(--text); scroll-margin-top: 32px; }
.prose h2 { margin-top: 72px; }
.prose h3 { margin-top: 36px; }
.prose a:not([class*="btn"]):not([class*="button"]) { color: var(--accent-dark); text-decoration: underline; text-underline-offset: 3px; }
.prose li + li { margin-top: 8px; }
.prose > :first-child { margin-top: 0; }
.reveal { opacity: 1; transform: none; }
.reveal.reveal-pending {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity var(--duration-reveal) var(--ease), transform var(--duration-reveal) var(--ease);
}
.reveal.shown { opacity: 1; transform: none; }
.decorated, .hero, .hero-canvas { overflow-x: clip; }

/* 页头使用独立宽版心；正文的 wrap 不参与导航布局。 */
#site-header, .topbar { position: relative; z-index: var(--layer-header); }
.topbar { height: var(--nav-h); border-bottom: 1px solid var(--border); background: var(--bg); color: var(--text); }
.topbar-in {
  width: 100%;
  max-width: min(100%, calc(var(--header-container) + var(--gutter) * 2));
  height: 100%;
  margin-inline: auto;
  padding-inline: var(--gutter);
  display: flex;
  align-items: center;
  gap: 40px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand-logo { display: block; width: 28px; height: 28px; flex-shrink: 0; }
.brand-name { font-size: 15px; font-weight: var(--weight-medium); letter-spacing: -.01em; }
.brand-mark {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: var(--radius-logo);
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-strong);
  position: relative;
}
.brand-mark::after {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}
.mainnav { min-width: 0; margin-left: auto; }
.mainnav ul {
  display: flex;
  align-items: center;
  list-style: none;
  gap: 30px;
  margin: 0;
  padding: 0;
}
.mainnav li { flex-shrink: 0; }
.mainnav a { display: block; padding-block: 12px; font-size: 14px; white-space: nowrap; color: var(--text-muted); }
.mainnav a:hover { color: var(--text); }
.mainnav a[aria-current="page"] { color: var(--text); font-weight: var(--weight-medium); }
.navtools { display: flex; align-items: center; gap: 16px; flex-shrink: 0; }
.navtools .sep { width: 1px; height: 18px; background: var(--border); }
.lang-wrap { position: relative; }
.lang {
  min-height: 32px;
  padding: 5px 10px 5px 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  white-space: nowrap;
}
.lang:hover { border-color: var(--text-muted); }
.caret { color: var(--text-muted); font-size: 11px; }
.lang-menu {
  position: absolute;
  inset-block-start: calc(100% + 10px);
  inset-inline-end: 0;
  width: 180px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  z-index: var(--layer-menu);
}
.lang-menu a { display: flex; align-items: center; min-height: 44px; padding: 8px 12px; border-radius: var(--radius); font-size: 14px; }
.lang-menu a:hover, .lang-menu a[aria-current="true"] { background: var(--bg-panel); color: var(--text); }
.menu-toggle {
  display: none;
  min-width: 44px;
  min-height: 44px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
}
.menu-toggle svg { display: block; width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: var(--stroke); }
.mobile-nav { display: none; }
.nav-veil {
  position: fixed;
  inset: var(--nav-h) 0 0;
  z-index: var(--layer-veil);
  border: 0;
  padding: 0;
  background: var(--veil);
  color: var(--text);
}

/* 页脚 */
.site-footer { border-top: 1px solid var(--border); background: var(--bg-panel); color: var(--text); padding-top: 64px; padding-bottom: 28px; }
.footer-grid { display: grid; grid-template-columns: 1.3fr .8fr 1.5fr; gap: 48px; }
.footer-brand p { max-width: 26em; margin-top: 20px; color: var(--text-muted); font-size: 14px; }
.footer-title { margin-block: 0 16px; font-size: 14px; font-weight: var(--weight-medium); }
.footer-links { list-style: none; margin: 0; padding: 0; }
.footer-links a { display: block; padding-block: 6px; color: var(--text-muted); font-size: 14px; overflow-wrap: anywhere; }
.footer-links a:hover { color: var(--text); text-decoration: underline; text-underline-offset: 4px; }
.footer-languages { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 36px; }
.footer-languages a { display: inline-flex; align-items: center; min-height: 44px; font-size: 13px; color: var(--text-muted); }
.footer-languages a[aria-current="true"] { color: var(--text); }
.footer-bottom { border-top: 1px solid var(--border); padding-top: 22px; margin-top: 20px; display: flex; flex-wrap: wrap; gap: 12px 28px; justify-content: space-between; color: var(--text-muted); font-size: 12px; }
.footer-bottom p { margin: 0; }

@media (max-width: 1280px) {
  .topbar-in { gap: 24px; }
  .mainnav ul { gap: 20px; }
}
@media (max-width: 1100px) {
  .mainnav { display: none; }
  .navtools { margin-left: auto; gap: 10px; }
  .navtools .sep { display: none; }
  .menu-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .mobile-nav:not([hidden]) {
    display: block;
    position: absolute;
    inset-block-start: var(--nav-h);
    inset-inline: 0;
    padding: 16px var(--gutter) 24px;
    max-height: calc(100vh - var(--nav-h));
    max-height: calc(100dvh - var(--nav-h));
    overflow-y: auto;
    overscroll-behavior: contain;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    z-index: var(--layer-menu);
  }
  .mobile-nav ul { list-style: none; padding: 0; margin: 0; }
  .mobile-nav a { display: flex; width: 100%; align-items: center; min-height: 48px; padding: 12px 8px; border-bottom: 1px solid var(--border); font-size: 15px; }
  .mobile-nav a[aria-current] { font-weight: var(--weight-medium); }
  .mobile-language-title { margin-block: 24px 8px; color: var(--text-muted); font-size: 12px; }
}
@media (max-width: 960px) {
  :root { --gutter: 24px; --section-space: 96px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .footer-brand { grid-column: 1 / -1; }
  .grid-three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
  h1 { font-size: clamp(24px, 5vw, 30px); }
}
@media (max-width: 640px) {
  :root { --gutter: 20px; --section-space: 80px; }
  .topbar-in { gap: 12px; }
  .brand-name { display: none; }
  .footer-brand .brand-name { display: inline; }
  .grid-two, .grid-three { grid-template-columns: minmax(0, 1fr); }
  .card, .panel { padding: 22px; }
  .footer-grid { grid-template-columns: minmax(0, 1fr); }
  .footer-brand { grid-column: auto; }
  .tilt, [data-tilt] { transform: none !important; }
  .cta { gap: 10px; }
  .footer-bottom { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal.reveal-pending { opacity: 1; transform: none; }
}