/* ==========================================================================
   泛影视站群CMS - Default Template Stylesheet
   Netflix-inspired dark theme
   ========================================================================== */

:root {
    --bg:           #0f0f0f;
    --bg-card:      #1a1a1a;
    --bg-elevated:  #232323;
    --text:         #ffffff;
    --text-dim:     #b3b3b3;
    --text-muted:   #6b6b6b;
    --primary:      #e50914;
    --primary-dark: #b00710;
    --border:       #2a2a2a;
    --radius:       8px;
    --radius-lg:    12px;
    --header-h:     64px;
    --max-w:        1280px;
    --shadow:       0 4px 20px rgba(0, 0, 0, 0.5);
    --shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.7);
    --transition:   0.2s ease;
}

/* ---------- Reset ---------- */
*,
*::before,
*::after { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
                 "Hiragino Sans GB", "Microsoft YaHei", "微软雅黑", Roboto,
                 Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary); }

img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; }
input, button { font-family: inherit; }

ul, ol { list-style: none; }

/* ---------- Layout helpers ---------- */
.container {
    width: 100%;
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 16px;
}

.section { padding: 32px 0; }
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}
.section-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}
.section-title::before {
    content: "";
    display: inline-block;
    width: 4px;
    height: 18px;
    background: var(--primary);
    border-radius: 2px;
}
.section-more {
    font-size: 13px;
    color: var(--text-dim);
}
.section-more:hover { color: var(--primary); }

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(15, 15, 15, 0.96);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    /* 允许 header 高度自适应: nav 折行时 header 自动变高 (修复: 之前固定 64px 导致 nav 折行被裁切) */
    min-height: var(--header-h);
    height: auto;
}
.site-header .inner {
    min-height: var(--header-h);
    height: auto;
    display: flex;
    align-items: center;
    gap: 20px;
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 8px 16px;
    flex-wrap: wrap;
}
.site-logo {
    font-size: 22px;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.5px;
    white-space: nowrap;
    flex-shrink: 0;
}
.site-logo:hover { color: var(--primary); }

.main-nav {
    display: flex;
    align-items: center;
    gap: 18px;  /* 缩小间距 24→18, 容纳更多项 */
    flex: 1;
    flex-wrap: wrap;  /* 关键: 允许折行, 所有分类可见 (修复: 之前 overflow-x:auto + 隐藏滚动条导致 17 项被遮蔽) */
    row-gap: 4px;
}
.main-nav a {
    color: var(--text-dim);
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    padding: 8px 0;
    position: relative;
}
.main-nav a:hover { color: var(--text); }
.main-nav a.active {
    color: var(--text);
}
.main-nav a.active::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary);
    border-radius: 1px;
}

/* === 下拉菜单 (有子分类的父分类 ▾) === */
.nav-item-dropdown {
    position: relative;
    display: inline-flex;
    align-items: center;
}
.nav-item-dropdown > a {
    color: var(--text-dim);
    font-size: 14px;
    font-weight: 500;
    padding: 8px 0;
    position: relative;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.nav-item-dropdown > a:hover { color: var(--text); }
.nav-item-dropdown.active > a { color: var(--text); }
.nav-item-dropdown.active > a::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary);
    border-radius: 1px;
}
.nav-arrow {
    font-size: 11px;
    color: var(--text-dim);
    transition: transform .15s, color .15s;
    display: inline-block;
    line-height: 1;
}
.nav-item-dropdown:hover .nav-arrow {
    transform: rotate(180deg);
    color: var(--primary);
}
.nav-submenu {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 200;
    list-style: none;
    margin: 0;
    padding: 6px 0;
    background: rgba(20, 20, 20, 0.98);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 6px;
    min-width: 140px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    /* 默认隐藏: hover 显示 */
    display: none;
    flex-direction: column;
    gap: 0;
}
.nav-item-dropdown:hover .nav-submenu,
.nav-item-dropdown:focus-within .nav-submenu {
    display: flex;
}
.nav-submenu li {
    width: 100%;
}
.nav-submenu a {
    display: block;
    padding: 8px 16px;
    color: var(--text-dim);
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    position: relative;
}
.nav-submenu a:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.04);
}
.nav-submenu a.active {
    color: var(--primary);
    background: rgba(229, 9, 20, 0.08);
}
.nav-submenu a.active::after { display: none; } /* 子菜单项不要下划线 */

.search-form {
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 4px 4px 4px 14px;
    transition: border-color var(--transition);
    flex-shrink: 0;
}
.search-form:focus-within { border-color: var(--primary); }
.search-form input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text);
    font-size: 13px;
    width: 140px;
}
.search-form input::placeholder { color: var(--text-muted); }
.search-form button {
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 16px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: background var(--transition);
}
.search-form button:hover { background: var(--primary-dark); }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
    background: #0a0a0a;
    border-top: 1px solid var(--border);
    padding: 32px 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 48px;
}
.site-footer .footer-name {
    color: var(--text-dim);
    font-weight: 600;
    margin-bottom: 6px;
}
.site-footer a { color: var(--text-dim); }
.site-footer a:hover { color: var(--primary); }
.site-footer .footer-links {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

/* ==========================================================================
   Hero banner
   ========================================================================== */
.hero-banner {
    position: relative;
    min-height: 420px;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
    background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 50%, #0f0f0f 100%);
    border-radius: 0;
    margin-bottom: 24px;
}
.hero-banner .hero-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center top;
    background-repeat: no-repeat;
    opacity: 0.6;
}
.hero-banner .hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(15,15,15,0.95) 0%, rgba(15,15,15,0.6) 50%, rgba(15,15,15,0.2) 100%),
                linear-gradient(0deg, rgba(15,15,15,1) 0%, rgba(15,15,15,0) 60%);
}
.hero-banner .hero-content {
    position: relative;
    z-index: 1;
    max-width: 640px;
    padding: 32px 16px 40px;
    max-width: var(--max-w);
    width: 100%;
    margin: 0 auto;
}
.hero-title {
    font-size: 32px;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 12px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.6);
}
.hero-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.hero-badges .badge {
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}
.badge-score-hero { background: var(--primary); color: #fff; }
.badge-year-hero { background: rgba(255,255,255,0.15); color: var(--text); }
.badge-remarks-hero { background: rgba(229,9,20,0.2); color: var(--primary); border: 1px solid rgba(229,9,20,0.4); }
.hero-desc {
    color: var(--text-dim);
    font-size: 14px;
    line-height: 1.7;
    margin-bottom: 20px;
    max-width: 560px;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 22px;
    border-radius: var(--radius);
    border: none;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    transition: all var(--transition);
    cursor: pointer;
    white-space: nowrap;
}
.btn-primary {
    background: var(--primary);
    color: #fff;
}
.btn-primary:hover {
    background: var(--primary-dark);
    color: #fff;
}
.btn-ghost {
    background: rgba(255,255,255,0.1);
    color: var(--text);
    border: 1px solid rgba(255,255,255,0.15);
}
.btn-ghost:hover {
    background: rgba(255,255,255,0.18);
    color: var(--text);
}
.btn-lg { padding: 12px 28px; font-size: 15px; }

/* ==========================================================================
   Video grid & card
   ========================================================================== */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
}

.video-card {
    display: block;
    background: transparent;
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform var(--transition);
    cursor: pointer;
}
.video-card:hover {
    transform: scale(1.05);
    z-index: 2;
}

.video-card .poster {
    position: relative;
    aspect-ratio: 2 / 3;
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-elevated) 100%);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: box-shadow var(--transition);
}
.video-card:hover .poster {
    box-shadow: var(--shadow-hover);
}
.video-card .poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}
.video-card:hover .poster img { transform: scale(1.08); }

.video-card .poster-fallback {
    display: none;
    position: absolute;
    inset: 0;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    font-weight: 800;
    color: var(--primary);
    text-transform: uppercase;
}
.video-card .poster.no-pic .poster-fallback { display: flex; }

.badge {
    position: absolute;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    z-index: 2;
    line-height: 1.4;
    backdrop-filter: blur(2px);
}
.badge-remarks {
    bottom: 6px;
    left: 6px;
    background: rgba(0,0,0,0.7);
    color: #fff;
    max-width: calc(100% - 12px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.badge-score {
    top: 6px;
    right: 6px;
    background: var(--primary);
    color: #fff;
}

.video-card .card-body {
    padding: 8px 2px 4px;
}
.video-card .card-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.4;
}
.video-card .card-meta {
    font-size: 12px;
    color: var(--text-dim);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-top: 2px;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-dim);
}
.empty-state .empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
    color: var(--text-muted);
}
.empty-state h3 {
    font-size: 18px;
    color: var(--text);
    margin-bottom: 6px;
}

/* ==========================================================================
   Breadcrumb
   ========================================================================== */
.breadcrumb {
    font-size: 12px;
    color: var(--text-muted);
    padding: 14px 0;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.breadcrumb a { color: var(--text-dim); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb .sep { color: var(--text-muted); }
.breadcrumb .current { color: var(--text); }

/* ==========================================================================
   List page
   ========================================================================== */
.list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0 18px;
    flex-wrap: wrap;
    gap: 12px;
}
.list-header h1 {
    font-size: 22px;
    font-weight: 700;
}
.list-header .count {
    color: var(--text-dim);
    font-size: 13px;
}

/* ==========================================================================
   Detail page
   ========================================================================== */
.detail-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 32px;
    padding: 24px 0;
}
.detail-poster {
    aspect-ratio: 2 / 3;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    position: relative;
}
.detail-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.detail-poster .poster-fallback {
    display: none;
    position: absolute;
    inset: 0;
    align-items: center;
    justify-content: center;
    font-size: 80px;
    font-weight: 800;
    color: var(--primary);
}
.detail-poster.no-pic .poster-fallback { display: flex; }

.detail-info h1 {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 6px;
}
.detail-info .vod-sub {
    color: var(--text-dim);
    font-size: 14px;
    margin-bottom: 14px;
}
.detail-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}
.detail-meta .meta-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-dim);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
}
.detail-meta .meta-item.score {
    background: rgba(229,9,20,0.15);
    border-color: rgba(229,9,20,0.4);
    color: var(--primary);
    font-weight: 700;
}
.detail-meta .meta-item.remarks {
    background: rgba(229,9,20,0.15);
    border-color: rgba(229,9,20,0.4);
    color: var(--primary);
}

.detail-row {
    margin-bottom: 14px;
    font-size: 13px;
    line-height: 1.8;
}
.detail-row .label {
    color: var(--text-muted);
    display: inline-block;
    min-width: 56px;
}
.detail-row .value {
    color: var(--text-dim);
}
.detail-row .value.content {
    color: var(--text-dim);
    line-height: 1.9;
    display: block;
    margin-top: 6px;
    padding: 12px 14px;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.detail-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    flex-wrap: wrap;
}

/* Play lines list */
.play-lines {
    margin-top: 18px;
}
.play-lines .line-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 8px;
    transition: all var(--transition);
}
.play-lines .line-item:hover {
    border-color: var(--primary);
    background: var(--bg-elevated);
}
.play-lines .line-name {
    font-weight: 600;
    color: var(--text);
    font-size: 14px;
}
.play-lines .line-ep-count {
    color: var(--text-dim);
    font-size: 12px;
}

/* ==========================================================================
   Play / vodplay page
   ========================================================================== */
.play-area {
    background: #000;
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin: 16px 0;
    aspect-ratio: 16 / 9;
    max-height: 540px;
    box-shadow: var(--shadow);
}
.play-area iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}
.play-area-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 480px;
    background: var(--bg-card);
    color: var(--text-muted);
    border-radius: var(--radius-lg);
    font-size: 16px;
}

.play-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 6px;
}
.play-current-ep {
    color: var(--text-dim);
    font-size: 13px;
    margin-bottom: 16px;
}

.tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 4px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border);
}
.tabs::-webkit-scrollbar { display: none; }
.tab-btn {
    padding: 8px 16px;
    background: transparent;
    color: var(--text-dim);
    border: none;
    border-bottom: 2px solid transparent;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    transition: all var(--transition);
    margin-bottom: -1px;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.ep-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 8px;
    margin-bottom: 24px;
}
.ep-btn {
    padding: 8px 6px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-dim);
    font-size: 13px;
    text-align: center;
    transition: all var(--transition);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ep-btn:hover {
    border-color: var(--primary);
    color: var(--text);
    background: var(--bg-elevated);
}
.ep-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    font-weight: 600;
}

/* ==========================================================================
   Pagination
   ========================================================================== */
.pagination {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    padding: 28px 0 12px;
}
.pagination .page-info {
    color: var(--text-dim);
    font-size: 13px;
    margin-right: 8px;
}
.page-btn {
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-dim);
    font-size: 13px;
    font-weight: 500;
    transition: all var(--transition);
}
.page-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.page-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.page-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

/* ==========================================================================
   Search page
   ========================================================================== */
.search-header {
    padding: 20px 0 18px;
}
.search-header h1 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 4px;
}
.search-header h1 .kw { color: var(--primary); }
.search-header .count {
    color: var(--text-dim);
    font-size: 13px;
}

/* ==========================================================================
   404 page
   ========================================================================== */
.error-page {
    text-align: center;
    padding: 80px 20px;
}
.error-page .error-code {
    font-size: 96px;
    font-weight: 900;
    color: var(--primary);
    line-height: 1;
    margin-bottom: 12px;
    letter-spacing: -4px;
}
.error-page .error-msg {
    font-size: 18px;
    color: var(--text-dim);
    margin-bottom: 28px;
}

/* ==========================================================================
   Utilities
   ========================================================================== */
.text-dim { color: var(--text-dim); }
.text-muted { color: var(--text-muted); }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.hidden { display: none; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 768px) {
    .site-header .inner { gap: 12px; padding: 0 12px; }
    .site-logo { font-size: 18px; }
    .main-nav { gap: 14px; }
    .main-nav a { font-size: 13px; }
    .search-form input { width: 100px; }

    .hero-banner { min-height: 320px; }
    .hero-banner .hero-content { padding: 24px 12px 28px; }
    .hero-title { font-size: 22px; }
    .hero-desc { font-size: 13px; -webkit-line-clamp: 3; display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }

    .video-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .video-card .card-title { font-size: 12px; }
    .video-card .card-meta { font-size: 11px; }

    .detail-layout {
        grid-template-columns: 1fr;
        gap: 18px;
    }
    .detail-poster {
        max-width: 200px;
        margin: 0 auto;
    }
    .detail-info h1 { font-size: 22px; }

    .play-area { aspect-ratio: 16 / 9; max-height: 280px; }
    .play-area-empty { height: 280px; font-size: 14px; }

    .ep-grid {
        grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
        gap: 6px;
    }
    .ep-btn { font-size: 12px; padding: 6px 4px; }

    .section-title { font-size: 17px; }
    .section { padding: 22px 0; }

    .error-page .error-code { font-size: 72px; }
}

@media (max-width: 480px) {
    .video-grid { gap: 8px; }
    .search-form input { width: 80px; }
    .hero-banner { min-height: 260px; }
}

/* ========== 泛页面样式 ========== */
.pan-page { max-width: 1200px; margin: 0 auto; padding: 20px 16px 40px; }
.pan-page .breadcrumb { margin-bottom: 16px; font-size: 13px; color: var(--text-dim); }
.pan-page .breadcrumb .sep { margin: 0 6px; opacity: 0.5; }
.pan-page .breadcrumb .tag { color: var(--text); background: var(--bg-card); padding: 2px 8px; border-radius: 4px; font-size: 12px; }

.pan-header { margin-bottom: 24px; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.pan-title { font-size: 28px; font-weight: 800; line-height: 1.3; color: var(--text); margin: 0 0 12px; }
.pan-meta { display: flex; flex-wrap: wrap; gap: 8px; }
.ctx-chip { display: inline-flex; align-items: center; padding: 4px 12px; border-radius: 16px; font-size: 12px; font-weight: 500; background: rgba(229,9,20,0.15); color: var(--primary); border: 1px solid rgba(229,9,20,0.3); }
.ctx-area { background: rgba(34,197,94,0.15); color: #22c55e; border-color: rgba(34,197,94,0.3); }
.ctx-type { background: rgba(59,130,246,0.15); color: #3b82f6; border-color: rgba(59,130,246,0.3); }
.ctx-year { background: rgba(245,158,11,0.15); color: #f59e0b; border-color: rgba(245,158,11,0.3); }
.ctx-director { background: rgba(168,85,247,0.15); color: #a855f7; border-color: rgba(168,85,247,0.3); }
.ctx-actor { background: rgba(236,72,153,0.15); color: #ec4899; border-color: rgba(236,72,153,0.3); }

.pan-content { margin-bottom: 32px; line-height: 1.9; color: var(--text-dim); font-size: 15px; }
.pan-content p { margin-bottom: 16px; text-indent: 2em; }

.pan-section { margin-bottom: 32px; }
.section-title { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 700; color: var(--text); margin: 0 0 16px; }
.section-title .title-bar { width: 4px; height: 20px; background: var(--primary); border-radius: 2px; }

.pan-links .link-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.pan-link { display: block; padding: 10px 14px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px; color: var(--text-dim); font-size: 13px; transition: all 0.2s; text-transform: capitalize; }
.pan-link:hover { background: var(--primary); color: #fff; border-color: var(--primary); transform: translateY(-1px); }

.pan-seo { margin-top: 40px; }
.seo-meta { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 16px 20px; }
.seo-row { display: flex; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.seo-row:last-child { border-bottom: none; }
.seo-label { flex-shrink: 0; width: 80px; color: var(--text-dim); font-weight: 500; }
.seo-value { color: var(--text); flex: 1; word-break: break-all; }

@media (max-width: 640px) {
    .pan-title { font-size: 22px; }
    .pan-content { font-size: 14px; }
    .pan-links .link-grid { grid-template-columns: 1fr; }
}

/* ========== 播放器样式 ========== */
.play-area { position: relative; width: 100%; aspect-ratio: 16/9; max-height: 560px; background: #000; border-radius: 8px; overflow: hidden; margin-bottom: 16px; }
.play-area video, .play-area iframe { width: 100%; height: 100%; border: 0; display: block; }
.play-area-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; color: var(--text-dim); gap: 8px; }
.play-area-empty .empty-icon { font-size: 48px; }
.play-area-empty h3 { margin: 0; font-size: 18px; }

.player-loading { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; background: rgba(0,0,0,0.7); color: #fff; gap: 12px; z-index: 5; }
.loading-spinner { width: 40px; height: 40px; border: 3px solid rgba(255,255,255,0.2); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { font-size: 14px; color: rgba(255,255,255,0.8); }

.player-error { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; background: rgba(0,0,0,0.85); color: #fff; gap: 8px; text-align: center; padding: 20px; }
.player-error .error-icon { font-size: 48px; color: #ef4444; }
.player-error h3 { margin: 0; font-size: 18px; color: #fff; }
.player-error p { margin: 0; font-size: 13px; color: rgba(255,255,255,0.7); max-width: 400px; }
.player-error .error-detail { font-size: 11px; color: rgba(255,255,255,0.5); font-family: monospace; }

.play-title { font-size: 22px; font-weight: 700; margin: 16px 0 8px; color: var(--text); }
.play-current-ep { font-size: 13px; color: var(--text-dim); margin-bottom: 16px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.play-current-ep strong { color: var(--text); }
.play-url-badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 10px; font-weight: 600; background: rgba(229,9,20,0.15); color: var(--primary); border: 1px solid rgba(229,9,20,0.3); }

/* 无播放地址提示 */
.btn-disabled { background: rgba(107,114,128,0.15); color: #6b7280; cursor: not-allowed; border: 1px solid rgba(107,114,128,0.2); }
.no-play-notice { display: flex; align-items: center; gap: 10px; padding: 14px 16px; background: rgba(245,158,11,0.1); border: 1px solid rgba(245,158,11,0.2); border-radius: 8px; color: #92400e; font-size: 14px; }
.no-play-notice .notice-icon { font-size: 20px; }
.no-play-notice a { color: var(--primary); text-decoration: underline; }

/* ========================================
   广告位样式 (.ad-zone)
   所有广告位由 renderAd() 渲染, 包含:
   - .ad-zone        外层包装
   - .ad-zone-head   顶部标签栏 (广告标识 + 名称 + 关闭按钮)
   - .ad-zone-body   广告代码渲染区
   - .ad-zone-foot   底部免责声明
   ======================================== */

.ad-container { max-width: var(--max-w); margin: 16px auto; padding: 0 16px; box-sizing: border-box; }
.ad-container.ad-container-header { margin-top: 0; }
.ad-container.ad-container-footer { margin-bottom: 0; }
.ad-container.ad-container-detail { margin: 20px auto; }
.ad-container.ad-container-before-play { margin-bottom: 0; margin-top: 12px; }
/* before_play 广告紧贴播放器上方, 无间隙, 无左侧红线, 共享圆角形成一体 */
.ad-container-before-play + .play-area,
.ad-container-before-play ~ .play-area { margin-top: 0; border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
/* before_play 广告隐藏底部免责声明 (避免与播放器之间产生间隙) */
.ad-container-before-play .ad-zone-foot { display: none; }
.ad-container-before-play .ad-zone-body { padding: 0; }
/* 广告与播放器共享圆角: 广告顶部圆角, 底部直角; 播放器顶部直角, 底部圆角 */
.ad-container-before-play .ad-zone {
    border: 0;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    overflow: hidden;
}
.ad-container-before-play .ad-zone-head {
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
/* before_play 广告内的 #preRollAd 与播放器同宽 */
.ad-container-before-play #preRollAd {
    border-radius: 0 !important;
    max-width: 100% !important;
}

/* 广告位外层 */
.ad-zone {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-left: 3px solid var(--primary);
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
    box-shadow: var(--shadow);
}

/* 列表间广告卡片 - 与视频卡片同尺寸 */
.video-card-ad-slot {
    /* 由 .video-grid 的 grid 布局接管 */
}
.video-card-ad-slot .ad-zone {
    border-left: 3px solid var(--primary);
    height: 100%;
    box-sizing: border-box;
}
.video-card-ad-slot .ad-zone-body { padding: 0; }
.video-card-ad-slot .ad-zone-head,
.video-card-ad-slot .ad-zone-foot { display: none; }

/* 顶部标签栏 */
.ad-zone-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: rgba(229, 9, 20, 0.08);
    border-bottom: 1px solid var(--border);
    font-size: 12px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.ad-zone-tag {
    display: inline-block;
    padding: 1px 7px;
    background: var(--primary);
    color: #fff;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
}
.ad-zone-name {
    color: var(--text-dim);
    font-size: 12px;
    flex: 1;
}
.ad-zone-close {
    background: transparent;
    border: 0;
    color: var(--text-muted);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
    border-radius: 3px;
    transition: color 0.15s, background 0.15s;
}
.ad-zone-close:hover { color: #fff; background: rgba(255,255,255,0.1); }

/* 广告代码渲染区 */
.ad-zone-body {
    padding: 10px 12px;
    background: var(--bg);
    line-height: 1.5;
    overflow: hidden;
}
.ad-zone-body iframe { display: block; max-width: 100%; }
.ad-zone-body img { max-width: 100%; height: auto; }

/* 底部免责声明 */
.ad-zone-foot {
    padding: 5px 12px;
    background: rgba(0,0,0,0.3);
    border-top: 1px solid var(--border);
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.4;
}
.ad-zone-foot a { color: var(--text-dim); text-decoration: underline; }
.ad-zone-foot a:hover { color: var(--primary); }

/* 响应式 - 小屏广告体边距收窄 */
@media (max-width: 640px) {
    .ad-container { padding: 0 12px; margin: 12px auto; }
    .ad-zone-body { padding: 8px; }
    .ad-zone-head { padding: 5px 10px; font-size: 11px; }
    .ad-zone-foot { padding: 4px 10px; font-size: 10px; }
}

/* ===== SEO优化样式 ===== */

/* 今日更新模块 (首页时效性) */
.section-today .section-title { color: #16a34a; }
.section-today .section-date { font-size: 12px; color: var(--text-dim, #b3b3b3); margin-left: 8px; font-weight: normal; }

/* FAQ 可见区域 (配合 JSON-LD FAQPage) */
.faq-section { margin: 24px 0; }
.faq-list { display: flex; flex-direction: column; gap: 8px; }
.faq-item {
    background: var(--bg-card, #1a1a1a);
    border: 1px solid var(--border, #2a2a2a);
    border-radius: 8px;
    overflow: hidden;
    transition: border-color 0.2s;
}
.faq-item[open] { border-color: var(--primary, #e50914); }
.faq-item summary {
    padding: 12px 16px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    color: var(--text, #fff);
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
    content: '▸';
    color: var(--text-dim, #b3b3b3);
    transition: transform 0.2s;
    font-size: 12px;
}
.faq-item[open] summary::after { transform: rotate(90deg); }
.faq-item summary:hover { background: rgba(255,255,255,0.03); }
.faq-item p {
    margin: 0;
    padding: 0 16px 12px;
    color: var(--text-dim, #b3b3b3);
    font-size: 13px;
    line-height: 1.7;
}
.faq-item p b { color: var(--text, #fff); }

/* 详情页底部: 更新时间戳 + 内链导航 */
.detail-meta-footer {
    background: var(--bg-card, #1a1a1a);
    border: 1px solid var(--border, #2a2a2a);
    border-radius: 8px;
    padding: 14px 18px;
    margin: 16px 0;
}
.detail-updated {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.detail-updated time { color: var(--primary, #e50914); font-weight: 600; }
.detail-internal-links {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding-top: 10px;
    border-top: 1px dashed var(--border, #2a2a2a);
}
.detail-internal-links a {
    padding: 4px 12px;
    background: rgba(229,9,20,0.1);
    border: 1px solid rgba(229,9,20,0.2);
    border-radius: 14px;
    font-size: 12px;
    color: var(--primary, #e50914);
    text-decoration: none;
    transition: all 0.2s;
}
.detail-internal-links a:hover {
    background: var(--primary, #e50914);
    color: #fff;
}

/* 响应式: 小屏内链换行 */
@media (max-width: 640px) {
    .detail-updated { gap: 6px; }
    .detail-internal-links a { font-size: 11px; padding: 3px 10px; }
}

/* ===== 子维度导航 (详情页裂变URL) ===== */
.subdim-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 16px 0;
    padding: 12px;
    background: var(--bg-card, #1a1a1a);
    border: 1px solid var(--border, #2a2a2a);
    border-radius: 8px;
}
.subdim-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border, #2a2a2a);
    border-radius: 6px;
    font-size: 13px;
    color: var(--text-dim, #b3b3b3);
    text-decoration: none;
    transition: all 0.15s;
}
.subdim-tab:hover {
    background: var(--primary, #e50914);
    color: #fff;
    border-color: var(--primary, #e50914);
    transform: translateY(-1px);
}
.subdim-tab .sd-icon { font-size: 14px; }
@media (max-width: 640px) {
    .subdim-tabs { gap: 6px; padding: 8px; }
    .subdim-tab { padding: 6px 10px; font-size: 12px; }
}
