/* ==========================================================================
   腾讯视频风格首页样式 (tv-home.css)
   独立于主题原有 CSS，仅由 index.html 引用
   ========================================================================== */

:root {
    --tv-bg: #f5f6f8;
    --tv-text: #14161a;
    --tv-text-2: #868d99;
    --tv-text-3: #a8aeb8;
    --tv-line: #ededf1;
    --tv-brand: #0aa7ff;
    --tv-brand-2: #0a6bff;
    --tv-score: #ff9f0a;
    --tv-radius: 12px;
    --tv-wrap: 1200px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body.tv-body {
    background: var(--tv-bg);
    color: var(--tv-text);
    font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    display: block;
    max-width: 100%;
}

button {
    font-family: inherit;
}

.tv-wrap {
    width: 100%;
    max-width: var(--tv-wrap);
    margin: 0 auto;
    padding: 0 20px;
}

/* --------------------------------------------------------------- 顶部导航 */

.tv-header {
    position: sticky;
    top: 0;
    z-index: 60;
    background: rgba(255, 255, 255, .94);
    -webkit-backdrop-filter: saturate(180%) blur(10px);
    backdrop-filter: saturate(180%) blur(10px);
    border-bottom: 1px solid var(--tv-line);
}

.tv-header-inner {
    display: flex;
    align-items: center;
    gap: 26px;
    height: 64px;
}

.tv-logo {
    display: flex;
    align-items: center;
    gap: 9px;
    flex: 0 0 auto;
}

.tv-logo-mark {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background: linear-gradient(135deg, #00d2ff 0%, #0a6bff 100%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(10, 107, 255, .30);
    flex: 0 0 auto;
}

.tv-logo-mark svg {
    width: 15px;
    height: 15px;
    fill: #fff;
    margin-left: 1px;
}

.tv-logo-text {
    font-size: 21px;
    font-weight: 800;
    letter-spacing: -.5px;
    color: #12161c;
}

.tv-nav {
    display: flex;
    align-items: center;
    gap: 26px;
    flex: 1 1 auto;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.tv-nav::-webkit-scrollbar {
    display: none;
}

.tv-nav a {
    position: relative;
    flex: 0 0 auto;
    font-size: 15.5px;
    color: #3f454f;
    padding: 4px 0;
    white-space: nowrap;
    transition: color .18s;
}

.tv-nav a:hover {
    color: var(--tv-brand);
}

.tv-nav a.is-active {
    color: #12161c;
    font-weight: 700;
}

.tv-nav a.is-active::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -1px;
    width: 18px;
    height: 3px;
    border-radius: 3px;
    transform: translateX(-50%);
    background: linear-gradient(90deg, #00d2ff, #0a6bff);
}

.tv-search {
    position: relative;
    flex: 0 0 auto;
    width: 226px;
    height: 36px;
}

.tv-search input {
    width: 100%;
    height: 36px;
    padding: 0 40px 0 15px;
    border: 1px solid transparent;
    border-radius: 18px;
    background: #f1f3f6;
    color: #2a2f38;
    font-size: 13px;
    outline: none;
    transition: background .18s, border-color .18s, box-shadow .18s;
}

.tv-search input::placeholder {
    color: #a3a9b3;
}

.tv-search input:focus {
    background: #fff;
    border-color: #d3dae3;
    box-shadow: 0 4px 14px rgba(18, 22, 28, .07);
}

.tv-search button {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #8f96a1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color .18s, background .18s;
}

.tv-search button svg {
    width: 16px;
    height: 16px;
}

.tv-search button:hover {
    color: #fff;
    background: var(--tv-brand);
}

.tv-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 0 0 auto;
}

.tv-act-link {
    font-size: 13.5px;
    color: #4b515b;
}

.tv-act-link:hover {
    color: var(--tv-brand);
}

.tv-act-vip {
    display: inline-flex;
    align-items: center;
    height: 30px;
    padding: 0 14px;
    border-radius: 15px;
    font-size: 13px;
    font-weight: 600;
    color: #7a5a1e;
    background: linear-gradient(135deg, #ffe6b8, #f2c979);
}

.tv-act-vip:hover {
    filter: brightness(1.04);
}

/* ------------------------------------------------------------- 巨幕轮播 */

.tv-main {
    padding-bottom: 8px;
}

.tv-hero {
    padding: 24px 0 4px;
}

.tv-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 18px;
    align-items: stretch;
}

.tv-carousel {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    background: #0b0e13;
    box-shadow: 0 12px 34px rgba(15, 25, 40, .12);
}

.tv-track {
    display: flex;
    transition: transform .55s cubic-bezier(.25, .8, .3, 1);
}

.tv-slide {
    position: relative;
    flex: 0 0 100%;
    width: 100%;
    aspect-ratio: 16 / 8.6;
    overflow: hidden;
}

.tv-slide>img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 24%;
}

.tv-slide::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(to top, rgba(6, 9, 14, .94) 0%, rgba(6, 9, 14, .62) 30%, rgba(6, 9, 14, .12) 58%, rgba(6, 9, 14, .26) 100%);
    pointer-events: none;
}

.tv-slide-info {
    position: absolute;
    left: 36px;
    right: 108px;
    bottom: 48px;
    z-index: 2;
    color: #fff;
}

.tv-kicker {
    display: inline-block;
    margin-bottom: 12px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    letter-spacing: .5px;
    color: #fff;
    background: rgba(255, 255, 255, .18);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}

.tv-slide-info h2 {
    margin: 0 0 10px;
    font-size: 30px;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -.5px;
    text-shadow: 0 2px 14px rgba(0, 0, 0, .4);
}

.tv-slide-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;
    margin-bottom: 10px;
    font-size: 13px;
    color: rgba(255, 255, 255, .8);
}

.tv-slide-meta .s {
    color: #ffb02e;
    font-weight: 700;
}

.tv-slide-desc {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0 0 18px;
    max-width: 620px;
    font-size: 13.5px;
    line-height: 1.65;
    color: rgba(255, 255, 255, .72);
}

.tv-play-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    padding: 0 22px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #00c2ff, #0a6bff);
    box-shadow: 0 8px 20px rgba(10, 107, 255, .38);
    transition: transform .18s, filter .18s;
}

.tv-play-btn svg {
    width: 14px;
    height: 14px;
    fill: #fff;
}

.tv-play-btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.06);
}

.tv-dots {
    position: absolute;
    right: 20px;
    bottom: 20px;
    z-index: 4;
    display: flex;
    gap: 6px;
}

.tv-dots b {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .42);
    cursor: pointer;
    transition: width .25s, border-radius .25s, background .25s;
}

.tv-dots b.on {
    width: 20px;
    border-radius: 6px;
    background: #fff;
}

.tv-arrow {
    position: absolute;
    top: 50%;
    z-index: 4;
    width: 36px;
    height: 36px;
    margin-top: -18px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(10, 14, 20, .42);
    color: #fff;
    cursor: pointer;
    opacity: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity .2s, background .2s;
}

.tv-arrow svg {
    width: 18px;
    height: 18px;
}

.tv-arrow:hover {
    background: rgba(10, 107, 255, .85);
}

.tv-arrow.prev {
    left: 14px;
}

.tv-arrow.next {
    right: 14px;
}

.tv-carousel:hover .tv-arrow {
    opacity: 1;
}

/* --------------------------------------------------------------- 侧榜单 */

.tv-rank {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 16px 4px 8px;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 6px 22px rgba(15, 25, 40, .055);
}

.tv-rank-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding: 0 14px 8px;
}

.tv-rank-head h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 800;
    letter-spacing: -.2px;
}

.tv-rank-head a {
    font-size: 12px;
    color: var(--tv-text-3);
}

.tv-rank-head a:hover {
    color: var(--tv-brand);
}

.tv-rank-list {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    margin: 0;
    padding: 0;
    list-style: none;
}

.tv-rank-list li a {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 5px 12px;
    border-radius: 8px;
    transition: background .16s;
}

.tv-rank-list li a:hover {
    background: #f5f8fb;
}

.tv-rank-no {
    flex: 0 0 18px;
    width: 18px;
    font-size: 14px;
    font-weight: 800;
    font-style: italic;
    text-align: center;
    color: #c6ccd5;
}

.tv-rank-list li:nth-child(1) .tv-rank-no {
    color: #ff4d4f;
}

.tv-rank-list li:nth-child(2) .tv-rank-no {
    color: #ff7a1a;
}

.tv-rank-list li:nth-child(3) .tv-rank-no {
    color: #ffb020;
}

.tv-rank-name {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 13.5px;
    color: #272c34;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tv-rank-list li a:hover .tv-rank-name {
    color: var(--tv-brand);
}

.tv-rank-tag {
    flex: 0 0 auto;
    max-width: 84px;
    font-size: 11.5px;
    color: var(--tv-text-3);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* --------------------------------------------------------------- 分区栏 */

.tv-sec {
    padding: 26px 0 4px;
}

.tv-sec-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.tv-sec-title {
    display: flex;
    align-items: baseline;
    gap: 10px;
    min-width: 0;
}

.tv-sec-title h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -.4px;
    color: #14161a;
}

.tv-sec-title span {
    font-size: 12.5px;
    color: var(--tv-text-3);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tv-more {
    display: inline-flex;
    align-items: center;
    gap: 1px;
    flex: 0 0 auto;
    font-size: 13px;
    color: var(--tv-text-2);
    transition: color .16s;
}

.tv-more svg {
    width: 14px;
    height: 14px;
}

.tv-more:hover {
    color: var(--tv-brand);
}

.tv-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 20px 14px;
}

/* --------------------------------------------------------------- 卡片 */

.tv-card {
    display: block;
    min-width: 0;
}

.tv-card-poster {
    position: relative;
    aspect-ratio: 3 / 4;
    border-radius: 10px;
    overflow: hidden;
    background: linear-gradient(150deg, #e8ebf0, #dde1e8);
    box-shadow: 0 2px 10px rgba(15, 25, 40, .07);
    transition: transform .22s ease, box-shadow .22s ease;
    isolation: isolate;
}

.tv-card-poster>img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s ease;
}

.tv-card:hover .tv-card-poster {
    transform: translateY(-5px);
    box-shadow: 0 16px 28px rgba(15, 25, 40, .18);
}

.tv-card:hover .tv-card-poster>img {
    transform: scale(1.045);
}

.tv-card-shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, .68) 0%, rgba(0, 0, 0, .12) 26%, rgba(0, 0, 0, 0) 48%);
    pointer-events: none;
}

.tv-card-remarks {
    position: absolute;
    left: 9px;
    bottom: 8px;
    max-width: calc(100% - 52px);
    font-size: 12px;
    line-height: 1.2;
    color: #fff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-shadow: 0 1px 4px rgba(0, 0, 0, .5);
}

.tv-card-score {
    position: absolute;
    right: 9px;
    bottom: 7px;
    font-size: 13px;
    font-weight: 800;
    font-style: italic;
    color: var(--tv-score);
    text-shadow: 0 1px 5px rgba(0, 0, 0, .6);
}

.tv-card-play {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 46px;
    height: 46px;
    margin: -23px 0 0 -23px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .92);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(.82);
    transition: opacity .2s, transform .2s;
    box-shadow: 0 6px 16px rgba(0, 0, 0, .25);
}

.tv-card-play svg {
    width: 17px;
    height: 17px;
    fill: #0a6bff;
    margin-left: 2px;
}

.tv-card:hover .tv-card-play {
    opacity: 1;
    transform: scale(1);
}

.tv-card-title {
    margin: 9px 0 0;
    font-size: 13.5px;
    font-weight: 500;
    color: #1b1f26;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color .16s;
}

.tv-card:hover .tv-card-title {
    color: #0a6bff;
}

.tv-card-sub {
    margin: 3px 0 0;
    font-size: 12px;
    color: var(--tv-text-3);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* --------------------------------------------------------------- 页脚 */

.tv-foot {
    margin-top: 44px;
    padding: 34px 0 26px;
    background: #17181c;
    color: #8d939d;
    font-size: 13px;
}

.tv-foot-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 30px;
    padding-bottom: 22px;
    border-bottom: 1px solid rgba(255, 255, 255, .07);
}

.tv-foot-links {
    display: flex;
    flex-wrap: wrap;
    gap: 9px 18px;
    max-width: 780px;
}

.tv-foot-links a {
    color: #a8aeb8;
    transition: color .16s;
}

.tv-foot-links a:hover {
    color: #fff;
}

.tv-foot-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    font-size: 17px;
    font-weight: 800;
    color: #e8ebf0;
}

.tv-foot-brand .tv-logo-mark {
    box-shadow: none;
}

.tv-foot-bottom {
    padding-top: 16px;
    font-size: 12.5px;
    line-height: 1.9;
    color: #62676f;
}

.tv-foot-bottom p {
    margin: 0;
}

/* --------------------------------------------------------------- 响应式 */

@media (max-width: 1180px) {
    .tv-hero-grid {
        grid-template-columns: minmax(0, 1fr) 300px;
    }

    .tv-nav {
        gap: 20px;
    }
}

@media (max-width: 1024px) {
    .tv-hero-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .tv-rank {
        display: none;
    }

    .tv-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }

    .tv-search {
        width: 190px;
    }
}

@media (max-width: 860px) {
    .tv-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 16px 12px;
    }

    .tv-slide-info h2 {
        font-size: 24px;
    }

    .tv-nav {
        gap: 18px;
    }

    .tv-nav a {
        font-size: 14.5px;
    }
}

@media (max-width: 760px) {
    .tv-header-inner {
        display: grid;
        grid-template-columns: auto 1fr;
        grid-template-areas:
            "logo actions"
            "search search"
            "nav nav";
        height: auto;
        padding: 9px 0 8px;
        row-gap: 8px;
        column-gap: 12px;
    }

    .tv-logo {
        grid-area: logo;
    }

    .tv-actions {
        grid-area: actions;
        justify-self: end;
    }

    .tv-search {
        grid-area: search;
        width: 100%;
        height: 34px;
    }

    .tv-search input {
        height: 34px;
    }

    .tv-search button {
        top: 3px;
    }

    .tv-nav {
        grid-area: nav;
        gap: 20px;
        padding-bottom: 2px;
    }

    .tv-hero {
        padding-top: 14px;
    }

    .tv-carousel {
        border-radius: 12px;
    }

    .tv-slide {
        aspect-ratio: 16 / 10;
    }

    .tv-slide-info {
        left: 16px;
        right: 16px;
        bottom: 16px;
    }

    .tv-slide-info h2 {
        font-size: 19px;
        margin-bottom: 6px;
    }

    .tv-kicker {
        margin-bottom: 8px;
        font-size: 11px;
        padding: 2px 8px;
    }

    .tv-slide-meta {
        font-size: 12px;
        gap: 6px 10px;
        margin-bottom: 8px;
    }

    .tv-slide-desc {
        display: none;
    }

    .tv-play-btn {
        height: 34px;
        padding: 0 16px;
        font-size: 13px;
    }

    .tv-dots {
        right: 12px;
        bottom: 12px;
    }

    .tv-arrow {
        display: none;
    }

    .tv-sec {
        padding: 20px 0 2px;
    }

    .tv-sec-title h2 {
        font-size: 18px;
    }

    .tv-sec-title span {
        display: none;
    }

    .tv-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 15px 9px;
    }

    .tv-card-poster {
        border-radius: 8px;
    }

    .tv-card-title {
        font-size: 12.5px;
        margin-top: 7px;
    }

    .tv-card-sub {
        font-size: 11px;
    }

    .tv-card-play {
        width: 38px;
        height: 38px;
        margin: -19px 0 0 -19px;
        opacity: 1;
        transform: scale(1);
        background: rgba(0, 0, 0, .34);
        box-shadow: none;
    }

    .tv-card-play svg {
        width: 14px;
        height: 14px;
        fill: #fff;
    }

    .tv-foot {
        margin-top: 30px;
        padding: 24px 0 20px;
    }

    .tv-foot-top {
        flex-direction: column;
        gap: 16px;
    }

    .tv-foot-bottom {
        font-size: 11.5px;
    }
}

@media (max-width: 420px) {
    .tv-wrap {
        padding: 0 12px;
    }

    .tv-grid {
        gap: 13px 7px;
    }

    .tv-logo-text {
        font-size: 18px;
    }

    .tv-act-vip {
        display: none;
    }
}

/* 图片加载失败时的占位（由 JS 加上 .is-broken） */
.tv-card-poster>img.is-broken,
.tv-slide>img.is-broken {
    opacity: 0;
}
