/*!
 * 全站滚动体验修复（zaka）
 * 目的：解决部分页面/机型「内容超出屏幕却滑不动」「底部内容被导航挡住」的问题
 * 注意：只作用于带 .app-container 的普通页面，聊天页（chat / group_chat）是独立布局，不受影响
 */

/* 1. 容器不再自己当滚动条
   原来 .app-container 同时是 min-height:100vh 又 overflow-y:auto，
   在微信/QQ 内置浏览器、部分安卓浏览器里会生成一个"高度=内容"的假滚动容器，
   手指滑动时既滚不动容器也滚不动页面 —— 就是"页面看着有内容但滑不下去"。
   改成让页面本身（body/document）来滚动，所有机型行为一致。 */
.app-container {
  /* 注意：overflow-x:hidden + overflow-y:visible 会被浏览器算成 auto，
     所以这里必须先整体 visible，再用 clip 单独收横向（支持 clip 的内核才用） */
  overflow: visible !important;
  height: auto !important;
  max-height: none !important;
  -webkit-overflow-scrolling: touch;
}
@supports (overflow: clip) {
  .app-container {
    overflow-x: clip !important;
    overflow-y: visible !important;
  }
}

/* 2. 页面级惯性滚动 + 允许纵向回弹 */
body:has(.app-container) {
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: auto;
  touch-action: pan-y pinch-zoom;
}

/* 3. 底部导航不遮挡最后一屏内容 */
body:has(.bottom-nav) .app-container {
  padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)) !important;
}
body:has(.gd-actionbar) .app-container {
  padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px)) !important;
}

/* 4. 图片/表格不撑破布局（撑破后会出现横向滚动条，纵向跟着滑不动） */
.app-container img,
.app-container table,
.app-container pre {
  max-width: 100%;
}

/* 5. 浮层内部自己滚，不lock住整页 */
.app-container .filter-panel,
.app-container .switch-panel,
.app-container .detail-body,
.app-container .popup-body,
.app-container .sheet-body {
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

/* 6. iOS 底部安全区（有底部导航的页面） */
.bottom-nav {
  padding-bottom: env(safe-area-inset-bottom, 0px);
  height: auto !important;
  min-height: 50px;
}
