/* 首页 TAB：共用顶栏 + 独立内容区 */

body.wb-video-home[data-wb-home-tab="home"] .wb-home-pane--home,
body.wb-video-home:not([data-wb-home-tab]) .wb-home-pane--home {
    display: block;
}

body.wb-video-home[data-wb-home-tab="home"] .wb-home-pane--channel,
body.wb-video-home:not([data-wb-home-tab]) .wb-home-pane--channel {
    display: none !important;
}

body.wb-video-home[data-wb-home-tab]:not([data-wb-home-tab="home"]) .wb-home-pane--home {
    display: none !important;
}

body.wb-video-home[data-wb-home-tab]:not([data-wb-home-tab="home"]) .wb-home-pane--channel {
    display: block;
}

body.wb-video-home .wb-home-shared-strip {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* 图标广告仅属于“首页”TAB；分类频道仍共用同一页面，需按当前 TAB 隐藏。 */
body.wb-video-home[data-wb-home-tab]:not([data-wb-home-tab="home"])
    .wb-home-shared-strip > .tab-icons-panel {
    display: none !important;
}

body.wb-video-home .wb-home-shared-strip > .myui-panel,
body.wb-video-home .wb-home-shared-strip > .ads-slider,
body.wb-video-home .wb-home-shared-strip > .wb-fuli-hub-panel {
    margin: 0 !important;
}

body.wb-video-home .wb-home-shared-strip .ads-slider,
body.wb-video-home .wb-home-shared-strip .myui-banner,
body.wb-video-home .wb-home-shared-strip .flickity,
body.wb-video-home .wb-home-shared-strip .swiper-container {
    border-radius: var(--wb-radius-panel, 12px);
    overflow: hidden;
}

body.wb-video-home .wb-home-shared-strip .wb-sysmsg-panel {
    border-radius: var(--wb-radius-panel, 12px);
    overflow: hidden;
    margin: 0 !important;
    padding: 8px 0 !important;
}

body.wb-video-home .wb-home-shared-strip .wb-sysmsg-panel .gonggaoxiaoxi {
    padding: 2px 0;
}

body.wb-video-home .wb-home-shared-strip .myui-panel.myui-panel-bg,
body.wb-video-home .wb-home-shared-strip .wb-wenzi-ads-panel {
    padding: 0 !important;
}

body.wb-video-home .wb-home-shared-strip .myui-panel.myui-panel-bg .myui-panel-box,
body.wb-video-home .wb-home-shared-strip .myui-panel.myui-panel-bg .myui-panel_bd,
body.wb-video-home .wb-home-shared-strip .myui-panel.myui-panel-bg .hengfu-ads-container {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

body.wb-video-home .wb-home-channel-mount {
    min-height: 120px;
}

body.wb-video-home .wb-home-channel-wrap {
    margin-top: 0;
}

body.wb-video-home .wb-home-subcategories {
    margin: 2px 0 8px;
    padding: 0;
}

body.wb-video-home .wb-home-subcategories__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 7px;
}

body.wb-video-home .wb-home-subcategories__item {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    min-width: 0;
    min-height: 62px;
    padding: 9px 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    border-radius: 10px;
    background: #e0f2fe;
    color: #075985 !important;
    text-align: center;
    text-decoration: none !important;
    transition: transform .15s ease, filter .15s ease;
}

body.wb-video-home .wb-home-subcategories__item.has-image {
    min-height: 0;
    aspect-ratio: 1 / 1;
    padding: 10px 6px 8px;
    justify-content: flex-end;
    color: #fff !important;
    background: #334155;
}

body.wb-video-home .wb-home-subcategories__media {
    position: absolute;
    inset: 0;
    z-index: 0;
    display: block;
    pointer-events: none;
}

body.wb-video-home .wb-home-subcategories__media::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(15, 23, 42, .04) 28%, rgba(15, 23, 42, .18) 52%, rgba(2, 6, 23, .86) 100%);
}

body.wb-video-home .wb-home-subcategories__media img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

body.wb-video-home .wb-home-subcategories__item:nth-child(4n + 2) {
    background: #ede9fe;
    color: #6d28d9 !important;
}

body.wb-video-home .wb-home-subcategories__item:nth-child(4n + 3) {
    background: #dcfce7;
    color: #15803d !important;
}

body.wb-video-home .wb-home-subcategories__item:nth-child(4n) {
    background: #ffedd5;
    color: #c2410c !important;
}

body.wb-video-home .wb-home-subcategories__item:active {
    transform: scale(.97);
}

body.wb-video-home .wb-home-subcategories__item.is-active {
    color: #fff !important;
    background: linear-gradient(135deg, #2563eb 0%, #0ea5e9 100%) !important;
    box-shadow: 0 5px 12px rgba(37, 99, 235, .22);
    transform: translateY(-1px);
}

body.wb-video-home .wb-home-subcategories__item.is-active small {
    opacity: .86;
}

body.wb-video-home .wb-home-subcategories__item.has-image.is-active
    .wb-home-subcategories__media::after {
    background: linear-gradient(135deg, rgba(37, 99, 235, .38), rgba(14, 165, 233, .2)),
        linear-gradient(180deg, rgba(15, 23, 42, .12), rgba(15, 23, 42, .58));
}

body.wb-video-home .wb-home-subcategories__name {
    position: relative;
    z-index: 1;
    width: 100%;
    overflow: hidden;
    color: inherit;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.wb-video-home .wb-home-subcategories__item small {
    position: relative;
    z-index: 1;
    max-width: 100%;
    overflow: hidden;
    color: inherit;
    font-size: 11px;
    line-height: 1.2;
    opacity: .72;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.wb-video-home .wb-home-subcategories__item.has-image
    .wb-home-subcategories__name {
    overflow: visible;
    font-size: 16px;
    font-weight: 900;
    line-height: 1.15;
    letter-spacing: .7px;
    text-overflow: clip;
    text-shadow:
        0 0 2px rgba(255, 255, 255, 1),
        0 0 7px rgba(56, 189, 248, .9),
        0 2px 3px rgba(0, 0, 0, .95),
        1px 1px 0 rgba(0, 0, 0, .72),
        -1px -1px 0 rgba(0, 0, 0, .55);
    white-space: normal;
}

body.wb-video-home .wb-home-subcategories__item.has-image small {
    position: relative;
    top: auto;
    right: auto;
    order: -1;
    max-width: 100%;
    padding: 0;
    border-radius: 0;
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    line-height: 1.15;
    background: transparent;
    box-shadow: none;
    opacity: .88;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .8);
}

html.theme-dark body.wb-video-home .wb-home-subcategories__item {
    background: rgba(14, 165, 233, .18);
    color: #7dd3fc !important;
}

html.theme-dark body.wb-video-home .wb-home-subcategories__item:nth-child(4n + 2) {
    background: rgba(139, 92, 246, .2);
    color: #c4b5fd !important;
}

html.theme-dark body.wb-video-home .wb-home-subcategories__item:nth-child(4n + 3) {
    background: rgba(34, 197, 94, .18);
    color: #86efac !important;
}

html.theme-dark body.wb-video-home .wb-home-subcategories__item:nth-child(4n) {
    background: rgba(249, 115, 22, .2);
    color: #fdba74 !important;
}

html.theme-dark body.wb-video-home .wb-home-subcategories__item.has-image {
    color: #fff !important;
    background: #1e293b;
}

body.wb-video-home .wb-home-channel-head {
    display: block;
    margin: 0;
    padding: 8px 0 4px;
    border-radius: 0;
    background: transparent;
    border: 0;
}

body.wb-video-home .wb-home-channel-head__main {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 10px;
    min-width: 0;
}

body.wb-video-home .wb-home-channel-head__title {
    margin: 0;
    min-width: 0;
    overflow: hidden;
    font-size: 17px;
    font-weight: 700;
    color: var(--wb-app-text, #0f172a);
    line-height: 1.3;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.wb-video-home .wb-home-channel-head__title::before {
    content: "";
    flex: 0 0 auto;
    width: 3px;
    height: 16px;
    border-radius: 999px;
    background: linear-gradient(180deg, #2563eb 0%, #06b6d4 100%);
}

body.wb-video-home .wb-home-channel-head__count {
    flex: 0 0 auto;
    margin-left: auto;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 11px;
    line-height: 1.2;
    color: #64748b;
    background: #f1f5f9;
    white-space: nowrap;
}

body.wb-video-home .wb-home-channel-head__count-num {
    margin: 0 2px;
    color: #2563eb;
    font-size: 13px;
    font-weight: 700;
}

html.theme-dark body.wb-video-home .wb-home-channel-head__count {
    color: #94a3b8;
    background: rgba(148, 163, 184, .12);
}

html.theme-dark body.wb-video-home .wb-home-channel-head__count-num {
    color: #60a5fa;
}

body.wb-video-home .wb-home-channel-head__toolbar {
    position: -webkit-sticky;
    position: sticky;
    top: calc(env(safe-area-inset-top, 0px) + var(--top-floating-ad-height, 0px) + var(--myui-header-height, 84px));
    z-index: 90;
    display: flex;
    align-items: center;
    width: 100%;
    gap: 0;
    min-width: 0;
    padding: 4px 0 8px;
    box-sizing: border-box;
    justify-content: stretch;
    background: var(--wb-app-card, #fff);
}

body.wb-video-home .wb-home-channel-head__sort {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    width: 100%;
    max-width: none;
    padding: 3px;
    gap: 2px;
    border-radius: 8px;
    box-sizing: border-box;
}

body.wb-video-home .wb-home-channel-head__sort .wb-vod-filter__sort-item {
    width: 100%;
    height: 30px;
    padding: 0 4px;
    border-radius: 6px;
    font-size: 12px;
    box-sizing: border-box;
}

html.theme-dark body.wb-video-home .wb-home-channel-head {
    background: transparent;
    border-color: transparent;
}

html.theme-dark body.wb-video-home .wb-home-channel-head__title {
    color: #f8fafc;
}

body.wb-video-home .wb-home-pane--home [data-wb-home-tab] {
    cursor: pointer;
}

body.wb-video-home .wb-home-channel-feed {
    margin-top: 0;
}

body.wb-video-home .wb-home-channel-feed .wb-vod-infinite__foot {
    padding: 16px 0 8px;
    text-align: center;
}

body.wb-video-home .wb-home-channel-feed .wb-vod-infinite__hint {
    margin: 0;
    font-size: 13px;
    color: var(--wb-muted, #94a3b8);
}

body.wb-video-home .wb-home-tab-loading,
body.wb-video-home .wb-home-tab-empty {
    padding: 48px 16px;
    text-align: center;
    font-size: 14px;
    color: var(--wb-muted, #94a3b8);
}

body.wb-video-home .wb-home-tab-loading .fa {
    margin-right: 6px;
}
