/* ===== 天气应用 — iOS 风格 ===== */

/* ── 场景容器 ── */
#scene-weather {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 40%, #0f3460 70%, #1a1a2e 100%);
    overflow: hidden;
    z-index: 100;
    color: rgba(255, 255, 255, 0.92);
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'PingFang SC', 'Hiragino Sans GB', sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* ── 导航栏 ── */
.weather-nav {
    display: flex;
    align-items: center;
    padding: calc(14px + var(--safe-top)) 8px 6px;
    z-index: 10;
    flex-shrink: 0;
}

.weather-nav-back {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 50%;
    transition: background 0.2s;
}

.weather-nav-back:active {
    background: rgba(255, 255, 255, 0.1);
}

.weather-nav-back svg {
    width: 20px;
    height: 20px;
    stroke: rgba(255, 255, 255, 0.85);
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.weather-nav-title {
    font-size: 17px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    margin-left: 4px;
    letter-spacing: 0.3px;
}

/* ── 可滚动内容区 ── */
.weather-scroll {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 0 16px calc(20px + var(--safe-bottom));
    scroll-behavior: smooth;
}

.weather-scroll::-webkit-scrollbar {
    display: none;
}

/* ── 主天气卡片 ── */
.weather-main-card {
    position: relative;
    width: 100%;
    border-radius: 20px;
    padding: 28px 20px 24px;
    margin-bottom: 12px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.04);
    border: 0.5px solid rgba(255, 255, 255, 0.08);
}

.weather-main-city {
    font-size: 22px;
    font-weight: 400;
    text-align: center;
    letter-spacing: 2px;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 2px;
}

.weather-main-temp {
    font-size: 72px;
    font-weight: 200;
    text-align: center;
    line-height: 1.1;
    letter-spacing: -3px;
    color: rgba(255, 255, 255, 0.98);
    margin: 4px 0;
}

.weather-main-condition {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 16px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
    margin: 4px 0;
}

.weather-main-condition-icon {
    font-size: 28px;
}

.weather-main-highlow {
    text-align: center;
    font-size: 15px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 6px;
    letter-spacing: 0.5px;
}

.weather-main-highlow .high {
    color: rgba(255, 255, 255, 0.92);
}

.weather-main-highlow .low {
    color: rgba(255, 255, 255, 0.55);
}

.weather-main-highlow .sep {
    margin: 0 8px;
    opacity: 0.3;
}

/* ── 逐小时预报 ── */
.weather-hourly-section {
    position: relative;
    width: 100%;
    border-radius: 20px;
    padding: 16px 0;
    margin-bottom: 12px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.04);
    border: 0.5px solid rgba(255, 255, 255, 0.08);
}

.weather-hourly-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 16px 12px;
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.weather-hourly-header svg {
    width: 14px;
    height: 14px;
    opacity: 0.5;
}

.weather-hourly-track {
    display: flex;
    gap: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0 8px;
    scrollbar-width: none;
}

.weather-hourly-track::-webkit-scrollbar {
    display: none;
}

.weather-hourly-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 60px;
    padding: 4px 8px;
    flex-shrink: 0;
    border-radius: 12px;
    transition: background 0.2s;
}

.weather-hourly-item:active {
    background: rgba(255, 255, 255, 0.06);
}

.weather-hourly-time {
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.6);
}

.weather-hourly-item.now .weather-hourly-time {
    font-weight: 700;
    color: rgba(255, 255, 255, 0.95);
}

.weather-hourly-icon {
    font-size: 22px;
    line-height: 1;
}

.weather-hourly-temp {
    font-size: 16px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
}

.weather-hourly-item.now .weather-hourly-temp {
    color: rgba(255, 255, 255, 0.98);
}

/* ── 10天预报 ── */
.weather-daily-section {
    position: relative;
    width: 100%;
    border-radius: 20px;
    padding: 8px 0;
    margin-bottom: 12px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.04);
    border: 0.5px solid rgba(255, 255, 255, 0.08);
}

.weather-daily-row {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    border-bottom: 0.5px solid rgba(255, 255, 255, 0.06);
    position: relative;
}

.weather-daily-row:last-child {
    border-bottom: none;
}

.weather-daily-day {
    width: 44px;
    font-size: 15px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.85);
    flex-shrink: 0;
}

.weather-daily-day.today {
    font-weight: 700;
}

.weather-daily-icon {
    width: 30px;
    font-size: 18px;
    text-align: center;
    flex-shrink: 0;
}

.weather-daily-bar-wrap {
    flex: 1;
    margin: 0 12px;
    height: 4px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    overflow: hidden;
    position: relative;
}

.weather-daily-bar {
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.35));
    position: absolute;
    top: 0;
    transition: width 0.3s ease;
}

.weather-daily-temps {
    display: flex;
    gap: 6px;
    font-size: 14px;
    font-weight: 500;
    flex-shrink: 0;
    min-width: 60px;
    justify-content: flex-end;
}

.weather-daily-high {
    color: rgba(255, 255, 255, 0.92);
}

.weather-daily-low {
    color: rgba(255, 255, 255, 0.45);
}

/* ── 底部详情网格 ── */
.weather-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 12px;
}

.weather-detail-card {
    position: relative;
    border-radius: 20px;
    padding: 18px 16px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.04);
    border: 0.5px solid rgba(255, 255, 255, 0.08);
    min-height: 100px;
}

.weather-detail-label {
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.45);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.weather-detail-value {
    font-size: 28px;
    font-weight: 200;
    color: rgba(255, 255, 255, 0.95);
    line-height: 1.1;
    margin-bottom: 2px;
}

.weather-detail-sub {
    font-size: 13px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.5);
}

/* 日出日落专用 */
.weather-sunrise-set {
    grid-column: 1 / -1;
}

.weather-sunrise-set-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 0;
}

.weather-sun-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.weather-sun-item .sun-icon {
    font-size: 22px;
    margin-bottom: 2px;
}

.weather-sun-item .sun-label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
    font-weight: 500;
}

.weather-sun-item .sun-time {
    font-size: 16px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
}

/* ── UV 指示条 ── */
.weather-uv-bar-wrap {
    margin-top: 8px;
    height: 4px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

.weather-uv-bar {
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, #34C759, #FFD60A, #FF9500, #FF3B30);
    transition: width 0.4s ease;
}

/* ── 响应式 ── */
@media (min-width: 500px) {
    #scene-weather {
        position: absolute;
    }
}

@media (max-width: 360px) {
    .weather-main-temp {
        font-size: 56px;
    }
    .weather-main-city {
        font-size: 18px;
    }
    .weather-hourly-item {
        min-width: 50px;
        padding: 4px 6px;
    }
    .weather-detail-value {
        font-size: 22px;
    }
    .weather-daily-row {
        padding: 8px 12px;
    }
}
