:root {
  --bg: #FBFBFC;
  --bg-panel: #FFFFFF;
  --bg-panel-2: #F4F4F6;
  --border: #E6E6EA;
  --border-strong: #D8D8DE;
  --accent: #8A6C00;
  --accent-dark: #6B5400;
  --accent-wash: rgba(138, 108, 0, 0.075);
  --accent-line: rgba(138, 108, 0, 0.38);
  --text: #17171A;
  --text-muted: #686871;
  --text-faint: #9C9CA5;
  --success: #2E9E64;
  --success-ring: rgba(46, 158, 100, 0.28);
  --success-ink: #216C46;
  --warn: #B5761C;
  --error: #C4402F;
  --on-accent: #FFFFFF;
  --dot: #D4D4DA;
  --dot-soft: #DCDCE1;
  --mask-solid: #000000;
  --clear: transparent;
  --veil: rgba(23, 23, 26, 0.38);
  --key-line: rgba(255, 255, 255, 0.38);
  --shadow-hair: 0 1px 2px rgba(23, 23, 26, 0.04);
  --shadow-node: 0 1px 2px rgba(23, 23, 26, 0.05), 0 4px 10px -6px rgba(23, 23, 26, 0.08);
  --shadow-window: 0 1px 2px rgba(23, 23, 26, 0.03), 0 24px 48px -32px rgba(23, 23, 26, 0.14);
  --shadow-btn: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 1px 2px rgba(23, 23, 26, 0.12);
  --radius: 6px;
  --radius-sm: 4px;
  --radius-pill: 999px;
  --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;
  --shell: 1240px;
  --reading: 860px;
  --nav-content: 1280px;
  --gutter: 32px;
  --topbar-height: 64px;
  --touch: 44px;
  --section-top: 64px;
  --section-bottom: 72px;
  --h1-size: clamp(34px, 2.6vw + 12px, 48px);
  --h1-mobile: clamp(24px, 6.4vw, 30px);
  --h2-size: clamp(24px, 2.4vw, 32px);
  --h3-size: 19px;
  --quick: 0.15s ease;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
html.nav-open { overflow: hidden; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 15px/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button, summary { cursor: pointer; }
button:disabled { cursor: not-allowed; }
img, svg { max-width: 100%; vertical-align: middle; }
img { height: auto; }
:where(main, section, article, aside, .grid > *, .stack > *, .prose > *, .panel > *, .card > *) { min-width: 0; }
:where(.icon, .status-dot, button > svg, a > svg) { flex-shrink: 0; }
:focus-visible { outline: 2px solid var(--accent-dark); outline-offset: 3px; }

h1, h2, h3 {
  margin: 0 0 0.6em;
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
h1 { font-size: var(--h1-size); line-height: 1.12; letter-spacing: -0.02em; }
h2 { font-size: var(--h2-size); }
h3 { font-size: var(--h3-size); font-weight: 500; }
.keep { white-space: nowrap; }
p { margin: 0 0 1em; }
.dim { color: var(--text-muted); }
:where(p, li, dd, .brand, .card, .panel) { overflow-wrap: anywhere; }
code, kbd, samp, pre { font-family: var(--font-mono); }
code { overflow-wrap: anywhere; }
pre {
  max-width: 100%;
  margin: 1em 0;
  padding: 14px 16px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  background: var(--bg-panel-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  line-height: 1.65;
  tab-size: 2;
}
pre code { white-space: pre; overflow-wrap: normal; word-break: normal; }
.prose { line-height: 1.8; }
.prose h2:not(:first-child) { margin-top: 1.55em; }
.prose h3:not(:first-child) { margin-top: 1.25em; }
.prose :where(ul, ol) { padding-inline-start: 1.5em; }
.prose li + li { margin-top: .35em; }
.text-link, .prose a:not(.btn, .dl-fab, .toc-tabs a) {
  text-decoration: underline;
  text-decoration-color: var(--accent-line);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}
.text-link:hover, .prose a:not(.btn, .dl-fab):hover { text-decoration-color: var(--accent); }

.page { position: relative; }
.page::before, .page::after {
  content: "";
  position: absolute;
  inset-block: 0;
  width: 0;
  border-left: 1px dashed var(--border);
  pointer-events: none;
  z-index: 3;
}
.page::before { left: max(10px, calc(50% - var(--shell) / 2)); }
.page::after { right: max(10px, calc(50% - var(--shell) / 2)); }
.shell, .wrap {
  position: relative;
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.wrap { max-width: calc(var(--reading) + var(--gutter) * 2); }
.sec { padding-top: var(--section-top); padding-bottom: var(--section-bottom); }
.strata { border-top: 1px solid var(--border); }
.strata--panel { background: var(--bg-panel-2); color: var(--text); }
.decor-frame { position: relative; overflow-x: clip; }
.decor-frame > .decor-fill {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr));
  gap: 16px;
}
.stack { display: grid; gap: 16px; }
.card, .panel {
  padding: clamp(16px, 3vw, 24px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-panel);
  color: var(--text);
}
.card > :last-child, .panel > :last-child { margin-bottom: 0; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 42px;
  max-width: 100%;
  padding: 8px 12px 8px 18px;
  border: 1px solid var(--clear);
  border-radius: var(--radius);
  text-align: center;
  font: 500 15px/1.25 var(--font-body);
  letter-spacing: -0.005em;
  cursor: pointer;
  transition: background-color var(--quick), border-color var(--quick);
}
.btn-solid { background: var(--accent); color: var(--on-accent); box-shadow: var(--shadow-btn); }
.btn-solid:not(:disabled):is(:hover, .state-hover) { background: var(--accent-dark); color: var(--on-accent); }
.btn-line {
  background: var(--bg-panel);
  color: var(--text);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-hair);
}
.btn-line:not(:disabled):is(:hover, .state-hover) { border-color: var(--text-faint); }
.btn:not(:disabled):is(:active, .state-pressed) { box-shadow: inset var(--shadow-hair); }
.btn-line:not(:disabled):is(:active, .state-pressed) { background: var(--bg-panel-2); color: var(--text); }
.btn-solid:not(:disabled):is(:active, .state-pressed) { background: var(--accent-dark); color: var(--on-accent); }
.btn.state-focus { outline: 2px solid var(--accent-dark); outline-offset: 3px; }
.btn:disabled, .btn[aria-disabled="true"]:not([href]) {
  background: var(--bg-panel-2);
  color: var(--text-muted);
  border-color: var(--border);
  box-shadow: none;
}
.keycap {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: var(--radius-sm);
  font: 500 11px/1 var(--font-mono);
  flex-shrink: 0;
}
.btn-solid .keycap { border: 1px solid var(--key-line); color: var(--on-accent); }
.btn-line .keycap { border: 1px solid var(--border-strong); background: var(--bg); color: var(--text-muted); }

.topbar { position: relative; z-index: 10; }
.topbar-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: clamp(16px, 2.1vw, 30px);
  height: var(--topbar-height);
  width: 100%;
  max-width: min(100%, calc(var(--nav-content) + var(--gutter) * 2));
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.topbar--proof .topbar-row { max-width: var(--shell); }
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  flex-shrink: 0;
}
.brand-mark { display: block; width: 28px; height: 28px; flex-shrink: 0; }
.topnav { min-width: 0; margin-inline-start: auto; }
.topnav-list {
  display: flex;
  align-items: center;
  gap: clamp(16px, 2vw, 28px);
  list-style: none;
  margin: 0;
  padding: 0;
}
.topnav-list a { font-size: 14px; color: var(--text-muted); transition: color var(--quick); }
.topnav-list a:hover { color: var(--text); }
.topnav-list a[aria-current="page"] { color: var(--text); font-weight: 500; }
.top-tools { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.lang-picker { position: relative; }
.lang-switch, .nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  padding: 0 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-panel);
  color: var(--text);
  font-size: 13px;
  white-space: nowrap;
  list-style: none;
}
.lang-switch::-webkit-details-marker, .nav-toggle::-webkit-details-marker { display: none; }
.lang-switch svg { width: 14px; height: 14px; color: var(--text-muted); }
.lang-caret { color: var(--text-muted); font-size: 11px; }
.lang-short { display: none; }
.nav-toggle { display: none; min-width: var(--touch); min-height: var(--touch); padding-inline: 8px; }
.lang-menu, .site-drawer {
  background: var(--bg-panel);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.lang-menu {
  position: absolute;
  z-index: 3;
  inset-block-start: calc(100% + 6px);
  inset-inline-end: 0;
  min-width: 152px;
  max-height: calc(100dvh - var(--topbar-height));
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 4px;
  box-shadow: var(--shadow-hair);
}
.lang-menu a, .site-drawer a {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: var(--touch);
  padding: 8px 12px;
}
.lang-menu a:is(:hover, [aria-current]), .site-drawer a:is(:hover, [aria-current]) {
  background: var(--bg-panel-2);
  color: var(--text);
}
.lang-menu a[aria-current], .site-drawer a[aria-current] { font-weight: 600; }
.site-drawer {
  position: absolute;
  z-index: 2;
  inset-block-start: 100%;
  inset-inline: var(--gutter);
  max-height: calc(100dvh - var(--topbar-height));
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 8px;
  box-shadow: var(--shadow-hair);
}
.site-drawer ul { list-style: none; padding: 0; margin: 0; }
.drawer-label {
  margin: 6px 0 0;
  padding: 8px 12px 0;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-muted);
}
.nav-veil {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: var(--veil);
  color: var(--text);
  touch-action: none;
}
.nav-open .topbar-row { z-index: 1; background: var(--bg); color: var(--text); }
.preview-drawer { display: none; }

.site-footer {
  border-top: 1px solid var(--border);
  padding-top: 44px;
  background: var(--bg-panel-2);
  color: var(--text);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr 1.25fr .8fr;
  gap: 24px;
}
.footer-grid > * { min-width: 0; }
.footer-intro p { margin: 12px 0 0; max-width: 28ch; color: var(--text-muted); }
.footer-heading { margin: 4px 0 12px; font-size: 14px; font-weight: 600; }
.footer-list { margin: 0; padding: 0; list-style: none; }
.footer-list li { margin-bottom: 6px; }
.footer-list a { color: var(--text-muted); }
.footer-list a:is(:hover, [aria-current]) { color: var(--text); }
.footer-list a:hover { text-decoration: underline var(--accent); text-underline-offset: 4px; }
.footer-copy {
  margin: 30px 0 0;
  padding: 14px 0 20px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 13px;
}

.reveal { transition: opacity .38s ease, transform .38s ease; }
.reveal-pending .reveal:not(.shown, :focus-within) { opacity: 0; transform: translateY(8px); }
.reveal.shown { opacity: 1; transform: none; }

@media (max-width: 1280px) {
  html:not(:lang(zh-CN)) .topbar-row > .topnav { display: none; }
  html:not(:lang(zh-CN)) .top-tools { margin-inline-start: auto; }
  html:not(:lang(zh-CN)) .nav-toggle { display: inline-flex; }
}
@media (max-width: 900px) {
  :root { --gutter: 20px; }
  .topbar-row > .topnav { display: none; }
  .top-tools { margin-inline-start: auto; }
  .nav-toggle { display: inline-flex; }
  .preview-drawer { display: block; }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
  :root { --h1-size: var(--h1-mobile); --section-top: 42px; --section-bottom: 48px; }
}
@media (max-width: 640px) {
  :root { --gutter: 16px; }
  .topbar-row { gap: 8px; }
  .lang-switch { min-height: var(--touch); }
  .lang-full { display: none; }
  .lang-short { display: inline; }
  .tilt, .tilt-safe { transform: none !important; rotate: none !important; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
  .reveal-pending .reveal:not(.shown) { opacity: 1; transform: none; }
}