:root {
  --c-bg: #F4F7FE;
  --c-panel: #FFFFFF;
  --c-panel-2: #EAF0FB;
  --c-border: #D9E0EC;
  --c-border-soft: #E5EAF3;
  --c-border-strong: #C3CCDA;
  --c-accent: #2A62D6;
  --c-accent-dark: #1B47A6;
  --c-on-accent: #FFFFFF;
  --c-text: #1F2933;
  --c-muted: #5B6675;
  --c-faint: #8C96A5;
  --c-success: #1E8E5A;
  --c-warn: #F7D94C;
  --c-error: #C8372D;
  --c-dot-a: #CCD4E1;
  --c-dot-b: #BCC6D6;
  --c-dot-c: #AEB9CB;
  --c-clear: transparent;
  --c-veil: rgba(31, 41, 51, 0.24);

  --font-display: "Inter", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-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-xs: 3px;
  --r-sm: 6px;
  --r-md: 8px;
  --r-pill: 999px;
  --r-circle: 50%;
  --shadow-board: 0 24px 60px rgba(44, 62, 100, 0.12), 0 4px 14px rgba(44, 62, 100, 0.05);
  --shadow-sheet: 0 12px 30px rgba(44, 62, 100, 0.08);
  --shadow-chip: 0 1px 2px rgba(44, 62, 100, 0.06);
  --shadow-lift: 0 8px 22px rgba(44, 62, 100, 0.10);
  --shadow-fab: 0 14px 34px rgba(44, 62, 100, 0.16), 0 2px 6px rgba(44, 62, 100, 0.06);
  --ring-focus: 0 0 0 3px rgba(42, 98, 214, 0.28);

  --gutter: 40px;
  --content-max: 1360px;
  --reading-max: 800px;
  --head-h: 68px;
  --peek-h: 56px;
  --section-space: 96px;
  --time-reveal: 450ms;
  --ease-reveal: cubic-bezier(0.2, 0.65, 0.3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
html.nav-open { overflow: hidden; }
body {
  margin: 0;
  background: var(--c-bg);
  color: var(--c-text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
[hidden] { display: none !important; }
img, svg { display: block; max-width: 100%; }
img { height: auto; }
svg { flex-shrink: 0; }
button, input, select, textarea { font: inherit; }
button, summary { cursor: pointer; }
button { color: inherit; }
a { color: var(--c-accent); text-underline-offset: 4px; }
a:hover { color: var(--c-accent-dark); }
a, button, input, select, textarea, summary, [tabindex] { -webkit-tap-highlight-color: var(--c-clear); }
:focus-visible { outline: 2px solid var(--c-accent); outline-offset: 4px; }
a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: none;
  box-shadow: var(--ring-focus);
}
::selection { background: var(--c-warn); color: var(--c-text); }
h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--c-text);
  text-wrap: balance;
  overflow-wrap: break-word;
}
h1 { font-size: clamp(34px, 2.4vw + 12px, 46px); font-weight: 900; line-height: 1.16; letter-spacing: -0.015em; }
h2 { font-size: clamp(24px, 1.4vw + 10px, 32px); font-weight: 900; line-height: 1.25; letter-spacing: -0.01em; }
h3 { font-size: 21px; font-weight: 800; line-height: 1.4; }
p { margin-block: 0 1.2em; }
code, pre, kbd { font-family: var(--font-mono); }
code { font-size: 0.88em; overflow-wrap: anywhere; }
pre {
  max-width: 100%;
  min-width: 0;
  margin-block: 20px;
  padding: 20px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  background: var(--c-panel);
  color: var(--c-text);
  font-size: 13px;
  line-height: 1.85;
  tab-size: 2;
}
pre code { font-size: inherit; overflow-wrap: normal; word-break: normal; white-space: pre; }
hr { border: 0; border-top: 1px solid var(--c-border); margin-block: 32px; }
:where(section, article, div, nav, aside, li) { min-width: 0; }
[id] { scroll-margin-top: 28px; }
.shell, .wrap {
  width: 100%;
  max-width: calc(var(--content-max) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.reading { max-width: calc(var(--reading-max) + var(--gutter) * 2); }
.section { padding-top: var(--section-space); padding-bottom: var(--section-space); }
.section--compact { padding-top: 40px; padding-bottom: 40px; }
.section__head { margin-bottom: 32px; max-width: 720px; }
.section__head h2 { margin-top: 0; margin-bottom: 14px; }
.muted { color: var(--c-muted); }
.mono { font-family: var(--font-mono); }
.keep { white-space: nowrap; }
.text-link { font-weight: 700; text-decoration-thickness: 2px; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
  border: 0;
}
.skip {
  position: absolute;
  left: 16px;
  top: -80px;
  padding: 8px 14px;
  background: var(--c-panel);
  color: var(--c-accent);
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  font-weight: 700;
  z-index: 100;
}
.skip:focus { top: 12px; }

.actions { margin-top: 28px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 48px;
  padding: 10px 22px;
  border-radius: var(--r-sm);
  border: 1px solid var(--c-clear);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.5;
  text-decoration: none;
  text-align: center;
}
.btn svg { width: 17px; height: 17px; }
.btn--primary {
  background: var(--c-accent);
  border-color: var(--c-accent);
  color: var(--c-on-accent);
  box-shadow: var(--shadow-lift);
}
.btn--primary:hover, .btn--primary.is-hover {
  background: var(--c-accent-dark);
  border-color: var(--c-accent-dark);
  color: var(--c-on-accent);
}
.btn--ghost { background: var(--c-panel); border-color: var(--c-border); color: var(--c-text); }
.btn--ghost:hover { border-color: var(--c-border-strong); color: var(--c-text); }
.btn--ghost svg { color: var(--c-muted); }
.btn:disabled, .btn[aria-disabled="true"] {
  background: var(--c-panel-2);
  color: var(--c-muted);
  border-color: var(--c-border);
  box-shadow: none;
  cursor: not-allowed;
}
.btn.is-focus { box-shadow: var(--ring-focus); }
.btn--small { min-height: 40px; font-size: 14px; padding: 8px 14px; }

.topbar { height: var(--head-h); position: relative; z-index: 60; }
.topbar__inner {
  width: 100%;
  max-width: min(100%, calc(1360px + var(--gutter) * 2));
  padding-inline: var(--gutter);
  margin-inline: auto;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 24px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--c-text); flex-shrink: 0; }
.brand:hover { color: var(--c-text); }
.brand__mark { width: 32px; height: 32px; flex-shrink: 0; }
.brand__name { font-family: var(--font-display); font-weight: 900; font-size: 18px; letter-spacing: -0.01em; }
.mainnav { margin-left: auto; min-width: 0; }
.mainnav ul { display: flex; align-items: center; list-style: none; margin: 0; padding: 0; gap: 2px; }
.mainnav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 16px;
  border-radius: var(--r-pill);
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  color: var(--c-muted);
  white-space: nowrap;
}
.mainnav a:hover { color: var(--c-text); }
.mainnav a[aria-current="page"] { background: var(--c-accent); color: var(--c-on-accent); }
.header-tools { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.language { position: relative; }
.lang {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  background: var(--c-panel);
  color: var(--c-text);
  font: 600 14px/1 var(--font-body);
  list-style: none;
}
.lang::-webkit-details-marker { display: none; }
.lang svg { width: 15px; height: 15px; color: var(--c-muted); }
.lang__caret { color: var(--c-muted); font-size: 11px; }
.lang__short { display: none; }
.language-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 190px;
  margin: 0;
  padding: 6px;
  list-style: none;
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  background: var(--c-panel);
  color: var(--c-text);
  box-shadow: var(--shadow-sheet);
  z-index: 5;
}
.language-menu a { display: flex; align-items: center; min-height: 44px; padding: 8px 12px; color: var(--c-text); text-decoration: none; border-radius: var(--r-sm); }
.language-menu a:hover, .language-menu a[aria-current="true"] { background: var(--c-panel-2); color: var(--c-accent-dark); }
.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  background: var(--c-panel);
  color: var(--c-text);
}
.menu-toggle svg { width: 22px; height: 22px; }
.mobile-nav { display: none; }
.nav-veil {
  position: fixed;
  inset: var(--head-h) 0 0;
  border: 0;
  background: var(--c-veil);
  color: var(--c-text);
  z-index: 1;
}

.panel, .card {
  padding: 24px;
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  background: var(--c-panel);
  color: var(--c-text);
  box-shadow: var(--shadow-sheet);
}
.card h3 { margin-top: 0; margin-bottom: 12px; }
.card p:last-child, .panel p:last-child { margin-bottom: 0; }
.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.prose { line-height: 1.85; }
.prose h2 { margin-top: 2.2em; margin-bottom: 0.8em; }
.prose h3 { margin-top: 1.7em; margin-bottom: 0.7em; }
.prose li + li { margin-top: 0.5em; }
.prose :not(pre) > code { background: var(--c-panel-2); color: var(--c-text); padding: 2px 5px; border-radius: var(--r-xs); }
.prose img { max-width: 100%; }
.prose a { overflow-wrap: anywhere; }
.prose blockquote { margin-inline: 0; }
.prose > :first-child { margin-top: 0; }

.site-footer { border-top: 1px solid var(--c-border); padding-top: 56px; padding-bottom: 100px; }
.footer-grid { display: grid; grid-template-columns: 1.2fr 0.7fr 1.4fr 0.7fr; gap: 40px; }
.footer-brand p { color: var(--c-muted); margin-top: 16px; max-width: 27em; font-size: 14px; }
.footer-title { margin: 0 0 16px; font-size: 15px; font-weight: 800; }
.footer-list { list-style: none; margin: 0; padding: 0; }
.footer-list li + li { margin-top: 8px; }
.footer-list a { color: var(--c-muted); font-size: 14px; text-decoration: none; }
.footer-list a:hover { color: var(--c-accent); text-decoration: underline; }
.footer-bottom { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--c-border); display: flex; flex-wrap: wrap; gap: 12px 24px; color: var(--c-muted); font-size: 13px; }
.footer-bottom a { color: var(--c-muted); }

.reveal { opacity: 1; transform: none; }
.reveal-ready .reveal:not(.shown) { opacity: 0; transform: translateY(14px); }
.reveal-ready .reveal { transition: opacity var(--time-reveal) var(--ease-reveal), transform var(--time-reveal) var(--ease-reveal); }
.reveal-ready .reveal.shown { opacity: 1; transform: none; }

@media (max-width: 1120px) {
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1000px) {
  .topbar .brand { min-width: 0; flex-shrink: 1; }
  .topbar .brand__name { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .mainnav:not(.preview-nav) { display: none; }
  .header-tools { margin-left: auto; }
  .menu-toggle { display: inline-flex; }
  .mobile-nav:not([hidden]) {
    display: block;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 3;
    max-height: calc(100dvh - var(--head-h));
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 16px var(--gutter) 24px;
    background: var(--c-panel);
    color: var(--c-text);
    border-bottom: 1px solid var(--c-border);
    box-shadow: var(--shadow-sheet);
  }
  .mobile-nav ul { list-style: none; margin: 0; padding: 0; }
  .mobile-nav a { display: flex; align-items: center; width: 100%; min-height: 46px; padding: 10px 14px; text-decoration: none; color: var(--c-text); border-radius: var(--r-sm); }
  .mobile-nav a[aria-current="page"] { background: var(--c-accent); color: var(--c-on-accent); }
  .mobile-nav a[aria-current="true"] { background: var(--c-panel-2); color: var(--c-accent-dark); }
  .mobile-nav__label { margin: 20px 14px 8px; font-size: 13px; color: var(--c-muted); }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
  :root { --gutter: 20px; --section-space: 64px; }
  h1 { font-size: clamp(24px, 6.4vw, 30px); }
  .card-grid { grid-template-columns: minmax(0, 1fr); }
  .preview-topbar { height: auto; padding-top: 14px; padding-bottom: 14px; }
  .preview-topbar .topbar__inner { flex-wrap: wrap; gap: 14px; }
  .preview-topbar .preview-nav { order: 3; width: 100%; margin: 0; }
  .preview-nav ul { flex-wrap: wrap; }
  .preview-nav a { padding-inline: 12px; font-size: 14px; }
}
@media (max-width: 640px) {
  .tilt, [data-tilt] { transform: none !important; }
  .lang__full { display: none; }
  .lang__short { display: inline; }
  .footer-grid { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .brand__name { font-size: 16px; }
  .topbar__inner { gap: 10px; }
  .header-tools { gap: 6px; }
  .lang { padding-inline: 9px; }
  .panel, .card { padding: 20px; }
}
@media (max-width: 360px) {
  :root { --gutter: 16px; }
  .brand { gap: 7px; }
  .brand__mark { width: 28px; height: 28px; }
  .brand__name { font-size: 14px; }
  .btn { padding-inline: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal-ready .reveal:not(.shown) { opacity: 1; transform: none; }
}