:root {
    /* ============ Brand & Semantic Colors (V3.0 升级) ============ */
    --primary: #1890FF;        /* 科技蓝 - 主色调 (V3.0优化) */
    --primary-light: #40A9FF;  /* 浅蓝色 */
    --primary-dark: #096DD9;   /* 深蓝色 */
    --primary-hover: #40A9FF;  /* 悬停蓝色 */
    --primary-active: #096DD9; /* 激活蓝色 */
    
    /* 辅助色 - V3.0优化 */
    --secondary: #6c757d;      /* 灰色 */
    --secondary-hover: #5a6268;
    --success: #52C41A;        /* 成功绿 (V3.0) */
    --success-hover: #389e0d;
    --info: #13C2C2;          /* 信息青 (V3.0) */
    --info-hover: #08979c;
    --warning: #FA8C16;        /* 警告橙 (V3.0) */
    --warning-hover: #d46b08;
    --danger: #F5222D;         /* 危险红 (V3.0) */
    --danger-hover: #cf1322;
    --light: #f8f9fa;         /* 浅灰 */
    --dark: #343a40;          /* 深灰 */
    
    /* 教育功能色 (V3.0新增) */
    --excellent-gold: #FAAD14;      /* 优秀 */
    --knowledge-purple: #722ED1;    /* 知识点 */
    --chart-blue: #2F54EB;          /* 图表蓝 */
    --chart-green: #52C41A;         /* 图表绿 */
    
    /* Brand Aliases (UI设计方案V2.6) */
    --color-brand: var(--primary);
    --color-brand-contrast: #ffffff;
    --color-success: var(--success);
    --color-warning: var(--warning);
    --color-danger: var(--danger);
    --color-info: var(--info)
    
    /* 科技蓝玻璃态界面主色系 - 完全符合UI设计方案 */
    --glass-primary: rgba(0, 123, 255, 0.85);
    --glass-primary-light: rgba(0, 123, 255, 0.1);
    --glass-primary-medium: rgba(0, 123, 255, 0.25);
    --glass-border: rgba(0, 123, 255, 0.18);
    --glass-shadow: 0 8px 32px 0 rgba(0, 123, 255, 0.15);
    --glass-backdrop-filter: blur(16px);
    --glass-webkit-backdrop-filter: blur(16px);
    
    /* 导航栏颜色 - 优化为更现代的科技蓝风格 */
    --sidebar-bg: #1a1f36;     /* 深科技蓝背景 */
    --sidebar-text: #ffffff;   /* 白色文字 */
    --sidebar-hover-bg: rgba(0, 123, 255, 0.15); /* 科技蓝悬停 */
    --sidebar-active-bg: var(--primary); /* 激活使用主色 */
    --sidebar-active-text: #ffffff; 
    --sidebar-group-title-color: #a0a9c0; /* 柔和的蓝灰色 */
    --sidebar-border-color: rgba(255, 255, 255, 0.1);
    
    /* 灰色系 */
    --gray-100: #f8f9fa;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #adb5bd;
    --gray-600: #6c757d;
    --gray-700: #495057;
    --gray-800: #343a40;
    --gray-900: #212529;
    
    /* 背景色 */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #e9ecef;
    
    /* 文字颜色 */
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --text-muted: #adb5bd;
    --text-light: #f8f9fa;
    
    /* Text Aliases (UI设计方案V2.6) */
    --color-text: var(--text-primary);
    --color-text-secondary: var(--text-secondary);
    --color-text-muted: var(--text-muted);
    
    /* 边框颜色 */
    --border-color: #dee2e6;
    --border-light: #e9ecef;
    --color-border: var(--border-color);
    --color-border-light: var(--border-light);
    
    /* ============ Elevation (阴影等级 - UI设计方案V2.6) ============ */
    --elev-0: none;
    --elev-1: 0 1px 2px rgba(0,0,0,0.06), 0 1px 1px rgba(0,0,0,0.04);
    --elev-2: 0 4px 8px rgba(0,0,0,0.10);
    --elev-3: 0 8px 16px rgba(0,0,0,0.14);
    --elev-4: 0 12px 24px rgba(0,0,0,0.18);
    
    /* 旧版本兼容 */
    --shadow-sm: 0 2px 4px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 8px 0 rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 16px 0 rgba(0, 0, 0, 0.15);
    --shadow-xl: 0 16px 32px 0 rgba(0, 0, 0, 0.2);
    --shadow-2xl: 0 24px 48px 0 rgba(0, 0, 0, 0.25);
    --glass-shadow: 0 8px 32px 0 rgba(0, 123, 255, 0.15);
    --box-shadow: var(--shadow-md);
    --box-shadow-lg: var(--shadow-lg);
    --box-shadow-sm: var(--shadow-sm);
    
    /* 圆角系统 - 符合UI设计方案要求 */
    --radius-xs: 4px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-2xl: 32px;
    --radius-full: 9999px;
    
    /* 旧版本兼容 */
    --border-radius: var(--radius-md);
    --border-radius-sm: var(--radius-sm);
    --border-radius-lg: var(--radius-xl);
    
    /* ============ Focus & States (UI设计方案V2.6) ============ */
    --focus-ring: rgba(13, 110, 253, 0.4);
    --focus-ring-width: 2px;
    --hover-opacity: 0.9;
    --hover-factor: 1.04;  /* 4% 加深 */
    --active-opacity: 0.8;
    --active-factor: 1.08; /* 8% 加深 */
    --disabled-opacity: 0.5;
    
    /* ============ Transition (UI设计方案V2.6) ============ */
    --transition-fast: 150ms ease-in-out;
    --transition-base: 250ms ease-in-out;
    --transition-slow: 350ms ease-in-out;
    
    /* 旧版本兼容 */
    --transition: all 0.3s ease;
    
    /* 布局 */
    --sidebar-width: 280px;
    --sidebar-collapsed-width: 80px;
    --header-height: 70px;
    --container-max-width: 1200px;
    
    /* ============ Typography (UI设计方案V2.6) ============ */
    --font-family-base: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Microsoft YaHei", sans-serif;
    --font-family-monospace: "SFMono-Regular", Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    
    --font-size-xs: 0.75rem;   /* 12px */
    --font-size-sm: 0.875rem;  /* 14px */
    --font-size-base: 1rem;    /* 16px */
    --font-size-lg: 1.125rem;  /* 18px */
    --font-size-xl: 1.25rem;   /* 20px */
    --font-size-2xl: 1.5rem;   /* 24px */
    --font-size-3xl: 1.875rem; /* 30px */
    
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    
    --line-height-tight: 1.25;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.75;
    
    /* 旧版本兼容 */
    --font-family-sans-serif: var(--font-family-base);
    
    /* 间距 */
    --spacer: 1rem;
    --spacer-sm: 0.5rem;
    --spacer-lg: 1.5rem;
    --spacer-xl: 3rem;
    
    --spacer-1: 0.25rem;
    --spacer-2: 0.5rem;
    --spacer-3: 0.75rem;
    --spacer-4: 1rem;
    --spacer-5: 1.25rem;
    --spacer-6: 1.5rem;
    --spacer-8: 2rem;
    --spacer-10: 2.5rem;
    --spacer-12: 3rem;
    
    /* 组件特定变量 */
    --card-spacer-x: 1.25rem;
    --card-spacer-y: 0.75rem;
    --card-border-width: 1px;
    --card-cap-bg: var(--bg-secondary);
    --card-cap-color: var(--text-primary);
    
    --btn-padding-x: 0.75rem;
    --btn-padding-y: 0.375rem;
    --btn-font-weight: 400;
    --btn-focus-width: 0.2rem;
    --btn-focus-box-shadow: 0 0 0 0.2rem rgba(74, 108, 247, 0.25);
    
    --form-grid-gutter-width: 10px;
    --input-padding-x: 0.75rem;
    --input-padding-y: 0.375rem;
    --input-line-height: 1.5;
    --input-focus-border-color: #80bdff;
    --input-focus-box-shadow: 0 0 0 0.2rem rgba(74, 108, 247, 0.25);
    
    --table-cell-padding: 0.75rem;
    --table-hover-bg: rgba(0, 0, 0, 0.075);
    
    /* 断点 */
    --breakpoint-xs: 0;
    --breakpoint-sm: 576px;
    --breakpoint-md: 768px;
    --breakpoint-lg: 992px;
    --breakpoint-xl: 1200px;
    --breakpoint-xxl: 1400px;
    
    /* 网格系统 */
    --grid-item-min-width: 250px;
    
    /* ============ Z-Index (UI设计方案V2.6) ============ */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;
}

/* ============ Dark Mode (暗色主题 - UI设计方案V2.6) ============ */
[data-theme="dark"] {
    /* Brand Colors */
    --primary: #66b2ff;
    --color-brand: #66b2ff;
    --color-brand-contrast: #000000;
    
    /* Sidebar */
    --sidebar-bg: #1a1a2e;
    --sidebar-text: #ffffff;
    --sidebar-hover-bg: #16213e;
    --sidebar-active-bg: #0f3460;
    --sidebar-active-text: #ffffff;
    --sidebar-group-title-color: #a0a0a0;
    --sidebar-border-color: #2d2d44;
    
    /* Backgrounds */
    --bg-primary: #121212;
    --bg-secondary: #1e1e1e;
    --bg-tertiary: #2d2d2d;
    --color-bg: var(--bg-primary);
    --color-surface: #2c3034;
    
    /* Text */
    --text-primary: #e9ecef;
    --text-secondary: #adb5bd;
    --text-muted: #6c757d;
    --text-light: #f8f9fa;
    --color-text: var(--text-primary);
    --color-text-secondary: var(--text-secondary);
    --color-text-muted: var(--text-muted);
    
    /* Borders */
    --border-color: #495057;
    --border-light: #343a40;
    --color-border: var(--border-color);
    --color-border-light: var(--border-light);
    
    /* Elevation (调整深色模式阴影) */
    --elev-1: 0 1px 2px rgba(0,0,0,0.3), 0 1px 1px rgba(0,0,0,0.2);
    --elev-2: 0 4px 8px rgba(0,0,0,0.4);
    --elev-3: 0 8px 16px rgba(0,0,0,0.5);
    --elev-4: 0 12px 24px rgba(0,0,0,0.6);
    
    /* Glass Effect (暗色模式玻璃态) */
    --glass-primary: rgba(102, 178, 255, 0.15);
    --glass-primary-light: rgba(102, 178, 255, 0.08);
    --glass-border: rgba(102, 178, 255, 0.2);
}

/* ============ Animation Utilities (UI设计方案V2.6) ============ */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes slideInRight {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

@keyframes slideInLeft {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

@keyframes slideInUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

@keyframes slideInDown {
    from { transform: translateY(-100%); }
    to { transform: translateY(0); }
}

@keyframes scaleIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

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

/* ============ Utility Classes (UI设计方案V2.6) ============ */
.transition-fast { transition: var(--transition-fast); }
.transition-base { transition: var(--transition-base); }
.transition-slow { transition: var(--transition-slow); }

.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-xl { box-shadow: var(--shadow-xl); }
.shadow-2xl { box-shadow: var(--shadow-2xl); }
.shadow-glass { box-shadow: var(--glass-shadow); }

.rounded-xs { border-radius: var(--radius-xs); }
.rounded-sm { border-radius: var(--radius-sm); }
.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-2xl { border-radius: var(--radius-2xl); }
.rounded-full { border-radius: var(--radius-full); }

/* ============ Focus Ring (UI设计方案V2.6 - 键盘可达性) ============ */
.focus-ring:focus,
.focus-ring:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible,
[tabindex]:focus-visible {
    outline: var(--focus-ring-width) solid var(--focus-ring);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* 移除默认outline */
*:focus:not(:focus-visible) {
    outline: none;
}

/* 交互元素的focus ring */
.btn:focus-visible,
.form-control:focus-visible,
.form-select:focus-visible {
    outline: var(--focus-ring-width) solid var(--focus-ring);
    outline-offset: 2px;
}

/* ============ Glass Morphism Components (UI设计方案V2.6) ============ */
.glass-card {
    background: var(--glass-primary-light);
    backdrop-filter: var(--glass-backdrop-filter);
    -webkit-backdrop-filter: var(--glass-webkit-backdrop-filter);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--glass-shadow);
}

.glass-button {
    background: var(--glass-primary-medium);
    backdrop-filter: var(--glass-backdrop-filter);
    -webkit-backdrop-filter: var(--glass-webkit-backdrop-filter);
    border: 1px solid var(--glass-border);
    color: var(--primary);
    transition: var(--transition-base);
}

.glass-button:hover {
    background: var(--glass-primary);
    transform: translateY(-2px);
}

/* ============ Hover & Active States (UI设计方案V2.6) ============ */
.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.hover-scale:hover {
    transform: scale(1.05);
}

.hover-opacity:hover {
    opacity: var(--hover-opacity);
}

/* ============ Responsive Utilities ============ */
@media (max-width: 767.98px) {
    :root {
        --sidebar-width: 100%;
        --font-size-base: 0.9375rem; /* 15px */
        --spacer: 0.875rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}