/* ============================================================
   天气卡片 + 雪花动效优化
   风格：毛玻璃 / 轻阴影，与深色背景图协调
   ============================================================ */

/* ---------- 天气卡片 ---------- */
#wx-card {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 900;
    min-width: 132px;
    padding: 12px 14px 11px;
    border-radius: 16px;
    background: rgba(20, 24, 31, 0.42);
    border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.10);
    -webkit-backdrop-filter: blur(14px) saturate(150%);
    backdrop-filter: blur(14px) saturate(150%);
    color: #f2f5f8;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    line-height: 1.2;
    opacity: 0;
    transform: translateY(-8px) scale(0.97);
    transition: opacity .42s ease, transform .42s cubic-bezier(.22,.68,.36,1);
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
}

#wx-card.wx-in {
    opacity: 1;
    transform: translateY(0) scale(1);
}

#wx-card .wx-top {
    display: flex;
    align-items: center;
    gap: 9px;
}

#wx-card .wx-icon {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    display: block;
}

#wx-card .wx-icon svg {
    width: 100%;
    height: 100%;
    display: block;
    overflow: visible;
}

#wx-card .wx-temp {
    font-size: 27px;
    font-weight: 600;
    letter-spacing: -0.5px;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

#wx-card .wx-temp sup {
    font-size: 13px;
    font-weight: 500;
    vertical-align: super;
    opacity: .85;
    margin-left: 1px;
}

#wx-card .wx-desc {
    margin-top: 7px;
    font-size: 12.5px;
    color: rgba(242, 245, 248, 0.90);
    display: flex;
    align-items: center;
    gap: 6px;
}

#wx-card .wx-desc .wx-range {
    color: rgba(242, 245, 248, 0.62);
    font-variant-numeric: tabular-nums;
}

#wx-card .wx-meta {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 11.5px;
    color: rgba(242, 245, 248, 0.66);
    display: flex;
    gap: 10px;
    font-variant-numeric: tabular-nums;
}

#wx-card .wx-meta span {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

#wx-card .wx-meta i {
    font-style: normal;
    opacity: .75;
}

/* 移动端：缩尺寸、上移让位 */
@media screen and (max-width: 736px) {
    #wx-card {
        top: 12px;
        right: 12px;
        min-width: 0;
        padding: 9px 11px 9px;
        border-radius: 13px;
    }
    #wx-card .wx-icon { width: 26px; height: 26px; }
    #wx-card .wx-temp { font-size: 21px; }
    #wx-card .wx-desc { font-size: 11px; margin-top: 5px; }
    #wx-card .wx-meta { display: none; }
}

/* ---------- 雪花容器（关键：pointer-events 不拦截点击） ---------- */
#snow-layer {
    position: fixed;
    inset: 0;
    z-index: 999999;
    pointer-events: none;
    overflow: hidden;
    contain: strict;
}

#snow-layer .flake {
    position: absolute;
    top: -40px;
    left: 0;
    will-change: transform, opacity;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    pointer-events: none;
    opacity: 0;
}

#snow-layer .flake img {
    display: block;
    width: 100%;
    height: auto;
    border: 0;
    pointer-events: none;
    -webkit-user-select: none;
    user-select: none;
    -webkit-user-drag: none;
}

@keyframes flakeFallL {
    0%   { opacity: 0; transform: translate3d(0, 0, 0) rotate(0deg); }
    18%  { opacity: var(--flake-op, .9); }
    82%  { opacity: var(--flake-op, .9); }
    100% { opacity: 0; transform: translate3d(var(--sway, 120px), 108vh, 0) rotate(var(--spin, 220deg)); }
}

@keyframes flakeFallR {
    0%   { opacity: 0; transform: translate3d(0, 0, 0) rotate(0deg); }
    18%  { opacity: var(--flake-op, .9); }
    82%  { opacity: var(--flake-op, .9); }
    100% { opacity: 0; transform: translate3d(calc(var(--sway, 120px) * -1), 108vh, 0) rotate(calc(var(--spin, 220deg) * -1)); }
}

/* 用户偏好减弱动效时自动关闭 */
@media (prefers-reduced-motion: reduce) {
    #snow-layer { display: none !important; }
    #wx-card { transition: none; }
}

/* ===== 音乐播放器避让（窄屏） =====
   Swhite 皮肤固定于左下角，尺寸 300x80。
   窄屏时页脚文字可能落入播放器矩形，故整体上移留出安全区。
   断点取 1023px：平板竖屏/小窗同样需要避让。 */
@media screen and (max-width: 1023px) {
    #wrapper {
        padding-bottom: 104px !important;
    }
}

/* 极窄屏（<340px）播放器内容更紧凑，额外加高 */
@media screen and (max-width: 340px) {
    #wrapper {
        padding-bottom: 112px !important;
    }
}
/* ============================================================
   IP 定位城市名（2026-11-17 新增）
   ============================================================ */

#wx-card .wx-city {
    margin-top: 6px;
    font-size: 11.5px;
    letter-spacing: .2px;
    color: rgba(242, 245, 248, 0.72);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    max-width: 100%;
}

#wx-card .wx-city svg {
    width: 10px;
    height: 10px;
    flex: 0 0 auto;
    opacity: .8;
}

#wx-card .wx-city b {
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media screen and (max-width: 736px) {
    #wx-card .wx-city { font-size: 10.5px; margin-top: 5px; }
}
