/* =========================================================
   甜点电竞 · 天气瓶氛围特效（配合 od-weather-fx.js）
   晴：阳光光斑 + 蒲公英 + 指尖金光
   傍晚：随滚动变化的晚霞底 + 归鸟 + 导航栏风铃 + 余烬 + 飘落的叶子
   雨（方案 B）：大雨 + 积水涟漪 + 很淡的雾玻璃 + 水珠水痕（鼠标滑过即擦）+ 边缘水滴 + 卡片上沿水花 + 贴地低雾，无闪电
   主页和海克斯模拟页共用
   夜：星空连线 + 流星许愿 + 卡片月光描边
   ========================================================= */

/* ---------- 切换天气：整页交叉淡化（od-enhance.js 用 View Transition） ---------- */
::view-transition-old(root),::view-transition-new(root){animation-duration:.75s;animation-timing-function:cubic-bezier(.4,0,.2,1)}
/* 淡化期间新画面里的颜色直接是最终色（不再逐个元素过渡），天气图层照常慢慢淡入 */
html.od-wx-vt,html.od-wx-vt *{transition-property:opacity,visibility,transform!important}

/* ---------- 图层 ---------- */
.od-wfx-sky,.od-wfx-bg,.od-wfx-fg{position:fixed;inset:0;pointer-events:none;opacity:0;visibility:hidden;transition:opacity .6s var(--od-out,ease-out),visibility 0s .6s}
.od-wfx-sky,.od-wfx-bg{z-index:-1}
.od-wfx-fg{z-index:47}
.od-wfx-bg,.od-wfx-fg{display:block;width:100%;height:100%}
html[data-od-weather=dusk] .od-wfx-sky,
html[data-od-weather=day] .od-wfx-bg,
html[data-od-weather=day] .od-wfx-fg,
html[data-od-weather=dusk] .od-wfx-bg,
html[data-od-weather=night] .od-wfx-bg,
html[data-od-weather=dusk] .od-wfx-fg,
html[data-od-weather=rain] .od-wfx-bg,
html[data-od-weather=rain] .od-wfx-fg{opacity:1;visibility:visible;transition:opacity .6s var(--od-out,ease-out),visibility 0s}
/* ---------- 傍晚：晚霞底（--p = 滚动进度 0~1） ---------- */
.od-wfx-sky{contain:strict}
.od-wfx-sky>i{position:absolute;inset:0;will-change:opacity}
.od-sky-a{background:linear-gradient(180deg,#f8cfb8 0%,#f6dccc 30%,#f3e1d6 60%,#f4e5dc 100%)}
.od-sky-b{background:linear-gradient(180deg,#dfc6de 0%,#e9d5e4 32%,#efe1ea 62%,#f2e6ed 100%);opacity:var(--p,0)}
.od-wfx-sky>.od-sky-sun{inset:auto;left:66%;top:12vh;width:300px;height:300px;margin:-150px 0 0 -150px;border-radius:50%;
  background:radial-gradient(closest-side,#ffe6c4cc,#ffd2a866 30%,#ffc09a26 60%,transparent);
  translate:0 calc(var(--p,0) * 64vh);opacity:calc(1 - var(--p,0) * .5);will-change:translate,opacity}
.od-sky-sun::after{content:'';position:absolute;left:50%;top:50%;width:40px;height:40px;margin:-20px;border-radius:50%;background:radial-gradient(circle at 42% 40%,#ffe9c8,#f5a98c)}
.od-wfx-sky>.od-sky-stars{
  background-image:radial-gradient(1.3px 1.3px at 22px 34px,#fff,transparent),radial-gradient(1px 1px at 128px 92px,#fff,transparent),radial-gradient(1.5px 1.5px at 206px 44px,#fffbea,transparent),radial-gradient(1px 1px at 76px 140px,#fff,transparent);
  background-size:260px 170px;opacity:max(0,calc((var(--p,0) - .6) * 2.2));
  -webkit-mask-image:linear-gradient(#000,transparent 60%);mask-image:linear-gradient(#000,transparent 60%)}

/* ---------- 傍晚：风铃 ---------- */
.od-chime{display:none;flex:none;align-self:flex-start;width:28px;height:52px;margin:-6px 2px 0 0;padding:0;border:0;background:none;box-shadow:none;cursor:pointer;color:var(--od-ink-soft,#7a5c63)}
html[data-od-weather=dusk] .od-chime{display:block}
.od-chime svg{display:block;width:100%;height:100%;overflow:visible}
.od-chime-sw{transform-box:view-box;transform-origin:14px 8px}
.od-chime:hover{color:var(--coral)}
.od-chime:focus-visible{outline:3px solid var(--coral);outline-offset:2px;border-radius:8px}
.od-chime.ring .od-chime-sw{animation:odChimeRing 1.6s var(--od-out,ease-out)}
.od-chime.breeze .od-chime-sw{animation:odChimeBreeze 1.4s var(--od-out,ease-out)}
@keyframes odChimeRing{10%{rotate:16deg}28%{rotate:-12deg}46%{rotate:8deg}64%{rotate:-5deg}82%{rotate:2deg}}
@keyframes odChimeBreeze{20%{rotate:-7deg}50%{rotate:4deg}78%{rotate:-2deg}}

/* ---------- 晴：阳光场景图层（窗边光束 + 纱帘云影；只在晴天显示）。注意 body 是 isolation:isolate，下面写的混合模式实际不起作用，等于普通叠加 ---------- */
.od-sunfx{position:fixed;inset:0;z-index:47;pointer-events:none;overflow:hidden;opacity:0;visibility:hidden;transition:opacity .9s var(--od-out,ease-out),visibility 0s .9s}
html[data-od-weather=day] .od-sunfx.on{opacity:var(--o,1);visibility:visible;transition:opacity .9s var(--od-out,ease-out),visibility 0s}
.od-sunfx-l{position:absolute;left:-10%;top:-10%;width:120%;height:120%;display:block;will-change:transform}
/* 阳光从右上照来（和全站卡片的凸起阴影同一个方向）：晴天里卡片、面板、按钮多一道往左下投的长影子，有立体感 */
html[data-od-weather=day]{
  --od-cast:-20px 26px 34px -12px rgba(122,88,60,.24);
  --od-cast-sm:-6px 9px 14px -6px rgba(122,88,60,.16);
  --raised:var(--od-lx) var(--od-ly) 19px var(--od-sh-d),calc(var(--od-lx) * -1) calc(var(--od-ly) * -1) 19px var(--od-sh-l),var(--od-cast);
  --od-raised-md:calc(var(--od-lx) * .57) calc(var(--od-ly) * .57) 10px var(--od-sh-d),calc(var(--od-lx) * -.57) calc(var(--od-ly) * -.57) 10px var(--od-sh-l),var(--od-cast-sm);
  --od-raised-sm:calc(var(--od-lx) * .43) calc(var(--od-ly) * .43) 8px var(--od-sh-d),calc(var(--od-lx) * -.43) calc(var(--od-ly) * -.43) 8px var(--od-sh-l),var(--od-cast-sm)}
/* 窗边光束：在内容后面，只落在页面底色上。光束外很淡的暗（正片叠底）+ 光束里的光（滤色：只会提亮，不会染成黄色色块） */
.od-sunfx-shade{z-index:-1;mix-blend-mode:multiply;--o:.12;will-change:transform}
.od-sunfx-glow{z-index:-1;mix-blend-mode:screen;--o:.9;will-change:transform}
.od-sunfx-shade .od-sunfx-l,.od-sunfx-glow .od-sunfx-l{left:-12%;top:-12%;width:124%;height:124%}
/* 海克斯模拟页以抽卡为主：窗光再淡一些，只当陪衬 */
.hx-simulator .od-sunfx-glow{--o:.62}
.hx-simulator .od-sunfx-shade{--o:.08}
/* 晴 · 纱帘 + 云影：光层外面套一层条纹遮罩（褶皱，左右摆）；云影时光层变淡、暗层铺一层同色补上光斑（页面 body 是 isolation:isolate，混合模式不起作用，所以都用普通叠加） */
.od-sunfx-sway{position:absolute;will-change:transform,opacity}
.od-sunfx-sway>.od-sunfx-l{position:absolute}
.od-sunfx-fill{position:absolute;inset:-12%;background:rgb(120 88 62);opacity:0;will-change:opacity}

/* ---------- 雨：积水面 + 玻璃雾（各自一个图层，在前景画布下面；雾只在变化时更新，不用每帧重画整屏） ---------- */
.od-wfx-pool,.od-wfx-fog{position:fixed;left:0;pointer-events:none;z-index:47;opacity:0;visibility:hidden;transition:opacity .6s var(--od-out,ease-out),visibility 0s .6s}
.od-wfx-fog{top:0;width:100%;height:100%;display:block}
.od-wfx-pool{right:0;bottom:0;height:174px;background:linear-gradient(rgba(150,178,184,0),rgba(150,178,184,.16) 30%,rgba(120,150,158,.3))}
html[data-od-weather=rain] :is(.od-wfx-pool,.od-wfx-fog){opacity:1;visibility:visible;transition:opacity .6s var(--od-out,ease-out),visibility 0s}

/* ---------- 雨：贴地的低雾（两层大柔光，只做 transform 平移，不触发重画） ---------- */
.od-wfx-mist{position:fixed;left:0;right:0;bottom:0;height:42vh;z-index:-1;pointer-events:none;overflow:hidden;contain:strict;opacity:0;visibility:hidden;transition:opacity .9s var(--od-out,ease-out),visibility 0s .9s}
html[data-od-weather=rain].wfx-rain-a .od-wfx-mist{opacity:1;visibility:visible;transition:opacity .9s var(--od-out,ease-out),visibility 0s}
.od-wfx-mist>i{position:absolute;left:-30%;width:160%;height:100%;bottom:-8%;will-change:transform;
  background:radial-gradient(28% 46% at 18% 78%,rgba(238,244,242,.62),transparent 70%),radial-gradient(32% 40% at 52% 88%,rgba(232,240,238,.5),transparent 72%),radial-gradient(26% 44% at 84% 80%,rgba(240,246,244,.56),transparent 70%)}
.od-wfx-mist>i+i{bottom:-16%;opacity:.75;background:radial-gradient(30% 40% at 30% 86%,rgba(226,236,234,.55),transparent 70%),radial-gradient(34% 46% at 70% 84%,rgba(236,243,241,.5),transparent 72%)}
html[data-od-weather=rain] .od-wfx-mist>i{animation:odMist 46s ease-in-out infinite alternate}
html[data-od-weather=rain] .od-wfx-mist>i+i{animation-duration:63s;animation-direction:alternate-reverse}
@keyframes odMist{from{transform:translate3d(-7%,0,0)}to{transform:translate3d(7%,0,0)}}
html.od-bg-paused .od-wfx-mist>i{animation-play-state:paused}

/* ---------- 雨：画布已经画了雨，关掉光层里旧的静态雨丝和薄雾，避免叠两层 ---------- */
html[data-od-weather=rain] .od-light>:is(.od-l-rain,.od-l-mist){opacity:0!important;visibility:hidden!important;animation:none!important}

/* ---------- 夜：卡片月光描边（--g 0~1，离鼠标越近越亮） ---------- */
html[data-od-weather=night] .od-mg.od-mg{box-shadow:0 0 0 1px rgb(236 232 255 / calc(.16 + var(--g,0) * .5)),0 0 calc(6px + var(--g,0) * 18px) rgb(206 198 255 / calc(.1 + var(--g,0) * .38)),0 8px 18px #0a0b1c55}

/* ---------- 夜：许愿气泡 ---------- */
.od-wish{position:fixed;left:0;top:0;z-index:420;margin:0;padding:8px 16px;border-radius:999px;background:#3d4163;color:#f3f1fb;font-size:14px;font-weight:600;line-height:1.4;white-space:nowrap;box-shadow:0 0 0 1px #ffffff40,0 0 20px #e4e0ff66;pointer-events:none;opacity:0;translate:-50% -110%;transition:opacity .2s var(--od-out,ease-out),translate .2s var(--od-out,ease-out)}
.od-wish.show{opacity:1;translate:-50% -140%}

@media(prefers-reduced-motion:reduce){
  .od-chime .od-chime-sw{animation:none!important}
  .od-wfx-sky,.od-wfx-bg,.od-wfx-fg,.od-wish,.od-wfx-mist,.od-wfx-pool,.od-wfx-fog{transition:none}
  .od-wfx-mist>i{animation:none!important}
}

/* 晴 · 更华丽的一层（11-29 定稿：日晕 + 棱镜虹彩，od-weather-fx.js 的 sunLux）。
   日晕、斜光、彩虹光斑在内容后面（只照在页面底色上，主视觉和卡片不会被染色）；内容上面只有跟着光标的一小串光斑。
   全部是预先画好的小贴图，只做 transform / opacity（合成线程），平时不跑脚本、不重画 */
.od-sunfx-lux{--o:1}
.od-sunfx-luxback{z-index:-1}
.od-sunfx-luxfront{z-index:47}
.od-sunfx-lux>*{position:absolute;pointer-events:none}
/* 日晕和斜光：512px 的小图放大到 110vmax，贴着右上角 */
.od-sunfx-lux .lx-core,.od-sunfx-lux .lx-rays{right:0;top:0;width:110vmax;height:110vmax;transform-origin:100% 0;will-change:transform,opacity}
.od-sunfx-lux .lx-core{opacity:.7;animation:odLuxBreath 6.5s ease-in-out infinite}
@keyframes odLuxBreath{0%,100%{transform:scale(.93);opacity:.56}50%{transform:scale(1.05);opacity:.78}}
.od-sunfx-lux .lx-rays{opacity:.55;animation:odLuxRay 19s ease-in-out infinite alternate}
.od-sunfx-lux .lx-rays-2{opacity:.4;animation:odLuxRay2 27s ease-in-out infinite alternate}
@keyframes odLuxRay{from{transform:rotate(-4deg)}to{transform:rotate(5deg)}}
@keyframes odLuxRay2{from{transform:rotate(7deg) scale(1.1)}to{transform:rotate(-6deg) scale(1.1)}}
/* 彩虹光斑（11-29 第三轮）：固定位置、平时透明；光标的光照到才慢慢浮现（透明度由脚本按距离写），浮现时从稍小、稍糊变清楚，走开再慢慢淡回去 */
.od-sunfx-lux .lx-band{background-size:100% 100%;rotate:var(--r);opacity:0;scale:.9;filter:blur(3px);will-change:transform,opacity;
  transition:opacity 1.1s cubic-bezier(.3,.6,.3,1),scale 1.4s cubic-bezier(.2,.7,.2,1),filter 1.2s ease-out;
  animation:odLuxDrift 30s ease-in-out infinite alternate}
.od-sunfx-lux .lx-band.lit{scale:1;filter:none;transition-duration:.9s,1.1s,.9s}
@keyframes odLuxDrift{from{translate:0 0}to{translate:var(--dx) var(--dy)}}
/* 跟着光标的光斑：位置由脚本在鼠标移动时写一次，滑过去的过程由过渡补（离光标越近过渡越短，写在元素上）。
   光标在主视觉上时整串淡到很淡（不挡主视觉），离开页面时淡出 */
html[data-od-weather=day] .od-sunfx-luxfront.on{transition:opacity .45s ease-out,visibility 0s}
html[data-od-weather=day] .od-sunfx-luxfront.on.lx-dim{opacity:calc(var(--o,1) * .28)}
html[data-od-weather=day] .od-sunfx-luxfront.on.lx-away{opacity:0}
.od-sunfx-lux .lx-ghost{left:0;top:0;background-size:100% 100%;will-change:transform;transition-property:transform;transition-timing-function:cubic-bezier(.2,.75,.25,1)}
html.od-bg-paused .od-sunfx-lux>*{animation-play-state:paused}
@media(prefers-reduced-motion:reduce){.od-sunfx-lux>*{animation:none!important;transition:none}.od-sunfx-luxfront{display:none}}

/* 12-05 晚 触屏（手机 / 平板）：窗光两层不用混合模式、不常驻显卡层（iPhone 微信滑动时内容变空白、页面重载） */
@media (hover:none),(pointer:coarse){
.od-sunfx,.od-sunfx-l,.od-sunfx-shade,.od-sunfx-glow{will-change:auto!important;transform:none!important}
.od-sunfx-shade{mix-blend-mode:normal;--o:.07}
.od-sunfx-glow{mix-blend-mode:normal;--o:.42}
.od-sunfx-sway,.od-sunfx-lux,.od-l-beam{display:none!important}
}
