/* ===================================================================
   《谁是凶手》暗黑侦探风主题
   =================================================================== */
:root {
  --bg-deep: #0c0c13;
  --bg-panel: #14141f;
  --bg-panel-2: #1a1a28;
  --bg-elevated: #20202f;
  --border: #26263c;
  --border-soft: #1f1f33;
  --text: #e9e9f0;
  --text-muted: #9a9ab2;
  --text-dim: #6c6c88;
  --purple: #7c5cbf;
  --purple-bright: #9d7bff;
  --red: #a8324a;
  --red-bright: #d04a63;
  --gold: #c9a24b;
  --gold-bright: #e6c36a;
  --green: #4fa07a;
  --navy: #1b2a4a;
  --radius: 12px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-deep);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", "Hiragino Sans GB", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* 背景氛围：迷雾 + 暗纹 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(1200px 600px at 15% -10%, rgba(124, 92, 191, 0.16), transparent 60%),
    radial-gradient(900px 500px at 90% 0%, rgba(168, 50, 74, 0.10), transparent 55%),
    radial-gradient(800px 700px at 50% 120%, rgba(27, 42, 74, 0.35), transparent 60%);
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
  background-image: radial-gradient(rgba(255,255,255,0.028) 1px, transparent 1px);
  background-size: 26px 26px;
}

.app-wrap { position: relative; z-index: 1; min-height: 100vh; display: flex; flex-direction: column; }
.app-main { flex: 1; }

a { color: var(--purple-bright); text-decoration: none; }
a:hover { color: #bca6ff; }

/* ---------- 导航栏 ---------- */
.navbar-detective {
  background: rgba(12, 12, 19, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.navbar-detective .navbar-brand {
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.brand-mark {
  width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(135deg, var(--purple), var(--red));
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 900; color: #fff; font-size: 15px;
}
.navbar-detective .nav-link { color: var(--text-muted); font-weight: 500; }
.navbar-detective .nav-link:hover,
.navbar-detective .nav-link.active { color: var(--text); }
.coin-pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(201, 162, 75, 0.12);
  border: 1px solid rgba(201, 162, 75, 0.35);
  color: var(--gold-bright);
  padding: 4px 12px; border-radius: 20px; font-weight: 700; font-size: 14px;
}
.medal-pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(124, 92, 191, 0.14);
  border: 1px solid rgba(124, 92, 191, 0.4);
  color: #cbb6ff;
  padding: 4px 12px; border-radius: 20px; font-weight: 700; font-size: 14px;
}

/* ---------- 卡片 ---------- */
.panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.panel-2 { background: var(--bg-panel-2); border: 1px solid var(--border-soft); border-radius: var(--radius); }

/* ---------- 按钮 ---------- */
.btn-brand {
  background: linear-gradient(135deg, #6d4fc0, #8a5cd6);
  color: #fff; border: none; font-weight: 600;
}
.btn-brand:hover { color: #fff; background: linear-gradient(135deg, #7c5cbf, #9d7bff); }
.btn-danger-dark {
  background: linear-gradient(135deg, #7a2434, #a8324a);
  color: #fff; border: none; font-weight: 600;
}
.btn-danger-dark:hover { color: #fff; background: linear-gradient(135deg, #a8324a, #d04a63); }
.btn-outline-brand {
  color: var(--purple-bright); border: 1px solid rgba(124,92,191,0.5); font-weight: 600;
}
.btn-outline-brand:hover { background: rgba(124,92,191,0.14); color: #cbb6ff; border-color: var(--purple-bright); }

/* ---------- 首页 hero ---------- */
.hero {
  padding: 72px 0 56px;
  text-align: center;
  position: relative;
}
.hero .hero-title {
  font-size: clamp(30px, 6vw, 52px);
  font-weight: 900; letter-spacing: 2px;
  background: linear-gradient(180deg, #fff, #c9b7ff);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero .hero-slogan { color: var(--text-muted); margin-top: 14px; font-size: 16px; letter-spacing: 3px; }

.section-title {
  font-weight: 800; letter-spacing: 1px; margin-bottom: 20px;
  display: flex; align-items: center; gap: 10px;
}
.section-title::before {
  content: ""; width: 4px; height: 20px; border-radius: 2px;
  background: linear-gradient(180deg, var(--purple), var(--red));
}

/* ---------- 案件卡片 ---------- */
.case-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .18s ease, border-color .18s ease;
  height: 100%;
  display: flex; flex-direction: column;
}
.case-card:hover { transform: translateY(-4px); border-color: rgba(124,92,191,0.55); }
.case-card .case-body { padding: 16px; flex: 1; display: flex; flex-direction: column; gap: 10px; }
.case-tag { font-size: 12px; padding: 2px 8px; border-radius: 6px; font-weight: 600; }
.tag-type { background: rgba(27,42,74,0.7); color: #8fb4ff; }
.tag-diff { background: rgba(168,50,74,0.2); color: #ff9db0; }
.tag-diff.easy { background: rgba(79,160,122,0.2); color: #8fe0b8; }

.state-badge { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 6px; }
.filter-label { font-size: 12px; font-weight: 700; color: var(--text-dim); letter-spacing: 1px; margin-right: 2px; }

/* 充值档位卡片 */
.recharge-tier { position: relative; }
.recharge-tier.tier-hot { border-color: rgba(201, 162, 75, 0.55); background: linear-gradient(180deg, rgba(201,162,75,0.10), var(--bg-panel) 60%); }
.tier-badge {
  position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
  background: linear-gradient(135deg, #e6c36a, #c9a24b);
  color: #1a1a24; font-size: 11px; font-weight: 800;
  padding: 3px 12px; border-radius: 999px; letter-spacing: 1px;
  white-space: nowrap;
}
.state-locked { background: rgba(108,108,136,0.18); color: var(--text-dim); }
.state-doing { background: rgba(201,162,75,0.16); color: var(--gold-bright); }
.state-done { background: rgba(79,160,122,0.16); color: #8fe0b8; }

/* ---------- 游玩页 ---------- */
.story-text {
  line-height: 2; font-size: 16.5px; color: #d8d8e6;
  white-space: pre-wrap;
}
.suspect-card {
  background: var(--bg-panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.suspect-card:hover { border-color: rgba(124,92,191,0.5); }
.suspect-card.selected { border-color: var(--purple-bright); background: rgba(124,92,191,0.12); }
.suspect-card:has(input:checked) { border-color: var(--purple-bright); background: rgba(124,92,191,0.12); }

/* 内容页板块标题（紧凑型） */
.section-head.compact { margin-bottom: 20px; }
.section-head.compact h2 { font-size: 18px; }
.section-head.compact .title-bar { height: 20px; }
.suspect-avatar {
  width: 46px; height: 46px; border-radius: 50%;
  background: linear-gradient(135deg, #333, #20202f);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; color: #cbb6ff; font-size: 18px;
}

/* ---------- 排行榜 ---------- */
.rank-row {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 14px; border-radius: 10px;
  background: var(--bg-panel-2); border: 1px solid var(--border-soft);
  margin-bottom: 10px;
}
.rank-num { font-weight: 900; font-size: 18px; width: 40px; text-align: center; color: var(--text-dim); }
.rank-num.top { color: var(--gold-bright); }

/* ---------- 勋章/段位 ---------- */
.rank-name {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 8px; font-weight: 800; letter-spacing: 1px;
  background: linear-gradient(135deg, rgba(124,92,191,0.25), rgba(168,50,74,0.25));
  border: 1px solid rgba(124,92,191,0.5);
  color: #e7dcff;
}

/* ---------- 规则页 ---------- */
.rule-block { padding: 20px; margin-bottom: 16px; }

/* ---------- 表单 ---------- */
.form-control, .form-select {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
}
.form-control:focus, .form-select:focus {
  background: var(--bg-elevated);
  border-color: var(--purple-bright);
  color: var(--text);
  box-shadow: 0 0 0 3px rgba(124,92,191,0.18);
}
.form-label { color: var(--text-muted); font-weight: 600; }

/* ---------- 表格 ---------- */
.table { color: var(--text); }
.table-dark-detective {
  --bs-table-bg: transparent;
  --bs-table-border-color: var(--border-soft);
  --bs-table-color: var(--text);
}
.table-dark-detective > :not(caption) > * > * {
  color: var(--text);
  background-color: transparent;
}
.table-dark-detective thead th {
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  font-weight: 600;
}

/* ---------- 页脚 ---------- */
.footer {
  border-top: 1px solid var(--border);
  padding: 28px 0;
  color: var(--text-dim);
  margin-top: 40px;
}

/* ---------- 二维码 ---------- */
.qr-box {
  background: #fff; border-radius: 12px; padding: 16px;
  display: inline-block; box-shadow: 0 0 40px rgba(124,92,191,0.25);
}
.qr-box canvas, .qr-box img { display: block; }

/* ---------- 动画 ---------- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fadeUp .5s ease both; }

/* ===================================================================
   首页 / 排行榜增强
   =================================================================== */

/* Hero 徽章 */
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 18px; border-radius: 999px;
  background: rgba(124, 92, 191, 0.10);
  border: 1px solid rgba(124, 92, 191, 0.35);
  color: #cbb6ff; font-size: 13px; letter-spacing: 3px; font-weight: 600;
  margin-bottom: 22px;
}

/* Hero 统计条 */
.hero-stats {
  display: flex; justify-content: center; flex-wrap: wrap;
  margin-top: 50px; padding-top: 30px;
  border-top: 1px solid var(--border-soft);
}
.hero-stat {
  padding: 0 42px; text-align: center; min-width: 130px; position: relative;
}
.hero-stat:not(:last-child)::after {
  content: ""; position: absolute; right: 0; top: 12%;
  height: 76%; width: 1px; background: var(--border);
}
.hero-stat .num {
  font-size: 32px; font-weight: 900; line-height: 1.15;
  background: linear-gradient(180deg, #fff, #cbb6ff);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-stat .label { font-size: 13px; color: var(--text-muted); margin-top: 6px; letter-spacing: 1px; }

/* 区块标题 */
.section-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  margin-bottom: 26px; gap: 12px;
}
.section-head .title-wrap { display: flex; align-items: center; gap: 12px; }
.section-head .title-bar {
  width: 4px; height: 26px; border-radius: 2px; flex-shrink: 0;
  background: linear-gradient(180deg, var(--purple), var(--red));
}
.section-head h2 { font-weight: 800; letter-spacing: 1px; margin: 0; font-size: 22px; }
.section-head .sub { color: var(--text-dim); font-size: 13px; margin-top: 4px; }
.section-head .more { color: var(--text-muted); font-size: 14px; white-space: nowrap; }
.section-head .more:hover { color: var(--purple-bright); }

/* 案件卡片封面 */
.case-cover {
  height: 120px;
  background: linear-gradient(135deg, rgba(124,92,191,0.50), rgba(168,50,74,0.42));
  position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.case-cover::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at 80% 20%, rgba(255,255,255,0.16), transparent 48%);
}
.case-cover .cover-num {
  font-size: 46px; font-weight: 900; letter-spacing: 4px;
  color: rgba(255,255,255,0.22);
}
.case-cover .cover-type {
  position: absolute; left: 12px; bottom: 10px;
  font-size: 12px; font-weight: 700; color: rgba(255,255,255,0.9);
  padding: 3px 10px; border-radius: 6px;
  background: rgba(0,0,0,0.30); backdrop-filter: blur(4px);
}

/* 排行榜领奖台（前三名） */
.rank-podium { margin-bottom: 26px; }
.podium-card {
  background: var(--bg-panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 18px; text-align: center; height: 100%;
  position: relative; overflow: hidden;
  transition: transform .18s ease, border-color .18s ease;
}
.podium-card:hover { transform: translateY(-4px); }
.podium-card.rank-1 { border-color: rgba(240,199,94,0.5); background: linear-gradient(180deg, rgba(240,199,94,0.10), var(--bg-panel-2) 62%); }
.podium-card.rank-2 { border-color: rgba(192,200,216,0.4); background: linear-gradient(180deg, rgba(192,200,216,0.08), var(--bg-panel-2) 62%); }
.podium-card.rank-3 { border-color: rgba(205,154,91,0.45); background: linear-gradient(180deg, rgba(205,154,91,0.10), var(--bg-panel-2) 62%); }
.podium-medal {
  width: 44px; height: 44px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 18px; color: #1a1a24; margin-bottom: 14px;
}
.podium-card.rank-1 .podium-medal { background: linear-gradient(135deg, #ffe08a, #f0c75e); box-shadow: 0 4px 16px rgba(240,199,94,0.4); }
.podium-card.rank-2 .podium-medal { background: linear-gradient(135deg, #e6ecf5, #b8c4d4); box-shadow: 0 4px 16px rgba(192,200,216,0.3); }
.podium-card.rank-3 .podium-medal { background: linear-gradient(135deg, #e8c39a, #cd9a5b); box-shadow: 0 4px 16px rgba(205,154,91,0.3); }
.podium-avatar {
  width: 62px; height: 62px; border-radius: 50%;
  background: linear-gradient(135deg, #3a3a52, #1f1f33);
  border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; color: #cbb6ff; font-size: 24px;
  margin: 0 auto 12px;
}
.podium-name { font-weight: 700; font-size: 16px; }
.podium-rankname {
  display: inline-block; margin-top: 6px;
  font-size: 12px; font-weight: 700; letter-spacing: 1px;
  padding: 3px 12px; border-radius: 6px;
  background: rgba(124,92,191,0.18); color: #d8c8ff;
  border: 1px solid rgba(124,92,191,0.4);
}
.podium-medals { margin-top: 10px; font-size: 14px; color: var(--gold-bright); font-weight: 700; }

/* 排行榜列表行（4-10名） */
.rank-row {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 18px; border-radius: 12px;
  background: var(--bg-panel-2); border: 1px solid var(--border-soft);
  margin-bottom: 10px; transition: border-color .15s ease;
}
.rank-row:hover { border-color: rgba(124,92,191,0.4); }
.rank-num { font-weight: 900; font-size: 18px; width: 42px; text-align: center; color: var(--text-dim); flex-shrink: 0; }
.rank-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(135deg, #33334a, #20202f);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: #cbb6ff; flex-shrink: 0;
}
.rank-info { flex: 1; min-width: 0; }
.rank-nickname { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-tag { font-size: 12px; color: #9a9ab2; }
.rank-medals { font-weight: 700; color: var(--gold-bright); flex-shrink: 0; }

/* 步骤卡片 */
.step-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 22px; height: 100%;
  position: relative; overflow: hidden;
  transition: transform .18s ease, border-color .18s ease;
}
.step-card:hover { transform: translateY(-4px); border-color: rgba(124,92,191,0.5); }
.step-num {
  font-size: 44px; font-weight: 900; line-height: 1;
  background: linear-gradient(180deg, rgba(124,92,191,0.9), rgba(168,50,74,0.9));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  margin-bottom: 14px;
}
.step-card h5 { font-weight: 700; margin-bottom: 8px; }
.step-card p { color: var(--text-muted); font-size: 14px; margin: 0; line-height: 1.8; }

/* 底部 CTA */
.cta {
  background: linear-gradient(135deg, rgba(124,92,191,0.18), rgba(168,50,74,0.16));
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 48px 24px; text-align: center; margin-top: 60px;
}
.cta h3 { font-weight: 800; letter-spacing: 1px; }
.cta p { color: var(--text-muted); margin: 12px 0 24px; }

/* ---------- 移动端适配 ---------- */
@media (max-width: 576px) {
  .hero { padding: 48px 0 36px; }
  .story-text { font-size: 15.5px; }
  .hero-stat { padding: 10px 24px; min-width: 45%; }
  .hero-stat:not(:last-child)::after { display: none; }
  .section-head { flex-direction: column; align-items: flex-start; }
}
