/* ============================================================
 * perf-anim.css — 移动端动画降级（解决首页滚动卡顿）
 * ------------------------------------------------------------
 * 根因：首页有 ~30 个无限循环装饰动画（浮动粒子 + 旗舰卡 conic-gradient
 * 边框旋转 + logo/图标扫光脉冲）+ 13 个 backdrop-filter 毛玻璃，
 * 移动端滚动时持续重绘，主线程/GPU 被占满 → 掉帧卡顿（实测 88ms/帧）。
 *
 * 策略：移动端（窄屏/触屏）关闭持续装饰动画 + 毛玻璃降级为不透明背景；
 *       桌面端完全保留（性能足够，高级感完整）。纯 CSS 渐进增强，零 JS。
 * ============================================================ */

@media (max-width: 768px), (pointer: coarse) {

  /* ---------- 1. 关闭首页装饰粒子（持续重绘，无功能意义） ---------- */
  div[style*="floatParticle"],
  div[style*="nftFloat"],
  .bp-particle,
  .nft-particle {
    animation: none !important;
    display: none !important;
  }

  /* ---------- 2. 关闭旗舰卡 conic-gradient 边框旋转 + 发光/扫光 ---------- */
  .nav-item.nav-flagship,
  .nav-item.nav-flagship .icon,
  .nav-item.nav-flagship .ns-label,
  .nav-item.nav-flagship .ns-badge {
    animation: none !important;
  }

  /* ---------- 3. 关闭侧边栏 logo 扫光 + 分区图标脉冲 ---------- */
  .sidebar-logo h1,
  .sidebar .nav-section .ns-icon {
    animation: none !important;
  }

  /* ---------- 4. backdrop-filter 毛玻璃 → 不透明（滚动时极贵） ---------- */
  .mobile-nav,
  .bottom-nav,
  #sidebar,
  .sidebar-overlay,
  #toast,
  .compliance-bar,
  .pn-overlay {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
  .mobile-nav,
  .bottom-nav {
    background: rgba(8, 6, 16, 0.97) !important;
  }
  #sidebar {
    background: #0a0812 !important;
  }
  .sidebar-overlay {
    background: rgba(6, 5, 11, 0.55) !important;
  }
  /* 浅色主题：移动端导航/侧边栏不透明背景改为浅色（id/class 高特异性压过暗色降级） */
  [data-wsc-theme="light"] .mobile-nav,
  [data-wsc-theme="light"] .bottom-nav {
    background: #ffffff !important;
  }
  [data-wsc-theme="light"] #sidebar {
    background: #ffffff !important;
  }
}

/* ---------- 全局：尊重系统「减弱动效」 ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001s !important;
  }
}
