/* ============================================
   济南西城实验中学成绩管理系统 - 全局样式 v2
   统一设计系统：藏青蓝 + 香槟金
   ============================================ */

/*
   济南西城实验中学成绩管理系统 - 全局样式 v3
   设计系统：藏青靛蓝单主色 + 语义色 + 浅灰底白卡
   参考 Velzon (#405189/#f3f6f9/#0ab39c) 与 Metronic 数据平台规范
*/

:root {
    /* 品牌主色 - 藏青靛蓝（单主色 + 一档亮阶） */
    --brand-900: #16283f;
    --brand-800: #1d3550;
    --brand-700: #2b4b7d;
    --brand-600: #35598f;
    --accent: #bf9b5f;
    --accent-light: #d8bf95;

    /* 交互主色 */
    --primary: #2b4b7d;
    --primary-light: #35598f;
    --primary-dark: #1d3550;
    --primary-bg: #eaf1f9;
    --secondary: #4a7ab5;
    --success: #0d9f8a;
    --warning: #e0a13c;
    --danger: #dd5a4d;
    --info: #4a7ab5;

    /* 中性色 */
    --gray-50: #f2f5f9;
    --gray-100: #f6f8fb;
    --gray-200: #e6ecf3;
    --gray-300: #d5dfea;
    --gray-400: #8a99ab;
    --gray-500: #5a6b80;
    --gray-600: #445369;
    --gray-700: #2c3a4d;
    --gray-800: #1e2936;
    --gray-900: #121c27;

    /* 阴影 */
    --shadow-sm: 0 1px 2px rgba(22, 40, 63, 0.04);
    --shadow: 0 1px 2px rgba(22, 40, 63, 0.04), 0 1px 3px rgba(22, 40, 63, 0.05);
    --shadow-md: 0 2px 6px rgba(22, 40, 63, 0.05), 0 6px 18px rgba(22, 40, 63, 0.06);
    --shadow-lg: 0 10px 30px rgba(22, 40, 63, 0.10);
    --shadow-xl: 0 18px 44px rgba(22, 40, 63, 0.14);

    /* 圆角 */
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 14px;

    --transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);

    /* 可换肤令牌（切换主题时覆盖这四项） */
    --surface: #ffffff;      /* 卡片 / 顶栏底色 */
    --sb-text: #c3d4e8;      /* 侧栏常规文字 */
    --sb-active-bg: rgba(255, 255, 255, 0.10);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    background: var(--gray-50);
    color: var(--gray-800);
    min-height: 100vh;
    font-size: 14px;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

::selection { background: var(--accent); color: #fff; }

/* 滚动条美化 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--gray-100); }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }

.main-content {
    flex: 1;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 28px 40px;
}

/* ============================================================
   侧边栏布局 v3 —— 仿 Velzon / Metronic 数据平台骨架
   ============================================================ */
:root {
    --sb-w: 236px;
    --sb-w-collapsed: 64px;
    --topbar-h: 58px;
}

body {
    display: flex;
    flex-direction: row;
    min-height: 100vh;
    align-items: stretch;
}

/* ---------- 侧边栏 ---------- */
.app-sidebar {
    width: var(--sb-w);
    flex-shrink: 0;
    background: var(--brand-800);
    color: var(--sb-text);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 200;
    transition: width 0.22s var(--transition);
    box-shadow: 1px 0 0 rgba(255, 255, 255, 0.04) inset;
}

.sb-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 16px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    text-decoration: none;
    color: #fff;
    flex-shrink: 0;
    min-height: var(--topbar-h);
    box-sizing: content-box;
}
.sb-brand .logo {
    width: 34px;
    height: 34px;
    object-fit: contain;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.1);
    padding: 3px;
    flex-shrink: 0;
}
.sb-brand .brand-txt { min-width: 0; }
.sb-brand .s1 {
    font-size: 13.5px;
    font-weight: 650;
    line-height: 1.3;
    letter-spacing: 0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sb-brand .s2 {
    font-size: 10.5px;
    color: #8ba3bf;
    letter-spacing: 0.14em;
    margin-top: 1px;
    white-space: nowrap;
}

.sb-scroll {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 10px 9px 16px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}
.sb-scroll::-webkit-scrollbar { width: 5px; }
.sb-scroll::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.18);
    border-radius: 3px;
}
.sb-scroll::-webkit-scrollbar-track { background: transparent; }

.sb-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.16em;
    color: #6d86a3;
    padding: 14px 10px 6px;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
}
.sb-label:first-child { padding-top: 4px; }

/* 一级链接 */
.sb-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 11px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--sb-text);
    text-decoration: none;
    margin-bottom: 2px;
    transition: background 0.16s, color 0.16s;
    white-space: nowrap;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    width: 100%;
    box-sizing: border-box;
    border: none;
    background: transparent;
    font-family: inherit;
    text-align: left;
}
.sb-link svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    opacity: 0.88;
}
.sb-link span { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.sb-link:hover {
    background: rgba(255, 255, 255, 0.07);
    color: #fff;
}
.sb-link.active {
    background: var(--brand-600);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
.sb-link.active svg { opacity: 1; }

/* 折叠箭头 */
.sb-group > .sb-toggle::after {
    content: "";
    width: 6px;
    height: 6px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg);
    opacity: 0.6;
    margin-top: -3px;
    transition: transform 0.2s;
    flex-shrink: 0;
}
.sb-group.open > .sb-toggle::after {
    transform: rotate(-135deg);
    margin-top: 2px;
}
.sb-group.open > .sb-toggle { color: #fff; }

/* 二级菜单 */
.sb-sub {
    display: none;
    margin: 2px 0 4px 0;
    padding-left: 13px;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    margin-left: 18px;
}
.sb-group.open > .sb-sub { display: block; }
.sb-sub a {
    display: flex;
    align-items: center;
    padding: 7px 10px;
    border-radius: 7px;
    font-size: 12.5px;
    color: #a9bfd6;
    text-decoration: none;
    margin-bottom: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: background 0.16s, color 0.16s;
}
.sb-sub a:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.sb-sub a.active {
    background: rgba(191, 155, 95, 0.16);
    color: #e8cfa6;
    font-weight: 600;
}
.sb-sub a.active::before {
    content: "";
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--accent);
    margin-right: 7px;
    flex-shrink: 0;
}

/* 侧栏底部 */
.sb-foot {
    flex-shrink: 0;
    padding: 11px 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    font-size: 11px;
    color: #7e96b1;
    line-height: 1.5;
    white-space: nowrap;
    overflow: hidden;
}
.sb-foot b { color: #b9cee4; font-weight: 600; }

/* ---------- 主区域 ---------- */
.app-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: var(--gray-50);
}

.app-topbar {
    height: var(--topbar-h);
    background: var(--surface);
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 22px;
    position: sticky;
    top: 0;
    z-index: 150;
    flex-shrink: 0;
}
.tb-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-800);
    letter-spacing: 0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tb-crumb {
    font-size: 12px;
    color: var(--gray-400);
    white-space: nowrap;
}
.tb-crumb i { font-style: normal; margin: 0 5px; opacity: 0.6; }
.tb-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 9px;
}
.tb-user {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 5px 12px 5px 6px;
    background: var(--primary-bg);
    border-radius: 999px;
    font-size: 12.5px;
    color: var(--brand-700);
    font-weight: 500;
}
.tb-user .av {
    width: 23px;
    height: 23px;
    border-radius: 50%;
    background: var(--brand-700);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
}
.tb-logout {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 11px;
    border-radius: 8px;
    font-size: 12.5px;
    color: var(--gray-500);
    text-decoration: none;
    border: 1px solid var(--gray-200);
    transition: all 0.16s;
    white-space: nowrap;
}
.tb-logout:hover {
    color: #c0392b;
    border-color: #f3c9c4;
    background: #fdf3f2;
}

/* 移动端汉堡按钮 */
.sb-toggle-btn {
    display: none;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid var(--gray-200);
    background: var(--surface);
    color: var(--gray-600);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.sb-toggle-btn:hover { background: var(--gray-100); }

.sb-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(18, 28, 39, 0.5);
    z-index: 190;
    backdrop-filter: blur(1px);
}

/* 主内容区覆盖 */
.main-content {
    flex: 1;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 20px 24px 32px;
    box-sizing: border-box;
}
.main-footer {
    border-top: 1px solid var(--gray-200);
    background: var(--surface);
    padding: 14px 24px;
    text-align: center;
    font-size: 11.5px;
    color: var(--gray-400);
    margin-top: auto;
}
.main-footer b { color: var(--gray-500); font-weight: 600; }

/* ---------- 响应式 ---------- */
@media (max-width: 1100px) {
    body { display: block; }
    .app-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        transform: translateX(-100%);
        transition: transform 0.24s var(--transition);
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.2);
    }
    body.sb-open .app-sidebar { transform: translateX(0); }
    body.sb-open .sb-overlay { display: block; }
    .sb-toggle-btn { display: inline-flex; }
    .app-main { width: 100%; }
    .main-content { padding: 16px 14px 28px; }
    .app-topbar { padding: 0 14px; }
    .tb-crumb { display: none; }
}
@media (max-width: 620px) {
    .tb-user span.uname { display: none; }
    .tb-logout span { display: none; }
    .tb-logout { padding: 6px 9px; }
}

/* ========== 主内容区 ========== */
.main-content { padding: 28px 40px; max-width: 1400px; margin: 0 auto; }

/* ========== 页面标题 ========== */
.page-header {
    margin-bottom: 24px;
    padding-left: 14px;
    border-left: 4px solid var(--accent);
}

.page-header h1 {
    font-size: 24px;
    font-weight: 600;
    color: var(--brand-800);
    margin-bottom: 6px;
}

.page-header .page-subtitle {
    font-size: 14px;
    color: var(--gray-500);
}

/* ========== 卡片 ========== */
.card {
    background: white;
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s;
}
.card:hover { box-shadow: var(--shadow); }

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    background: linear-gradient(180deg, #fbfcfe 0%, #ffffff 100%);
    border-radius: var(--radius) var(--radius) 0 0;
}

.card-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.card-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.card-header h2 {
    font-size: 16px;
    font-weight: 600;
    color: var(--brand-800);
    display: flex;
    align-items: center;
    gap: 8px;
}
.card-header h2::before {
    content: '';
    display: inline-block;
    width: 3px;
    height: 15px;
    background: var(--accent);
    border-radius: 2px;
}

/* 内联筛选表单 */
.filter-form-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-form-inline .form-select-sm,
.filter-form-inline .form-input-sm {
    padding: 6px 10px;
    font-size: 13px;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    background: white;
    color: var(--gray-700);
    transition: all 0.2s;
}

.filter-form-inline .form-select-sm:focus,
.filter-form-inline .form-input-sm:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(42, 96, 152, 0.12);
}

.filter-form-inline .form-input-sm { min-width: 160px; }
.filter-form-inline .form-select-sm { min-width: 100px; }

.card-body { padding: 20px; }

/* ========== 搜索框 ========== */
.search-box { position: relative; margin: 16px 0; }

.search-box .search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    pointer-events: none;
}

.search-box input {
    width: 100%;
    padding: 14px 16px 14px 48px;
    border: 1.5px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 15px;
    transition: all 0.2s ease;
    background: white;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 4px rgba(42, 96, 152, 0.1);
}

.search-box input::placeholder { color: var(--gray-400); }

/* ========== 筛选区域 ========== */
.filter-panel {
    background: white;
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin-bottom: 20px;
}

.filter-header {
    background: linear-gradient(135deg, var(--primary-bg) 0%, #dfe9f4 100%);
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--gray-200);
}

.filter-header svg { color: var(--primary); }
.filter-header h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--brand-800);
    margin: 0;
}

.filter-body { padding: 20px; }

.filter-row {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 140px;
    flex: 1;
}

.filter-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-500);
    letter-spacing: 0.5px;
}

.filter-group select,
.filter-group input {
    padding: 10px 14px;
    border: 1.5px solid var(--gray-300);
    border-radius: 8px;
    font-size: 14px;
    color: var(--gray-700);
    background: white;
    transition: all 0.2s ease;
    cursor: pointer;
}

.filter-group select:focus,
.filter-group input:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(42, 96, 152, 0.1);
}

.filter-actions {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

/* ========== 按钮 ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1.4;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 2px 6px rgba(30, 74, 110, 0.25);
}
.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
    box-shadow: 0 4px 12px rgba(30, 74, 110, 0.32);
    color: white;
}

.btn-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
    border-color: var(--gray-200);
}
.btn-secondary:hover { background: var(--gray-200); }

.btn-outline {
    background: transparent;
    border: 1px solid var(--gray-300);
    color: var(--gray-700);
}
.btn-outline:hover {
    background: var(--primary-bg);
    border-color: var(--primary-light);
    color: var(--primary);
}

.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-lg { padding: 12px 24px; font-size: 16px; }

/* ========== 表单 ========== */
.form-group { margin-bottom: 16px; }

.form-label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-600);
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    font-size: 14px;
    color: var(--gray-800);
    background: white;
    transition: all 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(42, 96, 152, 0.1);
}

.form-control::placeholder { color: var(--gray-400); }

/* ========== 表格 ========== */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table th {
    background: linear-gradient(180deg, var(--primary-bg) 0%, #e8eff7 100%);
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: var(--brand-800);
    border-bottom: 2px solid var(--gray-300);
    white-space: nowrap;
}

.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--gray-200);
    color: var(--gray-700);
}

.data-table tbody tr:nth-child(even) { background: #fbfcfe; }
.data-table tr:hover { background: var(--primary-bg); }

.data-table .actions { display: flex; gap: 8px; }

/* ========== 徽章 ========== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.badge-primary { background: var(--primary-bg); color: var(--primary); }
.badge-success { background: #d1fae5; color: #059669; }
.badge-warning { background: #fef3c7; color: #d97706; }
.badge-danger { background: #fee2e2; color: #dc2626; }
.badge-gray { background: var(--gray-100); color: var(--gray-600); }

/* ========== 统计卡片 ========== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}
.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.stat-card .stat-label {
    font-size: 13px;
    color: var(--gray-500);
    margin-bottom: 8px;
}

.stat-card .stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--brand-800);
    font-variant-numeric: tabular-nums;
}

.stat-card .stat-change {
    font-size: 12px;
    margin-top: 4px;
}

/* 成绩场景：上升用红、下降用绿（中国习惯） */
.stat-card .stat-change.up { color: #dc2626; }
.stat-card .stat-change.down { color: #059669; }

/* ========== 分页 ========== */
.pagination {
    display: flex;
    align-items: center;
    gap: 4px;
    justify-content: center;
    margin-top: 24px;
}

.pagination a,
.pagination span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    border-radius: 8px;
    font-size: 14px;
    color: var(--gray-600);
    text-decoration: none;
    transition: all 0.2s;
}

.pagination a:hover { background: var(--gray-100); }
.pagination .active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 2px 6px rgba(30, 74, 110, 0.25);
}
.pagination .disabled { opacity: 0.5; pointer-events: none; }

/* ========== 消息提示 ========== */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.alert-success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; border-left: 3px solid #059669; }
.alert-warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; border-left: 3px solid #d97706; }
.alert-danger { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; border-left: 3px solid #dc2626; }
.alert-info { background: var(--primary-bg); color: var(--brand-800); border: 1px solid #cbdcec; border-left: 3px solid var(--accent); }

/* ========== 模态框 ========== */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(13, 35, 56, 0.55);
    backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal {
    background: white;
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: var(--shadow-xl);
}

.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(180deg, #fbfcfe 0%, #fff 100%);
}
.modal-header h3 { font-size: 18px; font-weight: 600; color: var(--brand-800); }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* ========== 加载状态 ========== */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: var(--gray-500);
}
.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ========== 空状态 ========== */
.empty-state { text-align: center; padding: 60px 20px; color: var(--gray-500); }
.empty-state svg { width: 64px; height: 64px; margin-bottom: 16px; color: var(--gray-300); }
.empty-state h3 { font-size: 18px; font-weight: 600; color: var(--gray-600); margin-bottom: 8px; }

/* ========== 工具类 ========== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--gray-500); }
.text-primary { color: var(--primary); }
.text-success { color: #059669; }
.text-danger { color: #dc2626; }
.text-warning { color: #d97706; }

.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }

/* ========== 页脚 ========== */
.main-footer {
    background: var(--surface);
    color: var(--gray-400);
    font-size: 11.5px;
    margin-top: auto;
    width: 100%;
    border-top: 1px solid var(--gray-200);
}
.main-footer p {
    max-width: none;
    margin: 0 auto;
    padding: 14px 24px;
    letter-spacing: 0.3px;
    text-align: center;
}
.main-footer a { color: var(--gray-500); text-decoration: none; transition: color 0.2s; }
.main-footer a:hover { color: var(--brand-700); text-decoration: underline; }

/* ========== 响应式 ========== */
@media (max-width: 768px) {
    .main-content { padding: 16px 14px; }
    .stats-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   v3 组件升级层 —— 数据平台规范（浅灰底 / 白卡 / 单主色 / 语义色）
   置于样式末尾以覆盖旧定义
   ============================================================ */

/* ---------- 页面标题 ---------- */
.page-header {
    display: flex;
    align-items: flex-end;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--gray-200);
}
.page-header h1 {
    font-size: 19px;
    font-weight: 650;
    color: var(--gray-800);
    letter-spacing: 0.01em;
    margin: 0;
    border: none;
    padding: 0;
}
.page-header h1::before { display: none; }
.page-header .page-subtitle {
    font-size: 12.5px;
    color: var(--gray-400);
    margin: 3px 0 0;
}

/* ---------- 卡片 ---------- */
.card {
    background: var(--surface);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    margin-bottom: 16px;
    overflow: hidden;
    transition: box-shadow 0.2s, border-color 0.2s;
}
.card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--gray-300);
}
.card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 18px;
    border-bottom: 1px solid var(--gray-200);
    background: var(--surface);
    border-radius: 0;
}
.card-header h2 {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-800);
    margin: 0;
    padding: 0;
    border: none;
    letter-spacing: 0.01em;
}
.card-header h2::before { display: none; }
.card-header-left { display: flex; align-items: center; gap: 9px; min-width: 0; }
.card-header-right { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card-body { padding: 16px 18px; }

/* ---------- 按钮 ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 34px;
    padding: 0 14px;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    border-radius: 8px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.16s var(--transition);
    white-space: nowrap;
    text-decoration: none;
    line-height: 1;
    box-sizing: border-box;
}
.btn svg { width: 14px; height: 14px; flex-shrink: 0; }
.btn-primary {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 1px 2px rgba(43, 75, 125, 0.2);
}
.btn-primary:hover {
    background: var(--primary-light);
    border-color: var(--primary-light);
    box-shadow: 0 3px 10px rgba(43, 75, 125, 0.26);
    color: #fff;
}
.btn-secondary {
    background: var(--surface);
    color: var(--gray-600);
    border-color: var(--gray-300);
}
.btn-secondary:hover {
    background: var(--gray-100);
    border-color: var(--gray-400);
    color: var(--gray-700);
}
.btn-outline {
    background: transparent;
    color: var(--primary);
    border-color: var(--gray-300);
}
.btn-outline:hover {
    background: var(--primary-bg);
    border-color: var(--primary-light);
    color: var(--primary);
}
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover { background: #c94b3e; border-color: #c94b3e; color: #fff; }
.btn-success { background: var(--success); color: #fff; border-color: var(--success); }
.btn-success:hover { background: #0b8977; border-color: #0b8977; color: #fff; }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 6px; }
.btn-sm svg { width: 12px; height: 12px; }
.btn-lg { height: 40px; padding: 0 20px; font-size: 14px; border-radius: 9px; }
.btn:disabled, .btn.disabled {
    opacity: 0.55;
    cursor: not-allowed;
    box-shadow: none;
}

/* ---------- 表格 ---------- */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    background: var(--surface);
}
.data-table thead th {
    text-align: left;
    padding: 10px 14px;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--gray-400);
    letter-spacing: 0.05em;
    background: #fafbfd;
    border-bottom: 1px solid var(--gray-200);
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 2;
}
.data-table tbody td {
    padding: 10px 14px;
    border-bottom: 1px solid #f1f5f9;
    color: var(--gray-700);
    vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr { transition: background 0.14s; }
.data-table tbody tr:hover { background: #f8fbff; }
.data-table .num, .data-table .score, .data-table td[align="right"] {
    font-variant-numeric: tabular-nums;
}

/* ---------- 表单 ---------- */
.form-label {
    display: block;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--gray-600);
    margin-bottom: 6px;
}
.form-control, .form-select, select.form-control, textarea.form-control {
    width: 100%;
    height: 34px;
    padding: 0 11px;
    font-size: 13px;
    font-family: inherit;
    color: var(--gray-800);
    background: var(--surface);
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    box-sizing: border-box;
    transition: border-color 0.16s, box-shadow 0.16s;
    outline: none;
}
textarea.form-control { height: auto; padding: 9px 11px; line-height: 1.6; }
.form-control:focus, .form-select:focus, select.form-control:focus, textarea.form-control:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(53, 89, 143, 0.12);
}
.form-control::placeholder { color: var(--gray-400); }
.form-group { margin-bottom: 14px; }

/* ---------- 徽标 ---------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 5px;
    font-size: 11.5px;
    font-weight: 600;
    line-height: 1.6;
    letter-spacing: 0.01em;
}
.badge-primary { background: var(--primary-bg); color: var(--brand-700); }
.badge-success { background: #e6f7f4; color: #0a7f6f; }
.badge-warning { background: #fdf4e5; color: #a8721a; }
.badge-danger { background: #fdecea; color: #c0392b; }
.badge-gray { background: #eef2f7; color: var(--gray-500); }

/* ---------- 提示条 ---------- */
.alert {
    padding: 11px 15px;
    border-radius: 9px;
    font-size: 13px;
    margin-bottom: 14px;
    border: 1px solid transparent;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    line-height: 1.6;
}
.alert-success { background: #e9f8f4; border-color: #bfe9df; color: #0a6b5d; }
.alert-danger { background: #fdeeec; border-color: #f7cdc7; color: #b3362a; }
.alert-warning { background: #fdf6e8; border-color: #f6e2bc; color: #97661a; }
.alert-info { background: #edf3fb; border-color: #cfdff2; color: #2b4b7d; }

/* ---------- 筛选面板 ---------- */
.filter-panel {
    background: var(--surface);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.filter-header {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 12px 18px;
    border-bottom: 1px solid var(--gray-200);
    font-size: 13.5px;
    font-weight: 600;
    color: var(--gray-700);
    background: var(--surface);
    cursor: pointer;
}
.filter-body { padding: 16px 18px; }
.filter-row {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    align-items: flex-end;
}
.filter-group { display: flex; flex-direction: column; gap: 6px; min-width: 130px; }
.filter-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.filter-form-inline { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ---------- 空状态 ---------- */
.empty-state {
    padding: 48px 20px;
    text-align: center;
    color: var(--gray-400);
    font-size: 13px;
}
.empty-state svg { width: 40px; height: 40px; opacity: 0.4; margin-bottom: 10px; }

/* ---------- 搜索框 ---------- */
.search-box { position: relative; margin: 14px 0; }
.search-box input {
    width: 100%;
    height: 38px;
    padding: 0 14px 0 38px;
    font-size: 13px;
    border: 1px solid var(--gray-300);
    border-radius: 9px;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.16s, box-shadow 0.16s;
    background: var(--surface);
    color: var(--gray-800);
    font-family: inherit;
}
.search-box input:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(53, 89, 143, 0.12);
}
.search-box .search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    display: flex;
    pointer-events: none;
}

/* ---------- 弹窗 ---------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(18, 28, 39, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 500;
    backdrop-filter: blur(2px);
    padding: 20px;
}
.modal {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 520px;
    max-height: 88vh;
    overflow: auto;
}
.modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--gray-200);
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-800);
    display: flex;
    align-items: center;
}
.modal-body { padding: 20px; font-size: 13.5px; color: var(--gray-600); }
.modal-footer {
    padding: 13px 20px;
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    background: #fafbfd;
}

/* ---------- 通用工具类微调 ---------- */
.loading {
    display: inline-block;
    width: 15px;
    height: 15px;
    border: 2px solid var(--gray-300);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: v3spin 0.7s linear infinite;
}
@keyframes v3spin { to { transform: rotate(360deg); } }

/* ---------- 热/冷数据分组标签 ---------- */
.sb-label.hot, .sb-label.cold {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #7e96b1;
    font-size: 10px;
}
.sb-label i {
    font-style: normal;
    font-size: 8.5px;
    font-weight: 700;
    letter-spacing: 0.06em;
    padding: 1px 4px;
    border-radius: 3px;
    line-height: 1.5;
}
.sb-label.hot i { background: rgba(13, 159, 138, 0.2); color: #5fd6c2; }
.sb-label.cold i { background: rgba(96, 130, 180, 0.22); color: #8fb0d8; }

/* ============================================================
   v3 通用组件：KPI 指标卡 / 分布条 / 分组面板
   ============================================================ */
.kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(186px, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}
.kpi {
    background: var(--surface);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 15px 17px;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.2s, border-color 0.2s;
}
.kpi:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
    border-color: var(--gray-300);
}
.kpi::before {
    content: "";
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--primary);
}
.kpi.teal::before { background: var(--success); }
.kpi.amber::before { background: var(--warning); }
.kpi.rose::before { background: var(--danger); }
.kpi-top { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.kpi-ico {
    width: 28px; height: 28px;
    border-radius: 8px;
    display: grid; place-items: center;
    background: var(--primary-bg);
    color: var(--primary);
    flex-shrink: 0;
}
.kpi.teal .kpi-ico { background: #e6f7f4; color: #0a7f6f; }
.kpi.amber .kpi-ico { background: #fdf4e5; color: #a8721a; }
.kpi.rose .kpi-ico { background: #fdecea; color: #c0392b; }
.kpi-ico svg { width: 14px; height: 14px; }
.kpi-lbl { font-size: 12.5px; color: var(--gray-500); font-weight: 500; }
.kpi-num {
    font-size: 25px;
    font-weight: 680;
    letter-spacing: -0.02em;
    line-height: 1.15;
    color: var(--gray-800);
    font-variant-numeric: tabular-nums;
}
.kpi-num small { font-size: 13px; font-weight: 500; color: var(--gray-400); margin-left: 2px; }
.kpi-sub { font-size: 11.5px; color: var(--gray-400); margin-top: 5px; }
.kpi-sub b { color: var(--gray-600); font-weight: 600; }

/* 分布条 */
.bar {
    height: 6px;
    border-radius: 99px;
    background: #eef2f7;
    overflow: hidden;
}
.bar > i { display: block; height: 100%; border-radius: 99px; background: var(--primary); }
.bar.teal > i { background: var(--success); }
.bar.amber > i { background: var(--warning); }
.bar.rose > i { background: var(--danger); }
.dist-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.dist-row .lbl { width: 72px; font-size: 12.5px; color: var(--gray-500); flex-shrink: 0; }
.dist-row .bar { flex: 1; }
.dist-row .val {
    width: 52px; text-align: right;
    font-size: 12.5px; font-weight: 600;
    color: var(--gray-700);
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}

/* 网格 */
.grid-2 { display: grid; grid-template-columns: 1.5fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 1080px) {
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

/* 年度切换条 */
.year-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.year-tabs a {
    padding: 6px 13px;
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--gray-500);
    background: var(--surface);
    border: 1px solid var(--gray-200);
    text-decoration: none;
    transition: all 0.16s;
}
.year-tabs a:hover { border-color: var(--primary-light); color: var(--primary); }
.year-tabs a.on {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    font-weight: 600;
}

/* 表格内层次标签 */
.tier {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    background: #eef2f7;
    color: var(--gray-500);
    white-space: nowrap;
}
.tier.t1 { background: #f8edd9; color: #96702c; }
.tier.t2 { background: #e6f0fb; color: #2b5580; }
.tier.t3 { background: #e8f4f1; color: #0a7f6f; }
.tier.t4 { background: #f0edf9; color: #5b4a9e; }
.tier.t5 { background: #eef2f7; color: var(--gray-500); }

/* 分页 */
.pager { display: flex; align-items: center; gap: 6px; justify-content: center; padding: 16px 0 4px; flex-wrap: wrap; }
.pager a, .pager span {
    min-width: 30px; height: 30px;
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0 9px;
    border-radius: 7px;
    font-size: 12.5px;
    color: var(--gray-600);
    background: var(--surface);
    border: 1px solid var(--gray-200);
    text-decoration: none;
}
.pager a:hover { border-color: var(--primary-light); color: var(--primary); }
.pager .cur { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.pager .gap { border: none; background: transparent; color: var(--gray-400); }
.pager .info { margin-left: 8px; color: var(--gray-400); border: none; background: transparent; font-size: 12px; }

/* ========== 侧栏：冷数据标记（毕业档案） ========== */
.sb-toggle .tag-cold {
    font-style: normal;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.08em;
    line-height: 1;
    padding: 3px 5px;
    border-radius: 4px;
    background: rgba(191, 155, 95, 0.16);
    color: #d8bf95;
    flex-shrink: 0;
}
.sb-group.open > .sb-toggle .tag-cold {
    background: rgba(191, 155, 95, 0.26);
    color: #f0dcba;
}

/* ========== 表单：禁用态按钮（通用） ========== */
.btn.is-disabled,
.btn[aria-disabled="true"] {
    pointer-events: none;
    opacity: 0.5;
    cursor: not-allowed;
}


/* ============================================================
   主题层 v1 · 可切换配色
   使用方式：<html data-theme="gold"> / data-theme="emerald" / 无 = 藏青蓝
   切换器脚本见 base.html，偏好写入 cookie(cj_theme) + localStorage
   ============================================================ */

/* ---------- 01 学院金：暖纸白 + 深墨侧栏 + 学院金 ---------- */
[data-theme="gold"] {
    --brand-900: #241e14;
    --brand-800: #16171a;
    --brand-700: #8a6c33;
    --brand-600: #9a7b3f;

    --accent: #9a7b3f;
    --accent-light: #d8c89e;

    --primary: #8a6c33;
    --primary-light: #9a7b3f;
    --primary-dark: #6e5427;
    --primary-bg: #f5eedf;
    --secondary: #a6803f;

    --gray-50: #f7f4ee;
    --gray-100: #fcfaf5;
    --gray-200: #e8e1d5;
    --gray-300: #d6cbb6;
    --gray-400: #918e7e;
    --gray-500: #6e6c5f;
    --gray-600: #4e4f48;
    --gray-700: #33352f;
    --gray-800: #1a1b18;
    --gray-900: #12130f;

    --surface: #ffffff;
    --sb-text: #c9c6b8;
    --sb-active-bg: rgba(154, 123, 63, 0.20);

    --shadow-sm: 0 1px 2px rgba(48, 40, 24, 0.05);
    --shadow: 0 1px 2px rgba(48, 40, 24, 0.05), 0 1px 3px rgba(48, 40, 24, 0.06);
    --shadow-md: 0 2px 6px rgba(48, 40, 24, 0.06), 0 6px 18px rgba(48, 40, 24, 0.07);
    --shadow-lg: 0 10px 30px rgba(48, 40, 24, 0.10);
    --shadow-xl: 0 18px 44px rgba(48, 40, 24, 0.14);
}

/* 学院金：标题衬线、页头收一点字距 */
html[data-theme="gold"] .dash-head h1,
html[data-theme="gold"] .page-head h1,
html[data-theme="gold"] .tb-title {
    font-family: "Songti SC", "SimSun", Georgia, serif;
    font-weight: 400;
    letter-spacing: 0.01em;
}
[data-theme="gold"] .kpi-num { letter-spacing: -0.01em; }
[data-theme="gold"] .app-sidebar {
    background: linear-gradient(180deg, #1b1916 0%, #131210 100%);
    box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.05);
}
/* 学院金：KPI 图标底色改暖，避免冷绿/冷黄在暖纸底上跳出来 */
[data-theme="gold"] .kpi.teal .kpi-ico { background: #edf3ee; color: #2f7a52; }
[data-theme="gold"] .kpi.amber .kpi-ico { background: #fbf0dc; color: #a8721a; }
[data-theme="gold"] .kpi.rose .kpi-ico { background: #fbeceb; color: #c04a3f; }

/* ---------- 02 墨绿：浅灰绿底 + 深墨绿侧栏 + 玉绿 + 沙金 ---------- */
[data-theme="emerald"] {
    --brand-900: #081814;
    --brand-800: #0e2721;
    --brand-700: #17705a;
    --brand-600: #1c8368;

    --accent: #c9a96a;
    --accent-light: #dcc79b;

    --primary: #17705a;
    --primary-light: #1c8368;
    --primary-dark: #125c4a;
    --primary-bg: #e8f1ec;
    --secondary: #2a8a70;

    --gray-50: #f4f6f3;
    --gray-100: #fafbf9;
    --gray-200: #e1e7e0;
    --gray-300: #c9d4c9;
    --gray-400: #86988e;
    --gray-500: #5f6e66;
    --gray-600: #3f5048;
    --gray-700: #26382f;
    --gray-800: #12201b;
    --gray-900: #0b1611;

    --surface: #ffffff;
    --sb-text: #b9ccc3;
    --sb-active-bg: rgba(23, 112, 90, 0.22);

    --shadow-sm: 0 1px 2px rgba(18, 32, 27, 0.05);
    --shadow: 0 1px 2px rgba(18, 32, 27, 0.05), 0 1px 3px rgba(18, 32, 27, 0.06);
    --shadow-md: 0 2px 6px rgba(18, 32, 27, 0.06), 0 6px 18px rgba(18, 32, 27, 0.07);
    --shadow-lg: 0 10px 30px rgba(18, 32, 27, 0.10);
    --shadow-xl: 0 18px 44px rgba(18, 32, 27, 0.14);

    --radius: 12px;
    --radius-lg: 16px;
}
[data-theme="emerald"] .app-sidebar {
    background: linear-gradient(180deg, #10302a 0%, #0b221d 100%);
}
html[data-theme="emerald"] .dash-head h1,
html[data-theme="emerald"] .page-head h1 {
    letter-spacing: -0.005em;
}

/* ---------- 主题切换器（顶栏） ---------- */
.theme-sw {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 5px;
    border-radius: 20px;
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
}
.theme-sw .tsw {
    width: 15px;
    height: 15px;
    padding: 0;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.14);
    cursor: pointer;
    transition: box-shadow 0.16s, transform 0.16s;
    position: relative;
}
.theme-sw .tsw:hover { transform: scale(1.14); }
.theme-sw .tsw.navy { background: linear-gradient(135deg, #35598f, #16283f); }
.theme-sw .tsw.gold { background: linear-gradient(135deg, #c9a566, #8a6c33); }
.theme-sw .tsw.emerald { background: linear-gradient(135deg, #1c8368, #0b221d); }
.theme-sw .tsw.on {
    box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--gray-400);
}
@media (max-width: 720px) {
    .theme-sw { display: none; }
}
