:root {
    --theme-primary: #475569;
    --theme-hover: #334155;
    --theme-light: #f1f5f9;
    --theme-border: #cbd5e1;
    --bg-main: #f1f5f9;
    --bg-card: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --table-header: #f8fafc;
}

[data-theme="dark"] {
    --bg-main: #0f172a;
    --bg-card: #1e293b;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --border-color: #334155;
    --theme-light: rgba(255, 255, 255, 0.08);
    --theme-border: #475569;
    --table-header: #0f172a;
}

html, body {
    height: 100vh !important;
    width: 100vw !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: row !important;
    font-family: 'Noto Sans SC', 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    -webkit-tap-highlight-color: transparent;
}

/* 左侧固定侧边导航栏：无论屏幕分辨率或CDN状态，恒定钉在左侧，绝不横向坍塌 */
#sidebar {
    width: 240px !important;
    min-width: 240px !important;
    max-width: 240px !important;
    height: 100vh !important;
    max-height: 100vh !important;
    flex-shrink: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    position: relative !important;
    top: 0 !important;
    left: 0 !important;
    transform: none !important;
    z-index: 40 !important;
    box-sizing: border-box !important;
}

/* 侧栏导航菜单列表容器 */
#sidebar-nav {
    flex: 1 1 0% !important;
    overflow-y: auto !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
    padding: 12px !important;
    margin: 0 !important;
    box-sizing: border-box !important;
}

/* 侧栏菜单项胶囊按钮基础样式 */
.nav-item {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    width: 100% !important;
    padding: 10px 14px !important;
    border-radius: 12px !important;
    text-align: left !important;
    cursor: pointer !important;
    border: none !important;
    background: transparent;
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px !important;
    box-sizing: border-box !important;
    text-decoration: none !important;
}

.nav-item i {
    width: 20px !important;
    text-align: center !important;
    font-size: 16px !important;
    flex-shrink: 0 !important;
}

.nav-item .nav-title {
    flex: 1 1 0% !important;
}

/* 右侧主工作区容器：充满剩余视口宽度 */
main {
    flex: 1 1 0% !important;
    min-width: 0 !important;
    height: 100vh !important;
    max-height: 100vh !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    background-color: var(--bg-main) !important;
    position: relative !important;
    box-sizing: border-box !important;
}

/* 移动端菜单按钮在常规屏幕下彻底隐藏 */
#mobile-sidebar-toggle {
    display: none !important;
}

/* 课表核心网格与卡片自适应保底 */
#view-timetable {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

#timetable-table-container {
    flex: 1 1 0% !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    overflow-x: auto !important;
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
}

#timetable-table {
    width: 100% !important;
    table-layout: fixed !important;
    border-collapse: collapse !important;
    margin: 0 !important;
}

#timetable-table th,
#timetable-table td {
    padding: 1px !important;
    vertical-align: middle !important;
    box-sizing: border-box !important;
}

#timetable-tbody td div {
    min-height: 0 !important;
    border-radius: 6px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: relative !important;
    box-sizing: border-box !important;
    transition: all 0.15s ease !important;
}

/* 隐藏单元格内的常驻铅笔图标，仅在 hover 时轻柔浮现 */
#timetable-tbody td div i.fa-pen,
#timetable-tbody td i.fa-pen,
#timetable-tbody td div i.fa-pencil {
    display: none !important;
}

#timetable-tbody td div:hover i.fa-pen,
#timetable-tbody td div:hover i.fa-pencil {
    display: inline-block !important;
    position: absolute !important;
    right: 4px !important;
    top: 4px !important;
    opacity: 0.4 !important;
}

.bg-card-theme {
    background-color: var(--bg-card) !important;
}

.border-theme-box {
    border-color: var(--border-color) !important;
}

.text-main-color {
    color: var(--text-main) !important;
}

.text-muted-color {
    color: var(--text-muted) !important;
}

/* 强制主展示容器采用纯物理 Block 容器锁定置顶，杜绝任何 Flex 纵向剩余空间分配与下沉 */
#content-container {
    display: block !important;
    height: 100% !important;
    max-height: 100% !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    overflow-anchor: none !important;
    padding: 10px 14px !important;
    margin: 0 !important;
    box-sizing: border-box !important;
}

/* 强制所有非当前视图与带有 hidden 的元素绝对隐藏脱离文档流，消除任何空白占位 */
.hidden,
[hidden],
.view-section.hidden,
section.hidden {
    display: none !important;
    position: absolute !important;
    width: 0 !important;
    height: 0 !important;
    min-height: 0 !important;
    max-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    overflow: hidden !important;
    pointer-events: none !important;
    visibility: hidden !important;
}

/* 学生档案及所有卡片级业务视图版面绝对物理置顶，消除 relative / margin-bottom 带来的位移 */
#view-students,
.view-section:not(.hidden) {
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    position: static !important;
    top: auto !important;
    bottom: auto !important;
    transform: none !important;
    overflow-anchor: none !important;
}

#view-students>div:first-child {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    position: static !important;
    transform: none !important;
}

/* 课表与总览大屏在激活时充满容器高度 */
#view-timetable:not(.hidden),
#view-dashboard:not(.hidden) {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
}

/* 侧边导航栏交互与当前选中项高亮效果 */
.nav-item {
    position: relative;
    transition: background-color 0.1s ease, color 0.1s ease, transform 0.1s ease, box-shadow 0.1s ease;
    will-change: transform, background-color;
}

.nav-item:not(.nav-item-active):hover {
    background-color: rgba(255, 255, 255, 0.12) !important;
    transform: translateX(3px);
}

.nav-item-active {
    background-color: #ffffff !important;
    color: #0f172a !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.22), 0 1px 4px rgba(0, 0, 0, 0.1) !important;
    transform: translateX(4px) !important;
    font-weight: 700 !important;
}

.nav-item-active i {
    color: var(--theme-primary, #475569) !important;
    font-weight: 900 !important;
    transform: scale(1.15);
}

.nav-item-active .nav-title {
    color: #0f172a !important;
    font-weight: 800 !important;
}

.nav-item-active .nav-meta-badge {
    display: inline-flex !important;
    align-items: center;
    font-weight: 700 !important;
    color: #334155 !important;
}

/* 激活状态下各模块徽标适配白底背景的精致配色 */
.nav-item-active .nav-meta-badge.bg-white\/20,
.nav-item-active .nav-meta-badge[class*="bg-white"] {
    background-color: #f1f5f9 !important;
    color: #334155 !important;
    border: 1px solid #cbd5e1 !important;
}

.nav-item-active .nav-meta-badge.bg-indigo-400\/30,
.nav-item-active .nav-meta-badge[class*="bg-indigo"] {
    background-color: #e0e7ff !important;
    color: #4338ca !important;
}

.nav-item-active .nav-meta-badge.bg-emerald-400\/30,
.nav-item-active .nav-meta-badge[class*="bg-emerald"] {
    background-color: #d1fae5 !important;
    color: #047857 !important;
}

.nav-item-active .nav-meta-badge.bg-amber-400\/30,
.nav-item-active .nav-meta-badge[class*="bg-amber"] {
    background-color: #fef3c7 !important;
    color: #b45309 !important;
}

.nav-item-active .nav-meta-badge.bg-rose-500\/30,
.nav-item-active .nav-meta-badge[class*="bg-rose"] {
    background-color: #ffe4e6 !important;
    color: #be123c !important;
}

.nav-item-active #badge-calendar-reminder span {
    background-color: #d97706 !important;
}

/* 左侧高亮发光边缘指示条 */
.nav-item-active::before {
    content: '';
    position: absolute;
    left: -10px;
    top: 15%;
    bottom: 15%;
    width: 5px;
    background: #38bdf8;
    border-radius: 0 4px 4px 0;
    box-shadow: 0 0 12px #38bdf8;
}

/* 暗黑模式下的侧栏激活态 */
[data-theme="dark"] .nav-item-active {
    background-color: #1e293b !important;
    color: #f8fafc !important;
    border: 1px solid rgba(255, 255, 255, 0.25) !important;
}

[data-theme="dark"] .nav-item-active .nav-title {
    color: #ffffff !important;
}

[data-theme="dark"] .nav-item-active i {
    color: #38bdf8 !important;
}

[data-theme="dark"] .nav-item-active .nav-meta-badge.bg-white\/20,
[data-theme="dark"] .nav-item-active .nav-meta-badge[class*="bg-white"] {
    background-color: rgba(255, 255, 255, 0.15) !important;
    color: #f1f5f9 !important;
    border-color: transparent !important;
}

[data-theme="dark"] .nav-item-active .nav-meta-badge.bg-indigo-400\/30,
[data-theme="dark"] .nav-item-active .nav-meta-badge[class*="bg-indigo"] {
    background-color: rgba(129, 140, 248, 0.25) !important;
    color: #c7d2fe !important;
}

[data-theme="dark"] .nav-item-active .nav-meta-badge.bg-emerald-400\/30,
[data-theme="dark"] .nav-item-active .nav-meta-badge[class*="bg-emerald"] {
    background-color: rgba(52, 211, 153, 0.25) !important;
    color: #a7f3d0 !important;
}

[data-theme="dark"] .nav-item-active .nav-meta-badge.bg-amber-400\/30,
[data-theme="dark"] .nav-item-active .nav-meta-badge[class*="bg-amber"] {
    background-color: rgba(251, 191, 36, 0.25) !important;
    color: #fde68a !important;
}

[data-theme="dark"] .nav-item-active .nav-meta-badge.bg-rose-500\/30,
[data-theme="dark"] .nav-item-active .nav-meta-badge[class*="bg-rose"] {
    background-color: rgba(244, 63, 94, 0.25) !important;
    color: #fecdd3 !important;
}

[data-theme="dark"] .nav-item-active #badge-calendar-reminder span {
    background-color: #fbbf24 !important;
}

/* 主色调绑定 CSS 变量 */
.btn-primary,
.bg-theme-700 {
    background-color: var(--theme-primary) !important;
    color: #ffffff !important;
}

.btn-primary:hover,
.hover\:bg-theme-800:hover,
.bg-theme-700:hover {
    background-color: var(--theme-hover) !important;
}

.theme-gradient-sidebar {
    background: linear-gradient(180deg, var(--theme-primary) 0%, var(--theme-hover) 100%) !important;
}

.theme-gradient-header {
    background: linear-gradient(90deg, var(--theme-primary) 0%, var(--theme-hover) 50%, var(--theme-primary) 100%) !important;
}

.text-theme-600 {
    color: var(--theme-primary) !important;
}

.text-theme-700 {
    color: var(--theme-primary) !important;
}

.text-theme-800 {
    color: var(--theme-hover) !important;
}

.bg-theme-50 {
    background-color: var(--theme-light) !important;
}

/* 学科与作息活动徽章色彩系统 (支持小学、初中全学科与大课间、眼操) */
.sub-chinese {
    background-color: #fef2f2;
    color: #991b1b;
    border-color: #fecaca;
}

.sub-math {
    background-color: #eff6ff;
    color: #1e40af;
    border-color: #bfdbfe;
}

.sub-english {
    background-color: #ecfdf5;
    color: #065f46;
    border-color: #a7f3d0;
}

.sub-physics {
    background-color: #fffbeb;
    color: #92400e;
    border-color: #fde68a;
}

.sub-chemistry {
    background-color: #f0fdfa;
    color: #0f766e;
    border-color: #99f6e4;
}

.sub-biology {
    background-color: #f7fee7;
    color: #3f6212;
    border-color: #d9f99d;
}

.sub-science {
    background-color: #f0fdfa;
    color: #0f766e;
    border-color: #99f6e4;
}

.sub-history {
    background-color: #f8fafc;
    color: #334155;
    border-color: #cbd5e1;
}

.sub-politics {
    background-color: #faf5ff;
    color: #6b21a8;
    border-color: #e9d5ff;
}

.sub-pe {
    background-color: #ecfdf5;
    color: #047857;
    border-color: #a7f3d0;
}

.sub-music {
    background-color: #fff7ed;
    color: #9a3412;
    border-color: #fed7aa;
}

.sub-art {
    background-color: #fdf4ff;
    color: #86198f;
    border-color: #f5d0fe;
}

.sub-info {
    background-color: #fff1f2;
    color: #9f1239;
    border-color: #fecdd3;
}

.sub-class {
    background-color: #fdf2f8;
    color: #9d174d;
    border-color: #fbcfe8;
}

.sub-self {
    background-color: #f8fafc;
    color: #475569;
    border-color: #e2e8f0;
}

.sub-sun {
    background-color: #fefce8;
    color: #854d0e;
    border-color: #fef08a;
}

.sub-activity {
    background-color: #f0fdf4;
    color: #166534;
    border-color: #bbf7d0;
}

.sub-eye {
    background-color: #f0fdf4;
    color: #15803d;
    border-color: #86efac;
}

.sub-labor {
    background-color: #fffbeb;
    color: #b45309;
    border-color: #fde68a;
}

/* 暗黑模式下学科与活动徽章 */
[data-theme="dark"] .sub-chinese {
    background-color: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border-color: rgba(239, 68, 68, 0.3);
}

[data-theme="dark"] .sub-math {
    background-color: rgba(59, 130, 246, 0.15);
    color: #93c5fd;
    border-color: rgba(59, 130, 246, 0.3);
}

[data-theme="dark"] .sub-english {
    background-color: rgba(16, 185, 129, 0.15);
    color: #6ee7b7;
    border-color: rgba(16, 185, 129, 0.3);
}

[data-theme="dark"] .sub-science {
    background-color: rgba(20, 184, 166, 0.15);
    color: #5eead4;
    border-color: rgba(20, 184, 166, 0.3);
}

[data-theme="dark"] .sub-pe {
    background-color: rgba(16, 185, 129, 0.15);
    color: #6ee7b7;
    border-color: rgba(16, 185, 129, 0.3);
}

[data-theme="dark"] .sub-music {
    background-color: rgba(249, 115, 22, 0.15);
    color: #fdba74;
    border-color: rgba(249, 115, 22, 0.3);
}

[data-theme="dark"] .sub-art {
    background-color: rgba(217, 70, 239, 0.15);
    color: #f0abfc;
    border-color: rgba(217, 70, 239, 0.3);
}

[data-theme="dark"] .sub-eye,
[data-theme="dark"] .sub-activity {
    background-color: rgba(16, 185, 129, 0.15);
    color: #86efac;
    border-color: rgba(16, 185, 129, 0.3);
}

[data-theme="dark"] .sub-sun {
    background-color: rgba(234, 179, 8, 0.15);
    color: #fde047;
    border-color: rgba(234, 179, 8, 0.3);
}

[data-theme="dark"] .sub-self {
    background-color: #1e293b;
    color: #94a3b8;
    border-color: #334155;
}

[data-theme="dark"] .bg-white {
    background-color: #1e293b !important;
}

[data-theme="dark"] .border-slate-100,
[data-theme="dark"] .border-slate-200,
[data-theme="dark"] .border-slate-200\/80 {
    border-color: #334155 !important;
}

[data-theme="dark"] .bg-slate-50,
[data-theme="dark"] .bg-slate-50\/80,
[data-theme="dark"] .bg-slate-50\/70,
[data-theme="dark"] .bg-slate-50\/40 {
    background-color: #0f172a !important;
}

[data-theme="dark"] .text-slate-800,
[data-theme="dark"] .text-slate-700,
[data-theme="dark"] .text-slate-900 {
    color: #f1f5f9 !important;
}

[data-theme="dark"] .text-slate-600,
[data-theme="dark"] .text-slate-500 {
    color: #cbd5e1 !important;
}

[data-theme="dark"] .text-slate-400 {
    color: #94a3b8 !important;
}

[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
    background-color: #0f172a !important;
    color: #f1f5f9 !important;
    border-color: #334155 !important;
}

/* 极简现代细微滚动条 */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.45);
    border-radius: 9999px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(100, 116, 139, 0.75);
}

[data-theme="dark"] .custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(100, 116, 139, 0.5);
}

[data-theme="dark"] .custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.8);
}

/* 自定义无填充科目卡片 (任课教师单科高亮或无填充模式) */
.sub-no-fill {
    background-color: #ffffff !important;
    color: #475569 !important;
    border-color: #e2e8f0 !important;
}

[data-theme="dark"] .sub-no-fill {
    background-color: #1e293b !important;
    color: #94a3b8 !important;
    border-color: #334155 !important;
}

/* 打印专用元素在常规屏幕下彻底隐藏 */
.calendar-print-only {
    display: none !important;
}

/* ============================================================ */
/* 课表与工作日历 A4 横版单页精准打印规范 (自动缩放至一页，不打印任何弹窗) */
/* ============================================================ */
@page {
    size: A4 landscape;
    margin: 5mm 8mm 5mm 8mm;
}

@media print {

    /* 1. 强制打印全部背景色与文字颜色 (各科目配色完美显色) */
    *,
    *::before,
    *::after {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        accent-color: exact !important;
        box-sizing: border-box !important;
    }

    /* 2. 绝对隐藏所有非打印元素、侧边栏、顶部栏、Toast与全部弹窗对话框 */
    .no-print,
    #modal-timetable-settings,
    #modal-periods,
    #modal-school-schedule,
    #timetable-settings-wrapper,
    #btn-timetable-settings,
    [id^="modal-"],
    aside,
    header,
    #toast-container,
    .modal-enter {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }

    /* 3. 根容器解绑与单页强制适配 (保证刚好一页，不分页、不溢出) */
    html,
    body {
        width: 100% !important;
        height: 100% !important;
        max-height: 100% !important;
        overflow: hidden !important;
        margin: 0 !important;
        padding: 0 !important;
        background: #ffffff !important;
        color: #0f172a !important;
    }

    body>div.h-screen,
    body>div,
    main {
        width: 100% !important;
        height: 100% !important;
        max-height: 100% !important;
        overflow: hidden !important;
        margin: 0 !important;
        padding: 0 !important;
        display: block !important;
        position: static !important;
        background: transparent !important;
    }

    /* 打印视图隔离：课表打印 vs 工作日历A4横幅打印 vs 座位表A4横幅打印 */
    body:not(.print-calendar-active):not(.print-seating-active) .view-section:not(#view-timetable) {
        display: none !important;
    }

    body.print-calendar-active .view-section:not(#view-calendar) {
        display: none !important;
    }

    body.print-seating-active .view-section:not(#view-seating) {
        display: none !important;
    }

    /* 座位表横版 A4 高清张贴打印样式规范 */
    body.print-seating-active {
        background: #ffffff !important;
    }

    body.print-seating-active #view-seating {
        display: block !important;
        width: 100% !important;
        height: auto !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: visible !important;
    }

    body.print-seating-active .seating-no-print {
        display: none !important;
    }

    body.print-seating-active .seating-print-header {
        display: flex !important;
    }

    body.print-seating-active #seating-wrapper {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 auto !important;
        padding: 0 !important;
    }

    body.print-seating-active .seat-card {
        border: 1.5px solid #475569 !important;
        background: #ffffff !important;
        box-shadow: none !important;
        page-break-inside: avoid !important;
        break-inside: avoid !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    body.print-seating-active .seat-card button {
        display: none !important;
    }

    body.print-seating-active .chalkboard-indicator {
        background: #1e293b !important;
        color: #ffffff !important;
        border-radius: 4px !important;
        margin-bottom: 6px !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    body.print-calendar-active #view-calendar {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        height: 100% !important;
        max-height: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: hidden !important;
        page-break-inside: avoid !important;
        page-break-after: avoid !important;
        break-inside: avoid !important;
    }

    body.print-calendar-active .calendar-no-print {
        display: none !important;
    }

    body.print-calendar-active .calendar-print-only {
        display: block !important;
    }

    body.print-calendar-active #calendar-main-canvas {
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
        margin: 0 !important;
        height: 100% !important;
    }

    body.print-calendar-active .calendar-day-col {
        border: 1.5px solid #334155 !important;
        background: #ffffff !important;
        page-break-inside: avoid !important;
    }

    body.print-calendar-active .calendar-day-col * {
        box-shadow: none !important;
    }

    #view-timetable {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        height: 100% !important;
        max-height: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: hidden !important;
        page-break-inside: avoid !important;
        page-break-after: avoid !important;
        break-inside: avoid !important;
    }

    #view-timetable>div {
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
        margin: 0 !important;
        height: 100% !important;
        max-height: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: space-between !important;
    }

    /* 4. 打印专用抬头 (优雅展示班级与学期) */
    .timetable-print-header {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        padding-bottom: 3px !important;
        margin-bottom: 3px !important;
        border-bottom: 1.5px solid #334155 !important;
        flex-shrink: 0 !important;
    }

    /* 5. 课程表格容器自适应填满剩余高度 */
    #timetable-table-container {
        flex: 1 1 0% !important;
        min-height: 0 !important;
        overflow-y: auto !important;
        overflow-x: auto !important;
        display: flex !important;
        flex-direction: column !important;
    }

    #timetable-table {
        width: 100% !important;
        height: 100% !important;
        table-layout: fixed !important;
        border-collapse: collapse !important;
        border: 1.5px solid #475569 !important;
    }

    #timetable-table th,
    #timetable-table td {
        border: 1px solid #cbd5e1 !important;
        padding: 1px 2px !important;
        text-align: center !important;
        vertical-align: middle !important;
    }

    #timetable-table thead tr {
        height: 24px !important;
        background-color: #f1f5f9 !important;
    }

    #timetable-table thead th {
        font-size: 11px !important;
        font-weight: 800 !important;
        color: #0f172a !important;
        padding: 2px 1px !important;
    }

    #timetable-tbody tr {
        height: auto !important;
    }

    /* 单元格卡片精简尺寸，保证填满不撑大，严格单页自适应 */
    #timetable-tbody td button,
    #timetable-tbody td div {
        box-shadow: none !important;
        min-height: 0 !important;
        height: 100% !important;
    }

    #timetable-tbody td .font-bold {
        font-size: 11.5px !important;
        line-height: 1.15 !important;
    }

    #timetable-tbody td div.font-mono {
        font-size: 9px !important;
        line-height: 1 !important;
    }

    /* 6. 底部排课统计看板紧凑贴底 */
    #timetable-hours-statistics {
        flex-shrink: 0 !important;
        margin-top: 2px !important;
        padding-top: 2px !important;
        border-top: 1px solid #94a3b8 !important;
        font-size: 9.5px !important;
        line-height: 1.15 !important;
    }
}

/* ============================================================ */
/* 调座位模块：流动指示箭头放大、红色实体填充与一闪一闪动态提示 */
/* ============================================================ */
@keyframes seating-arrow-flash {
    0%, 100% {
        opacity: 1;
        transform: scale(1.15);
        box-shadow: 0 0 12px rgba(220, 38, 38, 0.9), 0 2px 4px rgba(0, 0, 0, 0.25);
        background-color: #dc2626;
    }
    50% {
        opacity: 0.32;
        transform: scale(0.9);
        box-shadow: 0 0 2px rgba(220, 38, 38, 0.2);
        background-color: #ef4444;
    }
}

.seating-indicator-flash {
    animation: seating-arrow-flash 0.85s ease-in-out infinite !important;
}