/* ============================================================
 * 英语六级刷题库 - 样式（清爽学习风，响应式）
 * ============================================================ */
:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --ink: #1f2733;
  --muted: #6b7686;
  --line: #e6eaf0;
  --brand: #4f46e5;
  --brand-soft: #eef0ff;
  --ok: #16a34a;
  --ok-soft: #e7f6ec;
  --no: #dc2626;
  --no-soft: #fdeaea;
  --warn: #d97706;
  --shadow: 0 1px 3px rgba(20, 30, 60, .06), 0 8px 24px rgba(20, 30, 60, .06);
  --radius: 14px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); }

/* 顶栏 */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px;
  background: linear-gradient(135deg, #4f46e5, #6366f1);
  color: #fff;
  position: sticky; top: 0; z-index: 20;
}
.brand { font-size: 18px; font-weight: 700; letter-spacing: .5px; }
.header-info { display: flex; gap: 14px; font-size: 13px; opacity: .95; }
.header-info span { background: rgba(255,255,255,.18); padding: 3px 10px; border-radius: 999px; }

/* 导航 */
.navbar {
  display: flex; gap: 6px; overflow-x: auto;
  padding: 10px 14px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 53px; z-index: 15;
}
.navbtn {
  flex: 0 0 auto;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 14px; cursor: pointer;
  transition: all .15s;
}
.navbtn:hover { background: var(--brand-soft); color: var(--brand); }
.navbtn.active { background: var(--brand); color: #fff; }

/* 主体 */
.view { max-width: 880px; margin: 0 auto; padding: 20px 16px 60px; }
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px;
  box-shadow: var(--shadow); margin-bottom: 18px;
}
.card h2 { margin: 0 0 14px; font-size: 20px; }
.card h3 { margin: 22px 0 10px; font-size: 16px; color: var(--ink); }
.card.center, .card.center * { text-align: center; }
.card.center .row { justify-content: center; }

label { display: block; font-size: 13px; color: var(--muted); margin: 14px 0 6px; }
select, input[type="number"], input[type="text"] {
  width: 100%; padding: 10px 12px; font-size: 15px;
  border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink);
}
.radios { display: flex; gap: 18px; padding: 6px 0; }
.radios label { margin: 0; display: inline-flex; align-items: center; gap: 6px; color: var(--ink); font-size: 15px; }

.row { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; align-items: center; }
button { font-family: inherit; }
button.primary {
  background: var(--brand); color: #fff; border: none;
  padding: 11px 20px; border-radius: 10px; font-size: 15px; cursor: pointer;
  transition: filter .15s;
}
button.primary:hover { filter: brightness(1.05); }
button.ghost {
  background: #fff; color: var(--brand); border: 1px solid var(--brand);
  padding: 8px 16px; border-radius: 10px; cursor: pointer; font-size: 14px;
}
button.link {
  background: none; border: none; color: var(--brand); cursor: pointer;
  font-size: 14px; padding: 4px 6px;
}
button.link.danger { color: var(--no); }
button.danger {
  background: #fff; color: var(--no); border: 1px solid var(--no-soft);
  padding: 10px 16px; border-radius: 10px; cursor: pointer; font-size: 14px;
}
button.ok { background: var(--ok-soft); color: var(--ok); border: 1px solid #bfe6cb; padding: 9px 16px; border-radius: 10px; cursor: pointer; }
button.no { background: var(--no-soft); color: var(--no); border: 1px solid #f3c6c6; padding: 9px 16px; border-radius: 10px; cursor: pointer; }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 14px; background: #fafbff; border: 1px dashed var(--line); padding: 10px 12px; border-radius: 10px; }
hr { border: none; border-top: 1px solid var(--line); margin: 22px 0; }
code { background: #f1f3f9; padding: 1px 6px; border-radius: 6px; font-size: 13px; }

/* 刷题卡片 */
.qcard { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.qhead { display: flex; align-items: center; gap: 10px; }
.badge { background: var(--brand-soft); color: var(--brand); padding: 4px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; }
.prog { margin-left: auto; color: var(--muted); font-size: 14px; }
.qtitle { font-size: 17px; font-weight: 700; margin: 14px 0 10px; }
.qquit { margin-top: 18px; text-align: center; }

.passage { background: #fafbff; border: 1px solid var(--line); border-radius: 10px; padding: 14px; font-size: 15px; line-height: 1.9; }
.transcript { background: #fffaf0; border: 1px solid #f3e6c8; border-radius: 10px; padding: 14px; font-size: 15px; line-height: 1.9; margin-bottom: 12px; }
.transcript .tag, .ref .tag { display: inline-block; font-size: 12px; color: var(--warn); background: #fdf3df; padding: 2px 8px; border-radius: 6px; margin-bottom: 8px; }
.note { font-size: 13px; color: var(--warn); margin: 6px 0 12px; }
.question { font-size: 16px; font-weight: 600; margin: 14px 0; }

.opts { display: flex; flex-direction: column; gap: 10px; }
.opt {
  display: flex; align-items: flex-start; gap: 10px; text-align: left;
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 14px; cursor: pointer; font-size: 15px; color: var(--ink);
  transition: all .12s;
}
.opt:hover { border-color: var(--brand); background: var(--brand-soft); }
.opt .optkey { flex: 0 0 auto; font-weight: 700; color: var(--brand); }
.opt.correct { background: var(--ok-soft); border-color: #bfe6cb; color: #0f7a37; }
.opt.wrong { background: var(--no-soft); border-color: #f3c6c6; color: #b42318; }
.opt:disabled { cursor: default; }

.wordbank { font-size: 13px; color: var(--muted); margin: 12px 0; line-height: 2; }
.wb { display: inline-block; background: #f1f3f9; border-radius: 6px; padding: 2px 8px; margin: 2px; }
select.blank, select.mselect { padding: 6px 8px; border-radius: 8px; border: 1px solid var(--brand); font-size: 14px; color: var(--brand); background: #fff; }
select.blank.correct, select.mselect.correct { background: var(--ok-soft); border-color: #bfe6cb; color: #0f7a37; }
select.blank.wrong, select.mselect.wrong { background: var(--no-soft); border-color: #f3c6c6; color: #b42318; }

.paras { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.para { background: #fafbff; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; font-size: 14.5px; }
.para b { color: var(--brand); margin-right: 6px; }
.stmts { display: flex; flex-direction: column; gap: 12px; }
.stmt { display: flex; align-items: center; gap: 12px; justify-content: space-between; flex-wrap: wrap; }
.stmtxt { flex: 1 1 240px; font-size: 14.5px; }
.stmt select { width: auto; }

.cn { font-size: 17px; line-height: 2; background: #fafbff; border: 1px solid var(--line); border-radius: 10px; padding: 16px; }
.ref { margin-top: 14px; background: #f6fff9; border: 1px solid #cfeede; border-radius: 10px; padding: 14px; }
.ref .en { font-size: 15px; line-height: 1.9; }
.tips { font-size: 13px; color: var(--muted); margin-top: 8px; }
.prompt { font-size: 16px; line-height: 1.9; background: #fffaf0; border: 1px solid #f3e6c8; border-radius: 10px; padding: 14px; }

.actions { margin-top: 14px; }
.gradewrap { margin-top: 14px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.feedback { margin-top: 16px; border-radius: 10px; padding: 12px 14px; background: #f8fafc; border: 1px solid var(--line); }
.verdict { font-weight: 700; font-size: 15px; margin-bottom: 6px; }
.verdict.ok { color: var(--ok); }
.verdict.no { color: var(--no); }
.exp { font-size: 14px; color: var(--ink); }
.nextwrap { margin-top: 16px; text-align: right; }

.exambar { display: flex; align-items: center; justify-content: space-between; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; box-shadow: var(--shadow); }
#timer { font-size: 18px; font-weight: 700; color: var(--warn); font-variant-numeric: tabular-nums; }

/* 列表（错题/收藏） */
.list { display: flex; flex-direction: column; gap: 10px; }
.item { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; flex-wrap: wrap; }
.item .badge { flex: 0 0 auto; }
.itemacts { margin-left: auto; display: flex; gap: 6px; }

/* 统计 */
.statgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 8px; }
.stat { background: var(--brand-soft); border-radius: 12px; padding: 14px; text-align: center; }
.stat .num { font-size: 24px; font-weight: 800; color: var(--brand); }
.stat .lbl { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.bar { display: flex; align-items: center; gap: 10px; margin: 10px 0; }
.bl { flex: 0 0 84px; font-size: 13.5px; color: var(--muted); }
.btrack { flex: 1; background: #eef1f6; border-radius: 999px; height: 12px; overflow: hidden; }
.bfill { display: block; height: 100%; background: linear-gradient(90deg, #6366f1, #4f46e5); border-radius: 999px; }
.bv { flex: 0 0 110px; text-align: right; font-size: 12.5px; color: var(--muted); }
.week { display: flex; align-items: flex-end; gap: 10px; height: 120px; padding: 10px 0; }
.dbar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.dcol { width: 60%; background: var(--brand); border-radius: 6px 6px 0 0; min-height: 4px; }
.dlbl { font-size: 11px; color: var(--muted); }

/* 词汇卡片 */
.flashcard { background: linear-gradient(135deg, #eef0ff, #f6f7ff); border: 1px solid var(--line); border-radius: 16px; padding: 40px 20px; margin: 16px 0; box-shadow: var(--shadow); }
.flashcard .word { font-size: 34px; font-weight: 800; color: var(--brand); }
.flashcard .phon { font-size: 16px; color: var(--muted); margin: 6px 0 18px; }
.flashcard .pos { font-size: 14px; color: var(--warn); font-weight: 600; }
.flashcard .def { font-size: 20px; margin: 6px 0; }
.flashcard .ex { font-size: 14px; color: var(--muted); font-style: italic; }
.card.center .row { justify-content: center; }

.footer { text-align: center; color: var(--muted); font-size: 12.5px; padding: 24px 16px 40px; }

@media (max-width: 560px) {
  .statgrid { grid-template-columns: repeat(2, 1fr); }
  .bl { flex-basis: 64px; }
  .bv { flex-basis: 84px; }
  .topbar { padding: 12px 14px; }
  .navbar { top: 49px; }
}
