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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    color: #ffffff;
    min-height: 100vh;
    padding: 20px;
}

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

/* 标题样式 */
.header {
    text-align: center;
    margin-bottom: 30px;
}

.header h1 {
    font-size: 2.5rem;
    background: linear-gradient(45deg, #ffd700, #ff6b35);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 10px;
}

.header p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.1rem;
}

/* 仪表盘样式 */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.dashboard-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 25px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.dashboard-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
}

.dashboard-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.2);
}

/* 卡片特定样式 */
.bank-price::before { background: linear-gradient(90deg, #ffd700, #ff6b35); }
.recycle-price::before { background: linear-gradient(90deg, #4caf50, #8bc34a); }
.brand-price::before { background: linear-gradient(90deg, #2196f3, #03a9f4); }
.stats-card::before { background: linear-gradient(90deg, #9c27b0, #673ab7); }

.card-icon {
    font-size: 2rem;
    margin-bottom: 15px;
    text-align: center;
}

.card-content h3 {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 15px;
    font-weight: 500;
}

.price-display {
    font-size: 2.2rem;
    font-weight: bold;
    background: linear-gradient(45deg, #ffffff, #e0e0e0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 5px;
}

.price-unit {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}

/* 统计卡片样式 */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

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

.stat-label {
    display: block;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: bold;
    color: #ffffff;
}

/* 迷你走势图 */
.card-sparkline {
    height: 40px;
    margin-top: 15px;
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.dashboard-card:hover .card-sparkline {
    opacity: 1;
}

/* 图表容器 */
.chart-container {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 20px;
}

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

.chart-title {
    font-size: 1.3rem;
    font-weight: 500;
}

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

.chart-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.8);
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.chart-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

.chart-btn.active {
    background: linear-gradient(45deg, #ffd700, #ff6b35);
    color: #000000;
    border-color: transparent;
}

#priceChart {
    width: 100% !important;
    height: 400px !important;
}

/* 加载和错误状态 */
.loading, .error {
    text-align: center;
    padding: 40px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    margin: 20px 0;
}

.loading {
    color: #ffd700;
}

.error {
    color: #ff4757;
}

/* 刷新按钮 */
.refresh-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: linear-gradient(45deg, #ffd700, #ff6b35);
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    color: #000000;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 5px 20px rgba(255, 215, 0, 0.3);
    transition: all 0.3s ease;
    z-index: 1000;
}

.refresh-btn:hover {
    transform: rotate(180deg) scale(1.1);
    box-shadow: 0 8px 30px rgba(255, 215, 0, 0.4);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .price-display {
        font-size: 1.8rem;
    }
    
    .chart-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .chart-buttons {
        width: 100%;
        justify-content: center;
    }
}

/* 动画效果 */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.dashboard-card {
    animation: pulse 2s ease-in-out infinite;
}

.dashboard-card:nth-child(2) { animation-delay: 0.2s; }
.dashboard-card:nth-child(3) { animation-delay: 0.4s; }
.dashboard-card:nth-child(4) { animation-delay: 0.6s; }

/* 玻璃态效果增强 */
.dashboard-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* 使用说明样式 */
.usage-guide {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 30px 0;
    margin-top: 40px;
}

.usage-guide h3 {
    text-align: center;
    margin-bottom: 30px;
    color: #ffd700;
    font-size: 1.5rem;
}

.guide-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.guide-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.guide-item:hover {
    transform: translateY(-3px);
    border-color: rgba(255, 215, 0, 0.3);
}

.guide-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.guide-text h4 {
    color: #ffffff;
    margin-bottom: 5px;
    font-size: 1.1rem;
}

.guide-text p {
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
    font-size: 0.9rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .guide-content {
        grid-template-columns: 1fr;
    }
    
    .guide-item {
        flex-direction: column;
        text-align: center;
    }
    
    .usage-guide h3 {
        font-size: 1.3rem;
    }
}
