* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

:root {
    --primary: #e50914;
    --primary-dark: #b20710;
    --dark: #0f0f0f;
    --dark-light: #1a1a1a;
    --gray: #2d2d2d;
    --light-gray: #8c8c8c;
    --white: #ffffff;
    --card-bg: #1f1f1f;
    --text-light: #f0f0f0;
    --transition: all 0.3s ease;
    --container-max-width: 1000px;
}

body {
    background-color: var(--dark);
    color: var(--white);
    line-height: 1.6;
    overflow-x: hidden;
}

/* 移动设备顶部导航 */
.mobile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--dark);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    max-width: var(--container-max-width);
    margin: 0 auto;
    width: 100%;
}

.mobile-header .logo {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.mobile-header .logo i {
    font-size: 24px;
}

.mobile-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.mobile-actions i {
    font-size: 20px;
    color: var(--white);
}

.search-icon {
    position: relative;
}

.search-box {
    position: absolute;
    top: 40px;
    right: 0;
    width: 0;
    overflow: hidden;
    transition: var(--transition);
    background: var(--dark-light);
    border-radius: 24px;
}

.search-box.active {
    width: 280px;
    padding: 10px 15px;
}

.search-box input {
    width: 100%;
    background: transparent;
    border: none;
    color: var(--white);
    font-size: 16px;
    outline: none;
    padding: 5px 0;
}

/* 底部导航 */
.mobile-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-around;
    background: var(--dark-light);
    padding: 8px 0;
    z-index: 100;
    border-top: 1px solid var(--gray);
    max-width: var(--container-max-width);
    margin: 0 auto;
    width: 100%;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--light-gray);
    font-size: 12px;
    transition: var(--transition);
    padding: 6px 12px;
    border-radius: 8px;
}

.nav-item.active, .nav-item:hover {
    color: var(--primary);
    background: rgba(229, 9, 20, 0.15);
}

.nav-item i {
    font-size: 18px;
    margin-bottom: 4px;
}

/* 分类页面头部 - 修改：设置最大宽度与container相同 */
.category-header {
    padding: 20px 16px;
    background: linear-gradient(135deg, var(--primary), #8a0a0f);
    text-align: center;
    position: relative;
    overflow: hidden;
    max-width: var(--container-max-width);
    margin: 0 auto;
    width: 100%;
}

.category-header::before {
    content: "";
    position: absolute;
    top: -50px;
    right: -30px;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
}

.category-header::after {
    content: "";
    position: absolute;
    bottom: -70px;
    left: -40px;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
}

.category-header h1 {
    font-size: 28px;
    margin-bottom: 10px;
    position: relative;
    z-index: 2;
}

.category-header p {
    color: rgba(255,255,255,0.8);
    font-size: 15px;
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.category-stats {
    display: flex;
    justify-content: center;
    gap: 25px;
    margin-top: 20px;
    position: relative;
    z-index: 2;
}

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

.stat-value {
    font-size: 22px;
    font-weight: bold;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 13px;
    opacity: 0.9;
}

/* 筛选器部分 - 修改：设置最大宽度与container相同 */
.filters-container {
    padding: 15px 16px;
    background: var(--dark-light);
    position: sticky;
    top: 56px;
    z-index: 99;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    max-width: var(--container-max-width);
    margin: 0 auto;
    width: 100%;
}

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-dropdown {
    position: relative;
    flex: 1;
    min-width: 120px;
}

.filter-btn {
    background: var(--gray);
    color: var(--white);
    border: none;
    padding: 10px 15px;
    border-radius: 25px;
    font-size: 14px;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: var(--transition);
}

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

.filter-options {
    position: absolute;
    top: 45px;
    left: 0;
    width: 100%;
    background: var(--dark-light);
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.4);
    display: none;
    z-index: 20;
    max-height: 300px;
    overflow-y: auto;
}

.filter-options.active {
    display: block;
}

.filter-option {
    padding: 12px 15px;
    font-size: 14px;
    transition: var(--transition);
    cursor: pointer;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.filter-option:hover, .filter-option.active {
    background: var(--primary);
    color: var(--white);
}

/* 内容区域 - 网格布局 */
.container {
    max-width: var(--container-max-width);
    width: 100%;
    margin: 0 auto;
    background: rgba(15, 15, 15, 0.9);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    position: relative;
    backdrop-filter: blur(10px);
    padding: 0 16px 100px;
}

.section-title {
    font-size: 20px;
    margin-top: 10px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    padding-bottom: 12px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 3px;
    background: var(--primary);
    border-radius: 2px;
}

/* 网格视频布局 */
.video-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 30px;
    min-height: 500px;
}

.video-card {
    background: var(--card-bg);
    border-radius: 8px;
    overflow: hidden;
    transition: var(--transition);
    box-shadow: 0 3px 8px rgba(0,0,0,0.3);
    cursor: pointer;
    position: relative;
}

.video-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.video-card:active {
    transform: scale(0.98);
}

.video-card.featured {
    grid-column: span 2;
}

.video-thumb {
    position: relative;
    height: 180px;
    overflow: hidden;
}

.video-card.featured .video-thumb {
    height: 200px;
}

.video-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s;
}

.video-card:hover .video-thumb img {
    transform: scale(1.05);
}

.duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.8);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    z-index: 2;
}

.video-info {
    padding: 12px;
}

.video-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.video-card.featured .video-title {
    font-size: 18px;
}

.video-meta {
    display: flex;
    justify-content: space-between;
    color: var(--light-gray);
    font-size: 12px;
    margin-top: 8px;
}

.video-meta span:first-child {
    color: var(--primary);
}

.rating {
    display: flex;
    align-items: center;
    gap: 4px;
}

.rating i {
    color: #FFC107;
    font-size: 12px;
}

/* 无限滚动加载指示器 */
.infinite-scroll-loader {
    display: flex;
    justify-content: center;
    padding: 20px;
    display: none;
}

.loader {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(229, 9, 20, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: spin 1s ease-in-out infinite;
}

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

.no-more-content {
    text-align: center;
    padding: 20px;
    color: var(--light-gray);
    display: none;
}

/* 回到顶部按钮 */
.back-to-top {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    box-shadow: 0 4px 12px rgba(229, 9, 20, 0.4);
    cursor: pointer;
    transition: var(--transition);
    opacity: 0;
    transform: translateY(20px);
    z-index: 99;
}

.back-to-top.visible {
    opacity: 1;
    transform: translateY(0);
}

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


/* 响应式设计 - 平板和桌面 */
@media (min-width: 768px) {
    .mobile-header {
        padding: 15px 30px;
    }
    
    .category-header {
        padding: 30px;
    }
    
    .category-header h1 {
        font-size: 36px;
    }
    
    .category-header p {
        font-size: 17px;
    }
    
    .filters-container {
        padding: 15px 30px;
    }
    
    .container {
        padding: 30px 30px 100px;
    }
    
    .video-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
    
    .video-card.featured {
        grid-column: span 3;
    }
    
    .video-thumb {
        height: 200px;
    }
    
    .video-card.featured .video-thumb {
        height: 280px;
    }

    .back-to-top {
        bottom: 90px;
        right: 30px;
    }
}

@media (min-width: 992px) {
    .video-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 25px;
    }
    
    .video-card.featured {
        grid-column: span 4;
    }
}

.link-reset {
    text-decoration: none;
    color: inherit;
    display: block;
}

/* PWA安装提示样式 */
.pwa-install-banner {
    position: fixed;
    bottom: 70px;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #6e8efb, #a777e3);
    color: white;
    padding: 12px 16px;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.15);
    z-index: 999;
    display: none;
    border-radius: 8px 8px 0 0;
    margin: 0 auto;
    width: 55%;
    max-width: 550px;
}

.pwa-banner-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 550px;
    margin: 0 auto;
}
.pwa-banner-text {
    display: flex;
    align-items: center;
    flex: 1;
}
.pwa-banner-text i {
    margin-right: 10px;
    font-size: 1.2rem;
}
.pwa-banner-actions {
    display: flex;
    gap: 10px;
}
.pwa-install-btn, .pwa-close-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
}
.pwa-install-btn {
    background-color: white;
    color: #6e8efb;
}
.pwa-close-btn {
    background-color: transparent;
    color: white;
    border: 1px solid rgba(255,255,255,0.5);
}

/* 调整底部导航栏位置，为PWA提示留出空间 */
.mobile-nav {
    bottom: 0;
    z-index: 1000;
}

/* 调整回到顶部按钮位置 */
.back-to-top.visible {
    bottom: 80px;
}

@media (max-width: 768px) {
    .pwa-banner-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .pwa-banner-actions {
        align-self: flex-end;
    }
}

