/* ============================================================
   单招CRM · 2027届演示模型 全局样式
   规范：全局 CSS 独立成 .css 文件，禁止内联 style 标签
   ============================================================ */

:root {
  --primary: #2e6be6;
  --primary-dark: #1e4fb5;
  --sidebar-bg: #1f2d3d;
  --sidebar-hover: #2a3b4f;
  --sidebar-active: #2e6be6;
  --success: #2fa66a;
  --warning: #e8a33d;
  --danger: #e05a4e;
  --info: #3ba3c9;
  --bg: #f2f4f8;
  --card: #ffffff;
  --border: #e4e8ef;
  --text: #2b3444;
  --text-sub: #7a8599;
  --male: #3b82d6;
  --female: #d66b9e;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

/* ---------- 布局骨架 ---------- */
.layout { display: flex; height: 100vh; height: 100dvh; }

.sidebar {
  width: 220px;
  background: var(--sidebar-bg);
  color: #cfd8e3;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.logo {
  height: 60px;
  display: flex;
  align-items: center;
  padding: 0 18px;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.08);
  letter-spacing: 1px;
}
.logo .logo-badge {
  width: 30px; height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), #6ea0ff);
  display: flex; align-items: center; justify-content: center;
  margin-right: 10px;
  font-size: 14px;
  color: #fff;
}
.logo .logo-sub { font-size: 11px; font-weight: 400; color: #8fa3bd; margin-left: 6px; }

.menu { flex: 1; padding: 10px 0; overflow-y: auto; }
.menu-group { padding: 12px 18px 6px; font-size: 11px; color: #6d7f96; letter-spacing: 1px; }
.menu-item {
  display: flex; align-items: center;
  padding: 11px 18px;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: background .15s;
  user-select: none;
}
.menu-item:hover { background: var(--sidebar-hover); }
.menu-item.active { background: var(--sidebar-active); border-left-color: #9cc0ff; color: #fff; }
.menu-item .mi-icon { width: 20px; margin-right: 10px; text-align: center; opacity: .85; font-size: 15px; }

.sidebar-foot {
  padding: 14px 18px;
  border-top: 1px solid rgba(255,255,255,.08);
  font-size: 12px; color: #8fa3bd;
  line-height: 1.9;
}

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.topbar {
  height: 60px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 24px;
  gap: 14px;
}
.topbar .crumb { font-size: 16px; font-weight: 600; }
.topbar .demo-tag {
  background: #fff4e0; color: #b47207;
  border: 1px solid #f2d9a8;
  font-size: 12px; padding: 3px 10px; border-radius: 20px;
}
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 18px; color: var(--text-sub); font-size: 13px; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
}

.content { flex: 1; overflow-y: auto; padding: 22px 24px; }
.page { display: none; }
.page.active { display: block; animation: fadein .25s ease; }
@keyframes fadein { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- 通用组件 ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 20px;
  margin-bottom: 18px;
}
.card-title { font-size: 15px; font-weight: 600; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.card-title::before { content: ""; width: 4px; height: 15px; background: var(--primary); border-radius: 2px; }
.card-title .ct-extra { margin-left: auto; font-size: 12px; color: var(--text-sub); font-weight: 400; }

.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

.kpi { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 16px 18px; position: relative; overflow: hidden; }
.kpi .k-label { color: var(--text-sub); font-size: 13px; }
.kpi .k-value { font-size: 30px; font-weight: 700; margin-top: 6px; }
.kpi .k-foot { margin-top: 6px; font-size: 12px; color: var(--text-sub); }
.kpi .k-foot b.up { color: var(--success); }
.kpi::after { content: ""; position: absolute; right: -20px; top: -20px; width: 80px; height: 80px; border-radius: 50%; opacity: .08; }
.kpi.k-blue::after { background: var(--primary); } .kpi.k-blue .k-value { color: var(--primary); }
.kpi.k-green::after { background: var(--success); } .kpi.k-green .k-value { color: var(--success); }
.kpi.k-orange::after { background: var(--warning); } .kpi.k-orange .k-value { color: var(--warning); }
.kpi.k-red::after { background: var(--danger); } .kpi.k-red .k-value { color: var(--danger); }

.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; white-space: nowrap; }
.bg-gray   { background: #eef1f6; color: #6d7a90; }
.bg-blue   { background: #e8f0fe; color: #2e6be6; }
.bg-orange { background: #fdf3e2; color: #c07c14; }
.bg-green  { background: #e6f6ee; color: #23915c; }
.bg-red    { background: #fdecea; color: #cf4436; }
.bg-purple { background: #f1ecfb; color: #7a4fd0; }
.bg-cyan   { background: #e6f6fa; color: #2490b5; }

table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; padding: 10px 12px; background: #f7f9fc; color: var(--text-sub); font-weight: 600; border-bottom: 1px solid var(--border); white-space: nowrap; }
.tbl td { padding: 10px 12px; border-bottom: 1px solid #f0f2f7; vertical-align: middle; }
.tbl tr:hover td { background: #fafbfe; }
.tbl .name-cell { font-weight: 600; white-space: nowrap; }
.tbl td.cell-act .btn { white-space: nowrap; }
.tbl .sub { color: var(--text-sub); font-size: 12px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  padding: 7px 16px; border-radius: 7px; border: 1px solid transparent;
  cursor: pointer; font-size: 13px; background: var(--primary); color: #fff;
  transition: all .15s; user-select: none;
  font-family: inherit; touch-action: manipulation;
}
.btn:hover { background: var(--primary-dark); }
.btn.btn-outline { background: #fff; color: var(--text); border-color: var(--border); }
.btn.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: #f6f9ff; }
.btn.btn-sm { padding: 4px 12px; font-size: 12px; }
.btn.btn-green { background: var(--success); } .btn.btn-green:hover { background: #268a58; }
.btn.btn-red { background: var(--danger); } .btn.btn-red:hover { background: #c7453a; }
.btn.btn-orange { background: var(--warning); } .btn.btn-orange:hover { background: #cf8e2a; }

.toolbar { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; align-items: center; }
.input, .select {
  padding: 7px 12px; border: 1px solid var(--border); border-radius: 7px;
  font-size: 13px; background: #fff; color: var(--text); outline: none; min-width: 150px;
  font-family: inherit;
}
.input:focus { border-color: var(--primary); }

/* ---------- 看板图表 ---------- */
.bar-wrap { display: flex; align-items: flex-end; gap: 14px; height: 160px; padding: 0 6px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bar-val { font-size: 12px; color: var(--text-sub); }
.bar { width: 60%; max-width: 42px; background: linear-gradient(180deg, #6ea0ff, var(--primary)); border-radius: 6px 6px 0 0; transition: height .6s ease; }
.bar.b2 { background: linear-gradient(180deg, #7dd8ab, var(--success)); }
.bar-x { font-size: 12px; color: var(--text-sub); }

.hbar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.hbar-label { width: 90px; font-size: 13px; color: var(--text-sub); text-align: right; flex-shrink: 0; }
.hbar-track { flex: 1; height: 14px; background: #eef1f6; border-radius: 8px; overflow: hidden; }
.hbar-fill { height: 100%; border-radius: 8px; background: linear-gradient(90deg, #6ea0ff, var(--primary)); }
.hbar-num { width: 52px; font-size: 13px; font-weight: 600; }

.todo-item { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px dashed #eef1f6; }
.todo-item:last-child { border-bottom: none; }
.todo-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.todo-txt { flex: 1; }
.todo-txt .t1 { font-size: 13px; }
.todo-txt .t2 { font-size: 12px; color: var(--text-sub); margin-top: 2px; }

/* ---------- 宿舍可视化 ---------- */
.dorm-head { display: flex; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.floor-block { margin-bottom: 22px; }
.floor-title { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.floor-tag { background: var(--sidebar-bg); color: #fff; padding: 3px 12px; border-radius: 6px; font-size: 12px; }
.floor-note { font-size: 12px; color: var(--text-sub); }
.rooms { display: flex; flex-wrap: wrap; gap: 12px; }
.room {
  border: 1px solid var(--border); border-radius: 10px; background: #fff;
  width: 240px; overflow: hidden;
}
.room-full { border-color: #cfe3d6; }
.room-head { padding: 8px 12px; background: #f7f9fc; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 8px; }
.room-no { font-weight: 700; font-size: 14px; }
.room-cap { margin-left: auto; font-size: 12px; color: var(--text-sub); }
.beds { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 10px; }
.bed {
  border-radius: 7px; padding: 7px 9px; font-size: 12px;
  border: 1px dashed var(--border); color: #a8b3c5; background: #fafbfd;
  cursor: pointer; transition: all .15s; min-height: 48px;
  display: flex; flex-direction: column; justify-content: center; gap: 2px;
}
.bed:hover { transform: translateY(-2px); box-shadow: 0 3px 10px rgba(46,107,230,.15); }
.bed.occupied { border: 1px solid transparent; color: #fff; }
.bed.occupied.male { background: linear-gradient(135deg, #5b93e8, #3b6fc9); }
.bed.occupied.female { background: linear-gradient(135deg, #e08cb2, #c25f92); }
.bed .b-name { font-weight: 600; font-size: 13px; }
.bed .b-meta { opacity: .85; font-size: 11px; }
.bed .b-empty-tag { text-align: center; }

/* ---------- 学生全景 ---------- */
.profile-head { display: flex; align-items: center; gap: 18px; }
.profile-avatar { width: 64px; height: 64px; border-radius: 14px; color: #fff; font-size: 22px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.profile-avatar.male { background: linear-gradient(135deg, #5b93e8, #3b6fc9); }
.profile-avatar.female { background: linear-gradient(135deg, #e08cb2, #c25f92); }
.profile-name { font-size: 20px; font-weight: 700; }
.profile-tags { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.info-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px 20px; margin-top: 16px; }
.info-item .i-label { font-size: 12px; color: var(--text-sub); }
.info-item .i-value { margin-top: 3px; font-size: 13px; font-weight: 500; }

.timeline { position: relative; padding-left: 24px; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: #e4e8ef; }
.tl-item { position: relative; padding-bottom: 18px; }
.tl-item::before { content: ""; position: absolute; left: -22px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 3px solid var(--primary); }
.tl-item.done::before { border-color: var(--success); background: var(--success); }
.tl-item.pending::before { border-color: var(--warning); }
.tl-title { font-weight: 600; font-size: 13px; }
.tl-desc { font-size: 12px; color: var(--text-sub); margin-top: 3px; line-height: 1.7; }

.score-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.score-sub { width: 120px; font-size: 13px; }
.score-track { flex: 1; height: 10px; background: #eef1f6; border-radius: 6px; overflow: hidden; }
.score-fill { height: 100%; border-radius: 6px; }
.score-num { width: 60px; font-weight: 700; font-size: 14px; text-align: right; }

/* ---------- 班级卡片 ---------- */
.class-card { border: 1px solid var(--border); border-radius: 10px; padding: 16px; background: #fff; }
.class-card .cc-head { display: flex; align-items: center; gap: 10px; }
.class-card .cc-name { font-weight: 700; font-size: 15px; }
.class-card .cc-stat { display: flex; gap: 18px; margin-top: 12px; }
.class-card .cc-stat .s { font-size: 12px; color: var(--text-sub); }
.class-card .cc-stat .s b { display: block; font-size: 20px; color: var(--text); margin-top: 2px; }

/* ---------- 弹层 ---------- */
.modal-mask { display: none; position: fixed; inset: 0; background: rgba(20,30,45,.45); z-index: 50; align-items: center; justify-content: center; padding: 20px; }
.modal-mask.show { display: flex; }
.modal { background: #fff; border-radius: 12px; width: 640px; max-width: 92vw; max-height: 84vh; overflow-y: auto; }
.modal-head { padding: 16px 22px; border-bottom: 1px solid var(--border); font-weight: 700; font-size: 15px; display: flex; align-items: center; }
.modal-close { margin-left: auto; cursor: pointer; color: var(--text-sub); font-size: 18px; user-select: none; }
.modal-body { padding: 20px 22px; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.form-item .f-label { font-size: 12px; color: var(--text-sub); margin-bottom: 5px; }
.form-item .input, .form-item .select { width: 100%; }

/* 进度条（缴费） */
.pay-track { height: 8px; background: #eef1f6; border-radius: 6px; overflow: hidden; min-width: 90px; flex: 1; }
.pay-fill { height: 100%; background: var(--success); border-radius: 6px; }

/* toast */
#toast { position: fixed; top: 74px; left: 50%; transform: translateX(-50%); background: rgba(30,40,55,.92); color: #fff; padding: 10px 22px; border-radius: 8px; font-size: 13px; z-index: 99; opacity: 0; pointer-events: none; transition: opacity .25s; }
#toast.show { opacity: 1; }

.empty-tip { text-align: center; color: var(--text-sub); padding: 30px 0; font-size: 13px; }

/* ============================================================
   往届回顾（2026 届真实数据）
   ============================================================ */
.kpi.k-purple::after { background: #7a4fd0; }
.kpi.k-purple .k-value { color: #7a4fd0; }
.kpi.k-cyan::after { background: var(--info); }
.kpi.k-cyan .k-value { color: var(--info); }
.kpi .k-value .kv-unit { font-size: 15px; font-weight: 600; margin-left: 3px; }

/* 届别标识条 */
.year-switch {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: linear-gradient(96deg, #1f2d3d, #2e4a75);
  border-radius: 10px; padding: 13px 18px; margin-bottom: 18px; color: #dbe6f5;
}
.year-switch .ys-tag {
  background: #e3b65c; color: #1f2d3d; font-weight: 700;
  font-size: 13px; padding: 4px 12px; border-radius: 6px; white-space: nowrap;
}
.year-switch .ys-title { font-size: 15px; font-weight: 600; color: #fff; }
.year-switch .ys-note { margin-left: auto; font-size: 12px; color: #9fb4d0; text-align: right; line-height: 1.6; }

/* 条形图配色变体 */
.hbar-fill.f-blue   { background: linear-gradient(90deg, #6ea0ff, var(--primary)); }
.hbar-fill.f-green  { background: linear-gradient(90deg, #7dd8ab, var(--success)); }
.hbar-fill.f-orange { background: linear-gradient(90deg, #f4c477, var(--warning)); }
.hbar-fill.f-purple { background: linear-gradient(90deg, #b39bea, #7a4fd0); }
.hbar-fill.f-cyan   { background: linear-gradient(90deg, #7fd0e6, #2490b5); }
.hbar-fill.f-red    { background: linear-gradient(90deg, #f0918a, var(--danger)); }
.hbar-num.wide { width: 96px; }
.hbar-label.wide { width: 148px; line-height: 1.35; }

/* 团队业绩行 */
.team-row { display: flex; align-items: center; gap: 12px; margin-bottom: 13px; }
.team-row .tm-name { width: 92px; flex-shrink: 0; font-size: 13px; font-weight: 600; text-align: right; }
.team-row .tm-bar { flex: 1; min-width: 0; }
.team-row .tm-top { display: flex; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.team-row .tm-cnt { font-size: 13px; font-weight: 700; }
.team-row .tm-sub { font-size: 11px; color: var(--text-sub); }
.team-row .tm-rate { width: 74px; flex-shrink: 0; text-align: right; }
.team-row .tm-rate b { font-size: 14px; }
.team-row .tm-rate span { display: block; font-size: 11px; color: var(--text-sub); }
.rate-good b { color: var(--success); }
.rate-mid  b { color: var(--primary); }
.rate-low  b { color: var(--warning); }

/* 数据质量清单 */
.q-list { display: flex; flex-direction: column; gap: 9px; }
.q-row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.q-row .q-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; background: var(--warning); }
.q-row .q-txt { flex: 1; }
.q-row .q-num { font-weight: 700; color: var(--warning); }
.q-row.ok .q-dot { background: var(--success); }
.q-row.ok .q-num { color: var(--success); }
.q-note { font-size: 12px; color: var(--text-sub); line-height: 1.7; margin-top: 12px; }

/* 退费金额列 */
.refund-sum { display: flex; gap: 22px; flex-wrap: wrap; margin-bottom: 14px; }
.refund-sum .rs { font-size: 12px; color: var(--text-sub); }
.refund-sum .rs b { display: block; font-size: 20px; color: var(--danger); margin-top: 2px; }
.refund-sum .rs.green b { color: var(--success); }
.refund-sum .rs.blue b { color: var(--primary); }

/* ============================================================
   新增报名 · 粘贴自动填充
   ============================================================ */
.modal.modal-lg { width: 860px; }
.paste-box {
  border: 1px solid #d6e2f7; background: #f7faff;
  border-radius: 10px; padding: 14px 16px; margin-bottom: 18px;
}
.paste-box.filled { border-color: #a9dcbe; background: #f5fcf8; }
.paste-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.paste-title { font-size: 13px; font-weight: 700; color: var(--primary-dark); }
.paste-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.paste-area {
  width: 100%; min-height: 132px; resize: vertical;
  border: 1px solid var(--border); border-radius: 8px;
  padding: 11px 13px; font-size: 12.5px; line-height: 1.75;
  font-family: "Consolas", "Microsoft YaHei", monospace;
  color: var(--text); background: #fff; outline: none;
}
.paste-area:focus { border-color: var(--primary); }
.paste-tip { margin-top: 9px; font-size: 12px; color: var(--text-sub); line-height: 1.7; }
.paste-tip b { color: var(--success); }
.paste-tip.warn b { color: var(--danger); }

/* 分段小标题（表单内） */
.form-sec {
  grid-column: 1 / -1; display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 700; color: var(--primary-dark);
  margin-top: 4px; padding-bottom: 7px; border-bottom: 1px dashed var(--border);
}
.form-sec .fs-tip { margin-left: auto; font-size: 12px; font-weight: 400; color: var(--text-sub); }
.form-grid-3 { grid-template-columns: repeat(3, 1fr); }
.form-span-all { grid-column: 1 / -1; }
.f-label .req { color: var(--danger); margin-left: 2px; }
.form-item .input[readonly] { background: #f5f7fb; color: var(--text-sub); }
.sum-value { font-size: 17px; font-weight: 700; color: var(--primary); padding-top: 6px; }

/* ============================================================
   工具类（供结构层复用，替代内联 style）
   ============================================================ */
.ml-auto { margin-left: auto; }
.mt8  { margin-top: 8px; }
.mt10 { margin-top: 10px; }
.mt14 { margin-top: 14px; }
.mt16 { margin-top: 16px; }
.mt18 { margin-top: 18px; }
.mb18 { margin-bottom: 18px; }
.pt6  { padding-top: 6px; }
.nowrap { white-space: nowrap; }

.input-wide  { min-width: 260px; }
.select-wide { min-width: 220px; }

.count-tip { margin-left: auto; color: var(--text-sub); font-size: 12px; }
.hint-text { color: var(--text-sub); font-size: 12px; }
.todo-arrow { color: var(--text-sub); }
.todo-item.clickable { cursor: pointer; }
.refund-amt { color: var(--danger); font-weight: 600; }
.class-meta { margin-top: 8px; font-size: 12px; color: var(--text-sub); }
.cc-stat .s b.c-male { color: var(--male); }
.cc-stat .s b.c-female { color: var(--female); }
.building-title { margin-bottom: 8px; font-weight: 700; font-size: 15px; }

/* 宿舍图例 */
.legend-male   { background: #e8f0fe; color: #2e6be6; }
.legend-female { background: #fdeef4; color: #c25f92; }
.dorm-stat { margin-left: auto; font-size: 12px; color: var(--text-sub); }

/* 学生全景补充 */
.score-foot { font-size: 12px; color: var(--text-sub); margin-top: 4px; }
.info-grid-2 { grid-template-columns: 1fr 1fr; }

/* 床位弹层 */
.bed-modal-head { display: flex; gap: 14px; align-items: center; }
.avatar-sm { width: 52px; height: 52px; font-size: 18px; }
.bm-name-row { font-weight: 700; font-size: 16px; }
.bm-meta { font-size: 12px; color: var(--text-sub); margin-top: 4px; }
.row-actions { margin-top: 16px; display: flex; gap: 10px; }
.bed-empty-box { text-align: center; padding: 10px 0; }
.bed-empty-icon { font-size: 38px; color: var(--border); }
.bed-empty-title { margin-top: 8px; font-weight: 600; }
.bed-empty-desc { font-size: 12px; color: var(--text-sub); margin: 6px 0 16px; }

/* ---------- 移动端侧栏抽屉（按钮 + 遮罩） ---------- */
.menu-toggle {
  display: none;
  background: none; border: none; cursor: pointer;
  font-size: 20px; line-height: 1; color: var(--text);
  padding: 6px 8px; border-radius: 8px; font-family: inherit;
}
.menu-toggle:active { background: #eef1f6; }
.drawer-close { display: none; }
.drawer-mask { display: none; position: fixed; inset: 0; background: rgba(20,30,45,.45); z-index: 55; }
.drawer-mask.show { display: block; }

/* ============================================================
   响应式 · 平板（≤1024px）
   ============================================================ */
@media (max-width: 1024px) {
  .sidebar { width: 186px; }
  .content { padding: 18px; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .info-grid { grid-template-columns: repeat(3, 1fr); }
  .room { width: 220px; }
  .modal.modal-lg { width: 92vw; }
  .form-grid-3 { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   响应式 · 手机（≤768px）
   ============================================================ */
@media (max-width: 768px) {
  html, body { -webkit-text-size-adjust: 100%; }

  /* —— 侧栏改为抽屉，主区占满 —— */
  .layout { display: block; }
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0;
    width: 252px; z-index: 60;
    transform: translateX(-100%);
    transition: transform .26s ease;
    box-shadow: 0 0 26px rgba(0,0,0,.28);
  }
  .sidebar.open { transform: none; }
  .drawer-close { display: inline-block; margin-left: auto; font-size: 16px; color: #8fa3bd; padding: 2px 4px; cursor: pointer; }
  .menu-item { padding: 13px 18px; font-size: 15px; }
  .menu-item .mi-icon { font-size: 16px; }
  .menu-group { padding: 14px 18px 6px; }
  .main { height: 100%; }

  /* —— 顶栏 —— */
  .menu-toggle { display: inline-flex; align-items: center; }
  .topbar { height: 54px; padding: 0 12px; gap: 8px; }
  .topbar .crumb { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .demo-tag { font-size: 11px; padding: 2px 8px; white-space: nowrap; }
  .tb-date, .tb-user { display: none; }
  .topbar-right { gap: 0; }
  .avatar { width: 30px; height: 30px; font-size: 12px; }

  .content { padding: 12px 12px calc(12px + env(safe-area-inset-bottom)); }

  /* —— 栅格折叠 —— */
  .grid { gap: 12px; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }

  .card { padding: 14px; border-radius: 12px; margin-bottom: 12px; }
  .card-title { font-size: 14px; margin-bottom: 12px; }
  .card-title .ct-extra { font-size: 11px; }

  .kpi { padding: 13px 14px; border-radius: 12px; }
  .kpi .k-label { font-size: 12px; }
  .kpi .k-value { font-size: 24px; margin-top: 4px; }
  .kpi .k-foot { font-size: 11px; }

  /* —— 表格 → 卡片列表 —— */
  .tbl thead { display: none; }
  .tbl, .tbl tbody, .tbl tr, .tbl td { display: block; width: 100%; }
  .tbl tr {
    border: 1px solid var(--border); border-radius: 10px;
    padding: 12px 14px; margin-bottom: 10px; background: #fff;
  }
  .tbl tr:hover td { background: transparent; }
  .tbl td {
    border: none; padding: 3px 0; font-size: 13px;
    display: flex; align-items: baseline; gap: 10px;
  }
  .tbl td::before {
    content: attr(data-label);
    flex: 0 0 76px; color: var(--text-sub); font-size: 12px;
  }
  .tbl td.no-label::before { display: none; }
  .tbl td.cell-name { font-size: 15px; font-weight: 700; padding-bottom: 8px; }
  .tbl td.cell-act { padding-top: 10px; }
  .tbl td.cell-act .btn { flex: 1; }
  .tbl .hide-sm { display: none; }
  .tbl .sub { font-size: 12.5px; word-break: break-all; }

  /* —— 工具栏 / 表单控件 —— */
  .toolbar { gap: 8px; }
  .input, .select, .input-wide, .select-wide { min-width: 0; width: 100%; }
  .toolbar .btn { width: 100%; }
  .count-tip { margin-left: 0; width: 100%; text-align: right; }
  .hint-text { display: block; width: 100%; line-height: 1.7; }

  /* —— 看板图表 —— */
  .bar-wrap { height: 132px; gap: 8px; padding: 0; }
  .bar-val, .bar-x { font-size: 11px; }
  .hbar-row { gap: 8px; }
  .hbar-label { width: 74px; font-size: 12px; }
  .hbar-num { width: 46px; font-size: 12px; }
  .score-sub { width: 84px; font-size: 12px; }
  .score-row { gap: 8px; }
  .score-num { width: 50px; font-size: 13px; }

  /* —— 宿舍可视化 —— */
  .dorm-head { gap: 8px; margin-bottom: 12px; }
  .dorm-stat { width: 100%; margin-left: 0; }
  .rooms { gap: 10px; }
  .room { width: 100%; }
  .beds { gap: 8px; padding: 10px; }
  .bed { min-height: 54px; padding: 8px 10px; font-size: 12.5px; }
  .bed:hover { transform: none; box-shadow: none; }
  .floor-block { margin-bottom: 18px; }

  /* —— 学生全景 —— */
  .profile-head { gap: 12px; }
  .profile-avatar { width: 54px; height: 54px; font-size: 19px; border-radius: 12px; }
  .profile-name { font-size: 18px; }
  .profile-tags { gap: 6px; margin-top: 6px; }
  .info-grid, .info-grid-2 { grid-template-columns: repeat(2, 1fr); gap: 10px 14px; }
  .timeline { padding-left: 20px; }
  .tl-item::before { left: -20px; }

  /* —— 班级卡片 —— */
  .class-card .cc-stat { gap: 14px; flex-wrap: wrap; }

  /* —— 弹层：底部抽屉式 —— */
  .modal-mask { padding: 14px; align-items: flex-end; }
  .modal, .modal.modal-sm { width: 100%; max-width: 100%; max-height: 88vh; border-radius: 14px; }
  .modal-head { padding: 14px 18px; }
  .modal-body { padding: 16px 18px; }
  .modal-foot { padding: 12px 18px; }
  .modal-foot .btn { flex: 1; }
  .form-grid { grid-template-columns: 1fr; gap: 12px; }
  .form-grid-3 { grid-template-columns: 1fr; }
  .row-actions { flex-direction: column; }
  .row-actions .btn { width: 100%; }

  /* —— 往届回顾 —— */
  .year-switch { padding: 11px 13px; gap: 8px; border-radius: 12px; }
  .year-switch .ys-title { font-size: 14px; }
  .year-switch .ys-note { margin-left: 0; width: 100%; text-align: left; font-size: 11px; }
  .team-row { gap: 8px; margin-bottom: 11px; }
  .team-row .tm-name { width: 62px; font-size: 12px; }
  .team-row .tm-rate { width: 64px; }
  .team-row .tm-rate b { font-size: 13px; }
  .hbar-num.wide { width: 78px; font-size: 12px; }
  .hbar-label.wide { width: 96px; }
  .refund-sum { gap: 14px; }
  .refund-sum .rs b { font-size: 17px; }

  /* —— 粘贴自动填充 —— */
  .paste-box { padding: 12px; border-radius: 12px; }
  .paste-title { font-size: 12.5px; width: 100%; }
  .paste-actions { margin-left: 0; width: 100%; }
  .paste-actions .btn { flex: 1; }
  .paste-area { min-height: 118px; font-size: 12px; }
  .sum-value { font-size: 15px; padding-top: 4px; }

  #toast { top: 62px; max-width: 88vw; text-align: center; }
}

/* ============================================================
   响应式 · 小屏手机（≤380px）
   ============================================================ */
@media (max-width: 380px) {
  .kpi .k-value { font-size: 21px; }
  .tbl td::before { flex-basis: 68px; }
  .hbar-label { width: 64px; }
  .demo-tag { font-size: 10px; padding: 2px 6px; }
}

/* 横屏矮屏（手机横放）——压缩纵向留白 */
@media (max-height: 480px) and (orientation: landscape) {
  .topbar { height: 46px; }
  .bar-wrap { height: 104px; }
}
