:root {
  color-scheme: light;
  --bg: #FDFCFF;
  --bg-panel: #F5F2FE;
  --bg-panel-2: #EDE8FC;
  --surface: #FFFFFF;
  --border: #E4DFF3;
  --border-strong: #D2C9F1;
  --accent: #6550F2;
  --accent-2: #4C7DF5;
  --accent-dark: #4632C9;
  --text: #231A4D;
  --text-muted: #625A80;
  --on-accent: #FFFFFF;
  --success: #1E9E6A;
  --warn: #C98A12;
  --error: #D23F4B;
  --success-ink: #146044;
  --warn-ink: #714C06;
  --error-ink: #982A37;
  --glow-violet: #D4CBFF;
  --glow-periwinkle: #C6D6FF;
  --glow-rose: #F6DDEE;
  --clear: transparent;
  --accent-halo: rgba(101, 80, 242, .14);
  --veil: rgba(35, 26, 77, .24);
  --mask-on: #000000;
  --mask-half: rgba(0, 0, 0, .42);
  --mask-ghost: rgba(0, 0, 0, .6);

  --grad-accent: linear-gradient(90deg, var(--accent), var(--accent-2));
  --grad-accent-hover: linear-gradient(90deg, var(--accent-dark), var(--accent));
  --grad-chip: linear-gradient(180deg, var(--surface), var(--bg-panel));
  --grad-tile: linear-gradient(180deg, var(--surface) 0%, var(--surface) 58%, var(--bg-panel) 150%);
  --grad-panel: linear-gradient(180deg, var(--bg-panel), var(--bg));
  --shadow-card: 0 1px 2px rgba(35, 26, 77, .05), 0 12px 32px rgba(35, 26, 77, .05);
  --shadow-card-hover: 0 1px 2px rgba(35, 26, 77, .06), 0 16px 36px rgba(70, 50, 201, .06);
  --shadow-chip: 0 1px 2px rgba(35, 26, 77, .04);
  --shadow-btn: 0 1px 2px rgba(70, 50, 201, .16), 0 8px 22px rgba(101, 80, 242, .2);
  --inset-highlight: inset 0 1px 0 rgba(255, 255, 255, .9);

  --radius-pill: 999px;
  --radius-round: 50%;
  --radius-tile: 18px;
  --radius-panel: 32px;
  --radius-detail: 28px;
  --radius-sm: 10px;
  --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;
  --body-size: 16px;
  --title-size: clamp(34px, 2.2vw + 16px, 48px);
  --title-mobile: clamp(24px, 2.2vw + 16px, 30px);
  --section-title: clamp(24px, 1.4vw + 14px, 34px);
  --subhead-size: clamp(18px, 1vw + 14px, 24px);
  --gutter: clamp(16px, 2.3vw, 32px);
  --shell: 1240px;
  --reading: 820px;
  --nav-h: 64px;
  --section-space: clamp(52px, 7vw, 108px);
  --card-pad: clamp(18px, 3vw, 34px);
  --fast: .2s;
  --reveal-duration: .45s;
  --tab-duration: 7000ms;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: var(--body-size)/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

main, section, article, aside, .grid > *, .footer-grid > * { min-width: 0; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
a { color: var(--accent-dark); text-underline-offset: .2em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: var(--radius-sm); }
svg, .eyebrow-dot, .status-dot { flex-shrink: 0; }
p, li, dd { overflow-wrap: break-word; }
h1, h2, h3 {
  margin: 0 0 .65em;
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.25;
  text-wrap: balance;
  overflow-wrap: break-word;
}
h1 { font-size: var(--title-size); line-height: 1.14; letter-spacing: -.02em; }
h2 { font-size: var(--section-title); letter-spacing: -.015em; }
h3 { font-size: var(--subhead-size); }
p { margin: 0 0 1em; }
:where(h1, h2, h3, section, article)[id] { scroll-margin-top: 88px; }
.keep-word { white-space: nowrap; }
.muted { color: var(--text-muted); }
.wrap { width: 100%; max-width: var(--shell); margin-inline: auto; padding-inline: var(--gutter); }
.reading { max-width: calc(var(--reading) + var(--gutter) * 2); }
.sec { padding-block: var(--section-space); }
.grid { display: grid; gap: clamp(14px, 2.5vw, 28px); grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.clip-decor { position: relative; overflow-x: clip; }
.decor-svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

code { font: inherit; overflow-wrap: anywhere; }
:not(pre) > code {
  padding-inline: .25em;
  border-radius: var(--radius-sm);
  background: var(--bg-panel);
  color: var(--text);
}
pre {
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  margin: 1em 0;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-panel);
  color: var(--text);
  font: .875rem/1.6 var(--font-mono);
  white-space: pre;
  overscroll-behavior-inline: contain;
}
pre code { overflow-wrap: normal; }
.prose { min-width: 0; line-height: 1.8; }
.prose :is(h2, h3):not(:first-child) { margin-top: 1.55em; }
.card, .panel {
  min-width: 0;
  border: 1px solid var(--border);
  background: var(--grad-tile);
  color: var(--text);
  box-shadow: var(--shadow-card), var(--inset-highlight);
}
.card { padding: var(--card-pad); border-radius: var(--radius-tile); }
.panel { padding: clamp(24px, 5vw, 72px); border-radius: var(--radius-panel); background: var(--grad-panel); color: var(--text); }
.card > :last-child, .panel > :last-child { margin-bottom: 0; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  max-width: 100%;
  padding: 8px 24px;
  border: 0;
  border-radius: var(--radius-pill);
  font: 500 15.5px/1.2 var(--font-body);
  text-align: center;
  text-decoration: none;
  overflow-wrap: anywhere;
  cursor: pointer;
  transition: transform var(--fast) ease;
}
.btn svg, .line-icon {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.btn:hover, .btn.is-hover { transform: translateY(-1px); }
.btn:active { transform: none; }
.btn-primary { background: var(--grad-accent); color: var(--on-accent); box-shadow: var(--shadow-btn); }
.btn-primary:is(:hover, .is-hover, :active) { background: var(--grad-accent-hover); color: var(--on-accent); }
.btn-ghost { background: var(--surface); color: var(--accent-dark); border: 1.5px solid var(--accent); }
.btn-ghost:is(:hover, .is-hover, :active) { background: var(--bg-panel); color: var(--accent-dark); }
.btn:is(:focus-visible, .is-focus) { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: var(--radius-pill); }
.btn:disabled, .btn:disabled:hover {
  transform: none;
  border: 1px solid var(--border);
  box-shadow: none;
  background: var(--bg-panel-2);
  color: var(--text-muted);
  cursor: not-allowed;
}

html.nav-open { overflow: hidden; }
.topbar { position: relative; z-index: 40; height: var(--nav-h); background: var(--bg); color: var(--text); }
.topbar-inner {
  max-width: min(100%, calc(1280px + var(--gutter) * 2));
  height: 100%;
  margin-inline: auto;
  padding-inline: var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(12px, 2vw, 32px);
}
.brand { display: inline-flex; align-items: center; gap: 10px; flex-shrink: 0; color: var(--text); text-decoration: none; }
.brand-mark { width: 32px; height: 32px; flex-shrink: 0; }
.brand-name { font-size: 17px; font-weight: 500; letter-spacing: -.01em; }
.mainnav { min-width: 0; margin-inline-start: auto; }
.mainnav ul { display: flex; align-items: center; gap: clamp(12px, 2vw, 30px); list-style: none; margin: 0; padding: 0; }
.mainnav a { display: block; padding-block: 6px; font-size: 15px; color: var(--text-muted); text-decoration: none; line-height: 1.25; }
.mainnav a:hover, .mainnav a[aria-current="page"] { color: var(--text); }
.mainnav a[aria-current="page"] { font-weight: 500; }
.header-tools { position: relative; display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.lang, .hamburger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text-muted);
  box-shadow: var(--shadow-chip);
  cursor: pointer;
}
.lang { min-height: 34px; padding-inline: 14px; font-size: 14px; white-space: nowrap; }
.lang:hover, .hamburger:hover { border-color: var(--border-strong); color: var(--text); }
.lang-caret { font-size: 11px; }
.lang-short, .hamburger, .nav-drawer, .nav-veil { display: none; }
.language-list, .nav-drawer ul, .footer-grid ul { list-style: none; padding: 0; margin: 0; }
.language-list {
  position: absolute;
  z-index: 3;
  inset-block-start: calc(100% + 6px);
  inset-inline-end: 0;
  min-width: 154px;
  max-width: calc(100vw - var(--gutter) * 2);
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: var(--radius-tile);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-card);
}
.language-list a, .nav-drawer a {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 44px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
}
:is(.language-list, .nav-drawer) a:is(:hover, [aria-current]) { background: var(--bg-panel); color: var(--text); }
.nav-drawer { position: absolute; inset: 100% 0 auto; z-index: 2; }
.nav-veil { position: fixed; inset: var(--nav-h) 0 0; z-index: 1; background: var(--veil); color: var(--text); }
.drawer-label { margin: 12px 14px 4px; color: var(--text-muted); font-size: .875rem; }

.site-footer {
  padding-block: clamp(36px, 6vw, 80px) 22px;
  border-top: 1px solid var(--border);
  background: var(--grad-panel);
  color: var(--text);
}
.footer-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1.4fr) minmax(0, .8fr); gap: clamp(20px, 4vw, 52px); }
.footer-grid h2 { font-size: 16px; margin-bottom: 12px; }
.footer-grid p { max-width: 34ch; margin-top: 12px; color: var(--text-muted); }
.footer-grid li + li { margin-top: 5px; }
.footer-grid a:not(.brand), .footer-end a { font-size: .875rem; }
.footer-end {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  justify-content: space-between;
  margin-top: 30px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: .875rem;
}

.reveal { transition: opacity var(--reveal-duration) ease, translate var(--reveal-duration) ease; }
.reveal.reveal-pending:not(.shown):not(:focus-within) { opacity: 0; translate: 0 8px; }

@media (max-width: 1024px) {
  .topbar:not(.topbar-preview) .mainnav { display: none; }
  .header-tools { margin-inline-start: auto; }
  .hamburger { display: inline-flex; min-width: 44px; min-height: 44px; }
  .nav-drawer {
    display: block;
    max-height: calc(100vh - var(--nav-h));
    max-height: calc(100dvh - var(--nav-h));
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 12px var(--gutter) 18px;
    border-block: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow-card);
  }
  .nav-veil { display: block; }
}
@media (max-width: 820px) {
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
  h1 { font-size: var(--title-mobile); }
  .brand-name { font-size: 16px; }
}
@media (max-width: 640px) {
  .tilt, .tilt:hover, [data-tilt] { transform: none !important; rotate: none !important; }
}
@media (max-width: 400px) {
  .lang-full { display: none; }
  .lang-short { display: inline; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal, .btn { transition: none; }
  .reveal.reveal-pending:not(.shown) { opacity: 1; translate: none; }
  .btn:hover { transform: none; }
}
@media (forced-colors: active) {
  .btn { border: 1px solid currentColor; }
}