/* ============================================================
   微信内容归档 · 管理后台样式
   ============================================================ */

:root {
  --primary: #1677ff;
  --primary-hover: #3d8bff;
  --primary-active: #0d63d8;
  --primary-soft: #eaf2ff;
  --primary-line: #bcd7ff;

  --bg: #f2f4f8;
  --card: #ffffff;
  --border: #e7eaf0;
  --border-strong: #d5dae4;

  --text: #1a1d23;
  --text-2: #5b6472;
  --muted: #949cab;

  --success: #12a15d;
  --success-soft: #e7f7ef;
  --warning: #e08700;
  --warning-soft: #fff5e6;
  --danger: #e0453f;
  --danger-soft: #fdeceb;
  --purple: #7a5af8;
  --purple-soft: #f0ecff;

  --radius-sm: 7px;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;

  --shadow-sm: 0 1px 2px rgba(20, 28, 45, .05);
  --shadow: 0 1px 2px rgba(20, 28, 45, .04), 0 4px 14px rgba(20, 28, 45, .05);
  --shadow-lg: 0 12px 36px rgba(20, 28, 45, .12);
  --shadow-xl: 0 24px 60px rgba(20, 28, 45, .16);

  --sidebar-w: 226px;
  --topbar-h: 62px;

  --ease: cubic-bezier(.32, .72, .3, 1);
}

/* ---------- 关键修复 ----------
   HTML 的 hidden 属性依赖 UA 样式 [hidden]{display:none}，
   而 .login-page / .layout 都用 display:flex，作者样式优先级更高，
   会把 hidden 顶掉。这里显式提升优先级，否则登录后登录页不会消失。 */
[hidden] {
  display: none !important;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, p, ul, li, dl, dd, dt { margin: 0; padding: 0; }
ul { list-style: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
a { color: var(--primary); text-decoration: none; }

::selection { background: var(--primary-soft); }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #ccd3e0; border-radius: 6px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #b3bdcf; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ==================== 通用控件 ==================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .06s;
  user-select: none;
}
.btn:hover { border-color: #bcc5d4; background: #fafbfd; }
.btn:active { transform: translateY(.5px); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(22, 119, 255, .18); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.btn.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 1px 2px rgba(22, 119, 255, .3);
}
.btn.primary:hover:not(:disabled) { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn.primary:active:not(:disabled) { background: var(--primary-active); }

.btn.ghost { border-color: transparent; background: transparent; color: var(--text-2); }
.btn.ghost:hover { background: #f1f4f9; color: var(--text); border-color: transparent; }

.btn.danger { color: var(--danger); border-color: #f6cdca; background: #fff; }
.btn.danger:hover { background: var(--danger-soft); border-color: #eeb0ac; }

.btn.success { color: var(--success); border-color: #b9e5cf; background: #fff; }
.btn.success:hover { background: var(--success-soft); }

.btn.sm { height: 28px; padding: 0 10px; font-size: 12.5px; border-radius: 6px; }
.btn.lg { height: 42px; font-size: 15px; border-radius: var(--radius); }
.btn.block { width: 100%; }

.icon-btn {
  width: 34px; height: 34px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.icon-btn:hover { background: #f1f4f9; color: var(--text); border-color: var(--border); }
.icon-btn.spinning svg { animation: spin .7s linear infinite; }

/* 报名提醒铃铛：红点用绝对定位挂在右上角，不参与按钮布局（否则图标会被挤偏） */
.bell-btn { position: relative; }
.bell-btn.has-unread svg { color: var(--primary); }

.bell-dot {
  position: absolute;
  top: 4px; right: 4px;
  min-width: 8px; height: 8px;
  border-radius: 99px;
  background: var(--danger, #e5484d);
  box-shadow: 0 0 0 2px #fff;
}
.bell-dot.num {
  min-width: 16px; height: 16px;
  top: 1px; right: 1px;
  font-size: 10px; line-height: 16px;
  color: #fff; text-align: center;
  font-variant-numeric: tabular-nums;
}

.input, .select, .textarea {
  width: 100%;
  height: 34px;
  padding: 0 11px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.textarea { height: auto; min-height: 78px; padding: 9px 11px; resize: vertical; line-height: 1.65; }
.input::placeholder, .textarea::placeholder { color: #b3bac7; }
.input:hover, .select:hover, .textarea:hover { border-color: #bcc5d4; }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(22, 119, 255, .14);
}

.select {
  appearance: none;
  padding-right: 28px;
  cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path d='M2.6 4.6 6 8l3.4-3.4' stroke='%23949cab' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 9px center;
}

.input-wrap { position: relative; }
.input-wrap .iw-icon {
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  color: var(--muted); display: flex; pointer-events: none;
}
.input.has-icon { padding-left: 33px; }
.input.has-eye { padding-right: 54px; }
.iw-eye {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  border: none; background: transparent; color: var(--muted);
  font-size: 12px; padding: 4px 8px; border-radius: 5px; cursor: pointer;
}
.iw-eye:hover { color: var(--primary); background: var(--primary-soft); }

.field { margin-bottom: 16px; }
.field > label {
  display: block; margin-bottom: 7px;
  font-size: 13px; font-weight: 500; color: var(--text-2);
}
.field .tip { margin-top: 6px; font-size: 12px; color: var(--muted); }

.checkbox {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 13px; color: var(--text-2); cursor: pointer; user-select: none;
}
.checkbox input { width: 15px; height: 15px; accent-color: var(--primary); cursor: pointer; margin: 0; }

/*
 * 活动弹窗里「报名要收集的信息」的每一行：左边「收集 XX」，右边「必填」。
 * 必填靠右是为了让人一眼看出「这两件事是分开的」—— 并排两个复选框很容易被
 * 读成「要么都勾要么都不勾」。
 */
.collect-row {
  display: flex; align-items: center; gap: 12px;
  padding: 7px 0; border-bottom: 1px dashed #eef1f6;
}
.collect-row:last-child { border-bottom: 0; }
.collect-row .cf-req-wrap { margin-left: auto; }
.collect-row .cf-req:disabled { opacity: .45; cursor: not-allowed; }

/* ==================== 登录页 ==================== */

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  background:
    radial-gradient(circle at 12% 18%, #dfeaff 0%, transparent 45%),
    radial-gradient(circle at 88% 82%, #e4f7ee 0%, transparent 45%),
    var(--bg);
}

.login-shell {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 100%;
  max-width: 860px;
  background: #fff;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  animation: rise .35s var(--ease);
}

@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.login-brand {
  position: relative;
  padding: 44px 40px;
  background: #12304f;
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}
.login-brand::after {
  content: "";
  position: absolute;
  right: -90px; bottom: -110px;
  width: 300px; height: 300px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .05);
}
.login-brand::before {
  content: "";
  position: absolute;
  right: 30px; top: -80px;
  width: 180px; height: 180px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .04);
}

.lb-top { display: flex; align-items: center; gap: 14px; position: relative; z-index: 1; }
.lb-logo {
  width: 46px; height: 46px; flex-shrink: 0;
  border-radius: 13px;
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .2);
  display: flex; align-items: center; justify-content: center;
  font-size: 21px; font-weight: 600;
}
.login-brand h1 { font-size: 19px; font-weight: 600; letter-spacing: .3px; }
.lb-sub { font-size: 12px; color: rgba(255, 255, 255, .55); letter-spacing: .6px; margin-top: 3px; }

.lb-features { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 13px; margin: 34px 0; }
.lb-features li { display: flex; align-items: center; font-size: 13.5px; color: rgba(255, 255, 255, .82); }
.lb-features i {
  width: 17px; height: 17px; margin-right: 11px; flex-shrink: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .13);
  position: relative;
}
.lb-features i::after {
  content: "";
  position: absolute; left: 5px; top: 5px;
  width: 7px; height: 4px;
  border-left: 1.6px solid #7fd6ab;
  border-bottom: 1.6px solid #7fd6ab;
  transform: rotate(-45deg);
}

.lb-foot {
  position: relative; z-index: 1;
  font-size: 11.5px; color: rgba(255, 255, 255, .4);
  letter-spacing: .4px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, .1);
}

.login-form-panel {
  padding: 44px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.login-form-panel h2 { font-size: 20px; font-weight: 600; }
.lf-tip { font-size: 13px; color: var(--muted); margin: 6px 0 26px; }
.lf-hint {
  margin-top: 20px; padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 12px; color: var(--muted); text-align: center;
}
.lf-hint b { color: var(--text-2); font-weight: 600; }

.login-error {
  margin-bottom: 14px;
  padding: 9px 13px;
  border-radius: var(--radius-sm);
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 13px;
  border: 1px solid #f6cdca;
  animation: shake .3s;
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

/* ==================== 布局 ==================== */

.layout { display: flex; min-height: 100vh; }

.nav-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(20, 28, 45, .4);
  z-index: 90;
}

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: #fff;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 100;
  transition: width .2s var(--ease), flex-basis .2s var(--ease);
}

.sb-head {
  height: var(--topbar-h);
  flex: 0 0 var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 18px;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}
.sb-logo {
  width: 32px; height: 32px; flex-shrink: 0;
  border-radius: 9px;
  background: var(--primary);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 600;
  box-shadow: 0 3px 10px rgba(22, 119, 255, .28);
}
.sb-title { display: flex; flex-direction: column; white-space: nowrap; }
.sb-title b { font-size: 14px; font-weight: 600; letter-spacing: .2px; }
.sb-title span { font-size: 10px; color: var(--muted); letter-spacing: 1px; }

.sb-nav { flex: 1; padding: 12px 11px; overflow-y: auto; overflow-x: hidden; }

.nav-group-label {
  font-size: 11px; color: var(--muted);
  letter-spacing: .6px;
  padding: 14px 12px 7px;
  white-space: nowrap;
}
.sb-nav > .nav-group-label:first-child { padding-top: 4px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  margin-bottom: 2px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-size: 13.5px;
  cursor: pointer;
  white-space: nowrap;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  transition: background .14s, color .14s;
}
.nav-item:hover { background: #f3f6fb; color: var(--text); }
.nav-item.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.nav-item .ni-icon { width: 18px; display: flex; justify-content: center; flex-shrink: 0; }
.nav-item .ni-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.nav-item .ni-badge {
  font-size: 11px; line-height: 17px; padding: 0 7px;
  border-radius: 20px;
  background: var(--danger); color: #fff;
  font-weight: 600;
}

.sb-foot { padding: 10px 11px; border-top: 1px solid var(--border); }
.sb-collapse {
  display: flex; align-items: center; gap: 11px;
  width: 100%; padding: 9px 12px;
  border: none; background: transparent; border-radius: var(--radius-sm);
  color: var(--muted); font-size: 13px; cursor: pointer;
  white-space: nowrap; overflow: hidden;
  transition: background .14s, color .14s;
}
.sb-collapse:hover { background: #f3f6fb; color: var(--text); }
.sbc-icon { width: 18px; display: flex; justify-content: center; transition: transform .2s; font-size: 14px; }

/* 收起态 */
body.sidebar-collapsed .sidebar { width: 62px; flex-basis: 62px; }
body.sidebar-collapsed .sb-title,
body.sidebar-collapsed .nav-item .ni-text,
body.sidebar-collapsed .nav-group-label,
body.sidebar-collapsed .sbc-text,
body.sidebar-collapsed .nav-item .ni-badge { display: none; }
body.sidebar-collapsed .sb-head { padding: 0; justify-content: center; }
body.sidebar-collapsed .nav-item { justify-content: center; padding: 10px 0; }
body.sidebar-collapsed .nav-group-label { padding: 10px 0 4px; height: 0; overflow: hidden; }
body.sidebar-collapsed .sbc-icon { transform: rotate(180deg); }
body.sidebar-collapsed .sb-collapse { justify-content: center; padding: 10px 0; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: var(--topbar-h);
  flex: 0 0 var(--topbar-h);
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 22px;
  position: sticky;
  top: 0;
  z-index: 60;
}

.nav-toggle { display: none; }

.crumb { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 10px; }
.crumb h1 { font-size: 16px; font-weight: 600; white-space: nowrap; }
.crumb-sub { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.topbar-right { display: flex; align-items: center; gap: 6px; }

/* 用户菜单 */
.user-menu { position: relative; }
.user-chip {
  display: flex; align-items: center; gap: 9px;
  padding: 4px 9px 4px 4px;
  border: 1px solid transparent;
  border-radius: 30px;
  background: transparent;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.user-chip:hover { background: #f3f6fb; border-color: var(--border); }
.uc-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--primary);
  color: #fff; font-size: 13px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  text-transform: uppercase;
}
.uc-text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.25; }
.uc-text b { font-size: 13px; font-weight: 600; }
.uc-text i { font-size: 11px; color: var(--muted); font-style: normal; }
.uc-caret { color: var(--muted); display: flex; transition: transform .18s; }
.user-menu.open .uc-caret { transform: rotate(180deg); }

.user-dropdown {
  position: absolute; right: 0; top: calc(100% + 8px);
  width: 210px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  opacity: 0; visibility: hidden;
  transform: translateY(-6px);
  transition: opacity .16s, transform .16s, visibility .16s;
  z-index: 70;
}
.user-menu.open .user-dropdown { opacity: 1; visibility: visible; transform: none; }
.ud-head { padding: 10px 12px 9px; border-bottom: 1px solid var(--border); margin-bottom: 5px; }
.ud-head b { display: block; font-size: 13.5px; font-weight: 600; }
.ud-head span { font-size: 12px; color: var(--muted); }
.ud-item {
  display: block; width: 100%; text-align: left;
  padding: 8px 12px; border: none; background: transparent;
  border-radius: 6px; font-size: 13.5px; color: var(--text);
  cursor: pointer;
}
.ud-item:hover { background: #f3f6fb; }
.ud-item.danger { color: var(--danger); }
.ud-item.danger:hover { background: var(--danger-soft); }
.ud-divider { height: 1px; background: var(--border); margin: 5px 0; }

.page { padding: 22px; padding-bottom: 56px; max-width: 1560px; width: 100%; }

/* ==================== 卡片 ==================== */

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card + .card { margin-top: 16px; }

.card-head {
  padding: 15px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.card-head h3 { font-size: 14.5px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.card-head .hint { font-size: 12.5px; color: var(--muted); font-weight: 400; }
.card-head.stack { flex-direction: column; align-items: stretch; gap: 13px; }
.card-head.stack .toolbar { width: 100%; }
.card-body { padding: 18px; }
.card-body.flush { padding: 0; }

.card-grid { display: grid; gap: 16px; }
.card-grid.two { grid-template-columns: 1.55fr 1fr; }
.card-grid + .card { margin-top: 16px; }
.card-grid .card + .card { margin-top: 0; }

@media (max-width: 1080px) {
  .card-grid.two { grid-template-columns: 1fr; }
}

/* ==================== 统计卡 ==================== */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(196px, 1fr));
  gap: 14px;
}

.stat {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 17px 18px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .18s, transform .18s, border-color .18s;
}
.stat:hover { box-shadow: var(--shadow); transform: translateY(-1px); border-color: var(--border-strong); }

.stat-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.stat-label { font-size: 12.5px; color: var(--text-2); font-weight: 500; }
.stat-ico {
  width: 32px; height: 32px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
}
.stat-ico.blue { background: var(--primary-soft); color: var(--primary); }
.stat-ico.green { background: var(--success-soft); color: var(--success); }
.stat-ico.amber { background: var(--warning-soft); color: var(--warning); }
.stat-ico.purple { background: var(--purple-soft); color: var(--purple); }

.stat-value { font-size: 27px; font-weight: 700; letter-spacing: -.6px; line-height: 1.15; }
.stat-value small { font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 5px; letter-spacing: 0; }
.stat-foot { margin-top: 7px; font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.stat-foot .pct { font-weight: 600; }
.pct.up { color: var(--success); }
.pct.down { color: var(--danger); }

/* ==================== 工具栏 ==================== */

.toolbar { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; }
.toolbar .input, .toolbar .select { width: auto; min-width: 132px; }
.toolbar .grow { flex: 1; min-width: 200px; }
.toolbar .spacer { flex: 1; }

.search-field { position: relative; flex: 1; min-width: 200px; }
/* 输入框要撑满这层壳：`.toolbar .input` 是 width:auto，不撑满的话
   壳占了 200px、框只有浏览器默认的 150px，右边空出一截而左边图标贴着 —— 
   看起来像「搜索框做窄了」（校区管理那排更明显，因为整行很宽）。 */
.search-field .input { padding-left: 32px; width: 100%; }
.search-field .sf-icon {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  color: var(--muted); display: flex; pointer-events: none;
}
.search-field kbd {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  font-family: inherit; font-size: 11px; color: var(--muted);
  border: 1px solid var(--border-strong); border-radius: 4px;
  padding: 0 5px; line-height: 17px; background: #fafbfd;
  pointer-events: none;
}

/* ==================== 表格 ==================== */

.table-scroll { overflow: auto; max-height: calc(100vh - 300px); }

table.data { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }

table.data thead th {
  position: sticky; top: 0; z-index: 5;
  background: #fafbfd;
  color: var(--text-2);
  font-weight: 600;
  font-size: 12.5px;
  text-align: left;
  padding: 11px 11px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  box-shadow: inset 0 -1px 0 var(--border);
}
table.data tbody td {
  padding: 11px;
  border-bottom: 1px solid #f1f3f7;
  vertical-align: middle;
}
table.data tbody tr:last-child td { border-bottom: none; }
table.data tbody tr { transition: background .12s; }
table.data tbody tr:hover { background: #fafbfd; }
table.data tbody tr.selected { background: var(--primary-soft); }
table.data tbody tr.selected:hover { background: #e0ecff; }

th.col-check, td.col-check { width: 40px; padding-left: 18px; padding-right: 0; }
td.col-actions { white-space: nowrap; text-align: right; }
th.col-actions { text-align: right; }
td.col-actions .btn { margin-left: 5px; }
td.col-actions .btn:first-child { margin-left: 0; }
td.nowrap, th.nowrap { white-space: nowrap; }
td.num { font-variant-numeric: tabular-nums; }

.cell-main { display: flex; gap: 10px; align-items: center; min-width: 168px; }
.cell-main .meta { min-width: 0; flex: 1; }
.cell-main .t {
  font-weight: 600; font-size: 13.5px; margin-bottom: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 208px;
}
.cell-main .s {
  font-size: 12px; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 208px;
}

.thumb {
  width: 44px; height: 44px; border-radius: 8px; object-fit: cover;
  background: #eef1f6; border: 1px solid var(--border); display: block; flex-shrink: 0;
  transition: transform .18s;
}
tr:hover .thumb { transform: scale(1.06); }
.thumb-ph {
  width: 44px; height: 44px; border-radius: 8px; flex-shrink: 0;
  background: #f0f4fb; border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; color: var(--primary);
}

/* 视频封面上的播放角标 */
.thumb-wrap { position: relative; flex-shrink: 0; line-height: 0; }
.cover-play {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 13px; line-height: 1;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .7);
  pointer-events: none;
}

/* ---------- 文件图标（按扩展名分类配色） ---------- */

.thumb-file {
  position: relative;
  width: 44px; height: 44px; border-radius: 8px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid transparent;
  line-height: 1;
}
.thumb-file b {
  font-size: 10.5px; font-weight: 700; letter-spacing: .3px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.thumb-file i {
  position: absolute; right: -4px; bottom: -4px;
  min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 9px;
  background: var(--text); color: #fff;
  font-size: 10px; font-style: normal; font-weight: 600; line-height: 17px;
  text-align: center;
}

.tone-doc   { background: #e8f1ff; border-color: #bcd7ff; color: #0d63d8; }
.tone-xls   { background: #e7f7ef; border-color: #b3e5cb; color: #0f7a47; }
.tone-ppt   { background: #fff2e6; border-color: #ffd4ab; color: #b35f00; }
.tone-pdf   { background: #fdeceb; border-color: #f6cdca; color: #c02f2a; }
.tone-zip   { background: #f0ecff; border-color: #d3c9ff; color: #5b3fd6; }
.tone-media { background: #e4f7f6; border-color: #aee2df; color: #0a7c74; }
.tone-audio { background: #e4f7f6; border-color: #aee2df; color: #0a7c74; }
.tone-code  { background: #f2f4f8; border-color: #dde2ea; color: #4a5568; }
.tone-other { background: #f2f4f8; border-color: #dde2ea; color: #5b6472; }

/* ---------- 类型列下的附件计数胶囊 ---------- */

.asset-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.achip {
  display: inline-block;
  padding: 0 6px;
  border-radius: 5px;
  font-size: 11px;
  line-height: 17px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.achip.img  { background: #e8f1ff; color: #0d63d8; }
.achip.vid  { background: #e7f7ef; color: #0f7a47; }
.achip.aud  { background: #e4f7f6; color: #0a7c74; }

/* 详情弹窗里的音频行：名称 + 原生播放器 + 下载 */
.audio-list { display: flex; flex-direction: column; gap: 10px; }
.audio-item {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fafbfd;
}
.audio-item .ai-name { font-size: 13px; color: var(--text-1); flex: 1 1 220px; word-break: break-all; }
.audio-item audio { height: 34px; flex: 2 1 260px; min-width: 200px; }
.audio-item .ai-dl { font-size: 12px; color: var(--primary); text-decoration: none; white-space: nowrap; }
.achip.file { background: #fff2e6; color: #b35f00; }

/* ---------- 详情弹窗里的文件列表 ---------- */

.asset-block { margin-bottom: 18px; }
.asset-block:last-child { margin-bottom: 0; }
.asset-block > label {
  display: block; margin-bottom: 9px;
  font-size: 13px; font-weight: 500; color: var(--text-2);
}
.asset-block > label .muted { font-weight: 400; margin-left: 4px; }

.file-list { display: flex; flex-direction: column; gap: 8px; }

.file-item {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fafbfd;
  color: inherit;
  text-decoration: none;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.file-item:hover {
  border-color: var(--primary-line);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.fi-icon {
  width: 40px; height: 40px; border-radius: 8px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid transparent;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10.5px; font-weight: 700; letter-spacing: .3px;
}

.fi-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.fi-name {
  font-size: 13.5px; font-weight: 500; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.fi-sub { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.fi-action {
  flex-shrink: 0;
  font-size: 12.5px; color: var(--primary);
  opacity: 0; transition: opacity .15s;
}
.file-item:hover .fi-action { opacity: 1; }

@media (max-width: 620px) {
  .fi-action { display: none; }
}

.avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; border: 1px solid var(--border); display: block; }

/* ==================== 徽标 / 标签 ==================== */

.badge {
  display: inline-flex; align-items: center;
  padding: 1px 9px;
  border-radius: 20px;
  font-size: 11.5px;
  line-height: 19px;
  white-space: nowrap;
  background: #f2f4f8;
  color: var(--text-2);
  border: 1px solid transparent;
}
.badge.blue { background: var(--primary-soft); color: #0d63d8; }
.badge.green { background: var(--success-soft); color: var(--success); }
.badge.orange { background: var(--warning-soft); color: var(--warning); }
.badge.red { background: var(--danger-soft); color: var(--danger); }
.badge.purple { background: var(--purple-soft); color: var(--purple); }
.badge.grey { background: #f2f4f8; color: var(--text-2); }
.badge.outline { background: #fff; border-color: var(--border-strong); color: var(--text-2); }
.badge + .badge { margin-left: 4px; }

/* 表格内标签只占一行，避免行高参差不齐 */
.tag-list { display: flex; gap: 4px; flex-wrap: nowrap; overflow: hidden; max-width: 132px; }
.tag-list .badge { margin: 0; flex-shrink: 0; }

.dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; margin-right: 6px; }
.dot.green { background: var(--success); }
.dot.red { background: var(--danger); }
.dot.orange { background: var(--warning); }
.dot.grey { background: var(--muted); }

/* ==================== 批量操作条 ==================== */

.bulk-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 18px;
  background: var(--primary-soft);
  border-bottom: 1px solid var(--primary-line);
  font-size: 13.5px;
  animation: slideDown .18s var(--ease);
}
@keyframes slideDown { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.bulk-bar .bb-count { font-weight: 600; color: #0d63d8; }
.bulk-bar .bb-actions { margin-left: auto; display: flex; gap: 8px; }

/* ==================== 分页 ==================== */

.pager {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 18px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
  flex-wrap: wrap;
}
.pager .pg-info { white-space: nowrap; }
.pager .pg-spacer { flex: 1; }
.pager .pages { display: flex; gap: 4px; }
.pager .pg {
  min-width: 30px; height: 30px; padding: 0 8px;
  border: 1px solid var(--border-strong); border-radius: 6px;
  background: #fff; cursor: pointer; color: var(--text-2);
  font-size: 13px;
  transition: all .14s;
}
.pager .pg:hover:not(:disabled):not(.active) { border-color: var(--primary); color: var(--primary); }
.pager .pg.active { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.pager .pg:disabled { opacity: .4; cursor: not-allowed; }
.pager .pg-dots { color: var(--muted); padding: 0 3px; align-self: center; }
.pager .pg-jump { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.pager .pg-jump input {
  width: 52px; height: 30px; text-align: center;
  border: 1px solid var(--border-strong); border-radius: 6px; padding: 0 6px;
}
.pager select.pg-size {
  height: 30px; border: 1px solid var(--border-strong); border-radius: 6px;
  padding: 0 24px 0 8px; background: #fff; cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path d='M2.6 4.6 6 8l3.4-3.4' stroke='%23949cab' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat; background-position: right 7px center;
}

/* ==================== 空状态 / 加载 ==================== */

.empty { padding: 64px 24px; text-align: center; color: var(--muted); }
.empty .e-ico {
  width: 56px; height: 56px; margin: 0 auto 16px;
  border-radius: 16px; background: #f2f5fa;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
}
.empty .e-title { font-size: 14.5px; color: var(--text-2); font-weight: 500; }
.empty .e-desc { font-size: 13px; margin-top: 6px; line-height: 1.7; }

.skeleton { padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.sk-row { display: flex; gap: 12px; align-items: center; }
.sk {
  background: linear-gradient(90deg, #eef1f6 25%, #f6f8fb 37%, #eef1f6 63%);
  background-size: 400% 100%;
  animation: shimmer 1.3s ease-in-out infinite;
  border-radius: 6px;
}
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.sk.square { width: 44px; height: 44px; border-radius: 8px; flex-shrink: 0; }
.sk.line { height: 12px; }
.sk.line.w40 { width: 40%; }
.sk.line.w60 { width: 60%; }
.sk.line.w80 { width: 80%; }

/* ==================== 图表 ==================== */

.chart-svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart-legend { display: flex; gap: 18px; align-items: center; margin-top: 14px; font-size: 12.5px; color: var(--text-2); flex-wrap: wrap; }
.chart-legend button {
  display: flex; align-items: center; gap: 7px;
  border: none; background: transparent; cursor: pointer;
  font-size: 12.5px; color: var(--text-2); padding: 3px 6px; border-radius: 6px;
}
.chart-legend button:hover { background: #f3f6fb; }
.chart-legend button.off { opacity: .38; }
.chart-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

.bar-list { display: flex; flex-direction: column; gap: 15px; }
.bar-item .bi-top { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; }
.bar-item .bi-top .n { color: var(--text); }
.bar-item .bi-top .v { color: var(--muted); font-variant-numeric: tabular-nums; }
.bar-item .bi-track { height: 7px; background: #eef1f6; border-radius: 5px; overflow: hidden; }
.bar-item .bi-fill { height: 100%; border-radius: 5px; background: var(--primary); transition: width .4s var(--ease); }

/* ==================== 登录报表 ==================== */

/*
 * 报表页签：一块一块往下排（范围说明 → 按日趋势 → 两列并排 → 三列排行）。
 * 只用 grid 布局，不做图表库 —— 全部是内联 SVG，和首页那张趋势图同一路子，
 * 少一个外部依赖，也就少一个「哪天 CDN 挂了后台空白」的可能。
 */
.report-range { margin-bottom: 14px; font-size: 13px; color: var(--text-2); }
.report-range b { color: var(--text); font-variant-numeric: tabular-nums; }

.report-block { margin-top: 20px; }
.report-block > h4 {
  margin: 0 0 10px; font-size: 13.5px; font-weight: 600; color: var(--text);
}

/* 两列（场景 / 时段）与三列（三个 Top 榜）。窄屏一律堆成一列 */
.report-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 26px; }
.report-grid.three { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 980px) {
  .report-grid, .report-grid.three { grid-template-columns: 1fr; }
}

/* 排行榜里的数字对齐：等宽数字 + 右对齐，扫一眼就能比大小 */
.report-block .bi-top .v { font-variant-numeric: tabular-nums; }
.small { font-size: 12px; }

/* ==================== 分类卡片 ==================== */

.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(228px, 1fr));
  gap: 14px;
}
.cat-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 17px;
  background: #fff;
  transition: border-color .16s, box-shadow .16s, transform .16s;
}
.cat-card:hover { border-color: var(--primary-line); box-shadow: var(--shadow); transform: translateY(-1px); }
.cat-card.disabled { opacity: .62; }
.cc-top { display: flex; align-items: center; gap: 11px; margin-bottom: 12px; }
.cc-ico {
  width: 40px; height: 40px; border-radius: 11px;
  background: #f2f6fd; display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
}
.cc-name { font-size: 14.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-sort { font-size: 12px; color: var(--muted); }
.cc-foot { display: flex; align-items: center; justify-content: space-between; padding-top: 12px; border-top: 1px solid #f1f3f7; }
.cc-count { font-size: 12.5px; color: var(--text-2); }
.cc-count b { color: var(--primary); font-size: 15px; font-variant-numeric: tabular-nums; }
.cc-actions { display: flex; gap: 5px; }

/* ==================== 标签云 ==================== */

.tag-cloud { display: flex; flex-wrap: wrap; gap: 10px; }
.tag-cloud .tc {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px;
  border-radius: 30px;
  background: #f5f7fb;
  border: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-2);
  transition: all .15s;
}
.tag-cloud .tc:hover { border-color: var(--primary-line); background: var(--primary-soft); color: #0d63d8; }
.tag-cloud .tc .n { font-variant-numeric: tabular-nums; font-size: 11.5px; color: var(--muted); }
.tag-cloud .tc:hover .n { color: #0d63d8; }
.tag-cloud .tc .x {
  border: none; background: transparent; cursor: pointer;
  color: var(--muted); font-size: 15px; line-height: 1; padding: 0 0 0 2px;
  opacity: .45; transition: opacity .15s, color .15s;
}
.tag-cloud .tc .x:hover { opacity: 1; color: var(--danger); }

/* ==================== 排课（频次 / 星期 / 时间段） ==================== */

/*
 * 频次用分段按钮而不是 <select>：
 * 四个选项一眼看全，改选不用展开一层下拉；而且「单次 / 每天 / 每周 / 每两周」
 * 是互斥的少数几个值，下拉在这里只多一次点击。
 */
.seg {
  display: inline-flex; padding: 3px; gap: 2px;
  border-radius: 9px; background: #f2f5fa; border: 1px solid var(--border);
}
.seg button {
  border: none; background: transparent; cursor: pointer; font-family: inherit;
  padding: 6px 14px; border-radius: 7px; font-size: 13px; color: var(--text-2);
  transition: all .15s;
}
.seg button:hover { color: #0d63d8; }
.seg button.on {
  background: #fff; color: #0d63d8; font-weight: 600;
  box-shadow: 0 1px 3px rgba(16, 32, 64, .1);
}

/* 星期多选：七个方块，勾中的高亮。不用七个 checkbox —— 那一行横着排不下，竖着太占高度 */
.week-pick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.week-pick .wk {
  width: 42px; height: 34px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px; border: 1px solid var(--border); background: #fff;
  font-size: 13px; color: var(--text-2);
  cursor: pointer; user-select: none; transition: all .15s;
}
.week-pick .wk:hover { border-color: var(--primary-line); color: #0d63d8; }
.week-pick .wk.on {
  background: var(--primary-soft); border-color: var(--primary-line);
  color: #0d63d8; font-weight: 600;
}

/* 排课实时预览：改了马上能看见「家长会看到的那句话」 */
.sched-preview {
  margin-top: 12px; padding: 9px 12px;
  border-radius: 8px; background: #f7f9fd; border: 1px dashed var(--border);
  font-size: 13px; color: var(--text-2);
}
.sched-preview b { color: var(--text); font-weight: 600; }
.sched-preview .pb { color: var(--muted); }

/* ==================== 弹窗 ==================== */

.mask {
  position: fixed; inset: 0;
  background: rgba(20, 28, 45, .42);
  display: flex; align-items: center; justify-content: center;
  z-index: 200; padding: 24px;
  animation: fade .16s;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.modal {
  width: 100%; max-width: 460px; max-height: 88vh;
  display: flex; flex-direction: column;
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  animation: pop .2s var(--ease);
  overflow: hidden;
}
@keyframes pop { from { opacity: 0; transform: scale(.97) translateY(8px); } to { opacity: 1; transform: none; } }
.modal.wide { max-width: 720px; }

/*
 * 报名名单：一屏要放「核销码 + 收集项 + 订单号 + 操作」十几列，
 * 720 会把每一列都压成两行字。翻倍到 1440（即 wide 的 2 倍），
 * 窗口没那么宽时 width:100% 会自己退回可用宽度，不会溢出屏幕。
 */
.modal.wider { max-width: 1440px; }

.modal-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
}
.modal-head h3 { font-size: 15px; font-weight: 600; }
.modal-body { padding: 20px; overflow-y: auto; flex: 1; }
.modal-foot {
  padding: 13px 20px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 9px;
  background: #fafbfd; flex-shrink: 0;
}
.close-x {
  border: none; background: transparent; cursor: pointer;
  width: 28px; height: 28px; border-radius: 6px;
  color: var(--muted); font-size: 19px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.close-x:hover { background: #f1f4f9; color: var(--text); }

.kv { display: grid; grid-template-columns: 84px 1fr; gap: 9px 14px; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }

.preview-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(126px, 1fr)); gap: 10px; }
.preview-grid img, .preview-grid video {
  width: 100%; height: 126px; object-fit: cover;
  border-radius: 9px; border: 1px solid var(--border); background: #eef1f6;
  cursor: zoom-in; display: block;
}
.preview-grid video { cursor: default; }

.text-block {
  background: #fafbfd;
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 13px;
  white-space: pre-wrap;
  word-break: break-word;
  min-height: 54px;
  font-size: 13.5px;
  line-height: 1.75;
  max-height: 240px;
  overflow-y: auto;
}

/* ==================== 提示 ==================== */

#toast-host {
  position: fixed; top: 18px; left: 50%; transform: translateX(-50%);
  z-index: 999; display: flex; flex-direction: column; gap: 8px; align-items: center;
  pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 9px;
  padding: 10px 18px;
  border-radius: 9px;
  background: #1f2530;
  color: #fff;
  font-size: 13.5px;
  box-shadow: 0 8px 26px rgba(20, 28, 45, .3);
  animation: toastIn .22s var(--ease);
  max-width: min(90vw, 480px);
}
@keyframes toastIn { from { opacity: 0; transform: translateY(-12px) scale(.96); } to { opacity: 1; transform: none; } }
.toast.ok { background: #0f8a51; }
.toast.err { background: #d13b36; }
.toast i { width: 15px; height: 15px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

.loading-line { padding: 48px; text-align: center; color: var(--muted); font-size: 13.5px; }

.muted { color: var(--muted); }
.strong { font-weight: 600; }
.row { display: flex; align-items: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.w-full { width: 100%; }

/* ==================== 响应式 ==================== */

@media (max-width: 960px) {
  .login-shell { grid-template-columns: 1fr; max-width: 440px; }
  .login-brand { padding: 30px 28px; }
  .lb-features { display: none; }
  .lb-foot { display: none; }
  .login-form-panel { padding: 32px 28px; }

  .nav-toggle { display: inline-flex; }

  .sidebar {
    position: fixed;
    left: 0; top: 0;
    transform: translateX(-100%);
    transition: transform .24s var(--ease);
    box-shadow: var(--shadow-xl);
  }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .nav-overlay { display: block; }

  body.sidebar-collapsed .sidebar { width: var(--sidebar-w); flex-basis: var(--sidebar-w); }
  body.sidebar-collapsed .sb-title,
  body.sidebar-collapsed .nav-item .ni-text,
  body.sidebar-collapsed .sbc-text { display: revert; }
  body.sidebar-collapsed .sb-head { padding: 0 18px; justify-content: flex-start; }
  body.sidebar-collapsed .nav-item { justify-content: flex-start; padding: 9px 12px; }
  body.sidebar-collapsed .sbc-icon { transform: none; }
  body.sidebar-collapsed .sb-collapse { justify-content: flex-start; padding: 9px 12px; }

  .page { padding: 16px; padding-bottom: 40px; }
  .topbar { padding: 0 14px; }
  .crumb-sub { display: none; }
  .uc-text { display: none; }
  .table-scroll { max-height: none; }
  .cell-main .t, .cell-main .s { max-width: 190px; }
}

@media (max-width: 620px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-value { font-size: 23px; }
  .modal { max-height: 92vh; }
  .card-head { padding: 13px 15px; }
  .card-body { padding: 15px; }
  .pager { justify-content: center; }
  .pager .pg-spacer { display: none; }
}

/* ==================== 报名活动 ==================== */

/* 两列并排的字段组（时间、地点+人数）。窄屏会退成一列 */
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

/*
 * 省 / 市 / 区三个下拉并排。
 *
 * ⚠ 这里用 grid 而不是 flex:1 —— flex:1 在窄容器里会把中文挤成竖排
 *   （「江西省」变成「江/西/省」三行），而这个坑项目里踩过不止一次。
 *   三列等宽 + 下拉自己截断最长的那种写法，比挤成竖排好读。
 *   手机上一律退成一列：375px 除以 3 只剩 110px，「新疆维吾尔自治区」放不下。
 */
.region-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

@media (max-width: 620px) {
  .region-row { grid-template-columns: 1fr; }
}

.text-muted { color: var(--muted); }

/*
 * 活动的查询结果行（「筛出 3 个 / 共 12 个」）。
 * 单独一行、压在卡片网格上面：卡片本身是自适应网格，把计数塞进 head 里
 * 会跟着筛选变高变低，整页会跳一下。
 */
.act-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 13px;
  font-size: 13px;
  color: var(--muted);
}

.act-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}

.act-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 17px;
  background: #fff;
  display: flex;
  flex-direction: column;
  transition: border-color .16s, box-shadow .16s, transform .16s;
}

.act-card:hover {
  border-color: var(--primary-line);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

/* 关闭的活动压暗：同一屏里「还能报」和「已关掉」必须一眼分得出来 */
.act-card.is-closed { opacity: .66; }

/*
 * 已下架。和「关闭」是两件事：关闭只是停止报名（家长还看得见），
 * 下架是撤下来（家长看不到了）。所以除了变淡，再加一条虚线边框 ——
 * 只靠透明度区分，两个状态在截图里几乎一样。
 *
 * ⚠ 透明度别低于 .7：整卡变淡会连「已下架」这个徽标一起变淡，
 *   管理员就看不清那张卡到底是什么状态了（0.58 时实测标题和徽标都发虚）。
 *   要表达「它不在架上了」，虚线边框 + 徽标已经够了。
 */
.act-card.is-unlisted {
  opacity: .72;
  border-style: dashed;
}

/* 校区卡片的封面：从卡片顶部铺满，做成头图 */
.ac-cover {
  height: 150px;
  margin: -16px -17px 14px;
  background-size: cover;
  background-position: center;
  background-color: #eef1f6;
  border-top-left-radius: var(--radius);
  border-top-right-radius: var(--radius);
}
.ac-cover.ph {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  background: linear-gradient(135deg, #eef4ff 0%, #e6fbf2 100%);
}

/* 图片上传器：预览 + 选图/移除按钮 */
.uploader {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.up-preview {
  width: 120px;
  height: 90px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.up-ph {
  width: 120px;
  height: 90px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 26px;
  color: var(--text-3);
  background: #f3f5f9;
  border: 1px dashed var(--border-strong);
  border-radius: 8px;
}

/*
 * 只读值（编辑校区里的「来源与资质」）。
 *
 * 做成和 .input 一样高的一格灰底，而不是一行裸文字：
 * 并排两栏时高度不齐会让人以为右边那格没加载出来。
 * word-break 是给手机号和「2026-11-11 10:00 → 2026-11-12 09:30」留的 ——
 * 省略号会把最关键的后半段裁掉。
 */
.readonly-val {
  min-height: 38px;
  display: flex;
  align-items: center;
  padding: 8px 12px;
  background: #f7f9fc;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  line-height: 1.5;
  word-break: break-all;
}

.lic-thumb {
  display: block;
  max-width: 240px;
  max-height: 160px;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: zoom-in;
}
.up-ph span { font-size: 12px; color: var(--text-3); }


.ac-head { display: flex; align-items: flex-start; gap: 10px; }
.ac-t { min-width: 0; flex: 1; }

.ac-name {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ac-sub { margin-top: 5px; font-size: 12px; color: var(--muted); }

.ac-rows {
  margin: 12px 0 10px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.ac-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  color: var(--text-2);
}

.ac-row span { width: 32px; flex: none; color: var(--muted); }

.ac-row em {
  font-style: normal;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ac-row em b {
  color: var(--primary);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.ac-group {
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: #f7f9fc;
  font-size: 12px;
  color: var(--text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ac-foot {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #f1f3f7;
  display: flex;
  /* 校区卡片刻有七个按钮（新增兴趣班 / 报名记录 / 访问记录 / 提现设置 / 关闭显示 / 编辑 / 删除），
     窄屏一定挤，允许换行 —— 硬挤成一排会把「删除」压到卡片外面去 */
  flex-wrap: wrap;
  gap: 6px;
}

/* ---------- 报名名单弹窗 ---------- */

.roster-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.roster-spacer { flex: 1; }
.roster-total { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

.roster-foot {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-top: 12px;
}

@media (max-width: 720px) {
  .field-row { grid-template-columns: 1fr; }
}

/* ==================== 经销商 ==================== */

/* 子标签：和顶部导航长得像，但这里是「同一页的三个视角」，
   所以做成页内分段控件而不是再挂一组侧栏项 */
.dist-tabs {
  display: flex;
  gap: 4px;
  padding: 10px 16px 0;
  border-bottom: 1px solid var(--border);
}

.dist-tab {
  position: relative;
  padding: 9px 14px 11px;
  border: 0;
  background: transparent;
  font-size: 13px;
  color: var(--text-2);
  cursor: pointer;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.dist-tab:hover { color: var(--text); background: #f7f9fc; }

/* ⚠️ 选中态不只靠颜色：再加粗 + 底部一道实线，
   色弱或者低对比度屏幕上也能看出当前在哪一栏 */
.dist-tab.on {
  color: var(--primary);
  font-weight: 600;
}

.dist-tab.on::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: var(--primary);
}

/* 推广码、订单号这种「要被抄下来」的字符串用等宽，
   o / 0、l / 1 分不清的时候能少一半人工核对 */
.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: .5px;
}

/* 金额右对齐用等宽数字，一列下来小数点能对齐 */
.money {
  color: var(--success);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* 收款信息可能很长（银行卡号 + 姓名），截断 + title 看全 */
.payee {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-2);
}

/* 活动卡片里的佣金那一行：比例数字比正文小一档，不要抢报名费的视线 */
.ac-row em .muted {
  font-weight: 400;
  color: var(--muted);
}

/* ---------- 排障提示条（支付通道状态 / 报名异常） ---------- */

.diag {
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 16px;
  font-size: 13px;
  line-height: 1.75;
  border: 1px solid transparent;
}

.diag.ok {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #065f46;
}

.diag.warn {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}

.diag-list {
  margin-top: 6px;
  font-size: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  word-break: break-all;
}

.diag-code {
  font-size: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: #b91c1c;
  word-break: break-all;
  white-space: pre-wrap;
}

/* ============================================================
   活动表单：导航坐标 + 地图选点
   ============================================================ */

.coord-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.coord-row .input {
  max-width: 150px;
}

/* 地图容器必须有固定高度，否则 GL JS 初始化出来是 0 像素、整块空白 */
.pick-map {
  width: 100%;
  height: 380px;
  border-radius: var(--radius);
  overflow: hidden;
  background: #f4f6fa;
  border: 1px solid var(--border);
}

.pick-loading,
.pick-fail {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 20px;
  text-align: center;
  font-size: 13px;
  line-height: 1.8;
  color: var(--text-2);
}

.map-search {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.pick-bar {
  display: flex;
  gap: 12px;
  align-items: baseline;
  flex-wrap: wrap;
  margin-top: 8px;
}

.pick-coord {
  font-size: 13px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.pick-bar .muted {
  font-size: 12.5px;
  color: var(--muted);
}

/* ============================================================
   预留名额
   ============================================================ */

.resv-sum {
  margin-bottom: 14px;
}

.resv-kpi {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.resv-kpi > div {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.resv-kpi b {
  font-size: 22px;
  line-height: 1.2;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.resv-kpi span {
  font-size: 12.5px;
  color: var(--muted);
}

.resv-form {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.resv-form .input {
  flex: 1 1 130px;
  min-width: 90px;
}

.resv-form .input[type="number"] {
  flex: 0 0 auto;
}

/* ==================== 报名提醒面板 ==================== */

.nt-list { display: flex; flex-direction: column; gap: 10px; }

.nt-item {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-left: 3px solid transparent;
  border-radius: var(--radius-sm);
  background: #fff;
  cursor: default;
  transition: background .15s, border-color .15s;
}

/* 未读：左侧一道蓝条。**不用整块浅蓝底** —— 五十条全是浅蓝就分不出新旧了 */
.nt-item.unread {
  border-left-color: var(--primary);
  background: #f8fbff;
  cursor: pointer;
}

.nt-head {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 6px;
}

.nt-time {
  margin-left: auto;
  font-size: 11.5px;
  color: var(--text-3, #98a1b3);
  font-variant-numeric: tabular-nums;
}

.nt-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.5;
}

.nt-body {
  margin-top: 4px;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--text-2);
  white-space: normal;
  word-break: break-all;
}

.nt-meta {
  margin-top: 8px;
  font-size: 11.5px;
  color: var(--text-3, #98a1b3);
}

/* ============================================================
   使用说明（整本操作手册）
   ------------------------------------------------------------
   正文是外部生成的（manual.js），这里只管排版，所以选择器全部收在
   .manual / .manual-body 里面 —— 全局的 h1~h3、ul 都被 reset 过，
   放出作用域会连后台其它页面一起改掉。
   ============================================================ */

.manual {
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

/* 首页的入口条：一行字 + 一个箭头，不做成卡片，避免和下面的统计卡抢目光 */
.manual-entry {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding: 12px 16px;
  background: var(--primary-soft);
  border: 1px solid var(--primary-line);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background .14s, border-color .14s;
}
.manual-entry:hover { background: #dfeaff; border-color: #a9c9f5; }
.manual-entry .me-ico { font-size: 19px; line-height: 1; }
.manual-entry .me-text { flex: 1; min-width: 0; font-size: 13px; color: var(--text-2); }
.manual-entry .me-text b { color: var(--text); font-weight: 600; margin-right: 6px; }
.manual-entry .me-go { flex: none; color: var(--primary); font-size: 12.5px; font-weight: 500; }

/* ---------- 左：搜索 + 目录 ---------- */

.manual-side {
  position: sticky;
  top: calc(var(--topbar-h) + 16px);
  max-height: calc(100vh - var(--topbar-h) - 34px);
  display: flex;
  flex-direction: column;
  padding: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.manual-search { position: relative; }
.manual-search .input { height: 32px; padding-right: 30px; font-size: 13px; }

.ms-clear {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 50%;
  background: #eef1f6;
  color: var(--text-2);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}
.ms-clear:hover { background: #e2e7f0; color: var(--text); }

.manual-hit {
  margin-top: 8px;
  padding: 6px 9px;
  border-radius: 6px;
  background: var(--warning-soft);
  color: #8a5a00;
  font-size: 12px;
  line-height: 1.5;
}

.manual-toc {
  flex: 1;
  min-height: 0;
  margin-top: 10px;
  padding-right: 2px;
  overflow-y: auto;
}

.mt-part + .mt-part { margin-top: 3px; }

.mt-part-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
.mt-part-btn span { flex: 1; }
.mt-part-btn:hover { background: #f4f6fa; color: var(--text); }

.mt-caret {
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid #a8b1c1;
  transition: transform .16s var(--ease);
}
.mt-part.closed .mt-caret { transform: rotate(-90deg); }
.mt-part.closed .mt-chaps { display: none; }

.mt-chap {
  display: block;
  padding: 5px 8px 5px 14px;
  border-left: 2px solid transparent;
  border-radius: 0 6px 6px 0;
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.4;
}
.mt-chap:hover { background: #f4f6fa; color: var(--text); }
.mt-chap.active {
  background: var(--primary-soft);
  border-left-color: var(--primary);
  color: var(--primary);
  font-weight: 500;
}

.manual-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 11.5px;
  /* 目录只有 210px 宽时，「7 篇 33 章」和「打印 / 存 PDF」会挤在一行互相压 */
  flex-wrap: wrap;
}
.manual-foot .link-btn {
  white-space: nowrap;
  padding: 0;
  border: 0;
  background: none;
  color: var(--primary);
  font-size: 12px;
  cursor: pointer;
}
.manual-foot .link-btn:hover { text-decoration: underline; }

/* ---------- 右：正文 ---------- */

.manual-body {
  min-width: 0;
  max-width: 940px;
  padding: 30px 38px 46px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.manual-body h1 {
  margin: 34px 0 6px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-size: 19px;
  font-weight: 600;
  line-height: 1.4;
}
.manual-body .m-part > h1:first-child { margin-top: 0; }

/* 首部「这本手册怎么用」不属于任何一篇，视觉上跟篇标题同级 */
.manual-body .m-front-title {
  margin: 0 0 6px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-size: 19px;
  font-weight: 600;
}

.manual-body h2 {
  margin: 26px 0 8px;
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.45;
}
.manual-body h3 {
  margin: 18px 0 6px;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}
.manual-body h4 {
  margin: 14px 0 4px;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 600;
}

.manual-body p {
  margin: 8px 0;
  color: var(--text);
  font-size: 13.5px;
  line-height: 1.85;
}

.manual-body ul, .manual-body ol {
  margin: 8px 0;
  padding-left: 22px;
}
.manual-body ul { list-style: disc; }
.manual-body ol { list-style: decimal; }
.manual-body li {
  margin: 3px 0;
  font-size: 13.5px;
  line-height: 1.8;
}
.manual-body li > ul, .manual-body li > ol { margin: 3px 0; }
.manual-body strong { font-weight: 600; }
.manual-body code {
  padding: 1px 4px;
  border-radius: 4px;
  background: #f2f4f8;
  font-family: ui-monospace, Consolas, "Courier New", monospace;
  font-size: 12.5px;
}

/* 提示条：手册里用 > 写的「⚠ 注意」 */
.m-note {
  margin: 10px 0;
  padding: 9px 12px;
  border-left: 3px solid var(--warning);
  border-radius: 0 6px 6px 0;
  background: var(--warning-soft);
  color: #7a5200;
  font-size: 13px;
  line-height: 1.75;
}

/* 表格：手册里 42 张，宽表在窄屏上必须能横着滚，不能把卡片撑破 */
.m-table-wrap { margin: 10px 0 14px; overflow-x: auto; }
.manual-body table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.manual-body th {
  padding: 7px 9px;
  border: 1px solid var(--border);
  background: #f6f8fb;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
}
.manual-body td {
  padding: 7px 9px;
  border: 1px solid var(--border);
  line-height: 1.7;
  vertical-align: top;
}
.manual-body tbody tr:nth-child(even) td { background: #fbfcfe; }

.manual-body mark {
  padding: 0 1px;
  border-radius: 2px;
  background: #ffe8a3;
  color: inherit;
}

/* ---------- 窄屏 ---------- */

@media (max-width: 1080px) {
  .manual { grid-template-columns: 210px minmax(0, 1fr); }
  .manual-body { padding: 24px 22px 36px; }
}

@media (max-width: 900px) {
  .manual { display: block; }
  .manual-side {
    position: static;
    max-height: none;
    margin-bottom: 12px;
  }
  .manual-toc { max-height: 240px; }
  .manual-body { max-width: none; padding: 20px 16px 32px; }

  /*
   * 手机上不把表格压成 100%：四列表挤在 340px 里，每格只剩两三个字，
   * 「家长 / 学员」会断成三行，比横向滚一下更难读。给一个下限，
   * 让 .m-table-wrap 去滚。
   */
  .manual-body table { min-width: 560px; font-size: 12px; }
}

/* ---------- 打印（「打印 / 存 PDF」按钮） ---------- */

@media print {
  .sidebar, .topbar, .nav-overlay, .manual-side,
  #toast-host, #modal-root { display: none !important; }

  html, body, .main, .page { background: #fff; }
  .page { max-width: none; padding: 0; }
  .manual { display: block; }

  .manual-body {
    max-width: none;
    padding: 0;
    border: 0;
    box-shadow: none;
  }

  .manual-body h1, .manual-body h2, .manual-body h3 { break-after: avoid; }
  .manual-body tr, .m-note { break-inside: avoid; }
  .m-table-wrap { overflow: visible; }
  .manual-body a { color: inherit; }

  @page { margin: 16mm 14mm; }
}

/* ============================================================
   工具管理（投票 / 计时记录）
   ============================================================ */

.tool-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.tool-tabs .tt {
  height: 34px;
  padding: 0 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  color: var(--text-2);
  font-size: 13px;
  cursor: pointer;
  transition: all .14s var(--ease);
}

.tool-tabs .tt:hover { border-color: var(--border-strong); color: var(--text); }

.tool-tabs .tt.on {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
}

/* 总开关：整行可点，说明跟在后面 —— 开关本身不带文案，
   旁边单独一行小字才解释得清「关了以后会发生什么」 */
.sw-line {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fafbfd;
  font-size: 13px;
  cursor: pointer;
}

.sw-line input[type="checkbox"] {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--primary);
}

.sw-label {
  font-weight: 600;
  color: var(--text);
}

.sw-hint {
  color: var(--muted);
  font-size: 12px;
}

.mt-12 { margin-top: 12px; }
