:root {
  --bg: #ffffff;
  --bg-panel: #f6f7f8;
  --bg-panel-2: #2d3035;
  --border: #e5e7ea;
  --accent: #d2474b;
  --accent-dark: #a9363b;
  --accent-2: #8fcfe0;
  --text: #2e3136;
  --text-muted: #7c8189;
  --text-secondary: #686d75;
  --text-faint: #a9aeb5;
  --success: #3f9a6b;
  --warn: #c48a1e;
  --error: #b8323a;
  --on-accent: #ffffff;
  --on-dark: #b7bcc3;
  --on-dark-dim: #a9aeb5;
  --on-dark-strong: #ffffff;
  --on-dark-fill: rgba(255, 255, 255, .09);
  --dot: #d4d7db;
  --line-art: #e2e5e9;
  --veil: rgba(46, 49, 54, .18);
  --mask-on: #000000;
  --mask-off: rgba(0, 0, 0, 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-normal: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;
  --size-body: 16px;
  --size-small: 14px;
  --size-caption: 13px;
  --size-h1: clamp(34px, 2.2vw + 16px, 48px);
  --size-h2: clamp(26px, 3vw, 36px);
  --size-h3: clamp(19px, 2vw, 23px);
  --tracking-title: -.02em;
  --tracking-brand: -.01em;
  --tracking-button: -.005em;

  --r-window: 24px;
  --r-panel: 28px;
  --r-btn: 14px;
  --r-mark: 8px;
  --r-small: 10px;
  --r-rule: 2px;
  --r-pill: 999px;
  --r-circle: 50%;

  --shadow-float: 0 60px 120px -40px rgba(46, 49, 54, .22), 0 24px 48px -24px rgba(46, 49, 54, .14), 0 2px 6px rgba(46, 49, 54, .04);
  --shadow-soft: 0 10px 28px -16px rgba(46, 49, 54, .28), 0 1px 2px rgba(46, 49, 54, .05);
  --shadow-accent: 0 14px 28px -14px rgba(210, 71, 75, .6), inset 0 1px 0 rgba(255, 255, 255, .18);
  --shadow-mark: 0 4px 10px -4px rgba(46, 49, 54, .22), inset 0 0 0 1px rgba(46, 49, 54, .04);

  --page-w: 1200px;
  --reading-w: 800px;
  --window-w: 1120px;
  --head-w: 1280px;
  --head-h: 68px;
  --gutter: 24px;
  --section-gap: 160px;
  --panel-pad: clamp(24px, 4vw, 48px);
  --grid-gap: 24px;
  --speed-fast: 150ms;
  --speed-reveal: 600ms;
  --ease-out: cubic-bezier(.2, .7, .3, 1);
  --focus-ring: 2px solid var(--accent-dark);
}
*,
*::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: var(--weight-normal) var(--size-body)/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
main, section, article, aside, nav, header, footer, div { min-width: 0; }
img { max-width: 100%; }
svg { display: block; flex-shrink: 0; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: var(--mask-off); }
button { cursor: pointer; }
a { color: var(--accent-dark); text-decoration-thickness: 1px; text-underline-offset: .2em; }
a:hover { color: var(--accent); }
button:focus-visible, a:focus-visible, summary:focus-visible, [tabindex]:focus-visible {
  outline: var(--focus-ring);
  outline-offset: 4px;
}
[hidden] { display: none !important; }
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-title);
  line-height: 1.25;
  text-wrap: balance;
  overflow-wrap: break-word;
}
h1 { font-size: var(--size-h1); line-height: 1.15; }
h2 { font-size: var(--size-h2); }
h3 { font-size: var(--size-h3); }
p { margin: 0 0 1.2em; }
h1, h2, h3 { margin: 0 0 .75em; }
strong { font-weight: var(--weight-semibold); }
code, pre, kbd { font-family: var(--font-mono); }
code { overflow-wrap: anywhere; font-size: .9em; }
pre {
  margin: 24px 0;
  padding: 24px;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  background: var(--bg-panel);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--r-btn);
  font-size: var(--size-small);
  line-height: 1.9;
  tab-size: 2;
}
pre code { overflow-wrap: normal; word-break: normal; white-space: pre; font-size: inherit; }
hr { border: 0; border-top: 1px solid var(--border); margin: 40px 0; }
ul, ol { padding-inline-start: 1.5em; }
li + li { margin-top: .4em; }
.wrap {
  width: 100%;
  max-width: var(--page-w);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.reading { max-width: var(--reading-w); margin-inline: auto; }
.section {
  position: relative;
  padding-top: var(--section-gap);
  padding-bottom: 0;
  overflow-x: clip;
}
.section__heading { text-align: center; max-width: 780px; margin: 0 auto 56px; }
.section__heading p { color: var(--text-secondary); }
.prose { line-height: 1.9; overflow-wrap: break-word; }
.prose h2 { margin-top: 2.6em; scroll-margin-top: 28px; }
.prose h3 { margin-top: 2em; }
.prose li { padding-inline-start: .2em; }
.prose a { overflow-wrap: anywhere; }
.prose > :last-child { margin-bottom: 0; }
.nowrap { white-space: nowrap; }
.muted { color: var(--text-secondary); }
.mono { font-family: var(--font-mono); }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: var(--gutter);
  padding: 10px 16px;
  background: var(--bg);
  color: var(--text);
  border-radius: var(--r-small);
  transform: translateY(-180%);
}
.skip-link:focus { transform: none; }
.cluster { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.grid-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--grid-gap); }
.grid-three { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--grid-gap); }
.grid-two > *, .grid-three > * { min-width: 0; }
.card, .panel {
  position: relative;
  padding: var(--panel-pad);
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--r-panel);
}
.panel { box-shadow: var(--shadow-float); }
.card h3, .panel h3 { margin-top: 0; }
.card p:last-child, .panel p:last-child { margin-bottom: 0; }
.btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 12px 26px;
  max-width: 100%;
  border: 1px solid var(--mask-off);
  border-radius: var(--r-btn);
  font-size: var(--size-body);
  font-weight: var(--weight-semibold);
  line-height: 1.5;
  letter-spacing: var(--tracking-button);
  text-align: center;
  text-decoration: none;
  transition: background-color var(--speed-fast), box-shadow var(--speed-fast);
}
.btn svg { width: 18px; height: 18px; }
.btn--primary {
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: var(--shadow-accent);
}
.btn--primary:hover, .btn--primary.is-hover { background: var(--accent-dark); color: var(--on-accent); }
.btn--ghost {
  background: var(--bg);
  color: var(--text);
  border-color: var(--border);
  box-shadow: var(--shadow-soft);
}
.btn--ghost:hover, .btn--ghost.is-hover { background: var(--bg-panel); color: var(--text); }
.btn--ghost svg { color: var(--text-muted); }
.btn--small { min-height: 44px; padding: 9px 18px; font-size: var(--size-small); }
.btn:disabled, .btn[aria-disabled="true"] {
  background: var(--bg-panel);
  color: var(--text-secondary);
  border-color: var(--border);
  box-shadow: none;
  cursor: not-allowed;
}
.btn.is-focus { outline: var(--focus-ring); outline-offset: 4px; }
.site-head { position: relative; z-index: 40; min-height: var(--head-h); background: var(--bg); color: var(--text); }
.site-head__inner {
  position: relative;
  z-index: 2;
  max-width: min(100%, calc(var(--head-w) + var(--gutter) * 2));
  min-height: var(--head-h);
  margin-inline: auto;
  padding-inline: var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand { display: flex; align-items: center; gap: 12px; flex-shrink: 0; color: var(--text); text-decoration: none; }
.brand:hover { color: var(--text); }
.brand__mark {
  display: block;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: var(--r-mark);
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-mark);
}
.brand__name {
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  font-size: 16px;
  letter-spacing: var(--tracking-brand);
}
.nav { min-width: 0; margin-left: auto; }
.nav__list {
  display: flex;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 2px;
}
.nav__list li { margin: 0; }
.nav__link {
  display: block;
  padding: 7px 13px;
  border-radius: var(--r-pill);
  font-size: var(--size-small);
  font-weight: var(--weight-medium);
  color: var(--text-secondary);
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--speed-fast), background-color var(--speed-fast);
}
.nav__link:hover { color: var(--text); }
.nav__link.is-active, .nav__link[aria-current="page"] {
  background: var(--bg-panel);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--border);
}
.head-tools { position: relative; display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.lang {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  min-height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--bg);
  color: var(--text-secondary);
  font-size: var(--size-caption);
  font-weight: var(--weight-medium);
  white-space: nowrap;
}
.lang svg { width: 15px; height: 15px; }
.lang__short { display: none; }
.language-popover {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  z-index: 6;
  min-width: 190px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--r-btn);
  background: var(--bg);
  color: var(--text);
  box-shadow: var(--shadow-soft);
}
.language-popover a { display: block; min-height: 44px; padding: 10px 14px; color: var(--text); text-decoration: none; border-radius: var(--r-mark); }
.language-popover a:hover, .language-popover [aria-current="true"] { background: var(--bg-panel); color: var(--text); }
.nav__menu {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 44px;
  min-height: 44px;
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--bg-panel);
  color: var(--text);
  font-size: var(--size-caption);
  font-weight: var(--weight-medium);
}
.nav__menu svg { width: 15px; height: 15px; }
.mobile-nav { display: none; }
.nav-veil { position: fixed; inset: var(--head-h) 0 0; z-index: 1; border: 0; padding: 0; background: var(--veil); color: var(--text); cursor: default; }
.site-foot {
  margin-top: var(--section-gap);
  padding-top: 64px;
  padding-bottom: 28px;
  background: var(--bg);
  color: var(--text);
  border-top: 1px solid var(--border);
}
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1.2fr; gap: 48px; }
.foot-brand p { max-width: 360px; margin-top: 20px; font-size: var(--size-small); color: var(--text-secondary); }
.foot-title { margin: 0 0 18px; font-size: var(--size-small); font-weight: var(--weight-semibold); }
.foot-links { list-style: none; padding: 0; margin: 0; }
.foot-links li { margin: 0; }
.foot-links a { display: inline-block; padding-top: 5px; padding-bottom: 5px; color: var(--text-secondary); font-size: var(--size-small); text-decoration: none; }
.foot-links a:hover { color: var(--accent-dark); }
.foot-languages { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 42px; }
.foot-languages a { padding-top: 6px; padding-bottom: 6px; font-size: var(--size-small); color: var(--text-secondary); }
.foot-languages [aria-current="true"] { color: var(--text); }
.foot-bottom { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 28px; margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--border); font-size: var(--size-caption); color: var(--text-secondary); }
.foot-bottom p { margin: 0; }
.foot-legal { display: flex; flex-wrap: wrap; gap: 20px; }
.foot-legal a { color: var(--text-secondary); }
.reveal { opacity: 1; transform: none; }
html.reveal-ready .reveal:not(.shown) { opacity: 0; transform: translateY(18px); }
html.reveal-ready .reveal { transition: opacity var(--speed-reveal) var(--ease-out), transform var(--speed-reveal) var(--ease-out); }
.reveal.shown { opacity: 1; transform: none; }

@media (max-width: 1279px) {
  .site-head__inner { gap: 16px; }
  .nav { display: none; }
  .head-tools { margin-left: auto; }
  .nav__menu { display: flex; }
  .mobile-nav:not([hidden]) {
    display: block;
    position: fixed;
    top: var(--head-h);
    left: 0;
    right: 0;
    z-index: 5;
    max-height: calc(100dvh - var(--head-h));
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 16px var(--gutter) 28px;
    background: var(--bg);
    color: var(--text);
    border-top: 1px solid var(--border);
    box-shadow: var(--shadow-soft);
  }
  .mobile-nav ul { display: block; list-style: none; padding: 0; margin: 0; }
  .mobile-nav li { margin: 0; }
  .mobile-nav a { display: block; width: 100%; min-height: 46px; padding: 11px 16px; text-decoration: none; color: var(--text); border-radius: var(--r-small); }
  .mobile-nav a:hover, .mobile-nav [aria-current] { background: var(--bg-panel); color: var(--text); }
  .mobile-nav__languages { margin-top: 16px !important; padding-top: 16px !important; border-top: 1px solid var(--border); }
}
@media (max-width: 768px) {
  h1 { font-size: clamp(24px, 4.4vw, 30px); }
  .grid-three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .foot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; }
  .foot-brand { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  :root { --gutter: 16px; --section-gap: 160px; --grid-gap: 18px; }
  .wrap { width: 100%; padding-inline: var(--gutter); }
  .grid-two, .grid-three { grid-template-columns: minmax(0, 1fr); }
  .brand { gap: 8px; }
  .brand__name { font-size: 13px; }
  .brand__mark { width: 28px; height: 28px; }
  .site-head__inner { gap: 8px; }
  .head-tools { margin-left: auto; gap: 6px; }
  .lang { padding-inline: 10px; min-height: 44px; }
  .lang svg, .lang__full, .nav__menu-label { display: none; }
  .lang__short { display: inline; }
  .nav__menu { padding: 10px; }
  .section__heading { margin-bottom: 36px; }
  .tilt, [data-tilt] { transform: none !important; }
  pre { padding: 18px; }
  .foot-grid { grid-template-columns: minmax(0, 1fr); }
  .foot-bottom { align-items: flex-start; flex-direction: column; }
  .foot-brand { grid-column: auto; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; }
  html.reveal-ready .reveal:not(.shown) { opacity: 1; transform: none; }
}