:root {
  --bg: #F3F3F3;
  --panel: #FFFFFF;
  --panel-2: #EBEBEB;
  --sunken: #F7F7F7;
  --line: #E1E1E1;
  --line-card: #E3E3E3;
  --line-device: #D6D6D6;
  --hair: #EDEDED;
  --cross: #BDBDBD;
  --accent: #222222;
  --accent-dark: #0B0B0B;
  --ink: #1E1E1E;
  --muted: #6E6E6E;
  --faint: #A3A3A3;
  --success: #2F7A4D;
  --warn: #946512;
  --error: #B0372F;
  --logo-a: #3A3A3A;
  --logo-b: #0B0B0B;
  --veil: rgba(0, 0, 0, .18);
  --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;
  --text-xs: 12px;
  --text-sm: 14px;
  --text-base: 15px;
  --text-lg: 18px;
  --text-h3: 20px;
  --text-h2: clamp(24px, 2.2vw, 34px);
  --text-h1: clamp(34px, calc(2.2vw + 14px), 46px);
  --leading-body: 1.6;
  --leading-prose: 1.85;
  --tracking-heading: -.02em;

  --r-btn: 8px;
  --r-card: 12px;
  --r-device: 14px;
  --r-screen: 7px;
  --r-sm: 6px;
  --r-code: 4px;
  --r-highlight: 5px;
  --r-pill: 999px;
  --r-circle: 50%;

  --shadow-card: 0 1px 2px rgba(0, 0, 0, .035), 0 10px 30px -12px rgba(0, 0, 0, .07);
  --shadow-device: 0 2px 6px rgba(0, 0, 0, .05), 0 28px 56px -22px rgba(0, 0, 0, .16);
  --shadow-seg: 0 1px 2px rgba(0, 0, 0, .08), 0 0 0 .5px rgba(0, 0, 0, .04);
  --shadow-knob: 0 1px 2px rgba(0, 0, 0, .18);
  --shadow-btn: 0 1px 2px rgba(0, 0, 0, .12), inset 0 1px 0 rgba(255, 255, 255, .08);
  --shadow-lang: 0 1px 1px rgba(0, 0, 0, .02);
  --shadow-badge: 0 1px 2px rgba(0, 0, 0, .03);

  --shell: 1240px;
  --reading: 820px;
  --header-content: 1280px;
  --gutter: 24px;
  --rail-x: max(12px, calc(50% - 644px));
  --nav-h: 68px;
  --peek: 60px;
  --rh: 24px;
  --section-space: 80px;
  --duration-fast: .15s;
  --duration-reveal: .5s;
  --ease: ease;
  --z-rail: 0;
  --z-content: 1;
  --z-veil: 40;
  --z-header: 50;
  --z-drawer: 51;
  --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(--ink);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
button { color: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: var(--transparent); }
button:disabled { cursor: not-allowed; }
img, svg { vertical-align: middle; }
img { max-width: 100%; height: auto; }
svg { flex-shrink: 0; }
ul, ol { margin: 0; padding: 0; }
h1, h2, h3, h4, p, figure, blockquote { margin: 0; }
h1, h2, h3, h4 {
  font-family: var(--font-display);
  text-wrap: balance;
  overflow-wrap: break-word;
}
h1 { font-size: var(--text-h1); font-weight: 800; line-height: 1.13; letter-spacing: var(--tracking-heading); }
h2 { font-size: var(--text-h2); font-weight: 800; line-height: 1.2; letter-spacing: var(--tracking-heading); }
h3 { font-size: var(--text-h3); font-weight: 650; line-height: 1.4; }
code, pre, kbd { font-family: var(--font-mono); }
code { overflow-wrap: anywhere; }
pre {
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  padding: 20px;
  background: var(--sunken);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--r-btn);
  font-size: var(--text-sm);
  line-height: 1.75;
  overscroll-behavior-x: contain;
}
pre code { overflow-wrap: normal; word-break: normal; white-space: pre; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: var(--r-sm); }
[hidden] { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.nowrap { white-space: nowrap; }
.muted { color: var(--muted); }
.mono { font-family: var(--font-mono); }
.text-link { text-decoration: underline; text-underline-offset: 4px; }
.skip-link {
  position: fixed;
  left: var(--gutter);
  top: 8px;
  transform: translateY(-180%);
  z-index: var(--z-drawer);
  padding: 12px 18px;
  background: var(--accent);
  color: var(--panel);
  border-radius: var(--r-btn);
}
.skip-link:focus { transform: none; }
.page { position: relative; min-height: 100vh; overflow-x: clip; }
.page::before, .page::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--line);
  pointer-events: none;
  z-index: var(--z-rail);
}
.page::before { left: var(--rail-x); }
.page::after { right: var(--rail-x); }
.shell, .wrap {
  position: relative;
  z-index: var(--z-content);
  width: 100%;
  max-width: calc(var(--shell) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
  min-width: 0;
}
.reading { max-width: calc(var(--reading) + var(--gutter) * 2); }
.section { padding-top: var(--section-space); padding-bottom: var(--section-space); }
.section-head { text-align: center; margin-bottom: 40px; }
.section-head h2 { margin-top: 18px; }
.section-head p { max-width: 38em; margin: 12px auto 0; color: var(--muted); }
.xline { position: relative; height: 1px; background: var(--line); color: var(--ink); z-index: var(--z-content); }
.xmark {
  position: absolute;
  top: 0;
  width: 17px;
  height: 17px;
  transform: translate(-50%, -50%);
  background: var(--bg);
  color: var(--ink);
}
.xmark::before, .xmark::after { content: ""; position: absolute; background: var(--cross); }
.xmark::before { left: 4px; right: 4px; top: 8px; height: 1px; }
.xmark::after { top: 4px; bottom: 4px; left: 8px; width: 1px; }
.xmark--l { left: var(--rail-x); }
.xmark--r { left: calc(100% - var(--rail-x)); }
.card, .panel {
  min-width: 0;
  padding: 24px;
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--line-card);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
}
.card h3 + p, .panel h3 + p { margin-top: 8px; }
.card p, .panel p { color: var(--muted); }
.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.card-grid > *, .hero-card > *, .footer-grid > * { min-width: 0; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 12px 18px;
  max-width: 100%;
  border: 1px solid var(--transparent);
  border-radius: var(--r-btn);
  font: 600 14.5px/1.25 var(--font-body);
  text-align: center;
  transition: background var(--duration-fast), border-color var(--duration-fast);
}
.btn svg { width: 16px; height: 16px; }
.btn--solid { background: var(--accent); color: var(--panel); box-shadow: var(--shadow-btn); }
.btn--solid:hover, .btn--solid.is-hover { background: var(--accent-dark); color: var(--panel); }
.btn--line { background: var(--panel); color: var(--ink); border-color: var(--line); }
.btn--line:hover, .btn--line.is-hover { border-color: var(--line-device); background: var(--sunken); color: var(--ink); }
.btn--quiet { background: var(--transparent); color: var(--ink); }
.btn--quiet:hover { background: var(--panel-2); color: var(--ink); }
.btn:disabled, .btn[aria-disabled="true"] { background: var(--panel-2); color: var(--muted); border-color: var(--line); box-shadow: none; }
.btn.is-focus { outline: 2px solid var(--accent); outline-offset: 3px; }
.button-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.badge, .chip, .tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 28px;
  max-width: 100%;
  padding: 5px 12px;
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  font: 500 12.5px/1.4 var(--font-body);
  overflow-wrap: anywhere;
  white-space: normal;
}
.badge { box-shadow: var(--shadow-badge); }
.badge svg, .chip svg { width: 13px; height: 13px; color: var(--muted); }
.dot { position: relative; width: 7px; height: 7px; flex-shrink: 0; border-radius: var(--r-circle); background: var(--accent); }
.dot::after { content: ""; position: absolute; inset: -3px; border-radius: var(--r-circle); border: 1px solid var(--line-device); }
#site-header { position: relative; z-index: var(--z-header); }
.topbar {
  position: relative;
  z-index: var(--z-header);
  width: 100%;
  max-width: min(100%, calc(var(--header-content) + var(--gutter) * 2));
  min-height: var(--nav-h);
  margin-inline: auto;
  padding-inline: var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; flex-shrink: 0; font-family: var(--font-display); font-weight: 700; font-size: 16px; letter-spacing: -.01em; }
.brand img { width: 30px; height: 30px; flex-shrink: 0; }
.dotnav { margin-left: auto; min-width: 0; }
.dotnav ul { display: flex; align-items: center; list-style: none; margin: 0; padding: 0; }
.dotnav li { display: flex; align-items: center; flex-shrink: 0; }
.dotnav li + li::before { content: "·"; color: var(--muted); margin-inline: 13px; font-weight: 700; }
.dotnav a { display: inline-flex; align-items: center; min-height: 44px; color: var(--muted); font-size: var(--text-sm); white-space: nowrap; transition: color var(--duration-fast); }
.dotnav a:hover, .dotnav a[aria-current="page"] { color: var(--ink); }
.dotnav a[aria-current="page"] { font-weight: 600; }
.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: 7px;
  min-height: 34px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-btn);
  background: var(--panel);
  color: var(--ink);
  font: 500 13px/1.2 var(--font-body);
  box-shadow: var(--shadow-lang);
  white-space: nowrap;
}
.lang svg { width: 14px; height: 14px; color: var(--muted); }
.lang:hover { border-color: var(--line-device); }
.lang-short { display: none; }
.language-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  padding: 6px;
  list-style: none;
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--r-btn);
  box-shadow: var(--shadow-card);
  z-index: var(--z-drawer);
}
.language-menu a { display: flex; align-items: center; min-height: 44px; padding: 10px 12px; border-radius: var(--r-sm); }
.language-menu a:hover, .language-menu a[aria-current="true"] { background: var(--panel-2); color: var(--ink); }
.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 8px;
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--r-btn);
}
.menu-toggle svg { width: 20px; height: 20px; }
.mobile-drawer {
  position: absolute;
  top: 100%;
  left: var(--gutter);
  right: var(--gutter);
  padding: 16px;
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  max-height: calc(100dvh - var(--nav-h) - 16px);
  overflow-y: auto;
  overscroll-behavior: contain;
  box-shadow: var(--shadow-card);
  z-index: var(--z-drawer);
}
.mobile-drawer ul { list-style: none; }
.mobile-drawer a { display: flex; align-items: center; width: 100%; min-height: 44px; padding: 11px 12px; border-radius: var(--r-sm); }
.mobile-drawer a:hover, .mobile-drawer a[aria-current] { background: var(--panel-2); color: var(--ink); }
.drawer-caption { margin: 16px 12px 6px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: var(--text-xs); }
.nav-veil { position: fixed; inset: var(--nav-h) 0 0; border: 0; background: var(--veil); color: var(--ink); z-index: var(--z-veil); }
.preview-language > summary { list-style: none; cursor: pointer; }
.preview-language > summary::-webkit-details-marker { display: none; }
.site-footer { position: relative; z-index: var(--z-content); border-top: 1px solid var(--line); }
.footer-grid { display: grid; grid-template-columns: 1.35fr .85fr 1.3fr .7fr; gap: 40px; padding-top: 56px; padding-bottom: 48px; }
.footer-brand p { max-width: 26em; margin-top: 16px; color: var(--muted); font-size: var(--text-sm); }
.footer-heading { margin-bottom: 14px; font-size: var(--text-sm); font-weight: 650; }
.footer-links { list-style: none; }
.footer-links a { display: inline-flex; align-items: center; min-height: 36px; padding-block: 6px; font-size: var(--text-sm); color: var(--muted); }
.footer-links a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
.footer-bottom { border-top: 1px solid var(--line); padding-top: 20px; padding-bottom: 24px; font-size: var(--text-xs); color: var(--muted); }
.prose { min-width: 0; line-height: var(--leading-prose); }
.prose > * + *, .prose section > * + * { margin-top: 18px; }
.prose h2 { margin-top: 48px; }
.prose h3 { margin-top: 28px; }
.prose p, .prose li { overflow-wrap: break-word; }
.prose ul, .prose ol { padding-left: 1.5em; }
.prose li + li { margin-top: 8px; }
.prose a { text-decoration: underline; text-underline-offset: 4px; }
.prose :not(pre) > code { padding: 1px 5px; border: 1px solid var(--hair); border-radius: var(--r-code); background: var(--sunken); color: var(--ink); font-size: .88em; }
.prose [id], section[id], [role="tabpanel"] { scroll-margin-top: 24px; }
.reveal { opacity: 1; transform: none; }
.reveal-ready .reveal:not(.shown) { opacity: 0; transform: translateY(14px); }
.reveal-ready .reveal { transition: opacity var(--duration-reveal) var(--ease), transform var(--duration-reveal) var(--ease); }
.reveal-ready .reveal.shown { opacity: 1; transform: none; }
.decorated-section, [data-hero-visual] { position: relative; overflow-x: clip; }
@media (max-width: 1280px) {
  .dotnav li + li::before { margin-inline: 9px; }
  html:not([lang="zh-CN"]) .dotnav { display: none; }
  html:not([lang="zh-CN"]) .menu-toggle { display: inline-flex; }
}
@media (max-width: 1100px) {
  .dotnav { display: none; }
  .menu-toggle { display: inline-flex; }
  .header-tools { margin-left: auto; }
  .topbar { gap: 16px; }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
  :root { --text-h1: clamp(24px, 4.2vw, 30px); --section-space: 56px; }
  .card-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  :root { --gutter: 16px; }
  .topbar { gap: 8px; }
  .brand { font-size: var(--text-sm); gap: 8px; }
  .header-tools { margin-left: auto; gap: 8px; }
  .lang { min-height: 44px; padding-inline: 10px; }
  .lang-full { display: none; }
  .lang-short { display: inline; }
  .footer-grid { gap: 30px 20px; }
  .footer-brand { grid-column: 1 / -1; }
  .card, .panel { padding: 20px; }
  .tilt, [data-tilt] { transform: none !important; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal-ready .reveal:not(.shown) { opacity: 1; transform: none; }
  .reveal-ready .reveal, .btn, .dotnav a { transition: none; }
}