/* ==================== 全局样式 — 暗色主题 ==================== */
.hidden { display: none !important; }
:root {
    /* ===== 主色调（橙/琥珀色系）===== */
    --primary-color: #ff7a45;
    --primary-hover: #f97316;
    --primary-light: rgba(255, 122, 69, 0.10);
    --primary-bg: rgba(255, 122, 69, 0.07);
    --success-color: #22c55e;
    --success-light: rgba(34, 197, 94, 0.12);
    --danger-color: #ef4444;
    --danger-light: rgba(239, 68, 68, 0.12);
    --warning-color: #f59e0b;
    --warning-light: rgba(245, 158, 11, 0.12);

    /* ===== 背景色系（暗色）===== */
    --bg-color: #0b0d14;
    --bg-secondary: #111321;
    --sidebar-bg: #13141f;
    --card-bg: #1a1b2e;
    --card-hover: #212338;

    /* ===== 文字颜色（浅色）===== */
    --text-primary: #e8ecf4;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-inverse: #1e293b;

    /* ===== 边框 & 阴影（暗色适配）===== */
    --border-color: #252840;
    --border-light: #1e2035;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.2);
    --shadow: 0 2px 8px rgba(0,0,0,0.25);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.35);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.4);
    --shadow-inset: inset 0 1px 3px rgba(0,0,0,0.2);

    /* ===== 圆角与过渡 ===== */
    --radius: 12px;
    --radius-sm: 8px;
    --radius-xs: 6px;
    --transition: all 0.2s ease;
    --sidebar-width: 260px;
    --time-col-width: 60px;

    /* ===== 暗色主题特有 ===== */
    --glass-bg: rgba(26, 27, 46, 0.65);
    --glass-border: rgba(255,255,255,0.05);
    --glow-primary: 0 0 20px rgba(255, 122, 69, 0.15);
    --glow-success: 0 0 20px rgba(34, 197, 94, 0.15);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { height: 100%; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.5;
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* ==================== 左侧边栏（暗色） ==================== */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #13141f 0%, #111321 100%);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow-y: auto;
    flex-shrink: 0;
}

.sidebar-brand {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 17px;
    color: var(--primary-color);
    border-bottom: 1px solid var(--border-color);
}
.sidebar-brand-icon {
    width: 30px; height: 30px;
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--primary-color);
}
.sidebar-brand-icon svg, .sidebar-brand-icon img { width: 24px; height: 24px; }
.sidebar-brand-bg {
    display: inline-block;
    background: white;
    border-radius: 4px;
    line-height: 0;
    vertical-align: middle;
    overflow: hidden;
}

/* 统计卡片区域 */
.sidebar-stats {
    padding: 12px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-stat {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    background: rgba(255,255,255,0.03);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
    transition: var(--transition);
}
.sidebar-stat:hover { background: var(--primary-bg); border-color: rgba(255,122,69,0.2); box-shadow: var(--glow-primary); }
.sidebar-stat.clickable-stat { cursor: pointer; position: relative; }
.sidebar-stat.clickable-stat:hover {
    background: var(--primary-bg); border-color: var(--primary-color); box-shadow: var(--glow-primary);
}
.sidebar-stat-full {
    grid-column: 1 / -1;
}

.sidebar-stat-icon {
    font-size: 18px; width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,122,69,0.12); border-radius: 8px;
    flex-shrink: 0; color: var(--primary-color);
}
.sidebar-stat-icon svg { width: 18px; height: 18px; }

.sidebar-stat-info { flex: 1; min-width: 0; text-align: center; }
.sidebar-stat-value { font-size: 20px; font-weight: 800; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.4); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-stat-label { font-size: 12px; font-weight: 500; color: #a0aec0; margin-top: 2px; white-space: nowrap; }

/* 班级入口卡片 — 与其他卡片统一风格 */
.sidebar-stat.clickable-stat[onclick*="classes"] {
    background: rgba(255,255,255,0.03);
    border-color: var(--border-light);
}
.sidebar-stat.clickable-stat[onclick*="classes"]:hover {
    background: var(--primary-bg); border-color: var(--primary-color); box-shadow: var(--glow-primary);
}
.sidebar-stat[onclick*="classes"] .sidebar-stat-value { color: #fff !important; }
.sidebar-stat[onclick*="classes"] .sidebar-stat-label { color: #a0aec0 !important; }

/* 侧边栏导航 */
.sidebar-nav {
    padding: 10px; display: flex; flex-direction: column; gap: 4px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-nav-btn {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 16px; border-radius: var(--radius-sm);
    background: transparent; border: none; cursor: pointer;
    font-size: 14px; font-weight: 500; color: var(--text-secondary);
    transition: var(--transition); text-align: left;
}
.sidebar-nav-btn:hover { background: var(--primary-light); color: var(--primary-color); }
.sidebar-nav-btn.active { background: var(--primary-color); color: white; font-weight: 600; }
.sidebar-nav-btn .nav-icon {
    width: 20px; height: 20px;
    display: inline-flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.sidebar-nav-btn .nav-icon svg { width: 18px; height: 18px; }
.sidebar-nav-btn.active .nav-icon { color: #fff; }

/* ==================== 主内容区 ==================== */
.main-content {
    flex: 1; display: flex; flex-direction: column;
    height: 100vh;
    overflow-y: auto;
}

/* 周导航栏 */
.week-nav {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 24px; background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color); flex-shrink: 0;
}
.week-nav-left { display: flex; align-items: center; gap: 12px; }
.week-nav-title { font-size: 18px; font-weight: 700; color: var(--text-primary); }
.week-nav-subtitle { font-size: 13px; color: var(--text-muted); margin-left: 8px; }

.week-nav-btn {
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--card-bg); border: 1px solid var(--border-color);
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    font-size: 16px; color: var(--text-secondary); transition: var(--transition);
}
.week-nav-btn:hover { background: var(--primary-light); border-color: var(--primary-color); color: var(--primary-color); }
.week-nav-btn.today-btn { width: auto; min-width: 100px; padding: 0 16px; border-radius: var(--radius-xs); font-size: 13px; font-weight: 600; }
.week-nav-btn.back-week-btn {
    width: auto; padding: 0 14px; border-radius: var(--radius-xs);
    font-size: 13px; font-weight: 600;
    background: var(--primary-color); color: white;
    border-color: var(--primary-color); animation: pulse-btn 2s ease infinite;
}
.week-nav-btn.back-week-btn:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: white; }
@keyframes pulse-btn {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255,122,69,0.3); }
    50% { box-shadow: 0 0 8px 3px rgba(255,122,69,0.2); }
}
.week-nav-right { display: flex; align-items: center; gap: 10px; }
.week-teacher-select {
    padding: 5px 12px; border: 1px solid var(--border-color);
    border-radius: var(--radius-xs); font-size: 13px;
    background: var(--card-bg); color: var(--text-primary); cursor: pointer;
    outline: none; min-width: 180px;
}
.week-teacher-select:focus { border-color: var(--primary-color); box-shadow: 0 0 0 2px rgba(255,122,69,0.15); }
.week-nav-center {
    display: flex; align-items: center; gap: 20px;
    padding: 0 16px;
}
.week-stat {
    font-size: 13px; color: var(--text-secondary); white-space: nowrap;
}
.week-stat b {
    font-size: 17px; font-weight: 700; margin-right: 4px;
}
.week-stat-done b { color: #10b981; }
.week-stat-pending b { color: #f59e0b; }

/* ==================== 周课表时间网格视图 ==================== */
.week-view-container {
    flex: 1; display: flex; flex-direction: column; overflow: hidden;
}

/* 表头：日期行 */
.week-header {
    display: flex; flex: none; background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.time-label-header {
    width: var(--time-col-width); flex-shrink: 0;
    padding: 10px 4px; text-align: center;
    font-size: 11px; font-weight: 700; color: var(--primary-color);
    border-right: 1.5px solid var(--border-color);
    background: linear-gradient(180deg, var(--card-bg) 0%, var(--bg-secondary) 100%);
}

.day-header-cell {
    flex: 1; min-width: 80px; padding: 10px 6px;
    text-align: center; border-right: 1px solid var(--border-color);
    color: var(--text-primary);
}
.day-header-cell:last-child { border-right: none; }

.day-header-cell.today-header {
    background: linear-gradient(135deg, var(--primary-color), #c2410c);
    color: white;
}
.day-header-cell.today-header .dh-month,
.day-header-cell.today-header .dh-dow { color: rgba(255,255,255,0.85) !important; }

.day-header-cell.past-header { background: var(--bg-secondary); }
.day-header-cell.future-header {
    background: linear-gradient(180deg, var(--card-bg) 0%, var(--bg-secondary) 100%);
}

.dh-dow { font-size: 11px; letter-spacing: 0.5px; margin-bottom: 2px; }
.day-header-cell.today-header .dh-dow { font-weight: 700; }
.dh-date { font-size: 20px; font-weight: 800; line-height: 1.1; }
.dh-month { font-size: 10px; opacity: 0.65; margin-top: 1px; }

/* 时间网格主体 */
.week-grid-wrapper {
    flex: 1; overflow: auto; position: relative;
}

.week-grid {
    display: flex; min-width: 100%; position: relative;
}

/* 左侧时间列 */
.time-column {
    width: var(--time-col-width); flex-shrink: 0;
    border-right: 1.5px solid var(--border-color);
    background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--card-bg) 100%);
    z-index: 2; position: sticky; left: 0;
}

.time-slot-label {
    height: 72px; /* 每小时高度 */
    display: flex; align-items: flex-start; justify-content: center;
    padding-top: 3px; font-size: 12px; font-weight: 600; color: var(--text-secondary);
    border-bottom: 1.5px solid var(--border-color); user-select: none;
    position: relative;
}
.time-slot-label::after {
    content: ''; position: absolute;
    left: 50%; bottom: 0; width: calc(100% - 12px); height: 1.5px;
    background: var(--border-color); transform: translateX(-50%);
}

/* 日期列容器 */
.day-grid-column {
    flex: 1; min-width: 80px; position: relative;
    border-right: 1.5px solid var(--border-color);
}
.day-grid-column:last-child { border-right: none; }

/* 时间格子 */
.time-cell {
    height: 72px; border-bottom: 1.5px solid var(--border-color);
    position: relative; cursor: pointer;
    transition: background 0.15s;
}
.time-cell:hover { background: var(--primary-light); }

/* 半小时划分线（每个时间格子的中间位置） */
.time-cell::after {
    content: ''; position: absolute;
    left: 0; right: 0; top: 50%;
    height: 1px; background: var(--border-light);
    pointer-events: none;
}

/* 当前时间指示线 */
.current-time-line {
    position: absolute; left: 0; right: 0;
    height: 2px; background: var(--danger-color);
    z-index: 15; pointer-events: none;
}
.current-time-line::before {
    content: ''; position: absolute;
    left: -5px; top: -4px;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid var(--danger-color);
}

/* 课程块（绝对定位在时间网格中） */
.course-block {
    position: absolute; left: 3px; right: 3px;
    border-radius: 8px; padding: 6px 8px;
    cursor: pointer; z-index: 10;
    border-left: 4px solid var(--primary-color);
    box-shadow: 0 1px 4px rgba(0,0,0,0.3);
    overflow: hidden; transition: transform 0.15s, box-shadow 0.15s, cursor 0.1s;
    min-height: 36px; display: flex; flex-direction: column; justify-content: space-between;
}
.course-block:hover { transform: scale(1.02); box-shadow: 0 4px 14px rgba(0,0,0,0.4); z-index: 20; }

/* 课程卡片主信息区 */
.cb-main-info { flex: 1; min-width: 0; }
.cb-student-name {
    font-size: 15px; font-weight: 700; line-height: 1.25;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cb-time-row {
    font-size: 14px; font-weight: 600; color: var(--text-secondary);
    margin-top: 4px; letter-spacing: 0.3px;
}
.cb-meta-row {
    font-size: 14px; font-weight: 600; color: var(--text-secondary);
    margin-top: 2px;
    display: flex; align-items: center; flex-wrap: nowrap; gap: 5px;
    overflow: hidden; white-space: nowrap;
}
.cb-meta-text {
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    flex: 1 1 auto; min-width: 0;
}
.cb-type-badge {
    background: rgba(255,122,69,0.15); color: var(--primary-color);
    padding: 1px 6px; border-radius: 6px; font-size: 13px;
    flex: 0 0 auto;
}
.cb-class-badge {
    background: rgba(255,122,69,0.15); color: var(--primary-color);
    padding: 1px 6px; border-radius: 6px; font-size: 13px;
    max-width: 90px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    flex: 0 0 auto;
}
.cb-content-text {
    font-size: 13px; color: var(--text-muted);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    margin-top: 2px;
}

.course-block.status-completed {
    border-left-color: var(--success-color); background: rgba(34, 197, 94, 0.12);
}
.course-block.status-cancelled {
    border-left-color: var(--danger-color); background: rgba(239, 68, 68, 0.12); opacity: 0.55;
}
.course-block.status-rescheduled {
    border-left-color: var(--warning-color); background: rgba(245, 158, 11, 0.12);
}
.course-block.status-scheduled,
.course-block.status-planned {
    border-left-color: var(--primary-color); background: rgba(255, 122, 69, 0.12);
}

.cb-time-badge {
    display: inline-block; font-size: 10px; font-weight: 600;
    padding: 1px 5px; border-radius: 8px; margin-top: 2px;
}
.cb-time-badge.completed-badge { background: var(--success-light); color: var(--success-color); }
.cb-time-badge.cancelled-badge { background: var(--danger-light); color: var(--danger-color); }
.cb-time-badge.rescheduled-badge { background: var(--warning-light); color: #d97706; }
.cb-time-badge.planned-badge { background: var(--primary-light); color: var(--primary-color); }

/* ==================== 拖拽排课样式 ==================== */
.course-draggable {
    /* 默认继承 .course-block 的 cursor: pointer（悬停显示手指） */
    user-select: none;
}
/* 按住时变为抓取手势 */
.course-draggable:active,
.course-block.dragging-cursor {
    cursor: grabbing !important;
}

.course-block.dragging {
    opacity: 0.35 !important;
    transform: scale(0.97);
    pointer-events: none; /* 拖拽时禁用原块交互 */
}

.course-block.drag-ghost {
    opacity: 0.9;
    box-shadow: 0 8px 30px rgba(0,0,0,0.25);
    border-radius: 8px;
    transition: none;
    cursor: grabbing;
}

.drop-highlight {
    background: rgba(255, 122, 69, 0.12);
    border: 2px dashed var(--primary-color);
    animation: dropPulse 1s ease infinite alternate;
}
.drop-highlight.drop-copy {
    background: rgba(34, 197, 94, 0.12);
    border-color: var(--success-color);
}
.drop-highlight .drop-label {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    font-size: 11px; font-weight: 700;
    white-space: nowrap;
    color: var(--primary-color); text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    pointer-events: none;
}
.drop-highlight.drop-copy .drop-label {
    color: var(--success-color);
}

@keyframes dropPulse {
    from { background-color: rgba(255, 122, 69, 0.08); }
    to   { background-color: rgba(255, 122, 69, 0.18); }
}
@keyframes dropPulseCopy {
    from { background-color: rgba(34, 197, 94, 0.08); }
    to   { background-color: rgba(34, 197, 94, 0.18); }
}
.drop-highlight.drop-copy {
    animation-name: dropPulseCopy;
}

/* 无课程提示（在每列底部显示） */
.no-course-hint {
    position: absolute; bottom: 40px; left: 50%;
    transform: translateX(-50%); font-size: 11px; color: var(--text-muted);
    opacity: 0.4; pointer-events: none; white-space: nowrap;
}

/* ==================== 页面视图 ==================== */
.page-view {
    display: none;
    padding: 24px; animation: fadeIn 0.25s ease;
}
.page-view.active { display: block; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.page-header {
    display: flex; justify-content: space-between;
    align-items: center; margin-bottom: 24px;
}
.page-title { font-size: 22px; font-weight: 700; color: var(--text-primary); }

/* ==================== 按钮 ==================== */
.btn {
    padding: 10px 20px; border: none; border-radius: var(--radius-xs);
    cursor: pointer; font-size: 14px; font-weight: 500;
    transition: var(--transition); display: inline-flex;
    align-items: center; justify-content: center; gap: 6px;
}
.btn-primary { background: var(--primary-color); color: white; }
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-1px); }
.btn-secondary { background: var(--card-bg); color: var(--text-primary); border: 1px solid var(--border-color); }
.btn-secondary:hover { background: var(--card-hover); }
.btn-success { background: var(--success-color); color: white; }
.btn-danger { background: var(--danger-color); color: white; }
.btn-small { padding: 6px 14px; font-size: 12px; }
.btn-large { padding: 14px 28px; font-size: 16px; }
.btn-edit { padding: 5px 10px; font-size: 12px; background: var(--primary-light); color: var(--primary-color); }
.btn-delete { padding: 5px 10px; font-size: 12px; background: var(--danger-light); color: var(--danger-color); }

/* ==================== 表格 ==================== */
.table-container { background: var(--card-bg); border-radius: var(--radius); overflow: auto; box-shadow: var(--shadow); border: 1px solid var(--border-color); }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td {
    padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}
.data-table th { background: var(--bg-secondary); font-weight: 600; font-size: 12px; color: var(--text-secondary); letter-spacing: 0.3px; }
.data-table tr:hover { background: var(--card-hover); }
.action-btns { display: flex; gap: 6px; }
.action-btns .btn { cursor: pointer; position: relative; z-index: 1; }

/* 班型标签 */
.ct-badge { display: inline-block; padding: 2px 10px; border-radius: 10px; font-size: 12px; font-weight: 500; white-space: nowrap; line-height: 1.4; }
.ct-badge-1v1 { background: var(--success-light); color: var(--success-color); }
.ct-badge-class { background: rgba(59, 130, 246, 0.12); color: #60a5fa; }

/* ==================== 弹窗 ==================== */
.modal {
    display: none; position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(6px);
    z-index: 300; align-items: center; justify-content: center;
}
.modal.show { display: flex; }

/* 预览类弹窗(嵌套在其它弹窗内)需要更高层级 */
.modal-preview { z-index: 400 !important; }

.modal-content {
    background: var(--card-bg); border-radius: var(--radius);
    width: 90%; max-width: 520px; max-height: 85vh;
    overflow-y: auto; box-shadow: 0 25px 50px rgba(0,0,0,0.5);
    border: 1px solid var(--border-color);
    animation: modalSlide 0.3s ease;
}
.modal-lg { max-width: 650px; }
.modal-xl { max-width: 780px; }

@keyframes modalSlide { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.modal-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 18px 22px; border-bottom: 1px solid var(--border-color);
}
.modal-header h3 { font-size: 16px; font-weight: 700; margin: 0; color: var(--text-primary); }

.close-btn {
    background: none; border: none; font-size: 22px; cursor: pointer;
    color: var(--text-muted); width: 30px; height: 30px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%; transition: var(--transition);
}
.close-btn:hover { background: var(--danger-light); color: var(--danger-color); }

/* ==================== 表单 ==================== */
form { padding: 20px; }
.form-group { margin-bottom: 12px; }
.form-group label {
    display: block; font-size: 13px; font-weight: 600;
    color: var(--text-secondary); margin-bottom: 5px;
}
.form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: 9px 12px; border: 1px solid var(--border-color);
    border-radius: var(--radius-xs); font-size: 14px; outline: none;
    transition: var(--transition); font-family: inherit; box-sizing: border-box;
    background: var(--bg-secondary); color: var(--text-primary);
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(255,122,69,0.12);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row-3col { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
/* 三栏行内 textarea 与 input 高度统一（单行高度） */
.form-row-3col textarea,
.form-row-3col input[type="text"],
.form-row-3col input[type="tel"],
.form-row-3col input[type="number"],
.form-row-3col select {
    min-height: 40px;
    max-height: 40px;
    height: 40px !important;
    resize: none;
}
/* 三栏行内嵌套的 flex 容器中的 select/input 不受 68px 限制 */
.form-row-3col .form-group > div select,
.form-row-3col .form-group > div input {
    height: auto !important;
    min-height: auto !important;
    max-height: none !important;
}

/* 预付信息区 */
.prepaid-section {
    margin: 2px 0 4px;
    padding: 10px 14px;
    background: linear-gradient(135deg, rgba(124,58,237,0.1), rgba(124,58,237,0.05));
    border-radius: var(--radius);
    border: 1px solid rgba(124,58,237,0.25);
}
.prepaid-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr) auto;
    gap: 10px;
    align-items: end;
}
.prepaid-card { margin-bottom: 0; }
.prepaid-card input { background: var(--bg-secondary) !important; }

/* 剩余余额显示 */
.prepaid-balance-display {
    grid-column: 4 / -1;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 10px 16px; border-radius: 10px;
    background: var(--bg-secondary); border: 2px dashed rgba(124,58,237,0.4); min-width: 140px;
}
.balance-label { font-size: 11px; color: #a78bfa; font-weight: 500; }
.balance-value { font-size: 22px; color: #a78bfa; font-weight: 700; }
.balance-value.money { color: var(--success-color); }
.balance-divider { color: var(--text-muted); font-size: 14px; margin: 0 4px; }

@media (max-width: 640px) {
    .form-row-3col { grid-template-columns: 1fr; }
    .prepaid-grid { grid-template-columns: 1fr 1fr; }
    .prepaid-balance-display { grid-column: 1 / -1; }
}
.form-actions {
    display: flex; justify-content: flex-end; gap: 10px;
    margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border-color);
}

.quick-buttons { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.quick-btn {
    padding: 4px 12px; background: var(--primary-light); color: var(--primary-color);
    border: none; border-radius: 14px; font-size: 12px; font-weight: 500;
    cursor: pointer; transition: var(--transition);
}
.quick-btn:hover { background: var(--primary-color); color: white; }
.quick-btn.selected { background: var(--primary-color); color: white; }

/* ==================== 搜索和筛选 ==================== */
.search-bar { margin-bottom: 16px; display: flex; gap: 8px; align-items: center; }
.search-bar select {
    padding: 9px 12px; border: 1px solid var(--border-color);
    border-radius: 20px; font-size: 13px; outline: none;
    background: var(--card-bg); color: var(--text-secondary); cursor: pointer;
    transition: var(--transition);
}
.search-bar select:focus { border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(255,122,69,0.12); }
.search-bar input {
    padding: 10px 14px; border: 1px solid var(--border-color);
    border-radius: 20px; font-size: 14px; outline: none;
    flex: 1; max-width: 320px; transition: var(--transition);
    background: var(--card-bg); color: var(--text-primary);
}
.search-bar input:focus { border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(255,122,69,0.12); }

.filter-bar {
    display: flex; gap: 10px; align-items: center; margin-bottom: 16px;
    flex-wrap: wrap; padding: 12px; background: var(--card-bg);
    border-radius: var(--radius-sm); box-shadow: var(--shadow-sm); border: 1px solid var(--border-color);
}
.filter-bar select, .filter-bar input {
    padding: 8px 12px; border: 1px solid var(--border-color);
    border-radius: var(--radius-xs); font-size: 13px; outline: none;
    background: var(--bg-secondary); color: var(--text-primary);
}

/* ==================== 课程收入汇总栏 ==================== */
.courses-income-bar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 16px; margin-bottom: 14px;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1) 0%, rgba(34, 197, 94, 0.05) 100%);
    border: 1px solid rgba(34, 197, 94, 0.25); border-radius: var(--radius-sm);
    transition: all 0.3s ease;
}
.income-bar-left { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.income-bar-icon { font-size: 18px; }
.income-bar-text { font-size: 13px; color: var(--text-secondary); }
.income-bar-stat { font-size: 13px; color: var(--text-primary); }
.income-bar-stat b { color: var(--text-primary); font-weight: 600; }
.income-bar-highlight {
    font-size: 15px; font-weight: 700; color: var(--success-color);
    background: var(--card-bg); padding: 3px 12px; border-radius: 8px;
    box-shadow: 0 1px 3px rgba(34,197,94,0.15);
}
.income-num, .income-mask { display: inline; }
.income-mask { letter-spacing: 2px; font-weight: 700; }
.income-toggle-btn {
    background: none; border: 1px solid rgba(34, 197, 94, 0.25); border-radius: 6px;
    padding: 4px 8px; cursor: pointer; color: var(--success-color);
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s;
}
.income-toggle-btn:hover { background: var(--success-light); border-color: var(--success-color); }

/* ==================== 主页 - 仪表盘 ==================== */
.home-hero {
    display: flex; align-items: center; justify-content: space-between;
    padding: 20px 36px; margin-bottom: 20px;
    background: linear-gradient(135deg, rgba(255,122,69,0.12), rgba(124,58,237,0.08));
    border: 1px solid rgba(255,122,69,0.15);
    border-radius: 14px; backdrop-filter: blur(10px);
    position: relative; overflow: hidden;
}
.home-hero::after {
    content: ''; position: absolute; right: -60px; top: -60px;
    width: 200px; height: 200px; border-radius: 50%;
    background: radial-gradient(circle, rgba(255,122,69,0.15), transparent 70%);
    pointer-events: none;
}
.home-hero-left {
    display: flex; flex-direction: column; gap: 6px;
    z-index: 1; flex: 1; min-width: 0;
}
.home-greeting-row {
    display: flex; align-items: center;
}
.home-greeting {
    font-size: 34px; font-weight: 800; color: var(--text-primary);
    line-height: 1.1; white-space: nowrap; letter-spacing: 10px;
}
.home-date {
    font-size: 13px; color: var(--text-muted); white-space: nowrap;
}
.home-hero-btn {
    padding: 8px 20px; font-size: 13px;
    white-space: nowrap;
}
.home-clock {
    font-size: 52px; font-weight: 900;
    font-family: 'Courier New', 'Consolas', 'Menlo', monospace;
    color: var(--primary-color); letter-spacing: 3px; line-height: 1;
    text-shadow: 0 0 30px rgba(255,122,69,0.4), 0 0 60px rgba(255,122,69,0.2);
    white-space: nowrap;
}
.home-grid {
    display: grid; grid-template-columns: 1fr 1fr 300px; gap: 16px;
}
.home-today-col { min-width: 0; }
.home-tomorrow-col { min-width: 0; }
.home-side { display: flex; flex-direction: column; gap: 16px; }

/* 区块标题 */
.home-section-header {
    display: flex; align-items: center; gap: 8px;
    font-size: 16px; font-weight: 700; color: var(--text-primary);
    margin-bottom: 14px;
}
.home-section-icon { width: 20px; height: 20px; color: var(--primary-color); flex-shrink: 0; }
.home-section-count {
    font-size: 12px; font-weight: 600; color: var(--primary-color);
    background: rgba(255,122,69,0.12); padding: 2px 10px; border-radius: 10px;
}

/* 今日/明日课程时间线（紧凑版） */
.home-timeline { position: relative; padding-left: 24px; }
.home-timeline::before {
    content: ''; position: absolute; left: 7px; top: 0; bottom: 0;
    width: 2px; background: var(--border-color);
}
.home-timeline-item {
    position: relative; padding: 10px 12px; margin-bottom: 6px;
    background: var(--card-bg); border-radius: 8px; border: 1px solid var(--border-color);
    display: flex; align-items: center; gap: 10px; transition: all .15s;
    cursor: pointer;
}
.home-timeline-item:hover { background: var(--primary-bg); border-color: var(--primary-color); transform: translateX(2px); }
.home-timeline-item::before {
    content: ''; position: absolute; left: -21px; top: 18px;
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--primary-color); border: 2px solid var(--bg-secondary);
}
.home-timeline-item.completed::before { background: #4ade80; }
.home-timeline-item.cancelled::before { background: #f87171; }
.home-timeline-time {
    font-size: 13px; font-weight: 700; color: var(--primary-color);
    min-width: 50px; text-align: center; line-height: 1.4;
}
.home-timeline-time span { font-size: 13px; font-weight: 700; color: var(--primary-color); }
.home-timeline-body { flex:1; min-width:0; }
.home-timeline-student { font-size: 13px; font-weight: 700; color: var(--text-primary); }
.home-timeline-meta { font-size: 11px; color: var(--text-muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-timeline-right {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.home-timeline-status {
    font-size: 10px; padding: 2px 8px; border-radius: 10px; font-weight: 600;
    white-space: nowrap; text-align: center;
}
.home-class-tag {
    display: inline-block;
    font-size: 11px; font-weight: 600;
    color: var(--primary-color); background: rgba(255,122,69,0.12);
    padding: 1px 6px; border-radius: 6px;
    max-width: 80px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    text-align: center;
}

/* 空状态 & 加载中 */
.home-empty {
    text-align: center; padding: 50px 20px; color: var(--text-muted);
}
.home-empty svg { width: 48px; height: 48px; opacity: 0.2; margin-bottom: 12px; }
.home-loading {
    text-align: center; padding: 40px 20px; color: var(--text-muted); font-size: 13px;
}

/* 右栏卡片 */
.home-card {
    background: var(--card-bg); border-radius: 10px; border: 1px solid var(--border-color);
    padding: 16px;
}
.home-card-title {
    display: flex; align-items: center; gap: 8px;
    font-size: 14px; font-weight: 700; color: var(--text-primary);
    margin-bottom: 14px;
}
.home-card-icon { width: 18px; height: 18px; color: var(--primary-color); flex-shrink: 0; }

/* 本周概览柱状图 */
.home-week-chart {
    display: flex; align-items: flex-end; justify-content: space-between;
    height: 100px; gap: 6px; margin-bottom: 12px;
}
.home-week-bar-wrap {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.home-week-bar {
    width: 100%; max-width: 28px; min-height: 4px;
    border-radius: 4px 4px 0 0; transition: all .2s;
    background: var(--border-color);
}
.home-week-bar.has-courses { background: rgba(255,122,69,0.35); }
.home-week-bar.is-today { background: var(--primary-color); box-shadow: 0 0 8px rgba(255,122,69,0.4); }
.home-week-bar-wrap:hover .home-week-bar.has-courses { background: var(--primary-color); }
.home-week-bar-label {
    font-size: 10px; color: var(--text-muted); font-weight: 500;
}
.home-week-bar-wrap.is-today .home-week-bar-label { color: var(--primary-color); font-weight: 700; }
.home-week-bar-count {
    font-size: 10px; color: var(--text-muted); font-weight: 600;
}
.home-week-summary {
    display: flex; justify-content: space-around;
    padding-top: 12px; border-top: 1px solid var(--border-color);
}
.home-week-summary-item { text-align: center; }
.home-week-summary-val { font-size: 18px; font-weight: 800; color: var(--text-primary); }
.home-week-summary-lbl { font-size: 10px; color: var(--text-muted); margin-top: 2px; }

/* 待办便利贴 */
.home-todo-input { display: flex; gap: 6px; margin-bottom: 10px; }
.home-todo-input input {
    flex: 1; padding: 6px 10px; font-size: 13px; border-radius: 6px;
    background: var(--bg-secondary); border: 1px solid var(--border-color);
    color: var(--text-primary); outline: none;
}
.home-todo-input input:focus { border-color: var(--primary-color); }
.home-todo-input button { padding: 4px 10px; font-size: 16px; border-radius: 6px; }
.home-todo-list { display: flex; flex-direction: column; gap: 4px; max-height: 200px; overflow-y: auto; }
.home-todo-item {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 8px; border-radius: 6px; font-size: 13px;
    transition: background .15s;
}
.home-todo-item:hover { background: var(--bg-secondary); }
.home-todo-check {
    width: 16px; height: 16px; border-radius: 3px; flex-shrink: 0; cursor: pointer;
    border: 2px solid var(--border-color); transition: all .15s;
}
.home-todo-check:hover { border-color: var(--primary-color); }
.home-todo-item.done .home-todo-check { background: var(--primary-color); border-color: var(--primary-color); }
.home-todo-item.done .home-todo-check::after {
    content: '✓'; color: #fff; font-size: 10px; font-weight: 700;
    display: flex; align-items: center; justify-content: center; height: 100%;
}
.home-todo-text { flex:1; color: var(--text-primary); }
.home-todo-item.done .home-todo-text { text-decoration: line-through; color: var(--text-muted); }
.home-todo-del {
    font-size: 14px; color: var(--text-muted); cursor: pointer; padding: 0 4px;
    opacity: 0; transition: opacity .15s;
}
.home-todo-item:hover .home-todo-del { opacity: 1; }
.home-todo-del:hover { color: #f87171; }
.home-todo-empty { text-align:center; color:var(--text-muted); font-size:12px; padding:8px 0; }

/* 最近反馈（扩展版，占满剩余空间） */
.home-feedback-expanded { flex: 1; }
.home-feedback-list { display: flex; flex-direction: column; gap: 8px; }
.home-feedback-item {
    padding: 10px 12px; border-radius: 8px;
    background: var(--bg-secondary); border: 1px solid var(--border-color);
    cursor: pointer; transition: all .15s;
}
.home-feedback-item:hover { border-color: var(--primary-color); background: var(--primary-bg); }
.home-feedback-top {
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px;
}
.home-feedback-student { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.home-feedback-date { font-size: 10px; color: var(--text-muted); }
.home-feedback-content {
    font-size: 12px; color: var(--text-muted); line-height: 1.5;
    overflow: hidden; text-overflow: ellipsis; display: -webkit-box;
    -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}

/* 响应式 */
@media (max-width: 1100px) {
    .home-grid { grid-template-columns: 1fr; }
    .home-side { flex-direction: row; flex-wrap: wrap; }
    .home-side .home-card { flex: 1; min-width: 260px; }
}

/* ==================== AI录入页面 ==================== */
.ai-input-container {
    background: var(--card-bg); border-radius: var(--radius);
    padding: 24px; box-shadow: var(--shadow); margin-bottom: 20px;
    border: 1px solid var(--border-color);
}
.ai-input-container textarea {
    width: 100%; padding: 16px; border: 1px solid var(--border-color);
    border-radius: var(--radius-sm); font-size: 14px; line-height: 1.7;
    resize: vertical; outline: none; transition: var(--transition);
    font-family: inherit; margin-bottom: 14px;
    background: var(--bg-secondary); color: var(--text-primary);
}
.ai-input-container textarea:focus {
    border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(255,122,69,0.12);
}
.ai-result {
    background: var(--card-bg); border-radius: var(--radius); padding: 20px;
    box-shadow: var(--shadow); margin-bottom: 20px;
    border-left: 4px solid var(--success-color);
    border: 1px solid var(--border-color); border-left: 4px solid var(--success-color);
}
.ai-result.hidden { display: none; }
.ai-result h4 { font-size: 15px; margin-bottom: 10px; color: var(--text-primary); }

.template-btn {
    text-align: left; padding: 12px 14px; background: var(--bg-secondary);
    border: 1px dashed var(--border-color); border-radius: var(--radius-xs);
    cursor: pointer; font-size: 13px; color: var(--text-secondary);
    transition: var(--transition);
}
.template-btn:hover { background: var(--primary-light); border-color: var(--primary-color); color: var(--primary-color); border-style: solid; }
.template-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; margin-bottom: 20px; }

.api-info {
    background: var(--warning-light); border-radius: var(--radius);
    padding: 18px; border-left: 4px solid var(--warning-color); margin-bottom: 20px;
}
.api-info h3 { color: var(--warning-color); font-size: 14px; }
.api-info p { font-size: 13px; color: var(--text-secondary); margin-bottom: 8px; }
.api-info code { display: block; background: var(--card-bg); padding: 8px 12px; border-radius: 6px; font-family: monospace; font-size: 12px; color: var(--primary-color); margin-bottom: 8px; }
.api-info pre { background: var(--card-bg); padding: 10px; border-radius: 6px; font-family: monospace; font-size: 11px; color: var(--text-secondary); }

/* ==================== Toast ==================== */
.toast {
    position: fixed; bottom: 24px; right: 24px;
    background: var(--card-bg); color: var(--text-primary);
    padding: 14px 24px; border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg); z-index: 400; font-size: 14px; font-weight: 500;
    animation: toastIn 0.3s ease;
    border: 1px solid var(--border-color);
}
.toast.hidden { display: none; }
.toast.success { background: var(--success-color); color: white; border-color: var(--success-color); }
.toast.error { background: var(--danger-color); color: white; border-color: var(--danger-color); }
.toast.warning { background: var(--warning-color); color: white; border-color: var(--warning-color); }
.toast.info { background: #3b82f6; color: white; border-color: #3b82f6; }

/* ========== 重复排课样式 ========== */
.repeat-section {
    margin-top: 16px;
    padding: 14px 16px;
    background: linear-gradient(135deg, rgba(255,122,69,0.06), rgba(124,58,237,0.06));
    border: 1.5px dashed var(--primary-color);
    border-radius: var(--radius-sm);
}

.repeat-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-color);
}

.repeat-toggle .toggle-switch {
    position: relative;
    width: 40px;
    height: 22px;
    background: #3a3f5c;
    border-radius: 11px;
    transition: all 0.3s;
    flex-shrink: 0;
    border: 1px solid #4a4f6c;
}

.repeat-toggle .toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px; left: 2px;
    width: 18px; height: 18px;
    background: white;
    border-radius: 50%;
    transition: all 0.3s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.repeat-toggle input:checked + .toggle-switch { background: var(--primary-color); }
.repeat-toggle input:checked + .toggle-switch::after { left: 20px; }
.repeat-toggle input[type="checkbox"] {
    position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none;
}

#status-hint {
    white-space: nowrap;
    font-size: 11px;
    margin-top: 2px;
}

.repeat-options {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.repeat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr auto 1fr;
    gap: 12px;
    align-items: end;
    margin-top: 14px;
}

.repeat-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.repeat-field label {
    font-size: 12px;
    font-weight: 600;
    color: var(--primary-color);
}

.repeat-field select,
.repeat-field input[type="number"],
.repeat-field input[type="date"] {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-xs);
    background: var(--bg-secondary);
    font-size: 13px;
    color: var(--text-primary);
    transition: border-color 0.2s;
    box-sizing: border-box;
}
.repeat-field select:focus,
.repeat-field input:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(255,122,69,0.12);
}

.repeat-field-divider {
    display: flex;
    align-items: flex-end;
    padding-bottom: 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
}

.repeat-info-text {
    font-size: 12px;
    color: var(--primary-color);
    background: var(--primary-light);
    padding: 8px 12px;
    border-radius: var(--radius-xs);
    line-height: 1.5;
}

.repeat-preview {
    margin-top: 12px;
    max-height: 150px;
    overflow-y: auto;
}
.repeat-preview-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.repeat-preview-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.repeat-preview-item {
    font-size: 11px;
    padding: 4px 10px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
}
.repeat-preview-item.is-past {
    color: var(--text-muted);
    border-color: var(--border-color);
    text-decoration: line-through;
}
.repeat-preview-item.is-first {
    background: var(--primary-light);
    border-color: var(--primary-color);
    font-weight: 600;
    color: var(--primary-color);
}

/* ========== 撤销栏样式 ========== */
.undo-bar {
    position: fixed;
    top: 16px; right: 16px;
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    background: var(--card-bg);
    border: 1.5px solid var(--success-color);
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 20px rgba(0,0,0,0.3), 0 0 0 1px rgba(34,197,94,0.15);
    animation: slideInRight 0.3s ease-out;
    font-size: 13px;
}
@keyframes slideInRight {
    from { transform: translateX(120%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.undo-bar-text {
    color: var(--text-primary);
    white-space: nowrap;
}
.undo-bar-text strong { color: var(--success-color); }

.undo-btn {
    padding: 5px 14px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.undo-btn:hover { background: #dc2626; box-shadow: 0 2px 8px rgba(239,68,68,0.35); }

.undo-close {
    background: none; border: none; font-size: 18px;
    color: #94a3b8; cursor: pointer; padding: 2px 4px;
    line-height: 1;
}
.undo-close:hover { color: var(--text-primary); }

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

/* ==================== 教师管理样式 ==================== */
.subject-checkboxes {
    display: flex; flex-wrap: wrap; gap: 8px;
}
.subject-checkboxes label {
    position: relative;
    display: inline-flex; align-items: center; gap: 4px;
    padding: 7px 14px; border: 1.5px solid var(--border-color);
    border-radius: var(--radius-xs); cursor: pointer;
    font-size: 13px; color: var(--text-secondary);
    transition: var(--transition); user-select: none;
    white-space: nowrap;
    min-width: 56px; justify-content: center;
}
.subject-checkboxes input[type="checkbox"] {
    position: absolute; opacity: 0; pointer-events: none; width: 0; height: 0;
}
.subject-checkboxes label:hover {
    border-color: var(--primary-color); background: var(--primary-light);
}
.subject-checkboxes label:has(input:checked) {
    border-color: var(--primary-color); background: var(--primary-light);
    color: var(--primary-color); font-weight: 600;
}

/* 科目标签（表格中显示） */
.subject-tags-row { display: flex; flex-wrap: wrap; gap: 4px; }
.subject-tag {
    display: inline-block; padding: 2px 8px; border-radius: 8px;
    font-size: 11px; background: rgba(124,58,237,0.12); color: #a78bfa; white-space: nowrap;
}

/* ==================== 响应式 ==================== */

/* ==================== 登录页面样式 ==================== */
.login-overlay {
    position: fixed; top: 0; left: 0;
    width: 100%; height: 100%;
    background: linear-gradient(135deg, var(--bg-color) 0%, var(--sidebar-bg) 100%);
    z-index: 9999;
    display: flex; align-items: center; justify-content: center;
}
.login-overlay.hidden { display: none !important; }

.login-card {
    background: var(--card-bg); border-radius: 16px; border: 1px solid var(--border-color);
    width: 400px; max-width: 90vw;
    padding: 40px 36px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: loginSlideUp 0.5s ease;
}
@keyframes loginSlideUp {
    from { transform: translateY(30px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}

.login-header { text-align: center; margin-bottom: 28px; }
.login-logo {
    font-size: 48px; display: block; margin-bottom: 12px;
    color: var(--primary-color);
}
.login-logo img {
    width: 144px; height: 144px;
    object-fit: contain;
    filter: hue-rotate(18deg) saturate(0.75) brightness(1.45) contrast(1.05);
}
.login-logo-bg {
    display: inline-block;
    background: white;
    border-radius: 8px;
    line-height: 0;
    overflow: hidden;
}
.login-header h1 {
    font-size: 22px; font-weight: 800; color: var(--text-primary); margin-bottom: 4px;
}
.login-subtitle {
    font-size: 13px; color: var(--text-muted);
    font-weight: 400; letter-spacing: 1px;
}

/* 登录输入框（带图标的 input group） */
.login-field .form-group { margin-bottom: 0; }
.login-input-wrap {
    position: relative;
    display: flex; align-items: center;
}
.login-field-icon {
    position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
    width: 20px; height: 20px; color: var(--text-muted);
    display: flex; align-items: center; justify-content: center;
    pointer-events: none; transition: color 0.2s;
}
.login-field-icon svg {
    width: 18px; height: 18px;
}
.login-input-wrap input {
    padding-left: 42px !important;
    width: 100% !important;
    height: 46px !important;
}
.login-input-wrap input:focus ~ .login-field-icon,
.login-input-wrap input:focus + .login-field-icon {
    color: var(--primary-color);
}
/* 注意：图标在 input 左侧的绝对定位，focus 时不能用兄弟选择器，改用父元素 focus-within */
.login-input-wrap:focus-within .login-field-icon {
    color: var(--primary-color);
}
.login-field { margin-bottom: 12px; }

.login-error {
    color: var(--danger-color); font-size: 13px;
    min-height: 20px; text-align: center; margin-bottom: 12px; font-weight: 500;
}

.btn-full { width: 100%; }

.login-hint {
    text-align: center; margin-top: 16px; font-size: 12px;
    color: var(--text-muted); background: var(--bg-secondary);
    padding: 8px 12px; border-radius: var(--radius-xs);
}

/* 用户信息栏 */
.user-info-bar {
    padding: 12px 16px; display: flex; align-items: center; gap: 10px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary); flex-shrink: 0;
}
.user-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), #c2410c);
    color: white; display: flex; align-items: center;
    justify-content: center; font-weight: 700; font-size: 15px; flex-shrink: 0;
}
.user-detail { flex: 1; min-width: 0; }
.user-name {
    font-size: 14px; font-weight: 600; color: var(--text-primary);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.user-role-badge { font-size: 11px; color: var(--text-muted); }

.btn-logout {
    background: none; border: none; cursor: pointer;
    font-size: 13px; color: var(--text-muted); padding: 4px 10px;
    border-radius: var(--radius-xs); transition: all 0.2s; white-space: nowrap; flex-shrink: 0;
}
.btn-logout:hover { background: var(--danger-light); color: var(--danger-color); }

/* 角色标签 */
.role-badge {
    display: inline-block; padding: 3px 10px; border-radius: 10px;
    font-size: 12px; font-weight: 600;
}
.role-admin {
    background: var(--warning-light); color: var(--warning-color);
}
.role-teacher {
    background: rgba(124,58,237,0.12); color: #a78bfa;
}

@media (max-width: 768px) {
    body { flex-direction: column; height: auto; min-height: 100vh; }
    .sidebar { width: 100%; height: auto; border-right: none; border-bottom: 1px solid var(--border-color); }
    .sidebar-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; padding: 12px; }
    .sidebar-ranking { display: none; }
    .sidebar-nav { display: flex; flex-direction: row; overflow-x: auto; padding: 8px 12px; gap: 4px; }
    .sidebar-nav-btn { padding: 8px 14px; white-space: nowrap; }
    .main-content { height: auto; min-height: 60vh; }
    .week-view-container { overflow: auto; }
    .time-column { display: none; }
    .time-label-header { display: none; }
    .day-grid-column { min-width: 70px; }
    .search-bar input { width: 100%; }
    .form-row { grid-template-columns: 1fr; }
}

/* ========== 智能排课助手样式 ========== */
.smart-schedule-container {
    background: var(--card-bg); border-radius: var(--radius);
    padding: 18px; box-shadow: var(--shadow); margin-bottom: 20px;
    border: 1px solid var(--border-color);
}
.smart-input-wrapper {
    display: flex; gap: 10px; align-items: stretch;
}
.smart-input-wrapper textarea {
    flex: 1; min-height: 80px; padding: 12px;
    border: 2px solid var(--border-color); border-radius: var(--radius);
    font-size: 15px; resize: vertical; transition: border-color 0.2s;
    line-height: 1.5; background: var(--bg-secondary); color: var(--text-primary);
}
.smart-input-wrapper textarea:focus {
    outline: none; border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 122, 69, 0.12);
}
.smart-send-btn {
    padding: 10px 20px; border-radius: var(--radius); cursor: pointer;
    font-size: 14px; font-weight: 600; white-space: nowrap; height: auto;
    align-self: flex-end; display: flex; align-items: center; gap: 4px;
}

/* 解析结果预览 */
.smart-result {
    margin-top: 16px; padding: 14px 18px;
    border-radius: var(--radius); border-left: 4px solid;
    background: var(--bg-secondary); animation: fadeIn 0.2s ease;
}
.smart-result.success { border-left-color: var(--success-color); }
.smart-result.warning { border-left-color: var(--warning-color); }
.smart-result.error { border-left-color: var(--danger-color); }

/* 确认卡片 */
.smart-confirm-card {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1) 0%, rgba(34, 197, 94, 0.05) 100%);
    border: 2px solid rgba(34, 197, 94, 0.3); border-radius: var(--radius);
    padding: 20px; animation: slideUp 0.25s ease;
}
@keyframes slideUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.confirm-card-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 14px;
}
.confirm-card-title { font-size: 16px; font-weight: 700; color: var(--success-color); }
.confirm-card-grid {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 14px 0;
}
.confirm-card-item {
    background: var(--card-bg); padding: 10px 14px;
    border-radius: 8px; display: flex; gap: 8px; align-items: center;
    border: 1px solid var(--border-color);
}
.confirm-card-item .label { color: var(--text-muted); font-size: 13px; }
.confirm-card-item .value { font-weight: 600; font-size: 14px; color: var(--text-primary); }
.confirm-card-actions {
    display: flex; gap: 10px; margin-top: 16px; justify-content: flex-end;
}
.confirm-card-warning {
    background: var(--warning-light); border: 1px solid rgba(245,158,11,0.3);
    border-radius: 6px; padding: 8px 12px; margin-top: 10px;
    font-size: 13px; color: var(--warning-color);
}
.confirm-card-warning .warn-icon { margin-right: 4px; }

/* 排课历史 */
.smart-history-item {
    display: flex; align-items: center; padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 13px;
}
.smart-history-item:last-child { border-bottom: none; }
.shi-time { color: var(--text-muted); width: 70px; flex-shrink: 0; }
.shi-info { flex: 1; }
.shi-student { font-weight: 500; color: var(--text-primary); }
.shi-teacher { color: var(--text-secondary); margin-left: 6px; }
.shi-status { font-size: 11px; padding: 2px 8px; border-radius: 10px; }
.shi-status.planned { background: rgba(59, 130, 246, 0.12); color: #60a5fa; }
.shi-status.done { background: var(--success-light); color: var(--success-color); }

/* ========== 快速新建学生按钮 ========== */
.btn-quick-add-student {
    display: inline-flex; align-items: center; justify-content: center;
    width: 22px; height: 22px; border-radius: 50%;
    border: 1.5px solid var(--primary-color); background: transparent;
    color: var(--primary-color); font-size: 16px; font-weight: 700;
    cursor: pointer; line-height: 1; padding: 0; margin-left: 6px;
    transition: all 0.2s; vertical-align: middle;
}
.btn-quick-add-student:hover {
    background: var(--primary-color); color: #fff;
    transform: scale(1.15); box-shadow: 0 0 8px rgba(255,122,69,0.4);
}

/* ========== 多选学生组件 ========== */
.multi-student-select {
    position: relative;
    border: 2px solid var(--border-color); border-radius: var(--radius);
    background: var(--bg-secondary); min-height: 44px; padding: 4px 8px;
    cursor: text; transition: border-color 0.2s, box-shadow 0.2s;
}
.multi-student-select:focus-within {
    border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(255,122,69,0.12);
}
.ms-selected-tags {
    display: flex; flex-wrap: wrap; gap: 6px; min-height: 28px;
}
.ms-tag {
    display: inline-flex; align-items: center; gap: 4px;
    background: var(--primary-light);
    border: 1px solid rgba(255,122,69,0.25); border-radius: 6px;
    padding: 2px 8px; font-size: 13px; font-weight: 500;
    color: var(--primary-color); animation: tagPop 0.15s ease;
}
@keyframes tagPop { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.ms-tag-remove {
    cursor: pointer; width: 16px; height: 16px; border-radius: 50%;
    background: none; border: none; color: var(--text-muted); font-size: 14px;
    line-height: 1; padding: 0; display: flex; align-items: center; justify-content: center;
    transition: all 0.15s;
}
.ms-tag-remove:hover { background: var(--danger-color); color: white; }
.ms-input {
    border: none; outline: none; min-width: 160px; font-size: 14px;
    padding: 4px 0; flex: 1; min-height: 28px; background: transparent;
    color: var(--text-primary);
}
/* 下拉建议列表 */
.ms-dropdown {
    position: absolute; top: 100%; left: -1px; right: -1px;
    max-height: 200px; overflow-y: auto;
    background: var(--card-bg); border: 1px solid var(--border-color);
    border-radius: 0 0 var(--radius) var(--radius);
    box-shadow: 0 8px 24px rgba(0,0,0,0.3); z-index: 100;
    margin-top: 2px;
}
.ms-dropdown-item {
    padding: 8px 14px; font-size: 13px; cursor: pointer;
    display: flex; justify-content: space-between; align-items: center;
    transition: background 0.1s;
    color: var(--text-primary);
}
.ms-dropdown-item:hover { background: var(--card-hover); }
.ms-dropdown-item.selected { background: var(--primary-light); color: var(--primary-color); }
.ms-dropdown-item .ms-di-subject { font-size: 11px; color: var(--text-muted); }
.ms-dropdown-empty { padding: 12px 14px; color: var(--text-muted); font-size: 13px; text-align: center; }

/* 周视图课程卡片：多人显示 */
.cb-student-name-multi {
    font-size: 15px; font-weight: 700; line-height: 1.25;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    display: flex; align-items: center;
}

/* 小组课/班课 卡片特殊样式（不覆盖状态色，仅加右侧紫色渐变条作区分） */
.course-block-group {
    box-shadow: inset 3px 0 0 rgba(124,58,237,0.4), 0 1px 4px rgba(0,0,0,0.3);
}

/* ==================== 视图切换按钮组 ==================== */
.view-toggle-group {
    display: inline-flex;
    background: var(--card-bg);
    border-radius: 8px;
    padding: 3px;
    margin-right: 16px;
    border: 1px solid var(--border-color);
}
.view-toggle-btn {
    padding: 6px 14px;
    border: none;
    background: transparent;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    white-space: nowrap;
}
.view-toggle-btn:hover { background: var(--primary-light); color: var(--primary-color); }
.view-toggle-btn.active {
    background: var(--primary-color);
    color: white;
    box-shadow: var(--shadow-sm);
    font-weight: 600;
}

.week-nav-arrows { display: inline-flex; align-items: center; gap: 4px; }
.month-year-nav { display: inline-flex; align-items: center; gap: 4px; }

/* ==================== 日历视图容器 ==================== */
.schedule-container { position: relative; flex: 1; overflow-y: auto; overflow-x: hidden; }
.month-view, .year-view { height: 100%; padding: 12px 20px 24px; }

/* ==================== 月课表热力图 ==================== */
.month-header-row {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    padding: 0 4px;
}
.month-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}
.month-cell {
    aspect-ratio: 1.1;
    min-height: 22px;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    position: relative;
    user-select: none;
    border: 1px solid var(--border-color);
}
.month-cell:hover {
    transform: scale(1.08);
    z-index: 2;
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}
.month-cell.other-month {
    opacity: 0.5;
}
.month-cell.today {
    outline: 2px solid var(--primary-color);
    outline-offset: -2px;
}
.month-cell-date {
    font-size: 25px;
    font-weight: 700;
    line-height: 1;
    position: absolute;
    top: 2px;
    right: 5px;
}
.month-cell-count {
    font-size: 20px;
    font-weight: 800;
    line-height: 1.2;
}
.month-cell-empty .month-cell-count {
    font-size: 11px;
    font-weight: 400;
    color: var(--text-muted);
}

/* 绿色热力图色阶（暗色主题适配） */
.heat-0  { background: var(--bg-secondary); color: var(--text-muted); border-color: var(--border-color); }
.heat-1  { background: rgba(34, 197, 94, 0.15); color: #86efac; }
.heat-2  { background: rgba(34, 197, 94, 0.25); color: #4ade80; }
.heat-3  { background: rgba(34, 197, 94, 0.35); color: #4ade80; }
.heat-4  { background: rgba(34, 197, 94, 0.5); color: #bbf7d0; }
.heat-5  { background: rgba(34, 197, 94, 0.65); color: #dcfce7; }
.heat-6  { background: rgba(34, 197, 94, 0.8); color: #ffffff; }
[class*="heat-7"] { background: rgba(34, 197, 94, 0.95); color: #ffffff; }

/* ==================== 年课表热力图 ==================== */
.year-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 14px;
    max-width: 900px;
    margin: 0 auto;
}
.year-month-cell {
    border-radius: 16px;
    padding: 28px 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    min-height: 140px;
    user-select: none;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
}
.year-month-cell:hover {
    transform: translateY(-2px) scale(1.03);
    z-index: 2;
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
    border-color: var(--primary-color);
}
.year-month-name {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-primary);
}
.year-month-count {
    font-size: 36px;
    font-weight: 800;
    line-height: 1;
    color: var(--primary-color);
}
.year-summary {
    text-align: center;
    margin: 16px 0 8px;
    font-size: 15px;
    color: var(--text-secondary);
}
.year-summary b { color: var(--success-color); }

/* 响应式：小屏幕 */
@media (max-width: 768px) {
    .view-toggle-group { margin-right: 8px; }
    .view-toggle-btn { padding: 5px 10px; font-size: 12px; }
    .month-cell { min-height: 20px; }
    .month-cell-count { font-size: 12px; }
    .year-grid { grid-template-columns: repeat(4, 1fr); gap: 10px; }
    .year-month-cell { min-height: 100px; padding: 18px 12px; }
    .year-month-count { font-size: 26px; }
}

/* ==================== 成绩管理页面 ==================== */
.grade-stats-bar {
    display: flex; gap: 12px; margin-bottom: 16px;
    flex-wrap: wrap;
}
.grade-stat-card {
    background: var(--bg-secondary); border-radius: 10px;
    padding: 14px 20px; min-width: 110px; text-align: center;
    border: 1px solid var(--border-color);
}
.grade-stat-value {
    font-size: 24px; font-weight: 700; color: var(--primary-color);
}
.grade-stat-label {
    font-size: 11px; color: var(--text-muted); margin-top: 4px;
}
.grade-subject-stats {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px; margin-bottom: 16px;
}
.grade-subject-item {
    background: var(--bg-secondary); border-radius: 8px; padding: 10px 14px;
    font-size: 13px; border: 1px solid var(--border-color);
    display: flex; justify-content: space-between; align-items: center;
}
.grade-subject-name { font-weight: 600; color: var(--text-primary); }
.grade-subject-avg { color: var(--primary-color); font-weight: 700; }
/* 得分率颜色 */
.score-excellent { color: #059669; font-weight: 700; }   /* >=85% 绿色 */
.score-good { color: #2563eb; font-weight: 600; }        /* >=70% 蓝色 */
.score-average { color: #d97706; font-weight: 600; }      /* >=50% 橙色 */
.score-poor { color: #dc2626; font-weight: 700; }         /* <50% 红色 */
/* 筛选栏内联总记录数 */
.grade-total-inline {
    margin-left: auto; padding: 4px 14px;
    background: #f0f0ff; border-radius: 16px;
    font-size: 13px; color: var(--text-secondary);
    white-space: nowrap;
}
.grade-total-inline b { color: var(--primary-color); }

/* 成绩折线图 */
.grade-chart-wrap {
    background: var(--card-bg); border: 1px solid var(--border-color);
    border-radius: 10px; padding: 20px; margin-bottom: 16px;
}
.grade-chart-wrap canvas { max-height: 260px; }

/* ==================== 课后反馈样式 ==================== */
/* 反馈时间线 */
.fb-timeline { position: relative; padding-left: 22px; }
.fb-timeline::before {
    content: ''; position: absolute; left: 6px; top: 8px; bottom: 8px;
    width: 1.5px; background: var(--border-color);
}
.fb-tl-item {
    position: relative; margin-bottom: 16px;
    background: var(--card-bg); border-radius: 10px;
    padding: 12px 14px; border: 1px solid var(--border-color);
    transition: box-shadow 0.15s;
}
.fb-tl-item:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.2); }
.fb-tl-dot {
    position: absolute; left: -19px; top: 12px;
    width: 11px; height: 11px; border-radius: 50%;
    border: 2.5px solid var(--card-bg); box-shadow: 0 0 0 1px var(--border-color);
}
.fb-tl-dot.course { background: #534AB7; }
.fb-tl-dot.praise { background: #0F6E56; }
.fb-tl-dot.remind { background: #BA7517; }
.fb-tl-dot.summary { background: #185FA5; }
.fb-tl-dot.other { background: #888780; }

.fb-tl-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 6px; gap: 8px;
}
.fb-tl-type-badge {
    font-size: 11px; font-weight: 500; padding: 1px 8px;
    border-radius: 8px; white-space: nowrap;
}
.fb-tl-type-badge.course { color: #a5b4fc; background: rgba(99,102,241,0.12); }
.fb-tl-type-badge.praise { color: #6ee7b7; background: rgba(16,185,129,0.12); }
.fb-tl-type-badge.remind { color: #fcd34d; background: rgba(245,158,11,0.12); }
.fb-tl-type-badge.summary { color: #93c5fd; background: rgba(37,99,235,0.12); }
.fb-tl-type-badge.other { color: var(--text-muted); background: var(--card-hover); }

.fb-tl-date { font-size: 11px; color: var(--text-muted); flex-shrink: 0; }
.fb-tl-body { font-size: 13px; color: var(--text-primary); line-height: 1.55; }
.fb-tl-section { margin-bottom: 4px; }
.fb-tl-label {
    display: inline-block; font-size: 11px; font-weight: 500; margin-right: 4px;
}
.fb-tl-label.c-main { color: #a5b4fc; }
.fb-tl-label.c-summary { color: #6ee7b7; }
.fb-tl-label.c-suggestion { color: #fcd34d; }
.fb-tl-label.c-homework { color: #93c5fd; }

.fb-tl-tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 6px; }
.fb-tag {
    font-size: 10px; padding: 2px 8px; border-radius: 10px;
    border: 1px solid; background: var(--card-bg);
}
.fb-tag.green { color: #6ee7b7; border-color: rgba(16,185,129,0.4); }
.fb-tag.amber { color: #fcd34d; border-color: rgba(245,158,11,0.4); }
.fb-tag.blue { color: #93c5fd; border-color: rgba(37,99,235,0.4); }
.fb-tag.pink { color: #f9a8d4; border-color: rgba(236,72,153,0.4); }
.fb-tag.purple { color: #c4b5fd; border-color: rgba(139,92,246,0.4); }

.fb-tl-actions {
    margin-top: 8px; display: flex; gap: 6px; justify-content: flex-end;
}

/* 家长版反馈卡片 */
.fb-card {
    max-width: 380px; margin: 0 auto; border-radius: 14px;
    overflow: hidden; border: 1px solid var(--border-color);
    font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
}
.fb-card-head {
    background: linear-gradient(135deg, var(--primary-color), #c2410c);
    padding: 14px 18px; color: #fff;
}
.fb-card-head .fb-card-title { font-size: 11px; opacity: 0.85; }
.fb-card-head .fb-card-student { font-size: 16px; font-weight: 600; margin-top: 2px; }
.fb-card-head .fb-card-meta { font-size: 11px; text-align: right; opacity: 0.85; margin-top: 2px; }
.fb-card-body { padding: 14px 18px; display: flex; flex-direction: column; gap: 10px; background: var(--card-bg); }
.fb-card-row {}
.fb-card-label { font-size: 11px; font-weight: 600; margin-bottom: 2px; display: block; }
.fb-card-text { font-size: 13px; line-height: 1.55; color: var(--text-primary); word-break: break-word; }
.fb-card-footer {
    padding: 8px 18px; background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    font-size: 11px; color: var(--text-muted); text-align: right;
}
/* 卡片类目标色 */
.fb-l-main { color: #a5b4fc; }
.fb-l-sum { color: #6ee7b7; }
.fb-l-sug { color: #fcd34d; }
.fb-l-hw { color: #93c5fd; }

/* 反馈标签选择器 */
.fb-tag-btn {
    cursor: pointer; font-size: 11px; padding: 3px 10px;
    border-radius: 12px; border: 1px solid var(--border-color);
    background: var(--card-bg); transition: all 0.15s;
    color: var(--text-secondary);
}
.fb-tag-btn:hover { border-color: var(--primary-color); }
.fb-tag-btn.active { background: var(--primary-color); color: #fff; border-color: var(--primary-color); }

/* ========== 班级管理样式 ========== */

/* 班级列表行 */
.class-row {
    display: flex; align-items: center; justify-content: space-between;
    background: var(--card-bg); border-radius: 10px; padding: 14px 18px;
    border: 1px solid var(--border-color); transition: background .15s; gap: 16px;
}
.class-row:hover { background: var(--primary-bg); }
.class-row-left { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; }
.class-row-name { font-size: 16px; font-weight: 700; color: var(--text-primary); }
.class-row-type { font-size: 11px; padding: 2px 8px; border-radius: 10px; background: var(--primary-light); color: var(--primary-color); font-weight: 500; }
.class-row-info { font-size: 13px; color: var(--text-secondary); display: flex; align-items: center; gap: 4px; }
.class-row-actions { display: flex; gap: 4px; flex-shrink: 0; }

/* 班级卡片（旧版保留）*/
.class-card {
    background: var(--card-bg); border-radius: 12px; padding: 18px; box-shadow: 0 1px 4px rgba(0,0,0,.2);
    border-left: 4px solid var(--primary-color); transition: transform .15s, box-shadow .15s;
    cursor: default; border: 1px solid var(--border-color); border-left: 4px solid var(--primary-color);
}
.class-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,.3); }
.class-card.type-1v1 { border-left-color: var(--success-color); }
.class-card.type-group { border-left-color: var(--warning-color); }
.class-card.type-class { border-left-color: #60a5fa; }

.class-card-header {
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px;
}
.class-card-title {
    font-size: 16px; font-weight: 700; color: var(--text-primary);
}
.class-card-type {
    font-size: 11px; padding: 2px 8px; border-radius: 10px; font-weight: 600;
}
.type-badge-1v1 { background: var(--success-light); color: var(--success-color); }
.type-badge-group { background: var(--warning-light); color: var(--warning-color); }
.type-badge-class { background: rgba(59, 130, 246, 0.12); color: #60a5fa; }

.class-card-info {
    display: flex; gap: 14px; font-size: 13px; color: var(--text-secondary); margin-bottom: 10px; flex-wrap: wrap;
}
.class-card-students {
    font-size: 13px; color: var(--text-secondary);
}
.class-card-actions {
    display: flex; gap: 6px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border-color);
}

/* 批量选人列表 */
.student-check-list label {
    display: flex; align-items: center; gap: 8px; padding: 6px 4px; border-radius: 6px;
    cursor: pointer; transition: background .15s; font-size: 13px;
    color: var(--text-primary);
}
.student-check-list label:hover { background: var(--primary-light); }
.student-check-list input[type="checkbox"] {
    accent-color: var(--primary-color); width: 16px; height: 16px; cursor: pointer;
}
.student-check-list .student-grade {
    font-size: 11px; color: var(--text-muted); margin-left: auto;
}

/* ============================================================
   UI 统一优化 (v3.0) — 暗色主题设计语言全局覆盖
   ============================================================ */

/* ----- 1. 全局表单元素（弹窗内裸 label/input 自动生效）----- */
.modal-content label {
    display: block; font-size: 13px; font-weight: 600;
    color: var(--text-secondary); margin-bottom: 5px;
}
.modal-content input[type="text"],
.modal-content input[type="number"],
.modal-content input[type="date"],
.modal-content input[type="tel"],
.modal-content input[type="password"],
.modal-content select,
.modal-content textarea {
    width: 100%; padding: 9px 12px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-xs); font-size: 14px; outline: none;
    transition: border-color .2s, box-shadow .2s;
    font-family: inherit; box-sizing: border-box;
    background: var(--bg-secondary); color: var(--text-primary);
}
.modal-content input:focus,
.modal-content select:focus,
.modal-content textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255,122,69,0.12);
}
/* 下拉框图标：替换默认黑色箭头为可见的浅色 */
.modal-content select,
.form-group select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a0aec0' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 12px;
    padding-right: 30px;
}
.modal-content input::placeholder,
.modal-content textarea::placeholder {
    color: var(--text-muted); font-size: 13px;
}

/* 日期/时间选择器图标：深色主题下调亮 */
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {
    filter: invert(0.75);
    cursor: pointer;
    opacity: 0.85;
}

/* ----- 2. 按钮系统补全 ----- */
.btn-outline {
    background: var(--card-bg); color: var(--text-secondary);
    border: 1.5px solid var(--border-color);
}
.btn-outline:hover {
    background: var(--primary-light); color: var(--primary-color);
    border-color: var(--primary-color);
}
.btn-sm {
    padding: 5px 12px; font-size: 12px; border-radius: 5px;
    min-height: 28px;
}
.btn-sm .nav-icon { font-size: 13px; }

/* ----- 3. 表格优化 ----- */
.data-table th {
    background: linear-gradient(180deg, var(--bg-secondary), var(--card-bg));
    font-weight: 700; font-size: 12px; color: var(--text-secondary);
    letter-spacing: 0.4px; text-transform: uppercase;
    padding: 11px 14px; border-bottom: 2px solid var(--border-color);
    position: sticky; top: 0; z-index: 1;
}
.data-table td {
    padding: 11px 14px; font-size: 13.5px;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}
.data-table tr:hover { background: var(--card-hover); }
.data-table tr:last-child td { border-bottom: none; }
.table-container {
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* ----- 4. 筛选栏优化 ----- */
.filter-bar {
    padding: 14px 16px;
    background: linear-gradient(135deg, var(--card-bg) 0%, var(--bg-secondary) 100%);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.filter-bar select,
.filter-bar input {
    padding: 8px 14px; border: 1.5px solid var(--border-color);
    border-radius: 8px; font-size: 13px; outline: none;
    background: var(--bg-secondary); color: var(--text-primary);
    transition: border-color .2s, box-shadow .2s;
    cursor: pointer;
}
.filter-bar select:hover,
.filter-bar input:hover { border-color: var(--text-muted); }
.filter-bar select:focus,
.filter-bar input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255,122,69,0.12);
}

/* ----- 5. 空状态优化 ----- */
.empty-state {
    padding: 48px 24px !important; text-align: center;
    color: var(--text-muted);
}
.empty-state::before {
    content: '📭'; display: block; font-size: 48px;
    margin-bottom: 12px; opacity: 0.5;
}

/* ----- 6. 页面标题优化 ----- */
.page-title {
    font-size: 24px; font-weight: 800;
    background: linear-gradient(135deg, var(--primary-color), #c2410c);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}
.page-header { margin-bottom: 20px; }

/* ----- 7. 弹窗优化 ----- */
.modal-content {
    border-radius: 16px;
    box-shadow: 0 25px 60px rgba(0,0,0,0.5);
    border: 1px solid var(--border-color);
}
.modal-header {
    padding: 20px 24px;
    background: linear-gradient(135deg, var(--primary-light) 0%, rgba(124,58,237,0.08) 100%);
    border-bottom: 1px solid var(--border-color);
    border-radius: 16px 16px 0 0;
}
.modal-header h3 {
    font-size: 17px; font-weight: 700; color: var(--primary-color);
}
.modal-close {
    background: var(--card-hover); border: none; font-size: 22px;
    cursor: pointer; color: var(--text-muted);
    width: 32px; height: 32px; display: flex;
    align-items: center; justify-content: center;
    border-radius: 50%; transition: all .2s;
    line-height: 1;
}
.modal-close:hover {
    background: var(--danger-light); color: var(--danger-color);
    transform: rotate(90deg);
}
.modal-footer {
    padding: 16px 24px; border-top: 1px solid var(--border-color);
    background: var(--bg-secondary); border-radius: 0 0 16px 16px;
}

/* ----- 8. 班级卡片优化 ----- */
.class-card {
    border-radius: 14px; padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--primary-color);
    transition: transform .2s, box-shadow .2s;
    background: linear-gradient(180deg, var(--card-bg) 0%, var(--bg-secondary) 100%);
}
.class-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}
.class-card-title { font-size: 17px; font-weight: 700; }
.class-card-type {
    font-size: 11px; padding: 3px 10px; border-radius: 12px; font-weight: 600;
}
.class-card-info { gap: 12px; }
.class-card-info span {
    display: inline-flex; align-items: center; gap: 3px;
    padding: 3px 10px; background: var(--bg-secondary);
    border-radius: 6px; font-size: 12px; font-weight: 500;
    color: var(--text-secondary);
}
.class-card-actions .btn-sm {
    flex: 1; justify-content: center;
}

/* ----- 9. 反馈时间线优化 ----- */
.fb-timeline { padding: 8px 0; }
.fb-tl-item {
    position: relative; padding-left: 28px; margin-bottom: 20px;
}
.fb-tl-item::before {
    content: ''; position: absolute; left: 9px; top: 24px; bottom: -20px;
    width: 2px; background: linear-gradient(180deg, var(--border-color), transparent);
}
.fb-tl-item:last-child::before { display: none; }
.fb-tl-dot {
    position: absolute; left: 2px; top: 4px;
    width: 16px; height: 16px; border-radius: 50%;
    border: 3px solid var(--card-bg); box-shadow: 0 0 0 2px var(--border-color);
}
.fb-tl-item:hover .fb-tl-dot { transform: scale(1.15); }
.fb-tl-header { margin-bottom: 8px; }
.fb-tl-type-badge {
    font-size: 11px; padding: 2px 10px; border-radius: 10px;
    font-weight: 600; margin-right: 8px;
}
.fb-tl-date { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.fb-tl-body {
    background: var(--bg-secondary); border: 1px solid var(--border-color);
    border-radius: 10px; padding: 14px 16px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    transition: box-shadow .2s;
}
.fb-tl-item:hover .fb-tl-body { box-shadow: 0 4px 12px rgba(0,0,0,0.2); }
.fb-tl-section { font-size: 13.5px; line-height: 1.7; margin-bottom: 6px; }
.fb-tl-section:last-child { margin-bottom: 0; }
.fb-tl-label {
    font-size: 12px; font-weight: 700; margin-right: 4px;
}

/* ----- 10. 家长卡片优化 ----- */
.fb-card {
    border-radius: 16px; overflow: hidden;
    box-shadow: 0 4px 20px rgba(255,122,69,0.15);
    border: 1px solid var(--border-color);
}
.fb-card-head {
    padding: 18px 22px; font-size: 16px; font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, var(--primary-color) 0%, #c2410c 100%);
}
.fb-card-body { padding: 20px 22px; background: var(--card-bg); }
.fb-card-footer {
    padding: 12px 22px; background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    font-size: 13px; color: var(--text-secondary);
}

/* ----- 11. 侧边栏统计卡片统一 ----- */
.sidebar-stat {
    border-radius: 10px; padding: 12px;
    transition: all .2s; position: relative; overflow: hidden;
}
.sidebar-stat:hover { transform: translateY(-1px); }
.sidebar-stat-icon {
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

/* ----- 12. 标签按钮统一 ----- */
.fb-tag-btn {
    border-radius: 14px; padding: 4px 12px;
    font-size: 12px; font-weight: 500;
    transition: all .2s;
}
.fb-tag-btn:hover { transform: translateY(-1px); }

/* ----- 13. 搜索栏优化 ----- */
.search-bar input,
.search-bar select {
    border-radius: 10px !important;
    border: 1.5px solid var(--border-color) !important;
    transition: border-color .2s, box-shadow .2s;
}
.search-bar input:focus,
.search-bar select:focus {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 3px rgba(255,122,69,0.12) !important;
}

/* ----- 14. 内联统计文字 ----- */
.grade-total-inline {
    font-size: 13px; color: var(--text-muted); font-weight: 500;
    margin-left: auto; padding: 4px 12px;
    background: var(--bg-secondary); border-radius: 8px;
}
.grade-total-inline b { color: var(--primary-color); font-weight: 700; }

/* ----- 15. 复选框列表优化 ----- */
.student-check-list {
    border: 1.5px solid var(--border-color) !important;
    border-radius: 10px !important;
    background: var(--bg-secondary) !important;
}
.student-check-list label {
    padding: 8px 10px; border-radius: 8px;
    transition: background .15s;
}
.student-check-list label:hover {
    background: var(--primary-light);
}
.student-check-list input[type="checkbox"]:checked + span {
    color: var(--primary-color); font-weight: 600;
}

/* ----- 16. Toast 优化 ----- */
.toast {
    border-radius: 12px; padding: 12px 20px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
}

/* ----- 17. 主按钮渐变 ----- */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), #c2410c);
    box-shadow: 0 2px 8px rgba(255,122,69,0.25);
}
.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-hover), #9a3412);
    box-shadow: 0 4px 14px rgba(255,122,69,0.35);
}
.btn-danger {
    background: linear-gradient(135deg, var(--danger-color), #dc2626);
    box-shadow: 0 2px 8px rgba(239,68,68,0.2);
}
.btn-danger:hover { box-shadow: 0 4px 14px rgba(239,68,68,0.3); }

/* ----- 18. 表单内 textarea ----- */
.modal-content textarea {
    resize: vertical; min-height: 38px; line-height: 1.6;
}

/* ----- 19. 滚动条暗色适配 ----- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ----- 20. select 下拉暗色适配 ----- */
select option {
    background: var(--card-bg); color: var(--text-primary);
}

/* ----- 21. 登录页暗色适配 ----- */
.login-overlay {
    background: linear-gradient(135deg, var(--bg-color) 0%, var(--sidebar-bg) 100%);
}
.login-card {
    background: var(--card-bg); border: 1px solid var(--border-color);
}
.login-header h1 { color: var(--text-primary); }
.login-hint {
    background: var(--bg-secondary); color: var(--text-muted);
}

/* ==================== SVG 图标统一样式 ==================== */

/* 页面大标题图标 */
.title-icon {
    width: 22px; height: 22px;
    vertical-align: -4px; margin-right: 6px; flex-shrink: 0;
}

/* 视图切换按钮图标 */
.view-icon {
    width: 14px; height: 14px;
    vertical-align: -2px; margin-right: 3px; flex-shrink: 0;
}

/* 表单标签图标 */
.lbl-icon {
    width: 16px; height: 16px;
    vertical-align: -3px; margin-right: 4px; flex-shrink: 0;
}

/* 按钮内图标 */
.btn-icon {
    width: 16px; height: 16px;
    vertical-align: -3px; margin-right: 4px; flex-shrink: 0;
}

/* JS动态生成的图标（课程详情、智能排课等） */
.js-icon {
    width: 16px; height: 16px;
    vertical-align: -3px; margin-right: 4px; flex-shrink: 0;
}

/* 页面标题 flex 布局 */
.page-title {
    display: flex; align-items: center;
}

/* ==================== 收支管理页面 ==================== */

/* 收支概览卡片 */
.expense-overview {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
    margin-bottom: 20px;
}
.expense-card {
    background: var(--card-bg); border: 1px solid var(--border-color);
    border-radius: 12px; padding: 24px 20px;
}
.expense-card .expense-card-label {
    font-size: 13px; color: var(--text-secondary); margin-bottom: 10px;
    display: flex; align-items: center; gap: 6px;
}
.expense-card .expense-card-label svg { width:16px; height:16px; }
.expense-card .expense-card-value {
    font-size: 32px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.expense-card.income .expense-card-value { color: #34d399; }
.expense-card.expense .expense-card-value { color: #f87171; }
.expense-card.net.net-positive { border-color: rgba(52,211,153,0.25); background: linear-gradient(135deg, rgba(52,211,153,0.06) 0%, rgba(52,211,153,0.01) 100%); }
.expense-card.net.net-positive .expense-card-value { color: #34d399; }
.expense-card.net.net-negative { border-color: rgba(248,113,113,0.25); background: linear-gradient(135deg, rgba(248,113,113,0.06) 0%, rgba(248,113,113,0.01) 100%); }
.expense-card.net.net-negative .expense-card-value { color: #f87171; }

/* 收支眼睛切换按钮 */
.expense-card.income .income-toggle-btn {
    background: none; border: none; cursor: pointer; padding: 2px;
    margin-left: auto; display: flex; align-items: center;
}
.expense-card.income .income-toggle-btn svg { width: 16px; height: 16px; color: var(--text-muted); }
.expense-card.income .income-toggle-btn:hover svg { color: var(--primary-color); }

/* 饼图区域 */
.expense-chart-section {
    background: var(--card-bg); border: 1px solid var(--border-color);
    border-radius: 12px; padding: 20px 24px; margin-bottom: 20px;
}
.expense-chart-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 16px;
}
.expense-chart-header h3 { font-size: 15px; color: var(--text-primary); margin: 0; font-weight: 600; }
.expense-chart-tabs { display: flex; gap: 4px; }
.expense-chart-tab {
    background: transparent; border: 1px solid var(--border-color);
    color: var(--text-secondary); padding: 4px 12px; border-radius: 6px;
    cursor: pointer; font-size: 13px; transition: all 0.2s;
}
.expense-chart-tab.active { background: var(--primary-color); color: #fff; border-color: var(--primary-color); }
.expense-chart-tab:hover:not(.active) { border-color: var(--primary-color); color: var(--primary-color); }
.expense-chart-body { display: flex; align-items: center; gap: 32px; min-height: 140px; }
.expense-chart-canvas { flex: 0 0 200px; height: 200px; display: flex; align-items: center; justify-content: center; }
.expense-chart-legend { flex: 1; min-width: 0; }
.pie-legend-item {
    display: flex; align-items: center; gap: 10px; padding: 5px 0;
    font-size: 13px; color: var(--text-primary);
}
.pie-legend-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.pie-legend-label { flex: 1; color: var(--text-secondary); }
.pie-legend-value { font-weight: 600; font-variant-numeric: tabular-nums; }
.pie-legend-pct { color: var(--text-muted); font-size: 12px; min-width: 40px; text-align: right; }

/* 支出列表 */
.expense-list-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 12px; flex-wrap: wrap; gap: 8px;
}
.expense-list-header h3 { font-size: 15px; color: var(--text-primary); margin: 0; font-weight: 600; }
.expense-list-filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.expense-list-filters select,
.expense-list-filters input[type="date"] {
    background: var(--bg-secondary); border: 1px solid var(--border-color);
    color: var(--text-primary); padding: 6px 10px; border-radius: 6px;
    font-size: 13px; font-family: inherit;
}
.expense-list-filters input[type="date"] { width: 130px; }
#expense-table { width: 100%; }
#expense-table td, #expense-table th { padding: 10px 14px; }
#expense-table td { font-size: 14px; }
.expense-cat-tag {
    display: inline-block; padding: 3px 10px; border-radius: 10px;
    font-size: 12px; color: #fff; white-space: nowrap;
}
.expense-cat-tag.cat-venue { background: #ff7a45; }
.expense-cat-tag.cat-transport { background: #3b82f6; }
.expense-cat-tag.cat-meal { background: #f59e0b; }
.expense-cat-tag.cat-referral { background: #8b5cf6; }
.expense-cat-tag.cat-other { background: #64748b; }
.expense-amount-col { font-weight: 600; color: var(--text-primary); }
.expense-desc-col { max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-secondary); }

/* 小按钮 */
.btn-sm { padding: 5px 12px; font-size: 13px; border-radius: 6px; }
.btn-icon-only {
    background: none; border: none; color: var(--text-secondary);
    cursor: pointer; padding: 4px; border-radius: 4px; transition: all 0.2s;
}
.btn-icon-only:hover { color: var(--primary-color); background: rgba(255,122,69,0.1); }
.btn-icon-only svg { width: 16px; height: 16px; display: block; }
.btn-icon-danger:hover { color: #f87171; background: rgba(248,113,113,0.1); }

@media (max-width: 768px) {
    .expense-overview { grid-template-columns: 1fr; }
    .expense-chart-body { flex-direction: column; }
    .expense-list-header { flex-direction: column; align-items: flex-start; gap: 8px; }
    .expense-list-filters { flex-wrap: wrap; }
}
