/* ===================== RESET & BASE ===================== */
:root {
  --bg: #0a0e1a;
  --bg-card: #111827;
  --bg-card-hover: #1a2332;
  --bg-nav: rgba(10, 14, 26, 0.92);
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --accent: #38bdf8;
  --accent2: #818cf8;
  --accent3: #34d399;
  --border: #1e293b;
  --layer0: #3b82f6;
  --layer1: #f59e0b;
  --layer2: #ef4444;
  --layer3: #8b5cf6;
  --layer4: #06b6d4;
  --layer5: #22c55e;
  --layer6: #f472b6;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --radius: 12px;
  --nav-h: 56px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}
[data-theme="light"] {
  --bg: #f1f5f9;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;
  --bg-nav: rgba(241, 245, 249, 0.92);
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --shadow: 0 4px 24px rgba(0,0,0,0.08);
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}
::selection { background: var(--accent); color: #000; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===================== NAV ===================== */
#main-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  height: var(--nav-h);
  background: var(--bg-nav);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
}
.nav-brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 18px; }
.nav-icon { font-size: 24px; }
.nav-links { display: flex; gap: 4px; list-style: none; }
.nav-links a {
  padding: 6px 14px; border-radius: 8px; font-size: 14px; font-weight: 500;
  color: var(--text-muted); transition: all .2s;
}
.nav-links a:hover, .nav-links a.active {
  color: var(--accent); background: rgba(56,189,248,0.08); text-decoration: none;
}
#theme-toggle {
  background: none; border: 1px solid var(--border); border-radius: 8px;
  padding: 6px 10px; font-size: 16px; cursor: pointer; color: var(--text);
}

/* ===================== SECTION COMMON ===================== */
section {
  padding: 80px 32px 40px;
  max-width: 1400px;
  margin: 0 auto;
}
#hero { max-width: 100%; padding-top: calc(var(--nav-h) + 40px); }
.section-title {
  font-size: 28px; font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  margin-bottom: 8px;
}
.section-desc { color: var(--text-muted); margin-bottom: 32px; font-size: 15px; }

/* ===================== BUTTON ===================== */
.btn {
  display: inline-block; padding: 10px 24px; border-radius: 8px;
  font-weight: 600; font-size: 14px; transition: all .2s; cursor: pointer; border: none;
}
.btn-primary { background: var(--accent); color: #000; }
.btn-primary:hover { background: #7dd3fc; text-decoration: none; }
.btn-outline {
  background: transparent; border: 1px solid var(--accent); color: var(--accent);
}
.btn-outline:hover { background: rgba(56,189,248,0.1); text-decoration: none; }

/* ===================== HERO ===================== */
#hero {
  display: flex; align-items: center; justify-content: space-between;
  min-height: calc(100vh - var(--nav-h)); gap: 40px;
  padding-left: 60px; padding-right: 60px;
}
.hero-content { max-width: 600px; }
.hero-content h1 {
  font-size: 48px; font-weight: 900;
  background: linear-gradient(135deg, var(--accent), var(--accent3), var(--accent2));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  line-height: 1.15; margin-bottom: 16px;
}
.hero-sub { font-size: 18px; color: var(--text-muted); margin-bottom: 24px; }
.hero-stats {
  display: flex; gap: 24px; margin-bottom: 32px; flex-wrap: wrap;
}
.stat-item {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 20px; min-width: 120px; text-align: center;
}
.stat-num { font-size: 28px; font-weight: 800; color: var(--accent); display: block; }
.stat-label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; }
.hero-actions { display: flex; gap: 12px; margin-top: 8px; }
.hero-visual { flex: 1; max-width: 560px; height: 400px; position: relative; }
#hero-canvas { width: 100%; height: 100%; }

/* ===================== MODAL ===================== */
.modal { position: fixed; inset: 0; z-index: 2000; display: flex; align-items: center; justify-content: center; }
.modal.hidden { display: none; }
.modal-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.6); }
.modal-content {
  position: relative; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); max-width: 720px; width: 92%; max-height: 85vh;
  overflow-y: auto; padding: 32px; box-shadow: var(--shadow);
}
.modal-close {
  position: absolute; top: 12px; right: 16px; background: none; border: none;
  font-size: 28px; color: var(--text-muted); cursor: pointer;
}
.cap-header { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.cap-layer-dot {
  width: 48px; height: 48px; border-radius: 50%; display: flex; align-items: center;
  justify-content: center; font-weight: 800; font-size: 20px; color: #000;
}
.cap-title h3 { font-size: 22px; margin-bottom: 2px; }
.cap-title .cap-cat { font-size: 13px; color: var(--text-muted); }
.cap-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.cap-field { background: var(--bg); border-radius: 8px; padding: 12px 16px; }
.cap-field-label { font-size: 11px; text-transform: uppercase; color: var(--text-muted); margin-bottom: 4px; letter-spacing: .5px; }
.cap-field-val { font-size: 14px; }
.cap-field.full { grid-column: 1 / -1; }
.cap-topics { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.topic-chip {
  font-size: 12px; font-family: var(--font-mono); padding: 3px 10px;
  border-radius: 4px; background: rgba(56,189,248,0.1); color: var(--accent);
}
.topic-chip.sub { background: rgba(239,68,68,0.1); color: #f87171; }
.lang-chip {
  display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 4px;
  background: rgba(129,140,248,0.12); color: var(--accent2); margin: 2px;
}

/* ===================== FOOTER ===================== */
footer {
  text-align: center; padding: 32px; color: var(--text-muted); font-size: 13px;
  border-top: 1px solid var(--border); margin-top: 40px;
}

/* ===================== SCROLLBAR ===================== */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* ===================== GUIDE (快速上手) ===================== */
#guide { padding-top: 80px; }

/* 三卡片 intro */
.guide-intro {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 36px;
}
.guide-intro-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; transition: border-color .2s;
}
.guide-intro-card:hover { border-color: var(--accent); }
.guide-intro-icon { font-size: 28px; margin-bottom: 10px; }
.guide-intro-card h3 {
  font-size: 17px; font-weight: 800; margin-bottom: 10px; color: var(--text);
}
.guide-intro-card p {
  font-size: 13.5px; color: var(--text-muted); line-height: 1.75;
}
.guide-intro-card b { color: var(--text); }
.guide-intro-card ul {
  list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px;
}
.guide-intro-card li {
  font-size: 13.5px; color: var(--text-muted); line-height: 1.6;
  padding-left: 14px; position: relative;
}
.guide-intro-card li::before {
  content: '›'; position: absolute; left: 0; color: var(--accent); font-weight: 700;
}
.guide-intro-card li b { color: var(--accent); }
.guide-intro-steps {
  display: flex; flex-direction: column; gap: 8px;
}
.guide-intro-steps a {
  font-size: 13.5px; color: var(--accent); padding: 6px 12px;
  background: rgba(56,189,248,.06); border: 1px solid rgba(56,189,248,.15);
  border-radius: 6px; transition: all .2s; display: block;
}
.guide-intro-steps a:hover {
  background: rgba(56,189,248,.14); text-decoration: none;
}

/* 概念+链路双列 */
.guide-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 32px; margin-bottom: 28px;
}
.guide-col { min-width: 0; }
.guide-heading {
  font-size: 15px; font-weight: 700; color: var(--accent2);
  margin-bottom: 12px; text-transform: uppercase; letter-spacing: .5px;
}
/* 概念词典 */
.guide-terms { display: flex; flex-direction: column; gap: 8px; }
.guide-term {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 14px; display: flex; flex-direction: column; gap: 2px;
}
.guide-term-name {
  font-size: 14px; font-weight: 700; color: var(--accent);
}
.guide-term-name .en {
  font-size: 11px; font-weight: 400; color: var(--text-muted);
  font-family: var(--font-mono); margin-left: 6px;
}
.guide-term-desc {
  font-size: 12.5px; color: var(--text-muted); line-height: 1.6;
}
.guide-term-desc code {
  font-family: var(--font-mono); font-size: 11px;
  background: rgba(56,189,248,.08); padding: 1px 5px; border-radius: 3px; color: var(--accent);
}
/* 示例链路 */
.guide-flow { display: flex; flex-direction: column; gap: 0; }
.flow-step {
  display: grid; grid-template-columns: 28px 1fr; gap: 0 10px;
  padding: 6px 0; border-left: 2px solid var(--border); margin-left: 13px;
  padding-left: 16px; position: relative;
}
.flow-step::before {
  content: ''; position: absolute; left: -5px; top: 12px;
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent); border: 2px solid var(--bg);
}
.flow-num {
  font-size: 13px; color: var(--text-muted); grid-column: 1; grid-row: 1 / 3;
  display: flex; align-items: center; justify-content: center;
}
.flow-topic {
  font-family: var(--font-mono); font-size: 12px; color: var(--accent);
  background: rgba(56,189,248,.08); padding: 1px 6px; border-radius: 3px;
  justify-self: start; white-space: nowrap;
}
.flow-detail {
  grid-column: 2; font-size: 12px; color: var(--text-muted); margin-top: 2px;
}
/* 版本信息 */
.guide-version-info {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px;
  padding: 12px 14px; display: flex; flex-direction: column; gap: 4px;
  font-size: 12.5px; color: var(--text-muted); line-height: 1.6;
}
.guide-version-info code {
  font-family: var(--font-mono); font-size: 11px;
  background: rgba(52,211,153,.1); padding: 1px 5px; border-radius: 3px; color: var(--accent3);
}
/* 下一步 */
.guide-next {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 16px 20px; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius);
}
.guide-next-label { font-size: 13px; font-weight: 700; color: var(--text-muted); }
.guide-next-btn {
  font-size: 13px; padding: 5px 14px; border-radius: 6px;
  background: rgba(56,189,248,.08); color: var(--accent); border: 1px solid rgba(56,189,248,.2);
  font-weight: 600; transition: all .2s;
}
.guide-next-btn:hover { background: rgba(56,189,248,.18); text-decoration: none; }

/* ===================== RESPONSIVE ===================== */
@media (max-width: 900px) {
  #hero { flex-direction: column; padding: 100px 24px 40px; text-align: center; min-height: auto; }
  .hero-content h1 { font-size: 32px; }
  .hero-stats { justify-content: center; }
  .hero-visual { max-width: 100%; height: 260px; }
  .nav-links { display: none; }
  .cap-grid { grid-template-columns: 1fr; }
  section { padding: 60px 16px 32px; }
  .guide-grid { grid-template-columns: 1fr; }
  .guide-intro { grid-template-columns: 1fr; }
}
