/* 体育单招政治题库 —— 样式
   单文件、零依赖、离线可用。移动端优先。 */

:root {
  --bg: #f4f6f9;
  --card: #ffffff;
  --ink: #1f2937;
  --muted: #6b7280;
  --line: #e5e7eb;
  --brand: #2563eb;
  --brand-soft: #eff4ff;
  --ok: #15803d;
  --ok-soft: #eefbf2;
  --bad: #dc2626;
  --bad-soft: #fef2f2;
  --warn: #b45309;
  --warn-soft: #fffbeb;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
}

* { box-sizing: border-box; }

/* 手机上：去掉点击时的蓝色闪块，并避免双击缩放造成的延迟 */
button, .option, .paper, .mode, .result, a, label, select, input {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", sans-serif;
  font-size: 15px;
  line-height: 1.65;
  -webkit-text-size-adjust: 100%;
}

body { padding-bottom: 80px; }

/* ---------- 顶栏 ---------- */
.app-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand-wrap {
  max-width: 880px; margin: 0 auto; padding: 10px 16px 0;
  display: flex; align-items: center; gap: 10px;
}
.logo {
  width: 34px; height: 34px; flex: none; border-radius: 9px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff; font-weight: 700; font-size: 17px;
  display: grid; place-items: center;
}
.brand-text h1 { margin: 0; font-size: 16px; font-weight: 650; letter-spacing: .2px; }
.brand-text p { margin: 0; font-size: 12px; color: var(--muted); }

.tabs {
  max-width: 880px; margin: 0 auto; padding: 8px 16px 0;
  display: flex; gap: 4px; overflow-x: auto;
}
.tabs button {
  flex: none; border: 0; background: transparent; cursor: pointer;
  padding: 8px 14px; border-radius: 8px 8px 0 0; font-size: 14px;
  color: var(--muted); font-family: inherit;
  border-bottom: 2px solid transparent;
}
.tabs button:hover { background: #f3f4f6; color: var(--ink); }
.tabs button.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }

/* ---------- 布局 ---------- */
main { max-width: 880px; margin: 0 auto; padding: 16px; }
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px; margin-bottom: 14px;
}
.card h2 { margin: 0 0 12px; font-size: 15px; font-weight: 650; }
.card h2 .hint { font-weight: 400; color: var(--muted); font-size: 12px; margin-left: 6px; }

/* ---------- 概览 ---------- */
.overview { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
.ov-item {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 10px; text-align: center; box-shadow: var(--shadow);
}
.ov-item b { display: block; font-size: 20px; font-weight: 700; color: var(--brand); }
.ov-item span { font-size: 11px; color: var(--muted); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  padding: 9px 16px; border-radius: 9px; font-size: 14px; font-family: inherit;
  cursor: pointer; transition: .12s;
}
.btn:hover { background: #f9fafb; border-color: #d1d5db; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.btn.primary:hover { background: #1d4ed8; }
.btn.ghost { border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: #f3f4f6; color: var(--ink); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.sm { padding: 5px 10px; font-size: 12.5px; border-radius: 7px; }

.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- 模式卡 ---------- */
.modes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.mode {
  text-align: left; cursor: pointer; font-family: inherit;
  border: 1px solid var(--line); background: #fff; border-radius: var(--radius);
  padding: 13px 14px; transition: .12s;
}
.mode:hover { border-color: var(--brand); background: var(--brand-soft); }
.mode b { display: block; font-size: 14.5px; margin-bottom: 2px; }
.mode span { font-size: 12px; color: var(--muted); }

/* ---------- 筛选 ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
select, input[type=search], input[type=text] {
  font-family: inherit; font-size: 13.5px; color: var(--ink);
  padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px;
  background: #fff; outline: none;
}
select:focus, input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
input[type=search] { min-width: 180px; flex: 1; }
label.chk { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: var(--muted); cursor: pointer; }

/* ---------- 试卷列表 ---------- */
.paper-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.paper {
  text-align: left; cursor: pointer; font-family: inherit;
  border: 1px solid var(--line); background: #fff; border-radius: 9px;
  padding: 9px 11px; transition: .12s;
}
.paper:hover { border-color: var(--brand); background: var(--brand-soft); }
.paper b { display: block; font-size: 13.5px; font-weight: 600; }
.paper span { font-size: 11.5px; color: var(--muted); }
.paper .bar { height: 3px; background: #eef2f7; border-radius: 2px; margin-top: 6px; overflow: hidden; }
.paper .bar i { display: block; height: 100%; background: var(--brand); }

/* ---------- 做题 ---------- */
.quiz-top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 10px; flex-wrap: wrap;
}
.quiz-top .meta { font-size: 12.5px; color: var(--muted); }
.quiz-top .meta b { color: var(--ink); }
.progress { height: 4px; background: #e8edf5; border-radius: 2px; overflow: hidden; margin-bottom: 14px; }
.progress i { display: block; height: 100%; background: var(--brand); transition: width .2s; }

.q-num { font-size: 12.5px; color: var(--muted); margin-bottom: 6px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pill {
  display: inline-block; padding: 1px 8px; border-radius: 999px;
  font-size: 11px; background: #eef2f7; color: var(--muted);
}
.pill.multi { background: #fef3c7; color: var(--warn); }
.pill.dup { background: #f3e8ff; color: #7c3aed; }

.material {
  background: var(--warn-soft); border-left: 3px solid #f59e0b;
  border-radius: 0 8px 8px 0; padding: 10px 12px; margin-bottom: 12px;
  font-size: 13.5px; color: #78350f;
}
.material b { display: block; font-size: 11.5px; color: var(--warn); margin-bottom: 3px; }

.stem { font-size: 16px; line-height: 1.75; margin-bottom: 14px; white-space: pre-wrap; }

.options { display: flex; flex-direction: column; gap: 8px; }
.option {
  display: flex; gap: 10px; align-items: flex-start;
  border: 1px solid var(--line); background: #fff; border-radius: 10px;
  padding: 11px 13px; cursor: pointer; transition: .12s; font-family: inherit;
  text-align: left; font-size: 15px; line-height: 1.6; color: var(--ink);
  width: 100%;
}
.option:hover { border-color: #c7d2fe; background: #fafbff; }
.option .letter {
  flex: none; width: 24px; height: 24px; border-radius: 6px;
  background: #f0f3f8; color: var(--muted); font-weight: 700; font-size: 13px;
  display: grid; place-items: center; margin-top: 1px;
}
.option.picked { border-color: var(--brand); background: var(--brand-soft); }
.option.picked .letter { background: var(--brand); color: #fff; }
.option.right { border-color: var(--ok); background: var(--ok-soft); }
.option.right .letter { background: var(--ok); color: #fff; }
.option.wrong { border-color: var(--bad); background: var(--bad-soft); }
.option.wrong .letter { background: var(--bad); color: #fff; }
.option.locked { cursor: default; }
.option.locked:hover { border-color: inherit; }
.option .txt { flex: 1; }

.verdict { margin-top: 14px; padding: 11px 13px; border-radius: 10px; font-size: 14px; }
.verdict.ok { background: var(--ok-soft); color: var(--ok); border: 1px solid #bbf7d0; }
.verdict.bad { background: var(--bad-soft); color: var(--bad); border: 1px solid #fecaca; }
.verdict b { font-weight: 700; }

.explanation {
  margin-top: 10px; background: #fafbfc; border: 1px solid var(--line);
  border-radius: 10px; padding: 12px 13px; font-size: 13.5px; line-height: 1.75;
  color: #374151; white-space: pre-wrap;
}
.explanation h3 { margin: 0 0 6px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.explanation .none { color: var(--muted); font-style: italic; }

.toolbar {
  display: flex; gap: 8px; justify-content: space-between; align-items: center;
  margin-top: 16px; flex-wrap: wrap;
}
.toolbar .spacer { flex: 1; }

/* ---------- 统计 ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 10px; text-align: center;
}
.stat b { display: block; font-size: 22px; font-weight: 700; }
.stat span { font-size: 11.5px; color: var(--muted); }
.stat.ok b { color: var(--ok); }
.stat.bad b { color: var(--bad); }

.bars { display: flex; flex-direction: column; gap: 7px; margin-top: 4px; }
.bar-row { display: flex; align-items: center; gap: 9px; font-size: 13px; }
.bar-row .nm { width: 130px; flex: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.bar-row .track { flex: 1; height: 7px; background: #eef2f7; border-radius: 4px; overflow: hidden; }
.bar-row .track i { display: block; height: 100%; background: var(--brand); }
.bar-row .vv { width: 72px; flex: none; text-align: right; font-variant-numeric: tabular-nums; font-size: 12px; color: var(--muted); }

/* ---------- 其他 ---------- */
.empty { text-align: center; color: var(--muted); padding: 40px 16px; font-size: 14px; }
.result-list { display: flex; flex-direction: column; gap: 8px; }
.result {
  border: 1px solid var(--line); background: #fff; border-radius: 9px;
  padding: 10px 12px; cursor: pointer; font-family: inherit; text-align: left; transition: .12s;
}
.result:hover { border-color: var(--brand); background: var(--brand-soft); }
.result .t { font-size: 13.5px; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.result .s { font-size: 11.5px; color: var(--muted); margin-top: 4px; }

.fav-star { border: 0; background: transparent; cursor: pointer; font-size: 17px; line-height: 1; padding: 2px 4px; color: #d1d5db; }
.fav-star.on { color: #f59e0b; }

.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  background: #111827; color: #fff; padding: 9px 18px; border-radius: 999px;
  font-size: 13.5px; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 50;
}
.toast.show { opacity: .93; }

@media (max-width: 560px) {
  .overview { grid-template-columns: repeat(2, 1fr); }
  .modes { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(3, 1fr); }
  .bar-row .nm { width: 92px; }
  main { padding: 12px; }
  .stem { font-size: 15.5px; }
}
