/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Roboto, -apple-system, BlinkMacSystemFont, sans-serif;
    background: #0a0a0a;
    color: #fff;
    line-height: 1.6;
}

/* 导航栏 */
.navbar {
    background: rgba(20, 20, 20, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid #333;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: #ff6a00;
    text-decoration: none;
    transition: color 0.3s;
}

.logo:hover {
    color: #ff8533;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
}

.nav-link {
    color: #fff;
    text-decoration: none;
    font-size: 1rem;
    transition: color 0.3s;
}

.nav-link:hover {
    color: #ff6a00;
}

/* 搜索框 */
.search-box {
    flex: 1;
    max-width: 500px;
    margin: 0 2rem;
    display: flex;
}

.search-input {
    flex: 1;
    padding: 0.8rem 1.2rem;
    border: none;
    border-radius: 30px 0 0 30px;
    background: #2a2a2a;
    color: #fff;
    font-size: 1rem;
    transition: background 0.3s;
}

.search-input:focus {
    outline: none;
    background: #333;
}

.search-input::placeholder {
    color: #888;
}

.search-btn {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 0 30px 30px 0;
    background: #ff6a00;
    color: white;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s;
}

.search-btn:hover {
    background: #ff5200;
}

.search-btn:focus {
    outline: 2px solid #ffaa00;
    outline-offset: 2px;
}

/* 主要内容 */
.container {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 2rem;
}

/* 分类导航 */
.categories {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.category-btn {
    padding: 0.6rem 1.5rem;
    background: #2a2a2a;
    border: none;
    border-radius: 30px;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.95rem;
}

.category-btn:hover,
.category-btn.active {
    background: #ff6a00;
    color: white;
}

.category-btn:focus {
    outline: 2px solid #ffaa00;
    outline-offset: 2px;
}

/* 视频网格 */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.video-card {
    background: #1a1a1a;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.video-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(255, 106, 0, 0.2);
}

.video-card:focus-within {
    outline: 2px solid #ff6a00;
    outline-offset: 2px;
}

.video-thumbnail {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #2a2a2a;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-thumbnail .placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #ff6a00, #ff5200);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 4rem;
}

.video-duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
}

.video-info {
    padding: 1rem;
}

.video-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #fff;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-meta {
    display: flex;
    justify-content: space-between;
    color: #888;
    font-size: 0.85rem;
}

.video-views {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

/* 置顶视频特殊样式 */
.video-card.top-video {
    border: 2px solid #ff6a00;
    box-shadow: 0 0 15px rgba(255, 106, 0, 0.3);
}

.video-card.top-video .video-title {
    color: #ffaa00;
}

/* 播放器模态框 */
.player-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 2000;
    display: none;
    justify-content: center;
    align-items: center;
}

.player-modal.active {
    display: flex;
}

.player-container {
    width: 90%;
    max-width: 1000px;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
}

.player-header {
    padding: 1rem;
    background: #1a1a1a;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.player-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #fff;
    margin: 0;
}

.close-player {
    background: none;
    border: none;
    color: #888;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    transition: color 0.3s;
}

.close-player:hover {
    color: #ff6a00;
}

.close-player:focus {
    outline: 2px solid #ff6a00;
    outline-offset: 2px;
}

video {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    outline: none;
}

.player-info {
    padding: 1rem;
    background: #1a1a1a;
    display: flex;
    justify-content: space-between;
    color: #888;
}

/* 加载动画 */
.loading {
    text-align: center;
    padding: 3rem;
    grid-column: 1 / -1;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid #333;
    border-top-color: #ff6a00;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

/* 提示信息 */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 2rem;
    background: #1a1a1a;
    border-left: 4px solid #ff6a00;
    border-radius: 8px;
    color: #fff;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    transform: translateX(400px);
    transition: transform 0.3s;
    z-index: 3000;
}

.toast.show {
    transform: translateX(0);
}

.toast.error {
    border-left-color: #f44336;
}

.toast.success {
    border-left-color: #4caf50;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin: 2rem 0;
}

.page-btn {
    padding: 0.5rem 1rem;
    background: #2a2a2a;
    border: none;
    border-radius: 5px;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s;
}

.page-btn:hover,
.page-btn.active {
    background: #ff6a00;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .search-box {
        margin: 0;
        max-width: 100%;
    }
    
    .video-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1rem;
    }
    
    .nav-links {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }
    
    .categories {
        justify-content: center;
    }
    
    .video-grid {
        grid-template-columns: 1fr;
    }
}

/* 打印样式 */
@media print {
    .navbar,
    .categories,
    .search-box,
    .player-modal,
    .toast {
        display: none;
    }
    
    body {
        background: white;
        color: black;
    }
}

/* 辅助功能 */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}