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

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

/* ── 顶栏通栏；内部与主区同宽 ── */
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,.me-header,
.hr-header,.ab-header,.vx-header,.sf-header,.nk-header,.ed-header,.vod-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,.tw-site header,.ed-body header,
.vx-site header,.nk-body header,.cb-body header,.body-me header,.body-hr header,
.body-ab header,.body-sf header,.body-cb header,.vod-body 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,.mg-head__row,.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,.me-header__inner,.me-nav__inner,.hr-header__inner,
.ab-header__inner,.vx-header__inner,.sf-header__inner,.nk-header__inner,
.ed-header__inner,.vod-header__inner,.cb-capsules,.tw-tax,[class*="capsules"],
[class*="header__inner"],[class*="head__inner"],[class*="head__row"],[class*="head__bar"]{
  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,.me-main,.hr-main,.ab-main,.vx-main,.sf-main,.nk-main,.ed-main,.vod-main,
.mg-site main,.pop-site main,.cpop-site main,.tw-body main,.hc-body main,.ed-body main,
.vx-site main,.nk-body main,.cb-body main,.body-me main,.body-hr main,.body-ab main,
.body-sf main,.body-cb main,.vod-body main,.body-mg 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,.me-footer,.hr-footer,.ab-footer,.vx-footer,.sf-footer,.nk-footer,.ed-footer,.vod-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,.me-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;
}

/* 顶栏对齐 */
.cb-header__main,.mg-head__bar,.mg-head__row,.div-header__inner,.tw-head__inner,.hc-head__bar,
.nc-head__inner,.lp-head__inner,.me-header__inner,[class*="head__bar"],[class*="header__main"],
[class*="head__row"],[class*="head__inner"]{
  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"],[class*="chip"]{white-space:nowrap}

/* 横滑轨道 */
[class*="scroll__track"],[class*="rail__track"],[class*="strip__track"],
[class*="spotlight__cards"],[class*="spotlight__rail"],
.cb-spotlight__rail,.lp-hero__strip,.ab-hero__strip,.mg-hero__focus{
  max-width:100%;
  overflow-x:auto;
  overflow-y:hidden;
  -webkit-overflow-scrolling:touch;
  scrollbar-width:thin;
}

/* ── 区头对齐 ── */
[class*="section-head"],[class*="__head"]:not(header):not([class*="header"]),
[class*="zone__head"],[class*="block__head"],.me-section-head,.cb-section-head,
.hr-section__head,.ab-section__head,.mg-block__head,.lp-section__head,.sf-section__head,
.nk-zone__head,.vx-section-head{
  display:flex!important;
  flex-wrap:wrap!important;
  align-items:baseline!important;
  justify-content:space-between!important;
  gap:10px 16px!important;
  width:100%!important;
  margin:0 0 16px!important;
  max-width:100%!important;
}
[class*="section-head"] h2,[class*="__head"] h2,[class*="zone__head"] h2,
[class*="block__head"] h2{margin:0!important;line-height:1.3!important}

/* ── 卡片标题两行截断，meta 单行，网格更齐 ── */
[class*="card__title"],[class*="film__title"],.me-card__title,.mg-film h3,.ab-poster strong,
.nk-tile h3,.nk-mini h3,.hr-card h3,.sf-card h3,.vx-card h3,.lp-card h3,.cb-card h3,
article[data-card] h3,article[data-card] strong.me-card__title{
  display:-webkit-box!important;
  -webkit-box-orient:vertical!important;
  -webkit-line-clamp:2!important;
  overflow:hidden!important;
  line-height:1.35!important;
  max-width:100%!important;
  word-break:break-word!important;
}
[class*="card__meta"],[class*="film__meta"],.me-card__meta,.nk-mini p,.hr-card p{
  display:flex!important;
  flex-wrap:wrap!important;
  gap:4px 8px!important;
  align-items:center!important;
  font-size:.78rem!important;
  line-height:1.3!important;
  max-width:100%!important;
}

/* 海报网格：默认交给 site-craft；此处只兜底不溢出 */
.movie-grid,.div-grid,.cb-grid,.mg-grid,.hc-grid,.nc-grid,.tw-grid,.lp-grid,.pop-grid,
.me-curate-grid,.me-cat-grid,.ed-grid,.vx-grid,.sf-grid,.nk-grid,.nk-wall,.hr-grid,.ab-wall,
.ab-grid,.vod-grid,.ab-poster-grid,.vx-shelf__grid,.vx-rail__track,.sf-scroll,
[class*="movie-grid"],[class*="poster-grid"]{
  width:100%!important;
  max-width:100%!important;
  align-items:stretch!important;
  min-width:0!important;
}

/* 卡片不挤出格子 */
article[class*="card"],article[data-card],.movie-card,.div-card,.cb-card,.mg-card,.hc-card,
.tw-card,.lp-card,.pop-card,.me-card,.ed-card,.vx-card,.sf-card,.nk-card,.nk-tile,.nk-mini,
.hr-card,.ab-card,.ab-poster,.mg-film{
  min-width:0!important;
  max-width:100%!important;
}
[class*="card__frame"],[class*="card__poster"],[class*="film__poster"],[class*="tile__frame"],
[class*="poster__frame"],.poster-frame,.me-card__frame,.ab-poster__frame,.nk-tile__frame{
  display:block!important;
  width:100%!important;
  overflow:hidden;
  background:#1a1a1a;
}
[class*="card__frame"] img,[class*="card__poster"] img,[class*="film__poster"] img,
[class*="tile__frame"] img,[class*="poster__frame"] img,.me-card__frame img,
.ab-poster__frame img,.nk-tile__frame img,.mg-film__poster img{
  width:100%!important;
  height:100%!important;
  object-fit:cover!important;
  display:block!important;
}

/* ── 英雄区：不负 margin；纵向允许阴影，横向裁切 ── */
.cb-hero,.cb-spotlight,.tw-hero,.mg-hero,.mg-banner,.hc-spotlight,.lp-hero,.cp-hero,.nc-hero,
.pop-hero,.cpop-banner,.me-hero,.hr-hero,.ab-hero,.vx-hero,.sf-hero,.nk-hero,
.ed-hero,.vod-hero,[class$="-hero"],[class$="__hero"]{
  margin-left:0!important;
  margin-right:0!important;
  max-width:100%!important;
  box-sizing:border-box!important;
  overflow-x:clip;
  overflow-y:visible;
}
.me-hero__band,.mg-hero__layout,.ed-hero,.tw-hero,.hr-hero__inner,.ab-hero,.lp-hero,
.cb-spotlight,.vx-hero,.nk-hero{
  width:100%!important;
  max-width:100%!important;
  box-sizing:border-box!important;
}
h1,h2,h3{overflow-wrap:anywhere;word-break:break-word;max-width:100%}

a,a:hover,a:focus,a:visited{text-decoration:none}

/* 搜索框 */
form[role="search"],form[class*="search"],.cb-search,.mg-search,.me-search,.tw-search,
.hc-search,.cp-search,.lp-search,.ed-search,.vx-search,.sf-search,.nk-search,.hr-search,.ab-search{
  display:flex!important;
  align-items:stretch!important;
  min-width:0!important;
  max-width:100%!important;
  overflow:hidden;
}
form[role="search"] input[type="search"],form[class*="search"] input,
.cb-search input,.mg-search input,.me-search input,.tw-search input,.hc-search input,
.ed-search input,.vx-search input,.sf-search input,.nk-search input,.hr-search input,.ab-search input{
  min-width:0!important;
  flex:1 1 auto!important;
  width:auto!important;
  max-width:none!important;
}
form[role="search"] button,form[class*="search"] button,
.cb-search button,.mg-search button,.me-search button,.tw-search button{
  flex:0 0 auto!important;
  white-space:nowrap!important;
}

/* ── 播放页：双栏对齐 + 窄屏单栏 ── */
[class*="play"],[class*="player"],[class*="cinema"],[class*="theater"]{
  max-width:100%;box-sizing:border-box;
}
#movie-player,video.player,video[controls],
[class*="play__screen"] video,[class*="player"] video,[class*="cinema"] video,
[class*="theater"] video,[class*="stage"] video{
  width:100%!important;
  max-height:min(72vh,740px);
  background:#000;
  border-radius:10px;
}
.me-play__detail,.nk-play,.ab-play,.cb-theater,.hr-play,.vx-play,.mg-play,
.cb-cinema,.lp-player,.sf-player,.ed-play{
  width:100%!important;
  max-width:100%!important;
  box-sizing:border-box!important;
}
@media (min-width:901px){
  .me-play__detail{
    display:grid!important;
    grid-template-columns:minmax(0,1.55fr) minmax(220px,.9fr)!important;
    gap:24px!important;
    align-items:start!important;
  }
  .nk-play{
    display:grid!important;
    grid-template-columns:minmax(0,1fr) 260px!important;
    gap:20px!important;
    align-items:start!important;
  }
  .ab-play{
    display:grid!important;
    grid-template-columns:minmax(0,1.4fr) minmax(220px,.85fr)!important;
    gap:20px!important;
    align-items:start!important;
  }
  .cb-theater,.hr-play,.vx-play{
    display:grid!important;
    grid-template-columns:minmax(0,1.5fr) minmax(220px,.85fr)!important;
    gap:20px!important;
    align-items:start!important;
  }
}
@media (max-width:900px){
  .me-play__detail,.nk-play,.ab-play,.cb-theater,.hr-play,.vx-play,
  [class*="play__detail"],[class*="play__layout"]{
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:16px!important;
  }
  [class*="play__aside"],[class*="play__side"],[class*="play__panel"],
  [class*="play__info"],.nk-play__side,.ab-play__panel{
    width:100%!important;
    max-width:100%!important;
  }
  .mg-play__bar,.cb-cinema__bar{
    display:flex!important;
    flex-wrap:wrap!important;
    gap:12px!important;
    align-items:center!important;
  }
}

/* 播放页相关推荐：与主栏同宽 */
[class*="related"],.nk-zone,.me-related,.ab-related,.vx-related,.sf-related{
  width:100%!important;
  max-width:100%!important;
}

/* ── 分类页 ── */
.category-grid,.ab-catgrid,.cb-cat-tiles,.me-chips + .category-grid,.lp-cats{
  width:100%!important;
  max-width:100%!important;
}
.category-grid.large,.ab-catgrid,.cb-cat-tiles{
  display:grid!important;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:14px!important;
}
@media (max-width:640px){
  .category-grid.large,.ab-catgrid,.cb-cat-tiles{
    grid-template-columns:1fr!important;
  }
}
[class*="filter"],[class*="filters"],.me-filters,.ab-filterbar,.cb-filterbar{
  max-width:100%!important;
  box-sizing:border-box!important;
  display:flex!important;
  flex-wrap:wrap!important;
  gap:10px!important;
  align-items:center!important;
  margin:0 0 18px!important;
}
[class*="filter"] input,[class*="filters"] input,.me-filters__search,.ab-filterbar__input{
  min-width:0!important;
  flex:1 1 160px!important;
  max-width:100%!important;
}
[class*="chips"],[class*="catmos"],[class*="entry"],.me-chips,.ed-catmos,.cb-capsules__track{
  display:flex;flex-wrap:wrap;gap:8px;max-width:100%;
}
[class*="cat-layout"],.cb-cat-layout,.lp-cat-layout{
  display:grid!important;
  grid-template-columns:minmax(160px,220px) minmax(0,1fr)!important;
  gap:20px!important;
  align-items:start!important;
  width:100%!important;
}
@media (max-width:860px){
  [class*="cat-layout"],.cb-cat-layout,.lp-cat-layout{
    grid-template-columns:1fr!important;
  }
}

section,[class*="block"],[class*="section"]{max-width:100%}
.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,.me-nav-toggle,.nk-burger,.ab-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,.me-search{
    width:100%;max-width:100%;
  }
}
@media (max-width:640px){
  input[type="search"],input[type="text"]{font-size:16px!important}
  .mg-head__tools{
    flex:1 1 100%!important;
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    order:5!important;
    justify-content:stretch!important;
  }
  .mg-head__tools .mg-search{
    flex:1 1 auto!important;
    width:auto!important;
    max-width:none!important;
    min-width:0!important;
  }
  .mg-head__tools .mg-btn--cta{display:none!important}
}

body{padding-left:env(safe-area-inset-left);padding-right:env(safe-area-inset-right)}
a,button,input,select,textarea{touch-action:manipulation}
/* search-ui · svg icons */
img,video,canvas{max-width:100%;height:auto;display:block}
svg{max-width:100%}
button svg,a svg,[class*="search"] svg,[class*="burger"] svg,[class*="nav-toggle"] svg,.me-nav-toggle svg{
  width:18px!important;height:18px!important;max-width:none!important;
  display:block!important;flex-shrink:0!important;
}

/* seo-cross-platform · 触控与安全区 */
html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
body{-webkit-tap-highlight-color:transparent;padding-left:env(safe-area-inset-left);padding-right:env(safe-area-inset-right)}
a,button,input,select,textarea{touch-action:manipulation}
img[loading="lazy"]{content-visibility:auto}
@media (max-width:640px){
  input[type="search"],input[type="text"]{font-size:16px!important} /* 防 iOS 聚焦放大 */
}
