/* 基础变量 */
:root {
    --primary-color: #0071e3;
    --primary-hover: #005bbf;
    --secondary-color: #64748b;
    --success-color: #0a7f45;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --info-color: #3b82f6;
    --background: #eef2f7;
    --surface: #ffffff;
    --surface-soft: rgba(255, 255, 255, 0.72);
    --surface-tint-blue: linear-gradient(135deg, rgba(0, 113, 227, 0.07) 0%, rgba(255, 255, 255, 0.90) 60%, rgba(255, 255, 255, 0.95) 100%);
    --surface-tint-green: linear-gradient(135deg, rgba(10, 127, 69, 0.06) 0%, rgba(255, 255, 255, 0.90) 60%, rgba(255, 255, 255, 0.95) 100%);
    --surface-tint-purple: linear-gradient(135deg, rgba(99, 102, 241, 0.06) 0%, rgba(255, 255, 255, 0.90) 60%, rgba(255, 255, 255, 0.95) 100%);
    --surface-tint-orange: linear-gradient(135deg, rgba(245, 158, 11, 0.06) 0%, rgba(255, 255, 255, 0.90) 60%, rgba(255, 255, 255, 0.95) 100%);
    --border: rgba(15, 23, 42, 0.08);
    --border-strong: rgba(15, 23, 42, 0.14);
    --text-primary: #1d1d1f;
    --text-secondary: #515154;
    --text-muted: #86868b;
    --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.05);
    --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
    --shadow-md: 0 16px 40px rgba(15, 23, 42, 0.12);
    --shadow-lg: 0 24px 60px rgba(15, 23, 42, 0.14);
    --radius: 10px;
    --radius-lg: 16px;
    --radius-xl: 22px;
}

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

[hidden] {
    display: none !important;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background:
        radial-gradient(circle at 12% 0%, rgba(0, 113, 227, 0.12), transparent 28%),
        radial-gradient(circle at 92% 8%, rgba(10, 127, 69, 0.08), transparent 22%),
        linear-gradient(180deg, #f8fafd 0%, #eef2f7 54%, #e8edf4 100%);
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    padding: 24px;
}

/* 容器 */
.dashboard-container {
    max-width: 1600px;
    margin: 0 auto;
}

.kanban-shell {
    display: grid;
    gap: 20px;
}

.dashboard-topbar {
    padding: 14px 20px 12px;
}

.topbar-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(520px, auto);
    align-items: center;
    gap: 16px;
}

.topbar-brand {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

.brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #1677ff 0%, #0958d9 100%);
    color: #fff;
    font-size: 22px;
    font-weight: 800;
    box-shadow: 0 16px 28px rgba(22, 119, 255, 0.24);
    flex: 0 0 auto;
}

.topbar-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.topbar-actions-compact {
    gap: 10px;
    flex-wrap: nowrap;
}

.topbar-statuses {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.topbar-login-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.login-status {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid rgba(226, 232, 240, 0.95);
    background: rgba(255, 255, 255, 0.88);
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.debug-bar {
    display: none;
    margin-top: 8px;
    font-size: 12px;
    color: #475569;
    gap: 12px;
    flex-wrap: wrap;
}

.status-strip-item {
    min-width: 0;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(226, 232, 240, 0.9);
    background: rgba(255, 255, 255, 0.74);
}

.status-strip-item span {
    display: block;
    color: var(--text-muted);
    font-size: 11px;
}

.status-strip-item strong {
    display: block;
    margin-top: 4px;
    color: var(--text-primary);
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.compact-status-item {
    min-width: 122px;
    padding: 5px 9px;
    background: rgba(255, 255, 255, 0.88);
}

.compact-status-item span {
    font-size: 10px;
}

.compact-status-item strong {
    margin-top: 2px;
    font-size: 11px;
}

.page-version-inline {
    margin-top: 2px;
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 0 8px;
    border-radius: 999px;
    background: rgba(22, 119, 255, 0.08);
    color: #1677ff;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.workspace-shell {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.workspace-sider {
    position: sticky;
    top: 24px;
    display: grid;
    gap: 10px;
    padding: 18px 16px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.62);
    background: rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(24px);
    box-shadow: var(--shadow-sm);
}

.workspace-sider-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.workspace-nav-item {
    min-height: 44px;
    border-radius: 12px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-secondary);
    font: inherit;
    font-weight: 700;
    text-align: left;
    padding: 0 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.workspace-nav-item:hover {
    background: rgba(22, 119, 255, 0.06);
    color: #1677ff;
}

.workspace-nav-item.active {
    background: linear-gradient(135deg, rgba(22, 119, 255, 0.12) 0%, rgba(9, 88, 217, 0.08) 100%);
    color: #1677ff;
    border-color: rgba(22, 119, 255, 0.18);
    box-shadow: inset 0 0 0 1px rgba(22, 119, 255, 0.04);
}

.workspace-main {
    min-width: 0;
}

.kanban-page {
    display: none;
    min-width: 0;
}

.kanban-page.active {
    display: block;
}

/* 头部 */
.dashboard-header {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.86) 0%, rgba(247, 250, 255, 0.92) 58%, rgba(240, 247, 255, 0.94) 100%);
    backdrop-filter: blur(24px);
    border-radius: 18px;
    padding: 30px 38px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(255, 255, 255, 0.56);
    position: relative;
    overflow: hidden;
}

.dashboard-header::after {
    content: '';
    position: absolute;
    inset: auto -10% -55% 40%;
    height: 220px;
    background: radial-gradient(circle, rgba(0, 113, 227, 0.10), transparent 68%);
    pointer-events: none;
}

.header-content {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, 520px);
    gap: 18px;
    align-items: start;
    position: relative;
    z-index: 1;
}

.header-main {
    min-width: 0;
}

#kanbanLoginBar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.kanban-auth-btn {
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    color: var(--text-primary);
    min-height: 30px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.kanban-auth-btn:hover {
    border-color: rgba(59, 130, 246, 0.42);
    color: #1d4ed8;
}

.sync-refresh-btn {
    border-color: rgba(148, 163, 184, 0.34);
}

.dashboard-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 12px;
}

.title-icon {
    font-size: 30px;
}

.dashboard-subtitle {
    display: none;
}

.school-sync-panel {
    border: 1px solid rgba(148, 163, 184, 0.26);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.76);
    padding: 10px;
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
}

.school-sync-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.school-sync-head strong {
    display: block;
    font-size: 13px;
    color: var(--text-primary);
}

.school-sync-head span {
    display: block;
    margin-top: 2px;
    color: var(--text-secondary);
    font-size: 11px;
}

.school-sync-head button {
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    background: #eff6ff;
    color: #1d4ed8;
    font-weight: 700;
    font-size: 12px;
    padding: 6px 10px;
    cursor: pointer;
    white-space: nowrap;
}

.modal-shell {
    position: fixed;
    inset: 0;
    z-index: 22000;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(15, 23, 42, 0.32);
    backdrop-filter: blur(8px);
}

.modal-card {
    width: min(920px, 100%);
    max-height: calc(100vh - 48px);
    overflow: auto;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.24);
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 28px 64px rgba(15, 23, 42, 0.26);
}

.account-modal-head {
    position: sticky;
    top: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(255, 255, 255, 0.98);
}

.account-modal-head h2,
.account-section-title h3 {
    margin: 0;
    color: var(--text-primary);
}

.account-modal-head p,
.account-section-title span,
.province-picker-head span {
    margin: 4px 0 0;
    color: var(--text-secondary);
    font-size: 12px;
}

.account-layout {
    display: grid;
    grid-template-columns: minmax(320px, 0.9fr) minmax(360px, 1.1fr);
    gap: 16px;
    padding: 16px;
    background: rgba(241, 245, 249, 0.68);
}

.account-editor,
.account-list-panel {
    min-width: 0;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 14px;
    background: #fff;
    padding: 14px;
}

.account-section-title,
.province-picker-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.account-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 14px;
}

.account-form label {
    display: grid;
    gap: 7px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 700;
}

.account-form label:nth-child(3) {
    grid-column: 1 / -1;
}

.account-inline-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.province-picker {
    width: 100%;
    min-height: 220px;
    padding: 8px;
    border: 1px solid rgba(148, 163, 184, 0.26);
    border-radius: 12px;
    background: #fff;
    color: var(--text-primary);
}

.account-save-btn {
    width: 100%;
    border: none;
    border-radius: 12px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #fff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.sub-account-list {
    display: grid;
    gap: 10px;
}

.sub-account-item {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    padding: 12px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 12px;
    background: #fff;
}

.sub-account-item strong,
.sub-account-item span {
    display: block;
}

.sub-account-item span {
    margin-top: 4px;
    font-size: 12px;
    color: var(--text-secondary);
}

.school-detail-card {
    width: min(1440px, calc(100vw - 48px));
}

.school-detail-metrics {
    display: grid;
    /* 7 个指标固定单行 */
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 10px;
    padding: 16px 20px 0;
}

.school-detail-table-wrapper {
    margin: 16px 20px 20px;
    max-height: calc(100vh - 260px);
}

.account-role-pill {
    display: inline-flex;
    align-items: center;
    margin-bottom: 8px;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.12);
    color: #1d4ed8;
    font-size: 11px;
    font-weight: 700;
}

.school-sync-status-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.school-sync-status-item {
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 8px;
    background: rgba(248, 250, 252, 0.86);
    padding: 8px;
    min-width: 0;
}

.school-sync-status-item span {
    display: block;
    color: var(--text-muted);
    font-size: 11px;
    line-height: 1.2;
}

.school-sync-status-item strong {
    display: block;
    margin-top: 4px;
    color: var(--text-primary);
    font-size: 12px;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 通用区块标题 */
.section-header {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.section-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: 0.01em;
}

.section-icon {
    font-size: 20px;
    opacity: 0.92;
}

/* 学校备注：校弹窗内输入区 + 列表，趋势下方动态流 */
.school-note-box {
    margin: 0 0 16px;
    padding: 14px 16px;
    border: 1px solid var(--border-color, #e6e6e6);
    border-radius: 12px;
    background: var(--surface-2, #fafafa);
}
.school-note-box[hidden] { display: none; }
.school-note-input-row { display: flex; gap: 12px; align-items: flex-start; }
.school-note-input {
    flex: 1 1 auto;
    min-width: 0;
    resize: vertical;
    border: 1px solid var(--border-color, #d5d5d5);
    border-radius: 8px;
    padding: 8px 10px;
    font: inherit;
    font-size: 13px;
    line-height: 1.5;
}
.school-note-input:focus { outline: none; border-color: #1473e6; }
.school-note-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: 0 0 auto; }
.school-note-count { font-size: 12px; color: #98a2b3; }
.school-note-list { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; max-height: 200px; overflow-y: auto; }
.school-note-empty { font-size: 13px; color: #98a2b3; padding: 8px 0; }
.school-note-item {
    padding: 8px 12px;
    border-radius: 8px;
    background: #fff;
    border: 1px solid var(--border-color, #eee);
}
.school-note-item-head { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.school-note-item-school { font-weight: 700; font-size: 13px; color: var(--text-primary, #1f2329); }
.school-note-item-text { font-size: 13px; line-height: 1.5; color: var(--text-primary, #2c2c2c); white-space: pre-wrap; word-break: break-word; }
.school-note-item-meta { font-size: 12px; color: #98a2b3; white-space: nowrap; }
.school-note-feed { display: flex; flex-direction: column; gap: 8px; max-height: 360px; overflow-y: auto; padding: 4px 0; }
.note-open-btn {
    border: 1px solid #d5d5d5;
    background: #fff;
    border-radius: 6px;
    padding: 2px 10px;
    font-size: 12px;
    cursor: pointer;
    color: #1473e6;
}
.note-open-btn:hover { border-color: #1473e6; background: #f0f6ff; }
@media (max-width: 768px) {
    .school-note-input-row { flex-direction: column; }
    .school-note-actions { flex-direction: row; align-self: stretch; justify-content: space-between; }
}

/* 单校价值洞察栏：位于「班级数据明细」标题与导出按钮之间，字号偏小，不影响下方表格高度 */
.school-insight-bar {
    flex: 1 1 0;
    min-width: 0;
    margin: 0 18px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    line-height: 1.45;
    color: var(--text-secondary, #5a6472);
}
.school-insight-bar[hidden] { display: none; }
.school-insight-bar .sib-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.school-insight-bar .sib-tag {
    flex: 0 0 auto;
    font-weight: 700;
    color: var(--text-primary, #1f2329);
    background: rgba(20, 115, 230, 0.08);
    border-radius: 6px;
    padding: 1px 7px;
}
.school-insight-bar .sib-text {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}
.school-insight-bar .sib-strong { color: #1473e6; font-weight: 700; }
.school-insight-bar .sib-up { color: #10b981; font-weight: 700; }
.school-insight-bar .sib-down { color: #ef4444; font-weight: 700; }
.school-insight-bar .sib-muted { color: #98a2b3; }
@media (max-width: 768px) {
    .school-insight-bar { margin: 8px 0 0; font-size: 11px; }
    .school-insight-bar .sib-row { white-space: normal; }
}

/* 上传区域 */
.upload-section {
    background: rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(24px);
    border-radius: 8px;
    padding: 28px;
    margin-bottom: 24px;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--border);
}

.upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 48px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.02) 0%, rgba(168, 85, 247, 0.02) 100%);
}

.upload-area:hover,
.upload-area.dragover {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(168, 85, 247, 0.08) 100%);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.upload-icon {
    font-size: 56px;
    margin-bottom: 16px;
    opacity: 0.8;
}

.upload-area h3 {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.upload-area p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.upload-hint {
    color: var(--text-muted);
    font-size: 12px;
}

/* 已上传周次列表 */
.uploaded-weeks {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.weeks-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.weeks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

.week-card {
    background: linear-gradient(135deg, var(--surface) 0%, #f8fafc 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s;
    cursor: pointer;
}

.week-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}

.week-card.active {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.05) 0%, rgba(37, 99, 235, 0.02) 100%);
}

.week-info {
    flex: 1;
}

.week-date {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.week-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.week-stats {
    text-align: right;
}

.week-stat-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-color);
}

.week-stat-label {
    font-size: 11px;
    color: var(--text-muted);
}

.week-delete {
    margin-left: 12px;
    padding: 6px;
    background: transparent;
    border: none;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s;
    font-size: 16px;
}

.week-delete:hover {
    opacity: 1;
}

.filter-section {
    margin-bottom: 24px;
    background: var(--surface-tint-blue);
    backdrop-filter: blur(22px);
    border: 1px solid rgba(255, 255, 255, 0.62);
    border-radius: 18px;
    padding: 24px 24px 18px;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.filter-section::before {
    content: '';
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: linear-gradient(180deg, rgba(0, 113, 227, 0.78), rgba(59, 130, 246, 0.34));
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

#assignmentCountSelect {
    min-width: 0;
}

@media (max-width: 1200px) {
    .header-content {
        grid-template-columns: 1fr;
    }

    .topbar-main {
        grid-template-columns: 1fr;
        justify-items: start;
    }

    .topbar-actions,
    .topbar-actions-compact {
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .topbar-statuses {
        justify-content: flex-start;
    }

    .workspace-shell {
        grid-template-columns: 1fr;
    }

    .workspace-sider {
        position: static;
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .filter-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .search-mode-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .school-sync-status-grid {
        grid-template-columns: 1fr;
    }

    .topbar-statuses,
    .topbar-login-actions {
        width: 100%;
    }

    .workspace-sider {
        grid-template-columns: 1fr;
    }

    .filter-grid {
        grid-template-columns: 1fr;
    }
    .filter-group:nth-child(1) {
        grid-column: span 1;
    }
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.filter-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
    text-transform: none;
    letter-spacing: 0;
}

.label-icon {
    font-size: 12px;
}

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

.date-input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 13px;
    background: var(--surface);
    color: var(--text-primary);
    transition: all 0.2s;
}

.date-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.date-separator {
    color: var(--text-muted);
    font-size: 13px;
}

.filter-select {
    padding: 8px 10px;
    border: 1px solid rgba(15, 23, 42, 0.09);
    border-radius: 10px;
    font-size: 12px;
    background: rgba(255, 255, 255, 0.82);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 18px;
    padding-right: 30px;
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.filter-select:disabled {
    background: var(--background);
    cursor: not-allowed;
    color: var(--text-muted);
}

.multi-source-select {
    display: none;
}

.multi-select {
    position: relative;
    width: 100%;
    min-width: 160px;
}

.multi-select-trigger {
    width: 100%;
    min-height: 32px;
    box-sizing: border-box;
    border: 1px solid rgba(15, 23, 42, 0.09);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.82);
    color: var(--text-primary);
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 0 10px;
    cursor: pointer;
}

.multi-select-menu {
    display: none;
    position: absolute;
    z-index: 50;
    top: calc(100% + 6px);
    left: 0;
    width: min(320px, 80vw);
    max-height: 240px;
    overflow: auto;
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.16);
    padding: 8px;
}

.multi-select.open .multi-select-menu {
    display: grid;
    gap: 4px;
}

.multi-select-menu label {
    min-height: 30px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 6px;
    border-radius: 6px;
    font-size: 13px;
    white-space: nowrap;
    cursor: pointer;
}

.multi-select-menu label:hover {
    background: #f1f5f9;
}

.filter-actions-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 0;
    border-top: 0;
}

.filter-status {
    margin-left: auto;
    font-size: 12px;
    color: var(--text-muted);
    letter-spacing: 0.01em;
}

.filter-status strong {
    color: var(--primary-color);
    font-size: 14px;
}

.btn {
    padding: 8px 14px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.22s ease;
    backdrop-filter: blur(10px);
}

.btn-primary {
    background: linear-gradient(135deg, #0a84ff 0%, #0068d6 100%);
    color: white;
    box-shadow: 0 10px 20px rgba(0, 113, 227, 0.16);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.78);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

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

.btn-danger {
    background: rgba(255, 255, 255, 0.78);
    color: var(--danger-color);
    border: 1px solid rgba(239, 68, 68, 0.16);
}

.btn-danger:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(239, 68, 68, 0.4);
}

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

.btn-icon {
    font-size: 15px;
}

.btn-export {
    background: linear-gradient(135deg, var(--success-color) 0%, #059669 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
}

.btn-export:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.4);
}

/* 指标卡片 */
.metrics-section {
    margin-bottom: 24px;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.metric-card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.90) 0%, rgba(247, 250, 255, 0.88) 100%);
    backdrop-filter: blur(22px);
    border-radius: 18px;
    padding: 18px 18px 16px;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(255, 255, 255, 0.62);
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
}

.metric-card::before {
    content: '';
    position: absolute;
    top: 14px;
    bottom: 14px;
    left: 0;
    width: 4px;
    border-radius: 0 8px 8px 0;
    background: linear-gradient(180deg, var(--primary-color), var(--info-color));
    opacity: 0.95;
    transition: opacity 0.3s;
}

.metric-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.metric-card.metric-primary::before {
    opacity: 1;
}

.metric-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    padding-left: 10px;
}

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

.metric-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.45px;
}

.metric-value {
    font-size: 30px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
    line-height: 1.15;
    padding-left: 10px;
}

.metric-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    padding-left: 10px;
}

/* 图表区域 */
.charts-section {
    margin-bottom: 24px;
}

.charts-section .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.trend-toggle-btn {
    padding: 8px 14px;
    min-width: 64px;
}

.charts-section.is-collapsed .trend-content {
    display: none;
}

.charts-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

.chart-card {
    background: var(--surface-tint-green);
    backdrop-filter: blur(22px);
    border-radius: 18px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(255, 255, 255, 0.62);
    position: relative;
    overflow: hidden;
}

.chart-card::before {
    content: '';
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: linear-gradient(180deg, rgba(10, 127, 69, 0.72), rgba(16, 185, 129, 0.28));
}

.chart-card-wide {
    grid-column: 1 / -1;
}

.chart-header {
    margin-bottom: 16px;
}

.chart-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
    letter-spacing: 0.01em;
}

.chart-subtitle {
    font-size: 12px;
    color: var(--text-muted);
}

.chart-container {
    height: 320px;
    width: 100%;
}

/* 表格区域 */
.table-section {
    margin-bottom: 24px;
}

/* 高价值学校年级区域 */
.high-value-section {
    margin-bottom: 24px;
    background: var(--surface-tint-purple);
    backdrop-filter: blur(22px);
    border-radius: 18px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(255, 255, 255, 0.62);
    position: relative;
    overflow: hidden;
}

.high-value-section::before {
    content: '';
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: linear-gradient(180deg, rgba(99, 102, 241, 0.74), rgba(129, 140, 248, 0.24));
}

.high-value-filters {
    margin-bottom: 8px;
}

.filter-row {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 10px;
}

.filter-row .filter-group {
    min-width: 0;
}

.filter-actions {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

.high-value-table-wrapper {
    max-height: 500px;
    overflow: auto;
    background: white;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.high-value-info {
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-muted);
    text-align: right;
}

.hv-data-table {
    min-width: 1320px;
}

.charts-grid-single {
    grid-template-columns: 1fr;
}

.favorite-page-section {
    margin-bottom: 20px;
}

.school-link {
    border: none;
    padding: 0;
    background: transparent;
    color: #1677ff;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
}

.school-link:hover {
    color: #0958d9;
    text-decoration: underline;
}

.favorite-toggle {
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    color: #faad14;
}

.high-value-insights {
    margin: 0 0 16px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.74);
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 10px;
    color: var(--text);
}

.high-value-insights:empty {
    display: none;
}

.high-value-insights .insight-title {
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 700;
}

.high-value-insights ul {
    margin: 0;
    padding-left: 18px;
}

.high-value-insights li {
    margin: 4px 0;
    line-height: 1.6;
}

.high-value-insights .insight-empty {
    color: var(--text-muted);
    font-size: 13px;
}

/* 学校定义标签样式 */
.school-category-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}
.school-category-badge.paid {
    background: #d1fae5;
    color: #065f46;
}
.school-category-badge.needs-improvement {
    background: #fef3c7;
    color: #92400e;
}
.school-category-badge.trial {
    background: #f3f4f6;
    color: #374151;
}

.high-value-section .section-header {
    margin-bottom: 16px;
}

.table-actions {
    display: flex;
    gap: 8px;
}

.table-wrapper {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.92) 0%, rgba(250, 252, 255, 0.90) 100%);
    backdrop-filter: blur(22px);
    border-radius: 18px;
    overflow: auto;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(255, 255, 255, 0.62);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-table th,
.data-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.data-table th {
    background: linear-gradient(180deg, #f6f9fd 0%, #edf3fa 100%);
    font-weight: 700;
    color: #516070;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.55px;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.2s;
}

.table-wrapper .data-table thead th,
.high-value-table-wrapper .data-table thead th {
    position: sticky;
    top: 0;
    z-index: 5;
    box-shadow: inset 0 -1px 0 rgba(148, 163, 184, 0.18);
}

.detail-total-row td,
.high-value-total-row td {
    position: sticky;
    bottom: 0;
    z-index: 4;
    background: #fff7e6;
    font-weight: 700;
    box-shadow: inset 0 1px 0 rgba(250, 173, 20, 0.24);
}

.data-table th:hover {
    background: #e2e8f0;
}

.data-table th.sortable::after {
    content: '⇅';
    margin-left: 6px;
    opacity: 0.3;
}

.data-table th.sortable.asc::after {
    content: '↑';
    opacity: 1;
}

.data-table th.sortable.desc::after {
    content: '↓';
    opacity: 1;
}

.data-table tbody tr {
    transition: background 0.2s;
}

.data-table tbody tr:hover {
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.03) 0%, rgba(37, 99, 235, 0.05) 100%);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.data-table tbody td {
    color: var(--text-primary);
}

/* 自定义重点校区块补充弱着色 */
#customSchoolSection {
    background: var(--surface-tint-orange);
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.62);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

#customSchoolSection::before {
    content: '';
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: linear-gradient(180deg, rgba(245, 158, 11, 0.76), rgba(251, 191, 36, 0.25));
}

#customSchoolSection .section-header,
#customSchoolSection .custom-school-content,
#customSchoolSection .filter-actions,
#customSchoolSection .filter-row,
#customSchoolSection .table-wrapper,
#customSchoolSection textarea,
#customSchoolSection .search-input-wrapper {
    position: relative;
    z-index: 1;
}

/* 空状态 */
.empty-state {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-xl);
    padding: 80px 24px;
    text-align: center;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.empty-icon {
    font-size: 72px;
    margin-bottom: 24px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.empty-hint {
    color: var(--text-muted);
    font-size: 13px;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }

    .chart-card-wide {
        grid-column: 1;
    }
}

@media (max-width: 768px) {
    body {
        padding: 12px;
    }

    .dashboard-header {
        padding: 20px;
    }

    .dashboard-title {
        font-size: 20px;
    }

    .filter-grid {
        grid-template-columns: 1fr;
    }

    .filter-actions-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .search-mode-grid,
    .school-select-combo {
        grid-template-columns: 1fr;
    }

    .filter-status {
        margin-left: 0;
        text-align: center;
    }

    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .weeks-grid {
        grid-template-columns: 1fr;
    }

    .school-detail-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 480px) {
    .metrics-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .compact-status-item {
        min-width: 0;
        flex: 1 1 100%;
    }
}

/* v3 single-column workspace overrides */
.workspace-shell {
    display: block;
}

.workspace-sider {
    position: sticky;
    top: 24px;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    margin-bottom: 16px;
    overflow-x: auto;
}

.workspace-sider-title {
    flex: 0 0 auto;
    margin-right: 4px;
    letter-spacing: 0;
    text-transform: none;
}

.workspace-nav-item {
    min-height: 36px;
    border-radius: 10px;
    padding: 0 16px;
    white-space: nowrap;
    flex: 0 0 auto;
}

.workspace-main {
    min-width: 0;
}

.kanban-page {
    min-width: 0;
}

.toolbar-section,
.charts-section,
.table-section,
.metrics-section,
.custom-school-section,
.favorite-page-section {
    background: rgba(255, 255, 255, 0.86);
    backdrop-filter: blur(18px);
    border: 1px solid rgba(255, 255, 255, 0.62);
    border-radius: 18px;
    box-shadow: var(--shadow-sm);
    padding: 12px 14px 12px;
    margin-bottom: 10px;
}

.toolbar-section::before,
.favorite-page-section::before,
.custom-school-section::before {
    display: none;
}

/* 需求1：取消筛选区固定，随页面自然滚动，最大化结果区 */
/* overflow:visible + z-index：学校下拉弹层锚定在字段下方，不被本区裁剪、不被下方表格吸顶表头盖住 */
.toolbar-section {
    position: relative;
    z-index: 20;
    overflow: visible;
}

/* 需求2：折叠头部改为 Ant 卡片式标题栏，标题左 / 收起链接右，不再空占一行 */
.toolbar-section .section-header,
.custom-school-section > .section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 0 8px;
    margin-bottom: 10px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.toolbar-section .section-title,
.custom-school-section > .section-header .section-title {
    display: flex;
    margin: 0;
    font-size: 15px;
}

/* 数据筛选：模式切换并入头部行，左切换 / 右收起 */
.filter-toolbar-header {
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.filter-toolbar-header .search-mode-toggle {
    margin-bottom: 0;
}

.table-section {
    padding: 0;
    overflow: hidden;
}

.table-section .section-header,
.metrics-section .section-header,
.charts-section .section-header,
.favorite-page-section .section-header,
.custom-school-section .section-header {
    padding: 0 0 10px;
    margin-bottom: 10px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.table-section .section-header {
    padding: 14px 18px 10px;
    margin-bottom: 0;
}

.compact-section-header {
    margin-bottom: 0;
}

.table-section .table-wrapper,
.table-section .high-value-table-wrapper {
    border-top: 1px solid rgba(15, 23, 42, 0.06);
}

.section-title {
    font-size: 16px;
}

.section-icon {
    font-size: 18px;
}

.collapsible-content.is-collapsed {
    display: none !important;
}

/* 需求2/5：收起为 Ant 链接式按钮，弱化、不抢占空间 */
.collapse-toggle-btn {
    min-width: 0;
    flex: 0 0 auto;
    padding: 2px 6px;
    border: 0;
    background: transparent;
    box-shadow: none;
    color: var(--primary-color);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.5;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.18s, color 0.18s;
}

.collapse-toggle-btn::after {
    content: '▾';
    margin-left: 4px;
    font-size: 10px;
}

.collapse-toggle-btn[aria-expanded="false"]::after {
    content: '▸';
}

.collapse-toggle-btn:hover {
    color: var(--primary-hover, #1668dc);
    background: rgba(37, 99, 235, 0.08);
}

.search-mode-toggle {
    display: inline-flex;
    margin-bottom: 8px;
    padding: 6px;
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.76);
}

.filter-grid {
    gap: 10px;
    margin-bottom: 6px;
}

.filter-actions-bar,
.filter-actions,
.custom-school-actions {
    gap: 10px;
}

.high-value-filters {
    margin-bottom: 18px;
}

.high-value-insights {
    margin-bottom: 10px;
    padding: 8px 10px;
    font-size: 12px;
}

.high-value-table-wrapper {
    max-height: min(72vh, 820px);
}

.table-wrapper {
    max-height: min(74vh, 860px);
}

.charts-grid-single .chart-card {
    padding: 18px 20px 12px;
}

.chart-header {
    margin-bottom: 10px;
}

.chart-title {
    font-size: 16px;
    margin-bottom: 0;
}

.chart-subtitle {
    display: none;
}

.chart-container {
    height: 420px;
}

.high-value-trend-section .chart-container {
    height: 460px;
}

.custom-school-section {
    padding-top: 8px;
}

.trend-filter-row-collapsible {
    margin-bottom: 10px;
    padding: 10px 12px;
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.74);
}

.trend-filter-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.trend-filter-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
}

.trend-filter-fields {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.metrics-section {
    padding-top: 12px;
}

.metrics-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
}

.metric-card {
    min-width: 0;
    padding: 10px;
    border-radius: 12px;
}

.metric-header {
    margin-bottom: 8px;
    padding-left: 8px;
}

.metric-icon {
    font-size: 14px;
}

.metric-title {
    font-size: 11px;
    letter-spacing: 0.2px;
}

.metric-value {
    font-size: 18px;
    padding-left: 8px;
}

.metric-subtitle {
    padding-left: 8px;
    font-size: 10px;
}

.custom-school-panel {
    display: block;
}

.custom-school-input-wrap {
    margin-bottom: 8px;
}

.custom-school-filter-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.custom-school-textarea {
    min-height: 84px;
}

.custom-school-tabs {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.custom-school-result {
    margin-top: 0;
}

@media (max-width: 1200px) {
    .workspace-sider {
        top: 16px;
    }

    .toolbar-section {
        position: static;
    }

    .metrics-grid,
    .custom-school-filter-grid,
    .trend-filter-fields {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .chart-container,
    .high-value-trend-section .chart-container {
        height: 360px;
    }
}

@media (max-width: 768px) {
    .workspace-sider {
        align-items: flex-start;
        flex-wrap: nowrap;
    }

    .metrics-grid,
    .custom-school-filter-grid,
    .trend-filter-fields {
        grid-template-columns: 1fr;
    }

    .toolbar-section,
    .charts-section,
    .table-section,
    .metrics-section,
    .custom-school-section,
    .favorite-page-section {
        padding-left: 16px;
        padding-right: 16px;
    }

    .table-section .section-header {
        padding-left: 16px;
        padding-right: 16px;
    }
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid var(--border);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 动画效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.metric-card,
.chart-card,
.week-card {
    animation: fadeInUp 0.4s ease-out forwards;
}

/* 滚动条美化 */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #cbd5e1 0%, #94a3b8 100%);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #94a3b8 0%, #64748b 100%);
}

/* ========== v2.3 新增样式 ========== */

/* 搜索模式切换 */
.search-mode-toggle {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
    padding: 4px;
    background: rgba(255, 255, 255, 0.52);
    border: 1px solid rgba(255, 255, 255, 0.56);
    border-radius: 12px;
    width: fit-content;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.search-mode-grid {
    display: grid;
    grid-template-columns: minmax(260px, 2fr) repeat(2, minmax(140px, 1fr)) auto;
    gap: 10px;
    align-items: end;
}
/* 快速搜索：关键词输入框只与学段/年级筛选框等高对齐（原 .search-input 偏大，与下拉错位） */
.search-mode-grid .search-input {
    padding: 8px 12px;
    font-size: 12px;
    border-width: 1px;
    border-radius: 10px;
}

/* 需求3：可搜索学校下拉框（合并输入框与下拉，Ant Select showSearch 风格） */
.searchable-select {
    position: relative;
    width: 100%;
    min-width: 0;
}

.searchable-select-input {
    width: 100%;
    cursor: text;
}

.searchable-select-input::placeholder {
    color: var(--text-primary);
    opacity: 1;
}

.searchable-select.has-value .searchable-select-input::placeholder {
    color: var(--text-primary);
}

.searchable-select.is-open .searchable-select-input {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.searchable-select-popup {
    position: absolute;
    z-index: 60;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    padding: 4px;
    background: #fff;
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.16);
}

/* 列表首行：模糊搜索框（固定不滚动） */
.searchable-select-search {
    flex: 0 0 auto;
    padding: 2px 2px 6px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
    margin-bottom: 4px;
}

.searchable-select-search input {
    width: 100%;
    height: 30px;
    padding: 0 10px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 8px;
    font-size: 13px;
    background: #fff;
}

.searchable-select-search input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* 选项列表区（滚动在此层） */
.searchable-select-list {
    flex: 1 1 auto;
    max-height: 240px;
    overflow-y: auto;
}

.searchable-select-popup[hidden] {
    display: none;
}

.searchable-option {
    padding: 7px 10px;
    border-radius: 6px;
    font-size: 13px;
    color: var(--text-primary);
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.searchable-option:hover,
.searchable-option.is-active {
    background: rgba(37, 99, 235, 0.08);
}

.searchable-option.is-selected {
    color: var(--primary-color);
    font-weight: 600;
    background: rgba(37, 99, 235, 0.06);
}

.searchable-option-empty {
    padding: 10px;
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
    cursor: default;
}

.mode-btn {
    padding: 8px 14px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: 10px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.mode-btn:hover {
    background: var(--surface);
    color: var(--text-primary);
}

.mode-btn.active {
    background: linear-gradient(135deg, rgba(255,255,255,0.98), rgba(240,246,255,0.92));
    color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

/* 快速搜索模式 */
.search-mode {
    margin-bottom: 24px;
}

.search-input-wrapper {
    display: flex;
    gap: 12px;
    align-items: center;
}

.search-input {
    flex: 1;
    padding: 14px 20px;
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    font-size: 15px;
    transition: all 0.2s;
    background: var(--surface);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-hint {
    margin-top: 12px;
    font-size: 12px;
    color: var(--text-muted);
}

/* 已上传数据管理区域 */
.uploaded-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    padding: 32px;
    margin-top: 24px;
    box-shadow: var(--shadow-md);
}

.uploaded-section .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

/* 周次卡片复选框 */
.week-card {
    position: relative;
    display: flex;
    align-items: center;
    padding: 16px;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
}

.week-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.week-checkbox-wrapper {
    margin-right: 12px;
}

.week-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.week-card-content {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.week-card .week-delete {
    position: static;
    margin-left: 12px;
}

/* 时间段独立区域样式 */
.filter-section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 20px 0 12px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-section-title:first-child {
    margin-top: 0;
}

.date-range-wrapper {
    background: var(--background);
    padding: 16px;
    border-radius: var(--radius);
    margin-bottom: 16px;
}

.date-range-info {
    margin-top: 8px;
    color: var(--text-secondary);
}

.date-range-info small {
    font-size: 12px;
}


#highValueTable {
    table-layout: auto;
    width: max-content;
    min-width: 100%;
}

#highValueTable th,
#highValueTable td {
    white-space: nowrap;
    width: auto;
    padding: 8px 10px;
}

#highValueTable th {
    font-size: 11px;
}

#highValueTable td {
    font-size: 12px;
}


.upload-panel-grid {
    display: grid;
    grid-template-columns: minmax(320px, 420px) 1fr;
    gap: 20px;
    align-items: start;
}

.upload-entry-card,
.upload-weeks-card,
.custom-school-panel {
    background: rgba(248, 250, 252, 0.75);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
}

.subsection-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
}

.custom-school-section {
    margin-bottom: 24px;
}

.custom-school-textarea {
    width: 100%;
    min-height: 84px;
    resize: vertical;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 12px;
    line-height: 1.5;
    background: var(--surface);
    color: var(--text-primary);
}

.custom-school-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.custom-school-filter-grid {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    margin-top: 8px;
    align-items: end;
}

.custom-school-filter-grid .filter-group {
    flex: 1 1 0;
    min-width: 0;
}

.custom-school-filter-grid .filter-select {
    width: 100%;
}

.custom-school-actions,
.custom-school-tabs {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.custom-school-tabs {
    flex-wrap: wrap;
}

.favorite-toggle {
    border: none;
    background: none;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
}

.favorite-toggle:hover {
    transform: scale(1.08);
}

.hv-week-date {
    font-size: 10px;
    line-height: 1.05;
    min-width: 68px;
    padding-left: 3px;
    padding-right: 3px;
}

#highValueTable thead th {
    position: sticky;
    z-index: 4;
    background: linear-gradient(180deg, #f6f9fd 0%, #edf3fa 100%);
    box-shadow: inset 0 -1px 0 var(--border);
}

#highValueTable thead tr:first-child th {
    top: 0;
}

#highValueTable thead tr:nth-child(2) th {
    top: 30px;
    z-index: 5;
}

#highValueTable thead th.hv-sticky-static {
    top: 0;
    z-index: 6;
}

#highValueTable th.hv-week-group {
    text-align: center;
    font-size: 11px;
    letter-spacing: 0.4px;
}

#highValueTable th.hv-week-metric {
    min-width: 72px;
    text-align: center;
    font-size: 10px;
    letter-spacing: 0;
}

.high-value-total-row td {
    background: #eef6ff;
    border-top: 2px solid #93c5fd;
    color: #0f172a;
    font-weight: 700;
    position: sticky;
    bottom: 0;
    z-index: 7;
    box-shadow: 0 -2px 8px rgba(15, 23, 42, 0.08);
}

#tableSection > .table-wrapper {
    max-height: 560px;
    overflow: auto;
}

#dataTable thead th {
    position: sticky;
    top: 0;
    z-index: 4;
    background: linear-gradient(180deg, #f6f9fd 0%, #edf3fa 100%);
    box-shadow: inset 0 -1px 0 var(--border);
}

#dataTable thead tr:nth-child(2) th {
    top: 30px;
    z-index: 5;
}

.detail-total-row td {
    position: sticky;
    bottom: 0;
    z-index: 6;
    background: #eef6ff;
    border-top: 2px solid #93c5fd;
    color: #0f172a;
    font-weight: 700;
    box-shadow: 0 -2px 8px rgba(15, 23, 42, 0.08);
}

#detailTotalBtn.active,
#detailTotalBtn[aria-pressed="true"] {
    background: #dbeafe;
    color: #1d4ed8;
    border-color: #93c5fd;
}

.high-value-trend-section {
    margin-top: 18px;
}

.trend-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 8px;
    align-items: end;
}

.trend-filter-row .filter-group {
    min-width: 0;
    flex: 1 1 160px;
}

.custom-school-view {
    margin-top: 14px;
}

#customSchoolSchoolTable,
#customSchoolTable,
#customSchoolClassTable,
#highValueTable,
#dataTable {
    width: max-content;
    min-width: 100%;
    table-layout: auto;
}

#customSchoolSchoolTable th,
#customSchoolSchoolTable td,
#customSchoolTable th,
#customSchoolTable td,
#customSchoolClassTable th,
#customSchoolClassTable td,
#highValueTable th,
#highValueTable td,
#dataTable th,
#dataTable td {
    white-space: nowrap;
    word-break: keep-all;
    padding: 4px 5px;
    font-size: 10px;
    line-height: 1.1;
    vertical-align: middle;
}

#customSchoolSchoolTable td.school-name-cell,
#customSchoolTable td.school-name-cell,
#customSchoolClassTable td.school-name-cell,
#highValueTable td.school-name-cell,
#dataTable td.school-name-cell,
#customSchoolSchoolTable td.teacher-name-cell,
#customSchoolTable td.teacher-name-cell,
#customSchoolClassTable td.teacher-name-cell,
#highValueTable td.teacher-name-cell,
#dataTable td.teacher-name-cell {
    max-width: 160px;
    min-width: 96px;
    overflow: hidden;
    position: relative;
}

#customSchoolSchoolTable td.school-name-cell,
#customSchoolTable td.school-name-cell,
#customSchoolClassTable td.school-name-cell,
#highValueTable td.school-name-cell,
#dataTable td.school-name-cell,
#customSchoolSchoolTable td.teacher-name-cell,
#customSchoolTable td.teacher-name-cell,
#customSchoolClassTable td.teacher-name-cell,
#highValueTable td.teacher-name-cell,
#dataTable td.teacher-name-cell {
    white-space: normal;
    word-break: break-all;
    overflow-wrap: anywhere;
    text-overflow: clip;
    text-align: left;
    line-height: 1.15;
    vertical-align: top;
}

#customSchoolSchoolTable td.school-name-cell.allow-one-line,
#customSchoolTable td.school-name-cell.allow-one-line,
#customSchoolClassTable td.school-name-cell.allow-one-line,
#highValueTable td.school-name-cell.allow-one-line,
#dataTable td.school-name-cell.allow-one-line,
#customSchoolSchoolTable td.teacher-name-cell.allow-one-line,
#customSchoolTable td.teacher-name-cell.allow-one-line,
#customSchoolClassTable td.teacher-name-cell.allow-one-line,
#highValueTable td.teacher-name-cell.allow-one-line,
#dataTable td.teacher-name-cell.allow-one-line {
    white-space: nowrap;
    word-break: keep-all;
    overflow-wrap: normal;
}

#customSchoolSchoolTable td.school-name-cell.allow-two-lines,
#customSchoolTable td.school-name-cell.allow-two-lines,
#customSchoolClassTable td.school-name-cell.allow-two-lines,
#highValueTable td.school-name-cell.allow-two-lines,
#dataTable td.school-name-cell.allow-two-lines,
#customSchoolSchoolTable td.teacher-name-cell.allow-two-lines,
#customSchoolTable td.teacher-name-cell.allow-two-lines,
#customSchoolClassTable td.teacher-name-cell.allow-two-lines,
#highValueTable td.teacher-name-cell.allow-two-lines,
#dataTable td.teacher-name-cell.allow-two-lines {
    word-break: break-all;
    overflow-wrap: anywhere;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
}

#customSchoolSchoolTable th,
#customSchoolSchoolTable td,
#customSchoolTable th,
#customSchoolTable td,
#customSchoolClassTable th,
#customSchoolClassTable td,
#highValueTable th,
#highValueTable td,
#dataTable th,
#dataTable td {
    padding: 4px 5px;
    font-size: 10px;
    line-height: 1.1;
}

#customSchoolTable th,
#customSchoolTable td,
#customSchoolClassTable th,
#customSchoolClassTable td {
    white-space: nowrap;
    padding: 8px 10px;
}

#customSchoolTable {
    width: max-content;
    min-width: 100%;
    table-layout: auto;
}

#customSchoolTable th,
#customSchoolTable td {
    white-space: nowrap;
    word-break: keep-all;
    text-align: center;
    line-height: 1.2;
    padding: 5px 6px;
    font-size: 12px;
}

#customSchoolTable th {
    white-space: normal;
    word-break: break-word;
    line-height: 1.1;
    padding: 5px 4px;
    font-size: 10px;
}

#customSchoolTable td.school-name-cell {
    white-space: normal;
    word-break: break-all;
    overflow-wrap: anywhere;
    overflow: hidden;
    display: table-cell;
    text-overflow: clip;
    text-align: left;
    max-width: 160px;
    min-width: 96px;
    line-height: 1.15;
    vertical-align: top;
}

#customSchoolSchoolTable td.teacher-name-cell,
#customSchoolTable td.teacher-name-cell,
#customSchoolClassTable td.teacher-name-cell,
#highValueTable td.teacher-name-cell,
#dataTable td.teacher-name-cell {
    max-width: 140px;
}

.compact-number-cell {
    font-size: 10px;
    line-height: 1.1;
}

#customSchoolTable td.metric-good,
#customSchoolClassTable td.metric-good,
#customSchoolTable .metric-good,
#customSchoolClassTable .metric-good {
    color: #16a34a !important;
    font-weight: 700;
}

#customSchoolTable td.metric-bad,
#customSchoolClassTable td.metric-bad,
#customSchoolTable .metric-bad,
#customSchoolClassTable .metric-bad {
    color: #dc2626 !important;
    font-weight: 700;
}

@media (max-width: 1100px) {
    .upload-panel-grid {
        grid-template-columns: 1fr;
    }

}
