:root {
  color-scheme: dark;
  --bg: #071f2b;
  --bg-panel: #04161f;
  --bg-panel-2: #0d2a39;
  --border: #1d3d4c;
  --accent: #19d3c5;
  --accent-dark: #0d9e94;
  --accent-hover: #3fe2d5;
  --lime: #c4f25a;
  --blue: #3d8bff;
  --text: #e8f1f4;
  --text-muted: #8fa9b5;
  --text-dim: #5d7a87;
  --code: #c4d3da;
  --code-soft: #8399a3;
  --success: #3fd98a;
  --warn: #f2c14e;
  --error: #f0626a;
  --ink: #04161f;
  --grid-line: #0d2a39;
  --win-bar: #061c27;
  --win-active: #0a2734;
  --line-active: #071f2b;
  --field-deep: #0b5d61;
  --field-deeper: #083a43;
  --glass: rgba(232, 241, 244, .06);
  --glass-line: rgba(232, 241, 244, .14);
  --hairline: rgba(232, 241, 244, .07);
  --btn-hi: rgba(255, 255, 255, .35);
  --accent-halo: rgba(25, 211, 197, .18);
  --accent-halo-strong: rgba(25, 211, 197, .55);
  --lime-glow: rgba(196, 242, 90, .92);
  --lime-glow-soft: rgba(196, 242, 90, .28);
  --vignette: rgba(4, 22, 31, .62);
  --shadow-1: rgba(1, 10, 14, .55);
  --shadow-2: rgba(1, 10, 14, .78);
  --mask-on: #000;
  --clear: transparent;
  --font-display: "Charter", "Iowan Old Style", "Georgia", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", 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;
  --r-xl: 40px;
  --r-lg: 20px;
  --r-win: 14px;
  --r-btn: 10px;
  --r-sm: 7px;
  --r-pill: 999px;
  --gutter: 48px;
  --reading-width: 1120px;
  --wide-width: 1440px;
  --section-space: 160px;
  --head-height: 64px;
  --notice-height: 36px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --fast: .2s;
  --shadow-float: 0 24px 48px -18px var(--shadow-1), 0 70px 130px -36px var(--shadow-2);
}
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); 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: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: var(--accent-halo); }
button { cursor: pointer; }
a { color: var(--blue); text-decoration: none; text-underline-offset: .22em; }
a:hover { text-decoration: underline; }
img, svg { max-width: 100%; }
img { height: auto; }
svg { flex-shrink: 0; }
button svg, a svg { pointer-events: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: var(--r-sm); }
::selection { background: var(--accent); color: var(--ink); }
h1, h2, h3, h4 { margin-top: 0; color: var(--text); text-wrap: balance; }
h1, .h1 {
  font-family: var(--font-display);
  font-size: clamp(34px, 2.4vw + 14px, 48px);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -.015em;
}
h2 { font-family: var(--font-display); font-size: clamp(28px, 3vw, 40px); font-weight: 400; line-height: 1.3; }
h3 { font-size: 21px; font-weight: 500; line-height: 1.4; }
h4 { font-size: 17px; font-weight: 600; }
p { margin-top: 0; margin-bottom: 1.25em; }
strong { font-weight: 600; }
code, kbd, pre, samp { font-family: var(--font-mono); }
code { color: var(--code); font-size: .88em; overflow-wrap: anywhere; }
pre {
  max-width: 100%;
  min-width: 0;
  margin: 24px 0;
  padding: 22px;
  overflow-x: auto;
  background: var(--bg-panel);
  color: var(--code);
  border: 1px solid var(--border);
  border-radius: var(--r-win);
  line-height: 1.9;
  tab-size: 2;
}
pre code { color: inherit; font-size: 13px; white-space: pre; overflow-wrap: normal; word-break: normal; }
hr { border: 0; border-top: 1px solid var(--border); margin: 40px 0; }
ul, ol { padding-left: 1.5em; }
li + li { margin-top: .4em; }
figure { margin: 0; }
small, .small { font-size: 13px; }
.muted { color: var(--text-muted); }
.mono { font-family: var(--font-mono); }
.keep { white-space: nowrap; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.wrap { width: 100%; max-width: calc(var(--reading-width) + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter); }
.wrap-wide { max-width: var(--wide-width); }
.section { padding-top: var(--section-space); }
.section:last-child { padding-bottom: var(--section-space); }
.section-heading { max-width: 760px; margin-bottom: 40px; }
.section-heading p { color: var(--text-muted); }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.grid > *, .hero > *, .footer-grid > *, .panel > * { min-width: 0; }
.stack > * + * { margin-top: 24px; }
.flow { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.panel, .card {
  min-width: 0;
  background: var(--bg-panel);
  color: var(--text);
  border: 1px solid var(--border);
}
.panel { padding: 48px; border-radius: var(--r-xl); }
.card { padding: 28px; border-radius: var(--r-lg); }
.panel .card { background: var(--bg); color: var(--text); }
.card p:last-child, .panel p:last-child { margin-bottom: 0; }
.prose { min-width: 0; max-width: 100%; }
.prose h2 { margin-top: 72px; scroll-margin-top: 24px; }
.prose h3 { margin-top: 36px; }
.prose p, .prose li { color: var(--text-muted); }
.prose strong { color: var(--text); }
.prose a { overflow-wrap: anywhere; }
.prose img { max-width: 100%; }
.prose blockquote { margin-inline: 0; }
.btn {
  min-height: 52px;
  padding: 12px 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  max-width: 100%;
  border: 1px solid var(--clear);
  border-radius: var(--r-btn);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
  text-align: center;
  text-decoration: none;
  transition: background-color var(--fast), border-color var(--fast), transform var(--fast);
}
.btn svg { width: 18px; height: 18px; }
.btn:hover { text-decoration: none; }
.btn-primary {
  background: var(--accent);
  color: var(--ink);
  box-shadow: inset 0 1px 0 var(--btn-hi), 0 14px 32px -14px var(--accent-halo-strong);
}
.btn-primary:hover, .btn-primary.is-hover { background: var(--accent-hover); color: var(--ink); transform: translateY(-1px); }
.btn-primary:active { background: var(--accent); color: var(--ink); transform: translateY(0); }
.btn-ghost { background: var(--clear); color: var(--text); border-color: var(--glass-line); }
.btn-ghost:hover, .btn-ghost.is-hover { background: var(--glass); color: var(--text); border-color: var(--text-muted); }
.btn:disabled, .btn[aria-disabled="true"] { background: var(--bg-panel-2); color: var(--text-muted); border-color: var(--border); box-shadow: none; cursor: not-allowed; transform: none; }
.btn.is-focus { outline: 2px solid var(--blue); outline-offset: 3px; }
.notice {
  min-height: var(--notice-height);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 5px 24px;
  background: linear-gradient(90deg, var(--accent-dark), var(--accent), var(--accent-dark));
  color: var(--ink);
  font-size: 13.5px;
}
.notice-tag {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .12em;
  background: var(--ink);
  color: var(--lime);
  padding: 3px 10px;
  border-radius: var(--r-pill);
}
.notice-text b { font-weight: 600; }
.notice-link { flex-shrink: 0; color: var(--ink); font-weight: 600; border-bottom: 1px solid currentColor; }
.notice-link:hover { text-decoration: none; }
#site-header { position: relative; z-index: 50; }
.site-head { position: relative; background: var(--bg-panel); color: var(--text); border-bottom: 1px solid var(--border); z-index: 2; }
.site-head-in {
  position: relative;
  width: 100%;
  max-width: min(100%, calc(1344px + var(--gutter) * 2));
  margin-inline: auto;
  height: var(--head-height);
  padding-inline: var(--gutter);
  display: flex;
  align-items: center;
  gap: 44px;
}
.brand { display: inline-flex; align-items: center; gap: 11px; flex-shrink: 0; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark {
  display: block;
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border-radius: var(--r-sm);
  background: var(--text);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--glass-line);
}
.brand-name { font-size: 16px; font-weight: 600; letter-spacing: -.005em; }
.desktop-nav { min-width: 0; }
.nav-list { display: flex; align-items: center; list-style: none; margin: 0; padding: 0; gap: 0; font-size: 14.5px; }
.nav-list li { display: flex; align-items: center; margin: 0; white-space: nowrap; }
.nav-list li + li::before { content: "·"; color: var(--text-muted); margin-inline: 13px; }
.nav-list a { display: block; padding-block: 12px; color: var(--text-muted); transition: color var(--fast); }
.nav-list a:hover, .nav-list a[aria-current="page"] { color: var(--text); text-decoration: none; }
.head-tools { display: flex; align-items: center; gap: 10px; margin-left: auto; flex-shrink: 0; }
.lang-box { position: relative; }
.lang {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: var(--clear);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  padding: 6px 14px;
  min-height: 36px;
  font: inherit;
  font-size: 13.5px;
  white-space: nowrap;
}
.lang svg { width: 15px; height: 15px; }
.lang:hover { color: var(--text); }
.lang-short { display: none; }
.lang-menu {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: 200px;
  padding: 8px;
  margin: 0;
  list-style: none;
  background: var(--bg-panel);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--r-win);
  box-shadow: var(--shadow-float);
  z-index: 6;
}
.lang-menu li { margin: 0; }
.lang-menu a { display: flex; align-items: center; min-height: 44px; padding: 10px 14px; color: var(--text-muted); border-radius: var(--r-sm); }
.lang-menu a:hover, .lang-menu a[aria-current="true"] { background: var(--bg-panel-2); color: var(--text); text-decoration: none; }
.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--r-btn);
  background: var(--bg-panel);
  color: var(--text);
}
.menu-toggle svg { width: 21px; height: 21px; }
.mobile-drawer { display: none; }
.menu-veil { position: fixed; inset: 0; z-index: 1; background: var(--vignette); color: var(--text); border: 0; width: 100%; height: 100%; }
.site-footer { margin-top: var(--section-space); padding-top: 64px; padding-bottom: 32px; border-top: 1px solid var(--border); background: var(--bg-panel); color: var(--text); }
.footer-grid { display: grid; grid-template-columns: 1.3fr .8fr 1.1fr .8fr; gap: 48px; }
.footer-grid h2 { font-family: var(--font-body); font-size: 15px; font-weight: 600; margin-bottom: 20px; }
.footer-grid p { color: var(--text-muted); font-size: 14px; margin-top: 20px; }
.footer-links { list-style: none; margin: 0; padding: 0; }
.footer-links li { margin: 0; }
.footer-links a { display: inline-block; padding-block: 6px; color: var(--text-muted); font-size: 14px; overflow-wrap: anywhere; }
.footer-links a:hover { color: var(--text); }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--border); color: var(--text-muted); font-size: 12px; }
.footer-bottom p { margin: 0; }
.footer-bottom a { color: var(--text-muted); }
.reveal { opacity: 1; transform: none; }
html.reveal-ready .reveal:not(.shown) { opacity: 0; transform: translateY(12px); }
.reveal { transition: opacity .6s var(--ease), transform .6s var(--ease); }
.hero-wrap { position: relative; isolation: isolate; overflow-x: clip; padding-bottom: 128px; margin-bottom: -128px; }
.hero-wrap::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 760px;
  z-index: -1;
  background-image: linear-gradient(var(--grid-line) 1px, var(--clear) 1px), linear-gradient(90deg, var(--grid-line) 1px, var(--clear) 1px);
  background-size: 96px 96px;
  background-position: -1px -1px;
  mask-image: linear-gradient(180deg, var(--mask-on) 0%, var(--mask-on) 35%, var(--clear) 92%);
  -webkit-mask-image: linear-gradient(180deg, var(--mask-on) 0%, var(--mask-on) 35%, var(--clear) 92%);
}
.hero {
  max-width: var(--wide-width);
  margin-inline: auto;
  padding-inline: var(--gutter);
  min-height: max(720px, calc(100vh - 100px));
  display: grid;
  grid-template-columns: minmax(0, 540px) minmax(0, 1fr);
  column-gap: 56px;
  align-content: center;
}
.hero-copy { align-self: center; padding-top: 24px; padding-bottom: 56px; }
.hero .h1 { margin: 26px 0 0; }
.h1-a, .h1-b { display: block; }
.h1-b { background: linear-gradient(90deg, var(--lime), var(--accent)); color: var(--clear); background-clip: text; -webkit-background-clip: text; padding-bottom: .06em; }
.lede { margin: 20px 0 0; max-width: 522px; font-size: 16.5px; line-height: 1.8; color: var(--text-muted); }
.lede strong { color: var(--text); font-weight: 600; }
.stage {
  position: relative;
  isolation: isolate;
  align-self: stretch;
  min-height: 720px;
  margin: 36px 0 -128px;
  border-radius: var(--r-xl);
  overflow: hidden;
  border: 1px solid var(--glass-line);
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-dark) 22%, var(--field-deep) 42%, var(--field-deeper) 66%, var(--bg-panel) 100%);
  color: var(--text);
}
.stage::before { content: ""; position: absolute; inset: 0 0 auto; height: 320px; z-index: 0; background: radial-gradient(58% 70% at 50% 0%, var(--lime-glow) 0%, var(--lime-glow-soft) 45%, var(--clear) 100%); animation: glow-in 1.6s ease-out both; }
.stage::after { content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none; background: radial-gradient(130% 90% at 50% 18%, var(--clear) 52%, var(--vignette) 100%); }
.frame { position: absolute; z-index: 1; top: 136px; left: 40px; right: 40px; bottom: 64px; padding: 7px; border-radius: var(--r-lg); background: var(--glass); color: var(--text); border: 1px solid var(--glass-line); box-shadow: var(--shadow-float); }
.win { height: 100%; display: flex; flex-direction: column; border-radius: var(--r-win); background: var(--bg-panel); color: var(--text); border: 1px solid var(--hairline); overflow: hidden; }
.win-bar { position: relative; flex-shrink: 0; height: 44px; display: flex; align-items: center; justify-content: center; background: var(--win-bar); color: var(--text-muted); border-bottom: 1px solid var(--border); }
.win-dots { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); display: flex; gap: 8px; }
.win-dots i { width: 11px; height: 11px; border-radius: var(--r-pill); display: block; }
.win-dots i:nth-child(1) { background: var(--error); }
.win-dots i:nth-child(2) { background: var(--warn); }
.win-dots i:nth-child(3) { background: var(--success); }
.win-title { font-family: var(--font-mono); font-size: 12.5px; letter-spacing: .02em; }
.win-body { flex: 1; display: grid; grid-template-columns: 156px minmax(0, 1fr); min-height: 0; }
.sections { border-right: 1px solid var(--border); padding: 22px 0; margin: 0; list-style: none; font-family: var(--font-mono); font-size: 13px; }
.sections li { padding: 7px 18px 7px 16px; border-left: 2px solid var(--clear); color: var(--text-muted); white-space: nowrap; margin: 0; }
.sections li.is-current { color: var(--text); background: var(--win-active); border-left-color: var(--blue); }
.code { counter-reset: ln; min-width: 0; overflow: auto; padding-top: 22px; padding-bottom: 22px; font-family: var(--font-mono); font-size: 14px; line-height: 31px; color: var(--code); }
.ln { counter-increment: ln; display: grid; grid-template-columns: 48px max-content; min-width: 100%; width: max-content; animation: line-in .32s var(--ease) both; }
.ln::before { content: counter(ln); text-align: right; padding-right: 14px; color: var(--text-muted); border-right: 1px solid var(--hairline); }
.lc { padding-left: 18px; padding-right: 18px; white-space: pre; }
.ln.is-caret { background: var(--line-active); color: var(--code); }
.ln:nth-child(1) { animation-delay: .12s; }
.ln:nth-child(2) { animation-delay: .20s; }
.ln:nth-child(3) { animation-delay: .28s; }
.ln:nth-child(4) { animation-delay: .36s; }
.ln:nth-child(5) { animation-delay: .44s; }
.ln:nth-child(6) { animation-delay: .52s; }
.ln:nth-child(7) { animation-delay: .60s; }
.ln:nth-child(8) { animation-delay: .68s; }
.ln:nth-child(9) { animation-delay: .76s; }
.ln:nth-child(10) { animation-delay: .84s; }
.t-sec { color: var(--accent); }
.t-pol { color: var(--blue); }
.t-op { color: var(--code-soft); }
.caret { display: inline-block; vertical-align: -3px; margin-left: 3px; animation: caret-in .01s 1.16s both; }
.caret::after { content: ""; display: block; width: 8px; height: 17px; background: var(--accent); animation: blink 1.6s 1.2s ease-in-out infinite; }
.tail { height: 240px; }
@keyframes line-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes caret-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes blink { 0%, 45% { opacity: 1; } 55%, 100% { opacity: .08; } }
@keyframes glow-in { from { opacity: 0; transform: translateY(-16px); } to { opacity: 1; transform: none; } }
@media (max-width: 1360px) {
  .site-head-in { gap: 28px; }
  .nav-list { font-size: 13.5px; }
  .nav-list li + li::before { margin-inline: 9px; }
}
@media (max-width: 1120px) {
  .desktop-nav { display: none; }
  .head-tools { margin-left: auto; }
  .menu-toggle { display: inline-flex; }
  .mobile-drawer:not([hidden]) { display: block; }
  .mobile-drawer {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 5;
    max-height: calc(100dvh - var(--head-height) - var(--notice-height));
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 16px var(--gutter) 24px;
    background: var(--bg-panel);
    color: var(--text);
    border-bottom: 1px solid var(--border);
  }
  .mobile-drawer ul { list-style: none; margin: 0; padding: 0; }
  .mobile-drawer li { margin: 0; }
  .mobile-drawer a { display: flex; align-items: center; width: 100%; min-height: 48px; padding: 12px 16px; color: var(--text-muted); border-bottom: 1px solid var(--border); }
  .mobile-drawer a:hover, .mobile-drawer a[aria-current] { background: var(--bg-panel-2); color: var(--text); text-decoration: none; }
  .drawer-label { margin: 24px 16px 8px; color: var(--text-muted); font-size: 12px; }
}
@media (max-width: 1120px) {
  :root { --gutter: 32px; }
  .hero { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .hero-copy { padding-top: 72px; padding-bottom: 48px; }
  .stage { height: 600px; min-height: 0; margin: 0 0 -96px; }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
  h1, .h1 { font-size: clamp(24px, 7vw, 30px); }
}
@media (max-width: 760px) {
  :root { --gutter: 20px; }
  .notice { font-size: 12px; gap: 10px; padding-inline: 16px; flex-wrap: wrap; text-align: center; }
  .notice-tag, .notice-link { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
  .notice-text { display: none; }
  .hero-copy { padding-top: 48px; padding-bottom: 40px; }
  .lede { font-size: 15.5px; }
  .stage { height: 520px; border-radius: var(--r-xl); }
  .frame { top: 84px; left: 14px; right: 14px; bottom: 40px; }
  .win-body { grid-template-columns: minmax(0, 1fr); }
  .sections { display: none; }
  .code { font-size: 12px; line-height: 27px; }
  .ln { grid-template-columns: 34px max-content; }
  .ln::before { padding-right: 10px; }
  .lc { padding-left: 12px; }
}
@media (max-width: 640px) {
  :root { --section-space: 160px; }
  .grid, .footer-grid { grid-template-columns: minmax(0, 1fr); }
  .panel { padding: 24px; }
  .card { padding: 22px; }
  .site-head-in { gap: 12px; }
  .brand-name { font-size: 13px; }
  .brand-suffix { display: none; }
  .head-tools { margin-left: auto; gap: 8px; }
  .lang { padding: 6px 10px; min-height: 44px; }
  .lang-full { display: none; }
  .lang-short { display: inline; }
  .footer-grid { gap: 36px; }
  .footer-bottom { margin-top: 36px; }
  .tilt, [data-tilt] { transform: none !important; }
  pre { padding: 16px; }
  .hero .badge { gap: 7px; font-size: 12px; }
  .hero .badge-mono { font-size: 10px; }
}
@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; }
}

/* 跳到正文:平时移出文档流,避免把页头顶下去(英文顶栏两行时汉堡会掉出质检的 80px 窗口) */
.skip-link {
  position: absolute;
  left: 16px;
  top: 8px;
  z-index: 100;
  padding: 12px 16px;
  background: var(--bg-panel);
  color: var(--text);
  border-radius: var(--r-btn);
  transform: translateY(-160%);
}
.skip-link:focus {
  transform: none;
}
