:root {
  color-scheme: light;
  --bg: #F6F6F2;
  --bg-panel: #FFFFFF;
  --bg-panel2: #ECEDE7;
  --border: #DCDED6;
  --accent: #1B5873;
  --accent-dark: #0F3747;
  --text: #16181B;
  --text-muted: #5C636B;
  --success: #2F8A5B;
  --warn: #C7860F;
  --error: #C03A36;
  --amber: #F0A73A;
  --wash-top: rgb(27 88 115 / .03);
  --wash-bottom: rgb(27 88 115 / .065);
  --accent-tint: rgb(27 88 115 / .10);
  --veil: rgb(7 26 34 / .40);
  --shadow-soft: 0 24px 56px -22px rgb(27 88 115 / .24), 0 2px 6px rgb(27 88 115 / .06);
  --shadow-float: 0 22px 44px -16px rgb(4 22 30 / .62), 0 3px 8px rgb(4 22 30 / .22);
  --hairline-hi: inset 0 1px 0 rgb(255 255 255 / .95);
  --scene-sky-top: #0A2A38;
  --scene-sky-bottom: #18506A;
  --scene-moon: #BFE0E6;
  --scene-far: #2C6D86;
  --scene-mid: #1C5269;
  --scene-near: #12394A;
  --scene-wall-low: #0D3141;
  --scene-ink: #071A22;
  --scene-ink-2: #0C2833;
  --scene-ink-3: #10313E;
  --scene-chair: #1E4C60;
  --leaf: var(--success);
  --leaf-dark: #236B46;
  --flag-red: #CE2B37;
  --flag-blue: #2A3F7E;
  --flag-navy: #1F2C66;
  --flag-white: var(--bg-panel);
  --flag-edge: rgb(22 24 27 / .16);
  --cube-top: #D3D6CF;
  --cube-left: #A9AEA8;
  --cube-right: #8B9198;

  --font-display: "Inter", "Noto Sans SC", "PingFang SC", "Hiragino Sans", "Microsoft YaHei", system-ui, sans-serif;
  --font-body: "Inter", "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --size-small: .8125rem;
  --size-body: 1rem;
  --size-lede: 1.25rem;
  --size-nav: .90625rem;
  --size-h1: clamp(52px, 4.45vw, 64px);
  --size-h2: clamp(28px, 3vw, 40px);
  --size-h3: clamp(19px, 2vw, 24px);
  --size-brand: 18px;
  --size-icon: 16px;
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semi: 600;
  --weight-bold: 700;
  --weight-heavy: 800;
  --weight-display: 900;
  --radius-btn: 3px;
  --radius-sm: 5px;
  --radius-card: 8px;
  --radius-pill: 999px;
  --gutter: clamp(16px, 4vw, 64px);
  --head-gutter: clamp(20px, 4vw, 64px);
  --wrap: 1360px;
  --head-height: 64px;
  --section-space: clamp(48px, 6vw, 88px);
  --gap: clamp(14px, 2vw, 24px);
  --card-pad: clamp(16px, 2.3vw, 32px);
  --quick: 150ms;
  --reveal-time: 360ms;
  --toc-clearance: 64px;
}
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--head-height) + 12px);
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: var(--size-body)/1.6 var(--font-body);
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
button, summary { cursor: pointer; }
img { max-width: 100%; height: auto; }
svg, .badge-dot, .state-dot { flex-shrink: 0; }
p { text-wrap: pretty; }
h1, h2, h3 { font-family: var(--font-display); }
h1, h2 { text-wrap: balance; }
h1 { font-size: var(--size-h1); line-height: 1.1; font-weight: var(--weight-display); letter-spacing: -.02em; }
h2, .h2 { font-size: var(--size-h2); line-height: 1.2; font-weight: var(--weight-heavy); letter-spacing: -.02em; }
h3 { font-size: var(--size-h3); line-height: 1.3; text-wrap: pretty; }
small, .muted { color: var(--text-muted); }
small { font-size: var(--size-small); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.no-break, .price { white-space: nowrap; }
.price, .mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
code, pre { font-family: var(--font-mono); }
code { overflow-wrap: anywhere; }
pre {
  max-width: 100%;
  overflow-x: auto;
  padding: 16px;
  background: var(--bg-panel2);
  border-radius: var(--radius-sm);
}
pre code { overflow-wrap: normal; }
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.sec { padding-top: var(--section-space); padding-bottom: var(--section-space); }
.prose { min-width: 0; max-width: 48em; }
.prose p { max-width: 42em; }
.prose a:not(.btn) { color: var(--accent); text-decoration: underline; text-underline-offset: .18em; }
.grid > *, .hero > *, .footer-grid > * { min-width: 0; }
.decor-stage { position: relative; overflow-x: clip; }
.stripe-halo { position: absolute; inset-inline: 0; max-width: 100%; pointer-events: none; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 24px;
  border: 1.5px solid var(--text);
  border-radius: var(--radius-btn);
  font-family: var(--font-body);
  font-size: var(--size-body);
  font-weight: var(--weight-bold);
  letter-spacing: .01em;
  white-space: nowrap;
  transition: background-color var(--quick), color var(--quick), border-color var(--quick);
}
.btn svg { width: var(--size-icon); height: var(--size-icon); }
.btn-solid, .btn-primary { background: var(--text); color: var(--bg-panel); }
.btn-solid:hover:not(:disabled), .btn-primary:hover:not(:disabled) { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn-line, .btn-secondary { background: transparent; color: var(--text); }
.btn-line:hover:not(:disabled), .btn-secondary:hover:not(:disabled) { background: var(--bg-panel); }
.btn:active:not(:disabled) { border-color: var(--accent); }
.btn:disabled { cursor: not-allowed; color: var(--text-muted); background: var(--bg-panel2); border-color: var(--border); }
.btn-sm { min-height: 36px; padding-inline: 18px; font-size: .875rem; }
.card, .panel {
  min-width: 0;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--hairline-hi), var(--shadow-soft);
}
.card { padding: var(--card-pad); }
.inset-panel { background: var(--bg-panel2); border-radius: var(--radius-sm); }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 30px;
  max-width: 100%;
  padding: 3px 14px 3px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--bg-panel);
  box-shadow: var(--hairline-hi);
  font-size: var(--size-small);
  font-weight: var(--weight-semi);
}
.badge-dot, .state-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--accent);
}
.badge-dot { box-shadow: 0 0 0 3px var(--accent-tint); }
.badge-sep { color: var(--text-muted); font-weight: var(--weight-medium); }
.mark-wave { position: relative; display: inline; }
.mark-wave-line {
  position: absolute;
  left: -2px;
  bottom: -.16em;
  width: calc(100% + 4px);
  height: 12px;
  overflow: visible;
  pointer-events: none;
}
.mark-wave-line path {
  fill: none;
  stroke: var(--amber);
  stroke-width: 5;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}
.sec-intro { padding-top: var(--section-space); padding-bottom: clamp(32px, 4.5vw, 64px); text-align: center; }
.sec-intro .h2 { margin: 0; }
.sec-intro p { max-width: 36em; margin: 16px auto 0; color: var(--text-muted); }
.cube { width: 32px; height: 32px; display: block; margin: 0 auto 16px; }
.cube-top, .cube-mark { fill: var(--cube-top); }
.cube-left { fill: var(--cube-left); }
.cube-right { fill: var(--cube-right); }
.cube-check { fill: none; stroke: var(--cube-right); stroke-width: 1.2; stroke-linecap: round; stroke-linejoin: round; }

.site-head { position: relative; z-index: 20; height: var(--head-height); background: var(--bg-panel); border-bottom: 1px solid var(--border); }
.head-inner { height: 100%; display: flex; flex-wrap: nowrap; align-items: center; gap: clamp(12px, 2.8vw, 40px); padding-inline: var(--head-gutter); }
.brand { display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; }
.brand img { flex-shrink: 0; width: 32px; height: 32px; }
.brand-en { font: var(--weight-heavy) var(--size-brand)/1.2 var(--font-display); letter-spacing: -.015em; }
.brand-zh { font-weight: var(--weight-medium); color: var(--text-muted); }
.nav-main { flex: 1; min-width: 0; }
.nav-main ul { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav-main a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding-inline: clamp(8px, .98vw, 14px);
  border-radius: var(--radius-pill);
  color: var(--text-muted);
  font-size: var(--size-nav);
  font-weight: var(--weight-medium);
  white-space: nowrap;
}
.nav-main a:hover, .drawer-panel a:hover, .lang:hover, .lang-panel a:hover { color: var(--text); background: var(--bg-panel2); }
.nav-main a[aria-current="page"], .drawer-panel a[aria-current="page"], .lang-panel a[aria-current="true"], .drawer-panel a[aria-current="true"] {
  background: var(--accent-tint);
  color: var(--accent-dark);
  font-weight: var(--weight-bold);
}
.head-tools { margin-left: auto; display: flex; flex-shrink: 0; align-items: center; gap: 12px; }
.lang-switch { position: relative; }
.lang, .drawer-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding-inline: 10px;
  border-radius: var(--radius-btn);
  background: none;
  white-space: nowrap;
  font-size: .875rem;
}
.lang { min-width: 36px; min-height: 36px; color: var(--text-muted); border: 0; }
.lang svg, .drawer-toggle svg { width: var(--size-icon); height: var(--size-icon); }
.lang-txt { white-space: nowrap; }
.caret { font-size: var(--size-small); }
.lang-panel {
  position: absolute;
  z-index: 4;
  inset-block-start: calc(100% + 8px);
  inset-inline-end: 0;
  min-width: 10em;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--bg-panel);
  box-shadow: var(--shadow-soft);
}
.lang-panel a { display: flex; align-items: center; min-height: 36px; padding: 4px 12px; border-radius: var(--radius-sm); }
.drawer-toggle { display: none; min-width: 44px; min-height: 44px; border: 1px solid var(--border); }
.drawer-panel, .drawer-veil { position: fixed; top: var(--head-height); }
.drawer-veil { z-index: 1; inset-inline: 0; bottom: 0; width: 100%; background: var(--veil); border: 0; }
.drawer-panel {
  z-index: 2;
  right: 0;
  width: min(100%, 340px);
  height: calc(100dvh - var(--head-height));
  max-height: calc(100dvh - var(--head-height));
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 12px var(--gutter) 24px;
  background: var(--bg-panel);
  box-shadow: var(--shadow-soft);
}
.drawer-panel a { display: flex; align-items: center; width: 100%; min-height: 44px; padding: 8px 12px; border-radius: var(--radius-sm); }
.drawer-languages { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
html.nav-open { overflow: hidden; }
.static-drawer { display: none; }
.static-drawer summary, .lang-switch summary { list-style: none; }
.static-drawer summary::-webkit-details-marker, .lang-switch summary::-webkit-details-marker { display: none; }
.static-drawer:not([open]) .drawer-panel, .lang-switch:not([open]) > summary + .lang-panel { display: none; }

.site-foot { border-top: 1px solid var(--border); background: var(--bg-panel2); padding-block: 44px 20px; }
.footer-grid { display: grid; grid-template-columns: 1.12fr 1.25fr .63fr; gap: var(--gap); }
.footer-brand p { max-width: 28em; color: var(--text-muted); margin: 12px 0 0; }
.footer-label { margin: 0 0 8px; font-size: var(--size-small); font-weight: var(--weight-bold); color: var(--text-muted); }
.footer-links, .footer-legal { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.footer-links a, .footer-legal a, .footer-search a { display: inline-flex; align-items: center; min-height: 28px; }
.site-foot a:hover:not(.brand) { color: var(--accent); text-decoration: underline; text-underline-offset: .16em; }
.footer-search { display: flex; flex-wrap: wrap; align-items: center; gap: 0 8px; font-size: var(--size-small); margin: 28px 0 8px; }
.footer-search .footer-label { margin: 0 4px 0 0; }
.footer-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 20px; padding-top: 12px; border-top: 1px solid var(--border); font-size: var(--size-small); color: var(--text-muted); }

#server-status {
  margin-block: var(--gap);
  padding: clamp(10px, 2vw, 24px);
  overflow: hidden;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
}
.reveal { transition: opacity var(--reveal-time) ease-out, transform var(--reveal-time) ease-out; }
.reveal.pending { opacity: 0; transform: translateY(16px); }
.reveal.pending:focus-within { opacity: 1; transform: none; transition: none; }

@media (max-width: 1100px) {
  .nav-main { display: none; }
  .drawer-toggle { display: inline-flex; }
  .static-drawer { display: block; }
}
@media (max-width: 768px) {
  :root { --size-h1: 38px; --size-lede: 17px; }
  .footer-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  :root { --size-h1: 36px; --size-brand: 16px; --head-gutter: 16px; }
  .no-break { white-space: normal; }
  .head-inner { gap: 8px; }
  .head-tools { margin-left: auto; gap: 6px; }
  .lang .lang-txt, .lang .caret { display: none; }
  .head-tools .btn-sm { padding-inline: 10px; }
  .brand { gap: 7px; }
  .tilt { transform: none; rotate: none; }
  .decor-stage { max-width: 100%; }
}
@media (max-width: 480px) {
  .drawer-panel { inset-inline: 0; width: 100%; }
  .head-inner .brand img { width: 28px; height: 28px; }
}
@media (max-width: 350px) {
  :root { --size-h1: 32px; --size-brand: 15px; }
  .head-inner { gap: 4px; }
  .head-tools { gap: 4px; }
  .head-tools .btn-sm { padding-inline: 7px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal, .reveal.pending { opacity: 1; transform: none; transition: none; }
  .btn { transition: none; }
}