/* ============ 考试中心样式 ============ */
* { box-sizing: border-box; }
body { margin: 0; background: #f4f1ea; color: #2b2b2b;
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  /* 覆盖 app.css 的 overflow:hidden（教材平台 SPA 固定布局所用），
     否则考试页正文（长试卷）会被裁切、无法滚动、看不到后面的题。 */
  overflow-y: auto; }
/* 章节列表底部按钮组 */
.ch-btns { display: flex; gap: 8px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }

.exam-top { display: flex; align-items: center; gap: 16px; padding: 10px 22px;
  background: #fff; border-bottom: 1px solid #e6e0d4; position: sticky; top: 0; z-index: 20; }
.et-left { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.et-logo { width: 34px; height: 34px; border-radius: 8px; background: #c0392b; color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: 18px; }
.et-title { font-size: 18px; font-weight: 700; }
.et-nav { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
.et-nav a { padding: 7px 13px; border-radius: 8px; color: #555; text-decoration: none; font-size: 14px; }
.et-nav a:hover { background: #f0ece2; }
.et-nav a.active { background: #c0392b; color: #fff; }
.et-nav a.et-platform { color: #3556c9; font-weight: 600; border: 1px solid #cdd7f3; background: #eef1fb; }
.et-nav a.et-platform:hover { background: #e2e8fa; }
.et-user { font-size: 14px; color: #555; white-space: nowrap; }
.et-user b { color: #c0392b; }

.exam-main { max-width: 980px; margin: 22px auto; padding: 0 16px 60px; min-height: 60vh; }
.exam-loading { text-align: center; color: #999; padding: 60px 0; }
.exam-foot { text-align: center; color: #aaa; font-size: 12px; padding: 18px; }

/* 卡片 / 区块 */
.card { background: #fff; border: 1px solid #e6e0d4; border-radius: 12px; padding: 18px 20px; margin-bottom: 16px; }
.card h2 { margin: 0 0 12px; font-size: 17px; }
.muted { color: #999; font-size: 13px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.btn { display: inline-block; padding: 9px 16px; border: none; border-radius: 8px; cursor: pointer;
  background: #c0392b; color: #fff; font-size: 14px; text-decoration: none; }
.btn:hover { opacity: .92; }
.btn.ghost { background: #fff; color: #c0392b; border: 1px solid #c0392b; }
.btn.gray { background: #eee; color: #555; }
.btn.sm { padding: 5px 10px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* 仪表盘 */
.dash-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.dash-card { background: #fff; border: 1px solid #e6e0d4; border-radius: 12px; padding: 16px; text-align: center; }
.dash-card .n { font-size: 26px; font-weight: 700; color: #c0392b; }
.dash-card .l { color: #888; font-size: 13px; margin-top: 4px; }
.feat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; margin-top: 8px; }
.feat { background: #fff; border: 1px solid #e6e0d4; border-radius: 12px; padding: 18px; cursor: pointer; transition: .15s; }
.feat:hover { border-color: #c0392b; transform: translateY(-2px); }
.feat .t { font-weight: 700; font-size: 15px; }
.feat .d { color: #999; font-size: 12px; margin-top: 6px; }

/* 章节列表 */
.chapter { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px;
  border: 1px solid #e6e0d4; border-radius: 10px; background: #fff; margin-bottom: 10px; cursor: pointer; }
.chapter:hover { border-color: #c0392b; }
.chapter .meta { color: #999; font-size: 13px; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 6px; font-size: 12px; margin-left: 6px; }
.tag.single { background: #e7f1ff; color: #2b6cb0; }
.tag.multiple { background: #fff3e0; color: #c97a00; }
.tag.judge { background: #e9f7ef; color: #2f9e44; }

/* 题目 */
.q { background: #fff; border: 1px solid #e6e0d4; border-radius: 12px; padding: 18px 20px; margin-bottom: 14px; }
.q .qh { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.q .qt { font-size: 12px; padding: 2px 9px; border-radius: 6px; background: #eee; color: #666; }
.q .qstem { font-size: 15px; line-height: 1.6; margin-bottom: 12px; }
.opt { display: flex; gap: 10px; align-items: flex-start; padding: 9px 12px; border: 1px solid #eee;
  border-radius: 8px; margin-bottom: 8px; cursor: pointer; }
.opt:hover { background: #faf7f0; }
.opt.sel { border-color: #c0392b; background: #fdf0ee; }
.opt.ok { border-color: #2f9e44; background: #eafaf0; }
.opt.bad { border-color: #c0392b; background: #fdecea; }

/* 题型标签按题型着色（刷题/结果页统一） */
.q .qt.qt-single   { background: #e7f1ff; color: #2b6cb0; }
.q .qt.qt-multiple { background: #ff7a18; color: #fff; font-weight: 700; }
.q .qt.qt-judge   { background: #e9f7ef; color: #2f9e44; }

/* 选项选中态按题型区分颜色，避免误以为多选只选一个 */
.opt.sel.sel-single   { border-color: #c0392b; background: #fdf0ee; }
.opt.sel.sel-multiple { border-color: #2b6cb0; background: #e7f1ff; }
.opt.sel.sel-judge   { border-color: #2f9e44; background: #e9f7ef; }

/* 多选题醒目提示，防止用户只选一个答案 */
.q .multi-hint { color: #d2691e; font-size: 12px; font-weight: 700; margin: 2px 0 10px; }
.q .multi-hint::before { content: '⚠ '; }

.opt .mk { width: 20px; height: 20px; border-radius: 50%; border: 1px solid #bbb; display: grid; place-items: center; flex: 0 0 auto; font-size: 12px; }
.opt.ok .mk { background: #2f9e44; color: #fff; border-color: #2f9e44; }
.opt.bad .mk { background: #c0392b; color: #fff; border-color: #c0392b; }
.opt .tx { flex: 1; }
.analysis { margin-top: 10px; padding: 10px 12px; background: #f8f6f0; border-radius: 8px; font-size: 13px; color: #555; }
.analysis b { color: #c0392b; }

/* 进度 / 结果 */
.progress { height: 8px; background: #eee; border-radius: 6px; overflow: hidden; margin: 10px 0; }
.progress > i { display: block; height: 100%; background: #c0392b; width: 0; transition: .2s; }
.result-big { text-align: center; padding: 24px; }
.result-big .score { font-size: 52px; font-weight: 800; color: #c0392b; }
.result-big .sub { color: #777; margin-top: 6px; }
.pass { color: #2f9e44; font-weight: 700; }
.fail { color: #c0392b; font-weight: 700; }
.sticky-bar { position: sticky; bottom: 0; background: #fff; border-top: 1px solid #e6e0d4;
  padding: 12px 16px; display: flex; justify-content: space-between; align-items: center; z-index: 10; }

/* 排行榜 */
.lb-row { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-bottom: 1px solid #f0ece2; }
.lb-row .rank { width: 28px; height: 28px; border-radius: 50%; background: #eee; display: grid; place-items: center; font-weight: 700; }
.lb-row .rank.r1 { background: #f1c40f; color: #fff; }
.lb-row .rank.r2 { background: #bdc3c7; color: #fff; }
.lb-row .rank.r3 { background: #cd7f32; color: #fff; }
.lb-row .nm { flex: 1; font-weight: 600; }
.lb-row .vl { font-weight: 700; color: #c0392b; }

/* 表格 */
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
table.tbl th, table.tbl td { padding: 9px 10px; border-bottom: 1px solid #f0ece2; text-align: left; }
table.tbl th { color: #888; font-weight: 600; background: #faf7f0; }
a.link { color: #c0392b; cursor: pointer; }

/* 管理表单 */
.frm label { display: block; font-size: 13px; color: #666; margin: 10px 0 4px; }
.frm input, .frm select, .frm textarea { width: 100%; padding: 8px 10px; border: 1px solid #ddd; border-radius: 8px; font-size: 14px; }
.opt-edit { display: flex; gap: 8px; margin-bottom: 6px; }
.opt-edit input:first-child { width: 60px; }
.hint { background: #fff8e1; border: 1px solid #ffe082; border-radius: 8px; padding: 10px 12px; font-size: 13px; color: #8a6d00; }
.modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,.4); display: none; place-items: center; z-index: 50; }
.modal-mask.show { display: grid; }
.modal { background: #fff; border-radius: 12px; padding: 20px; width: min(420px, 92vw); }
.modal textarea { width: 100%; height: 90px; }
#appealModal .modal textarea { min-height: 96px; resize: vertical; }
#apMsg { font-size: 13px; }
#apMsg.ap-ok { color: #2f9e44; background: #eafaf0; border: 1px solid #b7e3c4; padding: 8px 10px; border-radius: 8px; }
#apMsg.ap-err { color: #c0392b; background: #fdf0ee; border: 1px solid #f0b9b4; padding: 8px 10px; border-radius: 8px; }
.share-btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

/* ============ 自主学习（PPT 式逐题学习） ============ */
.btn.study { background: #eef1fb; color: #3556c9; border: 1px solid #cdd7f3; }
.btn.study:hover { background: #e2e8fa; opacity: 1; }

.study-wrap { max-width: 880px; margin: 0 auto; }
.study-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.study-title { font-size: 19px; font-weight: 700; }
.study-card { background: #fff; border: 1px solid #e6e0d4; border-radius: 16px;
  padding: 26px 30px; margin-top: 14px; box-shadow: 0 10px 30px rgba(20, 30, 60, .07);
  border-top: 5px solid #c0392b; }
.study-card.q-multiple { border-top-color: #ff7a18; }
.study-card.q-judge { border-top-color: #2f9e44; }
.study-card .qh { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
.study-stem { font-size: 21px; line-height: 1.75; font-weight: 600; color: #23262b; margin: 4px 0 18px; }

.sopts { display: flex; flex-direction: column; gap: 10px; }
.sopt { display: flex; gap: 12px; align-items: flex-start; padding: 12px 15px;
  border: 1px solid #e6e6e6; border-radius: 10px; font-size: 16px; background: #fcfcfe; }
.sopt .mk { flex: 0 0 auto; width: 24px; height: 24px; border-radius: 50%;
  border: 1px solid #bbb; display: grid; place-items: center; font-size: 13px; font-weight: 700; color: #666; }
.sopt .tx { flex: 1; line-height: 1.6; }
.sopt.ok { border-color: #2f9e44; background: #eafaf0; }
.sopt.ok .mk { background: #2f9e44; color: #fff; border-color: #2f9e44; }
/* 学习页：选项可点（即时判定） */
.sopt.pickable { cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s; }
.sopt.pickable:hover { border-color: #4d8ef7; background: #f4f8ff; }
.sopt.picked { border-color: #4d8ef7; background: #eef4ff; }
.sopt.picked .mk { background: #4d8ef7; color: #fff; border-color: #4d8ef7; }
.sopt.bad { border-color: #e03131; background: #fdf0f0; }
.sopt.bad .mk { background: #e03131; color: #fff; border-color: #e03131; }
.sopt .tag-ok { margin-left: auto; align-self: center; color: #2f9e44; font-weight: 700; font-size: 14px; white-space: nowrap; }
.study-verdict { margin-top: 16px; padding: 12px 16px; border-radius: 10px; font-size: 16px; font-weight: 700; }
.study-verdict.v-ok { color: #1b7a3d; background: #eafaf0; border: 1px solid #b7e4c7; }
.study-verdict.v-bad { color: #c92a2a; background: #fdf0f0; border: 1px solid #f5c2c2; }

.study-ans { margin-top: 20px; padding: 16px 18px; border-radius: 12px;
  background: #f4fbf6; border: 1px solid #cdeed8; }
.study-ans .ans-line { font-size: 17px; color: #1b7a3d; margin-bottom: 8px; }
.study-ans .ans-line b { font-size: 18px; }
.study-ans .ana { font-size: 15px; line-height: 1.85; color: #333; white-space: pre-wrap; }
.study-ans .ana b { color: #1b7a3d; }
.study-hide { margin-top: 20px; padding: 14px; text-align: center; color: #999;
  background: #f7f8fa; border: 1px dashed #ddd; border-radius: 10px; font-size: 14px; }

.study-actions { margin-top: 18px; justify-content: space-between; }
.study-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; padding: 0 4px; }
.study-done { text-align: center; margin-top: 14px; padding: 12px; border-radius: 10px;
  background: #eafaf0; color: #1b7a3d; font-weight: 700; }
