/* ============================================
   新芮智能排课系统 Web 版
   全局样式 - 响应式 / 专业教务风格
   ============================================ */

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #eff6ff;
  --success: #16a34a;
  --warning: #f59e0b;
  --danger: #dc2626;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --radius: 8px;
  --shadow-sm: 0 1px 2px 0 rgba(0,0,0,.05);
  --shadow: 0 1px 3px 0 rgba(0,0,0,.1), 0 1px 2px -1px rgba(0,0,0,.1);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -2px rgba(0,0,0,.1);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  background: var(--gray-50);
  color: var(--gray-800);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  max-width: 100%;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

/* ---------- 布局 ---------- */
.app {
  display: flex;
  min-height: 100vh;
  min-width: 0;
}

.sidebar {
  width: 220px;
  background: #1e293b;
  color: #e2e8f0;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform .25s ease;
}

.sidebar .brand {
  padding: 18px 20px;
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  border-bottom: 1px solid #334155;
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar .brand .logo {
  width: 32px; height: 32px;
  background: var(--primary);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: #fff; font-weight: 700;
}

.sidebar nav { flex: 1; overflow-y: auto; padding: 10px 0; }

.sidebar .nav-group {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px 8px;
  margin-top: 6px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .04em;
  font-weight: 700;
  color: #ffffff;
  background: #0d1b2e;
  border-top: 1px solid #334155;
  border-left: 3px solid var(--primary);
  cursor: pointer;
  user-select: none;
  transition: background .15s, color .15s;
}
.sidebar .nav-group:hover { background: #1a2f4a; color: #fff; }
.sidebar .nav-arrow {
  font-size: 14px;
  color: #cbd5e1;
  font-weight: 400;
  line-height: 1;
  transition: transform .25s ease, color .15s;
}
.sidebar .nav-group:hover .nav-arrow { color: #fff; }

.sidebar nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 20px;
  color: #94a3b8;
  font-size: 14px;
  border-left: 3px solid transparent;
  transition: all .15s;
}
.sidebar nav a:hover { background: #334155; color: #f1f5f9; }
.sidebar nav a.active {
  background: var(--primary);
  color: #ffffff;
  font-weight: 600;
  border-left-color: #ffffff;
}

.main {
  flex: 1;
  margin-left: 220px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
}

.topbar {
  height: 60px;
  background: #fff;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar .menu-toggle {
  display: none;
  background: none; border: none;
  font-size: 22px; cursor: pointer; color: var(--gray-700);
}

.topbar .page-title { font-size: 17px; font-weight: 600; flex-shrink: 0; }

.topbar .spacer { flex: 1; }

.topbar #user-name,
.topbar #pay-status,
.topbar .btn { white-space: nowrap; flex-shrink: 0; }

.content {
  padding: 24px;
  flex: 1;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  min-width: 0;
}

/* ---------- 卡片 ---------- */
.card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
  min-width: 0;
  max-width: 100%;
}
.card-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--gray-200);
  font-weight: 600;
  font-size: 15px;
  display: flex; align-items: center; gap: 10px;
}
.card-body { padding: 20px; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 16px;
  border-radius: 6px;
  border: 1px solid var(--gray-300);
  background: #fff;
  color: var(--gray-700);
  font-size: 14px;
  cursor: pointer;
  transition: all .15s;
  font-family: inherit;
  white-space: nowrap;
}
.btn:hover { background: var(--gray-100); border-color: var(--gray-400); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-success { background: var(--success); border-color: var(--success); color: #fff; }
.btn-success:hover { background: #15803d; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-warning { background: var(--warning); border-color: var(--warning); color: #fff; }
.btn-warning:hover { background: #d97706; }
.btn-sm { padding: 5px 10px; font-size: 13px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }
.btn-block { width: 100%; }

/* ---------- 表单 ---------- */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-700);
}
.form-control {
  width: 100%;
  padding: 9px 6px;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
  background: #fff;
}
.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
.form-control.error { border-color: var(--danger); }
.form-row { display: flex; gap: 12px; flex-wrap: wrap; }
.form-row .form-group { flex: 1; min-width: 160px; }
.form-hint { font-size: 12px; color: var(--gray-500); margin-top: 4px; padding: 12px 16px;}

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; }
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.table th, .table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--gray-200);
  text-align: left;
  white-space: nowrap;
}
.table th {
  background: var(--gray-50);
  font-weight: 600;
  color: var(--gray-600);
  font-size: 13px;
}
.table tr:hover td { background: var(--gray-50); }

/* ---------- 排课表格 ---------- */
.schedule-grid {
  display: grid;
  gap: 1px;
  background: var(--gray-200);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  overflow: hidden;
}
.schedule-grid .sch-head, .schedule-grid .sch-cell {
  background: #fff;
  padding: 8px 10px;
  text-align: center;
}
.schedule-grid .sch-head {
  background: var(--gray-50);
  font-weight: 600;
  color: var(--gray-600);
}
.schedule-grid .sch-cell { min-height: 56px; cursor: pointer; position: relative; transition: background .15s, box-shadow .15s, transform .1s; }
.schedule-grid .sch-cell:hover { background: var(--primary-light); }
.schedule-grid .course-name { font-weight: 600; color: var(--gray-800); }
.schedule-grid .teacher-name { font-size: 12px; color: var(--gray-500); }
.schedule-grid .sch-cell.empty { background: var(--gray-50); color: var(--gray-300); }
/* 单双周同段多门课: 子格堆叠显示 */
.schedule-grid .sub-cell { padding: 1px 0; border-bottom: 1px dashed #e2e8f0; }
.schedule-grid .sub-cell:last-child { border-bottom: none; }
.schedule-grid .week-tag { display:inline-block; margin-left:3px; padding:0 4px; border-radius:3px; font-size:11px; font-weight:700; vertical-align:1px; }
.schedule-grid .week-tag.wk-single { background:#dcfce7; color:#15803d; }
.schedule-grid .week-tag.wk-double { background:#e0f2fe; color:#0369a1; }

/* 手动调课: 选中后可调整(绿)/冲突不可调(红)/禁排不可调(橙红) */
/* 优先级: 冲突红 > 可排绿 > 禁排提示; 因此冲突红(not-adjustable)定义在最后以覆盖禁排色 */
.schedule-grid .sch-cell.adjustable { background: #dcfce7 !important; box-shadow: inset 0 0 0 1px #16a34a; }
/* 禁排节次: 橙红背景 + 橙色斜条纹, 与冲突红区分 (仅作提示, 优先级最低) */
.schedule-grid .sch-cell.forbidden-slot {
  background: repeating-linear-gradient(45deg, #fed7aa 0px, #fed7aa 6px, #ffedd5 6px, #ffedd5 12px) !important;
  box-shadow: inset 0 0 0 1px #ea580c;
}
.schedule-grid .sch-cell.not-adjustable { background: #fee2e2 !important; box-shadow: inset 0 0 0 1px #dc2626; }
/* 选中节次: 陷下去(按下)效果, 覆盖红色背景使其显示为选中态 */
.schedule-grid .sch-cell.selected {
  background: #bfdbfe !important;
  box-shadow: inset 0 3px 6px rgba(0,0,0,.35), inset 0 0 0 2px var(--primary);
  transform: translateY(2px);
}

/* 鼠标指向某节次: 同科目黄色高亮, 同教师加边框 */
.schedule-grid .sch-cell.hover-course { background: #fef08a !important; box-shadow: inset 0 0 0 1px #ca8a04; }
.schedule-grid .sch-cell.hover-teacher { box-shadow: inset 0 0 0 2px #2563eb; }
/* 班级禁排节次: 始终灰色禁用, 不可点击, 最高优先级覆盖其他标记 */
/* 保留清晰的节次边框线(内阴影边框), 避免与网格线同色导致边框消失 */
.schedule-grid .sch-cell.class-forbidden {
  background: #eef0f2 !important;
  box-shadow: inset 0 0 0 1px #cbd5e1 !important;
  cursor: not-allowed !important;
  transform: none !important;
  opacity: 1;
}
.schedule-grid .sch-cell.class-forbidden:hover { background: #e2e8f0 !important; box-shadow: inset 0 0 0 1px #cbd5e1 !important; }
.schedule-grid .sch-cell.class-forbidden .course-name { color: #9ca3af !important; }
.schedule-grid .sch-cell.class-forbidden .teacher-name { color: #b6beca !important; }
.schedule-grid .sch-cell.class-forbidden:hover { background: #e5e7eb !important; }
.schedule-grid .sch-cell.class-forbidden .course-name { color: #9ca3af !important; }
.schedule-grid .sch-cell.class-forbidden .teacher-name { color: #d1d5db !important; }

/* 合班课标记 */
.schedule-grid .sch-cell.merged { border-top: 3px solid var(--warning); }

/* ---------- 临时调课 / 代课 ---------- */
/* 可选择的节次格子(新建代课) */
.schedule-grid .sch-cell.tmp-pick { cursor: pointer; background: #f8fafc; }
.schedule-grid .sch-cell.tmp-pick:hover { background: #dbeafe; box-shadow: inset 0 0 0 2px #2563eb; }
.schedule-grid .sch-cell.tmp-pick.selected { background: #bfdbfe !important; box-shadow: inset 0 0 0 2px #2563eb; }
/* 临时课表中已被代课的节次: 橙色高亮 */
.schedule-grid .sch-cell.temp-sub {
  background: #fff7ed !important;
  box-shadow: inset 0 0 0 2px #f97316;
}
.schedule-grid .sch-cell.temp-sub:hover { background: #ffedd5 !important; }
.schedule-grid .sch-cell.temp-sub .course-name { color: #9a3412; }
.schedule-grid .sch-cell.temp-sub .teacher-name { color: #c2410c; }
.schedule-grid .temp-sub-flag {
  margin-top: 3px; display: inline-block; font-size: 11px; color: #fff;
  background: #f97316; padding: 1px 6px; border-radius: 4px; font-weight: 600;
}
.form-row { display: flex; gap: 14px; flex-wrap: wrap; }
.form-row .form-group { flex: 1; min-width: 180px; }

/* ---------- 排课限制网格 (VB式点击) ---------- */
.restrict-grid {
  width: 100%; border-collapse: collapse;
  table-layout: fixed; /* 列平均分布 + 自动调整 */
}
.restrict-grid th, .restrict-grid td { border: 1px solid var(--gray-200); text-align: center; padding: 4px; }
.restrict-grid .rs-corner {
  background: var(--gray-50); font-size: 12px; color: var(--gray-400);
  width: 64px; white-space: nowrap;
}
.restrict-grid .rs-day, .restrict-grid .rs-period {
  background: var(--gray-50); font-weight: 600; color: var(--gray-600); cursor: pointer;
  user-select: none; font-size: 13px; white-space: nowrap;
}
.restrict-grid .rs-day:hover, .restrict-grid .rs-period:hover { background: #e5e7eb; }
.restrict-grid .rs-cell {
  height: 34px; cursor: pointer; background: #fff; transition: background .15s;
}
.restrict-grid .rs-cell:hover { background: #f1f5f9; }
.restrict-grid .rs-cell.on {
  background: #fee2e2; position: relative;
}
.restrict-grid .rs-cell.on::after {
  content: '禁'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: #dc2626; font-size: 13px; font-weight: 600;
}
.rs-name { font-size: 16px; font-weight: 700; color: var(--gray-900); margin-right: 10px; }
.rs-pos { vertical-align: middle; }
.rs-tip { font-size: 12px; color: var(--gray-400); margin-bottom: 10px; }

/* ---------- 标签 ---------- */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
}
.badge-success { background: #dcfce7; color: #15803d; }
.badge-warning { background: #fef3c7; color: #b45309; }
.badge-danger { background: #fee2e2; color: #b91c1c; }
.badge-primary { background: #dbeafe; color: #1d4ed8; }
.badge-gray { background: var(--gray-100); color: var(--gray-600); }

/* ---------- 顶部学校名 ---------- */
.school-name {
  display: none;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-50, #eff6ff);
  padding: 3px 10px;
  border-radius: 999px;
  margin-right: 6px;
}

/* ---------- 文本工具类 ---------- */
.muted { color: var(--gray-500); font-size: 13px; }
.text-success { color: #15803d; }
.text-danger { color: #b91c1c; }

/* ---------- 进度条 ---------- */
.progress {
  height: 8px;
  background: var(--gray-100);
  border-radius: 999px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  background: var(--success);
  border-radius: 999px;
  transition: width .3s;
}
.progress-bar.warning { background: var(--warning); }
.progress-bar.danger { background: var(--danger); }

/* ---------- 模态框 ---------- */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.5);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-mask.show { display: flex; }
.modal {
  background: #fff;
  border-radius: 12px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-200);
  font-weight: 600;
  font-size: 16px;
  display: flex; align-items: center; justify-content: space-between;
}
.modal-header .close { background: none; border: none; font-size: 22px; cursor: pointer; color: var(--gray-400); }
.modal-header .close:hover { color: var(--gray-700); }
.modal-body { padding: 20px; }
.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--gray-200);
  display: flex; justify-content: flex-end; gap: 10px;
}

/* ---------- 提示 ---------- */
.toast-wrap {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  background: #fff;
  border-left: 4px solid var(--primary);
  box-shadow: var(--shadow-md);
  border-radius: 6px;
  padding: 12px 16px;
  min-width: 240px;
  animation: slideIn .3s ease;
}
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }
@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ---------- 登录页 ---------- */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #3b82f6 100%);
  padding: 20px;
}
.auth-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0,0,0,.2);
  width: 100%;
  max-width: 420px;
  padding: 36px;
}
.auth-card .brand {
  text-align: center;
  margin-bottom: 28px;
}
.auth-card .brand .logo {
  width: 56px; height: 56px;
  background: var(--primary);
  border-radius: 14px;
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 26px; font-weight: 700;
  margin-bottom: 12px;
}
.auth-card .brand h1 { font-size: 22px; color: var(--gray-900); }
.auth-card .brand p { color: var(--gray-500); font-size: 13px; margin-top: 4px; }
.auth-tabs { display: flex; margin-bottom: 24px; border-bottom: 1px solid var(--gray-200); }
.auth-tabs button {
  flex: 1;
  background: none; border: none;
  padding: 10px;
  font-size: 14px;
  cursor: pointer;
  color: var(--gray-500);
  border-bottom: 2px solid transparent;
  font-family: inherit;
}
.auth-tabs button.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.auth-divider {
  text-align: center;
  color: var(--gray-400);
  font-size: 12px;
  margin: 20px 0;
  display: flex; align-items: center; gap: 12px;
}
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--gray-200); }
.wechat-btn {
  width: 100%;
  padding: 10px;
  margin-bottom: 10px;
  background: #07c160;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-family: inherit;
}
.wechat-btn:hover { background: #06ad56; }

/* 微信登录突出区 (登录页上方) */
.wx-login-block {
  background: linear-gradient(135deg, #e8faf0 0%, #f2fcf6 100%);
  border: 1px solid #b7ebc9;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 18px;
}
.wx-login-title {
  text-align: center;
  color: #07c160;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 12px;
}
.wechat-btn-lg {
  padding: 13px;
  font-size: 15px;
  border-radius: 8px;
}

/* ---------- 微信扫码登录弹层 ---------- */
.qr-modal-mask {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(15, 23, 42, .5);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.qr-modal {
  background: #fff; border-radius: 16px; width: 100%; max-width: 360px;
  overflow: hidden; box-shadow: 0 24px 60px rgba(0,0,0,.25);
  animation: qrIn .22s ease;
}
@keyframes qrIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.qr-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--gray-100);
  font-size: 16px; font-weight: 600; color: var(--gray-900);
}
.qr-modal-header .close { background: none; border: none; font-size: 22px; color: var(--gray-400); cursor: pointer; line-height: 1; }
.qr-modal-header .close:hover { color: var(--gray-700); }
.qr-modal-body { padding: 28px 20px; text-align: center; }
.qr-box {
  width: 200px; height: 200px; margin: 0 auto 16px;
  border: 1px solid var(--gray-200); border-radius: 10px;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.qr-box img { width: 100%; height: 100%; }
.qr-tip-main { font-size: 15px; color: var(--gray-800); font-weight: 500; margin-bottom: 4px; }
.qr-tip-main.success { color: var(--success, #16a34a); }
.qr-tip-main.error { color: #dc2626; }
.qr-tip-sub { font-size: 12px; color: var(--gray-400); margin-bottom: 14px; }
.qr-refresh { display: inline-block; }
.qr-modal-foot {
  display: flex; align-items: center; justify-content: center; gap: 32px;
  padding: 12px 20px; border-top: 1px solid var(--gray-100);
  font-size: 12px; color: var(--gray-400);
}
.wx-icon { display: inline-flex; }

/* ---------- "另一个"选择弹窗 (参考"复制到"样式, 限制宽高防溢出) ---------- */
.another-modal { max-width: 420px; max-height: 70vh; overflow: hidden; display: flex; flex-direction: column; }
.another-modal .modal-header { flex-shrink: 0; }
.another-modal .modal-body {
  padding: 16px 20px; min-height: 0;
  display: flex; flex-direction: column; flex: 1;
}
.another-search { margin-bottom: 12px; flex-shrink: 0; }
.another-list {
  flex: 1; min-height: 0;
  max-height: 380px; overflow-y: auto; overflow-x: hidden;
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px;
  padding: 2px; /* 给滚动条留出空间 */
}
.another-item {
  display: block; width: 100%; min-width: 0; text-align: left;
  border: 1px solid var(--gray-200); background: #fff; border-radius: 8px;
  padding: 9px 12px; font-size: 14px; color: var(--gray-800); cursor: pointer;
  transition: all .15s;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  word-break: break-all;
}
.another-item:hover { border-color: var(--primary); background: var(--primary-50, #eff6ff); }
.another-item.active { border-color: var(--primary); background: var(--primary-50, #eff6ff); color: var(--primary); font-weight: 600; }

/* ---------- "打印其他" 多选弹窗 (下拉多选, 参考"复制到") ---------- */
.print-other-select { width: 100%; height: 300px; font-size: 14px; }
.print-other-count {
  flex: 1; text-align: left; align-self: center;
  font-size: 13px; color: var(--gray-500);
}

/* ---------- 冲突提示 ---------- */
.conflict-banner {
  background: #fef2f2; border: 1px solid #fecaca; border-left: 4px solid #dc2626;
  color: #991b1b; border-radius: 8px; padding: 12px 16px; margin-bottom: 14px;
  font-size: 13px;
}
.conflict-banner ul { margin: 6px 0 0 20px; padding: 0; }
.conflict-banner li { line-height: 1.7; }
.sch-cell.conflict {
  background: #fee2e2 !important; border-color: #f87171 !important;
}
.sch-cell .conflict-flag {
  margin-top: 4px; font-size: 11px; color: #fff; background: #dc2626;
  display: inline-block; padding: 1px 6px; border-radius: 4px; font-weight: 600;
}

/* ---------- 付费套餐 ---------- */
.plan-grid {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px;
  margin-bottom: 18px;
}
.plan-card {
  position: relative; text-align: center; cursor: pointer;
  border: 1px solid var(--gray-200); border-radius: 12px; padding: 18px 12px;
  background: #fff; transition: all .2s;
}
.plan-card:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: 0 6px 16px rgba(15,23,42,.06); }
.plan-card.featured { border: 2px solid var(--primary); }
.plan-card.chosen { border: 2px solid var(--primary); background: #eff6ff; box-shadow: 0 6px 18px rgba(37,99,235,.15); }
.plan-hot {
  position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
  background: var(--primary); color: #fff; font-size: 11px; font-weight: 600;
  padding: 2px 10px; border-radius: 999px;
}
.plan-name { font-size: 14px; font-weight: 600; color: var(--gray-700); margin-bottom: 6px; }
.plan-price b { font-size: 22px; font-weight: 800; color: var(--ink); }
.plan-days { font-size: 12px; color: var(--gray-400); margin-top: 4px; }
.plan-save { display: inline-block; margin-top: 6px; font-size: 11px; color: #16a34a; font-weight: 600; }

@media (max-width: 900px) {
  .plan-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 560px) {
  .plan-grid { grid-template-columns: 1fr; }
}

/* ---------- 支付信息与收款引导 ---------- */
.pay-meta {
  display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 16px;
}
.pay-meta > div {
  flex: 1; min-width: 150px; background: #f8fafc; border: 1px solid var(--gray-200);
  border-radius: 8px; padding: 12px 14px; text-align: center;
}
.pay-meta span { display: block; font-size: 12px; color: var(--gray-400); margin-bottom: 4px; }
.pay-meta b { font-size: 15px; color: var(--gray-800); }
.pay-guide {
  text-align: center; border: 1px dashed #e2e8f0; border-radius: 12px;
  padding: 20px; background: #fafbfc;
}
.pay-step { font-size: 14px; color: var(--gray-700); margin-bottom: 8px; }
.pay-step span {
  display: inline-block; width: 20px; height: 20px; border-radius: 50%;
  background: var(--primary); color: #fff; font-size: 12px; line-height: 20px; margin-right: 6px;
}
.pay-qr-img img { width: 200px; height: 200px; border: 1px solid var(--gray-200); border-radius: 10px; margin: 12px auto; }
.pay-order { font-size: 13px; color: var(--gray-500); margin-top: 8px; }
.pay-wait { margin-top: 8px; font-size: 13px; color: #b45309; font-weight: 600; }

/* ---------- 分页条 ---------- */
.pager {
  display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
  padding: 12px 16px; border-top: 1px solid var(--gray-100);
}
.pager .btn { min-width: 32px; }

/* ---------- 套餐锁定 ---------- */
.plan-card.disabled { opacity: .55; cursor: not-allowed; pointer-events: none; }
.plan-lock {
  position: absolute; top: 8px; right: 10px; font-size: 16px; color: var(--gray-400);
}

/* ---------- 折叠卡片 ---------- */
.collapsible-head { cursor: pointer; user-select: none; }
.collapsible-head:hover { background: var(--gray-50); }
.collapse-arrow { font-size: 12px; color: var(--gray-400); margin-left: 8px; }

/* ---------- 统计块 ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.stat-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.stat-card .stat-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
}
.stat-card .stat-num { font-size: 24px; font-weight: 700; color: var(--gray-900); }
.stat-card .stat-label { font-size: 13px; color: var(--gray-500); }

/* ---------- 工具条 ---------- */
.toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 16px;padding: 12px 16px;
}
.toolbar > * { flex-shrink: 0; }
.toolbar .spacer { flex: 1; min-width: 8px; }

/* ---------- 空状态 ---------- */
.empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--gray-400);
}
.empty .icon { font-size: 48px; margin-bottom: 12px; }

/* ---------- 响应式 ---------- */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-mask {
    position: fixed; inset: 0;
    background: rgba(15,23,42,.5);
    z-index: 90;
    display: none;
  }
  .sidebar-mask.show { display: block; }
  .main { margin-left: 0; }
  .topbar .menu-toggle { display: block; }
  .home-link { display: none; }
  .content { padding: 16px; }
  .form-row { flex-direction: column; gap: 0; }
  .toolbar { gap: 8px; }
  .stat-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
  .table th, .table td { padding: 8px; font-size: 13px; }
  .card-header { padding: 12px 16px; }
  .card-body { padding: 16px; }
}

/* 手机端付费页适配 */
@media (max-width: 560px) {
  .pay-meta > div { min-width: 100%; }
  .pay-guide { padding: 16px 12px; }
  .pay-qr-img img { width: 170px; height: 170px; }
  .pay-step { font-size: 13px; }
  #pay-buy-btn { width: 100%; }
}
@media (max-width: 380px) {
  .pay-qr-img img { width: 150px; height: 150px; }
  .plan-card { padding: 16px 10px; }
}

/* ---------- 打印样式 ---------- */
@media print {
  .sidebar, .topbar, .toolbar, .no-print { display: none !important; }
  .main { margin: 0; }
  .content { padding: 0; max-width: 100%; }
  .card { border: none; box-shadow: none; }
  .schedule-grid { border: 1px solid #000; }
  .schedule-grid .sch-cell, .schedule-grid .sch-head { border: 1px solid #000; }
}
