/* D4P-R1: iPhone/iPad 主屏幕模式常驻发热专项
   只定格登录与首页长期无限循环的大面积背景动画。
   不删除渐变、毛玻璃、阴影、按钮反馈或弹窗动画。 */
@supports (-webkit-touch-callout: none) {
  @media (display-mode: standalone) {
    body,
    .app::before,
    .app::after,
    #assetsView main.content::before,
    #assetsView .hero,
    #assetsView .hero::before {
      animation: none !important;
      animation-play-state: paused !important;
    }

    body,
    #assetsView main.content::before,
    #assetsView .hero {
      background-position: 50% 50% !important;
    }

    .app::before,
    .app::after,
    #assetsView .hero::before {
      will-change: auto !important;
    }
  }
}

/* D4P-R2: 继续只冻结主屏幕模式下的长期背景流动，不改交互动画 */
@supports (-webkit-touch-callout: none) {
  @media (display-mode: standalone) {
    body.check-home [data-wallet-page="assets"]::before,
    body.check-home [data-wallet-page="assets"]::after,
    body.check-finance [data-wallet-page="finance"]::before,
    body.check-finance [data-wallet-page="finance"]::after,
    body.check-accounts [data-wallet-page="accounts"]::before,
    body.check-profile [data-wallet-page="profile"]::before {
      animation: none !important;
      animation-play-state: paused !important;
    }
  }
}

/* D4P-R37: iOS home-screen thermal calm layer. */
@supports (-webkit-touch-callout: none) {
  @media (display-mode: standalone) {
    .screen.active,
    .view-container.active,
    .sheet-bg.open,
    .finance-board-overlay.is-open {
      animation: none !important;
      transition-duration: 120ms !important;
    }

    .app::before,
    .app::after,
    body.check-home [data-wallet-page="assets"]::before,
    body.check-home [data-wallet-page="assets"]::after,
    body.check-finance [data-wallet-page="finance"]::before,
    body.check-finance [data-wallet-page="finance"]::after,
    #assetsView .hero::before,
    #assetsView .hero::after,
    .finance-v9-hero::before,
    .finance-v9-hero::after,
    .unified-top-card::before,
    .unified-top-card::after {
      animation: none !important;
      filter: none !important;
      transform: none !important;
      will-change: auto !important;
    }

    .sheet-bg,
    .sheet,
    .wallet-bottom-nav,
    .finance-board-overlay,
    .finance-board-overlay-inner,
    .finance-v9-card,
    .finance-v9-section,
    .finance-v9-tool,
    .finance-v9-market-tabs,
    .asset-card,
    .service-card,
    .profile-card,
    .bill-v5-card,
    .bill-v5-summary {
      backdrop-filter: none !important;
      -webkit-backdrop-filter: none !important;
    }

    .sheet-bg {
      background: rgba(15, 23, 42, 0.28) !important;
    }

    .sheet,
    .finance-board-overlay-inner {
      background: rgba(248, 250, 252, 0.98) !important;
    }

  }
}

html.standalone-pwa-mode .screen.active,
html.standalone-pwa-mode .view-container.active,
html.standalone-pwa-mode .sheet-bg.open,
html.standalone-pwa-mode .finance-board-overlay.is-open {
  animation: none !important;
  transition-duration: 120ms !important;
}

html.standalone-pwa-mode .sheet-bg,
html.standalone-pwa-mode .sheet,
html.standalone-pwa-mode .wallet-bottom-nav,
html.standalone-pwa-mode .finance-board-overlay,
html.standalone-pwa-mode .finance-board-overlay-inner,
html.standalone-pwa-mode .finance-v9-card,
html.standalone-pwa-mode .finance-v9-section,
html.standalone-pwa-mode .finance-v9-tool,
html.standalone-pwa-mode .finance-v9-market-tabs,
html.standalone-pwa-mode .asset-card,
html.standalone-pwa-mode .service-card,
html.standalone-pwa-mode .profile-card,
html.standalone-pwa-mode .bill-v5-card,
html.standalone-pwa-mode .bill-v5-summary {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/* Native WKWebView does not satisfy CSS display-mode: standalone even when
   navigator.standalone is exposed by the shell. Mirror the PWA thermal rules
   explicitly for the native shell marker injected at document start. */
html[data-cb-native-shell="ios"] body,
html[data-cb-native-shell="ios"] .app::before,
html[data-cb-native-shell="ios"] .app::after,
html[data-cb-native-shell="ios"] #assetsView main.content::before,
html[data-cb-native-shell="ios"] #assetsView .hero,
html[data-cb-native-shell="ios"] #assetsView .hero::before,
html[data-cb-native-shell="ios"] body.check-home [data-wallet-page="assets"]::before,
html[data-cb-native-shell="ios"] body.check-home [data-wallet-page="assets"]::after,
html[data-cb-native-shell="ios"] body.check-finance [data-wallet-page="finance"]::before,
html[data-cb-native-shell="ios"] body.check-finance [data-wallet-page="finance"]::after,
html[data-cb-native-shell="ios"] body.check-accounts [data-wallet-page="accounts"]::before,
html[data-cb-native-shell="ios"] body.check-profile [data-wallet-page="profile"]::before,
html[data-cb-native-shell="ios"] .screen.active,
html[data-cb-native-shell="ios"] .view-container.active,
html[data-cb-native-shell="ios"] .sheet-bg.open,
html[data-cb-native-shell="ios"] .finance-board-overlay.is-open,
html[data-cb-native-shell="ios"] .finance-v9-hero::before,
html[data-cb-native-shell="ios"] .finance-v9-hero::after,
html[data-cb-native-shell="ios"] .unified-top-card::before,
html[data-cb-native-shell="ios"] .unified-top-card::after {
  animation: none !important;
  animation-play-state: paused !important;
  will-change: auto !important;
}

html[data-cb-native-shell="ios"] .app::before,
html[data-cb-native-shell="ios"] .app::after,
html[data-cb-native-shell="ios"] #assetsView .hero::before,
html[data-cb-native-shell="ios"] #assetsView .hero::after,
html[data-cb-native-shell="ios"] .finance-v9-hero::before,
html[data-cb-native-shell="ios"] .finance-v9-hero::after,
html[data-cb-native-shell="ios"] .unified-top-card::before,
html[data-cb-native-shell="ios"] .unified-top-card::after {
  filter: none !important;
  transform: none !important;
}

html[data-cb-native-shell="ios"] body,
html[data-cb-native-shell="ios"] #assetsView main.content::before,
html[data-cb-native-shell="ios"] #assetsView .hero {
  background-position: 50% 50% !important;
}
