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

/* 天气主题配色方案 */
:root {
    /* 晴朗/白天 - 默认主题 */
    --bg-gradient-start: #87CEEB;
    --bg-gradient-end: #E0F7FF;
    --accent-color: #FFB74D;
    --text-primary: #1565C0;
    --text-secondary: #37474F;
    --card-bg: rgba(255, 255, 255, 0.25);
    --card-border: rgba(255, 255, 255, 0.4);
    --card-shadow: rgba(0, 0, 0, 0.1);
    --glass-blur: 20px;
}

/* 多云/阴天主题 */
[data-weather="cloudy"] {
    --bg-gradient-start: #B0BEC5;
    --bg-gradient-end: #E3F2FD;
    --accent-color: #78909C;
    --text-primary: #37474F;
    --text-secondary: #546E7A;
    --card-bg: rgba(255, 255, 255, 0.3);
    --card-border: rgba(255, 255, 255, 0.5);
}

/* 雨天主题 */
[data-weather="rain"] {
    --bg-gradient-start: #546E7A;
    --bg-gradient-end: #90A4AE;
    --accent-color: #4FC3F7;
    --text-primary: #FFFFFF;
    --text-secondary: #E0E0E0;
    --card-bg: rgba(255, 255, 255, 0.15);
    --card-border: rgba(255, 255, 255, 0.3);
}

/* 雪天/寒冷主题 */
[data-weather="snow"] {
    --bg-gradient-start: #E3F2FD;
    --bg-gradient-end: #BBDEFB;
    --accent-color: #81D4FA;
    --text-primary: #0277BD;
    --text-secondary: #01579B;
    --card-bg: rgba(255, 255, 255, 0.4);
    --card-border: rgba(255, 255, 255, 0.6);
}

/* 夜晚主题 */
[data-weather="night"] {
    --bg-gradient-start: #0D1B2A;
    --bg-gradient-end: #1B263B;
    --accent-color: #FF9800;
    --text-primary: #E0E0E0;
    --text-secondary: #B0BEC5;
    --card-bg: rgba(255, 255, 255, 0.08);
    --card-border: rgba(255, 255, 255, 0.15);
}

/* 雾/霾主题 */
[data-weather="fog"] {
    --bg-gradient-start: #757575;
    --bg-gradient-end: #9E9E9E;
    --accent-color: #607D8B;
    --text-primary: #FFFFFF;
    --text-secondary: #E0E0E0;
    --card-bg: rgba(255, 255, 255, 0.12);
    --card-border: rgba(255, 255, 255, 0.25);
}

/* 高温/炎热主题 */
[data-weather="hot"] {
    --bg-gradient-start: #FF9800;
    --bg-gradient-end: #FFCC80;
    --accent-color: #D84315;
    --text-primary: #BF360C;
    --text-secondary: #E65100;
    --card-bg: rgba(255, 255, 255, 0.3);
    --card-border: rgba(255, 255, 255, 0.5);
}

/* 基础样式 */
body {
    font-family: 'Microsoft YaHei', 'PingFang SC', -apple-system, BlinkMacSystemFont, sans-serif;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    background-attachment: fixed;
    color: var(--text-primary);
    transition: all 0.5s ease;
    padding: 20px;
}

/* 主容器 */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

/* 头部样式 */
.header {
    text-align: center;
    margin-bottom: 30px;
    position: relative;
}

.title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.subtitle {
    font-size: 1rem;
    opacity: 0.8;
    color: var(--text-secondary);
}

/* 城市选择器按钮 */
.header-actions {
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    gap: 10px;
}

.notification-btn {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: var(--card-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--card-border);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px var(--card-shadow);
}

.notification-btn:hover {
    background: var(--card-bg);
    transform: scale(1.05);
}

.notification-btn.active {
    background: linear-gradient(135deg, #4CAF50, #8BC34A);
    color: #FFFFFF;
}

.city-selector-btn {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: var(--card-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--card-border);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px var(--card-shadow);
}

.city-selector-btn:hover {
    background: var(--card-bg);
    transform: scale(1.05);
}

.city-selector-btn span {
    display: block;
    width: 24px;
    height: 3px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* 城市选择侧边栏 */
.city-sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: -5px 0 30px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
    color: #37474F;
}

.city-sidebar.active {
    right: 0;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.sidebar-header h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: #37474F;
    margin: 0;
}

.close-sidebar-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: none;
    background: rgba(0, 0, 0, 0.05);
    color: #37474F;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.close-sidebar-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    transform: rotate(90deg);
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
    color: #37474F;
}

/* 搜索区域 */
.search-section {
    margin-bottom: 30px;
}

.search-box {
    display: flex;
    gap: 12px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.city-input {
    flex: 1;
    min-width: 200px;
    padding: 15px 20px;
    border: none;
    border-radius: 16px;
    background: rgba(0, 0, 0, 0.05);
    color: #37474F;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.city-input::placeholder {
    color: #9E9E9E;
    opacity: 0.8;
}

.city-input:focus {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    background: rgba(0, 0, 0, 0.08);
}

.search-btn {
    padding: 15px 30px;
    border: none;
    border-radius: 16px;
    background: #1565C0;
    color: #FFFFFF;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(21, 101, 192, 0.3);
}

.search-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(21, 101, 192, 0.4);
    background: #0D47A1;
}

.search-btn:active {
    transform: translateY(0);
}

/* 快捷城市按钮 */
.saved-cities {
    margin-bottom: 20px;
}

.saved-cities-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 300px;
    overflow-y: auto;
}

.saved-city-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.saved-city-item:hover {
    background: rgba(21, 101, 192, 0.1);
    transform: translateX(5px);
}

.saved-city-name {
    font-size: 0.95rem;
    color: #37474F;
    font-weight: 500;
}

.saved-city-actions {
    display: flex;
    gap: 8px;
}

.saved-city-delete {
    padding: 4px 8px;
    border: none;
    border-radius: 6px;
    background: rgba(244, 67, 54, 0.1);
    color: #F44336;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.saved-city-delete:hover {
    background: rgba(244, 67, 54, 0.2);
}

.add-city-btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #4CAF50, #8BC34A);
    color: #FFFFFF;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.add-city-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(76, 175, 80, 0.4);
}

.quick-cities {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.quick-city-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 20px;
    background: rgba(0, 0, 0, 0.05);
    color: #37474F;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.quick-city-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    background: rgba(21, 101, 192, 0.1);
    color: #1565C0;
}

/* 加载状态 */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-primary);
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--card-border);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 错误信息 */
.error-msg {
    text-align: center;
    padding: 40px;
    background: var(--card-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--card-border);
    border-radius: 20px;
    box-shadow: 0 8px 32px var(--card-shadow);
    color: var(--text-primary);
}

.error-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.error-text {
    font-size: 1.1rem;
    margin-bottom: 20px;
    color: var(--text-secondary);
}

.retry-btn {
    padding: 12px 30px;
    border: none;
    border-radius: 12px;
    background: var(--accent-color);
    color: white;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.retry-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
}

/* 侧边栏遮罩层 */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* 天气卡片 - 毛玻璃效果 */
.weather-card {
    background: var(--card-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 30px;
    margin-bottom: 25px;
    box-shadow: 0 8px 32px var(--card-shadow);
    transition: all 0.3s ease;
}

.weather-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px var(--card-shadow);
}

/* 卡片头部 */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--card-border);
}

.city-name {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
}

.header-time {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.update-time {
    font-size: 0.9rem;
    color: var(--text-secondary);
    opacity: 0.8;
}

.lunar-date {
    font-size: 0.85rem;
    color: var(--text-secondary);
    opacity: 0.7;
}

.lunar-festival {
    display: block;
    font-size: 1.1rem;
    font-weight: 700;
    color: #FF6B6B;
    background: linear-gradient(135deg, #FFE5E5, #FFB8B8);
    padding: 8px 16px;
    border-radius: 20px;
    margin-top: 8px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
    animation: festivalPulse 2s ease-in-out infinite;
}

.lunar-festival.hidden {
    display: none;
}

@keyframes festivalPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 6px 16px rgba(255, 107, 107, 0.5);
    }
}

.share-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 20px;
    background: rgba(0, 0, 0, 0.05);
    color: #37474F;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    background: rgba(21, 101, 192, 0.1);
    color: #1565C0;
}

/* 天气主要信息 */
.weather-main {
    text-align: center;
    margin-bottom: 30px;
}

.weather-icon-container {
    margin-bottom: 15px;
}

.weather-icon {
    font-size: 6rem;
    display: inline-block;
    animation: float 3s ease-in-out infinite;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
}

.weather-icon i {
    font-family: "qweather-icons" !important;
    font-size: 6rem;
    display: inline-block;
    animation: float 3s ease-in-out infinite;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.temperature-container {
    margin-bottom: 10px;
}

.temperature {
    font-size: 4rem;
    font-weight: 300;
    color: var(--text-primary);
}

.temperature-unit {
    font-size: 2rem;
    color: var(--text-secondary);
}

.weather-desc {
    font-size: 1.3rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* 天气详情 */
.weather-details {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    border: 1px solid var(--card-border);
    transition: all 0.3s ease;
}

.detail-item:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.detail-icon {
    font-size: 1.5rem;
}

.detail-info {
    display: flex;
    flex-direction: column;
}

.detail-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    opacity: 0.8;
}

.detail-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* 报告时间 */
.report-time {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-secondary);
    opacity: 0.7;
    padding-top: 15px;
    border-top: 1px solid var(--card-border);
}

/* 预报容器 */
.forecast-container {
    margin-top: 30px;
}

.forecast-title {
    font-size: 1.3rem;
    color: var(--text-primary);
    margin-bottom: 20px;
    text-align: center;
}

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

.forecast-item {
    background: var(--card-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px var(--card-shadow);
}

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

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

.forecast-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.forecast-weather {
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 8px;
    font-weight: 500;
}

.forecast-temp {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.forecast-wind {
    font-size: 0.8rem;
    color: var(--text-secondary);
    opacity: 0.8;
    margin-top: 8px;
}

/* 页脚 */
.footer {
    text-align: center;
    padding: 30px;
    color: var(--text-secondary);
    opacity: 0.7;
    font-size: 0.85rem;
}

/* 天气预警容器 */
.warning-container {
    margin-bottom: 25px;
}

.warning-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.warning-item {
    padding: 20px;
    background: rgba(255, 87, 51, 0.1);
    border-left: 4px solid #FF5722;
    border-radius: 12px;
    transition: all 0.3s ease;
    animation: slideIn 0.5s ease-out;
}

.warning-item:hover {
    background: rgba(255, 87, 51, 0.2);
    transform: translateX(5px);
}

.warning-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 87, 51, 0.3);
}

.warning-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.warning-level {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    color: white;
}

.warning-level.red {
    background: #FF5722;
}

.warning-level.orange {
    background: #FF9800;
}

.warning-level.yellow {
    background: #FFC107;
}

.warning-level.blue {
    background: #2196F3;
}

.warning-type {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.warning-time {
    font-size: 0.85rem;
    color: var(--text-secondary);
    opacity: 0.8;
}

.warning-text {
    font-size: 0.95rem;
    color: var(--text-primary);
    line-height: 1.6;
    margin-top: 10px;
}

.warning-empty {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* 温度趋势图容器 */
.temp-chart-container {
    margin-top: 20px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
}

.temp-chart {
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    height: 200px;
    padding: 20px 0;
    gap: 10px;
}

.temp-bar {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    max-width: 60px;
}

.temp-bar-max {
    width: 30px;
    background: linear-gradient(to top, #FF6B6B, #FF8E8E);
    border-radius: 4px 4px 0 0;
    transition: height 0.5s ease;
}

.temp-bar-min {
    width: 30px;
    background: linear-gradient(to bottom, #4FC3F7, #81D4FA);
    border-radius: 0 0 4px 4px;
    transition: height 0.5s ease;
}

.temp-bar-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 8px;
    text-align: center;
}

.temp-bar-value {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

/* 湿度和风力可视化 */
.weather-metrics {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-top: 20px;
}

.metric-card {
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    text-align: center;
}

.metric-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 10px 0;
}

.metric-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.metric-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    margin-top: 10px;
    overflow: hidden;
}

.metric-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.metric-bar-fill.humidity {
    background: linear-gradient(90deg, #4FC3F7, #81D4FA);
}

.metric-bar-fill.wind {
    background: linear-gradient(90deg, #FFB74D, #FF9800);
}

/* 卡片标题 */
.card-title {
    font-size: 1.3rem;
    color: var(--text-primary);
    margin-bottom: 20px;
    text-align: center;
}

/* 24小时天气 */
.hourly-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 10px;
}

.hourly-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    transition: all 0.3s ease;
    min-width: 80px;
}

.hourly-item:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.hourly-time {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.hourly-icon {
    font-size: 1.8rem;
    margin-bottom: 8px;
}

.hourly-temp {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* 日出日落 */
.sun-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.sun-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    transition: all 0.3s ease;
}

.sun-item:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.sun-icon {
    font-size: 2.5rem;
}

.sun-info {
    display: flex;
    flex-direction: column;
}

.sun-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.sun-time {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* 生活指数 */
.life-index-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.life-index-item {
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.life-index-item:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.life-index-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.life-index-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.life-index-level {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.life-index-advice {
    font-size: 0.85rem;
    color: var(--text-secondary);
    opacity: 0.8;
}

/* 隐藏元素 */
.hidden {
    display: none !important;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .aqi-details {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .aqi-value {
        font-size: 3rem;
    }
    
    .aqi-level {
        font-size: 1.1rem;
    }
}

.title {
    font-size: 1.8rem;
}
@media (max-width: 480px) {
    

.title {
    font-size: 1.8rem;
}

.search-box {
    flex-direction: column;
}

.city-input,
.search-btn {
    width: 100%;
}

.weather-card {
    padding: 20px;
}

.temperature {
    font-size: 3rem;
}

.weather-icon {
    font-size: 4rem;
}

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

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

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

.hourly-list {
    grid-template-columns: repeat(4, 1fr);
}

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

.header-actions {
    gap: 5px;
}

.notification-btn,
.city-selector-btn {
    width: 45px;
    height: 45px;
}
}
@media (max-width: 480px) {
    .forecast-list {
        grid-template-columns: 1fr;
    }

    .quick-cities {
        gap: 8px;
    }

    .quick-city-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }

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

    .hourly-list {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* 动画效果 */
.fade-in {
    animation: fadeIn 0.5s ease-out;
}

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

.slide-in {
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 城市选择器 - 三级下拉框样式 */
.city-selector {
    margin-bottom: 20px;
}

.selector-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.selector-label {
    font-size: 1rem;
    font-weight: 600;
    color: #37474F !important;
    margin-bottom: 8px;
    text-align: center;
}

.selector-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.city-select {
    flex: 1;
    min-width: 150px;
    padding: 12px 16px;
    border: none;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.05);
    color: #37474F !important;
    font-size: 0.95rem;
    outline: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2337474F' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 18px;
    padding-right: 40px;
}

.city-select:hover {
    background: rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.city-select:focus {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    background: rgba(0, 0, 0, 0.08);
}

.city-select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    background: rgba(0, 0, 0, 0.03);
}

/* 下拉选项样式 - 浏览器限制较多，需要针对性处理 */
.city-select option {
    background: #ffffff;
    color: #333;
    padding: 12px 16px;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* 针对Webkit浏览器的下拉框样式 */
.city-select::-webkit-listbox {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(0, 0, 0, 0.1);
    padding: 8px 0;
}

/* Firefox 下拉框样式 */
.city-select:-moz-focusring {
    color: transparent;
    text-shadow: 0 0 0 #333;
}

/* IE/Edge 下拉框样式 */
.city-select::-ms-expand {
    display: none;
}

/* 自定义下拉框容器（使用JS增强） */
.custom-select-wrapper {
    position: relative;
    flex: 1;
    min-width: 150px;
}

.custom-select-trigger {
    width: 100%;
    padding: 12px 40px 12px 16px;
    border: none;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.05);
    color: #37474F !important;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    text-align: left;
    position: relative;
}

.custom-select-trigger::after {
    content: '';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2337474F' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-size: contain;
    transition: transform 0.3s ease;
}

.custom-select-trigger.active::after {
    transform: translateY(-50%) rotate(180deg);
}

.custom-select-trigger:hover {
    background: rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.custom-select-trigger.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: rgba(0, 0, 0, 0.03);
}

.custom-select-trigger.disabled:hover {
    transform: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.custom-select-options {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.custom-select-options.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.custom-option {
    padding: 12px 16px;
    color: #37474F !important;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.custom-option:last-child {
    border-bottom: none;
}

.custom-option:hover {
    background: rgba(21, 101, 192, 0.1);
    color: #1565C0 !important;
}

.custom-option.selected {
    background: rgba(21, 101, 192, 0.15);
    color: #1565C0;
    font-weight: 600;
}

/* 滚动条样式 */
.custom-select-options::-webkit-scrollbar {
    width: 6px;
}

.custom-select-options::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 3px;
}

.custom-select-options::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.custom-select-options::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* 搜索按钮容器 */
.selector-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 15px;
}

.selector-search-btn {
    padding: 12px 30px;
    border: none;
    border-radius: 12px;
    background: #1565C0;
    color: #FFFFFF !important;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(21, 101, 192, 0.3);
}

.selector-search-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(21, 101, 192, 0.4);
    background: #0D47A1;
}

.selector-search-btn:active {
    transform: translateY(0);
}

.selector-search-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* 或分隔线 */
.selector-divider {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 20px 0;
    color: #37474F !important;
    font-size: 0.9rem;
}

.selector-divider::before,
.selector-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(0, 0, 0, 0.1);
}

/* 响应式下拉框 */
@media (max-width: 768px) {
    .selector-row {
        flex-direction: column;
    }

    .city-select {
        width: 100%;
        min-width: auto;
    }

    .selector-actions {
        flex-direction: column;
    }

    .selector-search-btn {
        width: 100%;
    }
}
