/* 基础样式 */
.weather-container {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    color: #333;
    line-height: 1.6;
}

.section-title {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: #2c3e50;
    padding-bottom: 0.5rem;
    position: relative;
}

.section-title:after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 3px;
    background: linear-gradient(90deg, #3498db, #2c3e50);
    border-radius: 3px;
}

/* 图标统一大小 */
.icon {
    width: 1em;
    height: 1em;
    vertical-align: middle;
    fill: currentColor;
    margin-right: 5px;
}

.daily-icon {
    width: 2em;
    height: 2em;
    margin-right: 8px;
}

/* 当前天气样式 */
.weather-current {
    background: linear-gradient(135deg, #3498db, #2c3e50);
    color: white;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.location-title {
    font-size: 2rem;
    margin: 0 0 5px 0;
}

.location-details {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    font-size: 0.9rem;
    opacity: 0.9;
}

.current-conditions {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
}

.temperature-section {
    flex: 1;
    min-width: 200px;
}

.current-temp {
    font-size: 4rem;
    font-weight: bold;
    line-height: 1;
}

.temp-range {
    margin: 10px 0;
    font-size: 1.2rem;
}

.high {
    margin-right: 15px;
}

.feels-like {
    font-size: 1rem;
}

.weather-icon-section {
    flex: 1;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.weather-icon {
    text-align: center;
    margin-bottom: 10px;
}

.condition-text {
    display: block;
    font-size: 1.5rem;
    margin-top: 5px;
}

.precipitation {
    font-size: 1rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.precipitation span {
    display: flex;
    align-items: center;
}

.additional-metrics {
    flex: 2;
    min-width: 300px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    align-content: center;
}

.metric-item {
    background-color: rgba(255, 255, 255, 0.1);
    padding: 12px;
    border-radius: 5px;
    display: flex;
    align-items: center;
}

.metric-label {
    margin: 0 8px;
    font-size: 0.9rem;
    opacity: 0.9;
}

.metric-value {
    font-size: 1.1rem;
    font-weight: bold;
    margin-left: auto;
}

/* 24小时预报图表样式 */
#hourly-chart {
    background-color: #fff;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 30px;
}

/* 14天预报网格样式 */
.forecast-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.forecast-card {
    background-color: #fff;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    min-height: 220px;
}

.forecast-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.card-header {
    margin-bottom: 10px;
    text-align: center;
}

.day {
    font-weight: bold;
    display: block;
    color: #2c3e50;
    font-size: 0.95rem;
}

.date {
    font-size: 0.9rem;
    color: white;
}

.weather-info {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 10px 0;
    flex-grow: 1;
}

.weather-desc {
    font-size: 0.85rem;
    color: #34495e;
    text-align: center;
}

.temp-info {
    display: flex;
    justify-content: space-around;
    margin: 10px 0;
    font-size: 1.2rem;
}

.high-temp {
    color: #e74c3c;
    font-weight: bold;
}

.low-temp {
    color: #3498db;
    font-weight: bold;
}

.sun-info {
    display: flex;
    justify-content: space-around;
    font-size: 0.9rem;
    margin: 8px 0;
    color: #7f8c8d;
}

.sun-info i {
    margin-right: 3px;
}

.uv-info {
    text-align: center;
    font-size: 0.9rem;
    color: #e67e22;
    margin-top: 8px;
}

/* 新增的生活建议板块样式 */
.life-advice {
    margin-top: 30px;
}

.advice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.advice-card {
    background-color: #fff;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
}

.advice-card:hover {
    transform: translateY(-5px);
}

.advice-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.advice-header .icon {
    width: 24px;
    height: 24px;
    margin-right: 10px;
}

.advice-header h3 {
    margin: 0;
    font-size: 1.2rem;
    color: #2c3e50;
}

.advice-content {
    color: #555;
    line-height: 1.6;
    font-size: 0.95rem;
}

/* 不同卡片的不同颜色主题 */
.clothing-card .advice-header {
    color: #e74c3c;
}

.uv-card .advice-header {
    color: #e67e22;
}

.carwash-card .advice-header {
    color: #3498db;
}

.sport-card .advice-header {
    color: #2ecc71;
}

.health-card .advice-header {
    color: #9b59b6;
}

.travel-card .advice-header {
    color: #1abc9c;
}

.air-conditioner-card .advice-header {
    color: #3498db;
}

.diet-card .advice-header {
    color: #e67e22;
}

/* 响应式设计 - 平板 */
@media (max-width: 1200px) {
    .forecast-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 900px) {
    .forecast-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .current-conditions {
        flex-direction: column;
    }
    
    .additional-metrics {
        grid-template-columns: 1fr;
        margin-top: 20px;
    }
    
    .weather-icon-section {
        margin: 20px 0;
    }
    
    .forecast-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .advice-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* 响应式设计 - 手机端 */
@media (max-width: 480px) {
    .weather-container {
        padding: 10px;
    }
    
    .location-title {
        font-size: 1.4rem;
        line-height: 1.3;
    }
    
    .location-details {
        flex-direction: column;
        gap: 5px;
    }
    
    .current-temp {
        font-size: 3.2rem;
    }
    
    .condition-text {
        font-size: 1.2rem;
    }
    
    .precipitation {
        font-size: 0.9rem;
    }
    
    .metric-item {
        padding: 8px;
    }
    
    .metric-label, .metric-value {
        font-size: 0.9rem;
    }
    
    /* 14天预报手机端优化 */
    .forecast-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .forecast-card {
        min-height: auto;
        padding: 12px;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
    }
    
    .card-header {
        flex: 0 0 100%;
        margin-bottom: 5px;
    }
    
    .weather-info {
        flex: 1;
        margin: 5px 0;
        justify-content: flex-start;
    }
    
    .temp-info {
        flex: 1;
        margin: 5px 0;
        justify-content: space-around;
    }
    
    .sun-info {
        flex: 0 0 100%;
        margin: 5px 0;
    }
    
    .uv-info {
        flex: 0 0 100%;
        text-align: left;
        margin-top: 5px;
    }
    
    /* 生活建议手机端优化 */
    .advice-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .advice-card {
        padding: 15px;
    }
    
    .advice-header h3 {
        font-size: 1.1rem;
    }
    
    .advice-content {
        font-size: 0.9rem;
    }
    
    /* 24小时预报图表手机端优化 */
    #hourly-chart {
        height: 250px;
        padding: 10px;
    }
}

/* 小屏幕手机优化 */
@media (max-width: 360px) {
    .location-title {
        font-size: 1.2rem;
    }
    
    .current-temp {
        font-size: 2.8rem;
    }
    
    .temp-range {
        font-size: 1rem;
    }
    
    .condition-text {
        font-size: 1rem;
    }
    
    .forecast-card {
        padding: 10px;
    }
    
    .weather-desc {
        font-size: 0.8rem;
    }
    
    .temp-info {
        font-size: 0.85rem;
    }
    
    .sun-info, .uv-info {
        font-size: 0.7rem;
    }
}