/* ==================== 1. 全局基础与暗黑配色 ==================== */
:root {
    --bg-body: #111111;
    --bg-card: #1a1a1a;
    --bg-header: #161616;
    --gold-primary: #f5b942;
    --gold-gradient: linear-gradient(135deg, #fce38a 0%, #f38181 100%);
    --vip-bg: linear-gradient(90deg, #e6b980 0%, #eacda3 100%);
    --text-main: #ffffff;
    --text-sub: #999999;
    --border-color: #262626;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", Arial, sans-serif;
    font-size: 13px;
    line-height: 1.4;
    overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
ul, li { list-style: none; }
.container { max-width: 1440px; margin: 0 auto; padding: 0 16px; }

/* ==================== 2. 顶部导航与搜索 ==================== */
header {
    background-color: var(--bg-header);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 80px;
    gap: 20px;
}

.logo {
    font-size: 22px;
    font-weight: 900;
    color: var(--gold-primary);
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.nav-links { 
    display: flex; 
    gap: 22px; 
    font-size: 25px; 
    font-weight: 500; 
}
.nav-links a { white-space: nowrap; }
.nav-links a:hover, .nav-links a.active { color: var(--gold-primary); font-weight: bold; }

/* 搜索框优化：防止移动端挤压换行 */
.search-box {
    display: flex;
    align-items: center;
    background: #252525;
    border-radius: 20px;
    padding: 5px 14px;
    width: 300px;
    border: 1px solid #333;
}
.search-box input {
    background: transparent;
    border: none;
    color: #fff;
    flex: 1;
    outline: none;
    font-size: 13px;
    min-width: 0;
}
.search-box button {
    background: transparent;
    border: none;
    color: var(--gold-primary);
    cursor: pointer;
    font-weight: bold;
    white-space: nowrap;
    padding-left: 8px;
}

/* 二级分类快捷筛选栏 */
.sub-nav {
    display: flex;
    gap: 20px;
    padding: 10px 0;
    font-size: 14px;
    border-top: 1px solid #1f1f1f;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.sub-nav::-webkit-scrollbar { display: none; }
.sub-nav a { color: var(--text-sub); white-space: nowrap; }
.sub-nav a.active { color: var(--gold-primary); font-weight: bold; position: relative; }
.sub-nav a.active::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 25%;
    width: 50%;
    height: 2px;
    background: var(--gold-primary);
    border-radius: 2px;
}

/* ==================== 3. 核心首焦区 (左大图 + 右今晚精选) ==================== */
.hero-section { display: grid; grid-template-columns: 1.2fr 1fr; gap: 16px; margin-top: 16px; }
.hero-main { position: relative; border-radius: 10px; overflow: hidden; height: 360px; background: #222; }
.hero-main img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.95) 10%, rgba(0,0,0,0.4) 60%, transparent 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 24px;
}
.hero-tag {
    display: inline-block;
    background: rgba(245, 185, 66, 0.2);
    color: var(--gold-primary);
    border: 1px solid var(--gold-primary);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    width: fit-content;
    margin-bottom: 8px;
}
.hero-title { font-size: 28px; font-weight: 800; margin-bottom: 8px; }
.hero-desc {
    color: #ccc;
    font-size: 13px;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.hero-actions { display: flex; gap: 12px; }
.btn-play { background: var(--gold-primary); color: #111; font-weight: bold; padding: 8px 22px; border-radius: 6px; font-size: 14px; }
.btn-fav { background: rgba(255,255,255,0.15); color: #fff; padding: 8px 18px; border-radius: 6px; font-size: 14px; backdrop-filter: blur(4px); }

/* 右侧：今晚精选 */
.hero-side { background: var(--bg-card); border-radius: 10px; padding: 14px; display: flex; flex-direction: column; }
.side-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; font-size: 15px; font-weight: bold; }
.side-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; flex: 1; }


/* ==================== 4. 今日热度榜 (已隐藏底部丑陋滚动条) ==================== */
.trending-bar {
    background: var(--bg-card);
    border-radius: 8px;
    padding: 12px 16px;
    margin: 16px 0;
    display: flex;
    align-items: center;
    gap: 16px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.trending-bar::-webkit-scrollbar { display: none; height: 0; }

.trending-label { color: var(--gold-primary); font-weight: 800; white-space: nowrap; display: flex; align-items: center; gap: 4px; font-size: 14px; }
.trending-list { display: flex; gap: 16px; flex: 1; }
.trending-item { display: flex; align-items: center; gap: 8px; background: #222; padding: 6px 10px; border-radius: 6px; min-width: 190px; }
.rank-num { font-weight: 900; font-size: 14px; width: 20px; text-align: center; color: #888; }
.trending-item:nth-child(1) .rank-num { color: #ff4d4f; }
.trending-item:nth-child(2) .rank-num { color: #ff7a45; }
.trending-item:nth-child(3) .rank-num { color: #ffa940; }
.trending-info { overflow: hidden; }
.trending-name { font-weight: bold; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trending-hits { font-size: 11px; color: var(--text-sub); }

/* ==================== 5. 核心网格与绝对统一尺寸封面容器 ==================== */
.section-header { display: flex; justify-content: space-between; align-items: center; margin: 20px 0 12px; }
.section-title { font-size: 28px; font-weight: bold; }
.section-more { color: var(--text-sub); font-size: 12px; }

.vod-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 12px; }
.vod-card { display: flex; flex-direction: column; width: 100%; overflow: hidden; transition: transform 0.2s ease; }
.vod-card:hover { transform: translateY(-4px); }

/* 严格锁死容器比例为 3:4 竖屏比例，绝对不参差不齐 */
.poster-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 4;
    height: 0;
    padding-bottom: 133.33% !important; /* 兼容性兜底：强制所有格子高度完全一致 */
    border-radius: 6px;
    overflow: hidden;
    background: #1a1a1a;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* 强制图片绝对定位并居中裁切填满容器，绝不拉伸变形 */
.poster-wrap img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.badge-rank { position: absolute; top: 0; left: 0; background: rgba(0, 0, 0, 0.7); color: #fff; font-size: 11px; font-weight: bold; padding: 2px 6px; border-bottom-right-radius: 6px; z-index: 2; }
.vod-card:nth-child(1) .badge-rank { background: #d4380d; }
.vod-card:nth-child(2) .badge-rank { background: #d46b08; }
.vod-card:nth-child(3) .badge-rank { background: #d48806; }

.badge-type { position: absolute; top: 6px; right: 6px; background: rgba(20, 20, 20, 0.85); border: 1px solid var(--gold-primary); color: var(--gold-primary); font-size: 10px; font-weight: bold; padding: 1px 5px; border-radius: 4px; z-index: 2; }
.badge-type.vip { background: var(--vip-bg); color: #111; border: none; }

.poster-bottom { position: absolute; bottom: 0; left: 0; right: 0; background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, transparent 100%); padding: 16px 6px 5px; display: flex; justify-content: flex-end; font-size: 11px; color: #ddd; z-index: 1; }

.vod-title { margin-top: 6px; font-size: 13px; font-weight: 600; color: #f0f0f0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vod-card:hover .vod-title { color: var(--gold-primary); }
.vod-remarks { font-size: 11px; color: var(--text-sub); margin-top: 2px; }

/* ==================== 6. 底部标签云与导航增强样式 ==================== */
.site-footer {
    margin-top: 50px;
    background: #0a0a0a;
    border-top: 1px solid var(--border-color);
    padding: 40px 0 30px;
    color: var(--text-sub);
    font-size: 12px;
    line-height: 1.6;
}
.footer-intro { margin-bottom: 24px; }
.footer-intro h3 { color: #fff; font-size: 15px; margin-bottom: 8px; font-weight: bold; }
.footer-intro p { color: #888; margin-bottom: 6px; }
.footer-sub-desc { color: #777; }

.footer-tags-section { margin-bottom: 24px; padding-bottom: 20px; border-bottom: 1px solid #1a1a1a; }
.tags-group-title { color: #bbb; font-weight: bold; margin-bottom: 10px; }
.tags-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-item {
    background: #181818;
    color: #999;
    padding: 4px 10px;
    border-radius: 4px;
    border: 1px solid #242424;
    transition: all 0.2s ease;
}
.tag-item:hover { color: var(--gold-primary); border-color: var(--gold-primary); background: rgba(245, 185, 66, 0.05); }

.footer-nav-links { display: flex; flex-wrap: wrap; gap: 20px; margin-bottom: 16px; font-size: 13px; font-weight: 500; }
.footer-nav-links a { color: #ccc; }
.footer-nav-links a:hover { color: var(--gold-primary); }

.footer-links { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 16px; color: #777; }
.links-title { color: #999; }
.footer-links a { color: #777; }
.footer-links a:hover { color: var(--gold-primary); }

.footer-copyright { padding-top: 16px; border-top: 1px solid #161616; color: #666; }

/* ==================== 7. 响应式与手机端完美适配 ==================== */
@media (max-width: 1200px) { 
    .vod-grid { grid-template-columns: repeat(6, 1fr); } 
}

@media (max-width: 900px) { 
    .hero-section { grid-template-columns: 1fr; } 
    .vod-grid { grid-template-columns: repeat(4, 1fr); } 

    /* 手机端顶部重构：上下排列，保留一级分类并改为横向滑动 */
    .nav-top {
        height: auto;
        flex-direction: column;
        align-items: stretch;
        padding: 10px 0;
        gap: 10px;
    }
    .search-box {
        width: 100%;
    }
    .nav-links {
        display: flex;
        gap: 16px;
        font-size: 14px;
        overflow-x: auto;
        padding-bottom: 4px;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    .nav-links::-webkit-scrollbar { display: none; }
}

@media (max-width: 600px) { 
    .vod-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; } 
    .hero-main { height: 240px; } 
    .hero-title { font-size: 20px; } 
}

/* ==================== 分类页多维筛选面板样式 ==================== */
.filter-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 16px 20px;
    margin-top: 16px;
}

.filter-row {
    display: flex;
    align-items: flex-start;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    gap: 16px;
}
.filter-row:last-child {
    border-bottom: none;
}

.filter-label {
    color: var(--text-sub);
    font-weight: bold;
    font-size: 13px;
    min-width: 45px;
    padding-top: 4px;
}

.filter-items {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex: 1;
}

.filter-items a {
    color: #aaa;
    background: #222;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 13px;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.filter-items a:hover {
    color: var(--gold-primary);
    background: rgba(245, 185, 66, 0.05);
}

.filter-items a.active {
    color: #111;
    background: var(--gold-primary);
    font-weight: bold;
    border-color: var(--gold-primary);
}

/* 手机端筛选面板自适应 */
@media (max-width: 768px) {
    .filter-panel {
        padding: 12px;
    }
    .filter-row {
        flex-direction: column;
        gap: 6px;
    }
    .filter-label {
        min-width: auto;
    }
}
/* ==================== 分页组件样式 ==================== */
.mac-pages {
    display: flex;
    justify-content: center;
    margin: 40px 0 20px;
}

.page-list {
    display: flex;
    align-items: center;
    gap: 8px;
}

.page-list a, 
.page-list span {
    background: var(--bg-card);
    color: #bbb;
    border: 1px solid var(--border-color);
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 13px;
    transition: all 0.2s ease;
}

.page-list a:hover {
    color: var(--gold-primary);
    border-color: var(--gold-primary);
    background: rgba(245, 185, 66, 0.05);
}

.page-list .current {
    background: var(--gold-primary);
    color: #111;
    font-weight: bold;
    border-color: var(--gold-primary);
}

.page-list .disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}
/* ==================== 视频详情页样式 ==================== */
.vod-detail-box {
    display: flex;
    gap: 30px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
}

/* 左侧海报固定宽度 */
.vod-detail-poster {
    width: 240px;
    flex-shrink: 0;
}
.vod-detail-poster .poster-wrap {
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

/* 右侧信息排版 */
.vod-detail-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.vod-detail-title {
    font-size: 24px;
    font-weight: bold;
    color: #fff;
    margin: 0;
}

.vod-meta-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.meta-badge {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 13px;
    color: #aaa;
}

.vod-actor-info, .vod-desc-info {
    font-size: 13px;
    color: #ccc;
    line-height: 1.6;
}

.vod-actor-info .label, .vod-desc-info .label {
    color: var(--text-sub);
    font-weight: bold;
}

.vod-desc-info p {
    margin: 4px 0 0 0;
    color: #999;
}

/* 立即播放按钮 */
.vod-action-btns {
    margin-top: 10px;
}

.btn-play-now {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--gold-primary);
    color: #111;
    font-weight: bold;
    padding: 10px 28px;
    border-radius: 6px;
    font-size: 15px;
    transition: all 0.2s ease;
    text-decoration: none;
}
.btn-play-now:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* ==================== 短剧选集数字网格样式 ==================== */
.episode-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(54px, 1fr));
    gap: 10px;
    max-height: 260px;
    overflow-y: auto;
    padding-right: 4px;
}

/* 自定义选集滚动条 */
.episode-grid::-webkit-scrollbar {
    width: 6px;
}
.episode-grid::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 3px;
}

.episode-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: #ccc;
    text-align: center;
    padding: 10px 0;
    border-radius: 6px;
    font-size: 14px;
    font-weight: bold;
    text-decoration: none;
    transition: all 0.2s ease;
}

.episode-item:hover {
    color: var(--gold-primary);
    border-color: var(--gold-primary);
    background: rgba(245, 185, 66, 0.05);
}

/* 移动端自适应 */
@media (max-width: 768px) {
    .vod-detail-box {
        flex-direction: column;
        padding: 16px;
    }
    .vod-detail-poster {
        width: 100%;
        max-width: 180px;
        margin: 0 auto;
    }
    .vod-detail-title {
        font-size: 20px;
        text-align: center;
    }
    .vod-meta-tags {
        justify-content: center;
    }
}
/* ==================== 视频播放页双栏布局 ==================== */
.play-main-box {
    display: flex;
    gap: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
}

/* 左侧播放器容器 */
.player-wrapper {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

/* 播放器视口（强制撑开高度，适配电脑端与短剧竖屏播放器） */
.player-viewport {
    position: relative;
    width: 100%;
    height: 540px;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
}

/* 强制苹果CMS注入的 iframe/video 100% 铺满视口 */
.player-viewport iframe, 
.player-viewport object, 
.player-viewport embed {
    width: 100% !important;
    height: 100% !important;
    border: none;
    display: block;
}

/* 播放器下方信息控制条 */
.player-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 4px 4px;
    gap: 12px;
}

.playing-info {
    display: flex;
    align-items: baseline;
    gap: 12px;
    overflow: hidden;
}

.playing-title {
    font-size: 18px;
    font-weight: bold;
    color: #fff;
    text-decoration: none;
    white-space: nowrap;
}
.playing-title:hover {
    color: var(--gold-primary);
}

.playing-ep {
    font-size: 13px;
    color: var(--gold-primary);
    white-space: nowrap;
}

.player-controls {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.ctrl-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-color);
    color: #ddd;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 13px;
    text-decoration: none;
    transition: all 0.2s;
}
.ctrl-btn:hover {
    border-color: var(--gold-primary);
    color: var(--gold-primary);
}
.ctrl-btn.disabled {
    opacity: 0.4;
    pointer-events: none;
}

/* 右侧选集侧边栏 */
.play-sidebar {
    width: 320px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 14px;
    max-height: 590px;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-title {
    font-size: 15px;
    font-weight: bold;
    color: #fff;
}

.sidebar-sub {
    font-size: 12px;
    color: var(--text-sub);
}

.play-source-tabs {
    display: flex;
    gap: 8px;
    margin: 12px 0;
    flex-wrap: wrap;
}

.source-tab {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    color: #999;
}
.source-tab.active {
    background: rgba(245, 185, 66, 0.15);
    color: var(--gold-primary);
    border: 1px solid rgba(245, 185, 66, 0.4);
}

/* 侧边栏数字选集网格 */
.sidebar-episode-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    overflow-y: auto;
    padding-right: 4px;
}

.sidebar-episode-grid::-webkit-scrollbar {
    width: 5px;
}
.sidebar-episode-grid::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 3px;
}

.ep-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: #ccc;
    text-align: center;
    padding: 8px 0;
    border-radius: 5px;
    font-size: 13px;
    font-weight: bold;
    text-decoration: none;
    transition: all 0.2s;
}
.ep-btn:hover {
    color: var(--gold-primary);
    border-color: var(--gold-primary);
}
/* 当前正在播放的集数高亮 */
.ep-btn.active {
    background: var(--gold-primary);
    color: #111;
    border-color: var(--gold-primary);
}

/* 底部简介卡片 */
.info-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 16px 20px;
}
.info-header {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}
.info-header .tag {
    background: rgba(255, 255, 255, 0.05);
    color: #aaa;
    font-size: 12px;
    padding: 3px 8px;
    border-radius: 4px;
}
.info-desc {
    font-size: 13px;
    color: #999;
    line-height: 1.6;
    margin: 0;
}

/* 播放页移动端自适应 */
@media (max-width: 900px) {
    .play-main-box {
        flex-direction: column;
        padding: 12px;
    }
    .player-viewport {
        height: 260px; /* 手机端自动调整播放器高度 */
    }
    .play-sidebar {
        width: 100%;
        max-height: 300px;
    }
    .sidebar-episode-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}
/* 播放器视口与内部流媒体自适应加固 */
.player-viewport {
    position: relative;
    width: 100%;
    height: 540px;
    background: #000 !important;
    border-radius: 8px;
    overflow: hidden;
}

.player-viewport iframe,
.player-viewport video,
.player-viewport object,
.player-viewport embed {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    border: none;
    background: #000;
}