:root {
  --blue: #2563EB;
  --blue-50: #EFF6FF;
  --green: #059669;
  --green-50: #ECFDF5;
  --amber: #D97706;
  --amber-50: #FFFBEB;
  --red: #DC2626;
  --red-50: #FEF2F2;
  --ink: #0F172A;
  --muted: #64748B;
  --line: #E2E8F0;
  --bg: #F8FAFC;
  --card: #ffffff;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --transition: 0.2s ease;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: var(--blue); text-decoration: none; }

/* 登录 */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg, #eef4fb, #f5f7fa);
}
.login-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 32px 28px; width: 340px; box-shadow: 0 6px 24px rgba(24,95,165,.08);
}
.login-card h1 { font-size: 18px; margin: 0 0 4px; }
.login-card .sub { color: var(--muted); font-size: 13px; margin-bottom: 20px; }
.login-card label { display: block; font-size: 13px; margin: 12px 0 6px; color: var(--muted); }
.login-card input, .login-card select, .fld input, .fld select, .fld textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px;
  font-size: 14px; background: #fff; color: var(--ink); font-family: inherit;
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--blue); color: #fff; border: none; border-radius: 8px;
  padding: 9px 16px; font-size: 14px; cursor: pointer; transition: .15s;
}
.btn:hover { background: #0c447c; }
/* UI 简化（2026-10-23）：ghost 按钮蓝色描边改中性灰——一屏只留一个主色焦点，
   次要操作全部退场，避免蓝/青/红按钮互相打架 */
.btn.ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn.ghost:hover { background: #F1F5F9; border-color: #CBD5E1; color: var(--ink); }
.btn.sm { padding: 6px 12px; font-size: 13px; }
.btn.block { width: 100%; margin-top: 18px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* 布局 */
.topbar { background: var(--card); border-bottom: 1px solid var(--line); padding: 12px 22px; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 10; }
.topbar .brand { font-weight: 600; font-size: 16px; }
.topbar .brand small { color: var(--muted); font-weight: 400; font-size: 12px; margin-left: 8px; }
.topbar .who { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 12px; }
.nav { display: flex; gap: 4px; padding: 10px 22px 0; background: var(--card); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.nav button { background: none; border: none; padding: 9px 16px; font-size: 14px; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; }
.nav button.active { color: var(--blue); border-bottom-color: var(--blue); font-weight: 500; }
.main { padding: 22px; max-width: 1200px; margin: 0 auto; }

/* 卡片/列表 */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 18px; margin-bottom: 16px; }
.card h3 { margin: 0 0 6px; font-size: 15px; }
.row { display: flex; gap: 16px; flex-wrap: wrap; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.item { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.item .title { font-weight: 500; font-size: 15px; margin-bottom: 6px; }
.item .meta { color: var(--muted); font-size: 12.5px; line-height: 1.7; }
.item .acts { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.tag { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 12px; }
.tag-ok { background: var(--green-50); color: var(--green); }
.tag-warn { background: var(--amber-50); color: var(--amber); }
.tag-blue { background: var(--blue-50); color: var(--blue); }
.tag-red { background: var(--red-50); color: var(--red); }
.tag-muted { background: var(--line); color: var(--muted); }
.btn.ghost.danger { color: var(--red); border-color: var(--red); }
.btn.ghost.danger:hover { background: var(--red-50); }

/* P1：搜索框 / 筛选下拉（任务总表、资料库） */
.search-input { padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; background: #fff; color: var(--ink); outline: none; }
.search-input:focus { border-color: var(--blue); }
select.search-input { cursor: pointer; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; text-align: center; }
.stat .num { font-size: 26px; font-weight: 600; }
.stat .lbl { color: var(--muted); font-size: 13px; margin-top: 4px; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 500; background: #fafbfc; }
.muted { color: var(--muted); }
.toast { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); background: #1f2933; color: #fff; padding: 10px 18px; border-radius: 8px; font-size: 14px; z-index: 99; opacity: 0; transition: .2s; }
.toast.show { opacity: 1; }
.toast.err { background: var(--red); }
.empty { text-align: center; color: var(--muted); padding: 40px; }

/* 弹层 */
.modal-mask { position: fixed; inset: 0; background: rgba(31,41,51,.35); display: flex; align-items: center; justify-content: center; z-index: 50; }
.modal { background: #fff; border-radius: 14px; width: 560px; max-width: 92vw; max-height: 88vh; overflow: auto; padding: 22px; position: relative; }
.modal h2 { margin: 0 0 14px; font-size: 17px; }
.fld { margin-bottom: 14px; }
.fld label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.fld .hint { color: var(--muted); font-size: 12px; margin-top: 4px; }
.chk { display: inline-flex !important; align-items: center; gap: 7px; margin: 4px 18px 4px 0; font-size: 14px !important; color: var(--ink) !important; cursor: pointer; }
.chk input { width: auto !important; margin: 0; }
/* 防御：.fld 内的裸 checkbox 不被 100% 宽规则拉变形（未加 .chk 时至少保持原生尺寸） */
.fld input[type="checkbox"] { width: auto; padding: 0; }
.modal-acts { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }

/* 题目 */
.q { border: 1px solid var(--line); border-radius: 10px; padding: 14px; margin-bottom: 14px; }
.q .qt { font-weight: 500; margin-bottom: 10px; }
.opt { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 8px; cursor: pointer; }
.opt:hover { background: var(--blue-50); }
.opt input { accent-color: var(--blue); }
.qresult { font-size: 12.5px; margin-top: 6px; }
.qresult.ok { color: var(--green); }
.qresult.no { color: var(--red); }
.content-box { background: #fafbfc; border: 1px solid var(--line); border-radius: 10px; padding: 14px; white-space: pre-wrap; line-height: 1.8; font-size: 14px; }

/* 文件在线预览（查看） */
.modal.wide { width: 880px; }
.preview-box { background: #fafbfc; border: 1px solid var(--line); border-radius: 10px; padding: 10px; min-height: 260px; display: flex; align-items: center; justify-content: center; overflow: auto; }
.preview-box img { max-width: 100%; max-height: 66vh; display: block; border-radius: 6px; }
.preview-box iframe { width: 100%; height: 66vh; border: 0; background: #fff; border-radius: 6px; }
.preview-box .preview-text { margin: 0; width: 100%; max-height: 66vh; overflow: auto; white-space: pre-wrap; word-break: break-word; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace; font-size: 13px; line-height: 1.7; color: var(--ink); }
.pv-none { color: var(--muted); font-size: 13px; padding: 20px 10px; text-align: center; }

/* 考试主题：输入框 + 主题管理 */
.theme-row { display: flex; align-items: center; gap: 8px; }
.theme-row input { flex: 1; }
.theme-plus { flex: 0 0 auto; padding: 6px 11px; font-size: 15px; line-height: 1; font-weight: 600; }
.theme-mgr { margin-top: 10px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #fafbfc; }
.theme-mgr .theme-title { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.theme-add { display: flex; gap: 8px; margin-bottom: 6px; }
.theme-add input { flex: 1; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; font-family: inherit; background: #fff; color: var(--ink); }
.theme-item { display: flex; align-items: center; gap: 8px; padding: 7px 2px; border-top: 1px solid #eceff3; }
.theme-item .th-name { flex: 1; font-size: 13px; cursor: pointer; word-break: break-all; }
.theme-item .th-name:hover { color: var(--blue); text-decoration: underline; }
.theme-item .th-acts { display: flex; gap: 6px; flex: 0 0 auto; }
.theme-item input.th-edit { flex: 1; padding: 6px 8px; border: 1px solid var(--blue); border-radius: 8px; font-size: 13px; font-family: inherit; background: #fff; color: var(--ink); }

/* 工作台（首页聚合） */
.dash-head { display: flex; justify-content: space-between; align-items: center; }
.dash-hi { font-size: 17px; font-weight: 500; }
.section-h { font-size: 13px; font-weight: 500; color: var(--muted); margin: 18px 0 4px; }
.notice { display: flex; gap: 8px; align-items: center; background: var(--amber-50); border: 0.5px solid #FDE68A; border-radius: 10px; padding: 10px 14px; font-size: 13px; color: var(--amber); margin-top: 14px; }
.notice .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--amber); flex: 0 0 auto; }
/* 卡片轻阴影，对齐禅医 V3 设计语言 */
.card, .item, .topbar, .nav, .login-card { box-shadow: var(--shadow-sm); }
.modal { box-shadow: var(--shadow-md); }

/* ============ P1/P2 增强样式 ============ */

/* 统一卡片：可点击整卡、hover 微抬升 */
.item, .card { transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition); }
.card.link:hover, .item.link:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: #cdd9ee; }
.item.link { cursor: pointer; }

/* 状态徽标扩展语义 */
.tag { font-weight: 500; line-height: 1.6; }
.tag-warn { color: var(--amber); }
.tag-red { color: var(--red); }

/* 空态组件：图标 + 引导 + 操作 */
.empty { text-align: center; color: var(--muted); padding: 48px 20px; }
.empty .em-icon { font-size: 34px; line-height: 1; opacity: .55; display: block; margin-bottom: 10px; }
.empty .em-tip { font-size: 13px; margin: 8px 0 14px; color: var(--muted); }
.empty .em-acts { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* 微交互：按钮态 / loading / 骨架屏 */
.btn { position: relative; user-select: none; -webkit-tap-highlight-color: transparent; }
.btn:hover { background: #1d4ed8; }
.btn:active { transform: translateY(1px) scale(.99); }
.btn.loading { color: transparent !important; pointer-events: none; }
.btn.loading::after {
  content: ""; position: absolute; top: 50%; left: 50%; width: 15px; height: 15px;
  margin: -8px 0 0 -8px; border: 2px solid rgba(255,255,255,.55); border-top-color: #fff;
  border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.btn.ghost.loading::after { border-color: rgba(37,99,235,.4); border-top-color: var(--blue); }

/* 骨架屏 */
.skeleton { background: linear-gradient(90deg, #eef2f7 25%, #e2e8f0 37%, #eef2f7 63%); background-size: 400% 100%; animation: shimmer 1.3s ease infinite; border-radius: 8px; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
.sk-card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; box-shadow: var(--shadow-sm); }
.sk-line { height: 12px; margin: 8px 0; }

/* 统计仪表盘 */
.stat-row { display: flex; gap: 12px; flex-wrap: wrap; margin: 12px 0 4px; }
.stat.big .num { font-size: 30px; }
.bar { height: 8px; border-radius: 6px; background: var(--line); overflow: hidden; margin-top: 6px; }
.bar > i { display: block; height: 100%; background: var(--blue); border-radius: 6px; }
.miss-list { margin-top: 8px; }
.miss-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; background: #fff; }
.miss-row .mr-name { font-weight: 500; }
.miss-row .mr-sub { color: var(--muted); font-size: 12px; }
.dist { display: flex; gap: 6px; align-items: flex-end; height: 70px; margin-top: 8px; }
.dist > .db { flex: 1; background: var(--blue-50); border-radius: 6px 6px 0 0; position: relative; display: flex; align-items: flex-end; justify-content: center; }
.dist > .db > .db-fill { position: absolute; left: 0; right: 0; bottom: 0; background: var(--blue); border-radius: 6px 6px 0 0; }
.dist > .db > span { position: relative; z-index: 1; font-size: 11px; color: var(--muted); padding-bottom: 3px; }

/* ============ 响应式：平板 ============ */
@media (max-width: 768px) {
  .topbar { flex-wrap: wrap; gap: 8px; padding: 10px 14px; }
  .topbar .brand { font-size: 15px; }
  .nav { padding: 8px 12px 0; flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .nav button { white-space: nowrap; padding: 9px 12px; font-size: 13.5px; }
  .main { padding: 14px; }
  .grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .card, .item { padding: 14px; }
  .dash-head { flex-direction: column; align-items: flex-start; gap: 12px; }
  .modal, .modal.wide { width: 94vw; max-width: 94vw; padding: 18px; }
  .login-card { width: 92vw; max-width: 360px; }
  table { display: block; overflow-x: auto; white-space: nowrap; }
  th, td { padding: 8px; }
}
/* ============ 响应式：手机 ============ */
@media (max-width: 480px) {
  .topbar .who { font-size: 12px; gap: 8px; }
  .topbar .who .btn { padding: 4px 9px; }
  .brand small { display: none; }
  .main { padding: 12px 10px; }
  .stats { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat .num { font-size: 22px; }
  .dash-hi { font-size: 16px; }
  .section-h { font-size: 12.5px; }
  .preview-box iframe, .preview-box img { max-height: 52vh; }
}

/* ============ 新人入职培训 ============ */
.tag-onb { background: #FFF4E5; color: #B45309; border: 1px solid #FCD9A6; }
.btn.on { background: #FFF4E5; color: #B45309; border-color: #FCD9A6; }
.onb-card { border-left: 3px solid var(--amber); }

/* ============ 学习记录：考试型/阅读型分类大格子 ============ */
.cat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.cat-card {
  border-radius: 14px; padding: 46px 20px; text-align: center; cursor: pointer;
  border: 1px solid var(--line); transition: transform .15s ease, box-shadow .15s ease;
  user-select: none;
}
.cat-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(15, 23, 42, .08); }
.cat-card:active { transform: translateY(0); }
.cat-exam { background: var(--blue-50); border-color: #BFDBFE; }
.cat-read { background: var(--green-50); border-color: #A7F3D0; }
.cat-name { font-size: 22px; font-weight: 700; color: var(--ink); letter-spacing: 2px; }
.cat-count {
  display: inline-block; margin-top: 14px; background: #fff; border: 1px solid var(--line);
  border-radius: 999px; padding: 5px 16px; font-size: 13px; color: var(--muted);
}
@media (max-width: 640px) { .cat-grid { grid-template-columns: 1fr; } .cat-card { padding: 34px 16px; } }

/* ============ UI 简化改版（2026-10-23） ============ */
/* 目标：减层级（去层层卡片外壳）、减列数、减按钮、减颜色；一屏一个主色焦点 */

/* 页头：标题 + 一句话说明 + 主操作（替代第一个 .card 外壳） */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h2 { margin: 0; font-size: 20px; font-weight: 600; }
.page-head .ph-sub { color: var(--muted); font-size: 13px; margin-top: 5px; }
.page-head .ph-acts { display: flex; gap: 8px; align-items: center; flex: 0 0 auto; }

/* 区块标题行：标题居左 + 工具（搜索/筛选/按钮）居右，不再套 .card */
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 24px 0 12px; flex-wrap: wrap; }
.sec-head:first-child { margin-top: 0; }
.sec-head .sh-title { font-size: 14px; font-weight: 600; display: flex; align-items: baseline; gap: 8px; }
.sec-head .sh-title .muted { font-weight: 400; font-size: 12.5px; }
.sec-head .sh-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* 文字按钮：表格/列表行内的主操作（查看进度、查看） */
.btn.flat { background: none; border: none; color: var(--blue); padding: 5px 8px; font-size: 13px; border-radius: 7px; }
.btn.flat:hover { background: var(--blue-50); }
.btn.flat.danger { color: var(--muted); }
.btn.flat.danger:hover { background: var(--red-50); color: var(--red); }

/* 图标按钮：行内次操作（编辑/删除），默认低调、hover 才显色 */
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border: none; border-radius: 7px; background: none; color: var(--muted); cursor: pointer; transition: .15s; padding: 0; vertical-align: middle; }
.icon-btn:hover { background: #F1F5F9; color: var(--ink); }
.icon-btn.danger:hover { background: var(--red-50); color: var(--red); }
.icon-btn svg { width: 15px; height: 15px; display: block; }

/* 资料/共享资料紧凑行列表（替代大卡片网格） */
.mat-list { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.mat-row { display: flex; align-items: center; gap: 12px; padding: 11px 16px; border-top: 1px solid #F1F5F9; }
.mat-row:first-child { border-top: none; }
.mat-row:hover { background: #F8FAFC; }
.mat-row .mr-main { flex: 1; min-width: 0; }
.mat-row .mr-title { font-weight: 500; font-size: 14px; }
.mat-row .mr-meta { color: var(--muted); font-size: 12px; margin-top: 3px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mat-row .mr-meta .tag { font-size: 11px; padding: 1px 8px; line-height: 1.7; }
.mat-row .mr-acts { flex: 0 0 auto; display: flex; gap: 4px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }

/* 员工任务紧凑行（保留 .item 类名：旧 E2E 以 #taskList .item 为锚点） */
.task-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; }
.task-row .tr-main { flex: 1; min-width: 0; }
.task-row .title { margin-bottom: 3px; }
.task-row .meta { line-height: 1.6; }
.task-row .acts { margin-top: 0; flex: 0 0 auto; }

/* 紧凑表格（任务总表/用户管理） */
.tbl-wrap { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
table.tbl-compact { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl-compact th { color: var(--muted); font-weight: 500; font-size: 12px; text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); background: #FAFBFC; white-space: nowrap; }
.tbl-compact td { padding: 10px 12px; border-bottom: 1px solid #F1F5F9; vertical-align: middle; }
.tbl-compact tbody tr:last-child td { border-bottom: none; }
.tbl-compact tbody tr:hover { background: #F8FAFC; }
.t-main { font-weight: 500; }
.t-sub { color: var(--muted); font-size: 12px; margin-top: 2px; }

/* 迷你进度条（完成 N/M） */
.prog-mini { display: flex; align-items: center; gap: 8px; }
.prog-mini .pm-bar { width: 56px; height: 5px; border-radius: 4px; background: var(--line); overflow: hidden; flex: 0 0 auto; }
.prog-mini .pm-bar > i { display: block; height: 100%; background: var(--green); border-radius: 4px; }
.prog-mini .pm-num { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.prog-mini .pm-num b { color: var(--ink); font-weight: 600; }

/* 推送弹窗：考试专属设置视觉分组 */
.exam-box { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: #FAFBFC; }

/* 简化改版 · 响应式补充 */
@media (max-width: 768px) {
  .page-head { margin-bottom: 14px; }
  .sec-head { margin: 18px 0 10px; }
  .tbl-wrap { overflow: visible; border: none; background: transparent; }
  .mat-row, .task-row { padding: 10px 12px; }
  .mat-row .mr-acts { width: 100%; justify-content: flex-start; }
}

/* ============ 考试发布简化 + 试题导入（2026-10-23） ============ */

/* 推送弹窗分区标题（弹窗内复用 sec-head 视觉，去掉外边距） */
.push-sec { margin-bottom: 16px; }
.push-sec > .sec-head { margin: 0 0 10px; }
.push-sec > .sec-head .sh-title { font-size: 13px; color: var(--muted); font-weight: 600; }

/* 任务组成：两个可点击卡片（替代两个裸 checkbox） */
.comp-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.comp-card { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; cursor: pointer; transition: border-color .15s, background .15s; background: #fff; }
.comp-card:hover { border-color: #c7d5ec; }
.comp-card input { width: 16px; height: 16px; margin: 0; flex: 0 0 auto; accent-color: var(--blue); cursor: pointer; }
.comp-card .cc-ico { font-size: 18px; line-height: 1; flex: 0 0 auto; }
.comp-card .cc-t { font-size: 13.5px; font-weight: 500; line-height: 1.3; }
.comp-card .cc-s { display: block; font-size: 11.5px; color: var(--muted); font-weight: 400; margin-top: 2px; }
.comp-card:has(input:checked) { border-color: var(--blue); background: var(--blue-50); }
.comp-card:has(input:checked) .cc-t { color: var(--blue); }

/* 考试设置三栏（前置条件 / 次数 / 规则） */
.exam-grid { display: grid; grid-template-columns: 1.1fr 1fr 1fr; gap: 10px; align-items: start; }
.exam-grid .fld { margin-bottom: 10px; }
.exam-grid .fld:last-child { margin-bottom: 0; }
.exam-grid .chk { margin: 0; }

/* 题目区工具栏（统计 + 导入 + 添加） */
.q-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.q-tools .q-stat { font-size: 12.5px; color: var(--muted); margin-right: auto; }

/* 紧凑题目行：题号 + 类型 + 删除 / 题干 / 可折叠选项 / 答案 */
.q { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; background: #fff; }
.q .q-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.q .q-no { font-size: 12px; font-weight: 600; color: var(--muted); background: #F1F5F9; border-radius: 6px; padding: 2px 8px; flex: 0 0 auto; }
.q .qtype { width: auto; flex: 0 0 auto; padding: 3px 6px; font-size: 12.5px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--ink); }
.q .q-del { margin-left: auto; }
.q .qcontent { width: 100%; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 13.5px; font-family: inherit; }
.q .qcontent:focus, .q .qanswer:focus { border-color: var(--blue); outline: none; }
.q .q-ans-row { margin-top: 8px; }
.q .qanswer { width: 100%; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 13.5px; font-family: inherit; }
.q .q-opts { margin-top: 8px; }
.q .q-opts-toggle { background: none; border: none; color: var(--blue); font-size: 12.5px; padding: 2px 0; cursor: pointer; }
.q .q-opts-toggle:hover { text-decoration: underline; }
.q .qoptions { width: 100%; margin-top: 6px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; font-family: inherit; resize: vertical; }
.q .qoptions[hidden] { display: none; }
.q .q-opts-sum { color: var(--muted); font-size: 12.5px; }

/* 导入弹窗：双页签 */
.imp-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.imp-tab { background: none; border: none; padding: 8px 14px; font-size: 13.5px; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.imp-tab:hover { color: var(--ink); }
.imp-tab.active { color: var(--blue); border-bottom-color: var(--blue); font-weight: 500; }
.imp-pane textarea { width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; font-size: 13px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace; line-height: 1.7; resize: vertical; }
.imp-pane textarea:focus { border-color: var(--blue); outline: none; }
.imp-file-drop { border: 1.5px dashed var(--line); border-radius: 10px; padding: 22px 16px; text-align: center; background: #FAFBFC; }
.imp-file-drop input[type="file"] { font-size: 13px; }
.imp-help { margin-top: 14px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #FAFBFC; font-size: 12.5px; color: var(--muted); }
.imp-help summary { cursor: pointer; font-weight: 500; color: var(--ink); font-size: 13px; }
.imp-help pre { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font-size: 12px; line-height: 1.8; overflow: auto; white-space: pre; margin: 8px 0; }
.imp-help ul { margin: 6px 0; padding-left: 18px; }
.imp-help li { margin: 3px 0; }

/* 导入预览 */
.imp-result { background: var(--blue-50); border: 1px solid #c7d9f8; border-radius: 10px; padding: 11px 14px; font-size: 13.5px; margin-bottom: 12px; }
.imp-warns { border: 1px solid #FDE68A; background: var(--amber-50); border-radius: 10px; padding: 10px 14px; font-size: 12.5px; color: #92400e; margin-bottom: 12px; max-height: 132px; overflow: auto; }
.imp-warns div { margin: 2px 0; }
.imp-list { max-height: 300px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
.imp-row { display: flex; gap: 10px; align-items: baseline; padding: 9px 12px; border-top: 1px solid #F1F5F9; font-size: 13px; }
.imp-row:first-child { border-top: none; }
.imp-row .ir-no { color: var(--muted); flex: 0 0 auto; font-size: 12px; }
.imp-row .ir-c { flex: 1; min-width: 0; }
.imp-row .ir-a { flex: 0 0 auto; color: var(--muted); font-size: 12.5px; }
.imp-row .ir-a b { color: var(--ink); font-weight: 600; }

@media (max-width: 640px) {
  .comp-cards { grid-template-columns: 1fr; }
  .exam-grid { grid-template-columns: 1fr; }
  .exam-grid .chk { padding-top: 0; }
}

/* 弹窗内子图层：导入试题覆盖在当前弹窗上（保留底层表单状态） */
.sub-layer { position: absolute; inset: 0; background: #fff; border-radius: 14px; padding: 22px; overflow: auto; z-index: 5; display: flex; flex-direction: column; }
.sub-layer h2 { margin: 0 0 14px; font-size: 17px; }
.sub-layer .modal-acts { margin-top: auto; padding-top: 12px; }
