/**
 * 共享管理端基础样式
 * 托管于 manager.aiplayfun.com/shared/admin.css
 * 所有项目引用此文件，只需改这里即可同步所有平台
 *
 * 版本历史：
 *   v1.0  2026-05-03  初始版本，以社工资源平台为母版，合并 classmate 管理端组件
 */

/* ════════════════════════════════════════
   CSS 变量
════════════════════════════════════════ */
:root {
  --primary:        #2563eb;
  --primary-dark:   #1d4ed8;
  --primary-light:  #eff6ff;
  --bg:             #f1f5f9;
  --bg-card:        #ffffff;
  --sidebar-bg:     #0f172a;
  --sidebar-text:   #94a3b8;
  --sidebar-hover:  rgba(255,255,255,.06);
  --sidebar-active: #2563eb;
  --text:           #0f172a;
  --text-muted:     #64748b;
  --text-light:     #94a3b8;
  --border:         #e2e8f0;
  --border-light:   #f1f5f9;
  --danger:         #ef4444;
  --danger-bg:      #fef2f2;
  --success:        #22c55e;
  --success-bg:     #f0fdf4;
  --warning:        #f59e0b;
  --warning-bg:     #fffbeb;
  --info:           #3b82f6;
  --info-bg:        #eff6ff;
  --gold:           #e8c97e;
  --radius:         8px;
  --radius-lg:      12px;
  --shadow-sm:      0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow:         0 4px 12px rgba(0,0,0,.08), 0 2px 4px rgba(0,0,0,.05);
  --topbar-h:       56px;
  --sidebar-w:      220px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px; color: var(--text); background: var(--bg);
}
a { color: var(--primary); text-decoration: none; }

/* ════════════════════════════════════════
   登录页
════════════════════════════════════════ */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 50%, #2563eb 100%);
}
.login-card {
  background: #fff; border-radius: 20px; padding: 44px 40px;
  width: 100%; max-width: 400px; box-shadow: 0 24px 80px rgba(0,0,0,.25);
}
.login-logo {
  width: 64px; height: 64px; background: var(--primary); border-radius: 16px;
  display: flex; align-items: center; justify-content: center; margin: 0 auto 20px;
  color: #fff; box-shadow: 0 8px 24px rgba(37,99,235,.4);
}
.login-card h2 { text-align: center; font-size: 22px; font-weight: 800; margin-bottom: 4px; }
.login-sub { text-align: center; color: var(--text-muted); margin-bottom: 32px; font-size: 13px; }
.error-msg { color: var(--danger); font-size: 12px; margin-top: 8px; text-align: center; min-height: 18px; }

/* ════════════════════════════════════════
   表单控件
════════════════════════════════════════ */
.form-group { margin-bottom: 16px; }
.form-row   { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.form-label {
  display: block; font-size: 12px; font-weight: 600; color: var(--text-muted);
  margin-bottom: 6px; letter-spacing: .3px;
}
.form-hint  { font-size: 11px; color: var(--text-light); margin-top: 4px; }
.form-control {
  width: 100%; padding: 9px 12px; border: 1.5px solid var(--border);
  border-radius: var(--radius); font-size: 14px; outline: none;
  transition: border-color .15s, box-shadow .15s; background: #fff; color: var(--text);
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.form-control::placeholder { color: #bec8d2; }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 80px; line-height: 1.6; }
.form-control[readonly] { background: var(--bg); cursor: not-allowed; color: var(--text-muted); }
.form-control[disabled]  { background: var(--bg); cursor: not-allowed; color: var(--text-muted); }

/* ════════════════════════════════════════
   按钮
════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 16px; border-radius: var(--radius); border: none; cursor: pointer;
  font-size: 13px; font-weight: 500; transition: all .15s; white-space: nowrap; line-height: 1;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 2px 6px rgba(37,99,235,.35); }
.btn-primary:hover { background: var(--primary-dark); box-shadow: 0 4px 10px rgba(37,99,235,.45); }
.btn-ghost { background: transparent; color: var(--text); border: 1.5px solid var(--border); }
.btn-ghost:hover { background: var(--bg); border-color: #c8d4e0; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-success { background: var(--success); color: #fff; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 6px; }
.btn-xs { padding: 3px 8px; font-size: 11px; border-radius: 5px; }
.btn.w-full { width: 100%; }
.btn-close {
  background: none; border: none; font-size: 22px; cursor: pointer; line-height: 1;
  color: var(--text-muted); padding: 2px 6px; border-radius: 6px; transition: background .15s;
}
.btn-close:hover { background: var(--bg); }
.action-btns { display: flex; gap: 4px; align-items: center; }
.btn-edit {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 6px; border: none; cursor: pointer;
  font-size: 12px; font-weight: 500; transition: all .15s;
  background: var(--primary-light); color: var(--primary);
}
.btn-edit:hover { background: #dbeafe; }
.btn-del {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 6px; border: none; cursor: pointer;
  font-size: 12px; font-weight: 500; transition: all .15s;
  background: var(--danger-bg); color: var(--danger);
}
.btn-del:hover { background: #fecaca; }

/* ════════════════════════════════════════
   顶栏
════════════════════════════════════════ */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; height: var(--topbar-h);
  background: var(--sidebar-bg);
  display: flex; align-items: center;
  padding: 0 16px; gap: 12px; z-index: 100;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.menu-toggle {
  background: none; border: none; font-size: 20px; cursor: pointer;
  color: #94a3b8; display: none; padding: 4px;
}
.topbar-logo {
  display: flex; align-items: center; gap: 10px; width: var(--sidebar-w);
  padding-left: 4px; flex-shrink: 0;
}
.topbar-logo-icon {
  width: 30px; height: 30px; background: var(--primary); border-radius: 8px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.topbar-logo-icon svg { color: #fff; }
.topbar-logo-text { font-weight: 700; font-size: 14px; color: #fff; white-space: nowrap; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-username { font-size: 13px; color: #cbd5e1; }
.topbar .btn-ghost { border-color: rgba(255,255,255,.12); color: #94a3b8; font-size: 12px; }
.topbar .btn-ghost:hover { background: rgba(255,255,255,.08); color: #fff; border-color: rgba(255,255,255,.25); }
/* 顶部用户头像 */
.topbar-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; flex-shrink: 0;
}

/* ════════════════════════════════════════
   侧边栏
════════════════════════════════════════ */
.sidebar {
  position: fixed; top: var(--topbar-h); left: 0; bottom: 0; width: var(--sidebar-w);
  background: var(--sidebar-bg); overflow-y: auto; z-index: 90;
  transition: transform .25s; border-right: 1px solid rgba(255,255,255,.04);
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 4px; }
.nav-menu { padding: 8px 0 24px; }
.nav-group-title {
  padding: 20px 18px 6px; font-size: 10px; text-transform: uppercase;
  letter-spacing: 1px; color: #475569; font-weight: 700;
}
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 18px;
  color: var(--sidebar-text); cursor: pointer; font-size: 13px;
  transition: background .15s, color .15s;
  margin: 1px 8px; border-radius: 8px;
}
.nav-item:hover { background: var(--sidebar-hover); color: #e2e8f0; }
.nav-item.active {
  background: var(--sidebar-active); color: #fff;
  box-shadow: 0 2px 8px rgba(37,99,235,.4);
}
.nav-item.active svg { opacity: 1; }
.nav-item svg { flex-shrink: 0; opacity: .6; }
.nav-badge {
  margin-left: auto; background: var(--danger); color: #fff;
  font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 10px;
}
.sidebar-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 89;
}

/* ════════════════════════════════════════
   主内容区
════════════════════════════════════════ */
.main-content {
  margin-left: var(--sidebar-w); margin-top: var(--topbar-h);
  padding: 24px; min-height: calc(100vh - var(--topbar-h));
}

/* 组织架构页专属：主区定高不随 body 滚，学校/届别两栏列表各自内部独立滚动。
   其余页面（用户/时光轴等长表格）依赖整页滚，勿去掉 data-page 限定改成全局 */
body[data-page="cohorts"] { overflow: hidden; }
body[data-page="cohorts"] .main-content {
  height: calc(100vh - var(--topbar-h));
  display: flex; flex-direction: column; min-height: 0;
}
body[data-page="cohorts"] #page-content {
  flex: 1; display: flex; flex-direction: column; min-height: 0;
}

/* ════════════════════════════════════════
   页面头
════════════════════════════════════════ */
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; flex-wrap: wrap; gap: 12px;
}
.page-title { font-size: 20px; font-weight: 800; }
.page-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ════════════════════════════════════════
   筛选栏
════════════════════════════════════════ */
.filter-bar {
  display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; align-items: center;
  background: #fff; padding: 14px 16px; border-radius: var(--radius-lg);
  border: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
/* filter-bar 内的 form-control 不占满宽度，自适应内容 */
.filter-bar .form-control { width: auto; min-width: 120px; flex: 1; max-width: 220px; }
.filter-bar input[type=date].form-control { min-width: 140px; flex: none; }
.filter-kw    { flex: 2; min-width: 180px; }
.filter-select { flex: 1; min-width: 130px; }
.filter-divider { width: 1px; height: 24px; background: var(--border); flex-shrink: 0; }

/* 年份标签横排(时光轴管理)：替代下拉框，按当前 学校/届别 范围内真实有照片的年份升序平铺 */
.year-tags { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; flex: 1; min-width: 0; }
.year-tag {
  display: inline-flex; align-items: center; justify-content: center;
  height: 32px; padding: 0 14px;
  border: 1.5px solid var(--border); border-radius: 999px;
  background: #fff; color: var(--text); font-size: 13px; font-weight: 500;
  cursor: pointer; transition: all .15s; user-select: none; white-space: nowrap;
}
.year-tag:hover:not(.active) { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.year-tag.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.year-tag-empty { font-size: 13px; color: var(--text-muted); padding: 0 4px; }
.filter-actions { display: flex; gap: 6px; flex-shrink: 0; margin-left: auto; }

/* ════════════════════════════════════════
   卡片
════════════════════════════════════════ */
.card {
  background: #fff; border-radius: var(--radius-lg); border: 1px solid var(--border);
  overflow: hidden; box-shadow: var(--shadow-sm);
}
.card-body { padding: 16px; }
.card-footer {
  padding: 12px 16px; border-top: 1px solid var(--border-light);
  display: flex; align-items: center; justify-content: space-between;
  background: #fafbfd;
}

/* ════════════════════════════════════════
   控制台 Banner
════════════════════════════════════════ */
.dash-banner {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 60%, #2563eb 100%);
  border-radius: 16px; padding: 28px 32px; margin-bottom: 20px;
  display: flex; align-items: center; justify-content: space-between;
  color: #fff; overflow: hidden; position: relative;
}
.dash-banner::before {
  content: ''; position: absolute; right: -60px; top: -60px;
  width: 240px; height: 240px; border-radius: 50%;
  background: rgba(255,255,255,.05); pointer-events: none;
}
.dash-banner::after {
  content: ''; position: absolute; right: 100px; bottom: -80px;
  width: 160px; height: 160px; border-radius: 50%;
  background: rgba(255,255,255,.04); pointer-events: none;
}
.dash-greeting { font-size: 22px; font-weight: 800; margin-bottom: 6px; }
.dash-date     { font-size: 13px; opacity: .75; margin-bottom: 4px; }
.dash-desc     { font-size: 12px; opacity: .5; }
.dash-banner-icon { opacity: .4; flex-shrink: 0; position: relative; z-index: 1; }
.dash-section-title {
  font-size: 12px; font-weight: 700; color: var(--text-muted);
  margin-bottom: 12px; text-transform: uppercase; letter-spacing: .8px;
}

/* ════════════════════════════════════════
   统计卡片
════════════════════════════════════════ */
.stat-cards {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px; margin-bottom: 24px;
}
.stat-card {
  background: #fff; border-radius: var(--radius-lg); border: 1px solid var(--border);
  padding: 20px 16px; box-shadow: var(--shadow-sm); cursor: pointer;
  transition: box-shadow .2s, transform .2s;
}
.stat-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.stat-icon {
  width: 44px; height: 44px; border-radius: 12px; font-size: 22px;
  display: flex; align-items: center; justify-content: center; margin: 0 auto 12px;
}
.stat-card .num,   .stat-card .stat-num   { font-size: 28px; font-weight: 800; text-align: center; line-height: 1; }
.stat-card .label, .stat-card .stat-label { font-size: 12px; color: var(--text-muted); margin-top: 6px; text-align: center; }
/* stat-icon 颜色变体 */
.stat-icon.blue,  .stat-icon.info    { background: #eff6ff; }
.stat-icon.green, .stat-icon.success { background: #f0fdf4; }
.stat-icon.red,   .stat-icon.danger  { background: #fef2f2; }
.stat-icon.orange, .stat-icon.warning { background: #fff7ed; }
.stat-icon.gold                       { background: #fffbeb; }
.stat-icon.gray                       { background: #f3f4f6; }

/* ════════════════════════════════════════
   表格
════════════════════════════════════════ */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th {
  padding: 11px 14px; text-align: left; border-bottom: 2px solid var(--border);
  font-weight: 600; color: var(--text-muted); background: #fafbfd;
  font-size: 11px; text-transform: uppercase; letter-spacing: .6px; white-space: nowrap;
}
td {
  padding: 11px 14px; border-bottom: 1px solid var(--border-light); font-size: 13px;
}
td.ellipsis { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
tr:last-child td { border-bottom: none; }
tbody tr { transition: background .1s; }
tbody tr:hover td { background: #f8fafc; }
.td-actions { white-space: nowrap; }

/* ════════════════════════════════════════
   徽章
════════════════════════════════════════ */
.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px;
  border-radius: 20px; font-size: 11px; font-weight: 600; white-space: nowrap;
}
.badge::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .7; }
.badge-success  { background: var(--success-bg); color: #166534; }
.badge-danger   { background: var(--danger-bg);  color: #991b1b; }
.badge-warning  { background: var(--warning-bg); color: #854d0e; }
.badge-info     { background: var(--info-bg);    color: #1e40af; }
.badge-gray     { background: var(--bg);         color: var(--text-muted); }
/* classmate 专用状态徽章 */
.badge-active   { background: #dcfce7; color: #166534; }
.badge-pending  { background: #fef9c3; color: #a16207; }
.badge-banned   { background: #fee2e2; color: #dc2626; }
.badge-draft    { background: #f3f4f6; color: #6b7280; }
.badge-signup   { background: #dbeafe; color: #1d4ed8; }
.badge-ongoing  { background: #ede9fe; color: #7c3aed; }
.badge-ended    { background: #f3f4f6; color: #6b7280; }
.badge-archived { background: #f3f4f6; color: #6b7280; }
.badge-gold     { background: #fef3c7; color: #b45309; }

/* ════════════════════════════════════════
   用户头像 / 用户行
════════════════════════════════════════ */
.user-cell { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  background: #1a2a3a; color: var(--gold);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
}
.avatar-blue  { background: var(--primary); color: #fff; }
.avatar-green { background: #166534; color: #fff; }

/* 面试阶段标签（classmate 专用） */
.stage-tag {
  display: inline-block; padding: 2px 8px; border-radius: 10px;
  font-size: 12px; font-weight: 500;
}
.stage-tag.stage-一面  { background: #dbeafe; color: #1d4ed8; }
.stage-tag.stage-二面  { background: #ede9fe; color: #6d28d9; }
.stage-tag.stage-终面  { background: #fef3c7; color: #92400e; }
.stage-tag.stage-已通过 { background: #dcfce7; color: #15803d; }
.stage-tag.stage-已拒绝 { background: #fee2e2; color: #b91c1c; }

/* 详情网格 */
.detail-grid { display: flex; flex-direction: column; gap: 10px; }
.detail-row {
  display: flex; align-items: baseline; gap: 12px;
  font-size: 13px; padding-bottom: 10px; border-bottom: 1px solid var(--border);
}
.detail-row:last-child { border-bottom: none; padding-bottom: 0; }
.detail-label { width: 72px; flex-shrink: 0; color: var(--text-muted); font-size: 12px; }

/* ════════════════════════════════════════
   分页
════════════════════════════════════════ */
.pagination { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.page-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 32px; height: 32px; padding: 0 8px;
  border: 1.5px solid var(--border); border-radius: 7px;
  background: #fff; color: var(--text); font-size: 13px; font-weight: 500;
  cursor: pointer; transition: all .15s; user-select: none;
}
.page-btn:hover:not(.disabled):not(.active) {
  border-color: var(--primary); color: var(--primary); background: var(--primary-light);
}
.page-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.page-btn.disabled { opacity: .35; cursor: not-allowed; }
.page-info { font-size: 12px; color: var(--text-muted); padding: 0 4px; white-space: nowrap; }

/* 每页条数选择器（2026-08-28）。跟页码按钮同高，视觉上属于同一条分页栏 */
.page-size {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; color: var(--text-muted); white-space: nowrap; margin-left: 4px;
}
.page-size-sel {
  height: 32px; padding: 0 6px;
  border: 1.5px solid var(--border); border-radius: 7px;
  background: #fff; color: var(--text); font-size: 13px; cursor: pointer;
}
.page-size-sel:hover { border-color: var(--primary); }

/* ════════════════════════════════════════
   弹窗
════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 2000;
  display: flex; align-items: center; justify-content: center; padding: 16px;
  backdrop-filter: blur(2px);
}
.modal {
  background: #fff; border-radius: 16px; width: 100%; max-width: 720px;
  max-height: 90vh; display: flex; flex-direction: column;
  box-shadow: 0 24px 60px rgba(0,0,0,.2);
}
.modal-sm  { max-width: 420px; }
.modal-lg  { max-width: 860px; }
.modal-fullscreen {
  max-width: calc(100vw - 32px); max-height: calc(100vh - 32px);
  width: calc(100vw - 32px); height: calc(100vh - 32px);
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px; border-bottom: 1px solid var(--border);
  font-weight: 700; font-size: 16px; flex-shrink: 0; gap: 12px;
}
.modal-header-actions { display: flex; align-items: center; gap: 8px; }
.modal-fs-btn {
  background: none; border: 1.5px solid var(--border); border-radius: 7px;
  padding: 5px 10px; cursor: pointer; font-size: 12px; color: var(--text-muted);
  transition: all .15s; white-space: nowrap;
}
.modal-fs-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.modal-body { flex: 1; overflow-y: auto; padding: 24px; }
.modal-body::-webkit-scrollbar { width: 5px; }
.modal-body::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 4px; }
.modal-footer {
  padding: 16px 24px; border-top: 1px solid var(--border);
  display: flex; gap: 8px; justify-content: flex-end; flex-shrink: 0;
  background: #fafbfd; border-radius: 0 0 16px 16px;
}

/* ════════════════════════════════════════
   Toast
════════════════════════════════════════ */
#toast-container {
  position: fixed; top: 68px; right: 20px; z-index: 999;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  display: flex; align-items: center; gap: 10px; padding: 12px 18px;
  border-radius: 10px; font-size: 13px; font-weight: 500; color: #fff;
  box-shadow: 0 4px 16px rgba(0,0,0,.2);
  animation: toastIn .2s ease-out; max-width: 320px;
}
.toast-success { background: #15803d; }
.toast-error   { background: #b91c1c; }
.toast-info    { background: #1e40af; }
.toast-warning { background: #b45309; }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(12px); }
  to   { opacity: 1; transform: none; }
}

/* AI 修复「收尾中」的不定态进度条（timeline.js 引用）。
   逐脸循环跑完后还要贴回原图 + 编码 + 上传，这一段报不了百分比。
   没有百分比的时候宁可让条子来回跑，也不要摆一条不动的满条 ——
   后者暗示"早该结束了"，看着就像卡死（2026-09-04 PM 实测反馈）。 */
@keyframes aiTailSlide {
  0%   { left: -40%; }
  100% { left: 100%; }
}

/* ════════════════════════════════════════
   空状态
════════════════════════════════════════ */
.empty-state { padding: 56px 20px; text-align: center; }
.empty-state-icon  { font-size: 48px; margin-bottom: 14px; opacity: .5; display: block; }
.empty-state-text  { font-size: 15px; font-weight: 600; color: var(--text-muted); display: block; margin-bottom: 6px; }
.empty-state-sub   { font-size: 13px; color: var(--text-light); display: block; }

/* ════════════════════════════════════════
   权限树
════════════════════════════════════════ */
.perm-tree { border: 1.5px solid var(--border); border-radius: 10px; overflow: hidden; }
.perm-group { border-bottom: 1px solid var(--border-light); }
.perm-group:last-child { border-bottom: none; }
.perm-group-label {
  display: flex; align-items: center; gap: 8px; padding: 9px 14px;
  background: var(--bg); font-size: 13px; font-weight: 600;
  color: var(--text); cursor: pointer; user-select: none;
}
.perm-group.depth-1 > .perm-group-label {
  padding-left: 28px; background: #fff;
  font-weight: 500; font-size: 13px; color: var(--text-muted);
}
.perm-group-label input[type=checkbox] {
  accent-color: var(--primary); width: 15px; height: 15px; flex-shrink: 0; cursor: pointer;
}
.perm-group-children { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 14px 10px 32px; background: #fff; }
.perm-group.depth-1 > .perm-group-children { padding-left: 46px; }
.perm-leaf {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px;
  border: 1.5px solid var(--border); border-radius: 6px; cursor: pointer;
  font-size: 12px; color: var(--text-muted); transition: all .15s;
}
.perm-leaf:hover { border-color: var(--primary); background: var(--primary-light); color: var(--primary); }
.perm-leaf.checked { border-color: var(--primary); background: var(--primary-light); color: var(--primary); font-weight: 500; }
.perm-leaf input[type=checkbox] {
  accent-color: var(--primary); width: 13px; height: 13px; flex-shrink: 0; cursor: pointer;
}

/* ════════════════════════════════════════
   旧版内联弹框（.modal-mask 方式，各页面 innerHTML 渲染）
════════════════════════════════════════ */
.modal-mask {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}
.modal-mask.show,
.modal-mask[style*="display: flex"] { display: flex !important; }
/* 旧弹框内部结构 */
.modal-mask .modal {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  width: 520px;
  max-width: 92vw;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
  display: flex;
  flex-direction: column;
}
.modal-mask .modal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px; flex-shrink: 0;
}
.modal-mask .modal-title { font-size: 16px; font-weight: 700; }
.modal-mask .modal-close {
  width: 28px; height: 28px; border-radius: 6px; border: none;
  background: #f3f4f6; color: var(--text-muted); cursor: pointer;
  font-size: 16px; display: flex; align-items: center; justify-content: center;
}
.modal-mask .modal-close:hover { background: #e5e7eb; }
.modal-mask .modal-body { flex: 1; overflow-y: auto; }
.modal-mask .modal-footer {
  display: flex; gap: 10px; justify-content: flex-end;
  margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.modal-mask .modal-lg { width: 680px; }
.modal-mask .modal-xl { width: 860px; }

/* ════════════════════════════════════════
   旧版表单组件（各页面 innerHTML 渲染）
════════════════════════════════════════ */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.form-item { display: flex; flex-direction: column; gap: 5px; }
.form-item .form-label { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.form-item input:not(.form-control),
.form-item select:not(.form-control),
.form-item textarea:not(.form-control) {
  width: 100%; padding: 8px 10px; border: 1.5px solid var(--border);
  border-radius: var(--radius); font-size: 13px; outline: none;
  background: #fff; color: var(--text); transition: border-color .15s;
}
.form-item input:not(.form-control):focus,
.form-item select:not(.form-control):focus,
.form-item textarea:not(.form-control):focus { border-color: var(--primary); }

/* ════════════════════════════════════════
   搜索栏（旧页面内联版本）
════════════════════════════════════════ */
.search-bar {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
  padding: 12px 16px; background: #fff;
  border-radius: var(--radius-lg); border: 1px solid var(--border);
  box-shadow: var(--shadow-sm); margin-bottom: 14px;
}
.search-bar input, .search-bar select {
  height: 34px; padding: 0 10px; border: 1.5px solid var(--border);
  border-radius: var(--radius); font-size: 13px; outline: none;
  background: #fff; color: var(--text); transition: border-color .15s;
}
.search-bar input:focus, .search-bar select:focus { border-color: var(--primary); }

/* ════════════════════════════════════════
   告警提示
════════════════════════════════════════ */
.alert {
  padding: 10px 14px; border-radius: 8px; font-size: 13px;
  margin-bottom: 14px; display: flex; align-items: center; gap: 8px;
}
.alert-warning { background: #fff7ed; border: 1px solid #fed7aa; color: #c2410c; }
.alert-info    { background: #eff6ff; border: 1px solid #bfdbfe; color: #1d4ed8; }
.alert-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #15803d; }

/* ════════════════════════════════════════
   照片网格（时光轴管理）
════════════════════════════════════════ */
.photo-grid-admin {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
}
.photo-thumb {
  aspect-ratio: 1; border-radius: 10px; overflow: hidden;
  background: #f3f4f6; display: flex; align-items: center; justify-content: center;
  font-size: 32px; cursor: pointer; position: relative;
  border: 1px solid var(--border); transition: box-shadow .15s;
}
.photo-thumb:hover { box-shadow: var(--shadow); }
.photo-thumb:hover .photo-overlay { opacity: 1; }
.photo-overlay {
  position: absolute; inset: 0; background: rgba(0,0,0,.4);
  opacity: 0; display: flex; align-items: center; justify-content: center;
  gap: 8px; transition: opacity .2s;
  /* ★ 必须 wrap + 左右留边（2026-09-22 加旋转钮时截图才发现）：
     卡片是正方形、宽度约 190px，两个按钮刚好塞下，**第三个一加进来
     两头的按钮就被 overflow:hidden 裁掉了** —— 而每个按钮自己都有正常尺寸、
     也点得到，所以只量尺寸的检查一路报绿，只有看截图才看得出来。
     写死"最多放两个"是把同一个坑留给下一个人，所以让它自己换行。
     ★ align-content 必须显式给 center：wrap 之后默认是 stretch，两行会被拉到
     一上一下贴着卡片边缘、中间空一大块 —— 不裁了，但更难看。
     卡片实测只有 138px 宽（1440 视口下 8 列），三个按钮 133px + 间距放不下，
     所以两行是常态，不是异常。 */
  flex-wrap: wrap; align-content: center; padding: 0 5px; row-gap: 6px;
}

/* ════════════════════════════════════════
   上传区域
════════════════════════════════════════ */
.upload-area {
  border: 2px dashed var(--border); border-radius: 8px; padding: 20px;
  text-align: center; cursor: pointer; color: var(--text-light);
  font-size: 13px; transition: border-color .15s;
}
.upload-area:hover { border-color: var(--primary); color: var(--text-muted); }

/* ════════════════════════════════════════
   响应式
════════════════════════════════════════ */
/* ════════════════════════════════════════
   工具栏（旧页面用 .toolbar）
════════════════════════════════════════ */
.toolbar {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 14px; flex-wrap: wrap;
}
.toolbar-right { margin-left: auto; display: flex; gap: 8px; }

/* ════════════════════════════════════════
   组织架构页专用（双栏布局）
════════════════════════════════════════ */
/* 这三条原来是 cohorts.js 里的内联样式（2026-08-29 搬过来的，取值一字未改）。
   搬出来的原因：窄屏要把两栏改成上下排，class 选择器压不过内联样式。
   ★ flex:1 + min-height:0 那一组不能删 —— 它们是「左右两栏各自独立滚动」的支撑
   （见上面 body[data-page="cohorts"] 那段，以及全局规范里的分栏滚动铁律）：
   中间任何一层没把高度传下去，内部的 overflow-y:auto 就失效，变成整页一起滚。 */
.org-layout { display: flex; gap: 16px; align-items: stretch; flex: 1; min-height: 0; }
.org-left   { width: 260px; flex-shrink: 0; padding: 16px; display: flex; flex-direction: column; min-height: 0; }
.org-right  { flex: 1; min-width: 0; padding: 16px; display: flex; flex-direction: column; min-height: 0; }
.org-panel-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 14px; }

/* ── 届别列表：一届两行（2026-08-29 重做，PM「太难操作了」）──────────────
   换掉原来那张 9 列宽表。真实数据下（21 个届别）它一行高约 220px、
   「班级」列被挤成一列一个字、7 个按钮横向溢出被切掉。
   现在一行约 60px，一屏看得见 8~10 个届别，不再横向滚。 */
.co-list { display: flex; flex-direction: column; }
.co-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 4px; border-bottom: 1px solid var(--border-light);
}
.co-row:last-child { border-bottom: none; }
.co-row:hover { background: #fafbfd; }
.co-row-cb { flex-shrink: 0; margin: 0; }
/* 缩略图给 64×36（16:9 近似 750:705 的观感），比原来的 80×45 小一档，
   目的是让整行压到 60px 左右 —— 它在这里的作用是"有没有图"，不是看内容 */
.co-thumb {
  width: 64px; height: 36px; flex-shrink: 0;
  object-fit: cover; border-radius: 4px; border: 1px solid var(--border);
  cursor: zoom-in; background: #f3f4f6;
}
.co-thumb--empty {
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: var(--text-light); cursor: default;
  border-style: dashed;
}
.co-main { flex: 1; min-width: 0; }
.co-line1 { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.co-name { font-size: 14px; font-weight: 600; color: var(--text); }
.co-years { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.co-line2 { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.co-warn { color: #dc2626; font-size: 11px; margin-top: 4px; line-height: 1.5; }

/* 徽章：默认是"陈述"，只有需要人动手的才上警示色。
   全都上色等于没有重点 —— 一眼扫过去应该只有该处理的那几个跳出来 */
.co-chip {
  display: inline-flex; align-items: center;
  padding: 2px 8px; border-radius: 4px;
  font-size: 11.5px; line-height: 18px; white-space: nowrap;
  background: #eef2f7; color: var(--text-muted); cursor: pointer;
}
.co-chip--muted { background: transparent; color: var(--text-light); cursor: default; padding-left: 2px; }
.co-chip--act   { background: #e8f0f7; color: #1a2a3a; }
.co-chip--warn  { background: #fdece9; color: #c0392b; }
.co-chip:hover:not(.co-chip--muted) { filter: brightness(.96); }
/* 灰态但**可点**的开关（如「需审核」）。
   之前它和「无背景图」「焦点卡自动」一样用 co-chip--muted，
   连 cursor 都是 default —— 三个字长得一模一样，PM 盯着截图也没认出中间那个能点。
   状态字和开关必须一眼分得开：虚线下划线 + 手型 + hover 变实底。 */
.co-chip--toggle {
  background: transparent; color: var(--text-light); cursor: pointer;
  padding-left: 2px; border-bottom: 1px dashed var(--text-light);
}
.co-chip--toggle:hover { background: #eef1f4; color: #1a2a3a; border-bottom-color: transparent; }

.co-ops { display: flex; align-items: center; gap: 2px; flex-shrink: 0; }

/* 行内图标按钮（2026-08-30，PM：「这几个按钮做成按钮图标放在列表上，鼠标移上去显示名称」）。
   取代了原来的「⋯」下拉菜单 —— 当初进菜单的理由是"7 个文字按钮任何屏宽都放不下"，
   而文字按钮一个约 70px、图标按钮一个 30px，换成图标之后那条约束就不成立了。

   默认无边框、无底色：一行里六个图标各自带框会变成一片"按钮墙"，
   而它们的层级本来就低于左边那个文字的「编辑」。hover 才浮出底色，指哪个亮哪个。 */
.co-ic {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; padding: 0; flex-shrink: 0;
  border: none; border-radius: var(--radius, 6px);
  background: transparent; color: var(--text-muted); cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.co-ic svg { width: 16px; height: 16px; display: block; }
.co-ic:hover { background: #eef2f7; color: var(--text); }
.co-ic:focus-visible { outline: 2px solid var(--primary, #E1483C); outline-offset: -2px; }

/* 删除单独隔一道竖线，而且只有 hover 才变红。
   常态就红的话，一行里最扎眼的会是「删除」—— 它恰恰是最不该被先看到的那个。 */
.co-ops-sep { width: 1px; height: 18px; margin: 0 5px; background: var(--border); flex-shrink: 0; }
.co-ic--danger:hover { background: #fdece9; color: #c0392b; }

/* ════════════════════════════════════════
   财务 Tab
════════════════════════════════════════ */
.f-tab { color: var(--text-muted); transition: color .15s, border-color .15s; }
.f-tab.active { color: var(--primary); font-weight: 600; }

/* 各列表页"用户名"类单元格：点击打开共享用户详情弹窗（viewUserDetail），统一可点样式 */
.ud-link { color: var(--primary); cursor: pointer; }
.ud-link:hover { text-decoration: underline; }

/* ════════════════════════════════════════
   内联弹框 input/select 兼容
   （旧页面 .modal-mask 内的原生控件无 .form-control 类）
════════════════════════════════════════ */
.modal-mask input:not([type=checkbox]):not([type=radio]):not([type=hidden]),
.modal-mask select,
.modal-mask textarea {
  width: 100%; padding: 8px 10px; border: 1.5px solid var(--border);
  border-radius: var(--radius); font-size: 13px; outline: none;
  background: #fff; color: var(--text); transition: border-color .15s;
  box-sizing: border-box;
}
.modal-mask input:not([type=checkbox]):not([type=radio]):not([type=hidden]):focus,
.modal-mask select:focus,
.modal-mask textarea:focus { border-color: var(--primary); }
.modal-mask textarea { min-height: 72px; resize: vertical; }

/* ════════════════════════════════════════
   响应式（2026-08-29 重做）

   为什么要重做：这个后台是**在小程序里用 web-view 打开**的
   （miniprogram/pages/admin-webview + 一次性 SSO），届别管理员实际就在
   390px 宽的手机上用它。原来这里只做了"收起侧栏 + 字号调小"，表格一列没动，
   实测 390px 下：顶栏「某中学·2000届」竖成一列一个字；同学会 8 列表格横向溢出，
   「费用」被切掉；时光轴空态文字被挤成一列。

   ★ 核心手法：**表格在窄屏变成卡片**，每个单元格前面补上它那一列的表头。
     表头文字由 admin.js::_stampTableLabels 写进 td[data-label]（一处 MutationObserver
     管住全部 22 个页面，不用逐页改 JS —— 逐页改必漏，而漏掉的那几页最难被发现）。
════════════════════════════════════════ */
@media (max-width: 768px) {
  /* 顶栏两行：第一行身份与操作，第二行学校/届别选择器。
     --topbar-h 一改，sidebar 的 top、main-content 的 margin-top 全都跟着走
     （它们都读这个变量），不用逐个改 —— 漏一个就是内容被顶栏盖住 */
  /* ★ 这个值必须罩得住顶栏实际高度：topbar 是 position:fixed，
     main-content 靠 margin-top:var(--topbar-h) 让位，小了就被盖住。
     现在是两行 —— 第一行身份与操作、第二行学校/届别，实测约 84px，给到 88px 留余量。
     （第一版给 100px 却排成了三行，反而不够高，正是这个坑。） */
  :root { --topbar-h: 88px; }
  .topbar { height: auto; min-height: var(--topbar-h); flex-wrap: wrap; padding: 6px 10px; row-gap: 6px; align-content: center; }
  /* logo 整块去掉：390px 上它挤得第一行放不下右侧那组，硬生生多出一行。
     这是从小程序里打开的管理页，用户不需要靠这里认品牌 */
  .topbar-logo { display: none; }
  .topbar-username { font-size: 12px; max-width: 30vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar .btn-ghost { padding: 4px 9px; font-size: 11px; }
  .topbar > div[style*="flex:1"] { display: none; }   /* 原来撑开左右的占位，两行布局不需要 */
  .topbar-right { margin-left: auto; gap: 8px; }
  /* 学校/届别整条占第二行。order 给个大值，保证它排在最后一行 */
  #org-filter { order: 10; width: 100%; margin-left: 0 !important; }
  #org-filter .form-control { flex: 1; width: auto !important; min-width: 0; }
  /* 届别管理员那条只读的「某中学 · 2000届」：不给 nowrap 就会被 flex 压成一列一个字 */
  .topbar-org-label { order: 10; width: 100%; margin-left: 0 !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

  .menu-toggle { display: block; }
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: none; }
  .sidebar-overlay.open { display: block; }
  .main-content { margin-left: 0; padding: 12px; }
  .modal { max-width: 100%; max-height: 95vh; border-radius: 12px; }
  .modal-fullscreen { width: 100vw; height: 100vh; max-width: 100vw; max-height: 100vh; border-radius: 0; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }

  /* 筛选栏：一行一个，别再挤成半截 */
  .filter-bar { padding: 12px; gap: 10px; }
  .filter-bar .form-control,
  .filter-kw, .filter-select { max-width: none; width: 100%; flex: 1 1 100%; min-width: 0; }
  .filter-bar input[type=date].form-control { flex: 1 1 calc(50% - 5px); min-width: 0; }
  .filter-divider { display: none; }
  /* 筛选栏里的每个 div 子块（年份标签条、按钮组…）各占一整行。
     margin-left 要 !important：好几个页面把按钮组写成
     `<div style="margin-left:auto;…">` 的**内联样式**，class 选择器压不过它 ——
     压不过的后果是它继续靠右挤，把左边的年份标签条压成一列一个字（时光轴页实测）。*/
  .filter-bar > div { flex: 1 1 100%; min-width: 0; margin-left: 0 !important; }
  .filter-bar > div[style*="flex"] { flex-wrap: wrap; }
  .filter-actions { margin-left: 0; width: 100%; }
  .filter-actions .btn { flex: 1; }

  /* ── 表格 → 卡片 ───────────────────────────────────────────────
     只对 .tbl-cards 生效。这个类由 admin.js 在窄屏时给"有表头的正常列表"加上，
     不是给所有 table 加：后台里还有一些用 table 做的**排版性**结构
     （弹框里的两列布局之类），把它们也拆成卡片会更难看。 */
  .table-wrap { overflow-x: auto; }           /* 没被转成卡片的表格仍可横向滚 */
  /* ★ min-width 必须清掉，而且要 !important。
     有的页面给表格设了 min-width 让它在窄窗口下横向滚（组织架构那张是 1080px）。
     变成卡片之后这个 min-width 还在，整张卡片被撑到 1080px 宽 ——
     标签靠左看得见、值靠右被推到屏幕外，看起来就是"所有值都空了"。
     用 !important 是为了连页面 JS 写的**内联** min-width 一起压掉
     （样式表里的 !important 是能盖过非 important 内联样式的）。 */
  table.tbl-cards { display: block; min-width: 0 !important; width: auto; }
  table.tbl-cards thead { display: none; }    /* 表头下沉成每格前面的小字 */
  table.tbl-cards tbody { display: block; }
  table.tbl-cards tbody tr {
    display: block; margin-bottom: 10px; padding: 4px 0;
    background: #fff; border: 1px solid var(--border);
    border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
  }
  table.tbl-cards tbody tr:hover td { background: transparent; }  /* 卡片里整行高亮没有意义 */
  table.tbl-cards td {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
    flex-wrap: wrap;
    padding: 7px 12px; border-bottom: 1px solid var(--border-light);
    font-size: 13px; word-break: break-word;
    /* !important 是为了压掉页面 JS 写在 td 上的内联 white-space:nowrap ——
       在 350px 宽的卡片里，换行永远好过溢出到屏幕外 */
    white-space: normal !important;
  }
  table.tbl-cards tr td:last-child { border-bottom: none; }
  /* 没有列名的格子（如「操作」列，admin.js 刻意不贴标签）不要留这个伪元素：
     它虽然内容为空，仍是个 flex 子项，会在卡片里占掉一整行、把按钮挤成两截 */
  table.tbl-cards td:not([data-label])::before { display: none; }
  table.tbl-cards td::before {
    content: attr(data-label);
    flex: 0 0 auto; max-width: 40%;
    color: var(--text-muted); font-size: 11px; font-weight: 600;
    letter-spacing: .4px; padding-top: 2px; white-space: nowrap;
  }
  /* 第一列当卡片标题：它几乎总是"这条是谁/是什么"，加个「姓名：」反而碍事 */
  table.tbl-cards td:first-child {
    font-size: 14px; font-weight: 600;
    background: #fafbfd; border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding: 10px 12px;
  }
  table.tbl-cards td:first-child::before { display: none; }
  /* 但第一列是"批量勾选框"时不能当标题：那会在卡片顶上撑出一条
     只有一个小方框的灰色标题栏，看着像渲染坏了（组织架构页实测）。
     data-pick 由 admin.js 在识别出"整格只有一个 checkbox"时打上 */
  table.tbl-cards td[data-pick] {
    background: transparent; font-weight: 400;
    padding: 8px 12px 0; border-bottom: none; min-height: 0;
  }
  table.tbl-cards td[data-pick] + td {
    background: #fafbfd; border-radius: 0; padding: 10px 12px;
  }
  /* 值为空时右边会塌成一条缝，给个占位高度，卡片不至于忽高忽低 */
  table.tbl-cards td:empty { min-height: 32px; }
  /* 操作按钮：整行占满、可换行，不然三四个按钮会挤出卡片 */
  table.tbl-cards td.td-actions {
    flex-wrap: wrap; white-space: normal; justify-content: flex-start; gap: 6px;
    background: #fafbfd; border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    padding: 10px 12px;
  }
  table.tbl-cards td.td-actions .btn { flex: 1 1 auto; min-width: 76px; }
  /* 空态那一行是 <td colspan=N>，它没有对应的列，别给它加标签 */
  table.tbl-cards td[data-full] { justify-content: center; text-align: center; padding: 24px 12px; }
  table.tbl-cards td[data-full]::before { display: none; }
  table.tbl-cards td.ellipsis { max-width: none; white-space: normal; overflow: visible; }

  .pagination { justify-content: center; }

  /* ── 一律允许换行（2026-08-29 全站 24 页实测之后加的）──────────────
     后台大量页面把工具条写成 `<div style="display:flex;...">` 的**内联样式**，
     没有 class 可抓。这已经是同一个病第三次咬人了（组织架构的双栏、
     筛选栏的按钮组、同学消息的工具条），所以这里按"内联样式里含 display:flex"
     直接兜住 —— 属性选择器看着糙，但它精确对准了这个反复出现的写法。
     换行只在真的放不下时才发生，放得下的行为完全不变。 */
  #page-content [style*="display:flex"] { flex-wrap: wrap; }
  /* 工具条里写死宽度的输入框（如 width:200px）在 390px 上要能缩 */
  #page-content .form-control[style*="width:"] { max-width: 100%; }

  /* ── 统计卡片：财务页写死了 repeat(3,1fr)，三列 ×176px 的大字金额
     把整页撑到 623px（实测）。窄屏按可用宽度自动排，并把金额字号收小 ──── */
  .stat-cards {
    grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)) !important;
    gap: 10px; margin-bottom: 16px;
  }
  /* ★ min-width:0 是关键：grid 子项默认 min-width:auto，
     「¥-121490.46」这种不可断行的大字会把轨道顶宽、整个网格溢出容器 */
  .stat-card { padding: 14px 10px; min-width: 0; }
  .stat-card .num, .stat-card .stat-num { font-size: 20px; word-break: break-all; }
  .stat-card .label, .stat-card .stat-label { font-size: 11px; }
  .stat-icon { width: 36px; height: 36px; font-size: 18px; margin-bottom: 8px; }

  /* ── 组织架构页：两栏改上下排 ──────────────────────────────
     桌面上这一页是"主区定高、两栏各自内部滚动"（见 body[data-page="cohorts"]）。
     那套在手机上会把两个面板挤进 100vh-88px，各剩一条缝，右侧「届别列表」
     整块被推出屏幕外 —— PM 实测截图就是这样。
     窄屏改回整页滚：上下排，左边学校列表限高自滚，下面届别列表跟着页面滚。 */
  body[data-page="cohorts"] { overflow: auto; }
  body[data-page="cohorts"] .main-content { height: auto; min-height: calc(100vh - var(--topbar-h)); }
  .org-layout { flex-direction: column; flex: none; }
  .org-left, .org-right { width: 100%; min-height: 0; }
  /* 学校可能有几十所：给它一个上限自滚，否则要划很久才够得着下面的届别列表 */
  #school-list { max-height: 42vh; }
  #cohort-list { overflow: visible; }
  /* 面板标题跟按钮同排放不下（「仁寿一中 · 届别列表」+ 两个按钮），
     不换行就会被 flex 压成一列一个字 —— 跟顶栏那条是同一个病 */
  .org-panel-head { flex-wrap: wrap; }
  /* 标题短就跟按钮同排（学校列表），长了才自己占一行（「XX中学 · 届别列表」）——
     一律强制 100% 的话，「学校列表 / ＋添加」白白占掉两行 */
  .org-panel-head > div:first-child { flex: 1 1 auto; min-width: 150px; }
  /* 学校卡片：名字长了就截断，别把右边的编辑/删除挤走 */
  #school-list > div > div:first-child { min-width: 0; }
}

/* ════════════════════════════════════════
   数据看板 · 统计范围按钮组（PM 2026-08-01：从下拉改成按钮点选）
════════════════════════════════════════ */
.an-day-btn {
  padding: 5px 13px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--card-bg, #fff); color: var(--text2, #555);
  font-size: 12.5px; font-family: inherit; cursor: pointer; white-space: nowrap;
  transition: background .15s, color .15s, border-color .15s;
}
.an-day-btn:hover { border-color: var(--primary); color: var(--primary); }
.an-day-btn.active {
  background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600;
}

/* ════════════════════════════════════════
   时光轴 · 照片编辑弹框里的「画框标人」区
   （PM 2026-08-01：画圈框人需要全屏查看图片，不然弹框里显示不完整）

   坐标口径：框选存的是相对 #pe-box-wrap 的百分比（见 pages/timeline.js::_initBoxDraw），
   所以 wrap 必须**始终紧贴图片本身**——全屏态下用 fit-content 收缩到图片实际宽度，
   一旦 wrap 比图片宽，画的框就会整体偏移、存进去的坐标全错。改这里务必守住这一条。
════════════════════════════════════════ */
.pe-box-wrap {
  position: relative; width: 100%; margin-bottom: 6px;
  border-radius: 6px; overflow: hidden; background: #000; cursor: crosshair;
}
.pe-box-img {
  width: 100%; height: auto; display: block;
  user-select: none; pointer-events: none;
}

/* 白框上那个删除 ✕（PM 2026-09-03「直接在框上删除」）。

   ★★ 默认**隐身**，悬停到那个框上才出现。

   理由是实拍看出来的（_shots/tl-photo-edit.png，观寺中学 2013 级 1 班，
   56 个自动框）：常显的时候红 ✕ 铺满整张照片。合影上相邻的框
   本来就挤在一起，于是一堆 ✕ 互相叠压、还盖住了旁边人的脸 ——
   而"看清人"正是这个页面存在的意义。
   我先前那张自制验收图没看出来，因为框是均匀摆开的、每个都有空隙。

   悬停才出仍然满足 PM 要的"看到哪张就在哪里删"：
   鼠标本来就得移到那个框上才能点它。

   ★ @media (hover: none) 下恢复常显：平板/触屏上没有悬停这个动作，
     隐起来就等于删不了。宁可在那些设备上乱一点。 */
.pe-del-x {
  opacity: 0;
  transition: opacity .12s;
}
.pe-unknown-box:hover .pe-del-x { opacity: 1; }
@media (hover: none) {
  .pe-del-x { opacity: 1; }
}
/* 全屏态：整张照片必须一屏内看全（PM 2026-08-02 第五次反馈，前四次我都在改
   另一个地方——独立的全屏标记层 #pt-*，而 PM 看的一直是这个「照片编辑」弹框）。

   ★ 2026-09-23 修正：横向上限必须是 **100%（容器）**，不是 vw（视口）。

   原来写的是 max-width:88vw，注释里说"百分比会循环依赖所以只能用 vw"。
   那个理由不成立，而且 vw 这个写法本身就是错的 —— 因为**这个弹框并不真的
   占满视口**：`.modal-fullscreen` 虽然写着 width:calc(100vw-32px)，
   但被更具体的规则盖掉，实测弹框只有 680px、内容区 592px。
   于是：图按 88vw=1267px 算宽度、渲染成固有的 800px，而 wrap 只有 592px，
   `overflow:hidden` 把右边 208px **直接切掉**。
   竖图不触发（本来就窄），所以症状是"一转成横的就缺一块"
   —— PM 2026-09-23「旋转后这里面的显示错位了」。

   实测（tools/admin-rotate-layout-repro.py，1440×980，800×400 的横图）：
     88vw  → wrap 592×400，img 800×400  ← 右边 208px 被裁
     100%  → wrap 592×296，img 592×296  ← 完整，比例 2.000 不变，wrap 严丝合缝
   所谓"循环依赖"在浏览器里并不发生：fit-content 先取 min(固有宽, 可用宽)=592，
   图片的 100% 再按 592 解析，一次收敛。

   width/height 都留 auto、只给两个方向的上限：浏览器会按图片自身比例等比缩到框内，
   而且 img 元素的盒子**正好等于缩放后的图片**——这一点是框选坐标正确的前提
   （不能用 object-fit:contain，那会让盒子大于图片，画的框整体偏移）。 */
.modal-mask-fullscreen .pe-box-wrap {
  width: fit-content; max-width: 100%; margin: 0 auto 6px;
}
.modal-mask-fullscreen .pe-box-img {
  width: auto; height: auto;
  max-width: 100%;                      /* 容器，不是视口 —— 理由见上面那段 */
  max-height: calc(100vh - 320px);
}

/* ── 届别批量操作条（PM 2026-08-28）──────────────────────────
   勾选若干届别后批量设背景图/航拍。规格沿用页面里既有的按钮和字号，不新造视觉。 */
.batch-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  margin-bottom: 10px;
  background: #f8f9fa;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
}
.batch-all {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
}
.batch-count {
  flex: 1;
  font-size: 12px;
  color: var(--text-muted);
}
.batch-bar .btn { width: auto; }
.batch-cb { cursor: pointer; }

/* 届别列表加了勾选列之后，右侧那 7 个操作按钮会被挤出可视区（窄屏上本来就紧张）。
   给容器横向滚动，够不着的按钮至少滑得到 —— 不改列宽，避免动到其它列的既有排版。 */
#cohort-list { overflow-x: auto; }
#cohort-list > table { min-width: 1080px; }

/* ===== 照片审核（2026-08-28）：同学投稿的老照片待审队列 =====
   用卡片网格而不是表格：审这个东西靠的是**看图**，表格里一行 20px 高的缩略图什么也判断不出来。 */
.pa-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
}
.pa-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
/* 等大格子 → 这里用 thumbnail(400×400 裁剪) 是 AGENTS 2.3 允许的少数场景之一。
   但点开的大图必须是未裁的 medium：判断"这张过不过"不能对着一张被切掉边的方图做。 */
.pa-thumb {
  position: relative;
  aspect-ratio: 1 / 1;
  background: #0f172a;
  cursor: zoom-in;
}
.pa-thumb img { width: 100%; height: 100%; object-fit: contain; background:#0f172a; display: block; }
.pa-pick {
  position: absolute; top: 6px; left: 6px;
  background: rgba(255,255,255,.92);
  border-radius: 6px; padding: 3px 5px; line-height: 1; cursor: pointer;
}
.pa-meta { padding: 8px 10px; flex: 1; }
.pa-year { font-size: 13px; font-weight: 600; color: var(--text); }
.pa-desc {
  font-size: 12px; color: var(--text-muted); margin-top: 3px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.pa-sub { font-size: 11px; color: var(--text-light); margin-top: 3px; }
.pa-actions {
  display: flex; gap: 6px; padding: 8px 10px;
  border-top: 1px solid var(--border);
}
.pa-actions .btn { flex: 1; }

/* ── 班级内标签 chip（我的班级页 / 2026-08-30）──────────────────────── */
/* 默认灰色描边；管理员给标签配了色时由内联 style 覆盖 border-color/color。
   不用实心底色：一行里可能并排三四枚，实心块会把表格搅得很花。 */
.cm-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 1px 8px; border-radius: 999px;
  border: 1px solid var(--border, #d0d7de);
  color: var(--text2, #57606a);
  font-size: 12px; line-height: 1.7; white-space: nowrap;
}
.cm-chip-x { cursor: pointer; opacity: .55; font-size: 11px; }
.cm-chip-x:hover { opacity: 1; color: var(--danger, #d1242f); }

/* ---------- 动态/详情里的图片：让"点开看大图"这件事看得出来 ---------- */
/* 这个能力一直都有（onclick=openImageViewer），但唯一的提示是光标变放大镜 +
   一个要等几秒才弹的 title —— PM 2026-09-24 直接当成"没这个功能"提了需求。
   所以补一个**悬停才显形**的角标：默认一点不占屏（全局 A17），
   鼠标一过去就明白这张图是能点的。不加任何常驻文字。 */
.adm-img-zoom {
  position: relative;
  cursor: zoom-in;
  border-radius: 8px;
  overflow: hidden;
}
.adm-img-zoom::after {
  content: "\2315";                 /* 放大镜 ⌕ —— 用字符不引图标字体 */
  position: absolute;
  right: 6px;
  bottom: 6px;
  width: 22px;
  height: 22px;
  line-height: 22px;
  text-align: center;
  font-size: 15px;
  border-radius: 50%;
  color: #fff;
  background: rgba(0, 0, 0, .55);
  opacity: 0;
  transition: opacity .15s;
  pointer-events: none;             /* 别挡住点击 */
}
.adm-img-zoom:hover::after { opacity: 1; }
.adm-img-zoom:hover img { filter: brightness(.92); }
