/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #f8f4ff 0%, #e6e6fa 100%);
    min-height: 100vh;
}

/* 头部导航 */
header {
    background: linear-gradient(135deg, #9370db 0%, #8a2be2 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 4px 15px rgba(139, 69, 190, 0.3);
    position: sticky;
    top: 0;
    z-index: 1000;
}

nav {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1rem;
}

nav h1 {
    font-size: 1.8rem;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

nav ul {
    display: flex;
    list-style: none;
    gap: 1rem;
    flex-wrap: wrap;
}

nav a {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    transition: all 0.3s ease;
    font-weight: 500;
}

nav a:hover,
nav a.active {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* 主要内容区域 */
main {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.content-section {
    display: none;
    animation: fadeIn 0.5s ease-in;
}

.content-section.active {
    display: block;
}

.section-content {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(139, 69, 190, 0.1);
    margin-bottom: 2rem;
}

.section-content h2 {
    color: #9370db;
    margin-bottom: 1rem;
    font-size: 2rem;
    border-bottom: 3px solid #e6e6fa;
    padding-bottom: 0.5rem;
}

/* 首页图表预览网格 */
.chart-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.chart-preview {
    background: linear-gradient(135deg, #f8f4ff 0%, #e6e6fa 100%);
    padding: 1.5rem;
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.chart-preview:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(139, 69, 190, 0.2);
    border-color: #9370db;
}

.chart-preview h3 {
    color: #9370db;
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.chart-preview p {
    color: #666;
    font-size: 0.9rem;
}

/* 图表容器 */
.chart-container {
    width: 100%;
    height: 500px;
    margin: 2rem 0;
    border-radius: 10px;
    overflow: hidden;
    background: #f8f4ff;
    border: 1px solid #e6e6fa;
}

/* 控制面板 */
.controls {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
    padding: 1rem;
    background: #f8f4ff;
    border-radius: 10px;
    margin-top: 1rem;
}

.controls label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #666;
    font-weight: 500;
}

.controls input[type="checkbox"] {
    accent-color: #9370db;
}

button {
    background: linear-gradient(135deg, #9370db 0%, #8a2be2 100%);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(139, 69, 190, 0.3);
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 69, 190, 0.4);
}

button:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(139, 69, 190, 0.3);
}

/* 页脚 */
footer {
    background: linear-gradient(135deg, #9370db 0%, #8a2be2 100%);
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: 3rem;
}

footer p {
    font-size: 1rem;
    opacity: 0.9;
}

/* 动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    nav {
        flex-direction: column;
        gap: 1rem;
    }
    
    nav ul {
        justify-content: center;
    }
    
    .chart-grid {
        grid-template-columns: 1fr;
    }
    
    .chart-container {
        height: 400px;
    }
    
    .controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    nav ul {
        flex-direction: column;
        align-items: center;
    }
    
    .section-content {
        padding: 1rem;
    }
    
    .chart-container {
        height: 300px;
    }
}

/* 自定义滚动条 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #9370db 0%, #8a2be2 100%);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #8a2be2 0%, #9370db 100%);
}