:root {
  --bg: #07080f;
  --bg-elev: #0f1322;
  --bg-card: #13192c;
  --bg-code: #060912;
  --border: rgba(148, 163, 184, 0.16);
  --border-gold: rgba(245, 158, 11, 0.45);
  --border-cyan: rgba(56, 189, 248, 0.42);
  --border-rose: rgba(251, 113, 133, 0.48);
  --text: #f1f5f9;
  --text-soft: #cbd5e1;
  --muted: #8b9bb4;
  --gold: #f59e0b;
  --gold-hi: #fcd34d;
  --cyan: #38bdf8;
  --emerald: #34d399;
  --rose: #fb7185;
  --violet: #a78bfa;
}
[data-theme="light"] {
  --bg: #f8fafc;
  --bg-elev: #ffffff;
  --bg-card: #ffffff;
  --bg-code: #0f172a;
  --border: rgba(15, 23, 42, 0.11);
  --border-gold: rgba(217, 119, 6, 0.4);
  --border-cyan: rgba(2, 132, 199, 0.35);
  --border-rose: rgba(225, 29, 72, 0.4);
  --text: #0f172a;
  --text-soft: #334155;
  --muted: #64748b;
  --gold: #d97706;
  --gold-hi: #b45309;
  --cyan: #0284c7;
  --emerald: #059669;
  --rose: #e11d48;
  --violet: #7c3aed;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Noto Sans SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(7, 8, 15, 0.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
[data-theme="light"] .site-header { background: rgba(255, 255, 255, 0.92); }
.header-inner {
  max-width: 1260px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none !important;
}
.brand-emblem {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--gold), #f97316, var(--cyan));
  display: grid;
  place-items: center;
  font-size: 20px;
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.35);
}
.brand-txt strong { display: block; font-size: 16.5px; color: var(--text); line-height: 1.2; }
.brand-txt span { display: block; font-size: 11px; color: var(--muted); }
.header-links { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-soft) !important;
  cursor: pointer;
  text-decoration: none !important;
  transition: all 0.16s;
  white-space: nowrap;
}
.pill-btn:hover { border-color: var(--border-gold); color: var(--text) !important; transform: translateY(-1px); }
.pill-btn.cyan {
  border: none;
  background: linear-gradient(135deg, var(--cyan), var(--emerald));
  color: #041016 !important;
  box-shadow: 0 4px 16px rgba(56, 189, 248, 0.3);
}
.pill-btn.gold {
  border: none;
  background: linear-gradient(135deg, var(--gold), #f97316);
  color: #080a10 !important;
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.32);
}
.pill-btn.rose {
  border-color: var(--border-rose);
  background: rgba(251, 113, 133, 0.12);
  color: var(--rose) !important;
}

/* Hero */
.hero {
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(ellipse 70% 55% at 20% 0%, rgba(245, 158, 11, 0.18), transparent 65%),
    radial-gradient(ellipse 65% 55% at 85% 15%, rgba(56, 189, 248, 0.16), transparent 65%),
    var(--bg);
}
.hero-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 54px 20px 44px;
  text-align: center;
}
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px;
  border-radius: 999px;
  border: 1px solid var(--border-gold);
  background: rgba(245, 158, 11, 0.12);
  color: var(--gold-hi);
  font-size: 12.5px;
  font-weight: 700;
  margin-bottom: 18px;
}
.hero h1 {
  font-size: clamp(32px, 5.4vw, 58px);
  font-weight: 900;
  line-height: 1.14;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}
.hl-gold {
  background: linear-gradient(135deg, #fde68a, #f59e0b, #f97316);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hl-cyan {
  background: linear-gradient(135deg, #38bdf8, #34d399);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-sub {
  max-width: 840px;
  margin: 0 auto 26px;
  font-size: 16.5px;
  color: var(--text-soft);
}
.hero-ctas {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

/* Filter & Search Bar */
.container { max-width: 1240px; margin: 0 auto; padding: 28px 20px 64px; }
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 22px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px 14px;
}
.hall-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.hall-tab {
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-soft);
  padding: 7px 13px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}
.hall-tab:hover { background: rgba(148, 163, 184, 0.1); color: var(--text); }
.hall-tab.active {
  background: rgba(245, 158, 11, 0.16);
  border-color: var(--border-gold);
  color: var(--gold-hi);
}
.hall-tab.elephant.active {
  background: rgba(251, 113, 133, 0.16);
  border-color: var(--border-rose);
  color: var(--rose);
}
.search-input {
  flex: 1;
  min-width: 220px;
  max-width: 320px;
  padding: 8px 13px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 13.5px;
  outline: none;
}
.search-input:focus { border-color: var(--cyan); }

/* Pantheon Cards Grid */
.gods-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 18px;
}
.god-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  cursor: pointer;
  transition: transform 0.18s, border-color 0.18s, box-shadow 0.18s;
}
.god-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-gold);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
}
.god-card.elephant {
  border-color: rgba(251, 113, 133, 0.38);
  background: linear-gradient(165deg, rgba(251, 113, 133, 0.08), var(--bg-card) 55%);
}
.god-card.elephant:hover { border-color: var(--rose); }
.god-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.god-avatar {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 26px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid var(--border-gold);
  flex-shrink: 0;
}
.god-card.elephant .god-avatar { background: rgba(251, 113, 133, 0.14); border-color: var(--border-rose); }
.god-head-txt { flex: 1; min-width: 0; }
.god-name { font-size: 19px; font-weight: 900; color: var(--text); line-height: 1.25; }
.god-en { font-size: 12px; color: var(--muted); }
.rank-badge {
  font-size: 11px;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
  background: rgba(245, 158, 11, 0.16);
  color: var(--gold-hi);
  border: 1px solid var(--border-gold);
}
.rank-badge.cyan { background: rgba(56, 189, 248, 0.14); color: var(--cyan); border-color: var(--border-cyan); }
.rank-badge.rose { background: rgba(251, 113, 133, 0.16); color: var(--rose); border-color: var(--border-rose); }
.rank-badge.emerald { background: rgba(52, 211, 153, 0.14); color: var(--emerald); border-color: rgba(52, 211, 153, 0.4); }

.god-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--gold-hi);
  background: rgba(245, 158, 11, 0.08);
  padding: 6px 10px;
  border-radius: 9px;
  border-left: 3px solid var(--gold);
}
.god-card.elephant .god-title { color: var(--rose); background: rgba(251, 113, 133, 0.08); border-left-color: var(--rose); }
.god-nick { font-size: 12.5px; color: var(--cyan); font-weight: 650; }
.god-summary { font-size: 13.8px; color: var(--text-soft); line-height: 1.65; }
.god-foot {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
}
.god-tag-mini { color: var(--muted); }
.god-read-link { color: var(--gold-hi); font-weight: 800; }

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(4, 6, 12, 0.78);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-overlay.hidden { display: none; }
.modal-box {
  width: 100%;
  max-width: 840px;
  max-height: 90vh;
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  border-radius: 22px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
}
.modal-head {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: var(--bg-elev);
}
.modal-close {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 18px;
  cursor: pointer;
  flex-shrink: 0;
}
.modal-body {
  padding: 24px 26px 30px;
  overflow-y: auto;
  font-size: 15px;
  color: var(--text-soft);
}
.modal-body h3 {
  font-size: 17px;
  font-weight: 850;
  color: var(--text);
  margin: 20px 0 8px;
  padding-left: 10px;
  border-left: 3px solid var(--gold);
}
.modal-body ul { margin: 8px 0 14px 20px; }
.modal-body li { margin-bottom: 6px; }
.decree-box {
  padding: 15px 18px;
  border-radius: 13px;
  background: rgba(245, 158, 11, 0.09);
  border: 1px solid var(--border-gold);
  color: var(--text);
  margin-bottom: 14px;
}
.decree-box.elephant { background: rgba(251, 113, 133, 0.1); border-color: var(--border-rose); }
.code-box {
  margin: 14px 0;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-code);
  overflow: hidden;
}
.code-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 13px;
  background: rgba(255, 255, 255, 0.04);
  font-size: 12px;
  color: #94a3b8;
  font-family: ui-monospace, Menlo, monospace;
}
.copy-btn {
  border: 1px solid rgba(56, 189, 248, 0.35);
  background: rgba(56, 189, 248, 0.14);
  color: #7dd3fc;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 11.5px;
  cursor: pointer;
}
.code-box pre {
  padding: 14px;
  overflow-x: auto;
  font-family: ui-monospace, Menlo, monospace;
  font-size: 12.8px;
  line-height: 1.55;
  color: #e2e8f0;
}
.lesson-box {
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(52, 211, 153, 0.09);
  border: 1px solid rgba(52, 211, 153, 0.35);
  color: var(--text-soft);
  margin: 14px 0;
}
.modal-cta-row {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* CS Freshman Quiz */
.quiz-section {
  margin-top: 44px;
  background: var(--bg-card);
  border: 1px solid var(--border-cyan);
  border-radius: 20px;
  padding: 28px;
}
.quiz-section h2 { font-size: 22px; font-weight: 900; margin-bottom: 6px; }
.quiz-opts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin-top: 16px;
}
.quiz-btn {
  text-align: left;
  padding: 14px 16px;
  border-radius: 13px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text);
  font-size: 13.5px;
  font-weight: 650;
  cursor: pointer;
  transition: all 0.15s;
}
.quiz-btn:hover { border-color: var(--cyan); transform: translateY(-2px); }
.quiz-result {
  margin-top: 16px;
  padding: 18px;
  border-radius: 14px;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid var(--border-cyan);
}
.quiz-result.hidden { display: none; }

/* Bottom Funnel */
.mega-funnel {
  margin-top: 44px;
  padding: 36px 28px;
  border-radius: 22px;
  text-align: center;
  border: 1px solid var(--border-gold);
  background:
    radial-gradient(circle at 18% 20%, rgba(245, 158, 11, 0.16), transparent 50%),
    radial-gradient(circle at 82% 80%, rgba(56, 189, 248, 0.16), transparent 50%),
    var(--bg-card);
}
.mega-funnel h2 { font-size: clamp(22px, 3vw, 32px); font-weight: 900; margin-bottom: 10px; }
.mega-funnel p { max-width: 760px; margin: 0 auto 20px; color: var(--text-soft); }

.site-footer {
  border-top: 1px solid var(--border);
  padding: 26px 20px 42px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}
.site-footer p { margin-bottom: 6px; }

@media (max-width: 700px) {
  .gods-grid { grid-template-columns: 1fr; }
  .modal-body { padding: 18px 16px; }
  .hero-inner { padding: 36px 16px 30px; }
}
