/* =============================================
   海贝英语 · 老师端 Web 全局样式
   参考 teacher_admin/SPEC.md Design Language
   ============================================= */

:root {
  --primary: #2563EB;
  --primary-light: #3B82F6;
  --primary-dark: #1D4ED8;
  --accent: #10B981;
  --warning: #F59E0B;
  --danger: #EF4444;
  --bg: #F8FAFC;
  --surface: #FFFFFF;
  --sidebar: #1E293B;
  --text-primary: #0F172A;
  --text-secondary: #64748B;
  --border: #E2E8F0;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.15);
  --sidebar-width: 220px;
  --sidebar-collapsed-width: 64px;
}

body.sidebar-collapsed:not(.logged-out) {
  --sidebar-width: var(--sidebar-collapsed-width);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { margin: 0; padding: 0; width: 100%; overflow-x: hidden; }

/* 全局焦点样式（替代 outline:none） */
*:focus { outline: 2px solid var(--primary); outline-offset: 2px; }
*:focus:not(:focus-visible) { outline: none; } /* 支持浏览器焦点可见性切换 */

body {
  font-family: 'Inter', -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  padding: 0;
}

/* ---- Layout ---- */
.app-container {
  display: none;
  min-height: 100vh;
}

/* Sidebar (PC) */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar);
  color: white;
  display: none;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  overflow: hidden;
  transition:
    width 250ms cubic-bezier(0.4, 0, 0.2, 1),
    transform 250ms cubic-bezier(0.4, 0, 0.2, 1);
}
.sidebar-logo {
  padding: 12px 10px 12px 12px;
  font-size: 16px;
  font-weight: 700;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-shrink: 0;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
  overflow: hidden;
}
.sidebar-brand-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #2563EB;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.sidebar-nav .nav-icon,
.nav-group-header .nav-icon,
.bottom-tab .tab-icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  background: none;
  color: currentColor;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.nav-svg {
  width: 18px;
  height: 18px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.sidebar-brand-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-nav { flex: 1; min-height: 0; padding: 12px 0; overflow-y: auto; overflow-x: hidden; }
.sidebar-nav a {
  display: none;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-size: 14px;
  transition: all 150ms ease;
  border-left: 3px solid transparent;
}
.sidebar-nav a:hover { background: rgba(255,255,255,0.05); color: white; }
.sidebar-nav a.active {
  background: rgba(255,255,255,0.1);
  color: white;
  border-left-color: var(--primary-light);
}
.sidebar-nav a .nav-icon { width: 18px; height: 18px; }

/* ── 分组：电脑悬停飞出，手机点开 ────────────────── */
.nav-group {
  margin-bottom: 2px;
}
.nav-group-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px 10px 13px;
  cursor: pointer;
  user-select: none;
  border-left: 3px solid transparent;
  color: rgba(255,255,255,0.7);
}
.nav-group-header:hover {
  background: rgba(255,255,255,0.06);
  color: #fff;
}
.nav-group.is-current > .nav-group-header,
.nav-group.flyout-open > .nav-group-header {
  background: rgba(255,255,255,0.1);
  color: #fff;
  border-left-color: var(--primary-light);
}
.nav-group-header .nav-icon {
  width: 18px;
  height: 18px;
  text-align: center;
  flex-shrink: 0;
}
.nav-group-title {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  flex: 1;
}
.nav-group-label {
  font-size: 14px;
  font-weight: 600;
  color: inherit;
  letter-spacing: 0.2px;
}
.nav-group-current {
  font-size: 11px;
  font-weight: 400;
  color: rgba(255,255,255,0.4);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav-group.is-current .nav-group-current {
  color: rgba(255,255,255,0.62);
}
.nav-group-arrow {
  flex-shrink: 0;
  width: 7px;
  height: 7px;
  border-right: 2px solid rgba(255,255,255,0.35);
  border-bottom: 2px solid rgba(255,255,255,0.35);
  transform: rotate(-45deg);
  margin-right: 4px;
}
.nav-group-items {
  overflow: hidden;
  max-height: 0;
}
.nav-group.open .nav-group-items { max-height: 1200px; }
.nav-item--danger {
  color: rgba(252, 165, 165, 0.95) !important;
}
.nav-item--danger:hover {
  background: rgba(239, 68, 68, 0.15) !important;
}
.nav-item--profile {
  margin-top: 10px;
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 12px !important;
}

.nav-flyout-panel {
  display: none;
  position: fixed;
  z-index: 1200;
  min-width: 248px;
  max-width: 360px;
  background: #243044;
  border: 1px solid rgba(255,255,255,0.1);
  border-left: none;
  border-radius: 0 12px 12px 0;
  box-shadow: 10px 12px 32px rgba(0,0,0,0.38);
  padding: 8px 8px 10px;
}
.nav-flyout-panel.open {
  display: block;
}
.nav-flyout-panel::before {
  content: '';
  position: absolute;
  left: -14px;
  top: 0;
  bottom: 0;
  width: 14px;
}
.nav-flyout-head {
  font-size: 12px;
  color: rgba(255,255,255,0.45);
  padding: 6px 10px 8px;
  font-weight: 600;
}
.nav-flyout-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
}
.nav-flyout-panel .nav-item {
  display: flex;
  padding: 10px 12px;
  border-radius: 8px;
  border-left: none;
  color: rgba(255,255,255,0.82);
}
.nav-flyout-panel .nav-item.active {
  background: rgba(232, 152, 10, 0.22);
  color: #fff;
}

@media (min-width: 1025px) {
  .nav-group-items { display: none; }
}

@media (max-width: 1024px) {
  .nav-flyout-panel { display: none !important; }
  .nav-group-arrow {
    transform: rotate(-45deg);
    transition: transform 200ms ease;
  }
  .nav-group.open .nav-group-arrow { transform: rotate(45deg); }
}

/* 导航项 */
.nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px 8px 14px;
  color: rgba(255,255,255,0.65);
  text-decoration: none;
  font-size: 13px;
  transition: all 150ms ease;
  border-left: 3px solid transparent;
}
.nav-item:hover { background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.9); }
.nav-item.active {
  background: rgba(255,255,255,0.1);
  color: white;
  border-left-color: var(--primary-light);
}
.nav-item .nav-icon { width: 18px; height: 18px; flex-shrink: 0; }
.nav-item .nav-label { flex: 1; }

/* 退出登录 */
.nav-logout {
  margin-top: 8px;
  width: 100%;
  text-align: left;
  cursor: pointer;
  color: rgba(255,255,255,0.55);
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 14px;
  background: none;
  font: inherit;
}
.nav-logout:hover { color: #ff8a8a; background: rgba(255,100,100,0.08); }
body.sidebar-collapsed .nav-logout .nav-label {
  display: none;
}
body.sidebar-collapsed .nav-logout {
  justify-content: center;
}

/* ── 兼容旧 .nav-parent 折叠菜单 ─────────────── */
/* 通用 nav-link 样式 */
.nav-link {
  color: rgba(255,255,255,0.65);
  text-decoration: none;
}
/* 原有系统设置折叠保持不变 */
.sidebar-user {
  padding: 16px;
  border-top: 1px solid rgba(255,255,255,0.1);
  display: none;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.sidebar-user .avatar {
  width: 36px; height: 36px;
  background: var(--primary);
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}
.sidebar-user .user-info { flex: 1; }
.sidebar-user .user-name { font-size: 13px; font-weight: 600; }
.sidebar-user .user-role { font-size: 11px; color: rgba(255,255,255,0.5); }
.sidebar-logout-btn {
  background: rgba(255,255,255,0.1);
  border: none;
  border-radius: 8px;
  color: rgba(255,255,255,0.85);
  cursor: pointer;
  font-size: 12px;
  padding: 6px 10px;
  flex-shrink: 0;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.sidebar-logout-btn:hover {
  background: rgba(239,68,68,0.3);
  color: #fff;
}

.sidebar-toggle-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 6px 10px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 8px;
  color: rgba(255,255,255,0.85);
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  flex-shrink: 0;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.sidebar-toggle-btn:hover {
  background: rgba(255,255,255,0.14);
  color: #fff;
}
.sidebar-toggle-icon {
  font-size: 18px;
  line-height: 1;
  transition: transform 250ms ease;
}
body.sidebar-collapsed .sidebar-toggle-icon {
  transform: rotate(180deg);
}
body.sidebar-collapsed .sidebar-toggle-text {
  display: none;
}
body.sidebar-collapsed .sidebar-toggle-btn {
  justify-content: center;
  padding: 6px 8px;
}
body.sidebar-collapsed .sidebar-logo {
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 6px;
}
body.sidebar-collapsed .sidebar-brand-text {
  display: none;
}
body.sidebar-collapsed .sidebar-brand {
  justify-content: center;
  flex: none;
}
body.sidebar-collapsed .nav-group-header {
  justify-content: center;
  padding: 10px 8px;
  gap: 0;
}
body.sidebar-collapsed .nav-group-title,
body.sidebar-collapsed .nav-group-arrow,
body.sidebar-collapsed .nav-group-current {
  display: none;
}
body.sidebar-collapsed .nav-group-items {
  display: none !important;
}
body.sidebar-collapsed .sidebar .nav-label,
body.sidebar-collapsed .sidebar .nav-group-label,
body.sidebar-collapsed .sidebar .nav-group-hint {
  display: none;
}
body.sidebar-collapsed .sidebar .nav-item {
  justify-content: center;
  padding: 10px 8px;
}
body.sidebar-collapsed .sidebar .nav-item--profile {
  margin-top: 4px;
  border-top: none;
  padding-top: 8px !important;
}
body.sidebar-collapsed .sidebar-user {
  justify-content: center;
  padding: 12px 8px;
}
body.sidebar-collapsed .sidebar-user .user-info {
  display: none;
}

/* 系统设置折叠菜单 */
.nav-parent { position: relative; }
.nav-parent-label {
  display: none;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-size: 14px;
  transition: all 150ms ease;
  border-left: 3px solid transparent;
  cursor: pointer;
}
.nav-parent-label:hover { background: rgba(255,255,255,0.05); color: white; }
.nav-parent.expanded > .nav-parent-label,
.nav-parent-label:has(+ .nav-children .active) {
  background: rgba(255,255,255,0.08);
  color: white;
  border-left-color: var(--primary-light);
}
.nav-arrow {
  margin-left: auto;
  font-size: 10px;
  transition: transform 200ms ease;
}
.nav-parent.expanded .nav-arrow { transform: rotate(90deg); }
.nav-children {
  display: none;
  padding-left: 16px;
}
.nav-parent.expanded .nav-children { display: block; }
.nav-child {
  display: none;
  align-items: center;
  gap: 12px;
  padding: 10px 16px 10px 28px;
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  font-size: 13px;
  transition: all 150ms ease;
  border-left: 3px solid transparent;
}
.nav-child:hover { background: rgba(255,255,255,0.05); color: white; }
.nav-child.active {
  background: rgba(255,255,255,0.1);
  color: white;
  border-left-color: var(--primary-light);
}

/* Main Content */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  max-width: calc(100vw - var(--sidebar-width));
  overflow-x: hidden;
  min-height: 100vh;
  display: none;
  flex-direction: column;
  transition: margin-left 250ms cubic-bezier(0.4, 0, 0.2, 1), max-width 250ms cubic-bezier(0.4, 0, 0.2, 1);
}
.page-header {
  background: var(--surface);
  padding: 20px 32px;
  border-bottom: 1px solid var(--border);
  display: none;
  align-items: center;
  justify-content: space-between;
}
.page-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}
.page-body { padding: 24px 32px; flex: 1; max-width: 100%; overflow-x: hidden; box-sizing: border-box; }

/* 宽表格区域：卡片内横向滚动，避免撑破整页 */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}
.table-scroll .data-table { width: max-content; min-width: 100%; }

/* 学生管理：列宽与省略 */
.page-students .data-table th,
.page-students .data-table td {
  padding: 8px 10px;
  font-size: 13px;
}
.page-students .col-school,
.page-students .col-result,
.page-students .col-class {
  max-width: 88px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.page-students .col-phone { white-space: nowrap; }

/* Mobile Bottom Tab */
.bottom-tabs {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  z-index: 100;
}
.bottom-tabs-inner {
  display: none;
  max-width: 480px;
  margin: 0 auto;
}
.bottom-tab {
  flex: 1;
  text-align: center;
  padding: 8px 0;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 11px;
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  border-top: 3px solid transparent;
  text-decoration: none;
  transition: all 150ms ease;
}
.bottom-tab.active { color: var(--primary); border-top-color: var(--primary); }
.bottom-tab .tab-icon {
  width: 18px;
  height: 18px;
  background: none;
  color: currentColor;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ---- Cards ---- */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 16px;
}
.card:hover { box-shadow: var(--shadow-md); }
.card-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-primary);
}

/* ---- Stats ---- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  box-shadow: var(--shadow);
  transition: transform 150ms ease, box-shadow 150ms ease;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-icon { font-size: 28px; margin-bottom: 8px; }
.stat-value { font-size: 28px; font-weight: 700; color: var(--text-primary); }
.stat-label { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 150ms ease;
  text-decoration: none;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--surface); color: var(--text-primary); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--bg); }
.btn-danger { background: var(--danger); color: white; }
.btn-success { background: var(--accent); color: white; }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--bg); color: var(--text-primary); }
.btn-block { display: flex; width: 100%; justify-content: center; }
.btn-sm { padding: 5px 14px; font-size: 13px; border-radius: 6px; cursor: pointer; border: 1px solid var(--border); background: var(--surface); color: var(--text-primary); }
.btn-sm:hover { background: var(--bg); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* ---- Form Elements ---- */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}
.form-input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  color: var(--text-primary);
  background: var(--surface);
  transition: border-color 150ms ease, box-shadow 150ms ease;
  outline: none;
}
.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
.form-input::placeholder { color: var(--text-secondary); opacity: 0.6; }
.form-select {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  background: var(--surface);
  outline: none;
  cursor: pointer;
}
.form-textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  min-height: 100px;
  outline: none;
  line-height: 1.6;
}
.form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

/* ---- Badges ---- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}
.badge-blue { background: #EFF6FF; color: var(--primary); }
.badge-green { background: #ECFDF5; color: #059669; }
.badge-yellow { background: #FFFBEB; color: #D97706; }
.badge-red { background: #FEF2F2; color: #DC2626; }
.badge-gray { background: #F1F5F9; color: var(--text-secondary); }

/* ---- Tables ---- */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  background: var(--bg);
  padding: 10px 16px;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
}
.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  color: var(--text-primary);
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: var(--bg); }

/* ---- Tabs ---- */
.tabs { display: flex; gap: 0; border-bottom: 2px solid var(--border); margin-bottom: 24px; }
.tab-btn {
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  border: none;
  background: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: all 150ms ease;
  white-space: nowrap;
}
.tab-btn:hover { color: var(--primary); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ---- Login Page ---- */
.login-page {
  min-height: 100vh;
  display: none;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  padding: 20px;
}
.login-card {
  background: var(--surface);
  border-radius: 16px;
  padding: 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
}
.login-logo { text-align: center; margin-bottom: 32px; }
.login-logo .logo-icon { font-size: 48px; margin-bottom: 8px; }
.login-logo h1 { font-size: 24px; font-weight: 700; color: var(--text-primary); }
.login-logo p { color: var(--text-secondary); font-size: 14px; margin-top: 4px; }
.login-error {
  background: #FEF2F2;
  color: var(--danger);
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 16px;
}

/* ---- Schedule ---- */
.schedule-date-nav {
  display: none;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}
.schedule-date-nav input[type="date"] {
  height: 40px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  background: var(--surface);
}
.course-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: all 150ms ease;
  border-left: 4px solid var(--primary);
}
.course-card:hover { transform: translateX(4px); box-shadow: var(--shadow-md); }
.course-time {
  min-width: 60px;
  text-align: center;
  background: #EFF6FF;
  border-radius: 8px;
  padding: 10px 8px;
}
.course-time .time-hr { font-size: 18px; font-weight: 700; color: var(--primary); }
.course-time .time-dur { font-size: 11px; color: var(--text-secondary); }
.course-info { flex: 1; }
.course-info .course-student { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.course-info .course-meta { font-size: 12px; color: var(--text-secondary); display: flex; gap: 12px; align-items: center; }
.course-action { color: var(--accent); font-size: 20px; }

/* ---- Attendance ---- */
/* V1 安全通知样式 */
.attendance-arrival-btn { background: #52c41a; color: white; padding: 4px 12px; border-radius: 4px; border: none; cursor: pointer; font-size: 13px; }
.attendance-arrival-btn:hover { background: #389e0d; }
.attendance-arrival-btn:disabled { background: #b7eb8f; cursor: not-allowed; }
.attendance-departure-btn { background: #1890ff; color: white; padding: 4px 12px; border-radius: 4px; border: none; cursor: pointer; font-size: 13px; }
.attendance-departure-btn:hover { background: #096dd9; }
.attendance-departure-btn:disabled { background: #91d5ff; cursor: not-allowed; }
.attendance-time { color: #52c41a; font-weight: bold; font-size: 13px; }
.attendance-status-waiting { color: #fa8c16; font-weight: bold; font-size: 12px; }

.attendance-toolbar {
  display: none;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.attendance-search {
  flex: 1;
  min-width: 200px;
  height: 40px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  outline: none;
}
.student-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr 80px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  align-items: center;
  font-size: 14px;
}
.student-row:last-child { border-bottom: none; }
.student-row:hover { background: var(--bg); }
.student-info .student-name { font-weight: 600; font-size: 14px; }
.student-info .student-phone { font-size: 12px; color: var(--text-secondary); }

/* ---- AI Copywriting ---- */
.ai-input-section { margin-bottom: 20px; }
.ai-hint {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 6px;
}
.ai-result-card {
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 12px;
  font-size: 14px;
  line-height: 1.8;
  color: var(--text-primary);
  white-space: pre-wrap;
  position: relative;
}
.ai-result-card .copy-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 150ms ease;
}
.ai-result-card .copy-btn:hover { background: var(--primary); color: white; border-color: var(--primary); }
.ai-loading {
  text-align: center;
  padding: 40px;
  color: var(--text-secondary);
}
.ai-loading .spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.ai-empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-secondary);
}
.ai-empty .empty-icon { font-size: 48px; margin-bottom: 12px; opacity: 0.5; }

/* ---- Dashboard Quick Actions ---- */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
.quick-action {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px 16px;
  text-align: center;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: all 150ms ease;
  text-decoration: none;
  color: var(--text-primary);
  display: block;
}
.quick-action:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.quick-action .qa-icon { font-size: 32px; margin-bottom: 8px; }
.quick-action .qa-label { font-size: 13px; font-weight: 500; }

/* ---- Toast ---- */
.toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--sidebar);
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 9999;
  opacity: 0;
  transition: all 300ms ease;
  pointer-events: none;
  white-space: nowrap;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---- Loading ---- */
.loading-center { text-align: center; padding: 60px; color: var(--text-secondary); }

/* ---- Page Transition ---- */
.page-view { animation: fadeIn 200ms ease; flex: 1; min-height: 100vh; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ---- AI Drawer（展示规则见下方「右侧抽屉」区块，此处仅保留动画与内容样式） ---- */
.drawer.open .drawer-panel { transform: translateX(0); }
.drawer-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.4);
  animation: fadeIn 200ms ease;
}
.drawer-panel {
  overflow-y: auto;
  overflow-x: hidden;
}
.drawer-header {
  background: var(--bg);
}
#drawer-title { font-size: 17px; font-weight: 700; color: var(--text-primary); }
.drawer-close {
  transition: background 150ms;
}
.drawer-close:hover { background: var(--border); }
.drawer-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 24px;
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-primary);
  min-height: 0;
}
.drawer-body .ai-result-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}
.drawer-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

/* ---- Utility ---- */
.flex { display: flex; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.text-sm { font-size: 12px; }
.text-secondary { color: var(--text-secondary); }
.font-bold { font-weight: 700; }

/* ---- Responsive ---- */
@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; max-width: 100vw; }
  .sidebar-toggle-btn { display: none !important; }
  body.sidebar-collapsed:not(.logged-out) { --sidebar-width: 220px; }
  .bottom-tabs { display: block; }
  .bottom-tabs-inner { display: flex; }
  .bottom-tab { display: flex; }
  .page-body { padding: 16px; padding-bottom: 80px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .quick-actions { grid-template-columns: repeat(2, 1fr); }
  .page-header { padding: 16px; }
  .data-table { font-size: 13px; }
  .data-table th, .data-table td { padding: 10px 12px; }
}

@media (max-width: 640px) {
  .student-row { grid-template-columns: 2fr 1fr 1fr 80px; }
  .student-row > *:nth-child(3),
  .student-row > *:nth-child(4) { display: none; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .login-card { padding: 28px 20px; }
}

/* ── 新增页面通用组件 ── */
.page-header { display: flex; justify-content: space-between; align-items: center; padding: 20px 24px; border-bottom: 1px solid var(--border); }
.page-header h2 { font-size: 20px; font-weight: 700; color: var(--text-primary); margin: 0; }
.page-loading { padding: 40px; text-align: center; color: var(--text-secondary); }
.page-error { padding: 20px; color: #ef4444; background: #fef2f2; border-radius: 8px; margin: 16px; }
.mt-16 { margin-top: 16px; }

.dashboard-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; padding: 20px 24px; }
.stat-card { background: white; border-radius: 12px; padding: 20px; display: flex; align-items: center; gap: 14px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.stat-icon { font-size: 28px; }
.stat-info { flex: 1; }
.stat-num { font-size: 24px; font-weight: 700; color: var(--text-primary); }
.stat-label { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }

.card { background: white; border-radius: 12px; padding: 20px 24px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); margin: 0 24px 16px; }
.card-title { font-size: 15px; font-weight: 600; color: var(--text-primary); margin-bottom: 16px; }

.data-table { width: 100%; border-collapse: collapse; font-size: 14px; border-spacing: 0; }
.data-table th {
  background: #EEF2FF;
  text-align: left;
  padding: 11px 14px;
  font-weight: 600;
  color: #1E3A5F;
  font-size: 13px;
  letter-spacing: 0;
  white-space: nowrap;
  border-bottom: none;
}
.data-table th:first-child { border-radius: 10px 0 0 10px; }
.data-table th:last-child { border-radius: 0 10px 10px 0; }
.data-table td {
  padding: 11px 14px;
  border-bottom: 1px solid #f1f5f9;
  color: var(--text-primary);
  font-size: 13.5px;
  vertical-align: middle;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.data-table tbody tr { background: #fff; transition: background 0.15s; }
.data-table tbody tr:nth-child(even) { background: #fafbfc; }
.data-table tbody tr:hover { background: #eef2ff; }
.data-table tr:last-child td { border-bottom: none; }
.data-table td.cell-action {
  text-align: right;
  white-space: nowrap;
  padding-right: 14px;
  max-width: none;
  overflow: visible;
  text-overflow: clip;
}
.data-table td.cell-action .btn-sm { margin-left: 6px; }
.data-table td.cell-action .btn-sm:first-child { margin-left: 0; }
.data-table td.cell-action .btn-sm.btn-primary {
  background: #2563EB;
  color: #fff;
  border: none;
}
.data-table td.cell-action .btn-sm.btn-primary:hover { background: #1d4ed8; color: #fff; }
.data-table td.cell-action .btn-sm.btn-deal {
  background: #fff;
  color: #047857;
  border: 1px solid #a7f3d0;
}
.data-table td.cell-action .btn-sm.btn-fail {
  background: transparent;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.tag { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 12px; font-weight: 500; }
.tag-green { background: #dcfce7; color: #16a34a; }
.tag-blue { background: #dbeafe; color: #2563eb; }
.tag-yellow { background: #fef9c3; color: #ca8a04; }
.tag-red { background: #fee2e2; color: #dc2626; }
.tag-gray { background: #f1f5f9; color: #64748b; }

.btn-primary { background: var(--primary); color: white; border: none; padding: 10px 20px; border-radius: 8px; cursor: pointer; font-size: 14px; font-weight: 500; }
.btn-primary:hover { background: #1d4ed8; }
.btn-secondary { background: #f1f5f9; color: var(--text-primary); border: none; padding: 10px 20px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.btn-secondary:hover { background: #e2e8f0; }
.btn-sm { background: #f1f5f9; color: #64748b; border: none; padding: 5px 12px; border-radius: 6px; cursor: pointer; font-size: 12.5px; font-weight: 500; transition: all 0.15s; }
.btn-sm:hover { background: #e2e8f0; color: #334155; }
.btn-sm.btn-edit { background: #eef2ff; color: #4f46e5; }
.btn-sm.btn-edit:hover { background: #c7d2fe; color: #3730a3; }
.btn-sm.btn-delete { background: #fff1f2; color: #e11d48; }
.btn-sm.btn-delete:hover { background: #fecdd3; color: #be123c; }

.empty-tip { color: var(--text-secondary); font-size: 14px; }

/* 遮罩层：全屏但左边留出sidebar宽度 */
/* ──────────────────────────────────────────
   统一弹窗（Modal）样式
   规范：居中、白色圆角卡片、右上角×按钮、可拖拽
────────────────────────────────────────── */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 25, 45, 0.55);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
/* 通用模态框：打开时强制显示所有子元素 */
.modal.modal-open { display: flex !important; }
.modal.modal-open .modal-content { display: flex !important; }
.modal.modal-open .modal-body { display: block !important; }
.modal.modal-open .modal-header,
.modal.modal-open .modal-footer { display: flex !important; }
/* 班级管理 - 添加学生：底部确认/取消与关闭并排 */
#course-stu-modal.modal-open .course-stu-footer {
  display: flex !important;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}
#course-stu-modal.cs-add-mode .course-stu-footer .cs-add-footer-btn {
  display: inline-flex !important;
}
.modal.modal-open .modal-close,
.modal.modal-open .modal-close-btn { display: inline-flex !important; }

/* stu-modal / pk-modal 专用高优先级覆盖 */
#stu-modal.modal-open .modal-content,
#pk-modal.modal-open .modal-content {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
}
#stu-modal.modal-open .modal-header,
#pk-modal.modal-open .modal-header { display: flex !important; }
#stu-modal.modal-open .modal-footer,
#pk-modal.modal-open .stu-modal-footer,
#pk-modal.modal-open .stu-modal-footer { display: flex !important; }
#stu-modal.modal-open .modal-close-btn { display: inline-flex !important; }

/* 详情弹窗 */
#sched-detail-modal.modal-open .sched-detail-body { display: flex !important; }
#sched-detail-modal.modal-open .detail-actions { display: flex !important; }

/* 通用居中弹窗内容 */
.modal-content {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18), 0 4px 16px rgba(0, 0, 0, 0.1);
  padding: 0;
  width: 90%;
  max-width: 520px;
  max-height: 90vh;
  overflow: hidden;
  overflow-x: hidden;
  display: none;
  flex-direction: column;
  position: relative;
  animation: modalIn 0.2s ease;
}
@keyframes modalIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.hb-dialog { z-index: 2000; }

/* 弹窗头部 */
.modal-header {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px 16px;
  border-bottom: 1px solid #f0f2f5;
  flex-shrink: 0;
  background: #fff;
  border-radius: 14px 14px 0 0;
  position: relative;
}
.modal-header h3 {
  margin: 0;
  padding-right: 28px;
  font-size: 16px;
  font-weight: 600;
  color: #1E3A5F;
  letter-spacing: 0;
}
/* 弹窗关闭按钮 */
.modal-close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: #f1f5f9;
  color: #334155;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, transform 0.15s;
  flex-shrink: 0;
  padding: 0;
  position: absolute;
  top: 12px;
  right: 12px;
}
.modal-close:hover { background: #e2e8f0; }

/* 弹窗主体内容 */
.modal-body {
  padding: 20px 24px 24px;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
  min-height: 0;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.modal-body input[type="checkbox"],
.modal-body input[type="radio"] {
  width: auto !important;
  flex-shrink: 0;
}
.modal-body .form-group { margin-bottom: 14px; }
.modal-body .form-group:last-child { margin-bottom: 0; }

/* 弹窗底部按钮区 */
.modal-footer {
  display: none;
  gap: 10px;
  padding: 14px 24px 18px;
  border-top: 1px solid #f0f2f5;
  flex-shrink: 0;
  background: #fafafa;
  border-radius: 0 0 14px 14px;
  justify-content: flex-end;
}

/* 中等宽度弹窗（分配、课表详情） */
.modal-content.modal-md { max-width: 640px; }
/* 大弹窗（列表/全屏侧栏） */
.modal-content.modal-lg { max-width: 780px; }
/* 小弹窗（确认框等） */
.modal-content.modal-sm { max-width: 380px; }

/* 详情类弹窗：允许点遮罩 / ESC 关闭（data-backdrop-close="1"） */
#sched-detail-modal.modal-open .modal-content,
#eval-detail-modal.modal-open .modal-content {
  overflow: hidden;
  flex-direction: column;
  max-height: 90vh;
}
#sched-detail-modal .sched-detail-body,
#eval-detail-modal #eval-detail-body {
  flex: 1;
  min-height: 0;
  max-height: none !important;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

/* ==========================================
   学生/接送居中弹窗 - 完整重写
   ========================================== */

/* 弹窗容器：默认隐藏，打开时 flex（学生/接送/通知/退费规则统一） */
#stu-modal,
#pk-modal,
#notif-modal,
#send-notif-modal,
#refund-rule-modal {
  position: fixed;
  inset: 0;
  z-index: 1001;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(15, 25, 45, 0.55);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
#stu-modal.modal-open,
#pk-modal.modal-open,
#notif-modal.modal-open,
#send-notif-modal.modal-open,
#refund-rule-modal.modal-open {
  display: flex !important;
}

/* 弹窗内容面板 */
#stu-modal .modal-content,
#pk-modal .modal-content,
#notif-modal .modal-content,
#send-notif-modal .modal-content,
#refund-rule-modal .modal-content {
  background: #fff;
  border-radius: 16px;
  width: 680px;
  max-width: 95vw;
  max-height: 92vh;
  overflow: hidden;
  padding: 0;
  display: none; /* 默认隐藏 */
  flex-direction: column;
  animation: modalIn 0.22s ease;
  box-shadow: 0 24px 80px rgba(0,0,0,0.18), 0 8px 32px rgba(0,0,0,0.1);
  box-sizing: border-box;
  position: relative;
  margin: auto;
}
#stu-modal .modal-content { width: 640px; }
#stu-modal.modal-open .modal-content,
#pk-modal.modal-open .modal-content,
#notif-modal.modal-open .modal-content,
#send-notif-modal.modal-open .modal-content,
#refund-rule-modal.modal-open .modal-content {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* 标题栏 */
#stu-modal .modal-header,
#pk-modal .modal-header,
#notif-modal .modal-header,
#send-notif-modal .modal-header,
#refund-rule-modal .modal-header {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: #fff;
  border-radius: 16px 16px 0 0;
  flex-shrink: 0;
  cursor: default;
  user-select: none;
}
#stu-modal.modal-open .modal-header,
#pk-modal.modal-open .modal-header,
#notif-modal.modal-open .modal-header,
#send-notif-modal.modal-open .modal-header,
#refund-rule-modal.modal-open .modal-header {
  display: flex !important;
}

@keyframes modalIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

#stu-modal .modal-header h3,
#pk-modal .modal-header h3,
#notif-modal .modal-header h3,
#send-notif-modal .modal-header h3,
#refund-rule-modal .modal-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #1E3A5F;
  cursor: default;
}

/* 关闭按钮 */
#stu-modal .modal-close-btn,
#pk-modal .modal-close-btn,
#notif-modal .modal-close-btn,
#send-notif-modal .modal-close-btn,
#refund-rule-modal .modal-close-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: #f1f5f9;
  color: #334155;
  font-size: 18px;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
  line-height: 1;
}
#stu-modal.modal-open .modal-close-btn,
#pk-modal.modal-open .modal-close-btn,
#notif-modal.modal-open .modal-close-btn,
#send-notif-modal.modal-open .modal-close-btn,
#refund-rule-modal.modal-open .modal-close-btn {
  display: inline-flex !important;
}
#stu-modal .modal-close-btn:hover,
#pk-modal .modal-close-btn:hover,
#notif-modal .modal-close-btn:hover,
#send-notif-modal .modal-close-btn:hover,
#refund-rule-modal .modal-close-btn:hover {
  background: #e2e8f0;
}

/* 主体区域 */
#stu-modal .modal-body,
#pk-modal .modal-body {
  padding: 12px 20px 8px;
  overflow-y: auto;
  flex: 1;
  box-sizing: border-box;
  min-height: 0;
  display: none;
}
#stu-modal.modal-open .modal-body,
#pk-modal.modal-open .modal-body {
  display: block !important;
}

/* 表单网格 */
#stu-modal .stu-form-grid,
#pk-modal .stu-form-grid {
  padding: 0;
  overflow-y: visible;
  display: none;
}
#stu-modal.modal-open .stu-form-grid,
#pk-modal.modal-open .stu-form-grid {
  display: grid !important;
}
#stu-modal.modal-open .stu-form-grid .form-group,
#pk-modal.modal-open .stu-form-grid .form-group {
  display: flex !important;
}

/* 底部按钮栏 */
#stu-modal .stu-modal-footer,
#pk-modal .stu-modal-footer {
  padding: 10px 20px;
  margin-top: 0;
  border-top: 1px solid #f0f2f5;
  display: none;
  gap: 10px;
  justify-content: flex-end;
  flex-shrink: 0;
  box-sizing: border-box;
}
#stu-modal.modal-open .stu-modal-footer,
#pk-modal.modal-open .stu-modal-footer {
  display: flex !important;
}

#notif-modal .modal-body,
#send-notif-modal .modal-body,
#refund-rule-modal .modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
  box-sizing: border-box;
  min-height: 0;
}
#notif-modal.modal-open .modal-footer,
#send-notif-modal.modal-open .modal-footer,
#refund-rule-modal.modal-open .modal-footer {
  display: flex !important;
}

/* 表单编辑弹窗：禁止拖拽光标 */
#notif-modal .modal-header,
#send-notif-modal .modal-header,
#stu-modal .modal-header,
#pk-modal .modal-header,
#refund-rule-modal .modal-header { cursor: default; user-select: none; }

/* 教师档案：与学生档案同宽，落在侧栏右侧的工作区正中 */
#th-modal .modal-content {
  width: 680px;
  max-width: calc(100vw - var(--sidebar-width) - 48px);
}
#th-modal #th-course-checkboxes label.th-course-row {
  display: flex !important;
  align-items: center;
  gap: 10px;
  margin-bottom: 0;
  font-weight: normal;
  cursor: pointer;
}
#th-modal #th-course-checkboxes .th-course-cb {
  width: auto !important;
  flex-shrink: 0;
  margin: 0;
}
#th-modal #th-course-checkboxes .th-course-label {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  color: #333;
  line-height: 1.4;
}

/* 教师管理页：紧凑标题 + 列表工具栏 */
.th-page-header {
  display: flex !important;
  align-items: center;
  padding: 8px 0 10px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.th-page-header h2 {
  font-size: 17px;
  font-weight: 700;
  margin: 0;
}
.th-list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: #fafbfc;
}
.th-list-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}
.th-list-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.th-list-actions #th-campus-filter {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  background: var(--surface);
  color: var(--text-primary);
  min-width: 140px;
}
.th-list-actions .th-add-btn {
  padding: 8px 20px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
  white-space: nowrap;
}
.th-list-actions .th-add-btn:hover {
  background: #1d4ed8;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.45);
}

/* 班级管理弹窗：加宽 */
#course-modal .modal-content {
  max-width: 720px;
  width: 94%;
}

/* 管理学生弹窗 */
#course-stu-modal .modal-content {
  max-width: 720px;
  width: 94%;
}
#course-stu-modal .course-stu-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}
#course-stu-modal .cs-check-all-label {
  display: flex !important;
  align-items: center;
  gap: 6px;
  margin-bottom: 0;
  font-weight: normal;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-secondary);
}
#course-stu-modal .cs-check-all,
#course-stu-modal .cs-check {
  width: auto !important;
  margin: 0;
  flex-shrink: 0;
}

/* 班级管理页：紧凑标题 + 列表工具栏 */
.course-page-header {
  display: flex !important;
  align-items: center;
  padding: 8px 0 10px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.course-page-header h2 {
  font-size: 17px;
  font-weight: 700;
  margin: 0;
}
.course-list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: #fafbfc;
}
.course-list-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}
.course-list-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.course-list-actions .course-add-btn {
  padding: 8px 20px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
  white-space: nowrap;
}
.course-list-actions .course-add-btn:hover {
  background: #1d4ed8;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.45);
}

/* 所有弹窗落在侧栏右侧工作区里垂直居中，不压住侧栏，也不贴边 */
.modal,
#stu-modal,
#pk-modal,
#notif-modal,
#send-notif-modal,
#refund-rule-modal,
#income-modal,
#pickup-modal,
#th-modal {
  left: var(--sidebar-width);
  right: 0;
  top: 0;
  bottom: 0;
  padding: 24px;
  box-sizing: border-box;
  align-items: center;
  justify-content: center;
}
@media (max-width: 1024px) {
  .modal,
  #stu-modal,
  #pk-modal,
  #notif-modal,
  #send-notif-modal,
  #refund-rule-modal,
  #income-modal,
  #pickup-modal,
  #th-modal {
    left: 0;
  }
}

/* ── 右侧抽屉 ─────────────────────── */
.drawer {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  pointer-events: none;
}
.drawer.open { display: block; pointer-events: auto; }
.drawer.open .drawer-overlay { opacity: 1; }
.drawer.open .drawer-panel { transform: translateX(0); }
.drawer-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.4);
  opacity: 0;
  transition: opacity 0.3s;
}
.drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 480px;
  max-width: 90vw;
  background: #fff;
  box-shadow: -8px 0 32px rgba(0,0,0,0.15);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s ease;
}
.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.drawer-header h3 { margin: 0; font-size: 16px; font-weight: 600; }
.drawer-close {
  width: 32px; height: 32px;
  border: none; background: none; cursor: pointer;
  font-size: 24px; color: #666;
  border-radius: 50%; line-height: 1;
}
.drawer-close:hover { background: #f5f5f5; }
.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

/* 兼容旧的 inline style 弹窗 */
#income-modal,
#pickup-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 25, 45, 0.55);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(2px);
}
#income-modal.modal-open,
#pickup-modal.modal-open { display: flex; }
#income-modal,
#pickup-modal {
  left: var(--sidebar-width);
  right: 0;
  padding: 24px;
  box-sizing: border-box;
}
@media (max-width: 1024px) {
  #income-modal,
  #pickup-modal { left: 0; }
}

/* 学生弹窗：按组两列，避免三列平铺 */
.stu-form-sec + .stu-form-sec {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #f1f5f9;
}
.stu-archive-no {
  margin: 2px 0 0;
  font-size: 12px;
  font-weight: 400;
  color: #64748b;
}
#stu-print-btn, #th-print-btn { margin-right: auto; }
.stu-form-sec h4 {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 600;
  color: #1E3A5F;
}
.stu-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: start;
  gap: 8px 16px;
  min-width: 0;
  box-sizing: border-box;
  width: 100%;
}
.stu-form-grid .form-group { display: flex; flex-direction: column; gap: 6px; margin: 0; box-sizing: border-box; }
.stu-form-grid .span-2,
.stu-form-grid .stu-account-bar { grid-column: 1 / -1; }
.stu-form-grid .form-group label { font-size: 13px; font-weight: 500; color: #64748b; margin: 0; }
.stu-field-hint { margin: 4px 0 0; font-size: 12px; line-height: 1.4; color: #94a3b8; }
.stu-account-bar {
  display: none;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  padding: 10px 12px;
  background: #f8fafc;
  border-radius: 8px;
  font-size: 13px;
  color: #475569;
}
.stu-account-bar input[type="text"],
.stu-account-bar input:not([type="checkbox"]) {
  width: 140px;
  padding: 6px 8px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #fff;
  color: #334155;
}
.stu-account-check { display: inline-flex; align-items: center; gap: 6px; margin: 0; color: #334155; }
.stu-form-grid .form-group input[readonly] { background: #f8fafc; color: #64748b; }
.stu-form-grid .form-group input,
.stu-form-grid .form-group select,
.stu-form-grid .form-group textarea {
  padding: 8px 10px; border: 1px solid #e5e7eb; border-radius: 6px;
  font-size: 14px; width: 100%; box-sizing: border-box; font-family: inherit;
}
.stu-form-grid .form-group input:focus,
.stu-form-grid .form-group select:focus,
.stu-form-grid .form-group textarea:focus {
  outline: none; border-color: var(--primary);
}
.stu-form-grid .form-group.full-width { grid-column: 1 / -1; }

/* 底部按钮行 */
.stu-modal-footer {
  display: flex; gap: 10px; padding-top: 16px;
  border-top: 1px solid #e5e7eb; margin-top: 12px; flex-shrink: 0;
}

.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 13px; color: var(--text-secondary); margin-bottom: 6px; font-weight: 500; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 9px 12px; border: 1px solid #e5e7eb; border-radius: 6px; font-size: 14px; box-sizing: border-box; font-family: inherit; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: var(--primary); }

.filter-bar { display: flex; gap: 10px; padding: 16px 24px; flex-wrap: wrap; }

/* AI 文案 */
.ai-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.ai-tab { background: #f1f5f9; border: none; padding: 8px 16px; border-radius: 6px; cursor: pointer; font-size: 13px; color: var(--text-secondary); }
.ai-tab.active { background: var(--primary); color: white; }
.ai-form { background: #f8fafc; border-radius: 8px; padding: 20px; margin-bottom: 16px; }
.ai-form h4 { margin: 0 0 14px; font-size: 15px; }
.ai-form .form-group { margin-bottom: 12px; }
.ai-results { display: flex; flex-direction: column; gap: 12px; }
.ai-result-card { background: white; border: 1px solid var(--border); border-radius: 8px; padding: 16px; }
.ai-result-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-size: 13px; color: var(--text-secondary); }

/* 招生获客 */
.schedule-item, .attendance-item, .schedule-item { display: flex; gap: 16px; align-items: center; padding: 10px 0; border-bottom: 1px solid #f1f5f9; font-size: 14px; }
.schedule-item:last-child, .attendance-item:last-child { border-bottom: none; }
.schedule-time, .attendance-time { color: var(--text-secondary); font-size: 13px; white-space: nowrap; }
.schedule-class { flex: 1; font-weight: 500; }

/* 经营报表 */
.trend-chart { display: flex; align-items: flex-end; gap: 12px; height: 120px; padding: 10px 0; }
.trend-bar { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; }
.trend-bar-fill { background: var(--primary); border-radius: 4px 4px 0 0; width: 100%; min-height: 4px; transition: height 0.3s; }
.trend-label { font-size: 11px; color: var(--text-secondary); margin-top: 4px; white-space: nowrap; }
.trend-num { font-size: 12px; font-weight: 600; color: var(--text-primary); margin-top: 2px; }

/* 作业 */
.homework-card { border: 1px solid var(--border); border-radius: 8px; padding: 16px; margin-bottom: 12px; }
.homework-title { font-weight: 600; font-size: 15px; margin-bottom: 8px; }
.homework-content { color: var(--text-secondary); font-size: 14px; line-height: 1.6; margin-bottom: 8px; white-space: pre-wrap; }
.homework-meta { font-size: 12px; color: var(--text-secondary); margin-bottom: 8px; }

/* 优惠券 */
.coupon-card { border: 1px solid #fbbf24; background: #fffbeb; border-radius: 8px; padding: 14px; margin-bottom: 10px; display: flex; gap: 12px; align-items: center; }
.coupon-value { font-size: 22px; font-weight: 700; color: #d97706; white-space: nowrap; }
.coupon-name { flex: 1; font-weight: 500; }
.coupon-meta { font-size: 12px; color: var(--text-secondary); white-space: nowrap; }

/* 拼团 */
.group-card { border: 1px solid var(--border); border-radius: 8px; padding: 14px; margin-bottom: 10px; }
.group-name { font-weight: 600; margin-bottom: 6px; }
.group-price { font-size: 18px; font-weight: 700; color: #dc2626; margin-bottom: 4px; }
.group-meta { font-size: 12px; color: var(--text-secondary); }

/* 成长档案 */
.growth-student-picker { max-width: 420px; margin-bottom: 16px; }
.growth-empty-tip { text-align: center; padding: 24px 16px; line-height: 1.7; color: var(--text-secondary); background: #f8fafc; border-radius: 8px; margin-top: 8px; }
.stu-search-field { position: relative; }
.stu-search-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-sizing: border-box;
  font-size: 14px;
  background: var(--surface);
  color: var(--text-primary);
}
.stu-search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.stu-search-helper {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-secondary);
}
.stu-search-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  max-height: 280px;
  overflow-y: auto;
  z-index: 99999;
  box-shadow: var(--shadow-lg);
}
.stu-search-hint-header {
  padding: 10px 12px 8px;
  font-size: 12px;
  color: var(--text-secondary);
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
}
.stu-search-hint-empty {
  padding: 14px 12px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}
.stu-search-hint-tip {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: #94a3b8;
}
.stu-search-hint-more {
  padding: 8px 12px;
  font-size: 12px;
  color: #94a3b8;
  background: #f8fafc;
  border-top: 1px solid var(--border);
}
.stu-hint-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  cursor: pointer;
  font-size: 13px;
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.12s;
}
.stu-hint-item:last-child { border-bottom: none; }
.stu-hint-item:hover { background: #eff6ff; }
.stu-hint-name { font-weight: 500; color: var(--text-primary); flex-shrink: 0; }
.stu-hint-py {
  font-size: 11px;
  font-weight: 600;
  color: #2563eb;
  background: #dbeafe;
  padding: 1px 6px;
  border-radius: 4px;
  flex-shrink: 0;
}
.stu-hint-campus {
  margin-left: auto;
  color: #94a3b8;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.info-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; font-size: 14px; color: var(--text-primary); margin-bottom: 12px; }
.info-grid > div { background: #f8fafc; padding: 8px 12px; border-radius: 6px; }
.report-card { border: 1px solid var(--border); border-radius: 8px; padding: 14px; margin-bottom: 10px; }
.report-period { font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.report-content { font-size: 13px; color: var(--text-secondary); margin-bottom: 6px; white-space: pre-wrap; }
.report-comment { font-size: 12px; color: #2563eb; background: #dbeafe; padding: 4px 8px; border-radius: 4px; display: inline-block; }

/* 学期设置 */
.semester-settings-page {
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
  padding: 24px 32px 40px;
  box-sizing: border-box;
}
.semester-settings-tabs {
  margin-bottom: 20px;
}
.semester-settings-body {
  width: 100%;
}
.semester-settings-panel {
  width: 100%;
  box-sizing: border-box;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 24px;
  box-shadow: var(--shadow);
}
.semester-panel-desc {
  margin: 0 0 16px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-secondary);
}
.semester-panel-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.semester-panel-toolbar--start {
  justify-content: flex-start;
}
.semester-panel-meta,
.semester-panel-hint {
  font-size: 13px;
  color: var(--text-secondary);
}
.semester-panel-actions {
  margin-top: 16px;
}
.semester-panel-actions--top {
  margin-top: 0;
  margin-bottom: 16px;
}
.semester-data-table .col-center {
  text-align: center;
}
.work-days-list,
.holiday-types-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}
.work-day-item {
  display: grid;
  grid-template-columns: 56px 72px 1fr auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  box-sizing: border-box;
  padding: 14px 16px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.work-day-label {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 14px;
}
.work-day-check {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
}
.work-day-check input {
  width: 16px;
  height: 16px;
  cursor: pointer;
}
.wd-time-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.wd-time-row input[type="time"] {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  background: var(--surface);
}
.work-day-sep {
  color: var(--text-secondary);
  font-size: 13px;
}
.wd-status {
  justify-self: start;
  font-size: 12px;
  padding: 2px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.wd-status.is-work {
  background: #dcfce7;
  color: #16a34a;
}
.wd-status.is-rest {
  background: #fee2e2;
  color: #dc2626;
}
.holiday-type-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  box-sizing: border-box;
  padding: 12px 16px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.semester-data-table {
  width: 100%;
}
.holiday-type-name {
  font-weight: 500;
  color: var(--text-primary);
  font-size: 14px;
}
.holiday-type-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
@media (max-width: 768px) {
  .semester-settings-page {
    padding: 16px;
  }
  .semester-settings-panel {
    padding: 16px;
  }
  .work-day-item {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

/* 教师管理 */
.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
#export-form { display: flex; }

/* 排课管理扩展样式 */
.page-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:20px; }
.page-header h2 { font-size:18px; font-weight:700; color:var(--text-primary); }
.filter-bar { display:flex; gap:10px; margin-bottom:16px; flex-wrap:wrap; align-items:center; }
.filter-bar input, .filter-bar select { padding:7px 12px; border:1px solid var(--border); border-radius:6px; font-size:14px; background:var(--surface); color:var(--text-primary); }
.form-group { margin-bottom:14px; }
.form-group label { display:block; font-size:13px; color:var(--text-secondary); margin-bottom:5px; font-weight:500; }
.form-group input, .form-group select { width:100%; padding:8px 12px; border:1px solid var(--border); border-radius:6px; font-size:14px; background:var(--bg); color:var(--text-primary); box-sizing:border-box; }
.form-row { display:grid; grid-template-columns:1fr 1fr; gap:12px; }

/* 未登录：全屏登录，不受侧栏 margin/max-width 影响 */
body.logged-out {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  overflow-x: hidden;
}
body.logged-out .sidebar {
  display: none !important;
}
body.logged-out .bottom-nav {
  display: none !important;
}
body.logged-out #main-view,
body.logged-out .main-content {
  margin: 0 !important;
  margin-left: 0 !important;
  max-width: none !important;
  width: 100vw !important;
  min-height: 100vh;
  display: flex !important;
  flex: none !important;
  padding: 0 !important;
}
body.logged-out .login-page {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 100vw;
  min-height: 100vh;
  margin: 0;
  padding: 20px;
  box-sizing: border-box;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
}

/* ── 话术库 ─────────────────────────────── */
.phrase-item {
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: #fff;
  border-radius: 10px;
  border: 1px solid #f0f0f0;
  border-left: 4px solid #e5e7eb;
  margin-bottom: 10px;
  transition: box-shadow 0.2s;
}
.phrase-item:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.phrase-item.is-favorite {
  border-left-color: #F59E0B;
  background: #FFFBEB;
}
.phrase-item.is-favorite::before {
  content: '⭐ ';
}
.phrase-item-content {
  flex: 1;
  font-size: 14px;
  color: #374151;
  line-height: 1.6;
  word-break: break-word;
}
.phrase-item-actions {
  display: none;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.phrase-item-fav {
  font-size: 18px;
  background: none;
  border: none;
  cursor: pointer;
  opacity: 0.4;
  transition: opacity 0.2s, transform 0.2s;
  padding: 2px;
}
.phrase-item-fav.active {
  opacity: 1;
  transform: scale(1.2);
}
.phrase-item-fav:hover { opacity: 0.8; }

/* 收藏 tab 列表 */
.phrase-item.is-fav-marked {
  border-left-color: #F59E0B;
}

/* 强制收藏状态样式（覆盖所有其他规则） */
body .phrase-item.is-favorite {
  background: #FFF9E6 !important;
  border-left: 4px solid #F59E0B !important;
  box-shadow: 0 2px 8px rgba(245,158,11,0.15) !important;
}
body .phrase-item.is-favorite::before {
  content: '⭐ ' !important;
}
body .phrase-item:not(.is-favorite) {
  background: #ffffff !important;
  border-left: 4px solid #e5e7eb !important;
}
/* 收藏按钮激活态 */
body .phrase-item-fav.active {
  color: #F59E0B !important;
  text-shadow: 0 0 8px rgba(245,158,11,0.5) !important;
  opacity: 1 !important;
}
body .phrase-item-fav:not(.active) {
  opacity: 0.3 !important;
}

/* ── 周视图课表 ─────────────────────────── */
.sched-page {
  padding: 0;
}

.sched-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  padding: 10px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.sched-header-left {
  display: flex;
  align-items: center;
  gap: 12px 16px;
  flex: 1;
  min-width: 0;
  flex-wrap: wrap;
}

.sched-page-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
}

.week-nav-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.week-nav-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 13px;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 150ms ease;
  font-weight: 500;
  white-space: nowrap;
}
.week-nav-btn:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}
.week-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  min-width: 0;
  white-space: nowrap;
}

.week-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  padding: 0;
  background: transparent;
  border-bottom: none;
}
.week-filters {
  display: flex;
  gap: 10px;
}
.week-filters select {
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  background: var(--surface);
  color: var(--text-primary);
  cursor: pointer;
  outline: none;
}
.week-filters select:focus {
  border-color: var(--primary);
}
.cell-add-btn {
  width: 26px;
  height: 26px;
  border: 1.5px dashed var(--primary);
  border-radius: 50%;
  background: rgba(79,70,229,0.06);
  color: var(--primary);
  font-size: 18px;
  font-weight: 400;
  line-height: 1;
  cursor: pointer;
  display: block;
  margin: 0 auto;
  transition: all 150ms ease;
  padding: 0;
}
.cell-add-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(var(--primary-rgb, 79,70,229), 0.08);
}
.empty-cell {
  cursor: pointer;
}

.week-table-wrap {
  overflow: auto;
  background: var(--surface);
  margin: 0;
}

.week-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.week-table th,
.week-table td {
  border: 1px solid var(--border);
  vertical-align: top;
  padding: 0;
}

.time-header {
  width: 80px;
  min-width: 80px;
  background: var(--bg);
  font-size: 12px;
  color: var(--text-secondary);
  text-align: center;
  padding: 12px 8px;
}

.day-header {
  background: var(--bg);
  padding: 12px 8px;
  text-align: center;
  min-width: 120px;
}
.day-header.weekend {
  background: #FFF7ED;
}
.day-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.day-num {
  font-size: 12px;
  color: var(--text-secondary);
}

.time-cell {
  background: var(--bg);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  width: 80px;
  min-width: 80px;
  padding: 12px 8px;
  border-right: 1px solid var(--border);
}

.hour-row td {
  height: 70px;
  min-height: 70px;
}

.day-cell {
  vertical-align: top;
  padding: 6px;
}
.empty-cell {
  text-align: center;
  color: #CBD5E1;
  font-size: 18px;
  padding-top: 20px;
}

.week-table .course-card {
  display: block;
  background: white;
  border-radius: 8px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  padding: 8px 10px;
  margin-bottom: 6px;
  cursor: pointer;
  transition: all 150ms ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.week-table .course-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.week-table .course-card .card-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
  line-height: 1.3;
}
.week-table .course-card .card-meta {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
}
.week-table .course-card .card-time {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 4px;
  opacity: 0.7;
}

/* 详情弹窗 */
.sched-detail-modal-content {
  min-width: 420px;
}
.sched-detail-body {
  display: none;
  flex-direction: column;
  gap: 2px;
}
.detail-card {
  background: var(--surface);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}
.detail-header {
  background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
  color: white;
  padding: 18px 20px 16px;
  border-left: 4px solid transparent;
}
.detail-course-name {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
}
.detail-meta {
  font-size: 13px;
  opacity: 0.85;
}
.detail-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: #F1F5F9;
  padding: 14px 16px;
}
.info-item {
  background: var(--surface);
  padding: 10px 4px;
}
.info-item:nth-child(3),
.info-item:nth-child(4) {
  grid-column: 1 / -1;
}
.info-label {
  font-size: 11px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 3px;
}
.info-value {
  font-size: 14px;
  color: var(--text-primary);
  font-weight: 500;
}
.detail-actions {
  display: none;
  gap: 8px;
  padding: 14px 16px;
  background: var(--bg);
}
.detail-btn {
  flex: 1;
  padding: 9px 6px;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
}
.detail-btn-edit    { background: #EEF2FF; color: #4F46E5; }
.detail-btn-edit:hover    { background: #E0E7FF; }
.detail-btn-reschedule { background: #F0FDF4; color: #16a34a; }
.detail-btn-reschedule:hover { background: #DCFCE7; }
.detail-btn-sign    { background: #ECFDF5; color: #059669; }
.detail-btn-sign:hover    { background: #D1FAE5; }
.detail-btn-delete  { background: #FEF2F2; color: #dc2626; }
.detail-btn-delete:hover  { background: #FEE2E2; }

/* ── 班级评测简报 ── */
.eval-class-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 16px;
}
.eval-stat-item {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.eval-stat-num {
  font-size: 28px;
  font-weight: 700;
  color: #333;
}
.eval-stat-label {
  font-size: 12px;
  color: #999;
  margin-top: 4px;
}
.eval-stu-card {
  border: 1px solid #f0f0f0;
  border-radius: 10px;
  margin-bottom: 10px;
  overflow: hidden;
  transition: all 0.2s;
}
.eval-stu-card.expanded {
  border-color: #667eea;
  box-shadow: 0 2px 8px rgba(102,126,234,0.15);
}
.eval-stu-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  cursor: pointer;
  background: #fff;
  user-select: none;
}
.eval-stu-row:hover { background: #f9faff; }
.eval-stu-info { display: flex; flex-direction: column; gap: 2px; }
.eval-stu-name { font-size: 15px; font-weight: 600; color: #333; }
.eval-stu-meta { font-size: 12px; color: #999; }
.eval-stu-scores { display: flex; align-items: center; gap: 8px; }
.eval-score-chip {
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
}
.eval-expand-icon { font-size: 10px; color: #999; }
.eval-stu-detail {
  border-top: 1px solid #f0f0f0;
  padding: 12px 16px;
  background: #fafbfc;
}
.btn-link {
  background: none;
  border: none;
  color: #667eea;
  cursor: pointer;
  font-size: 13px;
  padding: 2px 6px;
  text-decoration: underline;
}
.logout-link { color: rgba(255,255,255,0.5) !important; margin-top: 12px; }

/* ── 评测管理样式 ─────────────────────────── */
.eval-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  margin: 16px 0;
  flex-wrap: wrap;
}
.eval-tab {
  padding: 10px 20px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
}
.eval-tab:hover { color: var(--primary); }
.eval-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}
.eval-tabs-inner { display: flex; gap: 0; }
.eval-gen-tab { border: none; background: none; padding: 10px 20px; cursor: pointer; font-size: 14px; font-weight: 600; color: var(--text-secondary); border-bottom: 3px solid transparent; margin-bottom: -2px; }
.eval-gen-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.eval-toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.tag { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 10px; white-space: nowrap; }
.alert-success { background: #f6ffed; border: 1px solid #b7eb8f; border-radius: 8px; padding: 12px 16px; color: #52c41a; font-size: 14px; }
.alert-error { background: #fff2f0; border: 1px solid #ffccc7; border-radius: 8px; padding: 12px 16px; color: #ff4d4f; font-size: 14px; }
.sub-tabs { display: flex; gap: 4px; border-bottom: 2px solid #f0f0f0; padding-bottom: 0; flex-wrap: wrap; }
.sub-tab { padding: 8px 16px; border: none; background: none; cursor: pointer; font-size: 14px; color: #666; border-bottom: 2px solid transparent; margin-bottom: -2px; border-radius: 6px 6px 0 0; transition: all 0.2s; }
.sub-tab:hover { color: var(--primary); background: #f5f5f5; }
.sub-tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

/* =============================================
   Topbar + System Settings Dropdown
   ============================================= */

/* Topbar base */
.topbar {
  display: none; /* shown only when sidebar is visible / logged-in */
  position: fixed;
  top: 0;
  left: var(--sidebar-width);
  right: 0;
  height: 56px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  z-index: 200;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px 0 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.topbar-left {
  display: none;
  align-items: center;
}

.topbar-mobile-menu {
  display: none;
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: var(--text-secondary);
  padding: 6px;
  border-radius: 8px;
  transition: background 0.15s;
}

.topbar-mobile-menu:hover {
  background: var(--bg);
  color: var(--text-primary);
}

.topbar-right {
  display: none;
  align-items: center;
  gap: 12px;
}

/* Settings Dropdown */
.topbar-dropdown {
  position: relative;
}

.topbar-dropdown-trigger {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.topbar-dropdown-trigger:hover {
  background: #EFF6FF;
  border-color: var(--primary);
  color: var(--primary);
}

.topbar-dropdown-trigger.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  border-radius: 8px 8px 0 0;
}

.topbar-dropdown-label {
  font-family: inherit;
}

.topbar-dropdown-arrow {
  font-size: 10px;
  transition: transform 0.2s ease;
}

.topbar-dropdown-trigger.active .topbar-dropdown-arrow {
  transform: rotate(180deg);
}

/* Dropdown menu panel */
.topbar-dropdown-menu {
  position: absolute;
  top: calc(100% + 2px);
  right: 0;
  min-width: 260px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 300;
}

.topbar-dropdown-menu.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Dropdown item */
.topbar-dropdown-item {
  display: none;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  text-decoration: none;
  color: var(--text-primary);
  transition: background 0.15s ease;
  border-bottom: 1px solid #F8FAFC;
}

.topbar-dropdown-item:last-child {
  border-bottom: none;
}

.topbar-dropdown-item:hover {
  background: #EFF6FF;
}

.topbar-dropdown-item.active {
  background: #EEF2FF;
}

.dropdown-item-icon {
  font-size: 20px;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  background: var(--bg);
  border-radius: 8px;
  display: none;
  align-items: center;
  justify-content: center;
}

.topbar-dropdown-item:hover .dropdown-item-icon {
  background: #DBEAFE;
}

.dropdown-item-text {
  flex: 1;
}

.dropdown-item-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}

.dropdown-item-desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 1px;
}

/* Active page highlight */
.topbar-dropdown-item.active .dropdown-item-title {
  color: var(--primary);
}
/* Show/Hide elements based on login state */
body:not(.logged-out) .topbar {
  display: none;
}

body:not(.logged-out) .sidebar {
  display: flex;
}

body:not(.logged-out) .sidebar-logo {
  display: flex;
}

body:not(.logged-out) .sidebar-nav a {
  display: flex;
}

body:not(.logged-out) .main-content {
  display: flex;
  padding-top: 0px;
}

body.logged-out .sidebar-toggle-btn {
  display: none;
}

.settings-toolbar {
  display: flex;
  top: 0;
  position: fixed;
  left: var(--sidebar-width);
  right: 0;
  height: 48px;
  align-items: center;
  gap: 2px;
  padding: 0 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  z-index: 199;
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
  transition: left 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.settings-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  transition: all 150ms ease;
  border-radius: 6px 6px 0 0;
}

.settings-tab:hover {
  color: var(--primary);
  background: #EFF6FF;
  border-bottom-color: #BFDBFE;
}

.settings-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: #EFF6FF;
}

.settings-tab-icon {
  font-size: 15px;
  flex-shrink: 0;
}

.settings-tab-label {
  font-family: inherit;
}

/* Mobile: full-width topbar + toolbar */
@media (max-width: 1024px) {
  .topbar {
    left: 0;
  }

  .settings-toolbar {
    display: flex;
    top: 0;
    left: 0;
    gap: 2px;
  }

  body:not(.logged-out) .main-content {
  display: flex;
    padding-top: 104px;
  }

  .topbar-mobile-menu {
    display: none;
  }

  .settings-tab {
    padding: 10px 12px;
    font-size: 13px;
  }

  .settings-tab-icon {
    display: none;
  }
}

@media (max-width: 640px) {
  .settings-toolbar {
    display: flex;
    top: 0;
    gap: 0;
  }

  .settings-tab {
    padding: 10px 10px;
    font-size: 12.5px;
  }

  .settings-tab-label {
    max-width: 70px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/* ── 校长看板 ───────────────────────────────────── */
.dash-board {
  --dash-ink: #1a2332;
  --dash-muted: #6b645b;
  --dash-line: #e8e2d6;
  --dash-gold: #b7791f;
  --dash-gold-deep: #8a5a12;
  --dash-paper: #f7f3ec;
  --dash-alert: #b4232c;
  --dash-ok: #2f6f4a;
  padding: 18px 24px 40px;
  max-width: 1200px;
  color: var(--dash-ink);
}
.dash-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--dash-gold);
  text-transform: none;
  margin-bottom: 8px;
}
.dash-chip {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--dash-gold-deep);
  background: #f3e3c4;
  border-radius: 999px;
  vertical-align: middle;
}
.dash-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  padding: 4px 2px 16px;
  border-bottom: 1px solid var(--dash-line);
}
.dash-hero h2 {
  margin: 0;
  font-size: 26px;
  font-weight: 750;
  letter-spacing: -0.03em;
  line-height: 1.2;
}
.dash-hero-desc {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--dash-muted);
}
.dash-hero-side { text-align: right; flex-shrink: 0; }
.dash-hero-date {
  font-size: 13px;
  color: var(--dash-muted);
  margin-bottom: 8px;
}
.dash-hero-btn {
  border: 1px solid var(--dash-ink);
  background: var(--dash-ink);
  color: #fff;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.dash-hero-btn:hover { background: #2c3a4f; }

.dash-deals {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.dash-deal {
  background: #fff;
  border: 1px solid var(--dash-line);
  border-radius: 14px;
  padding: 16px 16px 14px;
  min-height: 148px;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.dash-deal:hover {
  border-color: #d4b57a;
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(138, 90, 18, 0.08);
}
.dash-deal.is-hot {
  background: linear-gradient(180deg, #fff8ea 0%, #fff 58%);
  border-color: #e4c48a;
}
.dash-deal.is-alert {
  background: linear-gradient(180deg, #fff1f0 0%, #fff 58%);
  border-color: #ecc4c4;
}
.dash-deal.is-ok { border-color: #c9ddd0; }
.dash-deal-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--dash-muted);
}
.dash-deal-num {
  font-size: 32px;
  font-weight: 750;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
  margin: 8px 0 6px;
}
.dash-deal.is-alert .dash-deal-num { color: var(--dash-alert); }
.dash-deal.is-hot .dash-deal-num { color: var(--dash-gold-deep); }
.dash-deal-note {
  font-size: 12px;
  color: var(--dash-muted);
  line-height: 1.45;
  margin-top: auto;
}
.dash-cta {
  display: inline-block;
  margin-top: 10px;
  font-size: 12px;
  font-weight: 700;
  color: var(--dash-gold-deep);
}

.dash-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 14px;
  align-items: start;
}
.dash-col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.dash-card {
  background: #fff;
  border: 1px solid var(--dash-line);
  border-radius: 14px;
  padding: 18px 18px 16px;
}
.dash-card--wide { margin-top: 14px; }
.dash-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 14px;
}
.dash-card-head h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}
.dash-card-head span {
  font-size: 12px;
  color: var(--dash-muted);
}
.dash-empty {
  font-size: 13px;
  color: var(--dash-muted);
  line-height: 1.6;
  padding: 8px 0 4px;
}
.dash-empty a { color: var(--dash-gold-deep); font-weight: 600; margin-left: 6px; }

.dash-money {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.dash-money-item {
  padding: 10px 12px;
  background: var(--dash-paper);
  border-radius: 10px;
}
.dash-money-item.is-main {
  background: #1a2332;
  color: #fff;
}
.dash-money-item.is-main .dash-money-lab { color: rgba(255,255,255,0.62); }
.dash-money-lab {
  font-size: 11px;
  font-weight: 600;
  color: var(--dash-muted);
  margin-bottom: 4px;
}
.dash-money-num {
  font-size: 18px;
  font-weight: 750;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.dash-money-num small {
  font-size: 12px;
  font-weight: 600;
  margin-left: 2px;
  opacity: 0.7;
}

.dash-spark {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 108px;
  padding: 4px 2px 0;
}
.dash-spark.is-empty {
  height: auto;
  padding: 0;
}
.dash-spark-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
}
.dash-spark-bar {
  width: 100%;
  max-width: 28px;
  background: #ddd4c4;
  border-radius: 3px 3px 0 0;
}
.dash-spark-col.has-val .dash-spark-bar { background: #c9a36a; }
.dash-spark-col.is-today .dash-spark-bar { background: var(--dash-gold-deep); }
.dash-spark-val {
  font-size: 10px;
  color: var(--dash-muted);
  margin: 4px 0 0;
  min-height: 12px;
}
.dash-spark-lab { font-size: 11px; color: var(--dash-muted); }

.dash-funnel { display: flex; flex-direction: column; gap: 8px; }
.dash-funnel-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 140px;
  padding: 10px 12px;
  background: #efe4cc;
  border-radius: 8px;
  font-size: 13px;
}
.dash-funnel-row.is-convert { background: #1a2332; color: #fff; }
.dash-funnel-row b { font-variant-numeric: tabular-nums; }
.dash-funnel-rate {
  font-size: 13px;
  color: var(--dash-muted);
  padding-top: 4px;
}
.dash-funnel-rate strong { color: var(--dash-gold-deep); font-size: 16px; }

.dash-meters { display: flex; flex-direction: column; gap: 12px; }
.dash-meter {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  padding: 4px 0;
}
.dash-ring {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  border-radius: 50%;
  background: conic-gradient(#c9a36a calc(var(--p) * 1%), #efece6 0);
  display: grid;
  place-items: center;
}
.dash-ring span {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #fff;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.dash-meter.is-good .dash-ring { background: conic-gradient(#2f6f4a calc(var(--p) * 1%), #efece6 0); }
.dash-meter.is-low .dash-ring { background: conic-gradient(#b4232c calc(var(--p) * 1%), #efece6 0); }
.dash-meter-name { font-size: 13px; font-weight: 700; }
.dash-meter-hint { font-size: 12px; color: var(--dash-muted); margin-top: 2px; line-height: 1.4; }

.dash-lessons { display: flex; flex-direction: column; }
.dash-lesson {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 2px 12px;
  padding: 8px 0;
  border-bottom: 1px solid #f1ece3;
  font-size: 13px;
}
.dash-lesson:last-child { border-bottom: none; }
.dash-lesson-time {
  grid-row: 1 / 3;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--dash-gold-deep);
  font-size: 12px;
  padding-top: 2px;
}
.dash-lesson-name { font-weight: 650; }
.dash-lesson-meta { font-size: 12px; color: var(--dash-muted); }
.dash-more {
  margin-top: 8px;
  background: none;
  border: none;
  padding: 0;
  color: var(--dash-gold-deep);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.dash-rank-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 8px 0;
}
.dash-rank-i {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--dash-paper);
  color: var(--dash-gold-deep);
  font-size: 12px;
  font-weight: 700;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  margin-top: 2px;
}
.dash-rank-body { flex: 1; min-width: 0; }
.dash-rank-top { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.dash-rank-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-rank-income { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--dash-gold-deep); }
.dash-rank-track {
  height: 6px;
  background: #efece6;
  border-radius: 99px;
  margin: 6px 0 4px;
  overflow: hidden;
}
.dash-rank-fill { height: 100%; background: #c9a36a; border-radius: 99px; }
.dash-rank-sub { font-size: 11px; color: var(--dash-muted); }

@media (max-width: 1100px) {
  .dash-deals { grid-template-columns: 1fr 1fr; }
  .dash-grid { grid-template-columns: 1fr; }
  .dash-money { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .dash-board { padding: 12px 14px 28px; }
  .dash-hero { flex-direction: column; align-items: flex-start; }
  .dash-hero-side { text-align: left; }
  .dash-deals { grid-template-columns: 1fr; }
  .dash-hero h2 { font-size: 22px; }
}

/* 课文点读校对 */
.pr-header-actions { display: flex; gap: 8px; margin-left: auto; align-items: center; }
.pr-header-actions .btn-sm.btn-primary { background: var(--primary); color: #fff; border: none; }
.pr-up-mask {
  position: fixed;
  inset: 0;
  z-index: 120000;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.pr-up-card {
  width: 420px;
  max-width: 92vw;
  background: #fff;
  border-radius: 14px;
  padding: 22px 22px 16px;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.2);
}
.pr-up-card h3 { margin: 0 0 8px; font-size: 17px; }
.pr-up-status { margin: 0 0 14px; color: #334155; font-size: 13px; line-height: 1.55; }
.pr-up-bar { height: 10px; background: #e2e8f0; border-radius: 99px; overflow: hidden; }
.pr-up-bar div { height: 100%; width: 0; background: var(--primary, #2563eb); transition: width 0.18s ease; }
.pr-up-mask.is-error .pr-up-bar div { background: #e11d48; }
.pr-up-meta { margin: 8px 0 0; font-size: 12px; color: #64748b; }
.pr-up-note { margin: 12px 0 0; font-size: 12px; color: #64748b; line-height: 1.5; }
.pr-up-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.pr-hint { margin: 0 0 12px; color: var(--text-secondary); font-size: 13px; line-height: 1.5; }
.pr-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 14px; }
.pr-toolbar label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-secondary); }
.pr-toolbar select, .pr-toolbar input { height: 32px; border: 1px solid var(--border); border-radius: 6px; padding: 0 8px; }
.pr-meta { font-size: 12px; color: var(--text-secondary); }
.pr-page { display: flex; flex-direction: column; height: 100vh; max-height: 100vh; overflow: hidden; box-sizing: border-box; }
.pr-page > .course-page-header,
.pr-page > .pr-hint,
.pr-page > .pr-toolbar { flex: 0 0 auto; }
.pr-editor { display: flex; gap: 16px; align-items: stretch; flex: 1 1 0; min-height: 0; overflow: hidden; }
.pr-stage-wrap { position: relative; flex: 1 1 0; min-width: 0; min-height: 0; background: #ececec; border-radius: 10px; overflow-x: hidden; overflow-y: scroll; scrollbar-gutter: stable; scrollbar-width: auto; scrollbar-color: #64748b #e2e8f0; }
.pr-stage-wrap::-webkit-scrollbar { width: 12px; }
.pr-stage-wrap::-webkit-scrollbar-track { background: #e2e8f0; }
.pr-stage-wrap::-webkit-scrollbar-thumb { background: #64748b; border-radius: 6px; border: 2px solid #e2e8f0; }
.pr-stage { position: relative; display: block; width: 100%; line-height: 0; cursor: crosshair; }
.pr-stage.pr-force-draw { touch-action: none; }
.pr-stage.pr-force-draw .pr-box,
.pr-stage.pr-force-draw .pr-handle { pointer-events: none; }
.pr-img { display: block; width: 100%; height: auto; user-select: none; -webkit-user-drag: none; }
.pr-type-field { position: relative; }
.pr-type-native { position: absolute; width: 1px; height: 1px; margin: 0; padding: 0; border: 0; opacity: 0; pointer-events: none; }
.pr-type-btn { display: flex; align-items: center; justify-content: space-between; width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--text-primary); font-size: 14px; text-align: left; cursor: pointer; }
.pr-type-btn::after { content: ''; width: 8px; height: 8px; margin-left: 8px; border-right: 2px solid #64748b; border-bottom: 2px solid #64748b; transform: rotate(45deg) translateY(-2px); flex-shrink: 0; }
.pr-type-menu { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30; margin: 0; padding: 4px; background: #fff; border: 1px solid #cbd5e1; border-radius: 8px; box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12); }
.pr-type-menu.pr-type-menu-up { top: auto; bottom: calc(100% + 4px); }
.pr-type-menu button { display: block; width: 100%; padding: 8px 10px; border: 0; border-radius: 6px; background: transparent; color: #1e293b; font-size: 14px; text-align: left; cursor: pointer; }
.pr-type-menu button[aria-selected="true"] { background: #2563eb; color: #fff; }
.pr-boxes { position: absolute; inset: 0; pointer-events: none; }
.pr-box { position: absolute; border: 2px solid #22c55e; background: rgba(34, 197, 94, 0.18); box-sizing: border-box; cursor: pointer; pointer-events: auto; user-select: none; }
.pr-box.on { border-color: #f59e0b; background: rgba(245, 158, 11, 0.28); z-index: 2; cursor: move; }
.pr-handle { position: absolute; width: 12px; height: 12px; margin: -6px 0 0 -6px; background: #fff; border: 2px solid #d97706; border-radius: 2px; box-sizing: border-box; z-index: 5; }
.pr-handle[data-h="nw"] { left: 0; top: 0; cursor: nwse-resize; }
.pr-handle[data-h="n"] { left: 50%; top: 0; cursor: ns-resize; }
.pr-handle[data-h="ne"] { left: 100%; top: 0; cursor: nesw-resize; }
.pr-handle[data-h="e"] { left: 100%; top: 50%; cursor: ew-resize; }
.pr-handle[data-h="se"] { left: 100%; top: 100%; cursor: nwse-resize; }
.pr-handle[data-h="s"] { left: 50%; top: 100%; cursor: ns-resize; }
.pr-handle[data-h="sw"] { left: 0; top: 100%; cursor: nesw-resize; }
.pr-handle[data-h="w"] { left: 0; top: 50%; cursor: ew-resize; }
.pr-draft { border-color: #60a5fa; background: rgba(96, 165, 250, 0.22); pointer-events: none; z-index: 3; }
.pr-side { width: 300px; flex-shrink: 0; min-height: 0; overflow: auto; }
.pr-side .card { padding: 14px; }
.pr-side textarea { width: 100%; resize: vertical; }
.pr-content-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.pr-content-head label { margin: 0; }
.pr-content-head-actions { display: flex; gap: 6px; }
.pr-content-head .btn-sm { padding: 4px 12px; }
.pr-side-actions { display: flex; gap: 8px; margin: 0 0 8px; }
.pr-side-actions .btn-primary,
.pr-side-actions .btn-secondary { flex: 1; }
.pr-save-hint { margin: 0 0 12px; font-size: 12px; color: var(--text-secondary); line-height: 1.4; }
.pr-save-hint.dirty { color: #d97706; }
@media (max-width: 900px) {
  .pr-page { height: auto; max-height: none; overflow: visible; }
  .pr-editor { flex-direction: column; height: auto; max-height: none; overflow: visible; }
  .pr-side { width: 100%; max-height: none; }
  .pr-stage-wrap { flex: none; height: 70vh; }
}
.stu-pick-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  color: #4f46e5;
  background: #eef2ff;
  vertical-align: middle;
}
.stu-pick-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  cursor: pointer;
}
.stu-pick-label input { width: 16px; height: 16px; }

.page-leads {
  min-width: 0;
  max-width: 100%;
}
.page-leads .page-header {
  margin-bottom: 0;
  padding: 12px 20px;
}
.page-leads-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.page-leads .sub-tabs {
  margin: 0;
  border: none;
  gap: 4px;
}
.page-leads-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  padding: 10px 20px 12px;
}
.page-leads-toolbar select {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  background: #fff;
}
.page-leads-hint {
  font-size: 12px;
  color: #888;
  margin-left: auto;
}
.page-leads .card.table-scroll {
  margin: 0 16px 16px;
  padding: 0;
  min-width: 0;
  max-width: calc(100% - 32px);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.page-leads .data-table {
  width: 100%;
  min-width: 920px;
  table-layout: fixed;
}
.page-leads .data-table th,
.page-leads .data-table td {
  white-space: nowrap;
  padding: 8px 10px;
  font-size: 13px;
  letter-spacing: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.page-leads .data-table th {
  overflow: hidden;
  text-overflow: clip;
  text-align: left;
}
.page-leads .col-status,
.page-leads td.cell-status { text-align: center; }
.page-leads .col-action,
.page-leads td.cell-action { text-align: right; }
.page-leads .tag-overdue {
  margin-left: 4px;
  color: #dc2626;
  font-size: 11px;
  font-weight: 600;
}
.page-leads .col-name { width: 108px; }
.page-leads .col-phone { width: 118px; }
.page-leads .col-source { width: 76px; }
.page-leads .col-time { width: 140px; }
.page-leads .col-ref { width: 92px; }
.page-leads .col-note { width: auto; }
.page-leads .col-owner { width: 76px; }
.page-leads .col-next { width: 88px; }
.page-leads .col-status { width: 76px; }
.page-leads .col-action { width: 64px; }
.page-leads .data-table td.cell-phone,
.page-leads .data-table td.cell-time {
  font-variant-numeric: tabular-nums;
  text-overflow: clip;
}
.page-leads .data-table td.cell-note {
  max-width: none;
}
.page-leads .data-table th:last-child,
.page-leads .data-table td.cell-action {
  position: sticky;
  right: 0;
  z-index: 2;
  width: 64px;
  min-width: 64px;
  max-width: 64px;
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
}
.page-leads .data-table th:last-child {
  background: #EEF2FF;
  box-shadow: -8px 0 8px -8px rgba(30, 58, 95, 0.12);
}
.page-leads .data-table td.cell-action {
  background: #fff;
  box-shadow: -8px 0 8px -8px rgba(44, 38, 32, 0.16);
}
.page-leads .data-table tbody tr:nth-child(even) td.cell-action {
  background: #fafbfc;
}
.page-leads .data-table tbody tr:hover td.cell-action {
  background: #eef2ff;
}
.page-leads .cell-action-hint {
  color: #2563EB;
  font-size: 13px;
  font-weight: 600;
}
.page-leads .cell-action-pop {
  display: none;
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 4;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  white-space: nowrap;
}
.page-leads td.cell-action:hover .cell-action-pop,
.page-leads td.cell-action:focus-within .cell-action-pop {
  display: flex;
}
.page-leads td.cell-action:hover .cell-action-hint,
.page-leads td.cell-action:focus-within .cell-action-hint {
  visibility: hidden;
}

#trial-list .data-table td.cell-action {
  position: relative;
  width: 64px;
  min-width: 64px;
  max-width: 64px;
  text-align: right;
  overflow: visible;
  text-overflow: clip;
}
#trial-list .cell-action-hint {
  color: #2563EB;
  font-size: 13px;
  font-weight: 600;
}
#trial-list .cell-action-pop {
  display: none;
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 4;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  white-space: nowrap;
}
#trial-list td.cell-action:hover .cell-action-pop,
#trial-list td.cell-action:focus-within .cell-action-pop {
  display: flex;
}
#trial-list td.cell-action:focus {
  outline: none;
}
#trial-list td.cell-action:focus-within .cell-action-pop {
  outline: 2px solid #2563EB;
  outline-offset: 2px;
}
#trial-list td.cell-action:hover .cell-action-hint,
#trial-list td.cell-action:focus-within .cell-action-hint {
  visibility: hidden;
}
#trial-list .cell-action-pop .btn-sm {
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #1e293b;
}
#trial-list .cell-action-pop .trial-act-pwd {
  color: #c2410c;
  border-color: #fdba74;
  background: #fff;
}
#trial-list .cell-action-pop .trial-act-sched {
  color: #6d28d9;
  border-color: #c4b5fd;
  background: #fff;
}
#trial-list .cell-action-pop .btn-primary {
  background: #2563EB;
  color: #fff;
  border: none;
}
#trial-list .cell-action-pop .btn-delete {
  background: #fff;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

#stu-archive-print { display: none; }
@media print {
  @page { size: A4; margin: 14mm; }
  body * { visibility: hidden !important; }
  #stu-archive-print, #stu-archive-print * { visibility: visible !important; }
  #stu-archive-print {
    display: block !important;
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    background: #fff;
    color: #111;
  }
  .arc-sheet { font-family: "Songti SC", "SimSun", serif; color: #111; }
  .arc-head { display: flex; justify-content: space-between; align-items: flex-end; border-bottom: 2px solid #1E3A5F; padding-bottom: 8px; }
  .arc-brand { margin: 0; font-size: 12px; letter-spacing: 0.12em; color: #1E3A5F; }
  .arc-sheet h1 { margin: 2px 0 0; font-size: 26px; font-weight: 700; }
  .arc-no { text-align: right; font-size: 12px; }
  .arc-no b { display: block; font-size: 16px; margin: 2px 0; }
  .arc-no span { display: block; color: #333; }
  .arc-sheet h2 { margin: 16px 0 8px; font-size: 14px; border-left: 3px solid #1E3A5F; padding-left: 8px; }
  .arc-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px 16px; }
  .arc-cell span, .arc-block span { display: block; font-size: 11px; color: #555; }
  .arc-cell b { display: block; margin-top: 2px; font-size: 14px; font-weight: 600; min-height: 1.2em; border-bottom: 1px solid #ddd; padding-bottom: 2px; }
  .arc-block { margin-top: 8px; }
  .arc-block p { margin: 4px 0 0; min-height: 2.4em; font-size: 14px; line-height: 1.5; border-bottom: 1px solid #ddd; white-space: pre-wrap; }
  .arc-sign { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 24px; margin-top: 36px; font-size: 13px; }
  .arc-sign span { display: inline-block; width: 120px; border-bottom: 1px solid #111; margin-left: 8px; }
  .arc-foot { margin-top: 28px; font-size: 11px; color: #666; }
}
