/* ==================== 首页样式 ==================== */

:root {
    --primary-color: #e5091d;
    --hover-color: #ff4158;
    --dark-bg: #0a0a14;
    --card-bg: rgba(255, 255, 255, 0.05);
    --text-primary: #ffffff;
    --text-secondary: #b8b8b8;
    --border-color: rgba(255, 255, 255, 0.1);
}


/* 主页容器 */
.homepage {
    position: relative;
    background: var(--dark-bg);
    min-height: 100vh;
    width: 100%;
    max-width: 100%;
    padding-top: 70px; /* 预留 header 高度，防止内容被遮挡 */
}

/* ==================== 全宽轮播图 ==================== */

.carousel-container {
    width: 100%;
    height: 600px;
    position: relative;
    overflow: hidden;
}

.carousel {
    width: 100%;
    height: 100%;
    position: relative;
}

.carousel-slide {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
}

.carousel-slide.active {
    opacity: 1;
    z-index: 1;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.6);
}

.carousel-content {
    position: absolute;
    bottom: 150px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    color: white;
    z-index: 2;
    max-width: 800px;
    width: 90%;
}

.carousel-content h2 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.8);
    animation: slideUp 0.8s ease-out;
}

.carousel-content p {
    font-size: 1rem;
    /* 移动端减少显示行数 */
    -webkit-line-clamp: 2;
    max-height: 3.2em;
    margin-bottom: 2rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
    animation: slideUp 0.8s ease-out 0.2s both;
    /* 多行文本溢出省略号处理 */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.6;
    max-height: 6em;
}

.play-btn {
    padding: 0.75rem 2rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #e5091d 0%, #ff4158 100%);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(229, 9, 29, 0.3);
    animation: slideUp 0.8s ease-out 0.4s both, pulse 2s ease-in-out infinite;
    text-decoration: none;
    display: inline-block;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

/* 按钮光晕效果 */
.play-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.play-btn:hover::before {
    left: 100%;
}

.play-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(229, 9, 29, 0.5);
    background: linear-gradient(135deg, #ff4158 0%, #e5091d 100%);
}

.play-btn:active {
    transform: translateY(-1px) scale(1.02);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 4px 20px rgba(229, 9, 29, 0.4);
    }
    50% {
        box-shadow: 0 4px 30px rgba(229, 9, 29, 0.7);
    }
}

/* 轮播控制按钮 */
.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-arrow:hover {
    background: rgba(229, 9, 29, 0.8);
    border-color: var(--primary-color);
    transform: translateY(-50%) scale(1.1);
}

.carousel-arrow.prev {
    left: 20px;
}

.carousel-arrow.next {
    right: 20px;
}

/* 轮播指示器 */
.carousel-indicators {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 10;
}

.indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.indicator.active {
    background: var(--primary-color);
    border-color: white;
    transform: scale(1.2);
}

.indicator:hover {
    background: rgba(255, 255, 255, 0.7);
}

/* ==================== 覆盖内容层 ==================== */

.overlay-content {
    position: relative;
    z-index: 5;
    margin-top: -100px;
    padding: 0 2rem 4rem 2rem;
}

.content-wrapper {
    max-width: 1400px;
    height: 100%;
    margin: 0 auto;
    display: block;
    gap: 2rem;
    background: linear-gradient(135deg, rgba(15, 15, 26, 0.98) 0%, rgba(26, 26, 46, 0.95) 100%);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* 全宽布局样式 */
.content-wrapper.full-width {
    grid-template-columns: 1fr;
}

.main-content.full-width-section {
    width: 100%;
}

/* ==================== 右侧内容区域 ==================== */

.main-content {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.content-section {
    animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.section-title {
    color: var(--text-primary);
    font-size: 1.75rem;
    font-weight: 800;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.more-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s;
}

.more-link:hover {
    color: var(--hover-color);
    transform: translateX(5px);
}

/* 视频网格 */
.video-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1.5rem;
}
.video-grid-l {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 1.5rem;
}

.video-card {
    cursor: pointer;
    transition: all 0.3s;
    min-width: 0; /* 防止卡片撑开网格 */
}

.video-card:hover {
    transform: translateY(-10px);
}

.video-poster,
.video-poster-3 {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 2/3;
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 0.75rem;
    min-width: 0; /* 防止图片撑开 */
}

.video-poster img,
.video-poster-3 img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.video-card:hover .video-poster img,
.video-card:hover .video-poster-3 img {
    transform: scale(1.1);
}

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

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

.play-icon {
    width: 60px;
    height: 60px;
    background: var(--primary-color);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    box-shadow: 0 4px 20px rgba(229, 9, 29, 0.5);
}

.play-icon:hover {
    transform: scale(1.2);
    background: var(--hover-color);
}

/* 视频徽章 */
.video-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
    z-index: 1;
}

.video-badge.hot {
    background: linear-gradient(135deg, #ff4158, #ff6b7a);
}

.video-badge.new {
    background: linear-gradient(135deg, #00d2ff, #3a7bd5);
}

.video-badge.hd {
    background: linear-gradient(135deg, #f093fb, #f5576c);
}

.video-badge.vip {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #000;
}

.video-title {
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%; /* 确保标题宽度受限 */
}

.video-desc {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%; /* 确保描述宽度受限 */
}

/* 视频列表 */
.video-list {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.video-list-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1.5rem;
}

/* ==================== 分页组件样式 ==================== */

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 2rem;
    padding: 1.5rem 0;
}

.page-btn {
    padding: 0.625rem 1.25rem;
    background: linear-gradient(135deg, rgba(229, 9, 29, 0.1), rgba(255, 65, 88, 0.1));
    border: 1px solid rgba(229, 9, 29, 0.3);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 100px;
}

.page-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--primary-color), var(--hover-color));
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(229, 9, 29, 0.4);
}

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

.page-numbers {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.page-number {
    min-width: 40px;
    height: 40px;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-number:hover {
    background: rgba(229, 9, 29, 0.1);
    border-color: var(--primary-color);
    color: var(--text-primary);
    transform: translateY(-2px);
}

.page-number.active {
    background: linear-gradient(135deg, var(--primary-color), var(--hover-color));
    border-color: var(--primary-color);
    color: white;
    box-shadow: 0 2px 12px rgba(229, 9, 29, 0.4);
    transform: scale(1.05);
}

.page-ellipsis {
    color: var(--text-secondary);
    padding: 0 0.25rem;
    font-size: 1rem;
    letter-spacing: 0.25rem;
}

/* 响应式设计 - 移动端适配 */
@media (max-width: 768px) {
    .pagination {
        flex-wrap: wrap;
        gap: 0.5rem;
        padding: 1rem 0;
    }
    
    .page-btn {
        min-width: 80px;
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }
    
    .page-number {
        min-width: 35px;
        height: 35px;
        font-size: 0.85rem;
    }
    
    .page-numbers {
        order: 1;
        width: 100%;
        justify-content: center;
        margin-top: 0.5rem;
    }
    
    .prev-page {
        order: 2;
    }
    
    .next-page {
        order: 3;
    }
}

@media (max-width: 480px) {
    .page-btn {
        min-width: 70px;
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
    }
    
    .page-number {
        min-width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }
}

/* ==================== 响应式设计 ==================== */

@media (max-width: 1400px) {
    .video-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    .video-grid-l {
        grid-template-columns: repeat(4, 1fr);
    }
    .content-wrapper {
        padding: 1.5rem;
    }
    
    .video-list-row {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 1200px) {
    .overlay-content {
        margin-top: -80px;
        padding: 0 1.5rem;
    }
    
    .content-wrapper {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .video-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .video-grid-l {
        grid-template-columns: repeat(3, 1fr);
    }
    .video-list-row {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .carousel-content h2 {
        font-size: 2.5rem;
    }
}

@media (max-width: 992px) {
    .carousel-container {
        height: 400px;
    }
    
    .overlay-content {
        margin-top: -60px;
    }
    
    .content-wrapper {
        grid-template-columns: 1fr;
        padding: 1.5rem;
    }
    
    .video-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }
    .video-grid-l {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }
    .video-list-row {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }
    
    .carousel-content h2 {
        font-size: 2rem;
    }
    
    .carousel-content p {
        font-size: 1rem;
    }
    
    /* 移动端筛选标签优化 */
    .filter-tabs {
        width: calc(100% + 1.5rem);
        margin-left: -0.75rem;
        padding: 0 0.75rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        gap: 0.5rem;
    }
    
    /* 平板端播放按钮优化 */
    .play-btn {
        padding: 0.6rem 1.5rem;
        font-size: 0.875rem;
    }
    
    .filter-tabs::-webkit-scrollbar {
        height: 4px;
    }
    
    .filter-tabs::-webkit-scrollbar-thumb {
        background: rgba(229, 9, 29, 0.5);
        border-radius: 2px;
    }
    
    .filter-tab {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
        flex-shrink: 0;
    }
}

@media (max-width: 768px) {
    .carousel-container {
        height: 300px;
    }
    
    .overlay-content {
        padding: 0 1rem;
    }
    
    .video-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    .video-grid-l {
        grid-template-columns: repeat(1, 1fr);
        gap: 0.75rem;
    }
    .video-list-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .section-header {
        align-items: flex-start;
        gap: 0.75rem;
        width: 100%;
        margin-top: 10px;
    }
    
    .section-title {
        font-size: 1.1rem;
        margin-bottom: 0;
    }
    .play-icon {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
    /* 移动端全屏滑动筛选栏 */
    .filter-tabs {
        width: 100vw;
        margin-left: calc(-50vw + 50%);
        margin-right: calc(-50vw + 50%);
        padding: 0.5rem 1rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        gap: 0.75rem;
        background: rgba(255, 255, 255, 0.02);
        backdrop-filter: blur(10px);
        border-top: 1px solid rgba(255, 255, 255, 0.05);
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }
    
    .filter-tabs::-webkit-scrollbar {
        display: none;
    }
    
    .filter-tab {
        padding: 0.6rem 1.25rem;
        font-size: 0.9rem;
        flex-shrink: 0;
        background: rgba(255, 255, 255, 0.08);
        border: 1px solid rgba(255, 255, 255, 0.1);
        white-space: nowrap;
    }
    
    .filter-tab:hover {
        background: rgba(229, 9, 29, 0.15);
    }
    
    .filter-tab.active {
        background: linear-gradient(135deg, var(--primary-color) 0%, #ff4158 100%);
        border-color: var(--primary-color);
        box-shadow: 0 2px 8px rgba(229, 9, 29, 0.3);
    }
    
    .carousel-content {
        bottom: 80px;
        width: 95%;
        padding: 0 1rem;
    }
    
    .carousel-content h2 {
        font-size: 1.3rem;
        margin-bottom: 0.5rem;
        /* 标题也限制行数，防止被挤出 */
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .carousel-content p {
        font-size: 0.85rem;
        margin-bottom: 1rem;
        /* 移动端严格限制为 2 行 */
        -webkit-line-clamp: 2;
        max-height: 2.8em;
        line-height: 1.4;
    }
    .video-poster {
        aspect-ratio: 16/9;
    }
    .video-poster-3 {
        aspect-ratio: 2/3;
    }
    .pagination {
        flex-direction: column;
        gap: 0.75rem;
        margin-top: 2rem;
    }
    
    .page-numbers {
        order: 2;
    }
    
    .page-btn.prev-page {
        order: 1;
        width: 100%;
    }
    
    .page-btn.next-page {
        order: 3;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .carousel-container {
        height: 250px;
    }
    
    .overlay-content {
        padding: 0.75rem;
    }
    
    .content-wrapper {
        padding: 1rem;
    }
    
    .video-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
    .video-grid-l {
        grid-template-columns: repeat(1, 1fr);
        gap: 0.5rem;
    }
    
    .video-list-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
    
    .carousel-content h2 {
        font-size: 1rem;
        /* 小屏幕标题限制为 1-2 行 */
        -webkit-line-clamp: 2;
        margin-bottom: 0.4rem;
    }
    
    .carousel-content p {
        font-size: 0.75rem;
        /* 小屏幕简介严格限制为 2 行 */
        -webkit-line-clamp: 2;
        line-height: 1.3;
    }
    
    .carousel-arrow {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    
    
    .video-title {
        font-size: 0.8rem;
    }
    
    .video-desc {
        font-size: 0.7rem;
    }
    
    .pagination {
        padding: 1rem 0;
    }
    
    .page-btn {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }
    
    .page-number {
        width: 35px;
        height: 35px;
        font-size: 0.85rem;
    }
    
    /* 小屏幕优化 */
    .filter-tabs {
        padding: 0.5rem 0.75rem;
        gap: 0.5rem;
    }
    
    .filter-tab {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
}

/* 筛选标签 */
.filter-tabs {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
    padding-bottom: 0.5rem;
}

.filter-tabs::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.filter-tab {
    padding: 0.5rem 1.25rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
    flex-shrink: 0;
}

.filter-tab:hover {
    background: rgba(229, 9, 29, 0.1);
    border-color: var(--primary-color);
    color: var(--text-primary);
}

.filter-tab.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, #ff4158 100%);
    border-color: var(--primary-color);
    color: white;
    box-shadow: 0 2px 12px rgba(229, 9, 29, 0.4);
}

