:root {
  --bg: #FFFFFF;
  --bg-panel: #F4F7FC;
  --bg-panel-2: #E9EFF9;
  --border: #DCE3EE;
  --accent: #1D5FD1;
  --accent-dark: #123F94;
  --text: #111A2E;
  --text-muted: #5A6478;
  --success: #1F9D63;
  --warn: #C98510;
  --error: #D23F3F;
  --accent-soft: #E8F0FD;
  --device-rim: #C9D7F2;
  --skeleton: #E4EAF4;
  --skeleton-strong: #D3DCEB;
  --on-accent: #FFFFFF;
  --on-dark: rgba(255, 255, 255, 0.76);
  --dark-hover: rgba(255, 255, 255, 0.13);
  --success-soft: rgba(31, 157, 99, 0.16);
  --hairline: rgba(29, 95, 209, 0.22);
  --hairline-2: rgba(29, 95, 209, 0.13);
  --dot-grid: rgba(29, 95, 209, 0.16);
  --glow: rgba(255, 255, 255, 0.92);
  --fade-clear: rgba(233, 239, 249, 0);
  --clear: transparent;
  --mask-solid: #000000;
  --veil: rgba(17, 26, 46, 0.38);
  --success-ink: #146441;
  --warn-ink: #76500B;
  --error-soft: #FCEEEE;
  --warn-soft: #FFF5DF;

  --font-display: 'Inter', 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
  --font-body: 'Inter', 'Noto Sans SC', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  --fs-xs: 12px;
  --fs-sm: 14px;
  --fs-nav: 15px;
  --fs-body: 16px;
  --fs-lede: 17px;
  --fs-h3: 21px;
  --fs-h2: 28px;
  --fs-h1: clamp(34px, 3.4vw, 48px);
  --weight-normal: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;
  --weight-display: 800;
  --r-xs: 6px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-pill: 999px;
  --r-round: 50%;
  --r-line: 2px;
  --gutter: 32px;
  --reading-width: 1120px;
  --motion-fast: 0.2s;
  --motion-reveal: 0.55s;

  --shadow-nav: 0 1px 2px rgba(17, 26, 46, 0.04), 0 12px 32px -14px rgba(18, 63, 148, 0.16);
  --shadow-chip: 0 1px 2px rgba(17, 26, 46, 0.05);
  --shadow-card: 0 1px 2px rgba(17, 26, 46, 0.04), 0 10px 28px -12px rgba(18, 63, 148, 0.14);
  --shadow-btn: 0 1px 2px rgba(18, 63, 148, 0.22), 0 10px 22px -8px rgba(29, 95, 209, 0.55);
  --shadow-window: 0 1px 3px rgba(17, 26, 46, 0.05), 0 24px 48px -16px rgba(18, 63, 148, 0.20), 0 60px 110px -30px rgba(18, 63, 148, 0.26);
  --shadow-device: 0 2px 6px rgba(17, 26, 46, 0.08), 0 28px 56px -14px rgba(18, 63, 148, 0.34), 0 70px 120px -26px rgba(17, 26, 46, 0.34);
  --grad-title: linear-gradient(180deg, var(--accent) 0%, var(--accent-dark) 100%);
  --grad-stage: linear-gradient(168deg, var(--bg-panel) 0%, var(--bg-panel-2) 100%);
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 24px; }
html.nav-open { overflow: hidden; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
[hidden] { display: none !important; }
img, svg { vertical-align: middle; }
img { max-width: 100%; height: auto; }
svg { flex-shrink: 0; }
button, input, select, textarea { font: inherit; }
button, summary, a { -webkit-tap-highlight-color: var(--clear); }
button { cursor: pointer; }
a { color: var(--accent-dark); text-underline-offset: 0.2em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: var(--r-xs); }
h1, h2, h3 {
  font-family: var(--font-display);
  color: var(--text);
  line-height: 1.3;
  text-wrap: balance;
  overflow-wrap: break-word;
}
h1 { font-size: var(--fs-h1); font-weight: var(--weight-display); letter-spacing: -0.015em; }
h2 { font-size: var(--fs-h2); font-weight: var(--weight-display); letter-spacing: -0.01em; }
h3 { font-size: var(--fs-h3); font-weight: var(--weight-bold); }
p { margin-top: 0; }
code, pre, kbd { font-family: var(--font-mono); }
code { overflow-wrap: anywhere; }
pre {
  max-width: 100%;
  min-width: 0;
  padding: 20px;
  overflow-x: auto;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  font-size: var(--fs-sm);
  line-height: 1.75;
  tab-size: 2;
}
pre code { overflow-wrap: normal; word-break: normal; white-space: pre; }
:where(main, section, article, aside, div, li, nav) { min-width: 0; }
.wrap { width: 100%; max-width: calc(var(--reading-width) + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-top: 72px; padding-bottom: 72px; }
.section__head { max-width: 680px; margin-bottom: 32px; }
.section__head h2 { margin: 0 0 12px; }
.section__head p, .muted { color: var(--text-muted); }
.keyword { white-space: nowrap; }
.mono { font-family: var(--font-mono); }
.screen, .decorated { position: relative; overflow-x: clip; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip-link { position: absolute; top: 8px; left: var(--gutter); z-index: 100; padding: 12px 18px; background: var(--bg); color: var(--accent-dark); border: 1px solid var(--accent); border-radius: var(--r-sm); }
.skip-link:not(:focus) { width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.card, .panel { border: 1px solid var(--border); color: var(--text); }
.card { padding: 24px; border-radius: var(--r-lg); background: var(--bg); box-shadow: var(--shadow-card); }
.panel { padding: 36px; border-radius: var(--r-xl); background: var(--bg-panel); }
.card h3 { margin-top: 0; }
.card p:last-child, .panel p:last-child { margin-bottom: 0; }
.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.prose { overflow-wrap: break-word; }
.prose h2 { margin-top: 2.4em; margin-bottom: 0.8em; }
.prose h3 { margin-top: 1.8em; margin-bottom: 0.7em; }
.prose p, .prose li { line-height: 1.85; }
.prose :where(ul, ol) { padding-inline-start: 1.5em; }
.prose section[id], .prose h2[id], [role="tabpanel"] { scroll-margin-top: 24px; }

.cta, .button-row { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-flex; justify-content: center; align-items: center; gap: 9px;
  min-height: 50px; padding: 0 26px;
  border: 1px solid var(--clear); border-radius: var(--r-pill);
  background: var(--bg); color: var(--text);
  font-size: var(--fs-body); font-weight: var(--weight-semibold);
  text-decoration: none; white-space: normal; text-align: center;
  transition: background-color var(--motion-fast), border-color var(--motion-fast), color var(--motion-fast);
}
.btn svg { width: 18px; height: 18px; }
.btn--primary { background: var(--accent); color: var(--on-accent); box-shadow: var(--shadow-btn); }
.btn--primary:hover, .btn--primary.is-hover { background: var(--accent-dark); color: var(--on-accent); }
.btn--ghost { padding-inline: 24px 22px; background: var(--bg); color: var(--accent-dark); border: 1.5px solid var(--accent-dark); }
.btn--ghost:hover, .btn--ghost.is-hover { background: var(--bg-panel); color: var(--accent-dark); }
.btn:active { box-shadow: none; }
.btn:disabled, .btn[aria-disabled="true"] { background: var(--bg-panel); color: var(--text-muted); border-color: var(--border); box-shadow: none; cursor: not-allowed; }
.btn.is-focus { outline: 2px solid var(--accent); outline-offset: 3px; }

.topbar { position: relative; z-index: 30; padding: 12px var(--gutter) 0; }
.topbar__inner {
  position: relative; display: flex; align-items: center; gap: 28px;
  max-width: min(100%, calc(1280px + var(--gutter) * 2)); height: 64px;
  margin-inline: auto; padding: 0 14px 0 28px;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-nav);
}
.brand { display: inline-flex; align-items: center; gap: 10px; flex-shrink: 0; color: var(--text); text-decoration: none; font-family: var(--font-display); font-size: var(--fs-body); font-weight: var(--weight-bold); letter-spacing: -0.01em; }
.brand__mark { width: 30px; height: 30px; flex-shrink: 0; }
.tabs-nav { align-self: stretch; margin-left: auto; min-width: 0; }
.tabs-nav ul { display: flex; align-items: center; list-style: none; margin: 0; padding: 0; height: 100%; gap: 0; }
.tabs-nav li { height: 100%; }
.tabs-nav a { position: relative; display: flex; align-items: center; height: 100%; padding: 0 15px; color: var(--text-muted); font-size: var(--fs-nav); font-weight: var(--weight-medium); text-decoration: none; white-space: nowrap; }
.tabs-nav a::after { content: ""; position: absolute; left: 15px; right: 15px; bottom: -1px; height: 2px; border-radius: var(--r-line); background: var(--accent); opacity: 0; transform: scaleX(0.3); transition: transform var(--motion-fast), opacity var(--motion-fast); }
.tabs-nav a:hover { color: var(--text); }
.tabs-nav a:hover::after { opacity: 0.35; transform: scaleX(1); }
.tabs-nav a[aria-current="page"] { color: var(--accent); font-weight: var(--weight-semibold); }
.tabs-nav a[aria-current="page"]::after { opacity: 1; transform: scaleX(1); }
.header-tools { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.language { position: relative; }
.lang { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; padding: 0 14px 0 12px; background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: var(--r-pill); font-size: var(--fs-sm); font-weight: var(--weight-medium); cursor: pointer; list-style: none; }
.lang:hover { border-color: var(--accent); background: var(--bg-panel); color: var(--text); }
.lang svg { width: 16px; height: 16px; color: var(--accent); }
.lang__caret { color: var(--text-muted); }
.lang__short { display: none; }
.language-menu { position: absolute; top: calc(100% + 12px); right: 0; z-index: 5; width: 200px; padding: 8px; margin: 0; list-style: none; background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow-card); }
.language-menu a { display: flex; align-items: center; min-height: 44px; padding: 10px 12px; color: var(--text); text-decoration: none; border-radius: var(--r-xs); }
.language-menu a:hover, .language-menu a[aria-current="true"] { background: var(--accent-soft); color: var(--accent-dark); }
.menu-toggle { display: none; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; border: 1px solid var(--border); border-radius: var(--r-pill); background: var(--bg); color: var(--accent-dark); }
.menu-toggle svg { width: 20px; height: 20px; }
.mobile-drawer { position: absolute; top: calc(100% + 10px); inset-inline: 0; z-index: 4; padding: 16px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--bg); color: var(--text); box-shadow: var(--shadow-card); max-height: calc(100dvh - 106px); overflow-y: auto; overscroll-behavior: contain; }
.mobile-drawer ul { display: block; list-style: none; padding: 0; margin: 0; }
.mobile-drawer a { display: flex; align-items: center; width: 100%; min-height: 44px; padding: 12px 14px; text-decoration: none; color: var(--text); border-radius: var(--r-xs); }
.mobile-drawer a:hover, .mobile-drawer a[aria-current] { background: var(--accent-soft); color: var(--accent-dark); }
.mobile-drawer__languages { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.nav-veil { position: fixed; inset: 0; z-index: 20; border: 0; background: var(--veil); color: var(--on-accent); cursor: default; }
.preview-mobile { display: none; }
.preview-mobile > summary { list-style: none; }
summary::-webkit-details-marker { display: none; }

.site-footer { margin-top: 48px; border-top: 1px solid var(--border); background: var(--bg-panel); color: var(--text); padding-top: 56px; padding-bottom: 28px; }
.footer-grid { display: grid; grid-template-columns: 1.2fr 0.8fr 1.3fr 0.7fr; gap: 36px; }
.footer-brand p { max-width: 26em; margin: 18px 0 0; color: var(--text-muted); font-size: var(--fs-sm); }
.footer-title { margin: 0 0 16px; font-size: var(--fs-sm); font-weight: var(--weight-bold); }
.footer-links { list-style: none; margin: 0; padding: 0; }
.footer-links li + li { margin-top: 8px; }
.footer-links a { display: inline-block; padding-block: 4px; color: var(--text-muted); text-decoration: none; font-size: var(--fs-sm); }
.footer-links a:hover { color: var(--accent-dark); text-decoration: underline; }
.footer-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px; margin-top: 36px; padding-top: 22px; border-top: 1px solid var(--border); color: var(--text-muted); font-size: var(--fs-xs); }
.footer-bottom p { margin: 0; }
.footer-legal { display: flex; flex-wrap: wrap; gap: 20px; }
.footer-legal a { color: var(--text-muted); }

.reveal { opacity: 1; transform: none; }
.reveal-pending { opacity: 0; transform: translateY(18px); transition: opacity var(--motion-reveal) ease, transform var(--motion-reveal) ease; }
.reveal.shown { opacity: 1; transform: none; }

@media (max-width: 1279px) {
  .tabs-nav { display: none; }
  .header-tools { margin-left: auto; }
  .menu-toggle { display: inline-flex; }
  .preview-mobile { display: block; }
  .topbar__inner { gap: 16px; }
}
@media (min-width: 1280px) {
  .mobile-drawer, .nav-veil { display: none !important; }
}
@media (max-width: 900px) {
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
  h1, .title { font-size: clamp(24px, 4vw, 30px); }
}
@media (max-width: 640px) {
  :root { --gutter: 16px; --fs-h2: 24px; }
  .wrap { width: 100%; padding-inline: var(--gutter); }
  .section { padding-top: 44px; padding-bottom: 44px; }
  .topbar__inner { padding-inline: 12px; gap: 8px; }
  .brand { font-size: var(--fs-sm); gap: 6px; }
  .brand__mark { width: 26px; height: 26px; }
  .header-tools { margin-left: auto; gap: 6px; }
  .lang { min-height: 44px; padding-inline: 10px; }
  .lang__full { display: none; }
  .lang__short { display: inline; }
  .lang svg { display: none; }
  .card-grid, .footer-grid { grid-template-columns: minmax(0, 1fr); }
  .card, .panel { padding: 22px; }
  .footer-grid { gap: 28px; }
  .footer-brand .brand { font-size: var(--fs-body); }
  .tilt, [data-tilt] { transform: none !important; }
  .button-row { gap: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; animation-iteration-count: 1 !important; }
  .reveal-pending { opacity: 1; transform: none; }
}