/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #0052d9;
    --primary-dark: #003bb3;
    --primary-light: #e6f0ff;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--gray-50);
    color: var(--gray-800);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 导航栏 */
.navbar {
    background: #fff;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
}

.logo-icon {
    font-size: 24px;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 32px;
}

.nav-menu a {
    text-decoration: none;
    color: var(--gray-600);
    font-weight: 500;
    transition: color 0.2s;
    padding: 8px 0;
}

.nav-menu a:hover,
.nav-menu a.active {
    color: var(--primary);
}

.nav-actions {
    display: flex;
    gap: 12px;
}

/* 按钮样式 */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
}

.btn-secondary:hover {
    background: var(--gray-200);
}

.btn-location {
    background: var(--primary-light);
    color: var(--primary);
}

.btn-location:hover {
    background: #d1e3ff;
}

/* 英雄区 */
.hero-section {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    padding: 60px 0;
    text-align: center;
}

.hero-title {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 12px;
}

.hero-subtitle {
    font-size: 16px;
    opacity: 0.9;
    margin-bottom: 32px;
}

.province-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.province-selector label {
    font-size: 14px;
}

.select-province {
    padding: 12px 16px;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    min-width: 160px;
    background: #fff;
    color: var(--gray-800);
    cursor: pointer;
}

/* 油价卡片区 */
.price-cards-section {
    padding: 40px 0;
}

.section-header {
    margin-bottom: 24px;
}

.section-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--gray-800);
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.update-time {
    font-size: 13px;
    color: var(--gray-500);
    font-weight: 400;
}

.price-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}

.price-card {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-md);
    transition: transform 0.2s, box-shadow 0.2s;
    border-top: 4px solid;
}

.price-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.card-92 { border-top-color: #22c55e; }
.card-95 { border-top-color: #3b82f6; }
.card-98 { border-top-color: #8b5cf6; }
.card-0 { border-top-color: #f59e0b; }

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.oil-type {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-600);
}

.trend {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 500;
}

.trend.up {
    background: #fef2f2;
    color: var(--danger);
}

.trend.down {
    background: #f0fdf4;
    color: var(--success);
}

.trend.stable {
    background: var(--gray-100);
    color: var(--gray-600);
}

.card-body {
    margin-bottom: 12px;
}

.price-symbol {
    font-size: 20px;
    color: var(--gray-500);
    font-weight: 500;
}

.price-value {
    font-size: 40px;
    font-weight: 700;
    color: var(--gray-800);
    line-height: 1;
}

.price-unit {
    font-size: 14px;
    color: var(--gray-500);
}

.card-footer {
    font-size: 13px;
    color: var(--gray-500);
}

.change {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.change.up {
    color: var(--danger);
}

.change.down {
    color: var(--success);
}

/* 图表区 */
.chart-section {
    padding: 40px 0;
    background: #fff;
}

.chart-section .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.chart-controls {
    display: flex;
    gap: 8px;
}

.btn-chart {
    padding: 8px 16px;
    border: 1px solid var(--gray-200);
    background: #fff;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.btn-chart:hover,
.btn-chart.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.chart-container {
    height: 400px;
    margin-top: 24px;
}

/* 调价记录 */
.calendar-section {
    padding: 40px 0;
}

.adjustment-list {
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.adjustment-item {
    display: flex;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid var(--gray-100);
}

.adjustment-item:last-child {
    border-bottom: none;
}

.adjustment-date {
    width: 120px;
    font-size: 14px;
    color: var(--gray-600);
}

.adjustment-content {
    flex: 1;
    display: flex;
    gap: 24px;
    align-items: center;
}

.adjustment-oil {
    display: flex;
    align-items: center;
    gap: 8px;
}

.oil-label {
    font-size: 13px;
    color: var(--gray-500);
}

.oil-change {
    font-weight: 600;
    font-size: 14px;
}

.oil-change.up {
    color: var(--danger);
}

.oil-change.down {
    color: var(--success);
}

.adjustment-note {
    font-size: 13px;
    color: var(--gray-500);
}

/* 全国对比 */
.comparison-section {
    padding: 40px 0;
    background: #fff;
}

.comparison-section .subtitle {
    font-size: 13px;
    color: var(--gray-500);
    font-weight: 400;
}

.comparison-table-wrapper {
    overflow-x: auto;
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.comparison-table th,
.comparison-table td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid var(--gray-100);
}

.comparison-table th {
    font-weight: 600;
    color: var(--gray-600);
    background: var(--gray-50);
}

.comparison-table tr:hover {
    background: var(--gray-50);
}

.rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 600;
}

.rank.top3 {
    background: var(--primary);
    color: #fff;
}

.rank.other {
    background: var(--gray-200);
    color: var(--gray-600);
}

.province-name {
    font-weight: 500;
    color: var(--gray-800);
}

.price {
    font-weight: 600;
    color: var(--gray-800);
}

/* 底部 */
.footer {
    background: var(--gray-900);
    color: var(--gray-400);
    padding: 48px 0 24px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 32px;
    flex-wrap: wrap;
    gap: 24px;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 600;
    color: #fff;
}

.footer-desc {
    margin-top: 8px;
    font-size: 13px;
    color: var(--gray-500);
    font-weight: 400;
}

.footer-links {
    display: flex;
    gap: 24px;
}

.footer-links a {
    color: var(--gray-400);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: #fff;
}

.footer-bottom {
    border-top: 1px solid var(--gray-800);
    padding-top: 24px;
    text-align: center;
    font-size: 13px;
}

/* 加载状态 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 错误提示 */
.error-message {
    background: #fef2f2;
    color: var(--danger);
    padding: 12px 16px;
    border-radius: var(--radius);
    margin: 16px 0;
    font-size: 14px;
}

/* 响应式 */
@media (max-width: 768px) {
    .nav-menu {
        display: none;
    }
    
    .hero-title {
        font-size: 28px;
    }
    
    .province-selector {
        flex-direction: column;
    }
    
    .price-cards {
        grid-template-columns: 1fr;
    }
    
    .chart-section .section-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .comparison-table th,
    .comparison-table td {
        padding: 12px 8px;
        font-size: 13px;
    }
    
    .footer-content {
        flex-direction: column;
    }
    
    .footer-links {
        flex-wrap: wrap;
    }
}

/* 动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.price-card {
    animation: fadeIn 0.5s ease-out;
}

.price-card:nth-child(1) { animation-delay: 0s; }
.price-card:nth-child(2) { animation-delay: 0.1s; }
.price-card:nth-child(3) { animation-delay: 0.2s; }
.price-card:nth-child(4) { animation-delay: 0.3s; }
