:root {
  --bg: #FEFEFB;
  --bg-panel: #F6F5F1;
  --bg-panel-2: #EEEDE8;
  --border: #E3E1DA;
  --border-strong: #CBC8BF;
  --accent: #DD4B1A;
  --accent-dark: #B23A12;
  --accent-tint: rgba(221, 75, 26, .13);
  --text: #1F1C17;
  --text-muted: #625E55;
  --text-faint: #9A958B;
  --on-accent: #FFFFFF;
  --success: #2F8F5B;
  --warn: #B7791F;
  --error: #C2362B;
  --clear: transparent;
  --veil: rgba(31, 28, 23, .24);
  --field-a: #A9B8B4;
  --field-b: #D9C7B4;
  --field-c: rgba(198, 197, 196, .62);
  --field-glow: rgba(255, 255, 255, .30);
  --win-bg: #FAF9F6;
  --win-side: #F2F1ED;
  --win-chrome: #F4F3EF;
  --dialog-bg: #FFFFFF;
  --input-bg: #FFFFFF;
  --knob: #FFFFFF;
  --tl-red: #EC6A5E;
  --tl-yellow: #F4BF4F;
  --tl-green: #61C554;
  --tl-ring: rgba(31, 28, 23, .14);
  --shadow-dialog: 0 1px 2px rgba(31, 28, 23, .06), 0 8px 18px -6px rgba(31, 28, 23, .16);
  --shadow-knob: 0 1px 1px rgba(31, 28, 23, .18);
  --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;
  --font-editorial: ui-serif, "Songti SC", "STSong", "Noto Serif CJK SC", serif;
  --regular: 400;
  --medium: 500;
  --semibold: 600;
  --body-size: 16px;
  --small-size: 14px;
  --h1-size: clamp(34px, 2.25vw + 16px, 48px);
  --h2-size: clamp(24px, 1.4vw + 14px, 34px);
  --h3-size: clamp(19px, 1vw + 12px, 24px);
  --r: 6px;
  --r-sm: 4px;
  --r-mark: 2px;
  --r-switch: 8px;
  --r-icon: 9px;
  --r-round: 50%;
  --container: 1200px;
  --reading: 78ch;
  --gutter: 32px;
  --nav-h: 64px;
  --tap: 44px;
  --gap: 20px;
  --section: clamp(56px, 7vw, 96px);
  --line: 1px;
  --swift: .15s ease;
}

*, *::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(--bg);
  color: var(--text);
  font: var(--regular) var(--body-size)/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
[hidden] { display: none !important; }
img, svg { max-inline-size: 100%; }
img, svg, .dot { flex-shrink: 0; }
a { color: inherit; text-decoration: none; }
button, summary { cursor: pointer; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent-dark); outline-offset: 3px; }
a:focus-visible { border-radius: var(--r-sm); }
[id] { scroll-margin-block-start: 20px; }

.wrap {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
  min-width: 0;
}
.reading { max-width: calc(var(--reading) + var(--gutter) * 2); }
.section { padding-block: var(--section); }
.section-panel { background: var(--bg-panel); color: var(--text); }
.prose, .prose > *, .card-grid > *, .feature-grid > *, .footer-grid > * { min-width: 0; }
.prose :where(p, li, dd, blockquote), .card, .panel { overflow-wrap: anywhere; }
.prose :where(a:not(.btn)), .text-link { color: var(--accent-dark); text-decoration: underline; text-underline-offset: .2em; }
.prose :where(h2, h3) { margin-block-start: 1.6em; }
h1, h2, h3 {
  margin: 0 0 .55em;
  font-family: var(--font-display);
  font-weight: var(--regular);
  line-height: 1.2;
  letter-spacing: -.02em;
  text-wrap: balance;
}
h1 { font-size: var(--h1-size); }
h2 { font-size: var(--h2-size); }
h3 { font-size: var(--h3-size); }
p { margin: 0 0 1em; }
.nowrap { white-space: nowrap; }
.muted { color: var(--text-muted); }
.accent { color: var(--accent-dark); }
.mono, code, pre { font-family: var(--font-mono); }
code { overflow-wrap: anywhere; word-break: normal; }
pre {
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  padding: 14px;
  border: var(--line) solid var(--border);
  border-radius: var(--r);
  background: var(--bg-panel-2);
  color: var(--text);
  font-size: .875rem;
}
pre code { white-space: pre; }
.decor-clip { position: relative; overflow-x: clip; }
.decor-fill { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip-link { position: fixed; inset: 8px auto auto var(--gutter); z-index: 40; }
.skip-link:not(:focus) { clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; }

.action-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46px;
  max-width: 100%;
  padding: 8px 24px;
  border: var(--line) solid var(--border-strong);
  border-radius: var(--r);
  background: var(--bg);
  color: var(--text);
  font-size: var(--body-size);
  font-weight: var(--medium);
  line-height: 1.15;
  text-align: center;
  overflow-wrap: anywhere;
  transition: background-color var(--swift), border-color var(--swift), color var(--swift);
}
.btn svg { width: 17px; height: 17px; }
.btn-primary { background: var(--accent-dark); border-color: var(--accent-dark); color: var(--on-accent); }
.btn-primary:hover, .btn-demo-hover { background: var(--text); border-color: var(--text); color: var(--on-accent); }
.btn-ghost { background: var(--clear); border-color: var(--text); color: var(--text); }
.btn-ghost:hover, .btn-ghost:active { background: var(--bg-panel-2); color: var(--text); }
.btn-primary:active, .btn-demo-active { background: var(--text); color: var(--on-accent); box-shadow: inset 0 0 0 2px var(--border-strong); }
.btn-demo-focus { outline: 2px solid var(--accent-dark); outline-offset: 3px; }
.btn:disabled, .btn:disabled:hover { background: var(--bg-panel-2); border-color: var(--border); color: var(--text-muted); cursor: not-allowed; }

.topbar {
  position: relative;
  z-index: 30;
  background: var(--bg);
  color: var(--text);
  border-bottom: var(--line) solid var(--border);
}
.topbar-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  height: var(--nav-h);
  max-width: min(100%, calc(1280px + var(--gutter) * 2));
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  color: var(--text);
  font: var(--medium) 17px/1.2 var(--font-display);
  letter-spacing: -.01em;
}
.brand-mark { display: block; width: 30px; height: 30px; }
.desktop-nav { height: 100%; margin-inline-start: auto; min-width: 0; }
.tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 100%;
  list-style: none;
  margin: 0;
  padding: 0;
}
.tabs li { height: 100%; min-width: 0; }
.tabs a {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding-inline: 14px;
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.2;
  text-align: center;
}
.tabs a:hover, .tabs a[aria-current="page"] { color: var(--text); }
.tabs a[aria-current="page"]::after {
  position: absolute;
  inset: auto 14px -1px;
  height: 2px;
  background: var(--accent);
  color: var(--text);
  content: "";
}
.header-tools { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.locale-picker { position: relative; }
.lang, .nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 34px;
  padding-inline: 12px;
  border: var(--line) solid var(--border);
  border-radius: var(--r);
  background: var(--bg);
  color: var(--text);
  font-size: var(--small-size);
  white-space: nowrap;
}
.lang:hover, .nav-toggle:hover { border-color: var(--border-strong); }
.lang svg { width: 15px; height: 15px; color: var(--text-muted); }
.lang-short, .nav-toggle, .site-drawer, .preview-drawer { display: none; }
.locale-list, .site-drawer {
  background: var(--bg);
  color: var(--text);
  border: var(--line) solid var(--border);
}
.locale-list {
  position: absolute;
  z-index: 3;
  inset: calc(100% + 8px) 0 auto auto;
  min-width: 145px;
  max-height: calc(100dvh - var(--nav-h) - 12px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 5px;
  border-radius: var(--r);
}
.locale-list ul, .site-drawer ul, .preview-drawer ul, .site-footer ul { list-style: none; padding: 0; margin: 0; }
.locale-list a, .site-drawer a, .preview-drawer a {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: var(--tap);
  padding: 8px 12px;
  border-radius: var(--r-sm);
}
.locale-list a:hover, .site-drawer a:hover, .preview-drawer a:hover,
.locale-list a[aria-current], .site-drawer a[aria-current], .preview-drawer a[aria-current] {
  background: var(--bg-panel);
  color: var(--text);
}
.nav-veil { position: fixed; inset: 0; z-index: 1; background: var(--veil); color: var(--text); }
.topbar .site-drawer { z-index: 2; }

.site-footer {
  background: var(--bg-panel);
  color: var(--text);
  border-top: var(--line) solid var(--border);
  padding-block: 48px 24px;
}
.footer-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, .8fr) minmax(0, 1.1fr) minmax(0, .8fr); gap: 24px; }
.footer-grid p { margin-block: 12px 0; color: var(--text-muted); }
.footer-label { font-size: var(--body-size); margin-block-end: 10px; }
.site-footer li + li { margin-block-start: 6px; }
.site-footer li a, .footer-line { color: var(--text-muted); font-size: var(--small-size); overflow-wrap: anywhere; }
.site-footer a:hover { text-decoration: underline; text-underline-offset: .2em; }
.footer-line { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; margin-block-start: 32px; padding-block-start: 16px; border-top: var(--line) solid var(--border); }
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: var(--gap); }
.card, .panel {
  padding: clamp(14px, 2vw, 24px);
  border: var(--line) solid var(--border);
  border-radius: var(--r);
  background: var(--bg);
  color: var(--text);
}
.panel { background: var(--bg-panel); color: var(--text); }
.card:hover, .panel:hover { border-color: var(--border-strong); }
.card > :last-child, .panel > :last-child { margin-block-end: 0; }
.reveal { opacity: 1; }
.reveal-ready .reveal { transition: opacity .45s ease, transform .45s ease; }
.reveal-ready .reveal:not(.shown):not(:focus-within):not(:target) { opacity: 0; transform: translateY(8px); }

@media (max-width: 1040px) {
  .tabs a { padding-inline: 10px; }
  .tabs a[aria-current="page"]::after { inset-inline: 10px; }
  .topbar-inner { gap: 16px; }
}
@media (max-width: 960px) {
  :root { --gutter: 20px; }
  .desktop-nav { display: none; }
  .header-tools { margin-inline-start: auto; }
  .nav-toggle { display: inline-flex; min-width: var(--tap); min-height: var(--tap); padding-inline: 8px; }
  .nav-toggle svg { width: 20px; height: 20px; }
  .site-drawer, .preview-drawer nav {
    display: block;
    position: absolute;
    inset: var(--nav-h) 0 auto;
    max-height: calc(100vh - var(--nav-h));
    max-height: calc(100dvh - var(--nav-h));
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 10px var(--gutter) 16px;
    border-bottom: var(--line) solid var(--border);
    background: var(--bg);
    color: var(--text);
  }
  .site-drawer .drawer-locales, .preview-drawer .drawer-locales { border-top: var(--line) solid var(--border); margin-block-start: 8px; padding-block-start: 8px; }
  .preview-drawer { display: block; }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
  :root { --h1-size: clamp(24px, 3.9vw, 30px); }
}
@media (max-width: 640px) {
  :root { --gutter: 16px; }
  .tilt, .tilt-demo, .auth { transform: none; }
  .topbar-inner { gap: 8px; }
  .header-tools { gap: 6px; }
  .lang-full { display: none; }
  .lang-short { display: inline; }
  .lang { min-height: var(--tap); padding-inline: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal-ready .reveal { transition: none; }
  .reveal-ready .reveal:not(.shown):not(:focus-within):not(:target) { opacity: 1; transform: none; }
  .btn { transition: none; }
}