* { box-sizing: border-box; }
:root { --line:#d5dce5; --bg:#eef2f7; --ink:#1c2733; --blue:#0b62c4; --red:#c0392b; --amber:#b8860b; --green:#177245; }
html,body { margin:0; height:100%; font:13px/1.65 "PingFang SC","Microsoft YaHei",-apple-system,sans-serif; color:var(--ink); background:var(--bg); }
.topbar { display:flex; align-items:center; justify-content:space-between; padding:8px 14px; background:#12376b; color:#fff; position:sticky; top:0; z-index:20; }
.brand b { font-size:15px; } .brand .sub { margin-left:10px; opacity:.65; font-size:12px; }
.tools { display:flex; align-items:center; gap:8px; }
.tools select,#askInput,.chips button { font:inherit; }
button { font:inherit; padding:5px 12px; border:1px solid var(--line); border-radius:4px; background:#fff; cursor:pointer; }
button:hover { border-color:var(--blue); color:var(--blue); }
button.primary { background:#1f7ae0; border-color:#1f7ae0; color:#fff; } button.primary:hover { background:#0b62c4; color:#fff; }
.modes { display:flex; border:1px solid rgba(255,255,255,.35); border-radius:4px; overflow:hidden; }
.mode { background:transparent; color:#fff; border:0; border-radius:0; padding:4px 12px; font-size:12px; }
.mode:hover { background:rgba(255,255,255,.15); color:#fff; }
.mode.on { background:#fff; color:#12376b; font-weight:700; }
.rxtable { width:100%; border-collapse:collapse; font-size:12px; margin:4px 0; }
.rxtable th { background:#eef4fb; color:#12376b; font-weight:600; padding:3px 5px; border:1px solid var(--line); }
.rxtable td { border:1px solid var(--line); padding:0; }
.rxtable input { width:100%; border:0; padding:4px 5px; font:inherit; background:transparent; }
.rxtable input:focus { background:#fffbe6; outline:1px solid #1f7ae0; }
button.mini { font-size:12px; padding:2px 8px; }
.diagpal .grp b { color:#8a4b00; }
.diagpal .t { border-color:#f0d9b5; background:#fffdf7; }
.timer { font-variant-numeric:tabular-nums; background:rgba(255,255,255,.16); padding:3px 10px; border-radius:12px; font-weight:700; letter-spacing:.5px; }
.timer.warn { background:#c0392b; }
.switch { font-size:12px; display:flex; align-items:center; gap:4px; cursor:pointer; }
.grid { display:grid; grid-template-columns:minmax(300px,1fr) minmax(430px,1.45fr) minmax(280px,0.9fr); gap:10px; padding:10px; align-items:start; }
.pane { background:#fff; border:1px solid var(--line); border-radius:6px; padding:10px 12px 14px; max-height:calc(100vh - 70px); overflow:auto; }
.pane h2 { margin:0 0 8px; font-size:13px; color:#12376b; border-bottom:2px solid #12376b; padding-bottom:5px; }
.pane h3 { font-size:12px; margin:14px 0 6px; color:#12376b; }
.card { background:#f6f9fd; border:1px solid #dbe6f5; border-radius:5px; padding:8px 10px; line-height:1.8; }
.card .k { color:#5b6b7d; }
.hint { font-size:12px; color:#7b8794; margin:8px 0; }
.askrow { display:flex; gap:6px; } .askrow input { flex:1; padding:6px 8px; border:1px solid var(--line); border-radius:4px; }
.chips { display:flex; flex-wrap:wrap; gap:5px; margin:7px 0; }
.chips button { padding:3px 9px; font-size:12px; border-radius:12px; background:#f2f6fb; }
.chips button.done { background:#e6f4ec; border-color:#9fd0b4; color:var(--green); text-decoration:line-through; }
.dialog { max-height:230px; overflow:auto; border:1px solid var(--line); border-radius:5px; padding:6px 8px; background:#fcfdff; }
.msg { margin:5px 0; } .msg .me { color:var(--blue); } .msg .dr { color:#12376b; font-weight:600; }
.examlist { display:flex; flex-direction:column; gap:4px; }
.examlist button { text-align:left; font-size:12px; padding:4px 8px; }
.examlist button.done { background:#e6f4ec; border-color:#9fd0b4; color:var(--green); }
.findings { margin-top:8px; font-size:12px; }
.finding { background:#fffdf3; border-left:3px solid var(--amber); padding:5px 8px; margin:5px 0; }
.field { margin:9px 0; } .field label { display:block; font-size:12px; color:#3d4c5c; margin-bottom:3px; font-weight:600; }
.field input,.field textarea,.field select { width:100%; padding:6px 8px; border:1px solid var(--line); border-radius:4px; font:inherit; }
.field textarea { min-height:74px; resize:vertical; }
.grid2 { display:grid; grid-template-columns:repeat(2,1fr); gap:6px 8px; }
.grid3 { display:grid; grid-template-columns:repeat(3,1fr); gap:6px 8px; }
.sec { margin:16px 0 6px; font-weight:700; font-size:12.5px; color:#12376b; background:#eef4fb; padding:4px 8px; border-radius:4px; }
.palette { border:1px dashed #b9cbe4; border-radius:5px; padding:6px; margin:6px 0 2px; background:#fafcff; }
.palette .grp { margin:4px 0; font-size:12px; }
.palette .grp b { color:#3d4c5c; margin-right:4px; }
.palette .t { display:inline-block; padding:1px 7px; margin:2px; border:1px solid #cfe0f3; border-radius:10px; background:#fff; cursor:pointer; font-size:12px; }
.palette .t:hover { background:#1f7ae0; color:#fff; border-color:#1f7ae0; }
.scorebox { text-align:center; padding:8px 0 4px; }
.score { font-size:44px; font-weight:800; line-height:1.1; }
.score.s0 { color:var(--red); } .score.s1 { color:var(--amber); } .score.s2 { color:var(--green); }
.grade { font-size:13px; color:#5b6b7d; margin-bottom:6px; }
.bar { height:7px; background:#e8eef6; border-radius:4px; overflow:hidden; margin:6px 0 10px; }
.bar i { display:block; height:100%; background:linear-gradient(90deg,#1f7ae0,#177245); }
.vetoalert { background:#fdecea; border:1px solid #f5b7b1; color:#922b21; padding:6px 8px; border-radius:4px; font-size:12px; margin-bottom:8px; }
.deductions { font-size:12px; }
.ded { border-left:3px solid #e8a33d; background:#fffbf3; padding:5px 8px; margin:5px 0; border-radius:0 4px 4px 0; cursor:pointer; }
.ded.veto { border-left-color:var(--red); background:#fdecea; }
.ded .m { font-weight:600; } .ded .a { color:#7b8794; }
.ded .p { float:right; color:var(--red); font-weight:700; }
.okmsg { color:var(--green); font-size:12px; }
.cov { font-size:12px; margin-top:10px; } .cov span { display:inline-block; padding:1px 7px; margin:2px; border-radius:10px; background:#eef4fb; }
.cov span.miss { background:#fdecea; color:#922b21; }
.submitbar { text-align:right; margin-top:14px; }
.modal { position:fixed; inset:0; background:rgba(18,40,70,.5); display:flex; align-items:center; justify-content:center; z-index:50; }
.modal.hidden { display:none; }
.modalbox { background:#fff; border-radius:8px; max-width:900px; width:92%; max-height:88vh; overflow:auto; padding:18px 22px; }
.modalfoot { text-align:right; padding-top:12px; }
.rep h3 { color:#12376b; border-bottom:1px solid var(--line); padding-bottom:4px; font-size:13px; margin:16px 0 8px; }
.rep table { width:100%; border-collapse:collapse; font-size:12px; } .rep td,.rep th { border:1px solid var(--line); padding:4px 7px; text-align:left; vertical-align:top; }
.rep .miss { background:#fdecea; } .rep .good { background:#eaf7ef; }
.big { font-size:30px; font-weight:800; } .big.s0{color:var(--red)} .big.s1{color:var(--amber)} .big.s2{color:var(--green)}


/* ============ 移动端适配 ============ */
.tabbar { display: none; }
.linkbtn { color:#fff; text-decoration:none; border:1px solid rgba(255,255,255,.5); border-radius:4px; padding:5px 10px; font-size:12px; }
.linkbtn:hover { background:rgba(255,255,255,.15); }

@media (max-width: 980px) {
  body { font-size: 15px; }
  .topbar { flex-wrap: wrap; gap: 6px; padding: 7px 10px; }
  .brand { width: 100%; }
  .brand b { font-size: 15px; }
  .brand .sub { display: block; margin: 0; font-size: 11px; }
  .tools { width: 100%; flex-wrap: wrap; gap: 6px; }
  .tools select { flex: 1 1 100%; order: -1; padding: 9px; font-size: 15px; }
  .modes { order: -2; }
  .mode { padding: 7px 13px; font-size: 13px; }
  .timer { padding: 5px 10px; font-size: 13px; }
  .tools button { padding: 8px 14px; font-size: 14px; }
  .switch { font-size: 12px; }
  .linkbtn { padding: 8px 12px; font-size: 13px; }

  .grid { display: block; padding: 8px 8px 76px; }
  .pane { display: none; max-height: none; border-radius: 8px; padding: 10px 12px 16px; }
  .pane.active { display: block; }
  .pane h2 { font-size: 14px; }

  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; height: 58px;
            background: #fff; border-top: 1px solid var(--line); z-index: 40;
            padding-bottom: env(safe-area-inset-bottom); }
  .tabbar button { flex: 1; border: 0; border-radius: 0; background: transparent; color: #5b6b7d;
                   font-size: 12.5px; padding: 6px 2px; display: flex; flex-direction: column;
                   align-items: center; justify-content: center; gap: 1px; }
  .tabbar button.on { color: #1f7ae0; font-weight: 700; box-shadow: inset 0 3px 0 #1f7ae0; }
  .tabbar #tabScore { font-size: 13px; }

  .field input, .field textarea, .field select { font-size: 16px; padding: 9px 10px; }
  .field textarea { min-height: 110px; }
  .field label { font-size: 12.5px; }
  .sec { font-size: 13px; padding: 5px 9px; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .chips button { padding: 7px 12px; font-size: 13px; }
  .examlist button { padding: 10px; font-size: 14px; }
  .palette .t { padding: 5px 10px; font-size: 13px; margin: 3px 2px; }
  .palette .grp { line-height: 2; }
  .dialog { max-height: 200px; font-size: 14px; }
  .card { font-size: 14px; }

  .rxtable thead { display: none; }
  .rxtable, .rxtable tbody, .rxtable tr, .rxtable td { display: block; width: 100%; }
  .rxtable tr { border: 1px solid var(--line); border-radius: 6px; margin: 8px 0; padding: 6px 9px; background: #fbfdff; }
  .rxtable td { border: 0; padding: 3px 0; }
  .rxtable td::before { content: attr(data-label); display: block; font-size: 11px; color: #5b6b7d; }
  .rxtable td:last-child { text-align: right; }
  .rxtable td:last-child::before { content: ''; }

  .modalbox { width: 100%; max-width: none; height: 100%; max-height: 100%; border-radius: 0; padding: 14px; }
  .modal { align-items: flex-start; }
  .score { font-size: 54px; }
  .big { font-size: 36px; }
  .rep table { font-size: 13px; }
  .rep th, .rep td { padding: 5px 6px; }
  .deductions { font-size: 13px; }
  .scorebox .cov { line-height: 1.9; }
}

.sw-short { display: none; }
@media (max-width: 980px) {
  .tools { align-items: center; }
  .tools > * { flex: 0 0 auto; }
  .tools button { flex: 0 0 auto; }
  .sw-full { display: none; }
  .sw-short { display: inline; }
  .switch { order: 3; }
  #btnSubmit { order: 2; }
  #btnReset { order: 4; }
  .linkbtn { order: 5; }
  .timer { order: 1; }
}
@media (max-width: 700px) {
  .tabs-scroll { overflow-x: auto; }
}
