:root {
  --color-bg: #15161A;
  --color-panel: #1C1E24;
  --color-panel-raised: #24272F;
  --color-border: #2F333C;
  --color-accent: #F6C453;
  --color-accent-dark: #D9A12A;
  --color-text: #F1EFE8;
  --color-muted: #A2A6B0;
  --color-dim: #6E727C;
  --color-success: #7BD389;
  --color-warning: #FFA366;
  --color-error: #F0716C;
  --color-sky: #8CC0F0;
  --color-pink: #F0A0B6;
  --color-lilac: #BAA8EE;
  --color-flag-red: #D8323C;
  --color-flag-white: #F4F4F4;
  --color-flag-blue: #2A5AA8;
  --color-flag-navy: #2F4A88;
  --color-flag-black: #1B1B1F;
  --color-flag-gold: #F2C438;
  --color-transparent: transparent;
  --overlay-edge: rgba(255, 255, 255, .08);
  --overlay-top: rgba(255, 255, 255, .14);
  --overlay-soft: rgba(255, 255, 255, .04);
  --overlay-line: rgba(255, 255, 255, .06);
  --overlay-dark: rgba(0, 0, 0, .55);
  --overlay-dark-soft: rgba(0, 0, 0, .35);
  --accent-06: rgba(246, 196, 83, .06);
  --accent-08: rgba(246, 196, 83, .08);
  --accent-12: rgba(246, 196, 83, .12);
  --accent-16: rgba(246, 196, 83, .16);
  --accent-35: rgba(246, 196, 83, .35);
  --accent-45: rgba(246, 196, 83, .45);
  --mist-05: rgba(122, 158, 220, .05);
  --tint-pink: rgba(240, 160, 182, .16);
  --tint-mint: rgba(123, 211, 137, .16);
  --tint-sky: rgba(140, 192, 240, .16);
  --tint-lilac: rgba(186, 168, 238, .16);
  --font-display: 'Inter', 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
  --font-body: 'Inter', 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-pill: 999px;
  --nav-height: 68px;
  --gutter: clamp(16px, 4vw, 32px);
  --content-width: 1280px;
  --reading-width: 780px;
  --section-space: clamp(72px, 9vw, 120px);
  --shadow-button: 0 8px 20px -8px var(--accent-45);
  --shadow-card: 0 18px 34px -18px var(--overlay-dark);
  --shadow-window: 0 48px 80px -20px var(--accent-06), 0 24px 48px -12px var(--overlay-dark);
  --focus-ring: 2px solid var(--color-accent);
  --toc-offset: 132px;
}
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-height) + 16px);
}
html.nav-open {
  overflow: hidden;
}
body {
  margin: 0;
  min-width: 320px;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
}
img,
svg,
video {
  display: block;
  max-width: 100%;
}
img {
  height: auto;
}
button,
input,
select,
textarea {
  color: inherit;
  font: inherit;
}
button {
  cursor: pointer;
}
a {
  color: inherit;
  text-decoration: none;
}
p,
ul,
ol,
blockquote,
figure {
  margin-top: 0;
}
h1,
h2,
h3,
h4 {
  color: var(--color-text);
  font-family: var(--font-display);
  text-wrap: balance;
}
h1 {
  margin: 0 0 20px;
  font-size: clamp(52px, 5vw, 68px);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -.02em;
}
h2 {
  margin: 0 0 16px;
  font-size: clamp(30px, 3.2vw, 44px);
  font-weight: 850;
  line-height: 1.18;
  letter-spacing: -.018em;
}
h3 {
  margin: 0 0 12px;
  font-size: clamp(20px, 2vw, 25px);
  font-weight: 800;
  line-height: 1.3;
}
code,
kbd,
samp,
pre,
.mono {
  font-family: var(--font-mono);
}
code {
  overflow-wrap: anywhere;
}
pre {
  max-width: 100%;
  overflow-x: auto;
  padding: 18px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-panel-raised);
  color: var(--color-text);
  -webkit-overflow-scrolling: touch;
}
::selection {
  background: var(--color-accent);
  color: var(--color-bg);
}
:where(a, button, input, select, textarea, summary, [role="tab"]):focus-visible {
  outline: var(--focus-ring);
  outline-offset: 3px;
}
.wrap {
  width: 100%;
  max-width: var(--content-width);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.reading {
  width: 100%;
  max-width: var(--reading-width);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.section {
  padding-top: var(--section-space);
  padding-bottom: var(--section-space);
  overflow-x: clip;
}
.section-panel {
  background: var(--color-panel);
  border-block: 1px solid var(--overlay-line);
}
.stack > * + * {
  margin-top: 20px;
}
.no-break {
  white-space: nowrap;
}
.muted {
  color: var(--color-muted);
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 12px;
  color: var(--color-muted);
  font-size: 13px;
  font-weight: 700;
}
.eyebrow::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-accent);
  content: "";
  flex-shrink: 0;
}
.badge,
.tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 28px;
  max-width: 100%;
  padding: 3px 10px;
  border: 1px solid var(--accent-35);
  border-radius: var(--radius-pill);
  background: var(--accent-12);
  color: var(--color-accent);
  font-size: 12px;
  font-weight: 700;
  overflow: hidden;
}
.badge svg,
.tag svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
.btn-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}
.btn {
  display: inline-flex;
  min-width: 24px;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border: 1px solid var(--color-transparent);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  transition: transform .15s ease, border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
}
.btn svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}
.btn:hover {
  transform: translateY(-1px);
}
.btn-primary {
  background: var(--color-accent);
  color: var(--color-bg);
  box-shadow: var(--shadow-button);
}
.btn-primary:hover {
  background: var(--color-accent-dark);
}
.btn-secondary {
  border-color: var(--color-border);
  background: var(--color-transparent);
  color: var(--color-text);
}
.btn-secondary:hover {
  border-color: var(--color-dim);
  background: var(--overlay-soft);
}
.btn-small {
  min-height: 38px;
  padding: 8px 14px;
  font-size: 13px;
}
.panel,
.card {
  min-width: 0;
  border: 1px solid var(--overlay-edge);
  border-radius: var(--radius-md);
  background: var(--color-panel);
  box-shadow: inset 0 1px 0 var(--overlay-top), var(--shadow-card);
}
.card {
  padding: clamp(20px, 3vw, 30px);
}
.card:hover {
  border-color: var(--accent-35);
}
.icon-plate {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: var(--radius-sm);
  background: var(--accent-16);
  color: var(--color-accent);
  flex-shrink: 0;
}
.icon-plate svg {
  width: 21px;
  height: 21px;
}
.icon-plate.pink {
  background: var(--tint-pink);
  color: var(--color-pink);
}
.icon-plate.mint {
  background: var(--tint-mint);
  color: var(--color-success);
}
.icon-plate.sky {
  background: var(--tint-sky);
  color: var(--color-sky);
}
.icon-plate.lilac {
  background: var(--tint-lilac);
  color: var(--color-lilac);
}
#site-header {
  min-height: var(--nav-height);
}
.site-topbar {
  position: relative;
  z-index: 60;
  height: var(--nav-height);
  border-bottom: 1px solid var(--overlay-line);
  background: var(--color-bg);
}
.header-inner {
  display: flex;
  height: 100%;
  align-items: center;
  gap: 24px;
}
.site-brand {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.site-brand img {
  width: 30px;
  height: 30px;
}
.brand-word {
  font-size: 18px;
  font-weight: 850;
  letter-spacing: -.01em;
}
.brand-local {
  color: var(--color-muted);
  font-size: 14px;
  font-weight: 600;
}
.desktop-nav {
  display: flex;
  height: 100%;
  align-items: stretch;
  gap: 2px;
  margin-left: auto;
}
.desktop-nav a {
  position: relative;
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding-inline: 10px;
  color: var(--color-muted);
  font-size: 13px;
  font-weight: 600;
}
.desktop-nav a:hover,
.desktop-nav a[aria-current="page"] {
  color: var(--color-text);
}
.desktop-nav a[aria-current="page"]::after {
  position: absolute;
  right: 10px;
  bottom: -1px;
  left: 10px;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: var(--color-accent);
  content: "";
}
.header-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.language-box {
  position: relative;
}
.language-toggle,
.menu-toggle {
  display: inline-flex;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--color-transparent);
  color: var(--color-muted);
}
.language-toggle:hover,
.menu-toggle:hover {
  background: var(--color-panel);
  color: var(--color-text);
}
.language-toggle svg,
.menu-toggle svg {
  width: 18px;
  height: 18px;
}
.language-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  display: none;
  width: 164px;
  padding: 6px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-panel-raised);
  box-shadow: var(--shadow-card);
}
.language-box.is-open .language-menu {
  display: block;
}
.language-menu a {
  display: flex;
  min-height: 40px;
  align-items: center;
  padding: 7px 10px;
  border-radius: var(--radius-xs);
  color: var(--color-muted);
  font-size: 13px;
}
.language-menu a:hover,
.language-menu a[aria-current="true"] {
  background: var(--overlay-soft);
  color: var(--color-text);
}
.header-login {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border: 1px solid var(--overlay-edge);
  border-radius: var(--radius-sm);
  background: var(--color-panel-raised);
  box-shadow: inset 0 1px 0 var(--overlay-top);
  font-size: 13px;
  font-weight: 700;
}
.header-login:hover {
  border-color: var(--accent-35);
}
.menu-toggle {
  display: none;
}
.mobile-drawer {
  position: absolute;
  z-index: 65;
  top: var(--nav-height);
  right: 0;
  left: 0;
  display: none;
  max-height: calc(100dvh - var(--nav-height));
  padding: 10px var(--gutter) 18px;
  overflow-y: auto;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-panel);
  overscroll-behavior: contain;
}
.mobile-drawer.is-open {
  display: block;
}
.mobile-drawer a {
  display: flex;
  width: 100%;
  min-height: 46px;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--overlay-line);
  color: var(--color-muted);
  font-weight: 650;
}
.mobile-drawer a[aria-current="page"],
.mobile-drawer a:hover {
  color: var(--color-text);
}
.drawer-languages {
  padding-top: 8px;
}
.drawer-languages strong {
  display: block;
  padding: 8px 12px 2px;
  color: var(--color-dim);
  font-size: 12px;
}
.nav-veil {
  position: fixed;
  z-index: 55;
  inset: var(--nav-height) 0 0;
  display: none;
  background: var(--overlay-dark-soft);
}
.nav-veil.is-open {
  display: block;
}
.site-footer {
  border-top: 1px solid var(--overlay-line);
  background: var(--color-panel);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1fr;
  gap: 42px;
  padding-top: 64px;
  padding-bottom: 42px;
}
.footer-brand {
  max-width: 340px;
}
.footer-brand .site-brand {
  margin-bottom: 14px;
}
.footer-brand p {
  color: var(--color-muted);
}
.footer-title {
  margin: 0 0 14px;
  color: var(--color-text);
  font-size: 13px;
  font-weight: 800;
}
.footer-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 18px;
}
.footer-links a,
.footer-languages a {
  min-height: 28px;
  color: var(--color-muted);
  font-size: 13px;
}
.footer-links a:hover,
.footer-languages a:hover {
  color: var(--color-accent);
}
.footer-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.footer-keywords a {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  padding: 4px 9px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xs);
  color: var(--color-muted);
  font-size: 12px;
}
.footer-languages {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 20px;
}
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 18px;
  padding-top: 22px;
  padding-bottom: 26px;
  border-top: 1px solid var(--overlay-line);
  color: var(--color-dim);
  font-size: 12px;
}
.footer-legal {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
}
.reveal {
  transition: opacity .55s ease, transform .55s ease;
}
.reveal.pending {
  opacity: 0;
  transform: translateY(16px);
}
.reveal.shown {
  opacity: 1;
  transform: none;
}
#server-status {
  position: relative;
  display: block;
  width: 100%;
  max-width: 100%;
  margin-bottom: 24px;
  overflow: hidden;
}
[data-counter] {
  display: inline-block;
  min-width: 3ch;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.prose > * {
  max-width: 100%;
}
.prose a {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.prose h2 {
  margin-top: 56px;
}
.prose h3 {
  margin-top: 34px;
}
.prose img,
.prose iframe {
  max-width: 100%;
}
body:has(.toc-tabs) section[id] {
  scroll-margin-top: var(--toc-offset);
}
@media (max-width: 1080px) {
  .desktop-nav {
    display: none;
  }
  .header-tools {
    margin-left: auto;
  }
  .menu-toggle {
    display: inline-flex;
  }
}
@media (max-width: 768px) {
  h1 {
    font-size: clamp(28px, 9.5vw, 40px);
    line-height: 1.12;
  }
  h2 {
    font-size: clamp(27px, 7vw, 36px);
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
  .footer-brand {
    grid-column: 1 / -1;
  }
}
@media (max-width: 640px) {
  .no-break {
    white-space: normal;
  }
  .wrap,
  .reading {
    padding-inline: var(--gutter);
  }
  .section {
    padding-top: 68px;
    padding-bottom: 68px;
  }
  .brand-local,
  .language-box {
    display: none;
  }
  .header-inner {
    gap: 8px;
  }
  .header-login {
    min-height: 36px;
    padding-inline: 11px;
  }
  .btn-row {
    justify-content: center;
  }
  .tilt,
  [class*="tilt-"] {
    transform: none;
  }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .footer-brand {
    grid-column: auto;
  }
  .footer-links {
    grid-template-columns: 1fr 1fr;
  }
  .footer-bottom {
    flex-direction: column;
  }
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .reveal,
  .reveal.pending {
    opacity: 1;
    transform: none;
  }
}