/**
 * hl062 顶栏 / 首页频道导航 / 卡片排版修复
 */

/* 文字 Logo 不再被 30px 宽度裁切 */
@media (max-width: 899px) {
  .header-logo .logo,
  .brand .logo,
  .hailuo-site-logo .header-logo {
    width: auto !important;
    max-width: 42vw;
    overflow: visible !important;
  }

  .homepage .header-bg .nav-search {
    margin-left: 0 !important;
  }

  .header-bg .header-logo,
  .header-content.header-bg .hailuo-site-logo .header-logo {
    transform: none !important;
    -webkit-transform: none !important;
  }
}

/* PC 顶栏单行 flex，避免站名与导航叠在一起 */
@media (min-width: 900px) {
  .header-content {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 8px;
    padding-left: 15px;
    padding-right: 15px;
    box-sizing: border-box;
  }

  .header-content .hailuo-cc,
  .header-content .nav-search,
  .header-content .nav,
  .header-content .pc,
  .header-content .header-module {
    float: none !important;
  }

  .header-content .nav {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
  }

  .header-content .nav-search {
    flex: 0 0 auto;
  }

  .header-content .header-module {
    flex: 0 0 auto;
    margin-left: auto;
  }

  .hailuo-site-logo .logo-site-name,
  .brand .logo-site-name {
    max-width: 168px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
    vertical-align: middle;
  }
}

/* 首页频道导航：仅手机端取消负 margin，PC 宽屏保持主题原生叠层 */
@media (max-width: 899px) {
  .homepage_homepage_channelnav {
    margin-top: 8px !important;
    margin-bottom: 28px !important;
    top: 0 !important;
    position: relative !important;
    z-index: 1 !important;
    height: auto !important;
    min-height: 0;
    padding-bottom: 10px;
    overflow: hidden;
  }

  .homepage_homepage_channelnav .homepage_left_content .homepage_main_tabs_wrap_new .homepage_main_tabs_new {
    width: auto !important;
    min-width: 86px;
    margin: 4px 10px 0 0 !important;
  }

  .homepage_homepage_channelnav .homepage_left_content .homepage_main_tabs_wrap_new .homepage_main_tabs_new .homepage_main_tabs_title_new {
    font-size: 20px;
  }
}

/* 卡片标题单行省略 */
.module-item-title,
.module-item .module-item-title,
.homepage_video_title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.index-logo .logo-site-name {
  max-width: 90vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 顶栏高度：仅平板/手机自适应，PC 保持主题固定高度 */
@media (max-width: 899px) {
  body.homepage .header-content,
  .page .header-content {
    height: auto !important;
    min-height: 70px;
  }
}

/* PC 顶栏 logo 区 flex（勿作用于手机，否则会覆盖 .hailuo-cc{display:none} 导致站名重复） */
@media (min-width: 900px) {
  .hailuo-site-logo .header-logo,
  .header-content .hailuo-cc {
    display: flex;
    align-items: center;
  }
}

.homepage .header-bg .logo img {
  margin-top: 0 !important;
}

body.homepage #index-main > .content {
  position: relative;
  z-index: 1;
}

body.homepage #index-main > .content > .module:first-child {
  margin-top: 8px;
}

/* 模块标题区：「今日更新」等副标题不飘到顶栏 */
.module-heading {
  min-height: 42px;
  padding-right: 130px;
  box-sizing: border-box;
}

.module-heading .more,
.module-heading .more.nonemore {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  max-width: 48%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.module-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

/* 详情 / 播放页选集区手机网格（仅选集链接容器，勿作用于 tab-list 外层） */
@media (max-width: 767px) {
  body.wc-syn-active .module-player-list .module-blocklist.scroll-box .scroll-content {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    font-size: 14px !important;
  }

  body.wc-syn-active .module-player-list .module-blocklist.scroll-box .scroll-content > a {
    text-align: center;
    padding: 8px 4px;
    font-size: 12px;
    background: #f7f8f9 !important;
    color: rgba(0, 0, 0, 0.68) !important;
    border-radius: 8px;
  }

  body.wc-syn-active.view.page #main {
    padding-top: 8px;
  }
}

@media (max-width: 480px) {
  body.wc-syn-active .module-player-list .module-blocklist.scroll-box .scroll-content {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ── 手机 / 百度浏览器：横向影片列表 ── */
@media (max-width: 767px) {
  .scroll-box:not(.scroll-box-y) {
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    touch-action: pan-x;
  }

  .scroll-content {
    display: inline-flex !important;
    flex-wrap: nowrap !important;
    vertical-align: top;
  }

  .scroll-content .module-item,
  .scroll-content .module-poster-item {
    flex: 0 0 auto;
  }

  .module-list .scroll-box,
  #index-vod .scroll-box {
    min-height: 120px !important;
  }

  .module-poster-items-small .module-item-cover,
  .scroll-box .module-item-cover {
    height: auto !important;
    min-height: 110px !important;
    padding-top: 0 !important;
  }

  .module-poster-items-small .module-item-pic img {
    position: relative !important;
    display: block !important;
    min-height: 100px;
    height: auto !important;
    object-fit: cover;
  }
}
