/* ========== 基础 ========== */
:root {
  --bg: #090d18;
  --bg-soft: #0f1424;
  --panel: rgba(18, 23, 39, 0.86);
  --panel-strong: #151b2d;
  --line: rgba(150, 175, 220, 0.16);
  --line-strong: rgba(150, 175, 220, 0.28);
  --text: #eef2ff;
  --muted: #96a3c4;
  --muted-dim: #6f7c9d;
  --teal: #34e6d0;
  --blue: #5b9dff;
  --purple: #a982ff;
  --amber: #ffb454;
  --pink: #ff5f9e;
  --mint: #56e6a8;
  --radius: 18px;
  --mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  --sans: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--sans);
  color: var(--text);
  background:
    radial-gradient(ellipse 70% 45% at 12% -5%, rgba(45, 105, 170, 0.28), transparent 70%),
    radial-gradient(ellipse 55% 40% at 92% 4%, rgba(90, 60, 160, 0.22), transparent 70%),
    linear-gradient(180deg, #0c1120 0%, var(--bg) 48%, #070a13 100%);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  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: 48px 48px;
  mask-image: linear-gradient(to bottom, black, transparent 85%);
  pointer-events: none;
  z-index: 0;
}

.bg-grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.22;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 240 240' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.25'/%3E%3C/svg%3E");
}

.bg-glow {
  position: fixed;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.18;
  pointer-events: none;
  z-index: 0;
}
.bg-glow--a { top: 26%; left: -240px; background: #1e78b8; }
.bg-glow--b { bottom: -220px; right: -180px; background: #7b3fc0; }

main, .topbar, .footer { position: relative; z-index: 1; }

/* ========== 顶部导航 ========== */
.topbar {
  width: min(1480px, 100% - 80px);
  margin: 0 auto;
  height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
  flex-shrink: 0;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #2fd7d0, #3a86ff);
  color: #06121f;
  font: 800 19px/1 var(--mono);
  box-shadow: 0 0 22px rgba(47, 215, 208, 0.35);
}

.brand-copy { display: flex; flex-direction: column; gap: 2px; }
.brand-copy strong { font-size: 15px; letter-spacing: 0.3px; }
.brand-copy small { font: 600 9px/1 var(--mono); letter-spacing: 2.4px; color: var(--muted); }

.nav { display: flex; align-items: center; gap: 38px; margin-left: auto; }
.nav a {
  position: relative;
  color: #c6d0e8;
  font-size: 13px;
  text-decoration: none;
  transition: color 0.2s ease;
}
.nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 100%; bottom: -7px;
  height: 2px;
  background: var(--teal);
  transition: right 0.25s ease;
}
.nav a:hover { color: #fff; }
.nav a:hover::after { right: 0; }

.pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 14px;
  border: 1px solid rgba(55, 220, 210, 0.4);
  border-radius: 999px;
  color: #d9fff9;
  background: rgba(29, 111, 118, 0.18);
  font-size: 12px;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}
.pill-btn:hover { background: rgba(39, 166, 168, 0.28); border-color: var(--teal); transform: translateY(-1px); }
.pill-btn-count { font: 600 10px/1 var(--mono); opacity: 0.8; }
.pill-btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* ========== 主视觉 ========== */
main { width: min(1480px, 100% - 80px); margin: 0 auto; }

.hero { padding: 46px 0 32px; }

.eyebrow {
  margin: 0 0 18px;
  font: 600 11px/1 var(--mono);
  letter-spacing: 1.6px;
  color: var(--muted);
}
.eyebrow .slash { color: var(--teal); font-size: 15px; margin-right: 8px; }

.hero h1 {
  margin: 0;
  max-width: 980px;
  font-size: clamp(23px, 2.35vw, 34px);
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: -0.5px;
  background: linear-gradient(90deg, #f4f7ff 10%, #b9c7e8 70%, #8593b8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.status-row {
  margin-top: 30px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 16px;
  border: 1px dashed rgba(255, 200, 92, 0.42);
  border-radius: 999px;
  background: rgba(255, 190, 70, 0.05);
  color: #d6dcec;
  font-size: 12px;
}
.status-pill strong { color: #ffcc72; font-weight: 600; }
.status-split { color: var(--muted-dim); }
.status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #ffc05a;
  box-shadow: 0 0 10px #ffc05a;
}
.status-link { color: var(--muted); font-size: 12px; text-decoration: none; }
.status-link:hover { color: var(--teal); }

/* ========== 章节卡片 ========== */
.chapter-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.card {
  --accent: var(--teal);
  position: relative;
  min-height: 350px;
  padding: 24px 24px 20px;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(18px);
  overflow: hidden;
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.85;
}
.card::after {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  top: -130px;
  right: -110px;
  border-radius: 50%;
  background: var(--accent);
  filter: blur(90px);
  opacity: 0.14;
  pointer-events: none;
}
.card:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--accent) 42%, transparent);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4), 0 0 0 1px color-mix(in srgb, var(--accent) 12%, transparent);
}

.card--teal   { --accent: var(--teal); }
.card--blue   { --accent: var(--blue); }
.card--purple { --accent: var(--purple); }
.card--amber  { --accent: var(--amber); }
.card--pink   { --accent: var(--pink); }
.card--mint   { --accent: var(--mint); }

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 22px;
}

.chapter-number {
  font: 800 38px/1 var(--mono);
  letter-spacing: -2px;
  color: var(--accent);
  text-shadow: 0 0 28px color-mix(in srgb, var(--accent) 45%, transparent);
}

.chapter-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  color: var(--accent);
  opacity: 0.9;
}
.chapter-icon svg { width: 46px; height: 46px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.card-kicker {
  margin: 0 0 10px;
  font: 600 9px/1 var(--mono);
  letter-spacing: 2.2px;
  color: var(--muted-dim);
}

.card h2 {
  margin: 0 0 12px;
  font-size: clamp(16px, 1.15vw, 18px);
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: -0.2px;
}

.card-desc {
  margin: 0 0 20px;
  font-size: 12px;
  line-height: 1.85;
  color: var(--muted);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}
.tag-list a {
  padding: 6px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.025);
  color: #bcc7df;
  font-size: 11px;
  text-decoration: none;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}
.tag-list a:hover {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  transform: translateY(-1px);
}

.card-footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.card-state { display: inline-flex; align-items: center; gap: 7px; font-size: 11px; color: #9fe9d8; }
.card-state .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 9px var(--accent); }
.card-state--muted { color: var(--muted-dim); }
.card-state--muted .dot { background: var(--muted-dim); box-shadow: none; }
.card-cta {
  color: var(--muted);
  font-size: 11px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: color 0.2s ease, gap 0.2s ease;
}
.card-cta:hover { color: var(--accent); gap: 9px; }

/* ========== 链接说明 ========== */
.link-guide {
  margin: 26px 0 70px;
  padding: 28px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(100deg, rgba(21, 28, 48, 0.92), rgba(14, 19, 33, 0.92));
}
.link-guide h2 { margin: 0 0 10px; font-size: 20px; }
.link-guide p:last-child { margin: 0; max-width: 820px; font-size: 12px; line-height: 1.9; color: var(--muted); }
.link-guide code { font-family: var(--mono); font-size: 11px; color: var(--teal); }
.pill-btn--ghost { border-color: var(--line-strong); background: rgba(255,255,255,0.03); color: #cfd8ee; }
.pill-btn--ghost:hover { border-color: var(--teal); color: var(--teal); background: rgba(52,230,208,0.08); }

.footer {
  width: min(1480px, 100% - 80px);
  margin: 0 auto;
  padding: 22px 0 34px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  color: var(--muted-dim);
  font: 500 10px/1 var(--mono);
  letter-spacing: 1px;
}

/* ========== 响应式 ========== */
@media (max-width: 1100px) {
  .topbar, main, .footer { width: min(100% - 48px, 1480px); }
  .chapter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nav { gap: 22px; }
}

@media (max-width: 720px) {
  .topbar, main, .footer { width: calc(100% - 32px); }
  .topbar { height: auto; padding: 16px 0; flex-wrap: wrap; gap: 16px; }
  .nav { order: 3; width: 100%; margin: 0; justify-content: space-between; gap: 8px; }
  .hero { padding: 34px 0 26px; }
  .hero h1 { font-size: 21px; }
  .chapter-grid { grid-template-columns: 1fr; }
  .card { min-height: 0; }
  .link-guide { flex-direction: column; align-items: flex-start; padding: 22px; }
  .footer { flex-direction: column; gap: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
