:root {
  color-scheme: dark;
  --bg: #07101d;
  --surface: rgba(12, 27, 45, 0.82);
  --surface-strong: #0d1b2d;
  --surface-soft: #10243a;
  --border: rgba(144, 176, 211, 0.16);
  --border-strong: rgba(144, 176, 211, 0.29);
  --text: #eef5ff;
  --muted: #98aac1;
  --faint: #6e8299;
  --primary: #53d7b4;
  --primary-dark: #061a15;
  --primary-soft: rgba(83, 215, 180, 0.11);
  --blue: #65a8ff;
  --amber: #f6bd62;
  --danger: #ff7f89;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.36);
  --radius-lg: 28px;
  --radius-md: 18px;
  --shell: min(1180px, calc(100vw - 40px));
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  min-width: 320px;
  margin: 0;
  background:
    radial-gradient(circle at 12% -8%, rgba(48, 110, 182, 0.22), transparent 34rem),
    radial-gradient(circle at 98% 18%, rgba(34, 178, 144, 0.13), transparent 30rem),
    var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 46px 46px;
  content: "";
  mask-image: linear-gradient(to bottom, black, transparent 84%);
  pointer-events: none;
}
a { color: inherit; text-decoration: none; }
button, textarea { font: inherit; }
button { color: inherit; }
code, pre { font-family: var(--mono); }
.shell { width: var(--shell); margin-inline: auto; }
.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;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--primary);
  color: var(--primary-dark);
  font-weight: 800;
  transform: translateY(-160%);
  transition: transform 180ms ease;
}
.skip-link:focus { transform: translateY(0); }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid transparent;
  background: rgba(7, 16, 29, 0.76);
  backdrop-filter: blur(18px);
}
.site-header.scrolled { border-color: var(--border); }
.nav {
  display: flex;
  min-height: 76px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand { display: inline-flex; align-items: center; gap: 12px; }
.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(83, 215, 180, 0.42);
  border-radius: 13px;
  background: linear-gradient(145deg, rgba(83, 215, 180, 0.2), rgba(101, 168, 255, 0.09));
  color: var(--primary);
  font: 900 0.76rem var(--mono);
  letter-spacing: 0.08em;
}
.brand-copy strong, .brand-copy small { display: block; }
.brand-copy strong { font-size: 0.95rem; letter-spacing: -0.01em; }
.brand-copy small { color: var(--muted); font-size: 0.7rem; }
.nav-actions { display: flex; align-items: center; gap: 12px; }
.nav-links { display: flex; align-items: center; gap: 25px; color: var(--muted); font-size: 0.87rem; }
.nav-links a { transition: color 160ms ease; }
.nav-links a:hover, .nav-links a:focus-visible { color: var(--text); }
.nav-github {
  padding: 8px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text) !important;
}
.language-toggle {
  display: grid;
  min-width: 54px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 750;
  cursor: pointer;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease;
}
.language-toggle:hover { border-color: rgba(83, 215, 180, 0.45); color: var(--primary); }
.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface);
  cursor: pointer;
}

.hero { position: relative; overflow: hidden; padding: 86px 0 74px; }
.hero-orbit {
  position: absolute;
  border-radius: 50%;
  filter: blur(22px);
  pointer-events: none;
}
.hero-orbit-one { top: 6%; left: -14rem; width: 34rem; height: 34rem; background: rgba(49, 120, 190, 0.13); }
.hero-orbit-two { right: -15rem; bottom: -16rem; width: 42rem; height: 42rem; background: rgba(43, 192, 154, 0.1); }
.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 0.94fr) minmax(470px, 1.06fr);
  align-items: center;
  gap: 58px;
}
.eyebrow, .section-kicker {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--primary);
  font-size: 0.73rem;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 5px rgba(83, 215, 180, 0.11);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 50% { box-shadow: 0 0 0 9px rgba(83, 215, 180, 0.025); opacity: 0.78; } }
h1, h2, h3, p { margin-top: 0; }
h1 {
  max-width: 730px;
  margin: 20px 0 22px;
  font-size: clamp(3.1rem, 6vw, 5.45rem);
  line-height: 0.98;
  letter-spacing: -0.06em;
}
html[data-lang="zh"] h1 { font-size: clamp(2.8rem, 5.3vw, 4.7rem); line-height: 1.05; }
.hero-lead { max-width: 650px; margin-bottom: 30px; color: #b4c4d8; font-size: clamp(1rem, 1.7vw, 1.16rem); }
.hero-actions, .cta-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 14px;
  font-size: 0.91rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}
.button:hover { transform: translateY(-2px); }
.button-primary { background: linear-gradient(135deg, var(--primary), #79e5c9); color: var(--primary-dark); box-shadow: 0 12px 32px rgba(43, 192, 154, 0.16); }
.button-secondary { border-color: var(--border-strong); background: rgba(255, 255, 255, 0.035); color: var(--text); }
.button-block { width: 100%; }
.hero-points { display: flex; flex-wrap: wrap; gap: 15px 21px; padding: 0; margin: 28px 0 0; color: var(--muted); font-size: 0.82rem; list-style: none; }
.hero-points li::before { margin-right: 7px; color: var(--primary); content: "✓"; }
.hero-preview { position: relative; }
.preview-frame {
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--surface-strong);
  box-shadow: var(--shadow);
}
.preview-frame img { display: block; width: 100%; height: auto; }
.preview-caption {
  position: absolute;
  right: 18px;
  bottom: -16px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: rgba(10, 24, 40, 0.94);
  color: var(--muted);
  font: 0.68rem var(--mono);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.25);
}
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 4px rgba(83, 215, 180, 0.1); }

.stats-strip { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); background: rgba(10, 23, 39, 0.48); }
.stats-grid { display: grid; grid-template-columns: repeat(5, 1fr); }
.stats-grid div { padding: 21px 12px; border-right: 1px solid var(--border); text-align: center; }
.stats-grid div:last-child { border-right: 0; }
.stats-grid strong, .stats-grid span { display: block; }
.stats-grid strong { font-size: 1.45rem; line-height: 1.2; }
.stats-grid span { margin-top: 3px; color: var(--faint); font-size: 0.74rem; }

.section { padding-top: 104px; }
.section-heading { max-width: 720px; margin-bottom: 38px; }
.section-heading h2, .cta-panel h2 { margin: 10px 0 12px; font-size: clamp(2rem, 4vw, 3.12rem); line-height: 1.08; letter-spacing: -0.045em; }
.section-heading p { max-width: 650px; margin-bottom: 0; color: var(--muted); }
.flow-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.flow-card {
  min-height: 202px;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(13, 28, 47, 0.7);
}
.flow-card.featured { border-color: rgba(83, 215, 180, 0.36); background: rgba(83, 215, 180, 0.07); }
.flow-index { color: var(--faint); font: 0.68rem var(--mono); }
.flow-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  margin-top: 18px;
  border-radius: 12px;
  background: var(--primary-soft);
  color: var(--primary);
  font: 800 0.9rem var(--mono);
}
.flow-card h3 { margin: 15px 0 8px; font-size: 1rem; }
.flow-card p { margin: 0; color: var(--muted); font-size: 0.8rem; }
.routing-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 18px; }
.routing-card { padding: 20px; border: 1px solid var(--border); border-radius: var(--radius-md); background: rgba(13, 28, 47, 0.54); }
.routing-code { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 10px; background: var(--primary-soft); color: var(--primary); font: 800 0.74rem var(--mono); }
.routing-card h3 { margin: 15px 0 8px; font: 700 0.8rem var(--mono); }
.routing-card p { margin: 0; color: var(--muted); font-size: 0.73rem; line-height: 1.7; }

.quick-layout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(340px, 0.8fr); gap: 18px; }
.quick-primary, .mini-step {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.13);
}
.quick-primary { border-color: rgba(83, 215, 180, 0.23); background: linear-gradient(145deg, rgba(83, 215, 180, 0.07), transparent 50%), var(--surface); }
.quick-label { margin-bottom: 16px; color: var(--primary); font-size: 0.71rem; font-weight: 850; letter-spacing: 0.1em; text-transform: uppercase; }
.quick-side { display: grid; gap: 18px; }
.mini-step { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 14px; padding: 20px; }
.mini-step > span { color: var(--primary); font: 800 0.72rem var(--mono); }
.mini-step h3 { margin: 0 0 12px; font-size: 0.96rem; }
.code-shell { overflow: hidden; border: 1px solid var(--border); border-radius: 14px; background: #071321; }
.code-toolbar {
  display: flex;
  min-height: 40px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 12px;
  border-bottom: 1px solid var(--border);
  color: var(--faint);
  font: 0.66rem var(--mono);
}
.copy-button {
  padding: 5px 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  font-size: 0.66rem;
  cursor: pointer;
}
.copy-button:hover { border-color: rgba(83, 215, 180, 0.36); color: var(--primary); }
pre { max-height: 360px; padding: 17px; margin: 0; overflow: auto; color: #c7d6e7; font-size: 0.73rem; line-height: 1.65; white-space: pre-wrap; word-break: break-word; }
.compact pre { max-height: 210px; }
.usage-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 26px;
  margin-top: 18px;
  padding: 26px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(11, 23, 39, 0.7);
}
.usage-banner h3 { margin: 8px 0 6px; font-size: 1.28rem; }
.usage-banner p { margin: 0; color: var(--muted); font-size: 0.85rem; }
.usage-chips { display: flex; flex-wrap: wrap; gap: 9px; justify-content: flex-end; }
.usage-chips button, .sample-row button {
  padding: 9px 13px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  font-size: 0.75rem;
  cursor: pointer;
  transition: border-color 160ms ease, color 160ms ease, transform 160ms ease;
}
.usage-chips button:hover, .sample-row button:hover { border-color: rgba(83, 215, 180, 0.46); color: var(--text); transform: translateY(-1px); }

.demo-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.92fr);
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.demo-input, .demo-output { padding: 28px; }
.demo-input { border-right: 1px solid var(--border); }
.demo-input label { display: block; margin-bottom: 10px; color: var(--muted); font-size: 0.76rem; font-weight: 800; letter-spacing: 0.04em; }
textarea {
  width: 100%;
  min-height: 174px;
  padding: 16px;
  resize: vertical;
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  outline: none;
  background: #071321;
  color: var(--text);
  line-height: 1.65;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
textarea:focus { border-color: rgba(83, 215, 180, 0.6); box-shadow: 0 0 0 4px rgba(83, 215, 180, 0.08); }
.sample-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 18px; }
.sample-row button { padding: 7px 10px; font-size: 0.69rem; }
.demo-note { margin: 12px 0 0; color: var(--faint); font-size: 0.69rem; text-align: center; }
.demo-output { background: linear-gradient(160deg, rgba(83, 215, 180, 0.065), transparent 52%), rgba(7, 19, 33, 0.72); }
.output-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding-bottom: 18px; border-bottom: 1px solid var(--border); }
.output-label, .output-header small { display: block; }
.output-label { color: var(--primary); font: 700 0.7rem var(--mono); }
.output-header small { margin-top: 4px; color: var(--faint); font: 0.61rem var(--mono); }
.output-status { padding: 5px 8px; border: 1px solid rgba(101, 168, 255, 0.27); border-radius: 999px; color: var(--blue); font: 0.59rem var(--mono); }
.output-fields { padding-top: 10px; margin: 0; }
.output-fields div { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 8px 0; border-bottom: 1px solid rgba(151, 183, 219, 0.09); }
.output-fields div:last-child { border-bottom: 0; }
.output-fields dt { color: var(--muted); font: 0.77rem var(--mono); }
.output-fields dd { margin: 0; color: var(--primary); font: 700 0.77rem var(--mono); }
.confidence { margin-top: 22px; }
.confidence > div:first-child { display: flex; justify-content: space-between; margin-bottom: 8px; color: var(--muted); font-size: 0.71rem; }
.confidence strong { color: var(--text); font-family: var(--mono); }
.confidence-track { height: 7px; overflow: hidden; border-radius: 999px; background: rgba(151, 183, 219, 0.12); }
.confidence-track span { display: block; width: 72%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--blue), var(--primary)); transition: width 320ms ease; }
.rationale { margin: 20px 0 0; padding: 13px 14px; border-left: 2px solid var(--primary); background: rgba(83, 215, 180, 0.045); color: var(--muted); font-size: 0.76rem; }

.docs-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.doc-card {
  display: flex;
  min-height: 242px;
  flex-direction: column;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}
.doc-card:hover { border-color: rgba(83, 215, 180, 0.32); background: rgba(16, 34, 55, 0.92); transform: translateY(-4px); }
.doc-card > span { color: var(--primary); font-size: 0.68rem; font-weight: 850; letter-spacing: 0.1em; }
.doc-card h3 { margin: 22px 0 10px; font-size: 1.07rem; }
.doc-card p { color: var(--muted); font-size: 0.82rem; }
.doc-card strong { margin-top: auto; color: var(--primary); font-size: 0.78rem; }
.cta-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  padding: 34px;
  border: 1px solid rgba(83, 215, 180, 0.24);
  border-radius: var(--radius-lg);
  background: linear-gradient(120deg, rgba(83, 215, 180, 0.11), transparent 56%), rgba(13, 28, 47, 0.84);
  box-shadow: var(--shadow);
}
.cta-panel h2 { max-width: 720px; margin-bottom: 0; }

.site-footer { margin-top: 110px; padding: 34px 0; border-top: 1px solid var(--border); background: rgba(5, 13, 24, 0.72); }
.footer-grid { display: flex; align-items: center; justify-content: space-between; gap: 30px; }
.site-footer strong { font-size: 0.86rem; }
.site-footer p { margin: 6px 0 0; color: var(--faint); font-size: 0.7rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 18px; color: var(--muted); font-size: 0.75rem; }
.footer-links a:hover { color: var(--primary); }

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 80;
  padding: 11px 15px;
  border: 1px solid rgba(83, 215, 180, 0.3);
  border-radius: 12px;
  background: #10243a;
  color: var(--text);
  font-size: 0.76rem;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}
.toast.visible { opacity: 1; transform: translateY(0); }
.reveal { opacity: 1; transform: none; }

@media (max-width: 1040px) {
  .hero-grid, .quick-layout, .demo-shell { grid-template-columns: 1fr; }
  .hero-grid { gap: 46px; }
  .hero-preview { max-width: 880px; }
  .demo-input { border-right: 0; border-bottom: 1px solid var(--border); }
  .flow-grid, .routing-grid { grid-template-columns: repeat(2, 1fr); }
  .usage-banner { align-items: flex-start; flex-direction: column; }
  .usage-chips { justify-content: flex-start; }
  .docs-grid { grid-template-columns: 1fr; }
  .doc-card { min-height: 205px; }
}
@media (max-width: 800px) {
  :root { --shell: min(100% - 28px, 1180px); }
  .nav { min-height: 68px; }
  .nav-toggle { display: grid; place-items: center; }
  .nav-links {
    position: absolute;
    top: 68px;
    right: 14px;
    left: 14px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 10px;
    border: 1px solid var(--border-strong);
    border-radius: 16px;
    background: #0b1829;
    box-shadow: var(--shadow);
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 11px 12px; border-radius: 10px; }
  .nav-links a:hover { background: rgba(255, 255, 255, 0.04); }
  .nav-github { margin-top: 5px; text-align: center; }
  .hero { padding-top: 62px; }
  h1 { font-size: clamp(2.75rem, 12.5vw, 4.5rem); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-grid div { border-bottom: 1px solid var(--border); }
  .stats-grid div:nth-child(even) { border-right: 0; }
  .stats-grid div:last-child { grid-column: 1 / -1; border-bottom: 0; }
  .section { padding-top: 82px; }
  .cta-panel, .footer-grid { align-items: flex-start; flex-direction: column; }
  .cta-actions { width: 100%; }
  .cta-actions .button { flex: 1; }
}
@media (max-width: 560px) {
  .brand-copy small { display: none; }
  .hero-actions .button { width: 100%; }
  .hero-points { display: grid; gap: 8px; }
  .quick-primary, .mini-step, .demo-input, .demo-output, .usage-banner, .cta-panel { padding: 20px; }
  .flow-grid, .routing-grid { grid-template-columns: 1fr; }
  .flow-card { min-height: 0; }
  .preview-caption { right: 10px; }
  .cta-actions { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
