/* ============================================
   网站 - 响应式样式表
   版本：2.1 | 优化：移动端搜索框不遮挡内容
   ============================================ */

/* CSS 变量 */
:root {
    --primary-color: #e50914;
    --primary-hover: #f40612;
    --secondary-color: #1a1a2e;
    --accent-color: #16213e;
    --text-primary: #ffffff;
    --text-secondary: #b3b3b3;
    --text-muted: #666666;
    --bg-dark: #0f0f0f;
    --bg-card: #1a1a1a;
    --bg-hover: #2a2a2a;
    --border-color: #333333;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.5);
    --radius: 8px;
    --radius-lg: 12px;
    --transition: all 0.3s ease;
    --container-width: 1400px;
    --header-height: 60px;
}

@media (min-width: 768px) {
    :root {
        --header-height: 70px;
    }
}

/* 重置样式 */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-top: var(--header-height);
}

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

a:hover {
    color: var(--primary-color);
}

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

ul, ol {
    list-style: none;
}

button, input {
    font-family: inherit;
    border: none;
    outline: none;
}

/* ============================================
   容器
   ============================================ */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 15px;
    width: 100%;
}

/* ============================================
   头部样式 - 修复移动端显示问题
   ============================================ */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: rgba(15, 15, 15, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.header-container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 15px;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: nowrap;
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.logo a {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo img {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.logo-text {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    display: inline-block;
}

@media (min-width: 768px) {
    .logo-text {
        display: inline-block;
    }
    
    .logo img {
        height: 45px;
    }
}

@media (min-width: 1024px) {
    .logo img {
        height: 50px;
    }
}

/* PC 导航 */
.pc-nav {
    display: none;
    flex: 1;
}

@media (min-width: 1024px) {
    .pc-nav {
        display: block;
    }
}

.nav-list {
    display: flex;
    align-items: center;
    gap: 5px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

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

.nav-item {
    white-space: nowrap;
    flex-shrink: 0;
}

.nav-link {
    display: block;
    padding: 8px 15px;
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-primary);
    background: var(--bg-hover);
}

/* 搜索框 - PC 端 */
.search-box {
    flex-shrink: 0;
    margin-left: auto;
}

.search-form {
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.search-input {
    width: 180px;
    height: 38px;
    padding: 0 12px;
    background: transparent;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-btn {
    width: 38px;
    height: 38px;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    border-left: 1px solid var(--border-color);
}

.search-btn:hover {
    color: var(--primary-color);
    background: rgba(229, 9, 20, 0.1);
}

/* 移动端搜索框 - 独立区域，不遮挡内容 */
.mobile-search-box {
    display: none;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
}

/* 移动端菜单按钮 */
.mobile-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: transparent;
    cursor: pointer;
    z-index: 1002;
    flex-shrink: 0;
    margin-left: auto;
}

@media (min-width: 1024px) {
    .mobile-menu-btn {
        display: none;
    }
}

.hamburger {
    position: relative;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    transition: var(--transition);
}

.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    left: 0;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    transition: var(--transition);
}

.hamburger::before {
    top: -7px;
}

.hamburger::after {
    top: 7px;
}

.mobile-menu-btn.active .hamburger {
    background: transparent;
}

.mobile-menu-btn.active .hamburger::before {
    transform: rotate(45deg);
    top: 0;
}

.mobile-menu-btn.active .hamburger::after {
    transform: rotate(-45deg);
    top: 0;
}

/* 移动端导航 */
.mobile-nav {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    max-width: 85%;
    height: 100vh;
    background: var(--bg-card);
    z-index: 1003;
    transition: left 0.3s ease;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: 2px 0 20px rgba(0, 0, 0, 0.5);
}

.mobile-nav.active {
    left: 0;
}

.mobile-nav-content {
    padding-top: 60px;
}

.mobile-nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background: var(--bg-card);
}

.mobile-nav-header span {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.mobile-nav-close {
    width: 36px;
    height: 36px;
    background: transparent;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-nav-list {
    list-style: none;
    margin: 0;
    padding: 10px 0;
}

.mobile-nav-list li {
    border-bottom: 1px solid var(--border-color);
}

.mobile-nav-list a {
    display: block;
    padding: 15px 20px;
    color: var(--text-secondary);
    font-size: 1rem;
    transition: var(--transition);
}

.mobile-nav-list a:hover {
    color: var(--primary-color);
    background: rgba(229, 9, 20, 0.1);
    padding-left: 25px;
}

/* ============================================
   主内容区
   ============================================ */
.main {
    flex: 1;
    padding: 30px 0 50px;
}

/* ============================================
   幻灯片/轮播
   ============================================ */
.banner-section {
    margin-bottom: 40px;
    width: 100%;
}

.banner-container {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    aspect-ratio: 21/9;
    max-height: 500px;
    width: 100%;
    margin: 0 auto;
}

@media (max-width: 768px) {
    .banner-container {
        aspect-ratio: 16/9;
        max-height: 300px;
    }
}

.banner-list {
    display: flex;
    height: 100%;
    width: 100%;
    transition: transform 0.5s ease;
}

.banner-item {
    min-width: 100%;
    width: 100%;
    position: relative;
    flex-shrink: 0;
}

.banner-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.banner-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 30px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
}

.banner-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    color: var(--text-primary);
}

@media (max-width: 768px) {
    .banner-title {
        font-size: 1.3rem;
    }
}

.banner-desc {
    color: var(--text-secondary);
    font-size: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.banner-dots {
    position: absolute;
    bottom: 20px;
    right: 30px;
    display: flex;
    gap: 8px;
}

.banner-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: var(--transition);
}

.banner-dot.active {
    background: var(--primary-color);
    transform: scale(1.2);
}

/* ============================================
   内容区块
   ============================================ */
.section {
    margin-bottom: 50px;
    width: 100%;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--primary-color);
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
}

.section-title::before {
    content: '';
    width: 4px;
    height: 24px;
    background: var(--primary-color);
    border-radius: 2px;
}

.section-more {
    color: var(--text-secondary);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.section-more:hover {
    color: var(--primary-color);
}

/* ============================================
   视频卡片网格
   ============================================ */
.vod-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    width: 100%;
}

@media (min-width: 640px) {
    .vod-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1024px) {
    .vod-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 20px;
    }
}

@media (min-width: 1400px) {
    .vod-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

.vod-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    transition: var(--transition);
    position: relative;
}

.vod-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.vod-cover {
    position: relative;
    aspect-ratio: 2/3;
    overflow: hidden;
}

.vod-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.vod-card:hover .vod-cover img {
    transform: scale(1.1);
}

.vod-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
}

.vod-card:hover .vod-overlay {
    opacity: 1;
}

.play-icon {
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
}

.vod-info {
    padding: 12px;
}

.vod-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
    color: var(--text-primary);
}

.vod-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.vod-remarks {
    background: var(--primary-color);
    color: var(--text-primary);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
}

/* ============================================
   列表页样式
   ============================================ */
.page-header {
    background: linear-gradient(135deg, var(--secondary-color), var(--accent-color));
    padding: 40px 20px;
    margin-bottom: 30px;
    border-radius: var(--radius-lg);
}

.page-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.page-desc {
    color: var(--text-secondary);
    font-size: 1rem;
    max-width: 800px;
}

/* 筛选条件 */
.filter-box {
    background-color: #1a1a1a;
    padding: 10px;
    margin-bottom: 30px;
}

.filter-row {
    overflow-x: auto; /* 允许水平滚动 */
    white-space: nowrap; /* 防止换行 */
    margin-bottom: 10px;
}

.filter-label {
    color: #fff;
    margin-right: 10px;
}

.filter-link {
    display: inline-block; /* 确保链接块级元素内联显示 */
    margin-right: 10px; /* 链接之间的间距 */
    padding: 5px 10px;
    background-color: #333;
    color: #fff;
    border-radius: 5px;
    text-decoration: none;
}

.filter-link.active {
    background-color: #e50914;
}

/* ============================================
   分页样式 - 适配PC+WAP
   ============================================ */
.pagination-container {
    width: 100%;
    padding: 30px 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.pagination {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

/* 分页按钮基础样式 */
.pagination .page-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    padding: 0 12px;
    background: #1a1a1a; /* 和你网站卡片背景统一 */
    border: 1px solid #333;
    border-radius: 6px;
    color: #b3b3b3; /* 次要文字色 */
    font-size: 14px;
    font-weight: 500;
    transition: all 0.25s ease;
    cursor: pointer;
    text-decoration: none;
}

/* 鼠标悬浮效果 */
.pagination .page-item:hover:not(.disabled):not(.active):not(.ellipsis) {
    background: #2a2a2a;
    color: #ffffff;
    border-color: #444;
    transform: translateY(-1px);
}

/* 当前页样式 */
.pagination .page-item.active {
    background: #e50914; /* 网站主色 */
    color: #ffffff;
    border-color: #e50914;
    font-weight: 600;
}

/* 禁用状态（首页/上一页在第一页时、下一页/尾页在最后一页时） */
.pagination .page-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* 省略号样式 */
.pagination .page-item.ellipsis {
    background: transparent;
    border: none;
    color: #666;
    min-width: auto;
    padding: 0 6px;
    cursor: default;
}

/* ============================================
   移动端适配
   ============================================ */
@media (max-width: 768px) {
    .pagination-container {
        padding: 20px 0;
    }
    
    .pagination {
        gap: 6px;
    }
    
    .pagination .page-item {
        min-width: 36px;
        height: 36px;
        padding: 0 8px;
        font-size: 13px;
    }
    
    /* 移动端简化文字按钮 */
    .pagination .page-item:not(.active):not(.ellipsis):not([href*="page="]) {
        min-width: 36px;
        padding: 0;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .pagination .page-item {
        min-width: 32px;
        height: 32px;
        font-size: 12px;
    }
    
    /* 超小屏只保留核心按钮 */
    .pagination .page-item:nth-child(1), /* 首页 */
    .pagination .page-item:last-child {   /* 尾页 */
        display: none;
    }
}

.page-item {
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-size: 0.9rem;
    transition: var(--transition);
}

.page-item:hover,
.page-item.active {
    background: var(--primary-color);
    color: var(--text-primary);
}

.page-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================
   详情页样式
   ============================================ */
.detail-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

@media (min-width: 1024px) {
    .detail-container {
        grid-template-columns: 350px 1fr;
    }
}

.detail-cover {
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.detail-cover img {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
}

.detail-info {
    background: var(--bg-card);
    padding: 25px;
    border-radius: var(--radius-lg);
}

.detail-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 15px;
    line-height: 1.3;
    color: var(--text-primary);
}

@media (max-width: 768px) {
    .detail-title {
        font-size: 1.4rem;
    }
}

.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.detail-meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.detail-meta-item strong {
    color: var(--text-primary);
}

.detail-content {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 25px;
}

.detail-content h3 {
    color: var(--text-primary);
    font-size: 1.2rem;
    margin-bottom: 15px;
}

.detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 25px;
}

.detail-tag {
    padding: 5px 12px;
    background: var(--bg-hover);
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.detail-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 25px;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary {
    background: var(--primary-color);
    color: var(--text-primary);
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--border-color);
}

/* 选集列表 */
.episode-section {
    background: var(--bg-card);
    padding: 25px;
    border-radius: var(--radius-lg);
    margin-top: 30px;
}

.episode-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

/* 新增播放列表横向滚动样式 */
.episode-tabs {
    overflow-x: auto;
    white-space: nowrap;
    padding: 10px 0;
    margin-bottom: 15px;
    -webkit-overflow-scrolling: touch;
}
.episode-tabs::-webkit-scrollbar {
    display: none;
}
.episode-tabs .episode-tab {
    display: inline-block;
    margin-right: 10px;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    min-width: 80px;
    text-align: center;
}
.episode-tabs .episode-tab.active {
    background: #e50914;
    color: white;
}
.episode-tabs .episode-tab:hover:not(.active) {
    color: #b3b3b3;
}

.episode-tab {
    padding: 8px 20px;
    background: var(--bg-hover);
    border-radius: var(--radius);
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-secondary);
}

.episode-tab.active {
    background: var(--primary-color);
    color: var(--text-primary);
}

.episode-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 10px;
}

.episode-item {
    padding: 12px 8px;
    background: var(--bg-hover);
    border-radius: var(--radius);
    text-align: center;
    font-size: 0.9rem;
    transition: var(--transition);
    color: var(--text-secondary);
}

.episode-item:hover,
.episode-item.active {
    background: var(--primary-color);
    color: var(--text-primary);
}

/* 新增：选集展开/收起按钮样式 */
.episode-show-more,
.episode-show-less {
    display: inline-block;
    padding: 12px 26px;
    background: #2a2a2a;
    border-radius: 5px;
    color: #b3b3b3;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px;
}

.episode-show-more:hover,
.episode-show-less:hover {
    background: var(--bg-hover);
    color: var(--text-secondary);
}

/* PC端优化 */
@media (min-width: 768px) {
    .episode-show-more,
    .episode-show-less {
        padding: 12px 26px;
    }
}

/* 移动端优化 */
@media (max-width: 767px) {
    .episode-show-more,
    .episode-show-less {
        padding: 12px 26px;
        font-size: 0.85rem;
    }
}

/* 新增：更多/折叠按钮样式 */
.more-button, .collapse-button {
    border: 2px solid red;
    padding: 5px 10px;
    color: white;
    background-color: #333; /* 深灰色背景 */
}

/* ============================================
   播放页样式
   ============================================ */
.player-container {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 30px;
}

.player-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
}

.player-wrapper iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.player-info {
    padding: 20px;
}

.player-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.player-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: 10px;
}

.player-prev,
.player-next {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    padding: 10px 20px;
    background: var(--bg-hover);
    border-radius: var(--radius);
    transition: var(--transition);
}

.player-prev:hover,
.player-next:hover {
    background: var(--primary-color);
    color: var(--text-primary);
}

/* ============================================
   搜索页样式
   ============================================ */
.search-results {
    margin-bottom: 30px;
}

.search-count {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.search-count strong {
    color: var(--primary-color);
}

/* ============================================
   排行榜样式
   ============================================ */
.top-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

@media (min-width: 1024px) {
    .top-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

.top-section {
    background: var(--bg-card);
    padding: 25px;
    border-radius: var(--radius-lg);
}

.top-section-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--primary-color);
    color: var(--text-primary);
}

.top-item {
    display: flex;
    gap: 15px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

.top-item:last-child {
    border-bottom: none;
}

.top-item:hover {
    background: var(--bg-hover);
    padding-left: 10px;
    padding-right: 10px;
    margin: 0 -10px;
    border-radius: var(--radius);
}

.top-num {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-hover);
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
    color: var(--text-secondary);
}

.top-item:nth-child(1) .top-num {
    background: #ffd700;
    color: #000;
}

.top-item:nth-child(2) .top-num {
    background: #c0c0c0;
    color: #000;
}

.top-item:nth-child(3) .top-num {
    background: #cd7f32;
    color: #000;
}

.top-cover {
    width: 60px;
    height: 80px;
    border-radius: var(--radius);
    overflow: hidden;
    flex-shrink: 0;
}

.top-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.top-info {
    flex: 1;
    min-width: 0;
}

.top-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 5px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--text-primary);
}

.top-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ============================================
   页脚样式
   ============================================ */
.footer {
    background: var(--secondary-color);
    padding: 50px 0 30px;
    margin-top: auto;
}

.footer-container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

@media (min-width: 768px) {
    .footer-content {
        grid-template-columns: repeat(3, 1fr);
    }
}

.footer-section h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.footer-section p,
.footer-section li {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 2;
}

.footer-section ul li a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    padding-top: 30px;
    border-top: 1px the var(--border-color);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.footer-bottom p {
    margin-bottom: 10px;
}

.footer-bottom a {
    color: var(--text-secondary);
}

.footer-bottom a:hover {
    color: var(--primary-color);
}

/* ============================================
   返回顶部
   ============================================ */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    color: var(--text-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 999;
    box-shadow: var(--shadow);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: var(--primary-hover);
    transform: translateY(-3px);
}

/* ============================================
   加载动画
   ============================================ */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 50px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================
   留言板样式
   ============================================ */
.gbook-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    margin-bottom: 40px;
}

@media (min-width: 1024px) {
    .gbook-container {
        grid-template-columns: 400px 1fr;
    }
}

.form-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 25px;
}

.form-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--primary-color);
    color: var(--text-primary);
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 12px 15px;
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: var(--transition);
}

.form-input:focus,
.form-textarea:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(229, 9, 20, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
    font-family: inherit;
    line-height: 1.6;
}

.verify-group {
    display: flex;
    gap: 15px;
    align-items: center;
}

.verify-input {
    flex: 1;
}

.verify-img {
    height: 42px;
    border-radius: var(--radius);
    cursor: pointer;
    border: 1px solid var(--border-color);
}

.btn-submit {
    background: var(--primary-color);
    color: var(--text-primary);
    padding: 12px 25px;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-submit:hover {
    background: var(--primary-hover);
}

.gbook-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.gbook-item {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px;
}

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

.gbook-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
}

.user-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.user-name {
    font-weight: 600;
    color: var(--text-primary);
}

.user-time {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.gbook-content {
    color: var(--text-secondary);
    line-height: 1.8;
}

/* ============================================
   响应式优化 - 修复搜索框遮挡问题
   ============================================ */
@media (max-width: 1200px) {
    .search-box {
        margin-left: 0;
    }
    
    .search-input {
        width: 150px;
    }
}

@media (max-width: 768px) {
    :root {
        --header-height: 56px;
    }
    
    .header {
        height: var(--header-height);
    }
    
    .header-container {
        padding: 0 12px;
        gap: 10px;
    }
    
    .logo img {
        height: 35px;
    }
    
    .logo-text {
        display: inline-block;
    }

    .mobile-search-box .search-input {
        width: 70%;
        padding: 8px;
        font-size: 14px;
    }

    .mobile-search-box .search-btn {
        width: 30%;
        padding: 8px;
    }

    .mobile-search-box .search-btn svg {
        width: 16px;
        height: 16px;
    }
    
    /* 移动端搜索框显示 - 独立区域 */
    .mobile-search-box {
        display: block;
    }
    
    /* PC 搜索框隐藏 */
    .search-box {
        display: none;
    }
    
    .mobile-search-box .search-form {
        width: 100%;
    }
    
    .mobile-menu-btn {
        display: flex;
        margin-left: auto;
    }
    
    /* 主内容区增加 padding，避免被头部和搜索框遮挡 */
    body {
        padding-top: calc(var(--header-height) + 62px);
    }
    
    .main {
        padding: 20px 0 40px;
    }
    
    .section {
        margin-bottom: 30px;
    }
    
    .section-title {
        font-size: 1.2rem;
    }
    
    .vod-grid {
        gap: 12px;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    
    .mobile-nav {
        width: 200px;
        max-width: 85%;
    }
}

@media (max-width: 480px) {
    .header-container {
        padding: 0 10px;
    }
    
    .logo img {
        height: 32px;
    }
    
    .vod-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    body {
        padding-top: calc(var(--header-height) + 62px);
    }
}

/* ============================================
   性能优化
   ============================================ */
img[loading="lazy"] {
    background: var(--bg-hover);
}

.vod-card,
.banner-item,
.episode-item {
    will-change: transform;
}

/* ============================================
   打印样式
   ============================================ */
@media print {
    .header,
    .footer,
    .back-to-top,
    .mobile-nav,
    
    body {
        background: #fff;
        color: #000;
        padding-top: 0;
    }
}

/* ============================================
   工具类
   ============================================ */
.hidden {
    display: none !important;
}

.clearfix::after {
    content: '';
    display: table;
    clear: both;
}

.text-center {
    text-align: center;
}

.text-primary {
    color: var(--text-primary) !important;
}

.text-secondary {
    color: var(--text-secondary) !important;
}

.text-muted {
    color: var(--text-muted) !important;
}


/* ============================================
   播放记录样式
   ============================================ */
/* 搜索+播放记录容器 */
.search-history-container {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    margin-left: auto;
}

/* 播放记录按钮 */
.history-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 38px;
    padding: 0 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
}

.history-text {
    display: inline-block;
}

/* 播放记录弹窗 */
.history-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: none;
    justify-content: center;
    align-items: center;
}

.history-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(2px);
}

.history-modal-content {
    position: relative;
    width: 90%;
    max-width: 500px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    z-index: 1;
}

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

.history-modal-header h3 {
    font-size: 1.1rem;
    color: var(--text-primary);
    font-weight: 600;
    margin: 0;
}

.history-modal-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.history-modal-body {
    max-height: 400px;
    overflow-y: auto;
    padding: 20px;
}

/* 空记录样式 */
.history-empty {
    text-align: center;
    padding: 40px 0;
    color: var(--text-muted);
    display: none;
}

/* 播放记录列表 */
.history-list {
    display: none;
    gap: 10px;
    flex-direction: column;
}

/* 弹窗底部 */
.history-modal-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
    text-align: right;
}

.history-clear-btn {
    padding: 8px 16px;
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
}

/* 响应式适配 */
@media (max-width: 1024px) {
    .history-text {
        display: none;
    }
    .history-btn {
        padding: 0 10px;
    }
}


    @media (max-width: 768px) {
        .pc-only {
            display: none !important;
        }
        .search-history-container {
            margin-left: auto !important;
        }
        .search-history-container .search-box {
            display: block !important;
        }
    }
    .history-btn:hover {
        background: var(--bg-hover) !important;
        color: var(--text-primary) !important;
    }
    .history-modal-close:hover {
        color: var(--primary-color) !important;
    }
    .history-clear-btn:hover {
        background: var(--primary-color) !important;
        color: var(--text-primary) !important;
        border-color: var(--primary-color) !important;
    }
    .history-list.active {
        display: flex !important;
    }
    .history-empty.active {
        display: block !important;
    }
    .history-item {
        display: flex !important;
        gap: 12px !important;
        padding: 10px !important;
        background: var(--bg-dark) !important;
        border-radius: var(--radius) !important;
        transition: var(--transition) !important;
    }
    .history-item:hover {
        background: var(--bg-hover) !important;
    }
    .history-item-pic {
        width: 80px !important;
        height: 45px !important;
        border-radius: 4px !important;
        overflow: hidden !important;
        flex-shrink: 0 !important;
    }
    .history-item-pic img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
    }
    .history-item-info {
        flex: 1 !important;
        min-width: 0 !important;
    }
    .history-item-name {
        font-size: 0.9rem !important;
        color: var(--text-primary) !important;
        margin-bottom: 4px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }
    .history-item-remarks {
        font-size: 0.8rem !important;
        color: var(--text-muted) !important;
        margin-bottom: 4px !important;
    }
    .history-item-part {
        font-size: 0.75rem !important;
        color: var(--text-secondary) !important;
    }
    .history-item-delete {
        background: transparent !important;
        border: none !important;
        color: var(--text-muted) !important;
        cursor: pointer !important;
        font-size: 1rem !important;
        width: 30px !important;
        height: 30px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        flex-shrink: 0 !important;
        transition: var(--transition) !important;
    }
    .history-item-delete:hover {
        color: var(--primary-color) !important;
    }