:root {
  --color-bg: #131038;
  --color-panel: #1A1650;
  --color-panel-raised: #221D66;
  --color-border: #35307A;
  --color-accent: #4EF2B3;
  --color-accent-dark: #17B67F;
  --color-text: #F2F1FB;
  --color-text-muted: #A8A4CE;
  --color-success: #3FD68F;
  --color-warning: #FFC24D;
  --color-error: #FF5C74;
  --color-shadow: rgba(0, 0, 0, .55);
  --color-shadow-heavy: rgba(0, 0, 0, .7);
  --color-white-soft: rgba(255, 255, 255, .05);
  --color-border-soft: color-mix(in srgb, var(--color-border) 55%, transparent);
  --color-accent-04: color-mix(in srgb, var(--color-accent) 4%, transparent);
  --color-accent-08: color-mix(in srgb, var(--color-accent) 8%, transparent);
  --color-accent-12: color-mix(in srgb, var(--color-accent) 12%, transparent);
  --color-accent-30: color-mix(in srgb, var(--color-accent) 30%, transparent);
  --font-display: 'Inter', 'Noto Sans SC', -apple-system, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --font-body: 'Inter', 'Noto Sans SC', -apple-system, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --font-mono: 'JetBrains Mono', 'SFMono-Regular', 'Menlo', 'Consolas', 'Courier New', monospace;
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --header-height: 64px;
  --content-width: 1320px;
  --reading-width: 820px;
  --gutter: 32px;
  --section-space: 88px;
  --focus-ring: 2px solid var(--color-accent);
  --shadow-chip: 0 2px 8px -4px var(--color-shadow);
  --shadow-panel: inset 0 1px 0 var(--color-white-soft), 0 34px 80px -34px var(--color-shadow-heavy), 0 12px 34px -18px var(--color-shadow);
  --transition-fast: 150ms ease;
  --transition-reveal: 560ms cubic-bezier(.2, .8, .2, 1);
  --toc-offset: 82px;
}
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  min-width: 320px;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 16px);
  background: var(--color-bg);
}
html.nav-open {
  overflow: hidden;
}
body {
  min-width: 320px;
  margin: 0;
  overflow-x: clip;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
main,
section,
article,
aside,
header,
footer,
nav,
div {
  min-width: 0;
}
img,
svg,
video,
canvas {
  display: block;
  max-width: 100%;
}
img {
  height: auto;
}
svg {
  flex-shrink: 0;
}
button,
input,
select,
textarea {
  color: inherit;
  font: inherit;
}
button,
summary {
  cursor: pointer;
}
a {
  color: inherit;
  text-decoration: none;
}
p,
ul,
ol,
blockquote,
pre,
table {
  margin-top: 0;
}
ul,
ol {
  padding: 0;
}
li {
  min-width: 0;
}
code,
kbd,
samp {
  font-family: var(--font-mono);
}
:not(pre) > code {
  overflow-wrap: anywhere;
  color: var(--color-accent);
  background: var(--color-panel-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xs);
  padding: .12em .38em;
}
pre {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  padding: 18px 20px;
  color: var(--color-text);
  background: var(--color-panel);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
}
pre code {
  white-space: pre;
}
hr {
  border: 0;
  border-top: 1px solid var(--color-border);
}
h1,
h2,
h3,
h4 {
  color: var(--color-text);
  font-family: var(--font-display);
  text-wrap: balance;
}
h1 {
  margin: 0 0 24px;
  font-size: clamp(52px, 5.1vw, 72px);
  font-weight: 900;
  letter-spacing: -.015em;
  line-height: 1.1;
}
h2 {
  margin: 0 0 18px;
  font-size: clamp(30px, 3.4vw, 46px);
  font-weight: 850;
  line-height: 1.16;
}
h3 {
  margin: 0 0 12px;
  font-size: clamp(20px, 2.1vw, 27px);
  font-weight: 800;
  line-height: 1.25;
}
p {
  margin-bottom: 18px;
}
::selection {
  color: var(--color-bg);
  background: var(--color-accent);
}
:where(a, button, summary, select, input, textarea, [tabindex]):focus-visible {
  outline: var(--focus-ring);
  outline-offset: 3px;
}
.no-break {
  white-space: nowrap;
}
.mono,
.fact-number,
.price-value {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}
.wrap {
  width: 100%;
  max-width: var(--content-width);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.reading-wrap {
  width: 100%;
  max-width: calc(var(--reading-width) + (var(--gutter) * 2));
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.section {
  padding-top: var(--section-space);
  padding-bottom: var(--section-space);
  overflow-x: clip;
}
.section-compact {
  padding-top: calc(var(--section-space) * .62);
  padding-bottom: calc(var(--section-space) * .62);
  overflow-x: clip;
}
.section-head {
  max-width: 760px;
  margin-bottom: 34px;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  margin-bottom: 16px;
  padding: 5px 11px;
  color: var(--color-text-muted);
  background: var(--color-panel);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-chip);
  font-family: var(--font-mono);
  font-size: 12px;
}
.status-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--color-success);
}
.text-muted {
  color: var(--color-text-muted);
}
.text-accent,
.keyword {
  color: var(--color-accent);
}
.panel,
.card {
  min-width: 0;
  background: var(--color-panel);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-panel);
}
.card {
  padding: 24px;
}
.badge,
.tag {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  overflow: hidden;
  padding: 2px 9px;
  color: var(--color-text-muted);
  background: var(--color-panel-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xs);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.4;
}
.badge-accent {
  color: var(--color-accent);
  background: var(--color-accent-08);
  border-color: color-mix(in srgb, var(--color-accent) 55%, var(--color-border));
}
.button,
.btn-primary,
.btn-secondary,
.btn-ghost,
.btn-login {
  display: inline-flex;
  min-width: 24px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--radius-sm);
  padding: 11px 24px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
  transition: color var(--transition-fast), background var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
}
.btn-primary {
  color: var(--color-bg);
  background: var(--color-accent);
  border: 1px solid var(--color-accent);
  box-shadow: 0 10px 30px -10px var(--color-accent-30);
}
.btn-primary:hover {
  background: var(--color-accent-dark);
  border-color: var(--color-accent-dark);
  transform: translateY(-1px);
}
.btn-secondary,
.btn-ghost,
.btn-login {
  color: var(--color-text);
  background: var(--color-panel);
  border: 1px solid var(--color-border);
}
.btn-secondary:hover,
.btn-ghost:hover,
.btn-login:hover {
  background: var(--color-panel-raised);
  border-color: var(--color-accent);
}
.btn-disabled,
.button:disabled {
  color: var(--color-text-muted);
  background: var(--color-panel);
  border: 1px solid var(--color-border);
  cursor: not-allowed;
  opacity: .6;
}
.icon-button {
  display: inline-flex;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: var(--color-text);
  background: var(--color-panel);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
}
.reveal {
  transition: opacity var(--transition-reveal), transform var(--transition-reveal);
}
.reveal.pending {
  opacity: 0;
  transform: translateY(16px);
}
.reveal.shown {
  opacity: 1;
  transform: none;
}
.site-header,
.topbar {
  position: relative;
  z-index: 100;
  height: var(--header-height);
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
}
.topbar-inner {
  display: flex;
  width: 100%;
  max-width: var(--content-width);
  height: 100%;
  align-items: center;
  gap: 30px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.brand {
  display: inline-flex;
  min-height: 44px;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
}
.brand-logo {
  width: 30px;
  height: 30px;
}
.brand-name {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 900;
  letter-spacing: .02em;
}
.brand-local {
  color: var(--color-text-muted);
  font-size: 14px;
  font-weight: 600;
}
.nav-tabs {
  display: flex;
  height: 100%;
  flex: 1 1 auto;
  align-items: stretch;
  gap: 3px;
}
.nav-tabs a {
  position: relative;
  display: flex;
  min-height: 44px;
  align-items: center;
  padding-inline: 11px;
  color: var(--color-text-muted);
  font-size: 14px;
  font-weight: 500;
}
.nav-tabs a:hover,
.nav-tabs a.is-current {
  color: var(--color-text);
}
.nav-tabs a.is-current {
  font-weight: 700;
}
.nav-tabs a.is-current::after {
  position: absolute;
  right: 10px;
  bottom: -1px;
  left: 10px;
  height: 2px;
  background: var(--color-accent);
  border-radius: var(--radius-xs);
  content: "";
}
.header-tools {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 12px;
}
.language {
  position: relative;
}
.language-button {
  display: inline-flex;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  color: var(--color-text-muted);
  background: transparent;
  border: 0;
}
.language-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  display: none;
  width: 170px;
  padding: 6px;
  background: var(--color-panel);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-panel);
}
.language.is-open .language-menu {
  display: block;
}
.language-menu a {
  display: flex;
  min-height: 44px;
  align-items: center;
  padding: 8px 10px;
  border-radius: var(--radius-xs);
}
.language-menu a:hover,
.language-menu a[aria-current="true"] {
  color: var(--color-accent);
  background: var(--color-panel-raised);
}
.menu-toggle {
  display: none;
}
.mobile-drawer {
  display: none;
}
.menu-veil {
  display: none;
}
.site-footer {
  position: relative;
  z-index: 2;
  padding-top: 58px;
  padding-bottom: 28px;
  background: var(--color-panel);
  border-top: 1px solid var(--color-border);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1.2fr .8fr;
  gap: 34px;
}
.footer-brand {
  max-width: 330px;
}
.footer-brand .brand {
  margin-bottom: 16px;
}
.footer-brand p,
.footer-column a,
.footer-languages a {
  color: var(--color-text-muted);
}
.footer-column h2 {
  margin-bottom: 14px;
  font-size: 14px;
  letter-spacing: .04em;
}
.footer-links {
  display: grid;
  gap: 7px;
  list-style: none;
}
.footer-links a {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
}
.footer-links a:hover,
.footer-languages a:hover {
  color: var(--color-accent);
}
.footer-languages {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
}
.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 38px;
  padding-top: 20px;
  color: var(--color-text-muted);
  border-top: 1px solid var(--color-border);
  font-family: var(--font-mono);
  font-size: 12px;
}
.footer-legal {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}
.prose {
  color: var(--color-text-muted);
}
.prose h2,
.prose h3,
.prose strong {
  color: var(--color-text);
}
.prose h2 {
  margin-top: 52px;
}
.prose h3 {
  margin-top: 34px;
}
.prose ul,
.prose ol {
  margin-bottom: 22px;
  padding-left: 1.4em;
}
.prose ul {
  list-style: disc;
}
.prose ol {
  list-style: decimal;
}
.prose a {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.prose a.btn-primary {
  color: var(--color-bg);
  text-decoration: none;
}
body:has(.toc-tabs) section[id] {
  scroll-margin-top: var(--toc-offset);
}
@media (max-width: 1160px) {
  .topbar-inner {
    gap: 18px;
  }
  .nav-tabs a {
    padding-inline: 7px;
    font-size: 13px;
  }
  .language-button span {
    display: none;
  }
}
@media (max-width: 900px) {
  :root {
    --gutter: 22px;
    --section-space: 68px;
  }
  .desktop-nav {
    display: none;
  }
  .header-tools {
    margin-left: auto;
  }
  .menu-toggle {
    display: inline-flex;
  }
  .menu-veil {
    position: fixed;
    z-index: 90;
    inset: var(--header-height) 0 0;
    background: color-mix(in srgb, var(--color-bg) 78%, transparent);
  }
  .site-header.menu-open .menu-veil {
    display: block;
  }
  .mobile-drawer {
    position: absolute;
    z-index: 110;
    top: var(--header-height);
    right: 0;
    left: 0;
    max-height: calc(100dvh - var(--header-height));
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 10px var(--gutter) 18px;
    background: var(--color-panel);
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow-panel);
  }
  .site-header.menu-open .mobile-drawer {
    display: block;
  }
  .mobile-drawer ul {
    display: grid;
    gap: 2px;
    margin: 0;
    list-style: none;
  }
  .mobile-drawer a {
    display: flex;
    width: 100%;
    min-height: 46px;
    align-items: center;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
  }
  .mobile-drawer a:hover,
  .mobile-drawer a.is-current {
    color: var(--color-accent);
    background: var(--color-panel-raised);
  }
  .mobile-language-links {
    margin-top: 10px !important;
    padding-top: 10px;
    border-top: 1px solid var(--color-border);
  }
  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 768px) {
  h1 {
    font-size: clamp(32px, 9.4vw, 40px);
    line-height: 1.12;
  }
  h2 {
    font-size: clamp(27px, 7.6vw, 36px);
  }
  .brand-local,
  .desktop-language {
    display: none;
  }
  .btn-login {
    min-height: 40px;
    padding: 9px 15px;
  }
  .footer-bottom {
    align-items: flex-start;
    flex-direction: column;
  }
}
@media (max-width: 640px) {
  :root {
    --gutter: 16px;
    --section-space: 56px;
  }
  .wrap,
  .reading-wrap,
  .topbar-inner {
    padding-inline: var(--gutter);
  }
  .card {
    padding: 19px;
  }
  .tilt,
  [class*="tilt-"] {
    transform: none !important;
  }
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .brand-name {
    font-size: 17px;
  }
}
@media (max-width: 390px) {
  .topbar-inner {
    gap: 8px;
  }
  .header-tools {
    gap: 7px;
  }
  .btn-login {
    padding-inline: 11px;
  }
}
@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;
  }
}