/* ==========================================================================
   中考英语听说训练营 — 全局样式
   主题切换遵循 html.dark class 约定（与三角洲情报台一致）
   ========================================================================== */

:root {
  --bg: #f4f6fb;
  --bg-soft: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.86);
  --border: rgba(15, 23, 42, 0.10);
  --border-strong: rgba(15, 23, 42, 0.18);
  --text: #16203a;
  --text-dim: #5a6684;
  --text-faint: #8b95ad;
  --brand: #3b6ef5;
  --brand-2: #7a5cf0;
  --brand-soft: rgba(59, 110, 245, 0.10);
  --ok: #17a673;
  --warn: #e08a1e;
  --bad: #dc4b4b;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.10);
  --shadow-sm: 0 4px 14px rgba(15, 23, 42, 0.07);
  --radius: 16px;
}

html.dark {
  --bg: #0d1220;
  --bg-soft: #141a2b;
  --bg-card: rgba(23, 30, 48, 0.82);
  --border: rgba(148, 163, 184, 0.16);
  --border-strong: rgba(148, 163, 184, 0.30);
  --text: #e8ecf7;
  --text-dim: #a3adc6;
  --text-faint: #7c88a3;
  --brand: #6a92ff;
  --brand-2: #9d7bff;
  --brand-soft: rgba(106, 146, 255, 0.14);
  --ok: #35d39a;
  --warn: #f0ac4b;
  --bad: #f47272;
  --shadow: 0 12px 34px rgba(0, 0, 0, 0.45);
  --shadow-sm: 0 4px 16px rgba(0, 0, 0, 0.32);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, -apple-system, sans-serif;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background .25s ease, color .25s ease;
}

body {
  min-height: 100vh;
  background-image:
    radial-gradient(1100px 520px at 12% -8%, rgba(59, 110, 245, .14), transparent 60%),
    radial-gradient(900px 480px at 92% 4%, rgba(122, 92, 240, .13), transparent 60%);
  background-attachment: fixed;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap {
  width: min(1120px, 100% - 32px);
  margin: 0 auto;
}

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--border);
}
.topbar-in {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 60px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: .3px;
  color: var(--text);
}
.logo svg { width: 26px; height: 26px; flex: none; }
.logo small {
  display: block;
  font-weight: 500;
  font-size: 11px;
  color: var(--text-faint);
  letter-spacing: 0;
}
.topnav { display: flex; gap: 4px; margin-left: auto; align-items: center; }
.topnav a {
  padding: 7px 12px;
  border-radius: 9px;
  font-size: 14px;
  color: var(--text-dim);
  font-weight: 500;
}
.topnav a:hover { background: var(--brand-soft); color: var(--brand); text-decoration: none; }
.topnav a.on { background: var(--brand-soft); color: var(--brand); }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-dim);
  cursor: pointer;
  flex: none;
}
.icon-btn:hover { color: var(--brand); border-color: var(--brand); }
.icon-btn svg { width: 18px; height: 18px; }

/* ---------- Hero ---------- */
.hero {
  padding: 54px 0 34px;
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 34px;
  align-items: center;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .2px;
}
.eyebrow svg { width: 14px; height: 14px; }
h1 {
  margin: 16px 0 10px;
  font-size: clamp(28px, 4.6vw, 44px);
  line-height: 1.22;
  letter-spacing: -.5px;
}
h1 .grad {
  background: linear-gradient(100deg, var(--brand), var(--brand-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.lead {
  color: var(--text-dim);
  font-size: 15.5px;
  max-width: 58ch;
  margin: 0 0 20px;
}
.cta-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  background: var(--brand);
  color: #fff;
  box-shadow: 0 6px 18px rgba(59, 110, 245, .28);
  transition: transform .12s ease, filter .15s ease;
}
.btn:hover { filter: brightness(1.06); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn svg { width: 17px; height: 17px; }
.btn.ghost {
  background: var(--bg-card);
  color: var(--text);
  border-color: var(--border-strong);
  box-shadow: none;
}
.btn.ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn.sm { padding: 7px 13px; font-size: 13px; border-radius: 9px; }
.btn.danger { background: var(--bad); box-shadow: none; }

.hero-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 16px 14px;
  box-shadow: var(--shadow-sm);
}
.stat b { display: block; font-size: 26px; line-height: 1.2; letter-spacing: -.5px; }
.stat span { font-size: 12.5px; color: var(--text-faint); }
.stat.hi b { color: var(--brand); }

/* ---------- 区块 ---------- */
section { padding: 34px 0; }
.sec-head { margin-bottom: 20px; }
.sec-head h2 {
  margin: 0 0 6px;
  font-size: 23px;
  letter-spacing: -.3px;
  display: flex;
  align-items: center;
  gap: 9px;
}
.sec-head h2 svg { width: 21px; height: 21px; color: var(--brand); }
.sec-head p { margin: 0; color: var(--text-dim); font-size: 14.5px; }

/* 地区切换 */
.seg {
  display: inline-flex;
  padding: 4px;
  gap: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.seg button {
  padding: 8px 18px;
  border-radius: 9px;
  border: 0;
  background: transparent;
  color: var(--text-dim);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.seg button.on { background: var(--brand); color: #fff; box-shadow: 0 4px 12px rgba(59,110,245,.3); }

/* 题型卡片 */
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.card:hover { transform: translateY(-3px); border-color: var(--brand); box-shadow: var(--shadow); }
.card .ic {
  width: 40px; height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--brand-soft);
  color: var(--brand);
}
.card .ic svg { width: 21px; height: 21px; }
.card h3 { margin: 0; font-size: 16px; }
.card p { margin: 0; font-size: 13px; color: var(--text-dim); flex: 1; }
.card .score {
  font-size: 12px;
  font-weight: 700;
  color: var(--brand);
  background: var(--brand-soft);
  padding: 3px 9px;
  border-radius: 7px;
  align-self: flex-start;
}

/* 表格 */
.tbl-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
}
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--border); }
th { background: color-mix(in srgb, var(--brand) 8%, transparent); font-weight: 600; font-size: 13px; color: var(--text-dim); }
tr:last-child td { border-bottom: 0; }
td.num { font-variant-numeric: tabular-nums; color: var(--text-dim); }
td b { color: var(--brand); }

/* 要点列表 */
.tips { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.tip {
  display: flex;
  gap: 11px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 14px 15px;
}
.tip .num {
  flex: none;
  width: 22px; height: 22px;
  border-radius: 7px;
  background: var(--brand);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: grid;
  place-items: center;
}
.tip b { display: block; font-size: 14px; margin-bottom: 2px; }
.tip p { margin: 0; font-size: 12.8px; color: var(--text-dim); }

.note {
  font-size: 12.5px;
  color: var(--text-faint);
  border-left: 3px solid var(--border-strong);
  padding-left: 12px;
  margin-top: 14px;
  line-height: 1.7;
}

/* ---------- 练习页 ---------- */
.practice-bar {
  position: sticky;
  top: 60px;
  z-index: 40;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
}
.practice-bar .wrap { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pbar-title { font-weight: 700; font-size: 16px; }
.pbar-sub { font-size: 12.5px; color: var(--text-faint); }
.pbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.qcard {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
}
.qnum {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px; height: 26px;
  padding: 0 8px;
  border-radius: 8px;
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 700;
  font-size: 13px;
}
.qtitle { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 700; margin-bottom: 12px; }
.qtitle .pts { margin-left: auto; font-size: 12px; color: var(--text-faint); font-weight: 500; }

.audio-box {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 16px;
  border-radius: 13px;
  background: color-mix(in srgb, var(--brand) 7%, transparent);
  border: 1px dashed var(--brand);
  margin-bottom: 16px;
}
.audio-box .meta { font-size: 13px; color: var(--text-dim); }
.play-count { font-size: 12px; color: var(--warn); font-weight: 600; }
.wave { display: flex; align-items: center; gap: 3px; height: 26px; }
.wave i {
  display: block;
  width: 3px;
  height: 8px;
  border-radius: 2px;
  background: var(--brand);
  opacity: .35;
}
.playing .wave i { animation: wv .8s infinite ease-in-out; }
.playing .wave i:nth-child(2) { animation-delay: .1s; }
.playing .wave i:nth-child(3) { animation-delay: .2s; }
.playing .wave i:nth-child(4) { animation-delay: .3s; }
.playing .wave i:nth-child(5) { animation-delay: .15s; }
.playing .wave i:nth-child(6) { animation-delay: .25s; }
@keyframes wv { 0%,100% { height: 8px; opacity: .3; } 50% { height: 24px; opacity: 1; } }

/* 选项 */
.opts { display: flex; flex-direction: column; gap: 9px; margin-top: 4px; }
.opt {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-soft);
  cursor: pointer;
  font-size: 14.5px;
  transition: border-color .15s, background .15s;
}
.opt:hover { border-color: var(--brand); }
.opt .key {
  flex: none;
  width: 24px; height: 24px;
  border-radius: 7px;
  border: 1.5px solid var(--border-strong);
  display: grid;
  place-items: center;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-dim);
}
.opt.sel { border-color: var(--brand); background: var(--brand-soft); }
.opt.sel .key { background: var(--brand); border-color: var(--brand); color: #fff; }
.opt.right { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, transparent); }
.opt.right .key { background: var(--ok); border-color: var(--ok); color: #fff; }
.opt.wrong { border-color: var(--bad); background: color-mix(in srgb, var(--bad) 12%, transparent); }
.opt.wrong .key { background: var(--bad); border-color: var(--bad); color: #fff; }
.opt.locked { cursor: default; }

/* 笔记表 */
.notes-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.notes-grid label { display: block; font-size: 12.5px; color: var(--text-dim); margin-bottom: 4px; }
input[type="text"], input[type="number"], textarea, select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--bg-soft);
  color: var(--text);
  font-size: 14.5px;
  font-family: inherit;
}
textarea { resize: vertical; min-height: 92px; line-height: 1.7; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--brand); outline-offset: 1px; }

/* 录音区 */
.rec-zone {
  border: 1px dashed var(--border-strong);
  border-radius: 13px;
  padding: 18px;
  text-align: center;
  background: var(--bg-soft);
}
.rec-dot {
  width: 13px; height: 13px;
  border-radius: 50%;
  background: var(--bad);
  display: inline-block;
  margin-right: 7px;
  vertical-align: middle;
  animation: blink 1s infinite;
}
@keyframes blink { 50% { opacity: .25; } }
.rec-time { font-variant-numeric: tabular-nums; font-size: 15px; font-weight: 600; }

/* 评分卡 */
.score-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 14px 0; }
.score-grid .s {
  text-align: center;
  padding: 12px 8px;
  border-radius: 12px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
}
.score-grid .s b { display: block; font-size: 20px; }
.score-grid .s span { font-size: 11.5px; color: var(--text-faint); }
.grade { font-size: 15px; font-weight: 700; }
.grade.good { color: var(--ok); }
.grade.mid { color: var(--warn); }
.grade.bad { color: var(--bad); }

.kv { display: flex; gap: 10px; font-size: 13.5px; padding: 5px 0; }
.kv b { flex: none; color: var(--text-dim); font-weight: 600; }

.hint {
  background: color-mix(in srgb, var(--warn) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--warn) 40%, transparent);
  color: var(--text);
  padding: 10px 13px;
  border-radius: 10px;
  font-size: 13px;
  margin: 12px 0;
}
.hint svg { width: 15px; height: 15px; color: var(--warn); vertical-align: -2px; margin-right: 5px; }

.bar-wrap { height: 8px; border-radius: 999px; background: var(--border); overflow: hidden; margin-top: 6px; }
.bar-fill { height: 100%; background: linear-gradient(90deg, var(--brand), var(--brand-2)); width: 0; transition: width .6s ease; }

.done-banner {
  background: color-mix(in srgb, var(--ok) 12%, transparent);
  border: 1px solid var(--ok);
  border-radius: 13px;
  padding: 16px 18px;
  margin-bottom: 16px;
}
.done-banner h3 { margin: 0 0 6px; font-size: 16px; color: var(--ok); }
.done-banner p { margin: 0; font-size: 13.5px; color: var(--text-dim); }

footer {
  border-top: 1px solid var(--border);
  margin-top: 40px;
  padding: 26px 0 40px;
  color: var(--text-faint);
  font-size: 12.5px;
}
footer .wrap { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 22px; padding-top: 34px; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .tips { grid-template-columns: 1fr; }
  .score-grid { grid-template-columns: repeat(2, 1fr); }
  .topnav a.hide-sm { display: none; }
}
@media (max-width: 560px) {
  .grid-4 { grid-template-columns: 1fr; }
  .hero-stats { grid-template-columns: 1fr 1fr; }
}
