:root {
  color-scheme: dark;
  --bg: #1d1c21;
  --bg-panel: #26252b;
  --bg-panel2: #141317;
  --border: #34333b;
  --accent: #4a8cff;
  --accent-dark: #2457d6;
  --text: #f2f1f4;
  --text-muted: #a3a2ab;
  --success: #3fbf86;
  --warn: #e2a84b;
  --error: #ef5f5f;
  --sand: #cdb98a;
  --sand-ring: rgb(205 185 138 / 18%);
  --nav-bg: #ffffff;
  --nav-muted: #5c5b64;
  --nav-line: #e7e6ec;
  --tint-bg: #f4f8ff;
  --ink-bg: #9cc0ff;
  --ink-text: #162038;
  --ink-muted: #344565;
  --ink-accent: #173669;
  --cab-0: var(--bg);
  --cab-1: #1a3470;
  --cab-2: #2f6fe8;
  --cab-3: var(--ink-bg);
  --prism-a: var(--nav-bg);
  --prism-b: #e6efff;
  --prism-side: #b9cff8;
  --shadow-ink: #0a1330;
  --hero-top: #212533;
  --blue-glow: rgb(74 140 255 / 16%);
  --warm-glow: rgb(205 185 138 / 7%);
  --dot: rgb(242 241 244 / 10%);
  --mask: #000000;
  --glass: rgb(242 241 244 / 6%);
  --glass-hover: rgb(242 241 244 / 12%);
  --glass-line: rgb(242 241 244 / 55%);
  --hairline: var(--dot);
  --accent-glow: rgb(74 140 255 / 42%);
  --shadow-deep: rgb(10 10 14 / 55%);
  --mark-b: #e4e3ea;
  --mark-line: rgb(29 28 33 / 8%);
  --wall-text: #85848e;
  --clear: transparent;
  --color-primary: var(--accent-dark);
  --color-accent: var(--accent);
  --color-text: var(--text);
  --color-bg: var(--bg);
  --surface: var(--bg);
  --fg: var(--text);
  --muted: var(--text-muted);
  --link: var(--accent);
  --focus: var(--link);
  --font-display: 'Inter', 'Noto Sans SC', 'Noto Sans JP', 'Noto Sans KR', 'PingFang SC', 'Hiragino Sans', '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, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --weight-display: 400;
  --weight-medium: 500;
  --weight-nav-current: 600;
  --fs-body: 16px;
  --fs-small: 13px;
  --fs-nav: 15px;
  --fs-code: 14px;
  --fs-h1: clamp(34px, 3.2vw, 48px);
  --fs-h2: clamp(26px, 3vw, 38px);
  --fs-h3: clamp(19px, 2vw, 23px);
  --fs-lead: 17px;
  --fs-note-code: 12px;
  --fs-platform: 13.5px;
  --fs-wall: 30px;
  --tracking-display: -.01em;
  --r-cab: 40px;
  --r-panel: 28px;
  --r-card: 20px;
  --r-note: 16px;
  --r-pill: 999px;
  --r-shot: 8px;
  --r-squircle: 28%;
  --r-focus: 6px;
  --wrap: 1248px;
  --read: 76ch;
  --nav-width: 1280px;
  --gutter: 24px;
  --gap: 16px;
  --section-space: 80px;
  --nav-height: 64px;
  --notice-height: 40px;
  --tap: 44px;
  --fast: .2s;
  --fade: .45s;
  --z-float: 5;
  --z-nav: 10;
  --z-skip: 20;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  color: var(--fg);
  background: var(--surface);
  font: var(--fs-body)/1.6 var(--font-body);
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
[hidden] { display: none !important; }
:where(h1, h2, h3, p, figure, blockquote, dl, dd, pre) { margin: 0; }
:where(h1, h2, h3) {
  font-family: var(--font-display);
  font-weight: var(--weight-display);
  line-height: 1.18;
  letter-spacing: var(--tracking-display);
  overflow-wrap: break-word;
}
h1 { font-size: var(--fs-h1); text-wrap: pretty; }
h2 { font-size: var(--fs-h2); text-wrap: balance; }
h3 { font-size: var(--fs-h3); text-wrap: balance; }
:lang(ja):is(h1, h2, h3, .lead) { word-break: auto-phrase; }
:lang(ko):is(h1, h2) { word-break: keep-all; }
.keep { white-space: nowrap; }
a { color: inherit; text-decoration: none; }
button { color: inherit; font: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: var(--r-focus); }
:where(img, svg) { max-width: 100%; }
:where(img) { height: auto; }
:where(.icon, .btn svg, .badge-dot, .platforms svg, .notice-text svg) { flex-shrink: 0; }
:where(.grid, .card-grid, .hero-grid, .foot-grid, .spectrum, .doc-split, .wall, .plat-grid) > * { min-width: 0; }
:where(.nav-links, .drawer ul, .lang-list, .foot-list, .platforms, .wall, .fact-row, .toc ul) {
  list-style: none;
  padding: 0;
  margin: 0;
}

.wrap, .nav-shell, .read-wrap { margin-inline: auto; padding-inline: var(--gutter); }
.wrap { max-width: var(--wrap); }
.read-wrap { max-width: calc(var(--read) + var(--gutter) * 2); }
.nav-shell { max-width: min(100%, calc(var(--nav-width) + var(--gutter) * 2)); }
.section { padding-block: var(--section-space); }
.section-head { max-width: var(--read); margin-bottom: 32px; }
.section-head > * + * { margin-top: 12px; }
.sec--base { --surface: var(--bg); --fg: var(--text); --muted: var(--text-muted); --link: var(--accent); background: var(--surface); color: var(--fg); }
.sec--tint, .sec--ink {
  --fg: var(--ink-text);
  --muted: var(--ink-muted);
  --link: var(--ink-accent);
  background: var(--surface);
  color: var(--fg);
}
.sec--tint { --surface: var(--tint-bg); }
.sec--ink { --surface: var(--ink-bg); }
.muted { color: var(--muted); }
.text-link, .prose a:not(.btn, .device-card) { color: var(--link); text-decoration: underline; text-underline-offset: .2em; }
.prose, .article-body, .doc-body { min-width: 0; }
.prose { line-height: 1.75; }
.prose > * + * { margin-block-start: 1em; }
.prose > :is(h2, h3):not(:first-child) { margin-block-start: 2em; }
:where(.prose, .article-body, .doc-body) :where(h2, h3, section)[id] { scroll-margin-top: 5rem; }
:where(code, kbd, samp, pre) { font-family: var(--font-mono); font-size: var(--fs-code); }
code { overflow-wrap: anywhere; }
pre {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  padding: 16px 20px;
  border: 1px solid var(--border);
  border-radius: var(--r-note);
  background: var(--bg-panel2);
  color: var(--text);
  white-space: pre;
}
pre code { overflow-wrap: normal; word-break: normal; }
.vh, .skip:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip:focus {
  position: fixed;
  inset: 8px auto auto var(--gutter);
  z-index: var(--z-skip);
  padding: 8px 14px;
  background: var(--nav-bg);
  color: var(--bg);
  border-radius: var(--r-pill);
}
.decor-zone { position: relative; isolation: isolate; overflow: hidden; overflow-x: clip; }
.decor-fill { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

/* 公告与纯文字导航 */
.notice {
  background: var(--sand);
  color: var(--bg);
  font-size: var(--fs-small);
  letter-spacing: .01em;
}
.notice-row { min-height: var(--notice-height); display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; padding-block: 6px; }
.notice-text { display: flex; align-items: center; gap: 10px; min-width: 0; }
.notice-text svg { width: 15px; height: 15px; }
.notice-link { flex-shrink: 0; white-space: nowrap; border-bottom: 1px solid currentColor; line-height: 1.2; }
.site-nav { color-scheme: light; position: relative; z-index: var(--z-nav); background: var(--nav-bg); color: var(--bg); --focus: var(--accent-dark); }
.nav-row { position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 32px; min-height: var(--nav-height); }
.brand { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.brand-mark, .app-mark { display: block; flex-shrink: 0; border-radius: var(--r-squircle); }
.brand-mark { width: 30px; height: 30px; }
.app-mark { width: 56px; height: 56px; }
.mark-sample {
  background: linear-gradient(145deg, var(--prism-a), var(--mark-b));
  color: var(--bg);
  box-shadow: inset 0 0 0 1px var(--nav-line);
}
.app-mark.mark-sample { box-shadow: inset 0 0 0 1px var(--mark-line), 0 10px 24px -14px var(--shadow-deep); }
.brand-name { font-size: var(--fs-body); font-weight: var(--weight-nav-current); letter-spacing: var(--tracking-display); line-height: 1.25; text-wrap: balance; }
.brand-name em { font-style: normal; font-weight: var(--weight-display); color: var(--nav-muted); margin-inline-start: 2px; }
.brand:hover .brand-name { text-decoration: underline; text-underline-offset: .2em; }
.nav-desktop { min-width: 0; margin-inline-start: auto; }
.nav-links { display: flex; align-items: center; list-style: none; margin: 0; padding: 0; gap: 28px; }
.nav-links a {
  display: block;
  position: relative;
  padding-block: 10px;
  font-size: var(--fs-nav);
  color: var(--nav-muted);
  white-space: nowrap;
  transition: color var(--fast);
}
.nav-links a:hover, .drawer a:hover, .lang-list a:hover { color: var(--bg); text-decoration: underline; text-underline-offset: .2em; }
.nav-links a[aria-current="page"] { color: var(--bg); font-weight: var(--weight-nav-current); }
.nav-links a[aria-current="page"]::after {
  content: "";
  position: absolute;
  inset: auto 0 5px;
  height: 2px;
  background: var(--accent-dark);
  color: var(--nav-bg);
}
.nav-tools { display: flex; align-items: center; flex-shrink: 0; gap: 4px; }
.lang-wrap { position: relative; }
.lang {
  display: flex;
  align-items: center;
  min-height: var(--tap);
  padding: 0 0 0 28px;
  border: 0;
  background: var(--clear);
  color: var(--bg);
  cursor: pointer;
  font-size: var(--fs-nav);
  white-space: nowrap;
}
.lang::before { content: ""; position: absolute; inset: 11px auto 11px 0; border-left: 1px solid var(--nav-line); pointer-events: none; }
.lang-short, .nav-toggle, .preview-menu { display: none; }
.lang-list {
  position: absolute;
  inset: calc(100% + 8px) 0 auto auto;
  width: max-content;
  min-width: 10rem;
  padding: 6px;
  border: 1px solid var(--nav-line);
  border-radius: var(--r-note);
  background: var(--nav-bg);
  color: var(--bg);
}
.lang-list a, .drawer a {
  display: flex;
  align-items: center;
  min-height: var(--tap);
  width: 100%;
  padding: 8px 12px;
  border-radius: var(--r-focus);
}
:where(.lang-list, .drawer) a[aria-current] { background: var(--tint-bg); color: var(--accent-dark); font-weight: var(--weight-nav-current); }
.nav-toggle, .preview-menu > summary {
  min-width: var(--tap);
  min-height: var(--tap);
  padding: 8px;
  border: 0;
  border-radius: var(--r-focus);
  background: var(--nav-bg);
  color: var(--bg);
  cursor: pointer;
}
.nav-toggle svg { width: 22px; height: 22px; display: block; }
.drawer {
  position: absolute;
  inset: 100% 0 auto;
  max-height: calc(100vh - 9rem);
  max-height: calc(100dvh - 9rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 12px var(--gutter) 20px;
  border-top: 1px solid var(--nav-line);
  background: var(--nav-bg);
  color: var(--bg);
}
.drawer-label { margin: 12px 12px 4px; font-size: var(--fs-small); color: var(--nav-muted); }
.nav-veil { position: fixed; inset: 0; z-index: 1; background: var(--shadow-deep); color: var(--text); }
html.nav-open { overflow: hidden; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  max-width: 100%;
  padding: 10px 28px;
  border: 1px solid var(--clear);
  border-radius: var(--r-pill);
  font-size: var(--fs-body);
  font-weight: var(--weight-medium);
  line-height: 1.24;
  letter-spacing: .005em;
  text-align: center;
  overflow-wrap: break-word;
  cursor: pointer;
  transition: transform var(--fast), box-shadow var(--fast), background-color var(--fast);
}
.btn svg { width: 18px; height: 18px; }
.btn-primary {
  color: var(--prism-a);
  background: var(--accent-dark);
  box-shadow: 0 12px 32px -12px var(--accent-glow), inset 0 1px 0 var(--hairline);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 16px 36px -12px var(--accent-glow), inset 0 1px 0 var(--hairline); }
.btn-ghost { color: var(--text); background: var(--glass); border-color: var(--glass-line); }
.btn-ghost:hover { color: var(--text); background: var(--glass-hover); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { background: var(--bg-panel); color: var(--text-muted); border-color: var(--border); box-shadow: none; transform: none; cursor: not-allowed; }

.card-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--gap); }
.card-grid > * { grid-column: span 2; }
.card-grid--pair > *, .card-grid:has(> :nth-child(5):last-child) > :nth-child(n+4) { grid-column: span 3; }
.card-grid:has(> :nth-child(7):last-child) { grid-template-columns: repeat(12, minmax(0, 1fr)); }
.card-grid:has(> :nth-child(7):last-child) > * { grid-column: span 3; }
.card-grid:has(> :nth-child(7):last-child) > :nth-child(n+5) { grid-column: span 4; }
.card, .panel {
  --muted: var(--text-muted);
  --link: var(--accent);
  min-width: 0;
  padding: clamp(18px, 3vw, 32px);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  color: var(--text);
  background: var(--bg-panel);
}
.panel { border-radius: var(--r-panel); }
.card > * + *, .panel > * + * { margin-top: 12px; }
.card h3 a:hover { text-decoration: underline; text-underline-offset: .2em; }

.site-footer { background: var(--bg-panel2); color: var(--text); border-top: 1px solid var(--border); }
.foot-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1.25fr) minmax(0, .7fr);
  gap: 32px;
  padding-block: 56px;
}
.foot-intro p { max-width: 28em; margin-top: 14px; color: var(--text-muted); }
.foot-heading { margin-bottom: 12px; font: var(--weight-medium) var(--fs-small)/1.5 var(--font-mono); color: var(--sand); }
.foot-list { display: grid; gap: 8px; font-size: var(--fs-nav); color: var(--text-muted); }
.foot-list a:hover, .foot-legal a:hover { color: var(--text); text-decoration: underline; text-underline-offset: .2em; }
.foot-list a[aria-current] { color: var(--text); text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: .2em; }
.foot-legal { border-top: 1px solid var(--border); padding-block: 18px 24px; display: flex; flex-wrap: wrap; gap: 8px 20px; color: var(--text-muted); font-size: var(--fs-small); }
body:has(.dl-fab) .site-footer { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }

.reveal-pending { opacity: 0; transform: translateY(12px); }
.reveal { transition: opacity var(--fade) ease, transform var(--fade) ease; }
.reveal.shown, .reveal:focus-within { opacity: 1; transform: none; }

@media (max-width: 1280px) {
  .nav-row { gap: 20px; }
  .nav-links { gap: 20px; }
  .lang { padding-inline-start: 20px; }
  :root:not(:lang(zh)) .nav-desktop { display: none; }
  :root:not(:lang(zh)) .nav-toggle { display: grid; place-items: center; }
  :root:not(:lang(zh)) .nav-tools { margin-inline-start: auto; }
}
@media (max-width: 1100px) {
  .nav-desktop { display: none; }
  .nav-toggle { display: grid; place-items: center; }
  .nav-tools { margin-inline-start: auto; }
  .preview-menu { display: block; }
  .preview-menu > summary { display: grid; place-items: center; list-style: none; }
  .preview-menu > summary::-webkit-details-marker { display: none; }
}
@media (max-width: 800px) {
  .foot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
  :root { --fs-h1: clamp(24px, 7.2vw, 30px); --section-space: 56px; }
  .card-grid, .card-grid:has(> :nth-child(7):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card-grid > *, .card-grid:has(> :nth-child(n):last-child) > * { grid-column: auto; }
}
@media (max-width: 640px) {
  :root { --gutter: 16px; --fs-lead: var(--fs-body); --fs-wall: 22px; }
  .notice-link { display: none; }
  .nav-row { gap: 8px; }
  .brand { gap: 8px; }
  .site-nav .brand { flex-shrink: 1; min-width: 0; }
  .site-nav .brand-name { max-width: min(16.5rem, calc(100vw - 128px)); }
  .site-nav .brand-name em { display: none; }
  .lang { padding-inline-start: 8px; }
  .lang-full { display: none; }
  .lang-short { display: inline; }
  .card-grid, .card-grid:has(> :nth-child(7):last-child) { grid-template-columns: minmax(0, 1fr); }
  .tilt, .decor-tilt { transform: none; }
  .foot-grid { gap: 24px 16px; }
  .foot-intro { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal, .btn, .nav-links a { transition: none; }
  .reveal-pending, .btn-primary:hover, .btn:active:not(:disabled) { opacity: 1; transform: none; }
}