/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 页面头部 */
.header {
    text-align: center;
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.header h1 {
    font-size: 2.5rem;
    color: #2c3e50;
    margin-bottom: 10px;
    font-weight: 700;
}

.subtitle {
    color: #7f8c8d;
    font-size: 1.1rem;
    margin-bottom: 20px;
}

.status-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.status {
    padding: 8px 16px;
    background: #27ae60;
    color: white;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

.status.loading {
    background: #f39c12;
}

.status.error {
    background: #e74c3c;
}

.last-update {
    color: #666;
    font-size: 12px;
}

.auto-refresh-countdown {
    color: #007bff;
    font-size: 12px;
    margin-left: 10px;
}

.auto-refresh-countdown #countdown {
    font-weight: 600;
    color: #0056b3;
}

.refresh-btn {
    padding: 10px 20px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.refresh-btn:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

/* 主要价格展示 */
.main-prices {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.price-card {
    background: rgba(255, 255, 255, 0.95);
    padding: 25px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.price-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.price-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.price-header h3 {
    color: #2c3e50;
    font-size: 1.3rem;
    font-weight: 600;
}

.unit {
    color: #7f8c8d;
    font-size: 0.9rem;
    background: #ecf0f1;
    padding: 4px 8px;
    border-radius: 10px;
}

.price-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: #f39c12;
    margin-bottom: 10px;
    text-align: center;
}

.shanghai .price-value {
    color: #e74c3c;
}

.shuibei .price-value {
    color: #9b59b6;
}

.price-change {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
}

.change-value, .change-percent {
    padding: 5px 10px;
    border-radius: 10px;
    font-weight: 500;
    font-size: 0.9rem;
}

.change-value.positive, .change-percent.positive {
    background: #d5f4e6;
    color: #27ae60;
}

.change-value.negative, .change-percent.negative {
    background: #fadbd8;
    color: #e74c3c;
}

.price-details {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.detail-item {
    text-align: center;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 0.85rem;
}

.detail-item span:first-child {
    color: #7f8c8d;
    display: block;
    margin-bottom: 2px;
}

.detail-item span:last-child {
    font-weight: 600;
    color: #2c3e50;
}

.price-varieties {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 8px;
    margin-top: 15px;
}

.variety-item {
    background: #f8f9fa;
    padding: 8px;
    border-radius: 8px;
    text-align: center;
    font-size: 0.85rem;
}

.variety-name {
    color: #7f8c8d;
    display: block;
    margin-bottom: 2px;
}

.variety-price {
    font-weight: 600;
    color: #9b59b6;
}

/* 图表部分 */
.chart-section {
    background: rgba(255, 255, 255, 0.95);
    padding: 25px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    margin-bottom: 30px;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.chart-header h3 {
    color: #2c3e50;
    font-size: 1.4rem;
    font-weight: 600;
}

.chart-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.chart-btn {
    padding: 8px 16px;
    border: 2px solid #3498db;
    background: transparent;
    color: #3498db;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.chart-btn.active,
.chart-btn:hover {
    background: #3498db;
    color: white;
}

.chart-container {
    position: relative;
    height: 400px;
    margin-bottom: 20px;
}

.chart-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.stat-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
    text-align: center;
}

.stat-label {
    color: #7f8c8d;
    font-size: 0.85rem;
    display: block;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 1.2rem;
    font-weight: 600;
    color: #2c3e50;
}

/* 品牌金铺 */
.brands-section, .banks-section, .recovery-section {
    background: rgba(255, 255, 255, 0.95);
    padding: 25px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    margin-bottom: 30px;
}

.brands-section h3, .banks-section h3, .recovery-section h3 {
    color: #2c3e50;
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 20px;
}

.brands-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.brand-card {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 15px;
    transition: all 0.3s ease;
    border-left: 4px solid #f39c12;
}

.brand-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.brand-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 10px;
}

.brand-prices {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 8px;
}

.brand-price-item {
    text-align: center;
    padding: 8px;
    background: white;
    border-radius: 8px;
}

.price-type {
    font-size: 0.75rem;
    color: #7f8c8d;
    display: block;
    margin-bottom: 2px;
}

.price-amount {
    font-weight: 600;
    color: #f39c12;
    font-size: 0.9rem;
}

/* 银行列表 */
.banks-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 15px;
}

.bank-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
    padding: 15px 20px;
    border-radius: 10px;
    border-left: 4px solid #27ae60;
    transition: all 0.3s ease;
}

.bank-item:hover {
    transform: translateX(5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.bank-name {
    font-weight: 600;
    color: #2c3e50;
}

.bank-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: #27ae60;
}

/* 回收价格 */
.recovery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.recovery-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    border-top: 3px solid #9b59b6;
    transition: all 0.3s ease;
}

.recovery-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.recovery-name {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
}

.recovery-price {
    font-size: 1.2rem;
    font-weight: 700;
    color: #9b59b6;
    margin-bottom: 5px;
}

.recovery-date {
    font-size: 0.8rem;
    color: #7f8c8d;
}

/* 数据信息 */
.data-info {
    background: rgba(255, 255, 255, 0.95);
    padding: 25px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    margin-bottom: 30px;
}

.data-info h3 {
    color: #2c3e50;
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 20px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
    padding: 12px 15px;
    border-radius: 8px;
}

.info-label {
    color: #7f8c8d;
    font-weight: 500;
}

.info-item span:last-child {
    font-weight: 600;
    color: #2c3e50;
}

/* 页面底部 */
.footer {
    text-align: center;
    padding: 20px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

.footer p {
    margin-bottom: 5px;
}

/* 加载遮罩 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.loading-overlay.hidden {
    display: none;
}

.loading-spinner {
    text-align: center;
    color: white;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 错误提示 */
.error-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1001;
    backdrop-filter: blur(5px);
}

.error-modal.hidden {
    display: none;
}

.error-content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.error-content h3 {
    color: #e74c3c;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.error-content p {
    color: #7f8c8d;
    margin-bottom: 20px;
    line-height: 1.5;
}

.error-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.retry-btn, .close-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.retry-btn {
    background: #3498db;
    color: white;
}

.retry-btn:hover {
    background: #2980b9;
}

.close-btn {
    background: #95a5a6;
    color: white;
}

.close-btn:hover {
    background: #7f8c8d;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .main-prices {
        grid-template-columns: 1fr;
    }
    
    .chart-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .chart-controls {
        justify-content: center;
    }
    
    .price-details {
        grid-template-columns: 1fr;
    }
    
    .brands-grid {
        grid-template-columns: 1fr;
    }
    
    .banks-list {
        grid-template-columns: 1fr;
    }
    
    .recovery-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 20px;
    }
    
    .header h1 {
        font-size: 1.8rem;
    }
    
    .status-bar {
        flex-direction: column;
        gap: 10px;
    }
    
    .price-value {
        font-size: 2rem;
    }
    
    .chart-container {
        height: 300px;
    }
}

/* 动画效果 */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
} 