/* layout-fix · 成品布局纠偏 v2（后加载） */
*,*::before,*::after{box-sizing:border-box}
html{max-width:100%;overflow-x:clip;scroll-behavior:smooth}
body{
  margin:0!important;
  max-width:100%!important;
  overflow-x:clip!important;
  min-height:100vh;
  line-height:1.55;
  -webkit-text-size-adjust:100%;
}
img,video,svg,canvas{max-width:100%;height:auto;display:block}
video{width:100%;background:#000}
iframe{max-width:100%}

:root{--lf-max:1200px;--lf-pad:20px}

/* 顶栏本身通栏；内部容器与主区同宽同边距 */
header,.site-header,.div-header,.div-topbar,.cb-header,.mg-head,.tw-head,.tw-header,
.hc-head,.hc-header,.nc-head,.nc-header,.lp-head,.lp-header,.pop-header,
.mg-site header,.pop-site header,.cpop-site header,.body-lp header,.body-mg header,
.hc-body header,.nc-body header,.tw-body header,.mg-site > header{
  width:100%!important;
  max-width:100%!important;
  left:auto!important;
  right:auto!important;
  margin-left:0!important;
  margin-right:0!important;
}

.cb-header__main,.mg-head__bar,.div-header__inner,.site-header__inner,
.hc-head__bar,.hc-header__inner,.nc-head__inner,.nc-header__inner,
.tw-head__inner,.tw-header__inner,.lp-head__inner,.lp-header__inner,
.pop-header__inner,.cb-capsules,.tw-tax,[class*="capsules"]{
  width:100%!important;
  max-width:var(--lf-max)!important;
  margin-left:auto!important;
  margin-right:auto!important;
  padding-left:max(var(--lf-pad), env(safe-area-inset-left))!important;
  padding-right:max(var(--lf-pad), env(safe-area-inset-right))!important;
  box-sizing:border-box!important;
}

main,.page-main,.cb-main,.div-main,.site-main,.hc-main,.nc-main,.tw-main,.lp-main,.mg-main,
.pop-main,.cpop-main,.mg-site main,.pop-site main,.cpop-site main,.tw-body main,.hc-body main{
  width:100%!important;
  max-width:var(--lf-max)!important;
  margin-left:auto!important;
  margin-right:auto!important;
  padding-left:max(var(--lf-pad), env(safe-area-inset-left))!important;
  padding-right:max(var(--lf-pad), env(safe-area-inset-right))!important;
  box-sizing:border-box!important;
}

footer,.site-footer,.div-footer,.cb-footer,.mg-foot,.hc-footer,.nc-footer,.tw-footer,.lp-footer{
  width:100%!important;
  max-width:100%!important;
}
.footer-inner,.div-footer__inner,.cb-footer__inner,.tw-footer__inner,.mg-foot__inner,
.hc-footer__inner,footer > div{
  width:100%!important;
  max-width:var(--lf-max)!important;
  margin-left:auto!important;
  margin-right:auto!important;
  padding-left:max(var(--lf-pad), env(safe-area-inset-left))!important;
  padding-right:max(var(--lf-pad), env(safe-area-inset-right))!important;
  box-sizing:border-box!important;
}

/* 顶栏 flex 换行 */
.cb-header__main,.mg-head__bar,.div-header__inner,.tw-head__inner,.hc-head__bar,
.nc-head__inner,.lp-head__inner,[class*="head__bar"],[class*="header__main"]{
  display:flex!important;
  flex-wrap:wrap!important;
  align-items:center!important;
  gap:12px 16px!important;
}
nav,[class*="-nav"],[class*="__nav"],[class*="-pills"]{min-width:0;max-width:100%}
nav a,[class*="capsule"],[class*="pill"]{white-space:nowrap}

/* 横滑轨道：只约束真正的轨道，勿误伤 spotlight/hero 整块 */
[class*="scroll__track"],[class*="rail__track"],[class*="strip__track"],
[class*="spotlight__cards"],[class*="-scroll"]:not([class*="section"]){
  max-width:100%;
  overflow-x:auto;
  overflow-y:hidden;
  -webkit-overflow-scrolling:touch;
}

/* 海报网格 */
.movie-grid,.div-grid,.cb-grid,.mg-grid,.hc-grid,.nc-grid,.tw-grid,.lp-grid,.pop-grid,
[class*="movie-grid"],[class*="poster-grid"],[class*="card-grid"],
.cb-block .cb-grid,.tw-section .tw-grid,.hc-block .hc-grid,.mg-section .mg-grid{
  display:grid!important;
  grid-template-columns:repeat(auto-fill,minmax(140px,1fr))!important;
  gap:14px!important;
  width:100%!important;
  max-width:100%!important;
  align-items:stretch!important;
}
@media (max-width:640px){
  .movie-grid,.div-grid,.cb-grid,.mg-grid,.hc-grid,.nc-grid,.tw-grid,.lp-grid,.pop-grid,
  [class*="movie-grid"],[class*="poster-grid"],[class*="card-grid"]{
    grid-template-columns:repeat(auto-fill,minmax(110px,1fr))!important;
    gap:10px!important;
  }
}

/* 卡片 / 海报 */
article[class*="card"],.movie-card,.div-card,.cb-card,.mg-card,.hc-card,.nc-card,.tw-card,.lp-card,.pop-card{
  min-width:0!important;
  max-width:100%!important;
  overflow:hidden;
}
[class*="card__poster"],.poster-frame,.div-card__poster{
  display:block!important;
  width:100%!important;
  aspect-ratio:3/4!important;
  background:#1a1a1a;
  overflow:hidden;
}
[class*="card__poster"] img,.poster-frame img,.div-card__poster img,
article[class*="card"] img,.movie-card img,.cb-card img,.mg-card img,.tw-card img,.hc-card img{
  width:100%!important;
  height:100%!important;
  aspect-ratio:3/4;
  object-fit:cover!important;
  background:#111;
}
[class*="card__meta"],[class*="card__body"] p{
  display:flex;flex-wrap:wrap;gap:6px;align-items:center;
}

/* 播放区 */
#movie-player,video.player,video[controls]{
  width:100%!important;
  max-height:70vh;
  border-radius:12px;
}

section,[class*="block"],[class*="section"]{max-width:100%}
/* 禁止英雄区负 margin 把内容拉出主栏。
   只命中英雄区容器本身，别用 [class*="hero"] 通配，
   否则会把 .nc-hero__copy / .mg-banner__visual 这类子元素也卡住。 */
.cb-hero,.tw-hero,.mg-hero,.mg-banner,.hc-spotlight,.lp-hero,.cp-hero,.nc-hero,.pop-hero,.cpop-banner{
  margin-left:0!important;
  margin-right:0!important;
  max-width:100%!important;
  box-sizing:border-box!important;
}
h1,h2,h3{overflow-wrap:anywhere;word-break:break-word}

/* 站内链接基本都是 logo、导航、卡片这类块状元素，浏览器默认下划线只会显脏 */
a,a:hover,a:focus,a:visited{text-decoration:none}

form[role="search"] input[type="search"],form[class*="search"] input,
.cb-search input,.mg-search input,.div-search input,.tw-search input,.hc-search input,
.cp-search input,.lp-search input,.cpop-search input{
  min-width:0;
  flex:1 1 auto;
  width:auto;
  max-width:none; /* 勿卡死宽度，否则搜索框中间会出现空白块 */
}

.site-header[style*="position"],.nav-shell{position:relative!important;transform:none!important}

@media (max-width:900px){
  [data-nav-toggle],.cb-nav-toggle,.mg-burger,.tw-burger{display:inline-flex!important}
  nav[data-mobile-menu]{width:100%;order:10}
  form[role="search"],form[class*="search"],.cb-search,.mg-search,.tw-search,.hc-search{
    width:100%;max-width:100%;
  }
  form[role="search"] input,.cb-search input,.mg-search input,.tw-search input,.hc-search input{
    max-width:none!important;flex:1;width:100%;
  }
}

/* pack10-compat-v2 · 莓果画廊跨端 / sticky 顶栏 */
html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
body.cb-site{overflow-x:clip;padding-left:env(safe-area-inset-left);padding-right:env(safe-area-inset-right)}
body.cb-site .cb-top{position:sticky;top:0;z-index:200!important;isolation:isolate}
.cb-shell,.cb-main,.cb-foot,.cb-play,.cb-rail,.cb-grid{min-width:0}
a,button,input,select,textarea,.cb-burger,.cb-btn,.cb-search__go,.cb-capsule{touch-action:manipulation;-webkit-tap-highlight-color:transparent}
img[loading="lazy"]{content-visibility:auto}
.cb-play__screen video,#movie-player{width:100%;height:100%;object-fit:contain;background:#0a0406}
.cb-search__go{white-space:nowrap!important;writing-mode:horizontal-tb!important}
.cb-film__link img,.cb-play__poster{aspect-ratio:2/3!important;object-fit:cover!important}
@media (max-width:640px){
  input[type="search"],input[type="text"],select{font-size:16px!important}
  .cb-brand__name{max-width:min(42vw,9em);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
}
@supports (padding:max(0px)){
  .cb-main{padding-bottom:max(48px,env(safe-area-inset-bottom))}
  .cb-top{padding-top:max(0px,env(safe-area-inset-top))}
}
