/**
 * 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，避免顶进 header */
.homepage_homepage_channelnav {
  margin-top: 12px !important;
  top: 0 !important;
  position: relative;
  z-index: 1;
}

@media (max-width: 899px) {
  .homepage_homepage_channelnav {
    margin-top: 8px !important;
    margin-bottom: 28px !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;
}

/* ── 顶栏高度自适应，避免导航/搜索挤出 fixed 区域 ── */
body.homepage .header-content,
.page .header-content {
  height: auto !important;
  min-height: 70px;
}

.hailuo-site-logo .header-logo,
.header-content .hailuo-cc {
  display: flex;
  align-items: center;
}

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

/* 频道导航：取消主题负 margin，避免顶进 header / 与菜单叠字 */
.homepage_homepage_channelnav {
  margin-top: 12px !important;
  margin-bottom: 28px !important;
  top: 0 !important;
  position: relative !important;
  z-index: 1 !important;
  height: auto !important;
  min-height: 0;
}

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%;
}

/* 详情 / 播放页选集区手机网格 */
@media (max-width: 767px) {
  body.wc-syn-active .module-play-list-content,
  body.wc-syn-active .module-list.sort-list {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
  }

  body.wc-syn-active .module-play-list-content a,
  body.wc-syn-active .module-list.sort-list a {
    text-align: center;
    padding: 8px 4px;
    font-size: 12px;
  }

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

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