:root {
    --md-sys-color-background: #7ebaf0;
    --md-sys-color-on-background: #002952;
    --md-sys-color-surface: rgba(255,255,255,0.2);
    --md-sys-color-surface-container: rgba(255,255,255,0.2);
    --md-sys-color-surface-variant: rgba(255,255,255,0.2);
    --md-sys-color-on-surface-variant: #44474f;
    --md-sys-color-primary: #00539c;
    --md-sys-color-on-primary: #7ebaf0;
    --md-sys-color-primary-container: #d1e4ff;
    --md-sys-color-on-primary-container: #001d36;

    --weather-sun: #ffb300;
    --weather-moon: #5c6065;
    --weather-star: rgba(0, 0, 0, 0.18);
    --weather-lightning: #ffb300;
    --weather-dust-stream: #e5c483;
    --weather-dust-particle: #d4b26f;

    --md-sys-curve-emphasized: cubic-bezier(0.1, 0.9, 0.2, 1);
    --md-sys-curve-fluid: cubic-bezier(0.4, 0, 0.2, 1);
    --curve-spring: cubic-bezier(0.34, 1.2, 0.64, 1);
    --curve-smooth: cubic-bezier(0.16, 1, 0.3, 1);
}

@media (prefers-color-scheme: dark) {
    :root {
        --weather-moon: #ffffff;
        --weather-star: rgba(255, 255, 255, 0.85);
        --weather-lightning: #fff59d;
        --weather-dust-stream: #a88a52;
        --weather-dust-particle: #bfa065;
    }
}

html, body {
    width: 100%; height: 100%; overflow: hidden; margin: 0; padding: 0;
    background-color: var(--md-sys-color-background);
    color: var(--md-sys-color-on-background);
    display: flex; justify-content: center; align-items: center;
    font-family: 'Roboto', sans-serif; box-sizing: border-box;
    transition: background-color 0.8s var(--md-sys-curve-emphasized);
    -webkit-tap-highlight-color: transparent;
}

@supports (height: 100dvh) {
    html, body { height: 100dvh; }
}

.fast-bg-transition, .fast-bg-transition body, .fast-bg-transition .desk-container {
    transition: background-color 0.15s ease-out !important;
}

/* 竖屏手机屏体：窄屏铺满真机，宽屏收束为一台居中圆角手机 */
.desk-container {
    width: 100%; height: 100%; background: var(--md-sys-color-surface);
    display: flex; flex-direction: column; overflow: hidden; position: relative;
    transition: background-color 0.8s var(--md-sys-curve-emphasized);
    padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
    /* 以屏体宽度为准的容器查询上下文，保证宽屏手机框内的元素同样按竖屏比例缩放 */
    container-type: inline-size;
    container-name: desk;
}

/* 桌面宽屏：收束为现代手机竖屏比例（仅加圆角与投影，不绘制假机身） */
@media (min-width: 620px) and (min-height: 700px) {
    body {
        padding: 28px;
        background-color: color-mix(in srgb, var(--md-sys-color-background) 78%, #000000);
    }
    .desk-container {
        width: 430px;
        max-width: 430px;
        height: min(920px, 100%);
        flex: 0 0 auto;
        border-radius: 48px;
        border: 1px solid color-mix(in srgb, var(--md-sys-color-on-background) 12%, transparent);
        box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35), 0 6px 20px rgba(0, 0, 0, 0.18);
    }
}

/* 屏体内的纵向滚动层 */
.desk-scroll {
    position: relative; z-index: 3;
    flex: 1 1 auto; min-height: 0; width: 100%;
    display: flex; flex-direction: column;
    box-sizing: border-box;
    overflow-y: auto; overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    scrollbar-width: none; -ms-overflow-style: none;
}
.desk-scroll::-webkit-scrollbar { width: 0; height: 0; display: none; }

.weather-canvas { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 2; }
.weather-space { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; overflow: hidden; }

.pane { width: 100%; position: relative; box-sizing: border-box; display: flex; flex-direction: column; z-index: 3; flex-shrink: 0; }

/* 上屏：时钟与气象总览 */
.pane-top { 
    padding: 26px 22px 6px; 
    justify-content: flex-start; 
    gap: 18px; 
}

/* 下屏：智能控制台 */
.pane-bottom { 
    padding: 10px 22px 32px; 
    background: transparent; 
    justify-content: flex-start; 
    gap: 14px;
}

.panel-content-router { flex: 0 0 auto; width: 100%; display: flex; flex-direction: column; overflow: visible; }
.view-panel { width: 100%; height: auto; display: flex; flex-direction: column; gap: 16px; overflow: visible; }
.view-panel.hidden { display: none !important; }

/* 高屏设备（如 430x932）留白微调 */
@media (min-width: 620px) and (min-height: 880px) {
    .pane-top { padding-top: 40px; gap: 24px; }
    .view-panel { gap: 18px; }
}

/* 时间排版彻底放大撑场面 */
.time-area { display: flex; flex-direction: column; align-items: flex-start; }
.time-display-stacked { 
    display: flex; flex-direction: column; line-height: 0.86; 
    font-size: clamp(96px, 24vw, 176px); 
    font-weight: 800; 
    letter-spacing: -5px; position: relative; z-index: 10; 
}
.time-display-stacked .hour-part { 
    color: var(--md-sys-color-primary); 
    transition: color 0.8s ease; 
    text-shadow: 4px 6px 16px color-mix(in srgb, var(--md-sys-color-primary) 30%, transparent);
}
.time-display-stacked .min-part { 
    color: var(--md-sys-color-on-background); 
    font-weight: 300; opacity: 0.85; transition: color 0.8s ease; 
    padding-left: 8px;
}
.date-container { margin-top: 16px; display: flex; flex-direction: column; gap: 6px; }
.date-display { font-size: clamp(18px, 4.6vw, 22px); font-weight: 700; opacity: 0.85; letter-spacing: 1px; }
.lunar-display { font-size: clamp(14px, 3.8vw, 17px); font-weight: 500; opacity: 0.7; letter-spacing: 0.5px; color: var(--md-sys-color-primary); transition: color 0.8s ease; }
.poetic-display { font-size: clamp(14px, 3.8vw, 17px); font-weight: 700; opacity: 0; color: var(--md-sys-color-primary); margin-top: 6px; transition: opacity 0.5s ease; height: 22px; letter-spacing: 1px; }

.weather-status-area { display: flex; flex-direction: column; gap: 8px; margin-top: 2px; }
.temp-display { font-size: clamp(44px, 12vw, 62px); font-weight: 300; line-height: 1.05; }
.weather-desc-row { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 500; flex-wrap: wrap; }
.desc-text { opacity: 0.85; }
.forecast-text-box { font-size: 14px; opacity: 0.8; font-weight: 500; margin-top: 4px; color: var(--md-sys-color-primary); min-height: 20px; transition: all 0.3s ease; }

.aqi-pill { padding: 5px 12px; border-radius: 14px; font-size: 13px; font-weight: 700; background: color-mix(in srgb, var(--md-sys-color-primary) 15%, transparent); color: var(--md-sys-color-primary); letter-spacing: 0.5px; transition: all 0.8s ease; }

/* 顶级通透液态玻璃面板：高光边缘与深层投影 */
.widget-card-glass {
    background: var(--md-sys-color-surface-container);
    backdrop-filter: blur(16px) saturate(120%);
    -webkit-backdrop-filter: blur(16px) saturate(120%);
    border-radius: 26px; 
    padding: 18px; 
    flex-shrink: 0;
    display: flex; flex-direction: column; justify-content: space-between; box-sizing: border-box; 
    will-change: transform;
    transform: translate3d(0, 0, 0); 
    backface-visibility: hidden;
    transition: transform 0.4s var(--curve-smooth), 
                background-color 0.8s var(--md-sys-curve-emphasized), 
                border-color 0.8s ease;
    border: 1px solid color-mix(in srgb, var(--md-sys-color-on-surface-variant) 15%, rgba(255,255,255,0.3));
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}
@media (prefers-color-scheme: dark) {
    .widget-card-glass {
        border: 1px solid color-mix(in srgb, var(--md-sys-color-on-surface-variant) 20%, rgba(255,255,255,0.1));
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    }
}
@container desk (min-width: 380px) {
    .widget-card-glass { padding: 20px; border-radius: 28px; }
}

.widget-card-glass[onclick], .ha-mini-pill-btn, .mode-tab-btn, .sim-mini-btn, .sim-select { transition: all 0.3s var(--curve-spring); }
.widget-card-glass[onclick]:hover { transform: translateY(-4px); box-shadow: 0 16px 32px rgba(0,0,0,0.08); }
.widget-card-glass[onclick]:active { transform: translateY(2px) scale(0.98); transition: all 0.15s ease-out; }

.ha-mini-pill-btn:hover { transform: translateY(-3px); }
.ha-mini-pill-btn:active, .mode-tab-btn:active, .sim-mini-btn:active { transform: scale(0.94); transition: transform 0.15s ease-out, background-color 0.15s ease-out; }

.large-action-card { background: color-mix(in srgb, var(--md-sys-color-primary-container) 50%, transparent) !important; color: var(--md-sys-color-on-primary-container) !important; border: 1px solid color-mix(in srgb, var(--md-sys-color-primary) 25%, transparent) !important; }
@media (prefers-color-scheme: dark) { .large-action-card { background: color-mix(in srgb, var(--md-sys-color-primary-container) 30%, transparent) !important; } }
.large-action-card .giant-icon { color: var(--md-sys-color-primary); font-size: 46px !important; }

.right-pane-header { display: flex; justify-content: space-between; align-items: center; width: 100%; margin-bottom: 4px; flex-shrink: 0; gap: 10px; }
.pane-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; opacity: 0.6; margin: 0; white-space: nowrap; }

.mode-toggle-capsule { display: flex; background: color-mix(in srgb, var(--md-sys-color-on-background) 8%, transparent); padding: 4px; border-radius: 99px; flex-shrink: 0; }
.mode-tab-btn { padding: 7px 12px; font-size: 13px; font-weight: 500; border: none; background: transparent; color: var(--md-sys-color-on-background); cursor: pointer; border-radius: 99px; display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.mode-tab-btn .material-symbols-rounded { font-size: 15px !important; }
.mode-tab-btn.active { background: var(--md-sys-color-primary); color: var(--md-sys-color-on-primary); font-weight: 700; box-shadow: 0 4px 12px rgba(0,0,0,0.15); }

.widget-header h3 { margin: 0; font-size: 15px; font-weight: 700; opacity: 0.85; display: flex; align-items: center; gap: 8px; }
.action-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.text-center-widget { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 10px; cursor: pointer; padding: 20px !important;}
.giant-icon { font-size: 46px !important; transition: transform 0.4s var(--curve-spring); }
.widget-title-clean { font-size: 16px; font-weight: 700; letter-spacing: 0.5px; }

/* 联系人专项区域 */
.contact-row { display: flex; gap: 14px; justify-content: center; width: 100%; }
.contact-card {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
    padding: 14px; border-radius: 20px;
    background: color-mix(in srgb, var(--md-sys-color-on-background) 4%, transparent);
    border: 1px solid color-mix(in srgb, var(--md-sys-color-on-background) 8%, transparent);
    cursor: pointer; transition: all 0.4s var(--curve-spring);
}
.contact-card:hover { transform: translateY(-4px); background: color-mix(in srgb, var(--md-sys-color-on-background) 8%, transparent); box-shadow: 0 8px 20px rgba(0,0,0,0.05); }
.contact-avatar {
    width: 62px; height: 62px; border-radius: 50%; object-fit: cover;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1); background: var(--md-sys-color-surface-variant);
}
.contact-name { font-size: 14px; font-weight: bold; margin-top: 4px; }

/* ========================================================================= */
/* 白噪音重构区域样式：彻底去掉复杂容器嵌套与混乱视觉                          */
/* ========================================================================= */
.wn-card-container {
    gap: 16px;
}

.wn-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.wn-card {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    cursor: pointer;
    border: 2px solid transparent;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s var(--curve-spring);
}

.wn-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.15);
}

.wn-card.active {
    border-color: var(--md-sys-color-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--md-sys-color-primary) 30%, transparent),
                0 8px 20px rgba(0, 0, 0, 0.2);
}

.wn-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.wn-card:hover .wn-cover,
.wn-card.active .wn-cover {
    transform: scale(1.1);
}

.wn-card-mask {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 30%, rgba(0, 0, 0, 0.7) 100%);
    pointer-events: none;
}

.wn-title {
    position: absolute;
    bottom: 8px;
    left: 0;
    right: 0;
    text-align: center;
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
    pointer-events: none;
}

.wn-control-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    background: color-mix(in srgb, var(--md-sys-color-on-background) 5%, transparent);
    padding: 8px 12px;
    border-radius: 18px;
    border: 1px solid color-mix(in srgb, var(--md-sys-color-on-background) 8%, transparent);
}

.wn-play-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    background: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px color-mix(in srgb, var(--md-sys-color-primary) 35%, transparent);
    transition: transform 0.2s var(--curve-spring), background-color 0.3s ease;
    flex-shrink: 0;
}

.wn-play-btn:active {
    transform: scale(0.92);
}

.wn-play-btn .material-symbols-rounded {
    font-size: 24px;
}

.wn-slider-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
}

.wn-control-bar input[type=range] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: color-mix(in srgb, var(--md-sys-color-on-background) 15%, transparent);
    outline: none;
    cursor: pointer;
}

.wn-control-bar input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--md-sys-color-primary);
    cursor: pointer;
    transition: transform 0.2s;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.wn-control-bar input[type=range]::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.wn-timer-tag {
    font-size: 18px;
    font-weight: 800;
    color: var(--md-sys-color-primary);
    min-width: 60px;
    text-align: right;
    flex-shrink: 0;
}

.wn-timer-tag .unit {
    font-size: 12px;
    font-weight: 500;
    opacity: 0.7;
    margin-left: 2px;
    color: var(--md-sys-color-on-background);
}

/* HA 扩展 */
.ha-ext-block { flex-shrink: 0; }
.ha-ext-label { font-size: 12px; font-weight: 700; opacity: 0.5; margin-bottom: 10px; letter-spacing: 1px; }
.ha-ext-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; width: 100%; }
.ha-mini-pill-btn { 
    padding: 14px 6px; border-radius: 18px; 
    border: 1px dashed color-mix(in srgb, var(--md-sys-color-on-background) 25%, transparent); 
    background: color-mix(in srgb, var(--md-sys-color-on-background) 4%, transparent); 
    color: var(--md-sys-color-on-background); font-size: 12px; font-weight: 700; 
    cursor: pointer; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; 
}
.ha-mini-pill-btn:hover { background: var(--md-sys-color-primary); color: var(--md-sys-color-on-primary); border-style: solid; border-color: transparent; }
.ha-mini-pill-btn .material-symbols-rounded { font-size: 20px; opacity: 0.9; }

.lightning-flash-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.65) 0%, transparent 85%); opacity: 0; pointer-events: none; z-index: 3; mix-blend-mode: screen; }
.flash-active .lightning-flash-overlay { animation: soft-flash 0.42s var(--md-sys-curve-fluid); }

.w-element { position: absolute; opacity: 0; pointer-events: none; will-change: transform, opacity; transition: opacity 1.5s var(--md-sys-curve-fluid), filter 1.5s ease; }
.ele-sun { width: 85px; height: 85px; background: var(--weather-sun); border-radius: 50%; top: 12%; left: 22%; box-shadow: 0 0 45px rgba(255, 179, 0, 0.5); }
.ele-sun::before { content: ''; position: absolute; top: -45px; left: -45px; right: -45px; bottom: -45px; background: radial-gradient(circle, rgba(255, 235, 59, 0.3) 0%, rgba(255, 179, 0, 0.1) 50%, transparent 75%); border-radius: 50%; z-index: -1; animation: sun-halo-rotate 22s infinite linear; }
.is-daytime.m-sunny .ele-sun { opacity: 0.95; pointer-events: auto; animation: sun-pulse 6s infinite alternate var(--md-sys-curve-fluid); filter: none; }
.is-daytime.m-cloudy .ele-sun { opacity: 0.35; pointer-events: auto; filter: blur(4px); transform: scale(0.95); }

.ele-moon { width: 60px; height: 60px; border-radius: 50%; top: 14%; left: 23%; box-shadow: -15px 15px 0 0 var(--weather-moon); filter: drop-shadow(0 0 14px var(--weather-moon)); transform: rotate(-15deg); transition: all 1.5s ease;}
.is-nighttime.m-sunny .ele-moon { opacity: 1; pointer-events: auto; animation: moon-float 8s infinite var(--md-sys-curve-fluid); filter: drop-shadow(0 0 14px var(--weather-moon)); }
.is-nighttime.m-cloudy .ele-moon { opacity: 0.38; pointer-events: auto; animation: moon-float 12s infinite linear; filter: blur(5px) rotate(-10deg); }

.ele-moon.m-full-moon { box-shadow: 0 0 35px rgba(255, 235, 150, 0.6), inset 0 0 20px rgba(255, 235, 150, 0.5); background: radial-gradient(circle at 35% 35%, #fffde7 0%, #fff59d 100%); filter: drop-shadow(0 0 20px #fff59d); transform: none !important; }
.is-nighttime.m-sunny .ele-moon.m-full-moon { animation: moon-float-full 8s infinite var(--md-sys-curve-fluid) !important; }

.ele-star { width: 3px; height: 3px; background: var(--weather-star); border-radius: 50%; }
.star-1 { left: 4%; top: 12%; }   .star-2 { left: 14%; top: 28%; }
.star-3 { left: 22%; top: 8%; }   .star-4 { left: 31%; top: 22%; }
.star-5 { left: 39%; top: 15%; }  .star-6 { left: 48%; top: 33%; }
.star-7 { left: 55%; top: 9%; }   .star-8 { left: 62%; top: 25%; }
.star-9 { left: 69%; top: 14%; }  .star-10 { left: 74%; top: 38%; }
.star-11 { left: 81%; top: 7%; }  .star-12 { left: 86%; top: 21%; }
.star-13 { left: 91%; top: 32%; } .star-14 { left: 96%; top: 11%; }
.star-15 { left: 10%; top: 68%; } .star-16 { left: 50%; top: 75%; }
.is-nighttime.m-sunny .ele-star { opacity: 0.85; animation: star-twinkle 2.5s infinite var(--md-sys-curve-fluid); }
.is-nighttime.m-sunny .star-1, .is-nighttime.m-sunny .star-5, .is-nighttime.m-sunny .star-9, .is-nighttime.m-sunny .star-13 { animation-delay: 0.3s; animation-duration: 2s; }
.is-nighttime.m-sunny .star-2, .is-nighttime.m-sunny .star-6, .is-nighttime.m-sunny .star-10, .is-nighttime.m-sunny .star-14 { animation-delay: 0.7s; animation-duration: 3s; }
.is-nighttime.m-sunny .star-3, .is-nighttime.m-sunny .star-7, .is-nighttime.m-sunny .star-11, .is-nighttime.m-sunny .star-15 { animation-delay: 1.2s; animation-duration: 2.4s; }
.is-nighttime.m-sunny .star-4, .is-nighttime.m-sunny .star-8, .is-nighttime.m-sunny .star-12, .is-nighttime.m-sunny .star-16 { animation-delay: 1.8s; animation-duration: 3.5s; }
.is-nighttime.m-cloudy .ele-star { opacity: 0.15; animation: star-twinkle 4s infinite linear; }

.milky-way { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; opacity: 0; transition: opacity 2s ease; z-index: 1; }
.is-qixi .milky-way { opacity: 1; }
.mw-star { position: absolute; background: white; border-radius: 50%; animation: mw-twinkle var(--duration) infinite alternate ease-in-out; opacity: 0.8; }

.ele-cloud-box { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; opacity: 0; will-change: opacity; transition: opacity 1.8s var(--md-sys-curve-fluid); }
.m-cloudy .ele-cloud-box, .m-thunder .ele-cloud-box, .m-storm .ele-cloud-box, .m-storm_thunder .ele-cloud-box, .m-rain .ele-cloud-box, .m-snow .ele-cloud-box { opacity: 1; }

.cloud-puff { 
    position: absolute;
    border-radius: 50%;
    filter: blur(25px); 
    will-change: transform; 
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
}

.cp-1 { 
    width: 500px; height: 500px; left: -10%; top: -20%; 
    background: radial-gradient(circle at 40% 40%, var(--weather-cloud-start) 0%, var(--weather-cloud-end) 70%); 
    animation: cloud-drift-1 22s infinite alternate ease-in-out; opacity: 0.95; 
}
.cp-2 { 
    width: 350px; height: 350px; left: 8%; top: -15%; 
    background: radial-gradient(circle at 30% 30%, var(--weather-cloud-start) 0%, transparent 70%); 
    animation: cloud-drift-1 22s infinite alternate ease-in-out; opacity: 1; 
}
.cp-3 { 
    width: 600px; height: 250px; left: -5%; top: 20%; 
    background: radial-gradient(circle at 50% 70%, var(--weather-cloud-end) 0%, transparent 75%); 
    animation: cloud-drift-1 22s infinite alternate ease-in-out; opacity: 0.9; 
}

.cp-4 { 
    width: 700px; height: 350px; left: 25%; top: -10%; 
    background: radial-gradient(circle at 50% 50%, var(--weather-cloud-start) 0%, var(--weather-cloud-end) 80%); 
    animation: cloud-drift-3 30s infinite alternate ease-in-out; opacity: 0.65; z-index: -1; 
}

.cp-5 { 
    width: 550px; height: 550px; left: 65%; top: -25%; 
    background: radial-gradient(circle at 60% 40%, var(--weather-cloud-start) 0%, var(--weather-cloud-end) 70%); 
    animation: cloud-drift-2 26s infinite alternate ease-in-out; opacity: 0.95; 
}
.cp-6 { 
    width: 400px; height: 400px; left: 55%; top: -10%; 
    background: radial-gradient(circle at 70% 30%, var(--weather-cloud-start) 0%, transparent 70%); 
    animation: cloud-drift-2 26s infinite alternate ease-in-out; opacity: 1; 
}
.cp-7 { 
    width: 650px; height: 250px; left: 58%; top: 22%; 
    background: radial-gradient(circle at 50% 70%, var(--weather-cloud-end) 0%, transparent 75%); 
    animation: cloud-drift-2 26s infinite alternate ease-in-out; opacity: 0.9; 
}

@keyframes cloud-drift-1 { 0% { transform: translate3d(0, 0, 0) scale(1); } 100% { transform: translate3d(60px, -15px, 0) scale(1.08); } }
@keyframes cloud-drift-2 { 0% { transform: translate3d(0, 0, 0) scale(1); } 100% { transform: translate3d(-60px, 15px, 0) scale(0.95); } }
@keyframes cloud-drift-3 { 0% { transform: translate3d(0, 0, 0) scale(1); } 100% { transform: translate3d(40px, 5px, 0) scale(1.02); } }

.ele-typhoon-eye { width: 80px; height: 80px; border: 6px dashed rgba(180,185,200,0.5); border-radius: 50%; top: 20%; left: 46%; animation: typhoon-spin 4s infinite linear; }
.m-typhoon .ele-typhoon-eye { opacity: 0.7; pointer-events: auto; }

.ele-haze-stream-box { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 2; pointer-events: none; opacity: 0; transition: opacity 2.0s ease-in-out; }
.aqi-moderate .ele-haze-stream-box, .aqi-heavy .ele-haze-stream-box { opacity: 1; }

.haze-cloud-wave { 
    position: absolute; 
    background: var(--weather-dust-stream); 
    border-radius: 50%; 
    filter: blur(30px); 
    opacity: 0; 
    will-change: transform, opacity; 
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
}
.aqi-moderate .hcw-1 { width: 400px; height: 120px; left: -100px; top: 30%; animation: haze-swell-left 18s infinite alternate ease-in-out; --haze-op: 0.45; }
.aqi-heavy .hcw-1 { width: 500px; height: 150px; left: -100px; top: 25%; animation: haze-swell-left 13s infinite alternate ease-in-out; --haze-op: 0.75; }

.ele-dust-box { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 5; pointer-events: none; }
.dust-particle { position: absolute; background: var(--weather-dust-particle); border-radius: 50%; opacity: 0; display: none; }
.aqi-heavy .dust-particle { display: block; --dust-op: 0.75; --dust-sc: 1.3; }
.dp-1 { width: 4px; height: 4px; left: -20px; top: 55%; animation: dust-tur-1 6.2s infinite linear; }
.dp-2 { width: 3px; height: 3px; left: -20px; top: 25%; animation: dust-tur-2 7.0s infinite linear 0.4s; }
.dp-3 { width: 5px; height: 5px; left: -20px; top: 15%; animation: dust-tur-1 6.8s infinite linear 1.5s; }
.dp-4 { width: 3px; height: 3px; left: -20px; top: 42%; animation: dust-tur-2 7.5s infinite linear 2.2s; }
.dp-5 { width: 4px; height: 4px; left: -20px; top: 70%; animation: dust-tur-1 5.8s infinite linear 3.1s; }
.dp-6 { width: 2.5px; height: 2.5px; left: -20px; top: 85%; animation: dust-tur-2 8.0s infinite linear 0.9s; }
.dp-7 { width: 3.5px; height: 3.5px; left: -20px; top: 33%; animation: dust-tur-1 6.5s infinite linear 4.5s; }
.dp-8 { width: 4.5px; height: 4.5px; left: -20px; top: 62%; animation: dust-tur-2 7.2s infinite linear 5.2s; }

.sim-select { width: 100%; padding: 8px 12px; font-size: 14px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--md-sys-color-on-background) 15%, transparent); background: color-mix(in srgb, var(--md-sys-color-on-background) 5%, transparent); color: var(--md-sys-color-on-background); outline: none; margin-top: 4px; cursor: pointer; }
.sim-select:focus { border-color: var(--md-sys-color-primary); box-shadow: 0 0 0 2px color-mix(in srgb, var(--md-sys-color-primary) 30%, transparent); }
.sim-group { display: flex; gap: 8px; margin-top: 4px; }
.sim-mini-btn { flex: 1; padding: 8px; font-size: 13px; border: none; border-radius: 10px; background: color-mix(in srgb, var(--md-sys-color-on-background) 6%, transparent); color: var(--md-sys-color-on-background); cursor: pointer; text-align: center; }
.sim-mini-btn.active { background: var(--md-sys-color-primary-container); color: var(--md-sys-color-on-primary-container); font-weight: 700; }

.debug-stack { display: flex; flex-direction: column; gap: 14px; }
.debug-stack .sim-label { font-weight: 700; font-size: 15px; margin-bottom: 8px; }
.debug-stack .sim-label.spaced { margin-top: 14px; }

.log-box { 
    height: 180px; min-height: 180px; background: color-mix(in srgb, var(--md-sys-color-on-surface-variant) 8%, transparent); border-radius: 14px; padding: 12px; font-family: monospace; font-size: 12px; overflow-y: auto; white-space: pre-wrap; box-sizing: border-box; color: var(--md-sys-color-on-surface-variant); margin-top: 6px;
    border: 1px solid color-mix(in srgb, var(--md-sys-color-on-surface-variant) 10%, transparent);
    box-shadow: inset 0 2px 6px rgba(0,0,0,0.03);
}

@keyframes sun-pulse { 0%, 100% { transform: scale(1); opacity: 0.95; } 50% { transform: scale(1.04); opacity: 1; } }
@keyframes sun-halo-rotate { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes moon-float { 0%, 100% { transform: rotate(-15deg) translateY(0); } 50% { transform: rotate(-11deg) translateY(-3px); } }
@keyframes moon-float-full { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes star-twinkle { 0%, 100% { opacity: 0.15; transform: scale(0.8); } 50% { opacity: 0.95; transform: scale(1.25); } }

@keyframes mw-twinkle { 
    0% { transform: scale(0.5); opacity: 0.3; } 
    100% { transform: scale(1.5); opacity: 1; } 
}

@keyframes typhoon-spin { to { transform: rotate(360deg); } }
@keyframes haze-swell-left { 0% { transform: translateX(0) scale(1) rotate(0deg); opacity: 0; } 20%, 80% { opacity: var(--haze-op, 0.5); } 100% { transform: translateX(var(--haze-travel, 700px)) scale(1.4) rotate(10deg); opacity: 0; } }
@keyframes dust-tur-1 { 0% { transform: translate(0, 0) scale(calc(0.6 * var(--dust-sc, 1))); opacity: 0; } 15%, 85% { opacity: var(--dust-op, 0.5); } 100% { transform: translate(var(--dust-travel, 1300px), -5px) scale(calc(0.7 * var(--dust-sc, 1))); opacity: 0; } }
@keyframes dust-tur-2 { 0% { transform: translate(0, 0) scale(calc(0.8 * var(--dust-sc, 1))); opacity: 0; } 20%, 75% { opacity: var(--dust-op, 0.5); } 100% { transform: translate(var(--dust-travel, 1300px), -30px) scale(calc(1.2 * var(--dust-sc, 1))); opacity: 0; } }
@keyframes soft-flash { 0%, 26%, 100% { opacity: 0; } 8%, 20% { opacity: 0.42; } }

/* ========================================================================= */
/* 竖屏比例适配：以屏体宽度为准（容器查询），宽屏手机框内同样生效            */
/* ========================================================================= */
@container desk (max-width: 600px) {

    /* 日月与台风眼：上移居中，避开竖屏顶部的时钟主视觉 */
    .ele-sun { width: 66px; height: 66px; top: 7%; left: 32%; box-shadow: 0 0 34px rgba(255, 179, 0, 0.5); }
    .ele-sun::before { top: -34px; left: -34px; right: -34px; bottom: -34px; }
    .ele-moon { top: 8%; left: 34%; }
    .ele-typhoon-eye { width: 64px; height: 64px; left: 38%; top: 15%; }

    /* 云团：等比收缩，避免在窄屏上糊成一片 */
    .cp-1 { width: 330px; height: 330px; left: -14%; top: -12%; }
    .cp-2 { width: 240px; height: 240px; left: 8%; top: -8%; }
    .cp-3 { width: 400px; height: 170px; left: -10%; top: 14%; }
    .cp-4 { width: 460px; height: 220px; left: 20%; top: -6%; }
    .cp-5 { width: 350px; height: 350px; left: 56%; top: -14%; }
    .cp-6 { width: 260px; height: 260px; left: 46%; top: -4%; }
    .cp-7 { width: 420px; height: 170px; left: 50%; top: 16%; }

    /* 尘埃与雾霾横移距离：按竖屏宽度收短，保证粒子在可视区停留 */
    .weather-space { --dust-travel: 620px; --haze-travel: 520px; }
    .aqi-moderate .hcw-1 { width: 300px; height: 100px; left: -80px; top: 26%; }
    .aqi-heavy .hcw-1 { width: 380px; height: 130px; left: -80px; top: 22%; }
}