:root {
  --bg: #245E96;
  --hero-deep: #1E4C7C;
  --hero-curve-1: #2C6CA8;
  --hero-curve-2: #3478B5;
  --panel: #FFFFFF;
  --panel-2: #F8F4EE;
  --border: #E2E8F0;
  --border-strong: #CBD5E1;
  --accent: #0B6FC6;
  --accent-dark: #08549A;
  --accent-tint: #E8F2FC;
  --accent-line: rgba(11, 111, 198, 0.38);
  --text: #17222F;
  --text-muted: #5A6878;
  --text-faint: #9AA6B4;
  --success: #1F9D6B;
  --warn: #D99A00;
  --error: #D14848;
  --sky: #8DCBF2;
  --sun: #FFC52E;
  --blossom: #F49BC0;
  --blossom-fold: #E57FAC;
  --on-dark: #FFFFFF;
  --on-dark-muted: rgba(255, 255, 255, 0.80);
  --on-dark-soft: rgba(255, 255, 255, 0.62);
  --chip-bg: rgba(255, 255, 255, 0.07);
  --chip-bg-hover: rgba(255, 255, 255, 0.14);
  --chip-border: rgba(255, 255, 255, 0.26);
  --ghost-border: rgba(255, 255, 255, 0.55);
  --line-ring: rgba(255, 255, 255, 0.10);
  --line-ring-soft: rgba(255, 255, 255, 0.06);
  --frame: rgba(141, 203, 242, 0.26);
  --frame-edge: rgba(255, 255, 255, 0.22);
  --chrome-bg: #F5F8FC;
  --code-bg: #F2F5F9;
  --veil: rgba(6, 24, 48, 0.56);
  --clear: transparent;

  --shadow-btn: 0 1px 2px rgba(6, 28, 56, 0.20), 0 8px 20px -6px rgba(6, 40, 84, 0.45);
  --shadow-bar: 0 2px 4px rgba(8, 30, 60, 0.12), 0 12px 28px -8px rgba(8, 30, 60, 0.38);
  --shadow-win: 0 2px 4px rgba(10, 34, 64, 0.14), 0 22px 44px -10px rgba(10, 34, 64, 0.34), 0 64px 120px -24px rgba(6, 24, 48, 0.50);
  --shadow-tray: 0 3px 6px rgba(8, 26, 52, 0.18), 0 26px 50px -10px rgba(8, 26, 52, 0.42), 0 54px 96px -18px rgba(4, 18, 40, 0.58);
  --shadow-card: 0 1px 2px rgba(23, 34, 47, 0.05), 0 6px 16px -8px rgba(23, 34, 47, 0.14);
  --shadow-seg: 0 1px 2px rgba(23, 34, 47, 0.12);

  --r-sheet: 40px;
  --r-board: 28px;
  --r-win: 24px;
  --r-win-inner: 14px;
  --r-btn: 12px;
  --r-card: 14px;
  --r-tray: 16px;
  --r-tile: 10px;
  --r-small: 8px;
  --r-seg: 9px;
  --r-seg-item: 7px;
  --r-notch: 3px;
  --r-round: 50%;
  --r-pill: 999px;

  --font-display: 'Inter', 'Noto Sans SC', 'Noto Sans JP', 'Noto Sans KR', 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
  --font-body: 'Inter', 'Noto Sans SC', 'Noto Sans JP', 'Noto Sans KR', 'PingFang SC', 'Hiragino Sans', 'Microsoft YaHei', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  --size-h1: clamp(34px, calc(3.4vw + 4px), 48px);
  --size-h2: clamp(26px, 2.6vw, 38px);
  --size-h3: clamp(20px, 2vw, 26px);
  --size-body: 16px;
  --size-small: 14px;
  --size-code: 13px;
  --weight-body: 400;
  --weight-medium: 500;
  --weight-strong: 600;
  --weight-bold: 700;
  --weight-display: 800;
  --weight-heavy: 900;
  --gutter: 24px;
  --read: 760px;
  --layout: 1120px;
  --mast-span: 1280px;
  --mast-approved: 1200px;
  --mast-height: 72px;
  --section-gap: clamp(56px, 9vw, 120px);
  --toc-offset: 12px;
  --ink-focus: var(--accent-dark);
  --ease-quick: 150ms ease;
  --ease-reveal: 420ms ease;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
html.nav-open { overflow: hidden; }
body {
  margin: 0;
  font: var(--weight-body) var(--size-body)/1.6 var(--font-body);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
[hidden] { display: none !important; }
img { display: block; max-inline-size: 100%; }
svg, .badge-dot, .cdot, .brand-mark { flex-shrink: 0; }
a { color: inherit; }
button { font: inherit; }
:focus-visible { outline: 2px solid var(--ink-focus); outline-offset: 3px; }
:where(.field, .masthead, .site-footer, .dark-sample) { --ink-focus: var(--sky); }
:where(.sheet, .page-surface, .drawer, .language-list, .modebar) { --ink-focus: var(--accent-dark); }
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: var(--weight-display);
  line-height: 1.25;
  text-wrap: balance;
}
h1 { font-size: var(--size-h1); line-height: 1.16; }
h2 { font-size: var(--size-h2); }
h3 { font-size: var(--size-h3); }
p { margin-block: 0 1em; }
p:last-child { margin-block-end: 0; }
.word { white-space: nowrap; }
code, kbd, samp, pre { font-family: var(--font-mono); }
code { overflow-wrap: anywhere; }
pre {
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  padding: 16px;
  background: var(--code-bg);
  color: var(--text);
  border-radius: var(--r-btn);
  font-size: var(--size-code);
}
pre code { overflow-wrap: normal; word-break: normal; white-space: pre; }
:where(section, h2, h3, [role="tabpanel"])[id] { scroll-margin-top: 84px; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.wrap, .reading-wrap {
  max-width: calc(var(--layout) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
  min-width: 0;
}
.reading-wrap { max-width: calc(var(--read) + var(--gutter) * 2); }
.sec { padding-block: var(--section-gap); }
.decor-clip { position: relative; overflow-x: clip; }
.page-surface { background: var(--panel); color: var(--text); }
.prose { min-width: 0; line-height: 1.85; }
.prose :where(a:not(.btn)), .text-link {
  color: var(--accent-dark);
  text-decoration: underline;
  text-underline-offset: .2em;
}
.prose :where(p, li, dd) { overflow-wrap: anywhere; }
.prose :where(h2, h3) { margin-block: 1.7em .6em; }
.prose > :first-child { margin-block-start: 0; }
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
  gap: 20px;
}
:where(.card-grid, .footer-grid, .feature-row, .win-body, .cards, .facts-list) > * { min-width: 0; }
.card, .board {
  min-width: 0;
  padding: clamp(16px, 3vw, 30px);
  border-radius: var(--r-card);
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  overflow-wrap: anywhere;
}
.board { border-radius: var(--r-board); background: var(--panel-2); color: var(--text); border: 0; box-shadow: none; }
:where(.card, .board) > :first-child { margin-block-start: 0; }

.btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  max-width: 100%;
  padding: 8px 28px;
  border: 1px solid var(--clear);
  border-radius: var(--r-btn);
  text-align: center;
  text-decoration: none;
  font-size: var(--size-body);
  font-weight: var(--weight-bold);
  line-height: 1.25;
  cursor: pointer;
  transition: background-color var(--ease-quick), border-color var(--ease-quick);
}
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--accent); color: var(--on-dark); box-shadow: var(--shadow-btn); }
.btn-primary:is(:hover, :active), .btn-primary.is-hover { background: var(--accent-dark); color: var(--on-dark); }
.btn-outline { background: var(--panel); color: var(--accent-dark); border-color: var(--accent-line); }
.btn-outline:is(:hover, :active) { background: var(--accent-tint); color: var(--accent-dark); }
.btn-ghost { background: var(--clear); color: var(--on-dark); border: 1.5px solid var(--ghost-border); min-width: min(168px, 100%); }
.btn-ghost:hover { background: var(--chip-bg-hover); color: var(--on-dark); border-color: var(--on-dark); }
.btn:is(:disabled, [aria-disabled="true"]) {
  background: var(--code-bg);
  color: var(--text-muted);
  border-color: var(--border-strong);
  box-shadow: none;
  cursor: not-allowed;
}

.masthead {
  position: relative;
  z-index: 20;
  background: var(--hero-deep);
  color: var(--on-dark);
}
.field .masthead { background: var(--clear); color: var(--on-dark); }
.masthead-row {
  position: relative;
  max-width: min(100%, calc(var(--mast-span) + var(--gutter) * 2));
  height: var(--mast-height);
  margin-inline: auto;
  padding-inline: var(--gutter);
  display: flex;
  align-items: center;
  gap: clamp(12px, 2vw, 32px);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--on-dark);
  text-decoration: none;
  font: var(--weight-display) 18px/1.2 var(--font-display);
  letter-spacing: -.01em;
  flex-shrink: 0;
}
.brand-mark { width: 32px; height: 32px; }
.brand-site {
  padding-left: 10px;
  border-left: 1px solid var(--chip-border);
  color: var(--on-dark-muted);
  font: var(--weight-medium) 13px/1.6 var(--font-body);
  letter-spacing: 0;
}
.topnav-wrap { margin-left: auto; min-width: 0; }
.topnav {
  display: flex;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: clamp(8px, 1vw, 14px);
  font-size: 15px;
}
.topnav li { display: flex; align-items: center; gap: clamp(8px, 1vw, 14px); }
.topnav li + li::before { content: "·"; color: var(--on-dark-soft); font-weight: var(--weight-bold); }
.topnav a { color: var(--on-dark-muted); padding: 6px 2px; text-decoration: none; transition: color var(--ease-quick); }
.topnav a:hover { color: var(--on-dark); }
.topnav a[aria-current="page"] { color: var(--sky); font-weight: var(--weight-bold); }
.mast-tools { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.language-box { position: relative; }
.lang, .nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 36px;
  padding-inline: 14px;
  border: 1px solid var(--chip-border);
  border-radius: var(--r-pill);
  background: var(--chip-bg);
  color: var(--on-dark);
  font-size: var(--size-small);
  cursor: pointer;
  white-space: nowrap;
}
.lang svg { width: 15px; height: 15px; }
.lang:hover, .nav-toggle:hover { background: var(--chip-bg-hover); color: var(--on-dark); }
.nav-toggle { display: none; min-width: 44px; min-height: 44px; padding-inline: 8px; }
.nav-toggle svg { width: 20px; height: 20px; }
.lang-short { display: none; }
.language-list, .drawer {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-bar);
}
.language-list {
  position: absolute;
  inset-inline-end: 0;
  top: calc(100% + 8px);
  z-index: 3;
  min-width: 160px;
  padding: 6px;
  border-radius: var(--r-card);
}
.language-list ul, .drawer ul, .footer-list { margin: 0; padding: 0; list-style: none; }
.language-list a, .drawer a {
  display: flex;
  align-items: center;
  min-height: 44px;
  width: 100%;
  padding: 8px 12px;
  border-radius: var(--r-small);
  color: var(--text);
  text-decoration: none;
}
:is(.language-list, .drawer) a:is(:hover, [aria-current]) {
  background: var(--accent-tint);
  color: var(--accent-dark);
}
.drawer, .nav-veil { display: none; }
.site-footer { background: var(--hero-deep); color: var(--on-dark); padding-block: 68px 24px; }
.footer-grid { display: grid; grid-template-columns: 1.35fr .8fr 1.1fr .7fr; gap: 36px; }
.footer-grid .brand { white-space: normal; }
.footer-intro { margin-top: 14px; color: var(--on-dark-muted); max-width: 32ch; }
.footer-label { font-size: var(--size-body); margin: 0 0 12px; }
.footer-list a { display: inline-block; padding-block: 4px; color: var(--on-dark-muted); text-decoration: none; overflow-wrap: anywhere; }
.footer-list a:hover, .footer-list a[aria-current] { color: var(--sky); text-decoration: underline; text-underline-offset: .2em; }
.footer-copy { margin: 32px 0 0; padding-top: 16px; color: var(--on-dark-muted); border-top: 1px solid var(--chip-border); font-size: var(--size-small); }
.reveal { transition: opacity var(--ease-reveal); }
.reveal-ready .reveal:not(.shown):not(:focus-within) { opacity: 0; }

@media (max-width: 1280px) {
  .masthead:not([data-lang="zh-CN"]) .topnav-wrap { display: none; }
  .masthead:not([data-lang="zh-CN"]) .mast-tools { margin-left: auto; }
  .masthead:not([data-lang="zh-CN"]) .nav-toggle { display: inline-flex; }
}
@media (max-width: 960px) {
  .topnav-wrap { display: none; }
  .mast-tools { margin-left: auto; }
  .nav-toggle { display: inline-flex; }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1280px) {
  .nav-open .drawer:not([hidden]) {
    position: absolute;
    z-index: 2;
    inset-inline: var(--gutter);
    top: var(--mast-height);
    display: block;
    max-height: calc(100vh - var(--mast-height) - 12px);
    max-height: calc(100dvh - var(--mast-height) - 12px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 12px;
    border-radius: var(--r-card);
  }
  .nav-open .nav-veil:not([hidden]) {
    display: block;
    position: fixed;
    inset: 0;
    z-index: -1;
    background: var(--veil);
    color: var(--on-dark);
  }
  .nav-open .masthead-row { background: var(--hero-deep); color: var(--on-dark); }
  .drawer-label { display: block; margin-block: 12px 4px; padding: 12px 12px 0; border-top: 1px solid var(--border); }
}
@media (max-width: 768px) {
  :root { --size-h1: 28px; --gutter: 20px; --mast-height: 64px; }
}
@media (max-width: 640px) {
  :root { --gutter: 16px; }
  .masthead-row { gap: 6px; }
  .brand { font-size: 16px; gap: 8px; }
  .brand-site { display: none; }
  .mast-tools { gap: 5px; }
  .lang { padding-inline: 9px; }
  .lang-full, .lang .lang-globe { display: none; }
  .lang-short { display: inline; }
  .btn { min-height: 48px; padding-inline: 20px; font-size: 15px; }
  .btn-ghost { min-width: 0; }
  .footer-grid { gap: 24px 16px; }
  .footer-brand { grid-column: 1 / -1; }
  .tilt { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal-ready .reveal { opacity: 1 !important; }
}