/* ====== 特种作业人员实操考试系统 - 样式 ====== */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --primary: #2f6bff;
  --primary-dark: #1f4fd6;
  --primary-light: #eaf0ff;
  --danger: #e5484d;
  --success: #2f9e63;
  --warning: #d9822b;
  --bg: #f4f6fa;
  --card: #ffffff;
  --border: #e3e8f0;
  --text: #1c2333;
  --text-2: #5a6577;
  --text-3: #98a1b3;
  --shadow: 0 1px 3px rgba(28,35,51,.06), 0 4px 16px rgba(28,35,51,.06);
}
html, body { height: 100%; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.6;
}
button { font-family: inherit; }

/* ====== 通用 ====== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid transparent; border-radius: 8px; padding: 8px 16px;
  font-size: 14px; cursor: pointer; transition: all .15s; white-space: nowrap;
  background: #eef1f6; color: var(--text);
}
.btn:hover { filter: brightness(.96); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); filter: none; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-outline { background: #fff; border-color: var(--border); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: #eef1f6; color: var(--text); }
.btn-sm { padding: 4px 10px; font-size: 13px; border-radius: 6px; }
.btn-block { width: 100%; }
.btn-link { background: none; border: none; color: var(--primary); cursor: pointer; font-size: 13px; padding: 2px 6px; }
.btn-link.danger { color: var(--danger); }

.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 20px; box-shadow: var(--shadow);
}
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; flex-wrap: wrap; gap: 12px; }
.page-title { font-size: 20px; font-weight: 700; }
.page-desc { color: var(--text-2); font-size: 13px; margin-top: 2px; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 5px; font-weight: 500; }
.field input[type="text"], .field input[type="password"], .field input[type="number"],
.field select, .field textarea {
  width: 100%; border: 1px solid var(--border); border-radius: 8px;
  padding: 9px 12px; font-size: 14px; font-family: inherit; background: #fff; color: var(--text);
  outline: none; transition: border-color .15s;
}
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--primary); }
.field-row { display: flex; gap: 12px; }
.field-row .field { flex: 1; }
.form-error { color: var(--danger); font-size: 13px; margin-bottom: 10px; }

.badge { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 12px; font-weight: 500; background: #eef0f5; color: #55606f; }
.badge.part { background: #fff1e6; color: #c2570e; }
.badge.basic { background: #e6f4ff; color: #1766c2; }
.badge.emergency { background: #fdebec; color: #c22532; }
.badge.emergency2 { background: #fdf3e0; color: #9a6b0a; }
.badge.oral { background: #f3e8ff; color: #7c3aed; }
.badge.oral2 { background: #e8f7f4; color: #0f766e; }
.badge.choice { background: #f0f2f7; color: #5a6577; }
.badge.qa { background: #eefaf1; color: #22764a; }
.badge.done { background: #eefaf1; color: #22764a; }
.badge.doing { background: #fff8e6; color: #9a6b0a; }
.badge.deduct { background: #fdeef1; color: #b02a45; }
.badge.fixed { background: #e8eefc; color: #2b4fa2; }

/* ====== 登录页 ====== */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #2b3a67 0%, #2f6bff 55%, #66a6ff 100%);
  padding: 20px;
}
.login-card {
  background: #fff; border-radius: 16px; padding: 40px 36px; width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25); text-align: center;
}
.login-logo { font-size: 44px; }
.login-card h1 { font-size: 20px; margin: 8px 0 4px; }
.login-sub { color: var(--text-3); font-size: 13px; margin-bottom: 24px; }
.login-card form { text-align: left; }
.login-tip {
  margin-top: 20px; padding: 10px; background: var(--primary-light);
  border-radius: 8px; font-size: 12px; color: var(--primary-dark); text-align: left;
}

/* ====== 布局 ====== */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 230px; background: #1c2333; color: #cfd6e4; display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; flex-shrink: 0;
}
.sidebar-brand { padding: 20px 18px; font-size: 16px; font-weight: 700; color: #fff; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar-menu { flex: 1; padding: 12px 10px; overflow-y: auto; }
.menu-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 8px;
  cursor: pointer; margin-bottom: 4px; font-size: 14px; transition: all .15s;
}
.menu-item:hover { background: rgba(255,255,255,.08); color: #fff; }
.menu-item.active { background: var(--primary); color: #fff; }
.sidebar-footer { padding: 14px; border-top: 1px solid rgba(255,255,255,.08); }
.sidebar-user { font-size: 13px; margin-bottom: 10px; }
.sidebar-user b { color: #fff; display: block; }
.main-content { flex: 1; padding: 24px 28px; min-width: 0; }

/* ====== 表格 ====== */
.table-wrap { overflow-x: auto; }
table.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: 13px; }
.data-table th { color: var(--text-2); font-weight: 500; background: #fafbfd; white-space: nowrap; }
.data-table tr:hover td { background: #fafbff; }
.cell-title { max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar input[type="text"], .toolbar select {
  border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; font-size: 13px; outline: none;
}
.toolbar input[type="text"] { width: 220px; }
.toolbar input[type="date"] {
  padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 14px; background: #fff; color: var(--text-1); width: 145px;
}
.toolbar input[type="date"]:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.toolbar .spacer { flex: 1; }
.stat-chips { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.stat-chip { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 10px 16px; font-size: 13px; color: var(--text-2); }
.stat-chip b { font-size: 18px; color: var(--text); margin-right: 4px; }

/* ====== 弹窗 ====== */
.modal-mask {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; background: rgba(15,20,35,.45); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal {
  background: #fff; border-radius: 14px; width: 640px; max-width: 100%;
  max-height: 90vh; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.3);
  animation: pop .18s ease;
}
.modal-sm { width: 440px; }
.modal-wide { width: 1040px; }
.modal-wide .modal-body { padding: 18px 20px 22px; }
/* 弹窗弹出动画：只用缩放，不再从 opacity:0 起跳。
   部分安卓 WebView（尤其老内核对 fixed 元素的动画）动画不执行时会停在起始帧，
   起始帧透明度为 0 → 弹窗「弹不出来」（实际已 display:flex，但看不见）。 */
@keyframes pop { from { transform: scale(.96); } to { transform: scale(1); } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-head h3 { font-size: 16px; }
.modal-close { background: none; border: none; font-size: 22px; cursor: pointer; color: var(--text-3); line-height: 1; }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

.option-list { margin-bottom: 8px; }
.option-item { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.option-item .opt-label { width: 24px; font-weight: 600; color: var(--text-2); }
.option-item input { flex: 1; border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; font-size: 14px; outline: none; }
.option-item input:focus { border-color: var(--primary); }
.option-item .opt-del { background: none; border: none; color: var(--danger); cursor: pointer; font-size: 18px; }

.image-upload-row { display: flex; align-items: center; gap: 10px; }
.image-preview { max-width: 260px; max-height: 160px; margin-top: 8px; border-radius: 8px; border: 1px solid var(--border); }

/* ====== 试卷设置 ====== */
.setting-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 18px; }
.setting-item { background: #fafbfd; border: 1px solid var(--border); border-radius: 12px; padding: 16px; text-align: center; }
.setting-item .s-label { font-size: 13px; color: var(--text-2); margin-bottom: 8px; }
.setting-item input { width: 90px; text-align: center; font-size: 18px; font-weight: 700; padding: 6px; border: 1px solid var(--border); border-radius: 8px; outline: none; }
.setting-item input:focus { border-color: var(--primary); }
.total-line { font-size: 14px; margin-bottom: 18px; }
.total-line b { color: var(--primary); font-size: 18px; }
.template-box { border: 1px dashed var(--border); border-radius: 12px; padding: 18px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.template-info { flex: 1; min-width: 200px; }

/* ====== 学员考试入口 ====== */
.exam-entry-card { max-width: 720px; margin: 0 auto; text-align: center; }
.exam-entry-card .big-icon { font-size: 52px; margin: 10px 0; }
.rule-list { text-align: left; background: #fafbfd; border: 1px solid var(--border); border-radius: 12px; padding: 18px 22px; margin: 18px 0; }
.rule-list li { margin: 6px 0; color: var(--text-2); }
.rule-list b { color: var(--text); }

/* ====== 考试视图 ====== */
.exam-view {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; background: var(--bg); z-index: 50;
  display: flex; flex-direction: column;
}
/* 答题全屏（body.exam-active）时隐藏侧栏与呼出控件，避免挡住考题 */
body.exam-active #app-shell .sidebar,
body.exam-active #app-shell .menu-toggle,
body.exam-active #app-shell .menu-scrim,
body.exam-active #app-shell .menu-hotzone { display: none !important; }
.exam-header {
  background: #fff; border-bottom: 1px solid var(--border);
  padding: 14px 28px; display: flex; align-items: center; justify-content: space-between; gap: 20px;
}
.exam-title { font-size: 17px; font-weight: 700; }
.exam-progress-wrap { display: flex; align-items: center; gap: 10px; flex: 1; max-width: 420px; }
.exam-progress { flex: 1; height: 8px; background: #e9edf5; border-radius: 6px; overflow: hidden; }
.exam-progress-bar { height: 100%; background: var(--primary); border-radius: 6px; transition: width .25s; }
.exam-progress-text { font-size: 13px; color: var(--text-2); white-space: nowrap; }
.exam-body { flex: 1; display: flex; gap: 20px; padding: 22px 28px; overflow: hidden; }
.exam-card-area { flex: 1; overflow-y: auto; min-width: 0; }
.exam-side {
  width: 240px; flex-shrink: 0; background: #fff; border: 1px solid var(--border);
  border-radius: 12px; padding: 18px; height: fit-content; box-shadow: var(--shadow);
}
.exam-side-title { font-weight: 700; margin-bottom: 12px; }
.exam-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-bottom: 16px; }
.grid-item {
  height: 36px; border-radius: 8px; border: 1px solid var(--border); background: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 13px; cursor: pointer;
  transition: all .15s;
}
.grid-item.answered { background: var(--primary-light); border-color: var(--primary); color: var(--primary-dark); font-weight: 600; }
.grid-item.current { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 700; }
.exam-footer {
  background: #fff; border-top: 1px solid var(--border);
  padding: 12px 28px; display: flex; align-items: center; justify-content: space-between;
}
.exam-q-position { color: var(--text-2); font-size: 14px; }

.q-card {
  max-width: 820px; margin: 0 auto; background: #fff; border: 1px solid var(--border);
  border-radius: 14px; padding: 26px 30px; box-shadow: var(--shadow); animation: slideIn .25s ease;
}
@keyframes slideIn { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.q-meta { display: flex; gap: 8px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.q-index { font-size: 13px; color: var(--text-3); }
.q-title-text { font-size: 17px; font-weight: 600; margin-bottom: 8px; line-height: 1.7; }
.q-image { max-width: 350px; max-height: 200px; border-radius: 10px; border: 1px solid var(--border); margin: 10px 0; display: block; }
.opt-row {
  display: flex; align-items: flex-start; gap: 12px; padding: 12px 16px; border: 1px solid var(--border);
  border-radius: 10px; margin-bottom: 10px; cursor: pointer; transition: all .15s; font-size: 15px;
}
.opt-row:hover { border-color: var(--primary); }
.opt-row.selected { border-color: var(--primary); background: var(--primary-light); }
.opt-row .opt-key { font-weight: 700; color: var(--primary-dark); }
/* 试卷详情页选择题：直接点选作答 */
.pd-opts { display: flex; flex-direction: column; gap: 8px; margin: 6px 0 10px; }
.pd-opts .opt-row { cursor: pointer; user-select: none; }
.pd-opts .opt-row:active { transform: scale(0.995); }
.q-textarea {
  width: 100%; min-height: 140px; border: 1px solid var(--border); border-radius: 10px;
  padding: 14px; font-size: 15px; font-family: inherit; resize: vertical; outline: none;
}
.q-textarea:focus { border-color: var(--primary); }
.q-hint { color: var(--text-3); font-size: 13px; margin-top: 6px; }

/* ====== 试卷详情 ====== */
.paper-detail { max-width: 880px; margin: 0 auto; }
.paper-head-card { margin-bottom: 16px; }
.paper-head-card .meta-line { display: flex; gap: 22px; flex-wrap: wrap; color: var(--text-2); font-size: 13px; margin-top: 6px; }
.score-big { font-size: 30px; font-weight: 800; color: var(--primary); }
.review-block { margin-bottom: 14px; }
.review-ans {
  margin-top: 10px; border-radius: 10px; padding: 12px 16px; font-size: 14px;
  background: #fafbfd; border: 1px solid var(--border);
}
.review-ans .ans-label { font-weight: 600; margin-right: 6px; }
.review-ans.correct { background: #eefaf1; border-color: #bfe6cd; }
.review-ans.wrong { background: #fdebec; border-color: #f3c1c3; }
.review-ans.ref { background: #fff8e6; border-color: #f0dfb2; }
.tag-right { color: var(--success); font-weight: 700; }
.tag-wrong { color: var(--danger); font-weight: 700; }

/* ====== 考官打分 / 签字 ====== */
.grade-row { margin-top: 10px; font-size: 14px; font-weight: 600; color: var(--text-1); }
.grade-input {
  width: 76px; padding: 6px 10px; border: 1px solid var(--primary); border-radius: 8px;
  font-size: 15px; font-weight: 700; color: var(--primary-dark); text-align: center; outline: none;
}
.grade-input:focus { box-shadow: 0 0 0 3px var(--primary-light); }
/* 按次扣分题型：题型评分抬头 + 扣分次数输入 */
.deduct-head {
  margin: 18px 0 10px; padding: 12px 18px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  background: #fdf6f7; border: 1px solid #f3d3da; border-left: 4px solid #b02a45;
}
.deduct-head-main { flex: 1; min-width: 240px; }
.deduct-head-title { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.deduct-head-meta { font-size: 13px; color: var(--text-2); margin-top: 4px; }
.deduct-head-meta b { color: #b02a45; font-size: 15px; }
.deduct-head-meta .deduct-got { color: var(--success); }
.deduct-cap { color: var(--text-3); font-size: 12px; }
.deduct-check-wrap { font-size: 13px; color: var(--text-2); display: inline-flex; align-items: center; gap: 6px; cursor: pointer; white-space: nowrap; }
.deduct-check-wrap.disabled { opacity: .55; cursor: not-allowed; }
/* 叉车试卷：免核对，直接计入总分（替代「已核对」复选框） */
.deduct-auto { font-size: 13px; color: #0a7d3b; background: #e6f4ec; border: 1px solid #bfe3cd; border-radius: 20px; padding: 3px 10px; white-space: nowrap; }
.btn-link.ex-gen { color: #1c6dd0; }
.deduct-block { border-left: 3px solid #f0c3cd; }
.deduct-row { font-weight: 500; }
.deduct-input {
  width: 72px; padding: 5px 8px; border: 1px solid #b02a45; border-radius: 8px;
  font-size: 15px; font-weight: 700; color: #b02a45; text-align: center; outline: none;
}
.deduct-input:focus { box-shadow: 0 0 0 3px #fbe2e7; }
/* 扣分次数两侧的 − / + 微调按钮 */
.deduct-step { display: inline-flex; align-items: center; gap: 6px; vertical-align: middle; }
.deduct-step-btn {
  width: 30px; height: 30px; padding: 0; border: 1px solid #b02a45; border-radius: 8px;
  background: #fff; color: #b02a45; font-size: 18px; font-weight: 700; line-height: 1;
  font-family: inherit; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  transition: background .15s, color .15s;
}
.deduct-step-btn:hover:not(:disabled) { background: #b02a45; color: #fff; }
.deduct-step-btn:active:not(:disabled) { transform: translateY(1px); }
.deduct-step-btn:disabled { opacity: .45; cursor: not-allowed; }
/* 已有 −/+ 按钮，隐藏数字输入框自带的上下微调箭头，避免误触与挤压 */
.deduct-step .deduct-input { width: 64px; -moz-appearance: textfield; appearance: textfield; }
.deduct-step .deduct-input::-webkit-outer-spin-button,
.deduct-step .deduct-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.deduct-row .deduct-pts { color: #b02a45; font-weight: 700; }
/* ====== 考官端：按次扣分题型以列表呈现，次数 −/+ 固定在右侧列 ====== */
.deduct-list-box { padding: 0; overflow: hidden; margin: 0 0 14px; }
.deduct-list-box .table-wrap { overflow-x: auto; }
.deduct-list { width: 100%; border-collapse: collapse; font-size: 14px; }
.deduct-list thead th {
  background: #fdf6f7; color: #8d2233; font-size: 13px; font-weight: 600;
  text-align: left; padding: 9px 12px; white-space: nowrap; border-bottom: 1px solid #f3d3da;
}
.deduct-list tbody td { padding: 8px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.deduct-list tbody tr:last-child td { border-bottom: 0; }
.deduct-list tbody tr:hover td { background: #fffafb; }
.deduct-list .dl-no { width: 56px; color: var(--text-3); white-space: nowrap; }
.deduct-list th.dl-no { text-align: center; }
.deduct-list tbody .dl-no { text-align: center; }
.deduct-list .dl-title { min-width: 220px; line-height: 1.6; word-break: break-word; }
.deduct-list .dl-image { display: block; max-width: 180px; max-height: 90px; margin-top: 6px; border-radius: 6px; }
.deduct-list .dl-per { width: 108px; color: var(--text-2); font-size: 13px; white-space: nowrap; }
.deduct-list .dl-pts { width: 96px; color: var(--text-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.deduct-list .dl-pts.on { color: #b02a45; font-weight: 700; }
/* 0 分不显示负号：只在有扣分时亮出「-」 */
.deduct-list .dl-pts .dl-sign { display: none; }
.deduct-list .dl-pts.on .dl-sign { display: inline; }
.deduct-list .dl-pts .deduct-pts { font-weight: 700; }
.deduct-list .dl-times { width: 190px; white-space: nowrap; text-align: right; }
.deduct-list th.dl-times { text-align: right; }
.deduct-list tfoot td {
  padding: 9px 12px; background: #fdf6f7; border-top: 1px solid #f3d3da;
  color: var(--text-2); font-size: 13px;
}
.deduct-list tfoot .dl-foot-label b, .deduct-list tfoot .deduct-sum { color: #b02a45; font-size: 15px; }
.deduct-list tfoot .deduct-sum-got { color: var(--success); font-size: 15px; }
.deduct-list .dl-empty { text-align: center; color: var(--text-3); padding: 18px 0; }
.deduct-list-tip { padding: 8px 14px 12px; font-size: 12px; color: var(--text-3); }
.deduct-list-tip .deduct-locked { color: #b02a45; margin-left: 10px; }
@media (max-width: 560px) {
  .deduct-list { font-size: 13px; }
  .deduct-list thead th, .deduct-list tbody td, .deduct-list tfoot td { padding: 7px 8px; }
  .deduct-list .dl-per { width: 76px; font-size: 12px; }
  .deduct-list .dl-pts { width: 70px; }
  .deduct-list .dl-no { width: 40px; }
  .deduct-list .dl-times { width: 150px; }
  /* 窄屏横向滚动时把「次数」列吸附在右侧，点加减不用来回滑 */
  .deduct-list th.dl-times, .deduct-list td.dl-times {
    position: sticky; right: 0; background: var(--card);
    box-shadow: -8px 0 10px -8px rgba(0, 0, 0, .18);
  }
  .deduct-list thead th.dl-times { background: #fdf6f7; }
  .deduct-list-box .deduct-list-tip { font-size: 12px; }
  .deduct-step-btn { width: 28px; height: 28px; font-size: 17px; }
  .deduct-step .deduct-input { width: 52px; }
}
/* ====== 考试项目 ↔ 试卷（一个项目可勾选多份） ====== */
.ps-project {
  width: 100%; max-width: 280px; padding: 6px 10px; border: 1px solid var(--border);
  border-radius: 8px; font-size: 14px; color: var(--text-1); outline: none; background: #fff;
}
.ps-project:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.ps-ck-cell { display: flex; flex-wrap: wrap; gap: 8px 10px; }
.ps-ck {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border: 1px solid var(--border);
  border-radius: 999px; background: #fafbfd; font-size: 13px; color: var(--text-2); cursor: pointer; white-space: nowrap;
}
.ps-ck:hover { border-color: var(--primary); color: var(--text-1); }
.ps-ck.on { background: var(--primary-light); border-color: var(--primary); color: var(--primary-dark); font-weight: 600; }
.ps-ck input { margin: 0; cursor: pointer; }
.ps-ck-warn { font-size: 11px; color: #c62828; }
.result-pass { color: var(--success); }
.result-fail { color: var(--danger); }
.sign-img { height: 52px; max-width: 180px; object-fit: contain; background: #fff; border: 1px solid var(--border); border-radius: 6px; }
.name-link { font-size: 14px; }
.name-link:hover { text-decoration: underline; }

/* ====== 考试记录列表 ====== */
.record-list { display: flex; flex-direction: column; }
.record-item {
  display: flex; align-items: center; gap: 16px; padding: 14px 6px;
  border-bottom: 1px solid var(--border); flex-wrap: wrap;
}
.record-item:last-child { border-bottom: none; }
.record-item:hover { background: #fafbfd; }
.record-main { flex: 1; min-width: 0; }
.record-name { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; word-break: break-all; }
.record-meta { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--text-3); margin-top: 5px; }
.record-score { min-width: 88px; text-align: center; }
.record-score b { font-size: 20px; color: var(--primary); margin-right: 4px; }
.record-score span { font-size: 13px; font-weight: 600; }
.record-ungraded { color: var(--text-3); font-size: 13px; }
.record-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ====== 批量管理 ====== */
.batch-bar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 10px 12px; margin-bottom: 4px;
  background: #f6f8fb; border: 1px solid var(--border); border-radius: 10px;
}
.batch-count { font-size: 13px; color: var(--text-2); min-width: 90px; }
.rec-pick { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; padding: 4px 2px; flex: none; }
.rec-pick input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; accent-color: var(--primary); }
.rec-pick-all { font-size: 13px; font-weight: 600; }

/* ====== 打印 ====== */
#print-area { display: none; }
@media print {
  /* 只保留打印区域：被 visibility:hidden 的元素仍占布局高度，会把文档撑到第二页，
     因此应用主体/登录页/弹窗必须 display:none（仅对容器，不动 #print-area 内部） */
  #app-shell, #login-page, #toast { display: none !important; }
  .modal { display: none !important; }
  html, body { height: auto !important; margin: 0 !important; padding: 0 !important; background: #fff !important; }
  body * { visibility: hidden !important; }
  /* 只恢复可见性，不能改 display：模板里的 table/tr/td 若被改成 block 会破坏表格版式 */
  #print-area, #print-area * { visibility: visible !important; }
  #print-area { display: block !important; position: absolute; left: 0; top: 0; width: 100%; margin: 0; padding: 0; }
  #print-area table { border-collapse: collapse; }
  .p-title { font-size: 22px; font-weight: 700; text-align: center; margin-bottom: 12px; }
  .p-meta { font-size: 13px; text-align: center; margin-bottom: 4px; }
  .p-head { border-bottom: 2px solid #000; padding-bottom: 10px; margin-bottom: 16px; }
  .p-q { margin-bottom: 14px; page-break-inside: avoid; }
  .p-q-title { font-size: 14px; font-weight: 600; line-height: 1.7; }
  .p-opt { font-size: 13px; margin-left: 22px; line-height: 1.8; }
  .p-ans { font-size: 13px; margin-left: 22px; line-height: 2.2; border-bottom: 1px solid #999; width: 80%; }
  .p-img { max-width: 55%; max-height: 6cm; margin: 6px 0 0 22px; }
  .p-score { font-size: 12px; color: #0a7d3b; margin: 4px 0 0 22px; font-weight: 600; }
  .p-result { font-weight: 700; font-size: 15px; }
  .p-sign { width: 1.5cm; height: 1cm; object-fit: contain; vertical-align: middle; }
  .p-sign-blank { display: inline-block; width: 60px; border-bottom: 1px solid #333; }
}

/* ====== 操作记录 ====== */
.log-table td { font-size: 13px; vertical-align: top; }
.log-table .log-detail { max-width: 420px; color: var(--text-2); word-break: break-word; }
.log-table tbody tr:hover { background: #f7f9fc; }
.log-table input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--primary); cursor: pointer; }
/* 考生管理批量删除勾选框 */
.data-table input.ex-check { width: 15px; height: 15px; accent-color: var(--primary); cursor: pointer; }
.log-table .badge { white-space: nowrap; }
.log-table td .btn-link { white-space: nowrap; }

/* ====== 提示 ====== */
.toast {
  position: fixed; top: 24px; left: 50%; transform: translateX(-50%);
  background: #1c2333; color: #fff; padding: 10px 22px; border-radius: 10px;
  font-size: 14px; z-index: 200; box-shadow: 0 8px 30px rgba(0,0,0,.25); animation: pop .2s ease;
  max-width: min(760px, 86vw); white-space: pre-wrap; line-height: 1.6;
}
.empty-tip { text-align: center; color: var(--text-3); padding: 40px 0; }

/* ====== 参数说明表格 ====== */
.param {
  font-family: ui-monospace, SFMono-Regular, Consolas, "Courier New", monospace;
  background: #f1f5fb; color: #2b5cab; border: 1px solid #dde6f4;
  border-radius: 4px; padding: 1px 6px; font-size: 12px; white-space: nowrap;
}
.data-table td code.param { white-space: nowrap; }

@media (max-width: 900px) {
  .sidebar { width: 64px; }
  .sidebar-brand { font-size: 0; padding: 18px 8px; text-align: center; }
  .sidebar-brand::before { content: "🛠️"; font-size: 18px; }
  .menu-item span, .sidebar-user { display: none; }
  .exam-body { flex-direction: column-reverse; overflow-y: auto; }
  .exam-side { width: 100%; }
  .setting-grid { grid-template-columns: 1fr; }
  .field-row { flex-direction: column; gap: 0; }
}

/* ====== 图片点击放大预览（lightbox） ====== */
#img-lightbox {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 9999; display: none;
  align-items: center; justify-content: center; flex-direction: column;
  background: rgba(0, 0, 0, .78); cursor: zoom-out;
}
#img-lightbox.show { display: flex; }
#img-lightbox img {
  max-width: 92vw; max-height: 86vh; background: #fff;
  border-radius: 6px; box-shadow: 0 10px 46px rgba(0, 0, 0, .55);
}
#img-lightbox .img-lightbox-tip {
  color: #fff; font-size: 13px; margin-top: 12px; opacity: .85; user-select: none;
}
img[data-imgid] { cursor: zoom-in; }

/* ====== 选择题选项配图 ====== */
.option-item { flex-wrap: wrap; }
.option-item .opt-img-btn { background: none; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; font-size: 15px; line-height: 1; padding: 7px 9px; color: var(--text-2); }
.option-item .opt-img-btn:hover { border-color: var(--primary); color: var(--primary); }
.opt-img-wrap { position: relative; display: inline-flex; align-items: flex-start; gap: 2px; }
.option-item .opt-img-preview { max-width: 110px; max-height: 60px; margin: 0; cursor: zoom-in; }
.option-item .opt-img-rm { background: none; border: none; color: var(--danger); cursor: pointer; font-size: 16px; line-height: 1; padding: 0 2px; }
/* 考试页 / 详情页：选项行内的图片尺寸收窄 */
.opt-row .q-image.opt-image, .pd-opts .q-image.opt-image { max-width: 190px; max-height: 115px; margin: 6px 0 0; }
/* 打印：选项图片 */
.p-opt .p-img { max-width: 45%; max-height: 110px; margin: 4px 0 0; }

/* ====== 竖屏 / 窄屏：侧边菜单自动隐藏（抽屉），点左上角按钮呼出 ====== */
/* 横屏桌面（宽 > 980px）不受任何影响：按钮与遮罩默认不显示 */
.menu-toggle, .menu-scrim { display: none; }

@media (orientation: portrait) and (max-width: 980px) {
  .app-shell { display: block; }

  /* 菜单变成贴边抽屉，默认藏在屏幕外 */
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; width: 240px; max-width: 78vw;
    height: 100vh; z-index: 60; transform: translateX(-102%);
    transition: transform .22s ease; box-shadow: 0 0 30px rgba(0,0,0,.4);
  }
  .app-shell.menu-open .sidebar { transform: translateX(0); }
  /* 覆盖「窄屏缩成图标栏」的规则：竖屏下抽屉里显示完整菜单 */
  .sidebar-brand { font-size: 16px; padding: 20px 18px; text-align: left; }
  .sidebar-brand::before { content: none; }
  .menu-item span { display: inline; }
  .sidebar-user { display: block; }

  /* 呼出按钮：固定在左上角，考试答题页等全屏视图不经过 app-shell，自然不显示 */
  .menu-toggle {
    display: flex; align-items: center; justify-content: center;
    position: fixed; top: 10px; left: 12px; width: 44px; height: 44px; z-index: 70;
    border: none; border-radius: 10px; background: #1c2333; color: #fff;
    font-size: 20px; line-height: 1; cursor: pointer; box-shadow: 0 2px 10px rgba(0,0,0,.3);
  }
  .menu-toggle:active { background: var(--primary); }

  /* 半透明遮罩：点空白处收起菜单 */
  .menu-scrim {
    display: block; position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 55;
    background: rgba(0, 0, 0, .42); opacity: 0; pointer-events: none;
    transition: opacity .2s ease;
  }
  .app-shell.menu-open .menu-scrim { opacity: 1; pointer-events: auto; }

  .main-content { padding: 60px 14px 20px; }

  /* 工具栏（搜索框 / 筛选下拉）：竖屏下占满一行，不再固定宽度溢出 */
  .toolbar input[type="text"] { flex: 1 1 150px; width: auto; min-width: 0; }
  .toolbar select { max-width: 100%; }

  /* 出卷记录 / 考试记录列表：竖屏下信息纵向堆叠、操作按钮整行排列更易点 */
  .record-item { gap: 8px; padding: 12px 2px; }
  .record-score { min-width: 64px; }
  .record-actions { width: 100%; justify-content: flex-end; gap: 8px; }
  .record-actions .btn { padding: 8px 14px; }

  /* 试卷详情：题目图片按屏幕比例限高，保证竖屏下一屏能完整显示一道题 */
  .paper-detail .q-image { max-width: 62vw; max-height: 26vh; }
  .paper-detail .opt-row .q-image.opt-image, .paper-detail .pd-opts .q-image.opt-image { max-width: 44vw; max-height: 20vh; }

  /* ====== 全页面横竖屏自适应（竖屏 / 窄屏通用补充，横屏桌面不受影响） ====== */
  .card { padding: 14px; border-radius: 10px; }
  .page-head { margin-bottom: 12px; }
  .page-title { font-size: 18px; }
  /* 登录卡片不再固定 400px，窄屏不溢出 */
  .login-card { width: 100%; max-width: 400px; padding: 28px 22px; }
  /* 表格更紧凑：配合 .table-wrap 横向滚动，长内容自动换行 */
  .data-table th, .data-table td { padding: 8px 8px; font-size: 12px; }
  .data-table th { white-space: nowrap; }
  .data-table td { word-break: break-word; }
  .cell-title { max-width: 46vw; }
  /* 弹窗：竖屏下占满屏宽、限高 92vh，底部按钮可换行 */
  .modal-mask { padding: 10px; }
  .modal, .modal-sm, .modal-wide { width: 100%; max-height: 92vh; }
  .modal-body { padding: 14px; }
  .modal-foot { padding: 12px 14px; flex-wrap: wrap; }
  .modal-foot .btn { flex: 1 1 auto; }
  /* 表单并排字段改为纵向排列 */
  .field-row { flex-direction: column; gap: 0; }
  /* 试卷方案等三列网格改单列（900px 规则的补充，覆盖 900~980px 竖屏区间） */
  .setting-grid { grid-template-columns: 1fr; }
  /* 工具栏中的日期/下拉不再固定宽，避免溢出 */
  .toolbar input[type="date"] { width: auto; min-width: 120px; }
  /* 试卷详情头部：总评数字在窄屏下不挤压 */
  .paper-detail .score-big { font-size: 26px; }
  /* 签到横幅在窄竖屏下缩小字号 */
  .ck-banner { font-size: 30px; padding: 16px 14px; }
  .ck-banner .ck-banner-sub { font-size: 17px; }
  .ck-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .ck-name { font-size: 26px; padding: 20px 10px; }
}

/* ====== 侧边栏自动隐藏（宽屏同样生效，可一键固定） ====== */
/* 默认开启：菜单平时收起，鼠标移到屏幕左边缘（触屏点左边缘的小把手）滑出，鼠标移开自动收回；
   点菜单底部「📌 固定显示菜单」可切回常驻显示，选择按浏览器记忆（localStorage: menu_autohide）。 */
.menu-pin {
  width: 100%; margin-top: 8px; padding: 7px 10px; font-size: 12px; line-height: 1.25;
  background: rgba(255,255,255,.08); color: #cfd6e4; font-family: inherit;
  border: 1px solid rgba(255,255,255,.16); border-radius: 8px; cursor: pointer; text-align: center;
}
.menu-pin:hover { background: rgba(255,255,255,.16); color: #fff; }
.menu-hotzone { display: none; }

/* 收起状态：整条侧栏移出屏幕左侧；布局上不再占位，主内容自动占满整宽 */
.app-shell.auto-hide .sidebar {
  position: fixed; left: 0; top: 0; bottom: 0; width: 230px; max-width: 82vw;
  height: 100vh; z-index: 60; transform: translateX(-100%);
  transition: transform .22s ease; box-shadow: 6px 0 26px rgba(0,0,0,.28);
}
/* 滑出的抽屉里显示完整菜单文字（覆盖窄屏「缩成图标栏」的规则） */
.app-shell.auto-hide .sidebar-brand { font-size: 16px; padding: 20px 18px; text-align: left; }
.app-shell.auto-hide .sidebar-brand::before { content: none; }
.app-shell.auto-hide .menu-item span { display: inline; }
.app-shell.auto-hide .sidebar-user { display: block; }
.app-shell.auto-hide.menu-open .sidebar { transform: translateX(0); }

/* 左边缘热区：整条高度都能触发，右侧中部常驻一个小把手提示可点 */
.app-shell.auto-hide .menu-hotzone {
  display: block; position: fixed; left: 0; top: 0; bottom: 0; width: 16px; z-index: 65;
  background: transparent; transition: background .15s ease; cursor: pointer;
}
.app-shell.auto-hide .menu-hotzone::after {
  content: "☰"; position: absolute; left: 0; top: calc(50% - 34px);
  width: 16px; height: 68px; display: flex; align-items: center; justify-content: center;
  background: rgba(28,35,51,.5); color: #fff; font-size: 12px; line-height: 1;
  border-radius: 0 9px 9px 0; box-shadow: 0 2px 8px rgba(0,0,0,.18);
}
.app-shell.auto-hide .menu-hotzone:hover { background: rgba(28,35,51,.16); }
.app-shell.auto-hide .menu-hotzone:hover::after { background: var(--primary); }
.app-shell.auto-hide.menu-open .menu-hotzone { display: none; }

/* 打开时半透明遮罩：点空白处收回菜单 */
.app-shell.auto-hide .menu-scrim {
  display: block; position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 55;
  background: rgba(0,0,0,.3); opacity: 0; pointer-events: none; transition: opacity .2s ease;
}
.app-shell.auto-hide.menu-open .menu-scrim { opacity: 1; pointer-events: auto; }

/* 极窄屏（图标栏模式）：固定按钮只显示图钉图标，避免文字溢出 */
@media (max-width: 900px) and (orientation: landscape) {
  .app-shell:not(.auto-hide) .menu-pin { font-size: 0; padding: 6px 0; }
  .app-shell:not(.auto-hide) .menu-pin::before { content: "📌"; font-size: 14px; }
}

/* ====== 考生签到页：所选项目 + 考试日期 特大字横幅 + 考生姓名大按钮 ====== */
.ck-banner {
  display: flex; align-items: center; justify-content: center; gap: 18px;
  background: var(--primary, #1c4fd8); color: #fff;
  border-radius: 16px; padding: 22px 24px; margin-bottom: 16px;
  font-size: 42px; font-weight: 800; letter-spacing: 2px; text-align: center;
  box-shadow: 0 4px 16px rgba(0,0,0,.18); flex-wrap: wrap;
}
.ck-banner .ck-banner-sub { font-size: 22px; font-weight: 600; opacity: .92; letter-spacing: 0; }
.ck-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px; margin-top: 14px;
}
.ck-name {
  position: relative; border: 2px solid var(--border); border-radius: 14px;
  background: #fff; color: var(--text, #1c2333);
  font-size: 36px; font-weight: 700; padding: 30px 12px;
  cursor: pointer; text-align: center; line-height: 1.2;
  transition: transform .08s ease, box-shadow .12s ease;
  word-break: break-all;
  /* 去掉移动端 300ms 点击延迟与双击缩放判定：点一下立刻响应 */
  touch-action: manipulation; -ms-touch-action: manipulation;
}
.ck-name:hover { box-shadow: 0 4px 14px rgba(0,0,0,.14); }
.ck-name:active { transform: scale(.97); }
.ck-name .ck-signed {
  position: absolute; top: 8px; right: 10px; font-size: 13px; font-weight: 600;
  color: #fff; background: #2e7d32; border-radius: 999px; padding: 2px 10px;
}
.ck-name .ck-proj { display: block; font-size: 14px; font-weight: 500; color: var(--text-3, #667); margin-top: 6px; }

/* ============================================================
   手写签名板（考生签到 / 考生签名 / 考官签名 / 第二考官签名）
   · touch-action:none —— 手指在板上滑动只画线，不滚动页面
   · 关闭长按选中、长按菜单与点击高亮 —— 安卓 WebView 里长按会打断笔画
   ============================================================ */
#sign-canvas, #checkin-canvas, #sign2-canvas, #exsign-canvas, #sgsign-canvas {
  touch-action: none;
  -webkit-user-select: none; -moz-user-select: none; user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-drag: none;
}

/* 构建标识：现场排障时用于确认设备上跑的是不是最新代码（侧边栏底部小字） */
.build-tag {
  display: block; margin-top: 6px; text-align: center;
  font-size: 11px; color: rgba(207, 214, 228, .55); letter-spacing: .3px; user-select: none;
}

/* 考生管理页 · 预约系统同步状态条 */
.res-sync-bar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  margin: 10px 0 2px; padding: 8px 12px;
  background: #f2f7ff; border: 1px solid #cfe0f5; border-radius: 10px;
  font-size: 13px; color: #3a4b63;
}
.res-sync-bar .res-muted { font-weight: 600; color: #1c6dd0; }
.res-sync-bar .res-err { color: #c23b3b; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.res-sync-bar button { margin-left: auto; }


/* 签到表生成卡片 · 应考/实考人数与考官签字状态 */
.sg-meta { font-size: 13px; color: var(--text-2); margin-top: 6px; line-height: 1.7; }
.sgsign-list { border: 1px solid var(--border); border-radius: 10px; padding: 6px 10px; margin-bottom: 4px; }
.sgsign-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 5px 0; font-size: 14px; border-bottom: 1px dashed var(--border); }
.sgsign-row:last-child { border-bottom: none; }

/* 签到弹窗 · 预约系统电子签名带入条（检测到匹配签名时显示） */
#checkin-res-sign { flex-wrap: wrap; }
#checkin-res-sign .ck-res-tip { font-size: 13px; color: #2f6b2f; font-weight: 600; }
#checkin-res-sign .ck-res-img { height: 44px; max-width: 160px; object-fit: contain; background: #fff; border: 1px solid #d8e6d8; border-radius: 6px; padding: 2px; }
#checkin-res-sign button { margin-left: auto; font-size: 14px; padding: 6px 16px; }

/* 成绩导出弹窗（考试记录页 · 考试日期之后） */
.score-export-check { width: 15px; height: 15px; accent-color: var(--primary); cursor: pointer; }
#score-export-body td { white-space: nowrap; }
#score-export-body tr:hover td { background: #fafbff; }
