:root {
  --bg: #ffffff;
  --bg-panel: #f7f8fb;
  --bg-panel-2: #eef1f8;
  --border: #e3e6ee;
  --border-strong: #cdd3e0;
  --rail: #eef1f8;
  --accent: #4a6cf7;
  --accent-dark: #2f4fd8;
  --grad-end: #5fb878;
  --text: #15171c;
  --text-muted: #5c6270;
  --text-faint: #8b91a0;
  --success: #3f9e63;
  --warn: #c98a12;
  --error: #d6453d;
  --success-ink: #286c41;
  --warn-ink: #805707;
  --error-ink: #ad3029;
  --accent-soft: #edf1fe;
  --success-soft: #eaf5ee;
  --warn-soft: #fff6e3;
  --error-soft: #fcedeb;
  --on-accent: #ffffff;
  --clear: transparent;
  --veil: rgba(21, 23, 28, 0.24);
  --pattern-light: rgba(255, 255, 255, 0.18);
  --fact-deep: #223f9b;
  --fact-teal: #246b65;

  --shadow-hairline: 0 1px 2px rgba(21, 23, 28, 0.04);
  --shadow-float: 0 1px 2px rgba(21, 23, 28, 0.04), 0 12px 32px rgba(21, 23, 28, 0.06);
  --shadow-btn: 0 1px 2px rgba(47, 79, 216, 0.06), 0 6px 16px rgba(47, 79, 216, 0.06);

  --r-card: 10px;
  --r-btn: 8px;
  --r-pill: 999px;
  --r-cell: 6px;
  --r-mark: 7px;
  --r-shot: 8px;
  --r-circle: 50%;
  --r-none: 0;

  --font-display: "Inter", "Noto Sans SC", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-body: "Inter", "Noto Sans SC", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-strong: 600;
  --track-display: -0.02em;
  --track-small: -0.01em;
  --track-label: 0.04em;
  --size-xs: 12px;
  --size-sm: 13px;
  --size-nav: 14px;
  --size-body: 15px;
  --size-lede: 16px;
  --size-subtitle: 20px;
  --h1-size: clamp(34px, 3.4vw, 48px);
  --h2-size: clamp(26px, 3vw, 36px);
  --h3-size: 22px;
  --line-body: 1.6;
  --line-prose: 1.85;
  --line-heading: 1.2;

  --content: 1240px;
  --reading: 820px;
  --header-content: 1280px;
  --fig: 1080px;
  --header-h: 64px;
  --gutter: 24px;
  --section-gap: 140px;
  --card-pad: 26px;
  --gap: 24px;
  --motion-fast: 150ms;
  --motion-reveal: 550ms;
  --ease: ease;
  --focus-width: 2px;
  --layer-header: 50;
  --layer-veil: 40;
  --layer-fab: 30;
  --layer-skip: 100;
}

*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 24px);
}
html.nav-open { overflow: hidden; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--size-body);
  line-height: var(--line-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button, a { -webkit-tap-highlight-color: var(--clear); }
button:disabled, .btn[aria-disabled="true"] { cursor: not-allowed; }
img, svg { max-width: 100%; }
img { vertical-align: middle; }
svg { flex-shrink: 0; }
[hidden] { display: none !important; }
:where(a, button, summary, input, select, textarea, [tabindex]):focus-visible {
  outline: var(--focus-width) solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--r-btn);
}
::selection { background: var(--accent-soft); color: var(--text); }
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: var(--weight-regular);
  line-height: var(--line-heading);
  letter-spacing: var(--track-display);
  text-wrap: balance;
  overflow-wrap: break-word;
}
h1 { font-size: var(--h1-size); }
h2 { font-size: var(--h2-size); }
h3 { font-size: var(--h3-size); }
h4 { font-size: var(--size-subtitle); }
p { margin-top: 0; }
strong { font-weight: var(--weight-strong); }
code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  overflow-wrap: anywhere;
}
pre {
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--r-btn);
  background: var(--bg-panel);
  color: var(--text);
  line-height: 1.75;
  -webkit-overflow-scrolling: touch;
}
pre code { overflow-wrap: normal; white-space: pre; }
hr { border: 0; border-top: 1px solid var(--border); }
:where(main, section, article, aside, nav, figure, .grid, .grid > *, .wrap > *) { min-width: 0; }
.wrap {
  width: 100%;
  max-width: var(--content);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.wrap--reading { max-width: calc(var(--reading) + var(--gutter) * 2); }
.section { padding-top: var(--section-gap); }
.section:last-child { padding-bottom: var(--section-gap); }
.section__head { max-width: 760px; margin-bottom: 36px; }
.section__head h2 { margin-top: 0; margin-bottom: 16px; }
.section__head p, .muted { color: var(--text-muted); }
.section--decorated, .decorated { position: relative; overflow-x: clip; }
.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;
}
.skip {
  position: fixed;
  left: 12px;
  top: -80px;
  padding: 8px 14px;
  border-radius: var(--r-btn);
  background: var(--text);
  color: var(--bg);
  z-index: var(--layer-skip);
}
.skip:focus { top: 12px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 10px 22px;
  border: 1px solid var(--clear);
  border-radius: var(--r-btn);
  font-size: var(--size-body);
  font-weight: var(--weight-medium);
  line-height: 1.4;
  text-align: center;
  transition: background-color var(--motion-fast) var(--ease), border-color var(--motion-fast) var(--ease), color var(--motion-fast) var(--ease);
}
.btn svg { width: 17px; height: 17px; }
.btn--primary {
  background: var(--accent);
  color: var(--on-accent);
  border-color: var(--accent);
  box-shadow: var(--shadow-btn);
}
.btn--primary:hover, .btn--primary.is-hover {
  background: var(--accent-dark);
  color: var(--on-accent);
  border-color: var(--accent-dark);
}
.btn--ghost {
  background: var(--bg);
  color: var(--accent-dark);
  border-color: var(--accent);
}
.btn--ghost:hover, .btn--ghost.is-hover {
  background: var(--accent-soft);
  color: var(--accent-dark);
}
.btn--small { min-height: 40px; padding: 8px 14px; font-size: var(--size-sm); }
.btn:disabled, .btn[aria-disabled="true"] {
  background: var(--bg-panel-2);
  color: var(--text-muted);
  border-color: var(--border);
  box-shadow: none;
}
.btn.is-focus { outline: var(--focus-width) solid var(--accent); outline-offset: 3px; }
.text-link { color: var(--accent-dark); text-decoration: underline; text-underline-offset: 4px; }
.cta { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; margin-top: 24px; }

#site-header, .masthead {
  position: sticky;
  top: 0;
  z-index: var(--layer-header);
  height: var(--header-h);
  background: var(--bg);
  color: var(--text);
  border-bottom: 1px solid var(--border);
}
.masthead__inner {
  position: relative;
  max-width: min(100%, calc(var(--header-content) + var(--gutter) * 2));
  height: 100%;
  margin-inline: auto;
  padding-inline: var(--gutter);
  display: flex;
  align-items: center;
  gap: 24px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand__mark {
  display: block;
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border-radius: var(--r-mark);
}
.brand__placeholder {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-hairline), inset 0 0 0 4px var(--bg), inset 0 0 0 5px var(--accent-soft);
}
.brand__name { font-size: var(--size-body); font-weight: var(--weight-medium); letter-spacing: var(--track-small); white-space: nowrap; }
.mainnav { margin-left: auto; min-width: 0; }
.mainnav__list { display: flex; align-items: center; list-style: none; margin: 0; padding: 0; gap: 2px; }
.mainnav__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 8px 11px;
  border-radius: var(--r-btn);
  font-size: var(--size-nav);
  color: var(--text-muted);
  white-space: nowrap;
  transition: background-color var(--motion-fast) var(--ease), color var(--motion-fast) var(--ease);
}
.mainnav__link svg, .lang svg, .menu-toggle svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.mainnav__link:hover, .mainnav__link[aria-current="page"] {
  background: var(--bg-panel);
  color: var(--text);
}
.mainnav__link[aria-current="page"] svg { stroke: var(--accent); }
.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: 34px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--bg);
  color: var(--text-muted);
  font-size: var(--size-sm);
  white-space: nowrap;
}
.lang:hover { color: var(--text); border-color: var(--border-strong); }
.lang__short { display: none; }
.language-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 12px);
  width: 180px;
  margin: 0;
  padding: 8px;
  list-style: none;
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-float);
  background: var(--bg);
  color: var(--text);
}
.language-menu a { display: flex; align-items: center; min-height: 44px; padding: 10px 12px; border-radius: var(--r-btn); }
.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;
  border: 1px solid var(--border);
  border-radius: var(--r-btn);
  background: var(--bg);
  color: var(--text);
}
.menu-toggle svg { width: 22px; height: 22px; }
.mobile-drawer {
  position: absolute;
  top: var(--header-h);
  left: 0;
  right: 0;
  max-height: calc(100dvh - var(--header-h));
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px var(--gutter) 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  box-shadow: var(--shadow-float);
}
.mobile-drawer ul { margin: 0; padding: 0; list-style: none; }
.mobile-drawer a { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 46px; padding: 12px; border-radius: var(--r-btn); }
.mobile-drawer a:hover, .mobile-drawer a[aria-current] { background: var(--bg-panel); color: var(--accent-dark); }
.mobile-drawer svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.mobile-drawer__label { padding: 16px 12px 6px; margin: 12px 0 0; border-top: 1px solid var(--border); font-size: var(--size-xs); color: var(--text-muted); }
.nav-veil { position: fixed; inset: var(--header-h) 0 0; z-index: var(--layer-veil); border: 0; background: var(--veil); color: var(--text); }
.preview-menu { display: none; margin-left: auto; }
.preview-menu summary { list-style: none; padding: 10px; cursor: pointer; }
.preview-menu summary::-webkit-details-marker { display: none; }

.card, .panel {
  min-width: 0;
  padding: var(--card-pad);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  background: var(--bg);
  color: var(--text);
}
.panel--float { box-shadow: var(--shadow-float); }
.card h3 { margin-top: 0; }
.card p:last-child, .panel p:last-child { margin-bottom: 0; }
.grid { display: grid; gap: var(--gap); }
.grid--two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.prose { line-height: var(--line-prose); }
.prose h2 { margin-top: 64px; margin-bottom: 24px; }
.prose h3 { margin-top: 36px; margin-bottom: 16px; }
.prose p, .prose ul, .prose ol { margin-bottom: 22px; }
.prose li + li { margin-top: 10px; }
.prose a:not(.btn):not(.appstore-button) { color: var(--accent-dark); text-decoration: underline; text-underline-offset: 3px; }
.prose :where(p, li, dd) { overflow-wrap: break-word; }
.reveal { opacity: 1; transform: none; }
html.reveal-ready .reveal { opacity: 0; transform: translateY(14px); transition: opacity var(--motion-reveal) var(--ease), transform var(--motion-reveal) var(--ease); }
html.reveal-ready .reveal.shown { opacity: 1; transform: none; }

.site-footer { margin-top: var(--section-gap); padding-top: 56px; padding-bottom: 28px; background: var(--bg-panel); color: var(--text); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 0.8fr 1.3fr 0.7fr; gap: 40px; }
.footer-brand p { max-width: 360px; margin-top: 20px; color: var(--text-muted); font-size: var(--size-nav); }
.footer-heading { margin: 0 0 16px; font-size: var(--size-nav); font-weight: var(--weight-medium); }
.footer-links { list-style: none; margin: 0; padding: 0; font-size: var(--size-nav); }
.footer-links a { display: inline-block; padding-block: 6px; color: var(--text-muted); overflow-wrap: anywhere; }
.footer-links a:hover { color: var(--accent-dark); text-decoration: underline; text-underline-offset: 3px; }
.footer-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px 24px; margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--border); font-size: var(--size-xs); color: var(--text-muted); }
.footer-bottom p { margin: 0; }

@media (max-width: 1200px) {
  .mainnav { display: none; }
  .header-tools { margin-left: auto; }
  .menu-toggle { display: inline-flex; }
  .preview-menu { display: block; }
  .preview-masthead .header-tools { margin-left: 0; }
}
@media (max-width: 980px) {
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
  :root { --h1-size: clamp(24px, 4.3vw, 30px); --h2-size: clamp(24px, 4vw, 30px); }
}
@media (max-width: 640px) {
  :root { --gutter: 16px; --card-pad: 20px; --gap: 18px; }
  .masthead__inner { gap: 10px; }
  .brand { gap: 7px; min-width: 0; flex-shrink: 1; }
  .brand__name { min-width: 0; font-size: var(--size-sm); white-space: normal; overflow-wrap: anywhere; }
  .brand__mark { width: 28px; height: 28px; }
  .header-tools { margin-left: auto; gap: 6px; }
  .lang { padding-inline: 10px; min-height: 40px; }
  .lang__full { display: none; }
  .lang__short { display: inline; }
  .grid--two, .grid--three, .footer-grid { grid-template-columns: minmax(0, 1fr); }
  .footer-grid { gap: 28px; }
  .cta { flex-direction: column; align-items: stretch; max-width: 320px; margin-inline: auto; }
  .tilt, [data-tilt] { transform: none !important; }
  .section__head { margin-bottom: 28px; }
  .preview-masthead .lang { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; }
  html.reveal-ready .reveal { opacity: 1; transform: none; }
}