:root {
  --color-canvas: #F7F7FA;
  --color-surface: #FFFFFF;
  --color-mist: #E9EEF9;
  --color-mint: #D8EDE7;
  --color-line: #E2E4EC;
  --color-line-strong: #C9CFDF;
  --color-brand: #3D5AD6;
  --color-brand-deep: #2A41A8;
  --color-ink: #17181D;
  --color-muted: #5D6270;
  --color-success: #1E9E6A;
  --color-warning: #A86712;
  --color-error: #D64545;
  --color-amber: #F2A65A;
  --color-board: #2B3348;
  --color-board-rim: #1E2534;
  --color-pin: #A9B2C7;
  --color-trace: rgba(61, 90, 214, .5);
  --color-board-highlight: rgba(255, 255, 255, .07);
  --color-chip-shadow-a: rgba(20, 26, 48, .30);
  --color-chip-shadow-b: rgba(20, 26, 48, .26);
  --color-card-shadow: rgba(23, 24, 29, .08);
  --color-button-shadow: rgba(61, 90, 214, .30);
  --color-button-shadow-soft: rgba(42, 65, 168, .18);
  --color-overlay: rgba(23, 24, 29, .42);
  --font-display: 'Inter', 'Noto Sans SC', -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-body: 'Inter', 'Noto Sans SC', -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Consolas, monospace;
  --radius-large: 22px;
  --radius-medium: 14px;
  --radius-small: 10px;
  --radius-pill: 999px;
  --shadow-card: 0 16px 42px var(--color-card-shadow);
  --shadow-button: 0 3px 8px var(--color-button-shadow-soft), 0 12px 26px var(--color-button-shadow);
  --content-width: 1180px;
  --header-width: 1280px;
  --reading-width: 780px;
  --header-height: 76px;
  --gutter: clamp(16px, 4vw, 44px);
  --section-space: clamp(68px, 9vw, 128px);
  --transition-fast: 160ms ease;
  --transition-reveal: 560ms cubic-bezier(.2, .7, .2, 1);
}

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

html {
  scroll-behavior: smooth;
  background: var(--color-canvas);
  color: var(--color-ink);
  text-size-adjust: 100%;
}

html.nav-open {
  overflow: hidden;
}

body {
  min-width: 320px;
  margin: 0;
  overflow-x: clip;
  background: var(--color-canvas);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

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

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

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  border: 0;
  cursor: pointer;
}

a {
  color: var(--color-brand-deep);
  text-decoration-thickness: .08em;
  text-underline-offset: .18em;
}

a:hover {
  color: var(--color-brand);
}

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

p,
ul,
ol,
dl,
blockquote,
figure,
pre,
table {
  margin-bottom: 1.25em;
}

h1,
h2,
h3,
h4 {
  color: var(--color-ink);
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.18;
  text-wrap: balance;
}

h1 {
  margin-bottom: 24px;
  font-size: clamp(34px, 3.4vw, 48px);
  letter-spacing: -.02em;
}

h2 {
  margin-bottom: 20px;
  font-size: clamp(28px, 3vw, 42px);
  letter-spacing: -.015em;
}

h3 {
  margin-bottom: 14px;
  font-size: clamp(21px, 2vw, 28px);
}

h4 {
  margin-bottom: 10px;
  font-size: 18px;
}

.title-keep {
  white-space: nowrap;
}

strong {
  color: var(--color-ink);
  font-weight: 700;
}

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

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

:not(pre) > code {
  overflow-wrap: anywhere;
  color: var(--color-brand-deep);
  font-size: .9em;
  font-weight: 600;
}

pre {
  max-width: 100%;
  overflow-x: auto;
  padding: 20px;
  border-radius: var(--radius-medium);
  background: var(--color-board);
  color: var(--color-surface);
  font: 14px/1.75 var(--font-mono);
  tab-size: 2;
  -webkit-overflow-scrolling: touch;
}

pre code {
  color: inherit;
  white-space: pre;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--color-line);
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--color-mist);
  color: var(--color-ink);
  font-weight: 700;
}

hr {
  margin: 44px 0;
  border: 0;
  border-top: 1px solid var(--color-line);
}

.wrap,
.header-shell,
.footer-shell {
  width: 100%;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.wrap {
  max-width: calc(var(--content-width) + var(--gutter) * 2);
}

.wrap-reading {
  max-width: calc(var(--reading-width) + var(--gutter) * 2);
}

.header-shell {
  max-width: min(100%, calc(var(--header-width) + var(--gutter) * 2));
}

.footer-shell {
  max-width: min(100%, calc(var(--header-width) + var(--gutter) * 2));
}

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

.section-mist {
  overflow-x: clip;
  background: var(--color-mist);
  color: var(--color-ink);
}

.section-mint {
  overflow-x: clip;
  background: var(--color-mint);
  color: var(--color-ink);
}

.panel,
.card {
  border-radius: var(--radius-large);
  background: var(--color-surface);
  color: var(--color-ink);
  box-shadow: var(--shadow-card);
}

.panel {
  padding: clamp(24px, 4vw, 48px);
}

.card {
  padding: 26px;
}

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

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

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

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

.flex-row > svg,
.flex-row > img,
.flex-row > .dot,
.icon-fixed {
  flex-shrink: 0;
}

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

.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 13px 26px;
  border-radius: 12px;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  transition: transform var(--transition-fast), background var(--transition-fast), box-shadow var(--transition-fast);
}

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

.button:active {
  transform: translateY(1px);
}

.button-primary {
  background: var(--color-brand);
  color: var(--color-surface);
  box-shadow: var(--shadow-button);
}

.button-primary:hover {
  background: var(--color-brand-deep);
  color: var(--color-surface);
}

.button-secondary {
  background: var(--color-surface);
  color: var(--color-ink);
  box-shadow: var(--shadow-card);
}

.button-secondary:hover {
  background: var(--color-mist);
  color: var(--color-ink);
}

.button-outline {
  border: 2px solid var(--color-brand);
  background: var(--color-surface);
  color: var(--color-brand-deep);
}

.button-outline:hover {
  background: var(--color-mist);
  color: var(--color-brand-deep);
}

.button[disabled],
.button.is-disabled {
  cursor: not-allowed;
  opacity: .52;
  transform: none;
}

.badge,
.tag,
.fact-pill {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  gap: 7px;
  overflow: hidden;
  border-radius: var(--radius-pill);
  line-height: 1.25;
}

.badge {
  padding: 6px 11px;
  background: var(--color-mist);
  color: var(--color-brand-deep);
  font-size: 13px;
  font-weight: 700;
}

.badge-success {
  background: var(--color-mint);
  color: var(--color-ink);
}

.badge-warning {
  background: var(--color-amber);
  color: var(--color-ink);
}

.badge-error {
  background: var(--color-error);
  color: var(--color-surface);
}

.fact-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.fact-pill {
  padding: 8px 13px;
  background: var(--color-surface);
  color: var(--color-muted);
  box-shadow: 0 4px 16px var(--color-card-shadow);
  font-size: 13px;
}

.status-dot {
  width: 8px;
  height: 8px;
  flex-shrink: 0;
  border-radius: var(--radius-pill);
  background: var(--color-success);
}

.site-header {
  position: relative;
  z-index: 50;
  background: var(--color-canvas);
  color: var(--color-ink);
}

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

.site-brand {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: 11px;
  color: var(--color-ink);
  text-decoration: none;
}

.site-brand:hover {
  color: var(--color-ink);
}

.site-brand img {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
}

.site-brand-name {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -.01em;
}

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

.desktop-nav a {
  color: var(--color-muted);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

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

.desktop-nav a.is-active {
  font-weight: 700;
}

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

.language-control {
  position: relative;
}

.language-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  border-radius: var(--radius-small);
  background: var(--color-canvas);
  color: var(--color-muted);
  white-space: nowrap;
}

.language-button:hover {
  background: var(--color-mist);
  color: var(--color-ink);
}

.language-short {
  display: none;
}

.language-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 70;
  width: 168px;
  padding: 8px;
  border-radius: var(--radius-medium);
  background: var(--color-surface);
  color: var(--color-ink);
  box-shadow: var(--shadow-card);
}

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

.language-menu a {
  display: flex;
  min-height: 44px;
  width: 100%;
  align-items: center;
  padding: 8px 12px;
  border-radius: var(--radius-small);
  color: var(--color-muted);
  text-decoration: none;
}

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

.menu-toggle {
  display: none;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-small);
  background: var(--color-canvas);
  color: var(--color-ink);
}

.menu-toggle-lines,
.menu-toggle-lines::before,
.menu-toggle-lines::after {
  width: 20px;
  height: 2px;
  border-radius: var(--radius-pill);
  background: var(--color-ink);
}

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

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

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

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

.mobile-drawer {
  display: none;
}

.nav-veil {
  display: none;
}

.site-footer {
  overflow-x: clip;
  padding-top: 72px;
  background: var(--color-board);
  color: var(--color-surface);
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(240px, 1.25fr) repeat(3, minmax(160px, 1fr));
  gap: 44px;
}

.footer-brand .site-brand {
  color: var(--color-surface);
}

.footer-brand p {
  max-width: 360px;
  margin-top: 18px;
  color: var(--color-pin);
}

.footer-column h2 {
  margin-bottom: 16px;
  color: var(--color-surface);
  font-size: 15px;
  letter-spacing: .04em;
}

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

.footer-links a {
  color: var(--color-pin);
  text-decoration: none;
}

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

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 18px;
  margin-top: 56px;
  padding-top: 24px;
  padding-bottom: 28px;
  border-top: 1px solid var(--color-board-highlight);
  color: var(--color-pin);
  font-size: 14px;
}

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

.footer-legal a {
  color: var(--color-pin);
  text-decoration: none;
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity var(--transition-reveal), transform var(--transition-reveal);
}

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

.decorative-section {
  position: relative;
  overflow-x: clip;
}

.tilt {
  transform: rotate(4deg);
}

.prose {
  color: var(--color-ink);
}

.prose > * {
  max-width: 100%;
}

.prose h2 {
  margin-top: 2.1em;
  scroll-margin-top: 100px;
}

.prose h3 {
  margin-top: 1.7em;
  scroll-margin-top: 100px;
}

.prose a {
  overflow-wrap: anywhere;
}

.table-wrap {
  max-width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-medium);
  background: var(--color-surface);
  -webkit-overflow-scrolling: touch;
}

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

@media (max-width: 1080px) {
  .desktop-nav {
    gap: 18px;
  }

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

  .header-tools {
    margin-left: 12px;
  }
}

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

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

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

  .mobile-drawer {
    position: fixed;
    top: var(--header-height);
    right: 0;
    left: 0;
    z-index: 60;
    display: none;
    max-height: calc(100dvh - var(--header-height));
    overflow-y: auto;
    padding: 10px var(--gutter) 24px;
    overscroll-behavior: contain;
    background: var(--color-surface);
    color: var(--color-ink);
    box-shadow: var(--shadow-card);
  }

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

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

  .mobile-drawer a.is-active,
  .mobile-drawer a:hover {
    color: var(--color-ink);
    font-weight: 700;
  }

  .mobile-language-links {
    margin-top: 12px;
  }

  .nav-veil {
    position: fixed;
    inset: var(--header-height) 0 0;
    z-index: 40;
    background: var(--color-overlay);
  }

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

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

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

@media (max-width: 768px) {
  h1 {
    font-size: clamp(24px, 7.5vw, 30px);
    line-height: 1.15;
    letter-spacing: -.018em;
  }

  h2 {
    font-size: clamp(25px, 7vw, 34px);
  }

  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }

  .button-row .button {
    flex: 1 1 190px;
  }

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

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

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

  .site-brand-name {
    font-size: 17px;
  }

  .site-brand img {
    width: 32px;
    height: 32px;
  }

  .language-full {
    display: none;
  }

  .language-short {
    display: inline;
  }

  .language-button {
    padding-inline: 8px;
  }

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

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

  .fact-row {
    flex-direction: row;
    flex-wrap: wrap;
  }

  th,
  td {
    padding: 12px;
  }
}

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

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

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