/* ===== fix tpl 05/15/25/35/45 home visual start ===== */

/* 这些模板原来首页被做成纯排行榜，导航下面太空、无图、不像影视站 */
body.tpl-05 .site-main,
body.tpl-15 .site-main,
body.tpl-25 .site-main,
body.tpl-35 .site-main,
body.tpl-45 .site-main {
    width: min(1280px, 94vw) !important;
    max-width: 1280px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-top: 28px !important;
}

/* 首页恢复：左内容 + 右榜单 */
body.tpl-05 .tpl-rank-fixed,
body.tpl-15 .tpl-rank-fixed,
body.tpl-25 .tpl-rank-fixed,
body.tpl-35 .tpl-rank-fixed,
body.tpl-45 .tpl-rank-fixed {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 320px !important;
    gap: 24px !important;
    align-items: start !important;
}

/* 推荐影视、栏目模块正常展示 */
body.tpl-05 .recommend-lunli,
body.tpl-15 .recommend-lunli,
body.tpl-25 .recommend-lunli,
body.tpl-35 .recommend-lunli,
body.tpl-45 .recommend-lunli,
body.tpl-05 .tpl-section,
body.tpl-15 .tpl-section,
body.tpl-25 .tpl-section,
body.tpl-35 .tpl-section,
body.tpl-45 .tpl-section {
    width: 100% !important;
    overflow: hidden !important;
}

/* 海报卡片网格 */
body.tpl-05 .vod-collection,
body.tpl-15 .vod-collection,
body.tpl-25 .vod-collection,
body.tpl-35 .vod-collection,
body.tpl-45 .vod-collection {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)) !important;
    gap: 18px !important;
    align-items: start !important;
}

/* 海报正常比例 */
body.tpl-05 .card-poster .poster-img,
body.tpl-15 .card-poster .poster-img,
body.tpl-25 .card-poster .poster-img,
body.tpl-35 .card-poster .poster-img,
body.tpl-45 .card-poster .poster-img {
    aspect-ratio: 2 / 3 !important;
    border-radius: 14px !important;
    overflow: hidden !important;
}

body.tpl-05 .card-poster img,
body.tpl-15 .card-poster img,
body.tpl-25 .card-poster img,
body.tpl-35 .card-poster img,
body.tpl-45 .card-poster img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

/* 标题不要竖排 */
body.tpl-05 .vod-card *,
body.tpl-15 .vod-card *,
body.tpl-25 .vod-card *,
body.tpl-35 .vod-card *,
body.tpl-45 .vod-card * {
    writing-mode: horizontal-tb !important;
    text-orientation: mixed !important;
}

/* 标题最多两行 */
body.tpl-05 .card-poster strong,
body.tpl-15 .card-poster strong,
body.tpl-25 .card-poster strong,
body.tpl-35 .card-poster strong,
body.tpl-45 .card-poster strong {
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    white-space: normal !important;
    word-break: break-word !important;
    line-height: 1.35 !important;
    font-size: 15px !important;
    margin-top: 8px !important;
}

/* 年份、地区、分类一行显示 */
body.tpl-05 .card-poster span,
body.tpl-15 .card-poster span,
body.tpl-25 .card-poster span,
body.tpl-35 .card-poster span,
body.tpl-45 .card-poster span {
    display: block !important;
    overflow: hidden !important;
    white-space: nowrap !important;
    text-overflow: ellipsis !important;
}

/* 大图首屏正常 */
body.tpl-05 .tpl-hero,
body.tpl-15 .tpl-hero,
body.tpl-25 .tpl-hero,
body.tpl-35 .tpl-hero,
body.tpl-45 .tpl-hero {
    margin-bottom: 24px !important;
}

/* 右侧榜单 */
body.tpl-05 .tpl-rank-fixed .rank-panel,
body.tpl-15 .tpl-rank-fixed .rank-panel,
body.tpl-25 .tpl-rank-fixed .rank-panel,
body.tpl-35 .tpl-rank-fixed .rank-panel,
body.tpl-45 .tpl-rank-fixed .rank-panel {
    position: sticky !important;
    top: 96px !important;
    width: 320px !important;
}

/* 移动端 */
@media (max-width: 900px) {
    body.tpl-05 .tpl-rank-fixed,
    body.tpl-15 .tpl-rank-fixed,
    body.tpl-25 .tpl-rank-fixed,
    body.tpl-35 .tpl-rank-fixed,
    body.tpl-45 .tpl-rank-fixed {
        display: block !important;
    }

    body.tpl-05 .tpl-rank-fixed .rank-panel,
    body.tpl-15 .tpl-rank-fixed .rank-panel,
    body.tpl-25 .tpl-rank-fixed .rank-panel,
    body.tpl-35 .tpl-rank-fixed .rank-panel,
    body.tpl-45 .tpl-rank-fixed .rank-panel {
        position: static !important;
        width: 100% !important;
    }

    body.tpl-05 .vod-collection,
    body.tpl-15 .vod-collection,
    body.tpl-25 .vod-collection,
    body.tpl-35 .vod-collection,
    body.tpl-45 .vod-collection {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 12px !important;
    }
}

/* ===== fix tpl 05/15/25/35/45 home visual end ===== */
