:root {
  --bg: #f6f3ec; --card: #fff; --ink: #2b2118; --muted: #8a7f72;
  --brand: #8f2d1e; --ok: #1e7e34; --bad: #c0392b; --line: #e8e1d5;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif; background: var(--bg); color: var(--ink); }
.topbar { position: sticky; top: 0; z-index: 9; background: var(--brand); color: #fff; display: flex; align-items: center; gap: 12px; padding: 10px 16px; flex-wrap: wrap; }
.brand { font-weight: 700; letter-spacing: .5px; }
.nav { display: flex; gap: 6px; flex-wrap: wrap; }
.nav button { background: transparent; border: 1px solid rgba(255,255,255,.4); color: #fff; border-radius: 8px; padding: 6px 12px; cursor: pointer; font-size: 14px; }
.nav button.active { background: #fff; color: var(--brand); border-color: #fff; font-weight: 600; }
main { max-width: 760px; margin: 16px auto 60px; padding: 0 14px; }
.view { display: none; } .view.active { display: block; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px; margin-bottom: 14px; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
h1 { font-size: 22px; margin: 4px 0; } h2 { font-size: 17px; margin: 0 0 10px; } h3 { font-size: 16px; line-height: 1.7; }
.muted { color: var(--muted); font-size: 13px; }
.tag { display: inline-block; background: #f3e8e4; color: var(--brand); border-radius: 6px; padding: 2px 8px; font-size: 12px; margin-left: 6px; vertical-align: middle; }
.quiz-head .tag { margin-left: 0; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 14px 0; }
.stat { background: #faf7f0; border: 1px solid var(--line); border-radius: 10px; padding: 10px; text-align: center; }
.stat b { display: block; font-size: 20px; color: var(--brand); }
.stat span { font-size: 12px; color: var(--muted); }
.btnrow { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.btn { border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 10px 16px; font-size: 15px; cursor: pointer; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.btn.danger { background: #fff; color: var(--bad); border-color: #e5b8b2; }
.btn:disabled { opacity: .45; cursor: default; }
.tips { margin: 6px 0; padding-left: 20px; }
.tips li { margin: 8px 0; line-height: 1.7; }
.opt { display: block; width: 100%; text-align: left; margin: 8px 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fbf9f4; font-size: 15px; cursor: pointer; line-height: 1.55; }
.opt .abc { font-weight: 700; color: var(--brand); margin-right: 8px; }
.opt.correct { border-color: var(--ok); background: #eef7ee; }
.opt.incorrect { border-color: var(--bad); background: #fdf0ee; }
.opt:disabled { cursor: default; }
.exp { margin-top: 12px; padding: 12px 14px; border-radius: 10px; border: 1px dashed var(--line); background: #faf7ef; line-height: 1.75; font-size: 14px; }
.exp-title { font-weight: 700; margin-bottom: 6px; }
.exp.good .exp-title { color: var(--ok); } .exp.bad .exp-title { color: var(--bad); }
.progress { height: 6px; background: #eee7da; border-radius: 4px; margin: 8px 0 14px; }
#quiz-bar { height: 100%; width: 0; background: var(--brand); border-radius: 4px; transition: width .2s; }
.quiz-head { display: flex; justify-content: space-between; align-items: center; }
details.essay { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin: 10px 0; background: #fbf9f4; }
details.essay summary { cursor: pointer; font-weight: 600; line-height: 1.6; }
details.essay .pts { margin: 10px 0 0; padding-left: 20px; }
details.essay .pts li { margin: 6px 0; line-height: 1.75; }
.mem-label { display: block; margin-top: 10px; font-size: 14px; color: var(--ink); cursor: pointer; }
input[type=checkbox] { transform: scale(1.2); margin-right: 6px; vertical-align: middle; }
.wrong-item { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin: 10px 0; background: #fbf9f4; line-height: 1.7; }
table.tl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.tl td { border-bottom: 1px solid var(--line); padding: 7px 8px; vertical-align: top; line-height: 1.6; }
table.tl td.y { white-space: nowrap; font-weight: 700; color: var(--brand); width: 110px; }
.foot { text-align: center; color: var(--muted); font-size: 12px; padding: 18px; }
.hidden { display: none !important; }
select { width: 100%; padding: 10px; border: 1px solid var(--line); border-radius: 10px; margin: 6px 0 12px; font-size: 14px; background: #fff; }
label { font-size: 13px; color: var(--muted); }
.cp { margin: 10px 0; }
.cp-row { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 4px; }
.cp-bar { height: 8px; background: #eee7da; border-radius: 4px; overflow: hidden; }
.cp-fill { height: 100%; background: var(--brand); }
@media (max-width: 560px) { .stats { grid-template-columns: repeat(2, 1fr); } .nav { width: 100%; } }
