/* ============================================================
   gcmod-dialog.css — 弹窗滚动修复（独立文件，勿并入 gcmod-fix.css！）
   原因：gcmod-fix.css 会被并行的 UI 定制会话整体重写，追加的规则
   反复丢失（2026-10-03/04 两次被抹）。本文件独立存在即免疫。
   注入：smai-spa/index.html <link> + nginx 443 sub_filter 双通道。
   ============================================================ */

/* 订阅套餐等弹窗（/console/plan）：内容超出 max-h 时允许纵向滚动，
   否则底部「立即支付」按钮被裁掉且无法下滑。
   其他弹窗组件自带 overflow-y-auto，此规则对它们为 no-op。 */
[role='dialog'] {
  overflow-y: auto !important;
  overscroll-behavior: contain;
}

/* 站点图标统一兜底（原 gcmod-fix.css 第 11 段被覆盖丢失，迁入本文件）：
   防 SPA 重建后 brightness-0 滤镜类回归导致浅色模式图标被涂黑。 */
img[src='/zc.gcmod.cn.png'],
img[src='/smai-ui/assets/GcmodAi.png'] {
  filter: none !important;
}

/* Keep console breadcrumbs on one line on narrow screens. */
@media (max-width: 767px) {
  header:has([data-sidebar='trigger']) > nav {
    min-width: 0;
    flex: 1 1 auto;
    white-space: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    overscroll-behavior-x: contain;
  }
  header:has([data-sidebar='trigger']) > nav::-webkit-scrollbar { display: none; }
  header:has([data-sidebar='trigger']) > nav > div,
  header:has([data-sidebar='trigger']) > nav > div > * { flex-shrink: 0; white-space: nowrap; }
  header:has([data-sidebar='trigger']) > [data-sidebar='trigger'],
  header:has([data-sidebar='trigger']) > .flex-1 { flex-shrink: 0; }

  /* Allow vertical touch scrolling inside the console content shell and plan modal. */
  .h-full.min-h-0.overflow-y-auto,
  [role='dialog'] {
    touch-action: pan-y !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
  }
  [role='dialog'] {
    max-height: calc(100dvh - 2rem) !important;
    overflow-y: auto !important;
  }
}
