:root {
  color-scheme: dark;
  --bg: #000000;
  --bg-panel: #0A0A0A;
  --bg-panel2: #141414;
  --border: #232323;
  --border-strong: #2F2F2F;
  --accent: #4A86FF;
  --accent-dark: #1F5FE0;
  --accent-ink: #BCD2FF;
  --text: #F2F2F2;
  --text-muted: #8F8F8F;
  --text-dim: #818181;
  --ink: #000000;
  --success: #34C77B;
  --success-faint: rgba(52, 199, 123, 0.16);
  --warn: #E8B339;
  --error: #F2545B;
  --canvas-top: #071331;
  --canvas-mid: #030918;
  --canvas-bottom: #010207;
  --node-fill: #040B1E;
  --glow-strong: rgba(74, 134, 255, 0.58);
  --glow-mid: rgba(74, 134, 255, 0.30);
  --glow-soft: rgba(74, 134, 255, 0.15);
  --glow-faint: rgba(74, 134, 255, 0.07);
  --line: rgba(242, 242, 242, 0.36);
  --line-dim: rgba(242, 242, 242, 0.14);
  --veil: rgba(0, 0, 0, 0.72);
  --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', 'SFMono-Regular', Menlo, Consolas, 'Liberation Mono', monospace;
  --size-body: 15px;
  --size-small: 13px;
  --size-code: 12px;
  --size-title: clamp(34px, 3.6vw, 48px);
  --size-hero: clamp(34px, 2.9vw, 44px);
  --size-section: clamp(24px, 2.6vw, 36px);
  --size-subhead: 20px;
  --weight-normal: 400;
  --weight-medium: 500;
  --r-xl: 28px;
  --r-lg: 20px;
  --r-inset: 16px;
  --r-md: 14px;
  --r-button: 12px;
  --r-sm: 10px;
  --r-mark: 9px;
  --r-menu: 8px;
  --r-xs: 7px;
  --r-pill: 999px;
  --r-round: 50%;
  --wrap: 1360px;
  --reading: 840px;
  --header-wrap: 1280px;
  --gutter: 40px;
  --header-height: 68px;
  --target: 44px;
  --section-space: clamp(56px, 8vw, 112px);
  --card-pad: clamp(16px, 3vw, 32px);
  --ease-fast: .2s ease;
  --ease-reveal: .5s ease;
  --tab-cycle: 8s;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html {
  background: var(--bg);
  color: var(--text);
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: var(--size-body)/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
main, section, article, aside, .wrap, .prose, .grid > *, .stack > * { min-width: 0; }
img, svg, video { display: block; max-width: 100%; }
a { color: var(--accent); text-underline-offset: .22em; }
button, select, input { font: inherit; color: inherit; }
button:not(:disabled), summary, select { cursor: pointer; }
:is(svg, img, .eyebrow-dot, .status-dot) { flex-shrink: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
[id] { scroll-margin-top: 16px; }
h1, h2, h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: var(--weight-normal);
  line-height: 1.2;
  letter-spacing: -.018em;
  text-wrap: balance;
}
h1 { font-size: var(--size-title); }
h2 { font-size: var(--size-section); }
h3 { font-size: var(--size-subhead); }
.keep { white-space: nowrap; }
p { margin: 0 0 1em; }
small, .muted { color: var(--text-muted); }
strong { font-weight: var(--weight-medium); }
code, pre, kbd { font-family: var(--font-mono); }
code { overflow-wrap: anywhere; }
pre {
  max-width: 100%;
  margin: 1em 0;
  padding: 16px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-panel2);
  color: var(--text);
  font-size: var(--size-code);
  line-height: 1.62;
  white-space: pre;
}
pre code { overflow-wrap: normal; white-space: inherit; }
.wrap {
  width: 100%;
  max-width: calc(var(--wrap) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.wrap-reading { max-width: calc(var(--reading) + var(--gutter) * 2); }
.sec { padding-top: var(--section-space); padding-bottom: var(--section-space); }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 14px; }
.stack { display: grid; gap: 14px; }
.clip-decor { overflow-x: clip; }
.decor-svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.panel, .card {
  min-width: 0;
  padding: var(--card-pad);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  background: var(--bg-panel);
  color: var(--text);
  overflow-wrap: anywhere;
}
.panel-raised { background: var(--bg-panel2); color: var(--text); }
:is(.panel, .card) > :last-child { margin-bottom: 0; }
.prose { line-height: 1.8; overflow-wrap: anywhere; }
.prose :is(h2, h3) { margin-block: 1.55em .65em; }
.prose > :first-child { margin-top: 0; }
.prose :is(ul, ol) { padding-inline-start: 1.5em; }
.prose li + li { margin-top: .4em; }
.prose pre { overflow-wrap: normal; }
.tilt { transform: none; }

.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46px;
  max-width: 100%;
  padding: 8px 20px;
  border: 1px solid var(--border);
  border-radius: var(--r-button);
  font: var(--weight-medium) var(--size-body)/1.35 var(--font-body);
  text-align: center;
  text-decoration: none;
  transition: box-shadow var(--ease-fast), border-color var(--ease-fast), background-color var(--ease-fast);
}
.stroke-icon, .btn svg, .nav-link svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.btn-primary { background: var(--text); color: var(--ink); border-color: var(--accent); }
.btn-primary:is(:hover, .demo-hover):not(:disabled) { box-shadow: 0 0 0 4px var(--glow-soft); }
.btn-secondary { background: var(--bg-panel2); color: var(--text); }
.btn-secondary:is(:hover, .demo-hover):not(:disabled) { border-color: var(--text-dim); }
.btn:active:not(:disabled), .btn.demo-pressed { background: var(--bg-panel); color: var(--text); border-color: var(--accent); }
.btn:disabled { background: var(--bg-panel); color: var(--text-muted); border-color: var(--border); cursor: not-allowed; }
.demo-focus { outline: 2px solid var(--accent); outline-offset: 3px; }
.text-link { color: var(--accent); font-size: var(--size-small); text-decoration: none; }
.text-link:hover { text-decoration: underline; }

.topbar { position: relative; z-index: 5; }
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: 100%;
  max-width: min(100%, calc(var(--header-wrap) + var(--gutter) * 2));
  min-height: var(--header-height);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  color: var(--text);
  font-size: var(--size-body);
  font-weight: var(--weight-medium);
  letter-spacing: -.005em;
  text-decoration: none;
}
.brand-mark { width: 30px; height: 30px; border-radius: var(--r-mark); }
.topbar-right, .header-tools { display: flex; align-items: center; gap: 14px; }
.topbar-right, .desktop-nav { min-width: 0; }
.header-tools { flex-shrink: 0; gap: 8px; }
.nav-list {
  display: flex;
  align-items: center;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 7px 12px;
  border-radius: var(--r-pill);
  font-size: 14px;
  color: var(--text-muted);
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--ease-fast), background-color var(--ease-fast);
}
.nav-link svg { width: 15px; height: 15px; stroke-width: 1.6; }
.nav-link:hover { color: var(--text); }
.nav-link[aria-current="page"] {
  background: var(--bg-panel2);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--border);
}
.lang-picker { position: relative; }
.lang {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 34px;
  padding: 0 13px 0 11px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  background: var(--clear);
  color: var(--text);
  font-size: var(--size-small);
  white-space: nowrap;
  list-style: none;
}
.lang::-webkit-details-marker, .preview-drawer summary::-webkit-details-marker { display: none; }
.lang:hover { border-color: var(--border-strong); }
.lang svg { width: 14px; height: 14px; color: var(--text-muted); }
.lang-short, .menu-toggle, .nav-drawer, .nav-veil, .preview-drawer { display: none; }
.lang-menu {
  position: absolute;
  z-index: 3;
  inset-block-start: calc(100% + 8px);
  inset-inline-end: 0;
  min-width: 158px;
  padding: 6px;
  margin: 0;
  list-style: none;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  background: var(--bg-panel);
  color: var(--text);
}
.lang-menu a, .drawer-langs a {
  display: flex;
  align-items: center;
  min-height: var(--target);
  padding-inline: 12px;
  border-radius: var(--r-sm);
  color: var(--text-muted);
  text-decoration: none;
}
:is(.lang-menu, .drawer-langs) a:is(:hover, [aria-current="page"]) {
  background: var(--bg-panel2);
  color: var(--text);
}
html.nav-open { overflow: hidden; }

.site-footer { border-top: 1px solid var(--border); padding-block: 36px 24px; }
.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr));
  gap: 28px;
}
.footer-grid > * { min-width: 0; }
.footer-intro { margin: 14px 0 0; max-width: 27em; color: var(--text-muted); }
.footer-label { margin: 0 0 10px; font-size: var(--size-small); }
.footer-list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.footer-list a { color: var(--text-muted); text-decoration: none; overflow-wrap: anywhere; }
.footer-list a:hover { color: var(--text); text-decoration: underline; }
.footer-end { margin: 28px 0 0; padding-top: 16px; border-top: 1px solid var(--border); color: var(--text-muted); }

.reveal { transition: opacity var(--ease-reveal), transform var(--ease-reveal); }
.reveal.reveal-pending:not(.shown):not(:focus-within) { opacity: 0; transform: translateY(12px); }

@media (width < 1280px) {
  .topbar-inner { gap: 10px; }
  .topbar-right, .header-tools { margin-left: auto; }
  .desktop-nav { display: none; }
  .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: var(--target);
    min-height: var(--target);
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--r-button);
    background: var(--bg-panel);
    color: var(--text);
  }
  .nav-veil { display: block; position: fixed; inset: 0; z-index: 1; background: var(--veil); color: var(--text); }
  .nav-open .topbar-inner { position: relative; z-index: 2; background: var(--bg); color: var(--text); }
  .nav-drawer {
    display: block;
    position: absolute;
    inset: 100% 0 auto;
    z-index: 2;
    max-height: calc(100vh - var(--header-height));
    max-height: calc(100dvh - var(--header-height));
    padding: 12px var(--gutter) 20px;
    overflow-y: auto;
    overscroll-behavior: contain;
    border-block: 1px solid var(--border);
    background: var(--bg-panel);
    color: var(--text);
  }
  .nav-drawer .nav-list { display: grid; align-items: stretch; gap: 3px; }
  .nav-drawer .nav-link {
    display: flex;
    justify-content: flex-start;
    width: 100%;
    min-height: var(--target);
    padding: 10px 12px;
    white-space: normal;
  }
  .drawer-langs { list-style: none; margin: 8px 0 0; padding: 8px 0 0; border-top: 1px solid var(--border); }
  .preview-drawer { display: block; }
  .preview-drawer summary { list-style: none; }
}
@media (max-width: 960px) {
  :root { --gutter: 28px; }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
  :root { --size-title: clamp(24px, 6vw, 30px); --size-hero: var(--size-title); }
}
@media (max-width: 640px) {
  :root { --gutter: 16px; }
  .tilt, .tilt:hover { transform: none; }
  .lang-full { display: none; }
  .lang-short { display: inline; }
  .topbar .brand { gap: 7px; }
  .topbar-right { gap: 8px; }
  .footer-grid { gap: 22px 14px; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0s !important; transition-duration: 0s !important; }
  .reveal.reveal-pending:not(.shown) { opacity: 1; transform: none; }
}