/* 陪诊题库 · 在线练习 —— 简洁、以阅读和答题为主，无装饰性动画 */
:root {
  --bg: #f4f6f9;
  --card: #ffffff;
  --line: #dfe4ec;
  --text: #1f2937;
  --muted: #5b6675;
  --primary: #1c62c4;
  --primary-dark: #154e9e;
  --primary-soft: #eaf2fd;
  --ok: #146c43;
  --ok-bg: #e7f5ec;
  --ok-line: #9bd3b2;
  --no: #b3261e;
  --no-bg: #fdeceb;
  --no-line: #f0aaa5;
  --miss: #8a5600;
  --miss-bg: #fff3dd;
  --miss-line: #e8c37a;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", sans-serif;
  font-size: 16px;
  line-height: 1.7;
}
button, select, input { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
.app { min-height: 100vh; display: flex; flex-direction: column; }
.topbar { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.topbar-inner {
  max-width: 860px; margin: 0 auto; padding: 10px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.brand {
  border: 0; background: none; padding: 4px 0; font-size: 17px; font-weight: 700;
  color: var(--text); text-align: left;
}
.topbar-right { display: flex; gap: 8px; align-items: center; }
.topbtn {
  border: 1px solid var(--line); background: var(--card); border-radius: 8px;
  padding: 7px 12px; min-height: 40px; font-size: 14px; white-space: nowrap;
}
.topbtn:hover { background: var(--primary-soft); border-color: var(--primary); }
.badge {
  display: inline-block; margin-left: 6px; min-width: 20px; padding: 0 6px;
  border-radius: 10px; background: var(--no); color: #fff; font-size: 12px; line-height: 20px; text-align: center;
}
.badge.zero { background: #8b95a3; }
.view { width: 100%; max-width: 860px; margin: 0 auto; padding: 18px 16px 28px; flex: 1; }
.footer {
  max-width: 860px; margin: 0 auto; width: 100%; padding: 14px 16px 26px;
  color: var(--muted); font-size: 13px; line-height: 1.65;
}
.footer p { margin: 4px 0; }
.footer-sub { font-size: 12px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 18px; margin-bottom: 16px; }
.card h2 { margin: 0 0 12px; font-size: 19px; }
.card h3 { margin: 0 0 8px; font-size: 16px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.notice {
  background: var(--primary-soft); border: 1px solid #c7ddf8; border-radius: 10px;
  padding: 12px 14px; font-size: 14px; color: #234; margin-bottom: 16px;
}
.notice strong { color: var(--primary-dark); }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 16px; }
.stat-box { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px 10px; text-align: center; }
.stat-box .num { display: block; font-size: 22px; font-weight: 700; color: var(--primary-dark); line-height: 1.3; }
.stat-box .lbl { display: block; font-size: 12px; color: var(--muted); }

.field-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.field { margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }
.field label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.field select {
  width: 100%; min-height: 46px; padding: 8px 10px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--card);
}
.field select:focus, .field input:focus { outline: 2px solid var(--primary); outline-offset: 1px; }
.pool-hint { font-size: 13px; color: var(--muted); margin: 2px 0 14px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 48px; padding: 10px 18px; border-radius: 9px;
  border: 1px solid var(--primary); background: var(--primary); color: #fff;
  font-weight: 600; text-align: center;
}
.btn:hover:not(:disabled) { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn.secondary { background: var(--card); color: var(--primary-dark); border-color: var(--line); }
.btn.secondary:hover:not(:disabled) { background: var(--primary-soft); border-color: var(--primary); }
.btn.danger { background: var(--card); color: var(--no); border-color: var(--no-line); }
.btn.danger:hover:not(:disabled) { background: var(--no-bg); }
.btn.wide { width: 100%; }
.btn.small { min-height: 40px; padding: 6px 12px; font-size: 14px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }
.btn-row .btn { flex: 1 1 auto; }

/* ---------- 答题页 ---------- */
.quiz-head { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 14px; }
.quiz-head-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 14px; }
.progress-track { height: 9px; background: #e8ecf2; border-radius: 6px; overflow: hidden; margin: 10px 0 8px; }
.progress-fill { height: 100%; background: var(--primary); }
.head-meta { display: flex; gap: 10px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.chip { display: inline-block; padding: 2px 10px; border-radius: 12px; background: var(--primary-soft); color: var(--primary-dark); font-size: 13px; font-weight: 600; }
.chip.gray { background: #eef1f5; color: var(--muted); font-weight: 400; }

.stem { font-size: 18px; font-weight: 600; line-height: 1.75; white-space: pre-wrap; overflow-wrap: anywhere; margin: 0 0 6px; }
.type-hint { font-size: 13px; color: var(--muted); margin: 0 0 14px; }
.options { display: flex; flex-direction: column; gap: 10px; margin: 0 0 16px; }
.option {
  display: flex; align-items: flex-start; gap: 12px; width: 100%; text-align: left;
  min-height: 54px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--card); line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere;
}
.option:hover:not(:disabled) { border-color: var(--primary); background: var(--primary-soft); }
.option .box {
  flex: 0 0 22px; width: 22px; height: 22px; margin-top: 2px; border: 2px solid #9aa6b6;
  display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; color: #fff;
}
.option.single .box { border-radius: 50%; }
.option.multiple .box { border-radius: 5px; }
.option.checked { border-color: var(--primary); background: var(--primary-soft); }
.option.checked .box { background: var(--primary); border-color: var(--primary); }
.option .key { font-weight: 700; margin-right: 4px; }
.option .otext { flex: 1; }
.option .state-tag { display: block; margin-top: 6px; font-size: 13px; font-weight: 700; }
.option.locked { cursor: default; }
.option.s-correct { border-color: var(--ok-line); background: var(--ok-bg); }
.option.s-correct .state-tag { color: var(--ok); }
.option.s-missed { border-color: var(--miss-line); background: var(--miss-bg); }
.option.s-missed .state-tag { color: var(--miss); }
.option.s-wrong { border-color: var(--no-line); background: var(--no-bg); }
.option.s-wrong .state-tag { color: var(--no); }
.option.s-none { opacity: .82; }
.option.s-none .state-tag { color: var(--muted); font-weight: 400; }

.feedback { border-radius: 12px; border: 1px solid var(--line); padding: 16px; margin-bottom: 16px; }
.feedback.ok { border-color: var(--ok-line); background: var(--ok-bg); }
.feedback.no { border-color: var(--no-line); background: var(--no-bg); }
.fb-title { font-size: 18px; font-weight: 700; margin: 0 0 10px; }
.feedback.ok .fb-title { color: var(--ok); }
.feedback.no .fb-title { color: var(--no); }
.fb-line { margin: 4px 0; font-size: 15px; overflow-wrap: anywhere; }
.fb-expl { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); white-space: pre-wrap; overflow-wrap: anywhere; }
.fb-expl .lbl { font-weight: 700; display: block; margin-bottom: 4px; }
.no-expl { color: var(--muted); font-style: normal; }

.result-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.result-box { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px 8px; text-align: center; }
.result-box .num { display: block; font-size: 24px; font-weight: 700; color: var(--primary-dark); }
.result-box .lbl { display: block; font-size: 12px; color: var(--muted); }

.review-item { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 10px; overflow: hidden; }
.review-item summary { padding: 12px 14px; cursor: pointer; font-weight: 600; font-size: 15px; overflow-wrap: anywhere; }
.review-item .mark-ok { color: var(--ok); }
.review-item .mark-no { color: var(--no); }
.review-body { padding: 0 14px 14px; font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.review-body p { margin: 6px 0; }

.list-item { border: 1px solid var(--line); border-radius: 10px; padding: 14px; margin-bottom: 10px; background: var(--card); }
.list-item .li-title { font-weight: 600; font-size: 15px; margin: 0 0 6px; overflow-wrap: anywhere; }
.list-item .li-meta { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.divider { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
.kv { display: flex; flex-wrap: wrap; gap: 8px 24px; font-size: 14px; margin-bottom: 12px; }
.kv b { color: var(--primary-dark); }

/* ---------- 弹窗 / 提示 ---------- */
.modal-mask { position: fixed; inset: 0; background: rgba(20, 28, 40, .45); display: flex; align-items: center; justify-content: center; padding: 18px; z-index: 100; }
.modal { background: var(--card); border-radius: 12px; padding: 20px; width: 100%; max-width: 420px; }
.modal h3 { margin: 0 0 10px; font-size: 18px; }
.modal p { margin: 0 0 18px; font-size: 15px; white-space: pre-wrap; }
.modal .btn-row { justify-content: flex-end; }
#toast-root { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 200; width: min(92%, 460px); pointer-events: none; }
.toast { background: #243044; color: #fff; padding: 12px 16px; border-radius: 9px; font-size: 14px; margin-top: 8px; text-align: center; overflow-wrap: anywhere; }
.toast.err { background: var(--no); }
.file-input { display: none; }

@media (max-width: 620px) {
  body { font-size: 16px; }
  .view { padding: 14px 12px 24px; }
  .card { padding: 14px; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .result-grid { grid-template-columns: repeat(3, 1fr); }
  .stem { font-size: 17px; }
  .option { min-height: 56px; padding: 13px 12px; }
  .btn { min-height: 50px; }
  .topbar-inner { padding: 8px 12px; }
  .brand { font-size: 15px; }
  .topbtn { padding: 6px 9px; font-size: 13px; min-height: 38px; }
  .footer { padding: 12px 12px 22px; }
}
