/* ============================================
   排课管理系统 - 全局样式
   ============================================ */

/* =============================================================================
   ⚠️ 本文件不再定义任何 CSS 令牌（#1172）
   -----------------------------------------------------------------------------
   全站 :root 令牌的唯一权威是 css/design-system.css，它排在本文件之后加载，
   因此同名变量本来就由它说了算 —— 这里再写一份纯属第二个真相来源。

   历史问题：两套 :root 并存，15 个变量取值冲突（--radius 12 vs 14、
   --accent #06b6d4 vs #0891b2、--shadow-glow 两种完全不同的实现……）。
   改一处忘一处，风格必然分裂。现已全部收敛。

   为什么这里一个都不留：
     design-system.css 是旧令牌的**完备超集** —— 本文件原有 33 个令牌
     全部已在其中，包括 3 个本文件独有的 --sidebar-width / --sidebar-collapsed
     / --font-family，都已迁入。留「旧备份」只会制造新的分叉。

   防塌兜底：
     本文件对 3 个**布局级**令牌的使用点全部写成 var(--x, 兜底值)。
     万一 design-system.css 加载失败（404 / 漏进部署白名单），侧边栏宽度
     与字体仍成立，不会退化成 width:auto 或浏览器默认字体。
     纯颜色 / 阴影 / 圆角类令牌不兜底 —— 那种情况下裸底色是可接受的降级。

   判据工具：python _audit_tokens.py → 期望 TOKEN_AUDIT_OK
   ============================================================================= */

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

body {
    /* #1172：令牌迁至 design-system.css，此处保留兜底值防加载失败 */
    font-family: var(--font-family, 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif);
    background: var(--bg-page);
    color: var(--text);
    line-height: 1.6;
    overflow: hidden;
    height: 100vh;
    font-feature-settings: 'cv11', 'ss01';
}

#app {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* ===== 侧边栏（精致深色 + 线性图标） ===== */
.sidebar {
    width: var(--sidebar-width, 244px);   /* #1172 兜底：令牌加载失败时仍是 244px */
    background: var(--bg-sidebar-grad);
    color: var(--text-sidebar);
    display: flex;
    flex-direction: column;
    transition: width 0.28s var(--transition);
    flex-shrink: 0;
    z-index: 100;
    box-shadow: 1px 0 0 rgba(255,255,255,0.04), 8px 0 30px rgba(15,23,42,0.18);
}

.sidebar.collapsed { width: var(--sidebar-collapsed, 72px); }   /* #1172 兜底 */

.sidebar.collapsed .nav-item > span,
.sidebar.collapsed .brand-text,
.sidebar.collapsed .sidebar-footer > span:not(.status-indicator) { display: none; }
.sidebar.collapsed .nav-item { justify-content: center; padding: 13px; gap: 0; }

/* 品牌区 */
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 18px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.brand-mark {
    width: 40px; height: 40px; flex-shrink: 0;
    border-radius: var(--radius-md);
    background: var(--primary-gradient);
    color: #fff;
    font-size: 20px; font-weight: 800;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 6px 16px rgba(99,102,241,0.45);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.25; overflow: hidden; }
.brand-name { font-size: 15px; font-weight: 700; color: #f8fafc; white-space: nowrap; letter-spacing: 0.3px; }
.brand-sub { font-size: 11px; color: var(--text-sidebar-dim); white-space: nowrap; }

.sidebar-nav {
    flex: 1;
    padding: 14px 12px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.sidebar-nav::-webkit-scrollbar { width: 5px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: var(--radius-xs); }

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    color: var(--text-sidebar-dim);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all var(--transition);
    white-space: nowrap;
    font-size: 14px;
    font-weight: 500;
    position: relative;
}
.nav-item:hover {
    background: rgba(255,255,255,0.06);
    color: #f1f5f9;
}
.nav-item.active {
    background: var(--primary-gradient);
    color: #fff;
    box-shadow: 0 6px 16px rgba(99,102,241,0.32);
}
.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0; top: 50%;
    transform: translateY(-50%);
    width: 3px; height: 56%;
    background: #fff;
    border-radius: 0 var(--radius-xs) var(--radius-xs) 0;   /* #1174 */
}
.nav-item.active .nav-icon { filter: drop-shadow(0 0 6px rgba(255,255,255,0.5)); }

.nav-icon {
    width: 20px; height: 20px;
    flex-shrink: 0;
    stroke: currentColor;
    transition: filter var(--transition);
}

/* 侧边栏底部：任务选择 + 状态 */
.sidebar-footer {
    padding: 14px 14px 16px;
    border-top: 1px solid rgba(255,255,255,0.06);
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.task-select-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.task-select-icon { position: absolute; left: 10px; color: var(--text-sidebar-dim); pointer-events: none; }
#task-selector {
    width: 100%;
    padding: 9px 10px 9px 32px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.06);
    color: #e2e8f0;
    font-size: 13px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    transition: all var(--transition);
}
#task-selector:hover { border-color: rgba(255,255,255,0.28); background: rgba(255,255,255,0.1); }
#task-selector:focus { outline: none; border-color: var(--primary-light); }
#task-selector option { background: #1e293b; color: #e2e8f0; }

.status-indicator {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
    color: var(--text-sidebar-dim);
    padding-left: 2px;
}
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 8px rgba(16,185,129,0.6); flex-shrink: 0; }
.status-ok { color: var(--success); }
.status-busy { color: var(--warning); }
.status-busy .status-dot { background: var(--warning); box-shadow: 0 0 8px rgba(245,158,11,0.6); }
.status-error { color: var(--danger); }
.status-error .status-dot { background: var(--danger); box-shadow: 0 0 8px rgba(239,68,68,0.6); }

/* ===== 主内容区 ===== */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 28px;
    background: var(--bg-page);
    position: relative;
}
.main-content::before {
    content: '';
    position: fixed;
    top: -80px; right: -80px;
    width: 420px; height: 420px;
    background: radial-gradient(circle, rgba(99,102,241,0.05) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}
.main-content > * { position: relative; z-index: 1; }

/* ===== 页面通用 ===== */
.page-header {
    margin-bottom: 24px;
}

.page-header h2 {
    font-size: 24px;
    margin-bottom: 4px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: 0.2px;
}

.page-header p {
    color: var(--text-light);
    font-size: 14px;
}

/* ===== 卡片 ===== */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: var(--radius-lg);
    padding: 22px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
    margin-bottom: 16px;
    transition: box-shadow var(--transition), transform var(--transition);
}
.card:hover { box-shadow: var(--shadow-md); }

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
}
.card-header h3 {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

/* ===== 统计卡片 ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 18px;
    margin-bottom: 26px;
}

.stat-card {
    background: var(--bg-card);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: var(--radius-lg);
    padding: 22px;
    box-shadow: var(--shadow);
    text-align: center;
    cursor: pointer;
    border: 1px solid var(--border-light);
    transition: transform var(--transition), box-shadow var(--transition);
    position: relative;
    overflow: hidden;
}
.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--primary-gradient);
    opacity: 0.6;
    transition: opacity var(--transition);
}
.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}
.stat-card:hover::before { opacity: 1; }

.stat-card .stat-value {
    font-size: 34px;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}
.stat-card .stat-label {
    color: var(--text-light);
    font-size: 13px;
    margin-top: 6px;
    font-weight: 500;
}

/* ===== 按钮（渐变+阴影） ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 12px rgba(99,102,241,0.3);
}
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(99,102,241,0.4);
}
.btn-primary:active { transform: translateY(0); }

.btn-success { background: var(--success); color: white; box-shadow: 0 4px 12px rgba(16,185,129,0.25); }
.btn-success:hover { transform: translateY(-1px); opacity: 0.95; }

.btn-warning { background: var(--warning); color: white; box-shadow: 0 4px 12px rgba(245,158,11,0.25); }
.btn-warning:hover { transform: translateY(-1px); opacity: 0.95; }

.btn-danger { background: var(--danger); color: white; box-shadow: 0 4px 12px rgba(239,68,68,0.25); }
.btn-danger:hover { transform: translateY(-1px); opacity: 0.95; }

.btn-outline {
    background: rgba(255,255,255,0.7);
    backdrop-filter: blur(4px);
    border: 1px solid var(--border);
    color: var(--text);
}
.btn-outline:hover { background: white; border-color: var(--primary-light); color: var(--primary); }
/* 方案 A 视图增强：课表查看页开关按钮的「激活」态（按班级色块 / 特殊课程标签） */
.btn.active { background: var(--primary) !important; color: #fff !important; border-color: var(--primary) !important; box-shadow: 0 1px 3px rgba(79,70,229,0.35); }

.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: var(--radius-sm); }
.btn-lg { padding: 12px 28px; font-size: 16px; border-radius: var(--radius-md); }

/* #849 一键修复 · V5 走班引擎长耗时状态 */
/* 走班任务自动升 V5，主 SA 66s + 多轮收尾链，进度常长时间停在前期百分比；
   加紫色脉冲边框提示「仍在跑」，避免用户误判卡死而重复点击。 */
#rb-autofix-btn.autofix-v5 {
  background: linear-gradient(135deg, #7c3aed, #a855f7) !important;
  color: #fff !important;
  border: none !important;
}
#rb-autofix-btn.autofix-stuck {
  animation: autofixStuckPulse 1.2s ease-in-out infinite;
}
@keyframes autofixStuckPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(124, 58, 237, 0.55); }
  50%      { box-shadow: 0 0 0 6px rgba(124, 58, 237, 0); }
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* ===== 表格 ===== */
.table-container {
    overflow-x: auto;
    max-height: 500px;
    overflow-y: auto;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 14px;
}

th, td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
    transition: background var(--transition);
}

th {
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 1;
    color: var(--text);
    font-size: 13px;
    letter-spacing: 0.3px;
}

tr { transition: background var(--transition); }
tbody tr:hover { background: rgba(99,102,241,0.04); }

/* ===== 表单 ===== */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-light);
}

.form-control {
    width: 100%;
    padding: 9px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 14px;
    background: rgba(255,255,255,0.8);
    transition: all var(--transition);
    font-family: inherit;
}
.form-control:hover { border-color: var(--primary-light); }

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
    background: white;
}

select.form-control {
    cursor: pointer;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.form-row-inline { display: flex; flex-wrap: wrap; gap: 18px; margin-bottom: 12px; }
.form-row-inline label { display: flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
.form-row-inline input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; }

/* ===== 标签页 ===== */
.tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border);
    margin-bottom: 16px;
}

.tab {
    padding: 10px 20px;
    cursor: pointer;
    border: none;
    background: none;
    font-size: 14px;
    color: var(--text-light);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}

.tab:hover { color: var(--text); }
.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}

/* ===== 课表样式 ===== */

/* 手动调课课表区域：微深背景让科目色更突出 */
#adjust-grid {
    background: #1e1e2e;
    border-color: #2a2a3c;
}
#adjust-grid .timetable-cell.header {
    background: linear-gradient(135deg, #3b3b5c, #2d2d44);
    color: #e0e0ff;
    font-size: 13px;
}
#adjust-grid .timetable-cell.period-header {
    background: #252538;
    color: #9ca3af;
}
#adjust-grid .timetable-cell.empty {
    background: #1a1a28;
    color: #4b5563;
}
.timetable-grid {
    display: grid;
    grid-template-columns: 70px repeat(5, 1fr);
    gap: 2px;
    background: var(--border);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.timetable-cell {
    background: var(--bg-card);
    padding: 8px 4px;
    text-align: center;
    min-height: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
    position: relative;
}

.timetable-cell:hover {
    filter: brightness(0.95);
    transform: scale(1.02);
    z-index: 1;
}

.timetable-cell.header {
    background: var(--primary);
    color: white;
    font-weight: 600;
    font-size: 14px;
    min-height: 40px;
}

.timetable-cell.period-header {
    background: var(--bg);
    font-weight: 600;
    color: var(--text-light);
}

.timetable-cell.empty {
    color: var(--text-light);
}

/* 按教师调课用白底黑字（不显示科目色） */
#ta-grid .timetable-cell.has-course {
    background: #ffffff !important;
    color: #1e293b !important;
    font-weight: 500;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-sm);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    text-shadow: none;
}

/* 手动调课：选中槽位高亮（白边+放大+发光环） */
.timetable-cell.slot-selected {
    outline: 3px solid #fff !important;
    outline-offset: -3px;
    transform: scale(1.06) !important;
    z-index: 5 !important;
    box-shadow: 0 0 16px rgba(255,255,255,0.7), 0 4px 12px rgba(0,0,0,0.25) !important;
    animation: slot-pulse 1.4s ease-in-out infinite alternate;
}
@keyframes slot-pulse {
    from { box-shadow: 0 0 12px rgba(255,255,255,0.5), 0 4px 12px rgba(0,0,0,0.25); }
    to   { box-shadow: 0 0 20px rgba(255,255,255,0.85), 0 4px 16px rgba(0,0,0,0.3); }
}

/* 手动调课：选中一个后，其他可交换的槽位显示虚线边框提示 */
#adjust-grid .timetable-cell.slot-swap-target:not(.slot-selected):not(.locked) {
    outline: 2px dashed rgba(255,255,255,0.75);
    outline-offset: -2px;
}
#adjust-grid .timetable-cell.slot-swap-target.has-course:not(.slot-selected):not(.locked) {
    filter: brightness(1.08);
}
#adjust-grid .timetable-cell.slot-swap-target.empty:not(.slot-selected) {
    background: rgba(59,130,246,0.12);
    border: 2px dashed #3b82f6;
}

/* 手动调课：已锁定/不可交换的目标降低亮度 */
#adjust-grid .timetable-cell.locked.slot-swap-target,
#adjust-grid .timetable-cell.combined.slot-swap-target {
    opacity: 0.55;
    filter: grayscale(0.4);
    cursor: not-allowed;
}

.timetable-cell.locked::after {
    content: '🔒';
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 10px;
}

/* 教师调课状态徽章 */
.timetable-cell .slot-badge {
    font-size: 10px;
    line-height: 1.2;
    margin-top: 2px;
    padding: 1px 4px;
    border-radius: var(--radius-xs);
    font-weight: 600;
}
.slot-badge.badge-locked { background: rgba(0,0,0,0.5); color: #ddd; }
.slot-badge.badge-hard { background: rgba(231,76,60,0.85); color: #fff; }
.slot-badge.badge-soft { background: rgba(243,156,18,0.85); color: #fff; }
.slot-badge.badge-movable { background: rgba(46,204,113,0.85); color: #fff; }
.slot-badge.badge-other { background: rgba(148,163,184,0.7); color: #fff; }
.slot-badge.badge-free { background: rgba(203,213,225,0.5); color: #94a3b8; }

/* 教师课表各状态格子 hover */
.ta-slot { cursor: pointer; position: relative; transition: all 0.15s; }
.ta-locked { cursor: not-allowed; opacity: 0.85; }
.ta-hard_conflict { opacity: 0.9; }
.ta-free { cursor: pointer; }
.ta-free:hover { background: #e8f5e9 !important; }
.ta-other { cursor: pointer; }
.ta-other:hover { opacity: 0.8; filter: saturate(0.6); }

/* 教师调课：选中某课后，空白格显示该班课表的幽灵预览 */
#ta-grid .timetable-cell.ta-class-ghost {
    border: 1px dashed rgba(255, 255, 255, 0.55) !important;
    opacity: 0.82;
    font-size: 11px;
    line-height: 1.25;
    box-shadow: none;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}
#ta-grid .timetable-cell.ta-class-ghost .cg-name { font-weight: 700; }
#ta-grid .timetable-cell.ta-class-ghost .cg-hint { font-size: 9px; opacity: 0.9; }
/* 该班此格也空闲：淡绿勾，提示移动至此不会与本班冲突 */
#ta-grid .timetable-cell.ta-class-ghost-free {
    background: rgba(34, 197, 94, 0.10) !important;
    border: 1px dashed rgba(34, 197, 94, 0.5) !important;
}

/* 任教班级快捷切换 chips */
.ta-chip {
    padding: 3px 10px;
    font-size: 12px;
    border-radius: var(--radius-md);
    border: 1px solid #cbd5e1;
    background: #fff;
    color: #475569;
    cursor: pointer;
    transition: all 0.15s;
}
.ta-chip:hover { border-color: #6366f1; color: #4338ca; }
.ta-chip.active { background: #6366f1; color: #fff; border-color: #6366f1; }

.timetable-cell .course-name {
    font-weight: 600;
    font-size: 13px;
}

.timetable-cell .teacher-name {
    font-size: 11px;
    opacity: 0.9;
}

/* ===== 进度条 ===== */
.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--border);
    border-radius: var(--radius-xs);
    overflow: hidden;
    margin: 12px 0;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: var(--radius-xs);
    transition: width 0.3s;
}

/* ===== 模态框（通用样式统一在文件后半段，此处仅保留标题规则） ===== */
.modal h3 {
    margin: 0 0 16px;
    font-size: 17px;
    font-weight: 700;
}

/* ===== 模态表单字段（标签在上、控件在下） ===== */
.dm-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}
.dm-field label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}
.readonly-val {
    padding: 8px 12px;
    background: #f3f4f6;
    border-radius: var(--radius-md);
    color: #111827;
    font-weight: 600;
    font-size: 14px;
}
.readonly-val.empty {
    color: #9ca3af;
    font-weight: 400;
}

/* ===== Toast（高可读性：大字、加粗、深色文字、长显示） ===== */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    padding: 14px 24px;
    border-radius: var(--radius-md);
    color: #1a1a2e;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.4;
    box-shadow: 0 8px 30px rgba(0,0,0,0.25), 0 2px 8px rgba(0,0,0,0.15);
    animation: toastSlideIn 0.35s cubic-bezier(0.22,1,0.36,1);
    max-width: 420px;
    min-height: 48px;
    display: flex;
    align-items: center;
    gap: 10px;
    pointer-events: auto;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.3);
}

/* 注意：Utils.toast() 生成的类名是 `toast toast-<type>`（连字符），
   历史上此处写成 `.toast.success` 点连写法从不命中，导致全站提示透明底。
   两种写法都保留，避免个别遗留代码直接加 .success 类时失效。 */
.toast-success, .toast.success { background: linear-gradient(135deg, #22c55e, #16a34a); color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,0.2); }
.toast-error, .toast.error { background: linear-gradient(135deg, #ef4444, #dc2626); color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,0.2); }
.toast-warning, .toast-warn, .toast.warning { background: linear-gradient(135deg, #f59e0b, #d97706); color: #1a1a2e; }
.toast-info, .toast.info { background: linear-gradient(135deg, #3b82f6, #2563eb); color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,0.2); }
/* 未指定类型时的兜底底色，防止无 background 造成透明浮层 */
.toast:not([class*="toast-"]) { background: linear-gradient(135deg, #3b82f6, #2563eb); color: #fff; }

@keyframes toastSlideIn {
    from { transform: translateX(120%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ===== 导入区域 ===== */
.drop-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg);
}

.drop-zone:hover, .drop-zone.drag-over {
    border-color: var(--primary);
    background: rgba(79, 70, 229, 0.05);
}

.drop-zone .drop-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.drop-zone .drop-text {
    color: var(--text-light);
    font-size: 14px;
}

/* ===== 排课结果 ===== */
.result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.result-item {
    background: var(--bg);
    padding: 16px;
    border-radius: var(--radius-md);
    text-align: center;
}

.result-item .result-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
}

.result-item .result-label {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 4px;
}

/* ===== 冲突列表 ===== */
.conflict-list {
    list-style: none;
}

.conflict-item {
    padding: 10px 12px;
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.conflict-item.hard {
    background: #fef2f2;
    border-left: 3px solid var(--danger);
}

.conflict-item.soft {
    background: #fffbeb;
    border-left: 3px solid var(--warning);
}

/* ===== 筛选栏 ===== */
.filter-bar {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.filter-bar select, .filter-bar input {
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 14px;
}

/* ===== 颜色选择器 ===== */
.color-dot {
    display: inline-block;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    vertical-align: middle;
    border: 1px solid rgba(0,0,0,0.1);
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .sidebar {
        width: var(--sidebar-collapsed, 72px);   /* #1172 兜底 */
    }
    .sidebar .nav-item span:not(.nav-icon),
    .sidebar .sidebar-header h1,
    .sidebar .sidebar-footer span { display: none; }
    .main-content { padding: 16px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .timetable-grid { grid-template-columns: 50px repeat(5, 1fr); }

    /* ===== 手动调课移动端适配 ===== */
    .filter-bar { flex-wrap: wrap; }
    .filter-bar select, .filter-bar input { flex: 1 1 auto; min-width: 120px; }
    .ta-grid-scroll, .ps-grid-scroll {
        overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 6px;
    }
    .timetable-grid { grid-template-columns: 52px repeat(5, minmax(64px, 1fr)); min-width: 430px; }
    .timetable-cell { font-size: 11px; padding: 3px 2px; }
    .timetable-cell .course-name { font-size: 12px; font-weight: 600; }
    .timetable-cell .teacher-name { font-size: 10px; }
    /* 悬浮卡在手机上固定底部居中，避免溢出 */
    .ta-popover {
        width: auto; max-width: 92vw;
        left: 50% !important; right: auto !important;
        transform: translateX(-50%);
        top: auto !important; bottom: 12px !important;
    }
    .ps-drag-item { font-size: 12px; }
    .ps-drag-item.draggable { cursor: pointer; }
    .ps-picked { outline: 3px solid var(--primary); outline-offset: -2px;
        background: rgba(79,70,229,0.10) !important; }

    /* 双栏/三栏 → 单栏 */
    .rule-two-col { grid-template-columns: 1fr !important; min-height: auto; }
    .rule-left-col, .rule-right-col { min-height: auto; }
    .combined-3col { grid-template-columns: 1fr !important; min-height: auto; }
    .combined-col { min-height: auto; }
    .wizard-steps { overflow-x: auto; -webkit-overflow-scrolling: touch; flex-wrap: nowrap; }
}

/* ===== 总课表视图 ===== */
.overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 4px;
}

.overview-item {
    background: var(--bg-card);
    border-radius: var(--radius-xs);
    padding: 8px;
    text-align: center;
    font-size: 11px;
    border: 1px solid var(--border);
}

.overview-item .class-name {
    font-weight: 600;
    font-size: 11px;
    margin-bottom: 2px;
}

.overview-item .course-info {
    color: var(--text-light);
}

/* ===== 标签 ===== */
.tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--radius-md);
    font-size: 11px;
    font-weight: 500;
}

.tag-primary { background: #e0e7ff; color: var(--primary); }
.tag-success { background: #d1fae5; color: #065f46; }
.tag-warning { background: #fef3c7; color: #92400e; }
.tag-danger { background: #fee2e2; color: #991b1b; }

/* 按科目教研时间表格 */
.table {
    border-collapse: collapse;
}
.table th, .table td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.table th {
    background: var(--bg);
    font-weight: 600;
    font-size: 13px;
}
.table td select.form-control {
    padding: 4px 6px;
    font-size: 13px;
}
#rc-tbody .rc-period {
    width: 16px;
    height: 16px;
    margin-right: 2px;
    cursor: pointer;
}
#rc-tbody tr:hover {
    background: #f8fafc;
}

/* ===== 排课规则 6 步向导 ===== */
.wizard-steps {
    display: flex;
    gap: 0;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    box-shadow: var(--shadow);
    overflow: hidden;
}
.wizard-step {
    flex: 1;
    text-align: center;
    padding: 14px 10px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
    border: none;
    background: transparent;
    font-family: inherit;
}
.wizard-step::after {
    content: '';
    position: absolute;
    right: 0;
    top: 25%;
    height: 50%;
    width: 1px;
    background: var(--border);
}
.wizard-step:last-child::after { display: none; }
.wizard-step:hover { background: #f8fafc; }
.wizard-step.active { background: #eef2ff; }
.wizard-step.done { background: #f0fdf4; }
.wizard-step .step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #64748b;
    font-weight: 700;
    font-size: 13px;
    margin-bottom: 6px;
    transition: all 0.2s;
}
.wizard-step.active .step-num {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 0 0 4px rgba(79,70,229,0.15);
}
.wizard-step.done .step-num {
    background: #10b981;
    color: #fff;
}
.wizard-step .step-title {
    font-weight: 600;
    font-size: 13px;
    color: #475569;
    margin: 0;
}
.wizard-step.active .step-title { color: var(--primary); }
.wizard-step.done .step-title { color: #065f46; }
.wizard-step .step-desc {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 2px;
}
.wizard-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
    padding: 16px 0 0;
    border-top: 1px solid var(--border);
}
.wizard-actions .btn { min-width: 100px; justify-content: center; }

/* ===== 科目时间偏好矩阵（Step 3） ===== */
.spf-matrix { border-collapse:collapse; width:100%; table-layout:fixed; font-size:12px; }
.spf-matrix th, .spf-matrix td { border:1px solid #e2e8f0; text-align:center; }
.spf-head-corner { background:#f1f5f9; font-weight:600; color:#475569; padding:6px 4px; font-size:11px; }
.spf-head-day { background:#6366f1; color:#fff; padding:5px 2px; font-weight:600; font-size:11px; width:14.28%; }
.spf-head-period { background:#f1f5f9; font-weight:600; color:#475569; padding:6px 4px; font-size:11px; width:36px; }
.spf-cell { cursor:pointer; padding:8px 2px; min-height:32px; transition:all .15s; user-select:none; position:relative; }
.spf-cell:hover { transform:scale(1.1); z-index:2; box-shadow:0 2px 8px rgba(0,0,0,.12); }
.spf-neutral { background:#f8fafc; color:#94a3b8; }
.spf-neutral:hover { background:#f1f5f9; }
.spf-pref { background:#dcfce7; color:#16a34a; border-color:#86efac; font-weight:700; }
.spf-pref:hover { background:#bbf7d0; }
.spf-avoid { background:#fee2e2; color:#dc2626; border-color:#fca5a5; font-weight:700; }
.spf-avoid:hover { background:#fecaca; }

/* 步骤内容面板 */
.wizard-panel {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    padding: 24px;
    min-height: 420px;
}
.wizard-panel .panel-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
}
.wizard-panel .panel-desc {
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 20px;
}

/* 左右两栏布局 */
.rule-two-col {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 20px;
    min-height: 380px;
}
.rule-left-col {
    display: flex;
    flex-direction: column;
}
.rule-right-col {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    overflow: auto;
}
.rule-section-title {
    font-size: 14px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f1f5f9;
}

/* ===== sub-tabs ===== */
.tab-sub-bar {
    display: flex;
    gap: 0;
    margin-bottom: 16px;
    background: #f8fafc;
    border-radius: var(--radius-sm);
    padding: 3px;
    border: 1px solid var(--border);
}
.tab-sub {
    flex: 1;
    background: none;
    border: none;
    padding: 8px 14px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
    border-radius: var(--radius-sm);
    transition: all 0.15s;
    white-space: nowrap;
}
.tab-sub:hover { color: #1e293b; }
.tab-sub.active {
    background: #fff;
    color: var(--primary);
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* ===== 不排课时间网格 ===== */
.unavail-grid-wrap {
    overflow-x: auto;
}
.unavail-grid {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.unavail-grid th, .unavail-grid td {
    padding: 4px 6px;
    border: 1px solid #e8ecf1;
    text-align: center;
    background: #fff;
}
.unavail-grid th {
    background: #f1f5f9;
    font-weight: 600;
    color: #475569;
    font-size: 12px;
}
.unavail-cell {
    width: 44px;
    height: 34px;
    text-align: center;
    vertical-align: middle;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
}
.unavail-cell:hover { background:#f3f4f6; }
.unavail-cell.free {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
}
.unavail-cell.free:hover { background: #bbf7d0; transform: scale(1.08); }
.unavail-cell.blocked {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}
.unavail-cell.blocked:hover { background: #fecaca; transform: scale(1.08); }
.unavail-row-label {
    white-space: nowrap;
    width: 1px;
    vertical-align: middle;
    text-align: left;
}

/* 选择器列表 */
.selector-list {
    max-height: 280px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
}
.selector-item {
    padding: 9px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
    font-size: 13px;
    transition: all 0.1s;
    display: flex;
    align-items: center;
    gap: 8px;
}
.selector-item:hover { background: #f8fafc; }
.selector-item.active {
    background: #eef2ff;
    color: var(--primary);
    font-weight: 600;
    border-left: 3px solid var(--primary);
}
.selector-item .sel-badge {
    font-size: 10px;
    background: #e2e8f0;
    color: #64748b;
    padding: 1px 6px;
    border-radius: var(--radius-md);
    margin-left: auto;
}

/* ===== 排课规则 6 步向导 3 栏布局 ===== */
.combined-3col {
    display: grid;
    grid-template-columns: 240px 260px 1fr;
    gap: 16px;
    min-height: 400px;
}
.combined-col {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px;
    display: flex;
    flex-direction: column;
}
.combined-col h4 {
    margin: 0 0 10px;
    font-size: 13px;
    color: #64748b;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.combined-col .col-scroll {
    flex: 1;
    overflow-y: auto;
    max-height: 340px;
}
.cb-item {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    margin-bottom: 8px;
    font-size: 13px;
    transition: all 0.15s;
}
.cb-item:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.cb-item .cb-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.cb-item .cb-item-meta {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 4px;
}
.cb-item .cb-item-classes {
    font-size: 11px;
    color: #475569;
    margin-top: 3px;
    background: #f1f5f9;
    padding: 3px 6px;
    border-radius: var(--radius-xs);
}

/* 合班班级复选框列表 */
.cb-class-cb-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 13px;
    cursor: pointer;
}
.cb-class-cb-item:hover { background: #f8fafc; }
.cb-class-cb-item input[type="checkbox"] { cursor: pointer; }

/* ===== 预排表格 ===== */
.ps-cell {
    min-height: 48px;
    padding: 3px;
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    gap: 2px;
    align-items: stretch;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.15s;
}
.ps-cell.empty {
    background: #f8fafc;
    color: #cbd5e1;
    justify-content: center;
    align-items: center;
    font-size: 18px;
    border: 1px dashed #e2e8f0;
}
.ps-cell.empty:hover {
    background: #dbeafe;
    color: #3b82f6;
    border-color: #93c5fd;
    border-style: solid;
}
.ps-cell.filled {
    background: #dbeafe;
    border: 1px solid #93c5fd;
    padding: 2px;
}
.ps-tag {
    background: #fff;
    color: #1e40af;
    padding: 2px 5px;
    border-radius: var(--radius-xs);
    line-height: 1.3;
    border: 1px solid #c7d2fe;
    cursor: pointer;
    font-size: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ps-tag:hover { background: #fef3c7; border-color: #fbbf24; }

/* ===== 调课页颜色图例 ===== */
.adjust-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 13px;
    padding: 8px;
    background: #f8fafc;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}
.legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
}
.legend-swatch {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: var(--radius-xs);
}

/* ===== 排课规则附加样式 ===== */
/* Step 4 配置卡片 */
.config-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 12px;
}
.config-card h4 {
    font-size: 15px;
    margin-bottom: 4px;
}
.config-card .config-card-desc {
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 14px;
}
.config-card .form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
}
.config-card .form-group {
    margin-bottom: 0;
}
.config-card .form-group label {
    font-size: 12px;
    font-weight: 500;
    color: #64748b;
    margin-bottom: 4px;
}
.config-card .form-control {
    font-size: 14px;
    padding: 8px 12px;
}

/* ============================================
   导入页面
   ============================================ */
.import-card {
    margin-bottom: 16px;
}

.import-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 18px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.import-card-head > div:first-child {
    flex: 1;
    min-width: 0;
}

.import-card-head h3 {
    font-size: 17px;
    margin-bottom: 4px;
}

.import-card-desc {
    font-size: 13px;
    color: var(--text-light);
    line-height: 1.5;
    margin: 0;
}

.import-dropzone {
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 38px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg);
}

.import-dropzone:hover,
.import-dropzone.drag-over {
    border-color: var(--primary);
    background: rgba(79, 70, 229, 0.05);
}

.import-dropzone .drop-icon {
    font-size: 42px;
    margin-bottom: 10px;
}

.import-dropzone .drop-text {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
}

.import-dropzone .drop-hint {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 4px;
}

/* 强调型拖拽区（学校原始格式） */
.import-dropzone-accent {
    border-color: var(--primary-light);
    background: rgba(79, 70, 229, 0.04);
}

.import-dropzone-accent:hover,
.import-dropzone-accent.drag-over {
    border-color: var(--primary);
    background: rgba(79, 70, 229, 0.08);
}

.import-preview-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.import-preview-head h4 {
    font-size: 15px;
}

.import-progress-text {
    font-size: 13px;
    color: var(--text-light);
    margin: 6px 0 0;
}

/* 危险操作区 */
.import-danger-zone {
    border: 1px solid #fecaca;
    background: #fff8f8;
}

.import-danger-zone .import-card-head {
    border-bottom-color: #fecaca;
}

.import-danger-actions {
    display: flex;
    flex-direction: column;
}

.import-danger-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 16px 0;
}

.import-danger-item:first-child {
    padding-top: 4px;
}

.import-danger-item strong {
    font-size: 14px;
    display: block;
    margin-bottom: 2px;
}

.import-danger-item .import-card-desc {
    margin: 0;
}

.import-danger-divider {
    height: 1px;
    background: var(--border);
    margin: 0;
}

/* ============================================
   任务管理页面
   ============================================ */
.task-new-form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.task-new-form .form-control {
    flex: 1;
    min-width: 160px;
}

.task-new-form .btn {
    flex-shrink: 0;
}

.task-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
}

.task-actions .form-control {
    width: 130px;
    font-size: 12px;
    padding: 5px 8px;
}

.current-task-tag {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 8px;
    font-size: 11px;
    font-weight: 600;
    color: var(--primary);
    background: #eef2ff;
    border-radius: var(--radius-md);
}

.preset-config {
    font-family: monospace;
    font-size: 12px;
    color: var(--text-light);
    word-break: break-all;
}

/* 教研时间表格 */
.research-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.research-table th {
    background: #f8fafc;
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    color: #475569;
    border-bottom: 2px solid var(--border);
}
.research-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}
.research-table tr:hover td { background: #f8fafc; }
.research-table select.form-control {
    width: auto;
    min-width: 90px;
    padding: 5px 8px;
    font-size: 13px;
}
.rc-period-btn {
    display: inline-block;
    width: 20px;
    height: 20px;
    margin: 0 1px;
    border-radius: var(--radius-xs);
    border: 1px solid #e2e8f0;
    background: #f1f5f9;
    cursor: pointer;
    font-size: 9px;
    line-height: 18px;
    text-align: center;
    color: #94a3b8;
    transition: all 0.15s;
}
.rc-period-btn:hover { background: #e2e8f0; }
.rc-period-btn.active {
    background: #ef4444;
    color: #fff;
    border-color: #dc2626;
}

/* 教案平齐表格 */
.sync-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.sync-table th {
    background: #f8fafc;
    padding: 8px 10px;
    text-align: center;
    font-weight: 600;
    color: #475569;
    border-bottom: 2px solid var(--border);
    font-size: 12px;
}
.sync-table td {
    padding: 7px 10px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}
.sync-table tr:hover td { background: #fafafa; }
.sync-table td:first-child { text-align: left; }
.sync-table input[type="radio"] { cursor: pointer; width: 16px; height: 16px; }

/* Step 6 排课结果 */
.schedule-result {
    background: linear-gradient(135deg, #f0fdf4, #ecfdf5);
    border: 2px solid #86efac;
    border-radius: var(--radius-md);
    padding: 24px;
    margin-top: 16px;
}
.schedule-result h3 { margin-bottom: 16px; }
.schedule-result .result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
}

/* 提示横幅 */
.rule-tip {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 12px;
    color: #92400e;
    margin-bottom: 14px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}
.rule-tip .tip-icon { font-size: 16px; flex-shrink: 0; }

/* ============================================
   教师调整 - 悬浮详情卡 / 迷你课表 / 预览弹窗
   ============================================ */
.ta-popover {
    position: fixed;
    z-index: 1200;
    width: 300px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 14px;
    font-size: 13px;
    display: none;
}
.ta-popover.show { display: block; }

.ta-pop-head { margin-bottom: 8px; }
.ta-pop-course { font-size: 15px; font-weight: 700; color: var(--text); }
.ta-pop-meta { font-size: 12px; color: var(--text-light); margin-top: 2px; }

.ta-pop-status {
    display: inline-block;
    padding: 2px 10px;
    border-radius: var(--radius-md);
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 6px;
}
.ta-pop-status.badge-locked { background: #e5e7eb; color: #374151; }
.ta-pop-status.badge-hard { background: #fee2e2; color: #991b1b; }
.ta-pop-status.badge-soft { background: #fef3c7; color: #92400e; }
.ta-pop-status.badge-movable { background: #d1fae5; color: #065f46; }

.ta-pop-conflict {
    font-size: 12px;
    color: var(--danger);
    background: #fef2f2;
    border-radius: var(--radius-sm);
    padding: 6px 8px;
    margin-bottom: 8px;
    line-height: 1.4;
}

.ta-pop-actions { display: flex; gap: 6px; margin-bottom: 10px; }

.ta-pop-section-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-light);
    border-top: 1px solid var(--border);
    padding-top: 8px;
    margin-bottom: 6px;
}

.ta-mini-grid {
    display: grid;
    grid-template-columns: 22px repeat(5, 1fr);
    gap: 2px;
    font-size: 10px;
}
.ta-mini-corner { background: transparent; }
.ta-mini-h { text-align: center; color: var(--text-light); font-weight: 600; padding: 2px 0; }
.ta-mini-p { display: flex; align-items: center; justify-content: center; color: var(--text-light); }
.ta-mini-cell {
    border-radius: var(--radius-xs);
    padding: 3px 2px;
    text-align: center;
    line-height: 1.15;
    color: #fff;
    min-height: 26px;
    overflow: hidden;
}
.ta-mini-cell.empty { background: #f1f5f9; min-height: 26px; }

/* 移动预览弹窗 — 用 .modal--narrow 限定窄宽，不再覆盖通用 .modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}
.modal-overlay.hidden { display: none; }
.modal {
    background: var(--bg-card, #fff);
    border-radius: var(--radius-md);
    padding: 24px;
    width: 520px;
    max-width: 92vw;
    max-height: 85vh;
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
/* 窄版弹窗（移动预览等） */
.modal--narrow {
    width: 400px;
}
.modal-title { font-size: 17px; font-weight: 700; margin-bottom: 12px; }
.modal-summary { font-size: 14px; color: var(--text); margin-bottom: 12px; line-height: 1.5; }
.modal-body { font-size: 14px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border, #e2e8f0); }
.conflict-ok {
    background: #ecfdf5;
    color: #065f46;
    border-radius: var(--radius-sm);
    padding: 12px;
    font-size: 14px;
    font-weight: 600;
}
.conflict-list { display: flex; flex-direction: column; gap: 6px; max-height: 240px; overflow-y: auto; }
.conflict-item {
    border-radius: var(--radius-sm);
    padding: 8px 10px;
    font-size: 13px;
    line-height: 1.4;
}
.conflict-item.hard { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.conflict-item.soft { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }

/* ============================================
   通用表单 / 布局工具类（统一替代内联 style）
   ============================================ */
.field-label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: #64748b;
    margin-bottom: 4px;
}
.field-group { margin-bottom: 8px; }
.field-group:last-child { margin-bottom: 0; }

.inline-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.btn-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
}
.hint-text {
    font-size: 12px;
    color: var(--text-light);
}
.section-gap { margin-top: 12px; }
.divider-top { border-top: 1px solid var(--border); padding-top: 12px; }

/* 添加表单高亮面板（预排等） */
.add-form-panel {
    margin-top: 16px;
    padding: 16px;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: var(--radius-md);
}

/* 空状态提示 */
.empty-hint {
    text-align: center;
    color: #94a3b8;
    padding: 60px 0;
}
.empty-hint-sm {
    text-align: center;
    color: #94a3b8;
    padding: 20px;
}

/* 紧凑选项说明（教研/配置中的小字） */
.cfg-note {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 4px;
}
.text-right { text-align: right; }
.mb-12 { margin-bottom: 12px; }
.inline-label { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; }

/* 教案平齐表头对齐 */
.sync-table th { text-align: left; }
.sync-table th:nth-child(1), .sync-table th:nth-child(2) { width: 100px; }

/* 配置卡内的等宽文本输入（JSON 等） */
.config-card textarea.form-control { font-family: monospace; font-size: 13px; }

/* ============================================
   预排页面 —— 拖拽教师列表 + 时段网格
   ============================================ */
.ps-teacher-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    overflow: hidden;
}
.ps-teacher-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    cursor: pointer;
    background: #f8fafc;
    font-weight: 600;
    font-size: 13px;
    user-select: none;
}
.ps-teacher-header:hover { background: #f1f5f9; }
.ps-teacher-name { color: var(--text); }
.ps-teacher-count {
    font-size: 11px; color: var(--text-light); white-space: nowrap;
}
.ps-assign-list { padding: 6px 8px 8px; }

.ps-drag-item {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 7px 9px;
    margin-bottom: 4px;
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
    background: #fff;
    cursor: grab;
    transition: all 0.15s;
    user-select: none;
}
.ps-drag-item:hover { border-color: var(--primary-light); box-shadow: var(--shadow); }
.ps-drag-item.scheduled { opacity: 0.55; border-style: solid; border-color: #d1fae5; background: #f0fdf4; cursor: default; }
.ps-drag-item.dragging { opacity: 0.3; transform: scale(0.96); }
.ps-drag-dot {
    width: 8px; height: 28px; border-radius: var(--radius-xs); flex-shrink: 0;
}
.ps-drag-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ps-drag-course { font-size: 13px; font-weight: 600; color: var(--text); line-height: 1.25; }
.ps-drag-meta { font-size: 11px; color: var(--text-light); line-height: 1.2; }
.ps-drag-badge {
    font-size: 12px; font-weight: 700; color: #065f46; flex-shrink: 0;
}

/* 网格格子拖放目标 */
.ps-drop-target { position: relative; transition: all 0.15s; }
.ps-cell-over { outline: 3px solid var(--primary); outline-offset: -2px; background: rgba(79,70,229,0.06) !important; z-index: 2; }

/* 预排标签（可删除） */
.ps-tag-del {
    float:right; width:16px; height:16px; line-height:14px; text-align:center;
    border-radius:50%; background:#fecaca;color:#991b1b;font-size:11px;cursor:pointer;margin-left:4px;
    border:none;padding:0;font-weight:bold;
}
.ps-tag-del:hover { background:#ef4444; color:#fff; }

/* ===== 预排页面：筛选栏与优化 ===== */
.ps-filter-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}
.ps-select {
    flex: 1;
    font-size: 12px !important;
    padding: 5px 8px !important;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text);
    cursor: pointer;
    min-width: 0;
}
.ps-select:focus {
    border-color: var(--primary-light);
    outline: none;
    box-shadow: 0 0 0 2px rgba(79,70,229,0.12);
}
.ps-filter-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.ps-search-input {
    flex: 1;
    font-size: 12px !important;
    padding: 5px 10px !important;
}
.ps-filter-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--text-light);
    cursor: pointer;
    padding: 4px 10px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    white-space: nowrap;
    user-select: none;
    transition: all 0.15s;
    flex-shrink: 0;
}
.ps-filter-toggle input { display: none; }
.ps-filter-toggle:hover { border-color: var(--primary-light); }
.ps-filter-toggle.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.ps-un-count { color: #e74c4c; font-weight: 700; }
.ps-drag-hint {
    font-size: 10px;
    color: #94a3b8;
    flex-shrink: 0;
    padding: 1px 6px;
    border-radius: var(--radius-sm);
    background: #f1f5f9;
}
/* 可拖拽态（区别于已排） */
.ps-drag-item.draggable { cursor: grab; }
.ps-drag-item.draggable:hover { 
    border-color: var(--primary); 
    box-shadow: 0 2px 8px rgba(79,70,229,0.15);
    transform: translateY(-1px);
}
.ps-drag-item.draggable:active { cursor: grabbing; }
.btn-danger { 
    color: #dc2626; 
    border-color: #fca5a5; 
    background: #fef2f2; 
}
.btn-danger:hover { 
    background: #fee2e2; 
    border-color: #ef4444; 
}

/* 左侧列表容器固定高度可滚动 */
#ps-teacher-list {
    max-height: calc(100vh - 320px);
    overflow-y: auto;
    padding-right: 4px;
}
#ps-teacher-list::-webkit-scrollbar { width: 5px; }
#ps-teacher-list::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: var(--radius-xs); }
#ps-teacher-list::-webkit-scrollbar-track { background: transparent; }

/* 右侧网格容器也限制高度 */
#ps-grid-wrap {
    max-height: calc(100vh - 280px);
    overflow-y: auto;
}

/* ============================================
   富文本课表（课表查看 / 手动调整 共用）
   ★ 统一 .tt-table 定义（原 2049+2503 两套合并为 2503 一套）
   ============================================ */
.stat-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

/* ★ 统一 .tt-table —— 唯一定义，避免两套共存导致的渲染不一致 */
.tt-table {
    border-collapse: collapse;
    width: 100%;
    background: #fff;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,.05);
    table-layout: fixed;
    font-size: 13px;
    border: 1px solid var(--border);
    /* ★ 关键修复：阻止 flex shrink 压缩表格行高。
       当 .man-main 内容超出容器高度时，flex 默认会压缩子项，导致空行塌陷。 */
    flex-shrink: 0;
}
.tt-table th, .tt-table td {
    border: 1px solid #eef2f7;
    padding: 0;
    text-align: center;
    font-size: 13px;
    min-width: 64px;
}
/* 提高特异性，让 .tt-cell 的 padding 不被 .tt-table td 覆盖 */
.tt-table td.tt-cell { padding: 2px; }
/* 表头 */
.tt-table th {
    background: var(--primary);
    color: #fff;
    font-weight: 600;
    padding: 10px 6px;
}
/* 行号列（左侧第一列）—— 用 td 不是 th，所以用 .tt-rowhead 匹配 */
.tt-rowhead {
    height: 46px;
    line-height: 46px;
    overflow: hidden;
    background: linear-gradient(180deg, #f8fafc, #f1f5f9);
    font-weight: 600;
    color: #475569;
    font-size: 12px;
    width: 32px;
    text-align: center;
    white-space: nowrap;
}
/* ★ 强制每行高度 —— 用 height 而非 min-height（td/tr 的 min-height 在表格中不被浏览器遵守） */
.tt-table tbody tr { height: 46px; }
/* 单元格 */
.tt-cell {
    vertical-align: top;
    height: 46px;
    overflow: hidden;
    position: relative;
    border: 1px solid #eef2f7;
    padding: 4px 2px;
    font-size: 12px;
    transition: background-color 0.15s, box-shadow 0.15s;
}
.tt-cell.empty { background: #f1f5f9; height: 46px; overflow: hidden; border: 1px solid #e2e8f0; }
/* ★ 班级不排课时间标记：明确显示为「不排课」，区别于普通灰空格 */
.tt-cell.class-unavail { background: #fef2f2; height: 46px; overflow: hidden; border: 1px dashed #fca5a5; color: #dc2626; text-align: center; vertical-align: middle; font-weight: 700; font-size: 13px; line-height: 1.1; cursor: not-allowed; }
/* 选中课后：每个格子按「换过去是否冲突」着色（占用格也参与，支持交换） */
.tt-cell.tt-movable { background: #ecfdf5 !important; border: 1px solid #a7f3d0; cursor: pointer; position: relative; }
.tt-cell.tt-movable:hover { background: #d1fae5 !important; border-color: #34d399; }
.tt-cell.tt-blocked { background: #fef2f2 !important; border: 1px solid #fecaca; cursor: not-allowed; position: relative; }
.tt-cell.tt-blocked .tt-course { opacity: 0.6; }
.tt-cell.tt-sel-cell { outline: 3px solid #f59e0b; outline-offset: -2px; }
/* #886 批量模式多选高亮 */
.tt-cell.tt-multi { outline: 3px solid #2563eb; outline-offset: -2px; background: #eff6ff !important; box-shadow: inset 0 0 0 1px #93c5fd; z-index: 2; }
.tt-cell.tt-multi::after { content: '☑'; position: absolute; top: 1px; right: 3px; font-size: 11px; color: #2563eb; opacity: 0.8; pointer-events: none; }
/* #907 目标格高亮（源课=橙实框 tt-selected，目标=绿虚框 tt-target，区分更清晰） */
.tt-cell.tt-target { outline: 3px dashed #059669; outline-offset: -2px; background: #ecfdf5 !important; box-shadow: inset 0 0 0 1px #6ee7b7; z-index: 2; }
/* #909-C 源课选中高亮：橙实框 + 浅橙底（先前缺失 .tt-cell.tt-selected 规则导致选不中无反馈，已补） */
.tt-cell.tt-selected { outline: 3px solid #f59e0b; outline-offset: -2px; background: #fffbeb !important; box-shadow: inset 0 0 0 1px #fcd34d; z-index: 2; }
/* #909-C 拖拽经过目标格的实时预览高亮（蓝点框，区别于已选定/目标绿框） */
.tt-cell.tt-dragover { outline: 3px dashed #2563eb; outline-offset: -2px; background: #eff6ff !important; box-shadow: inset 0 0 0 1px #93c5fd; z-index: 3; }
/* #909 键盘光标高亮（浅灰描边，区别于源课橙框/目标绿框） */
.tt-cell.tt-cursor { outline: 2px solid #94a3b8; outline-offset: -1px; box-shadow: 0 0 0 2px rgba(148,163,184,.25); }
/* #886 批量操作栏 + 请假栏 */
.studio-batchbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 8px 0; padding: 8px 10px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: var(--radius-sm); font-size: 13px; }
.studio-batch-preview { font-size: 12px; color: #334155; margin-left: 4px; }
.studio-candidates { margin-top: 8px; }
.studio-candidates .studio-cand:hover { background: #f1f5f9 !important; border-color: #93c5fd !important; }
/* #961 批量/整块平移方案B：目标天/节为主，前/后1天降级为小图标微调；释放缓冲区收进「更多」折叠 */
.studio-nudge { padding: 2px 8px !important; font-weight: 700; line-height: 1.2; }
.studio-secondary { font-size: 12px; }
.studio-secondary > summary { cursor: pointer; color: #64748b; padding: 2px 4px; user-select: none; list-style: none; }
.studio-secondary > summary::-webkit-details-marker { display: none; }
.studio-secondary > summary::before { content: '▸ '; }
.studio-secondary[open] > summary::before { content: '▾ '; }
.studio-secondary > * { margin: 2px 4px 2px 0; }
/* #913 智能推荐·多目标分项预览卡片（#871-C Pareto 维度：硬冲突/软分/节律并列） */
.studio-cand-obj { display: flex; gap: 6px; margin-left: auto; align-items: stretch; }
.obj-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 48px; padding: 3px 7px; border-radius: var(--radius-sm); background: #f8fafc; border: 1px solid #e2e8f0; line-height: 1.15; }
.obj-tile .obj-k { font-size: 10px; color: #64748b; }
.obj-tile .obj-v { font-size: 13px; font-weight: 700; color: #0f172a; }
.obj-tile .obj-d { font-size: 10px; font-weight: 600; }
.obj-good .obj-v, .obj-good .obj-d { color: #059669; }
.obj-bad .obj-v, .obj-bad .obj-d { color: #dc2626; }
.obj-warn .obj-v, .obj-warn .obj-d { color: #d97706; }
.obj-best .obj-v { color: #0ea5e9; }
.obj-neutral .obj-v { color: #0f172a; }
/* #915 触屏拖拽幽灵提示 */
.studio-touch-ghost { position: fixed; z-index: 9999; transform: translate(-50%, -50%); pointer-events: none; background: #f59e0b; color: #fff; padding: 6px 12px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 700; box-shadow: 0 4px 12px rgba(0,0,0,.3); opacity: .95; max-width: 60vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 520px) { .studio-cand-obj { width: 100%; margin-left: 0; justify-content: flex-start; } }
/* 空位格子：仅用背景色+伪元素显示✓/×，不显示文字 */
.tt-cell.tt-movable::after { content: '✓'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 14px; color: #059669; opacity: 0.25; pointer-events: none; z-index: 1; }
.tt-cell.tt-movable:hover::after { opacity: 0.55; }
.tt-cell.tt-blocked::after { content: '×'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 12px; color: #ef4444; opacity: 0.3; pointer-events: none; }
/* 选中后高亮同班同师的其他课格 */
.tt-cell.tt-same-teacher { box-shadow: inset 0 0 0 2px #818cf8 !important; background: #eef2ff !important; }
.tt-cell.tt-same-teacher .tt-course { background: #c7d2fe; border-color: #a5b4fc; }
/* #924 A-1 拖前冲突预判：悬停目标位实时预警。
   硬冲突=红框+⚠红点（不可落库），软冲突=黄框+⚠黄点（可落库但质量下降）。
   层级低于选中橙框(tt-selected)，避免遮住源课；仅作目标位风险提示。 */
.tt-cell.tt-conflict-pending { outline: 3px solid #dc2626 !important; outline-offset: -2px; background: #fef2f2 !important; box-shadow: inset 0 0 0 1px #fca5a5 !important; }
.tt-cell.tt-conflict-soft { outline: 3px solid #f59e0b !important; outline-offset: -2px; background: #fffbeb !important; box-shadow: inset 0 0 0 1px #fcd34d !important; }
/* #962 选中目标经后端预览确认产生硬冲突：把绿底绿勾改成红底冲突态，避免用户误以为可落库 */
.tt-cell.tt-target-invalid { outline: 3px solid #dc2626 !important; outline-offset: -2px; background: #fef2f2 !important; box-shadow: inset 0 0 0 1px #fca5a5 !important; }
/* ⚠ 冲突红点/黄点：挂在格右上角，hover 显示冲突链 tooltip */
.studio-preview-dot { position: absolute; top: 2px; right: 2px; width: 16px; height: 16px; border-radius: 50%; font-size: 11px; line-height: 16px; text-align: center; color: #fff; font-weight: 700; z-index: 4; pointer-events: auto; box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.studio-preview-dot.hard { background: #dc2626; }
.studio-preview-dot.soft { background: #f59e0b; }
.studio-preview-dot::after { content: '⚠'; }
.tt-cell { position: relative; }
.tt-cell .tt-course { font-weight: 600; line-height: 1.2; display: block; width: 100%; min-height: 36px; cursor: pointer; box-sizing: border-box; }
/* 颜色区分各科模式：高饱和亮色圆角药丸 + 加粗白字（参考截图风格） */
.tt-cell .tt-course[style*="background"] { border-radius: var(--radius-md); padding: 4px 6px; min-height: 44px; border: none; color: #fff !important; font-weight: 700; font-size: 13px; text-shadow: 0 1px 2px rgba(0,0,0,.25); box-shadow: inset 0 1px 0 rgba(255,255,255,.2), inset 0 -1px 2px rgba(0,0,0,.15), 0 1px 3px rgba(0,0,0,.12); display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.2; position: relative; overflow: hidden; }
.tt-cell .tt-course[style*="background"]::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 45%; background: linear-gradient(180deg, rgba(255,255,255,.18) 0%, rgba(255,255,255,.05) 100%); border-radius: var(--radius-sm) var(--radius-sm) 50% 50%; pointer-events: none; }   /* #1174 */
.tt-cell .tt-course[style*="background"] .tt-teacher { color: #1a1a1a !important; text-shadow: 0 1px 1px rgba(255,255,255,.6); opacity: 1; font-size: 10.5px; font-weight: 600; }
.tt-cell .tt-course[style*="background"] .tt-class { color: #1a1a1a !important; text-shadow: 0 1px 1px rgba(255,255,255,.6); opacity: .9; font-size: 10px; }
.tt-cell .tt-course.tt-selected { outline: 3px solid #f59e0b; outline-offset: -2px; z-index: 2; box-shadow: 0 0 0 3px rgba(245,158,11,.3); cursor: pointer; }
.tt-cell .tt-teacher { font-size: 11px; opacity: 0.9; }
.tt-cell .tt-class { font-size: 10px; opacity: 0.7; margin-top: 1px; }
.tt-cell .tt-lock { position: absolute; top: 2px; right: 3px; font-size: 10px; }
/* 合班/走班课标记：醒目橙边 + 🔗 角标，提示"必须所有班级一起调整" */
.tt-course.tt-combined { box-shadow: inset 0 0 0 2px #f59e0b; border-radius: var(--radius-xs); position: relative; }
.tt-course.tt-combined::before { content: '\01F517'; font-size: 10px; margin-right: 2px; vertical-align: middle; }
/* 彩色模式下：橙边叠加在色块内阴影之上，保证合班标记仍可见 */
.tt-cell .tt-course.tt-combined[style*="background"] { box-shadow: inset 0 0 0 3px #fbbf24, inset 0 1px 3px rgba(0,0,0,.22); }
.mant-tt-course.tt-combined { box-shadow: inset 0 0 0 2px #f59e0b; position: relative; }
.mant-tt-course.tt-combined[style*="background"] { box-shadow: inset 0 0 0 3px #fbbf24, inset 0 1px 3px rgba(0,0,0,.18); }
.mant-tt-course.tt-combined::before { content: '\01F517'; font-size: 9px; margin-right: 1px; }
/* 预排锁定槽位：主网格高亮 + 🔒 角标（与合班 🔗 用 ::after 区分，避免冲突）。
   关闭「显示预排锁定」时（body.man-hide-locked）隐藏视觉，等同普通课格。 */
.tt-course.tt-locked { box-shadow: inset 0 0 0 2px #f59e0b; border-radius: var(--radius-xs); position: relative; }
.tt-course.tt-locked::after { content: '\01F512'; position: absolute; top: 1px; right: 2px; font-size: 9px; line-height: 1; }
.tt-cell .tt-course.tt-locked[style*="background"] { box-shadow: inset 0 0 0 2px #f59e0b, inset 0 1px 3px rgba(0,0,0,.22); }
body.man-hide-locked .tt-course.tt-locked { box-shadow: none; }
body.man-hide-locked .tt-course.tt-locked::after { content: none; }
body.man-hide-locked .mant-tt-course.tt-locked::after { content: none; }
.tt-cell .tt-badge {
    display: inline-block;
    margin-top: 2px;
    padding: 0 5px;
    border-radius: var(--radius-sm);
    font-size: 9px;
    font-weight: 700;
    color: #fff;
}
.tt-badge.badge-danger { background: #ef4444; }
.tt-badge.badge-warn { background: #f59e0b; }
.tt-cell.conflict-hard { box-shadow: inset 0 0 0 2px #ef4444; }
.tt-cell.conflict-soft { box-shadow: inset 0 0 0 2px #f59e0b; }
/* 教室临时预约占用叠加（#621）：斜纹红底，优先级高于课表内容，始终显示 */
.tt-cell.room-booked { background: repeating-linear-gradient(45deg, #fff7ed, #fff7ed 6px, #fed7aa 6px, #fed7aa 12px) !important; border: 1px solid #fdba74 !important; }
.tt-cell.room-booked .tt-booked { display: flex; align-items: center; justify-content: center; min-height: 40px; text-align: center; font-size: 11px; font-weight: 700; color: #9a3412; line-height: 1.2; }
/* 冲突面板 → 网格 高亮定位（P0-1）：由 highlightConflicts 叠加，把冲突单元格显著标红框 */
.tt-cell.tt-conflict-cell-hard { box-shadow: inset 0 0 0 3px #ef4444 !important; background: #fef2f2 !important; }
.tt-cell.tt-conflict-cell-soft { box-shadow: inset 0 0 0 3px #f59e0b !important; background: #fffbeb !important; }
.tt-cell.conflict-flash { animation: conflictFlash 0.9s ease-in-out 0s 3; z-index: 3; }
@keyframes conflictFlash {
  0%, 100% { box-shadow: inset 0 0 0 3px #ef4444; background: #fef2f2; }
  50% { box-shadow: inset 0 0 0 7px #ef4444; background: #fee2e2; }
}
.tt-cell.locked {
    background-image: repeating-linear-gradient(45deg, rgba(0,0,0,0.04) 0 6px, transparent 6px 12px);
}
.tt-cell.editable { cursor: pointer; }
.tt-cell.editable:hover { transform: scale(1.02); z-index: 1; box-shadow: var(--shadow-md); }
.tt-cell.selected { outline: 3px solid var(--primary); outline-offset: -3px; z-index: 2; }

/* 全校总表分块 */
.tt-block { margin-bottom: 22px; }
.tt-block-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
    padding-left: 8px;
    border-left: 3px solid var(--primary);
}
.tt-block-grid { overflow-x: auto; }

/* ============================================
   按教师调整 — 工具栏 + 两栏布局 + 颜色态
   ============================================ */
.ta-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 8px 12px;
    background: #f8fafc;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    margin-bottom: 12px;
}
.ta-toolbar label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: var(--text);
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}
.ta-toolbar input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}
.ta-toolbar .ta-tb-spacer { flex: 1; }

.ta-two-col {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 380px;
    gap: 16px;
    align-items: start;
}
.ta-right-col {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.ta-section-title {
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    background: #f8fafc;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--primary);
}
.ta-mini-grid-wrap {
    overflow: auto;
    max-height: 360px;
    background: #fff;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}
.ta-mini-grid-wrap .timetable-cell {
    font-size: 10px;
    padding: 3px 2px;
    min-height: 30px;
}
.ta-mini-grid-wrap .course-name { font-size: 10px; }
.ta-mini-grid-wrap .teacher-name { font-size: 9px; }
@media (max-width: 768px) {
    .ta-two-col { grid-template-columns: 1fr; }
}

/* 教师调课三栏布局（hover 预览 + 校验着色） */
.ta-three-col {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 12px;
    align-items: start;
}
.ta-three-col .ta-left-col {
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow: hidden;
}
.ta-three-col .ta-right-col {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.ta-preview-box {
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(6px);
    border-radius: var(--radius-md);
    border: 1px solid #e2e8f0;
    padding: 10px 8px;
    overflow-x: auto;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.ta-preview-box h5 {
    margin: 0 0 6px;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
}
.ta-preview-grid .timetable-cell {
    font-size: 10px;
    padding: 3px 2px;
    min-height: 30px;
    cursor: default;
    font-weight: 500;
}
.ta-preview-grid .timetable-cell.empty { min-height: 30px; }
.ta-preview-grid .course-name { font-size: 10px; }
.ta-preview-grid .teacher-name { font-size: 9px; }

/* 校验着色 */
.ta-valid-conflict-free {
    background: #22c55e !important;
    color: #fff !important;
    box-shadow: 0 0 8px rgba(34,197,94,0.4);
    border: 2px solid #16a34a !important;
}
.ta-valid-conflict-free .slot-badge { display: none; }
.ta-valid-locked {
    opacity: 0.35;
    pointer-events: none !important;
    filter: grayscale(0.7);
    cursor: not-allowed !important;
}
.ta-inline-buffer {
    margin-top: 4px;
    border-top: 1px dashed #cbd5e1;
    padding-top: 8px;
}
.ta-inline-buffer .ta-buffer-drop {
    min-height: 40px;
    gap: 4px;
    padding: 6px;
}

/* 校验ON态覆盖（父类开关 + 黑白色调，避免亮色扎眼） */
#ta-grid.ta-validation-on .ta-target-valid {
    background: rgba(15, 23, 42, 0.05) !important;
    color: inherit !important;
    border: 2px solid #1e293b !important;
    box-shadow: 0 1px 4px rgba(0,0,0,0.15) !important;
    position: relative;
}
#ta-grid.ta-validation-on .ta-target-valid::after {
    content: '✓';
    position: absolute;
    top: 1px; right: 3px;
    font-size: 9px;
    color: #1e293b;
    font-weight: 700;
    line-height: 1;
}
#ta-grid.ta-validation-on .ta-target-valid .slot-badge { display: none; }
#ta-grid.ta-validation-on .ta-slot.ta-owner:not(.ta-target-valid):not(.ta-selected) {
    opacity: 0.30;
    pointer-events: none !important;
    filter: grayscale(0.7);
    cursor: not-allowed !important;
}
#ta-grid.ta-validation-on .ta-slot.ta-owner:not(.ta-target-valid):not(.ta-selected) .slot-badge { display: none; }
#ta-grid.ta-validation-on .ta-slot.ta-owner:not(.ta-target-valid):not(.ta-selected) .course-name,
#ta-grid.ta-validation-on .ta-slot.ta-owner:not(.ta-target-valid):not(.ta-selected) .teacher-name {
    opacity: 0.5;
}
/* TA 三栏响应式 */
@media (max-width: 1024px) {
    .ta-three-col { grid-template-columns: 1fr; }
}

/* 格子状态颜色 */
.ta-slot.ta-owner {
    border: 2px solid #10b981 !important;
    background: #ffffff !important;
    color: #1e293b !important;
}
.ta-slot.ta-owner.ta-selected {
    background: #fb923c !important;
    color: #ffffff !important;
    text-shadow: none;
    border: 2px solid #ea580c !important;
    box-shadow: 0 0 0 3px rgba(251,146,60,0.3);
}
.ta-slot.ta-locked {
    background: #ffffff !important;
    color: #1e293b !important;
    border: 1px solid #cbd5e1 !important;
    cursor: not-allowed;
    opacity: 0.6;
}
.ta-slot.ta-locked.ta-selected {
    background: #fb923c !important;
    color: #ffffff !important;
    border: 2px solid #ea580c !important;
    opacity: 1;
}
.ta-slot.ta-other {
    background: #ffffff !important;
    color: #1e293b !important;
    border: 1px solid #cbd5e1;
    cursor: pointer;
}
.ta-slot.ta-other:hover {
    background: #f8fafc !important;
}
.ta-slot.ta-target-valid {
    background: #d1fae5 !important;
    color: #064e3b !important;
    border: 2px solid #10b981 !important;
    font-weight: 600;
}
.ta-slot.ta-other {
    opacity: 0.55;
    filter: saturate(0.3);
    border: 1px solid rgba(0,0,0,0.18) !important;
}
.ta-slot.ta-free {
    background: #fafafa;
    color: #cbd5e1;
    border: 1px dashed #e2e8f0 !important;
}
.ta-slot.ta-target-preview {
    outline: 3px dashed var(--primary) !important;
    outline-offset: -2px;
    background: rgba(79, 70, 229, 0.08) !important;
}

.ta-slot { cursor: pointer; }
.ta-slot.ta-locked { cursor: not-allowed; }

/* 可移且不冲突的目标格：红色标识（按用户要求用红色表示） */
.ta-slot.ta-target-valid {
    border: 3px solid #e74c3c !important;
    background: rgba(231, 76, 60, 0.15) !important;
    cursor: pointer;
    box-shadow: 0 0 0 2px rgba(231, 76, 60, 0.35);
}
/* 选中班级高亮 */
.ta-slot.ta-hl {
    box-shadow: 0 0 0 3px #f59e0b inset;
}

/* 右侧信息面板 */
.ta-info-panel {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    min-height: 160px;
}
.ta-info-empty { color: #94a3b8; font-size: 13px; text-align: center; padding: 30px 10px; }
.ta-info-head { font-size: 18px; font-weight: 700; color: #1e293b; margin-bottom: 8px; }
.ta-info-row { font-size: 13px; color: #475569; margin: 4px 0; }
.ta-info-note { color: #94a3b8; }
.ta-info-status { display: inline-block; margin-top: 8px; padding: 3px 10px; border-radius: var(--radius-md); font-size: 12px; font-weight: 600; }
.ta-info-status.badge-locked { background: #f1f5f9; color: #64748b; }
.ta-info-status.badge-hard { background: rgba(231,76,60,0.85); color: #fff; }
.ta-info-status.badge-soft { background: rgba(243,156,18,0.85); color: #fff; }
.ta-info-status.badge-movable { background: rgba(46,204,113,0.85); color: #fff; }
.ta-info-actions { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; }

/* 底部缓冲区 */
.ta-buffer-zone {
    margin-top: 16px;
    border: 1px dashed #cbd5e1;
    border-radius: var(--radius-md);
    padding: 12px 14px;
    background: #f8fafc;
}
.ta-buffer-title { font-size: 13px; color: #475569; margin-bottom: 8px; font-weight: 600; }
.ta-buffer-drop {
    min-height: 56px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    border: 2px dashed #94a3b8;
    border-radius: var(--radius-sm);
    padding: 8px;
    background: #fff;
    cursor: pointer;
}
.ta-buffer-drop:hover { border-color: #6366f1; background: #f5f3ff; }
.ta-buffer-hint { color: #94a3b8; font-size: 13px; }
.ta-buffer-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 56px;
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.ta-buffer-card .bc-cls { font-size: 10px; opacity: 0.9; font-weight: 400; }
.ta-buffer-card:hover { outline: 2px solid #1e293b; }




/* ====== 新增：多用户登录/注册/顶栏/表格等 ====== */
.auth-tab { background:#f1f5f9; color:#64748b; }
.auth-tab.active { background:linear-gradient(135deg,#6366f1,#8b5cf6); color:#fff; }

.topbar { position:sticky; top:0; z-index:50; display:flex; align-items:center; justify-content:space-between;
  padding:0 24px; height:60px; background:rgba(255,255,255,0.92); backdrop-filter:saturate(180%) blur(12px);
  -webkit-backdrop-filter:saturate(180%) blur(12px); border-bottom:1px solid var(--border); color:var(--text); flex-shrink:0; }
.topbar-left { display:flex; align-items:center; gap:14px; flex-shrink:0; }
.topbar-divider { width:1px; height:22px; background:var(--border); }
.topbar-title { font-weight:700; font-size:17px; white-space:nowrap; color:var(--text); letter-spacing:0.2px; }
.topbar-right { display:flex; align-items:center; gap:14px; margin-left:auto; }
.topbar-user { font-size:13px; font-weight:600; white-space:nowrap; color:var(--text-light); }
.topbar-avatar { width:34px; height:34px; border-radius:50%; background:var(--primary-gradient); color:#fff;
  display:flex; align-items:center; justify-content:center; font-size:14px; font-weight:700; flex-shrink:0;
  box-shadow:0 2px 8px rgba(99,102,241,0.32); }
.btn-logout { display:inline-flex; align-items:center; gap:6px; padding:7px 14px; border-radius: var(--radius-sm);
  border:1px solid var(--border); background:#fff; color:var(--text-light); font-size:13px; font-weight:600; cursor:pointer;
  transition:all var(--transition); }
.btn-logout:hover { color:var(--danger); border-color:#fca5a5; background:#fef2f2; }
.topbar .sidebar-toggle { display:inline-flex; align-items:center; justify-content:center; width:36px; height:36px;
  background:transparent; color:var(--text-light); border:none; cursor:pointer; border-radius: var(--radius-sm); transition:all var(--transition); }
.topbar .sidebar-toggle:hover { background:#f1f5f9; color:var(--text); }

.app-body { display:flex; min-height:calc(100vh - 60px); }
.main-content { flex:1; padding:28px 32px; overflow:auto; }
.page-title { font-size:24px; font-weight:700; margin:0 0 18px; color:var(--text); letter-spacing:0.2px; }

/* ===== 仪表盘统计卡片（紧凑一行小图标） ===== */
.stat-cards { display:grid; gap:10px; }
.stat-cards.stat-row-compact { grid-template-columns: repeat(9, 1fr); }
.stat-row-gap { height: 8px; }
@media (max-width: 960px) {
  .stat-cards.stat-row-compact { grid-template-columns: repeat(5, 1fr); }
}
@media (max-width: 640px) {
  .stat-cards.stat-row-compact { grid-template-columns: repeat(3, 1fr); }
}
/* 小图标统计芯片（替代旧 stat-card） */
.stat-chip {
  background:#fff; border-radius: var(--radius-md); padding:10px 6px;
  text-align:center; box-shadow:0 1px 2px rgba(15,23,42,.04),0 3px 10px rgba(15,23,42,.05);
  border:1px solid var(--border-light); display:flex; flex-direction:column; align-items:center;
  gap:2px; transition:transform .12s,box-shadow .12s;
}
.stat-chip:hover { transform:translateY(-1.5px); box-shadow:0 4px 14px rgba(15,23,42,.08); }
.stat-chip-ico { font-size:18px; line-height:1; }
.stat-chip-val { font-size:17px; font-weight:800; color:var(--primary); letter-spacing:-0.3px; line-height:1; }
.stat-chip-lbl { font-size:10.5px; color:var(--text-light); line-height:1; }

/* 保留旧 stat-card 样式（其他页面可能引用），但仪表盘不再使用 */

.sub-tabs { display:flex; gap:8px; margin-bottom:14px; flex-wrap:wrap; }
.sub-tab { padding:8px 16px; border:none; border-radius: var(--radius-sm); background:#eef2ff; color:#6366f1; cursor:pointer; font-weight:600; }
.sub-tab.active { background:#6366f1; color:#fff; }

.toolbar { display:flex; gap:10px; align-items:center; margin-bottom:14px; flex-wrap:wrap; }
.toolbar label { font-size:13px; color:var(--text-light); }
.card { background:#fff; border-radius: var(--radius-lg); padding:22px; box-shadow:0 1px 3px rgba(15,23,42,.05),0 6px 18px rgba(15,23,42,.06); border:1px solid var(--border-light); }
.muted { color:var(--text-light); font-size:13px; }
.error { color:#ef4444; }

.data-table { width:100%; border-collapse:collapse; background:#fff; border-radius: var(--radius-md); overflow:hidden; box-shadow:0 2px 10px rgba(0,0,0,.05); }
.data-table th, .data-table td { padding:10px 12px; text-align:left; border-bottom:1px solid #f1f5f9; font-size:14px; }
.data-table th { background:#f8fafc; color:#475569; font-weight:600; }
.data-table tr:hover { background:#f8faff; }
.data-table .row-actions { white-space: nowrap; }
.data-table .row-actions .btn { margin-right: 6px; }
.data-table .row-actions .btn:last-child { margin-right: 0; }

.progress-bar { width:100%; height:14px; background:#eef2ff; border-radius: var(--radius-sm); overflow:hidden; }
.progress-fill { height:100%; width:0%; background:linear-gradient(90deg,#6366f1,#8b5cf6); transition:width .4s; }
.alert { padding:12px 16px; border-radius: var(--radius-md); margin-top:10px; font-size:14px; }
.alert.success { background:#ecfdf5; color:#047857; border:1px solid #a7f3d0; }
.alert.info { background:#eef2ff; color:#3730a3; border:1px solid #c7d2fe; }
.alert.error { background:#fef2f2; color:#b91c1c; border:1px solid #fecaca; }
.alert.warn { background:#fffbeb; color:#92400e; border:1px solid #fde68a; }

/* ★ 以下为 .tt-cell 状态变体（可移动/冲突/选中/同师等）—— 统一 .tt-table 已在上方定义 */
.tt-cell.conflict { outline:2px solid #ef4444; }

/* 左侧网格悬停联动高亮 */
.tt-cell.tt-hover-active { background-color:#fef08a !important; box-shadow:inset 0 0 0 2px #eab308; z-index:2; transition:background-color .15s, box-shadow .15s; }

/* ===== 混合视图：教师格子固定 vs 班级参考格 ===== */
.tt-cell.tt-teacher-pinned {
  background:#f8fafc;
  border-color:#e2e8f0;
}
.tt-cell.tt-teacher-pinned.tt-movable { background:#ecfdf5 !important; border:1px solid #a7f3d0; }
.tt-cell.tt-teacher-pinned.tt-blocked { background:#fef2f2 !important; border:1px solid #fecaca; }
.tt-cell.tt-class-ref {
  background:#fffbeb;
  border-color:#fde68a;
}
/* ★ 班级参考格 + 冲突状态：覆盖基础色，与右侧面板一致 */
.tt-cell.tt-class-ref.tt-movable { background:#ecfdf5 !important; border:1px solid #a7f3d0; cursor:pointer; position:relative; }
.tt-cell.tt-class-ref.tt-movable:hover { background:#d1fae5 !important; border-color:#34d399; }
.tt-cell.tt-class-ref.tt-blocked { background:#fef2f2 !important; border:1px solid #fecaca; cursor:not-allowed; position:relative; }
.tt-cell.tt-class-ref.tt-blocked .tt-ref-course { opacity:0.55; }
/* ★ 班级参考格的 ✓/× 角标（右下角，不遮挡内容）*/
.tt-cell.tt-class-ref.tt-movable .tt-ref-move-icon,
.tt-cell.tt-teacher-pinned.tt-movable .tt-ref-move-icon { position:absolute; bottom:1px; right:2px; font-size:11px; color:#059669; font-weight:700; pointer-events:none; z-index:3; }
.tt-cell.tt-class-ref.tt-blocked .tt-ref-move-icon,
.tt-cell.tt-teacher-pinned.tt-blocked .tt-ref-move-icon { position:absolute; bottom:1px; right:2px; font-size:11px; color:#ef4444; font-weight:700; pointer-events:none; z-index:3; }
.tt-cell.tt-class-ref .tt-ref-course {
  opacity:.82;
  font-size:12.5px;
}
.tt-cell.tt-class-ref .tt-ref-course .tt-teacher {
  color:#b45309;
  font-weight:600;
}
.tt-cell.tt-class-ref .tt-ref-course .tt-class {
  color:#92400e;
  font-size:10px;
}
.tt-course { font-weight:700; color:#1e293b; display:block; width:100%; cursor:pointer; box-sizing:border-box; }
.tt-teacher { font-size:11px; color:#64748b; }

.task-row, .user-row { display:flex; align-items:center; justify-content:space-between; background:#fff; padding:14px 16px;
  border-radius: var(--radius-md); margin-bottom:10px; box-shadow:0 2px 8px rgba(99,102,241,.06); gap:12px; flex-wrap:wrap; }
.task-actions { display:flex; gap:8px; align-items:center; }
.badge { display:inline-block; padding:2px 8px; border-radius: var(--radius-full); font-size:11px; margin-left:6px; }
.badge-admin { background:#ede9fe; color:#7c3aed; }
.badge-user { background:#e0f2fe; color:#0369a1; }
.badge-trial { background:#fef3c7; color:#b45309; }
.badge-off { background:#fee2e2; color:#b91c1c; }
.badge-hl { background:#fef3c7; color:#b45309; }
.badge-walk { background:#fef3c7; color:#92400e; }
.badge-conc { background:#dbeafe; color:#1d4ed8; }
.form-input { width:100%; padding:10px 12px; border:1px solid #e2e8f0; border-radius: var(--radius-sm); font-size:14px; margin:6px 0 12px; box-sizing:border-box; }
.pay-cfg-form textarea.form-input { font-family: 'SFMono-Regular', Consolas, monospace; font-size:12px; line-height:1.5; }
#pay-cfg-status .badge { margin-left:2px; font-size:12px; }
.mini-select { padding:4px 8px; border-radius: var(--radius-sm); border:1px solid #ddd; font-size:12px; }
.btn-lg { padding:14px 28px; font-size:16px; }

/* ===== 自动排课页（布局整改） ===== */
.sched-page { max-width:800px; }

/* ===== 排课模式选择（独立卡片） ===== */
.sched-mode-card {
  background:#fff; border:1px solid #e2e8f0; border-radius: var(--radius-lg);
  padding:16px 20px; margin-top:14px;
  box-shadow:0 1px 2px rgba(15,23,42,.04);
}
.sched-mode-card-title {
  font-size:13px; font-weight:700; color:#334155; margin:0 0 10px 0;
  letter-spacing:.02em;
}
.sched-mode-bar {
  display:flex; align-items:center; gap:8px;
}
.sched-mode-label {
  font-size:13px; font-weight:600; color:#475569; white-space:nowrap;
  margin-right:2px;
}
.sched-mode-pill {
  display:inline-flex; align-items:center; gap:6px;
  padding:8px 18px; border:1.5px solid #e2e8f0; border-radius: var(--radius-full);
  cursor:pointer; background:#fafbfc; transition:all .15s;
  user-select:none;
}
.sched-mode-pill:hover { border-color:#c7d2fe; background:#fbfaff; }
.sched-mode-pill input { display:none; }
.sched-mode-pill.active { border-color:#6366f1; background:#f5f3ff; box-shadow:0 0 0 3px rgba(99,102,241,.12); }
.sched-mode-pill .pill-text { font-size:13px; font-weight:600; color:#334155; }
.sched-mode-pill.active .pill-text { color:#4f46e5; }
.sched-mode-pill .pill-hint { font-size:11px; color:#94a3b8; }
.sched-mode-pill.active .pill-hint { color:#818cf8; }
/* 引擎档位锁定（V4 专业版 / V5 企业版不足时置灰🔒） */
.sched-mode-pill.is-locked { opacity:.55; cursor:not-allowed; filter:grayscale(.4); }
.sched-mode-pill.is-locked:hover { border-color:#e2e8f0; background:#fafbfc; }
.sched-mode-pill .lock-badge {
  font-size:10px; color:#f59e0b; font-weight:600; margin-left:2px;
  cursor:pointer; white-space:nowrap;
}
.sched-mode-pill .lock-badge:hover { text-decoration:underline; }

/* ===== 操作按钮区（独立卡片） ===== */
.sched-action-card {
  background:#fff; border:1px solid #e2e8f0; border-radius: var(--radius-lg);
  padding:18px 20px; margin-top:14px;
  box-shadow:0 1px 2px rgba(15,23,42,.04);
}
.sched-btn-group { display:flex; gap:12px; justify-content:center; flex-wrap:wrap; }
.sched-btn-group .btn { min-width:150px; justify-content:center; font-size:15px; padding:12px 28px; border-radius: var(--radius-md); }
.sched-btn-group .btn-icon { font-size:13px; margin-right:5px; }

/* ===== 优化指令区（独立卡片） ===== */
.sched-instr-block {
  background:#fff; border:1px solid #e2e8f0; border-radius: var(--radius-lg);
  padding:16px 20px; margin-top:14px;
  box-shadow:0 1px 2px rgba(15,23,42,.04);
}
.sched-instr-header { display:flex; align-items:center; gap:10px; margin-bottom:8px; }
.sched-instr-title { font-size:14px; font-weight:600; color:#334155; margin:0; }
.sched-instr-box { width:100%; min-height:100px; max-height:180px; padding:12px 14px; border:1px solid #d1d5db; border-radius: var(--radius-md); font-size:14px; font-family:inherit; line-height:1.65; resize:vertical; box-sizing:border-box; transition:border-color .15s,box-shadow .15s; background:#fafbff; }
.sched-instr-box:focus { outline:none; border-color:#6366f1; box-shadow:0 0 0 3px rgba(99,102,241,.15); background:#fff; }
.sched-instr-help { font-size:12px; color:#94a3b8; margin:8px 0 0; line-height:1.55; }
.sched-instr-help b { color:#64748b; font-weight:600; }

/* ===== 指令解析对话预览面板 ===== */
.instr-chat-panel {
  border:1px solid #e2e8f0; border-radius: var(--radius-md); background:#fafbff;
  padding:16px 18px; overflow:hidden;
}
.instr-chat-bubble { display:flex; gap:10px; margin-bottom:12px; }
.instr-chat-bubble-ai .instr-chat-avatar {
  width:32px; height:32px; border-radius:50%; flex-shrink:0;
  background:linear-gradient(135deg,#7F77DD,#A78BFA);
  color:#fff; font-size:12px; font-weight:600;
  display:flex; align-items:center; justify-content:center;
}
.instr-chat-bubble-ai .instr-chat-body {
  flex:1; min-width:0;
  background:#fff; border:1px solid #e5e7eb; border-radius: var(--radius-md);
  padding:12px 14px; font-size:13px; line-height:1.6; color:#334155;
}
.instr-chat-bubble-error .instr-chat-body {
  background:#fef2f2; border-color:#fecaca; color:#b91c1c;
}
/* 分组卡片 */
.instr-preview-group {
  margin:8px 0 4px; padding:8px 10px 4px;
  background:#f8faff; border:1px solid #ede9fe; border-radius: var(--radius-sm);
}
.instr-preview-group .instr-group-icon { font-size:14px; margin-right:4px; }
.instr-preview-group .instr-group-label {
  font-size:12px; font-weight:600; color:#5B21B6; margin-right:6px;
}
.instr-preview-group ul {
  margin:4px 0 0; padding-left:18px; list-style:none;
}
.instr-preview-group li {
  font-size:13px; color:#374151; line-height:1.55; padding:2px 0;
  position:relative; padding-left:12px;
}
.instr-preview-group li::before {
  content:''; position:absolute; left:0; top:10px;
  width:5px; height:5px; border-radius:50%; background:#A78BFA;
}
/* 可勾选的解析项（用户可取消勾选以排除误解析的指令） */
.instr-preview-item { display:block; }
.instr-keep-label {
  display:flex; align-items:flex-start; gap:6px;
  cursor:pointer; user-select:none; padding:1px 0;
}
.instr-keep-label input.instr-keep { margin-top:4px; flex:0 0 auto; accent-color:#7C3AED; }
.instr-keep-label span { flex:1 1 auto; }
.instr-keep-label:hover { color:#5B21B6; }
/* 取消勾选后：灰显并加删除线，提示该项将不被应用 */
.instr-keep-label input.instr-keep:not(:checked) + span { color:#9CA3AF; text-decoration:line-through; }
/* 编辑提示条 */
.instr-preview-hint {
  margin:10px 0 4px; padding:8px 12px;
  background:#eff6ff; border:1px solid #bfdbfe; border-radius: var(--radius-sm);
  font-size:12px; color:#1e40af; line-height:1.5;
}
.instr-preview-actions { margin-top:12px; display:flex; gap:10px; flex-wrap:wrap; }
/* 未识别警告组 */
.instr-preview-warn { background:#fffbeb; border-color:#fde68a; }
.instr-preview-warn .instr-group-label { color:#92400E; }
.instr-preview-warn li::before { background:#f59e0b; }
.instr-unrecognized { color:#92400E !important; font-style:italic; }
/* 统计摘要 */
.instr-preview-summary {
  margin-top:10px; padding:8px 12px;
  background:#f0fdf4; border:1px solid #bbf7d0; border-radius: var(--radius-sm);
  font-size:12px; color:#166534; text-align:center;
}
/* 操作按钮栏 */
.instr-preview-actions {
  display:flex; gap:8px; justify-content:flex-end; margin-top:12px; padding-top:10px;
  border-top:1px solid #f1f5f9;
}

/* ===== 进度与结果区 ===== */
.sched-progress-wrap { margin-top:16px; }
.sched-result-wrap { margin-top:12px; }

/* ===== 导入数据页 ===== */
.import-tabs { display:flex; gap:4px; margin-bottom:16px; border-bottom:2px solid #e5e7eb; padding-bottom:0; }
.import-tab { padding:10px 20px; border:none; background:none; cursor:pointer; font-size:14px; font-weight:600; color:#6b7280; border-bottom:3px solid transparent; margin-bottom:-2px; transition:all .2s; }
.import-tab:hover { color:#374151; }
.import-tab.active { color:var(--primary); border-bottom-color:var(--primary); }
.upload-zone { border:2px dashed #d1d5db; border-radius: var(--radius-md); padding:40px 20px; text-align:center; background:#fafbff; cursor:pointer; transition:border-color .2s,background .2s; min-height:120px; display:flex; flex-direction:column; align-items:center; justify-content:center; }
.upload-zone:hover { border-color:var(--primary); background:#f0f0ff; }
.upload-icon { font-size:40px; margin-bottom:8px; color:#9ca3af; }

/* ===== 不排课时间 ===== */
.unavail-toolbar { display:flex; justify-content:space-between; align-items:center; margin-bottom:14px; }
.unavail-layout { display:flex; gap:16px; }
.unavail-sidebar { width:200px; flex-shrink:0; }
.unavail-sidebar input[type="text"] { width:100%; padding:7px 10px; border:1px solid #e2e8f0; border-radius: var(--radius-sm); font-size:13px; box-sizing:border-box; margin-bottom:8px; }
.unavail-class-list { max-height:400px; overflow-y:auto; border:1px solid #e5e7eb; border-radius: var(--radius-sm); }
.unavail-class-item { padding:8px 12px; cursor:pointer; font-size:13px; border-bottom:1px solid #f3f4f6; transition:background .15s; width:100%; box-sizing:border-box; user-select:none; }
.unavail-class-item:hover { background:#f9fafb; }
.unavail-class-item.active { background:#ede9fe; color:#6366f1; font-weight:600; }
.unavail-grid-wrap { flex:1; overflow-x:auto; }
.unavail-grid { border-collapse:collapse; width:100%; font-size:13px; }
.unavail-grid th { background:#f9fafb; padding:8px 6px; text-align:center; font-weight:600; color:#374151; border:1px solid #e5e7eb; white-space:nowrap; }
.unavail-grid td { padding:4px; text-align:center; border:1px solid #e5e7eb; }
.unavail-check { width:22px; height:22px; appearance:none; -webkit-appearance:none; border:2px solid #d1d5db; border-radius: var(--radius-xs); cursor:pointer; position:relative; transition:all .15s; }
.unavail-check:checked { background:#10b981; border-color:#10b981; }
.unavail-check:checked::after { content:''; position:absolute; top:2px;left:6px;width:5px;height:10px;border:solid white; border-width:0 2px 2px 0; transform:rotate(45deg); }
.unavail-check.unavail-checked { background:#ef4444; border-color:#ef4444; }

/* 不排课网格：表头上午/下午按钮 + 行全选按钮 */
.unavail-half-btns { display:flex; gap:2px; justify-content:center; margin-top:3px; }
.unavail-grid .btn-xs { font-size:10px; padding:1px 5px; border:1px solid #d1d5db; border-radius: var(--radius-xs); background:#fff; cursor:pointer; color:#6b7280; line-height:1.4; white-space:nowrap; }
.unavail-grid .btn-xs:hover { background:#f3f4f6; color:#374151; border-color:#9ca3af; }

/* ===== 任务管理表格 ===== */
.task-toolbar { display:flex; gap:10px; align-items:center; margin-bottom:14px; flex-wrap:wrap; }
.task-table { width:100%; border-collapse:collapse; font-size:13px; }
.task-table th { background:#f9fafb; padding:10px 12px; text-align:left; font-weight:600; color:#374151; border-bottom:2px solid #e5e7eb; white-space:nowrap; }
.task-table td { padding:10px 12px; border-bottom:1px solid #f3f4f6; vertical-align:middle; }
.task-table tr:hover { background:#fafbff; }
.status-tag { display:inline-block; padding:3px 10px; border-radius: var(--radius-full); font-size:11px; font-weight:600; }
.status-conflict { background:#fef2f2; color:#dc2626; }
.status-done { background:#ecfdf5; color:#059669; }
.status-normal { background:#eff6ff; color:#2563eb; }
.action-btns { display:flex; gap:4px; }
.action-btns button { padding:4px 8px; font-size:11px; border-radius: var(--radius-sm); border:1px solid #e5e7eb; background:white; cursor:pointer; transition:all .15s; }
.action-btns button:hover { border-color:var(--primary); color:var(--primary); }

/* ===== 合班配置 ===== */
.combine-layout { display:flex; gap:16px; }
.combine-col { flex:1; border:1px solid #e5e7eb; border-radius: var(--radius-md); overflow:hidden; }
.combine-col-header { background:#f9fafb; padding:10px 14px; font-weight:600; font-size:13px; border-bottom:1px solid #e5e7eb; }
.combine-list { max-height:360px; overflow-y:auto; padding:6px; }
.combine-item { padding:8px 10px; border-radius: var(--radius-sm); cursor:pointer; font-size:13px; margin-bottom:2px; transition:background .15s; }
.combine-item:hover { background:#f3f4f6; }
.combine-item.selected { background:#ede9fe; color:#6366f1; font-weight:600; }
.combine-actions { display:flex; flex-direction:column; justify-content:center; gap:8px; padding:0 8px; }
.combine-result { flex:1.2; border:1px solid #e5e7eb; border-radius: var(--radius-md); overflow:hidden; }
.combine-result-header { background:#f9fafb; padding:10px 14px; font-weight:600; font-size:13px; border-bottom:1px solid #e5e7eb; display:flex; justify-content:space-between; align-items:center; }
.combine-entry { padding:8px 14px; border-bottom:1px solid #f3f4f6; font-size:13px; display:flex; justify-content:space-between; align-items:center; }

/* ===== 预排 ===== */
.presched-layout { display:flex; gap:16px; max-height: calc(100vh - 300px); }

/* ============================================================
   品牌升级：Logo / 登录双栏 / 旗舰 Hero / 功能卡
   ============================================================ */

/* ===== 登录页（双栏品牌布局） ===== */
.login-page {
  position: fixed; inset: 0; z-index: 9999;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  background: var(--bg-page);
}

.login-hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 55%, #8b5cf6 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px 48px;
}
.login-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(255,255,255,0.10) 1px, transparent 1px);
  background-size: 22px 22px;
  opacity: 0.6;
}
.login-hero-glow {
  position: absolute;
  width: 640px; height: 640px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(56,189,248,0.35) 0%, transparent 65%);
  top: -200px; right: -180px;
  pointer-events: none;
  filter: blur(6px);
}
.login-hero-inner { position: relative; z-index: 1; max-width: 460px; }
.login-logo {
  width: 88px; height: 88px;
  border-radius: var(--radius-2xl);
  box-shadow: 0 16px 38px rgba(0,0,0,0.30);
  margin-bottom: 24px;
}
.login-brand {
  font-size: 40px; font-weight: 800; letter-spacing: 1px;
  margin: 0 0 8px; line-height: 1.1;
}
.login-tagline {
  font-size: 16px; font-weight: 600; color: #e9d5ff;
  margin: 0 0 30px;
}
.login-feats { list-style: none; margin: 0 0 30px; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.login-feats li { display: flex; align-items: center; gap: 12px; font-size: 15px; opacity: 0.96; }
.lf-ico {
  width: 36px; height: 36px; flex-shrink: 0;
  border-radius: var(--radius-md); background: rgba(255,255,255,0.16);
  display: flex; align-items: center; justify-content: center; font-size: 17px;
}
.login-hero-foot {
  font-size: 13px; opacity: 0.75; letter-spacing: 0.5px;
  padding-top: 18px; border-top: 1px solid rgba(255,255,255,0.18);
}

.login-form-side { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px; position: relative; }
/* ICP 备案信息（登录页底部） */
.icp-footer { margin-top: 18px; text-align: center; font-size: 12px; }
.icp-footer a { color: var(--text-light); text-decoration: none; opacity: 0.85; }
.icp-footer a:hover { opacity: 1; text-decoration: underline; }
/* ICP 备案信息（侧边栏底部） */
.icp-side { display: block; margin-top: 6px; font-size: 11px; text-align: center; }
.icp-side a { color: var(--text-light); text-decoration: none; opacity: 0.75; }
.icp-side a:hover { opacity: 1; }
.sidebar.collapsed .icp-side { display: none; }
.login-card {
  width: 100%; max-width: 400px; background: #fff;
  border-radius: var(--radius-2xl); padding: 40px 38px;
  box-shadow: 0 24px 70px rgba(79,70,229,0.16);
  border: 1px solid rgba(99,102,241,0.08);
}
.login-card-logo {
  width: 54px; height: 54px; border-radius: var(--radius-lg);
  box-shadow: 0 8px 20px rgba(99,102,241,0.28);
  margin-bottom: 16px;
}
.login-card-title { font-size: 24px; font-weight: 700; margin: 0 0 4px; color: var(--text); }
.login-card-sub { font-size: 14px; color: var(--text-light); margin: 0 0 22px; }

.auth-tabs {
  display: flex; gap: 6px; background: #f1f5f9;
  padding: 5px; border-radius: var(--radius-md); margin-bottom: 22px;
}
.auth-tab {
  flex: 1; padding: 11px; border: none; background: transparent;
  border-radius: var(--radius-sm); cursor: pointer; font-size: 15px; font-weight: 600;
  color: #64748b; transition: all 0.2s; font-family: inherit;
}
.auth-tab.active {
  background: #fff; color: var(--primary);
  box-shadow: 0 2px 8px rgba(15,23,42,0.10);
}

#login-form input, #register-form input {
  width: 100%; padding: 13px 16px; margin-bottom: 12px;
  border: 1px solid #e2e8f0; border-radius: var(--radius-md); font-size: 15px;
  box-sizing: border-box; transition: all 0.2s; font-family: inherit;
  background: #fbfcfe; color: var(--text);
}
#login-form input:focus, #register-form input:focus {
  outline: none; border-color: var(--primary); background: #fff;
  box-shadow: 0 0 0 4px rgba(99,102,241,0.12);
}
#login-form .btn-lg, #register-form .btn-lg { width: 100%; margin-top: 4px; }
#login-error, #register-error {
  display: none; color: var(--danger); font-size: 13px;
  margin: 12px 0 0; line-height: 1.5;
}

/* ===== 侧边栏 Logo + 旗舰徽章 ===== */
.sidebar-logo {
  width: 40px; height: 40px; flex-shrink: 0;
  border-radius: var(--radius-md);
  box-shadow: 0 6px 16px rgba(99,102,241,0.45);
}
.brand-badge {
  display: inline-block; margin-left: 6px; padding: 1px 7px;
  font-size: 10px; font-weight: 700; color: #fde68a;
  background: rgba(251,191,36,0.16); border: 1px solid rgba(251,191,36,0.40);
  border-radius: var(--radius-sm); vertical-align: middle; letter-spacing: 0.5px;
}

/* ===== 顶栏 Logo ===== */
.topbar-logo {
  width: 26px; height: 26px; border-radius: var(--radius-sm); flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(99,102,241,0.30);
}

/* ===== 概览页 旗舰 Hero（紧凑版） ===== */
.dash-hero {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 60%, #8b5cf6 100%);
  color: #fff; border-radius: var(--radius-lg);
  padding: 18px 24px; margin-bottom: 16px; position: relative; overflow: hidden;
  box-shadow: 0 10px 28px rgba(99,102,241,0.18);
}
.dash-hero::after {
  content: ''; position: absolute; right: -50px; top: -50px;
  width: 200px; height: 200px; border-radius: 50%;
  background: radial-gradient(circle, rgba(56,189,248,0.25) 0%, transparent 65%);
  pointer-events: none;
}
.dash-hero-left { position: relative; z-index: 1; }
.dash-hero-badge {
  display: inline-block; padding: 3px 10px; border-radius: var(--radius-lg);
  font-size: 11px; font-weight: 700; background: rgba(255,255,255,0.18);
  margin-bottom: 8px; letter-spacing: 0.5px;
}
.dash-hero-title { font-size: 21px; font-weight: 800; margin: 0 0 4px; letter-spacing: 0.5px; }
.dash-hero-sub { font-size: 13px; opacity: 0.9; margin: 0; color: #ede9fe; }
.dash-hero-logo {
  width: 56px; height: 56px; border-radius: var(--radius-lg);
  box-shadow: 0 8px 20px rgba(0,0,0,0.2); flex-shrink: 0;
}

/* ===== 概览页 核心能力卡（紧凑版） ===== */
.feat-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px; margin-top: 14px;
}
.feat-card {
  background: var(--bg-card); border: 1px solid var(--border-light);
  border-radius: var(--radius-md); padding: 14px;
  box-shadow: var(--shadow); position: relative; overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.feat-card::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--primary-gradient); opacity: 0.8;
}
.feat-card:hover {
  transform: translateY(-3px); box-shadow: var(--shadow-lg);
  border-color: rgba(99,102,241,0.2);
}
.feat-ico {
  width: 36px; height: 36px; border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center; font-size: 18px;
  background: linear-gradient(135deg, rgba(99,102,241,0.1), rgba(139,92,246,0.1));
  margin-bottom: 10px;
}
.feat-title { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.feat-desc { font-size: 12px; color: var(--text-light); line-height: 1.45; }

/* ===== 概览页 帮助入口栏（使用手册 / 使用视频） ===== */
.dash-help-bar {
  display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap;
}
/* hero 内联帮助按钮：白底半透明，紧凑 */
.dash-help-bar.dash-help-inline {
  gap: 8px; margin-top: 10px;
}
.dash-help-bar.dash-help-inline .dash-help-btn {
  padding: 6px 14px; border-radius: var(--radius-xl);
  background: rgba(255,255,255,0.2); border: 1px solid rgba(255,255,255,0.35);
  color: #fff; font-size: 12px; font-weight: 600;
}
.dash-help-bar.dash-help-inline .dash-help-btn:hover {
  background: rgba(255,255,255,0.35); border-color: rgba(255,255,255,0.55);
  color: #fff; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,.1);
}
.dash-help-bar.dash-help-inline .dash-help-ico { font-size: 14px; }
.dash-help-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 18px; border-radius: var(--radius-md);
  background: #f8fafc; border: 1px solid #e2e8f0;
  color: #334155; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all .15s; text-decoration: none;
}
.dash-help-btn:hover {
  background: #eef2ff; border-color: #a5b4fc; color: #4f46e5;
  transform: translateY(-1px); box-shadow: 0 4px 12px rgba(79,70,229,.1);
}
.dash-help-btn .dash-help-ico {
  font-size: 18px; flex-shrink: 0;
}

/* ===== 仪表盘：可折叠清空数据区 ===== */
.dash-clear-accordion {
  background: #fff; border-radius: var(--radius-lg); border: 1px solid #fecaca;
  box-shadow: 0 1px 3px rgba(15,23,42,.05), 0 6px 18px rgba(15,23,42,.06);
  overflow: hidden;
}
.dash-clear-accordion summary {
  padding: 14px 20px; cursor: pointer; font-weight: 700; font-size: 14px;
  color: #991b1b; background: #fef2f2; user-select: none;
  display: flex; align-items: center; gap: 8px;
}
.dash-clear-accordion summary:hover { background: #fee2e2; }
.dash-clear-accordion summary::-webkit-details-marker { display: none; }
.dash-clear-accordion summary::after { content: '▶'; margin-left: auto; font-size: 11px; transition: transform .2s; color: #b91c1b; }
.dash-clear-accordion[open] summary::after { transform: rotate(90deg); }
.dash-clear-body { padding: 16px 20px 8px; }
.dash-clear-group {
  padding: 12px 14px; border-radius: var(--radius-md); margin-bottom: 10px;
  border: 1px solid #e5e7eb; background: #fafafa;
}
.dash-clear-group:last-child { margin-bottom: 0; }
.dash-clear-danger { border-color: #fed7aa; background: #fffbeb; }
.dash-clear-destructive { border-color: #fecaca; background: #fef2f2; }
.dash-clear-label {
  font-weight: 700; font-size: 13px; margin-bottom: 4px;
}

/* ===== 响应式：登录与概览 ===== */
@media (max-width: 860px) {
  .login-page { grid-template-columns: 1fr; }
  .login-hero { display: none; }
  .login-card { box-shadow: none; border: none; padding: 28px 18px; }
  .dash-hero { flex-direction: column; align-items: flex-start; }
  .dash-hero-logo { display: none; }
  .feat-grid { grid-template-columns: 1fr 1fr; }
  .dash-help-bar { flex-direction: column; }
  .dash-help-btn { justify-content: center; }
}
@media (max-width: 520px) {
  .feat-grid { grid-template-columns: 1fr; }
}
.presched-left { width:280px; flex-shrink:0; max-height:100%; overflow:auto; }
.presched-filter { display:flex; gap:6px; margin-bottom:10px; }
.presched-filter select { flex:1; padding:6px 8px; border:1px solid #e2e8f0; border-radius: var(--radius-sm); font-size:12px; }
.presched-course-list { border:1px solid #e5e7eb; border-radius: var(--radius-sm); max-height:500px; overflow-y:auto; }
.presched-group-title { padding:8px 12px; background:#f9fafb; font-size:12px; font-weight:700; color:#6b7280; border-bottom:1px solid #e5e7eb; position:sticky;top:0; }
.presched-course-item { padding:8px 12px; display:flex; justify-content:space-between; align-items:center; cursor:grab; font-size:13px; border-bottom:1px solid #f3f4f6; transition:background .15s; }
.presched-course-item:hover { background:#fafbff; }
.presched-course-item .drag-handle { color:#9ca3af; cursor:grab; font-size:16px; }
.presched-right { flex:1; min-width:0; max-height:100%; overflow:auto; }
.presched-grid { border-collapse:collapse; width:100%; font-size:13px; }
.presched-grid th { background:#f9fafb; padding:8px 10px; text-align:center; border:1px solid #e5e7eb; font-weight:600; position:sticky; top:0; z-index:2; }
.presched-info-table thead th { position:sticky; top:0; z-index:2; background:#f9fafb; }
.presched-grid td { padding:14px 10px; text-align:center; border:1px solid #e5e7eb; min-height:58px; vertical-align:middle; position:relative; }
.ps-pick-item:hover { background:#fafbff; }
.presched-cell-empty { display:inline-flex; align-items:center; justify-content:center; width:36px; height:36px; border-radius: var(--radius-sm); color:#c4cdd5; cursor:pointer; font-size:20px; font-weight:300; transition:all .15s; user-select:none; }
.presched-cell-empty:hover { background:#eef2ff; color:#6366f1; transform:scale(1.1); }
.presched-cell-selected { background:#eef2ff !important; box-shadow:inset 0 0 0 2px #6366f1; }
.presched-cell-selected .presched-cell-empty { background:#c7d2fe; color:#4338ca; }
.presched-slot { display:inline-block; padding:2px 6px; border-radius: var(--radius-xs); font-size:11px; margin:1px; background:#ede9fe; color:#6366f1; cursor:pointer; position:relative; }
.presched-slot.conflict { background:#fee2e2; color:#dc2626; }
.presched-slot .remove-slot { position:absolute;top:-4px;right:-4px;width:14px;height:14px;border-radius:50%; background:#ef4444;color:white;font-size:10px;line-height:14px;text-align:center;cursor:pointer;display:none; }
.presched-slot:hover .remove-slot { display:block; }

/* ===== 其他规则多Tab ===== */
.rule-other-tabs { display:flex; gap:4px; margin-bottom:14px; border-bottom:1px solid #e5e7eb; flex-wrap:wrap; }
.rule-other-tab { padding:8px 16px; border:none; background:none; cursor:pointer; font-size:13px; font-weight:600; color:#6b7280; border-bottom:2px solid transparent; margin-bottom:-1px; }
.rule-other-tab.active { color:var(--primary); border-bottom-color:var(--primary); }
.json-editor { width:100%; min-height:120px; padding:10px; border:1px solid #e2e8f0; border-radius: var(--radius-sm); font-family:monospace; font-size:12px; resize:vertical; box-sizing:border-box; }
.research-table { width:100%; border-collapse:collapse; font-size:13px; }
.research-table th { background:#f9fafb; padding:8px 12px; text-align:left; font-weight:600; border:1px solid #e5e7eb; }
.research-table td { padding:8px 12px; border:1px solid #f3f4f6; }

/* ===== 会员中心 / 等级 / 微信登录 ===== */
.tier-badge { display:inline-block; padding:1px 8px; border-radius: var(--radius-md); font-size:11px; font-weight:700; margin-left:4px; vertical-align:middle; }
.tier-trial { background:#f1f5f9; color:#64748b; }
.tier-personal { background:#dbeafe; color:#1d4ed8; }
.tier-professional { background:#ede9fe; color:#7c3aed; }
.tier-enterprise { background:#fef3c7; color:#b45309; }

.btn-upgrade { padding:6px 14px; border-radius: var(--radius-sm); border:1px solid transparent; background:linear-gradient(90deg,#6366f1,#8b5cf6); color:#fff; font-size:13px; font-weight:600; cursor:pointer; transition:filter .15s; }
.btn-upgrade:hover { filter:brightness(1.08); }

.btn-wechat { background:#07c160; border-color:#07c160; color:#fff; display:flex; align-items:center; justify-content:center; gap:8px; }
.btn-wechat:hover { background:#06ad56; }
.auth-divider { display:flex; align-items:center; gap:10px; margin:14px 0 4px; color:#94a3b8; font-size:12px; }
.auth-divider::before, .auth-divider::after { content:''; flex:1; height:1px; background:#e2e8f0; }

/* 会员中心布局 */
.mem-current { margin-bottom:18px; }
.mem-card { background:#fff; border-radius: var(--radius-lg); padding:18px 20px; box-shadow:0 1px 3px rgba(15,23,42,.05),0 6px 18px rgba(15,23,42,.06); border:1px solid var(--border-light); }
.mem-card.tier-trial { border-left:4px solid #94a3b8; }
.mem-card.tier-personal { border-left:4px solid #1d4ed8; }
.mem-card.tier-professional { border-left:4px solid #7c3aed; }
.mem-card.tier-enterprise { border-left:4px solid #b45309; }
.mem-card-head { display:flex; align-items:center; justify-content:space-between; margin-bottom:14px; }
.mem-plan-name { font-size:18px; font-weight:700; color:var(--text); }
.mem-exp { font-size:12px; color:#94a3b8; }
.mem-usage { display:flex; flex-direction:column; gap:10px; }
.mu-row { display:grid; grid-template-columns: 72px 1fr 84px; align-items:center; gap:10px; }
.mu-label { font-size:13px; color:#475569; }
.mu-bar { height:8px; background:#eef2f7; border-radius: var(--radius-sm); overflow:hidden; }
.mu-fill { height:100%; background:linear-gradient(90deg,#6366f1,#8b5cf6); border-radius: var(--radius-sm); }
.mu-fill.over { background:linear-gradient(90deg,#ef4444,#f97316); }
.mu-num { font-size:12px; color:#64748b; text-align:right; }
.mem-tip { margin:14px 0 0; font-size:13px; color:#b45309; background:#fffbeb; border:1px solid #fde68a; padding:8px 12px; border-radius: var(--radius-sm); }

.mem-plans-head { display:flex; align-items:center; justify-content:space-between; margin:8px 0 14px; flex-wrap:wrap; gap:10px; }
.mem-plans-head h3 { margin:0; font-size:16px; }
.period-toggle { display:inline-flex; background:#f1f5f9; border-radius: var(--radius-md); padding:3px; }
.pt-btn { border:none; background:transparent; padding:7px 14px; border-radius: var(--radius-sm); font-size:13px; cursor:pointer; color:#64748b; font-weight:600; }
.pt-btn.active { background:#fff; color:var(--primary); box-shadow:0 1px 2px rgba(15,23,42,.1); }
.mem-plan-cards { display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:14px; }
.plan-card { background:#fff; border:1px solid #e2e8f0; border-radius: var(--radius-lg); padding:18px; display:flex; flex-direction:column; gap:8px; position:relative; transition:box-shadow .15s,transform .15s; }
.plan-card:hover { box-shadow:0 8px 24px rgba(99,102,241,.12); transform:translateY(-2px); }
.plan-card.highlight { border-color:#8b5cf6; box-shadow:0 4px 16px rgba(139,92,246,.18); }
.plan-badge { position:absolute; top:-10px; right:14px; background:linear-gradient(90deg,#6366f1,#8b5cf6); color:#fff; font-size:11px; font-weight:700; padding:2px 10px; border-radius: var(--radius-md); }
.plan-name { font-size:16px; font-weight:700; color:var(--text); }
.plan-price { font-size:26px; font-weight:800; color:#4338ca; }
.plan-per { font-size:13px; font-weight:500; color:#94a3b8; margin-left:2px; }
.plan-desc { font-size:12px; color:#94a3b8; margin:0; min-height:32px; }
.plan-feats { list-style:none; padding:0; margin:4px 0 8px; display:flex; flex-direction:column; gap:6px; font-size:13px; color:#334155; }
.plan-feats li { padding-left:16px; position:relative; }
.plan-feats li::before { content:'•'; color:#6366f1; position:absolute; left:2px; }
.plan-feats li.ft { color:#059669; }
.plan-feats li.ft::before { content:'✓'; color:#059669; }
.plan-buy { width:100%; margin-top:auto; }

.mem-orders { margin-top:22px; }
.mem-orders-title { font-size:15px; margin:0 0 10px; }
.mem-order-list { display:flex; flex-direction:column; gap:8px; }
.mem-order-row { display:grid; grid-template-columns: 1fr auto auto; gap:14px; align-items:center; background:#fff; border:1px solid #e2e8f0; border-radius: var(--radius-md); padding:10px 14px; font-size:13px; }
.pay-qr { width:220px; height:220px; display:block; margin:10px auto; border:1px solid #e2e8f0; border-radius: var(--radius-md); padding:8px; background:#fff; }
.pay-mode { font-size:13px; color:#475569; text-align:center; margin:6px 0 4px; }

/* 待审核订单（个人收款码人工审核） */
.pending-list { display:flex; flex-direction:column; gap:12px; margin-top:12px; }
.pending-row { display:flex; justify-content:space-between; align-items:center; gap:16px; background:#fff; border:1px solid #e2e8f0; border-radius: var(--radius-md); padding:12px 16px; }
.pending-info { font-size:13px; line-height:1.6; }
.proof-thumb { width:96px; height:96px; object-fit:cover; border:1px solid #e2e8f0; border-radius: var(--radius-sm); margin-top:6px; display:inline-block; }
.proof-thumb:hover { box-shadow:0 0 0 2px #2563eb; }

/* ===== 手动调课（增强版）===== */
.manual-tabs { display:flex; gap:4px; margin-bottom:14px; border-bottom:2px solid #e5e7eb; flex-wrap:wrap; }
.manual-tab { padding:8px 16px; border:none; background:none; cursor:pointer; font-size:13px; font-weight:600; color:#6b7280; border-bottom:3px solid transparent; margin-bottom:-2px; }
.manual-tab.active { color:var(--primary); border-bottom-color:var(--primary); }
.manual-tab.has-conflict { color:#dc2626; }
.manual-toolbar { display:flex; gap:10px; align-items:center; margin-bottom:12px; flex-wrap:wrap; }
.manual-main { display:flex; gap:16px; }
.manual-tt-panel { flex:1; min-width:0; }
.manual-side { width:340px; flex-shrink:0; display:flex; flex-direction:column; gap:10px; max-height:720px; }
.manual-card { border:1px solid #e5e7eb; border-radius: var(--radius-md); overflow:hidden; margin-bottom:0; display:flex; flex-direction:column; }
.manual-card-header { background:#f9fafb; padding:8px 12px; font-weight:600; font-size:12px; border-bottom:1px solid #e5e7eb; display:flex; justify-content:space-between; align-items:center; flex-shrink:0; }
.manual-card-body { padding:8px; overflow:auto; flex:1; min-height:0; }
.color-legend { display:flex; gap:12px; font-size:11px; flex-wrap:wrap; margin-top:8px; }
.legend-item { display:flex; align-items:center; gap:4px; }
.legend-swatch { width:14px; height:14px; border-radius: var(--radius-xs); border:1px solid #d1d5db; }
.buffer-zone { border:1px dashed #f59e0b; border-radius: var(--radius-sm); padding:10px; min-height:60px; background:#fffbeb; margin-top:10px; }
.buffer-zone-title { font-size:12px; font-weight:700; color:#d97706; margin-bottom:6px; }

/* ===== 手动调课：新布局 ===== */
.man-layout { display:flex; gap:16px; align-items:flex-start; height: calc(100vh - 220px); min-height:400px; }
.man-main { flex:0 0 60%; display:flex; flex-direction:column; min-width:0; overflow:auto; }
/* ★ 关键修复：让 .man-main 的所有直接子项都不被 flex shrink 压缩。
   否则当内容超出容器高度时，#mant-main-grid（含表格）会被压扁成 2-3 行。 */
.man-main > * { flex-shrink: 0; }
.man-side { flex:1; display:flex; flex-direction:column; gap:10px; min-width:280px; max-width:40%; overflow:hidden; }
.man-section-title { font-weight:700; font-size:14px; margin-bottom:8px; color:#1e293b; }
.man-grid-wrap { overflow:auto; flex:1; min-height:200px; }
.man-grid-wrap .tt-table { margin-bottom: 0; }
.man-info-card { flex:1; min-height:0; display:flex; flex-direction:column; }
.man-info-card .manual-card-body { overflow-y:auto; }

/* #909 移动端响应式：工作室布局纵向堆叠 + 课格放大便于触摸点击 */
@media (max-width: 768px) {
  .man-layout { flex-direction: column; height: auto; min-height: 0; }
  .man-main { flex: 1 1 auto; width: 100%; overflow: visible; }
  .man-side { flex: 1 1 auto; width: 100%; max-width: 100%; min-width: 0; }
  .man-grid-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .tt-cell { min-height: 52px; }            /* 触摸目标加大 */
  .tt-cell .tt-course { min-height: 44px; font-size: 14px; }
  .manual-toolbar { flex-wrap: wrap; gap: 6px; }
  .manual-toolbar select, .manual-toolbar button { font-size: 13px; padding: 6px 8px; }
}

/* 选中高亮：底色填充 */
.tt-cell .tt-course.tt-selected {
  background:#fef3c7 !important;
  outline:3px solid #f59e0b;
  outline-offset:-2px;
  border-radius: var(--radius-sm);
  z-index:2;
  position:relative;
  box-shadow:0 0 0 3px rgba(245,158,11,.3);
}
/* 可交换提示色（同课程其他格）—— 更醒目 */
.tt-cell .tt-course.tt-swap-hint {
  background:#d1fae5 !important;
  border-radius: var(--radius-sm);
  cursor:pointer;
  outline:2px solid #10b981;
  outline-offset:-1px;
}
.tt-cell .tt-course.tt-swap-hint:hover {
  background:#a7f3d0 !important;
  box-shadow:0 0 0 2px #10b981;
  transform:scale(1.03);
}
/* 单元格内班级名（教师视图） */
.tt-class {
  font-size:10px;
  opacity:.75;
  display:block;
  margin-top:1px;
  padding-top:2px;
  border-top:1px dotted #d1d5db;
}

/* ===== 教师视图：右侧课程详情面板 ===== */
.man-info-header { padding:10px 12px; background:#f8fafc; border-radius: var(--radius-sm); margin-bottom:10px; }
.man-info-course { font-size:16px; font-weight:700; color:#1e293b; }
.man-info-meta { font-size:11px; color:#64748b; margin-top:2px; }
.man-info-body { overflow-y:auto; flex:1; }
.man-info-section { margin-bottom:12px; }
.man-info-section-title { font-size:12px; font-weight:700; color:#475569; margin-bottom:6px; padding-bottom:4px; border-bottom:1px solid #e5e7eb; }
.man-info-table { width:100%; border-collapse:collapse; font-size:11px; }
.man-info-table th { background:#f1f5f9; padding:5px 8px; text-align:left; font-weight:600; color:#475569; border:1px solid #e2e8f0; }
.man-info-table td { padding:5px 8px; border:1px solid #f1f5f9; color:#374151; }
.man-info-table tr:hover { background:#f8fafc; }
.man-info-class-group { display:flex; flex-wrap:wrap; gap:6px; padding:6px 0; align-items:center; }
.man-info-class-name { font-size:12px; font-weight:700; color:#2563eb; min-width:60px; }
.man-info-asg { font-size:11px; background:#eff6ff; color:#1d4ed8; padding:3px 8px; border-radius: var(--radius-md); white-space:nowrap; }
.man-info-empty-list { display:flex; flex-wrap:wrap; gap:4px; }
.man-info-empty-slot { font-size:11px; background:#ecfdf5; color:#059669; padding:3px 8px; border-radius: var(--radius-xs); cursor:pointer; border:1px solid #a7f3d0; }
.man-info-empty-slot:hover { background:#d1fae5; }
.tag-hard { background:#fef2f2; color:#dc2626; padding:1px 6px; border-radius: var(--radius-sm); font-size:10px; }
.tag-soft { background:#fffbeb; color:#d97706; padding:1px 6px; border-radius: var(--radius-sm); font-size:10px; }

/* ===== 右侧面板：教师所有班级课表网格 ===== */
.mant-tt-header { margin-bottom:8px; }
.mant-tt-title { font-size:13px; font-weight:700; color:#1e293b; }
.mant-tt-stats { font-size:11px; color:#64748b; margin-top:2px; }
.mant-tt-table { width:100%; border-collapse:collapse; font-size:11px; table-layout:fixed; }
.mant-tt-table thead th { background:#6366f1; color:#fff; padding:5px 3px; font-size:11px; font-weight:600; text-align:center; border:1px solid #4f46e5; }
.mant-tt-table tbody td { border:1px solid #e2e8f0; padding:0; vertical-align:middle; height:46px; overflow:hidden; position:relative; }
.mant-tt-rowhead { background:#f1f5f9; text-align:center; font-weight:600; color:#64748b; font-size:11px; width:28px; border:1px solid #e2e8f0; height:46px; line-height:46px; }
.mant-tt-cell.empty { background:#fafbff; height:46px; }
.mant-tt-cell.tt-movable { background:#ecfdf5 !important; box-shadow:inset 0 0 0 1px #a7f3d0; cursor:pointer; }
.mant-tt-cell.tt-blocked { background:#fef2f2 !important; box-shadow:inset 0 0 0 1px #fecaca; cursor:not-allowed; }
.mant-tt-cell.tt-blocked .mant-tt-course { opacity:0.55; }
.mant-tt-cell.tt-sel-cell { background:#fef3c7 !important; box-shadow:inset 0 0 0 2px #f59e0b; }
.mant-tt-cell.tt-sel-cell .mant-tt-course { background:#fde68a; border-color:#f59e0b; color:#92400e; }
/* 右侧空位：仅背景色+伪元素✓/× */
.mant-tt-cell.tt-movable::after { content:'✓'; position:absolute; inset:0; display:flex; align-items:center; justify-content:center; font-size:12px; color:#059669; opacity:.25; pointer-events:none; }
.mant-tt-cell.tt-blocked::after { content:'×'; position:absolute; inset:0; display:flex; align-items:center; justify-content:center; font-size:11px; color:#ef4444; opacity:.3; pointer-events:none; }
/* 右侧课格：紧凑三行显示（科目/教师/班级）—— 固定高度不变形 */
.mant-tt-course { display:block; padding:2px 3px; cursor:pointer; border-radius: var(--radius-xs); text-align:center; line-height:1.25; transition:background-color .15s, box-shadow .15s; min-height:38px; max-height:42px; overflow:hidden; box-sizing:border-box; background:#ede9fe; color:#4c1d95; border:1px solid #c4b5fd; font-size:10px; }
/* 颜色区分各科模式：覆盖默认紫色，整块实心+加粗白字 */
.mant-tt-course[style*="background"] { color: #fff !important; font-weight: 700; border: none; text-shadow: 0 1px 2px rgba(0,0,0,.25); box-shadow: inset 0 1px 0 rgba(255,255,255,.2), inset 0 -1px 2px rgba(0,0,0,.15), 0 1px 3px rgba(0,0,0,.1); border-radius: var(--radius-sm); }
.mant-tt-course[style*="background"] .tt-teacher { color: #1a1a1a !important; text-shadow: 0 1px 1px rgba(255,255,255,.6); }
.mant-tt-course[style*="background"] .tt-class { color: #1a1a1a !important; text-shadow: 0 1px 1px rgba(255,255,255,.6); }
.mant-tt-course:hover { background:#ddd6fe; z-index:2; position:relative; box-shadow:0 2px 6px rgba(99,102,241,.25); }
/* ★ 关键修复：父级为 movable/blocked/sel-cell 时，课程标签背景必须透明/跟随，
   否则 mant-tt-course 的 #ede9fe 会覆盖父级 td 的绿/粉色，导致右面板看不出可移动/冲突状态 */
.mant-tt-cell.tt-movable > .mant-tt-course { background:#dcfce7; border-color:#86efac; color:#166534; }
.mant-tt-cell.tt-blocked > .mant-tt-course { background:#fee2e2; border-color:#fca5a5; color:#991b1b; opacity:0.7; }
.mant-tt-cell.tt-sel-cell > .mant-tt-course { background:#fef3c7; border-color:#fcd34d; color:#92400e; }
/* 右侧联动悬停高亮（与左侧同色）—— 必须覆盖内层 mant-tt-course 背景 */
.mant-tt-cell.mant-tt-hover-active { background-color:#fef08a !important; box-shadow:inset 0 0 0 2px #eab308; z-index:2; transition:background-color .15s, box-shadow .15s; }
.mant-tt-cell.mant-tt-hover-active > .mant-tt-course { background:#fef9c3; border-color:#fcd34d; color:#854d0e; }
.mant-tt-subj { display:block; font-weight:700; font-size:11px; color:#4c1d95; }
.mant-tt-tname { display:block; font-size:9px; opacity:.75; color:#6d28d9; }
.mant-tt-cname { display:block; font-size:9px; opacity:.65; color:#7c3aed; }
/* 选中/交换高亮：继承左侧风格但适配右侧 */
.mant-tt-course.tt-selected { outline:2px solid #f59e0b; outline-offset:-1px; box-shadow:0 0 0 3px rgba(245,158,11,.35); background:#fef3c7; z-index:3; position:relative; }
.mant-tt-course.tt-swap-hint { outline:1px dashed #22c55e; outline-offset:-1px; }
.mant-tt-course.tt-swap-hint:hover { background:#dcfce7; }
/* 冲突/锁定标记 */
.mant-tt-cell .conflict-hard { box-shadow:inset 0 0 0 2px #ef4444; }
.mant-tt-cell .conflict-soft { box-shadow:inset 0 0 0 2px #f59e0b; }
.mant-tt-course.tt-locked::after { content:'🔒'; position:absolute; top:1px; right:2px; font-size:8px; }

/* ===== 课表查看（增强版）===== */
.tt-view-steps { display:flex; gap:4px; margin-bottom:14px; border-bottom:2px solid #e5e7eb; }
.tt-view-step { padding:10px 18px; border:none; background:none; cursor:pointer; font-size:14px; font-weight:600; color:#6b7280; border-bottom:3px solid transparent; margin-bottom:-2px; border-radius: var(--radius-sm) var(--radius-sm) 0 0; }   /* #1174 */
.tt-view-step.active { color:var(--primary); border-bottom-color:var(--primary); background:#fafbff; }
.tt-subtabs { display:flex; gap:4px; margin-bottom:12px; flex-wrap:wrap; }
.tt-subtab { padding:6px 14px; border:1px solid #e5e7eb; border-radius: var(--radius-xl); background:white; cursor:pointer; font-size:12px; font-weight:600; color:#6b7280; transition:all .15s; }
.tt-subtab:hover { border-color:var(--primary-light); color:var(--primary); }
.tt-subtab.active { background:var(--primary); color:white; border-color:var(--primary); }
.tt-options { display:flex; gap:12px; align-items:center; margin-bottom:12px; flex-wrap:wrap; font-size:12px; }
.tt-option { display:flex; align-items:center; gap:4px; cursor:pointer; }
.tt-option input[type="checkbox"] { accent-color:var(--primary); }
.tt-detail-table { width:100%; border-collapse:collapse; font-size:13px; }
.tt-detail-table th { background:#f9fafb; padding:10px 12px; text-align:left; font-weight:600; border:1px solid #e5e7eb; white-space:nowrap; }
.tt-detail-table td { padding:10px 12px; border:1px solid #f3f4f6; vertical-align:middle; }
.tt-detail-table tr:nth-child(even) { background:#fafbff; }

/* ===== 单双周视图切换（课表查看） ===== */
.tt-parity-switch { display:inline-flex; align-items:center; gap:2px; padding:2px; background:#f1f5f9; border-radius: var(--radius-sm); }
.tt-parity-label { font-size:12px; color:#64748b; margin-right:4px; margin-left:6px; }
.tt-parity-btn { border:none; background:none; padding:5px 12px; border-radius: var(--radius-sm); cursor:pointer; font-size:12px; font-weight:600; color:#64748b; transition:all .15s; }
.tt-parity-btn:hover { color:var(--primary); }
.tt-parity-btn.active { background:white; color:var(--primary); box-shadow:0 1px 3px rgba(0,0,0,.12); }
/* 单元格单/双周徽标 */
.tt-parity-badge { display:inline-block; min-width:16px; text-align:center; font-size:10px; font-weight:700; line-height:1.5; padding:0 4px; border-radius: var(--radius-sm); vertical-align:middle; margin-left:2px; }
.tt-parity-badge.tt-p1 { background:#fef3c7; color:#b45309; }   /* 单周=琥珀 */
.tt-parity-badge.tt-p2 { background:#dbeafe; color:#1d4ed8; }   /* 双周=蓝 */
.tt-detail-table tr:hover { background:#f0f0ff; }
.tt-cell-course { font-weight:600; color:#1e293b; }
.tt-cell-teacher { color:#64748b; font-size:12px; }

/* 交换成功：两格强烈闪烁 + 方向箭头覆盖层，确保用户感知到「已交换」 */
@keyframes manSwapFlash {
  0%   { box-shadow: 0 0 0 0 rgba(34,197,94,0); transform: scale(1); }
  15%  { box-shadow: 0 0 0 5px rgba(34,197,94,1), 0 0 20px rgba(34,197,94,.6); background:#bbf7d0 !important; transform: scale(1.03); }
  35%  { box-shadow: 0 0 0 4px rgba(34,197,94,.8), 0 0 14px rgba(34,197,94,.4); background:#86efac !important; transform: scale(1.01); }
  60%  { box-shadow: 0 0 0 3px rgba(34,197,94,.5), 0 0 10px rgba(34,197,94,.2); background:#dcfce7 !important; transform: scale(1); }
  100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); transform: scale(1); }
}
.man-swap-flash {
  animation: manSwapFlash 2.2s ease-out 1;
  border-radius: var(--radius-sm);
  position: relative;
  z-index: 10;
}
/* 闪烁时在格子中心显示交换箭头 */
.man-swap-flash::after {
  content: '⇄';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 20px;
  color: #166534;
  font-weight: 900;
  z-index: 11;
  opacity: 0;
  animation: swapArrowShow 2.2s ease-out 1 forwards;
  text-shadow: 0 0 6px rgba(255,255,255,.9);
  pointer-events: none;
}
@keyframes swapArrowShow {
  0%, 10% { opacity: 0; transform: translate(-50%,-50%) scale(0.3); }
  25% { opacity: 1; transform: translate(-50%,-50%) scale(1.2); }
  55% { opacity: 1; transform: translate(-50%,-50%) scale(1); }
  75%, 100% { opacity: 0; transform: translate(-50%,-50%) scale(0.8); }
}
.tt-stat-row { display:flex; gap:12px; margin-bottom:12px; flex-wrap:wrap; }
.tt-stat-card { background:white; border:1px solid #e5e7eb; border-radius: var(--radius-md); padding:12px 16px; min-width:120px; }
.tt-stat-num { font-size:24px; font-weight:700; color:var(--primary); }
.tt-stat-label { font-size:11px; color:#6b7280; }

/* ===== 规则引擎（齐全可配置）===== */
.rule-mode-tabs { display:flex; gap:8px; margin-bottom:4px; }
.rule-mode-tab { padding:9px 16px; border:1px solid #e5e7eb; background:white; border-radius: var(--radius-md); cursor:pointer; font-size:14px; font-weight:600; color:#475569; }
.rule-mode-tab.active { background:linear-gradient(135deg,#6366f1,#8b5cf6); color:white; border-color:transparent; }
.rule-engine-toolbar { display:flex; justify-content:space-between; align-items:center; gap:12px; flex-wrap:wrap; background:white; border:1px solid #e5e7eb; border-radius: var(--radius-md); padding:12px 16px; margin-bottom:14px; }
.rule-summary { font-size:13px; color:#475569; }
.rule-summary b { color:#1e293b; }
.rule-group { margin-bottom:18px; }
.rule-group-title { font-size:14px; font-weight:700; color:#334155; margin:0 0 10px; padding-left:10px; border-left:4px solid #6366f1; }
.rule-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(320px,1fr)); gap:14px; }
.rule-card { background:white; border:1px solid #e5e7eb; border-radius: var(--radius-md); padding:14px 16px; transition:opacity .15s, box-shadow .15s; }
.rule-card.disabled { opacity:.55; }
.rule-card-head { display:flex; justify-content:space-between; align-items:flex-start; gap:10px; }
.rule-card-title { font-size:14px; font-weight:700; color:#1e293b; display:flex; align-items:center; gap:6px; flex-wrap:wrap; }
.rule-badge { font-size:11px; padding:2px 8px; border-radius: var(--radius-full); font-weight:600; }
.rule-badge.hard { background:#fee2e2; color:#dc2626; }
.rule-badge.soft { background:#dbeafe; color:#2563eb; }
.rule-desc { font-size:12px; color:#64748b; margin:8px 0 10px; line-height:1.5; }
.rule-field { margin-top:8px; }
.rule-label { font-size:11px; color:#94a3b8; display:block; margin-bottom:4px; font-weight:600; }
.rule-weight-row { display:flex; align-items:center; gap:8px; }
.rule-weight { flex:1; }
.rule-weight-num { width:78px; padding:4px 6px; border:1px solid #e2e8f0; border-radius: var(--radius-sm); font-size:12px; }
.rule-param-row { display:flex; justify-content:space-between; align-items:center; gap:10px; margin-top:6px; }
.rule-param-row label { font-size:12px; color:#475569; }
.rule-param { width:120px; padding:4px 6px; border:1px solid #e2e8f0; border-radius: var(--radius-sm); font-size:12px; }
.switch { position:relative; display:inline-block; width:40px; height:22px; flex:none; }
.switch input { opacity:0; width:0; height:0; }
.switch .slider { position:absolute; cursor:pointer; inset:0; background:#cbd5e1; border-radius: var(--radius-2xl); transition:.2s; }
.switch .slider:before { content:""; position:absolute; height:16px; width:16px; left:3px; bottom:3px; background:white; border-radius:50%; transition:.2s; }
.switch input:checked + .slider { background:#6366f1; }
.switch input:checked + .slider:before { transform:translateX(18px); }
.switch.small { width:34px; height:18px; }
.switch.small .slider:before { height:12px; width:12px; left:3px; bottom:3px; }
.switch.small input:checked + .slider:before { transform:translateX(16px); }

/* 步骤1：排课设置（分组卡片式布局） */
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 14px; }
.settings-group { background:#fff; border:1px solid #e2e8f0; border-radius: var(--radius-sm); overflow:hidden; }
.settings-group-title { background:#f8fafc; border-bottom:1px solid #e2e8f0; padding:10px 14px; font-size:13px; font-weight:700; color:#475569; letter-spacing:0.5px; }
.settings-group-body { padding:10px 14px 14px; }
.settings-row { display:grid; grid-template-columns: 130px 1fr; gap:10px; align-items:start; padding:8px 0; border-bottom:1px dashed #f1f5f9; }
.settings-row:last-child { border-bottom: none; }
.settings-label { font-size:13px; color:#1e293b; font-weight:500; padding-top:6px; line-height:1.4; }
.settings-control { display:flex; flex-direction:column; gap:4px; }
.settings-input { padding:6px 10px; border:1px solid #cbd5e1; border-radius: var(--radius-sm); font-size:13px; width:auto; min-width:140px; max-width:240px; background:#fff; }
.settings-help { font-size:11px; color:#94a3b8; line-height:1.4; margin-top:2px; }

/* 步骤2：不排课时间 - 三下拉 */
.unavail-mode-bar { display:flex; gap:8px; align-items:center; flex-wrap:wrap; margin-bottom:10px; }
.unavail-mode-bar select { padding:6px 10px; border:1px solid #cbd5e1; border-radius: var(--radius-sm); font-size:13px; background:#fff; }
.unavail-mode-bar .badge-tag { padding:3px 10px; background:#eef2ff; color:#4338ca; border-radius: var(--radius-md); font-size:11px; font-weight:600; }

/* 步骤3：连堂约束 - 不连堂节次 */
.no-consec-section { background:#fef3c7; border:1px solid #fbbf24; border-radius: var(--radius-sm); padding:12px 16px; margin-top:14px; }
.no-consec-title { font-size:13px; font-weight:700; color:#92400e; margin-bottom:6px; }
.no-consec-pair-list { display:flex; flex-wrap:wrap; gap:10px; margin-top:8px; }
.no-consec-pair { display:inline-flex; align-items:center; gap:4px; padding:5px 10px; background:#fff; border:1px solid #f59e0b; border-radius: var(--radius-sm); cursor:pointer; font-size:13px; user-select:none; }
.no-consec-pair input { cursor:pointer; }
.no-consec-pair.checked { background:#fef3c7; }

/* 步骤4：合班/走班 拆分 */
.combine-split-tabs { display:flex; gap:8px; margin-bottom:14px; border-bottom:1px solid #e2e8f0; padding-bottom:6px; }
.combine-split-tab { padding:8px 16px; font-size:13px; font-weight:600; color:#64748b; border:none; background:transparent; cursor:pointer; border-bottom:2px solid transparent; margin-bottom:-7px; }
.combine-split-tab.active { color:#4338ca; border-bottom-color:#6366f1; }
.walk-class-tag { display:inline-block; background:#dbeafe; color:#1d4ed8; padding:1px 6px; border-radius: var(--radius-xs); font-size:11px; margin-left:6px; }

/* 步骤6：预排 - 表格式左侧 */
.presched-info-table { width:100%; border-collapse:collapse; font-size:12px; }
.presched-info-table th { background:#f8fafc; padding:8px 10px; text-align:left; border-bottom:1px solid #e2e8f0; color:#475569; font-weight:600; }
.presched-info-table td { padding:8px 10px; border-bottom:1px solid #f1f5f9; }
.presched-info-table tr:hover td { background:#f8fafc; }
.presched-progress { display:inline-block; padding:2px 8px; border-radius: var(--radius-md); font-size:11px; font-weight:600; }
.presched-progress.full { background:#dcfce7; color:#166534; }
.presched-progress.partial { background:#fef3c7; color:#92400e; }
.presched-progress.empty { background:#fee2e2; color:#991b1b; }
.ps-drag-handle { display:inline-block; width:18px; height:18px; line-height:16px; text-align:center; background:#e2e8f0; border-radius: var(--radius-xs); color:#64748b; font-weight:bold; cursor:grab; font-size:12px; user-select:none; }
.ps-drag-handle:hover { background:#cbd5e1; color:#334155; }
.ps-drag-handle:active { cursor:grabbing; }
.ps-drag-full { background:#fef3c7; color:#d97706; }
.research-grid-table { border-collapse:collapse; font-size:12px; }
.research-grid-table th { background:#f8fafc; padding:6px 10px; font-weight:600; }
.research-grid-table td { padding:4px; }
.mini-grid { border-collapse:collapse; font-size:11px; }
.mini-grid th { background:#f8fafc; padding:3px 6px; font-weight:500; color:#64748b; }
.mini-grid td { padding:2px; }
.mini-grid .period-label { background:#f8fafc; padding:3px 6px; color:#64748b; font-weight:500; }
.presched-cell-slots { display:flex; flex-direction:column; gap:2px; min-height:20px; }
.presched-slot-chip { padding:2px 4px; background:#dbeafe; border-radius: var(--radius-xs); cursor:pointer; color:#1e40af; line-height:1.15; display:flex; flex-direction:column; gap:0px; }
.presched-slot-chip:hover { background:#bfdbfe; }
.presched-slot-chip .chip-course { font-size:11px; font-weight:600; white-space:normal; word-break:break-word; }
.presched-slot-chip .chip-meta { font-size:10px; color:#1e3a8a; white-space:normal; word-break:break-word; }
.presched-slot-chip.is-preset { background:#dcfce7; color:#15803d; border:1px solid #86efac; }
.presched-slot-chip.is-preset .chip-meta { color:#166534; }
/* 主课表锁定（lock_source=manual）：与主课表联动的预排，蓝色区分 */
.presched-slot-chip.is-manual { background:#e0f2fe; color:#0369a1; border:1px solid #7dd3fc; }
.presched-slot-chip.is-manual .chip-meta { color:#075985; }
.presched-slot-chip .chip-src { align-self:flex-end; font-size:8px; line-height:1; background:#f59e0b; color:#fff; border-radius: var(--radius-xs); padding:0 2px; margin-top:1px; }
.chip-info { display:block; white-space:nowrap; }

/* ===== 排课策略档位预设按钮 ===== */
.sp-preset-btn {
  padding:7px 16px;
  font-size:13px;
  font-weight:600;
  color:#475569;
  background:#fff;
  border:1.5px solid #cbd5e1;
  border-radius: var(--radius-sm);
  cursor:pointer;
  transition:all .15s ease;
}
.sp-preset-btn:hover { border-color:#6366f1; color:#4f46e5; background:#eef2ff; }
.sp-preset-btn.sp-preset-active {
  border-color:#4f46e5;
  background:#4f46e5;
  color:#fff;
  box-shadow:0 2px 8px rgba(79,70,229,.28);
}
.sp-preset-btn.sp-preset-active:hover { background:#4338ca; color:#fff; }

/* #936 上午/下午分隔带：双细线小间隔（最小厚度，上下各 1px 实线） */
/* 必须用更高特异性覆盖 .tt-table tbody tr { height:46px }，否则分隔行仍被撑到 46px */
.tt-table tbody tr.tt-ampm-divider {
  height: 2px;
}
.tt-table .tt-ampm-divider td {
  height: 2px;
  line-height: 0;
  padding: 0;
  border: none;
  background: transparent;
  border-top: 1px solid #cbd5e1;
  border-bottom: 1px solid #cbd5e1;
}

/* ===================================================================
   #953 C级：调课工作台可视化增强（对标 Untis / ASIMUT）
   根因：四项功能后端均已算出 from→to 精确坐标，但前端只在灰色工具条
   以文字 chip 呈现，网格本身零可视化 → 「看不清楚」。此处集中补齐：
   工具栏分组+激活态 / 模式横幅 / 常驻图例 / 序号徽标 / 搬迁源目标格 /
   禁排区红斜纹 / 撤离标记 / SVG 箭头叠层 / 迷你甘特 / 侧边抽屉 / 新手引导。
   =================================================================== */
/* 网格容器须作为 SVG 箭头叠层锚点（position:relative） */
.man-grid-wrap { position: relative; }

/* 工具栏分组 */
.studio-toolbar-groups { display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-bottom:8px; }
.studio-tgroup { display:flex; align-items:center; gap:6px; padding:4px 8px; background:#f8fafc; border:1px solid #e2e8f0; border-radius: var(--radius-md); }
.studio-tgroup-label { font-size:11px; font-weight:700; color:#94a3b8; margin-right:3px; letter-spacing:.5px; }
.studio-toolbar-groups .btn { margin:0; }

/* 激活态按钮（进入某模式时变色发光，一眼可辨当前所处功能） */
.btn.studio-active { background: linear-gradient(180deg,#6366f1,#4f46e5); color:#fff; border-color:#4f46e5; box-shadow:0 2px 8px rgba(79,70,229,.35); }
.btn.studio-active:hover { background:#4338ca; color:#fff; }
.studio-multi-toggle.studio-active { background: linear-gradient(180deg,#3b82f6,#2563eb); border-color:#2563eb; box-shadow:0 2px 8px rgba(37,99,235,.35); color:#fff; }
#studio-timebox-btn.studio-active { background: linear-gradient(180deg,#f59e0b,#ea580c); border-color:#ea580c; box-shadow:0 2px 8px rgba(234,88,12,.35); color:#fff; }
#studio-pack-halfday.studio-active, #studio-pack-align.studio-active { background: linear-gradient(180deg,#10b981,#047857); border-color:#047857; box-shadow:0 2px 8px rgba(4,120,87,.35); color:#fff; }

/* 模式横幅（顶部，随当前功能切换配色） */
#studio-mode-banner { display:flex; align-items:center; gap:10px; padding:8px 14px; border-radius: var(--radius-md); font-size:13px; font-weight:600; margin-bottom:8px; border:1px solid transparent; animation: studioBannerIn .25s ease; }
@keyframes studioBannerIn { from { opacity:0; transform:translateY(-4px);} to {opacity:1; transform:none;} }
#studio-mode-banner .mb-icon { font-size:16px; }
#studio-mode-banner .mb-close { margin-left:auto; cursor:pointer; opacity:.6; font-size:13px; padding:2px 6px; border-radius: var(--radius-sm); }
#studio-mode-banner .mb-close:hover { opacity:1; background:rgba(0,0,0,.06); }
#studio-mode-banner.mode-view { background:#f1f5f9; color:#475569; border-color:#e2e8f0; }
#studio-mode-banner.mode-batch { background:#eff6ff; color:#1d4ed8; border-color:#bfdbfe; }
#studio-mode-banner.mode-timebox { background:#fff7ed; color:#c2410c; border-color:#fed7aa; }
#studio-mode-banner.mode-pack { background:#ecfdf5; color:#047857; border-color:#a7f3d0; }
#studio-mode-banner.mode-smart { background:#faf5ff; color:#7e22ce; border-color:#e9d5ff; }

/* 常驻图例 */
.studio-legend { display:flex; gap:14px; flex-wrap:wrap; font-size:11px; color:#64748b; margin-top:10px; padding:8px 10px; background:#f8fafc; border:1px solid #e2e8f0; border-radius: var(--radius-sm); }
.studio-legend .lg { display:flex; align-items:center; gap:5px; }
.studio-legend .sw { width:14px; height:14px; border-radius: var(--radius-xs); border:1px solid #cbd5e1; flex-shrink:0; }
.sw-sel { background:#fffbeb; border:2px solid #f59e0b; }
.sw-tgt { background:#ecfdf5; border:2px dashed #059669; }
.sw-move { background:#eff6ff; border:2px solid #2563eb; }
.sw-batch { background:#eff6ff; border:2px solid #2563eb; }
.sw-timebox { background: repeating-linear-gradient(45deg,#fee2e2,#fee2e2 4px,#fecaca 4px,#fecaca 8px); border:1px solid #dc2626; }
.sw-forbid { background: repeating-linear-gradient(45deg,#fee2e2,#fee2e2 4px,#fecaca 4px,#fecaca 8px); }
.sw-evac { background:#fff7ed; border:2px solid #f59e0b; }
.sw-gantt { background: linear-gradient(90deg,#dbeafe,#bfdbfe); }

/* 网格内装饰：批量序号徽标 / 搬迁源·目标 / 禁排区 / 撤离 */
.tt-cell.tt-seq { }
.tt-cell.tt-seq .tt-seq-badge { position:absolute; top:1px; left:2px; min-width:15px; height:15px; line-height:15px; text-align:center; font-size:10px; font-weight:700; color:#fff; background:#2563eb; border-radius: var(--radius-sm); padding:0 3px; z-index:5; pointer-events:none; }
.tt-cell.tt-move-src { outline:3px solid #2563eb !important; outline-offset:-2px; background:#eff6ff !important; box-shadow: inset 0 0 0 1px #93c5fd; z-index:2; }
.tt-cell.tt-move-src::before { content:'迁出'; position:absolute; bottom:1px; left:2px; font-size:9px; font-weight:700; color:#1d4ed8; background:rgba(239,246,255,.92); padding:0 3px; border-radius: var(--radius-xs); z-index:5; pointer-events:none; }
.tt-cell.tt-move-tgt { outline:3px dashed #059669 !important; outline-offset:-2px; background:#ecfdf5 !important; box-shadow: inset 0 0 0 1px #6ee7b7; z-index:2; }
.tt-cell.tt-move-tgt::before { content:'迁入'; position:absolute; bottom:1px; left:2px; font-size:9px; font-weight:700; color:#047857; background:rgba(236,253,245,.92); padding:0 3px; border-radius: var(--radius-xs); z-index:5; pointer-events:none; }
.tt-cell.tt-forbidden { background: repeating-linear-gradient(45deg,#fee2e2,#fee2e2 5px,#fecaca 5px,#fecaca 10px) !important; }
.tt-cell.tt-forbidden::after { content:'禁排'; position:absolute; top:1px; right:2px; font-size:9px; font-weight:700; color:#b91c1c; background:rgba(254,226,226,.92); padding:0 3px; border-radius: var(--radius-xs); z-index:5; pointer-events:none; }
.tt-cell.tt-evac { outline:3px solid #f59e0b !important; outline-offset:-2px; background:#fff7ed !important; box-shadow: inset 0 0 0 1px #fcd34d; z-index:2; }
.tt-cell.tt-evac::before { content:'撤离'; position:absolute; top:1px; left:2px; font-size:9px; font-weight:700; color:#c2410c; background:rgba(255,247,237,.92); padding:0 3px; border-radius: var(--radius-xs); z-index:5; pointer-events:none; }

/* SVG 箭头叠层（搬迁/疏散走向一目了然） */
.studio-overlay { position:absolute; top:0; left:0; pointer-events:none; z-index:6; overflow:visible; }

/* 迷你甘特（嵌入网格上方：当前视图每日课时密度条） */
.studio-gantt { display:flex; gap:6px; margin:6px 0 2px; align-items:flex-end; height:44px; }
.studio-gantt .gg-day { flex:1; display:flex; flex-direction:column; align-items:center; justify-content:flex-end; height:100%; font-size:10px; color:#64748b; }
.studio-gantt .gg-bar-wrap { width:100%; display:flex; align-items:flex-end; justify-content:center; flex:1; }
.studio-gantt .gg-bar { width:100%; max-width:48px; background:linear-gradient(180deg,#bfdbfe,#60a5fa); border-radius: var(--radius-xs) var(--radius-xs) 0 0; min-height:3px; transition:height .25s ease; }   /* #1174 */
.studio-gantt .gg-num { font-weight:700; color:#1e3a8a; margin-bottom:1px; }
.studio-gantt .gg-name { margin-top:2px; }

/* 侧边抽屉式智能操作盘 */
.studio-drawer-mask { position:fixed; inset:0; background:rgba(15,23,42,.35); z-index:1040; display:none; }
.studio-drawer-mask.open { display:block; }
.studio-drawer { position:fixed; top:0; right:0; height:100%; width:340px; max-width:86vw; background:#fff; box-shadow:-8px 0 30px rgba(0,0,0,.18); z-index:1041; transform:translateX(100%); transition:transform .25s ease; display:flex; flex-direction:column; }
.studio-drawer.open { transform:translateX(0); }
.studio-drawer-head { padding:12px 14px; border-bottom:1px solid #e5e7eb; display:flex; align-items:center; gap:8px; flex-shrink:0; }
.studio-drawer-head b { font-size:14px; flex:1; }
.studio-drawer-body { padding:12px 14px; overflow:auto; flex:1; }
.studio-drawer-foot { padding:10px 14px; border-top:1px solid #e5e7eb; display:flex; gap:8px; flex-shrink:0; }
.drawer-feat { border:1px solid #e5e7eb; border-radius: var(--radius-md); padding:10px; margin-bottom:10px; }
.drawer-feat .df-title { font-weight:700; font-size:13px; display:flex; align-items:center; gap:6px; }
.drawer-feat .df-status { font-size:11px; margin:5px 0 9px; line-height:1.5; }
.df-on { color:#059669; font-weight:600; }
.df-off { color:#94a3b8; }
.df-warn { color:#d97706; font-weight:600; }
.drawer-feat .df-actions { display:flex; gap:6px; flex-wrap:wrap; }
.drawer-feat .df-actions .btn { flex:1; min-width:84px; }

/* 新手引导 */
.studio-tour-mask { position:fixed; inset:0; background:rgba(15,23,42,.55); z-index:1050; display:none; align-items:center; justify-content:center; }
.studio-tour-mask.open { display:flex; }
.studio-tour-card { background:#fff; border-radius: var(--radius-lg); padding:20px 22px; max-width:380px; box-shadow:0 12px 40px rgba(0,0,0,.3); animation: studioTourIn .25s ease; }
@keyframes studioTourIn { from { opacity:0; transform:scale(.95);} to {opacity:1; transform:none;} }
.studio-tour-card h3 { margin:0 0 8px; font-size:16px; }
.studio-tour-card p { font-size:13px; color:#475569; line-height:1.6; margin:0 0 14px; }
.studio-tour-steps { display:flex; gap:6px; margin-bottom:12px; }
.studio-tour-dot { width:8px; height:8px; border-radius:50%; background:#cbd5e1; transition:background .2s; }
.studio-tour-dot.active { background:#4f46e5; }
.studio-tour-actions { display:flex; gap:8px; justify-content:flex-end; }
.tour-spot { position:relative; z-index:1051; box-shadow:0 0 0 3px #4f46e5, 0 0 0 9999px rgba(15,23,42,.55); border-radius: var(--radius-sm); }
@media (max-width:768px){ .studio-drawer { width:90vw; } .studio-toolbar-groups { gap:6px; } }
