/* 底部广告开启时：内容区收缩、按比例缩放，避免右侧纵向滚动条 */

main.flex.h-full.overflow-hidden > main.flex-1.h-full.flex.flex-col.p-3.relative:has(
    > section.absolute.left-0.bottom-0.z-100
  ) {
  overflow: hidden !important;
  min-height: 0 !important;
  min-width: 0 !important;
  max-width: 100% !important;
  padding-bottom: 12px !important;
}

main.flex.h-full.overflow-hidden
  > main.flex-1.h-full.flex.flex-col.p-3.relative:has(
    > section.absolute.left-0.bottom-0.z-100
  )
  > section.overflow-y-auto {
  flex: 1 1 0 !important;
  min-height: 0 !important;
  height: auto !important;
  overflow-x: hidden !important;
  overflow-y: hidden !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

main.flex.h-full.overflow-hidden
  > main.flex-1.h-full.flex.flex-col.p-3.relative:has(
    > section.absolute.left-0.bottom-0.z-100
  )
  > section.absolute.left-0.bottom-0.z-100 {
  position: relative !important;
  left: auto !important;
  bottom: auto !important;
  flex-shrink: 0 !important;
  width: calc(100% + 24px) !important;
  margin-left: -12px !important;
  margin-right: -12px !important;
  margin-bottom: -12px !important;
}

/* 单 SKU：占满内容区高度并居中，超出时 JS 等比缩放 */
main.flex.h-full.overflow-hidden
  > main.flex-1.h-full.flex.flex-col.p-3.relative:has(
    > section.absolute.left-0.bottom-0.z-100
  )
  > section.overflow-y-auto
  .min-h-full:not(.flex-col) {
  min-height: 0 !important;
  height: 100% !important;
  max-height: 100% !important;
  box-sizing: border-box !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: visible !important;
}

/* 多列版：内容区占满并拉伸；外层不纵滚（表格在组件内部分配高度）
   须带 :has(广告) 才能压过同文件默认 section 的 center/hidden 特异性 */
main.flex.h-full.overflow-hidden
  > main.flex-1.h-full.flex.flex-col.p-3.relative:has(
    > section.absolute.left-0.bottom-0.z-100
  )
  > section.overflow-y-auto:has(.single-sku-columns-calculator),
main.flex.h-full.overflow-hidden
  > main.flex-1.h-full.flex.flex-col.p-3.relative:has(#roi-share-ad-slot)
  > section.overflow-y-auto:has(.single-sku-columns-calculator),
main.flex.h-full.overflow-hidden
  > main.flex-1.h-full.flex.flex-col.p-3.relative:has(> section.roi-share-fallback-ad)
  > section.overflow-y-auto:has(.single-sku-columns-calculator),
main.flex.h-full.overflow-hidden
  > main.flex-1.h-full.flex.flex-col.p-3.relative
  > section.overflow-y-auto:has(.single-sku-columns-calculator) {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  justify-content: flex-start !important;
  overflow-x: hidden !important;
  overflow-y: hidden !important;
}

/* 多 SKU：垂直居中，PC 不出现右侧纵向滚动条 */
main.flex.h-full.overflow-hidden
  > main.flex-1.h-full.flex.flex-col.p-3.relative:has(
    > section.absolute.left-0.bottom-0.z-100
  )
  > section.overflow-y-auto
  .min-h-full.flex-col:has(.msk-global-form) {
  min-height: 100% !important;
  height: auto !important;
  max-height: none !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
  margin-top: auto !important;
  margin-bottom: auto !important;
  overflow-x: hidden !important;
  overflow-y: visible !important;
}

/* 多 SKU：垂直居中，PC 不出现右侧纵向滚动条 */
main.flex.h-full.overflow-hidden
  > main.flex-1.h-full.flex.flex-col.p-3.relative:has(
    > section.absolute.left-0.bottom-0.z-100
  )
  > section.overflow-y-auto:has(.msk-global-form) {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  justify-content: flex-start !important;
  overflow-x: hidden !important;
  overflow-y: hidden !important;
}

/* 多列：根节点必须 height:100% + overflow:hidden，否则内部 ssc-card/table-shell 的 flex 会塌成只剩底部按钮 */
main.flex.h-full.overflow-hidden
  > main.flex-1.h-full.flex.flex-col.p-3.relative:has(
    > section.absolute.left-0.bottom-0.z-100
  )
  > section.overflow-y-auto
  .single-sku-columns-calculator,
main.flex.h-full.overflow-hidden
  > main.flex-1.h-full.flex.flex-col.p-3.relative
  > section.overflow-y-auto
  .single-sku-columns-calculator {
  min-height: 0 !important;
  height: 100% !important;
  max-height: 100% !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  justify-content: flex-start !important;
  overflow: hidden !important;
}
