:root {
  --bg-primary: #090d16;
  --bg-secondary: #0f172a;
  --bg-surface: #111a2e;
  --bg-card: #141e33;
  --bg-input: #1e293b;
  --border: #1e293b;
  --border-light: rgba(255, 255, 255, 0.08);
  --border-focus: #38bdf8;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent: #38bdf8;
  --accent-hover: #7dd3fc;
  --accent-rgb: 56, 189, 248;
  --rose: #f43f5e;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --error: #ef4444;
  --code-bg: #090e17;
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --radius: 12px;
  --radius-sm: 6px;
  --shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
}

[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-secondary: #f1f5f9;
  --bg-surface: #f1f5f9;
  --bg-card: #ffffff;
  --bg-input: #ffffff;
  --border: #e2e8f0;
  --border-light: #edf2f7;
  --border-focus: #0284c7;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --accent: #0369a1;
  --accent-hover: #075985;
  --accent-rgb: 3, 105, 161;
  --rose: #e11d48;
  --success: #059669;
  --warning: #d97706;
  --danger: #dc2626;
  --error: #dc2626;
  --code-bg: #f8fafc;
  --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  width: 100%;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover, a:focus-visible {
  color: var(--accent-hover);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Navbar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(9, 13, 22, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  height: 64px;
  display: flex;
  align-items: center;
}

[data-theme="light"] .navbar {
  background: rgba(248, 250, 252, 0.88);
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text-primary);
  text-decoration: none;
}

.brand-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
}

.brand:hover, .brand:visited {
  color: var(--text-primary);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-link {
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}

.nav-link:visited {
  color: var(--text-secondary);
}

.nav-link:hover, .nav-link.active {
  color: var(--text-primary);
  background: var(--bg-secondary);
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-icon:hover {
  color: var(--text-primary);
  border-color: var(--border-focus);
  background: var(--bg-secondary);
}

/* Hero */
.hero {
  padding: 80px 0 60px;
  text-align: center;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: rgba(var(--accent-rgb), 0.12);
  border: 1px solid rgba(var(--accent-rgb), 0.3);
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--accent);
  margin-bottom: 24px;
}

.hero h1 {
  font-size: 3.25rem;
  line-height: 1.15;
  font-weight: 800;
  margin-bottom: 20px;
  letter-spacing: -0.03em;
}

.gradient-text {
  background: linear-gradient(135deg, var(--accent) 0%, #38bdf8 50%, var(--rose) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p {
  font-size: 1.25rem;
  color: var(--text-secondary);
  max-width: 760px;
  margin: 0 auto 40px;
}

/* Install Box */
.install-card {
  max-width: 680px;
  margin: 0 auto 50px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  text-align: left;
}

.install-tabs {
  display: flex;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}

.install-tab {
  padding: 12px 20px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  border: none;
  background: none;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.install-tab:hover {
  color: var(--text-primary);
}

.install-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  background: var(--bg-card);
}

.install-panel {
  display: none;
  padding: 20px 24px;
  position: relative;
}

.install-panel.active {
  display: block;
}

.code-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--accent);
  overflow-x: auto;
}

.code-wrap code {
  color: var(--text-primary);
}

.btn-copy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.btn-copy:hover {
  color: var(--text-primary);
  border-color: var(--accent);
}

/* Benchmark Stats */
.benchmark-card {
  max-width: 900px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.benchmark-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.benchmark-title {
  font-weight: 700;
  font-size: 1.05rem;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.stat-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
}

.stat-val {
  font-size: 1.8rem;
  font-weight: 800;
  font-family: var(--font-mono);
  margin-bottom: 4px;
}

.stat-val.fast {
  color: var(--accent);
}

.stat-val.gold {
  color: #fbbf24;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Section */
.section {
  padding: 80px 0;
}

.section-alt {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-title {
  font-size: 2.25rem;
  font-weight: 800;
  text-align: center;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

.section-desc {
  font-size: 1.15rem;
  color: var(--text-secondary);
  text-align: center;
  max-width: 650px;
  margin: 0 auto 50px;
}

/* Features Grid */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.feature-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-focus);
}

.feature-icon {
  display: flex;
  align-items: center;
  margin-bottom: 16px;
  color: var(--accent);
}

.feature-icon svg {
  width: 28px;
  height: 28px;
}

.feature-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.feature-text {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* Language Matrix */
.lang-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
}

.lang-pill {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.15s ease;
}

.lang-pill:hover {
  border-color: var(--accent);
  background: rgba(var(--accent-rgb), 0.05);
}

.lang-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

/* Docs Layout */
.docs-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 48px;
  padding-top: 40px;
  padding-bottom: 80px;
}

.docs-sidebar {
  position: sticky;
  top: 90px;
  height: calc(100vh - 120px);
  overflow-y: auto;
  padding-right: 12px;
}

.docs-nav-group {
  margin-bottom: 24px;
}

.docs-nav-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.docs-nav-links {
  list-style: none;
}

.docs-nav-link {
  display: block;
  padding: 6px 12px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  border-radius: var(--radius-sm);
  border-left: 2px solid transparent;
  transition: all 0.15s ease;
}

.docs-nav-link:visited {
  color: var(--text-secondary);
}

.docs-nav-link:hover, .docs-nav-link.active {
  color: var(--accent);
  background: var(--bg-secondary);
  border-left-color: var(--accent);
}

.docs-content {
  min-width: 0;
}

.docs-content h1 {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

.docs-content h2 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-top: 48px;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  letter-spacing: -0.01em;
}

.docs-content h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: 32px;
  margin-bottom: 12px;
}

.docs-content p, .docs-content ul, .docs-content ol {
  color: var(--text-secondary);
  font-size: 1.05rem;
  margin-bottom: 20px;
  line-height: 1.7;
}

.docs-content ul, .docs-content ol {
  padding-left: 24px;
}

.docs-content li {
  margin-bottom: 8px;
}

code {
  font-family: var(--font-mono);
}

:not(pre) > code:not(.cmd-title code):not(.code-wrap code) {
  font-family: var(--font-mono);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-size: 0.88em;
  color: var(--accent);
}

.docs-content code {
  font-family: var(--font-mono);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  color: var(--accent);
}

pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  color: var(--text-primary);
}

pre code {
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  color: inherit;
}

.docs-content pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  overflow-x: auto;
  margin-bottom: 24px;
}

.docs-content pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.92rem;
  color: var(--text-primary);
}

th {
  color: var(--text-secondary);
  font-weight: 600;
}

.cmd-code {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  font-family: var(--font-mono);
  color: var(--text-primary);
  line-height: 1.5;
  overflow-x: auto;
}
/* Command Card */
.cmd-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 20px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.cmd-card:hover {
  border-color: var(--border-focus);
}

.cmd-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.cmd-title {
  font-size: 1.1rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.cmd-title code {
  font-size: 1.05rem;
  color: var(--accent);
  background: none;
  border: none;
  padding: 0;
}

.cmd-badge {
  font-size: 0.72rem;
  padding: 3px 10px;
  border-radius: 9999px;
  background: rgba(var(--accent-rgb), 0.12);
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.cmd-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cmd-field {
  font-size: 0.95rem;
  line-height: 1.6;
}

.cmd-label {
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  display: block;
  margin-bottom: 2px;
}

.cmd-desc {
  color: var(--text-secondary);
  margin-bottom: 0 !important;
}

/* Workflow Quick Jump Navigation */
.workflows-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 32px;
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.wf-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all 0.15s ease;
  text-decoration: none;
}

.wf-pill:visited {
  color: var(--text-secondary);
}

.wf-pill:hover {
  color: var(--text-primary);
  border-color: var(--accent);
  background: rgba(var(--accent-rgb), 0.1);
}

/* Workflow Scenario Lists */
.cmd-scenario-list {
  list-style: none;
  padding-left: 0;
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cmd-scenario-item {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.cmd-scenario-bullet {
  color: var(--accent);
  font-size: 0.85rem;
  flex-shrink: 0;
}

/* Workflow Step & Instruction List */
.workflow-steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 10px 0 16px 0;
}

.workflow-step {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  transition: border-color 0.15s ease;
}

.workflow-step:hover {
  border-color: var(--border-focus);
}

.step-desc {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 8px;
  line-height: 1.45;
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(var(--accent-rgb), 0.12);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  font-family: var(--font-mono);
  flex-shrink: 0;
}

.workflow-step .code-wrap {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  margin: 0;
}

.workflow-step .code-wrap code {
  font-size: 0.88rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow-x: auto;
}

/* Workflow Pipeline Recipe (Multi-line code blocks) */
.workflow-recipe {
  margin: 14px 0;
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.recipe-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
}

.recipe-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.recipe-title svg {
  color: var(--text-muted);
  flex-shrink: 0;
}

.recipe-code {
  margin: 0;
  padding: 16px 20px;
  background: var(--code-bg);
  border: none;
  border-radius: 0;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--text-primary);
  white-space: pre;
}

.recipe-code code {
  background: none;
  border: none;
  padding: 0;
  color: var(--text-primary);
  font-size: inherit;
}

/* Tool Card */
.tool-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}

.tool-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}

.tool-name {
  font-size: 1.15rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--accent);
}

.tool-badge {
  font-size: 0.75rem;
  padding: 3px 8px;
  border-radius: 9999px;
  background: rgba(var(--accent-rgb), 0.1);
  color: var(--accent);
  font-weight: 600;
}

.tool-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
}

/* Footer */
.footer {
  border-top: 1px solid var(--border);
  padding: 40px 0;
  background: var(--bg-secondary);
  color: var(--text-muted);
  font-size: 0.9rem;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-links {
  display: flex;
  gap: 20px;
}

.footer-links a {
  color: var(--text-secondary);
}

.footer-links a:hover {
  color: var(--text-primary);
}

/* Mobile TOC Drawer */
.mobile-toc-bar {
  display: none;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
  position: sticky;
  top: 64px;
  z-index: 90;
}

.mobile-toc-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 8px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.mobile-toc-drawer {
  display: none;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 16px 24px;
}

.mobile-toc-drawer.open {
  display: block;
}

/* Responsive */
@media (max-width: 900px) {
  .docs-layout {
    grid-template-columns: 1fr;
  }
  .docs-sidebar {
    display: none;
  }
  .mobile-toc-bar {
    display: block;
  }
  .hero h1 {
    font-size: 2.5rem;
  }
}

@media (max-width: 600px) {
  .hero {
    padding: 50px 0 40px;
  }
  .hero h1 {
    font-size: 2.1rem;
  }
  .hero p {
    font-size: 1.05rem;
  }
  .features-grid {
    grid-template-columns: 1fr;
  }
  .benchmark-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
}
