/* 
 * 统一设计系统 - XCO Found 项目群
 * 适用于 startup、aixkol、aivtlink 三个项目
 */

/* ===== CSS 变量定义 ===== */
:root {
    /* 主色调 - 统一的品牌色彩 */
    --primary-50: #eff6ff;
    --primary-100: #dbeafe;
    --primary-200: #bfdbfe;
    --primary-300: #93c5fd;
    --primary-400: #60a5fa;
    --primary-500: #3b82f6;
    --primary-600: #2563eb;
    --primary-700: #1d4ed8;
    --primary-800: #1e40af;
    --primary-900: #1e3a8a;
    
    /* 辅助色调 */
    --secondary-50: #fdf4ff;
    --secondary-100: #fae8ff;
    --secondary-200: #f5d0fe;
    --secondary-300: #f0abfc;
    --secondary-400: #e879f9;
    --secondary-500: #d946ef;
    --secondary-600: #c026d3;
    --secondary-700: #a21caf;
    --secondary-800: #86198f;
    --secondary-900: #701a75;
    
    /* 功能色彩 */
    --success-50: #f0fdf4;
    --success-100: #dcfce7;
    --success-200: #bbf7d0;
    --success-300: #86efac;
    --success-400: #4ade80;
    --success-500: #22c55e;
    --success-600: #16a34a;
    --success-700: #15803d;
    --success-800: #166534;
    --success-900: #14532d;
    
    --warning-50: #fffbeb;
    --warning-100: #fef3c7;
    --warning-200: #fde68a;
    --warning-300: #fcd34d;
    --warning-400: #fbbf24;
    --warning-500: #f59e0b;
    --warning-600: #d97706;
    --warning-700: #b45309;
    --warning-800: #92400e;
    --warning-900: #78350f;
    
    --error-50: #fef2f2;
    --error-100: #fee2e2;
    --error-200: #fecaca;
    --error-300: #fca5a5;
    --error-400: #f87171;
    --error-500: #ef4444;
    --error-600: #dc2626;
    --error-700: #b91c1c;
    --error-800: #991b1b;
    --error-900: #7f1d1d;
    
    /* 中性色调 - 明亮主题 */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    /* 语义化颜色 - 明亮主题 */
    --background: var(--gray-50);
    --surface: #ffffff;
    --surface-elevated: #ffffff;
    --text-primary: var(--gray-900);
    --text-secondary: var(--gray-600);
    --text-muted: var(--gray-400);
    --border: var(--gray-200);
    --border-light: var(--gray-100);
    --divider: var(--gray-200);
    
    /* 渐变色 */
    --gradient-primary: linear-gradient(135deg, var(--primary-600) 0%, var(--secondary-600) 100%);
    --gradient-secondary: linear-gradient(135deg, var(--secondary-500) 0%, var(--primary-500) 100%);
    --gradient-success: linear-gradient(135deg, var(--success-500) 0%, var(--success-600) 100%);
    --gradient-warning: linear-gradient(135deg, var(--warning-500) 0%, var(--error-500) 100%);
    
    /* 阴影 */
    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* 特殊效果 */
    --glow-primary: 0 0 20px rgba(59, 130, 246, 0.3);
    --glow-secondary: 0 0 20px rgba(217, 70, 239, 0.3);
    --glow-success: 0 0 20px rgba(34, 197, 94, 0.3);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    
    /* 圆角 */
    --radius-xs: 0.125rem;
    --radius-sm: 0.25rem;
    --radius-md: 0.375rem;
    --radius-lg: 0.5rem;
    --radius-xl: 0.75rem;
    --radius-2xl: 1rem;
    --radius-3xl: 1.5rem;
    --radius-full: 9999px;
    
    /* 间距 */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    --spacing-3xl: 4rem;
    
    /* 动画 */
    --transition-fast: 0.15s ease-in-out;
    --transition-normal: 0.3s ease-in-out;
    --transition-slow: 0.5s ease-in-out;
    
    /* 字体 */
    --font-family-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-family-heading: 'Poppins', var(--font-family-sans);
    --font-family-mono: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
    
    /* 字体大小 */
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 1.875rem;
    --text-4xl: 2.25rem;
    --text-5xl: 3rem;
    --text-6xl: 3.75rem;
    
    /* 行高 */
    --leading-tight: 1.25;
    --leading-normal: 1.5;
    --leading-relaxed: 1.625;
    --leading-loose: 2;
}

/* 暗色主题 */
[data-theme="dark"] {
    /* 中性色调 - 暗色主题 */
    --gray-50: #18181b;
    --gray-100: #27272a;
    --gray-200: #3f3f46;
    --gray-300: #52525b;
    --gray-400: #71717a;
    --gray-500: #a1a1aa;
    --gray-600: #d4d4d8;
    --gray-700: #e4e4e7;
    --gray-800: #f4f4f5;
    --gray-900: #fafafa;
    
    /* 语义化颜色 - 暗色主题 */
    --background: #0f0f23;
    --surface: #1a1a2e;
    --surface-elevated: #16213e;
    --text-primary: var(--gray-900);
    --text-secondary: var(--gray-600);
    --text-muted: var(--gray-400);
    --border: var(--gray-200);
    --border-light: var(--gray-100);
    --divider: var(--gray-200);
    
    /* 暗色主题阴影 */
    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.4), 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 10px 10px -5px rgba(0, 0, 0, 0.3);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
}

/* ===== 基础样式重置 ===== */
*,
*::before,
*::after {
    box-sizing: border-box;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-scroll-behavior: smooth;
    -moz-scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    text-size-adjust: 100%;
    /* Firefox-specific optimizations */
    -moz-osx-font-smoothing: grayscale;
    -moz-font-feature-settings: "liga" 1;
}

body {
    font-family: var(--font-family-sans);
    font-size: var(--text-base);
    line-height: var(--leading-normal);
    color: var(--text-primary);
    background-color: var(--background);
    transition: background-color var(--transition-normal), color var(--transition-normal);
    -webkit-transition: background-color var(--transition-normal), color var(--transition-normal);
    -moz-transition: background-color var(--transition-normal), color var(--transition-normal);
    -o-transition: background-color var(--transition-normal), color var(--transition-normal);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* ===== 通用组件样式 ===== */

/* 按钮 */
.btn {
    display: inline-flex;
    display: -webkit-inline-flex;
    align-items: center;
    -webkit-align-items: center;
    justify-content: center;
    -webkit-justify-content: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-lg);
    font-size: var(--text-sm);
    font-weight: 500;
    line-height: var(--leading-tight);
    border: 1px solid transparent;
    border-radius: var(--radius-lg);
    -webkit-border-radius: var(--radius-lg);
    -moz-border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-fast);
    -webkit-transition: all var(--transition-fast);
    -moz-transition: all var(--transition-fast);
    -o-transition: all var(--transition-fast);
    text-decoration: none;
    white-space: nowrap;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    /* Firefox-specific fixes */
    -moz-appearance: none;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background-color: var(--surface);
    color: var(--text-primary);
    border-color: var(--border);
    box-shadow: var(--shadow-sm);
}

.btn-secondary:hover:not(:disabled) {
    background-color: var(--gray-100);
    border-color: var(--gray-300);
}

.btn-outline {
    background-color: transparent;
    color: var(--primary-600);
    border-color: var(--primary-600);
}

.btn-outline:hover:not(:disabled) {
    background-color: var(--primary-50);
}

.btn-ghost {
    background-color: transparent;
    color: var(--text-secondary);
    border-color: transparent;
}

.btn-ghost:hover:not(:disabled) {
    background-color: var(--gray-100);
    color: var(--text-primary);
}

.btn-sm {
    padding: var(--spacing-xs) var(--spacing-md);
    font-size: var(--text-xs);
}

.btn-lg {
    padding: var(--spacing-md) var(--spacing-xl);
    font-size: var(--text-lg);
}

/* 卡片 */
.card {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    -webkit-border-radius: var(--radius-xl);
    -moz-border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    -webkit-box-shadow: var(--shadow-sm);
    -moz-box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
    -webkit-transition: all var(--transition-normal);
    -moz-transition: all var(--transition-normal);
    -o-transition: all var(--transition-normal);
}

.card-hover:hover {
    transform: translateY(-2px);
    -webkit-transform: translateY(-2px);
    -moz-transform: translateY(-2px);
    -ms-transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    -webkit-box-shadow: var(--shadow-lg);
    -moz-box-shadow: var(--shadow-lg);
}

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

/* 输入框 */
.input {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: var(--text-sm);
    line-height: var(--leading-normal);
    color: var(--text-primary);
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    -webkit-border-radius: var(--radius-lg);
    -moz-border-radius: var(--radius-lg);
    transition: all var(--transition-fast);
    -webkit-transition: all var(--transition-fast);
    -moz-transition: all var(--transition-fast);
    -o-transition: all var(--transition-fast);
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    /* Safari-specific fixes */
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: text;
}

.input:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    -webkit-box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    -moz-box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

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

/* Safari input autofill styles */
.input:-webkit-autofill,
.input:-webkit-autofill:hover,
.input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px var(--surface) inset;
    -webkit-text-fill-color: var(--text-primary);
    transition: background-color 5000s ease-in-out 0s;
}

/* Safari date/time input fixes */
.input[type="date"],
.input[type="time"],
.input[type="datetime-local"] {
    -webkit-appearance: none;
    -moz-appearance: textfield;
}

.input[type="date"]::-webkit-calendar-picker-indicator,
.input[type="time"]::-webkit-calendar-picker-indicator,
.input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    background: transparent;
    bottom: 0;
    color: transparent;
    cursor: pointer;
    height: auto;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    width: auto;
}

/* 导航栏 */
.navbar {
    background-color: var(--surface);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(10px);
    transition: all var(--transition-normal);
}

.navbar.scrolled {
    background-color: rgba(255, 255, 255, 0.8);
    box-shadow: var(--shadow-sm);
}

[data-theme="dark"] .navbar.scrolled {
    background-color: rgba(26, 26, 46, 0.8);
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-600);
    background-color: var(--primary-50);
}

[data-theme="dark"] .nav-link:hover,
[data-theme="dark"] .nav-link.active {
    background-color: rgba(59, 130, 246, 0.1);
}

/* 工具类 */
.glass-effect {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    /* Safari fallback */
    background: rgba(255, 255, 255, 0.8);
    background: -webkit-linear-gradient(rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.1));
}

/* Safari-specific backdrop-filter support */
@supports (-webkit-backdrop-filter: blur(20px)) {
    .glass-effect {
        background: rgba(255, 255, 255, 0.1);
        -webkit-backdrop-filter: blur(20px);
    }
}

@supports (backdrop-filter: blur(20px)) {
    .glass-effect {
        background: rgba(255, 255, 255, 0.1);
        backdrop-filter: blur(20px);
    }
}

[data-theme="dark"] .glass-effect {
    background: rgba(26, 26, 46, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.gradient-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent; /* 回退颜色 */
}

.text-gradient-secondary {
    background: var(--gradient-secondary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 动画 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

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

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

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

@keyframes slideLeft {
    from { 
        opacity: 0;
        transform: translateX(20px);
        -webkit-transform: translateX(20px);
    }
    to { 
        opacity: 1;
        transform: translateX(0);
        -webkit-transform: translateX(0);
    }
}

@-webkit-keyframes slideLeft {
    from { 
        opacity: 0;
        -webkit-transform: translateX(20px);
    }
    to { 
        opacity: 1;
        -webkit-transform: translateX(0);
    }
}

@keyframes slideRight {
    from { 
        opacity: 0;
        transform: translateX(-20px);
        -webkit-transform: translateX(-20px);
    }
    to { 
        opacity: 1;
        transform: translateX(0);
        -webkit-transform: translateX(0);
    }
}

@-webkit-keyframes slideRight {
    from { 
        opacity: 0;
        -webkit-transform: translateX(-20px);
    }
    to { 
        opacity: 1;
        -webkit-transform: translateX(0);
    }
}

@keyframes bounce {
    0%, 100% { 
        transform: translateY(0);
        -webkit-transform: translateY(0);
    }
    50% { 
        transform: translateY(-5px);
        -webkit-transform: translateY(-5px);
    }
}

@-webkit-keyframes bounce {
    0%, 100% { -webkit-transform: translateY(0); }
    50% { -webkit-transform: translateY(-5px); }
}

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

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

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

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

.animate-fade-in { animation: fadeIn 0.5s ease-out; }
.animate-slide-up { animation: slideUp 0.5s ease-out; }
.animate-slide-down { animation: slideDown 0.5s ease-out; }
.animate-slide-left { animation: slideLeft 0.5s ease-out; }
.animate-slide-right { animation: slideRight 0.5s ease-out; }
.animate-bounce { animation: bounce 2s infinite; }
.animate-pulse { animation: pulse 2s infinite; }
.animate-spin { animation: spin 1s linear infinite; }

/* 响应式设计 */
@media (max-width: 768px) {
    .btn {
        padding: var(--spacing-xs) var(--spacing-md);
        font-size: var(--text-xs);
    }
    
    .card {
        border-radius: var(--radius-lg);
    }
    
    .navbar {
        padding: var(--spacing-sm);
    }
}

/* Edge-specific fixes */
@supports (-ms-ime-align: auto) {
    /* Edge Legacy detected */
    .glass-effect {
        background: rgba(255, 255, 255, 0.8);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }
    
    .btn {
        -ms-flex-align: center;
        -ms-flex-pack: center;
    }
    
    .input {
        -ms-appearance: none;
    }
}

/* Modern Edge (Chromium-based) fixes */
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
    .glass-effect {
        background: rgba(255, 255, 255, 0.9);
    }
    
    .card {
        -ms-filter: "progid:DXImageTransform.Microsoft.Shadow(Strength=4, Direction=135, Color='#000000')";
    }
}

/* Mobile browser compatibility and touch optimizations */
@media screen and (max-width: 768px) {
    /* iOS Safari specific fixes */
    @supports (-webkit-touch-callout: none) {
        html {
            -webkit-text-size-adjust: 100%;
            -webkit-tap-highlight-color: transparent;
        }
        
        body {
            -webkit-overflow-scrolling: touch;
            overscroll-behavior: contain;
        }
        
        .btn {
            -webkit-tap-highlight-color: transparent;
            -webkit-touch-callout: none;
            -webkit-user-select: none;
            touch-action: manipulation;
            cursor: pointer;
        }
        
        .input {
            -webkit-appearance: none;
            -webkit-border-radius: 0;
            border-radius: 8px;
            font-size: 16px; /* Prevents zoom on iOS */
        }
        
        /* Fix iOS Safari viewport issues */
        .container {
            min-height: -webkit-fill-available;
        }
    }
    
    /* Android Chrome specific fixes */
    @media screen and (-webkit-min-device-pixel-ratio: 1) {
        .btn {
            touch-action: manipulation;
            -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
        }
        
        .input {
            font-size: 16px; /* Prevents zoom on Android */
        }
        
        /* Android Chrome scrollbar */
        ::-webkit-scrollbar {
            width: 4px;
        }
        
        ::-webkit-scrollbar-track {
            background: transparent;
        }
        
        ::-webkit-scrollbar-thumb {
            background: rgba(0, 0, 0, 0.3);
            border-radius: 2px;
        }
    }
}

/* Touch-friendly interactive elements */
.touch-target {
    min-height: 44px;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

/* Mobile navigation optimizations */
@media screen and (max-width: 768px) {
    .mobile-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: var(--surface);
        border-top: 1px solid var(--border);
        padding: 8px 0;
        z-index: 1000;
        -webkit-backdrop-filter: blur(10px);
        backdrop-filter: blur(10px);
    }
    
    .mobile-nav-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: 8px;
        text-decoration: none;
        color: var(--text-secondary);
        transition: color 0.2s ease;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }
    
    .mobile-nav-item:active {
        background: rgba(0, 0, 0, 0.05);
    }
    
    .mobile-nav-item.active {
        color: var(--primary-600);
    }
}

/* Responsive typography for mobile */
@media screen and (max-width: 480px) {
    html {
        font-size: 14px;
    }
    
    h1 { font-size: 1.8rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.3rem; }
    h4 { font-size: 1.1rem; }
    h5 { font-size: 1rem; }
    h6 { font-size: 0.9rem; }
    
    .btn {
        padding: 12px 16px;
        font-size: 16px;
    }
    
    .input {
        padding: 12px;
        font-size: 16px;
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: var(--radius-full);
    -webkit-transition: var(--transition-fast);
    transition: var(--transition-fast);
}

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

[data-theme="dark"] ::-webkit-scrollbar-track {
    background: var(--gray-200);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: var(--gray-400);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: var(--gray-500);
}

/* Safari-specific scrollbar improvements */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
    ::-webkit-scrollbar {
        width: 12px;
        height: 12px;
    }
    
    ::-webkit-scrollbar-thumb {
        background: linear-gradient(to bottom, var(--gray-300), var(--gray-400));
        border: 2px solid var(--surface);
        border-radius: 6px;
    }
    
    [data-theme="dark"] ::-webkit-scrollbar-thumb {
        background: linear-gradient(to bottom, var(--gray-400), var(--gray-500));
        border: 2px solid var(--surface);
    }
}

/* 选择文本样式 */
::selection {
    background-color: var(--primary-200);
    color: var(--primary-900);
}

[data-theme="dark"] ::selection {
    background-color: var(--primary-800);
    color: var(--primary-100);
}

/* 焦点样式 */
.focus-ring:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

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

/* 高亮文本样式 */
.highlight-text {
    background: linear-gradient(120deg, var(--primary-100) 0%, var(--secondary-100) 100%);
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    border-left: 3px solid var(--primary-500);
    font-weight: 500;
    display: inline-block;
    margin: 0.25rem 0;
}

[data-theme="dark"] .highlight-text {
    background: linear-gradient(120deg, var(--primary-900) 0%, var(--secondary-900) 100%);
    border-left-color: var(--primary-400);
    color: var(--primary-100);
}

/* 改进的按钮样式 */
.btn-enhanced {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn-enhanced::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.btn-enhanced:hover::before {
    left: 100%;
}

.btn-enhanced:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg), var(--glow-primary);
}

/* 渐变文本 */
.gradient-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

/* 脉冲动画 */
.pulse-glow {
    animation: pulseGlow 2s ease-in-out infinite alternate;
}

@keyframes pulseGlow {
    from {
        box-shadow: var(--shadow-md);
    }
    to {
        box-shadow: var(--shadow-lg), var(--glow-primary);
    }
}

/* 改进的卡片悬停效果 */
.card-enhanced {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.card-enhanced::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.6s ease;
    z-index: 1;
}

.card-enhanced:hover::before {
    left: 100%;
}

.card-enhanced:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-xl), var(--glow-primary);
}

/* 微交互动画 */
.bounce-in {
    animation: bounceIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.fade-in-up {
    animation: fadeInUp 0.8s ease-out;
}

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

/* 加载状态 */
.loading-shimmer {
    background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-100) 50%, var(--gray-200) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

[data-theme="dark"] .loading-shimmer {
    background: linear-gradient(90deg, var(--gray-800) 25%, var(--gray-700) 50%, var(--gray-800) 75%);
    background-size: 200% 100%;
}

/* 高级交互效果 */
.btn-enhanced {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-enhanced::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn-enhanced:hover::before {
    left: 100%;
}

.btn-enhanced:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.btn-enhanced:active {
    transform: translateY(0);
    transition: transform 0.1s;
}

/* 脉冲效果 */
@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(59, 130, 246, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(59, 130, 246, 0.8), 0 0 30px rgba(59, 130, 246, 0.4);
    }
}

.pulse-glow {
    animation: pulse-glow 2s infinite;
}

/* 悬浮提示效果 */
.tooltip {
    position: relative;
    cursor: pointer;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    z-index: 1000;
}

.tooltip::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(100%);
    border: 5px solid transparent;
    border-top-color: rgba(0,0,0,0.8);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.tooltip:hover::after,
.tooltip:hover::before {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-5px);
}

/* 滚动触发动画 */
.scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease-out;
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* 磁性按钮效果 */
.magnetic-btn {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* 渐变边框效果 */
.gradient-border {
    position: relative;
    background: var(--background);
    border-radius: 12px;
}

.gradient-border::before {
    content: '';
    position: absolute;
    inset: 0;
    padding: 2px;
    background: linear-gradient(45deg, var(--primary-500), var(--secondary-500), var(--primary-500));
    border-radius: inherit;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: xor;
    -webkit-mask-composite: xor;
}

/* 粒子效果背景 */
.particle-bg {
    position: relative;
    overflow: hidden;
}

.particle-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(120, 219, 255, 0.3) 0%, transparent 50%);
    animation: particle-float 20s ease-in-out infinite;
}

@keyframes particle-float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
        opacity: 1;
    }
    50% {
        transform: translateY(-20px) rotate(180deg);
        opacity: 0.8;
    }
}

/* 波纹效果 */
.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    transform: scale(0);
    animation: ripple-animation 0.6s linear;
    pointer-events: none;
}

@keyframes ripple-animation {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* 按钮需要相对定位以支持波纹效果 */
.btn {
    position: relative;
    overflow: hidden;
}

/* 高级悬浮效果 */
.hover-lift {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

/* 发光边框效果 */
.glow-border {
    position: relative;
    border: 2px solid transparent;
    background: linear-gradient(var(--background), var(--background)) padding-box,
                linear-gradient(45deg, var(--primary-500), var(--secondary-500)) border-box;
    transition: all 0.3s ease;
}

.glow-border:hover {
    box-shadow: 0 0 20px rgba(var(--primary-500), 0.3);
}

/* 文字打字机效果 */
.typewriter {
    overflow: hidden;
    border-right: 2px solid var(--primary-500);
    white-space: nowrap;
    margin: 0 auto;
    animation: typing 3.5s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from { width: 0 }
    to { width: 100% }
}

@keyframes blink-caret {
    from, to { border-color: transparent }
    50% { border-color: var(--primary-500) }
}

/* 3D翻转卡片效果 */
.flip-card {
    background-color: transparent;
    perspective: 1000px;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.8s;
    transform-style: preserve-3d;
}

.flip-card:hover .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card-front, .flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.flip-card-back {
    background: linear-gradient(135deg, var(--primary-500), var(--secondary-500));
    color: white;
    transform: rotateY(180deg);
}

/* 进度条动画增强 */
.progress-bar-animated {
    position: relative;
    overflow: hidden;
}

.progress-bar-animated::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background-image: linear-gradient(
        -45deg,
        rgba(255, 255, 255, 0.2) 25%,
        transparent 25%,
        transparent 50%,
        rgba(255, 255, 255, 0.2) 50%,
        rgba(255, 255, 255, 0.2) 75%,
        transparent 75%,
        transparent
    );
    background-size: 50px 50px;
    animation: progress-bar-stripes 1s linear infinite;
}

@keyframes progress-bar-stripes {
    0% {
        background-position: 50px 0;
    }
    100% {
        background-position: 0 0;
    }
}

/* 用户体验增强样式 */

/* 加载状态 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--gray-200);
    border-top: 4px solid var(--primary-500);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-dots {
    display: inline-flex;
    gap: 4px;
}

.loading-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary-500);
    animation: loading-dots 1.4s ease-in-out infinite both;
}

.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes loading-dots {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* 通知和提示 */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    max-width: 400px;
    padding: 16px 20px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    z-index: 10000;
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    background: var(--success-50);
    border-left: 4px solid var(--success-500);
    color: var(--success-800);
}

.notification.error {
    background: var(--error-50);
    border-left: 4px solid var(--error-500);
    color: var(--error-800);
}

.notification.warning {
    background: var(--warning-50);
    border-left: 4px solid var(--warning-500);
    color: var(--warning-800);
}

.notification.info {
    background: var(--info-50);
    border-left: 4px solid var(--info-500);
    color: var(--info-800);
}

/* 模态框增强 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--surface);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-2xl);
    max-width: 90vw;
    max-height: 90vh;
    overflow: auto;
    transform: scale(0.9) translateY(-20px);
    transition: transform 0.3s ease;
}

.modal-overlay.show .modal-content {
    transform: scale(1) translateY(0);
}

/* 表单增强 */
.form-group {
    margin-bottom: 20px;
}

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

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: var(--surface);
    color: var(--text-primary);
    transition: all 0.3s ease;
    font-size: 16px;
}

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

.form-input.error {
    border-color: var(--error-500);
    box-shadow: 0 0 0 3px rgba(var(--error-500), 0.1);
}

.form-error {
    color: var(--error-600);
    font-size: 14px;
    margin-top: 4px;
}

.form-success {
    color: var(--success-600);
    font-size: 14px;
    margin-top: 4px;
}

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

.empty-state-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    opacity: 0.5;
}

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

.empty-state-description {
    font-size: 16px;
    line-height: 1.5;
    max-width: 400px;
    margin: 0 auto;
}

/* 骨架屏 */
.skeleton {
    background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-100) 50%, var(--gray-200) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--radius-md);
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.skeleton-text {
    height: 16px;
    margin-bottom: 8px;
}

.skeleton-title {
    height: 24px;
    margin-bottom: 12px;
}

.skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

/* 进度指示器 */
.progress-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 20px 0;
}

.progress-step {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    background: var(--gray-200);
    color: var(--gray-600);
    transition: all 0.3s ease;
}

.progress-step.active {
    background: var(--primary-500);
    color: white;
}

.progress-step.completed {
    background: var(--success-500);
    color: white;
}

.progress-line {
    flex: 1;
    height: 2px;
    background: var(--gray-200);
    position: relative;
    overflow: hidden;
}

.progress-line.completed::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--success-500);
    animation: progress-fill 0.5s ease-out;
}

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

/* ===== 多步骤进度指示器 ===== */
.progress-steps {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 2rem 0;
    position: relative;
}

.progress-steps::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gray-200);
    z-index: 1;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
    background: white;
    padding: 0 1rem;
}

.progress-step-circle {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
}

.progress-step.active .progress-step-circle {
    background: var(--primary-500);
    color: white;
}

.progress-step.completed .progress-step-circle {
    background: var(--success-500);
    color: white;
}

.progress-step-label {
    font-size: 0.875rem;
    color: var(--gray-600);
    text-align: center;
}

.progress-step.active .progress-step-label {
    color: var(--primary-600);
    font-weight: 600;
}

/* ===== 响应式设计增强 ===== */

/* 移动端优先的断点系统 */
@media (max-width: 480px) {
    /* 超小屏幕 */
    .container {
        padding: 0.5rem;
    }
    
    .card {
        margin: 0.5rem 0;
        padding: 1rem;
    }
    
    .btn {
        width: 100%;
        margin: 0.25rem 0;
        padding: 0.875rem 1rem;
        font-size: 1rem;
    }
    
    .modal-content {
        margin: 1rem;
        width: calc(100% - 2rem);
        max-height: calc(100vh - 2rem);
    }
    
    .progress-steps {
        flex-direction: column;
        gap: 1rem;
    }
    
    .progress-steps::before {
        display: none;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .form-group {
        margin-bottom: 1rem;
    }
    
    .navbar {
        flex-direction: column;
        padding: 1rem;
    }
    
    .nav-menu {
        flex-direction: column;
        width: 100%;
        margin-top: 1rem;
    }
    
    .nav-link {
        padding: 0.75rem;
        text-align: center;
        border-bottom: 1px solid var(--gray-200);
    }
}

@media (min-width: 481px) and (max-width: 768px) {
    /* 小屏幕 - 平板竖屏 */
    .container {
        padding: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .btn {
        min-width: 120px;
    }
    
    .modal-content {
        margin: 2rem;
        width: calc(100% - 4rem);
    }
    
    .navbar {
        padding: 1rem 2rem;
    }
    
    .progress-steps {
        flex-wrap: wrap;
        gap: 1rem;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    /* 中等屏幕 - 平板横屏 */
    .container {
        padding: 1.5rem;
        max-width: 1000px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
    }
    
    .modal-content {
        margin: 3rem auto;
        width: 80%;
        max-width: 600px;
    }
}

@media (min-width: 1025px) and (max-width: 1440px) {
    /* 大屏幕 - 桌面 */
    .container {
        padding: 2rem;
        max-width: 1200px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 2rem;
    }
}

@media (min-width: 1441px) {
    /* 超大屏幕 */
    .container {
        padding: 2rem;
        max-width: 1400px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 2rem;
    }
}

/* ===== 触摸设备优化 ===== */
@media (hover: none) and (pointer: coarse) {
    /* 触摸设备 */
    .btn {
        min-height: 44px; /* 苹果推荐的最小触摸目标 */
        padding: 0.875rem 1.5rem;
    }
    
    .nav-link {
        min-height: 44px;
        padding: 0.875rem 1rem;
    }
    
    .card {
        padding: 1.5rem;
    }
    
    /* 移除悬停效果 */
    .btn:hover,
    .card:hover,
    .nav-link:hover {
        transform: none;
        box-shadow: none;
    }
    
    /* 添加触摸反馈 */
    .btn:active {
        transform: scale(0.98);
        opacity: 0.8;
    }
    
    .card:active {
        transform: scale(0.99);
    }
}

/* ===== 高对比度模式支持 ===== */
@media (prefers-contrast: high) {
    :root {
        --primary-500: #0066cc;
        --primary-600: #0052a3;
        --gray-600: #333333;
        --gray-700: #1a1a1a;
        --gray-800: #000000;
    }
    
    .btn {
        border: 2px solid currentColor;
    }
    
    .card {
        border: 1px solid var(--gray-400);
    }
}

/* ===== 减少动画偏好支持 ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .fade-in-up,
    .pulse-glow,
    .hover-lift {
        animation: none !important;
        transition: none !important;
    }
}

/* ===== 暗色模式增强 ===== */
@media (prefers-color-scheme: dark) {
    :root {
        --primary-50: #1e3a8a;
        --primary-100: #1e40af;
        --primary-500: #3b82f6;
        --primary-600: #2563eb;
        --gray-50: #1f2937;
        --gray-100: #374151;
        --gray-200: #4b5563;
        --gray-300: #6b7280;
        --gray-400: #9ca3af;
        --gray-500: #d1d5db;
        --gray-600: #e5e7eb;
        --gray-700: #f3f4f6;
        --gray-800: #f9fafb;
        --gray-900: #ffffff;
    }
    
    body {
        background: var(--gray-50);
        color: var(--gray-700);
    }
    
    .card {
        background: var(--gray-100);
        border-color: var(--gray-200);
    }
    
    .btn-primary {
        background: var(--primary-500);
        border-color: var(--primary-500);
    }
    
    .modal-content {
        background: var(--gray-100);
        border-color: var(--gray-200);
    }
}

/* ===== 移动端导航增强 ===== */
.mobile-nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--gray-700);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
}

.mobile-nav-toggle:hover {
    background: var(--gray-100);
    color: var(--primary-600);
}

.mobile-nav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-nav-overlay.active {
    opacity: 1;
}

.mobile-nav-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: white;
    z-index: 999;
    padding: 2rem 1rem;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    transition: right 0.3s ease;
    overflow-y: auto;
}

.mobile-nav-menu.active {
    right: 0;
}

.mobile-nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--gray-200);
}

.mobile-nav-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--gray-600);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
}

.mobile-nav-close:hover {
    background: var(--gray-100);
    color: var(--gray-800);
}

.mobile-nav-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mobile-nav-links li {
    margin-bottom: 0.5rem;
}

.mobile-nav-links a {
    display: block;
    padding: 1rem;
    color: var(--gray-700);
    text-decoration: none;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    font-weight: 500;
}

.mobile-nav-links a:hover,
.mobile-nav-links a.active {
    background: var(--primary-50);
    color: var(--primary-600);
}

/* ===== 滑动手势支持 ===== */
.swipe-container {
    touch-action: pan-x;
    overflow-x: hidden;
}

.swipe-item {
    transition: transform 0.3s ease;
}

.swipe-item.swiping {
    transition: none;
}

/* ===== 下拉刷新 ===== */
.pull-to-refresh {
    position: relative;
    overflow: hidden;
}

.pull-to-refresh-indicator {
    position: absolute;
    top: -60px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 50%;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.pull-to-refresh.pulling .pull-to-refresh-indicator {
    top: 10px;
}

.pull-to-refresh.refreshing .pull-to-refresh-indicator {
    top: 10px;
    animation: spin 1s linear infinite;
}

/* ===== 虚拟滚动优化 ===== */
.virtual-scroll-container {
    height: 400px;
    overflow-y: auto;
    position: relative;
}

.virtual-scroll-content {
    position: relative;
}

.virtual-scroll-item {
    position: absolute;
    left: 0;
    right: 0;
    transition: opacity 0.2s ease;
}

/* ===== 手势识别增强 ===== */
.gesture-area {
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
}

.pinch-zoom {
    touch-action: none;
    transform-origin: center;
    transition: transform 0.1s ease-out;
}

/* ===== 移动端表单优化 ===== */
@media (max-width: 768px) {
    .mobile-nav-toggle {
        display: block;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .form-row .form-group {
        margin-right: 0;
        margin-bottom: 1rem;
    }
    
    .form-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .form-actions .btn {
        width: 100%;
    }
    
    /* 输入框优化 */
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    textarea,
    select {
        font-size: 16px; /* 防止iOS缩放 */
        padding: 1rem;
    }
    
    /* 表格响应式 */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .table-responsive table {
        min-width: 600px;
    }
    
    /* 卡片堆叠 */
    .card-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    /* 按钮组优化 */
    .btn-group {
        flex-direction: column;
    }
    
    .btn-group .btn {
        border-radius: 0.375rem;
        margin-bottom: 0.5rem;
    }
    
    .btn-group .btn:last-child {
        margin-bottom: 0;
    }
}

/* ===== 横屏模式优化 ===== */
@media (max-height: 500px) and (orientation: landscape) {
    .mobile-nav-menu {
        width: 50%;
        min-width: 280px;
    }
    
    .modal-content {
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .navbar {
        padding: 0.5rem 1rem;
    }
    
    .section-header h1 {
        font-size: 1.5rem;
    }
}

/* 打印样式 */
@media print {
    * {
        background: white !important;
        color: black !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }
    
    .btn,
    .modal,
    .notification,
    .loading-overlay,
    .mobile-nav-toggle,
    .mobile-nav-overlay,
    .mobile-nav-menu {
        display: none !important;
    }
    
    .card {
        border: 1px solid #ccc;
        page-break-inside: avoid;
    }
    
    h1, h2, h3 {
        page-break-after: avoid;
    }
    
    .container {
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }
}

/* ========================================
   页面加载和过渡动画
======================================== */

/* 页面加载动画 */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--background-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.5s ease-out;
}

.page-loader.fade-out {
    opacity: 0;
    pointer-events: none;
}

.page-loader-content {
    text-align: center;
    color: var(--text-primary);
}

.page-loader-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

.page-loader-text {
    font-size: 16px;
    font-weight: 500;
    margin-top: 10px;
}

/* 页面进入动画 */
.page-enter {
    animation: pageEnter 0.6s ease-out forwards;
}

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

/* 页面退出动画 */
.page-exit {
    animation: pageExit 0.3s ease-in forwards;
}

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

/* 元素淡入动画 */
.fade-in {
    animation: fadeIn 0.5s ease-out forwards;
}

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

/* 元素滑入动画 */
.slide-in-up {
    animation: slideInUp 0.6s ease-out forwards;
}

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

.slide-in-down {
    animation: slideInDown 0.6s ease-out forwards;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-in-left {
    animation: slideInLeft 0.6s ease-out forwards;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-in-right {
    animation: slideInRight 0.6s ease-out forwards;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 缩放动画 */
.scale-in {
    animation: scaleIn 0.5s ease-out forwards;
}

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

/* 旋转进入动画 */
.rotate-in {
    animation: rotateIn 0.6s ease-out forwards;
}

@keyframes rotateIn {
    from {
        opacity: 0;
        transform: rotate(-180deg) scale(0.8);
    }
    to {
        opacity: 1;
        transform: rotate(0deg) scale(1);
    }
}

/* 弹跳动画 */
.bounce-in {
    animation: bounceIn 0.8s ease-out forwards;
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* 延迟动画类 */
.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }
.delay-500 { animation-delay: 0.5s; }

/* 页面过渡效果 */
.page-transition {
    transition: all 0.3s ease-in-out;
}

/* 卡片悬停动画 */
.card-hover {
    transition: all 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

/* 按钮点击动画 */
.btn-click {
    transition: all 0.2s ease;
}

.btn-click:active {
    transform: scale(0.95);
}

/* 加载进度条 */
.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: var(--primary-color);
    z-index: 9998;
    transition: width 0.3s ease;
    box-shadow: 0 0 10px var(--primary-color);
}

/* 内容加载动画 */
.content-loading {
    position: relative;
    overflow: hidden;
}

.content-loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.4),
        transparent
    );
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* 滚动触发动画 */
.scroll-reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.6s ease-out;
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* 页面切换动画 */
.page-slide-enter {
    transform: translateX(100%);
}

.page-slide-enter-active {
    transform: translateX(0);
    transition: transform 0.3s ease-out;
}

.page-slide-exit {
    transform: translateX(0);
}

.page-slide-exit-active {
    transform: translateX(-100%);
    transition: transform 0.3s ease-out;
}

/* 模态框动画增强 */
.modal {
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    transform: scale(0.7) translateY(-50px);
    transition: all 0.3s ease;
}

.modal.show .modal-content {
    transform: scale(1) translateY(0);
}

/* 通知动画增强 */
.notification {
    transform: translateX(100%);
    transition: all 0.3s ease;
}

.notification.show {
    transform: translateX(0);
}

/* 加载点动画 */
.loading-dots {
    display: inline-block;
}

.loading-dots::after {
    content: '';
    animation: dots 1.5s infinite;
}

@keyframes dots {
    0%, 20% {
        content: '';
    }
    40% {
        content: '.';
    }
    60% {
        content: '..';
    }
    80%, 100% {
        content: '...';
    }
}

/* 脉冲动画 */
.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.7;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* 摇摆动画 */
.shake {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-5px);
    }
    75% {
        transform: translateX(5px);
    }
}

/* 减少动画的用户偏好设置 */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .scroll-reveal {
        opacity: 1;
        transform: none;
    }
}

/* ========================================
   无障碍访问和键盘导航支持
======================================== */

/* 焦点样式 */
*:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* 跳过链接 */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--primary-color);
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 10000;
    font-weight: 600;
    transition: top 0.3s ease;
}

.skip-link:focus {
    top: 6px;
    outline: 2px solid white;
}

/* 键盘导航增强 */
.keyboard-navigation {
    outline: none;
}

.keyboard-navigation *:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(var(--primary-rgb), 0.2);
}

/* 按钮焦点状态 */
.btn:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(var(--primary-rgb), 0.2);
}

.btn:focus:not(:focus-visible) {
    outline: none;
    box-shadow: none;
}

/* 输入框焦点状态 */
.input:focus,
.textarea:focus,
.select:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(var(--primary-rgb), 0.2);
}

/* 链接焦点状态 */
a:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    text-decoration: underline;
}

a:focus:not(:focus-visible) {
    outline: none;
}

/* 卡片焦点状态 */
.card:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(var(--primary-rgb), 0.2);
}

/* 模态框焦点陷阱 */
.modal[aria-hidden="false"] {
    /* 确保模态框内容可以获得焦点 */
}

.modal-content:focus {
    outline: none;
}

/* 屏幕阅读器专用内容 */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.sr-only-focusable:focus {
    position: static;
    width: auto;
    height: auto;
    padding: inherit;
    margin: inherit;
    overflow: visible;
    clip: auto;
    white-space: normal;
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    .btn {
        border: 2px solid currentColor;
    }
    
    .card {
        border: 2px solid var(--border-color);
    }
    
    .input,
    .textarea,
    .select {
        border: 2px solid var(--border-color);
    }
    
    .notification {
        border: 2px solid currentColor;
    }
}

/* 减少透明度偏好 */
@media (prefers-reduced-transparency: reduce) {
    .modal-overlay {
        background: var(--gray-900);
    }
    
    .notification {
        background: var(--surface);
    }
    
    .loading-overlay {
        background: var(--surface);
    }
}

/* 键盘导航指示器 */
.keyboard-user *:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.mouse-user *:focus {
    outline: none;
}

/* 表单标签关联 */
.form-group {
    position: relative;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-label[for] {
    cursor: pointer;
}

.form-label.required::after {
    content: ' *';
    color: var(--error-color);
}

/* 错误状态的无障碍支持 */
.input[aria-invalid="true"],
.textarea[aria-invalid="true"],
.select[aria-invalid="true"] {
    border-color: var(--error-color);
    box-shadow: 0 0 0 2px rgba(var(--error-rgb), 0.2);
}

.form-error {
    color: var(--error-color);
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-error::before {
    content: '⚠';
    font-weight: bold;
}

/* 成功状态的无障碍支持 */
.input[aria-invalid="false"],
.textarea[aria-invalid="false"],
.select[aria-invalid="false"] {
    border-color: var(--success-color);
    box-shadow: 0 0 0 2px rgba(var(--success-rgb), 0.2);
}

.form-success {
    color: var(--success-color);
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-success::before {
    content: '✓';
    font-weight: bold;
}

/* 进度指示器的无障碍支持 */
.progress-steps {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 2rem 0;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    flex: 1;
    position: relative;
}

.progress-step::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 100%;
    width: 100%;
    height: 2px;
    background: var(--border-color);
    transform: translateY(-50%);
    z-index: -1;
}

.progress-step:last-child::before {
    display: none;
}

.progress-step.completed::before {
    background: var(--success-color);
}

.progress-step-circle {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: var(--border-color);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.progress-step.active .progress-step-circle {
    background: var(--primary-color);
    color: white;
}

.progress-step.completed .progress-step-circle {
    background: var(--success-color);
    color: white;
}

.progress-step.completed .progress-step-circle::before {
    content: '✓';
}

.progress-step-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.progress-step.active .progress-step-label {
    color: var(--primary-color);
    font-weight: 600;
}

.progress-step.completed .progress-step-label {
    color: var(--success-color);
}

/* 通知的无障碍支持 */
.notification {
    role: alert;
    aria-live: polite;
}

.notification-error {
    aria-live: assertive;
}

/* 模态框的无障碍支持 */
.modal {
    role: dialog;
    aria-modal: true;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    color: var(--text-secondary);
    border-radius: 0.25rem;
}

.modal-close:hover {
    background: var(--gray-100);
    color: var(--text-primary);
}

.modal-close:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* 加载状态的无障碍支持 */
.loading-overlay {
    role: status;
    aria-live: polite;
    aria-label: "内容加载中";
}

.loading-spinner {
    width: 2rem;
    height: 2rem;
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* 表格的无障碍支持 */
.table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.table th,
.table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    background: var(--gray-50);
    font-weight: 600;
    color: var(--text-primary);
}

.table th:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: -2px;
}

/* 导航的无障碍支持 */
.nav {
    role: navigation;
}

.nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 1rem;
}

.nav-item {
    position: relative;
}

.nav-link {
    display: block;
    padding: 0.5rem 1rem;
    text-decoration: none;
    color: var(--text-primary);
    border-radius: 0.25rem;
    transition: all 0.2s ease;
}

.nav-link:hover {
    background: var(--gray-100);
    color: var(--primary-color);
}

.nav-link:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.nav-link[aria-current="page"] {
    background: var(--primary-color);
    color: white;
}

/* 面包屑导航 */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 1rem 0;
    font-size: 0.875rem;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.breadcrumb-item:not(:last-child)::after {
    content: '/';
    color: var(--text-secondary);
}

.breadcrumb-link {
    color: var(--primary-color);
    text-decoration: none;
}

.breadcrumb-link:hover {
    text-decoration: underline;
}

.breadcrumb-link:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* 工具提示的无障碍支持 */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip-content {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--gray-900);
    color: white;
    padding: 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 1000;
}

.tooltip:hover .tooltip-content,
.tooltip:focus .tooltip-content {
    opacity: 1;
    visibility: visible;
}

/* ========================================
   错误处理和用户反馈系统样式
   ======================================== */

/* 通知系统样式 */
.notification-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 10000;
    max-width: 400px;
    pointer-events: none;
}

.notification {
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    pointer-events: auto;
    min-width: 300px;
}

.notification.show {
    transform: translateX(0);
}

.notification-error {
    background: var(--error-color, #dc3545);
    color: white;
}

.notification-success {
    background: var(--success-color, #28a745);
    color: white;
}

.notification-info {
    background: var(--info-color, #17a2b8);
    color: white;
}

.notification-warning {
    background: var(--warning-color, #ffc107);
    color: var(--dark-color);
}

.notification-content {
    flex: 1;
    margin-right: 1rem;
}

.notification-close {
    background: none;
    border: none;
    color: inherit;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.notification-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* 错误状态样式 */
.error-state {
    border-color: var(--error-color, #dc3545) !important;
    background-color: rgba(220, 53, 69, 0.1);
}

.success-state {
    border-color: var(--success-color, #28a745) !important;
    background-color: rgba(40, 167, 69, 0.1);
}

.warning-state {
    border-color: var(--warning-color, #ffc107) !important;
    background-color: rgba(255, 193, 7, 0.1);
}

/* 表单错误样式 */
.form-error {
    color: var(--error-color, #dc3545);
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: block;
}

.form-success {
    color: var(--success-color, #28a745);
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: block;
}

/* 加载状态样式 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.loading-overlay.show {
    opacity: 1;
    visibility: visible;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color, #007bff);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

.loading-message {
    font-size: 1rem;
    color: var(--text-color);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 按钮加载状态 */
.btn.loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* 进度条样式 */
.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: var(--primary-color, #007bff);
    z-index: 10001;
    transition: width 0.3s ease;
    width: 0%;
}

/* 下拉刷新指示器 */
.pull-refresh-indicator {
    position: fixed;
    top: -50px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-color, #007bff);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0 0 0.5rem 0.5rem;
    font-size: 0.875rem;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
}

/* 网络状态指示器 */
.network-status {
    position: fixed;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--error-color, #dc3545);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.network-status.show {
    opacity: 1;
    visibility: visible;
}

.network-status.online {
    background: var(--success-color, #28a745);
}

/* 空状态样式 */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state-title {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.empty-state-description {
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
}

/* 确认对话框样式 */
.confirm-dialog {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.confirm-dialog.show {
    opacity: 1;
    visibility: visible;
}

.confirm-dialog-content {
    background: white;
    border-radius: 0.5rem;
    padding: 1.5rem;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    transform: scale(0.9);
    transition: transform 0.3s;
}

.confirm-dialog.show .confirm-dialog-content {
    transform: scale(1);
}

.confirm-dialog-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.confirm-dialog-message {
    margin-bottom: 1.5rem;
    color: var(--text-muted);
}

.confirm-dialog-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

/* 状态徽章 */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.status-badge.success {
    background: rgba(40, 167, 69, 0.1);
    color: var(--success-color, #28a745);
}

.status-badge.error {
    background: rgba(220, 53, 69, 0.1);
    color: var(--error-color, #dc3545);
}

.status-badge.warning {
    background: rgba(255, 193, 7, 0.1);
    color: var(--warning-color, #ffc107);
}

.status-badge.info {
    background: rgba(23, 162, 184, 0.1);
    color: var(--info-color, #17a2b8);
}

/* 响应式调整 */
@media (max-width: 768px) {
    .notification-container {
        top: 0.5rem;
        right: 0.5rem;
        left: 0.5rem;
        max-width: none;
    }
    
    .notification {
        min-width: auto;
    }
    
    .confirm-dialog-content {
        margin: 1rem;
        width: auto;
    }
}

/* ========================================
   性能优化样式
   ======================================== */

/* 图片优化 */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

.lazy-image {
    opacity: 0;
    transition: opacity 0.3s;
}

.lazy-image.loaded {
    opacity: 1;
}

.lazy-image.loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading-shimmer 1.5s infinite;
}

@keyframes loading-shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* 图片占位符 */
.image-placeholder {
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    font-size: 0.875rem;
    min-height: 200px;
    border: 1px dashed #dee2e6;
}

/* 虚拟滚动容器 */
.virtual-scroll-container {
    overflow-y: auto;
    height: 100%;
    position: relative;
}

.virtual-scroll-viewport {
    position: relative;
}

.virtual-scroll-item {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
}

/* 内容骨架屏 */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading-shimmer 1.5s infinite;
    border-radius: 4px;
}

.skeleton-text {
    height: 1rem;
    margin-bottom: 0.5rem;
}

.skeleton-text.short {
    width: 60%;
}

.skeleton-text.medium {
    width: 80%;
}

.skeleton-text.long {
    width: 100%;
}

.skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.skeleton-card {
    padding: 1rem;
    border: 1px solid #e9ecef;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

/* 预加载指示器 */
.preload-indicator {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary-color, #007bff), transparent);
    z-index: 10001;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.preload-indicator.active {
    opacity: 1;
    visibility: visible;
    animation: preload-progress 2s ease-in-out infinite;
}

@keyframes preload-progress {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* 缓存状态指示器 */
.cache-status {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.cache-status.show {
    opacity: 1;
    visibility: visible;
}

/* 性能监控面板 */
.performance-panel {
    position: fixed;
    top: 1rem;
    left: 1rem;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 1rem;
    border-radius: 0.5rem;
    font-family: monospace;
    font-size: 0.75rem;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    min-width: 200px;
}

.performance-panel.show {
    opacity: 1;
    visibility: visible;
}

.performance-metric {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.25rem;
}

.performance-metric-label {
    color: #ccc;
}

.performance-metric-value {
    color: #0f0;
}

.performance-metric-value.warning {
    color: #ff0;
}

.performance-metric-value.error {
    color: #f00;
}

/* 资源优化提示 */
.resource-hint {
    display: none;
}

/* 关键CSS内联 */
.critical-css {
    /* 关键路径CSS将被内联到HTML中 */
}

/* 非关键CSS延迟加载 */
.non-critical-css {
    /* 非关键CSS将被延迟加载 */
}

/* 字体优化 */
@font-face {
    font-family: 'OptimizedFont';
    src: url('fonts/optimized-font.woff2') format('woff2'),
         url('fonts/optimized-font.woff') format('woff');
    font-display: swap;
}

/* 减少重绘和回流的样式 */
.optimized-transform {
    will-change: transform;
    transform: translateZ(0);
}

.optimized-opacity {
    will-change: opacity;
}

.optimized-scroll {
    will-change: scroll-position;
}

/* GPU加速 */
.gpu-accelerated {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

/* 内容可见性优化 */
.content-visibility-auto {
    content-visibility: auto;
    contain-intrinsic-size: 0 500px;
}

/* 滚动性能优化 */
.smooth-scroll {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.scroll-snap-container {
    scroll-snap-type: y mandatory;
    overflow-y: scroll;
}

.scroll-snap-item {
    scroll-snap-align: start;
}

/* 布局稳定性 */
.layout-stable {
    min-height: 100px; /* 防止布局偏移 */
}

/* 资源预加载样式 */
.preload-image {
    position: absolute;
    top: -9999px;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
}

/* 压缩和优化的动画 */
.optimized-animation {
    animation-fill-mode: both;
    animation-duration: 0.3s;
    animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* 减少DOM操作的样式 */
.batch-update {
    /* 批量更新样式 */
    transition: all 0.3s ease;
}

/* 内存优化 */
.memory-efficient {
    /* 内存高效的样式 */
    contain: layout style paint;
}

/* 响应式图片优化 */
.responsive-image {
    width: 100%;
    height: auto;
    object-fit: cover;
}

@media (max-width: 768px) {
    .responsive-image {
        object-fit: contain;
    }
}

/* 预连接优化 */
.preconnect-hint {
    /* DNS预解析和预连接将在HTML中处理 */
}

/* 服务工作者缓存状态 */
.sw-cache-status {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--primary-color, #007bff);
    color: white;
    padding: 1rem;
    border-radius: 0.5rem;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.sw-cache-status.show {
    opacity: 1;
    visibility: visible;
}

/* ========================================
   浏览器兼容性和厂商前缀
======================================== */

/* CSS重置和标准化 */
* {
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
}

/* Flexbox兼容性 */
.flex-container {
    display: -webkit-box;
    display: -webkit-flex;
    display: -moz-box;
    display: -ms-flexbox;
    display: flex;
}

.flex-center {
    -webkit-box-align: center;
    -webkit-align-items: center;
    -moz-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    -moz-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
}

.flex-wrap {
    -webkit-flex-wrap: wrap;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
}

.flex-1 {
    -webkit-box-flex: 1;
    -webkit-flex: 1;
    -moz-box-flex: 1;
    -ms-flex: 1;
    flex: 1;
}

/* Transform兼容性 */
.transform-scale {
    -webkit-transform: scale(1.05);
    -moz-transform: scale(1.05);
    -ms-transform: scale(1.05);
    -o-transform: scale(1.05);
    transform: scale(1.05);
}

.transform-translate {
    -webkit-transform: translateY(-2px);
    -moz-transform: translateY(-2px);
    -ms-transform: translateY(-2px);
    -o-transform: translateY(-2px);
    transform: translateY(-2px);
}

.transform-rotate {
    -webkit-transform: rotate(180deg);
    -moz-transform: rotate(180deg);
    -ms-transform: rotate(180deg);
    -o-transform: rotate(180deg);
    transform: rotate(180deg);
}

/* Transition兼容性 */
.transition-all {
    -webkit-transition: all 0.3s ease;
    -moz-transition: all 0.3s ease;
    -ms-transition: all 0.3s ease;
    -o-transition: all 0.3s ease;
    transition: all 0.3s ease;
}

.transition-transform {
    -webkit-transition: -webkit-transform 0.3s ease;
    -moz-transition: -moz-transform 0.3s ease;
    -ms-transition: -ms-transform 0.3s ease;
    -o-transition: -o-transform 0.3s ease;
    transition: transform 0.3s ease;
}

/* Border-radius兼容性 */
.border-radius {
    -webkit-border-radius: 8px;
    -moz-border-radius: 8px;
    border-radius: 8px;
}

.border-radius-circle {
    -webkit-border-radius: 50%;
    -moz-border-radius: 50%;
    border-radius: 50%;
}

/* Box-shadow兼容性 */
.box-shadow {
    -webkit-box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    -moz-box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.box-shadow-hover {
    -webkit-box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    -moz-box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

/* Gradient兼容性 */
.gradient-primary {
    background: #667eea;
    background: -webkit-linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background: -moz-linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background: -ms-linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background: -o-linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.gradient-success {
    background: #56ab2f;
    background: -webkit-linear-gradient(135deg, #56ab2f 0%, #a8e6cf 100%);
    background: -moz-linear-gradient(135deg, #56ab2f 0%, #a8e6cf 100%);
    background: -ms-linear-gradient(135deg, #56ab2f 0%, #a8e6cf 100%);
    background: -o-linear-gradient(135deg, #56ab2f 0%, #a8e6cf 100%);
    background: linear-gradient(135deg, #56ab2f 0%, #a8e6cf 100%);
}

/* Filter兼容性 */
.filter-blur {
    -webkit-filter: blur(5px);
    -moz-filter: blur(5px);
    -ms-filter: blur(5px);
    -o-filter: blur(5px);
    filter: blur(5px);
}

.filter-brightness {
    -webkit-filter: brightness(1.2);
    -moz-filter: brightness(1.2);
    -ms-filter: brightness(1.2);
    -o-filter: brightness(1.2);
    filter: brightness(1.2);
}

.filter-grayscale {
    -webkit-filter: grayscale(100%);
    -moz-filter: grayscale(100%);
    -ms-filter: grayscale(100%);
    -o-filter: grayscale(100%);
    filter: grayscale(100%);
}

/* Backdrop-filter兼容性 */
.backdrop-blur {
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    /* 降级方案 */
    background: rgba(255, 255, 255, 0.8);
}

/* User-select兼容性 */
.user-select-none {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.user-select-all {
    -webkit-user-select: all;
    -moz-user-select: all;
    -ms-user-select: all;
    user-select: all;
}

/* Appearance兼容性 */
.appearance-none {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* Scrollbar兼容性 */
.custom-scrollbar {
    scrollbar-width: thin;
    scrollbar-color: #ccc #f1f1f1;
}

.custom-scrollbar::-webkit-scrollbar {
    width: 8px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* Grid兼容性 */
.grid-container {
    display: -ms-grid;
    display: grid;
    -ms-grid-columns: 1fr 1fr 1fr;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    -ms-grid-column-gap: 20px;
    -ms-grid-row-gap: 20px;
}

/* IE11特定修复 */
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
    .flex-container {
        display: -ms-flexbox;
    }
    
    .grid-container {
        display: -ms-grid;
    }
    
    .grid-item:nth-child(1) { -ms-grid-column: 1; -ms-grid-row: 1; }
    .grid-item:nth-child(2) { -ms-grid-column: 2; -ms-grid-row: 1; }
    .grid-item:nth-child(3) { -ms-grid-column: 3; -ms-grid-row: 1; }
}

/* Safari特定修复 */
@supports (-webkit-appearance: none) {
    .safari-fix {
        -webkit-transform: translateZ(0);
    }
}

/* Firefox特定修复 */
@-moz-document url-prefix() {
    .firefox-fix {
        -moz-osx-font-smoothing: grayscale;
    }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    .touch-friendly {
        min-height: 44px;
        min-width: 44px;
        padding: 12px;
    }
    
    .hover-effect:hover {
        transform: none;
        box-shadow: none;
    }
}

/* 高DPI屏幕优化 */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .high-dpi-image {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* 打印样式兼容性 */
@media print {
    .no-print {
        display: none !important;
    }
    
    .print-only {
        display: block !important;
    }
    
    * {
        -webkit-print-color-adjust: exact;
        color-adjust: exact;
    }
}

/* 降级方案 */
.no-js .js-only {
    display: none !important;
}

.no-css .css-fallback {
    display: block !important;
}

/* 功能检测类 */
.no-flexbox .flexbox-fallback {
    display: table;
    width: 100%;
}

.no-flexbox .flexbox-fallback > * {
    display: table-cell;
    vertical-align: middle;
}

.no-grid .grid-fallback {
    display: block;
}

.no-grid .grid-fallback > * {
    display: inline-block;
    width: 33.333%;
    vertical-align: top;
}

/* 兼容性测试报告样式 */
#compatibility-report {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.4;
}

#compatibility-report h3 {
    color: #333;
    font-size: 16px;
    margin: 0 0 12px 0;
}

#compatibility-report strong {
    color: #555;
    font-weight: 600;
}

#compatibility-report ul {
    list-style-type: disc;
}

#compatibility-report li {
    color: #666;
    font-size: 11px;
}

/* 响应式兼容性报告 */
@media (max-width: 768px) {
    #compatibility-report {
        width: 90vw;
        right: 5vw;
        top: 10px;
        max-height: 70vh;
    }
}