* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f5f7fa; color: #222; line-height: 1.6;
  -webkit-tap-highlight-color: transparent;
}
.topbar {
  position: sticky; top: 0; z-index: 10; background: #fff;
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-bottom: 1px solid #e8eaef;
}
.back { border: none; background: #eef2f8; border-radius: 8px; padding: 6px 12px; font-size: 15px; cursor: pointer; }
.back:active { background: #dde4f0; }
.top-title { font-weight: 600; }
main { max-width: 680px; margin: 0 auto; padding: 14px; }
.view h1 { font-size: 22px; margin-bottom: 4px; }
.view h2 { font-size: 18px; margin: 18px 0 8px; }
.muted { color: #8a93a3; } .small { font-size: 13px; }
.card { background: #fff; border-radius: 14px; padding: 18px; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.book-box { margin: 14px 0 8px; }
.book-title { font-weight: 600; margin-bottom: 12px; }
.btn { border: none; border-radius: 10px; padding: 10px 16px; font-size: 16px; cursor: pointer; }
.btn.primary { background: #3567e6; color: #fff; }
.btn.primary:active { background: #2a53c4; }
.btn.big { width: 100%; padding: 14px; font-size: 18px; }
.btn.ghost { background: #eef2f8; color: #334; }
.list-item {
  background: #fff; border-radius: 12px; padding: 14px; margin-bottom: 10px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,.05); cursor: pointer;
}
.list-item:active { background: #f4f7fd; }
.list-item .sub { color: #8a93a3; font-size: 13px; }
.list-item.disabled { opacity: .5; cursor: default; }
.badge { background: #eaf1ff; color: #3567e6; border-radius: 999px; font-size: 12px; padding: 2px 10px; white-space: nowrap; }
.badge.warn { background: #fff4e5; color: #b06a00; }

.quiz-head { margin-bottom: 12px; }
.quiz-name { font-weight: 700; font-size: 17px; margin-bottom: 8px; }
.progress { height: 8px; background: #e4e8f0; border-radius: 999px; overflow: hidden; }
#progressBar { height: 100%; width: 0; background: #3567e6; transition: width .3s; }

.q-card { background: #fff; border-radius: 14px; padding: 16px; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.q-top { display: flex; justify-content: space-between; align-items: start; gap: 8px; }
.q-no { font-size: 12px; color: #8a93a3; }
.q-text { font-size: 16px; }
.tts { border: 1px solid #cdd6e6; background: #f4f7fc; border-radius: 8px; padding: 4px 10px; font-size: 14px; cursor: pointer; white-space: nowrap; }
.options { margin: 14px 0; display: grid; gap: 8px; }
.opt {
  border: 2px solid #e4e8f0; border-radius: 10px; padding: 10px 12px; font-size: 15px;
  cursor: pointer; display: flex; gap: 8px; align-items: start;
}
.opt .letter { font-weight: 700; color: #3567e6; }
.opt.sel { border-color: #3567e6; background: #f0f5ff; }
.opt.right { border-color: #2e9e5b; background: #eafaf0; }
.opt.wrong { border-color: #d9534f; background: #fdeeed; }
input[type=text] {
  width: 100%; border: 2px solid #e4e8f0; border-radius: 10px; padding: 10px; font-size: 15px; margin: 12px 0;
}
.feedback { margin-top: 12px; border-radius: 10px; padding: 12px; font-size: 14px; display: none; }
.feedback.good { display: block; background: #eafaf0; color: #1c6b3c; }
.feedback.bad { display: block; background: #fdeeed; color: #a33431; }
.feedback.neutral { display: block; background: #fff8e8; color: #8a5b00; }
.feedback .ans { font-weight: 700; margin-bottom: 4px; }
.act-row { display: flex; gap: 10px; margin-top: 14px; }
.act-row .btn { flex: 1; }
.foot { text-align: center; padding: 18px 14px 30px; }
@media (min-width: 680px) { main { padding: 24px; } }
