:root {
  --color-bg: #120B08;
  --color-bg-panel: #101923;
  --color-bg-panel-2: #25170F;
  --color-border: #715238;
  --color-accent: #F4A62A;
  --color-accent-dark: #B85B17;
  --color-text: #F4E5C7;
  --color-text-muted: #B8A98D;
  --color-success: #8FAE9B;
  --color-warn: #F4A62A;
  --color-error: #E3422F;
  --color-transparent: transparent;
  --color-shadow: rgba(0, 0, 0, 0.56);
  --color-shadow-deep: rgba(0, 0, 0, 0.78);
  --color-panel-glass: rgba(16, 25, 35, 0.86);
  --color-grid-brown: rgba(113, 82, 56, 0.12);
  --color-grid-blue: rgba(143, 174, 155, 0.06);
  --color-accent-soft: rgba(244, 166, 42, 0.14);
  --color-accent-mid: rgba(244, 166, 42, 0.32);
  --color-accent-glow: rgba(244, 166, 42, 0.48);
  --color-error-soft: rgba(227, 66, 47, 0.18);
  --color-success-soft: rgba(143, 174, 155, 0.16);
  --color-text-soft: rgba(244, 229, 199, 0.08);
  --color-text-faint: rgba(244, 229, 199, 0.04);
  --color-black-soft: rgba(0, 0, 0, 0.26);
  --color-white-glint: rgba(255, 255, 255, 0.08);
  --font-display: Inter, "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --font-body: "Noto Sans SC", Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  --radius-none: 0;
  --radius-xs: 2px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-pill: 999px;
  --page-width: 1320px;
  --content-width: 820px;
  --nav-height: 76px;
  --gutter: clamp(16px, 4vw, 32px);
  --section-space: clamp(68px, 9vw, 120px);
  --control-height: 46px;
  --ease-machine: cubic-bezier(0.22, 0.78, 0.24, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 0;
  scroll-behavior: smooth;
  background: var(--color-bg);
}

html.nav-open {
  overflow: hidden;
}

body {
  min-width: 0;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--color-text);
  background:
    linear-gradient(90deg, var(--color-grid-brown) 1px, var(--color-transparent) 1px),
    linear-gradient(0deg, var(--color-grid-blue) 1px, var(--color-transparent) 1px),
    linear-gradient(118deg, var(--color-bg) 0%, var(--color-bg-panel-2) 39%, var(--color-bg-panel) 74%, var(--color-bg) 100%);
  background-size: 72px 72px, 72px 72px, 100% 100%;
  font-family: var(--font-body);
  line-height: 1.75;
  text-rendering: optimizeLegibility;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    var(--color-transparent) 0,
    var(--color-transparent) 3px,
    var(--color-text-faint) 4px
  );
  opacity: 0.46;
}

img,
svg,
video {
  max-width: 100%;
  height: auto;
}

img {
  display: block;
}

button,
input,
select,
textarea,
summary {
  font: inherit;
}

button,
summary {
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

a,
button,
summary {
  -webkit-tap-highlight-color: var(--color-transparent);
}

p,
h1,
h2,
h3,
h4,
ul,
ol,
blockquote,
pre,
figure {
  margin-top: 0;
}

h1,
h2,
h3,
h4 {
  color: var(--color-text);
  font-family: var(--font-display);
  line-height: 1.12;
}

h1 {
  margin-bottom: 24px;
  font-size: clamp(46px, 6.1vw, 82px);
  font-weight: 850;
  letter-spacing: -0.045em;
}

h2 {
  margin-bottom: 18px;
  font-size: clamp(30px, 4vw, 48px);
  letter-spacing: -0.025em;
}

h3 {
  margin-bottom: 12px;
  font-size: clamp(20px, 2.3vw, 27px);
}

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

strong {
  color: var(--color-text);
}

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

:not(pre) > code {
  max-width: 100%;
  padding: 0.12em 0.38em;
  border: 1px solid var(--color-border);
  color: var(--color-accent);
  background: var(--color-bg-panel);
  overflow-wrap: anywhere;
}

pre {
  max-width: 100%;
  overflow-x: auto;
  padding: 20px;
  border: 1px solid var(--color-border);
  color: var(--color-text);
  background: var(--color-bg-panel);
  box-shadow: inset 8px 8px 18px var(--color-shadow);
  font-family: var(--font-mono);
  line-height: 1.65;
  overscroll-behavior-inline: contain;
}

pre code {
  padding: 0;
  border: 0;
  color: inherit;
  background: none;
  white-space: pre;
  overflow-wrap: normal;
}

table {
  border-collapse: collapse;
}

th,
td {
  padding: 13px 15px;
  border: 1px solid var(--color-border);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--color-accent);
  background: var(--color-bg-panel-2);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.05em;
}

td {
  color: var(--color-text-muted);
  background: var(--color-bg-panel);
}

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

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

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

.section {
  padding-top: var(--section-space);
  padding-bottom: var(--section-space);
}

.section-compact {
  padding-top: calc(var(--section-space) * 0.58);
  padding-bottom: calc(var(--section-space) * 0.58);
}

.section,
.section-compact,
.hero,
.decorated-region {
  overflow-x: clip;
}

.grid {
  display: grid;
  gap: 24px;
}

.grid > *,
.flex-row > *,
.button-row > * {
  min-width: 0;
}

.flex-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.eyebrow,
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 16px;
  color: var(--color-accent);
  font-family: var(--font-mono);
  font-size: 0.73rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.eyebrow::before,
.kicker::before {
  width: 8px;
  height: 8px;
  flex-shrink: 0;
  content: "";
  background: var(--color-error);
  box-shadow: 0 0 13px var(--color-error-soft);
}

.accent-text {
  color: var(--color-accent);
  background: linear-gradient(90deg, var(--color-accent), var(--color-text), var(--color-accent));
  background-size: 220% 100%;
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: var(--color-transparent);
  animation: text-sweep 5s linear infinite;
}

.lead {
  max-width: 720px;
  color: var(--color-text-muted);
  font-size: clamp(17px, 2vw, 21px);
}

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

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

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn {
  min-height: var(--control-height);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 10px 18px;
  border: 1px solid var(--color-border);
  border-bottom-width: 4px;
  border-radius: var(--radius-xs);
  color: var(--color-text);
  background: linear-gradient(180deg, var(--color-bg-panel-2), var(--color-bg));
  box-shadow: inset 0 1px 0 var(--color-white-glint), 0 8px 14px var(--color-shadow);
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
}

.btn:hover {
  color: var(--color-accent);
  border-color: var(--color-accent-dark);
}

.btn:active {
  border-bottom-width: 1px;
  transform: translateY(3px);
}

.btn:focus-visible,
.nav-link:focus-visible,
.mobile-nav a:focus-visible,
.language-menu a:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

.btn-primary {
  color: var(--color-bg);
  border-color: var(--color-accent);
  background: linear-gradient(180deg, var(--color-accent), var(--color-accent-dark));
}

.btn-primary:hover {
  color: var(--color-bg);
  border-color: var(--color-text);
}

.btn-danger {
  border-color: var(--color-error);
  background: linear-gradient(180deg, var(--color-error), var(--color-bg-panel-2));
}

.btn-small {
  min-height: 38px;
  padding: 7px 13px;
  font-size: 0.86rem;
}

.btn[disabled],
.btn.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

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

.panel {
  padding: clamp(22px, 4vw, 40px);
  background:
    linear-gradient(90deg, var(--color-text-faint) 1px, var(--color-transparent) 1px),
    var(--color-bg-panel);
  background-size: 24px 100%;
  box-shadow: inset 10px 10px 24px var(--color-shadow), 12px 14px 0 var(--color-black-soft);
}

.panel::before,
.card::before {
  position: absolute;
  top: 9px;
  left: 9px;
  width: 7px;
  height: 7px;
  content: "";
  border: 1px solid var(--color-text-muted);
  border-radius: 50%;
  background: var(--color-bg);
}

.card {
  padding: 27px;
  background: linear-gradient(145deg, var(--color-bg-panel), var(--color-bg-panel-2));
  box-shadow: inset 0 1px 0 var(--color-white-glint), 8px 10px 0 var(--color-black-soft);
}

.card > :last-child,
.panel > :last-child {
  margin-bottom: 0;
}

.tilt {
  transform: rotate(-0.35deg);
}

.site-header {
  position: relative;
  z-index: 100;
  height: var(--nav-height);
  border-bottom: 1px solid var(--color-border);
  background: var(--color-panel-glass);
  box-shadow: 0 12px 34px var(--color-black-soft);
  backdrop-filter: blur(16px);
}

.nav-shell {
  position: relative;
  width: 100%;
  max-width: calc(var(--page-width) + var(--gutter) * 2);
  height: 100%;
  display: flex;
  align-items: center;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.brand {
  min-width: 220px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
}

.brand-mark {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border: 1px solid var(--color-accent);
  border-radius: var(--radius-md);
  box-shadow: inset 0 1px 0 var(--color-white-glint), 0 7px 18px var(--color-shadow);
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1.3;
}

.brand-copy small {
  color: var(--color-text-muted);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.15em;
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.nav-link,
.more-menu > summary {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 0 13px;
  border: 1px solid var(--color-transparent);
  color: var(--color-text-muted);
  font-size: 14px;
  line-height: 1.2;
  cursor: pointer;
}

.nav-link:hover,
.more-menu > summary:hover {
  color: var(--color-text);
  border-color: var(--color-border);
  background: var(--color-text-faint);
}

.nav-link.is-active,
.more-menu.is-active > summary {
  color: var(--color-accent);
  border-color: var(--color-accent-mid);
  background: var(--color-accent-soft);
}

.more-menu,
.language-picker {
  position: relative;
}

.more-menu > summary,
.language-picker > summary {
  list-style: none;
}

.more-menu > summary::-webkit-details-marker,
.language-picker > summary::-webkit-details-marker {
  display: none;
}

.more-menu > summary::after,
.language-picker > summary::after {
  margin-left: 7px;
  content: "▾";
  color: var(--color-accent);
  font-size: 10px;
}

.more-list,
.language-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 140;
  width: 174px;
  padding: 7px;
  border: 1px solid var(--color-border);
  background: var(--color-bg-panel);
  box-shadow: 12px 14px 0 var(--color-shadow);
}

.more-list a,
.language-menu a {
  min-height: 42px;
  display: flex;
  align-items: center;
  width: 100%;
  padding: 9px 11px;
  color: var(--color-text-muted);
  font-size: 13px;
}

.more-list a:hover,
.language-menu a:hover,
.language-menu a[aria-current="true"] {
  color: var(--color-accent);
  background: var(--color-accent-soft);
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 18px;
}

.language-picker > summary {
  min-width: 112px;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xs);
  color: var(--color-text);
  background: var(--color-bg-panel-2);
  font-size: 13px;
  cursor: pointer;
}

.nav-toggle {
  min-width: 44px;
  min-height: 44px;
  display: none;
  place-items: center;
  padding: 9px;
  border: 1px solid var(--color-border);
  color: var(--color-text);
  background: var(--color-bg-panel-2);
  cursor: pointer;
}

.nav-toggle-lines,
.nav-toggle-lines::before,
.nav-toggle-lines::after {
  width: 21px;
  height: 2px;
  display: block;
  background: var(--color-accent);
}

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

.nav-toggle-lines::before,
.nav-toggle-lines::after {
  position: absolute;
  left: 0;
  content: "";
}

.nav-toggle-lines::before {
  top: -7px;
}

.nav-toggle-lines::after {
  top: 7px;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-lines {
  background: var(--color-transparent);
}

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

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

.mobile-nav {
  display: none;
}

.mobile-nav-veil {
  display: none;
}

.site-footer {
  position: relative;
  margin-top: var(--section-space);
  border-top: 1px solid var(--color-border);
  background:
    linear-gradient(90deg, var(--color-text-faint) 1px, var(--color-transparent) 1px),
    var(--color-bg-panel);
  background-size: 32px 100%;
  box-shadow: inset 0 14px 30px var(--color-shadow);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.8fr 1.3fr 0.8fr;
  gap: 42px;
  padding-top: 60px;
  padding-bottom: 46px;
}

.footer-brand {
  min-width: 0;
}

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

.footer-title {
  margin-bottom: 16px;
  color: var(--color-accent);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
}

.footer-links {
  display: grid;
  gap: 9px;
}

.footer-links a {
  width: fit-content;
  max-width: 100%;
  color: var(--color-text-muted);
  font-size: 0.91rem;
  overflow-wrap: anywhere;
}

.footer-links a:hover {
  color: var(--color-accent);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding-top: 20px;
  padding-bottom: 24px;
  border-top: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition:
    opacity 0.72s var(--ease-machine),
    transform 0.72s var(--ease-machine);
}

.reveal.shown {
  opacity: 1;
  transform: translateY(0);
}

.prose {
  font-size: 1.02rem;
}

.prose h2,
.prose h3 {
  scroll-margin-top: calc(var(--nav-height) + 24px);
}

.prose h2 {
  margin-top: 3.2rem;
}

.prose h3 {
  margin-top: 2.2rem;
}

.prose p,
.prose li {
  overflow-wrap: anywhere;
}

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

.prose li::marker {
  color: var(--color-error);
}

.table-wrap {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
}

.data-table {
  width: 100%;
  min-width: 640px;
}

@keyframes text-sweep {
  from {
    background-position: 100% 50%;
  }

  to {
    background-position: -120% 50%;
  }
}

@media (max-width: 1040px) {
  .desktop-nav {
    display: none;
  }

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

  .nav-toggle {
    display: grid;
  }

  .mobile-nav {
    position: fixed;
    top: var(--nav-height);
    right: 0;
    z-index: 130;
    width: min(420px, 100%);
    max-height: calc(100dvh - var(--nav-height));
    overflow-y: auto;
    padding: 12px var(--gutter) 24px;
    border-left: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
    background: var(--color-bg-panel);
    box-shadow: -14px 18px 32px var(--color-shadow-deep);
    overscroll-behavior: contain;
  }

  .mobile-nav.is-open {
    display: block;
  }

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

  .mobile-nav a.is-active {
    color: var(--color-accent);
    background: var(--color-accent-soft);
  }

  .mobile-nav-label {
    margin: 20px 13px 7px;
    color: var(--color-accent);
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.14em;
  }

  .mobile-nav-veil {
    position: fixed;
    inset: var(--nav-height) 0 0;
    z-index: 90;
    border: 0;
    background: var(--color-shadow-deep);
  }

  .mobile-nav-veil.is-open {
    display: block;
  }

  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  :root {
    --nav-height: 66px;
    --gutter: 16px;
    --section-space: 66px;
  }

  body {
    background-size: 44px 44px, 44px 44px, 100% 100%;
  }

  h1 {
    font-size: clamp(39px, 13vw, 58px);
  }

  h2 {
    font-size: clamp(28px, 9vw, 39px);
  }

  .brand {
    min-width: 0;
    gap: 9px;
    font-size: 15px;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
  }

  .brand-copy small {
    display: none;
  }

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

  .header-tools > .language-picker {
    display: none;
  }

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

  .button-row .btn {
    width: 100%;
  }

  .panel,
  .card {
    padding: 22px 18px;
  }

  .tilt {
    transform: none;
  }

  .footer-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
  }

  .footer-bottom {
    flex-direction: column;
  }

  .data-table {
    min-width: 560px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}