/* ============================================================
   听写小课堂 · 样式表（浅色 / 儿童友好）
   ============================================================ */

:root {
  --bg: #f5f7fc;
  --card: #ffffff;
  --ink: #1f2a44;
  --ink-2: #5a6782;
  --ink-3: #8f9bb3;
  --line: #e8ecf5;
  --brand: #4f7cff;
  --brand-2: #6d9bff;
  --brand-soft: #eaf0ff;
  --orange: #ff8a3d;
  --green: #16b26b;
  --green-soft: #e6f8ef;
  --red: #f05252;
  --red-soft: #fdecec;
  --purple: #8b5cf6;
  --radius: 20px;
  --radius-sm: 12px;
  --shadow: 0 6px 24px rgba(31, 42, 68, .07);
  --shadow-lg: 0 18px 48px rgba(31, 42, 68, .13);
  --font: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font-family: inherit; }

/* ---------- 背景装饰 ---------- */
.bg-decor { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.blob { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .45; }
.blob-1 { width: 420px; height: 420px; background: #c9dcff; top: -140px; left: -80px; }
.blob-2 { width: 360px; height: 360px; background: #ffe0c7; top: 20%; right: -120px; }
.blob-3 { width: 320px; height: 320px; background: #d9f3e6; bottom: -140px; left: 25%; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 14px 28px;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 800; letter-spacing: .5px; }
.brand-icon { font-size: 24px; }
.nav { display: flex; gap: 6px; }
.nav-btn {
  border: 0; background: transparent; color: var(--ink-2);
  padding: 9px 15px; border-radius: 999px; cursor: pointer;
  font-size: 14px; font-weight: 600; transition: .18s;
  display: flex; align-items: center; gap: 6px;
}
.nav-btn:hover { background: var(--brand-soft); color: var(--brand); }
.nav-btn.is-active { background: var(--brand); color: #fff; box-shadow: 0 6px 16px rgba(79, 124, 255, .3); }

/* ---------- 视图 ---------- */
main { position: relative; z-index: 1; max-width: 1120px; margin: 0 auto; padding: 28px 24px 130px; }
.view { display: none; animation: fadeUp .32s ease; }
.view.is-active { display: block; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- 通用组件 ---------- */
.btn {
  border: 0; cursor: pointer; border-radius: 14px;
  padding: 11px 18px; font-size: 15px; font-weight: 600;
  background: #eef1f8; color: var(--ink); transition: .16s;
  display: inline-flex; align-items: center; gap: 6px; justify-content: center;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.98); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn-primary { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; box-shadow: 0 8px 20px rgba(79, 124, 255, .28); }
.btn-soft { background: var(--brand-soft); color: var(--brand); }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: #eef1f8; }
.btn-danger { background: var(--red-soft); color: var(--red); }
.btn-lg { padding: 14px 26px; font-size: 16px; border-radius: 16px; }
.btn-sm { padding: 8px 13px; font-size: 13px; border-radius: 11px; }
.icon-btn { border: 0; background: #f1f3f9; width: 32px; height: 32px; border-radius: 10px; cursor: pointer; color: var(--ink-2); font-size: 15px; }
.icon-btn:hover { background: #e6eaf3; }

.section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 34px 0 14px; }
.section-head h2 { font-size: 19px; margin: 0; }
.section-hint { color: var(--ink-3); font-size: 13px; }
.muted { color: var(--ink-3); font-size: 13px; margin: 4px 0 0; }
code { background: #f1f3f9; padding: 1px 6px; border-radius: 6px; font-size: 12.5px; }
kbd { background: #fff; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; padding: 1px 6px; font-size: 12px; }

/* ---------- Hero ---------- */
.hero {
  display: flex; align-items: center; justify-content: space-between; gap: 28px;
  background: linear-gradient(135deg, #ffffff 0%, #f3f7ff 100%);
  border: 1px solid var(--line); border-radius: 26px;
  padding: 30px 34px; box-shadow: var(--shadow);
}
.hero h1 { font-size: 30px; line-height: 1.35; margin: 0 0 10px; }
.hero-sub { color: var(--ink-2); margin: 0 0 16px; max-width: 520px; line-height: 1.7; font-size: 14.5px; }
.hero-tips { display: flex; flex-wrap: wrap; gap: 10px; }
.tip { background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 6px 13px; font-size: 12.5px; color: var(--ink-2); }
.hero-right { display: flex; gap: 12px; }
.mini-card {
  background: #fff; border: 1px solid var(--line); border-radius: 16px;
  padding: 14px 18px; min-width: 96px; text-align: center; box-shadow: var(--shadow);
}
.mini-num { font-size: 26px; font-weight: 800; color: var(--brand); line-height: 1.2; }
.mini-num.ok { color: var(--green); }
.mini-num.bad { color: var(--red); }
.mini-label { font-size: 12px; color: var(--ink-3); margin-top: 3px; }

/* ---------- 词库选择 ---------- */
.bank-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(238px, 1fr)); gap: 14px; }
.bank-card {
  position: relative; text-align: left; cursor: pointer;
  background: var(--card); border: 2px solid var(--line); border-radius: var(--radius);
  padding: 18px; transition: .18s;
}
.bank-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: #cfdcff; }
.bank-card.is-active { border-color: var(--brand); background: linear-gradient(160deg, #fff, #f2f6ff); box-shadow: 0 10px 26px rgba(79, 124, 255, .18); }
.bank-emoji { font-size: 26px; }
.bank-name { font-size: 16px; font-weight: 700; margin: 8px 0 4px; }
.bank-desc { font-size: 12.5px; color: var(--ink-3); line-height: 1.5; min-height: 34px; }
.bank-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; font-size: 12px; color: var(--ink-3); }
.bank-bar { height: 6px; background: #eef1f8; border-radius: 99px; overflow: hidden; margin-top: 8px; }
.bank-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--purple)); border-radius: 99px; transition: width .5s; }
.bank-badge { position: absolute; top: 12px; right: 12px; font-size: 11px; padding: 3px 8px; border-radius: 99px; background: var(--brand-soft); color: var(--brand); font-weight: 700; }

/* ---------- 模式选择 ---------- */
.mode-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.mode-card {
  cursor: pointer; border: 2px solid var(--line); background: var(--card);
  border-radius: var(--radius); padding: 18px 16px; text-align: center; transition: .18s;
}
.mode-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.mode-card.is-active { border-color: var(--orange); background: linear-gradient(160deg, #fff, #fff5ee); box-shadow: 0 10px 26px rgba(255, 138, 61, .18); }
.mode-emoji { font-size: 28px; display: block; }
.mode-title { display: block; font-weight: 700; margin: 8px 0 4px; font-size: 15px; }
.mode-desc { display: block; font-size: 12px; color: var(--ink-3); line-height: 1.5; }

.start-bar {
  position: sticky; bottom: 18px; margin-top: 28px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: rgba(255, 255, 255, .92); backdrop-filter: blur(12px);
  border: 1px solid var(--line); border-radius: 18px; padding: 14px 18px; box-shadow: var(--shadow-lg);
}
.start-info { font-size: 14px; color: var(--ink-2); }
.start-info b { color: var(--brand); }

/* ---------- 练习页 ---------- */
.practice-head { display: flex; align-items: center; gap: 18px; margin-bottom: 22px; flex-wrap: wrap; }
.progress-wrap { flex: 1; min-width: 220px; }
.progress-bar { height: 10px; background: #e8ecf7; border-radius: 99px; overflow: hidden; }
.progress-bar i { display: block; height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, var(--brand), var(--purple)); transition: width .4s ease; }
.progress-text { font-size: 12.5px; color: var(--ink-3); margin-top: 6px; }
.practice-meta { display: flex; gap: 8px; }
.chip { background: #fff; border: 1px solid var(--line); border-radius: 99px; padding: 6px 13px; font-size: 13px; color: var(--ink-2); }
.chip b { color: var(--brand); }
.chip-life b { color: var(--red); }

.quiz-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 26px;
  padding: 34px 30px 28px; box-shadow: var(--shadow-lg);
  max-width: 720px; margin: 0 auto; text-align: center;
  transition: box-shadow .2s;
}
.quiz-card.is-right { box-shadow: 0 18px 48px rgba(22, 178, 107, .22); }
.quiz-card.is-wrong { animation: shake .42s; box-shadow: 0 18px 48px rgba(240, 82, 82, .2); }
@keyframes shake { 10%, 90% { transform: translateX(-2px); } 20%, 80% { transform: translateX(4px); } 30%, 50%, 70% { transform: translateX(-7px); } 40%, 60% { transform: translateX(7px); } }
.quiz-index { font-size: 13px; color: var(--ink-3); margin-bottom: 16px; }

.play-btn {
  width: 138px; height: 138px; border-radius: 50%; border: 0; cursor: pointer;
  background: linear-gradient(135deg, var(--brand), var(--purple));
  color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  margin: 0 auto; box-shadow: 0 14px 34px rgba(79, 124, 255, .35); transition: .2s;
}
.play-btn:hover { transform: scale(1.05); }
.play-btn:active { transform: scale(.96); }
.ico-play { width: 44px; height: 44px; fill: #fff; }
.play-label { font-size: 12.5px; opacity: .92; }
.play-btn.is-playing { animation: pulse 1.2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(79, 124, 255, .45); } 70% { box-shadow: 0 0 0 22px rgba(79, 124, 255, 0); } 100% { box-shadow: 0 0 0 0 rgba(79, 124, 255, 0); } }

.wave { display: flex; align-items: flex-end; justify-content: center; gap: 4px; height: 26px; margin-top: 16px; opacity: 0; transition: .2s; }
.wave.on { opacity: 1; }
.wave i { width: 4px; height: 8px; border-radius: 99px; background: var(--brand); animation: bounce .9s infinite ease-in-out; }
.wave i:nth-child(2) { animation-delay: .1s; } .wave i:nth-child(3) { animation-delay: .2s; }
.wave i:nth-child(4) { animation-delay: .3s; } .wave i:nth-child(5) { animation-delay: .4s; }
.wave i:nth-child(6) { animation-delay: .5s; } .wave i:nth-child(7) { animation-delay: .6s; }
@keyframes bounce { 0%, 100% { height: 8px; } 50% { height: 24px; } }

.meaning-box {
  margin: 18px auto 0; max-width: 520px; background: #fff8f0; border: 1px dashed #ffd2ab;
  border-radius: 14px; padding: 14px 18px; font-size: 17px; color: #a35a1e; line-height: 1.6;
}
.meaning-box small { display: block; font-size: 12px; color: var(--ink-3); margin-bottom: 4px; }

/* 舞台：播放按钮与倒计时共用中间区域 */
.stage { display: flex; align-items: center; justify-content: center; min-height: 150px; }
.timer { position: relative; width: 138px; height: 138px; animation: fadeUp .2s; }
.timer svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.t-bg { fill: none; stroke: #eef1f8; stroke-width: 10; }
.t-fg { fill: none; stroke: var(--orange); stroke-width: 10; stroke-linecap: round; stroke-dasharray: 327; stroke-dashoffset: 0; transition: stroke-dashoffset .25s linear, stroke .25s; }
.timer-num { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 40px; font-weight: 800; color: var(--orange); }
.timer.urgent .t-fg { stroke: var(--red); }
.timer.urgent .timer-num { color: var(--red); animation: blink .8s infinite; }
@keyframes blink { 50% { opacity: .4; } }

.stage-tip { margin-top: 12px; font-size: 14.5px; color: var(--ink-2); min-height: 22px; line-height: 1.6; }
.action-row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }
.hint-text { margin-top: 10px; font-size: 13.5px; color: var(--orange); font-weight: 600; min-height: 19px; }

/* 答案卡（自评） */
.answer-card {
  margin-top: 22px; border-radius: 18px; padding: 24px 20px;
  background: linear-gradient(160deg, #f6f9ff, #ffffff); border: 1px solid var(--line);
  animation: fadeUp .28s;
}
.answer-label { font-size: 12.5px; color: var(--ink-3); letter-spacing: 2px; }
.answer-word { font-size: 40px; font-weight: 800; margin: 6px 0; letter-spacing: 1px; word-break: break-word; line-height: 1.25; }
.answer-mean { font-size: 14px; color: var(--ink-2); }
.self-check { display: flex; gap: 12px; justify-content: center; margin-top: 20px; flex-wrap: wrap; }
.self-note { font-size: 12.5px; color: var(--ink-3); margin-top: 14px; }
.btn-success { background: var(--green); color: #fff; box-shadow: 0 8px 20px rgba(22, 178, 107, .25); }

/* 一次性批改 */
.grading-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 26px;
  padding: 30px 26px; box-shadow: var(--shadow-lg); max-width: 880px; margin: 0 auto; animation: fadeUp .3s;
}
.grading-head { text-align: center; margin-bottom: 20px; }
.grading-head h2 { margin: 0 0 6px; font-size: 22px; }
.grading-head p { margin: 0; color: var(--ink-2); font-size: 14px; }
.grading-stat {
  display: inline-block; margin-top: 14px; background: var(--brand-soft); color: var(--brand);
  border-radius: 999px; padding: 7px 18px; font-size: 13px;
}
.grading-stat b { font-size: 16px; }
.grade-list {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(248px, 1fr));
  gap: 10px; max-height: 54vh; overflow: auto; padding: 4px;
}
.grade-item {
  display: flex; align-items: center; gap: 10px; background: #fbfcff;
  border: 2px solid var(--line); border-radius: 14px; padding: 10px 12px;
  cursor: pointer; transition: .15s;
}
.grade-item:hover { border-color: #cfdcff; transform: translateY(-1px); }
.grade-item.is-wrong { background: var(--red-soft); border-color: #f7c5c5; }
.grade-item.is-wrong .grade-w { color: var(--red); }
.grade-no { width: 24px; font-weight: 700; color: var(--ink-3); font-size: 13px; flex: none; }
.grade-main { flex: 1; min-width: 0; }
.grade-w { font-weight: 700; font-size: 15.5px; word-break: break-word; line-height: 1.3; }
.grade-m { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.grade-flag {
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center; font-size: 15px; background: #e8f7ef;
}
.grade-item.is-wrong .grade-flag { background: #fbdada; }
.grade-say { border: 0; background: transparent; cursor: pointer; font-size: 14px; opacity: .45; padding: 5px; border-radius: 8px; flex: none; }
.grade-say:hover { opacity: 1; background: #eef1f8; }
.grading-foot { display: flex; gap: 12px; justify-content: center; margin-top: 22px; flex-wrap: wrap; }

/* ---------- 结果页 ---------- */
.result-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 26px;
  padding: 36px 30px; box-shadow: var(--shadow-lg); max-width: 720px; margin: 0 auto; text-align: center;
}
.score-ring { position: relative; width: 168px; height: 168px; margin: 0 auto 10px; }
.score-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: #eef1f8; stroke-width: 12; }
.ring-fg { fill: none; stroke: var(--brand); stroke-width: 12; stroke-linecap: round; stroke-dasharray: 327; stroke-dashoffset: 327; transition: stroke-dashoffset 1s cubic-bezier(.2, .8, .2, 1); }
.score-inner { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.score-num { font-size: 40px; font-weight: 800; color: var(--brand); line-height: 1; }
.score-unit { font-size: 12px; color: var(--ink-3); margin-top: 4px; }
.stars { font-size: 26px; letter-spacing: 4px; margin: 6px 0 4px; min-height: 34px; }
.result-title { margin: 6px 0 4px; font-size: 24px; }
.result-sub { color: var(--ink-2); margin: 0 0 22px; font-size: 14.5px; }
.result-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 24px; }
.result-grid.wide { max-width: 720px; margin: 0 auto 28px; }
.wrong-review { text-align: left; margin-bottom: 24px; }
.wrong-review h3 { font-size: 16px; margin: 0 0 12px; }
.wrong-list { display: flex; flex-direction: column; gap: 8px; }
.wrong-item {
  display: flex; align-items: center; gap: 12px; background: #fbfcff;
  border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px;
}
.wrong-item .w { font-weight: 700; font-size: 16px; min-width: 120px; }
.wrong-item .m { flex: 1; font-size: 13px; color: var(--ink-2); }
.wrong-item.your { color: var(--red); text-decoration: line-through; font-size: 13px; }
.result-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ---------- 词库管理 ---------- */
.words-layout { display: grid; grid-template-columns: 262px 1fr; gap: 18px; align-items: start; }
.words-side, .words-main { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.side-head, .bank-detail-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 10px; }
.side-head h2, .bank-detail-head h2 { font-size: 17px; margin: 0; }
.bank-list { display: flex; flex-direction: column; gap: 6px; }
.bank-list-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px;
  cursor: pointer; border: 1px solid transparent; transition: .15s; text-align: left; width: 100%;
  background: transparent; font-size: 14px;
}
.bank-list-item:hover { background: #f4f7ff; }
.bank-list-item.is-active { background: var(--brand-soft); border-color: #cfdcff; color: var(--brand); font-weight: 700; }
.bank-list-item .cnt { margin-left: auto; font-size: 12px; color: var(--ink-3); font-weight: 400; }
.side-foot { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.bank-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.bank-actions select { width: auto; padding: 8px 10px; font-size: 13px; }

.table-wrap { max-height: 60vh; overflow: auto; border-radius: 12px; border: 1px solid var(--line); }
.word-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.word-table th {
  position: sticky; top: 0; background: #f7f9fd; text-align: left; padding: 11px 12px;
  font-size: 12.5px; color: var(--ink-3); font-weight: 600; border-bottom: 1px solid var(--line);
}
.word-table td { padding: 9px 12px; border-bottom: 1px solid #f1f3f9; vertical-align: middle; }
.word-table tr:hover td { background: #fbfcff; }
.word-table input { width: 100%; border: 1px solid transparent; background: transparent; border-radius: 8px; padding: 6px 8px; font-size: 14px; color: var(--ink); }
.word-table input:hover { border-color: var(--line); }
.word-table input:focus { outline: none; border-color: var(--brand); background: #fff; }
.mastery { font-size: 12px; padding: 3px 9px; border-radius: 99px; white-space: nowrap; }
.mastery.none { background: #f1f3f9; color: var(--ink-3); }
.mastery.ok { background: var(--green-soft); color: var(--green); }
.mastery.weak { background: var(--red-soft); color: var(--red); }
.del-row { border: 0; background: transparent; cursor: pointer; color: var(--ink-3); font-size: 15px; padding: 4px 8px; border-radius: 8px; }
.del-row:hover { background: var(--red-soft); color: var(--red); }

/* ---------- 成绩页 ---------- */
.history-list { display: flex; flex-direction: column; gap: 8px; }
.history-item { display: flex; align-items: center; gap: 14px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 13px 16px; }
.history-item .h-name { font-weight: 700; font-size: 14.5px; min-width: 130px; }
.history-item .h-date { font-size: 12.5px; color: var(--ink-3); }
.history-item .h-score { margin-left: auto; font-weight: 800; color: var(--brand); }
.big .wrong-item { padding: 14px 16px; }
.empty { text-align: center; color: var(--ink-3); padding: 40px 20px; font-size: 14px; }

/* ---------- 抽屉 / 弹窗 ---------- */
.drawer-mask, .modal-mask {
  position: fixed; inset: 0; background: rgba(24, 32, 51, .38); z-index: 40;
  opacity: 0; visibility: hidden; transition: .25s; backdrop-filter: blur(2px);
}
.drawer-mask.on, .modal-mask.on { opacity: 1; visibility: visible; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 400px; max-width: 92vw; z-index: 41;
  background: #fff; box-shadow: -20px 0 60px rgba(24, 32, 51, .18);
  transform: translateX(102%); transition: transform .3s cubic-bezier(.2, .8, .2, 1);
  display: flex; flex-direction: column;
}
.drawer.on { transform: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { font-size: 17px; margin: 0; }
.drawer-body { padding: 8px 22px 22px; overflow: auto; flex: 1; }
.drawer-foot { display: flex; gap: 10px; padding-top: 8px; }
.drawer-foot .btn-primary { flex: 1; }

.set-group { padding: 18px 0; border-bottom: 1px solid var(--line); }
.set-item { margin-bottom: 20px; }
.set-group .set-item:last-child { margin-bottom: 0; }
.set-item label { display: flex; justify-content: space-between; align-items: center; font-size: 14.5px; font-weight: 600; margin-bottom: 10px; }
.set-val { color: var(--brand); font-weight: 700; font-size: 13.5px; }
.set-note { font-size: 12.5px; color: var(--ink-3); line-height: 1.6; margin: 8px 0 0; }
.set-item.row { display: flex; align-items: flex-end; gap: 10px; }
.set-item.row > div { flex: 1; }
.set-item.row label { display: block; margin-bottom: 6px; }
input[type=range] { width: 100%; accent-color: var(--brand); }
select { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; font-size: 13.5px; background: #fbfcff; color: var(--ink); }

.switch { display: flex !important; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; font-weight: 500 !important; margin-bottom: 14px; text-align: left; }
.switch:last-child { margin-bottom: 0; }
.switch input { display: none; }
.switch-box { width: 42px; height: 24px; border-radius: 99px; background: #dfe4ef; position: relative; transition: .2s; flex: none; }
.switch-box::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: .2s; box-shadow: 0 1px 3px rgba(0, 0, 0, .18); }
.switch input:checked + .switch-box { background: var(--brand); }
.switch input:checked + .switch-box::after { transform: translateX(18px); }

.modal {
  position: fixed; z-index: 41; top: 50%; left: 50%; transform: translate(-50%, -46%) scale(.97);
  width: 560px; max-width: 92vw; background: #fff; border-radius: 22px; box-shadow: var(--shadow-lg);
  opacity: 0; visibility: hidden; transition: .25s;
}
.modal.on { opacity: 1; visibility: visible; transform: translate(-50%, -50%) scale(1); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 10px; }
.modal-head h2 { font-size: 17px; margin: 0; }
.modal-body { padding: 0 24px; }
.modal-body textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 14px; padding: 14px; font-size: 14px;
  line-height: 1.7; resize: vertical; outline: none; background: #fbfcff; color: var(--ink);
}
.modal-body textarea:focus { border-color: var(--brand); background: #fff; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 18px 24px 22px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 40px; transform: translate(-50%, 20px);
  background: rgba(31, 42, 68, .94); color: #fff; padding: 12px 22px; border-radius: 14px;
  font-size: 14px; z-index: 60; opacity: 0; visibility: hidden; transition: .25s; box-shadow: var(--shadow-lg);
}
.toast.on { opacity: 1; visibility: visible; transform: translate(-50%, 0); }

/* ---------- 打印：听写纸 / 答案纸 ---------- */
#print-area { display: none; }
@media print {
  @page { margin: 16mm; }
  body { background: #fff; }
  .bg-decor, .topbar, main, .drawer, .drawer-mask, .modal, .modal-mask, .toast { display: none !important; }
  #print-area { display: block !important; }
  .sheet { font-size: 15px; color: #000; }
  .sheet h1 { font-size: 19px; text-align: center; margin: 0 0 4px; }
  .sheet-meta { text-align: center; font-size: 12px; color: #666; margin-bottom: 20px; }
  .sheet-cols { column-count: 2; column-gap: 26px; }
  .sheet-row { display: flex; align-items: flex-end; gap: 8px; margin-bottom: 13px; break-inside: avoid; }
  .sheet-no { width: 30px; font-weight: 700; flex: none; }
  .sheet-line { flex: 1; border-bottom: 1px solid #555; height: 25px; }
  .sheet-word { flex: 1; font-size: 16px; font-weight: 600; border-bottom: 1px solid #ccc; height: 25px; }
  .sheet-mean { flex: 1; font-size: 12px; color: #666; }
  .sheet-foot { margin-top: 22px; font-size: 12px; color: #888; text-align: center; }
}

/* ---------- 响应式 ---------- */
@media (max-width: 860px) {
  .hero { flex-direction: column; align-items: flex-start; padding: 24px; }
  .hero-right { width: 100%; }
  .mini-card { flex: 1; }
  .words-layout { grid-template-columns: 1fr; }
  .result-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .topbar { padding: 10px 14px; flex-wrap: wrap; }
  .brand-text { font-size: 16px; }
  .nav { width: 100%; overflow-x: auto; }
  .nav-btn { padding: 8px 12px; font-size: 13px; }
  main { padding: 18px 14px 96px; }
  .hero h1 { font-size: 23px; }
  .quiz-card { padding: 26px 18px 22px; border-radius: 22px; }
  .play-btn { width: 116px; height: 116px; }
  .ico-play { width: 38px; height: 38px; }
  .answer-row { flex-direction: column; }
  .answer-input { font-size: 17px; }
  .start-bar { flex-direction: column; align-items: stretch; text-align: center; }
  .result-actions .btn { width: 100%; }
  .wrong-item { flex-wrap: wrap; }
  .wrong-item .w { min-width: 90px; }
}
