:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-alt: #f0f2f8;
  --surface-raised: #fbfcfe;
  --ink: #172033;
  --muted: #5f6b83;
  --muted-strong: #8a93a6;
  --line: #e3e7f0;
  --accent: #4f46e5;
  --accent-dark: #3f37c9;
  --accent-soft: #eef0ff;
  --accent-hover: #e3e6ff;
  --accent-border: #c9cdf8;
  --on-accent: #ffffff;
  --cyan: #0891b2;
  --hero-glow-cyan: rgba(8, 145, 178, 0.14);
  --hero-glow-accent: rgba(79, 70, 229, 0.12);
  --dot-idle: #d9deea;
  --code-bg: #111827;
  --code-bg-alt: #14213d;
  --code-text: #dbe4f5;
  --code-text-alt: #a5f3d0;
  --inline-code-bg: #eef0f6;
  --inline-code-text: #3730a3;
  --warning-bg: #fff8ed;
  --warning-border: #fde3b8;
  --warning-text: #8a5b10;
  --footer-bg: #0d1321;
  --footer-text: #cbd5e1;
  --footer-muted: #94a3b8;
  --footer-faint: #64748b;
  --footer-line: rgba(148, 163, 184, 0.18);
  --header-bg: rgba(246, 247, 251, 0.88);
  --shadow-sm: 0 1px 2px rgba(23, 32, 51, 0.06);
  --shadow-md: 0 12px 32px rgba(23, 32, 51, 0.08);
  --shadow-lg: 0 24px 60px rgba(23, 32, 51, 0.12);
  --radius: 18px;
}

[data-theme="dark"] {
  --bg: #0b1020;
  --surface: #121a2e;
  --surface-alt: #0f1628;
  --surface-raised: #17203a;
  --ink: #e6ebf5;
  --muted: #9aa7bd;
  --muted-strong: #7c8aa3;
  --line: #26324a;
  --accent: #a5b4fc;
  --accent-dark: #818cf8;
  --accent-soft: #1e2a4a;
  --accent-hover: #2a3a63;
  --accent-border: #334155;
  --on-accent: #0b1020;
  --cyan: #22d3ee;
  --hero-glow-cyan: rgba(34, 211, 238, 0.1);
  --hero-glow-accent: rgba(129, 140, 248, 0.12);
  --dot-idle: #3b4760;
  --code-bg: #060b16;
  --code-bg-alt: #0d1b34;
  --inline-code-bg: #1e2a4a;
  --inline-code-text: #c7d2fe;
  --warning-bg: #3a2a0e;
  --warning-border: #6b4a13;
  --warning-text: #fcd34d;
  --footer-bg: #070c17;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.45);
  --header-bg: rgba(11, 16, 32, 0.88);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font: inherit; }
h1, h2, h3, p, figure { margin: 0; }
h1, h2, h3 { line-height: 1.25; letter-spacing: -0.01em; }

:focus-visible {
  outline: 3px solid rgba(79, 70, 229, 0.45);
  outline-offset: 3px;
  border-radius: 4px;
}

.container {
  width: min(1160px, calc(100% - 48px));
  margin-inline: auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  min-height: 72px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand-mark { width: 32px; height: 32px; border-radius: 9px; }
.brand-name { font-size: 19px; font-weight: 800; letter-spacing: 0.06em; }

.site-nav { display: flex; align-items: center; gap: 26px; margin-left: auto; }
.nav-link { color: var(--muted); font-size: 15px; font-weight: 600; transition: color 0.2s; }
.nav-link:hover, .nav-link.is-current { color: var(--accent); }

.nav-toggle {
  display: none;
  margin-left: auto;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  cursor: pointer;
  padding: 10px;
}

.nav-toggle span { display: block; height: 2px; background: var(--ink); border-radius: 2px; margin: 3px 0; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 20px;
  border-radius: 11px;
  font-size: 15px;
  font-weight: 700;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}

.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--accent); color: var(--on-accent); box-shadow: 0 8px 20px rgba(79, 70, 229, 0.25); }
.btn-primary:hover { background: var(--accent-dark); box-shadow: 0 12px 26px rgba(79, 70, 229, 0.32); }
.btn-secondary { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.btn-secondary:hover { box-shadow: var(--shadow-md); }
.btn-sm { min-height: 40px; padding: 0 16px; font-size: 14px; }

.text-link, .inline-link { color: var(--accent); font-weight: 700; font-size: 14px; }
.text-link:hover, .inline-link:hover { text-decoration: underline; }
.download-link { display: inline-block; margin-top: 8px; }
.download-link::after { content: " ↓"; }

/* Hero */
.hero {
  position: relative;
  overflow: hidden;
  padding: 92px 0 88px;
  background:
    radial-gradient(circle at 82% 12%, var(--hero-glow-cyan), transparent 34%),
    radial-gradient(circle at 12% 85%, var(--hero-glow-accent), transparent 38%),
    var(--bg);
}

.hero-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 72px; align-items: center; }
.eyebrow, .section-kicker {
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.hero h1 { font-size: clamp(38px, 4.6vw, 60px); font-weight: 800; letter-spacing: -0.03em; }
.hero h1 span { display: block; }
.accent-text {
  background: linear-gradient(100deg, var(--accent), var(--cyan));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-desc { max-width: 540px; margin-top: 22px; color: var(--muted); font-size: 18px; }
.hero-note { margin-top: 18px; color: var(--muted-strong); font-size: 13px; }

.hero-demo { position: relative; }
.demo-window {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  padding: 0 24px 24px;
  overflow: hidden;
}

.demo-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 -24px 22px;
  padding: 14px 20px;
  background: var(--surface-raised);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.window-dots { display: flex; gap: 6px; }
.window-dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--dot-idle); }
.window-dots i:first-child { background: #fb7185; }
.window-dots i:nth-child(2) { background: #fbbf24; }
.window-dots i:last-child { background: #34d399; }

.demo-options { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.demo-option {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  padding: 6px 11px;
  border-radius: 999px;
  cursor: pointer;
}
.demo-option.is-active { background: var(--accent-soft); border-color: var(--accent-border); color: var(--accent); }

.demo-warning { text-decoration: underline wavy #f59e0b 1px; text-underline-offset: 4px; text-decoration-skip-ink: none; }
.demo-code pre, .code-wrap pre {
  margin: 0;
  background: var(--code-bg);
  color: var(--code-text);
  border-radius: 12px;
  padding: 18px;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.8;
}
.demo-code pre code, .code-wrap code { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; }
.demo-code--after pre { background: var(--code-bg-alt); color: var(--code-text-alt); }
.demo-arrow { display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--accent); font-size: 12px; font-weight: 700; padding: 12px 0; }
.demo-caption { margin-top: 16px; color: var(--muted); font-size: 12px; text-align: center; }

/* Sections */
.section { padding: 88px 0; }
.section--muted { background: var(--surface-alt); border-block: 1px solid var(--line); }
.section-head { max-width: 660px; margin: 0 auto 44px; text-align: center; }
.section-head h2 { font-size: clamp(28px, 3vw, 38px); font-weight: 800; }
.section-head > p:last-child { margin-top: 12px; color: var(--muted); }

.product-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.product-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s, box-shadow 0.25s;
  display: flex;
  flex-direction: column;
}
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.product-card-top { display: flex; gap: 14px; align-items: flex-start; }
.product-card-top h3 { font-size: 19px; overflow-wrap: anywhere; }
.product-kind { color: var(--muted); font-size: 13px; margin-top: 2px; }
.product-logo {
  width: 44px; height: 44px; flex-shrink: 0;
  object-fit: contain;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.product-desc { margin-top: 20px; color: var(--muted); }
.check-list { list-style: none; padding: 0; margin: 20px 0 26px; display: grid; gap: 10px; }
.check-list li { position: relative; padding-left: 24px; font-size: 14px; }
.check-list li::before { content: "✓"; position: absolute; left: 0; top: 0; color: var(--accent); font-weight: 800; }
.product-actions { display: flex; align-items: center; gap: 20px; margin-top: auto; }

.feature-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.feature-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 26px;
  box-shadow: var(--shadow-sm);
}
.feature-icon { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); font-size: 13px; font-weight: 800; }
.feature-card h3 { margin-top: 16px; font-size: 18px; }
.feature-card p { margin-top: 8px; color: var(--muted); font-size: 14px; }

.doc-faq { display: grid; gap: 10px; }
.doc-faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 0 20px; }
.doc-faq summary { cursor: pointer; font-weight: 700; font-size: 15px; padding: 16px 0; list-style: none; }
.doc-faq summary::-webkit-details-marker { display: none; }
.doc-faq summary::after { content: "+"; float: right; color: var(--accent); font-weight: 800; }
details[open] summary::after { content: "−"; }
.doc-faq p { color: var(--muted); font-size: 14px; padding-bottom: 18px; }

/* Footer */
.site-footer { background: var(--footer-bg); color: var(--footer-text); padding-top: 56px; }
.footer-inner { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 48px; padding-bottom: 44px; }
.footer-brand .brand-name { color: var(--footer-text); font-size: 21px; }
.footer-brand p { margin-top: 10px; color: var(--footer-muted); font-size: 14px; }
.footer-col { display: grid; gap: 10px; align-content: start; }
.footer-col h3 { color: var(--footer-text); font-size: 14px; margin-bottom: 4px; }
.footer-col a { color: var(--footer-muted); font-size: 14px; }
.footer-col a:hover { color: var(--footer-text); }
.footer-bottom { border-top: 1px solid var(--footer-line); padding: 20px 0 28px; display: flex; justify-content: space-between; gap: 16px; color: var(--footer-faint); font-size: 13px; }
.footer-bottom-right { display: flex; align-items: center; gap: 20px; }

.theme-toggle {
  display: inline-flex; align-items: center; gap: 8px;
  background: transparent; border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 8px; color: var(--footer-text);
  font-size: 13px; padding: 6px 11px; cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.theme-toggle:hover { border-color: rgba(148, 163, 184, 0.7); background: rgba(255, 255, 255, 0.05); }
.theme-icon { width: 14px; height: 14px; }
[data-theme="light"] .theme-icon--moon, [data-theme="dark"] .theme-icon--sun { display: none; }

.lang-picker { position: relative; }
.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 8px;
  color: var(--footer-text);
  font-size: 13px;
  padding: 6px 11px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.lang-toggle:hover, .lang-toggle[aria-expanded="true"] { color: var(--footer-text); border-color: rgba(148, 163, 184, 0.7); background: rgba(255, 255, 255, 0.05); }
.lang-chevron { width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg) translateY(-2px); transition: transform 0.2s; }
.lang-toggle[aria-expanded="true"] .lang-chevron { transform: rotate(225deg) translateY(-2px); }

.lang-popup {
  display: none;
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  min-width: 164px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  z-index: 60;
}
.lang-popup.is-open { display: grid; gap: 4px; }
.lang-popup button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.lang-popup button:hover { background: var(--accent-soft); color: var(--accent); }
.lang-popup button.is-active { background: var(--accent-soft); color: var(--accent); font-weight: 700; box-shadow: inset 0 0 0 1px var(--accent-border); }
.lang-popup button.is-active::after { content: "✓"; font-weight: 800; }

/* Docs */
.docs-page { padding: 56px 0 96px; }
.page-head { margin-bottom: 40px; }
.page-head-title { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.title-spacer { flex: 1 1 24px; }
.page-head h1 { font-size: clamp(32px, 4vw, 46px); font-weight: 800; }
.product-select-wrap { position: relative; display: inline-flex; align-items: center; color: var(--accent); }
.product-select-wrap::after {
  content: "";
  position: absolute;
  right: 14px;
  width: 6px; height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  pointer-events: none;
  transition: transform 0.2s;
}
.product-select-wrap.is-open::after { transform: rotate(225deg) translateY(-2px); }
.product-select {
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  border-radius: 999px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  padding: 7px 34px 7px 14px;
  cursor: pointer;
}
.product-select:hover, .product-select-wrap.is-open .product-select { background: var(--accent-hover); border-color: var(--accent-border); }

.product-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  z-index: 60;
}
.product-menu.is-open { display: grid; gap: 4px; }
.product-menu button {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; border: 0; background: transparent;
  color: var(--muted); font-size: 13px; font-weight: 600; text-align: left;
  white-space: nowrap;
  padding: 8px 12px; border-radius: 999px; cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.product-menu button:hover { background: var(--accent-soft); color: var(--accent); }
.product-menu button[aria-selected="true"] { background: var(--accent-soft); color: var(--accent); font-weight: 700; box-shadow: inset 0 0 0 1px var(--accent-border); }
.product-menu button[aria-selected="true"]::after { content: "✓"; font-weight: 800; }
.page-head p:last-child { margin-top: 12px; color: var(--muted); max-width: 680px; }

.docs-layout { display: grid; grid-template-columns: 248px minmax(0, 1fr); gap: 40px; align-items: start; }
.docs-sidebar { position: sticky; top: 96px; }
.sidebar-label { color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 12px; }

.docs-toc { margin-top: 24px; display: grid; gap: 2px; }
.docs-toc .sidebar-label { margin-bottom: 8px; }
.toc-link { color: var(--muted); font-size: 14px; padding: 8px 12px; border-radius: 9px; border-left: 2px solid transparent; }
.toc-link:hover { color: var(--accent); background: var(--accent-soft); }
.toc-link.is-active { color: var(--accent); background: var(--accent-soft); border-left-color: var(--accent); font-weight: 700; }

.docs-sections { display: grid; gap: 20px; min-width: 0; }
.doc-section {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 18px; padding: 32px;
  box-shadow: var(--shadow-sm); scroll-margin-top: 96px;
}
.doc-section h2 { font-size: 25px; margin-bottom: 12px; }
.doc-section > p { color: var(--muted); font-size: 15px; margin-bottom: 14px; }
.doc-section ol { padding-left: 22px; color: var(--muted); font-size: 15px; display: grid; gap: 8px; margin-bottom: 16px; }
.doc-section li::marker { color: var(--accent); font-weight: 800; }
.doc-panel { margin: 18px 0; }
.doc-panel > p { color: var(--muted); font-size: 15px; margin: 10px 0; }
.doc-note { color: var(--muted); font-size: 14px; background: var(--surface-alt); border-left: 3px solid var(--accent); padding: 10px 14px; border-radius: 0 8px 8px 0; }

.doc-steps { display: grid; gap: 10px; margin: 18px 0; }
.doc-steps > div { display: flex; gap: 14px; align-items: center; color: var(--muted); font-size: 15px; }
.doc-steps span { width: 26px; height: 26px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; background: var(--accent-soft); color: var(--accent); border-radius: 50%; font-size: 12px; font-weight: 800; }
.doc-steps p { margin: 0; }

.doc-figure { margin: 20px 0; }
.doc-figure img { width: 100%; border: 1px solid var(--line); border-radius: 12px; }
.doc-figure figcaption { color: var(--muted); font-size: 13px; margin-top: 8px; text-align: center; }

.callout { display: flex; gap: 12px; align-items: flex-start; margin-top: 20px; background: var(--warning-bg); border: 1px solid var(--warning-border); border-radius: 12px; padding: 14px 16px; color: var(--warning-text); font-size: 14px; }
.callout span { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; flex-shrink: 0; border-radius: 50%; background: #f59e0b; color: #fff; font-weight: 800; }

.glyph-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 18px 0; }
.glyph-card { border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: grid; gap: 6px; }
.glyph-card strong { font-size: 15px; }
.glyph-card span { color: var(--muted); font-size: 13px; }

.code-wrap { position: relative; margin: 14px 0; }
.code-wrap pre { padding-top: 44px; }
.copy-btn { position: absolute; top: 10px; right: 10px; z-index: 1; background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.16); color: #e2e8f0; font-size: 12px; padding: 4px 10px; border-radius: 7px; cursor: pointer; }
.copy-btn:hover { background: rgba(255, 255, 255, 0.2); }

.doc-section code { font-family: "SFMono-Regular", Consolas, monospace; font-size: 0.9em; background: var(--inline-code-bg); color: var(--inline-code-text); padding: 2px 6px; border-radius: 5px; }
.code-wrap code { background: none; color: inherit; padding: 0; }
.doc-help { text-align: left; }
.doc-help .btn { margin-top: 10px; }

/* Responsive */
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; gap: 48px; }
  .hero-copy { text-align: center; }
  .hero-desc { margin-inline: auto; }
  .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .docs-layout { grid-template-columns: 1fr; gap: 24px; }
  .docs-sidebar { position: static; }
  .docs-toc { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; }
  .docs-toc .sidebar-label { display: none; }
  .toc-link { white-space: nowrap; border-left: 0; border-bottom: 2px solid transparent; }
  .toc-link.is-active { border-left: 0; border-bottom-color: var(--accent); }
}

@media (max-width: 720px) {
  .container { width: min(100% - 32px, 1160px); }
  .nav-toggle { display: block; }
  .site-nav { display: none; position: absolute; top: 72px; left: 0; right: 0; background: var(--surface); border-bottom: 1px solid var(--line); padding: 12px 16px; margin: 0; flex-direction: column; gap: 4px; align-items: stretch; box-shadow: var(--shadow-md); }
  .site-nav.is-open { display: flex; }
  .nav-link { padding: 10px 12px; border-radius: 8px; }
  .nav-link:hover, .nav-link.is-current { background: var(--accent-soft); }
  .section { padding: 64px 0; }
  .product-grid, .feature-grid, .glyph-grid { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr 1fr; gap: 28px; }
  .footer-brand { grid-column: 1 / -1; }
  .doc-section { padding: 24px 20px; }
  .page-head { margin-bottom: 28px; }
}

@media (max-width: 420px) {
  .header-inner { gap: 10px; }
  .hero { padding: 64px 0; }
  .hero h1 { font-size: 36px; }
  .hero-desc { font-size: 16px; }
  .footer-inner { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
  .footer-bottom-right { flex-wrap: wrap; gap: 12px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
