/* ============================================================================
   scroll_injection_fix.css  v1
   修复「全局注入等长页面内容被裁剪、无法滚动」根因（站点 gugu8858.icu）
   ----------------------------------------------------------------------------
   根因（已用真实浏览器验证）：
   pagination_bottom.css 用选择器
     .ant-layout-content > div:has(> div[style*="repeat(auto-fill"]) > div:last-child
   把「含 repeat(auto-fill) 网格的 div 的最后一个子元素」钉成 position:fixed。
   - 在 dashboard 页，该 :last-child 是分页栏（小元素），钉到视口底部是「设计本意」。
   - 但在全局注入页，卡片网格自身（内联 style 含 repeat(auto-fill)）就是该 :last-child，
     于是整个 10976px 网格被整体钉成 position:fixed → 移出文档流 → main.scrollHeight
     恒等于 clientHeight=844，永远无可滚动距离，滚轮/滚动条失效，内容被静默裁掉。
   （此前只改 overflow/高度无法解决，因为固定定位元素不参与父级滚动高度。）

   修复（最小改动，已注入验证）：
   1) 仅当 :last-child 自身内联 style 含 "repeat(auto-fill"（即卡片网格本身）时改回
      position:static，恢复普通文档流，让网格撑开内容高度。
      该写法不会误伤 dashboard —— 其 :last-child 是分页栏，内联 style 不含
      "repeat(auto-fill"。
   2) 让 .ant-layout-content 成为「内容视口高度」的可滚动容器（顶栏 56px 以下整块），
      这样页面不再整体膨胀，而是 content 区自身滚动，侧栏/顶栏保持固定。

   验证结果（1600x900 真实 Chrome）：
       修复前  main clientH=844 scrollH=844  scrollable=false  wheel600 scrollTop=0
       修复后  main clientH=844 scrollH=11251 scrollable=true  wheel600 scrollTop=600
              滚到底 scrollTop=10407=scrollH-clientH（网格 10976px 底部可达）
       侧栏不动（top 恒 56），document scrollHeight 恒 900，无横向滚动。
   ========================================================================== */

/* 1) 把「卡片网格」从 position:fixed 改回普通文档流，恢复内容高度 */
html body:has(.brand-lockup) .ant-layout-content > div:has(> div[style*="repeat(auto-fill"]) > div:last-child[style*="repeat(auto-fill"] {
  position: static !important;
  top: auto !important;
  bottom: auto !important;
  left: auto !important;
  right: auto !important;
  z-index: auto !important;
  margin-top: 0 !important;
  background: transparent !important;
  border: none !important;
  border-top: none !important;
  box-shadow: none !important;
}

/* 2) 内容区成为内容视口高度的可滚动容器（顶栏 56px 以下整块），侧栏/顶栏保持固定 */
html body:has(.brand-lockup) .ant-layout-content {
  height: calc(100vh - 56px) !important;
  max-height: calc(100vh - 56px) !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
}
