/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    min-height: 100vh;
    color: #1a202c;
    line-height: 1.5;
    margin: 0;
    padding: 15px;
    font-weight: 400;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0;
}

/* 头部样式 */
.header {
    text-align: center;
    margin-bottom: 25px;
    color: #1a202c;
    padding: 20px 0;
}

.header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: #2d3748;
    letter-spacing: -0.025em;
}

.subtitle {
    font-size: 0.875rem;
    color: #718096;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* 主要内容区域 */
.main-content {
    display: grid;
    gap: 30px;
}

/* 当前指数卡片 */
.current-index-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(226, 232, 240, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
    transition: all 0.3s ease;
    position: relative;
}

.current-index-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.index-main {
    display: flex;
    align-items: center;
    gap: 30px;
}

.index-score {
    font-size: 4rem;
    font-weight: 800;
    color: #2563eb;
    line-height: 1;
    letter-spacing: -0.025em;
}

.index-rating {
    font-size: 0.9rem;
    font-weight: 500;
    padding: 6px 16px;
    border-radius: 6px;
    color: white;
    letter-spacing: 0.025em;
    white-space: nowrap;
    border-left: 4px solid rgba(255,255,255,0.3);
}

/* 指数评级颜色 - 机会导向配色 */
.rating-extreme-fear { background: #f1c40f; } /* 金色 - 黄金机会 */
.rating-fear { background: #27ae60; } /* 绿色 - 机会 */
.rating-neutral { background: #95a5a6; } /* 灰色 - 中性 */
.rating-greed { background: #e67e22; } /* 橙色 - 警惕 */
.rating-extreme-greed { background: #e74c3c; } /* 红色 - 危险 */


.last-updated {
    position: absolute;
    top: 20px;
    right: 25px;
    color: #9ca3af;
    font-size: 0.8rem;
    font-weight: 400;
    white-space: nowrap;
}

/* 图表容器 */
.chart-container {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(226, 232, 240, 0.8);
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.chart-container:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.chart-header h2 {
    color: #2d3748;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.chart-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.time-filter {
    padding: 10px 20px;
    border: 2px solid #e2e8f0;
    background: white;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    color: #718096;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.time-filter:hover {
    border-color: #4299e1;
    color: #4299e1;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.time-filter.active {
    background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
    border-color: #4299e1;
    color: white;
    box-shadow: 0 4px 12px rgba(66, 153, 225, 0.4);
}

.chart-wrapper {
    position: relative;
    height: 350px;
}


/* 页脚 */
.footer {
    text-align: center;
    margin-top: 30px;
    padding: 20px;
    color: #a0aec0;
    font-size: 0.8rem;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.footer a {
    color: #4299e1;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.footer a:hover {
    color: #3182ce;
    text-decoration: underline;
}

/* 小屏笔记本优化 */
@media (max-height: 800px) {
    .header {
        padding: 15px 0;
        margin-bottom: 20px;
    }
    
    .header h1 {
        font-size: 1.75rem;
    }
    
    .current-index-card {
        padding: 20px;
        margin-bottom: 15px;
    }
    
    .index-score {
        font-size: 3.5rem;
    }
    
    .chart-container {
        padding: 20px;
        margin-bottom: 15px;
    }
    
    .chart-wrapper {
        height: 280px;
    }
    
    .footer {
        margin-top: 20px;
        padding: 15px;
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .current-index-card {
        padding: 50px 20px 40px 20px;
    }
    
    .index-main {
        flex-direction: column;
        gap: 20px;
    }
    
    .index-score {
        font-size: 4rem;
    }
    
    .last-updated {
        position: static;
        margin-top: 20px;
        text-align: center;
    }
    
    .chart-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .chart-controls {
        justify-content: center;
    }
    
    .explanation-grid {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
    
    .chart-wrapper {
        height: 300px;
    }
}

@media (max-width: 480px) {
    .index-score {
        font-size: 3rem !important;
    }
    
    .time-filter {
        padding: 6px 12px;
        font-size: 0.9rem;
    }
    
    .chart-wrapper {
        height: 250px;
    }
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* 数值变化动画 */
.value-change {
    transition: all 0.3s ease;
}

.value-up {
    color: #27ae60 !important;
}

.value-down {
    color: #e74c3c !important;
}

