/* 公共样式 */
body {
    font-family: Arial, sans-serif;
    padding: 20px;
    background: #f5f5f5;
}

h2 {
    text-align: center;
    margin-bottom: 10px;
}

/* 分类按钮 */
.category-btns {
    text-align: center;
    margin-bottom: 20px;
}

.category-btns a {
    display: inline-block;
    padding: 6px 12px;
    margin: 2px;
    border: 1px solid #333;
    text-decoration: none;
    color: #333;
    border-radius: 4px;
    background: #fff;
    transition: background 0.3s, color 0.3s;
}

.category-btns a.active {
    background: #333;
    color: #fff;
}

/* 视频网格 */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 15px;
}

/* 视频格子 */
.video-item {
    border: 1px solid #333;
    position: relative;
    width: 100%;
    aspect-ratio: 16/9; /* 统一比例 */
    overflow: hidden;
    background: #000;
}

.video-item video {
    width: 100%;
    height: 100%;
    object-fit: contain; /* 适应容器，保持比例 */
    background: #000;
    transition: transform 0.3s;
}

/* 视频标题 */
.video-title {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(0,0,0,0.6);
    color: #fff;
    padding: 2px 5px;
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
}

/* 分页 */
.pagination {
    text-align: center;
    margin-top: 20px;
}

.pagination a {
    display: inline-block;
    padding: 6px 12px;
    margin: 2px;
    border: 1px solid #333;
    text-decoration: none;
    color: #333;
    border-radius: 4px;
    transition: background 0.3s, color 0.3s;
}

.pagination a.active {
    background: #333;
    color: #fff;
}

/* 移动端适配 */
@media(max-width:600px){
    .grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 10px;
    }
    .video-title {
        font-size: 12px;
    }
    .category-btns a {
        padding: 4px 8px;
        font-size: 12px;
    }
    .pagination a {
        padding: 4px 8px;
        font-size: 12px;
    }
}
