/* 统一入口身份门：仅 gate-mode 下出现，不改动任何既有管理视图 */
#gate { display: none; }
.gate-mode #boot, .gate-mode #login, .gate-mode #shell { display: none !important; }
.gate-mode #gate { display: flex; }
.gate-wrap { min-height: 100vh; align-items: center; justify-content: center; padding: 20px; }
.gate-card {
  width: 360px; max-width: 100%; background: #fff; border: 1px solid #e2eaee;
  border-radius: 10px; padding: 28px; text-align: center;
}
.gate-card h1 { font-size: 22px; color: #187890; }
.gate-card .sub { margin: 8px 0 22px; color: #7b8f99; font-size: 12px; }
.gate-btn {
  display: block; width: 100%; text-align: left; margin-bottom: 12px;
  padding: 14px 16px; border: 1px solid #d8e3e8; background: #fafcfd;
  border-radius: 8px; cursor: pointer; font: inherit;
}
.gate-btn:hover { border-color: #2193b0; background: #e6f3f6; }
.gate-title { display: block; font-size: 15px; color: #22313a; font-weight: 500; }
.gate-desc { display: block; margin-top: 4px; font-size: 12px; color: #7b8f99; }
.gate-foot { margin: 16px 0 0; font-size: 11px; color: #8a9ba3; }

* { box-sizing: border-box; }
:root {
  /* 内容展示区最大宽度：宽屏左右留白、窄屏自适应铺满。
     菜单与列设计以 1280px 为基准：扣掉 content 左右 20px padding 与 view 内 16px padding，
     表格可用宽约 1208px，12 列时每列平均约 100px，仍可横向滚动兜底。
     顶栏用同一个 gutter 对齐内容左边缘，避免出现「导航贴边、内容居中」的错位。 */
  --page-max: 1280px;
  --page-gutter: max(20px, calc((100% - var(--page-max)) / 2 + 20px));
}
body {
  margin: 0;
  font: 13px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #22313a;
  background: #f5f8fa;
}
h1, h2 { font-weight: 500; margin: 0; }
h1 { font-size: 18px; }
h2 { font-size: 14px; }
button, input { font: inherit; }
[hidden] { display: none !important; }

.boot { padding: 40px; text-align: center; color: #5f7480; }

.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-card {
  width: 320px; background: #fff; border: 1px solid #e2eaee;
  border-radius: 8px; padding: 24px;
}
.login-card .sub { margin: 6px 0 20px; color: #7b8f99; font-size: 12px; }
.login-card label { display: block; margin-bottom: 12px; color: #5f7480; font-size: 12px; }
.login-card input {
  display: block; width: 100%; margin-top: 5px; padding: 8px 10px;
  border: 1px solid #d8e3e8; border-radius: 6px; outline: none;
}
.login-card input:focus { border-color: #2193b0; }

.btn {
  border: 1px solid #d8e3e8; background: #fff; color: #33505c;
  border-radius: 6px; padding: 6px 12px; cursor: pointer;
}
.btn:hover { border-color: #2193b0; color: #187890; }
.btn.primary { width: 100%; margin-top: 6px; padding: 9px; background: #2193b0; border-color: #2193b0; color: #fff; }
.btn.primary:hover { background: #187890; }
.btn.ghost { padding: 5px 10px; font-size: 12px; }
.msg { min-height: 18px; margin: 10px 0 0; color: #b23b3b; font-size: 12px; }

.bar {
  display: flex; align-items: center; gap: 16px; height: 48px; padding: 0 var(--page-gutter);
  background: #fff; border-bottom: 1px solid #e2eaee;
}
.brand { color: #187890; font-weight: 500; white-space: nowrap; }
.tabs { display: flex; gap: 2px; flex: 1; }
.tab {
  border: 0; background: transparent; color: #5f7480;
  padding: 6px 12px; border-radius: 6px; cursor: pointer;
}
.tab:hover { background: #f0f6f8; }
.tab.active { background: #e6f3f6; color: #187890; }
.me { color: #7b8f99; font-size: 12px; white-space: nowrap; }

.notice { margin: 12px var(--page-gutter) 0; padding: 8px 12px; border-radius: 6px; background: #fdeeee; color: #a33333; }
.content { max-width: var(--page-max); margin: 0 auto; padding: 16px 20px 32px; }
.view { background: #fff; border: 1px solid #e2eaee; border-radius: 8px; padding: 16px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
.stat { background: #f0f6f8; border-radius: 6px; padding: 12px 14px; }
.stat .k { color: #7b8f99; font-size: 12px; }
.stat .v { font-size: 22px; font-weight: 500; color: #187890; margin-top: 4px; }
.section-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.section-head h2 { flex: 0 0 auto; }
.hint { color: #8a9ba3; font-size: 12px; }
.head-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.filter { border: 1px solid #d8e3e8; border-radius: 6px; padding: 5px 9px; outline: none; }
.filter:focus { border-color: #2193b0; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; table-layout: auto; }
th, td { padding: 6px 10px; text-align: left; border-bottom: 1px solid #eef3f5; white-space: nowrap; }
th { color: #7b8f99; font-weight: 500; font-size: 12px; background: #fafcfd; }
tbody tr:hover { background: #f7fbfc; }
.tag { display: inline-block; padding: 1px 6px; border-radius: 4px; font-size: 12px; }
.tag.on { background: #e6f3f6; color: #187890; }
.tag.off { background: #f2f4f5; color: #8a9ba3; }
.empty { padding: 24px; text-align: center; color: #8a9ba3; }
.notice.ok { background: #e6f3f6; color: #187890; }
.btn.mini { padding: 2px 7px; font-size: 12px; margin-right: 4px; }
.btn.danger { color: #a33333; }
.btn.danger:hover { border-color: #c05252; color: #a33333; }
.order-input { width: 62px; border: 1px solid #d8e3e8; border-radius: 6px; padding: 3px 6px; outline: none; }
.order-input:focus { border-color: #2193b0; }

.panel { background: #fafcfd; border: 1px solid #e2eaee; border-radius: 6px; padding: 10px 12px; margin-bottom: 4px; }
.sub-head { display: flex; align-items: center; gap: 6px; margin: 14px 0 8px; font-size: 12px; color: #33505c; font-weight: 500; }
.sub-head.first { margin-top: 0; }
.sub-head .hint { font-weight: 400; margin-left: 6px; }
.inline-input.bank-name { width: 150px; }
.roster-text, .editor textarea, .editor input {
  border: 1px solid #d8e3e8; border-radius: 6px; padding: 6px 8px; outline: none; font: inherit;
}
.roster-text:focus, .editor textarea:focus, .editor input:focus, .inline-input:focus { border-color: #2193b0; }
.roster-text { display: block; width: 100%; resize: vertical; }
.panel-actions { display: flex; align-items: center; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.inline-input { border: 1px solid #d8e3e8; border-radius: 6px; padding: 3px 6px; outline: none; }
.inline-input.name { width: 110px; }

/* 授权 / 分组面板 */
.form-row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.form-row label { display: flex; flex-direction: column; gap: 4px; color: #5f7480; font-size: 12px; }
.form-row label.narrow { min-width: 108px; }
.form-row label.check { flex-direction: row; align-items: center; gap: 5px; }
.form-row select, .form-row input[type="text"], #moveTargetGroup {
  border: 1px solid #d8e3e8; border-radius: 6px; padding: 5px 8px; outline: none; font: inherit; min-width: 150px;
}
.form-row select:focus, .form-row input[type="text"]:focus, #moveTargetGroup:focus { border-color: #2193b0; }
.form-row input[type="checkbox"], table input[type="checkbox"] { width: auto; margin: 0; }
.check-list { max-height: 176px; overflow-y: auto; border: 1px solid #d8e3e8; border-radius: 6px; padding: 6px 10px; background: #fff; }
.check-list label { display: flex; align-items: center; gap: 6px; padding: 2px 0; font-size: 12px; color: #33505c; }
.editor { background: #fafcfd; border: 1px solid #e2eaee; border-radius: 6px; padding: 10px 12px; margin: 10px 0; }
/* 题目编辑器行内展开：占据整行、允许换行，避免 nowrap 把表单挤成一列 */
tr.q-editor-row > td { padding: 0; white-space: normal; }
tr.q-editor-row .editor { margin: 0; border-radius: 0; border-left: 0; border-right: 0; }
.editor .row { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 8px; flex-wrap: wrap; }
.editor label { display: flex; flex-direction: column; gap: 4px; color: #5f7480; font-size: 12px; flex: 1; min-width: 120px; }
.editor label.narrow { flex: 0 0 130px; min-width: 0; }
.editor textarea { resize: vertical; min-height: 54px; width: 100%; }
.editor input { width: 100%; }

/* 授权设置弹窗 */
.modal-mask {
  position: fixed; inset: 0; z-index: 50; padding: 20px;
  background: rgba(24, 48, 58, .42);
  display: flex; align-items: center; justify-content: center;
}
.modal {
  width: min(680px, 100%); max-height: 88vh;
  display: flex; flex-direction: column;
  background: #fff; border: 1px solid #e2eaee; border-radius: 8px;
  box-shadow: 0 12px 32px rgba(24, 48, 58, .18);
}
.modal-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid #eef3f5; }
.modal-head h2 { flex: 1; }
/* 创建答题弹窗：标题栏可拖动（按住空白处移动，按钮/输入不触发） */
#createModal .modal-head { cursor: move; touch-action: none; user-select: none; }
#createModal .modal-head.dragging { cursor: grabbing; }
.modal-body { padding: 12px 16px; overflow-y: auto; }
.modal-body .form-row { margin-bottom: 8px; }
.modal-body .check-list { max-height: 168px; }
.modal-body .check-list label[hidden] { display: none; }
.modal-foot { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-top: 1px solid #eef3f5; }
.modal-foot .hint { flex: 1; }
.modal-foot .btn.primary { width: auto; margin-top: 0; }

/* 题库批量选择与题目编辑（答案可改，照小程序 bankDetail 口径） */
.batch-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 8px 10px; margin: 8px 0;
  background: #fafcfd; border: 1px solid #e2eaee; border-radius: 6px;
}
.batch-bar .btn[disabled] { opacity: .45; cursor: not-allowed; }
.opt-row { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.opt-text {
  flex: 1; border: 1px solid #d8e3e8; border-radius: 6px;
  padding: 5px 8px; outline: none; font: inherit;
}
.opt-text:focus { border-color: #2193b0; }
.opt-letter {
  width: 28px; height: 28px; flex: 0 0 28px;
  border: 1px solid #d8e3e8; background: #fff; border-radius: 6px;
  cursor: pointer; color: #33505c; font: inherit;
}
.opt-letter.picked, #qJudgeBlock button.picked {
  background: #2193b0; border-color: #2193b0; color: #fff;
}
#qBlankBlock label, #qEssayBlock label { flex: 1; }
#qBlankBlock input { width: 100%; }

/* ---- 扩展能力：已分散到题库 / 答题管理 / 查询各页，规则按 id 通用匹配 ---- */
.sub-head.first { margin-top: 0; }
.row { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 8px; }
.row label { display: flex; flex-direction: column; gap: 4px; color: #5f7480; font-size: 12px; }
.row label.grow { flex: 1; min-width: 220px; }
/* 题库题目行：返回/题库名/搜索/分页/翻页合并成一行，控件紧凑 */
.bank-qa-head { flex-wrap: wrap; row-gap: 6px; gap: 8px; }
.bank-qa-head .q-search-box { margin-left: 20px; }
.bank-qa-head .q-inline { display: inline-flex; flex-direction: row; align-items: center; gap: 4px; white-space: nowrap; color: #5f7480; font-size: 12px; }
.bank-qa-head input[type="text"] { width: 200px; padding: 4px 8px; }
.bank-qa-head select { min-width: 60px; padding: 4px 6px; }
.bank-qa-head .btn.mini { margin-right: 0; }
input.mini { width: 78px; }
#exBankChecks { max-height: 160px; overflow: auto; margin-bottom: 10px; }
#exBankChecks.check-list label { display: inline-flex; align-items: center; gap: 4px; margin-right: 14px; }
#exFile { flex: 1; min-width: 220px; }

/* ---- 答题管理 12 列 / 滑块 / 即时排序 / 三个弹窗（定案 5.2） ---- */
.cell-2 { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.cell-2 > span { overflow: hidden; text-overflow: ellipsis; max-width: 132px; }
.link-btn {
  border: 0; background: none; color: #187890; padding: 0; cursor: pointer;
  font: inherit; text-decoration: underline; text-underline-offset: 2px;
}
.link-btn:hover { color: #0e5c70; }

/* 状态小框：圆角小框带文字，高亮＝生效、变灰＝不生效，点即切换免二次确认 */
.switch {
  display: inline-block; min-width: 32px; padding: 2px 7px;
  border: 1px solid #d8e3e8; border-radius: 4px; background: #e9eff2;
  color: #84949d; font: inherit; font-size: 11px; line-height: 16px;
  text-align: center; cursor: pointer; vertical-align: middle;
  transition: background .15s, color .15s, border-color .15s;
}
.switch.on { background: #dff1f7; border-color: #9fd4e6; color: #156785; }
.switch:disabled { opacity: .45; cursor: not-allowed; }

.order-btns { display: inline-flex; gap: 3px; }
.order-btns button {
  border: 1px solid #d8e3e8; background: #fff; color: #33505c;
  border-radius: 4px; padding: 1px 5px; font: inherit; font-size: 11px; cursor: pointer;
}
.order-btns button:hover { border-color: #2193b0; color: #187890; }
.order-btns button.pinned { background: #dff1f7; border-color: #9fd4e6; color: #156785; }
.order-btns button.pinned:hover { background: #cbe7f0; border-color: #9fd4e6; color: #156785; }
/* 答题行拖动排序：认排序格里的 ⠿ 手柄，整行只是插入落点 */
.drag-handle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 18px; margin-left: 2px;
  color: #8aa3ad; font-size: 14px; line-height: 1; cursor: grab;
  border: 1px solid transparent; border-radius: 4px; user-select: none; -webkit-user-select: none;
}
.drag-handle:hover { color: #187890; border-color: #cbe7f0; background: #f0f9fc; }
.drag-handle:active { cursor: grabbing; }
tr.drag-row.dragging { opacity: .4; }
tr.drag-row.drag-over td { position: relative; }
tr.drag-row.drop-before td:first-child { box-shadow: inset 0 2px 0 #2193b0; }
tr.drag-row.drop-after td:first-child { box-shadow: inset 0 -2px 0 #2193b0; }
/* 置顶行不加整行底色，只靠「已置顶」按钮自身的底框底色区分 */

/* 答题管理表在窄屏内排不下时，由 .table-wrap 横向滚动兜底 */
#exerciseTable { min-width: 1020px; }

.modal.wide { width: min(780px, 100%); }
.form-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px; margin: 12px 0;
}
.form-grid label { display: block; color: #5f7480; font-size: 12px; }
.form-grid input, .form-grid select {
  display: block; width: 100%; margin-top: 4px; padding: 6px 8px;
  border: 1px solid #d8e3e8; border-radius: 6px; outline: none; font: inherit; color: #22313a;
}
.form-grid input:focus, .form-grid select:focus { border-color: #2193b0; }
.form-grid input:disabled, .form-grid select:disabled { background: #f5f8fa; color: #7b8f99; }
.check-row { display: flex; flex-wrap: wrap; gap: 16px; margin: 10px 0; }
.check-row label { display: flex; align-items: center; gap: 6px; }
.switch-row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.switch-row .hint { font-size: 11px; }
/* 授权弹窗：一行权限勾选框（题库 6 项 / 试卷 2 项） */
.perm-row { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 6px 2px 2px; }
.perm-row label { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: #22313a; cursor: pointer; }
.perm-row label.muted { color: #9fb0b8; cursor: not-allowed; }
.modal-table { max-height: 46vh; overflow: auto; margin-top: 10px; }
.scope-table { width: 100%; border-collapse: collapse; margin-top: 6px; }
.scope-table th, .scope-table td { border: 1px solid #e2eaee; padding: 5px 8px; text-align: left; }
.scope-table th { background: #f0f6f8; color: #5f7480; font-weight: 500; }
#scopeModalBody ul { margin: 6px 0; padding-left: 20px; }

/* ---- 答题管理重构：创建按钮 / 二级页切换 / 批量条 / 居中列 / 建卷规则行 ---- */
.btn.sm { width: auto; margin-top: 0; padding: 6px 16px; }
.btn.primary.sm { width: auto; margin-top: 0; padding: 5px 14px; }

/* 测试 / 练习 二级页分段切换（测试默认） */
.seg { display: flex; gap: 10px; margin: 4px 0 2px; }
.seg-btn {
  padding: 6px 22px; border: 1px solid #cfd8dc; background: #fff; color: #33505c;
  border-radius: 7px; cursor: pointer; font: inherit; font-size: 14px;
}
.seg-btn:hover { border-color: #2193b0; color: #187890; }
.seg-btn.active { background: #2193b0; border-color: #2193b0; color: #fff; }

/* 批量操作条上的小号勾选 / 删除 */
.mini-check { display: flex; align-items: center; gap: 5px; font-size: 12px; color: #5f7480; cursor: pointer; }

/* 列表居中列（滑块 / 排序） */
th.center, td.center { text-align: center; }

/* 建卷弹窗：单行规则 */
.f-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.f-row > span:first-child { color: #5f7480; font-size: 13px; min-width: 40px; }
.f-row > input {
  flex: 1; padding: 7px 10px; border: 1px solid #d8e3e8; border-radius: 6px;
  outline: none; font: inherit; color: #22313a;
}
.f-row > input:focus { border-color: #2193b0; }
.cm-rule {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 8px 10px; margin-bottom: 8px; background: #f7fafb;
  border: 1px solid #eef2f4; border-radius: 8px;
}
.cm-rule select { padding: 5px 8px; border: 1px solid #d8e3e8; border-radius: 6px; font: inherit; }
.cm-rule label { display: flex; align-items: center; gap: 3px; font-size: 12px; color: #5f7480; }
.cm-rule input.mini { width: 60px; padding: 4px 6px; border: 1px solid #d8e3e8; border-radius: 5px; font: inherit; }
.cm-rule .cm-del { margin-left: auto; }
.mini-row { gap: 14px; }

/* ---- 题库管理：导入行 / 名称+改名同排 / 列宽 ---- */
/* 导入区压成一行：按钮 + 题库名 + 选择文件 */
.bank-import { align-items: flex-end; gap: 12px; margin: 2px 0 12px; }
.bank-import .btn.sm { height: 34px; }
.bank-import label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: #5f7480; }
.bank-import label input[type="text"] {
  width: 200px; padding: 7px 10px; border: 1px solid #d8e3e8;
  border-radius: 6px; outline: none; font: inherit; color: #22313a;
}
.bank-import label input[type="file"] { width: 260px; padding: 5px 8px; border: 1px solid #d8e3e8; border-radius: 6px; background: #fff; font: inherit; }
.bank-import label input[type="text"]:focus { border-color: #2193b0; }

/* 导入行的格式提醒 + 模板下载链接，紧跟在文件框右侧、底对齐 */
.import-tip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: #7b8c95; white-space: nowrap; }
.import-tip .link-btn { font-size: 12px; }

/* 题库名与「改名」同一行，改名紧跟在输入框右侧 */
.cell-inline { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.cell-inline .inline-input.bank-name { width: 168px; }

/* 9 列（含勾选）在 1280px 内排不下时横向滚动兜底 */
#bankTable { min-width: 1080px; }

/* ===== 名册列表：按分组折叠，未分组垫底 ===== */
.roster-groups { display: flex; flex-direction: column; gap: 6px; }
.rg-card { border: 1px solid #e2eaee; border-radius: 6px; background: #fff; overflow: hidden; }
.rg-card.ungrouped { background: #fbfcfd; }
.rg-head-row { display: flex; align-items: center; gap: 6px; padding: 5px 10px; background: #f5fafb; }
.rg-card.ungrouped .rg-head-row { background: #f7f9fa; }
.rg-head {
  flex: 1; display: flex; align-items: center; gap: 6px; min-width: 0;
  background: none; border: 0; padding: 2px 0; cursor: pointer;
  text-align: left; color: #22313a; font: inherit;
}
.rg-head:hover .rg-name { color: #187890; }
.rg-arrow { width: 12px; color: #7b8f99; font-size: 11px; }
.rg-name { font-weight: 500; }
.rg-count { color: #7b8f99; font-size: 12px; }
.rg-acts { display: flex; align-items: center; gap: 4px; }
.rg-acts .btn.mini { margin-right: 0; }
.rg-body { border-top: 1px solid #eef3f5; }
/* 列宽：勾选 / 学号 / 姓名 / 班级 / 绑定 / 角色 / 重置密码 / 删除 —— 表头与行必须同一条 grid */
.rg-cols, .rg-row {
  display: grid;
  grid-template-columns: 26px 112px minmax(80px, 170px) minmax(70px, 150px) 58px 128px 76px 46px;
  align-items: center; gap: 8px; padding: 5px 10px;
}
.rg-nm, .rg-cls { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rg-cols {
  padding-top: 6px; padding-bottom: 4px;
  border-bottom: 1px solid #eef3f5; background: #fafcfd;
  color: #8a9ba3; font-size: 12px; line-height: 1.4;
}
.rg-row { border-bottom: 1px solid #f3f7f9; }
.rg-head.open .rg-name { color: #187890; }
.rg-row:last-child { border-bottom: 0; }
.rg-row:hover { background: #fafdfe; }
.rg-check { display: flex; align-items: center; justify-content: center; }
.rg-no { color: #5f7480; }
.rg-nm { color: #22313a; }
.rg-cls { color: #7b8f99; font-size: 12px; }
.rg-row .btn.mini { justify-self: end; margin-right: 0; }
/* 角色开关：互斥两按钮，配色照小程序 roleManage（学生青 #3bb8d4 / 管理员蓝 #4a7fb5） */
.role-sw { display: inline-flex; align-items: center; gap: 4px; justify-self: start; }
.role-btn {
  height: 22px; padding: 0 9px; font-size: 12px; line-height: 20px;
  border: 1px solid #d6dee3; border-radius: 4px; background: #fff;
  color: #8a9ba3; font-family: inherit; cursor: pointer;
  transition: background .12s, border-color .12s, color .12s;
}
.role-btn:hover:not(:disabled) { border-color: #b9c8d0; color: #5f7480; }
.role-btn.active-student { background: #3bb8d4; border-color: #3bb8d4; color: #fff; font-weight: 500; }
.role-btn.active-admin { background: #4a7fb5; border-color: #4a7fb5; color: #fff; font-weight: 500; }
.role-btn:disabled { cursor: not-allowed; opacity: .5; }
.role-btn.active-student:disabled, .role-btn.active-admin:disabled { opacity: 1;
  background: #eef4f7; border-color: #dfe9ee; color: #a3b4bd; font-weight: 400; }
.empty-body { padding: 12px; text-align: center; color: #8a9ba3; font-size: 12px; }
/* 超管：不出按钮，直接标出来，避免「两个都不选中」的歧义 */
.role-super {
  justify-self: start; display: inline-block; height: 22px; line-height: 20px; padding: 0 8px;
  border: 1px solid #b9cfe0; border-radius: 4px; background: #eef5fb;
  color: #4a7fb5; font-size: 12px; font-weight: 500;
}

/* ===== 错题本 / 收藏夹：题目卡片列表（照小程序 wrong-list） ===== */
.panel-actions.wrap { flex-wrap: wrap; row-gap: 8px; align-items: center; }
.inline-check { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: #5f7480; cursor: pointer; }
.q-cards { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.q-card {
  display: flex; align-items: flex-start; gap: 8px;
  border: 1px solid #e2eaee; border-radius: 6px; background: #fff; padding: 8px 10px;
}
.q-card.open { border-color: #bcdde6; background: #fbfdfe; }
.q-check { display: flex; align-items: center; padding-top: 3px; }
.q-main { flex: 1; min-width: 0; cursor: pointer; }
.q-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: #7b8f99; margin-bottom: 3px; }
.q-idx { color: #2193b0; font-weight: 500; }
.q-type { background: #eef6f8; color: #187890; padding: 0 6px; border-radius: 4px; }
.q-bank { color: #8a9ba3; }
.q-cnt { color: #b26a00; background: #fff4e0; padding: 0 6px; border-radius: 4px; }
.q-arrow { margin-left: auto; color: #a3b4bd; }
.q-stem { color: #22313a; font-size: 13px; line-height: 1.55; }
.q-card.open .q-stem { color: #16252d; }
.q-opts { margin-top: 6px; display: flex; flex-direction: column; gap: 3px; }
.q-opt { color: #3b5560; font-size: 12px; line-height: 1.5; }
.q-ans { margin-top: 6px; font-size: 12px; color: #187890; }
.q-analysis { margin-top: 3px; font-size: 12px; color: #7b8f99; line-height: 1.5; }
.q-analysis-edit-btn { margin-top: 6px; }
.q-analysis-edit { margin-top: 6px; }
.q-analysis-input { width: 100%; box-sizing: border-box; min-height: 72px; resize: vertical; font-size: 12px; line-height: 1.5; padding: 6px 8px; border: 1px solid #d6e3e9; border-radius: 4px; }
.q-analysis-ops { display: flex; gap: 6px; margin-top: 6px; }
.q-ops { display: flex; align-items: center; gap: 4px; }
.q-ops .btn.mini { margin-right: 0; }

/* ===== 排行榜 ===== */
.rank-totals { display: flex; gap: 10px; margin: 4px 0 12px; }
.rt-item {
  flex: 1 1 0; min-width: 0; border: 1px solid #e2eaee; border-radius: 6px;
  background: #fafcfd; padding: 10px; text-align: center;
}
.rt-item b { display: block; font-size: 22px; line-height: 1.3; color: #187890; }
.rt-item span { font-size: 12px; color: #7b8f99; }
.rank-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.rank-table th, .rank-table td { padding: 8px 10px; border-bottom: 1px solid #eef3f5; text-align: left; }
.rank-table th { background: #f7fafb; color: #5f7480; font-weight: 500; font-size: 12px; white-space: nowrap; }
.rank-table th.th-sort { cursor: pointer; user-select: none; }
.rank-table th.th-sort:hover { color: #187890; }
.rank-table .sort-arrow { font-style: normal; color: #b9c8d0; margin-left: 4px; font-size: 11px; }
.rank-table .sort-arrow.on { color: #2193b0; }
.rank-table .rk { font-style: normal; color: #435c68; font-size: 14px; margin-left: 13px; font-weight: 500; }
.rank-table tbody tr:hover { background: #fafdfe; }
.rank-table tr.is-me { background: #eef8fa; }
.rank-table tr.is-me:hover { background: #e6f4f7; }
.rank-table tr.me-divider td { background: #f5f7f8; color: #7b8f99; font-size: 12px; text-align: center; }
.rank-table tr.top3 { background: #fdf9ef; }
.rank-table tr.top3 td:first-child { font-weight: 700; color: #b26a00; }
.rank-table .empty-body { text-align: center; color: #8a9ba3; }

/* ===== 练测建卷弹窗 ===== */
.pool-rows { display: flex; flex-direction: column; gap: 8px; margin: 6px 0 10px; }
.pool-row { display: flex; align-items: center; gap: 10px; }
.pool-type { width: 56px; color: #22313a; font-size: 13px; }
.pool-row .mini { width: 76px; }

/* 池模式（错题本/收藏夹建练测）规则行：题库锁定，不显示题库与题号区间 */
.cm-rule.pool-rule { flex-wrap: nowrap; }
.cm-rule.pool-rule label { flex: 1 1 0; min-width: 0; justify-content: center; }
.cm-rule.pool-rule input.mini { width: 52px; }
.cm-pool-tag {
  display: inline-block; padding: 3px 8px; border-radius: 4px;
  background: #eef6f8; color: #187890; font-size: 12px; white-space: nowrap;
}
.cm-pool-note { color: #8a9ba3; font-size: 11px; white-space: nowrap; }
/* 全体学生视角的管理态：设为无效 */
.q-invalid { color: #a33333; }

/* ===== 错题练测 / 收藏练测：照小程序 wrongExercise 的抽题窗口 ===== */
.pm-modal { width: min(460px, 100%); }
.pm-modal .modal-body { background: #f0f4f7; }
.pm-sec {
  background: #fff; border: 1px solid #eef2f5; border-radius: 10px;
  padding: 12px 14px; margin-bottom: 10px;
}
.pm-line { display: flex; align-items: center; gap: 8px; min-height: 26px; }
.pm-between { justify-content: space-between; }
.pm-key { font-size: 13px; font-weight: 500; color: #22313a; }
.pm-radios { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.pm-radio { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: #22313a; cursor: pointer; }
.pm-radio input, .pm-pick input[type="radio"] { position: absolute; opacity: 0; width: 0; height: 0; }
.pm-radio i, .pm-pick i {
  width: 16px; height: 16px; flex: 0 0 16px; border-radius: 50%;
  border: 1px solid #c9d6dc; background: #fff; position: relative; display: inline-block;
}
.pm-radio input:checked + i, .pm-pick input:checked + i { background: #07c160; border-color: #07c160; }
.pm-radio input:checked + i::after, .pm-pick input:checked + i::after {
  content: ''; position: absolute; left: 4px; top: 3px; width: 6px; height: 4px;
  border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(-45deg);
}
.pm-title { font-size: 13px; font-weight: 500; color: #22313a; }
.pm-sub { font-size: 11px; color: #8a97a3; margin-top: 3px; line-height: 1.5; }
.pm-picks { margin-top: 4px; }
.pm-pick {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 9px 0; border-bottom: 1px solid #f0f4f7; font-size: 13px; color: #22313a; cursor: pointer;
}
.pm-pick:last-child { border-bottom: none; }
.pm-word { color: #22313a; }
.pm-num {
  width: 64px; height: 28px; text-align: center; font: inherit; font-size: 13px;
  color: #22313a; background: #f8fbfd; border: 1px solid #d0e0e8; border-radius: 6px; padding: 0 4px;
}
.pm-num:focus { outline: none; border-color: #2193b0; }
.pm-unit { font-size: 12px; color: #66757f; }
.pm-name { font-size: 13px; color: #22313a; }
.pm-start {
  background: linear-gradient(90deg, #2193b0 0%, #6dd5ed 100%);
  border-color: transparent; color: #fff; padding: 9px 30px !important;
}
.pm-start:hover { background: linear-gradient(90deg, #187890 0%, #55c3dd 100%); color: #fff; }
.pm-start[disabled] { opacity: .6; cursor: not-allowed; }

/* ===== 练测作答：逐题作答 + 交卷结果 ===== */
.runner-mask { position: fixed; inset: 0; z-index: 60; background: #eef3f6; }
.runner { width: min(880px, 100%); height: 100%; margin: 0 auto; display: flex; flex-direction: column; background: #f0f4f7; }
.runner-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 18px; background: #fff; border-bottom: 1px solid #e2eaee;
}
.runner-title { display: flex; align-items: baseline; gap: 10px; font-size: 14px; color: #22313a; }
.runner-title b { font-weight: 500; }
.runner-ops { display: flex; align-items: center; gap: 10px; }
.runner-body { flex: 1; overflow-y: auto; padding: 16px 18px 20px; }
.run-card { background: #fff; border: 1px solid #eef2f5; border-radius: 10px; padding: 16px 18px; margin-bottom: 12px; }
.run-meta { display: flex; align-items: center; gap: 10px; font-size: 12px; color: #7b8f99; margin-bottom: 8px; }
.run-no { color: #187890; font-weight: 500; }
.run-stem { font-size: 15px; line-height: 1.65; color: #22313a; white-space: pre-wrap; }
.run-opts { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.run-opt {
  display: flex; align-items: flex-start; gap: 8px; width: 100%; text-align: left;
  padding: 10px 12px; border: 1px solid #dbe6ea; background: #fff; border-radius: 8px;
  cursor: pointer; font: inherit; font-size: 13px; line-height: 1.5; color: #22313a;
}
.run-opt b { color: #187890; font-weight: 500; flex: 0 0 auto; }
.run-opt:hover { border-color: #2193b0; background: #f6fbfc; }
.run-opt.picked { border-color: #2193b0; background: #e8f5f8; }
.run-opt.right { border-color: #18a058; background: #eaf8ef; }
.run-opt.right b { color: #18a058; }
.run-opt.wrong { border-color: #c05252; background: #fdeeee; }
.run-opt.wrong b { color: #c05252; }
.run-answer { margin-top: 12px; }
.run-input, .run-textarea {
  width: 100%; border: 1px solid #d0e0e8; border-radius: 8px; padding: 9px 12px;
  font: inherit; font-size: 13px; color: #22313a; background: #f8fbfd; outline: none;
}
.run-input:focus, .run-textarea:focus { border-color: #2193b0; background: #fff; }
.run-textarea { min-height: 92px; resize: vertical; }
.run-fb { margin-top: 12px; border-radius: 8px; padding: 10px 12px; font-size: 12px; line-height: 1.7; }
.run-fb.ok { background: #eaf8ef; border: 1px solid #c9ecd6; color: #1b6b41; }
.run-fb.no { background: #fdeeee; border: 1px solid #f2cfcf; color: #8f2f2f; }
.run-fb-head { font-size: 13px; font-weight: 500; margin-bottom: 2px; }
.runner-foot {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 18px; background: #fff; border-top: 1px solid #e2eaee;
}
.run-dots { flex: 1; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; justify-content: center; max-height: 24px; overflow: hidden; }
.run-dot { width: 8px; height: 8px; border-radius: 50%; background: #d7e2e7; display: inline-block; }
.run-dot.done { background: #7ec2d4; }
.run-dot.cur { background: #2193b0; box-shadow: 0 0 0 2px rgba(33, 147, 176, .25); }
.run-dot.ok { background: #18a058; }
.run-dot.no { background: #c05252; }
.run-score { font-size: 14px; color: #22313a; }
.run-score b { font-size: 26px; font-weight: 600; color: #187890; margin-right: 4px; }
.run-res { display: flex; flex-direction: column; gap: 10px; }
.run-res-row {
  background: #fff; border: 1px solid #eef2f5; border-left: 3px solid #cfe0e6;
  border-radius: 8px; padding: 10px 14px;
}
.run-res-row.bad { border-left-color: #c05252; }
.run-res-head { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #7b8f99; margin-bottom: 4px; }
.run-res-stem { font-size: 13px; color: #22313a; line-height: 1.6; white-space: pre-wrap; }
.run-res-line { font-size: 12px; color: #546b76; margin-top: 3px; }
.run-tag { margin-left: auto; font-size: 11px; padding: 1px 7px; border-radius: 9px; }
.run-tag.ok { background: #eaf8ef; color: #1b6b41; }
.run-tag.no { background: #fdeeee; color: #8f2f2f; }
.run-tag.pend { background: #fff5e6; color: #8a5b12; }
.run-tag.skip { background: #eef2f5; color: #66757f; }

/* ===== 创建练测：题库锁定，版式照小程序 createWrongExercise ===== */
.cf-modal { width: min(720px, 100%); }
.cf-modal .modal-body { background: #f0f4f7; }
.cf-banner {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px; margin-bottom: 10px;
  background: #fff; border: 1px solid #eef2f5; border-radius: 10px; font-size: 13px;
}
.cf-banner-label { color: #8a97a3; font-size: 12px; }
.cf-banner b { font-weight: 500; color: #187890; }
.cf-banner-count { margin-left: auto; color: #5f7480; font-size: 12px; }
.cf-sec { background: #fff; border: 1px solid #eef2f5; border-radius: 10px; padding: 11px 14px; margin-bottom: 10px; }
.cf-line { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; min-height: 30px; margin: 3px 0; font-size: 13px; color: #5f7480; }
.cf-key { width: 112px; flex: 0 0 112px; color: #22313a; font-weight: 500; }
.cf-req { color: #c05252; margin-left: 2px; }
.cf-label { font-size: 13px; font-weight: 500; color: #22313a; margin-bottom: 6px; }
.cf-hint { font-size: 11px; color: #8a97a3; line-height: 1.6; }
.cf-unit { color: #8a97a3; font-size: 12px; }
.cf-num {
  width: 84px; height: 30px; text-align: center; font: inherit; font-size: 13px;
  color: #22313a; background: #f8fbfd; border: 1px solid #d0e0e8; border-radius: 6px; padding: 0 6px;
}
.cf-num:focus, .cf-input:focus, .cf-date:focus { outline: none; border-color: #2193b0; }
.cf-input, .cf-date {
  flex: 1; min-width: 170px; height: 30px; border: 1px solid #d0e0e8; border-radius: 6px;
  background: #f8fbfd; padding: 0 8px; font: inherit; font-size: 13px; color: #22313a;
}
.cf-hint.warn { color: #a8791b; }
.cf-matrix { display: flex; flex-direction: column; gap: 6px; }
.cf-row { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #5f7480; }
.cf-type { width: 52px; flex: 0 0 52px; color: #22313a; font-size: 13px; }
.cf-row input.cf-num { width: 62px; height: 28px; }
.cf-limit { color: #8a97a3; min-width: 48px; }
.cf-gap { flex: 1; }
.cf-total { margin-top: 8px; padding-top: 8px; border-top: 1px solid #eef2f5; font-size: 13px; color: #22313a; }
.cf-check { display: inline-flex; align-items: center; gap: 5px; margin-right: 16px; font-size: 12px; color: #22313a; cursor: pointer; }
.cf-check .cf-hint { margin-left: 2px; }
.cf-sec .cf-check { margin-bottom: 4px; }
.cf-sec .cf-check[hidden] { display: none; }

/* ===== 管理端答题转发：1 小时有效链接 ===== */
.st-modal { width: min(560px, 100%); }
.st-line { display: flex; align-items: center; gap: 8px; min-height: 28px; font-size: 13px; color: #5f7480; }
.st-key { width: 72px; flex: 0 0 72px; color: #22313a; font-weight: 500; }
.st-line b { color: #187890; font-weight: 500; }
.st-tip { font-size: 12px; color: #7b8f99; line-height: 1.7; margin: 8px 0; }
.st-box { background: #f8fbfd; border: 1px solid #d0e0e8; border-radius: 7px; padding: 9px 11px; font-size: 12px; color: #33505c; word-break: break-all; line-height: 1.6; user-select: all; }
/* 转发：一张卡片 + 一条链接，不放大段说明 */
.share-card { position: relative; border: 1px solid #cfe4eb; border-radius: 9px;
  background: linear-gradient(135deg, #f1fafc 0%, #fff 72%);
  padding: 14px 108px 13px 14px; min-height: 76px; }
.share-card .sc-title { font-size: 15px; font-weight: 600; color: #22313a; line-height: 1.45; }
.share-card .sc-meta { font-size: 12px; color: #7b8f99; margin-top: 5px; }
.share-card .sc-copy { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); }
.share-label { font-size: 12px; color: #7b8f99; margin: 12px 0 5px; }
.share-link-row { display: flex; gap: 8px; align-items: stretch; }
.share-link-row .st-box { flex: 1; min-width: 0; display: flex; align-items: center; }
/* 全局 .btn.primary 是 width:100%，在这里会撑成大青块、把链接挤成窄条，必须收回到按钮自身宽度 */
.share-link-row .btn { flex: 0 0 auto; width: auto; margin-top: 0; }
.share-foot-link { border: none; background: none; color: #187890; font: inherit;
  font-size: 12px; cursor: pointer; padding: 0; margin-left: auto; }
.share-foot-link:hover { text-decoration: underline; }

/* ===== 答题记录逐题详情（与小程序 recordDetail 同款，管理端/学生端共用类名语义） ===== */
.rd-sum { background: #f0f8fa; border: 1px solid #d7ebf0; border-radius: 8px; padding: 10px 14px; margin-bottom: 12px; font-size: 13px; color: #3a5c68; }
.rd-sum .ds-score { color: #187890; font-size: 22px; font-weight: 600; }
.rd-sum .ds-sub { color: #72909b; font-size: 12px; margin-left: 8px; }
.rd-list { display: flex; flex-direction: column; gap: 10px; }
.rd-card { border: 1px solid #e2eaee; border-radius: 8px; padding: 10px 12px; font-size: 13px; color: #3a4f58; }
.rd-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 12px; color: #8a97a3; }
.rd-head .dq-type { background: #eef3f5; border-radius: 4px; padding: 1px 6px; }
.rd-head .dq-score { margin-left: auto; }
.rd-ok { color: #1d9e75; font-weight: 600; }
.rd-bad { color: #d85a30; font-weight: 600; }
.rd-stem { line-height: 1.6; margin-bottom: 7px; }
.rd-opts { display: flex; flex-direction: column; gap: 4px; }
.rd-opt { display: flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 5px; line-height: 1.5; }
.rd-opt.opt-correct { background: #e1f5ee; }
.rd-opt.opt-wrong { background: #fceceb; }
.rd-tag { font-size: 11px; border-radius: 4px; padding: 0 5px; white-space: nowrap; }
.rd-tag.tag-user { background: #d6ecf5; color: #187890; }
.rd-tag.tag-user.bad { background: #f5d6d6; color: #a83232; }
.rd-tag.tag-correct { background: #c9ecd9; color: #0f6e56; }
.rd-text { display: flex; flex-direction: column; gap: 3px; font-size: 12px; }
.rd-text .dq-label { color: #8a97a3; }
.rd-analysis { margin-top: 7px; padding: 6px 9px; background: #f5f7f8; border-radius: 5px; font-size: 12px; color: #5f7480; line-height: 1.6; }

/* 页内简化确认窗：不带浏览器原生弹窗顶部的站点网址 */
.ask-box { width: min(380px, 100%); background: #fff; border: 1px solid #e2eaee; border-radius: 8px; box-shadow: 0 12px 32px rgba(24, 48, 58, .18); padding: 20px 20px 16px; }
.ask-box p { margin: 0 0 18px; font-size: 14px; line-height: 1.7; color: #22313a; white-space: pre-line; }
.ask-foot { display: flex; justify-content: flex-end; gap: 8px; }
.ask-foot .btn { width: auto; margin: 0; padding: 6px 18px; }
