/**
 * 移动端性能降温：暂停不可见层动画、降低 GPU 合成开销，不影响功能与交互。
 * 配合 html.is-mobile / html.is-low-end（index.html 注入）分级生效。
 */

html.miya-tab-hidden *,
html.miya-tab-hidden *::before,
html.miya-tab-hidden *::after {
  animation-play-state: paused !important;
}

.miya-mode-layer:not(.is-active) *,
.miya-mode-layer:not(.is-active) *::before,
.miya-mode-layer:not(.is-active) *::after {
  animation-play-state: paused !important;
}

body.miya-app-open .phone__wall,
body.miya-app-open .phone__wall *,
body.miya-app-open .desk-shell,
body.miya-app-open .desk-shell * {
  animation-play-state: paused !important;
}

[hidden] *,
[hidden] *::before,
[hidden] *::after {
  animation-play-state: paused !important;
}

/* 非活跃玩法层跳过绘制（切换过渡时 is-leaving 仍保留） */
.miya-mode-layer:not(.is-active):not(.is-leaving) {
  content-visibility: hidden;
  contain: layout style paint;
}

/* ── 移动端：降低合成与毛玻璃开销 ── */

html.is-mobile body.miya-app-open .phone {
  filter: saturate(0.94) brightness(0.97) !important;
}

html.is-mobile .glass {
  backdrop-filter: blur(16px) saturate(1.08) !important;
  -webkit-backdrop-filter: blur(16px) saturate(1.08) !important;
}

html.is-mobile .wg-player:not(.has-custom-player-bg) {
  backdrop-filter: blur(14px) saturate(1.05) !important;
  -webkit-backdrop-filter: blur(14px) saturate(1.05) !important;
}

html.is-mobile .phone__snow,
html.is-mobile .phone__curtain {
  filter: none !important;
}

html.is-mobile .wg-player__grain {
  opacity: 0.12 !important;
}

html.is-mobile .wg-player__orb {
  filter: blur(16px) !important;
}

html.is-mobile .qq-room__head,
html.is-mobile .qq-room__foot {
  backdrop-filter: blur(12px) saturate(1.12) !important;
  -webkit-backdrop-filter: blur(12px) saturate(1.12) !important;
}

html.is-mobile :is(
  .fr-back,
  .fr-nav__bar,
  .fr-compose__veil,
  .fr-note-editor__head
) {
  backdrop-filter: blur(10px) saturate(1.08) !important;
  -webkit-backdrop-filter: blur(10px) saturate(1.08) !important;
}

html.is-mobile :is(
  .ins-atelier-rail,
  .ins-vault-topbar,
  .ncm-mini-player,
  .miya-dialog-backdrop,
  .miya-dialog-card
) {
  backdrop-filter: blur(10px) saturate(1.06) !important;
  -webkit-backdrop-filter: blur(10px) saturate(1.06) !important;
}

html.is-mobile .desk--p1,
html.is-mobile .desk--p2,
html.is-mobile .desk--p3,
html.is-mobile .qq-room-scroll,
html.is-mobile .ncm-scroll,
html.is-mobile .sim-root {
  contain: layout style;
}

/* ── 关闭纯装饰性无限动画（保留播放/状态类核心反馈） ── */

html.is-mobile.is-low-end .wg-player__orb,
html.is-mobile.is-low-end .wg-player__scan,
html.is-mobile.is-low-end .wg-player__ring,
html.is-mobile.is-low-end .wg-player__marquee span,
html.is-mobile.is-low-end .wg-polaroid__card--1,
html.is-mobile.is-low-end .ins-atelier-orb,
html.is-mobile.is-low-end .mdl__aurora,
html.is-mobile.is-low-end .mdl__scan,
html.is-mobile.is-low-end .mdl__frame::before,
html.is-mobile.is-low-end .mc-room-deco__grain {
  animation: none !important;
}

html.is-mobile.is-low-end .mc-room-deco {
  opacity: 0.35;
}

html.is-mobile .fr-orb {
  filter: blur(24px);
}

html.is-mobile.is-low-end .fr-orb {
  filter: blur(16px);
  opacity: 0.65;
}

html.is-mobile.is-low-end .glass,
html.is-mobile.is-low-end .wg-player:not(.has-custom-player-bg),
html.is-mobile.is-low-end .qq-room__head,
html.is-mobile.is-low-end .qq-room__foot {
  backdrop-filter: blur(8px) saturate(1.04) !important;
  -webkit-backdrop-filter: blur(8px) saturate(1.04) !important;
}
