/* ==================== 天气查询 ==================== */

/* --- Hero 区域 --- */
.weather-hero {
    position: relative;
    min-height: 65vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
    padding: calc(var(--navbar-height) + var(--space-lg)) var(--space-sm) var(--space-lg);
    background: var(--bg-dark);
}

.weather-hero-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.weather-gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.15;
    animation: weatherOrbFloat 10s ease-in-out infinite;
}

.weather-gradient-orb.orb-1 {
    width: 450px;
    height: 450px;
    background: #F5A623;
    top: -120px;
    right: -80px;
    animation-delay: 0s;
}

.weather-gradient-orb.orb-2 {
    width: 350px;
    height: 350px;
    background: var(--primary);
    bottom: -100px;
    left: -100px;
    animation-delay: -4s;
}

.weather-gradient-orb.orb-3 {
    width: 200px;
    height: 200px;
    background: #2EA043;
    top: 40%;
    left: 60%;
    animation-delay: -7s;
    opacity: 0.1;
}

@keyframes weatherOrbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(40px, -20px) scale(1.08); }
    50% { transform: translate(-20px, -40px) scale(0.95); }
    75% { transform: translate(-30px, 20px) scale(1.03); }
}

.weather-hero-content {
    position: relative;
    z-index: 1;
    max-width: 600px;
}

.weather-hero-title {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: clamp(2.2rem, 5vw, 3.5rem);
    font-weight: 700;
    margin-bottom: var(--space-sm);
}

.weather-hero-title .title-line {
    color: var(--text-primary);
    opacity: 0.9;
}

.weather-hero-title .title-accent {
    background: linear-gradient(135deg, #F5A623, #FF6B35);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.weather-hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-xs);
}

.weather-hero-desc {
    font-size: 0.95rem;
    color: var(--text-secondary);
    opacity: 0.8;
    max-width: 450px;
    margin: 0 auto var(--space-md);
    line-height: 1.7;
}

/* --- 搜索框 --- */
.weather-search {
    display: flex;
    align-items: center;
    gap: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    padding: 6px 6px 6px 20px;
    max-width: 480px;
    margin: 0 auto;
    box-shadow: var(--shadow-md);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.weather-search:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 142, 247, 0.15), var(--shadow-md);
}

.weather-search svg {
    width: 20px;
    height: 20px;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.weather-search input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 1rem;
    padding: 10px 12px;
    font-family: 'Inter', 'Noto Sans SC', sans-serif;
    min-width: 0;
}

.weather-search input::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

.weather-search-btn {
    border-radius: var(--radius-full) !important;
    padding: 10px 24px !important;
    flex-shrink: 0;
}

/* --- 主界面 --- */
.weather-main {
    padding: var(--space-lg) 0 var(--space-xl);
    min-height: 50vh;
}

/* --- 加载/错误/初始状态 --- */
.weather-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-xl) 0;
    color: var(--text-secondary);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.weather-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-xl) 0;
    color: #F85149;
    text-align: center;
}

.weather-error svg {
    width: 48px;
    height: 48px;
    opacity: 0.8;
}

.weather-error p {
    font-size: 1rem;
}

/* --- 热门城市 --- */
.weather-initial-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-sm);
}

.popular-city-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-sm) var(--space-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.popular-city-card:hover {
    border-color: var(--primary);
    background: var(--bg-card-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.popular-city-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1rem;
}

.popular-city-country {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* --- 天气位置 --- */
.weather-location {
    text-align: left;
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--border);
}

.weather-location .city-name {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.weather-location .location-icon {
    width: 20px;
    height: 20px;
    color: #F85149;
    flex-shrink: 0;
}

.weather-location .update-time {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* --- 当前天气 --- */
.current-weather {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    margin-bottom: var(--space-md);
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.current-weather-main {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-shrink: 0;
}

.weather-icon-large {
    font-size: 3.5rem;
    line-height: 1;
}

.current-temp {
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    font-family: 'Inter', sans-serif;
}

.current-temp .unit {
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--text-secondary);
    vertical-align: super;
}

.current-weather-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.current-desc {
    font-size: 1.1rem;
    color: var(--text-primary);
    font-weight: 500;
}

.current-feels-like {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.current-hi-lo {
    display: flex;
    gap: var(--space-sm);
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.current-hi-lo .high {
    color: #F85149;
}

.current-hi-lo .low {
    color: var(--primary);
}

/* --- 逐小时预报 --- */
.hourly-list {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: var(--space-xs) 0;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

.hourly-list::-webkit-scrollbar {
    height: 6px;
}

.hourly-list::-webkit-scrollbar-track {
    background: var(--bg-dark);
    border-radius: 3px;
}

.hourly-list::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.hourly-item {
    flex-shrink: 0;
    scroll-snap-align: start;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    text-align: center;
    min-width: 90px;
    transition: all var(--transition-fast);
}

.hourly-item:hover {
    border-color: var(--primary);
    background: var(--bg-card-hover);
}

.hourly-time {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
    font-family: 'Inter', monospace;
}

.hourly-icon {
    font-size: 1.8rem;
    margin-bottom: 4px;
}

.hourly-temp {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
}

/* --- 7天预报 --- */
.daily-item {
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px 20px;
    margin-bottom: 8px;
    transition: all var(--transition-fast);
}

.daily-item:hover {
    border-color: var(--primary);
    background: var(--bg-card-hover);
}

.daily-day {
    width: 80px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.daily-date {
    width: 80px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.daily-icon {
    width: 50px;
    text-align: center;
    font-size: 1.6rem;
}

.daily-desc {
    flex: 1;
    font-size: 0.9rem;
    color: var(--text-secondary);
    padding: 0 10px;
}

.daily-temp-range {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 200px;
    flex-shrink: 0;
}

.daily-temp-low {
    color: var(--primary);
    font-weight: 500;
    font-size: 0.9rem;
    font-family: 'Inter', sans-serif;
}

.daily-temp-bar {
    flex: 1;
    height: 4px;
    background: var(--bg-dark);
    border-radius: 2px;
    position: relative;
    overflow: hidden;
}

.daily-temp-bar-fill {
    position: absolute;
    top: 0;
    height: 100%;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--primary), #F5A623, #F85149);
}

.daily-temp-high {
    color: #F85149;
    font-weight: 500;
    font-size: 0.9rem;
    font-family: 'Inter', sans-serif;
}

/* --- 天气详情 --- */
.details-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-sm);
}

.detail-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-sm) var(--space-md);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.detail-label svg {
    width: 16px;
    height: 16px;
    opacity: 0.7;
}

.detail-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
}

.detail-unit {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 400;
}

/* --- 区块标题 --- */
.weather-section-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
    margin-top: var(--space-md);
}

.weather-section-title:first-child {
    margin-top: 0;
}

/* --- 响应式 --- */
@media (max-width: 768px) {
    .weather-hero {
        min-height: 45vh;
    }

    .weather-hero-title {
        font-size: 1.8rem;
    }

    .weather-search {
        margin: 0 16px;
        padding: 4px 4px 4px 14px;
    }

    .weather-search input {
        font-size: 0.9rem;
        padding: 10px 8px;
    }

    .weather-search-btn {
        padding: 10px 18px !important;
        font-size: 0.9rem;
    }

    .weather-initial-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .current-weather {
        flex-direction: column;
        text-align: center;
        align-items: center;
    }

    .current-weather-info {
        align-items: center;
    }

    .current-hi-lo {
        justify-content: center;
    }

    .daily-temp-range {
        width: 120px;
    }

    .daily-day {
        width: 60px;
        font-size: 0.85rem;
    }

    .daily-date {
        width: 60px;
        font-size: 0.75rem;
    }

    .details-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .weather-hero {
        min-height: 40vh;
    }

    .weather-initial-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .popular-city-card {
        padding: 12px;
    }

    .current-temp {
        font-size: 2.8rem;
    }

    .weather-icon-large {
        font-size: 2.8rem;
    }

    .daily-item {
        flex-wrap: wrap;
        padding: 12px;
    }

    .daily-desc {
        flex: 0 0 100%;
        padding: 4px 0 0;
    }

    .daily-temp-range {
        width: 100%;
        justify-content: space-between;
    }

    .details-grid {
        grid-template-columns: 1fr 1fr;
    }

    .detail-card {
        padding: 10px 12px;
    }

    .weather-search {
        flex-wrap: nowrap;
        padding: 3px 3px 3px 12px;
    }

    .weather-search input {
        font-size: 0.85rem;
    }

    .weather-search-btn {
        padding: 8px 14px !important;
        font-size: 0.85rem;
    }
}
