* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #333;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.97);
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    color: white;
}

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

.logo i {
    font-size: 2.5rem;
    color: #FFD700;
}

.logo h1 {
    font-size: 2rem;
    font-weight: 600;
}

.search-box {
    display: flex;
    gap: 10px;
    flex: 0 1 400px;
}

#city-input {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.9);
    transition: all 0.3s;
}

#city-input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
}

#search-btn {
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 50%;
    background: white;
    color: #667eea;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

#search-btn:hover {
    background: #f0f0f0;
    transform: scale(1.05);
}

.date-time {
    text-align: right;
}

#current-date {
    font-size: 1.2rem;
    font-weight: 500;
}

#current-time {
    font-size: 2rem;
    font-weight: 300;
    font-family: 'Courier New', monospace;
}

.main-content {
    padding: 30px 40px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-gap: 30px;
}

.current-weather {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 20px;
    padding: 30px;
    display: grid;
    grid-template-columns: 1fr 1fr 2fr;
    gap: 30px;
    align-items: center;
}

.location-info h2 {
    font-size: 2.5rem;
    color: #2c3e50;
    margin-bottom: 10px;
}

.location-info p {
    color: #666;
    font-size: 1.1rem;
}

.weather-main {
    text-align: center;
}

.temperature {
    font-size: 5rem;
    font-weight: 300;
    color: #2c3e50;
    line-height: 1;
}

.temp-unit {
    font-size: 2rem;
    vertical-align: super;
}

.weather-condition {
    margin-top: 10px;
}

#weather-icon {
    font-size: 3rem;
    margin-bottom: 10px;
}

#weather-text {
    font-size: 1.5rem;
    color: #666;
}

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

.detail-item {
    display: flex;
    align-items: center;
    gap: 15px;
    background: white;
    padding: 15px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.detail-item i {
    font-size: 1.5rem;
    color: #667eea;
}

.detail-item .label {
    display: block;
    color: #888;
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.detail-item .value {
    font-size: 1.3rem;
    font-weight: 600;
    color: #2c3e50;
}

/* ===== 天气预警卡片样式 ===== */
.weather-alert {
    background: white;
    border-radius: 16px;
    padding: 20px;
    margin: 0;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    grid-column: 1 / -1;
    border-top: 6px solid #4dabf7;
    animation: fadeIn 0.8s ease;
}

.alert-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 12px;
}
.alert-header i {
    font-size: 26px;
    color: #f59e0b;
}
.alert-header h3 {
    font-size: 1.5rem;
    color: #1f2937;
    margin: 0;
    margin-right: auto;
}
.alert-level {
    font-weight: bold;
    padding: 5px 14px;
    border-radius: 20px;
    color: white;
    font-size: 0.95rem;
}
#alert-level-label.blue { background-color: #3b82f6; }
#alert-level-label.yellow { background-color: #eab308; }
#alert-level-label.orange { background-color: #f97316; }
#alert-level-label.red { background-color: #ef4444; }

.alert-body p {
    margin: 10px 0;
    line-height: 1.6;
    color: #4b5563;
}
.alert-body strong {
    color: #111827;
    min-width: 70px;
    display: inline-block;
}

.test-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
.test-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.weather-alert.blue { border-top-color: #3b82f6; }
.weather-alert.yellow { border-top-color: #eab308; }
.weather-alert.orange { border-top-color: #f97316; }
.weather-alert.red { border-top-color: #ef4444; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== 预报部分样式 ===== */
.hourly-forecast, .daily-forecast, .weather-map {
    background: white;
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.hourly-forecast h3, .daily-forecast h3, .weather-map h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.5rem;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

.hourly-container {
    display: flex;
    overflow-x: auto;
    gap: 20px;
    padding: 10px 0;
}

.hour-item {
    flex: 0 0 auto;
    text-align: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 15px;
    min-width: 100px;
}

.hour-time {
    font-weight: 600;
    color: #667eea;
    margin-bottom: 10px;
}

.hour-temp {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2c3e50;
    margin: 10px 0;
}

.daily-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.day-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 15px;
    transition: all 0.3s;
}

.day-item:hover {
    background: #eef2ff;
    transform: translateX(5px);
}

.day-name {
    font-weight: 600;
    color: #2c3e50;
    width: 100px;
}

.day-temp {
    font-weight: 600;
    color: #667eea;
}

#map-container {
    height: 300px;
    border-radius: 15px;
    overflow: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.map-placeholder {
    text-align: center;
}

.map-placeholder i {
    font-size: 4rem;
    margin-bottom: 15px;
    opacity: 0.9;
}

.footer {
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    color: #666;
    border-top: 1px solid #eaeaea;
}

.footer p {
    margin: 5px 0;
}

@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    .current-weather {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .weather-details {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    .search-box {
        width: 100%;
    }
    .weather-details {
        grid-template-columns: repeat(2, 1fr);
    }
    .main-content {
        padding: 20px;
    }
    .temperature {
        font-size: 4rem;
    }
}

.hourly-container::-webkit-scrollbar {
    height: 8px;
}

.hourly-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.hourly-container::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 10px;
    }
