/* zodaccess 新版界面节日氛围（$_MT['zodaccess_festival'] = 'christmas' | 'mid_autumn'）。
 * 只在新版界面且配置为已知节日时由 include/global/head.tpl、include/auth/head.tpl 加载；作用域 body[data-za-festival]。
 * 装饰只作展示：不接收点击、不与猫耳星轨图重叠；关闭配置后本文件不加载。
 * 位图素材在 media/illustrations/festival/：浅色用白底 JPEG / 透明 PNG（正片叠底），深色用 *-dark.png（透明底、浅色墨线、保留彩色），
 * 由主题自带的 .theme-light-show / .theme-dark-show 切换，不再垫米白纸片。圣诞帽为内联 SVG，只叠在猫耳星轨图上，原图不变。
 */

/* ---- 首页欢迎卡：标题笔触换色（沿用原笔触形状） ---- */
body.za-user-ui[data-za-festival="christmas"] #za-home { --za-home-pink: #f4cfc8; }
html[data-bs-theme="dark"] body.za-user-ui[data-za-festival="christmas"] #za-home { --za-home-pink: #5c3a37; }
body.za-user-ui[data-za-festival="mid_autumn"] #za-home { --za-home-pink: #f6e2aa; }
html[data-bs-theme="dark"] body.za-user-ui[data-za-festival="mid_autumn"] #za-home { --za-home-pink: #5a4a28; }

/* ---- 首页欢迎卡：猫耳星轨图左侧的节日小插画（独立 flex 项，互不重叠） ---- */
body.za-user-ui #za-home .za-fest-scene { flex: 0 0 222px; width: 222px; height: 148px; margin-left: auto; pointer-events: none; }
body.za-user-ui #za-home .za-fest-scene img { display: block; width: 100%; height: 100%; object-fit: contain; }
body.za-user-ui #za-home .za-fest-scene img.theme-light-show { mix-blend-mode: multiply; }

/* ---- 圣诞：猫耳星轨图戴圣诞帽（首页深色时原图在米白纸片上，帽子沿用浅色配色；认证页深色原图为白线，帽子改浅色描边） ---- */
body.za-user-ui[data-za-festival="christmas"] #za-home .za-signal-mark, body.za-auth-ui[data-za-festival="christmas"] .za-auth-refined-art { position: relative; }
body .za-fest-hat { position: absolute; inset: 0; pointer-events: none; }
body .za-fest-hat svg { display: block; width: 100%; height: 100%; overflow: visible; }
body .za-fest-hat .hat-cone { fill: var(--za-hat-red, #d24e43); stroke: var(--za-hat-line, #1f1d1a); stroke-width: 12; stroke-linejoin: round; }
body .za-fest-hat .hat-fur { fill: var(--za-hat-fur, #fffdf8); stroke: var(--za-hat-line, #1f1d1a); stroke-width: 12; stroke-linejoin: round; }
body .za-fest-hat .hat-mark { fill: none; stroke: var(--za-hat-line, #1f1d1a); stroke-width: 9; stroke-linecap: round; stroke-linejoin: round; }
html[data-bs-theme="dark"] body.za-auth-ui .za-fest-hat { --za-hat-line: #e8e6e1; --za-hat-fur: #191919; --za-hat-red: #c9483e; }

/* ---- 首页欢迎卡：卡内飘落（雪点 / 桂花），位于内容之下 ---- */
body.za-user-ui[data-za-festival] #za-home .za-intro-card { position: relative; isolation: isolate; }
body.za-user-ui #za-home .za-fest-fall { position: absolute; inset: 0; overflow: hidden; border-radius: inherit; z-index: -1; pointer-events: none; }
body.za-user-ui #za-home .za-fest-fall i { position: absolute; top: 0; left: var(--x); width: var(--s); height: 100%; transform: translate3d(0, var(--y), 0); animation: za-fest-fall var(--t) linear var(--d) infinite; }
body.za-user-ui #za-home .za-fest-fall i::before { content: ""; display: block; width: var(--s); height: var(--s); border-radius: 50%; background: #b3c6d8; opacity: var(--o); animation: za-fest-sway calc(var(--t) / 3) ease-in-out var(--d) infinite alternate; }
html[data-bs-theme="dark"] body.za-user-ui #za-home .za-fest-fall i::before { background: #e8e6e1; opacity: calc(var(--o) * .7); }
body.za-user-ui[data-za-festival="mid_autumn"] #za-home .za-fest-fall i { width: calc(var(--s) * 1.8); }
body.za-user-ui[data-za-festival="mid_autumn"] #za-home .za-fest-fall i::before,
html[data-bs-theme="dark"] body.za-user-ui[data-za-festival="mid_autumn"] #za-home .za-fest-fall i::before {
    width: calc(var(--s) * 1.8); height: calc(var(--s) * 1.8); border-radius: 0; opacity: var(--o);
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cg fill='%23e3a23b'%3E%3Cellipse cx='5' cy='2.6' rx='1.7' ry='2.2'/%3E%3Cellipse cx='5' cy='7.4' rx='1.7' ry='2.2'/%3E%3Cellipse cx='2.6' cy='5' rx='2.2' ry='1.7'/%3E%3Cellipse cx='7.4' cy='5' rx='2.2' ry='1.7'/%3E%3C/g%3E%3Ccircle cx='5' cy='5' r='1.1' fill='%23b8741f'/%3E%3C/svg%3E") center / contain no-repeat;
}
@keyframes za-fest-fall { from { transform: translate3d(0, -6%, 0); } to { transform: translate3d(var(--dx, 0px), 100%, 0); } }
@keyframes za-fest-sway { from { transform: translateX(-3px) rotate(0deg); } to { transform: translateX(3px) rotate(160deg); } }

/* ---- 顶栏挂饰（用户页与认证页共用素材；只在宽屏空白处出现） ---- */
body.za-user-ui[data-za-festival] .app-header .za-topbar, body.za-auth-ui[data-za-festival] .za-auth-header { position: relative; }
body.za-user-ui .za-fest-topbar, body.za-auth-ui .za-fest-topbar { position: absolute; top: 0; width: 192px; height: 64px; pointer-events: none; }
/* 用户页居中在面包屑与右侧账户区之间（账户名长度不定，不从右侧定位）；认证页只有 Logo 与主题按钮 */
body.za-user-ui .za-fest-topbar { left: 50%; transform: translateX(-50%); }
body.za-auth-ui .za-fest-topbar { right: 150px; }
body[data-za-festival="christmas"] .za-fest-topbar { width: 337px; height: 48px; }
body.za-user-ui .za-fest-topbar img, body.za-auth-ui .za-fest-topbar img { display: block; width: 100%; height: 100%; object-fit: contain; object-position: center top; }
/* 深色：透明底浅色墨线版本，外加一点暖色微光 */
html[data-bs-theme="dark"] body .za-fest-topbar img { filter: drop-shadow(0 0 6px rgba(255, 190, 110, .28)); }

/* ---- 侧栏菜单下的小贴纸：紧凑高度，900px 高的屏幕无需滚动即可看到；随菜单滚动，不占用底部管理员入口 ---- */
body.za-user-ui .za-fest-sticker { display: flex; align-items: center; gap: 10px; margin: 8px 18px 0; padding: 10px 14px 2px; border-top: 1px dashed var(--za-user-line); }
body.za-user-ui .za-fest-sticker-art { flex: 0 0 36px; width: 36px; height: 36px; border-radius: 50%; overflow: hidden; }
body.za-user-ui .za-fest-sticker-art img { display: block; width: 100%; height: 100%; object-fit: contain; }
body.za-user-ui .za-fest-sticker-art img.theme-light-show { mix-blend-mode: multiply; }
body.za-user-ui .za-fest-sticker strong { display: block; font: 400 13px/1.4 "Songti SC", "STSong", "SimSun", serif; color: var(--za-user-ink); }
body.za-user-ui .za-fest-sticker small { display: block; margin-top: 2px; font-size: 11px; color: #817d76; }
html[data-bs-theme="dark"] body.za-user-ui .za-fest-sticker small { color: #a7a7a1; }

/* ---- 登录 / 注册 / 找回密码（A2） ---- */
body.za-auth-ui[data-za-festival] .za-auth-page { position: relative; }
body.za-auth-ui .za-fest-auth-tag { margin: -8px 0 -6px; font: 400 15px/1.5 "Songti SC", "STSong", "SimSun", serif; letter-spacing: .4px; text-align: center; }
body.za-auth-ui[data-za-festival="christmas"] .za-fest-auth-tag { color: #b23a31; }
body.za-auth-ui[data-za-festival="mid_autumn"] .za-fest-auth-tag { color: #8a5a12; }
html[data-bs-theme="dark"] body.za-auth-ui[data-za-festival="christmas"] .za-fest-auth-tag { color: #eaa59c; }
html[data-bs-theme="dark"] body.za-auth-ui[data-za-festival="mid_autumn"] .za-fest-auth-tag { color: #e9c96f; }
body.za-auth-ui .za-fest-auth-chip { display: none; align-items: center; margin-right: auto; margin-left: -8px; padding: 3px 10px; border: 1px solid; border-radius: 99px; font-size: 12px; line-height: 1.4; white-space: nowrap; }
body.za-auth-ui[data-za-festival="christmas"] .za-fest-auth-chip { color: #9e3129; background: #f8e3df; border-color: #efc6bf; }
body.za-auth-ui[data-za-festival="mid_autumn"] .za-fest-auth-chip { color: #7a4f0f; background: #f8edcf; border-color: #eed9a0; }
html[data-bs-theme="dark"] body.za-auth-ui[data-za-festival="christmas"] .za-fest-auth-chip { color: #eaa59c; background: #3a2826; border-color: #5c3a37; }
html[data-bs-theme="dark"] body.za-auth-ui[data-za-festival="mid_autumn"] .za-fest-auth-chip { color: #e9c96f; background: #3a3222; border-color: #5a4a28; }
body.za-auth-ui[data-za-festival] .za-auth-theme { white-space: nowrap; flex-shrink: 0; }
/* 页面左下角的节日小插画：只在两侧留白足够的宽屏出现，不压表单、品牌图与页脚 */
body.za-auth-ui .za-fest-corner { position: absolute; left: 28px; bottom: 64px; width: 240px; height: 160px; pointer-events: none; }
body.za-auth-ui .za-fest-corner img { display: block; width: 100%; height: 100%; object-fit: contain; }
body.za-auth-ui .za-fest-corner img.theme-light-show { mix-blend-mode: multiply; }

/* ---- 宽度规则：与用户外框（992px 抽屉）及认证外框（760px 单列）断点一致 ---- */
@media (min-width: 992px) {
    body.za-user-ui[data-kt-app-sidebar-minimize="on"] .app-sidebar:not(:hover) .za-fest-sticker { display: none; }
}
@media (min-width: 992px) and (max-width: 1180px), (max-width: 860px) {
    body.za-user-ui #za-home .za-fest-scene { display: none; }
}
@media (max-width: 1180px) {
    body.za-user-ui .za-fest-topbar, body.za-auth-ui .za-fest-topbar { display: none; }
}
@media (max-width: 1379px) {
    body.za-auth-ui .za-fest-corner { display: none; }
}
@media (max-width: 760px) {
    body.za-auth-ui .za-fest-auth-chip { display: inline-flex; }
}
@media (max-width: 360px) {
    body.za-auth-ui .za-fest-auth-chip { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    body.za-user-ui #za-home .za-fest-fall i, body.za-user-ui #za-home .za-fest-fall i::before { animation: none !important; }
}
