/**
 * Nexthink ERP — 微信内置浏览器 / iOS Android WebKit 兼容层
 * 解决 backdrop-filter、background-attachment:fixed、多层 fixed 伪元素等导致的整页白屏。
 * 随 base.html 与各独立登录页引入；断点与 base 内联样式协同。
 */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

@media screen and (max-width: 1028px) {
  html,
  body {
    overflow-x: hidden;
    max-width: 100%;
  }

  body {
    background-attachment: scroll !important;
    background-image: none !important;
    background-color: #070d18 !important;
  }

  body::before,
  body::after {
    display: none !important;
    content: none !important;
  }

  /* 毛玻璃在部分 WebKit 上会触发 compositor 崩溃 → 一律关闭 */
  *,
  *::before,
  *::after {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  /* 半透明卡片改为实色底（保证对比度） */
  .card,
  .stat-card,
  .product-card,
  .wms-card,
  .logistics-card,
  .inventory-card,
  .orders-card,
  .system-card,
  .login-card,
  .tech-card,
  .inner-panel,
  .bg-light,
  .box {
    background: rgba(32, 36, 44, 0.97) !important;
  }

  .header {
    background: rgba(5, 14, 36, 0.99) !important;
  }

  .module-sidebar,
  .product-sidebar,
  .wms-sidebar,
  .system-sidebar,
  .logistics-sidebar,
  .inventory-sidebar,
  .orders-sidebar {
    background: linear-gradient(
      180deg,
      rgba(8, 16, 40, 0.99) 0%,
      rgba(6, 12, 32, 0.99) 100%
    ) !important;
  }

  /* 首页区块 */
  .mini,
  .promo,
  .todo-grid,
  .banner,
  .index-hero {
    background: rgba(28, 32, 40, 0.95) !important;
  }

  /* 管理后台独立布局 */
  .layout {
    flex-direction: column !important;
  }

  .layout > .sidebar {
    width: 100% !important;
    max-height: 260px;
    border-right: none !important;
    border-bottom: 1px solid rgba(93, 212, 224, 0.15);
    background: rgba(8, 16, 40, 0.99) !important;
  }

  .main-wrap {
    padding: 14px 12px !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* 内联写了 backdrop-filter 的遮罩（采集箱弹窗等） */
  [style*="backdrop-filter"] {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
}
