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

:root {
    --primary-color: #2196F3;
    --secondary-color: #03A9F4;
    --success-color: #4CAF50;
    --warning-color: #FF9800;
    --danger-color: #F44336;
    --dark-bg: #1a1a2e;
    --card-bg: #ffffff;
    --text-primary: #333333;
    --text-secondary: #666666;
    --border-radius: 12px;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 8px 15px rgba(0, 0, 0, 0.15);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--text-primary);
}

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

/* ========== 头部样式 ========== */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 20px 0;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.weather-icon {
    font-size: 32px;
}

.logo h1 {
    font-size: 24px;
    color: var(--primary-color);
}

.search-box {
    display: flex;
    gap: 10px;
    flex: 1;
    max-width: 500px;
}

.search-box input {
    flex: 1;
    padding: 12px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

.search-box button {
    padding: 12px 24px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.search-box button:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

/* ========== 主要内容 ========== */
.main-content {
    padding: 40px 0;
}

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

.section-header h2 {
    font-size: 24px;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.map-legend {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
    font-size: 14px;
}

.color-box {
    width: 20px;
    height: 20px;
    border-radius: 4px;
}

.color-box.hot { background: #d94e5d; }
.color-box.warm { background: #eac736; }
.color-box.cool { background: #50a3ba; }
.color-box.cold { background: #5470c6; }

/* ========== 地图区域 ========== */
.map-section {
    background: white;
    border-radius: var(--border-radius);
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
}

.map-container {
    width: 100%;
    height: 600px;
    border-radius: 8px;
}

/* ========== 当前天气卡片 ========== */
.current-weather {
    margin-bottom: 30px;
}

.weather-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: var(--border-radius);
    padding: 40px;
    color: white;
    box-shadow: var(--shadow);
}

.weather-header {
    margin-bottom: 30px;
}

.weather-header h3 {
    font-size: 36px;
    margin-bottom: 8px;
}

.weather-date {
    font-size: 16px;
    opacity: 0.9;
}

.weather-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 40px;
    flex-wrap: wrap;
}

.temperature {
    display: flex;
    align-items: flex-start;
}

.temp-value {
    font-size: 96px;
    font-weight: 700;
    line-height: 1;
}

.temp-unit {
    font-size: 36px;
    margin-top: 10px;
}

.weather-info {
    flex: 1;
    min-width: 300px;
}

.weather-condition {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
}

.weather-icon-large {
    font-size: 64px;
}

.weather-condition span:last-child {
    font-size: 28px;
    font-weight: 600;
}

.weather-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 8px;
    backdrop-filter: blur(10px);
}

.detail-label {
    font-size: 14px;
    opacity: 0.9;
}

.detail-value {
    font-size: 18px;
    font-weight: 600;
}

/* ========== 7天预报 ========== */
.forecast-section {
    background: white;
    border-radius: var(--border-radius);
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
}

.forecast-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.forecast-card {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.forecast-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.forecast-date {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.forecast-icon {
    font-size: 36px;
    margin: 10px 0;
}

.forecast-condition {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.forecast-temp {
    display: flex;
    justify-content: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 600;
}

.forecast-temp .high {
    color: var(--danger-color);
}

.forecast-temp .low {
    color: var(--primary-color);
}

/* ========== 主要城市网格 ========== */
.cities-grid {
    background: white;
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: var(--shadow);
}

.cities-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.city-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    padding: 20px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.city-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: var(--shadow-hover);
}

.city-name {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
}

.city-weather {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.city-icon {
    font-size: 32px;
}

.city-temp {
    font-size: 24px;
    font-weight: 700;
}

.city-info {
    margin-top: 15px;
    font-size: 13px;
    opacity: 0.9;
}

/* ========== 页脚 ========== */
.footer {
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 20px 0;
    margin-top: 40px;
}

.footer .container {
    text-align: center;
}

/* ========== 响应式设计 ========== */
@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
    }

    .search-box {
        width: 100%;
    }

    .weather-main {
        flex-direction: column;
    }

    .temp-value {
        font-size: 72px;
    }

    .weather-details {
        grid-template-columns: 1fr;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .map-legend {
        font-size: 12px;
    }

    .map-container {
        height: 400px;
    }
}

@media (max-width: 480px) {
    .logo h1 {
        font-size: 18px;
    }

    .temp-value {
        font-size: 56px;
    }

    .forecast-container {
        grid-template-columns: repeat(2, 1fr);
    }

    .cities-container {
        grid-template-columns: 1fr;
    }
}

/* ========== 动画效果 ========== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.weather-card,
.forecast-card,
.city-card {
    animation: fadeIn 0.5s ease-out;
}
