* {
/* 全局重置和基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'PingFang SC', 'Microsoft YaHei', 'Arial', sans-serif;
}

/* CSS 变量定义 */
:root {
    --primary-color: #0C96F1; /* 主蓝色 */
    --primary-light: #e8f0fe; /* 浅蓝色背景 */
    --text-dark: #202124; /* 深色文本 */
    --text-light: #ffffff; /* 白色文本 */
    --border-light: #dadce0; /* 浅灰色边框 */
    --success-color: #28a745;
    --error-color: #dc3545;
    --warning-color: #ffc107;
    --navbar-height: 64px;
}

/* 顶部导航栏样式 */
.top-navbar {
    background-color: white;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    position: sticky;
    top: 0;
    z-index: 1000;
    height: var(--navbar-height);
}

.navbar-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.navbar-brand {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--text-dark);
    transition: all 0.3s ease;
}

.navbar-brand:hover {
    transform: translateY(-1px);
}

.navbar-icon {
    font-size: 1.8rem;
    margin-right: 10px;
}

.navbar-name {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--primary-color);
}

.navbar-links {
    display: flex;
    align-items: center;
    gap: 24px;
}

.nav-link {
    color: var(--text-dark);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 4px;
    transition: all 0.3s ease;
    position: relative;
}

.nav-link:hover {
    color: var(--primary-color);
    background-color: var(--primary-light);
}

.nav-link.active {
    color: var(--primary-color);
    font-weight: 600;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 16px;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 2px;
}

.nav-link.admin {
    background-color: var(--primary-color);
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
}

.nav-link.admin:hover {
    background-color: #097dd9;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(12, 150, 241, 0.2);
}

body {
    background-color: #f8f9fa; /* 浅灰色背景 */
    color: var(--text-dark);
    line-height: 1.6;
    min-height: 100vh;
}

/* 容器样式 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 头部样式 */
header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px 0;
}

header h1 {
    font-size: 2.2rem;
    margin-bottom: 10px;
    color: var(--primary-color);
    font-weight: 600;
}

header p {
    color: #666;
    font-size: 1rem;
}

/* 分类标签样式 */
.category-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    overflow-x: auto;
    padding-bottom: 10px;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-light) transparent;
}

.category-tabs::-webkit-scrollbar {
    height: 4px;
}

.category-tabs::-webkit-scrollbar-thumb {
    background-color: var(--primary-color);
    border-radius: 2px;
}

.tab-btn {
    padding: 8px 16px;
    background-color: white;
    border: 2px solid #e0e0e0;
    border-radius: 20px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s ease;
    text-decoration: none;
    font-weight: 500;
}

.tab-btn.active {
    background-color: rgb(42, 103, 236) !important;
    color: white !important;
    border-color: var(--primary-color) !important;
    box-shadow: 0 4px 12px rgba(12, 150, 241, 0.3);
    transform: translateY(-2px);
}

.tab-btn:hover:not(.active) {
    border-color: var(--primary-color);
    color: white;
    transform: translateY(-1px);
    background-color: rgb(42, 103, 236);
}

/* 视频网格样式 */
.video-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr); /* 每行显示5个视频 */
    gap: 20px;
    margin-bottom: 40px;
}

/* 视频卡片样式 */
.video-card {
    background-color: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
    border: 1px solid rgba(0,0,0,0.06);
    position: relative;
    height: 190px;
}

.video-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 20px rgba(0,0,0,0.12);
}

.video-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, var(--primary-color), #49aff3);
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

/* 视频缩略图样式 */
.video-thumbnail {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 比例 */
    overflow: hidden;
    border-radius: 12px 12px 0 0;
}

.video-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

.duration {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background-color: rgba(0,0,0,0.8);
    color: white;
    font-size: 0.85rem;
    padding: 3px 8px;
    border-radius: 4px;
    backdrop-filter: blur(2px);
    font-weight: 500;
}

/* 视频标题样式 */
.video-title {
    font-size: 0.9rem;
    font-weight: 500;
    padding: 12px 15px 12px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
    color: #222;
    height: 60px;
}

/* 视频链接样式 */
.video-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

/* 搜索框样式 */
.search-container {
    display: flex;
    justify-content: center;
    padding: 20px;
    margin: 0 20px 25px;
    animation: fadeIn 0.5s ease;
    min-width: 0; /* 确保flex容器可以收缩 */
}

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

#search-input {
    flex: 1;
    min-width: 0; /* 允许输入框收缩 */
    max-width: 800px;
    padding: 14px 24px;
    border: 2px solid #dfe1e5;
    border-radius: 24px 0 0 24px;
    font-size: 16px;
    outline: none;
    transition: all 0.3s ease;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
    background-color: white;
}

#search-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(12, 150, 241, 0.2);
}

#search-button {
    padding: 14px 28px;
    background-color: rgb(42, 103, 236);
    color: white;
    border: none;
    border-radius: 0 24px 24px 0;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(12, 150, 241, 0.3);
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    white-space: nowrap;
}

#search-button:hover {
    background-color: #097dd9;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

#search-button:active {
    transform: translateY(1px);
}

/* 管理员链接样式 */
.admin-link-container {
    text-align: center;
    margin: 30px 0;
}

.admin-link {
    display: inline-block;
    padding: 10px 20px;
    background-color: var(--primary-light);
    color: var(--primary-color);
    text-decoration: none;
    border-radius: 20px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.admin-link:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(12, 150, 241, 0.2);
}

/* 页脚样式 */
.site-footer {
    background-color: white;
    color: var(--text-dark);
    padding: 30px 0 15px;
    margin-top: 40px;
    border-top: 1px solid var(--border-light);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer-info {
    text-align: center;
    margin-bottom: 20px;
}

.footer-info p {
    max-width: 800px;
    margin: 0 auto 15px;
    line-height: 1.6;
    color: #666;
}

.footer-links {
    margin-top: 15px;
}

.footer-links a {
    color: var(--primary-color);
    text-decoration: none;
    margin: 0 8px;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: #097dd9;
    text-decoration: underline;
}

.footer-bottom {
    text-align: center;
    padding-top: 15px;
    border-top: 1px solid var(--border-light);
    font-size: 14px;
    color: #666;
}

/* 分页控件样式 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 30px;
    padding: 20px;
}

.page-info {
    color: #666;
}

.page-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.page-btn.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.page-btn:hover:not(:disabled) {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

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

/* 导航栏响应式设计 */
@media (max-width: 768px) {
    .navbar-container {
        padding: 0 15px;
    }
    
    .navbar-name {
        font-size: 1.2rem;
    }
    
    .navbar-links {
        gap: 12px;
    }
    
    .nav-link {
        font-size: 0.9rem;
        padding: 6px 8px;
    }
    
    .nav-link.admin {
        padding: 6px 12px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .top-navbar {
        height: auto;
        min-height: var(--navbar-height);
    }
    
    .navbar-container {
        flex-direction: column;
        padding: 10px;
    }
    
    .navbar-brand {
        margin-bottom: 10px;
    }
    
    .navbar-links {
        justify-content: center;
        flex-wrap: wrap;
        gap: 8px;
    }
}

/* 视频网格响应式设计 */
@media (max-width: 1200px) {
    .video-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* 分页控件响应式设计 */
@media (max-width: 768px) {
    .pagination {
        padding: 10px;
    }
    
    .page-controls {
        gap: 6px;
    }
    
    .page-btn {
        padding: 6px 10px;
        font-size: 13px;
    }
    
    .page-info {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .page-controls {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .page-btn {
        min-width: 36px;
        height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0 8px;
    }
}

@media (max-width: 992px) {
    .video-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .video-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    header h1 {
        font-size: 1.8rem;
    }
    
    .video-card {
        height: 220px;
    }
    
    /* 分页控件响应式设计 */
    .pagination {
        padding: 10px;
    }
    
    .page-controls {
        gap: 6px;
    }
    
    .page-btn {
        padding: 6px 10px;
        font-size: 13px;
    }
    
    .page-info {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .video-grid {
        grid-template-columns: 1fr;
    }
    
    .container {
        padding: 10px;
    }
    
    .video-card {
        height: auto; /* 允许卡片高度自适应 */
        min-height: 240px; /* 设置最小高度以确保有足够空间显示标题 */
    }
    
    .video-title {
        font-size: 0.95rem; /* 略微增大标题字体大小 */
        padding: 12px 15px 15px;
        height: auto; /* 允许标题高度自适应 */
        min-height: 60px; /* 设置最小高度确保显示空间 */
    }
    
    /* 搜索框手机端样式 */
    .search-container {
        padding: 15px 10px;
        margin: 0 10px 20px;
    }
    
    #search-input {
        padding: 12px 16px;
        font-size: 14px;
    }
    
    #search-button {
        padding: 12px 18px;
        font-size: 14px;
    }
    
    /* 分页控件响应式设计 */
    .page-controls {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .page-btn {
        min-width: 36px;
        height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0 8px;
    }
}

/* 无数据状态样式 */
.no-videos {
    text-align: center;
    padding: 60px 20px;
    color: #666;
    font-size: 18px;
}

/* 分页控件样式 */
.pagination {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 40px 0;
    gap: 20px;
}

.page-info {
    color: #666;
    font-size: 14px;
    margin-bottom: 10px;
}

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

.page-btn {
    padding: 8px 14px;
    border: 1px solid #dfe1e5;
    border-radius: 6px;
    background-color: white;
    color: var(--text-dark);
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
}

.page-btn:hover:not(:disabled) {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(12, 150, 241, 0.1);
}

.page-btn.active {
    background-color: rgb(42, 103, 236);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(12, 150, 241, 0.2);
}

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

.page-btn:disabled:hover,
.page-btn.disabled:hover {
    border-color: #dfe1e5;
    color: var(--text-dark);
    box-shadow: none;
}

/* 平滑滚动 */
html {
    scroll-behavior: smooth;
}

/* 加载动画 */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(12, 150, 241, 0.2);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}