:root {
  --red: #A32020;
  --red-dark: #7E1717;
  --red-light: #FBEEEE;
  --gold: #B8860B;
  --ink: #1F2328;
  --ink-2: #57606A;
  --ink-3: #8B949E;
  --line: #DDE1E6;
  --line-2: #EAEEF2;
  --bg: #F5F6F8;
  --panel: #FFFFFF;
  --green: #1F7A4D;
  --green-light: #E9F5EF;
  --amber: #9A6700;
  --amber-light: #FFF6E5;
  --blue: #14609B;
  --blue-light: #E9F2FA;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(16, 22, 26, .08);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

/* ---------- 顶栏 ---------- */
.topbar {
  height: 60px;
  background: linear-gradient(90deg, var(--red) 0%, #B83232 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  position: sticky;
  top: 0;
  z-index: 40;
}

.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }

.logo {
  width: 34px; height: 34px;
  border-radius: 6px;
  background: rgba(255,255,255,.16);
  border: 1px solid rgba(255,255,255,.45);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 500;
  flex: none;
}

.topbar-title .t1 { font-size: 17px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-title .t2 { font-size: 12px; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 系统名称旁的版本号徽标 */
.ver-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  padding: 3px 7px;
  margin-left: 8px;
  border-radius: 999px;
  vertical-align: middle;
  letter-spacing: .3px;
  background: rgba(255,255,255,.22);
  border: 1px solid rgba(255,255,255,.5);
  color: #fff;
}
.ver-badge-light {
  background: #FDECEC;
  border: 1px solid #F1C9C9;
  color: var(--red);
}

.topbar-right { display: flex; align-items: center; gap: 8px; flex: none; }
.store-tip { font-size: 12px; opacity: .9; margin-right: 4px; }

.topbar .btn-ghost {
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.4);
  color: #fff;
}
.topbar .btn-ghost:hover { background: rgba(255,255,255,.26); }

/* ---------- 布局 ---------- */
.layout { display: flex; align-items: flex-start; }

.sidebar {
  width: 200px;
  flex: none;
  background: var(--panel);
  border-right: 1px solid var(--line);
  min-height: calc(100vh - 60px);
  padding: 12px 10px;
  position: sticky;
  top: 60px;
}

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--ink-2);
  cursor: pointer;
  margin-bottom: 2px;
  font-size: 15px;
}
.nav-item:hover { background: var(--line-2); }
.nav-item.active { background: var(--red-light); color: var(--red); font-weight: 500; }
.nav-item .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .45; }

.content { flex: 1; padding: 20px; min-width: 0; }

.tabbar { display: none; }

/* ---------- 通用组件 ---------- */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line-2);
  flex-wrap: wrap;
}
.panel-head h2 { margin: 0; font-size: 16px; font-weight: 500; }
.panel-head .sub { font-size: 13px; color: var(--ink-3); }
.panel-body { padding: 16px; }
.panel-body.tight { padding: 0; }

.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 14px;
}
.page-head h1 { margin: 0 0 2px; font-size: 20px; font-weight: 500; }
.page-head .desc { color: var(--ink-2); font-size: 13px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 7px 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  min-height: 36px;
  white-space: nowrap;
}
.btn:hover { border-color: var(--ink-3); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-dark); border-color: var(--red-dark); }
.btn-danger { color: var(--red); border-color: #E9C4C4; background: #fff; }
.btn-danger:hover { background: var(--red-light); border-color: var(--red); }
.btn-sm { min-height: 30px; padding: 4px 10px; font-size: 13px; }
.btn-lg { min-height: 44px; padding: 10px 22px; font-size: 16px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

input[type=text], input[type=number], input[type=date], select, textarea {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  min-height: 36px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid #F0C9C9; border-color: var(--red); }
textarea { resize: vertical; min-height: 68px; }

.field { margin-bottom: 12px; }
.field > label { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 4px; }
.field .hint { font-size: 12px; color: var(--ink-3); margin-top: 4px; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 14px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 14px; }

.toolbar {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
  padding: 12px 16px; border-bottom: 1px solid var(--line-2);
  background: #FCFCFD;
}
.toolbar .grow { flex: 1; min-width: 160px; }
.toolbar select, .toolbar input { width: auto; min-width: 120px; }

table.tbl { width: 100%; border-collapse: collapse; }
table.tbl th, table.tbl td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line-2);
  vertical-align: middle;
}
table.tbl th { background: #FAFBFC; font-weight: 500; font-size: 13px; color: var(--ink-2); white-space: nowrap; }
table.tbl tbody tr:hover { background: #FCFCFD; }
table.tbl td.num, table.tbl th.num { text-align: right; }
table.tbl .ops { white-space: nowrap; text-align: right; }
/* 可点击排序表头 */
table.tbl th[data-sort] { cursor: pointer; user-select: none; }
table.tbl th[data-sort]:hover { color: var(--blue); background: #F0F6FF; }
table.tbl th.c-sel, table.tbl td.c-sel { width: 38px; text-align: center; padding-left: 6px; padding-right: 6px; }
table.tbl td.c-sel input, table.tbl th.c-sel input { width: 16px; height: 16px; cursor: pointer; }
table.tbl tbody tr.sel { background: #EFF5FF; }

/* 已勾选操作条 */
.selbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 9px 14px; margin: 10px 0 0; background: #EFF5FF; border: 1px solid #CFE0FF;
  border-radius: 8px; font-size: 13px; color: var(--ink); }
.selbar b { color: var(--blue); }
.selbar .sub { margin-left: auto; }

.table-wrap { overflow-x: auto; }

.tag {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 20px;
  font-size: 12px;
  background: var(--line-2);
  color: var(--ink-2);
  white-space: nowrap;
}
.tag-red { background: var(--red-light); color: var(--red); }
.tag-green { background: var(--green-light); color: var(--green); }
.tag-amber { background: var(--amber-light); color: var(--amber); }
.tag-blue { background: var(--blue-light); color: var(--blue); }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 2px; }

.empty { padding: 40px 16px; text-align: center; color: var(--ink-3); }
.empty .big { font-size: 15px; margin-bottom: 6px; color: var(--ink-2); }

.pager { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 12px; color: var(--ink-2); font-size: 13px; }

/* ---------- 统计卡片 ---------- */
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; box-shadow: var(--shadow);
}
.card .k { font-size: 13px; color: var(--ink-2); }
.card .v { font-size: 26px; font-weight: 500; line-height: 1.3; }
.card .u { font-size: 12px; color: var(--ink-3); }

/* ---------- 工作台：当前进行的培训 ---------- */
.ongoing-panel > .panel-body { padding: 14px; }
.ongoing { border: 1px solid var(--green-light); border-left: 4px solid var(--green); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 14px; background: var(--panel); box-shadow: var(--shadow); }
.ongoing:last-child { margin-bottom: 0; }
.ongoing-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.ot-name { font-size: 17px; font-weight: 600; margin-left: 4px; }
.oh-actions { flex: none; }
.ongoing-stats { display: flex; flex-wrap: wrap; gap: 18px; margin: 12px 0 10px; font-size: 13px; color: var(--ink-2); }
.ongoing-stats b { color: var(--ink); font-size: 16px; font-weight: 600; margin: 0 2px; }
.ongoing-courses { margin-bottom: 12px; }
.ongoing-courses .chip { background: var(--green-light); border-color: transparent; font-size: 12px; }
.ongoing-cols { margin-top: 2px; }
.oc { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: var(--panel); }
.col-h { font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 8px; }
.name-list { list-style: none; margin: 0; padding: 0; max-height: 280px; overflow-y: auto; }
.name-list li { display: flex; align-items: center; gap: 8px; padding: 5px 0; border-bottom: 1px dashed var(--line-2); font-size: 13px; }
.name-list li:last-child { border-bottom: none; }
.name-list .nm { font-weight: 500; }
.empty.small { padding: 22px 10px; font-size: 13px; color: var(--ink-3); }

/* ---------- 柱状图 ---------- */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 150px; padding-top: 10px; }
.bar-col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; min-width: 0; }
.bar-col .bar { width: 100%; background: var(--red); border-radius: 4px 4px 0 0; min-height: 2px; opacity: .85; }
.bar-col .lb { font-size: 11px; color: var(--ink-3); white-space: nowrap; }
.bar-col .vv { font-size: 11px; color: var(--ink-2); }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: absolute; inset: 0;
  background: rgba(20, 24, 28, .45);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 40px 16px;
  z-index: 60;
  overflow: auto;
}
.modal-mask { position: fixed; }
.modal {
  background: #fff; border-radius: 12px; width: 100%; max-width: 620px;
  box-shadow: 0 8px 32px rgba(16,22,26,.22);
  display: flex; flex-direction: column;
  max-height: calc(100vh - 80px);
}
.modal.wide { max-width: 900px; }
.modal-head { padding: 14px 18px; border-bottom: 1px solid var(--line-2); display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.modal-head h3 { margin: 0; font-size: 16px; font-weight: 500; }
.modal-body { padding: 18px; overflow: auto; }
.modal-foot { padding: 12px 18px; border-top: 1px solid var(--line-2); display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.modal-close { background: none; border: none; font-size: 22px; line-height: 1; cursor: pointer; color: var(--ink-3); }

/* ---------- 台账查看/编辑弹窗 ---------- */
.le-sec { margin: 16px 0 8px; font-size: 14px; }
.le-sec b { font-weight: 500; color: var(--ink); }
.le-roster { max-height: 260px; overflow: auto; border: 1px solid var(--line-2); border-radius: 8px; }
.le-checks { display: flex; flex-wrap: wrap; gap: 8px 20px; padding: 4px 2px; }
.le-checks .check { margin: 0; white-space: nowrap; }

/* ---------- 提示 ---------- */
#toast-root { position: fixed; left: 50%; transform: translateX(-50%); bottom: 40px; z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  background: rgba(31,35,40,.94); color: #fff; padding: 10px 18px; border-radius: 8px; font-size: 14px;
  box-shadow: 0 4px 14px rgba(0,0,0,.2);
  animation: toastIn .18s ease-out;
  max-width: 80vw;
}
.toast.ok { background: rgba(31,122,77,.96); }
.toast.err { background: rgba(163,32,32,.96); }
.toast.warn { background: rgba(173,104,0,.96); }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- 签到登记 ---------- */
.sign-layout { display: flex; flex-direction: column; gap: 16px; align-items: stretch; }
.pick-list { max-height: 420px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
.pick-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--line-2); cursor: pointer; }
.pick-row:last-child { border-bottom: none; }
.pick-row:hover { background: #FAFBFC; }
.pick-row input { width: 18px; height: 18px; min-height: 0; flex: none; }
.pick-row .nm { font-weight: 500; }
.pick-row .mt { font-size: 12px; color: var(--ink-3); }
.pick-row.on { background: var(--red-light); }

.chip-list { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  padding: 5px 12px; border-radius: 20px; border: 1px solid var(--line);
  background: #fff; cursor: pointer; font-size: 13px;
}
.chip:hover { border-color: var(--ink-3); }
.chip.on { background: var(--red); border-color: var(--red); color: #fff; }
.chip .dict-mv {
  background: none; border: none; font-size: 12px; line-height: 1;
  padding: 0 1px; margin-left: 1px; cursor: pointer; color: var(--ink-3);
}
.chip .dict-mv:hover:not(:disabled) { color: var(--red); }
.chip .dict-mv:disabled { opacity: .25; cursor: default; }

.qr-box { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 10px; }
.qr-box canvas { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 8px; }
.qr-box .code { font-size: 13px; color: var(--ink-2); }

/* 二维码随窗口大小自动适配：小屏放大占满便于扫描，大屏封顶；统一样式，所有落点一致 */
.qr-svg { display: block; width: min(300px, 80vw); height: auto; aspect-ratio: 1 / 1; margin: 0 auto;
  background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 8px; box-sizing: border-box; }

/* ---------- 手机签到页 ---------- */
.sign-page { max-width: 520px; margin: 0 auto; }
.sign-big { font-size: 18px; }
.sign-done { text-align: center; padding: 30px 10px; }
.sign-done .tick {
  width: 56px; height: 56px; border-radius: 50%; background: var(--green-light);
  color: var(--green); display: flex; align-items: center; justify-content: center;
  font-size: 30px; margin: 0 auto 12px;
}
.sign-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 14px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 10px;
  background: #fff; cursor: pointer;
}
.sign-item:hover { border-color: var(--red); }
.sign-item .tt { font-weight: 500; }
.sign-item .mm { font-size: 12px; color: var(--ink-3); }

/* ---------- 打印 ---------- */
.print-area { display: none; }
@media print {
  .topbar, .sidebar, .tabbar, .toolbar, .btn, .no-print, #toast-root { display: none !important; }
  body { background: #fff; }
  .content { padding: 0; }
  .panel { border: none; box-shadow: none; }
  .print-area { display: block; }
  .print-only { display: block !important; }
  table.tbl th, table.tbl td { border: 1px solid #000; padding: 6px 8px; }
  .print-title { text-align: center; font-size: 20px; font-weight: 500; margin: 8px 0 4px; }
  .print-sub { text-align: center; font-size: 12px; color: #444; margin-bottom: 12px; }
}

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
  .grid3, .grid4 { grid-template-columns: 1fr 1fr; }
  .sign-layout { gap: 12px; }
}

@media (max-width: 700px) {
  body { font-size: 16px; }
  .sidebar { display: none; }
  .content { padding: 12px 12px 76px; }
  .grid2, .grid3, .grid4 { grid-template-columns: 1fr; }
  .topbar { height: auto; padding: 8px 12px; flex-wrap: wrap; }
  .topbar-title .t1 { font-size: 15px; }
  .topbar-right { margin-left: auto; }
  .store-tip { display: none; }
  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0;
    background: #fff; border-top: 1px solid var(--line); z-index: 50;
    padding: 4px 0 max(4px, env(safe-area-inset-bottom));
  }
  .tabbar .tab {
    flex: 1; text-align: center; padding: 6px 2px; font-size: 12px; color: var(--ink-2);
    cursor: pointer; border: none; background: none; min-height: 48px;
  }
  .tabbar .tab.active { color: var(--red); font-weight: 500; }
  .tabbar .tab .ic { display: block; font-size: 16px; line-height: 1.2; }
  .modal-mask { padding: 12px 8px; align-items: flex-start; }
  .toolbar select, .toolbar input { min-width: 100px; }
  .card .v { font-size: 22px; }
}

/* ---------- 实时签到情况面板 ---------- */
  .live-panel { border-left: 4px solid var(--blue); }
  .live-title { font-size: 15px; font-weight: 600; color: var(--blue); margin-bottom: 10px; }
  .live-stats { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
  .stat-card { flex: 1; min-width: 88px; background: var(--blue-light); border-radius: 8px; padding: 10px 8px; text-align: center; }
  .stat-card .stat-val { font-size: 22px; font-weight: 700; line-height: 1.1; }
  .stat-card .stat-label { font-size: 12px; color: var(--ink-2); margin-top: 2px; }
  .live-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
  .live-col { border: 1px solid #e5e7eb; border-radius: 8px; overflow: hidden; background: #fff; }
  .live-col-head { padding: 6px 10px; font-weight: 600; font-size: 13px; }
  .live-list { max-height: 240px; overflow: auto; }
  .live-item { display: flex; align-items: center; justify-content: space-between; padding: 6px 10px; border-top: 1px solid #f1f1f1; font-size: 13px; }
  .live-item .nm { font-weight: 500; }
  .live-item .tm { color: var(--ink-3); font-size: 12px; }
  .live-act { display: flex; gap: 4px; }
  .mini { font-size: 12px; padding: 2px 8px; border-radius: 6px; border: 1px solid #ccc; background: #fff; cursor: pointer; }
  .mini.btn-arrive { color: var(--green); border-color: #bfe3cf; }
  .mini.btn-leave { color: var(--amber); border-color: #f0dcae; }
  .mini.btn-absent { color: var(--red); border-color: #e9c4c4; }
  .live-empty { padding: 14px 10px; color: var(--ink-3); font-size: 13px; text-align: center; }
  @media (max-width: 720px) { .live-cols { grid-template-columns: 1fr; } }

  /* ---------- 班次表单：分日分时段编辑 ---------- */
  .form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
  .sess-row { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; flex-wrap: wrap; }
  .sess-row .s-date { width: 138px; }
  .sess-row .s-name { flex: 1; min-width: 84px; }
  .sess-row .s-start, .sess-row .s-end { width: 108px; }
  .sess-row .s-course { flex: 1.4; min-width: 120px; }
  .sess-row .s-teacher { flex: 1; min-width: 96px; }
  .sess-row .s-hours { width: 72px; }
  .sess-row .s-t { color: var(--ink-3); font-size: 12px; }
  .sess-day { font-size: 12px; font-weight: 600; color: var(--ink-2); margin: 10px 0 4px; }
  .sess-day:first-child { margin-top: 2px; }
  @media (max-width: 720px) {
    .form-grid-2 { grid-template-columns: 1fr; }
    .sess-row .s-date { width: 100%; }
    .sess-row .s-start, .sess-row .s-end { width: 100px; }
    .sess-row .s-course, .sess-row .s-teacher { min-width: 100%; }
  }

  /* ---------- 报名/签到页：快捷培训班卡片（鼠标 + 键盘可选中并切换） ---------- */
  .upcoming-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
  .up-card {
    border: 1px solid var(--line); border-radius: 10px; padding: 14px 14px 12px;
    background: var(--panel); cursor: pointer; outline: none;
    transition: border-color .12s, box-shadow .12s, transform .12s, background .12s;
    display: flex; flex-direction: column; gap: 6px; min-height: 96px;
  }
  .up-card:hover { border-color: var(--red); box-shadow: 0 2px 10px rgba(163,32,32,.12); transform: translateY(-1px); }
  .up-card:focus-visible { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(20,96,155,.28); transform: translateY(-1px); }
  .up-card.active { border: 2px solid var(--red); background: var(--red-light); padding: 13px 13px 11px; box-shadow: 0 2px 10px rgba(163,32,32,.14); }
  .up-card.active:focus-visible { box-shadow: 0 0 0 3px rgba(20,96,155,.28), 0 2px 10px rgba(163,32,32,.14); }
  .up-title { font-size: 15px; font-weight: 600; color: var(--ink); line-height: 1.4; }
  .up-meta { font-size: 12px; color: var(--ink-2); }
  .up-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 4px; }
  .up-reg { font-size: 12px; color: var(--ink-3); }
  .up-act { font-size: 11px; color: var(--ink-3); margin-top: 2px; line-height: 1.4; }
  .up-card.active .up-act { color: var(--red); font-weight: 600; }
  @media (max-width: 700px) { .upcoming-grid { grid-template-columns: 1fr 1fr; } }

  /* 多选 checkbox 组（人员所属群体等） */
  .field .checks { display: flex; flex-wrap: wrap; gap: 8px 16px; padding: 4px 0; }
  .field .checks .check { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: var(--ink); cursor: pointer; }
  .field .checks .check input { width: 15px; height: 15px; accent-color: var(--red); }

  /* 学时要求标准表的政策依据列 */
  .tbl .req-note { font-size: 12px; color: var(--ink-3); line-height: 1.5; max-width: 380px; }

  /* 归档材料面板 */
  .mat-toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
  .mat-toolbar select { width: auto; min-width: 120px; }
  .mat-toolbar input[type=file] { flex: 1; min-width: 160px; font-size: 13px; padding: 5px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
  .mat-list { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
  .mat-item { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
  .mat-thumb { width: 46px; height: 46px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); flex: 0 0 auto; }
  .mat-file { width: 46px; height: 46px; border-radius: 6px; background: var(--blue-light); color: var(--blue); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex: 0 0 auto; }
  .mat-meta { flex: 1; min-width: 0; }
  .mat-name { font-size: 13px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .mat-sub { font-size: 12px; color: var(--ink-3); margin-top: 2px; display: flex; align-items: center; gap: 6px; }


/* ---------- 登录前置门禁 ---------- */
body.logged-out .layout,
body.logged-out .tabbar { display: none; }

#loginGate {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #7E1717 0%, #A32020 55%, #B83232 100%);
  padding: 20px;
}
.gate-card {
  width: 100%; max-width: 420px; background: #fff; border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,.35); padding: 26px 24px 18px;
}
.gate-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.gate-brand .logo { width: 42px; height: 42px; font-size: 22px; background: var(--red); color: #fff; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.gate-brand .g1 { font-size: 17px; font-weight: 700; color: var(--ink); }
.gate-brand .g2 { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.gate-form { margin-top: 6px; }
.gate-form label { display: block; font-size: 13px; color: var(--ink-2); margin: 12px 0 4px; }
.gate-row { display: flex; gap: 8px; }
.gate-row input { flex: 1; min-width: 0; }
.gate-msg { font-size: 12px; color: var(--red); margin-top: 8px; min-height: 16px; }
.gate-note { font-size: 12px; color: var(--ink-3); background: var(--amber-light); border-radius: 8px; padding: 8px 10px; margin: 4px 0 6px; line-height: 1.6; }
.gate-note.err { color: var(--red-dark); background: var(--red-light); }
.gate-offline { margin-top: 16px; border-top: 1px dashed var(--line); padding-top: 12px; }
.gate-offline summary { cursor: pointer; font-size: 13px; color: var(--blue); }
.gate-foot { margin-top: 16px; font-size: 11px; color: var(--ink-3); text-align: center; line-height: 1.6; }

/* ---------- 顶栏登录身份徽标 ---------- */
#authBadge { display: flex; align-items: center; gap: 8px; margin-right: 4px; }
.auth-who { display: flex; align-items: center; gap: 6px; color: #fff; font-size: 13px; }
.auth-who b { font-weight: 600; }
.auth-who i { font-style: normal; background: rgba(255,255,255,.18); padding: 1px 8px; border-radius: 10px; font-size: 12px; }
.auth-off { font-style: normal; background: var(--amber); color: #fff; padding: 1px 6px; border-radius: 10px; font-size: 11px; }
#authBadge .btn-ghost { color: #fff; border-color: rgba(255,255,255,.4); }
#authBadge .btn-ghost:hover { background: rgba(255,255,255,.12); }

/* ---------- 合并模块子标签（人员·统计·设置） ---------- */
.subtabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line-2); margin: 6px 0 16px; flex-wrap: wrap; }
.subtab {
  appearance: none; background: transparent; border: none; cursor: pointer;
  padding: 8px 16px; font-size: 14px; color: var(--ink-3);
  border-bottom: 2px solid transparent; margin-bottom: -1px; border-radius: 0;
}
.subtab:hover { color: var(--ink); }
.subtab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

/* ---------- 分段切换（已归档 / 全部） ---------- */
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; }
.seg-btn { appearance: none; background: #fff; border: none; cursor: pointer; padding: 6px 14px; font-size: 13px; color: var(--ink-2); }
.seg-btn + .seg-btn { border-left: 1px solid var(--line-2); }
.seg-btn.active { background: var(--primary); color: #fff; }

/* ---------- 归档材料模块 ---------- */
.arc-list { display: flex; flex-direction: column; gap: 14px; }
.arc-card .panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.arc-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--ink-2); margin-bottom: 12px; }
.arc-meta span { white-space: nowrap; }
.arc-mats { display: flex; flex-direction: column; gap: 8px; }
.arc-mat { display: flex; align-items: center; gap: 12px; padding: 8px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--bg-2); }
.arc-thumb { width: 48px; height: 48px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line-2); flex: 0 0 auto; }
.arc-file { width: 48px; height: 48px; flex: 0 0 auto; border-radius: 6px; background: var(--blue-light); color: var(--blue);
  display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; }
.arc-mat-meta { flex: 1; min-width: 0; }
.arc-mat-name { font-size: 13px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.arc-mat-sub { font-size: 12px; color: var(--ink-3); margin-top: 3px; }
.arc-mat .btn { flex: 0 0 auto; }

/* ===== 材料归档管理（表格化 CRUD） ===== */
.mat-toolbar-top { align-items: center; }
.mat-toolbar-top input[type=search] { flex: 1; min-width: 180px; }
.mat-table-wrap { overflow-x: auto; border: 1px solid var(--line-2); border-radius: 10px; background: #fff; }
.mat-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.mat-table th, .mat-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.mat-table th { background: var(--bg-2); color: var(--ink-2); font-weight: 600; white-space: nowrap; position: sticky; top: 0; }
.mat-table tbody tr:last-child td { border-bottom: none; }
.mat-table tbody tr:hover { background: var(--bg-2); }
.mat-table td.num { text-align: right; white-space: nowrap; color: var(--ink-2); }
.mat-table td.acts { white-space: nowrap; }
.mat-table td.acts .btn { margin: 0 3px 0 0; }
.mat-cell { display: flex; align-items: center; gap: 10px; min-width: 220px; }
.mat-ic { width: 38px; height: 38px; border-radius: 6px; flex: 0 0 auto; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; }
.mat-ic.img { background: var(--blue-light); color: var(--blue); }
.mat-ic.file { background: var(--ink-3); color: #fff; }
.mat-name-cell { min-width: 0; }
.mat-name { font-size: 13px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 320px; }
.mat-remark { font-size: 12px; color: var(--ink-3); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 320px; }
#arcPager { margin-top: 4px; }

/* 人员导入查重提示 */
.dup-list { max-height: 260px; overflow: auto; border: 1px solid var(--line, #e5e7eb); border-radius: 8px; }
.dup-item { padding: 8px 12px; border-bottom: 1px solid var(--line, #e5e7eb); font-size: 13px; line-height: 1.7; }
.dup-item:last-child { border-bottom: none; }
.dup-item > b { font-weight: 600; }
.dup-ch { color: var(--ink-2); }
.dup-ch b { color: var(--ink); }
