* { margin:0; padding:0; box-sizing:border-box; }
body { font-family: "Microsoft YaHei", "PingFang SC", sans-serif; background:#f0f2f5; color:#333; }
a { text-decoration:none; color:inherit; }

/* ===== 登录页 ===== */
.login-page { display:flex; align-items:center; justify-content:center; min-height:100vh;
    background:linear-gradient(120deg,#8F1414,#F7EED6); }
.login-wrap { display:flex; align-items:stretch; gap:24px; max-width:920px; width:100%; padding:20px; }
.login-notice { background:#fff; border-radius:16px; box-shadow:0 10px 40px rgba(0,0,0,.2);
    flex:1; min-width:0; padding:32px 36px; overflow:hidden; }
.login-notice .notice-title { color:#4a3fb5; font-size:20px; margin-bottom:16px;
    padding-bottom:12px; border-bottom:2px solid #eef2ff; }
.login-notice .notice-content { color:#444; font-size:15px; line-height:1.8; white-space:pre-wrap; word-break:break-word; }
.login-box { background:#fff; padding:40px 48px; border-radius:16px; box-shadow:0 10px 40px rgba(0,0,0,.2); width:380px; flex-shrink:0; }
@media (max-width:860px) {
    .login-wrap { flex-direction:column; align-items:center; }
    .login-notice { width:100%; }
}
.login-box h1 { text-align:center; color:#4a3fb5; margin-bottom:4px; }
.login-sub { text-align:center; color:#888; margin-bottom:24px; }
.login-error { background:#fdecea; color:#c62828; padding:10px; border-radius:6px; margin-bottom:16px; text-align:center; }
.login-tip { text-align:center; color:#999; margin-top:16px; font-size:13px; }
.login-ssl-warn { background:#fff3cd; border:1px solid #f0ad4e; color:#a05a00; padding:9px 12px; border-radius:6px; margin-top:12px; font-size:13px; text-align:center; word-break:break-all; }
.login-box .form-field { margin-bottom:16px; }
.login-box .form-field label { display:block; margin-bottom:6px; color:#555; font-size:14px; }
.login-box input { width:100%; padding:12px; border:1px solid #ddd; border-radius:8px; font-size:15px; }

/* ===== 布局 ===== */
.layout { display:flex; min-height:100vh; }
.sidebar { width:220px; background:linear-gradient(120deg,#8F1414,#B23A2E); color:#fce8e6; flex-shrink:0; display:flex; flex-direction:column; position:fixed; top:0; bottom:0; }
.sidebar-header { padding:20px 18px; border-bottom:1px solid #a5382c; }
.sidebar-header h2 { font-size:18px; color:#fff; }
.notice-bell { background:none; border:none; cursor:pointer; font-size:17px; padding:2px 6px;
    border-radius:6px; line-height:1; transition:background .2s; }
.notice-bell:hover { background:rgba(255,255,255,.15); }
.price-link { color:#fff; font-size:13px; text-decoration:none; padding:3px 8px;
    border-radius:6px; border:1px solid rgba(255,255,255,.35); background:rgba(255,255,255,.1);
    transition:background .2s; white-space:nowrap; }
.price-link:hover { background:rgba(255,255,255,.25); }
.task-name { font-size:12px; color:#f2c1bd; margin-top:4px; word-break:break-all; }
.sidebar-nav { flex:1; overflow-y:auto; padding:10px 0; }
.nav-group { padding:12px 18px 4px; font-size:12px; color:#f4ccc8; letter-spacing:1px; }
.nav-item { display:block; padding:10px 18px; color:#fdeae8; font-size:14px; transition:.2s; cursor:pointer; }
.nav-item:hover { background:rgba(255,255,255,.15); color:#ffd76b; }
.nav-item.active { background:rgba(255,255,255,.12); color:#ffd76b; font-weight:bold; }
.sidebar-footer { padding:14px 18px; border-top:1px solid #a5382c; display:flex; justify-content:space-between; font-size:13px; }
.sidebar-footer a { color:#ffd9d6; }
.content { flex:1; margin-left:220px; padding:24px; min-width:0; }

/* ===== 通用组件 ===== */
.page-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:20px; }
.page-header h1 { font-size:22px; color:#1e293b; }
.page-sub { color:#64748b; margin-top:6px; font-size:14px; }
.card { background:#fff; border-radius:10px; padding:20px; margin-bottom:20px; box-shadow:0 1px 3px rgba(0,0,0,.08); }
.card h3 { font-size:16px; color:#1e293b; margin-bottom:12px; }
.hint { color:#94a3b8; font-size:13px; margin-bottom:10px; }
.hint.top { margin-top:10px; }

.btn { padding:9px 18px; border:none; border-radius:6px; cursor:pointer; font-size:14px; transition:.2s; }
.btn:disabled { opacity:.6; cursor:not-allowed; }
.btn-primary { background:#4f46e5; color:#fff; }
.btn-primary:hover { background:#4338ca; }
.btn-secondary { background:#e2e8f0; color:#334155; }
.btn-secondary:hover { background:#cbd5e1; }
.btn-danger { background:#ef4444; color:#fff; }
.btn-danger:hover { background:#dc2626; }
.btn-success { background:#16a34a; color:#fff; }
.btn-sm { padding:5px 10px; font-size:12px; }
.btn-lg { padding:12px 30px; font-size:16px; }
.btn-block { width:100%; }

.form-row { display:flex; gap:16px; flex-wrap:wrap; align-items:flex-end; margin-bottom:10px; }
.form-field { display:flex; flex-direction:column; gap:6px; }
.form-field label { font-size:13px; color:#555; }
.form-field select, .form-field input { padding:8px 10px; border:1px solid #ddd; border-radius:6px; font-size:14px; min-width:160px; }
.inp { padding:6px 8px; border:1px solid #ddd; border-radius:4px; font-size:13px; width:100%; }
.check-label { display:flex; align-items:center; gap:6px; font-size:14px; }
.check-label input { width:auto; min-width:0; }

.table { width:100%; border-collapse:collapse; }
.table th, .table td { border:1px solid #e2e8f0; padding:8px 10px; text-align:center; font-size:13px; }
.table th { background:#f8fafc; color:#475569; }
.table tr:hover { background:#f8fafc; }

.badge { display:inline-block; padding:2px 10px; border-radius:12px; font-size:12px; }
.badge.draft { background:#fef3c7; color:#92400e; }
.badge.running { background:#dbeafe; color:#1d4ed8; }
.badge.done { background:#dcfce7; color:#166534; }
.badge.morning { background:#dbeafe; color:#1d4ed8; }
.badge.afternoon { background:#fef3c7; color:#92400e; }
.badge.evening { background:#ede9fe; color:#5b21b6; }

/* ===== 任务列表 ===== */
.task-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(300px,1fr)); gap:16px; }
.task-card { background:#fff; border-radius:10px; padding:18px; box-shadow:0 1px 3px rgba(0,0,0,.08); }
.task-card-head { display:flex; justify-content:space-between; align-items:center; margin-bottom:8px; }
.task-card-head h3 { font-size:16px; }
.task-desc { color:#64748b; font-size:13px; min-height:36px; }
.task-card-meta { color:#94a3b8; font-size:12px; margin-bottom:12px; }
.task-card-actions { display:flex; gap:8px; }
.empty-tip { grid-column:1/-1; text-align:center; color:#94a3b8; padding:40px; }

/* ===== 弹窗 ===== */
.modal-mask { position:fixed; top:0; right:0; bottom:0; left:0; background:rgba(0,0,0,.5); display:flex; align-items:center; justify-content:center; z-index:1000; }
.modal-box { background:#fff; border-radius:12px; width:440px; max-width:90%; box-shadow:0 20px 60px rgba(0,0,0,.3); }
.modal-box.modal-wide { width:528px; }
.modal-head { display:flex; justify-content:space-between; align-items:center; padding:16px 20px; border-bottom:1px solid #eee; }
.modal-title { font-size:16px; font-weight:600; }
.modal-close { border:none; background:none; font-size:22px; cursor:pointer; color:#888; }
.modal-body { padding:20px; }
.modal-body .form-field { margin-bottom:14px; }
.modal-body select, .modal-body input:not([type=checkbox]):not([type=radio]) { width:100%; padding:9px; border:1px solid #ddd; border-radius:6px; font-size:14px; }
/* 班级多选网格（班级课程管理新增弹窗用独立类名，避免与合班/预排冲突） */
.class-check-grid-add { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:6px;
    width:100%; box-sizing:border-box; }
.class-check-item { display:flex; align-items:center; justify-content:flex-start; gap:5px;
    padding:4px 6px; text-align:left;
    border:1px solid #e2e8f0; border-radius:6px; cursor:pointer; font-size:13px; color:#333;
    background:#f8fafc; transition:background .15s; min-width:0; overflow:hidden; box-sizing:border-box; }
.class-check-item:hover { background:#eef2ff; }
.class-check-item input[type=checkbox] { width:14px !important; height:14px; margin:0; padding:0; flex:0 0 auto;
    accent-color:#4a6cf7; align-self:center; min-width:14px; max-width:14px; }
.class-check-item span { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; min-width:0;
    flex:1 1 auto; line-height:1; }

/* ===== 上传 ===== */
.upload-zone { border:2px dashed #cbd5e1; border-radius:10px; padding:30px; text-align:center; margin-bottom:16px; background:#f8fafc; }
.upload-zone input { display:block; margin:0 auto 12px; }
.upload-tip { color:#94a3b8; }
.import-result { margin-top:16px; }
.loading { color:#4f46e5; }
.success-box { background:#f0fdf4; border:1px solid #bbf7d0; color:#166534; padding:14px; border-radius:8px; margin-bottom:10px; }
.error-box { background:#fef2f2; border:1px solid #fecaca; color:#991b1b; padding:14px; border-radius:8px; }
.warn-box { background:#fffbeb; border:1px solid #fde68a; color:#92400e; padding:14px; border-radius:8px; margin:10px 0; }
.stash-view-btn { font-size:12px; color:#4f46e5; cursor:pointer; text-decoration:underline; }
.stash-view-btn:hover { color:#3730a3; }
.stash-class-row { display:flex; align-items:center; justify-content:space-between; padding:10px 6px;
    border-bottom:1px solid #e2e8f0; font-size:14px; }
.cell-content.preview .course-name { color:#15803d; }
.cell-content.preview .cell-teacher { color:#166534; }
/* 上午最后一节与下午第一节之间的空白行 */
tr.period-gap td { border:none; background:#fff; height:14px; padding:0; }
tr.period-gap td, tr.period-gap:hover td { background:#fff; }

/* ===== 校验核查 ===== */
.check-count { font-size:13px; font-weight:normal; color:#64748b; }
.check-row { padding:7px 6px; border-bottom:1px solid #f1f5f9; font-size:14px; line-height:1.5; }

/* ===== 条件设置 ===== */
.cond-layout { display:flex; flex-direction:column; gap:16px; }
.cond-tabs { display:flex; gap:8px; }
.tab-btn { padding:10px 20px; border:none; border-radius:6px; cursor:pointer; background:#e2e8f0; font-size:14px; }
.tab-btn.active { background:#4f46e5; color:#fff; }
.cond-main { display:flex; gap:16px; }
.cond-left { width:280px; flex-shrink:0; }
.cond-select-list { background:#fff; border-radius:10px; padding:16px; }
.cond-select-list h3 { font-size:15px; margin:0; }
.cond-title-row { display:flex; align-items:center; gap:10px; margin-bottom:10px; }
.cond-sel-count { font-size:13px; font-weight:normal; color:#64748b; }
.cond-sel-count b { color:#2563eb; font-weight:bold; }
.cond-actions { display:flex; justify-content:space-between; align-items:center; margin-bottom:8px; }
.scroll-list { max-height:460px; overflow-y:auto; }
.select-item { display:flex; align-items:center; gap:6px; padding:6px 8px; border-radius:4px; cursor:pointer; font-size:14px; }
.select-item:hover { background:#f1f5f9; }
.cond-right { flex:1; background:#fff; border-radius:10px; padding:16px; }
.cond-toolbar { display:flex; align-items:center; gap:10px; margin-bottom:12px; flex-wrap:wrap; }

/* ===== 节次表 ===== */
.period-table { width:100%; border-collapse:collapse; table-layout:fixed; }
.period-table th { border:1px solid #e2e8f0; padding:6px; background:#f8fafc; font-size:12px; }
.period-table td.slot { border:1px solid #e2e8f0; padding:4px; text-align:center; cursor:pointer; min-height:44px; font-size:11px; vertical-align:middle; }
.period-table td.slot:hover { background:#f0f9ff; }
.period-table .period-name { font-size:11px; width:120px; background:#f8fafc; border:1px solid #e2e8f0; text-align:center; vertical-align:middle; }
.period-table .slot.selected { background:#fef08a !important; }
.period-table .slot.saved { background:#dcfce7; }
.period-table .slot.swap-valid { background:#dcfce7 !important; cursor:pointer; }
.period-table .slot.disabled { background:#e2e8f0; cursor:not-allowed; color:#94a3b8; }
.period-table .slot.pre-slot { background:#ede9fe; font-size:10px; }
.period-table .cell-content { display:flex; flex-direction:column; }
.course-name { font-weight:600; color:#4f46e5; }
.cell-teacher { font-size:10px; color:#64748b; }
.period-table.mini td { padding:2px; font-size:10px; }
.mini-cell { border:1px solid #e2e8f0; padding:3px; font-size:10px; text-align:center; }

/* ===== 调课 ===== */
.swap-layout { display:flex; gap:16px; }
.swap-main { flex:1; min-width:0; }
.swap-side { width:420px; flex-shrink:0; }
.swap-stash { margin-top:16px; }
.swap-stash h4 { font-size:14px; margin-bottom:8px; color:#475569; }
.stash-row { border:2px dashed #cbd5e1; border-radius:8px; min-height:52px; padding:8px; margin-bottom:8px; display:flex; gap:6px; flex-wrap:wrap; background:#f8fafc; }
.stash-hint { color:#94a3b8; font-size:12px; width:100%; }

/* 暂存区格子（5列2行） */
.stash-grid { width:100%; border-collapse:collapse; table-layout:fixed; }
.stash-grid td { border:2px dashed #cbd5e1; height:52px; vertical-align:middle; text-align:center;
    cursor:pointer; background:#f8fafc; padding:4px; }
.stash-grid td:hover { background:#f1f5f9; }
.stash-grid td.filled { border-style:solid; border-color:#94a3b8; background:#fef9c3; }
.stash-grid td.stash-selected { background:#fde047; border-color:#ca8a04; box-shadow:inset 0 0 0 2px #ca8a04; }
.stash-grid .stash-content { display:flex; flex-direction:column; font-size:11px; }
.stash-grid .course-name { font-weight:600; color:#4f46e5; }

/* 固定大小课表单元格 */
.period-table.fixed-cell td.slot { height:52px; }
.period-table td.slot .cell-btn { display:block; font-size:10px; color:#64748b; margin-top:2px; cursor:pointer; }
.period-table td.slot .cell-btn:hover { color:#4f46e5; }

/* 班级课程管理折叠 */
.grade-row td { cursor:pointer; background:#eef2ff; font-weight:600; text-align:left; }
.grade-row:hover td { background:#e0e7ff; }
.grade-caret { display:inline-block; width:14px; }
.grade-summary { font-weight:400; color:#64748b; font-size:12px; }
.class-row td { cursor:pointer; background:#f8fafc; text-align:left; }
.class-row:hover td { background:#f1f5f9; }
.class-summary { font-weight:400; color:#64748b; font-size:12px; }

/* 条件设置 */
.cond-layout { display:flex; flex-direction:column; gap:16px; }
.cond-table td.slot { min-height:68px; }
.cond-2x td.slot { height:68px; }
.quick-day-cell { background:#fef9c3; cursor:pointer; color:#92400e; font-size:12px; font-weight:600; }
.quick-day-cell:hover { background:#fde68a; }
.quick-day-row .period-name { background:#f8fafc; }
.grade-block { margin-bottom:2px; }
.grade-title { padding:8px; background:#eef2ff; cursor:pointer; font-weight:600; font-size:14px; border-radius:4px; }
.grade-title:hover { background:#e0e7ff; }
.grade-classes { padding-left:12px; }
.tag-label { font-size:13px; color:#555; }

/* 预排课单元格（可多班堆叠，自动增高） */
#preTable td.slot.pre-slot { vertical-align:top; padding:2px; }
.pre-cell-list { display:flex; flex-direction:column; gap:2px; }
.pre-cell-item { display:flex; align-items:center; justify-content:space-between; gap:4px;
    background:#dbeafe; border-radius:4px; padding:2px 6px; font-size:11px; }
.pre-cell-item .pre-cell-del { color:#dc2626; font-weight:700; cursor:pointer; font-size:13px; padding:0 3px; }
.pre-cell-item .pre-cell-del:hover { color:#991b1b; }

/* ===== 不连堂 / 节次空隙内容 ===== */
.nc-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(240px,1fr)); gap:10px; margin-bottom:16px; }
.nc-hint { color:#64748b; font-size:13px; line-height:1.8; margin-bottom:14px; }
.nc-cell { border:1px solid #e2e8f0; border-radius:6px; padding:8px 10px; background:#fff; }
.nc-cell:hover { border-color:#c7d2fe; }
.nc-title { display:flex; align-items:center; gap:8px; font-size:14px; cursor:pointer; }
.nc-title:hover { background:#f8fafc; }
.nc-name { margin-left:auto; display:inline-flex; align-items:center; gap:3px; color:#475569; font-size:12px; white-space:nowrap; cursor:pointer; }
.nc-name input[type=checkbox] { width:15px; height:15px; margin:0; flex:none; }
.nc-cell .gap-input { margin-top:8px; width:100%; padding:6px 8px; border:1px solid #d1d5db; border-radius:6px; font-size:13px; box-sizing:border-box; outline:none; }
.nc-cell .gap-input:focus { border-color:#4f46e5; box-shadow:0 0 0 2px rgba(79,70,229,.12); }
.nc-cell .gap-input::placeholder { color:#b6c2d4; }

/* ===== 合班/预排 ===== */
.class-check-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(140px,1fr)); gap:6px; margin-bottom:14px; }
.comb-block { display:flex; flex-direction:column; gap:8px; margin-bottom:18px;
    padding:14px 16px; border:1px solid #e2e8f0; border-radius:8px; background:#f8fafc; }
.grade-group { margin-bottom:10px; }
.grade-group-title { font-weight:600; color:#4f46e5; margin-bottom:6px; font-size:13px; }
.comb-block label { font-size:13px; font-weight:600; color:#333; }
.comb-block select { padding:8px 10px; border:1px solid #ddd; border-radius:6px; font-size:14px; min-width:200px; }
.comb-block h3 { font-size:14px; color:#555; margin:4px 0 0; font-weight:normal; }
.pre-layout { display:flex; gap:16px; }
.pre-left { width:240px; flex-shrink:0; }
.pre-right { flex:1; }

/* ===== 进度 ===== */
.progress-area { margin:20px 0; }
.progress-bar-wrap { background:#e2e8f0; border-radius:8px; height:26px; overflow:hidden; }
.progress-bar { background:linear-gradient(90deg,#4f46e5,#06b6d4); height:100%; transition:width .3s; border-radius:8px; }
.progress-info { display:flex; gap:20px; margin-top:12px; font-size:14px; color:#475569; flex-wrap:wrap; }
.progress-message { color:#4f46e5; }
.done-actions { display:flex; gap:10px; margin-top:12px; }
.rule-list { padding-left:20px; line-height:1.9; color:#475569; font-size:14px; }

.conf-item { padding:6px 0; border-bottom:1px solid #f1f5f9; font-size:14px; }

/* ===== 班级课表不排课标签显示 ===== */
.period-table td.slot.cond-cell { cursor:default; }
.period-table td.slot.cond-cell .cond-tag-label { display:block; text-align:center; font-size:12px; padding:4px; border-radius:4px; }
.period-table td.slot.cond-不排课 { background:#fee2e2; }
.period-table td.slot.cond-不排课 .cond-tag-label { color:#b91c1c; background:#fee2e2; }
.period-table td.slot.cond-自习 { background:#fef3c7; }
.period-table td.slot.cond-自习 .cond-tag-label { color:#92400e; background:#fef3c7; }
.period-table td.slot.cond-综合实践 { background:#d1fae5; }
.period-table td.slot.cond-综合实践 .cond-tag-label { color:#065f46; background:#d1fae5; }
.period-table td.slot.cond-班会 { background:#ede9fe; }
.period-table td.slot.cond-班会 .cond-tag-label { color:#5b21b6; background:#ede9fe; }
.period-table td.slot.cond-cell.cond-不排课 { background:#fee2e2 !important; }
.period-table td.slot.cond-cell.cond-自习 { background:#fef3c7 !important; }
.period-table td.slot.cond-cell.cond-综合实践 { background:#d1fae5 !important; }
.period-table td.slot.cond-cell.cond-班会 { background:#ede9fe !important; }

/* 条件页年级勾选 */
.grade-check-label { display:inline-flex; align-items:center; margin-right:6px; cursor:pointer; }
.grade-check-label input { cursor:pointer; }

/* 右侧课表对应节次高亮（悬停=黄，选中=灰） */
.period-table .mini-cell.mini-hover { background:#fef08a !important; }
.period-table .mini-cell.mini-selected { background:#cbd5e1 !important; }
