:root {
  --bg: #f7f5f2;
  --bg-top: #fbfaf9;
  --bg-panel: #ffffff;
  --bg-panel-2: #eeeae7;
  --bg-chrome: #f4f2ef;
  --border: #e2ddd9;
  --border-soft: #ebe7e3;
  --accent: #5c2f55;
  --accent-dark: #3d1d38;
  --accent-mist: #b98aae;
  --accent-haze: #ede3e9;
  --accent-wash: rgba(92, 47, 85, 0.065);
  --accent-ring: rgba(92, 47, 85, 0.14);
  --text: #1c1a1b;
  --text-muted: #6e6869;
  --text-faint: #a39c9d;
  --ink: #261e24;
  --ink-line: rgba(255, 255, 255, 0.09);
  --on-ink: #fbf8fa;
  --on-ink-muted: rgba(251, 248, 250, 0.55);
  --success: #2f7d5b;
  --warn: #a8701a;
  --error: #b3372f;
  --dot-red: #ddb8b2;
  --dot-amber: #e2d0ad;
  --dot-green: #bcd0c2;
  --aura-plum: rgba(92, 47, 85, 0.17);
  --aura-rose: rgba(196, 164, 172, 0.42);
  --aura-haze: rgba(237, 227, 233, 0.9);
  --capsule-ring: rgba(185, 138, 174, 0.22);
  --veil: rgba(28, 26, 27, 0.3);
  --transparent: transparent;
  --font-display: 'Iowan Old Style', 'Charter', 'Georgia', 'Noto Sans SC', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', serif;
  --font-body: 'Inter', 'Noto Sans SC', 'PingFang SC', 'Hiragino Sans GB', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'SFMono-Regular', ui-monospace, Menlo, Consolas, monospace;
  --weight-normal: 400;
  --weight-medium: 500;
  --r-xs: 6px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 22px;
  --r-pill: 999px;
  --r-round: 50%;
  --r-logo: 28%;
  --shadow-chip: 0 1px 2px rgba(28, 26, 27, 0.04);
  --shadow-btn: 0 1px 1px rgba(61, 29, 56, 0.25), 0 10px 24px -10px rgba(61, 29, 56, 0.55);
  --shadow-btn-2: 0 1px 2px rgba(28, 26, 27, 0.05), 0 8px 20px -14px rgba(28, 26, 27, 0.25);
  --shadow-window: 0 0 0 1px rgba(28, 26, 27, 0.035), 0 2px 4px rgba(28, 26, 27, 0.03), 0 28px 60px -24px rgba(61, 29, 56, 0.2), 0 70px 140px -50px rgba(61, 29, 56, 0.28);
  --shadow-paper: 0 1px 2px rgba(28, 26, 27, 0.04), 0 10px 24px -18px rgba(28, 26, 27, 0.18);
  --shadow-capsule: 0 1px 1px rgba(20, 12, 18, 0.3), 0 12px 26px -10px rgba(38, 18, 34, 0.55);
  --container: 1180px;
  --reading: 800px;
  --header-width: 1280px;
  --header-h: 64px;
  --gutter: 40px;
  --section-space: 112px;
  --motion-fast: 0.2s;
  --motion-mid: 0.5s;
}

*, *::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: 16px;
  font-weight: var(--weight-normal);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
img, svg { max-width: 100%; }
img { display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
button, a { -webkit-tap-highlight-color: var(--accent-ring); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: var(--r-xs); }
::selection { background: var(--accent-haze); color: var(--accent-dark); }
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: var(--weight-normal);
  text-wrap: balance;
  overflow-wrap: break-word;
}
h1 { font-size: clamp(34px, 3.2vw, 48px); line-height: 1.12; letter-spacing: -0.004em; }
h2 { font-size: clamp(26px, 2.5vw, 36px); line-height: 1.25; }
h3 { font-size: 23px; line-height: 1.35; }
p { margin-top: 0; }
strong { font-weight: var(--weight-medium); }
code, pre, kbd { font-family: var(--font-mono); }
code { font-size: 0.88em; overflow-wrap: anywhere; }
pre {
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  padding: 20px;
  border: 1px solid var(--border-soft);
  border-radius: var(--r-sm);
  background: var(--bg-chrome);
  color: var(--text);
  line-height: 1.8;
  overscroll-behavior-x: contain;
}
pre code { white-space: pre; overflow-wrap: normal; word-break: normal; }
section, article, aside, nav, main, figure, .grid > *, .stack > * { min-width: 0; }
.wrap { width: 100%; max-width: calc(var(--container) + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter); }
.reading { max-width: calc(var(--reading) + var(--gutter) * 2); }
.section { position: relative; padding-top: var(--section-space); padding-bottom: var(--section-space); overflow-x: clip; }
.section--white { background: var(--bg-panel); color: var(--text); }
.section--fade { background: linear-gradient(180deg, var(--bg), var(--bg-panel-2), var(--bg)); color: var(--text); }
.section__heading { max-width: 740px; margin: 0 auto 48px; text-align: center; }
.section__heading p, .muted { color: var(--text-muted); }
.nowrap { 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; }
.grid { display: grid; gap: 24px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stack { display: grid; gap: 24px; }
.card, .panel {
  min-width: 0;
  padding: 32px;
  background: var(--bg-panel);
  color: var(--text);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-paper);
}
.panel--floating { box-shadow: var(--shadow-window); }
.card h3, .panel h3 { margin-top: 0; }
.card > :last-child, .panel > :last-child { margin-bottom: 0; }
.text-link { color: var(--accent); text-decoration: underline; text-underline-offset: 5px; }
.prose { min-width: 0; line-height: 1.9; }
.prose h2 { margin-top: 64px; }
.prose h3 { margin-top: 36px; }
.prose a:not(.btn):not(.app-store-button) { color: var(--accent); text-decoration: underline; text-underline-offset: 4px; }
.prose li { margin-bottom: 10px; }
.prose :is(h2, h3, h4)[id] { scroll-margin-top: 24px; }
.actions { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 12px; margin: 0 0 20px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 10px 24px;
  border: 1px solid var(--transparent); border-radius: var(--r-md);
  font-family: var(--font-body); font-size: 15.5px; letter-spacing: 0.01em; line-height: 1.4;
  text-align: center;
  transition: background-color var(--motion-fast), border-color var(--motion-fast), transform var(--motion-fast);
}
.btn--primary { background: var(--accent); color: var(--on-ink); box-shadow: var(--shadow-btn); }
.btn--primary:hover, .btn--primary.is-hover { background: var(--accent-dark); color: var(--on-ink); }
.btn--primary:active { transform: translateY(1px); }
.btn svg { width: 17px; height: 17px; flex-shrink: 0; margin-top: -2px; }
.btn--ghost { background: var(--bg-panel); color: var(--text); border-color: var(--border); box-shadow: var(--shadow-btn-2); }
.btn--ghost:hover, .btn--ghost.is-hover { border-color: var(--accent-mist); }
.btn:disabled, .btn[aria-disabled="true"] { background: var(--bg-panel-2); color: var(--text-muted); box-shadow: none; }
.btn__arrow { color: var(--text-muted); transition: transform var(--motion-fast); }
.btn--ghost:hover .btn__arrow { transform: translateX(2px); color: var(--accent); }

.topbar { position: relative; z-index: 40; height: var(--header-h); background: var(--bg-panel); color: var(--text); border-bottom: 1px solid var(--border-soft); }
.topbar__inner {
  position: relative; max-width: min(100%, calc(var(--header-width) + var(--gutter) * 2));
  height: 100%; margin-inline: auto; padding-inline: var(--gutter);
  display: flex; align-items: center; gap: 32px;
}
.brand { display: inline-flex; align-items: center; gap: 11px; flex-shrink: 0; }
.brand__mark { width: 30px; height: 30px; flex-shrink: 0; border-radius: var(--r-logo); }
.brand__mark--placeholder { background: linear-gradient(160deg, var(--bg-panel), var(--bg-panel-2)); color: var(--text); box-shadow: inset 0 0 0 1.5px var(--accent-ring), var(--shadow-chip); }
.brand__name { font-family: var(--font-display); font-size: 19px; letter-spacing: 0.01em; }
.tabs { margin-left: auto; height: 100%; min-width: 0; }
.tabs__list { display: flex; align-items: center; list-style: none; margin: 0; padding: 0; height: 100%; gap: 26px; }
.tabs__list li { height: 100%; flex-shrink: 0; }
.tabs__link { position: relative; display: flex; align-items: center; height: 100%; font-size: 14.5px; color: var(--text-muted); white-space: nowrap; transition: color var(--motion-fast); }
.tabs__link::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
  border-radius: var(--r-xs) var(--r-xs) 0 0; background: var(--accent); color: var(--on-ink);
  transform: scaleX(0); opacity: 0.35; transition: transform var(--motion-fast), opacity var(--motion-fast);
}
.tabs__link:hover { color: var(--text); }
.tabs__link:hover::after { transform: scaleX(0.6); }
.tabs__link[aria-current="page"] { color: var(--text); }
.tabs__link[aria-current="page"]::after { transform: scaleX(1); opacity: 1; }
.header-tools { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.language { position: relative; }
.lang {
  display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 6px 14px;
  border: 1px solid var(--border); border-radius: var(--r-pill); background: var(--bg-panel);
  color: var(--text-muted); font-size: 13.5px; white-space: nowrap;
}
.lang__caret { font-size: 10px; color: var(--text-muted); }
.lang__short { display: none; }
.language__menu { position: absolute; right: 0; top: calc(100% + 12px); width: 200px; margin: 0; padding: 8px; list-style: none; background: var(--bg-panel); color: var(--text); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow-window); }
.language__menu a { display: flex; align-items: center; min-height: 44px; padding: 8px 12px; border-radius: var(--r-xs); }
.language__menu a:hover, .language__menu a[aria-current] { background: var(--accent-haze); 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-sm); background: var(--bg-panel); color: var(--text); }
.menu-toggle svg { width: 21px; height: 21px; }
.mobile-drawer { position: absolute; left: 0; right: 0; top: var(--header-h); padding: 16px var(--gutter) 24px; max-height: calc(100dvh - var(--header-h)); overflow-y: auto; overscroll-behavior: contain; background: var(--bg-panel); color: var(--text); box-shadow: var(--shadow-paper); }
.mobile-drawer ul { margin: 0; padding: 0; list-style: none; }
.mobile-drawer a { display: flex; width: 100%; align-items: center; min-height: 48px; padding: 12px; border-bottom: 1px solid var(--border-soft); }
.mobile-drawer a[aria-current] { color: var(--accent); }
.mobile-drawer__label { margin: 24px 12px 8px; color: var(--text-muted); font-size: 13px; }
.nav-veil { position: fixed; z-index: 30; inset: var(--header-h) 0 0; border: 0; background: var(--veil); color: var(--text); }
.site-footer { padding-top: 72px; padding-bottom: 32px; border-top: 1px solid var(--border); background: var(--bg); color: var(--text); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 0.8fr 1.3fr 0.7fr; gap: 40px; }
.footer-grid > * { min-width: 0; }
.footer-brand p { max-width: 310px; margin-top: 20px; color: var(--text-muted); font-size: 14px; }
.footer-heading { margin: 0 0 20px; font-size: 16px; }
.footer-links { margin: 0; padding: 0; list-style: none; font-size: 14px; }
.footer-links a { display: inline-block; padding-block: 6px; overflow-wrap: anywhere; color: var(--text-muted); }
.footer-links a:hover { color: var(--accent); }
.footer-bottom { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: 12px 24px; font-size: 12px; color: var(--text-muted); }
.footer-bottom p { margin: 0; }
.reveal { opacity: 1; }
.reveal.is-observed { opacity: 0; transform: translateY(12px); transition: opacity var(--motion-mid), transform var(--motion-mid); }
.reveal.shown { opacity: 1; transform: none; }

@media (max-width: 1280px) {
  .topbar__inner { gap: 20px; }
  .tabs__list { gap: 18px; }
  .tabs__link { font-size: 14px; }
  html:not([lang="zh-CN"]):not([lang="zh-TW"]) .topbar .tabs { display: none; }
  html:not([lang="zh-CN"]):not([lang="zh-TW"]) .menu-toggle { display: inline-flex; }
  html:not([lang="zh-CN"]):not([lang="zh-TW"]) .header-tools { margin-left: auto; }
}
@media (max-width: 1100px) {
  .topbar .tabs { display: none; }
  .header-tools { margin-left: auto; }
  .menu-toggle { display: inline-flex; }
}
@media (max-width: 900px) {
  :root { --gutter: 20px; --section-space: 72px; }
  .topbar__inner { gap: 16px; }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; }
}
@media (max-width: 768px) {
  h1 { font-size: clamp(24px, 6.4vw, 30px); }
}
@media (max-width: 640px) {
  :root { --gutter: 16px; --section-space: 64px; }
  .grid { grid-template-columns: minmax(0, 1fr); }
  .card, .panel { padding: 24px; }
  .tilt { transform: none !important; }
  .topbar .brand { flex-shrink: 1; min-width: 0; }
  .topbar .brand__name { min-width: 0; overflow-wrap: anywhere; line-height: 1.25; }
  .brand__name { font-size: 17px; }
  .lang { padding-inline: 12px; min-height: 44px; }
  .lang__full { display: none; }
  .lang__short { display: inline; }
  .footer-grid { grid-template-columns: minmax(0, 1fr); }
  .actions { gap: 10px; }
  .actions .btn { width: 100%; max-width: 320px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal.is-observed { opacity: 1; transform: none; }
}