/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, 
        #ffeded 0%, 
        #fff5f5 25%, 
        #f0fff0 50%, 
        #f5fff5 75%, 
        #ffffff 100%);
    min-height: 100vh;
    color: #333;
    overflow-x: hidden;
}

body.dark-theme {
    background: linear-gradient(135deg, 
        #2d1b1b 0%, 
        #1b2d1b 25%, 
        #1b1b2d 50%, 
        #2d1b2d 75%, 
        #1b2d2d 100%);
    color: #e0e0e0;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 25px;
}

/* 头部样式 */
.header {
    text-align: center;
    margin-bottom: 50px;
    background: rgba(255, 255, 255, 0.98);
    padding: 40px 30px;
    border-radius: 20px;
    box-shadow: 
        0 10px 40px rgba(255, 100, 100, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    position: relative;
    overflow: hidden;
}

.dark-theme .header {
    background: rgba(40, 40, 60, 0.95);
    box-shadow: 
        0 10px 40px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(
        from 0deg,
        transparent,
        rgba(255, 200, 200, 0.4),
        rgba(200, 255, 200, 0.4),
        rgba(255, 255, 255, 0.6),
        transparent
    );
    animation: sparkle 8s linear infinite;
    z-index: -1;
}

.header::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        45deg,
        rgba(255, 107, 107, 0.05),
        rgba(78, 205, 196, 0.05),
        rgba(255, 255, 255, 0.1)
    );
    z-index: -1;
}

@keyframes sparkle {
    0% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.1); }
    100% { transform: rotate(360deg) scale(1); }
}

.title {
    font-size: 3rem;
    background: linear-gradient(135deg, 
        #ff6b6b 0%, 
        #ff8e8e 25%, 
        #4ecdc4 50%, 
        #88d8c0 75%, 
        #ffcccc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 15px;
    font-weight: 800;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.subtitle {
    font-size: 1.3rem;
    color: #666;
    font-weight: 400;
    line-height: 1.6;
}

.dark-theme .subtitle {
    color: #b0b0b0;
}

/* 主题切换按钮 */
.theme-toggle {
    margin-top: 20px;
}

.theme-btn {
    background: linear-gradient(135deg, #ff6b6b, #4ecdc4);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

.theme-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
}

/* 仪表板布局 - 单列排列 */
.dashboard {
    display: flex;
    flex-direction: column;
    gap: 35px;
    margin-bottom: 50px;
}

/* 卡片样式 */
.card {
    background: rgba(255, 255, 255, 0.98);
    border-radius: 20px;
    box-shadow: 
        0 10px 40px rgba(255, 100, 100, 0.12),
        0 1px 0 rgba(255, 255, 255, 0.6) inset;
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    opacity: 0;
    transform: translateY(30px);
}

.dark-theme .card {
    background: rgba(40, 40, 60, 0.95);
    box-shadow: 
        0 10px 40px rgba(0, 0, 0, 0.3),
        0 1px 0 rgba(255, 255, 255, 0.1) inset;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 
        0 20px 60px rgba(255, 100, 100, 0.2),
        0 8px 30px rgba(78, 205, 196, 0.15);
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg, 
        transparent, 
        rgba(255, 255, 255, 0.6), 
        transparent
    );
    transition: left 0.7s;
}

.card:hover::before {
    left: 100%;
}

.card-header {
    background: linear-gradient(135deg, #ff6b6b, #4ecdc4);
    color: white;
    padding: 25px;
    border-radius: 20px 20px 0 0;
    position: relative;
    overflow: hidden;
}

.card-header::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        45deg,
        rgba(255, 255, 255, 0.1),
        transparent,
        rgba(255, 255, 255, 0.1)
    );
}

.card-header h2 {
    font-size: 1.5rem;
    margin-bottom: 8px;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.card-header p {
    font-size: 1rem;
    opacity: 0.95;
    font-weight: 400;
}

.card-content {
    padding: 25px;
}

/* 图表容器 */
.chart-container {
    height: 350px;
    width: 100%;
    position: relative;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.5);
    overflow: hidden;
}

.dark-theme .chart-container {
    background: rgba(255, 255, 255, 0.05);
}

.chart-container:hover {
    transform: scale(1.03);
    box-shadow: 
        0 8px 25px rgba(255, 107, 107, 0.15),
        0 4px 15px rgba(78, 205, 196, 0.1);
}

.chart-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(
        from 0deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: chartSparkle 6s linear infinite;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.chart-container:hover::before {
    opacity: 1;
}

@keyframes chartSparkle {
    0% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.1); }
    100% { transform: rotate(360deg) scale(1); }
}

/* 图表控制按钮 */
.chart-controls, .animation-controls {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    justify-content: center;
}

.control-btn {
    background: linear-gradient(135deg, #ff8e8e, #88d8c0);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(255, 142, 142, 0.3);
}

.control-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 142, 142, 0.4);
}

/* 颜色调色板 */
.color-palette {
    display: flex;
    gap: 15px;
    margin-top: 20px;
    justify-content: center;
}

.color-item {
    flex: 1;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    color: white;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.color-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

/* 统计卡片样式 */
.stats-card {
    grid-column: 1 / -1;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
    padding: 30px;
}

.stat-item {
    text-align: center;
    padding: 35px 25px;
    background: linear-gradient(135deg, 
        rgba(255, 245, 245, 0.8), 
        rgba(240, 255, 240, 0.8));
    border-radius: 15px;
    box-shadow: 
        0 6px 20px rgba(255, 100, 100, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.dark-theme .stat-item {
    background: linear-gradient(135deg, 
        rgba(60, 45, 45, 0.8), 
        rgba(45, 60, 45, 0.8));
}

.stat-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #ff6b6b, #4ecdc4);
}

.stat-item:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 
        0 12px 30px rgba(255, 100, 100, 0.2),
        0 6px 20px rgba(78, 205, 196, 0.15);
}

.stat-value {
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(135deg, 
        #ff6b6b 0%, 
        #ff8e8e 33%, 
        #4ecdc4 66%, 
        #88d8c0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 15px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.stat-label {
    font-size: 1.1rem;
    color: #666;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.dark-theme .stat-label {
    color: #b0b0b0;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: rgba(255, 255, 255, 0.98);
    margin: 5% auto;
    padding: 30px;
    border-radius: 20px;
    width: 80%;
    max-width: 600px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
}

.dark-theme .modal-content {
    background: rgba(40, 40, 60, 0.98);
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover {
    color: #ff6b6b;
}

/* 页脚样式 */
.footer {
    text-align: center;
    padding: 40px;
    color: #666;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 6px 20px rgba(255, 100, 100, 0.1);
    backdrop-filter: blur(10px);
    line-height: 1.6;
}

.dark-theme .footer {
    background: rgba(40, 40, 60, 0.95);
    color: #b0b0b0;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .dashboard {
        gap: 25px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .dashboard {
        gap: 20px;
    }
    
    .title {
        font-size: 2.2rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 20px;
    }
    
    .chart-container {
        height: 280px;
    }
    
    .color-palette {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .title {
        font-size: 1.8rem;
    }
    
    .header {
        padding: 25px 20px;
    }
    
    .card-content {
        padding: 20px;
    }
    
    .chart-container {
        height: 220px;
    }
    
    .stat-value {
        font-size: 2.5rem;
    }
}

/* 页面加载动画 */
body {
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
}

body.loaded {
    opacity: 1;
}

/* 图表加载动画 */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    position: relative;
}

.loading::before {
    content: '';
    width: 60px;
    height: 60px;
    border: 3px solid rgba(255, 107, 107, 0.2);
    border-top: 3px solid #ff6b6b;
    border-radius: 50%;
    animation: spin 1.5s linear infinite;
    box-shadow: 0 0 20px rgba(255, 107, 107, 0.3);
}

.loading::after {
    content: '加载中...';
    position: absolute;
    bottom: -40px;
    color: #666;
    font-size: 14px;
    font-weight: 600;
}

@keyframes spin {
    0% { 
        transform: rotate(0deg);
        box-shadow: 0 0 20px rgba(255, 107, 107, 0.3);
    }
    50% {
        box-shadow: 0 0 30px rgba(255, 107, 107, 0.5);
    }
    100% { 
        transform: rotate(360deg);
        box-shadow: 0 0 20px rgba(255, 107, 107, 0.3);
    }
}

/* 图表加载进度条 */
.chart-loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, #ff6b6b, #4ecdc4);
    transition: width 1.5s ease-in-out;
    z-index: 10;
}

.chart-container.loading .chart-loading {
    width: 100%;
}

/* 自定义滚动条 */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #ff6b6b, #4ecdc4);
    border-radius: 10px;
    box-shadow: inset 0 0 6px rgba(255, 255, 255, 0.3);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #ff5252, #26a69a);
}