:root {
  --bg: #0b1120;
  --card: rgba(17, 24, 39, 0.85);
  --text: #e2e8f0;
  --muted: #94a3b8;
  --accent: #818cf8;
  --border: rgba(148, 163, 184, 0.2);
  --shadow: 0 18px 40px rgba(2, 6, 23, 0.4);
  --radius: 18px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

.container { width: min(860px, 100%); margin: 0 auto; padding: 0 5vw; }

.bg-glow { position: fixed; width: 380px; height: 380px; border-radius: 50%; filter: blur(100px); opacity: 0.5; z-index: -3; }
.glow-a { top: -100px; left: -60px; background: radial-gradient(circle, rgba(129, 140, 248, 0.4), transparent 70%); }
.glow-b { bottom: -120px; right: -80px; background: radial-gradient(circle, rgba(56, 189, 248, 0.3), transparent 70%); }

.bg-grid {
  position: fixed; inset: 0;
  background-image: radial-gradient(rgba(148, 163, 184, 0.14) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none; z-index: -4;
}

/* ── Nav ── */
.hero { padding: 20px 0 48px; }

.nav {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 18px; border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(16px);
}

.brand { display: flex; align-items: center; gap: 10px; }
.brand strong { display: block; }
.brand span { font-size: 0.85rem; color: var(--muted); }
.brand-mark { font-size: 1.4rem; }

.nav-links { display: flex; gap: 18px; font-size: 0.95rem; color: var(--muted); align-items: center; flex-wrap: wrap; }
.nav-links a:hover { color: var(--accent); }

.nav-version {
  font-size: 0.82rem;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--accent);
  background: rgba(129, 140, 248, 0.1);
  font-weight: 600;
}

.theme-toggle {
  border: 1px solid var(--border); padding: 8px 14px; border-radius: 999px;
  background: transparent; color: var(--text);
  display: flex; align-items: center; gap: 6px; cursor: pointer;
}

/* ── Hero ── */
.hero-body { margin-top: 32px; }
.hero-text h1 { font-size: clamp(2rem, 4vw, 2.8rem); margin: 0 0 12px; }
.hero-text p { color: var(--muted); margin: 0; }

/* ── Version / Changelog ── */
.version-section { margin-top: -24px; margin-bottom: 40px; }

.download-section { margin-top: -16px; margin-bottom: 36px; }

.download-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.download-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.download-head h2 {
  margin: 0 0 6px;
  font-size: 1.35rem;
}

.download-head p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.download-head strong {
  color: var(--text);
  font-weight: 600;
}

.download-version {
  flex-shrink: 0;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(129, 140, 248, 0.12);
  color: var(--accent);
  font-size: 0.88rem;
  font-weight: 700;
}

.download-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.download-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.35);
  color: var(--text);
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  min-height: 112px;
}

.download-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(2, 6, 23, 0.25);
  border-color: rgba(129, 140, 248, 0.45);
}

.dl-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
}

.dl-name {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
}

.dl-action {
  margin-top: auto;
  font-size: 0.82rem;
  color: var(--muted);
}

.download-btn:hover .dl-action {
  color: var(--accent);
}

.dl-quark .dl-icon { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.dl-xunlei .dl-icon { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.dl-uc .dl-icon { background: linear-gradient(135deg, #f97316, #ea580c); }
.dl-baidu .dl-icon { background: linear-gradient(135deg, #2563eb, #1e40af); }
.dl-mobile .dl-icon { background: linear-gradient(135deg, #06b6d4, #0891b2); }
.dl-guangya .dl-icon { background: linear-gradient(135deg, #22c55e, #16a34a); }

body.light .download-btn {
  background: #f8fafc;
}

body.light .download-btn:hover {
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.1);
}

@media (max-width: 820px) {
  .download-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 520px) {
  .download-head { flex-direction: column; align-items: flex-start; }
  .download-grid { grid-template-columns: 1fr; }
  .download-btn { min-height: auto; flex-direction: row; align-items: center; flex-wrap: wrap; }
  .dl-action { margin-top: 0; width: 100%; padding-left: 44px; }
}

.version-banner {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  box-shadow: var(--shadow);
}

.version-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.version-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  color: var(--muted);
}

.version-badge strong {
  color: var(--accent);
  font-size: 1.15rem;
}

.version-latest-tag {
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(129, 140, 248, 0.18);
  color: var(--accent);
}

.changelog-list { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }

.changelog-item {
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

.changelog-item:first-child { border-top: none; padding-top: 0; }

.changelog-item h3 {
  margin: 0 0 8px;
  font-size: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.changelog-item time { font-size: 0.85rem; color: var(--muted); font-weight: normal; }

.changelog-item ul {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.version-loading { margin: 0; color: var(--muted); }

/* ── Sections ── */
.section { margin: 0 auto 56px; }
.section > h2 { font-size: 1.5rem; margin: 0 0 20px; }

/* ── Steps ── */
.steps { display: grid; gap: 16px; }

.step {
  display: flex; gap: 18px; align-items: flex-start;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 24px;
}

.step-num {
  width: 40px; height: 40px; min-width: 40px;
  border-radius: 50%;
  background: rgba(129, 140, 248, 0.15);
  color: var(--accent);
  display: grid; place-items: center;
  font-size: 1.1rem; font-weight: 800;
}

.step-body h3 { margin: 0 0 6px; font-size: 1.05rem; }
.step-body p { margin: 0; color: var(--muted); font-size: 0.95rem; }

/* ── FAQ ── */
.faq-list { display: grid; gap: 14px; }

.faq-item {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 24px;
}

.faq-item h3 { margin: 0 0 6px; font-size: 1.05rem; }
.faq-item p { margin: 0; color: var(--muted); font-size: 0.95rem; }

/* ── Footer ── */
.footer { padding: 24px 0 32px; border-top: 1px solid var(--border); color: var(--muted); }
.footer-inner { display: flex; justify-content: center; }

/* ── Light ── */
body.light {
  --bg: #f3f6ff; --card: #ffffff; --text: #0f172a; --muted: #64748b;
  --accent: #6366f1; --border: rgba(148, 163, 184, 0.35);
  --shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
}
body.light .nav { background: rgba(255, 255, 255, 0.8); }
body.light .bg-grid { background-image: radial-gradient(rgba(15, 23, 42, 0.08) 1px, transparent 1px); }
body.light .bg-glow { opacity: 0.35; }

/* ── To Top ── */
.to-top {
  position: fixed; right: 18px; bottom: 18px;
  width: 44px; height: 44px; border-radius: 50%; border: none;
  background: var(--accent); color: #fff;
  cursor: pointer; display: none;
}
.to-top.show { display: grid; place-items: center; }

/* ── Responsive ── */
@media (max-width: 640px) {
  .nav { flex-wrap: wrap; justify-content: center; }
  .nav-links { width: 100%; justify-content: center; }
  .step { flex-direction: column; gap: 10px; }
}
