:root {
  color-scheme: dark;
  --bg: #0A0B0D;
  --bg-panel: #111215;
  --bg-panel-2: #17181C;
  --bg-raise: #1E2025;
  --border: #23252A;
  --border-hi: #2E3036;
  --accent: #E8C55A;
  --accent-dark: #B8962F;
  --accent-soft: rgba(232, 197, 90, 0.16);
  --text: #ECEDEF;
  --text-hover: #FFFFFF;
  --text-muted: #8A8F98;
  --text-dim: #5C616A;
  --success: #52B9C9;
  --success-soft: rgba(82, 185, 201, 0.14);
  --success-line: rgba(82, 185, 201, 0.45);
  --warn: var(--accent);
  --error: #E5584F;
  --stage-lo: #2A2C31;
  --stage-hi: #6B6F76;
  --stage-glow: rgba(107, 111, 118, 0.42);
  --stage-edge: rgba(255, 255, 255, 0.07);
  --sheen: rgba(255, 255, 255, 0.035);
  --shade: rgba(0, 0, 0, 0.55);
  --clear: transparent;

  --font-display: 'Inter', 'Noto Sans SC', 'PingFang SC', '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;
  --body-size: 15px;
  --title-size: clamp(34px, 3.35vw, 48px);
  --section-title: clamp(22px, 2.3vw, 32px);
  --subhead-size: clamp(17px, 1.7vw, 22px);
  --r-xs: 4px;
  --r-sm: 6px;
  --r-md: 8px;
  --r-pill: 999px;
  --r-round: 50%;
  --container: 1200px;
  --header-measure: 1280px;
  --prose-measure: 76ch;
  --stage-measure: 1400px;
  --gutter: 24px;
  --nav-h: 64px;
  --tap: 44px;
  --section-top: 112px;
  --section-bottom: 120px;
  --card-inset: clamp(16px, 3vw, 28px);
  --fast: .18s ease;
  --appear: .42s ease-out;
  --z-fab: 5;
  --z-toc: 10;
  --z-header: 20;
}

*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
html.nav-open { overflow: hidden; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--body-size);
  line-height: 1.6;
  overflow-wrap: anywhere;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
[hidden] { display: none !important; }
img, svg { max-inline-size: 100%; }
img { display: block; block-size: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
section[id], article[id], h2[id], h3[id], [role="tabpanel"] { scroll-margin-block-start: 5rem; }

.wrap {
  width: 100%;
  max-width: min(100%, calc(var(--container) + var(--gutter) * 2));
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.reading-wrap {
  width: 100%;
  max-width: min(100%, calc(var(--prose-measure) + var(--gutter) * 2));
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.wrap > *, .reading-wrap > *, .prose *, .article-body * { min-width: 0; }
.section-space {
  padding-top: var(--section-top);
  padding-bottom: var(--section-bottom);
}
.divided { border-block-start: 1px solid var(--border); }
.decor-clip { position: relative; overflow-x: clip; }
.decor-cover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

h1, h2, h3 {
  margin: 0 0 .65em;
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -.02em;
  text-wrap: balance;
}
h1 { font-size: var(--title-size); }
h2 { font-size: var(--section-title); }
h3 { font-size: var(--subhead-size); }
p, ul, ol, dl { margin-block: 0 1em; }
.keep-word { white-space: nowrap; }
.muted { color: var(--text-muted); }
.mono, code, pre { font-family: var(--font-mono); }
.eyebrow {
  margin: 0 0 20px;
  font: 12px/1.6 var(--font-mono);
  color: var(--text-muted);
  letter-spacing: .06em;
}
.statement {
  margin: 0;
  max-width: 980px;
  font: 400 var(--section-title)/1.32 var(--font-display);
  letter-spacing: -.015em;
  color: var(--text-muted);
}
.statement b { font-weight: 400; color: var(--text); }
.prose, .article-body { min-width: 0; line-height: 1.8; }
.prose :is(h2, h3):not(:first-child),
.article-body :is(h2, h3):not(:first-child) { margin-block-start: 1.75em; }
.prose a:not([class]), .article-body a:not([class]), .text-link {
  text-decoration: underline;
  text-underline-offset: .24em;
}
code { overflow-wrap: anywhere; }
:not(pre) > code {
  font-size: .9em;
  background: var(--bg-panel-2);
  color: var(--text);
  border-radius: var(--r-xs);
  padding-inline: .25em;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
pre {
  max-width: 100%;
  min-width: 0;
  margin: 0 0 1em;
  padding: 16px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  white-space: pre;
  background: var(--bg-panel);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-size: 13px;
  line-height: 1.65;
}
pre code { overflow-wrap: normal; white-space: inherit; }

.actions, .badge-line { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  max-width: 100%;
  padding: 4px 18px;
  border: 0;
  border-radius: var(--r-sm);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -.005em;
  line-height: 1.35;
  text-align: center;
  transition: background-color var(--fast), border-color var(--fast), color var(--fast);
}
.btn svg { width: 14px; height: 14px; flex-shrink: 0; }
.btn--primary { background: var(--text); color: var(--bg); }
.btn--primary:not(:disabled):is(:hover, .sample-hover) { background: var(--text-hover); color: var(--bg); }
.btn--primary:not(:disabled):is(:active, .sample-active) { background: var(--text-muted); color: var(--bg); }
.btn--ghost { border: 1px solid var(--border-hi); background: var(--clear); color: var(--text); }
.btn--ghost:not(:disabled):is(:hover, .sample-hover) {
  background: var(--bg-panel);
  color: var(--text);
  border-color: var(--text-dim);
}
.btn--ghost:not(:disabled):is(:active, .sample-active) {
  background: var(--bg-raise);
  color: var(--text);
  border-color: var(--text-muted);
}
.btn:disabled { background: var(--bg-panel-2); color: var(--text-muted); border: 1px solid var(--border); }
.btn.sample-focus { outline: 2px solid var(--accent); outline-offset: 3px; }

.dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: var(--r-round);
  flex-shrink: 0;
}
.dot--run { background: var(--accent); color: var(--bg); box-shadow: 0 0 0 3px var(--accent-soft); }
.dot--on { background: var(--success); color: var(--bg); box-shadow: 0 0 0 3px var(--success-soft); }
.dot--error { background: var(--error); color: var(--bg); }

.topbar {
  position: relative;
  z-index: var(--z-header);
  min-height: var(--nav-h);
  border-block-end: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
}
.head-shell {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 32px;
  width: 100%;
  max-width: min(100%, calc(var(--header-measure) + var(--gutter) * 2));
  min-height: calc(var(--nav-h) - 1px);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -.01em;
  color: var(--text);
}
.brand-mark { display: block; width: 26px; height: 26px; flex-shrink: 0; }
.nav-main { margin-left: auto; display: flex; align-items: center; gap: 26px; min-width: 0; }
.nav-links {
  display: flex;
  align-items: center;
  gap: 26px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a { font-size: 14px; color: var(--text-muted); transition: color var(--fast); white-space: nowrap; }
.nav-links a:hover { color: var(--text); }
.nav-links a[aria-current="page"] { color: var(--text); font-weight: 500; }
.nav-sep { width: 1px; height: 16px; flex-shrink: 0; background: var(--border-hi); color: var(--text); }
.head-tools { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.language-switch { position: relative; }
.lang, .nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding-inline: 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--clear);
  color: var(--text-muted);
}
.lang { min-height: 30px; font-size: 13px; white-space: nowrap; cursor: pointer; list-style: none; }
.lang::-webkit-details-marker { display: none; }
.lang:hover, .nav-toggle:hover { color: var(--text); border-color: var(--border-hi); }
.lang-list {
  position: absolute;
  z-index: 2;
  inset: calc(100% + 8px) 0 auto auto;
  width: max-content;
  min-width: 10rem;
  max-width: calc(100vw - var(--gutter) * 2);
  margin: 0;
  padding: 6px;
  list-style: none;
  border: 1px solid var(--border-hi);
  border-radius: var(--r-md);
  background: var(--bg-panel);
  color: var(--text);
}
.lang-list a, .nav-drawer a {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: var(--tap);
  padding: 8px 12px;
  color: var(--text-muted);
  border-radius: var(--r-sm);
}
:is(.lang-list, .nav-drawer) a:is(:hover, [aria-current]) {
  background: var(--bg-panel-2);
  color: var(--text);
}
.nav-toggle, .nav-drawer, .nav-veil { display: none; }
.nav-toggle { min-width: var(--tap); min-height: var(--tap); }
.nav-toggle svg { width: 18px; height: 18px; flex-shrink: 0; }

.site-foot { border-block-start: 1px solid var(--border); }
.foot-map {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, .75fr) minmax(0, 1.15fr) minmax(0, .65fr);
  gap: 32px;
  padding-block: 56px;
}
.foot-map > * { min-width: 0; }
.foot-map h2 { margin: 0 0 14px; font-size: 14px; letter-spacing: 0; }
.foot-map p { max-width: 33ch; margin: 12px 0 0; color: var(--text-muted); }
.foot-map ul, .foot-line ul { margin: 0; padding: 0; list-style: none; }
.foot-map li + li { margin-block-start: 6px; }
.foot-map li a, .foot-line { color: var(--text-muted); font-size: 13px; }
.foot-map li a:hover, .foot-line a:hover { color: var(--text); }
.foot-line {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 24px;
  padding-block: 22px;
  border-block-start: 1px solid var(--border);
}
.foot-line ul { display: flex; flex-wrap: wrap; gap: 8px 20px; }

.card, .panel {
  min-width: 0;
  padding: var(--card-inset);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}
.card { background: var(--bg-panel); color: var(--text); }
.panel { background: var(--bg-panel-2); color: var(--text); }
.card > :last-child, .panel > :last-child { margin-block-end: 0; }
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 12px;
}
.card-grid > * { min-width: 0; }

.reveal.reveal-armed {
  transition: opacity var(--appear), transform var(--appear);
}
.reveal.reveal-armed:not(.shown):not(:focus-within) { opacity: 0; transform: translateY(8px); }

@media (width < 1280px) {
  .topbar:not(.topbar--specimen) .head-shell { gap: 12px; }
  .topbar:not(.topbar--specimen) .nav-main { display: none; }
  .topbar:not(.topbar--specimen) .head-tools { margin-left: auto; }
  .nav-toggle { display: inline-flex; }
  .nav-drawer {
    display: block;
    position: absolute;
    inset: 100% 0 auto;
    max-height: calc(100vh - var(--nav-h));
    max-height: calc(100dvh - var(--nav-h));
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 12px var(--gutter) 20px;
    border-block: 1px solid var(--border);
    background: var(--bg-panel);
    color: var(--text);
  }
  .nav-drawer ul { margin: 0; padding: 0; list-style: none; }
  .drawer-locales { border-block-start: 1px solid var(--border); margin-block-start: 8px; padding-block-start: 8px; }
  .nav-veil {
    display: block;
    position: fixed;
    inset: 0;
    background: var(--shade);
    color: var(--text);
    touch-action: none;
  }
}
@media (max-width: 920px) {
  .foot-map { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topbar--specimen .head-shell { flex-wrap: wrap; gap: 0 16px; padding-top: 14px; }
  .topbar--specimen .nav-main {
    width: 100%;
    order: 3;
    margin-left: 0;
    padding: 12px 4px 14px;
    overflow-x: auto;
  }
  .topbar--specimen .nav-links { gap: 20px; }
  .topbar--specimen .nav-sep { display: none; }
  .topbar--specimen .head-tools { margin-left: auto; }
}
@media (max-width: 768px) {
  :root { --title-size: clamp(26px, 4.3vw, 30px); }
}
@media (max-width: 640px) {
  :root { --gutter: 16px; --section-top: 72px; --section-bottom: 80px; }
  .foot-map { gap: 24px 16px; padding-block: 40px; }
  .foot-map > :first-child { grid-column: 1 / -1; }
  .badge-line { justify-content: center; }
  .tilt, .tilt-decor { transform: none !important; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .reveal.reveal-armed:not(.shown) { opacity: 1; transform: none; }
}