/* 筛选按钮样式 */
.filter-section {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.filter-btn {
    display: block;
    padding: 0.2rem 0.5rem;
    border-radius: 20px;
    background: #f0f0f0;
    color: #666;
    text-decoration: none;
    transition: all 0.3s ease;
}

.filter-btn.active,
.filter-btn:hover {
    background: var(--primary-color);
    color: white;
}

/* 视频列表容器 */
.video-list-container {
    margin-top: 50px;
    position: relative;
}

/* 分类容器 */
.video-category {
    display: none;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 2rem;
}

/* 使用:target选择器实现筛选 */
.video-category:target {
    display: grid;
    animation: fadeIn 0.3s ease;
}

/* 默认显示全部 */
#all {
    display: grid;
}

/* 当选择其他分类时隐藏全部 */
.video-category:target~#all {
    display: none;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* 视频项样式 */
.video-item {
    display: block;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    text-decoration: none;
    color: inherit;
    transition: transform 0.3s ease;
}

.video-item:hover {
    transform: translateY(-5px);
}

.video-item img {
    width: 100%;
    height: 260px;
    min-height: 260px;
    object-fit: cover;
}

.video-info {
    padding: 1rem;
}

.video-info h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    height: 26px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.category-tag {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    background: var(--primary-color);
    color: white;
    border-radius: 4px;
    font-size: 0.8rem;
}

@media (max-width: 768px) {
    .video-category {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .filter-btn {
        padding: 0.6rem 1rem;
    }
}

/* 缩略图容器 */
.thumbnail-container {
    position: relative;
    overflow: hidden;
    border-radius: 8px 8px 0 0;
}

/* 评分样式 */
.rating {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.9);
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: bold;
    color: var(--primary-color);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.rating::before {
    content: '★';
    margin-right: 4px;
    color: #ffc107;
}

/* 时长样式 */
.duration {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    backdrop-filter: blur(2px);
}

/* 移动端适配 */
@media (max-width: 480px) {
    .rating {
        font-size: 0.8rem;
        padding: 3px 6px;
        top: 6px;
        right: 6px;
    }

    .duration {
        font-size: 0.75rem;
        padding: 3px 6px;
        bottom: 6px;
        right: 6px;
    }
}

.video-item:hover .thumbnail-container {
    transform: scale(1.05);
    transition: transform 0.3s ease;
}

.video-item:hover .duration {
    background: rgba(0, 0, 0, 0.9);
}

.thumbnail-container {
    transition: transform 0.3s ease;
}

/* 分页样式 */
/* 分页容器 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 2rem 0;
    gap: 1rem;
}

.page-item {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 40px;
    border-radius: 8px;
    background: #f5f5f5;
    color: #666;
    text-decoration: none;
    transition: all 0.3s ease;
    font-family: Arial, sans-serif;
    font-weight: 500;
}

/* 导航按钮基础样式 */
.page-prev,
.page-next {
    border-radius: 8px;
    background: #f5f5f5;
    color: #666;
    text-decoration: none;
    transition: all 0.3s ease;
    flex-shrink: 0;
    padding: 8px 12px
}

/* 数字分页容器 */
.page-numbers {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
    justify-content: center;
}

/* 动态按钮状态 */
#page1:target~.pagination .page-prev,
#page3:target~.pagination .page-next {
    opacity: 0.5;
    pointer-events: none;
}

#page1:target~.pagination .page-next {
    background: var(--primary-color);
    color: white;
}

#page2:target~.pagination .page-prev,
#page2:target~.pagination .page-next {
    background: var(--primary-color);
    color: white;
}

#page3:target~.pagination .page-prev {
    background: var(--primary-color);
    color: white;
}

/* 当前页按钮样式 */
.page-numbers .page-item:target,
#page1:target~.pagination [href="#page1"],
#page2:target~.pagination [href="#page2"],
#page3:target~.pagination [href="#page3"] {
    background: var(--primary-color);
    color: white;
    transform: scale(1.1);
}

/* 悬停效果 */
.page-prev:hover,
.page-next:hover,
.page-item:hover {
    filter: brightness(0.9);
    transform: translateY(-1px);
}

/* 移动端：上一页 / 页码 / 下一页 单行并排 */
@media (max-width: 768px) {
    .pagination {
        flex-direction: row;
        flex-wrap: nowrap;
        justify-content: center;
        align-items: stretch;
        gap: 0.45rem;
        margin: 1.35rem 0;
        padding: 0 0.35rem;
    }

    .page-prev,
    .page-next {
        flex: 1 1 0;
        min-width: 0;
        width: auto;
        order: unset;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 0.65rem 0.4rem;
        min-height: 2.75rem;
        font-size: 0.88rem;
        box-sizing: border-box;
    }

    .page-item {
        flex: 0 0 auto;
        width: auto;
        min-width: 2.75rem;
        height: auto;
        min-height: 2.75rem;
        padding: 0 0.6rem;
        font-size: 0.8rem;
        white-space: nowrap;
    }
}

/* 搜索页：结果标题 / 无结果 / 未输入关键词 */
.search-result-head {
    margin-bottom: 1.25rem;
}

.search-result-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 0.35rem;
}

.search-result-count {
    margin: 0;
    color: #666;
    font-size: 0.95rem;
}

.search-result-count strong {
    color: var(--primary-color, #e53935);
    font-weight: 600;
}

.search-empty,
.search-hint {
    padding: 2.5rem 1.5rem;
    text-align: center;
    color: #666;
    font-size: 1rem;
    background: #fafafa;
    border-radius: 8px;
    border: 1px dashed #ddd;
}

.search-hint {
    color: #888;
}