/* ==================== CSS 变量（浅色主题） ==================== */
:root {
    --bg-gradient-1: #e67e22;
    --bg-gradient-2: #f39c12;
    --bg-main: #f0f2f5;
    --bg-sidebar: rgba(255, 255, 255, 0.95);
    --bg-card: #ffffff;
    --bg-input: #ffffff;
    --bg-table-header: #f8f9fa;
    --bg-hover: #f8f9fa;
    --bg-modal-overlay: rgba(0, 0, 0, 0.5);
    --text-primary: #333333;
    --text-secondary: #555555;
    --text-muted: #888888;
    --text-light: #999999;
    --text-on-primary: #ffffff;
    --border-color: #e0e0e0;
    --border-light: #f0f0f0;
    --shadow-card: 0 10px 40px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 15px 50px rgba(0, 0, 0, 0.15);
    --shadow-sidebar: 2px 0 20px rgba(0, 0, 0, 0.1);
    --accent-primary: #e67e22;
    --accent-secondary: #f39c12;
    --color-success: #2ed573;
    --color-danger: #ff4757;
    --color-warning: #ffa502;
    --color-info: #4facfe;
    --score-table-header: #e67e22;
    --nav-active-bg: #e67e22;
    --nav-hover-bg: #f0f0f0;
    --scrollbar-track: #f1f1f1;
    --scrollbar-thumb: #c1c1c1;
    --scrollbar-thumb-hover: #a1a1a1;
}

/* ==================== 深色主题 ==================== */
[data-theme="dark"] {
    --bg-gradient-1: #1a1a3e;
    --bg-gradient-2: #2d1b4e;
    --bg-main: #141428;
    --bg-sidebar: rgba(26, 26, 50, 0.98);
    --bg-card: #1e1e3a;
    --bg-input: #2a2a4a;
    --bg-table-header: #252545;
    --bg-hover: #252545;
    --bg-modal-overlay: rgba(0, 0, 0, 0.7);
    --text-primary: #e8e8f0;
    --text-secondary: #c0c0d0;
    --text-muted: #8888a0;
    --text-light: #6666a0;
    --text-on-primary: #ffffff;
    --border-color: #3a3a5a;
    --border-light: #2a2a4a;
    --shadow-card: 0 10px 40px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 15px 50px rgba(0, 0, 0, 0.4);
    --shadow-sidebar: 2px 0 20px rgba(0, 0, 0, 0.3);
    --accent-primary: #f0932b;
    --accent-secondary: #f6b93b;
    --color-success: #4ae68a;
    --color-danger: #ff6b7a;
    --color-warning: #ffb832;
    --color-info: #6abcff;
    --score-table-header: #3a3a6e;
    --nav-active-bg: #3a3a6e;
    --nav-hover-bg: #2a2a4a;
    --scrollbar-track: #1a1a3a;
    --scrollbar-thumb: #3a3a5a;
    --scrollbar-thumb-hover: #4a4a6a;
}

/* ==================== 深色主题补丁 ==================== */
[data-theme="dark"] body {
    color: var(--text-primary);
}

[data-theme="dark"] strong {
    color: var(--text-primary);
}

[data-theme="dark"] select,
[data-theme="dark"] option {
    background: var(--bg-input);
    color: var(--text-primary);
}

[data-theme="dark"] input::placeholder {
    color: var(--text-muted);
}

[data-theme="dark"] select:focus,
[data-theme="dark"] input:focus {
    border-color: var(--accent-primary);
}

[data-theme="dark"] .data-table td {
    color: var(--text-secondary);
}

[data-theme="dark"] .data-table th {
    color: var(--text-secondary);
    background: var(--bg-table-header);
}

[data-theme="dark"] .data-table tr:hover {
    background: var(--bg-hover);
}

[data-theme="dark"] .score-table td {
    color: var(--text-primary);
    background: var(--bg-card);
}

[data-theme="dark"] .score-table input {
    background: var(--bg-input);
    color: var(--text-primary);
    border-color: var(--border-color);
}

[data-theme="dark"] .stat-value {
    color: var(--accent-primary);
}

[data-theme="dark"] .subject-tag {
    background: var(--bg-input);
    color: var(--text-secondary);
    border-color: var(--border-color);
}

[data-theme="dark"] .subject-tag:hover {
    color: var(--accent-primary);
    border-color: var(--accent-primary);
}

[data-theme="dark"] .subject-tag.selected {
    color: white;
}

[data-theme="dark"] .compare-student-tag {
    background: var(--bg-input);
    color: var(--text-secondary);
    border-color: var(--border-color);
}

[data-theme="dark"] .compare-student-tag.selected {
    color: white;
}

[data-theme="dark"] .btn-secondary {
    background: var(--bg-input);
    color: var(--text-secondary);
    border-color: var(--border-color);
}

[data-theme="dark"] .btn-secondary:hover {
    background: var(--border-color);
    color: var(--text-primary);
}

[data-theme="dark"] .modal-content {
    background: var(--bg-card);
    color: var(--text-primary);
}

[data-theme="dark"] .modal-close {
    color: var(--text-muted);
}

[data-theme="dark"] .modal-title {
    color: var(--text-primary);
}

[data-theme="dark"] .card-title {
    color: var(--text-primary);
    border-bottom-color: var(--border-light);
}

[data-theme="dark"] .filter-group label {
    color: var(--text-muted);
}

[data-theme="dark"] .filter-group select,
[data-theme="dark"] .filter-group input {
    background: var(--bg-input);
    color: var(--text-primary);
    border-color: var(--border-color);
}

[data-theme="dark"] .nav-item {
    color: var(--text-secondary);
}

[data-theme="dark"] .nav-item:hover {
    color: var(--accent-primary);
    background: var(--nav-hover-bg);
}

[data-theme="dark"] .nav-item.active {
    color: white;
}

[data-theme="dark"] .empty-state {
    color: var(--text-muted);
}

[data-theme="dark"] .warning-item {
    color: var(--text-primary);
}

[data-theme="dark"] .warning-drop {
    background: rgba(255, 107, 122, 0.12);
}

[data-theme="dark"] .warning-fail {
    background: rgba(255, 184, 50, 0.12);
}

[data-theme="dark"] .goal-table th {
    background: var(--bg-table-header);
    color: var(--text-secondary);
}

[data-theme="dark"] .goal-table td {
    color: var(--text-primary);
}

[data-theme="dark"] .goal-table input {
    background: var(--bg-input);
    color: var(--text-primary);
    border-color: var(--border-color);
}

[data-theme="dark"] .diagnosis-card {
    background: var(--bg-hover);
}

[data-theme="dark"] .diagnosis-title {
    color: var(--text-primary);
}

[data-theme="dark"] .diagnosis-desc {
    color: var(--text-secondary);
}

[data-theme="dark"] .switch-label {
    color: var(--text-secondary);
}

[data-theme="dark"] .switch-slider {
    background-color: var(--border-color);
}

[data-theme="dark"] .theme-toggle {
    background: var(--bg-hover);
    border-color: var(--border-color);
    color: var(--text-secondary);
}

[data-theme="dark"] .import-preview th {
    background: var(--bg-table-header);
    color: var(--text-secondary);
}

[data-theme="dark"] .import-preview td {
    color: var(--text-primary);
}

[data-theme="dark"] .tabs {
    border-bottom-color: var(--border-light);
}

[data-theme="dark"] .tab {
    color: var(--text-muted);
}

[data-theme="dark"] .tab.active {
    color: var(--accent-primary);
}

/* ==================== 基础样式 ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', 'Segoe UI', -apple-system, BlinkMacSystemFont, Arial, sans-serif;
    font-size: 15px;
    background: var(--bg-main);
    min-height: 100vh;
    transition: background 0.3s ease;
}

/* 全局字体继承 */
input, select, textarea, button {
    font-family: inherit;
}

.container {
    display: flex;
    min-height: 100vh;
}

/* ==================== 自定义滚动条 ==================== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-thumb-hover);
}

/* ==================== 侧边栏 ==================== */
.sidebar {
    width: 220px;
    background: var(--bg-sidebar);
    backdrop-filter: blur(10px);
    padding: 20px 0;
    box-shadow: var(--shadow-sidebar);
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
    overflow-y: auto;
}

.logo {
    text-align: center;
    padding: 0 20px 15px;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 15px;
}

.logo h1 {
    font-size: 17px;
    color: var(--text-primary);
    font-weight: 700;
    letter-spacing: 1px;
}

.logo .version-badge {
    display: inline-block;
    background: var(--accent-primary);
    color: white;
    font-size: 12px;
    padding: 3px 10px;
    border-radius: 10px;
    margin-top: 5px;
}

#datetime {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 8px;
    font-weight: 500;
    line-height: 1.6;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 13px 22px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-secondary);
    font-size: 14.5px;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: var(--nav-hover-bg);
    color: var(--accent-primary);
    border-left-color: var(--accent-primary);
}

.nav-item.active {
    background: var(--nav-active-bg);
    color: white;
    border-left-color: transparent;
}

.nav-item .nav-icon {
    margin-right: 12px;
    font-size: 16px;
    width: 24px;
    text-align: center;
}

.sidebar-footer {
    margin-top: auto;
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
}

.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px;
    border-radius: 10px;
    cursor: pointer;
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 13px;
    transition: all 0.3s ease;
    width: 100%;
}

.theme-toggle:hover {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

/* ==================== 主内容区 ==================== */
.main-content {
    flex: 1;
    padding: 25px 30px;
    overflow-y: auto;
    margin-left: 220px;
    min-height: 100vh;
}

.page {
    display: none;
    animation: fadeIn 0.4s ease;
}

.page.active {
    display: block;
}

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

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}
.quote-rainbow {
    font-size: 18px;
    font-style: italic;
    font-weight: 500;
    letter-spacing: 0.3px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 25%, #4facfe 50%, #00f2fe 75%, #43e97b 100%);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 6s ease infinite;
}
@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

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

/* ==================== 卡片 ==================== */
.card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: var(--shadow-card);
    transition: all 0.3s ease;
    animation: slideUp 0.4s ease;
}

.card:hover {
    box-shadow: var(--shadow-hover);
}

.card-title {
    font-size: 18px;
    color: var(--text-primary);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-light);
    font-weight: 600;
}

/* ==================== 表单 ==================== */
.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.form-group {
    flex: 1;
    min-width: 180px;
    margin-bottom: 16px;
}

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 11px 15px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 14.5px;
    transition: all 0.3s ease;
    background: var(--bg-input);
    color: var(--text-primary);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.form-group input:disabled,
.form-group select:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ==================== 按钮 ==================== */
.btn {
    padding: 11px 22px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14.5px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: var(--accent-primary);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: var(--bg-hover);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

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

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

.btn-danger:hover {
    background: #ff3344;
    transform: translateY(-2px);
}

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

.btn-success:hover {
    background: #26bd65;
    transform: translateY(-2px);
}

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

.btn-info {
    background: var(--color-info);
    color: white;
}

.btn-small {
    padding: 6px 14px;
    font-size: 12px;
    border-radius: 8px;
}

.btn-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* ==================== 表格 ==================== */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

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

.data-table th {
    background: var(--bg-table-header);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 13.5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

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

.data-table td {
    font-size: 14.5px;
    color: var(--text-secondary);
}

.action-btns {
    display: flex;
    gap: 8px;
}

/* ==================== 成绩表格 ==================== */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.score-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.score-table th,
.score-table td {
    padding: 12px;
    text-align: center;
    border: 1px solid var(--border-color);
}

.score-table th {
    background: var(--score-table-header);
    color: white;
    font-weight: 600;
    font-size: 14px;
}

.score-table td {
    background: var(--bg-card);
    color: var(--text-primary);
}

.score-table input {
    width: 80px;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    text-align: center;
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 14px;
}

.score-table input:focus {
    border-color: var(--accent-primary);
    outline: none;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.15);
}

.score-table input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 不及格成绩颜色标记 */
.score-fail-light {
    color: #e67e22 !important;
    font-weight: 600;
}

.score-fail-medium {
    color: #e74c3c !important;
    font-weight: 700;
}

.score-fail-dark {
    color: #e67e22 !important;
    font-weight: 700;
}

[data-theme="dark"] .score-fail-light {
    color: #f39c12 !important;
}

[data-theme="dark"] .score-fail-medium {
    color: #ff6b6b !important;
}

[data-theme="dark"] .score-fail-dark {
    color: #ff4757 !important;
}

/* ==================== 统计卡片 ==================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 22px;
    text-align: center;
    box-shadow: var(--shadow-card);
    transition: all 0.3s ease;
    cursor: default;
}

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

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

.stat-label {
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 8px;
}

/* ==================== 图表 ==================== */
.chart-container {
    position: relative;
    height: 400px;
    margin: 15px 0;
}

.chart-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
    gap: 25px;
}

/* ==================== 筛选栏 ==================== */
.filter-bar {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    flex-wrap: wrap;
    align-items: end;
}

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

.filter-group label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

.filter-group select,
.filter-group input {
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
    min-width: 150px;
    background: var(--bg-input);
    color: var(--text-primary);
    font-family: inherit;
    transition: border-color var(--duration-fast) var(--ease-smooth),
                box-shadow var(--duration-fast) var(--ease-smooth);
    outline: none;
}
.filter-group select:focus,
.filter-group input:focus {
    border-color: var(--accent-primary);
    box-shadow: var(--input-shadow-focus);
}
.filter-group select {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23888' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

/* ==================== 标签 ==================== */
.subject-tag {
    padding: 7px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.3s ease;
    border: 2px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-muted);
    display: inline-block;
}

.subject-tag:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.subject-tag.selected {
    background: var(--accent-primary);
    color: white;
    border-color: transparent;
}

.subject-selector {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 10px 0;
}

/* ==================== 排名指示 ==================== */
.rank-change {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-weight: 600;
    font-size: 13px;
}

.rank-up { color: var(--color-success); }
.rank-down { color: var(--color-danger); }
.rank-same { color: var(--text-muted); }

/* ==================== 预警样式 ==================== */
.warning-section {
    margin-bottom: 25px;
}

.warning-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-radius: 12px;
    margin-bottom: 10px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.warning-item:hover {
    transform: translateX(5px);
}

.warning-drop {
    background: rgba(255, 71, 87, 0.1);
    border-left: 4px solid var(--color-danger);
    color: var(--text-primary);
}

.warning-fail {
    background: rgba(255, 165, 2, 0.1);
    border-left: 4px solid var(--color-warning);
    color: var(--text-primary);
}

.warning-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.warning-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    border-radius: 11px;
    background: var(--color-danger);
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 0 6px;
    margin-left: 8px;
}

/* ==================== 空状态 ==================== */
.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 56px;
    margin-bottom: 15px;
    opacity: 0.5;
}

/* ==================== 模态框 ==================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-modal-overlay);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 30px;
    max-width: 600px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    animation: modalIn 0.3s ease;
    color: var(--text-primary);
}

.modal-content.modal-lg {
    max-width: 800px;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted);
    background: none;
    border: none;
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--color-danger);
}

/* ==================== Toast ==================== */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    padding: 15px 25px;
    border-radius: 12px;
    color: white;
    font-weight: 500;
    z-index: 2000;
    animation: toastIn 0.4s ease;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    max-width: 400px;
}

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

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

/* ==================== 标签页 ==================== */
.tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border-light);
}

.tab {
    padding: 12px 20px;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    color: var(--text-muted);
    font-weight: 500;
}

.tab:hover {
    color: var(--accent-primary);
}

.tab.active {
    color: var(--accent-primary);
    border-bottom-color: var(--accent-primary);
}

.tab-content {
    display: none;
}

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

/* ==================== 对比分析页 ==================== */
.compare-student-list {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 15px 0;
}

.compare-student-tag {
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.3s ease;
    border: 2px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-secondary);
}

.compare-student-tag:hover {
    border-color: var(--accent-primary);
}

.compare-student-tag.selected {
    background: var(--accent-primary);
    color: white;
    border-color: transparent;
}

.compare-student-tag.cloud-user {
    border-style: dashed;
    border-color: #3498db;
}
.compare-student-tag.cloud-user.selected {
    background: #3498db;
    border-color: transparent;
    border-style: solid;
}

/* ==================== 设置开关 ==================== */
.switch-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
}

.switch {
    position: relative;
    width: 48px;
    height: 26px;
    flex-shrink: 0;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border-color);
    border-radius: 13px;
    transition: 0.3s;
}

.switch-slider::before {
    content: "";
    position: absolute;
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: 0.3s;
}

.switch input:checked + .switch-slider {
    background-color: var(--accent-primary);
}

.switch input:checked + .switch-slider::before {
    transform: translateX(22px);
}

.switch-label {
    color: var(--text-secondary);
    font-size: 14px;
}

/* ==================== 数据导入预览 ==================== */
.import-preview {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    margin: 15px 0;
}

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

.import-preview th,
.import-preview td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}

.import-preview th {
    background: var(--bg-table-header);
    position: sticky;
    top: 0;
    color: var(--text-secondary);
}

.import-status-ok {
    color: var(--color-success);
}

.import-status-dup {
    color: var(--color-warning);
}

.import-status-err {
    color: var(--color-danger);
}





/* ==================== 云端状态 ==================== */
.cloud-status {
    font-size: 11px;
    text-align: center;
    margin-bottom: 14px;
    padding: 4px 10px;
    border-radius: 12px;
    display: none;
}
.cloud-status.online {
    display: block;
    color: #10b981;
    background: #f0fdf4;
}
.cloud-status.offline {
    display: block;
    color: #f59e0b;
    background: #fffbeb;
}
[data-theme="dark"] .cloud-status.online { background: #052e16; }
[data-theme="dark"] .cloud-status.offline { background: #451a03; }
.cloud-badge {
    display: inline-block;
    font-size: 9px;
    padding: 1px 5px;
    border-radius: 3px;
    margin-left: 4px;
    vertical-align: middle;
}
.cloud-badge.synced { background: #d1fae5; color: #065f46; }
.cloud-badge.local { background: #fef3c7; color: #92400e; }
[data-theme="dark"] .cloud-badge.synced { background: #064e3b; color: #6ee7b7; }
[data-theme="dark"] .cloud-badge.local { background: #451a03; color: #fcd34d; }

/* ==================== 用户栏 ==================== */
.user-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 6px;
    font-size: 13px;
}
.user-bar-name {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 13px;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.user-bar-logout {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 12px;
    padding: 2px 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    transition: all 0.2s;
}
.user-bar-logout:hover { color: var(--color-danger, #ef4444); border-color: var(--color-danger, #ef4444); }

/* ==================== 管理员后台 ==================== */
.admin-user-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-color);
    font-size: 13px;
    border-radius: 8px;
    margin: 2px 0;
    transition: background-color 0.15s ease;
    cursor: default;
}
.admin-user-item:hover { background-color: var(--bg-hover); }
.admin-user-item:last-child { border-bottom: none; }
.admin-user-meta { color: var(--text-muted); font-size: 12px; }
.admin-user-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.admin-user-actions .btn { font-size: 11px; padding: 4px 10px; }
.admin-tag { display: inline-block; background: var(--accent-primary); color: white; font-size: 10px; padding: 1px 6px; border-radius: 4px; margin-left: 6px; }
.superadmin-tag { display: inline-block; background: linear-gradient(135deg, #e74c3c, #c0392b); color: white; font-size: 10px; padding: 1px 6px; border-radius: 4px; margin-left: 6px; }
.role-toggle-btn { font-size: 11px; padding: 3px 10px; border: 1px solid var(--border-color); border-radius: 6px; cursor: pointer; background: var(--bg-input); color: var(--text-secondary); transition: all .2s; }
.role-toggle-btn:hover { border-color: var(--accent-primary); color: var(--accent-primary); }
.role-toggle-btn.promote { border-color: var(--accent-primary); color: var(--accent-primary); }
.role-toggle-btn.demote { border-color: var(--color-danger); color: var(--color-danger); }

/* ==================== 登录界面 ==================== */
.lock-screen {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: var(--bg-sidebar);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    padding: 12px;
    box-sizing: border-box;
    overflow-y: auto;
}
.lock-screen.hidden { display: none; }
.lock-box {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 40px;
    width: 420px;
    max-width: 92%;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    text-align: center;
}
.lock-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}
.lock-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 24px;
}
/* lock-input 基础：宽度和盒模型 */
.lock-input {
    width: 100%;
    background: var(--bg-input);
    color: var(--text-primary);
    box-sizing: border-box;
    outline: none;
}
/* lock-btn 基础：宽度和布局 */
.lock-btn {
    width: 100%;
    margin-top: 14px;
    border: none;
    color: white;
    font-weight: 600;
    cursor: pointer;
}
.lock-btn:hover { opacity: 0.85; }
.lock-error {
    color: #ef4444;
    font-size: 13px;
    margin-top: 10px;
    min-height: 18px;
}
.lock-hint {
    color: var(--text-muted);
    font-size: 11px;
    margin-top: 16px;
}
.lock-forgot {
    margin-top: 14px;
    font-size: 12px;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s;
}
.lock-forgot:hover { color: var(--accent-primary); }
.lock-reset-box {
    margin-top: 16px;
    padding: 14px;
    background: var(--bg-hover, #f9fafb);
    border-radius: 8px;
    text-align: center;
}

/* ==================== 汉堡菜单 ==================== */
.hamburger-btn {
    display: none;
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 200;
    width: 40px;
    height: 40px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    padding: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.hamburger-btn span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s ease;
}
.hamburger-btn.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger-btn.active span:nth-child(2) { opacity: 0; }
.hamburger-btn.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.4);
    z-index: 90;
}
.sidebar-overlay.active { display: block; }

/* ==================== 版权信息 ==================== */
.copyright-text {
    text-align: center;
    font-size: 10px;
    color: var(--text-muted);
    padding: 6px 10px 0;
    opacity: 0.7;
}

/* ==================== 表格滚动容器 ==================== */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ==================== 底部联系方式 ==================== */
.main-footer {
    text-align: center;
    padding: 20px 0 10px;
    margin-top: 30px;
    border-top: 1px solid var(--border-color);
    font-size: 12px;
    color: var(--text-muted);
}
.main-footer a {
    color: var(--accent-primary);
    text-decoration: none;
}
.main-footer a:hover { text-decoration: underline; }

/* ==================== 响应式 ==================== */
@media (max-width: 768px) {
    .hamburger-btn { display: flex; }

    .sidebar {
        width: 240px;
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        z-index: 150;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    .sidebar.open { transform: translateX(0); }

    .main-content {
        margin-left: 0;
        padding: 15px;
        padding-top: 58px;
    }

    .chart-grid { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .page-title { font-size: 20px; }
    .chart-container { height: 280px; }

    .card { padding: 16px; margin-bottom: 16px; border-radius: 12px; }
    .stat-value { font-size: 26px; }
    .stat-card { padding: 14px; border-radius: 12px; }

    .modal-content { padding: 20px; width: 95%; border-radius: 12px; }
    .modal-content.modal-lg { max-width: 95%; }

    .toast { left: 15px; right: 15px; bottom: 15px; max-width: none; }

    .page-header { flex-direction: column; align-items: flex-start; gap: 10px; }
    .btn-group { flex-wrap: wrap; }

    .score-table input { width: 60px; padding: 6px; font-size: 13px; }
    .score-table th, .score-table td { padding: 8px 6px; font-size: 12px; }

    /* 数据表格移动端适配 */
    .data-table th, .data-table td { padding: 10px 8px; font-size: 12px; }
    .card { overflow-x: auto; }

    .filter-group select,
    .filter-group input { min-width: 0; width: 100%; }
    .filter-group { flex: 1; min-width: 120px; }

    .copyright-text { display: block; }

    /* 登录注册页移动端适配 */
    .lock-screen {
        align-items: flex-start;
        padding-top: 20px;
        padding-bottom: 20px;
    }
    .lock-box {
        padding: 24px 20px;
        width: 100%;
        max-width: 92%;
        max-height: none;
        overflow-y: visible;
    }
    .lock-title { font-size: 18px; }
    .lock-input { padding: 10px 14px; font-size: 14px; }
    .lock-btn { padding: 12px; font-size: 15px; }

    /* 管理员用户列表移动端适配 */
    .admin-user-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 12px;
    }
    .admin-user-actions {
        flex-wrap: wrap;
        gap: 5px;
        width: 100%;
    }
    .admin-user-actions .btn {
        font-size: 11px;
        padding: 5px 8px;
        flex: 0 0 auto;
    }
    .admin-user-meta { font-size: 11px; line-height: 1.5; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .form-row { flex-direction: column; }
    .form-group { min-width: 100%; }
    .stat-value { font-size: 22px; }
    .chart-container { height: 220px; }
    .score-table input { width: 50px; padding: 5px; font-size: 12px; }
    .card { padding: 12px; }
    .filter-bar { gap: 8px; }

    /* 登录注册页超小屏适配 */
    .lock-box {
        padding: 20px 16px;
        border-radius: 14px;
    }
    .lock-title { font-size: 16px; }
    .lock-input { padding: 9px 12px; font-size: 13px; margin-bottom: 8px; }

    /* 管理员面板超小屏适配 */
    .admin-user-actions .btn {
        font-size: 10px;
        padding: 4px 6px;
    }
}

/* ==================== 打印样式 ==================== */
@media print {
    .sidebar,
    .btn,
    .btn-group,
    .filter-bar,
    .theme-toggle,
    .nav-item,
    .modal,
    .toast,
    .hamburger-btn,
    .sidebar-overlay,
    .quick-fill-bar,
    .threshold-control {
        display: none !important;
    }

    body { background: white !important; }

    .main-content {
        margin-left: 0 !important;
        padding: 10px !important;
    }

    .page {
        display: block !important;
        page-break-inside: avoid;
    }

    .card {
        box-shadow: none !important;
        border: 1px solid #ddd;
        break-inside: avoid;
    }

    body {
        background: white !important;
    }

    .page-title {
        color: #333 !important;
        text-shadow: none !important;
    }

    .stat-value {
        -webkit-text-fill-color: #333 !important;
        color: #333 !important;
    }
}

/* ==================== V3: 目标分达标指示 ==================== */
.goal-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
}

.goal-met {
    color: var(--color-success);
    background: rgba(46, 213, 115, 0.1);
}

.goal-miss {
    color: var(--color-danger);
    background: rgba(255, 71, 87, 0.1);
}

.goal-close {
    color: var(--color-warning);
    background: rgba(255, 165, 2, 0.1);
}

.goal-bar-bg {
    width: 100%;
    height: 6px;
    background: var(--border-color);
    border-radius: 3px;
    margin-top: 4px;
    overflow: hidden;
}

.goal-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease;
}

/* ==================== V3: 诊断卡片 ==================== */
.diagnosis-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px;
    border-radius: 12px;
    background: var(--bg-hover);
    margin-bottom: 12px;
    transition: all 0.3s ease;
    border-left: 4px solid var(--border-color);
}

.diagnosis-card:hover {
    transform: translateX(3px);
}

.diagnosis-strong {
    border-left-color: var(--color-success);
}

.diagnosis-weak {
    border-left-color: var(--color-danger);
}

.diagnosis-progress {
    border-left-color: var(--color-info);
}

.diagnosis-volatile {
    border-left-color: var(--color-warning);
}

.diagnosis-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.diagnosis-content {
    flex: 1;
}

.diagnosis-title {
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.diagnosis-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ==================== V3: 差距趋势 ==================== */
.gap-positive {
    color: var(--color-success);
    font-weight: 600;
}

.gap-negative {
    color: var(--color-danger);
    font-weight: 600;
}

.gap-zero {
    color: var(--text-muted);
}

/* ==================== V3: 考试对比 ==================== */
.exam-diff-up {
    color: var(--color-success);
    font-weight: 600;
}

.exam-diff-down {
    color: var(--color-danger);
    font-weight: 600;
}

.exam-diff-same {
    color: var(--text-muted);
}

/* ==================== V3: 目标设置表 ==================== */
.goal-table {
    width: 100%;
    border-collapse: collapse;
}

.goal-table th,
.goal-table td {
    padding: 10px 12px;
    text-align: center;
    border-bottom: 1px solid var(--border-light);
}

.goal-table th {
    background: var(--bg-table-header);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
}

.goal-table input {
    width: 70px;
    padding: 6px 8px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    text-align: center;
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 14px;
}

.goal-table input:focus {
    border-color: var(--accent-primary);
    outline: none;
}
    
/* ==================== V4: 进步里程碑 ==================== */
.milestone-banner {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    border-radius: 12px;
    margin-bottom: 10px;
    background: rgba(255, 215, 0, 0.08);
    border-left: 4px solid #f9ab00;
    animation: fadeIn 0.5s ease;
}

.milestone-banner:hover {
    transform: translateX(4px);
}

.milestone-icon {
    font-size: 28px;
    flex-shrink: 0;
}

.milestone-text {
    flex: 1;
}

.milestone-title {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 14px;
    margin-bottom: 2px;
}

.milestone-desc {
    font-size: 12px;
    color: var(--text-secondary);
}

/* ==================== V4: 考试备注标记 ==================== */
.exam-note-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 3px 10px;
    background: rgba(79, 172, 254, 0.1);
    border: 1px solid rgba(79, 172, 254, 0.2);
    border-radius: 12px;
    font-size: 11px;
    color: var(--color-info);
    font-weight: 500;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ==================== V4: 快捷操作栏 ==================== */
.quick-fill-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.quick-fill-btn {
    padding: 5px 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    background: var(--bg-hover);
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.quick-fill-btn:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.kbd-hint {
    display: inline-block;
    padding: 1px 5px;
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 11px;
    color: var(--text-secondary);
    font-family: monospace;
    margin-left: 4px;
}

/* V4: 排名变化追踪 */
.rank-overview-table { width: 100%; border-collapse: collapse; }
.rank-overview-table th,
.rank-overview-table td { padding: 8px 12px; text-align: center; border-bottom: 1px solid var(--border-color); font-size: 13px; }
.rank-overview-table th { font-weight: 600; color: var(--text-secondary); }
.rank-overview-table tr:hover { background: var(--bg-hover); }
.rank-up { color: #10b981; font-weight: 600; }
.rank-down { color: #ef4444; font-weight: 600; }
.rank-same { color: #6b7280; }
.rank-exam-label { font-size: 13px; color: var(--text-muted); margin-bottom: 8px; }

/* V4: 薄弱科目预警 */
.weak-alert-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border-color); }
.weak-alert-item:last-child { border-bottom: none; }
.weak-alert-name { font-weight: 600; min-width: 56px; font-size: 14px; }
.weak-alert-subjects { display: flex; flex-wrap: wrap; gap: 6px; }
.weak-subject-tag { background: #fef2f2; color: #dc2626; padding: 3px 10px; border-radius: 12px; font-size: 12px; border: 1px solid #fecaca; }
[data-theme="dark"] .weak-subject-tag { background: #451a1a; color: #fca5a5; border-color: #7f1d1d; }
.empty-state-small { text-align: center; padding: 20px; color: var(--text-muted); font-size: 14px; }
.threshold-control { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; font-size: 13px; color: var(--text-secondary); }
.threshold-control input[type="range"] { width: 120px; accent-color: var(--accent-primary); }

/* V4: 家长报告 */
.parent-report-preview { background: var(--bg-hover); border-radius: 8px; padding: 12px 16px; margin-top: 10px; font-size: 13px; color: var(--text-secondary); }

/* V4: CSV 导入 */
.csv-paste-area { width: 100%; min-height: 100px; border: 1px dashed var(--border-color); border-radius: 8px; padding: 12px; font-family: monospace; font-size: 12px; resize: vertical; background: var(--bg-card); color: var(--text-primary); }
.csv-paste-area:focus { border-color: var(--accent-primary); outline: none; }
.import-format-hint { font-size: 12px; color: var(--text-muted); margin-top: 8px; line-height: 1.6; }

/* ==================== V2.1: 视觉质感升级 ==================== */

/* 渐变主题色 */
:root {
    --gradient-primary: linear-gradient(135deg, #e67e22 0%, #f39c12 100%);
    --gradient-success: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    --gradient-warning: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-info: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --shadow-card: 0 4px 20px rgba(0,0,0,0.06);
    --shadow-card-hover: 0 8px 30px rgba(0,0,0,0.12);
}
[data-theme="dark"] {
    --shadow-card: 0 4px 20px rgba(0,0,0,0.3);
    --shadow-card-hover: 0 8px 30px rgba(0,0,0,0.5);
}

/* 卡片升级 */
.card {
    box-shadow: var(--shadow-card);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-card-hover);
}

/* 按钮动效 */
.btn {
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}
.btn:active { transform: scale(0.96); }
.btn-primary {
    background: var(--gradient-primary) !important;
    border: none;
    color: #fff;
}
.btn-success {
    background: var(--gradient-success) !important;
    border: none;
    color: #fff;
}

/* 统计卡片渐变背景 */
.stat-card {
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease;
}
.stat-card:hover { transform: translateY(-3px); }
.stat-card:nth-child(1) .stat-value { color: #e67e22; }
.stat-card:nth-child(2) .stat-value { color: #11998e; }
.stat-card:nth-child(3) .stat-value { color: #f5576c; }
.stat-card:nth-child(4) .stat-value { color: #4facfe; }

/* 导航项动效 */
.nav-item {
    transition: all 0.2s ease;
    border-radius: 10px;
    margin: 2px 8px;
}
.nav-item:hover {
    background: rgba(230, 126, 34, 0.1);
    transform: translateX(4px);
}
.nav-item.active {
    background: var(--gradient-primary) !important;
    color: #fff !important;
}
.nav-item.active:hover { transform: translateX(0); }

/* 页面切换动画 */
.page { animation: fadeSlideIn 0.3s ease; }
@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 登录页升级 */
.lock-box {
    background: var(--bg-primary);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
    backdrop-filter: blur(10px);
}
/* lock-input/lock-btn 精修已移至第16节统一管理 */

/* 表格升级 */
.data-table tbody tr {
    transition: background 0.15s ease;
}
.data-table tbody tr:hover {
    background: rgba(102, 126, 234, 0.06);
}

/* Toast 升级 */
.toast {
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    animation: toastSlide 0.3s ease;
}
@keyframes toastSlide {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* ==================== V2.1: 仪表盘概览 ==================== */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}
.dash-card {
    background: var(--bg-primary);
    border-radius: 16px;
    padding: 20px;
    box-shadow: var(--shadow-card);
    position: relative;
    overflow: hidden;
}
.dash-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
}
.dash-card:nth-child(1)::before { background: var(--gradient-primary); }
.dash-card:nth-child(2)::before { background: var(--gradient-success); }
.dash-card:nth-child(3)::before { background: var(--gradient-warning); }
.dash-card:nth-child(4)::before { background: var(--gradient-info); }
.dash-icon {
    width: 40px; height: 40px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
    margin-bottom: 12px;
}
.dash-card:nth-child(1) .dash-icon { background: rgba(102,126,234,0.12); }
.dash-card:nth-child(2) .dash-icon { background: rgba(17,153,142,0.12); }
.dash-card:nth-child(3) .dash-icon { background: rgba(245,87,108,0.12); }
.dash-card:nth-child(4) .dash-icon { background: rgba(79,172,254,0.12); }
.dash-number {
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 4px;
}
.dash-label {
    font-size: 12px;
    color: var(--text-muted);
}

/* ==================== V2.1: 学习激励 ==================== */
.motivation-card {
    background: var(--gradient-primary);
    color: #fff;
    border-radius: 16px;
    padding: 24px 28px;
    margin-top: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    box-shadow: 0 4px 20px rgba(230,126,34,0.3);
}
.motivation-left { flex: 1; }
.motivation-title {
    font-size: 14px;
    opacity: 0.85;
    margin-bottom: 8px;
    font-weight: 600;
}
.motivation-quote {
    font-size: 16px;
    line-height: 1.7;
    font-style: italic;
}
.motivation-author {
    font-size: 12px;
    opacity: 0.7;
    margin-top: 6px;
}
.motivation-right {
    text-align: center;
    min-width: 110px;
}
.countdown-label {
    font-size: 12px;
    opacity: 0.8;
}
.countdown-number {
    font-size: 48px;
    font-weight: 800;
    line-height: 1.1;
    margin: 4px 0;
}
.countdown-unit {
    font-size: 14px;
    opacity: 0.85;
}

/* ==================== V2.1: 增强指标卡片 ==================== */
.dashboard-metrics {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin: 20px 0;
}
.metric-card {
    background: var(--bg-primary);
    border-radius: 14px;
    padding: 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: var(--shadow-card);
    border-left: 4px solid var(--accent, #e67e22);
    transition: transform 0.2s, box-shadow 0.2s;
}
.metric-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}
.metric-icon {
    font-size: 28px;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(102,126,234,0.08);
    display: flex;
    align-items: center;
    justify-content: center;
}
.metric-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}
.metric-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* 目标进度条 */
.goal-progress-bar {
    height: 8px;
    background: var(--bg-secondary);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 8px;
}
.goal-progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.6s ease;
}

/* ==================== V2.1: 个人中心 ==================== */
.profile-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}
.profile-avatar {
    width: 64px; height: 64px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex; align-items: center; justify-content: center;
    font-size: 28px;
    color: #fff;
    font-weight: 700;
}
.profile-info h3 { margin: 0 0 4px; font-size: 18px; }
.profile-info p { margin: 0; font-size: 13px; color: var(--text-muted); }
.theme-selector {
    display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap;
}
.theme-btn {
    width: 36px; height: 36px;
    border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
}
.theme-btn:hover { transform: scale(1.15); }
.theme-btn.active { border-color: var(--text-primary); box-shadow: 0 0 0 2px var(--bg-primary); }

@media (max-width: 768px) {
    .dashboard-grid { grid-template-columns: repeat(2, 1fr); }
    .dashboard-metrics { grid-template-columns: repeat(2, 1fr); }
    .motivation-card { flex-direction: column; text-align: center; }
    .motivation-right { min-width: auto; }
    .metric-value { font-size: 20px; }
    .countdown-number { font-size: 36px; }
}

/* ================================================================
   V2.2: UI 全面精修 — 视觉质感 · 交互细节 · 移动端优化
   ================================================================ */

/* ---------- 新增设计 Token ---------- */
:root {
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
    --duration-fast: 0.18s;
    --duration-normal: 0.28s;
    --bg-login-pattern: radial-gradient(circle at 20% 80%, rgba(230,126,34,0.08) 0%, transparent 50%),
                        radial-gradient(circle at 80% 20%, rgba(243,156,18,0.06) 0%, transparent 50%),
                        radial-gradient(circle at 50% 50%, rgba(79,172,254,0.04) 0%, transparent 60%);
    --glass-bg: rgba(255,255,255,0.72);
    --glass-border: rgba(255,255,255,0.35);
    --glass-shadow: 0 8px 32px rgba(0,0,0,0.08);
    --input-shadow-focus: 0 0 0 3px rgba(230,126,34,0.15), 0 2px 8px rgba(230,126,34,0.1);
    --btn-glow: 0 4px 18px rgba(230,126,34,0.35);
}
[data-theme="dark"] {
    --bg-login-pattern: radial-gradient(circle at 20% 80%, rgba(240,147,43,0.06) 0%, transparent 50%),
                        radial-gradient(circle at 80% 20%, rgba(246,185,59,0.04) 0%, transparent 50%),
                        radial-gradient(circle at 50% 50%, rgba(106,188,255,0.03) 0%, transparent 60%);
    --glass-bg: rgba(30,30,58,0.8);
    --glass-border: rgba(58,58,90,0.5);
    --glass-shadow: 0 8px 32px rgba(0,0,0,0.25);
    --input-shadow-focus: 0 0 0 3px rgba(240,147,43,0.2), 0 2px 8px rgba(240,147,43,0.12);
    --btn-glow: 0 4px 18px rgba(240,147,43,0.3);
}

/* ---------- 1. 登录页视觉升级 ---------- */
.lock-screen {
    background: var(--bg-main);
    background-image: var(--bg-login-pattern);
}
.lock-screen::before {
    content: '';
    position: absolute;
    top: -40%; right: -30%;
    width: 600px; height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(230,126,34,0.06) 0%, transparent 70%);
    pointer-events: none;
    animation: loginOrb1 20s ease-in-out infinite alternate;
}
.lock-screen::after {
    content: '';
    position: absolute;
    bottom: -30%; left: -20%;
    width: 500px; height: 500px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(79,172,254,0.05) 0%, transparent 70%);
    pointer-events: none;
    animation: loginOrb2 25s ease-in-out infinite alternate;
}
@keyframes loginOrb1 {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(-60px, 40px) scale(1.15); }
}
@keyframes loginOrb2 {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(50px, -30px) scale(1.1); }
}

.lock-box {
    position: relative;
    z-index: 1;
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(1.3);
    -webkit-backdrop-filter: blur(20px) saturate(1.3);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: 44px 40px 36px;
    box-shadow: var(--glass-shadow), 0 1px 0 rgba(255,255,255,0.1) inset;
    animation: lockBoxIn 0.5s var(--ease-spring) both;
}
@keyframes lockBoxIn {
    from { opacity: 0; transform: translateY(24px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.lock-title {
    font-size: 22px;
    letter-spacing: -0.3px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.lock-input {
    text-align: left;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 13px 16px;
    font-size: 14px;
    transition: border-color var(--duration-fast) var(--ease-smooth),
                box-shadow var(--duration-fast) var(--ease-smooth),
                background var(--duration-fast);
}
.lock-input:hover {
    border-color: rgba(230,126,34,0.35);
}
.lock-input:focus {
    border-color: var(--accent-primary);
    box-shadow: var(--input-shadow-focus);
    background: var(--bg-card);
}
.lock-input::placeholder {
    color: var(--text-light);
    font-weight: 400;
}

.lock-btn {
    border-radius: var(--radius-md);
    padding: 13px;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 2px;
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    box-shadow: 0 2px 10px rgba(230,126,34,0.2);
    transition: all var(--duration-normal) var(--ease-smooth);
    position: relative;
    overflow: hidden;
}
.lock-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, transparent 50%);
    opacity: 0;
    transition: opacity var(--duration-fast);
}
.lock-btn:hover {
    opacity: 1;
    box-shadow: var(--btn-glow);
    transform: translateY(-2px);
}
.lock-btn:hover::after { opacity: 1; }
.lock-btn:active {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 2px 8px rgba(230,126,34,0.15);
}

.lock-hint a {
    position: relative;
    transition: color var(--duration-fast);
}
.lock-hint a::after {
    content: '';
    position: absolute;
    left: 0; bottom: -2px;
    width: 0; height: 1.5px;
    background: var(--accent-primary);
    transition: width var(--duration-normal) var(--ease-smooth);
}
.lock-hint a:hover::after { width: 100%; }

/* 登录/注册切换动画 */
#login-form, #register-form {
    animation: formFadeIn 0.35s var(--ease-smooth) both;
}
@keyframes formFadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---------- 2. 侧边栏精修 ---------- */
.sidebar {
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) transparent;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 4px; }

.logo h1 {
    font-size: 17px;
    letter-spacing: -0.3px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.version-badge {
    background: rgba(230,126,34,0.1);
    color: var(--accent-primary);
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.nav-item {
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    margin: 1px 8px;
    font-size: 14px;
    transition: all var(--duration-fast) var(--ease-smooth);
    position: relative;
}
.nav-item::before {
    content: '';
    position: absolute;
    left: 0; top: 50%;
    transform: translateY(-50%) scaleY(0);
    width: 3px; height: 60%;
    border-radius: 0 3px 3px 0;
    background: var(--accent-primary);
    transition: transform var(--duration-normal) var(--ease-spring);
}
.nav-item:hover {
    background: rgba(230,126,34,0.06);
    transform: translateX(2px);
}
.nav-item:hover::before {
    transform: translateY(-50%) scaleY(1);
}
.nav-item.active {
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%) !important;
    color: #fff !important;
    box-shadow: 0 3px 12px rgba(230,126,34,0.3);
}
.nav-item.active::before { display: none; }
.nav-item.active:hover {
    transform: translateX(0);
}
.nav-item .nav-icon {
    font-size: 16px;
    width: 22px;
    text-align: center;
    transition: transform var(--duration-fast) var(--ease-spring);
}
.nav-item:hover .nav-icon {
    transform: scale(1.12);
}

.user-bar {
    background: rgba(230,126,34,0.06);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    transition: background var(--duration-fast);
}
.user-bar:hover {
    background: rgba(230,126,34,0.1);
}

.sidebar-footer {
    border-top: 1px solid var(--border-light);
    padding-top: 12px;
    margin-top: auto;
}
.theme-toggle {
    border-radius: var(--radius-sm);
    transition: all var(--duration-fast) var(--ease-smooth);
}
.theme-toggle:hover {
    background: var(--bg-hover);
    transform: scale(1.02);
}

/* ---------- 3. 卡片系统精修 ---------- */
.card {
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    transition: transform var(--duration-normal) var(--ease-smooth),
                box-shadow var(--duration-normal) var(--ease-smooth),
                border-color var(--duration-fast);
}
.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 36px rgba(0,0,0,0.08);
    border-color: var(--border-color);
}
[data-theme="dark"] .card:hover {
    box-shadow: 0 12px 36px rgba(0,0,0,0.25);
}

.card-title {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.2px;
    color: var(--text-primary);
    padding-bottom: 12px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Stat Cards 升级 */
.stat-card {
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    position: relative;
    overflow: hidden;
    transition: all var(--duration-normal) var(--ease-smooth);
}
.stat-card::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    opacity: 0;
    transition: opacity var(--duration-fast);
}
.stat-card:hover::after { opacity: 1; }
.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 28px rgba(0,0,0,0.1);
}

.stat-value {
    font-weight: 800;
    letter-spacing: -1px;
}
.stat-label {
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

/* Metric Cards 精修 */
.metric-card {
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    transition: all var(--duration-normal) var(--ease-smooth);
}
.metric-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}
[data-theme="dark"] .metric-card:hover {
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

/* ---------- 4. 表格精修 ---------- */
.score-table, .data-table, .rank-overview-table {
    border-collapse: separate;
    border-spacing: 0;
}
.score-table thead th,
.data-table thead th,
.rank-overview-table thead th {
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    padding: 10px 12px;
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
}
.score-table tbody td,
.data-table tbody td,
.rank-overview-table tbody td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-light);
    transition: background var(--duration-fast);
}
.score-table tbody tr:hover td,
.data-table tbody tr:hover td,
.rank-overview-table tbody tr:hover td {
    background: rgba(230,126,34,0.03);
}
.score-table tbody tr:last-child td,
.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* 表格输入框优化 */
.score-table input[type="number"] {
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 7px 10px;
    text-align: center;
    transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
    background: var(--bg-input);
    color: var(--text-primary);
    -moz-appearance: textfield;
}
.score-table input[type="number"]::-webkit-inner-spin-button,
.score-table input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none; margin: 0;
}
.score-table input[type="number"]:focus {
    border-color: var(--accent-primary);
    box-shadow: var(--input-shadow-focus);
    outline: none;
}

/* 表格横向滚动提示 */
.table-responsive {
    position: relative;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) transparent;
}
.table-responsive::-webkit-scrollbar { height: 5px; }
.table-responsive::-webkit-scrollbar-track { background: transparent; }
.table-responsive::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 4px; }

/* ---------- 5. 表单精修 ---------- */
/* 统一 form-control 样式 */
.form-control {
    display: block;
    width: 100%;
    padding: 10px 14px;
    font-size: 14px;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    transition: border-color var(--duration-fast) var(--ease-smooth),
                box-shadow var(--duration-fast) var(--ease-smooth);
    outline: none;
}
.form-control:hover {
    border-color: var(--accent-secondary);
}
.form-control:focus {
    border-color: var(--accent-primary);
    box-shadow: var(--input-shadow-focus);
}
.form-control::placeholder {
    color: var(--text-light);
}
select.form-control {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23888' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

select, input[type="text"], input[type="password"], input[type="number"], input[type="date"], textarea {
    border-radius: var(--radius-sm);
    transition: border-color var(--duration-fast) var(--ease-smooth),
                box-shadow var(--duration-fast) var(--ease-smooth);
}
select:focus, input[type="text"]:focus, input[type="password"]:focus, input[type="date"]:focus, textarea:focus {
    box-shadow: var(--input-shadow-focus);
    outline: none;
}
select {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23888' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

/* Form label 样式统一 */
.form-group label {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    display: inline-block;
}

/* ---------- 6. 按钮系统精修 ---------- */
.btn {
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 13px;
    padding: 8px 16px;
    transition: all var(--duration-fast) var(--ease-smooth);
    cursor: pointer;
    position: relative;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(0.97); }

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary)) !important;
    border: none;
    color: #fff;
    box-shadow: 0 2px 8px rgba(230,126,34,0.2);
}
.btn-primary:hover {
    box-shadow: 0 4px 16px rgba(230,126,34,0.35);
}

.btn-danger {
    background: linear-gradient(135deg, #ff4757, #ff6b7a) !important;
    border: none;
    color: #fff;
}
.btn-danger:hover {
    box-shadow: 0 4px 16px rgba(255,71,87,0.35);
}

.btn-warning {
    background: linear-gradient(135deg, #ffa502, #ffb832) !important;
    border: none;
    color: #fff;
}

.btn-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ---------- 7. 弹窗 / Overlay 精修 ---------- */
.modal.active {
    animation: modalBgIn 0.25s var(--ease-smooth) both;
}
@keyframes modalBgIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    border-radius: var(--radius-xl);
    border: 1px solid var(--glass-border);
    box-shadow: 0 24px 80px rgba(0,0,0,0.15), 0 0 0 1px rgba(255,255,255,0.05) inset;
    animation: modalContentIn 0.35s var(--ease-spring) both;
}
@keyframes modalContentIn {
    from { opacity: 0; transform: scale(0.92) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-title {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.modal-close {
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    transition: all var(--duration-fast);
    font-size: 18px;
}
.modal-close:hover {
    background: rgba(239,68,68,0.1);
    color: var(--color-danger);
}

/* ---------- 8. Toast 精修 ---------- */
.toast {
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.12);
    animation: toastIn 0.4s var(--ease-spring) both;
}
@keyframes toastIn {
    from { opacity: 0; transform: translateY(30px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---------- 9. 空状态 ---------- */
.empty-state {
    padding: 48px 24px;
    text-align: center;
}
.empty-state-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.6;
    animation: emptyBounce 3s ease-in-out infinite;
}
@keyframes emptyBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}
.empty-state p {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.6;
}

/* ---------- 10. 滚动条全局优化 ---------- */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) transparent;
}
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--scrollbar-thumb-hover); }

/* ---------- 11. 页面标题精修 ---------- */
.page-title {
    font-weight: 800;
    letter-spacing: -0.5px;
    position: relative;
}

/* ---------- 12. 筛选栏精修 ---------- */
.filter-bar {
    background: var(--bg-hover);
    padding: 14px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: flex-end;
}
.filter-group label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 4px;
    display: block;
}

/* ---------- 13. Dashboard Dash-Card 精修 ---------- */
.dash-card {
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    transition: all var(--duration-normal) var(--ease-smooth);
}
.dash-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 36px rgba(0,0,0,0.08);
}

/* ---------- 14. 激励卡片精修 ---------- */
.motivation-card {
    border-radius: var(--radius-xl);
    background: linear-gradient(135deg, var(--accent-primary) 0%, #d35400 50%, var(--accent-secondary) 100%);
    background-size: 200% 200%;
    animation: gradientShift 8s ease infinite;
    position: relative;
    overflow: hidden;
}
.motivation-card::before {
    content: '';
    position: absolute;
    top: -50%; right: -30%;
    width: 300px; height: 300px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    pointer-events: none;
}
.motivation-card::after {
    content: '';
    position: absolute;
    bottom: -40%; left: -20%;
    width: 250px; height: 250px;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
    pointer-events: none;
}
@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.motivation-quote {
    font-size: 16px;
    line-height: 1.8;
    text-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.countdown-number {
    font-weight: 900;
    text-shadow: 0 2px 10px rgba(0,0,0,0.15);
}

/* ---------- 15. Admin 面板精修 ---------- */
.admin-user-item {
    padding: 14px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    margin-bottom: 8px;
    background: var(--bg-card);
    transition: all var(--duration-fast) var(--ease-smooth);
}
.admin-user-item:hover {
    border-color: var(--border-color);
    box-shadow: 0 4px 16px rgba(0,0,0,0.04);
}
[data-theme="dark"] .admin-user-item:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}
.admin-tag {
    display: inline-block;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: #fff;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 6px;
    margin-left: 6px;
    font-weight: 600;
}
.superadmin-tag {
    display: inline-block;
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: #fff;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 6px;
    margin-left: 6px;
    font-weight: 600;
}
.role-toggle-btn {
    padding: 4px 10px;
    font-size: 12px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all var(--duration-fast);
    background: var(--bg-input);
    color: var(--text-secondary);
}
.role-toggle-btn.promote {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}
.role-toggle-btn.promote:hover {
    background: var(--accent-primary);
    color: #fff;
}
.role-toggle-btn.demote {
    border-color: var(--color-danger);
    color: var(--color-danger);
}
.role-toggle-btn.demote:hover {
    background: var(--color-danger);
    color: #fff;
}

/* ---------- 16. 考试备注/标签优化 ---------- */
.exam-note-badge {
    border-radius: 8px;
    font-weight: 600;
    transition: all var(--duration-fast);
}
.exam-note-badge:hover {
    background: rgba(79,172,254,0.15);
}

.subject-tag, .weak-subject-tag {
    border-radius: 8px;
    font-weight: 500;
    transition: all var(--duration-fast);
}
.subject-tag:hover, .weak-subject-tag:hover {
    transform: translateY(-1px);
}

/* ---------- 17. Profile 页精修 ---------- */
.profile-avatar {
    width: 72px; height: 72px;
    font-size: 32px;
    box-shadow: 0 4px 16px rgba(230,126,34,0.25);
    transition: transform var(--duration-normal) var(--ease-spring);
}
.profile-avatar:hover {
    transform: scale(1.08) rotate(5deg);
}

/* ---------- 18. 进步里程碑精修 ---------- */
.milestone-banner {
    border-radius: var(--radius-md);
    border: 1px solid rgba(249,171,0,0.15);
    transition: all var(--duration-normal) var(--ease-smooth);
}
.milestone-banner:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 16px rgba(249,171,0,0.08);
}

/* ---------- 19. 快捷操作栏精修 ---------- */
.quick-fill-btn {
    border-radius: 8px;
    font-weight: 500;
    transition: all var(--duration-fast) var(--ease-smooth);
}
.quick-fill-btn:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    background: rgba(230,126,34,0.06);
    transform: translateY(-1px);
}
.quick-fill-btn:active {
    transform: translateY(0) scale(0.97);
}

/* ---------- 20. 图表容器优化 ---------- */
.chart-container {
    border-radius: var(--radius-md);
    overflow: hidden;
}

/* ---------- 21. 选择框美化（记住登录 checkbox） ---------- */
input[type="checkbox"] {
    accent-color: var(--accent-primary);
    cursor: pointer;
}

/* ---------- 22. 云状态指示器美化 ---------- */
.cloud-status {
    font-size: 12px;
    padding: 6px 14px;
    border-radius: 8px;
    background: rgba(230,126,34,0.06);
    margin-bottom: 14px;
    transition: all var(--duration-fast);
}

/* ==================== V2.2 移动端增强 ==================== */
@media (max-width: 768px) {
    .lock-box {
        padding: 28px 22px 24px;
        border-radius: var(--radius-xl);
        backdrop-filter: blur(16px);
    }
    .lock-screen::before,
    .lock-screen::after {
        display: none;
    }

    .card {
        border-radius: var(--radius-md);
    }

    .sidebar.open {
        box-shadow: 8px 0 40px rgba(0,0,0,0.15);
    }
    [data-theme="dark"] .sidebar.open {
        box-shadow: 8px 0 40px rgba(0,0,0,0.4);
    }

    .stat-card:hover,
    .card:hover,
    .metric-card:hover,
    .dash-card:hover {
        transform: none;
    }

    .admin-user-item {
        padding: 12px;
        border-radius: var(--radius-sm);
    }
    .admin-user-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        width: 100%;
    }
    .admin-user-actions .btn {
        flex: 0 0 auto;
        font-size: 11px;
        padding: 6px 10px;
        border-radius: 6px;
    }

    .filter-bar {
        padding: 12px;
        gap: 10px;
    }

    .motivation-card {
        border-radius: var(--radius-lg);
        padding: 20px;
    }
    .motivation-card::before,
    .motivation-card::after {
        display: none;
    }

    .modal-content {
        border-radius: var(--radius-lg);
        padding: 24px 20px;
        margin: 12px;
    }

    .quick-fill-bar {
        gap: 6px;
    }
    .quick-fill-btn {
        padding: 6px 10px;
        font-size: 11px;
    }

    /* 触摸友好的按钮尺寸 */
    .btn {
        min-height: 38px;
        padding: 8px 14px;
    }

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

    /* 改进移动端表格体验 */
    .score-table input[type="number"] {
        width: 56px;
        padding: 8px 4px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .lock-box {
        padding: 24px 18px 20px;
        border-radius: var(--radius-lg);
    }
    .lock-title {
        font-size: 18px;
    }
    .lock-btn {
        letter-spacing: 1px;
    }

    .dashboard-metrics {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    .metric-card {
        padding: 14px;
        gap: 10px;
    }
    .metric-icon {
        width: 40px; height: 40px;
        font-size: 22px;
    }
    .metric-value {
        font-size: 18px;
    }

    .admin-user-actions .btn {
        font-size: 10px;
        padding: 5px 8px;
    }

    .card {
        padding: 14px;
    }

    .modal-content {
        border-radius: var(--radius-md);
        padding: 20px 16px;
    }
}

/* ---------- 全局选择效果 ---------- */
::selection {
    background: rgba(230,126,34,0.2);
    color: var(--text-primary);
}
[data-theme="dark"] ::selection {
    background: rgba(240,147,43,0.25);
}

