/* 德学宝 Dexuebao-Magic 官网样式 */
:root {
  --bg-deep: #060b14;
  --bg: #0a1020;
  --bg-elevated: #111a2e;
  --card: rgba(17, 28, 50, 0.75);
  --card-hover: rgba(22, 36, 64, 0.9);
  --border: rgba(148, 163, 184, 0.18);
  --border-strong: rgba(56, 189, 248, 0.35);
  --text: #f1f5f9;
  --text-secondary: #cbd5e1;
  --muted: #94a3b8;
  --accent: #38bdf8;
  --accent-2: #818cf8;
  --accent-3: #22d3ee;
  --gradient-brand: linear-gradient(135deg, #38bdf8 0%, #6366f1 50%, #a855f7 100%);
  --gradient-btn: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.45);
  --shadow-glow: 0 0 60px rgba(56, 189, 248, 0.15);
  --radius: 16px;
  --radius-sm: 10px;
  --nav-h: 72px;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  background: var(--bg-deep);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
}

/* 全局背景光晕 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(ellipse 70% 50% at 15% -10%, rgba(56, 189, 248, 0.22), transparent 55%),
    radial-gradient(ellipse 55% 45% at 85% 5%, rgba(129, 140, 248, 0.18), transparent 50%),
    radial-gradient(ellipse 40% 30% at 50% 100%, rgba(34, 211, 238, 0.08), transparent 60%),
    var(--bg-deep);
  pointer-events: none;
}

a { color: var(--accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: #7dd3fc; }

.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 28px;
}

/* ========== 导航 ========== */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 200;
  height: var(--nav-h);
  background: rgba(6, 11, 20, 0.72);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border-bottom: 1px solid var(--border);
}

.site-nav .inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-h);
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 1.125rem;
  color: #fff !important;
  text-decoration: none !important;
  letter-spacing: 0.02em;
}

.brand:hover { opacity: 0.92; }

.brand .logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  font-size: 1.35rem;
  border-radius: 12px;
  background: var(--gradient-brand);
  box-shadow: 0 4px 16px rgba(56, 189, 248, 0.35);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.brand-text .en {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.nav-links a {
  color: var(--text-secondary);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none !important;
}

.nav-links a:hover {
  color: #fff;
  background: rgba(56, 189, 248, 0.1);
}

/* ========== 按钮 ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none !important;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
  white-space: nowrap;
}

.btn:hover { transform: translateY(-2px); }

.btn-primary {
  background: var(--gradient-btn);
  color: #fff !important;
  box-shadow: 0 8px 28px rgba(37, 99, 235, 0.4);
}

.btn-primary:hover {
  box-shadow: 0 12px 36px rgba(37, 99, 235, 0.5);
  color: #fff !important;
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text) !important;
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  border-color: var(--border-strong);
  background: rgba(56, 189, 248, 0.08);
  color: #fff !important;
}

/* ========== Hero ========== */
.hero {
  padding: 56px 0 80px;
  position: relative;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 48px;
  align-items: center;
}

.hero h1 {
  font-size: clamp(2.25rem, 4.5vw, 3.25rem);
  font-weight: 800;
  line-height: 1.2;
  margin: 0 0 20px;
  letter-spacing: -0.02em;
  background: linear-gradient(180deg, #fff 0%, #e2e8f0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero .lead {
  font-size: 1.125rem;
  color: var(--text-secondary);
  margin-bottom: 32px;
  max-width: 540px;
  line-height: 1.75;
}

.hero .lead strong { color: var(--accent); font-weight: 600; }

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 28px;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
}

.badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.1);
  color: var(--accent);
  border: 1px solid rgba(56, 189, 248, 0.28);
  letter-spacing: 0.03em;
}

.hero-meta {
  font-size: 0.85rem;
  color: var(--muted);
}

.hero-meta a { color: var(--accent-3); }

.hero-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px;
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  backdrop-filter: blur(12px);
}

.hero-card h3 {
  margin: 0 0 16px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent);
}

.hero-card ul {
  margin: 0;
  padding-left: 20px;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.hero-card li { margin-bottom: 10px; }
.hero-card li:last-child { margin-bottom: 0; }

.stat-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 24px;
}

.stat {
  background: rgba(6, 11, 20, 0.6);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 12px;
  text-align: center;
  transition: border-color 0.2s;
}

.stat:hover { border-color: var(--border-strong); }

.stat .num {
  font-size: 1.5rem;
  font-weight: 800;
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat .lbl {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 4px;
}

/* ========== 区块通用 ========== */
section { padding: 72px 0; }

section.alt {
  background: rgba(10, 16, 32, 0.55);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-title {
  text-align: center;
  margin-bottom: 48px;
}

.section-title h2 {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 800;
  margin: 0 0 12px;
  letter-spacing: -0.02em;
}

.section-title p {
  color: var(--muted);
  margin: 0;
  font-size: 1.05rem;
}

/* ========== 功能卡片 ========== */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 20px;
}

.feature-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
  backdrop-filter: blur(8px);
}

.feature-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.3);
  background: var(--card-hover);
}

.feature-card .icon {
  font-size: 2rem;
  margin-bottom: 14px;
  line-height: 1;
}

.feature-card h3 {
  margin: 0 0 10px;
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
}

.feature-card p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.65;
}

/* ========== 步骤 ========== */
.steps {
  counter-reset: step;
  max-width: 760px;
  margin: 0 auto;
}

.step {
  position: relative;
  padding: 0 0 32px 64px;
  border-left: 2px solid rgba(56, 189, 248, 0.2);
  margin-left: 18px;
}

.step:last-child {
  border-left-color: transparent;
  padding-bottom: 0;
}

.step::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: -19px;
  top: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gradient-btn);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.9rem;
  color: #fff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.step h3 {
  margin: 0 0 8px;
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
}

.step p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.step a { color: var(--accent-3); }

/* ========== 架构图 ========== */
.arch-box {
  background: rgba(6, 11, 20, 0.8);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 28px;
  font-family: "Cascadia Code", Consolas, "Courier New", monospace;
  font-size: 0.8rem;
  overflow-x: auto;
  white-space: pre;
  line-height: 1.6;
  color: #94a3b8;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

/* ========== CTA / 下载 ========== */
.cta-box {
  text-align: center;
  padding: 56px 32px;
  background: linear-gradient(145deg, rgba(37, 99, 235, 0.12), rgba(99, 102, 241, 0.08));
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 20px;
  box-shadow: var(--shadow-glow);
}

.cta-box h2 {
  margin: 0 0 12px;
  font-size: 1.75rem;
  font-weight: 800;
}

.cta-box p {
  color: var(--muted);
  margin: 0 0 28px;
  font-size: 1rem;
}

.download-box {
  text-align: left;
  max-width: 680px;
  margin: 0 auto;
}

#clientVersionInfo {
  min-height: 56px;
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.7;
}

#clientVersionInfo strong { color: var(--accent); }

.download-hint {
  margin-top: 20px;
  font-size: 0.85rem;
  color: var(--muted);
}

.download-hint code {
  background: rgba(6, 11, 20, 0.8);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.8rem;
  color: #f472b6;
  border: 1px solid var(--border);
}

/* ========== 页脚 ========== */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 40px 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.875rem;
  background: rgba(6, 11, 20, 0.5);
}

.site-footer p { margin: 0 0 10px; }
.site-footer a { color: var(--muted); margin: 0 6px; }
.site-footer a:hover { color: var(--accent); }

/* ========== 教程页 ========== */
.docs-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 36px;
  padding: 40px 0 80px;
}

.docs-sidebar {
  position: sticky;
  top: calc(var(--nav-h) + 16px);
  align-self: start;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  max-height: calc(100vh - var(--nav-h) - 32px);
  overflow-y: auto;
  backdrop-filter: blur(12px);
}

.docs-sidebar h4 {
  margin: 0 0 14px;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.docs-sidebar a {
  display: block;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 0.875rem;
  text-decoration: none !important;
}

.docs-sidebar a:hover,
.docs-sidebar a.active {
  background: rgba(56, 189, 248, 0.12);
  color: #fff;
}

.doc-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  margin-bottom: 24px;
  scroll-margin-top: calc(var(--nav-h) + 16px);
  backdrop-filter: blur(8px);
}

.doc-section h2 {
  margin: 0 0 20px;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--accent);
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}

.doc-section h3 {
  margin: 24px 0 10px;
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
}

.doc-section p,
.doc-section li {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.doc-section ol,
.doc-section ul {
  padding-left: 22px;
}

.tip {
  background: rgba(56, 189, 248, 0.08);
  border-left: 3px solid var(--accent);
  padding: 14px 18px;
  border-radius: 0 10px 10px 0;
  margin: 18px 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.warn {
  background: rgba(251, 191, 36, 0.08);
  border-left: 3px solid #fbbf24;
  padding: 14px 18px;
  border-radius: 0 10px 10px 0;
  margin: 18px 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

code {
  background: rgba(6, 11, 20, 0.8);
  padding: 2px 7px;
  border-radius: 5px;
  font-family: Consolas, monospace;
  font-size: 0.85em;
  color: #f472b6;
  border: 1px solid var(--border);
}

table.doc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  margin: 16px 0;
}

table.doc-table th,
table.doc-table td {
  border: 1px solid var(--border);
  padding: 12px 14px;
  text-align: left;
}

table.doc-table th {
  background: rgba(37, 99, 235, 0.15);
  color: #fff;
  font-weight: 600;
}

table.doc-table td { color: var(--text-secondary); }

/* ========== 响应式 ========== */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 36px; }
  .hero { padding-top: 32px; }
  .docs-layout { grid-template-columns: 1fr; }
  .docs-sidebar {
    position: static;
    max-height: none;
  }
  .nav-links a:not(.btn) { display: none; }
  .nav-links .btn { padding: 10px 16px; font-size: 0.85rem; }
}

@media (max-width: 480px) {
  .container { padding: 0 18px; }
  .hero-actions { flex-direction: column; }
  .hero-actions .btn { width: 100%; }
  .stat-row { grid-template-columns: 1fr 1fr; }
}
