:root {
  --color-bg: #0E1013;
  --color-panel: #14171C;
  --color-panel-raised: #1B1F26;
  --color-border: #262B33;
  --color-line: #3A414C;
  --color-accent: #DDF247;
  --color-accent-deep: #9DB61E;
  --color-text: #F2F4F0;
  --color-text-muted: #9AA3AD;
  --color-success: #6FE08F;
  --color-warning: #F5B94A;
  --color-error: #F26D6D;
  --color-focus: #DDF247;
  --color-accent-glow: rgb(221 242 71 / 22%);
  --color-accent-glow-strong: rgb(221 242 71 / 55%);
  --color-accent-glow-soft: rgb(221 242 71 / 10%);
  --color-success-glow: rgb(111 224 143 / 50%);
  --color-shadow: rgb(0 0 0 / 45%);
  --color-overlay: rgb(14 16 19 / 76%);
  --color-flag-red: #CE3B3B;
  --color-flag-blue: #2C4E8F;
  --color-flag-navy: #20335F;
  --color-flag-white: #F4F5F2;
  --font-display: 'Inter', 'Noto Sans SC', -apple-system, 'PingFang SC', 'Hiragino Kaku Gothic ProN', 'Malgun Gothic', 'Microsoft YaHei', sans-serif;
  --font-body: 'Inter', 'Noto Sans SC', -apple-system, 'PingFang SC', 'Hiragino Kaku Gothic ProN', 'Malgun Gothic', 'Microsoft YaHei', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', 'Cascadia Mono', Consolas, monospace;
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-pill: 999px;
  --gutter: clamp(16px, 3.4vw, 48px);
  --content-max: 1360px;
  --reading-max: 780px;
  --section-space: clamp(72px, 9vw, 128px);
  --header-height: 64px;
  --toc-height: 58px;
  --toc-offset: 138px;
  --line-reading: 1.82;
  --transition-fast: 150ms ease;
  --transition-reveal: 620ms cubic-bezier(.2, .7, .2, 1);
  --shadow-panel: 0 18px 54px rgb(0 0 0 / 24%);
  --shadow-accent: 0 8px 28px rgb(221 242 71 / 18%);
  --noise-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

*,
*::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;
  color: var(--color-text);
  background: var(--color-bg);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: 90;
  background-image: var(--noise-image);
  background-size: 160px 160px;
  content: "";
  opacity: .03;
  pointer-events: none;
}

main,
section,
article,
aside,
header,
footer,
nav,
div {
  min-width: 0;
}

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,
dl,
blockquote,
pre,
table,
figure {
  margin-top: 0;
}

p {
  margin-bottom: 1.15em;
}

ul,
ol {
  padding-left: 1.35em;
}

code,
kbd,
samp {
  font-family: var(--font-mono);
}

:not(pre) > code {
  padding: .14em .38em;
  overflow-wrap: anywhere;
  color: var(--color-accent);
  background: var(--color-panel-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xs);
  font-size: .88em;
}

pre {
  max-width: 100%;
  padding: 20px;
  overflow-x: auto;
  color: var(--color-text);
  background: var(--color-panel);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: .88rem;
  line-height: 1.7;
  -webkit-overflow-scrolling: touch;
}

pre code {
  overflow-wrap: normal;
  white-space: pre;
}

hr {
  height: 1px;
  margin: 48px 0;
  background: var(--color-border);
  border: 0;
}

::selection {
  color: var(--color-bg);
  background: var(--color-accent);
}

:where(a, button, input, select, textarea, summary, [role="tab"]):focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 3px;
}

.wrap {
  width: 100%;
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.reading-wrap {
  width: 100%;
  max-width: calc(var(--reading-max) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  position: relative;
  padding-top: var(--section-space);
  padding-bottom: var(--section-space);
  overflow-x: clip;
}

.section-compact {
  padding-top: clamp(48px, 6vw, 80px);
  padding-bottom: clamp(48px, 6vw, 80px);
}

.section-panel {
  background: var(--color-panel);
  border-block: 1px solid var(--color-border);
}

.eyebrow {
  margin-bottom: 14px;
  color: var(--color-accent-deep);
  font-family: var(--font-mono);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
}

h1,
h2,
h3,
h4 {
  margin-top: 0;
  color: var(--color-text);
  font-family: var(--font-display);
  text-wrap: balance;
}

h1 {
  margin-bottom: 24px;
  font-size: clamp(52px, 5.1vw, 72px);
  font-weight: 800;
  letter-spacing: -.01em;
  line-height: 1.12;
}

h2 {
  margin-bottom: 20px;
  font-size: clamp(34px, 4vw, 52px);
  font-weight: 800;
  letter-spacing: -.01em;
  line-height: 1.16;
}

h3 {
  margin-bottom: 12px;
  font-size: clamp(21px, 2vw, 28px);
  font-weight: 750;
  line-height: 1.28;
}

h4 {
  margin-bottom: 10px;
  font-size: 1rem;
  font-weight: 750;
}

.no-break {
  white-space: nowrap;
}

.accent-text {
  color: var(--color-accent);
  text-shadow: 0 0 28px var(--color-accent-glow);
}

.lead {
  max-width: 720px;
  color: var(--color-text-muted);
  font-size: clamp(18px, 2vw, 22px);
  line-height: 1.75;
}

.muted {
  color: var(--color-text-muted);
}

.mono {
  font-family: var(--font-mono);
}

.text-link {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  color: var(--color-accent);
  font-weight: 650;
  text-underline-offset: 4px;
}

.text-link:hover {
  text-decoration: underline;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}

.btn {
  display: inline-flex;
  min-width: 24px;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 12px 30px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-family: var(--font-display);
  font-size: .97rem;
  font-weight: 750;
  line-height: 1.2;
  text-align: center;
  transition: transform var(--transition-fast), border-color var(--transition-fast), background-color var(--transition-fast), box-shadow var(--transition-fast);
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  color: var(--color-bg);
  background: var(--color-accent);
  border-color: var(--color-accent-deep);
  box-shadow: var(--shadow-accent);
}

.btn-primary:hover {
  box-shadow: 0 10px 34px var(--color-accent-glow);
}

.btn-secondary,
.btn-ghost {
  color: var(--color-text);
  background: transparent;
  border-color: var(--color-line);
}

.btn-secondary:hover,
.btn-ghost:hover {
  border-color: var(--color-accent-deep);
  box-shadow: 0 0 0 3px var(--color-accent-glow-soft);
}

.btn-small {
  min-height: 38px;
  padding: 8px 16px;
  font-size: .84rem;
}

.btn[aria-disabled="true"],
.btn:disabled {
  color: var(--color-text-muted);
  background: var(--color-panel-raised);
  border-color: var(--color-border);
  box-shadow: none;
  cursor: not-allowed;
  opacity: .65;
  transform: none;
}

.panel,
.card {
  min-width: 0;
  background: var(--color-panel);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}

.panel {
  padding: clamp(22px, 3vw, 38px);
}

.card {
  padding: 24px;
}

.card-raised {
  background: var(--color-panel-raised);
  box-shadow: var(--shadow-panel);
}

.badge,
.capsule,
.tag {
  display: inline-flex;
  max-width: 100%;
  min-height: 28px;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  overflow: hidden;
  color: var(--color-text-muted);
  background: var(--color-panel);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: .73rem;
  line-height: 1.35;
  text-overflow: ellipsis;
}

.capsule {
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.status-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  background: var(--color-success);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--color-success-glow);
}

.trust-check {
  flex: 0 0 auto;
  color: var(--color-accent);
  font-weight: 800;
}

.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 {
  position: relative;
  z-index: 70;
  height: var(--header-height);
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
}

.header-inner {
  display: flex;
  height: var(--header-height);
  align-items: center;
  gap: 28px;
}

.site-brand {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.site-brand img {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
}

.brand-word {
  color: var(--color-text);
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: .04em;
}

.brand-local {
  color: var(--color-text-muted);
  font-size: 13px;
  font-weight: 500;
}

.desktop-nav {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.desktop-nav a {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  color: var(--color-text-muted);
  font-size: 13.5px;
  transition: color var(--transition-fast);
}

.desktop-nav a:hover,
.desktop-nav a.is-active {
  color: var(--color-text);
}

.desktop-nav a + a::before {
  padding-inline: 12px;
  color: var(--color-text-muted);
  content: "·";
  opacity: .4;
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
}

.language-control {
  position: relative;
}

.language-toggle {
  display: inline-flex;
  min-width: 24px;
  min-height: 36px;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  color: var(--color-text-muted);
  background: transparent;
  border: 0;
  border-radius: var(--radius-sm);
  font-size: 13px;
}

.language-caret {
  font-size: 10px;
  opacity: .72;
}

.language-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 75;
  width: 168px;
  padding: 6px;
  background: var(--color-panel-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-panel);
}

.language-menu[hidden] {
  display: none;
}

.language-menu a {
  display: flex;
  min-height: 40px;
  align-items: center;
  padding: 8px 10px;
  color: var(--color-text-muted);
  border-radius: var(--radius-sm);
  font-size: 13px;
}

.language-menu a:hover,
.language-menu a[aria-current="true"] {
  color: var(--color-text);
  background: var(--color-panel);
}

.header-login {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  padding: 7px 18px;
  color: var(--color-text);
  background: var(--color-panel);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 650;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.header-login:hover {
  border-color: var(--color-accent-deep);
  box-shadow: 0 0 0 3px var(--color-accent-glow-soft);
}

.menu-toggle {
  display: none;
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: var(--color-text);
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
}

.menu-toggle-lines,
.menu-toggle-lines::before,
.menu-toggle-lines::after {
  width: 18px;
  height: 1px;
  background: currentColor;
  content: "";
  transition: transform var(--transition-fast);
}

.menu-toggle-lines {
  position: relative;
}

.menu-toggle-lines::before,
.menu-toggle-lines::after {
  position: absolute;
  left: 0;
}

.menu-toggle-lines::before {
  top: -6px;
}

.menu-toggle-lines::after {
  top: 6px;
}

.menu-toggle[aria-expanded="true"] .menu-toggle-lines {
  background: transparent;
}

.menu-toggle[aria-expanded="true"] .menu-toggle-lines::before {
  top: 0;
  transform: rotate(45deg);
}

.menu-toggle[aria-expanded="true"] .menu-toggle-lines::after {
  top: 0;
  transform: rotate(-45deg);
}

.mobile-nav {
  display: none;
}

.mobile-nav[hidden] {
  display: none;
}

.mobile-nav a {
  display: flex;
  width: 100%;
  min-height: 48px;
  align-items: center;
  padding: 12px var(--gutter);
  color: var(--color-text-muted);
  border-bottom: 1px solid var(--color-border);
}

.mobile-nav a:hover,
.mobile-nav a.is-active {
  color: var(--color-text);
  background: var(--color-panel-raised);
}

.mobile-language-group {
  padding: 10px var(--gutter) 16px;
  background: var(--color-panel);
}

.mobile-language-group a {
  min-height: 44px;
  padding: 10px 0;
}

.nav-veil {
  display: none;
}

.site-footer {
  position: relative;
  padding-top: 64px;
  padding-bottom: 24px;
  overflow-x: clip;
  background: var(--color-panel);
  border-top: 1px solid var(--color-border);
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(240px, 1.2fr) 1fr 1fr;
  gap: clamp(28px, 5vw, 72px);
}

.footer-brand {
  max-width: 390px;
}

.footer-brand .site-brand {
  margin-bottom: 18px;
}

.footer-brand p {
  color: var(--color-text-muted);
  font-size: .93rem;
}

.footer-title {
  margin-bottom: 15px;
  color: var(--color-text);
  font-size: .84rem;
  font-weight: 750;
}

.footer-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px 20px;
}

.footer-links a,
.footer-keywords a,
.footer-languages a,
.footer-legal a {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  color: var(--color-text-muted);
  font-size: .86rem;
}

.footer-links a:hover,
.footer-keywords a:hover,
.footer-languages a:hover,
.footer-legal a:hover {
  color: var(--color-accent);
}

.footer-keywords,
.footer-languages {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 14px;
}

.footer-bottom {
  display: flex;
  margin-top: 46px;
  padding-top: 20px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: var(--color-text-muted);
  border-top: 1px solid var(--color-border);
  font-size: .78rem;
}

.footer-legal {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
}

.prose {
  color: var(--color-text-muted);
  line-height: var(--line-reading);
}

.prose h2,
.prose h3,
.prose h4,
.prose strong {
  color: var(--color-text);
}

.prose h2 {
  margin-top: 2.2em;
}

.prose h3 {
  margin-top: 1.8em;
}

.prose a {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.prose a.btn-primary {
  color: var(--color-bg);
  text-decoration: none;
}

.prose li + li {
  margin-top: .45em;
}

body:has(.toc-tabs) section[id] {
  scroll-margin-top: var(--toc-offset);
}

@media (max-width: 1180px) {
  .desktop-nav a + a::before {
    padding-inline: 7px;
  }

  .desktop-nav a {
    font-size: 12.5px;
  }

  .header-inner {
    gap: 18px;
  }
}

@media (max-width: 960px) {
  .desktop-nav,
  .language-control {
    display: none;
  }

  .header-tools {
    margin-left: auto;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .mobile-nav {
    position: absolute;
    top: var(--header-height);
    left: 0;
    z-index: 74;
    display: block;
    width: 100%;
    max-height: calc(100dvh - var(--header-height));
    overflow-y: auto;
    overscroll-behavior: contain;
    background: var(--color-panel);
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow-panel);
  }

  .nav-veil.is-open {
    position: fixed;
    inset: var(--header-height) 0 0;
    z-index: 65;
    display: block;
    background: var(--color-overlay);
    border: 0;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 768px) {
  h1 {
    font-size: clamp(32px, 9vw, 40px);
    line-height: 1.14;
  }

  h2 {
    font-size: clamp(28px, 7.5vw, 38px);
  }

  .section {
    padding-top: 72px;
    padding-bottom: 72px;
  }

  .tilt,
  [class*="tilt-"] {
    transform: none;
  }

  [data-parallax-decor] {
    transform: none;
  }

  .reveal,
  .reveal.pending,
  .reveal.shown {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 640px) {
  :root {
    --gutter: 16px;
  }

  .brand-local {
    display: none;
  }

  .header-inner {
    gap: 8px;
  }

  .header-tools {
    gap: 7px;
    margin-left: auto;
  }

  .header-login {
    min-height: 38px;
    padding-inline: 12px;
  }

  .button-row {
    align-items: stretch;
  }

  .button-row .btn {
    flex: 1 1 148px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .footer-brand {
    grid-column: auto;
  }

  .footer-bottom {
    align-items: flex-start;
    flex-direction: column;
  }

  .footer-links {
    grid-template-columns: 1fr 1fr;
  }

  .card,
  .panel {
    padding: 20px;
  }
}

@media (max-width: 380px) {
  .brand-word {
    font-size: 15px;
  }

  .header-login {
    padding-inline: 10px;
  }

  .menu-toggle {
    width: 42px;
    min-width: 42px;
  }
}

@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,
  .reveal.shown {
    opacity: 1;
    transform: none;
  }
}