:root {
  --bg: #FFFFFF;
  --bg-panel: #F5F6F8;
  --bg-panel-2: #ECEEF2;
  --border: #E3E6EB;
  --border-strong: #D3D7DE;
  --accent: #2459F0;
  --accent-dark: #1A3FB8;
  --text: #14161B;
  --text-muted: #5F6672;
  --text-faint: #8A909B;
  --success: #1FA657;
  --warn: #E8892B;
  --error: #D93A3A;
  --clear: transparent;
  --mask-ink: #000000;
  --veil: rgba(20,22,27,.32);
  --wall-top: #1B1E24;
  --wall-bottom: #232A36;
  --menubar-bg: rgba(255,255,255,.055);
  --menubar-line: rgba(255,255,255,.07);
  --menubar-hi: rgba(255,255,255,.16);
  --menubar-fg: #C9CED6;
  --win-bg: #15181E;
  --win-side: #1A1E25;
  --win-bar: #1C2028;
  --win-line: rgba(255,255,255,.07);
  --win-line-soft: rgba(255,255,255,.045);
  --win-hi: rgba(255,255,255,.08);
  --win-text: #E4E7EC;
  --win-muted: #8B929E;
  --win-faint: #5A616D;
  --tag-proxy-bg: rgba(36,89,240,.24);
  --tag-proxy-fg: #9AB5FF;
  --tag-direct-bg: rgba(31,166,87,.18);
  --tag-direct-fg: #62D294;
  --tag-reject-bg: rgba(232,137,43,.18);
  --tag-reject-fg: #F3B06C;
  --menu-hover: #F0F3FA;
  --switch-off: #D7DBE2;
  --knob: #FFFFFF;
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-win: 14px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --radius-pill: 999px;
  --radius-circle: 50%;
  --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','SFMono-Regular','Menlo','Consolas',monospace;
  --shadow-stage: 0 60px 120px -48px rgba(20,22,27,.38),0 24px 56px -28px rgba(20,22,27,.22);
  --shadow-window: 0 40px 80px -24px rgba(0,0,0,.6),0 0 0 1px rgba(255,255,255,.06);
  --shadow-menu: 0 44px 80px -20px rgba(8,10,14,.5),0 14px 30px -12px rgba(8,10,14,.32),0 0 0 1px rgba(20,22,27,.04);
  --shadow-btn: 0 10px 24px -10px rgba(20,22,27,.55);
  --shadow-fab: 0 16px 36px -14px rgba(20,22,27,.5);
  --shadow-lift: 0 10px 24px -14px rgba(20,22,27,.28);
  --shadow-card: 0 24px 60px -32px rgba(20,22,27,.22);
  --wrap: 1200px;
  --reading: 800px;
  --header-width: 1280px;
  --gutter: 24px;
  --header-height: 72px;
  --section-space: 96px;
  --ease: 180ms ease;
  --reveal-time: 550ms;
}
*, *::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: 400 16px/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
[hidden] { display: none !important; }
img, svg { display: block; max-width: 100%; }
img { height: auto; }
svg, .dot { flex-shrink: 0; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
button, a, input, summary { -webkit-tap-highlight-color: var(--clear); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: var(--radius-xs); }
::selection { background: var(--accent); color: var(--bg); }
h1, h2, h3, h4 { font-family: var(--font-display); text-wrap: balance; overflow-wrap: break-word; }
h1 { font-size: clamp(34px,3.4vw,48px); line-height: 1.14; font-weight: 900; letter-spacing: -.02em; }
h2 { font-size: clamp(24px,2.4vw,32px); line-height: 1.25; font-weight: 900; letter-spacing: -.02em; }
h3 { font-size: 22px; line-height: 1.4; font-weight: 800; }
p { margin: 0 0 1em; }
code, pre, kbd { font-family: var(--font-mono); }
code { overflow-wrap: anywhere; font-size: .9em; }
pre { max-width: 100%; overflow-x: auto; padding: 22px; background: var(--bg-panel); color: var(--text); border-radius: var(--radius-md); line-height: 1.9; }
pre code { font-size: 13px; white-space: pre; overflow-wrap: normal; word-break: normal; }
input, select, textarea { max-width: 100%; min-width: 0; padding: 10px 14px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--bg); color: var(--text); }
input::placeholder, textarea::placeholder { color: var(--text-muted); opacity: 1; }
.wrap, .wrap-wide, .reading {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.wrap-wide { max-width: calc(var(--wrap) + 48px); }
.reading { max-width: calc(var(--reading) + var(--gutter) * 2); }
.section { padding-top: var(--section-space); padding-bottom: var(--section-space); }
.section-heading { margin-bottom: 40px; text-align: center; }
.sec-title { margin: 0; text-align: center; }
.sec-lead { max-width: 600px; margin: 12px auto 0; text-align: center; font-size: 15.5px; color: var(--text-muted); }
.nowrap { white-space: nowrap; }
.muted { color: var(--text-muted); }
.mono { font-family: var(--font-mono); }
.text-link, .prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 4px; }
.text-link:hover, .prose a:hover { color: var(--accent-dark); }
.prose { min-width: 0; }
.prose h2 { margin-top: 2.4em; }
.prose h3 { margin-top: 1.8em; }
.prose p, .prose li { line-height: 1.9; }
.prose li + li { margin-top: .5em; }
.prose :not(pre) > code { background: var(--bg-panel); color: var(--text); padding: .1em .3em; border-radius: var(--radius-xs); }
.prose > :first-child { margin-top: 0; }
.prose img { margin-block: 24px; border-radius: var(--radius-md); }
.grid { display: grid; gap: 24px; }
.grid > *, .canvas > *, .footer-grid > *, .card > *, .win-body > * { min-width: 0; }
.grid-pair { grid-template-columns: repeat(2,minmax(0,1fr)); }
.stack { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.cluster { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.skip {
  position: absolute; left: 16px; top: 12px; z-index: 100;
  padding: 8px 14px; border-radius: var(--radius-pill);
  background: var(--text); color: var(--bg); font-size: 14px;
  opacity: 0; pointer-events: none;
}
.skip:focus { opacity: 1; pointer-events: auto; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 50px; padding: 12px 26px; max-width: 100%;
  font: 700 16px/1.4 var(--font-body); letter-spacing: .005em; text-align: center;
  border: 1px solid var(--clear); border-radius: var(--radius-pill);
  transition: transform var(--ease),background-color var(--ease),border-color var(--ease),box-shadow var(--ease);
}
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--text); color: var(--bg); box-shadow: var(--shadow-btn); }
.btn-primary:hover, .btn-primary.is-hover { transform: translateY(-1px); box-shadow: var(--shadow-btn),0 0 0 4px var(--bg-panel-2); }
.btn-primary .arrow { transition: transform var(--ease); }
.btn-primary:hover .arrow { transform: translateX(3px); }
.btn-ghost { background: var(--bg); color: var(--text); border-color: var(--border); padding-inline: 24px; }
.btn-ghost:hover, .btn-ghost.is-hover { background: var(--bg-panel); color: var(--text); border-color: var(--border-strong); }
.btn:active, .btn.is-pressed { transform: translateY(1px); box-shadow: none; }
.btn.is-focus { outline: 2px solid var(--accent); outline-offset: 3px; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-small { min-height: 44px; font-size: 14px; padding: 10px 20px; }
.card, .panel { background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 28px; min-width: 0; }
.panel { background: var(--bg-panel); color: var(--text); border-color: var(--clear); border-radius: var(--radius-xl); }
.card h3, .panel h3 { margin-top: 0; }
.card p:last-child, .panel p:last-child { margin-bottom: 0; }
.reveal { opacity: 1; transform: none; }
html.reveal-ready .reveal:not(.shown) { opacity: 0; transform: translateY(16px); }
html.reveal-ready .reveal { transition: opacity var(--reveal-time) ease,transform var(--reveal-time) ease; }
.topbar, #site-header { position: relative; z-index: 50; background: var(--bg); color: var(--text); }
.topbar-in {
  width: 100%; max-width: min(100%,calc(var(--header-width) + var(--gutter) * 2));
  margin-inline: auto; padding-inline: var(--gutter); height: var(--header-height);
  display: flex; align-items: center; gap: 32px; position: relative;
}
.brand { display: inline-flex; align-items: center; gap: 11px; flex-shrink: 0; }
.brand-mark { width: 34px; height: 34px; flex-shrink: 0; }
.brand-name { font-family: var(--font-display); font-size: 18px; font-weight: 800; letter-spacing: -.01em; }
.desktop-nav { margin-left: auto; min-width: 0; }
.nav-list { display: flex; align-items: center; list-style: none; margin: 0; padding: 0; gap: 28px; }
.nav-list a { display: block; font-size: 15px; font-weight: 500; color: var(--text-muted); white-space: nowrap; transition: color var(--ease); }
.nav-list a:hover { color: var(--text); }
.nav-list a[aria-current="page"] { color: var(--text); font-weight: 700; }
.header-tools { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.language-picker { position: relative; }
.lang {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 36px; padding: 8px 14px; white-space: nowrap;
  font: 500 14px/1.2 var(--font-body); background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-pill);
}
.lang:hover { border-color: var(--border-strong); }
.lang-caret { font-size: 11px; color: var(--text-muted); }
.lang-short { display: none; }
.language-menu {
  position: absolute; right: 0; top: calc(100% + 12px); width: 192px; padding: 8px;
  background: var(--bg); color: var(--text); border: 1px solid var(--border);
  border-radius: var(--radius-md); box-shadow: var(--shadow-card); z-index: 3;
}
.language-menu a { display: flex; align-items: center; min-height: 44px; padding: 10px 12px; border-radius: var(--radius-sm); }
.language-menu a:hover, .language-menu a[aria-current="true"] { background: var(--bg-panel); color: var(--accent-dark); }
.menu-toggle { display: none; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 10px; background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius-pill); }
.menu-toggle svg { width: 20px; height: 20px; }
.mobile-nav { display: none; }
.nav-veil { position: fixed; inset: var(--header-height) 0 0; z-index: 1; border: 0; padding: 0; background: var(--veil); color: var(--text); }
.site-footer { margin-top: 48px; padding-top: 64px; padding-bottom: 100px; background: var(--bg-panel); color: var(--text); border-radius: var(--radius-xl) var(--radius-xl) 0 0; }
.footer-grid { display: grid; grid-template-columns: 1.3fr 1fr 1.2fr .8fr; gap: 40px; }
.footer-brand p { max-width: 300px; color: var(--text-muted); font-size: 14px; margin-top: 18px; }
.footer-heading { font-size: 14px; font-weight: 800; margin: 0 0 16px; }
.footer-links { list-style: none; margin: 0; padding: 0; }
.footer-links a { display: inline-block; padding-block: 5px; font-size: 14px; color: var(--text-muted); }
.footer-links a:hover { color: var(--accent); }
.footer-bottom { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; font-size: 13px; color: var(--text-muted); }
@media (max-width: 1280px) {
  .topbar-in { gap: 24px; }
  .nav-list { gap: 20px; }
  .nav-list a { font-size: 14px; }
}
@media (max-width: 1100px) {
  .desktop-nav { display: none; }
  .header-tools { margin-left: auto; }
  .menu-toggle { display: inline-flex; }
  .mobile-nav {
    display: block; position: absolute; top: var(--header-height); left: 0; right: 0; z-index: 2;
    max-height: calc(100dvh - var(--header-height)); overflow-y: auto; overscroll-behavior: contain;
    padding: 16px var(--gutter) 24px; border-top: 1px solid var(--border);
    background: var(--bg); color: var(--text);
  }
  .mobile-nav ul { margin: 0; padding: 0; list-style: none; }
  .mobile-nav a { display: flex; align-items: center; width: 100%; min-height: 44px; padding: 12px 16px; border-radius: var(--radius-sm); }
  .mobile-nav a:hover, .mobile-nav a[aria-current] { background: var(--bg-panel); color: var(--accent-dark); }
  .mobile-languages { margin-top: 16px; border-top: 1px solid var(--border); padding-top: 12px; }
  .mobile-languages p { padding: 8px 16px; margin: 0; font-size: 13px; color: var(--text-muted); }
}
@media (max-width: 900px) {
  .footer-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 768px) {
  h1 { font-size: clamp(24px,4vw,30px); }
  .grid-pair { grid-template-columns: minmax(0,1fr); }
}
@media (max-width: 640px) {
  :root { --gutter: 16px; --header-height: 60px; --section-space: 64px; }
  .topbar-in > .brand { flex: 0 1 auto; min-width: 0; }
  .brand-name { min-width: 0; font-size: 16px; overflow-wrap: anywhere; }
  .brand { gap: 8px; }
  .brand-mark { width: 30px; height: 30px; }
  .topbar-in { gap: 10px; }
  .lang-full { display: none; }
  .lang-short { display: inline; }
  .lang { min-height: 44px; padding-inline: 12px; }
  .tilt, [data-tilt] { transform: none !important; }
  .card, .panel { padding: 20px; border-radius: var(--radius-lg); }
  .footer-grid { grid-template-columns: minmax(0,1fr); gap: 28px; }
  .site-footer { padding-top: 40px; }
  .prose h3 { font-size: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html.reveal-ready .reveal:not(.shown) { opacity: 1; transform: none; }
}
@media print {
  #site-header, .site-footer, .dl-fab, .toc { display: none !important; }
  html.reveal-ready .reveal:not(.shown) { opacity: 1; transform: none; }
}