﻿/* ==================== 全局样式 ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #4A90D9;
    --primary-dark: #357ABD;
    --primary-light: #E8F4FD;
    --success-color: #52C41A;
    --warning-color: #FAAD14;
    --danger-color: #F5222D;
    --text-primary: #262626;
    --text-secondary: #595959;
    --text-tertiary: #8C8C8C;
    --border-color: #E8E8E8;
    --bg-page: #F5F7FA;
    --bg-card: #FFFFFF;
    --shadow-sm: 0 1px 4px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.15);
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg-page);
    line-height: 1.5;
}

a {
    color: var(--primary-color);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ==================== 通用按钮 ==================== */
.btn-primary, .btn-default, .btn-danger, .btn-small {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary-color);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-default {
    background: #fff;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-default:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-danger {
    background: var(--danger-color);
    color: #fff;
}

.btn-danger:hover {
    background: #CF1322;
}

.btn-small {
    padding: 4px 10px;
    font-size: 12px;
}

.btn-block {
    width: 100%;
}

.btn-icon {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    background: #fff;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

.btn-icon:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-text {
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    background: #fff;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.btn-text:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

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

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
    transition: border-color 0.2s;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(74,144,217,0.1);
}

.form-row {
    display: flex;
    gap: 16px;
}

.form-row .form-group {
    flex: 1;
}

.form-error {
    display: none;
    padding: 8px 12px;
    background: #FFF2F0;
    border: 1px solid #FFCCC7;
    color: var(--danger-color);
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin-bottom: 16px;
}

.select-small {
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 13px;
    background: #fff;
    cursor: pointer;
}

.select-full, .input-full {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin-bottom: 8px;
}

/* ==================== 登录页面 ==================== */
.login-body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-container {
    display: flex;
    width: 100%;
    max-width: 900px;
    min-height: 520px;
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.login-left {
    flex: 1;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 48px 40px;
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.brand-icon {
    font-size: 48px;
    margin-right: 16px;
}

.login-brand {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
}

.login-left h1 {
    font-size: 28px;
    margin-bottom: 0;
}

.login-left p {
    opacity: 0.85;
    margin-bottom: 40px;
    margin-top: 8px;
}

.login-features {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.login-copyright {
    margin-top: 40px;
    font-size: 12px;
    opacity: 0.7;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
}

.feature-icon {
    font-size: 20px;
}

.login-right {
    flex: 1;
    padding: 48px 40px;
    display: flex;
    align-items: center;
}

.login-form-box {
    width: 100%;
}

.login-form-box h2 {
    font-size: 24px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.login-subtitle {
    color: var(--text-tertiary);
    margin-bottom: 32px;
}

.login-tip {
    margin-top: 24px;
    padding: 12px;
    background: var(--primary-light);
    border-radius: var(--radius-sm);
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.8;
}

.login-tip strong {
    color: var(--primary-dark);
}

/* ==================== 顶部导航栏 ==================== */
.top-header {
    height: 56px;
    background: #fff;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.header-left .logo {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary-color);
}

.header-center {
    display: flex;
    align-items: center;
    gap: 24px;
}

.date-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.current-date {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
    min-width: 200px;
    text-align: center;
}

.view-switch {
    display: flex;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.view-btn {
    padding: 6px 16px;
    border: none;
    background: #fff;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.view-btn.active {
    background: var(--primary-color);
    color: #fff;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-info {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 6px 12px;
    padding-bottom: 16px;
    border-radius: var(--radius-sm);
    transition: background 0.2s;
}

.user-info:hover {
    background: var(--bg-page);
}

.user-avatar {
    font-size: 18px;
}

.user-name {
    font-size: 14px;
    color: var(--text-primary);
}

.user-dropdown {
    display: none;
    position: absolute;
    top: calc(100% - 8px);
    right: 0;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    min-width: 140px;
    z-index: 99999;
    overflow: hidden;
}

.user-info:hover .user-dropdown {
    display: block;
}

.user-dropdown a {
    display: block;
    padding: 10px 16px;
    color: var(--text-secondary);
    font-size: 13px;
    transition: all 0.2s;
}

.user-dropdown a:hover {
    background: var(--bg-page);
    color: var(--primary-color);
    text-decoration: none;
}

/* ==================== 主体布局 ==================== */
.main-container {
    display: flex;
    height: calc(100vh - 56px);
    overflow: hidden;
}

/* ==================== 左侧课程池 ==================== */
.sidebar {
    width: 280px;
    background: #fff;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar-header {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.mobile-only {
    display: none !important;
}
.sidebar-header h3 {
    font-size: 16px;
    color: var(--text-primary);
    margin: 0;
}

.sidebar-filter {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
}

.course-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.course-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--primary-color);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    margin-bottom: 8px;
    cursor: grab;
    transition: all 0.2s;
    user-select: none;
    position: relative;
}

.course-card-avatar {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.course-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.course-card:active {
    cursor: grabbing;
}

.course-card.dragging {
    opacity: 0.5;
    transform: rotate(2deg);
}

.course-card .course-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.course-card .course-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-tertiary);
}

.course-card .course-grade {
    background: var(--primary-light);
    color: var(--primary-dark);
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 11px;
}

.sidebar-tip {
    padding: 12px 16px;
    border-top: 1px solid var(--border-color);
    font-size: 12px;
    color: var(--text-tertiary);
    background: var(--bg-page);
}

/* ==================== 右侧课表区域 ==================== */
.schedule-area {
    flex: 1;
    overflow: auto;
    padding: 16px;
}

.schedule-grid-wrapper {
    background: #fff;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

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

.schedule-grid thead th {
    background: var(--bg-page);
    padding: 12px 8px;
    text-align: center;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
}

.schedule-grid thead th.today {
    background: var(--primary-light);
    color: var(--primary-dark);
}

.schedule-grid thead th.weekend {
    background: #FFF7E6;
}

.schedule-grid thead th:first-child {
    width: 100px;
    background: var(--bg-page);
}

.schedule-grid thead th .date-num {
    font-size: 18px;
    font-weight: 600;
    display: block;
}

.schedule-grid thead th .week-day {
    font-size: 12px;
    color: var(--text-tertiary);
}

.schedule-grid tbody td {
    border: 1px solid var(--border-color);
    padding: 0;
    height: 90px;
    vertical-align: top;
    position: relative;
    transition: background 0.2s;
}

.schedule-grid tbody td.time-cell {
    background: var(--bg-page);
    padding: 8px;
    text-align: center;
    width: 100px;
    vertical-align: middle;
}

.schedule-grid tbody td.time-cell .slot-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    display: block;
}

.schedule-grid tbody td.time-cell .slot-time {
    font-size: 11px;
    color: var(--text-tertiary);
    display: block;
    margin-top: 2px;
}

.schedule-grid tbody td.drop-target {
    background: var(--primary-light);
    position: relative;
    height: 70px;
    overflow: hidden;
}

.schedule-grid tbody td.drop-target-hover {
    background: #D6E9FF;
    box-shadow: inset 0 0 0 2px var(--primary-color);
}

/* 课表中的课程块 */
.schedule-item {
    margin: 4px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    cursor: grab;
    transition: all 0.2s;
    position: relative;
    min-height: 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.schedule-item:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-md);
    z-index: 10;
}

.schedule-item:active {
    cursor: grabbing;
}

.schedule-item.dragging {
    opacity: 0.4;
}

.schedule-item .item-name {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 4px;
    line-height: 1.3;
}

.schedule-item .item-meta {
    font-size: 11px;
    color: rgba(255,255,255,0.85);
    line-height: 1.4;
}

.schedule-item .item-teacher {
    display: block;
}

.teacher-mini-avatar {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    vertical-align: middle;
    margin-right: 3px;
    object-fit: cover;
}

.schedule-item .item-classroom {
    display: block;
}

.schedule-item .item-students {
    font-size: 11px;
    color: rgba(255,255,255,0.9);
    line-height: 1.4;
    margin-top: 2px;
    padding-top: 2px;
    border-top: 1px solid rgba(255,255,255,0.2);
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: default;
}

.schedule-item .item-students-empty {
    color: rgba(255,255,255,0.5);
    font-style: italic;
}

.schedule-item .item-students-count {
    opacity: 1;
    font-weight: 500;
    margin-left: auto;
    flex-shrink: 0;
}

.schedule-item .item-students-names {
    font-size: 11px;
    margin-top: 2px;
    opacity: 0.9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* 详情弹窗tab */
.detail-tab-content {
    display: none;
}

.detail-tab-content.active {
    display: block;
}

/* 分页按钮禁用状态 */
#studentPrevPage:disabled,
#studentNextPage:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 搜索框清空按钮 */
.search-wrap {
    position: relative;
    margin-bottom: 8px;
}

.search-wrap .input-full {
    padding-right: 28px;
    margin-bottom: 0;
}

.search-clear {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    border-radius: 50%;
    background: #ccc;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    display: none;
    user-select: none;
    transition: background 0.2s;
    padding: 0;
}

.search-clear:hover {
    background: #999;
}

.search-clear.visible {
    display: block;
}

/* ==================== 弹窗 ==================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.45);
    z-index: 99999;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: #fff;
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 560px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.2s ease;
}

.modal-content.modal-small {
    max-width: 420px;
}

.modal-content.modal-large {
    max-width: 700px;
    width: 90%;
}

@keyframes modalIn {
    from { opacity: 0; transform: translateY(-20px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: 16px;
    color: var(--text-primary);
}

.modal-close {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    font-size: 20px;
    color: var(--text-tertiary);
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--bg-page);
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* ==================== 详情弹窗内容 ==================== */
.detail-row {
    display: flex;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
    align-items: center;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    width: 80px;
    color: var(--text-tertiary);
    font-size: 13px;
    flex-shrink: 0;
}

.detail-value {
    flex: 1;
    color: var(--text-primary);
    font-size: 14px;
}

.detail-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 12px;
    margin-right: 6px;
}

/* ==================== 配置弹窗 Tabs ==================== */
.tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.tab-btn {
    padding: 10px 20px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-secondary);
    transition: all 0.2s;
    margin-bottom: 0;
    line-height: 20px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    position: relative;
}

.tab-btn::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: transparent;
    transition: background 0.2s;
}

.tab-btn.active {
    color: var(--primary-color);
    font-weight: 500;
}

.tab-btn.active::after {
    background: var(--primary-color);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.tab-toolbar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    align-items: center;
    flex-wrap: wrap;
}

.tab-toolbar input {
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 13px;
}

.tab-toolbar input:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* ==================== 数据表格 ==================== */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-table th {
    background: var(--bg-page);
    padding: 10px 12px;
    text-align: left;
    font-weight: 500;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}

.data-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #f0f0f0;
    color: var(--text-primary);
}

.data-table tr:hover td {
    background: var(--bg-page);
}

.data-table .action-btn {
    padding: 3px 8px;
    font-size: 12px;
    margin-right: 6px;
    cursor: pointer;
    border: 1px solid var(--border-color);
    background: #fff;
    border-radius: 3px;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.data-table .action-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.data-table .action-btn.delete:hover {
    border-color: var(--danger-color);
    color: var(--danger-color);
}

.color-dot {
    display: inline-block;
    width: 16px;
    height: 16px;
    border-radius: 3px;
    vertical-align: middle;
}

/* ==================== Toast 提示 ==================== */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translateX(-50%) translateY(-50%);
    padding: 16px 32px;
    background: rgba(0,0,0,0.8);
    color: #fff;
    border-radius: var(--radius-md);
    font-size: 14px;
    z-index: 99999;
    opacity: 0;
    transition: all 0.3s;
    pointer-events: none;
    max-width: 400px;
    text-align: center;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast.success {
    background: var(--success-color);
}

.toast.error {
    background: var(--danger-color);
}

.toast.warning {
    background: var(--warning-color);
}

/* ==================== 滚动条 ==================== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

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

::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* ==================== 响应式 ==================== */
@media (max-width: 768px) {
    .desktop-only { display: none !important; }
    .mobile-only { display: flex !important; }
    .login-container {
        flex-direction: column;
    }
    .login-left {
        padding: 32px 24px;
    }
    .login-right {
        padding: 32px 24px;
    }
    .sidebar {
        width: 220px;
    }
    .header-center {
        gap: 12px;
    }
    .current-date {
        min-width: 140px;
        font-size: 13px;
    }
    .modal .form-group{
        display: flex !important;
        flex-direction: row !important;
        gap: 6px !important;
        align-items: center !important;
        margin-bottom: 8px !important;
    }
    .modal .form-group label{
        width: 70px !important;
        flex-shrink: 0 !important;
        font-size: 12px !important;
        margin: 0 !important;
    }
    .modal .form-group input, .modal .form-group select{
        flex: 1 !important;
        height: 28px !important;
        font-size: 12px !important;
    }
    .toast img{
        width: 16px !important;
        height: 16px !important;
    }
}

/* ==================== 打印样式 ==================== */
@media print {
    /* 页面设置 */
    @page {
        size: A4 landscape;
        margin: 10mm;
    }

    body {
        background: #fff !important;
        font-size: 12px;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* 隐藏不需要打印的元素 */
    .top-header,
    .sidebar,
    .modal,
    .toast,
    #printBtn,
    .user-info,
    .btn-icon,
    .btn-text,
    .view-switch,
    .select-small {
        display: none !important;
    }

    /* 主体区域全屏 */
    .main-container {
        display: block !important;
        height: auto !important;
        overflow: visible !important;
    }

    .schedule-area {
        padding: 0 !important;
        overflow: visible !important;
    }

    .schedule-grid-wrapper {
        box-shadow: none !important;
        border: none !important;
        min-width: auto !important;
        overflow: visible !important;
    }

    /* 打印标题 */
    .print-title {
        display: block !important;
        text-align: center;
        font-size: 18px;
        font-weight: 600;
        margin-bottom: 10px;
        color: #333;
    }

    .print-subtitle {
        display: block !important;
        text-align: center;
        font-size: 13px;
        color: #666;
        margin-bottom: 15px;
    }

    /* 课表样式优化 */
    .schedule-grid {
        width: 100% !important;
        border-collapse: collapse !important;
        border: 2px solid #333 !important;
    }

    .schedule-grid thead th {
        background: #f5f5f5 !important;
        color: #333 !important;
        padding: 8px 4px !important;
        font-size: 12px;
        border: 1.5px solid #333 !important;
    }

    .schedule-grid thead th .date-num {
        font-size: 14px !important;
    }

    .schedule-grid thead th .week-day {
        font-size: 11px !important;
    }

    .schedule-grid tbody td {
        border: 1.5px solid #333 !important;
        height: 60px !important;
        padding: 2px !important;
    }

    .schedule-grid tbody td.time-cell {
        background: #f5f5f5 !important;
        padding: 6px !important;
        width: 80px !important;
    }

    .schedule-grid tbody td.time-cell .slot-name {
        font-size: 12px !important;
    }

    .schedule-grid tbody td.time-cell .slot-time {
        font-size: 10px !important;
    }

    /* 课程块打印样式 */
    .schedule-item {
        margin: 2px !important;
        padding: 4px 6px !important;
        min-height: 50px !important;
        border-radius: 3px !important;
        cursor: default !important;
        box-shadow: none !important;
        transform: none !important;
    }

    .schedule-item:hover {
        transform: none !important;
        box-shadow: none !important;
    }

    .schedule-item .item-name {
        font-size: 11px !important;
        margin-bottom: 2px !important;
    }

    .schedule-item .item-meta {
        font-size: 10px !important;
    }

    /* 隐藏拖拽相关的高亮效果 */
    .drop-target-hover,
    .drop-target {
        background: #fff !important;
        box-shadow: none !important;
    }
}

/* 打印标题（屏幕上不显示，打印时显示） */
.print-title,
.print-subtitle {
    display: none;
}

/* ==================== 老师管理样式 ==================== */
.teacher-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.teacher-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    transition: all 0.2s;
    position: relative;
}

.teacher-card.selected {
    border-color: var(--primary-color);
    background: #f0f7ff;
}

.teacher-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.teacher-card-header {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.teacher-card-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid var(--primary-light);
}

.teacher-avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-page);
    font-size: 24px;
}

.teacher-card-info {
    flex: 1;
    min-width: 0;
}

.teacher-card-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.teacher-card-meta {
    font-size: 12px;
    color: var(--text-tertiary);
    line-height: 1.6;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.teacher-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.teacher-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
    color: #fff;
}

.teacher-tag-gray {
    background: #f0f0f0;
    color: #666;
}

.teacher-status {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: normal;
}

.teacher-status-active {
    background: #f6ffed;
    color: #52c41a;
    border: 1px solid #b7eb8f;
}

.teacher-status-inactive {
    background: #fff1f0;
    color: #ff4d4f;
    border: 1px solid #ffa39e;
}

.teacher-card-bio {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 12px;
    padding: 8px;
    background: var(--bg-page);
    border-radius: var(--radius-sm);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.teacher-card-actions {
    display: flex;
    gap: 8px;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
}

/* 头像上传 */
.avatar-upload {
    width: 100px;
    height: 100px;
    border: 2px dashed var(--border-color);
    border-radius: 50%;
    cursor: pointer;
    overflow: hidden;
    position: relative;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar-upload:hover {
    border-color: var(--primary-color);
    background: var(--primary-light);
}

.avatar-upload img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* 复选框组 */
.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px;
    background: var(--bg-page);
    border-radius: var(--radius-sm);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.2s;
}

.checkbox-label:hover {
    background: #fff;
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* 危险操作按钮 */
.btn-danger {
    background: #ff4d4f;
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.2s;
}

.btn-danger:hover {
    background: #ff7875;
}

.btn-warning {
    background: #faad14;
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.2s;
}

.btn-warning:hover {
    background: #ffc53d;
}

.btn-success {
    background: #52c41a;
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.2s;
}

.btn-success:hover {
    background: #73d13d;
}

/* 课程卡片上的学生管理按钮 */
.course-student-btn {
    margin-top: 8px;
    width: 100%;
    padding: 4px 8px;
    font-size: 12px;
    background: #f0f7ff;
    border: 1px solid #91caff;
    border-radius: 4px;
    color: #1677ff;
    cursor: pointer;
    transition: all 0.2s;
    pointer-events: auto;
}

.course-student-btn:hover {
    background: #1677ff;
    color: #fff;
    border-color: #1677ff;
}

/* ==================== 手机端自适应 ==================== */
@media (max-width: 768px) {
    /* 登录页手机端优化，一屏显示 */
    .login-container {
        min-height: 100vh;
        flex-direction: column;
    }
    .login-left {
        padding: 20px 20px 10px !important;
        flex: 0 0 auto;
    }
    .login-left h1 {
        font-size: 16px !important;
        margin-bottom: 4px !important;
        line-height: 1.2;
    }
    .login-left p {
        font-size: 10px !important;
        line-height: 1.3 !important;
        margin-bottom: 0 !important;
    }
    .login-right {
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
        padding: 10px 20px !important;
    }
    .login-right h2 {
        font-size: 16px !important;
        margin-bottom: 15px !important;
    }
    .form-group {
        margin-bottom: 12px !important;
    }
    .form-group input {
        padding: 10px 12px !important;
        font-size: 14px !important;
    }
    .login-btn {
        padding: 10px !important;
        font-size: 14px !important;
        margin-top: 5px !important;
    }
    .login-footer {
        font-size: 10px !important;
        margin-top: 15px !important;
        text-align: center;
    }

    /* 顶部导航栏 */
    .top-header {
        padding: 0 10px;
        height: 50px;
        flex-wrap: nowrap;
    }
    .header-left {
        display: flex;
        align-items: center;
        gap: 8px;
        flex-shrink: 0;
    }
    .header-left h1 {
        font-size: 14px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .header-center {
        display: none; /* 手机上隐藏日期选择器，放到侧边栏里 */
    }
    .header-right {
        gap: 4px;
        flex-shrink: 0;
    }
    .header-right button,
    .header-right select {
        font-size: 11px;
        padding: 4px 6px;
    }
    .user-info {
        font-size: 10px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 80px;
        padding: 0 4px;
        align-items: center;
        display: flex;
        height: 100%;
    }
    .user-name {
        font-size: 10px;
    }
    .user-avatar {
        font-size: 14px;
    }

    /* 主容器纵向排列 */
    .main-container {
        flex-direction: column;
        height: calc(100vh - 50px);
    }

    /* 侧边栏变成抽屉式 */
    .sidebar {
        width: 100% !important;
        height: 32vh;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        position: relative;
        flex-shrink: 0;
        display: flex;
        flex-direction: column;
    }
    .sidebar-header {
        flex-shrink: 0;
    }
    .sidebar.collapsed {
        height: auto;
    }
    .sidebar.collapsed #poolContent {
        display: none;
    }
    .sidebar-header {
        padding: 10px 15px;
    }
    .sidebar-filter {
        padding: 10px 15px;
    }

    /* 课程卡片网格单列 */
    .course-list {
        grid-template-columns: 1fr !important;
        gap: 8px;
        padding: 10px;
        overflow-y: visible;
    }

    /* 日程区域 */
    .schedule-area {
        flex: 1;
        overflow: auto;
        padding: 5px;
    }
    .schedule-grid-wrapper {
        min-width: auto; /* 手机端自适应宽度，不用横滑 */
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .schedule-grid {
        width: max-content;
        min-width: 100%;
        table-layout: auto;
    }
    .schedule-grid th, .schedule-grid td {
        min-width: 110px;
    }
    /* 手机端去掉左侧固定时间段列，所有列一起横向滑动，避免遮挡弹窗 */
    .schedule-grid thead th:first-child,
    .schedule-grid tbody td.time-cell {
        position: static !important;
        left: auto !important;
        z-index: auto !important;
    }

/* 弹窗打开时隐藏课表，避免遮挡 */
body.modal-open .schedule-grid-wrapper,
body.modal-open .main-content,
body.modal-open header {
    visibility: hidden;
}
body.modal-open .modal {
    visibility: visible;
}

    .modal {
        padding: 0 !important;
        z-index: 999999 !important;
        align-items: flex-start !important;
        justify-content: flex-end !important;
    }
    /* 弹窗全屏 */
    .modal-content {
        width: 250px !important;
        max-width: 75vw !important;
        max-height: 80vh;
        margin: 20px 10px 0 80px !important; /* 右边10px，左边留80px避开时间段栏 */
        border-radius: 12px !important;
        z-index: 999999 !important;
    }
    .modal-body {
        max-height: 60vh;
        overflow-y: auto;
    }

    /* 按钮缩小 */
    .btn {
        padding: 8px 14px;
        font-size: 13px;
    }
    .btn-small {
        padding: 4px 10px;
        font-size: 12px;
    }

    /* 老师管理网格 */
    .teacher-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px;
    }
    .teacher-card {
        padding: 10px;
    }

    .schedule-grid tbody td {
        height: 50px !important;
        padding: 2px !important;
    }
    .schedule-grid thead th {
        padding: 3px 2px !important;
        font-size: 11px;
    }
    .schedule-grid thead th .date-num {
        font-size: 12px;
        line-height: 1.2;
    }
    .schedule-grid thead th .week-day {
        font-size: 10px;
        line-height: 1.2;
    }
    .schedule-item {
        padding: 3px 4px !important;
        margin: 1px !important;
    }
    .schedule-item .item-name {
        font-size: 11px;
        margin-bottom: 1px;
    }
    .schedule-item .item-meta {
        font-size: 10px;
        line-height: 1.4;
        display: block;
    }
    .schedule-item .item-students-count {
        opacity: 1;
        font-size: 10px;
        color: #fff;
        flex-shrink: 0;
    }
    .schedule-item .item-students-names {
        font-size: 10px;
        color: #fff;
        margin-top: 1px;
        opacity: 0.95;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        display: flex !important;
        align-items: center;
        gap: 4px;
    }
    .schedule-item .item-students-names .stu-names-text {
        flex: 1;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        min-width: 0;
    }

    /* 详情tab */
    .detail-tabs {
        flex-wrap: wrap;
    }
    .detail-tab {
        flex: 1;
        text-align: center;
        padding: 8px;
        font-size: 13px;
    }

    /* 手机端配置表格优化 */
    .data-table {
        font-size: 12px;
    }
    .data-table th,
    .data-table td {
        padding: 6px 4px;
        font-size: 12px;
    }
    .data-table input[type="text"] {
        width: 60px !important;
        font-size: 12px;
        padding: 4px;
    }
    .data-table input[type="time"] {
        width: 80px !important;
        font-size: 12px;
        padding: 4px;
    }
    .data-table input[type="number"] {
        width: 50px !important;
        font-size: 12px;
        padding: 4px;
    }
    .data-table input[type="color"] {
        -webkit-appearance: none;
        appearance: none;
        width: 40px !important;
        height: 40px;
        padding: 0;
        border: none;
        border-radius: 8px;
        cursor: pointer;
        background: transparent;
    }
    .color-picker-btn {
        width: 36px;
        height: 36px;
        border-radius: 8px;
        cursor: pointer;
        border: 2px solid #fff;
        box-shadow: 0 1px 3px rgba(0,0,0,0.2);
        position: relative;
    }
    .data-table input[type="color"]::-webkit-color-swatch-wrapper {
        padding: 0;
    }
    .data-table input[type="color"]::-webkit-color-swatch {
        border: 2px solid #fff;
        border-radius: 8px;
        box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    }
    .data-table input[type="color"]::-webkit-color-caret {
        display: none;
    }
    .data-table td:last-child {
        white-space: nowrap;
    }
    .data-table .action-btn {
        display: inline-block;
        margin: 0 2px;
        padding: 4px 8px;
        font-size: 11px;
    }
    .tab-toolbar {
        flex-wrap: wrap;
        gap: 8px;
    }
    .tab-toolbar input {
        font-size: 12px;
        padding: 6px;
    }

    /* 管理页面卡片 */
    .manage-card {
        margin-bottom: 15px;
    }

    /* 用户下拉菜单手机端居中显示 */
    .user-dropdown {
        position: fixed !important;
        top: 30% !important;
        left: 50% !important;
        right: auto !important;
        transform: translate(-50%, -50%) !important;
        width: 350px !important;
        max-width: 90vw !important;
        box-shadow: 0 4px 20px rgba(0,0,0,0.2) !important;
    }
    .user-dropdown a {
        padding: 18px 24px !important;
        font-size: 16px !important;
    }

    /* 搜索框 */
    .sidebar-filter input,
    .sidebar-filter select {
        font-size: 13px;
        padding: 8px;
    }
}












