/* ============================================================
   安神小学堂 · 站点样式
   沿用品牌门户 token；主色 emerald + 金色点缀（国风）
   ============================================================ */
:root {
  --bg: #060912;
  --bg-soft: #0b1120;
  --surface: rgba(255, 255, 255, 0.035);
  --surface-2: rgba(255, 255, 255, 0.07);
  --border: rgba(120, 200, 170, 0.16);
  --border-strong: rgba(80, 220, 170, 0.42);
  --text: #e6edf6;
  --muted: #93a3bd;
  --faint: #5c6b85;
  --emerald: #34d399;
  --gold: #e8c97a;
  --cyan: #22d3ee;
  --blue: #3b82f6;
  --violet: #a855f7;
  --amber: #fbbf24;
  --rose: #fb7185;
  --radius: 16px;
  --maxw: 1140px;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.bg-fx {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(900px 600px at 10% -5%, rgba(52, 211, 153, 0.16), transparent 60%),
    radial-gradient(800px 600px at 92% 0%, rgba(232, 201, 122, 0.13), transparent 60%),
    radial-gradient(700px 500px at 50% 110%, rgba(34, 211, 238, 0.1), transparent 60%),
    var(--bg);
}
.bg-fx::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(120, 200, 170, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 200, 170, 0.05) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(circle at 50% 25%, #000 0%, transparent 78%);
  -webkit-mask-image: radial-gradient(circle at 50% 25%, #000 0%, transparent 78%);
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* ---------------- 导航 ---------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  background: rgba(6, 9, 18, 0.78);
  border-bottom: 1px solid var(--border);
}
.nav-in { display: flex; align-items: center; gap: 18px; height: 62px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: 0.3px; }
.brand img { height: 30px; width: auto; border-radius: 9px; }
.brand b { font-size: 17px; }
.brand em {
  font-style: normal;
  background: linear-gradient(92deg, var(--emerald), var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.nav-links { display: flex; gap: 20px; margin-left: auto; font-size: 14px; color: var(--muted); }
.nav-links a:hover { color: var(--text); }
.nav-links a.on { color: var(--emerald); }

/* ---------------- Hero ---------------- */
.hero { padding: 62px 0 34px; text-align: center; }
.hero .eyebrow {
  display: inline-block;
  font-size: 12px;
  letter-spacing: 2px;
  color: var(--gold);
  border: 1px solid rgba(232, 201, 122, 0.35);
  border-radius: 999px;
  padding: 5px 14px;
  margin-bottom: 20px;
}
.hero h1 { font-size: clamp(30px, 5vw, 46px); margin: 0 0 14px; letter-spacing: 1px; }
.hero h1 em {
  font-style: normal;
  background: linear-gradient(92deg, var(--emerald), var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p { color: var(--muted); max-width: 640px; margin: 0 auto 22px; font-size: 16px; }

.stats { display: flex; justify-content: center; gap: 34px; flex-wrap: wrap; margin-top: 8px; }
.stat b {
  display: block;
  font-size: 26px;
  background: linear-gradient(92deg, var(--emerald), var(--cyan));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.stat span { font-size: 12px; color: var(--faint); letter-spacing: 1px; }

/* ---------------- 区块 ---------------- */
.section { padding: 40px 0; }
.sec-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 20px; }
.sec-head h2 { font-size: 21px; margin: 0; }
.sec-head span { font-size: 13px; color: var(--faint); }
.sec-head .more { margin-left: auto; font-size: 13px; color: var(--emerald); }

/* ---------------- 系列卡片 ---------------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(252px, 1fr)); gap: 16px; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.2s, border-color 0.2s, background 0.2s;
  cursor: pointer;
}
.card:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  background: var(--surface-2);
}
.card-media { position: relative; aspect-ratio: 16 / 9; overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-media .ph { width: 100%; height: 100%; }
.card-body { padding: 14px 16px 16px; }
.card-body h3 { margin: 0 0 6px; font-size: 16px; }
.card-body p {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.meta { display: flex; gap: 10px; align-items: center; margin-top: 10px; font-size: 12px; color: var(--faint); }
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  border: 1px solid var(--border-strong);
  color: var(--emerald);
}
.badge.gold { color: var(--gold); border-color: rgba(232, 201, 122, 0.4); }
.badge.lock { color: var(--rose); border-color: rgba(251, 113, 133, 0.4); }

/* 渐变占位（无封面时） */
.ph { background: linear-gradient(135deg, #123, #234); }
.g-emerald { background: linear-gradient(135deg, #064e3b, #34d39955); }
.g-cyan { background: linear-gradient(135deg, #0e4b5a, #22d3ee55); }
.g-blue { background: linear-gradient(135deg, #1e3a8a, #3b82f655); }
.g-violet { background: linear-gradient(135deg, #4c1d95, #a855f755); }
.g-amber { background: linear-gradient(135deg, #78350f, #fbbf2455); }
.g-rose { background: linear-gradient(135deg, #7f1d3a, #fb718555); }

/* ---------------- 单集页 ---------------- */
.ep { padding: 26px 0 60px; }
.crumb { font-size: 13px; color: var(--faint); margin-bottom: 18px; }
.crumb a:hover { color: var(--emerald); }
.ep-hero {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  aspect-ratio: 16 / 9;
  position: relative;
}
.ep-hero img { width: 100%; height: 100%; object-fit: cover; }
.ep-title { font-size: clamp(22px, 3.4vw, 32px); margin: 20px 0 8px; }
.ep-meta { display: flex; gap: 14px; flex-wrap: wrap; color: var(--faint); font-size: 13px; margin-bottom: 18px; }
.ep-desc { color: var(--muted); font-size: 15px; max-width: 760px; }

.actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 24px 0 10px; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid var(--border-strong);
  color: var(--text);
  background: var(--surface-2);
  transition: transform 0.15s, background 0.2s;
  cursor: pointer;
}
.btn:hover { transform: translateY(-2px); background: rgba(52, 211, 153, 0.14); }
.btn.primary {
  background: linear-gradient(92deg, var(--emerald), var(--cyan));
  color: #04231a;
  border: none;
}
.btn.gold { border-color: rgba(232, 201, 122, 0.5); color: var(--gold); }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; transform: none; }

/* PDF 领取卡 */
.pdf-card {
  margin-top: 26px;
  border: 1px dashed rgba(232, 201, 122, 0.45);
  background: rgba(232, 201, 122, 0.06);
  border-radius: var(--radius);
  padding: 20px 22px;
}
.pdf-card h3 { margin: 0 0 6px; font-size: 17px; color: var(--gold); }
.pdf-card p { margin: 0 0 12px; color: var(--muted); font-size: 14px; }
.pdf-card ol { margin: 0; padding-left: 20px; color: var(--muted); font-size: 14px; }
.pdf-card ol li { margin-bottom: 4px; }
.pdf-card .kw {
  display: inline-block;
  margin-top: 10px;
  padding: 3px 10px;
  border-radius: 8px;
  background: rgba(232, 201, 122, 0.16);
  color: var(--gold);
  font-weight: 700;
  letter-spacing: 1px;
}

/* 上一集 / 下一集 */
.ep-nav { display: flex; gap: 12px; margin-top: 34px; flex-wrap: wrap; }
.ep-nav .btn { flex: 1; min-width: 200px; justify-content: center; }

/* ---------------- 页脚 ---------------- */
.footer { border-top: 1px solid var(--border); margin-top: 40px; padding: 28px 0 40px; color: var(--faint); font-size: 13px; }
.footer .f-in { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; }
.footer .f-brand { font-weight: 700; color: var(--muted); }
.footer .f-links { margin-left: auto; display: flex; gap: 16px; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 640px) {
  .nav-links { gap: 14px; font-size: 13px; }
  .nav-links .hide-sm { display: none; }
  .hero { padding: 44px 0 24px; }
  .stats { gap: 22px; }
  .card-body h3 { font-size: 15px; }
}

/* 内容为空时的兜底提示 */
.empty { color: var(--faint); text-align: center; padding: 40px 0; }
