/* Decoration-only canvases: never a site overlay or a pointer target. */
#holiday-effects-layer {
    position: fixed;
    inset: 0;
    z-index: 7;
    overflow: hidden;
    pointer-events: none;
}

#holiday-effects-layer > .holiday-snow,
#holiday-effects-layer > .holiday-eggs {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

[data-holiday-surface] {
    --holiday-spring: cubic-bezier(0.22, 1.36, 0.36, 1);
    --holiday-snow-mid: #f3f8ff;
    --holiday-snow-under: #bdd9fa;
    --holiday-snow-stroke: #a8ccf8;
    --holiday-ice-top: rgba(255, 255, 255, .92);
    --holiday-ice-bottom: rgba(154, 205, 255, .72);
    --holiday-wire: #36454f;
    --holiday-wash: linear-gradient(180deg, rgba(164, 208, 255, .62), rgba(196, 224, 255, .30) 42%, rgba(225, 240, 255, .08) 76%, transparent);
    --holiday-wash-thanks: linear-gradient(180deg, rgba(255, 232, 198, .86), rgba(255, 241, 222, .56) 44%, rgba(255, 246, 234, .16) 78%, transparent);
    --holiday-wash-amber: radial-gradient(ellipse 90% 100% at 50% 0, rgba(253, 224, 145, .50), rgba(254, 243, 199, .20) 52%, transparent);
    --holiday-aura-opacity: .08;
    /* 卡顶冠雪配色取自参考模板 --snow-top/mid/bottom/stroke/glow */
    --holiday-crown-top: #ffffff;
    --holiday-crown-mid: #f8fbff;
    --holiday-crown-bottom: #dce8f7;
    --holiday-crown-stroke: rgba(180, 205, 235, .7);
    --holiday-crown-glow: rgba(85, 130, 190, .16);
}

[data-holiday-surface][data-holiday-theme="dark"] {
    --holiday-snow-mid: #ebf4ff;
    --holiday-snow-under: #9cc4f5;
    --holiday-snow-stroke: rgba(191, 219, 254, .72);
    --holiday-ice-top: rgba(255, 255, 255, .90);
    --holiday-ice-bottom: rgba(147, 197, 253, .65);
    --holiday-wire: #94a3b8;
    --holiday-wash: linear-gradient(180deg, rgba(45, 95, 175, .54), rgba(34, 72, 138, .25) 44%, rgba(20, 42, 82, .08) 76%, transparent);
    --holiday-wash-thanks: linear-gradient(180deg, rgba(194, 96, 36, .34), rgba(154, 78, 28, .18) 44%, rgba(110, 56, 20, .05) 78%, transparent);
    --holiday-wash-amber: radial-gradient(ellipse 92% 100% at 50% 0, rgba(245, 158, 11, .32), rgba(217, 119, 6, .12) 52%, transparent);
    --holiday-aura-opacity: .15;
    --holiday-crown-top: #f2f8ff;
    --holiday-crown-mid: #d9ecff;
    --holiday-crown-bottom: #8bb8e8;
    --holiday-crown-stroke: rgba(135, 190, 250, .55);
    --holiday-crown-glow: rgba(85, 130, 190, .22);
}

[data-holiday-surface][data-holiday-season="thanks"] { --holiday-wash-current: var(--holiday-wash-thanks); }
[data-holiday-surface][data-holiday-season="amber"] { --holiday-wash-current: var(--holiday-wash-amber); }

.holiday-ornament {
    position: absolute;
    box-sizing: border-box;
    pointer-events: none;
}

.holiday-ornament[hidden] { display: none !important; }
.holiday-ornament > svg { display: block; width: 100%; height: 100%; overflow: visible; }

button.holiday-ornament {
    appearance: none;
    padding: 0;
    margin: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    opacity: 1;
}

button.holiday-ornament:not(:disabled) { pointer-events: auto; cursor: pointer; }
button.holiday-ornament:focus-visible { outline: 2px solid #8671d2; outline-offset: 2px; }

.holiday-wash {
    inset: 0 0 auto;
    height: 18rem;
    background: var(--holiday-wash-current, var(--holiday-wash));
    opacity: .38;
    /* 光晕从页面顶部淡入，避免上沿在纯色背景上切出一条硬边 */
    -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 18%, #000 100%);
    mask-image: linear-gradient(180deg, transparent 0, #000 18%, #000 100%);
}

[data-holiday-surface="home"][data-holiday-season="winter"] #page-home .holiday-wash { display: none; }
[data-holiday-surface]:not([data-holiday-surface="home"]) .holiday-wash { height: 11rem; opacity: .19; }

/* 卡顶冠雪：逐字对照参考模板 .card-snow-crown —— 11px 高、坐在卡片上边框外侧，
   bottom 对齐卡顶，左右各让 16px，雪体自带 0.6 描边、向上投影，
   两端雪梢自己收在卡角上，不做左右渐隐。 */
.holiday-cap-host { position: relative; }
.holiday-cap,
button.holiday-edge,
button.holiday-edge:not(:disabled) {
    position: absolute;
    bottom: calc(100% - 1.5px);
    top: auto;
    left: 16px;
    right: 16px;
    width: calc(100% - 32px);
    height: 11px;
    z-index: 6;
    pointer-events: none;
    overflow: visible;
    padding: 0;
    border: 0;
    background: none;
    transform-origin: top center;
    filter: drop-shadow(0 -1px 2px var(--holiday-crown-glow));
}
.holiday-cap > svg,
button.holiday-edge > svg { display: block; width: 100%; height: 100%; }
/* 聊天室卡自带 overflow:hidden（用来裁右上角的绿色光晕），雪只能收在卡内上沿。
   16px 内缩 + 11px 高度落在 20px 圆角之外，不会被圆角切到。 */
.holiday-cap-chatroom {
    bottom: auto;
    top: 0;
}
/* App 里品牌卡紧贴屏幕顶端（index.css 把它的 margin-top 归零），
   挂在卡外的冠雪和圣诞帽会被顶出可视区。照模板的做法给卡顶留出一点空间。 */
html.is-skxs-webview [data-holiday-surface="home"] #page-home .brand-header { margin-top: 14px !important; }

.holiday-edge:not(:disabled) > svg > path { pointer-events: visiblePainted; cursor: pointer; }
/* 模板 152 行 .uni-card.stepped-bounce：灵鹿或企鹅落脚时，被踩的卡片向下沉 3.5px 再弹回。
   模板的卡片本身带 transform 过渡，我们的卡片没有，这里按模板 138 行的同一条缓动补上。 */
.holiday-cap-host,
.holiday-bounce-host { transition: transform .32s cubic-bezier(.34, 1.56, .64, 1); }
.holiday-cap-host.holiday-stepped-bounce,
.holiday-bounce-host.holiday-stepped-bounce { transform: translateY(3.5px) scale(.992); }
[data-holiday-stage="2"] .holiday-edge .holiday-snow-extra { visibility: hidden; opacity: 0; transform: scaleY(.45); }
.holiday-snow-extra { transform-origin: top center; }

.holiday-hat {
    width: 33px;
    height: 27px;
    /* 帽檐已居中在图案里（x 3~33 / 36），按框宽一半补偿；
       -9° 的旋转会把帽檐再带左约 1px，这里一并补掉。 */
    margin-left: -15.5px !important;
    z-index: 3;
    transform: rotate(-9deg);
    /* 模板 227 行 .logo-hat-anim 的 pivot：绕帽檐右端偏下摆，不是绕正下方。 */
    transform-origin: 70% 85%;
}
.holiday-hat > svg { filter: drop-shadow(0 2px 3px rgba(220, 38, 38, .22)); }

.holiday-aura {
    inset: 0;
    border-radius: inherit;
    opacity: var(--holiday-aura-opacity);
    background: radial-gradient(ellipse at 6% 5%, #ff5f56 0%, transparent 34%),
        radial-gradient(ellipse at 17% 0%, #ffbd2e 0%, transparent 32%),
        radial-gradient(ellipse at 29% 0%, #27c93f 0%, transparent 31%);
}
[data-holiday-season="amber"] .holiday-aura { opacity: calc(var(--holiday-aura-opacity) * 1.7); }

button.holiday-lights {
    inset: -8px -5px -5px;
    z-index: 3;
    border-radius: 999px;
}
.holiday-lights > svg { position: absolute; top: 0; height: 17px; }
[data-holiday-surface="home"]:is([data-holiday-stage="3"], [data-holiday-stage="4"], [data-holiday-stage="5"]) [data-holiday-lights] .mac-dot {
    position: relative;
    box-shadow: 0 0 6px 1px var(--holiday-glow);
}
[data-holiday-surface="home"] [data-holiday-lights] .red { --holiday-glow: rgba(255, 95, 86, .85); --holiday-offset: 0s; }
[data-holiday-surface="home"] [data-holiday-lights] .yellow { --holiday-glow: rgba(255, 189, 46, .90); --holiday-offset: .6s; }
[data-holiday-surface="home"] [data-holiday-lights] .green { --holiday-glow: rgba(39, 201, 63, .84); --holiday-offset: 1.2s; }
[data-holiday-surface="home"] [data-holiday-lights="chase"] .yellow { --holiday-offset: .45s; }
[data-holiday-surface="home"] [data-holiday-lights="chase"] .green { --holiday-offset: .90s; }
[data-holiday-surface="home"]:is([data-holiday-stage="3"], [data-holiday-stage="4"], [data-holiday-stage="5"]) [data-holiday-lights] .mac-dot::after {
    content: "";
    position: absolute;
    top: 20%;
    left: 20%;
    width: 28%;
    height: 28%;
    border-radius: 50%;
    background: rgba(255, 255, 255, .88);
}

.holiday-bell {
    z-index: 3;
    width: 24px;
    height: 30px;
    margin-left: -12px !important;
    transform: rotate(-4deg);
    transform-origin: 50% 0;
}
.holiday-bell > svg { filter: drop-shadow(0 3px 5px rgba(217, 119, 6, .28)); }
.holiday-bell-ripple {
    position: absolute;
    top: 10px;
    left: 4px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1.5px solid rgba(245, 158, 11, .65);
    opacity: 0;
    pointer-events: none;
}

button.holiday-pine {
    top: -12px;
    right: 12px;
    width: clamp(37px, 13%, 54px);
    height: 24px;
    z-index: 2;
    transform-origin: 86% 52%;
}
.holiday-pine > svg { filter: drop-shadow(0 2px 4px rgba(22, 101, 52, .18)); }

button.holiday-thanks {
    top: auto;
    right: 8px;
    bottom: -6px;
    z-index: 4;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 3px 9px 3px 6px;
    border: 1.5px solid rgba(217, 119, 6, .34);
    border-radius: 999px;
    background: linear-gradient(160deg, #fffdf7, #ffe9c7);
    color: #9a3412;
    font-size: .66rem;
    font-weight: 700;
    letter-spacing: .01em;
    white-space: nowrap;
    box-shadow: 0 3px 10px rgba(180, 83, 9, .2), inset 0 1px 0 #fff;
}
.holiday-thanks > svg { flex: none; width: .82rem; height: .82rem; }
[data-holiday-theme="dark"] button.holiday-thanks {
    background: linear-gradient(160deg, #4a2c13, #3a2412);
    border-color: rgba(251, 146, 60, .42);
    color: #fdba74;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .36);
}

@media (prefers-reduced-motion: no-preference) {
    [data-holiday-motion="on"] .holiday-hat:not(:disabled) { animation: holiday-hat-tilt 3.6s ease-in-out infinite; }
    [data-holiday-motion="on"] .holiday-hat.holiday-playing { animation: holiday-hat-bounce .68s var(--holiday-spring), holiday-hat-tilt 3.6s ease-in-out .68s infinite; }
    [data-holiday-motion="on"] .holiday-edge.holiday-playing { animation: holiday-snow-jiggle .52s var(--holiday-spring); }
    [data-holiday-motion="on"] .holiday-snow-extra { transition: opacity .65s ease, transform .7s var(--holiday-spring); }
    [data-holiday-motion="on"] .holiday-pine:not(:disabled) { animation: holiday-pine-breeze 5.6s ease-in-out .8s infinite; }
    [data-holiday-motion="on"] .holiday-pine.holiday-playing { animation: holiday-pine-rustle .56s var(--holiday-spring), holiday-pine-breeze 5.6s ease-in-out .56s infinite; }
    [data-holiday-motion="on"] .holiday-bell:not(:disabled) { animation: holiday-bell-pendulum 4.5s ease-in-out infinite; }
    [data-holiday-motion="on"] .holiday-bell.holiday-playing { animation: holiday-bell-ring .92s ease-out, holiday-bell-pendulum 4.5s ease-in-out .92s infinite; }
    [data-holiday-motion="on"] .holiday-bell.holiday-playing .holiday-bell-ripple { animation: holiday-bell-wave .72s ease-out; }
    [data-holiday-motion="on"] .holiday-bell.holiday-playing .holiday-bell-ripple + .holiday-bell-ripple { animation-delay: .15s; }
    [data-holiday-motion="on"] .holiday-thanks { animation: holiday-thanks-float 3.8s ease-in-out .5s infinite; }
    [data-holiday-motion="on"] .holiday-thanks:not(:disabled):active,
    [data-holiday-motion="on"] .holiday-lights:not(:disabled):active { animation: none; transform: scale(.93); }
    [data-holiday-surface="home"][data-holiday-motion="on"]:is([data-holiday-stage="3"], [data-holiday-stage="4"], [data-holiday-stage="5"]) [data-holiday-lights="breathe"] .mac-dot {
        animation: holiday-glow 2.6s ease-in-out var(--holiday-offset) infinite;
    }
    [data-holiday-surface="home"][data-holiday-motion="on"]:is([data-holiday-stage="3"], [data-holiday-stage="4"], [data-holiday-stage="5"]) [data-holiday-lights="chase"] .mac-dot {
        animation: holiday-chase 1.35s ease-in-out var(--holiday-offset) infinite;
    }
    [data-holiday-surface="home"][data-holiday-motion="on"]:is([data-holiday-stage="3"], [data-holiday-stage="4"], [data-holiday-stage="5"]) [data-holiday-lights="steady"] .mac-dot {
        box-shadow: 0 0 12px 3.5px var(--holiday-glow);
        filter: brightness(1.15);
    }
}

@keyframes holiday-hat-tilt {
    0%, 100% { transform: rotate(-7deg) translateY(0); }
    50% { transform: rotate(4deg) translateY(-1px); }
}
@keyframes holiday-hat-bounce {
    0%, 100% { transform: rotate(-7deg); }
    26% { transform: scale(1.22, .85) rotate(-18deg) translateY(-3px); }
    56% { transform: scale(.94, 1.12) rotate(6deg) translateY(-4px); }
    80% { transform: scale(1.04, .97) rotate(-11deg); }
}
@keyframes holiday-snow-jiggle {
    0%, 100% { transform: translateY(0) scale(1); }
    28% { transform: translateY(2px) scale(1.015, .88); }
    60% { transform: translateY(-1.5px) scale(.99, 1.06); }
}
@keyframes holiday-pine-breeze { 50% { transform: rotate(-3deg); } }
@keyframes holiday-pine-rustle {
    28% { transform: rotate(-12deg) scale(1.06); }
    60% { transform: rotate(7deg) scale(.97); }
}
@keyframes holiday-bell-pendulum { 50% { transform: rotate(4deg); } }
@keyframes holiday-bell-ring {
    14% { transform: rotate(24deg); }
    30% { transform: rotate(-20deg); }
    48% { transform: rotate(15deg); }
    66% { transform: rotate(-10deg); }
    84% { transform: rotate(5deg); }
}
@keyframes holiday-bell-wave {
    0% { transform: scale(.6); opacity: .85; }
    100% { transform: scale(2.4); opacity: 0; }
}
@keyframes holiday-thanks-float { 50% { transform: translateY(-2px); } }
@keyframes holiday-glow {
    0%, 100% { box-shadow: 0 0 3px var(--holiday-glow); filter: brightness(1); }
    50% { box-shadow: 0 0 13px 3.5px var(--holiday-glow); filter: brightness(1.18); }
}
@keyframes holiday-chase {
    0%, 60%, 100% { transform: scale(.95); box-shadow: 0 0 2px var(--holiday-glow); }
    25% { transform: scale(1.16); box-shadow: 0 0 15px 4px var(--holiday-glow); }
}
