/* 图表样式 */
.chart-container {
    position: relative;
    width: 100%;
    height: 400px;
    margin: 1rem 0;
}

.chart-container canvas {
    max-width: 100%;
    height: auto !important;
}

/* 图表标题 */
.chart-title {
    text-align: center;
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 1rem;
}

/* 图表控制按钮 */
.chart-controls {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.chart-btn {
    padding: 0.5rem 1rem;
    border: 1px solid #ddd;
    background: white;
    cursor: pointer;
    border-radius: 3px;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.chart-btn:hover {
    background: #f8f9fa;
    border-color: #667eea;
}

.chart-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* 图表加载状态 */
.chart-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
    color: #666;
    font-style: italic;
}

.chart-error {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
    color: #dc3545;
    font-weight: 500;
}

/* 图表图例 */
.chart-legend {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

/* 价格趋势图表特殊样式 */
.price-trend-chart {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 10px;
    padding: 1rem;
}

.price-trend-chart .chart-container {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* 响应式图表 */
@media (max-width: 768px) {
    .chart-container {
        height: 300px;
    }
    
    .chart-controls {
        flex-direction: column;
        align-items: center;
    }
    
    .chart-legend {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }
}

/* 图表动画 */
@keyframes chartFadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.chart-container {
    animation: chartFadeIn 0.5s ease;
}

/* 数据点悬停效果 */
.chart-point {
    cursor: pointer;
    transition: all 0.3s ease;
}

.chart-point:hover {
    transform: scale(1.2);
}

/* 价格变化指示器 */
.price-change {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-weight: 500;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    font-size: 0.8rem;
}

.price-change.up {
    color: #28a745;
    background: #d4edda;
}

.price-change.down {
    color: #dc3545;
    background: #f8d7da;
}

.price-change.neutral {
    color: #6c757d;
    background: #e9ecef;
}

.price-change-arrow {
    font-size: 0.7rem;
}

/* 时间范围选择器 */
.time-range-selector {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    justify-content: center;
}

.time-range-btn {
    padding: 0.5rem 1rem;
    border: 1px solid #ddd;
    background: white;
    cursor: pointer;
    border-radius: 20px;
    font-size: 0.8rem;
    transition: all 0.3s ease;
    min-width: 60px;
}

.time-range-btn:hover {
    background: #f8f9fa;
    border-color: #667eea;
}

.time-range-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* 图表工具栏 */
.chart-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.chart-toolbar-left {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.chart-toolbar-right {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* 数据统计卡片 */
.chart-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.stat-card {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    text-align: center;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.8rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-change {
    font-size: 0.7rem;
    margin-top: 0.25rem;
}

/* 导出按钮 */
.export-btn {
    padding: 0.5rem 1rem;
    border: 1px solid #28a745;
    background: white;
    color: #28a745;
    cursor: pointer;
    border-radius: 3px;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.export-btn:hover {
    background: #28a745;
    color: white;
}

/* 图表无数据状态 */
.chart-no-data {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 200px;
    color: #666;
    text-align: center;
}

.chart-no-data-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.chart-no-data-text {
    font-style: italic;
}
