        body { font-family: "Microsoft YaHei", sans-serif; background-color: #f2f4f7; margin: 0; padding: 10px; overflow-x: auto; }
        .container { background-color: #fff; padding: 15px; border-radius: 6px; box-shadow: 0 2px 6px rgba(0,0,0,0.06); margin: 0 auto; min-width: 1200px; max-width: 100%; }
        h2, .subtitle { text-align: center; color: #29323c; margin: 5px 0; }
        .subtitle { color: #6b7280; font-size: 14px; margin-bottom: 15px; }
        .config-area { background: #eaf1f7; border: 1px solid #2c5f8a; border-radius: 6px; padding: 10px 16px; margin-bottom: 10px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; justify-content: center; }
        .config-area label { font-weight: bold; color: #29323c; font-size: 13px; }
        .config-area input[type="number"] { width: 50px; padding: 4px; border: 1px solid #d7dce2; border-radius: 4px; text-align: center; font-size: 13px; }
        .config-area .btn-apply { background-color: #2c5f8a; color: white; border: none; padding: 4px 16px; border-radius: 4px; cursor: pointer; font-weight: bold; }
        .config-area .btn-apply:hover { background-color: #244d70; }
        .upload-area { background: #eaf1f7; border: 2px dashed #2c5f8a; border-radius: 8px; padding: 12px 20px; margin-bottom: 10px; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px; }
        .upload-area .upload-left { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
        .upload-area input[type="file"] { padding: 5px 10px; font-size: 13px; border: 1px solid #d7dce2; border-radius: 4px; background: white; cursor: pointer; }
        .upload-area .file-status { font-weight: bold; color: #3f7d5c; font-size: 13px; }
        .upload-area .file-status.empty { color: #6b7280; }
        .upload-help-hint { position: relative; display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: bold; color: #2c5f8a; background: #eef4fb; border: 1px solid #bcd3ea; border-radius: 4px; padding: 3px 10px; cursor: help; }
        .upload-help-hint:hover { background: #dceafd; }
        .upload-help-popover { display: none; position: absolute; top: 130%; left: 0; z-index: 9999; background: #fff; border: 1px solid #d7dce2; border-radius: 6px; box-shadow: 0 6px 20px rgba(0,0,0,0.2); padding: 12px 14px; width: 540px; font-size: 12px; color: #29323c; font-weight: normal; text-align: left; cursor: default; white-space: normal; }
        .upload-help-hint:hover .upload-help-popover { display: block; }
        .upload-help-popover table { border-collapse: collapse; width: 100%; margin: 6px 0; font-size: 12px; }
        .upload-help-popover th, .upload-help-popover td { border: 1px solid #d7dce2; padding: 4px 6px; text-align: center; }
        .upload-help-popover th { background: #f2f5f8; color: #2c5f8a; }
        .upload-help-popover .help-title { font-weight: bold; color: #2c5f8a; margin-bottom: 4px; }
        .upload-help-popover ul { margin: 4px 0 0 18px; padding: 0; }
        .upload-help-popover li { margin: 2px 0; line-height: 1.5; }
        .rules-area { background: #f6f7f8; border: 1px solid #d7dce2; border-radius: 6px; padding: 10px 15px; margin-bottom: 10px; display: flex; flex-wrap: wrap; gap: 15px; justify-content: center; }
        .rules-area .rule-group { flex: 1; min-width: 320px; border: 1px solid #e4e7eb; border-radius: 6px; padding: 8px 12px; background: #fff; }
        .rules-area .rule-group h4 { margin: 0 0 5px 0; color: #29323c; font-size: 13px; border-bottom: 2px solid #b8863b; padding-bottom: 3px; }
        .rules-area .rule-group h4 .badge { font-size: 11px; background: #b8863b; color: white; border-radius: 12px; padding: 0 8px; margin-left: 6px; }
        .rules-area .rule-group h4 .badge.blue { background: #2c5f8a; }
        .rules-area .rule-group h4 .badge.green { background: #3f7d5c; }
        .rules-area .rule-group h4 .badge.purple { background: #6b5b95; }
        .rules-area .rule-item { display: flex; align-items: center; gap: 4px; margin: 3px 0; font-size: 12px; flex-wrap: wrap; }
        .rules-area .rule-item select { padding: 2px 4px; font-size: 12px; border: 1px solid #d7dce2; border-radius: 3px; background: white; max-width: 100px; }
        .rules-area .rule-item select.multi-select { max-width: 140px; }
        .rules-area .rule-item .remove-btn { color: #b3454b; cursor: pointer; font-weight: bold; font-size: 14px; margin-left: 2px; }
        .rules-area .rule-item .remove-btn:hover { color: #96393e; }
        .rule-index { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: #2c5f8a; color: #fff; font-size: 11px; font-weight: bold; flex-shrink: 0; }
        .prep-group-row > .rule-index { background: #c2410c; }
        .bind-rule-item > .rule-index, .multi-bind-item > .rule-index { background: #6b5b95; }
        .rules-area .add-btn { color: #2c5f8a; cursor: pointer; font-size: 12px; font-weight: bold; margin-top: 2px; display: inline-block; }
        .rules-area .add-btn:hover { color: #3a6f96; }
        .rules-area .rule-hint { font-size: 11px; color: #6b7280; margin-top: 2px; }
        .room-avail-row { display: flex; align-items: center; gap: 4px; margin: 2px 0; flex-wrap: wrap; }
        .room-avail-row .remove-btn { color: #b3454b; cursor: pointer; font-weight: bold; font-size: 14px; margin-left: 2px; }
        .room-avail-row .remove-btn:hover { color: #96393e; }
        .rule-item .bind-label { font-weight: bold; color: #6b5b95; margin: 0 2px; }
        .rule-item .week-check { margin-left: 6px; font-size: 12px; }
        .rule-item .scope-select { max-width: 80px; }
        .action-area { background: #f2f4f7; border: 1px solid #d7dce2; border-radius: 6px; padding: 10px 16px; margin-bottom: 10px; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; }
        .action-area .btn { padding: 6px 16px; font-size: 13px; }
        .toolbar { display: flex; justify-content: center; margin-bottom: 10px; gap: 10px; flex-wrap: wrap; align-items: center; }
        .stat-panel { background-color: #f8f0e2; border: 1px solid #e9d9b8; padding: 10px; border-radius: 6px; margin-bottom: 10px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
        .checkbox-group { display: flex; gap: 8px; font-weight: bold; color: #9c7130; flex-wrap: wrap; justify-content: center; }
        .checkbox-group label { font-size: 13px; }
        .btn { color: white; border: none; padding: 6px 16px; font-size: 13px; border-radius: 4px; cursor: pointer; font-weight: bold; transition: background 0.3s, transform 0.1s; white-space: nowrap; }
        .btn:active { transform: scale(0.97); }
        .btn-info { background-color: #6b7280; }
        .btn-danger { background-color: #b3454b; }
        .btn-danger:hover { background-color: #b3454b; }
        .btn-warning { background-color: #b8863b; box-shadow: 0 2px 6px rgba(230, 162, 60, 0.4); }
        .btn-primary { background-color: #2c5f8a; }
        .btn-primary:hover { background-color: #244d70; }
        .btn-success { background-color: #3f7d5c; }
        .btn-success:hover { background-color: #336749; }
        .btn-purple { background-color: #6b5b95; }
        .btn-purple:hover { background-color: #574a7d; }
        .btn-teal { background-color: #3f7f7a; }
        .btn-teal:hover { background-color: #336763; }
        .btn-undo { background-color: #574a7d; }
        .btn-undo:hover { background-color: #574a7d; }
        .btn-rule-export { background-color: #3f7d5c; }
        .btn-rule-export:hover { background-color: #336749; }
        .btn-rule-import { background-color: #2c5f8a; }
        .btn-rule-import:hover { background-color: #244d70; }
        .table-responsive { width: 100%; max-width: 100%; overflow-x: auto; overflow-y: visible; border: 1px solid #d7dce2; border-radius: 4px; cursor: grab; }
        .table-responsive.dragging { cursor: grabbing; user-select: none; }
        .table-responsive::-webkit-scrollbar { height: 14px; }
        .table-responsive::-webkit-scrollbar-track { background: #eef1f5; border-radius: 7px; }
        .table-responsive::-webkit-scrollbar-thumb { background: #8fa4bd; border-radius: 7px; border: 3px solid #eef1f5; }
        .table-responsive::-webkit-scrollbar-thumb:hover { background: #6b7280; }
        .sticky-hscroll {
            position: sticky; bottom: 0; left: 0; width: 100%; height: 16px;
            overflow-x: auto; overflow-y: hidden; background: #eef1f5;
            border: 1px solid #d7dce2; border-top: none; border-radius: 0 0 4px 4px;
            z-index: 60; display: none; margin-bottom: 4px;
        }
        .sticky-hscroll::-webkit-scrollbar { height: 14px; }
        .sticky-hscroll::-webkit-scrollbar-track { background: #eef1f5; }
        .sticky-hscroll::-webkit-scrollbar-thumb { background: #8fa4bd; border-radius: 7px; border: 3px solid #eef1f5; }
        .sticky-hscroll::-webkit-scrollbar-thumb:hover { background: #6b7280; }
        .sticky-hscroll-inner { height: 1px; }
        table { width: 100%; border-collapse: collapse; table-layout: auto; font-size: 12px; }
        th, td { border: 1px solid #d7dce2; text-align: center; padding: 3px 4px; font-size: 11px; white-space: nowrap; }
        thead th { background-color: #eaf1f7; color: #29323c; font-weight: bold; position: sticky; top: 0; z-index: 20; height: 30px; }
        .day-cell { background-color: #dbe6ee; color: #2c5f8a; font-weight: bold; font-size: 13px; position: sticky; left: 0; z-index: 15; }
        .period-cell { background-color: #eaf1f7; color: #565d66; font-weight: bold; position: sticky; left: 55px; z-index: 14; }
        .cell-container { position: relative; width: 100%; height: 26px; display: flex; align-items: center; justify-content: space-between; border-radius: 3px; cursor: default; background: white; padding: 0 2px; }
        .cell-container.drag-source { opacity: 0.4; outline: 2px dashed #6b5b95; }
        .cell-container.drag-over-ok { outline: 2px solid #2f9e5b; background-color: #eafaf0; }
        .cell-container.drag-over-bad { outline: 2px solid #c0392b; background-color: #fdecea; }
        .cell-text { flex: 1; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; user-select: none; font-size: 10px; }
        .cell-badges { display: inline-flex; align-items: center; flex-shrink: 0; white-space: nowrap; }
        .cell-badges:empty { display: none; }
        .dropdown-trigger { width: 16px; height: 16px; line-height: 16px; text-align: center; background: #e6ecf2; border-radius: 3px; color: #2c5f8a; font-weight: bold; font-size: 10px; cursor: pointer; margin-right: 1px; flex-shrink: 0; transition: background 0.2s; user-select: none; display: none; }
        .dropdown-trigger:hover { background: #d7dce2; }
        #toast-container { position: fixed; top: 54px; left: 50%; transform: translateX(-50%); z-index: 99999; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
        .toast-msg { background: #2c3e50; color: #fff; padding: 10px 18px; border-radius: 6px; font-size: 13px; line-height: 1.6; box-shadow: 0 4px 14px rgba(0,0,0,0.25); max-width: 480px; white-space: pre-wrap; text-align: left; opacity: 0; transform: translateY(-10px); transition: opacity .25s ease, transform .25s ease; pointer-events: auto; cursor: pointer; }
        .toast-msg.show { opacity: 1; transform: translateY(0); }
        .toast-msg.toast-warn { background: #8a5a1e; }
        .toast-msg.toast-error { background: #a83232; }
        .toast-msg.toast-success { background: #2f7d4f; }
        .cell-container.study-cell .dropdown-trigger { display: block; }
        .custom-dropdown { display: none; position: absolute; top: 24px; right: 0; z-index: 999; background: white; border: 1px solid #c3d2e0; border-radius: 4px; box-shadow: 0 4px 12px rgba(0,0,0,0.15); padding: 3px 0; min-width: 130px; max-height: 160px; overflow-y: auto; }
        .custom-dropdown .dropdown-item { padding: 3px 10px; font-size: 11px; cursor: pointer; color: #29323c; white-space: nowrap; transition: background 0.15s; }
        .custom-dropdown .dropdown-item:hover { background: #eaf1f7; color: #2c5f8a; }
        .custom-dropdown .dropdown-item.reset-item { color: #b8863b; font-weight: bold; border-bottom: 1px dashed #d7dce2; }
        .custom-dropdown .dropdown-item.reset-item:hover { background: #f8f0e2; color: #9c7130; }
        .badge-has-course { background-color: #b3454b; color: white; border-radius: 10px; padding: 0 4px; font-size: 9px; font-weight: bold; margin-left: 2px; display: inline-block; }
        .badge-zero-course { background-color: #6b7280; color: white; border-radius: 10px; padding: 0 4px; font-size: 9px; font-weight: bold; margin-left: 2px; display: inline-block; }
        .ampm-badge { font-size: 8px; color: #565d66; margin-left: 2px; font-weight: normal; }
        .ampm-badge.sun { color: #b8863b; }
        .ampm-badge.moon { color: #2c5f8a; }
        .week-dist-badge { font-size: 8px; color: #6b21a8; margin-left: 2px; font-weight: normal; display: inline-block; }
        .highlight-target { background-color: #e9cf7a !important; color: #b3454b !important; font-weight: bold !important; box-shadow: inset 0 0 0 2px #b3454b !important; animation: breathe 1.2s infinite alternate; }
        @keyframes breathe { 0% { opacity: 0.85; } 100% { opacity: 1; box-shadow: inset 0 0 6px 2px #b3454b !important; } }
        .day-boundary { border-bottom: 4px solid #1a365d !important; background-color: #f0f4f8; }
        .noon-boundary { border-bottom: 1px dashed #d4a76a !important; }
        .ampm-separator-row td.ampm-separator-cell {
            background: linear-gradient(90deg, #f8f0e2 0%, #eddcb0 50%, #dbe6ee 100%);
            color: #9c7130;
            font-weight: bold;
            font-size: 12px;
            letter-spacing: 1px;
            padding: 3px 4px;
            border-top: 2px solid #b8863b;
            border-bottom: 2px solid #2c5f8a;
            text-align: center;
            position: relative;
        }
        .ampm-sep-dots { color: #a8adb5; letter-spacing: -1px; font-weight: normal; }
        .conflict-cell { background-color: #faeced !important; color: #b3454b !important; font-weight: bold; }
        .cross-conflict-cell { outline: 3px solid var(--cross-color, #6b5b95) !important; outline-offset: -2px; box-shadow: 0 0 0 2px #fff inset; }
        .cross-conflict-cell::after { content: "⚠"; position: absolute; top: 0; right: 1px; font-size: 9px; color: var(--cross-color, #6b5b95); }
        .selected-for-swap { outline: 2px solid #2c5f8a !important; background-color: #eaf1f7 !important; }
        .swap-btn { position: absolute; top: 1px; right: 1px; width: 16px; height: 16px; line-height: 16px; text-align: center; font-size: 10px; color: #2c5f8a; background: #eaf1f7; border: 1px solid #b3c9e0; border-radius: 3px; cursor: pointer; z-index: 5; user-select: none; display: none; transition: all 0.15s; }
        .swap-btn:hover { background: #2c5f8a; color: #fff; }
        .cell-container:hover .swap-btn { display: block; }
        .cell-container.study-cell:hover .swap-btn { left: 1px; right: auto; }
        .swap-btn.active { display: block; background: #2c5f8a; color: #fff; outline: 2px solid #1a4a6e; }
        .monitor-item { padding: 4px 8px; border-radius: 3px; margin-bottom: 2px; border-left: 4px solid #6b7280; background: #f5f5f5; }

        .rule-violation { background-color: #e0b34d !important; color: #b3454b !important; font-weight: bold !important; box-shadow: inset 0 0 0 2px #c9822f !important; animation: flashRule 0.8s infinite alternate; }
        @keyframes flashRule { 0% { opacity: 0.8; background-color: #e0b34d; } 100% { opacity: 1; background-color: #d99a3d; box-shadow: inset 0 0 6px 2px #a86b28; } }
        .over-hour-warning { background-color: #b3454b !important; color: white !important; font-weight: bold; box-shadow: inset 0 0 0 2px #96393e !important; animation: flashWarning 1s infinite alternate; }
        @keyframes flashWarning { 0% { opacity: 0.85; background-color: #b3454b; } 100% { opacity: 1; background-color: #96393e; box-shadow: inset 0 0 8px 2px #7a2f33; } }
        .result-wrapper { display: block; width: 100%; margin-top: 12px; border-top: 2px solid #b8863b; padding-top: 12px; }
        .result-table { width: 90%; margin: 0 auto; min-width: 400px; border-collapse: collapse; font-size: 12px; }
        .result-table th { background-color: #f2f4f7; color: #565d66; border: 1px solid #d7dce2; padding: 4px 6px; }
        .result-table th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
        .result-table th.sortable:hover { background-color: #e3e7ed; color: #333; }
        .sort-arrow { font-size: 11px; color: #999; margin-left: 2px; }
        .result-table td { border: 1px solid #d7dce2; padding: 4px 6px; text-align: center; }
        
        .consecutive-info { font-size: 11px; color: #409eff; margin: 2px 0; }
        .consecutive-uniform-info { font-size: 11px; margin: 2px 0; }
        .highlight-target { outline: 2px solid #e6a23c !important; background-color: #fff7eb !important; }
        .clickable-name { color: #2c5f8a; text-decoration: underline; cursor: pointer; font-weight: bold; }
        .clickable-name:hover { color: #3a6f96; background-color: #eaf1f7; }
        
        .red-count-panel { background: #fff1f0; border: 2px solid #b3454b; border-radius: 8px; padding: 4px 14px; display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: bold; color: #cf1322; margin: 0 6px; }
        .red-count-panel .count-num { font-size: 18px; color: #b3454b; background: white; padding: 0 8px; border-radius: 4px; min-width: 28px; text-align: center; }
        .stat-bar { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 6px; }
        .fixed-cell { border: 3px solid #2c5f8a !important; box-shadow: inset 0 0 0 1px #2c5f8a; }
        .study-reason-panel { background: #eaf1f7; border: 1px solid #2c5f8a; border-radius: 6px; padding: 6px 14px; margin-top: 6px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
        .study-reason-panel .reason-item { font-size: 11px; color: #29323c; background: white; padding: 1px 8px; border-radius: 12px; border: 1px solid #d7dce2; }
        .study-reason-panel .reason-item .count { font-weight: bold; color: #2c5f8a; }
        .study-reason-panel .total { font-weight: bold; color: #b3454b; font-size: 13px; }
        .study-hint { display: none; position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); background: rgba(0,0,0,0.88); color: white; padding: 4px 10px; border-radius: 4px; font-size: 10px; white-space: normal; z-index: 100; pointer-events: none; max-width: 400px; text-align: left; line-height: 1.3; }
        .cell-container:hover .study-hint { display: block; }
        .cell-container.study-cell { background-color: #fff3e0; color: #9c6b2c; font-style: italic; }
        .cell-container.study-cell .cell-text { color: #9c6b2c; }
        /* "禁排所有课程"空白格：由"🚫 所有课程"禁排规则命中的空位会渲染成这种格，
           不显示"自习"文字、不显示下拉触发器，只保留一个浅灰底 + 右上角 🚫 角标，
           表示"该时段整段禁排，单元格保持空白"。 */
        .cell-container.forbid-all-cell { background-color: #f3f4f6 !important; color: #9ca3af !important; font-style: normal !important; }
        .cell-container.forbid-all-cell .cell-text { color: transparent !important; }
        .cell-container.forbid-all-cell .dropdown-trigger { display: none !important; }
        .cell-container.forbid-all-cell .study-hint { display: none; }
        .cell-container.forbid-all-cell::after {
            content: "🚫"; position: absolute; top: 1px; right: 2px;
            font-size: 10px; color: #b3454b; opacity: 0.65; pointer-events: none;
        }
        .cell-container.forbid-all-cell .swap-btn { display: none !important; }
        /* 鼠标悬浮在禁排格上时，把禁排原因浮窗显示出来 */
        .cell-container.forbid-all-cell:hover .study-hint.forbid-all-hint {
            display: block; background: rgba(179, 69, 75, 0.92);
        }
        .daily-violation { background-color: #c56368 !important; color: white !important; font-weight: bold !important; box-shadow: inset 0 0 0 2px #96393e !important; animation: flashDaily 0.8s infinite alternate; }
        @keyframes flashDaily { 0% { opacity: 0.85; background-color: #c56368; } 100% { opacity: 1; background-color: #b3454b; box-shadow: inset 0 0 6px 2px #a93226; } }
        .bind-rule-item { background: #f2f0f8; border-left: 3px solid #6b5b95; padding: 2px 6px; border-radius: 3px; }
        .multi-bind-item { background: #e8f8f0; border-left: 3px solid #3f7f7a; padding: 2px 6px; border-radius: 3px; }
        .rule-item select[multiple] { height: auto; min-height: 28px; }
        .monitor-panel { background: #f6f7f8; border: 2px solid #b8863b; border-radius: 6px; padding: 10px 15px; margin-top: 10px; margin-bottom: 10px; }
        .monitor-panel .monitor-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #d7dce2; padding-bottom: 6px; margin-bottom: 8px; flex-wrap: wrap; gap: 8px; }
        .monitor-panel .monitor-header h4 { margin: 0; color: #b8863b; font-size: 15px; }
        .monitor-panel .monitor-header .badge-count { background: #b3454b; color: white; border-radius: 12px; padding: 0 10px; font-weight: bold; font-size: 13px; }
        .monitor-list { max-height: 300px; overflow-y: auto; font-size: 12px; line-height: 1.6; }
        .monitor-item { padding: 4px 8px; border-radius: 3px; margin-bottom: 2px; border-left: 4px solid #6b7280; background: #f5f5f5; }
        .monitor-item .type-tag { display: inline-block; padding: 0 6px; border-radius: 3px; font-weight: bold; margin-right: 6px; font-size: 11px; color: white; }
        .monitor-item .type-tag.over { background: #b3454b; }
        .monitor-item .type-tag.under { background: #b8863b; }
        .clickable-monitor { cursor: pointer; transition: background 0.15s, transform 0.1s; }
        .clickable-monitor:hover { background: #e8eef5 !important; transform: translateX(2px); }
        .monitor-highlight-marker { outline: 2px solid #e6a23c !important; background-color: #fff7eb !important; animation: breathe 1.2s infinite alternate; }
        .monitor-item .type-tag.daily { background: #c56368; }
        .monitor-item .type-tag.study { background: #6b5b95; }
        .monitor-item .type-tag.conflict { background: #b3454b; }
        .monitor-item .type-tag.rule { background: #b3454b; }
        .monitor-empty { text-align: center; color: #3f7d5c; font-weight: bold; padding: 10px 0; }
        .adjust-selected-cell { outline: 3px solid #7c3aed !important; outline-offset: -2px; background-color: #f3e8ff !important; }
        .adjust-toolbar { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
        .adjust-mode-btn { background:#e8e3f0 !important; color:#483d8b !important; border:1px solid #c3b8d9 !important; }
        .adjust-mode-btn.active-mode { background:#7c3aed !important; color:#fff !important; border-color:#7c3aed !important; }
        .adjust-selection-hint { font-size:12px; color:#6b7280; }
        .adjust-selected-daycell { background:#7c3aed !important; color:#fff !important; border-color:#7c3aed !important; }
        .modify-upload-area { background: #eaf4ee; border: 2px solid #3f7d5c; border-radius: 8px; padding: 10px 20px; margin-bottom: 10px; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px; }
        .modify-upload-area .file-status { font-weight: bold; color: #3f7d5c; }
        .modify-upload-area .file-status.empty { color: #6b7280; }
        .rule-upload-area { background: #eaf4fe; border: 2px solid #2c5f8a; border-radius: 8px; padding: 10px 20px; margin-bottom: 10px; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px; }
        .rule-upload-area .file-status { font-weight: bold; color: #2c5f8a; }
        .rule-upload-area .file-status.empty { color: #6b7280; }
        .top-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; align-items: stretch; }
        .top-row > div { flex: 1 1 280px; margin-bottom: 0 !important; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; }
        .export-rule-area { background: #f8f0e2; border: 2px solid #b8863b; border-radius: 8px; padding: 10px 20px; gap: 12px; }
        .export-rule-area .btn-rule-export { padding: 6px 16px; }
    
        .cell-restricted { outline: 2px solid #1890ff !important; outline-offset: -2px; box-shadow: 0 0 0 2px rgba(24,144,255,0.2) inset; position: relative; }
        .cell-restricted::after { content: '⚠'; position: absolute; top: 0; left: 2px; font-size: 10px; color: #1890ff; z-index: 3; pointer-events: none; }
        .cell-restricted:hover { outline-color: #096dd9; box-shadow: 0 0 0 3px rgba(24,144,255,0.3) inset; }
    
        .sun-clickable { cursor: pointer; transition: all 0.2s; padding: 2px 5px; border-radius: 4px; font-size: 14px; }
        .sun-clickable:hover { background: #ffd54f; color: #f57f17; transform: scale(1.2); box-shadow: 0 2px 8px rgba(255,152,0,0.4); }
        .moon-clickable { cursor: pointer; transition: all 0.2s; padding: 2px 5px; border-radius: 4px; font-size: 14px; }
        .moon-clickable:hover { background: #90caf9; color: #1565c0; transform: scale(1.2); box-shadow: 0 2px 8px rgba(21,101,192,0.4); }
        .day-clickable { cursor: pointer; transition: all 0.2s; padding: 2px 6px; border-radius: 4px; font-size: 12px; background: #eef1f5; border: 1px solid #d7dce2; margin: 0 2px; display: inline-block; }
        .day-clickable:hover { background: #3f7d5c; color: #fff; border-color: #3f7d5c; transform: scale(1.08); box-shadow: 0 2px 8px rgba(63,125,92,0.4); }
        .subject-week-clickable { cursor: pointer; font-weight: bold; color: #2c5f8a; text-decoration: underline dotted; transition: all 0.2s; }
        .subject-week-clickable:hover { color: #b8863b; }
        .stats-click-active { background: #b8863b !important; color: #fff !important; font-weight: bold !important; font-size: 1.15em !important; border-radius: 4px; box-shadow: 0 2px 6px rgba(184,134,59,.5); }
        .workload-link { cursor: pointer; color: #e6a23c; font-weight: bold; font-size: 11px; transition: all 0.2s; padding: 1px 4px; border-radius: 3px; }
        .workload-link:hover { background: #e6a23c; color: #fff; }
        .no-consecutive-info { cursor: pointer; color: #f56c6c; font-weight: bold; font-size: 11px; transition: all 0.2s; padding: 1px 4px; border-radius: 3px; }
        .no-consecutive-info:hover { background: #f56c6c; color: #fff; }
        .noonbreak-info { cursor: pointer; color: #9b59b6; font-weight: bold; font-size: 11px; transition: all 0.2s; padding: 1px 4px; border-radius: 3px; }
        .noonbreak-info:hover { background: #9b59b6; color: #fff; }

        /* ======== 调课单面板 ======== */
        .substitute-overlay { position:fixed; top:0; left:0; width:100%; height:100%; background:rgba(0,0,0,0.35); z-index:9998; display:none; }
        .substitute-overlay.show { display:block; }
        .substitute-panel { position:fixed; top:50%; left:50%; transform:translate(-50%,-50%); width:920px; max-width:95vw; max-height:88vh; background:#fff; border-radius:12px; box-shadow:0 12px 40px rgba(0,0,0,0.25); z-index:9999; display:none; flex-direction:column; overflow:hidden; }
        .substitute-panel.show { display:flex; }
        .substitute-panel .sp-header { background:linear-gradient(135deg,#6a5acd,#483d8b); color:#fff; padding:14px 20px; display:flex; align-items:center; justify-content:space-between; }
        .substitute-panel .sp-header h3 { margin:0; font-size:17px; }
        .substitute-panel .sp-close { background:rgba(255,255,255,0.2); border:none; color:#fff; width:30px; height:30px; border-radius:50%; cursor:pointer; font-size:16px; }
        .substitute-panel .sp-close:hover { background:rgba(255,255,255,0.35); }
        .substitute-panel .sp-body { padding:16px 20px; overflow-y:auto; flex:1; }
        .substitute-panel .sp-section { margin-bottom:16px; }
        .substitute-panel .sp-section-title { font-weight:bold; color:#483d8b; font-size:14px; margin-bottom:8px; border-bottom:2px solid #e8e3f0; padding-bottom:4px; }
        .substitute-panel .sp-teacher-row { display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin-bottom:8px; }
        .substitute-panel .sp-teacher-row select, .substitute-panel .sp-teacher-row input { padding:5px 8px; border:1px solid #d7dce2; border-radius:4px; font-size:13px; }
        .substitute-panel .sp-add-btn { background:#483d8b; color:#fff; border:none; padding:5px 14px; border-radius:4px; cursor:pointer; font-size:13px; }
        .substitute-panel .sp-add-btn:hover { background:#3d3270; }
        .substitute-panel .sp-remove-btn { background:#e74c3c; color:#fff; border:none; width:26px; height:26px; border-radius:4px; cursor:pointer; font-size:13px; }
        .substitute-panel .sp-result-table { width:100%; border-collapse:collapse; font-size:12px; }
        .substitute-panel .sp-result-table th { background:#f0edf5; color:#483d8b; padding:6px 8px; text-align:left; border:1px solid #d7dce2; font-weight:bold; }
        .substitute-panel .sp-result-table td { padding:6px 8px; border:1px solid #e0dcea; vertical-align:top; }
        .substitute-panel .sp-result-table tr:nth-child(even) td { background:#faf9fc; }
        .substitute-panel .sp-candidate { display:inline-block; background:#e8f5e9; color:#2e7d32; padding:2px 8px; border-radius:3px; margin:2px 4px 2px 0; font-size:11px; cursor:pointer; border:1px solid #c8e6c9; }
        .substitute-panel .sp-candidate:hover { background:#c8e6c9; }
        .substitute-panel .sp-candidate.priority1 { background:#e3f2fd; color:#1565c0; border-color:#bbdefb; }
        .substitute-panel .sp-candidate.priority1:hover { background:#bbdefb; }
        .substitute-panel .sp-candidate.priority2 { background:#fff3e0; color:#e65100; border-color:#ffe0b2; }
        .substitute-panel .sp-candidate.priority2:hover { background:#ffe0b2; }
        .substitute-panel .sp-candidate.none { background:#ffebee; color:#c62828; border-color:#ffcdd2; cursor:default; }
        .substitute-panel .sp-empty { text-align:center; color:#999; padding:20px; font-size:13px; }
        .substitute-panel .sp-footer { padding:12px 20px; border-top:1px solid #e0dcea; display:flex; justify-content:space-between; align-items:center; background:#faf9fc; }
        .substitute-panel .sp-hint { font-size:11px; color:#888; }
        .substitute-panel .sp-export-btn { background:#2e7d32; color:#fff; border:none; padding:7px 18px; border-radius:4px; cursor:pointer; font-size:13px; font-weight:bold; }
        .substitute-panel .sp-export-btn:hover { background:#1b5e20; }
        .substitute-panel .sp-assigned { background:#fff9c4 !important; font-weight:bold; }
