:root {
    --wx-low: #edf7ee;
    --wx-low-border: #86c98a;
    --wx-low-text: #1a5c28;
    --wx-mod: #fffbea;
    --wx-mod-border: #f0c040;
    --wx-mod-text: #6b4200;
    --wx-high: #fff4ec;
    --wx-high-border: #f0924a;
    --wx-high-text: #7a2800;
    --wx-extreme: #fff0f0;
    --wx-extreme-border: #e05050;
    --wx-extreme-text: #7a0000;
}

/* ===== HERO ===== */
.wx-hero {
    padding: 40px 28px 20px;
    background: var(--bg);
}
.wx-hero-inner {
    max-width: var(--max-w);
    margin: 0 auto;
}
.wx-hero h1 {
    font-family: var(--font-display);
    font-size: clamp(28px, 4vw, 42px);
    line-height: 1.1;
    letter-spacing: -0.4px;
    color: var(--text);
    margin-bottom: 8px;
}
.wx-hero h1 .accent {
    color: var(--accent);
}
.wx-source-chip {
    font-size: 12px;
    color: var(--text-3);
    margin-top: 10px;
}

/* ===== CURRENT CONDITIONS ===== */
.wx-current-section {
    padding: 20px 28px 8px;
}
.wx-current-inner {
    max-width: var(--max-w);
    margin: 0 auto;
}
.wx-current-card {
    background: linear-gradient(135deg, rgba(0, 113, 227, 0.07) 0%, rgba(255, 177, 27, 0.04) 45%, rgba(255, 255, 255, 0) 75%), var(--surface);
    border: 1.5px solid var(--border-soft);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    padding: 28px;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 28px;
    align-items: center;
}
.wx-current-primary {
    display: flex;
    align-items: center;
    gap: 18px;
}
.wx-current-icon {
    font-size: 46px;
    line-height: 1;
    width: 92px;
    height: 92px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(255, 177, 27, 0.20), rgba(0, 113, 227, 0.12));
}
.wx-current-temp {
    font-family: var(--font-display);
    font-size: clamp(56px, 8vw, 84px);
    line-height: 1;
    color: var(--text);
}
.wx-current-temp .unit {
    font-size: 0.4em;
    color: var(--text-3);
    vertical-align: super;
}
.wx-current-cond {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    margin-top: 4px;
}
.wx-current-card--raining {
    background: linear-gradient(135deg, rgba(240, 192, 64, 0.18) 0%, rgba(240, 192, 64, 0.06) 55%, rgba(255, 255, 255, 0) 80%), var(--surface);
    border-color: #f0c040;
}
.wx-current-cond--raining {
    color: #a66a00;
}
.wx-current-feels {
    font-size: 16px;
    color: var(--text-2);
    margin-top: 2px;
}
.wx-current-hilo {
    font-size: 14px;
    color: var(--text-3);
    margin-top: 6px;
}
.wx-current-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    border-left: 1px solid var(--border-soft);
    padding-left: 28px;
}
.wx-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.wx-stat-label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-3);
}
.wx-stat-value {
    font-size: 21px;
    font-weight: 700;
    color: var(--text);
}
.wx-stat-sub {
    font-size: 13px;
    color: var(--text-2);
}

/* ===== 5-DAY OUTLOOK ===== */
.wx-outlook-section {
    padding: 20px 28px 8px;
}
.wx-outlook-inner {
    max-width: var(--max-w);
    margin: 0 auto;
}
.wx-section-title {
    font-family: var(--font-display);
    font-size: clamp(20px, 2.4vw, 24px);
    color: var(--text);
    margin-bottom: 4px;
}
.wx-outlook-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}
.wx-outlook-card {
    background: var(--surface);
    border: 1.5px solid var(--border-soft);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 16px 12px;
    text-align: center;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.wx-outlook-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}
.wx-outlook-card--today {
    border-color: #8fd19e;
    background: linear-gradient(180deg, rgba(46, 160, 67, 0.08), rgba(46, 160, 67, 0) 65%), var(--surface);
}
.wx-outlook-day {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
}
.wx-outlook-icon {
    font-size: 28px;
    line-height: 1;
    margin-bottom: 6px;
}
.wx-outlook-cond {
    font-size: 12px;
    color: var(--text-2);
    min-height: 28px;
    line-height: 1.3;
    margin-bottom: 8px;
}
.wx-outlook-temps {
    display: flex;
    justify-content: center;
    gap: 8px;
    font-size: 16px;
}
.wx-outlook-hi {
    font-weight: 700;
    color: var(--text);
}
.wx-outlook-lo {
    color: var(--text-3);
}

/* ===== DETAIL SECTIONS (temperature, feels-like, humidity, rain, wind) ===== */
.wx-detail-section {
    padding: 20px 28px 8px;
    scroll-margin-top: 76px;
    border-radius: var(--radius-xl);
    transition: box-shadow 0.4s ease;
}
.wx-detail-section--highlight {
    box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.25) inset;
}
.wx-detail-inner {
    max-width: var(--max-w);
    margin: 0 auto;
}
.wx-chart-card {
    background: var(--surface);
    border: 1.5px solid var(--border-soft);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    padding: 20px 20px 12px;
    overflow-x: auto;
    min-height: 160px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.wx-chart-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.wx-chart-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 0;
}
.wx-chart-icon {
    font-size: 22px;
    line-height: 1;
}
.wx-chart-title {
    font-family: var(--font-display);
    font-size: clamp(19px, 2.4vw, 23px);
    color: var(--text);
}
.wx-chart-now {
    font-size: 15px;
    color: var(--text-2);
    margin-left: auto;
}
.wx-chart-now strong {
    color: var(--text);
    font-weight: 700;
}
.wx-chart-sub {
    font-size: 13px;
    color: var(--text-3);
    margin-bottom: 4px;
}
.wx-chart-svg {
    width: 100%;
    height: 150px;
    display: block;
    overflow: visible;
}
.wx-bar-tick {
    font-family: var(--font-ui);
    font-size: 11px;
    fill: var(--text-3);
}
.wx-bar-value {
    font-family: var(--font-ui);
    font-size: 13px;
    font-weight: 700;
}
.wx-bar-time {
    font-family: var(--font-ui);
    font-size: 13px;
    fill: var(--text);
    font-weight: 600;
}

/* ===== AIR QUALITY ===== */
.wx-aqi-section {
    padding: 20px 28px 8px;
    scroll-margin-top: 76px;
    border-radius: var(--radius-xl);
    transition: box-shadow 0.4s ease;
}
.wx-aqi-section--highlight {
    box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.25) inset;
}
.wx-aqi-inner {
    max-width: var(--max-w);
    margin: 0 auto;
}

/* ===== SUN & MOON TABLE ===== */
.wx-sun-section {
    padding: 20px 28px 8px;
}
.wx-sun-inner {
    max-width: var(--max-w);
    margin: 0 auto;
}
.wx-sunmoon-table-wrap {
    background: var(--surface);
    border: 1.5px solid var(--border-soft);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    overflow-x: auto;
}
.wx-sunmoon-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 620px;
}
.wx-sunmoon-table th {
    text-align: left;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-3);
    padding: 14px 16px;
    border-bottom: 1.5px solid var(--border-soft);
    white-space: nowrap;
}
.wx-sunmoon-table td {
    font-size: 15px;
    color: var(--text);
    padding: 16px;
    border-bottom: 1px solid var(--border-soft);
    white-space: nowrap;
    transition: filter 0.1s ease;
}
.wx-sunmoon-table tr:last-child td {
    border-bottom: none;
}
.wx-sunmoon-table tbody tr:hover td {
    filter: brightness(0.96);
}
.wx-sunmoon-day {
    font-weight: 700;
}
.wx-sunmoon-table th:nth-child(2),
.wx-sunmoon-table td:nth-child(2),
.wx-sunmoon-table th:nth-child(3),
.wx-sunmoon-table td:nth-child(3) {
    background-color: rgba(255, 177, 27, 0.07);
}
.wx-sunmoon-table th:nth-child(4),
.wx-sunmoon-table td:nth-child(4),
.wx-sunmoon-table th:nth-child(5),
.wx-sunmoon-table td:nth-child(5),
.wx-sunmoon-table th:nth-child(6),
.wx-sunmoon-table td:nth-child(6) {
    background-color: rgba(99, 102, 241, 0.06);
}
.wx-sunmoon-table th:nth-child(2),
.wx-sunmoon-table td:nth-child(2) {
    border-left: 1px solid var(--border-soft);
}
.wx-sunmoon-table th:nth-child(4),
.wx-sunmoon-table td:nth-child(4) {
    border-left: 1.5px solid var(--border-soft);
}
.wx-sunmoon-phase {
    display: flex;
    align-items: center;
    gap: 8px;
}
.wx-moon-icon {
    font-size: 18px;
}

/* ===== SEO SECTION ===== */
.wx-seo-section {
    padding: 20px 28px 40px;
}
.wx-seo-inner {
    max-width: var(--max-w);
    margin: 0 auto;
}
.wx-seo-inner h2 {
    font-family: var(--font-display);
    font-size: clamp(22px, 3vw, 28px);
    color: var(--text);
    margin-bottom: 14px;
}
.wx-seo-inner > p {
    font-size: 15px;
    color: var(--text-2);
    line-height: 1.7;
    margin-bottom: 24px;
    max-width: 900px;
}
.wx-seo-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}
.wx-seo-card {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    padding: 16px 18px;
}
.wx-seo-card h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
}
.wx-seo-card p {
    font-size: 14px;
    color: var(--text-2);
    line-height: 1.6;
}
.wx-seo-card a {
    color: var(--accent);
}

/* ===== LOADING STATE ===== */
.wx-loading .wx-current-temp,
.wx-loading .wx-current-cond,
.wx-loading .wx-stat-value {
    color: var(--text-3);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    .wx-current-card {
        grid-template-columns: 1fr;
    }
    .wx-current-stats {
        border-left: none;
        padding-left: 0;
        border-top: 1px solid var(--border-soft);
        padding-top: 16px;
        grid-template-columns: repeat(3, 1fr);
    }
    .wx-outlook-row {
        grid-template-columns: repeat(5, 1fr);
        gap: 8px;
    }
    .wx-seo-grid {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 640px) {
    .wx-hero {
        padding: 28px 18px 16px;
    }
    .wx-current-section,
    .wx-outlook-section,
    .wx-detail-section,
    .wx-aqi-section,
    .wx-sun-section,
    .wx-seo-section {
        padding-left: 18px;
        padding-right: 18px;
    }
    .wx-current-card {
        padding: 20px;
    }
    .wx-current-primary {
        gap: 12px;
    }
    .wx-current-icon {
        font-size: 34px;
        width: 68px;
        height: 68px;
    }
    .wx-outlook-row {
        grid-template-columns: repeat(5, 1fr);
        gap: 6px;
    }
    .wx-outlook-card {
        padding: 12px 6px;
    }
    .wx-outlook-cond {
        display: none;
    }
    .wx-outlook-icon {
        font-size: 24px;
        margin-bottom: 4px;
    }
    .wx-outlook-day {
        font-size: 12px;
    }
    .wx-outlook-temps {
        flex-direction: column;
        gap: 2px;
        font-size: 14px;
    }
}
@media (max-width: 480px) {
    .wx-current-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    .wx-bar-tick,
    .wx-bar-value,
    .wx-bar-time {
        font-size: 11px;
    }
}
@media (max-height: 500px) and (orientation: landscape) {
    .wx-detail-section,
    .wx-aqi-section {
        padding-top: 18px;
    }
    .wx-chart-card {
        padding: 14px 16px 8px;
        min-height: 0;
    }
}
@media (prefers-reduced-motion: reduce) {
    .wx-detail-section,
    .wx-aqi-section {
        transition: none;
    }
    .wx-outlook-card,
    .wx-chart-card {
        transition: none;
    }
    .wx-outlook-card:hover,
    .wx-chart-card:hover {
        transform: none;
    }
}
