/* macOS Sonoma风格现代化FPS测试系统样式 */
:root {
    /* macOS Sonoma颜色系统 */
    --primary-color: #007AFF;
    --secondary-color: #5856D6;
    --success-color: #30D158;
    --warning-color: #FF9F0A;
    --danger-color: #FF453A;
    --accent-color: #BF5AF2;
    
    /* 动态渐变背景色 - 邻近色和互补色组合 */
    --bg-gradient-1: #667eea;  /* 蓝紫色 */
    --bg-gradient-2: #764ba2;  /* 深紫色 */
    --bg-gradient-3: #f093fb;  /* 粉色 */
    --bg-gradient-4: #f5576c;  /* 橙粉色 */
    --bg-gradient-5: #4facfe;  /* 蓝色 */
    --bg-gradient-6: #00f2fe;  /* 青色 */
    
    /* 新增柔和渐变色 */
    --bg-soft-1: #a8edea;     /* 柔和青色 */
    --bg-soft-2: #fed6e3;     /* 柔和粉色 */
    --bg-soft-3: #d299c2;     /* 柔和紫色 */
    --bg-soft-4: #fef9d3;     /* 柔和黄色 */
    
    /* 遮罩层透明度 */
    --overlay-opacity: 0.5;
    --content-overlay: 0.7;
    
    /* 玻璃态效果 */
    --glass-blur: 30px;
    --glass-opacity: 0.2;
    --glass-border: rgba(255, 255, 255, 0.3);
    --glass-shadow: 0 8px 32px rgba(31, 38, 135, 0.37);
    
    /* 文字颜色 - 确保在所有背景下可读 */
    --text-primary: #1d1d1f;      /* 深色主文字 */
    --text-secondary: #86868b;     /* 灰色次要文字 */
    --text-on-dark: #ffffff;       /* 深色背景上的白色文字 */
    --text-on-light: #1d1d1f;     /* 浅色背景上的深色文字 */
    --text-accent: #007AFF;        /* 强调色文字 */
    
    /* 阴影系统 */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.1), 0 8px 10px rgba(0, 0, 0, 0.04);
    
    /* 圆角系统 */
    --radius-xs: 4px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-2xl: 24px;
    
    /* 字体系统 */
    --font-system: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    --font-mono: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    
    /* 动画缓动 */
    --ease-out-quad: cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --ease-out-cubic: cubic-bezier(0.215, 0.61, 0.355, 1);
    --ease-in-out-cubic: cubic-bezier(0.645, 0.045, 0.355, 1);
}

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

html {
    font-size: 16px;
    line-height: 1.6;
}

html {
    height: 100%;
}

body {
    min-height: 100%;
    font-family: var(--font-system);
    scroll-behavior: smooth;
    overflow-x: hidden;
    position: relative;
    background: linear-gradient(45deg, 
        var(--bg-gradient-1) 0%, 
        var(--bg-gradient-2) 20%, 
        var(--bg-gradient-3) 40%, 
        var(--bg-gradient-4) 60%, 
        var(--bg-gradient-5) 80%, 
        var(--bg-gradient-6) 100%
    );
    background-size: 400% 400%;
    background-attachment: fixed;
    animation: gradientFlow 20s ease infinite;
    background: rgba(248, 250, 252, 0.9) !important;
}

/* 静态macOS风格背景层 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg,
        #667eea 0%,
        #764ba2 25%,
        #f093fb 50%,
        #f5576c 75%,
        #4facfe 100%
    );
    background-attachment: fixed;
    opacity: 0.4;
    z-index: -2;
}

/* macOS风格半透明遮罩层 */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(30px) saturate(1.1);
    -webkit-backdrop-filter: blur(30px) saturate(1.1);
    z-index: -1;
    pointer-events: none;
}

/* 半透明遮罩层 - 提升内容可读性 */
.content-overlay {
    position: relative;
    z-index: 1;
}

.content-overlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, var(--overlay-opacity));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: inherit;
    z-index: -1;
}

/* 动画关键帧已移除以优化性能 */

/* 静态装饰层 - 移除动画 */
.particle-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 10% 20%, rgba(255, 255, 255, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.04) 0%, transparent 40%),
        radial-gradient(circle at 40% 40%, rgba(255, 255, 255, 0.03) 0%, transparent 40%);
    pointer-events: none;
    z-index: -1;
    opacity: 0.6;
}

/* 粒子动画已移除以优化性能 */

/* 玻璃态效果基础类 */
.glass {
    background: rgba(255, 255, 255, var(--glass-opacity));
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: var(--radius-lg);
}

.glass-strong {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: var(--shadow-xl);
}

.glass-dark {
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-on-dark);
}

/* 主容器和布局系统 */
.wrapper {
    display: flex;
    width: 100%;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* 侧边栏 - macOS风格 */
.sidebar {
    width: 200px;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1000;
    transition: all 0.4s var(--ease-out-cubic);
    transform: translateX(0);
    background: linear-gradient(180deg, 
        rgba(248, 249, 250, 0.95) 0%,
        rgba(243, 244, 246, 0.95) 100%
    );
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid rgba(229, 231, 235, 0.8);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: rgba(15, 23, 42, 0.9) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
}

/* 侧边栏滚动条样式 */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 3px;
    transition: background 0.3s ease;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.25);
}

.sidebar.collapsed {
    transform: translateX(-200px);
}

/* 侧边栏头部 */
.sidebar-header {
    padding: 30px 25px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.sidebar-header h3 {
    color: #1d1d1f;
    font-size: 20px;
    font-weight: 700;
    margin: 0;
    text-shadow: none;
    letter-spacing: -0.5px;
}

/* 侧边栏导航 */
.sidebar .components {
    padding: 25px 0 50px 0;
    overflow: visible;
    flex: 1;
    min-height: calc(100vh - 120px);
    height: auto;
}

.sidebar .components::-webkit-scrollbar {
    display: none;
}

.sidebar .components li {
    margin: 6px 15px;
    list-style: none;
}

.sidebar .nav-link {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    color: #2c2c2e;
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all 0.3s var(--ease-out-cubic);
    font-weight: 500;
    font-size: 15px;
    position: relative;
    overflow: hidden;
    color: #e2e8f0 !important;
}

.sidebar .nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.3), 
        rgba(255, 255, 255, 0.1)
    );
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
    border-radius: var(--radius-md);
}

.sidebar .nav-link:hover::before,
.sidebar .nav-link.active::before {
    opacity: 1;
}

.sidebar .nav-link:hover {
    color: #1d1d1f;
    transform: translateX(8px) scale(1.02);
    box-shadow: var(--shadow-md);
    background: rgba(255, 255, 255, 0.1) !important;
}

.sidebar .nav-link.active {
    color: var(--primary-color);
    background: rgba(0, 122, 255, 0.1);
    border: 1px solid rgba(0, 122, 255, 0.2);
    font-weight: 600;
    color: #60a5fa !important;
    background: rgba(59, 130, 246, 0.2) !important;
}

.sidebar .nav-link i {
    margin-right: 12px;
    font-size: 18px;
    width: 20px;
    text-align: center;
    opacity: 0.8;
}

/* 主内容区域 */
#content {
    flex: 1;
    margin-left: 200px;
    padding: 0 10px;
    transition: margin-left 0.4s var(--ease-out-cubic);
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

#content.expanded {
    margin-left: 0;
}

/* 顶部导航栏 */
.navbar {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding: 15px 30px;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

/* 侧边栏切换按钮 */
#sidebarCollapse {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: var(--text-primary);
    padding: 12px 16px;
    border-radius: var(--radius-md);
    transition: all 0.3s var(--ease-out-cubic);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    font-size: 18px;
    box-shadow: var(--shadow-sm);
}

#sidebarCollapse:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
    border-color: rgba(255, 255, 255, 0.4);
}

/* 页面标题 */
.page-title {
    color: var(--text-primary);
    font-size: 32px;
    font-weight: 700;
    margin: 30px 0 20px 0;
    text-shadow: 0 1px 3px rgba(255, 255, 255, 0.5);
    letter-spacing: -1px;
}

/* 容器和卡片系统 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 30px;
}

.test-container {
    padding: 30px;
    max-width: 1400px;
    margin: 0 auto;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 20px;
    padding: 20px;
    min-height: calc(100vh - 140px);
}

.test-card, .settings-panel, .stats-panel {
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.9) 0%,
        rgba(248, 249, 250, 0.85) 100%
    );
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(229, 231, 235, 0.6);
    border-radius: var(--radius-xl);
    padding: 30px;
    margin-bottom: 25px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08), 
                0 1px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.3s var(--ease-out-cubic);
    position: relative;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.95) !important;
    border: 1px solid rgba(203, 213, 225, 0.5) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
}

.test-card::before, .settings-panel::before, .stats-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.1) 0%, 
        rgba(255, 255, 255, 0.05) 100%
    );
    pointer-events: none;
    z-index: -1;
}

.test-card:hover, .settings-panel:hover, .stats-panel:hover {
    transform: translateY(-5px) scale(1.01);
    box-shadow: var(--shadow-xl);
    border-color: rgba(255, 255, 255, 0.4);
}

/* 按钮系统 */
.btn-modern {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: var(--text-primary);
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 15px;
    transition: all 0.3s var(--ease-out-cubic);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.3), 
        rgba(255, 255, 255, 0.1)
    );
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.btn-modern:hover::before {
    opacity: 1;
}

.btn-modern:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: var(--shadow-md);
    border-color: rgba(255, 255, 255, 0.4);
    color: var(--text-primary);
}

.btn-modern:active {
    transform: translateY(0) scale(0.98);
}

/* 主要按钮 */
.btn-primary-modern, .btn.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), #0056b3);
    border: 1px solid rgba(0, 122, 255, 0.3);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary-modern:hover, .btn.btn-primary:hover {
    background: linear-gradient(135deg, #0056b3, var(--primary-color));
    box-shadow: var(--shadow-lg);
    color: white;
}

/* 成功按钮 */
.btn-success-modern {
    background: linear-gradient(135deg, var(--success-color), #20a944);
    border: 1px solid rgba(48, 209, 88, 0.3);
    color: white;
}

.btn-success-modern:hover {
    background: linear-gradient(135deg, #20a944, var(--success-color));
}

/* 危险按钮 */
.btn-danger-modern {
    background: linear-gradient(135deg, var(--danger-color), #d70015);
    border: 1px solid rgba(255, 69, 58, 0.3);
    color: white;
}

.btn-danger-modern:hover {
    background: linear-gradient(135deg, #d70015, var(--danger-color));
}

/* 表单控件 */
.form-control-modern, .form-control {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    font-size: 15px;
    color: var(--text-primary);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: all 0.3s var(--ease-out-cubic);
    box-shadow: var(--shadow-sm);
    color: #1e293b !important;
    background: rgba(255, 255, 255, 0.9) !important;
}

.form-control-modern::placeholder, .form-control::placeholder {
    color: var(--text-secondary);
}

.form-control-modern:focus, .form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1), var(--shadow-md);
    background: rgba(255, 255, 255, 0.3);
    color: var(--text-primary);
}

/* 选择框 */
.form-select-modern, .form-select {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    font-size: 15px;
    color: var(--text-primary);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    cursor: pointer;
    transition: all 0.3s var(--ease-out-cubic);
    color: #1e293b !important;
    background: rgba(255, 255, 255, 0.9) !important;
}

.form-select-modern:focus, .form-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
    background: rgba(255, 255, 255, 0.3);
}

/* 滑块控件 */
.form-range {
    background: transparent;
    cursor: pointer;
}

.form-range::-webkit-slider-track {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    height: 8px;
}

.form-range::-webkit-slider-thumb {
    background: linear-gradient(135deg, var(--primary-color), #0056b3);
    border: 2px solid white;
    border-radius: 50%;
    box-shadow: var(--shadow-md);
    cursor: pointer;
    height: 20px;
    width: 20px;
    -webkit-appearance: none;
    appearance: none;
}

.form-range::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-lg);
}

/* 标签 */
.form-label {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 8px;
    display: block;
    letter-spacing: 0.5px;
}

/* 文本工具类 */
.text-muted {
    color: var(--text-secondary) !important;
    font-size: 13px;
}

.text-center {
    text-align: center;
}

.text-white {
    color: #1d1d1f !important;
}

.text-white-70 {
    color: #48484a !important;
}

.text-white-50 {
    color: #8e8e93 !important;
}

.text-primary {
    color: var(--text-primary) !important;
}

.text-primary-color {
    color: var(--primary-color) !important;
}

/* 测试区域 */
.test-area {
    background: rgba(255, 255, 255, 0.1);
    border: 2px dashed rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-xl);
    min-height: 400px;
    position: relative;
    cursor: crosshair;
    transition: all 0.3s var(--ease-out-cubic);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 20px 0;
}

.test-area.active {
    border-color: var(--primary-color);
    background: rgba(0, 122, 255, 0.05);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

.test-area h3 {
    color: var(--text-primary);
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 10px;
}

.test-area p {
    color: var(--text-secondary);
    font-size: 16px;
}

/* 目标样式 */
.target {
    position: absolute;
    background: linear-gradient(135deg, var(--danger-color), #d70015);
    border: 3px solid white;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s var(--ease-out-cubic);
    box-shadow: var(--shadow-lg);
    animation: targetPulse 2s ease-in-out infinite;
    z-index: 10;
}

@keyframes targetPulse {
    0%, 100% { 
        transform: scale(1); 
        box-shadow: var(--shadow-lg);
    }
    50% { 
        transform: scale(1.05); 
        box-shadow: var(--shadow-xl);
    }
}

.target:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-xl);
    border-color: var(--warning-color);
}

.target.hit {
    animation: targetHit 0.3s ease-out forwards;
}

@keyframes targetHit {
    0% { 
        transform: scale(1); 
        opacity: 1; 
    }
    50% { 
        transform: scale(1.3); 
        background: linear-gradient(135deg, var(--success-color), #20a944);
    }
    100% { 
        transform: scale(0); 
        opacity: 0; 
    }
}

/* 统计卡片 */
.stat-item, .stat-card {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-lg);
    padding: 20px;
    text-align: center;
    transition: all 0.3s var(--ease-out-cubic);
    box-shadow: var(--shadow-md);
}

.stat-item:hover, .stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(255, 255, 255, 0.4);
}

.stat-value, .stat-card h3 {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 8px;
    font-family: var(--font-mono);
    text-shadow: 0 1px 3px rgba(0, 122, 255, 0.3);
}

.stat-label, .stat-card p {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Toast通知 */
.toast-modern, .toast {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    color: var(--text-primary);
}

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}

/* CPS测试区域 */
.cps-area {
    background: rgba(255, 255, 255, 0.05);
    border: none;
    border-radius: var(--radius-xl);
    min-height: 500px;
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    margin: 20px 0;
}

.cps-area.clicking {
    background: rgba(0, 122, 255, 0.1);
    transform: scale(0.995);
}

/* 图表容器 */
.chart-container {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin: 20px 0;
    box-shadow: var(--shadow-md);
}

/* 反应测试区域 */
.reaction-area {
    background: linear-gradient(135deg, 
        rgba(255, 59, 48, 0.8), 
        rgba(215, 0, 21, 0.8)
    );
    border: none;
    border-radius: var(--radius-xl);
    min-height: 400px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s var(--ease-out-cubic);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 600;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    box-shadow: var(--shadow-lg);
    margin: 20px 0;
}

.reaction-area.waiting {
    background: linear-gradient(135deg, 
        rgba(255, 59, 48, 0.9), 
        rgba(215, 0, 21, 0.9)
    );
    animation: pulse 1.5s ease-in-out infinite;
}

.reaction-area.ready {
    background: linear-gradient(135deg, 
        rgba(48, 209, 88, 0.9), 
        rgba(32, 169, 68, 0.9)
    );
    box-shadow: 0 0 30px rgba(48, 209, 88, 0.4);
}

/* 键盘布局 */
.keyboard-layout {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-lg);
    padding: 25px;
    margin: 20px 0;
    box-shadow: var(--shadow-md);
}

.key {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s var(--ease-out-cubic);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    margin: 2px;
    position: relative;
    overflow: hidden;
}

.key::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.2), 
        rgba(255, 255, 255, 0.05)
    );
    opacity: 0;
    transition: opacity 0.2s ease;
}

.key.pressed, .key.pressed::before {
    background: linear-gradient(135deg, var(--primary-color), #0056b3);
    color: white;
    transform: translateY(1px);
    box-shadow: var(--shadow-sm);
    opacity: 1;
}

.key:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    border-color: rgba(255, 255, 255, 0.4);
}

/* 进度条 */
.progress-modern, .progress {
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-lg);
    overflow: hidden;
    height: 12px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-bar-modern, .progress-bar {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: var(--radius-lg);
    transition: width 0.3s var(--ease-out-cubic);
    box-shadow: 0 2px 4px rgba(0, 122, 255, 0.3);
}

/* 禁用的3D场景 */
.disabled-scene {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-xl);
    padding: 60px 30px;
    text-align: center;
    box-shadow: var(--shadow-lg);
    transition: all 0.3s var(--ease-out-cubic);
    color: var(--text-primary);
}

.disabled-scene h3 {
    color: var(--text-primary);
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 15px;
}

.disabled-scene p {
    color: var(--text-secondary);
    font-size: 16px;
    margin-bottom: 25px;
}

.disabled-scene:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

/* 移动菜单按钮 */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1051;
    background: rgba(59, 130, 246, 0.9);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px;
    font-size: 18px;
    cursor: pointer;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.mobile-menu-toggle:hover {
    background: rgba(37, 99, 235, 0.9);
    transform: scale(1.05);
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1049;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    display: none;
}

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

/* 高分辨率和缩放优化 */
@media (-webkit-min-device-pixel-ratio: 1.25), (min-resolution: 120dpi) {
    .sidebar {
        border-right: 1px solid rgba(226, 232, 240, 0.8);
    }
    
    .sidebar .nav-link {
        padding: 12px 20px;
        font-size: 14px;
    }
}

/* 1200px以下 - 缩小侧边栏 */
@media (max-width: 1200px) and (min-width: 993px) {
    .sidebar {
        width: 200px;
        min-width: 200px;
    }
    
    .sidebar .nav-link {
        padding: 10px 16px;
        font-size: 13px;
    }
    
    #content {
        margin-left: 200px;
        width: calc(100% - 200px);
    }
}

/* 992px以下 - 移动菜单 */
@media (max-width: 992px) {
    .mobile-menu-toggle {
        display: block;
    }
    
    .sidebar-overlay {
        display: block;
    }
    
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        width: 280px;
        min-width: 280px;
        transform: translateX(-100%);
        z-index: 1050;
        transition: transform 0.3s ease;
        box-shadow: 4px 0 15px rgba(0, 0, 0, 0.1);
        overflow-y: auto;
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    #content {
        margin-left: 0;
        width: 100%;
    }
    
    .test-container, .container {
        padding: 20px 15px;
        margin-top: 60px; /* 为移动菜单按钮留空间 */
    }
}

/* 768px以下 - 平板和大手机 */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        top: 15px;
        left: 15px;
        padding: 10px;
        font-size: 16px;
    }
    
    .sidebar {
        width: 260px;
        min-width: 260px;
    }
    
    .test-container, .container {
        padding: 15px 10px;
        margin-top: 55px;
    }
    
    .test-card, .settings-panel, .stats-panel {
        padding: 20px;
        margin-bottom: 15px;
    }
    
    .stat-value, .stat-card h3 {
        font-size: 24px;
    }
    
    .page-title {
        font-size: 24px;
    }
    
    .navbar {
        padding: 10px 15px;
    }
    
    .particle-layer {
        display: none; /* 移动设备上隐藏粒子效果以提升性能 */
    }
}

/* 576px以下 - 小手机 */
@media (max-width: 576px) {
    .sidebar {
        width: 100%;
        min-width: 100%;
    }
    
    .mobile-menu-toggle {
        top: 10px;
        left: 10px;
        padding: 8px;
        font-size: 14px;
    }
    
    .test-container, .container {
        padding: 10px 5px;
        margin-top: 50px;
    }
    
    .test-card, .settings-panel, .stats-panel {
        padding: 15px;
        margin-bottom: 10px;
    }
}

/* 480px以下 - 超小屏幕 */
@media (max-width: 480px) {
    .test-container, .container {
        padding: 8px 3px;
    }
    
    .test-card, .settings-panel, .stats-panel {
        padding: 12px;
    }
}

/* 桌面端隐藏移动相关元素 */
@media (min-width: 993px) {
    .mobile-menu-toggle {
        display: none !important;
    }
    
    .sidebar-overlay {
        display: none !important;
    }
    
    .sidebar {
        transform: translateX(0) !important;
        position: relative !important;
        box-shadow: none !important;
    }
}

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

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

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

.animate-fade-in {
    animation: fadeIn 0.6s var(--ease-out-cubic);
}

.animate-slide-in-left {
    animation: slideInLeft 0.6s var(--ease-out-cubic);
}

.animate-slide-in-right {
    animation: slideInRight 0.6s var(--ease-out-cubic);
}

/* 加载动画 */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-left-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

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

/* 发光效果 */
.glow {
    box-shadow: 0 0 20px rgba(0, 122, 255, 0.5);
}

/* 脉冲效果 */
.pulse {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { 
        opacity: 1; 
        transform: scale(1);
    }
    50% { 
        opacity: 0.8; 
        transform: scale(1.02);
    }
}

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

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* 确保所有内容在粒子层之上 */
.wrapper, .sidebar, #content, .navbar {
    position: relative;
    z-index: 10;
}

/* 主要内容区域背景加深 */
.test-container {
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 20px;
    padding: 20px;
    min-height: calc(100vh - 140px);
}

/* 通用文字颜色优化 */
.test-card, .content-wrapper, .sidebar-item {
    color: #334155 !important;
}

.test-card h1, .test-card h2, .test-card h3, .test-card h4 {
    color: #1e293b !important;
    text-shadow: none !important;
}

.test-card p, .test-card span, .test-card div {
    color: #475569 !important;
}

/* 按钮文字颜色 */
.btn, .btn-start, .btn-primary, .btn-success, .btn-danger {
    color: white !important;
}

/* 输入框和表单文字颜色 */
.form-control, .form-select, input, textarea, select {
    color: #1e293b !important;
    background: rgba(255, 255, 255, 0.9) !important;
}

/* 列表和导航文字颜色 */
.nav-link, .list-group-item, .dropdown-item {
    color: #334155 !important;
}

.nav-link:hover, .list-group-item:hover {
    color: #1e293b !important;
}

/* 表格文字颜色 */
.table, .table td, .table th {
    color: #334155 !important;
}

/* 卡片内容文字颜色 */
.card, .card-body, .card-title, .card-text {
    color: #334155 !important;
}

/* 确保图标也使用深色 */
i, .bi {
    color: inherit !important;
}

/* 加强内容区域背景 */
.test-card {
    background: rgba(255, 255, 255, 0.95) !important;
    border: 1px solid rgba(203, 213, 225, 0.5) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
}

/* 左侧菜单栏背景加深 */
.sidebar {
    background: rgba(15, 23, 42, 0.9) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
}

.sidebar .nav-link {
    color: #e2e8f0 !important;
}

.sidebar .nav-link:hover {
    color: #f1f5f9 !important;
    background: rgba(255, 255, 255, 0.1) !important;
}

.sidebar .nav-link.active {
    color: #60a5fa !important;
    background: rgba(59, 130, 246, 0.2) !important;
}

/* 修复统计页面的文字颜色 */
.stats-main-title, .panel-title {
    color: #f1f5f9 !important;
}

.stats-subtitle {
    color: #cbd5e1 !important;
}

.metric-value {
    color: #f8fafc !important;
}

.metric-label, .data-type-count {
    color: #94a3b8 !important;
}

.data-type-title {
    color: #e2e8f0 !important;
}

/* 确保JavaScript动态生成的内容也使用正确颜色 */
.history-table-body, .empty-state-content {
    color: #cbd5e1 !important;
}

.empty-state-content h3 {
    color: #9ca3af !important;
}

.empty-state-content p {
    color: #6b7280 !important;
}

/* 修复移动设备警告框颜色 */
.mobile-warning, .mobile-warning * {
    color: #1f2937 !important;
}

/* 修复Toast通知颜色 */
.toast-message {
    color: #1f2937 !important;
}

/* 响应式文字颜色修复 */
@media (max-width: 768px) {
    .test-container {
        background: rgba(255, 255, 255, 0.95) !important;
    }
    
    .test-card {
        background: rgba(255, 255, 255, 0.98) !important;
    }
}

/* 浅色主题全局覆盖 - 禁用深色主题 */
.sidebar {
    background: rgba(248, 250, 252, 0.95) !important;
    color: #1f2937 !important;
}

.sidebar .nav-link {
    color: #374151 !important;
}

.sidebar .nav-link:hover {
    color: #1f2937 !important;
    background: rgba(59, 130, 246, 0.1) !important;
}

.sidebar .nav-link.active {
    color: #3b82f6 !important;
    background: rgba(59, 130, 246, 0.15) !important;
}

.test-container {
    background: rgba(255, 255, 255, 0.9) !important;
    border: 1px solid rgba(226, 232, 240, 0.8) !important;
    color: #1f2937 !important;
}

.test-card {
    background: rgba(255, 255, 255, 0.98) !important;
    color: #1f2937 !important;
    border: 1px solid rgba(226, 232, 240, 0.6) !important;
}

.test-card h1, .test-card h2, .test-card h3, .test-card h4 {
    color: #1e293b !important;
}

.test-card p, .test-card span, .test-card div {
    color: #374151 !important;
}

/* 统计页面特殊覆盖保持原设计 */
.stats-header-section,
.stats-overview-panel,
.stats-data-panel,
.stats-history-panel,
.stats-charts-panel {
    background: #ffffff !important;
    color: #1f2937 !important;
}

.stats-main-title, .panel-title {
    color: #1e293b !important;
}

.stats-subtitle {
    color: #475569 !important;
}

.metric-value {
    color: #1e293b !important;
}

.metric-label, .data-type-count {
    color: #64748b !important;
}

.data-type-title {
    color: #1e293b !important;
}

.metric-card, .data-type-card {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
}

.metric-card:hover, .data-type-card:hover {
    background: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
}

.history-table {
    background: #ffffff !important;
    border: 1px solid #e5e7eb !important;
}

.history-table-header {
    background: #f9fafb !important;
    color: #374151 !important;
}

.chart-area {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
}

.chart-tab {
    background: #f8fafc !important;
    color: #64748b !important;
    border: 1px solid #e2e8f0 !important;
}

.chart-tab:hover {
    background: #f1f5f9 !important;
    color: #475569 !important;
}

.chart-tab.active {
    background: #3b82f6 !important;
    color: white !important;
}

/* 表单控件浅色主题 */
.form-control, .form-select, input, textarea, select {
    background: rgba(255, 255, 255, 0.95) !important;
    color: #1f2937 !important;
    border: 1px solid #d1d5db !important;
}

.form-control:focus, .form-select:focus, input:focus, textarea:focus, select:focus {
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1) !important;
}

/* 按钮保持原有设计 */
.btn, .btn-start, .btn-primary, .btn-success, .btn-danger {
    color: white !important;
}

/* Toast和警告框浅色主题 */
.toast-message {
    background: rgba(255, 255, 255, 0.95) !important;
    color: #1f2937 !important;
    border: 1px solid #e5e7eb !important;
}

.mobile-warning {
    background: rgba(255, 255, 255, 0.95) !important;
    color: #1f2937 !important;
    border: 1px solid #e5e7eb !important;
}

/* 确保所有图标使用深色 */
i, .bi {
    color: inherit !important;
} 