/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

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

/* 导航栏 */
.navbar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 180px auto 1fr auto;
    column-gap: 12px;
    align-items: center;
}

.nav-logo a {
    color: white;
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-menu {
    display: flex;
    gap: 0.75rem;
}

.nav-search {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-search input {
    width: 100%;
    max-width: 260px;
    padding: 0.6rem 2.2rem 0.6rem 1rem; /* 右侧为图标预留空间 */
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    outline: none;
}

.nav-search .nav-search-icon {
    position: absolute;
    right: 12px;
    color: #666;
    font-size: 1rem;
    cursor: pointer;
}

.nav-search button {
    background: #ff6b6b;
    color: white;
    border: none;
    padding: 0.6rem 1rem;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
}

.nav-search button:hover { background: #ff5252; }

.nav-link {
    color: white;
    text-decoration: none;
    padding: 0.4rem 0.8rem;
    border-radius: 5px;
    transition: background-color 0.3s;
    white-space: nowrap;
}
.nav-right {
    display: flex;
    align-items: center;
    gap: 1rem;
    white-space: nowrap;
}

.nav-right .nav-link {
    padding: 0.35rem 0.6rem;
}

.nav-right .user-menu { margin-left: 0.5rem; }

.nav-link:hover,
.nav-link.active {
    background-color: rgba(255,255,255,0.2);
}

.nav-user {
    position: relative;
}

.user-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0.4rem 0.8rem;
    border-radius: 5px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background-color 0.3s;
    white-space: nowrap;
}

.user-btn:hover {
    background-color: rgba(255,255,255,0.2);
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border-radius: 5px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    min-width: 150px;
    display: none;
    z-index: 1001;
}

.user-dropdown a {
    display: block;
    padding: 0.75rem 1rem;
    color: #333;
    text-decoration: none;
    transition: background-color 0.3s;
}

.user-dropdown a:hover {
    background-color: #f8f9fa;
}

.user-dropdown a.active {
    background-color: #667eea;
    color: white;
}

/* 主要内容区域 */
.main-content {
    min-height: calc(100vh - 200px);
}

/* 首页样式 */
.hero-section {
    background: #2b2b2b;
    color: white;
    padding: 0.75rem 0;
    text-align: center;
}

.hero-content {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.hero-content h1 {
    font-size: 1.6rem;
    margin: 0;
    font-weight: 300;
}

.hero-content p {
    font-size: 0.95rem;
    margin: 0;
    opacity: 0.85;
}

.hero-search {
    max-width: 500px;
    margin: 0 auto;
    display: flex;
    gap: 0.5rem;
}

.hero-search input {
    flex: 1;
    padding: 1rem;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    outline: none;
}

.hero-search button {
    background: #ff6b6b;
    color: white;
    border: none;
    padding: 1rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
}

.hero-search button:hover {
    background: #ff5252;
}

/* 推荐视频区域 */
.recommend-section {
    padding: 3rem 0;
    background: white;
}

.recommend-section h2 {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 2rem;
    color: #333;
}

/* 分类区域 */
.category-section {
    padding: 3rem 0;
    background: #f8f9fa;
}

.category-section h2 {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 2rem;
    color: #333;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.category-card {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    text-align: center;
    text-decoration: none;
    color: #333;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

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

.category-icon {
    font-size: 3rem;
    color: #667eea;
    margin-bottom: 1rem;
}

.category-card h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.category-card p {
    color: #666;
    font-size: 1rem;
}

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

.video-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

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

.video-thumbnail {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.video-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.7);
    color: white;
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    font-size: 1.5rem;
    cursor: pointer;
    transition: background-color 0.3s;
}

.video-play-btn:hover {
    background: rgba(0,0,0,0.9);
}

.video-info {
    padding: 1rem;
}

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

.video-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: #666;
}

.video-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: #666;
}

.video-rating {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.stars {
    color: #ffc107;
}

/* 轮播图样式 */
.banner-section {
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    margin-top: 0;
    margin-bottom: 0;
}

.banner-container {
    position: relative;
    width: 100%;
    height: 520px;
    overflow: hidden;
    background: #f8f9fa;
}

.banner-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #666;
    font-size: 16px;
}

.banner-loading::after {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.banner-inner {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    transition: transform 0.5s ease-in-out;
}

.banner-slide {
    min-width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.banner-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease-in-out;
    will-change: transform;
}

.banner-slide:hover img {
    transform: scale(1.01);
}

/* 添加渐变遮罩效果 */
.banner-slide::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100px;
    background: linear-gradient(transparent, rgba(0,0,0,0.3));
    pointer-events: none;
}

.banner-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 10;
}

/* 轮播左右箭头 */
.banner-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: rgba(0,0,0,0.35);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 11;
    opacity: 0;
    transition: opacity 0.25s ease, background 0.25s ease;
}

.banner-prev { left: 16px; }
.banner-next { right: 16px; }

.banner-container:hover .banner-arrow { opacity: 1; }
.banner-arrow:hover { background: rgba(0,0,0,0.55); }

.banner-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: all 0.3s ease;
}

.banner-dot.active {
    background: white;
    transform: scale(1.2);
}

.banner-dot:hover {
    background: rgba(255,255,255,0.8);
}

/* 轮播图响应式设计 */
@media (max-width: 768px) {
    .banner-container {
        height: 320px;
    }
    
    .banner-dots {
        bottom: 15px;
    }
    
    .banner-dot {
        width: 10px;
        height: 10px;
    }
}

@media (max-width: 480px) {
    .banner-container {
        height: 240px;
    }
}

/* 筛选器 */
.filter-section {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    margin: 2rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.filter-group {
    margin-bottom: 1rem;
}

.filter-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #333;
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.filter-btn {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    color: #666;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.9rem;
}

.filter-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.filter-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* 搜索框 */
.search-section {
    margin: 2rem 0;
}

.search-box {
    max-width: 500px;
    margin: 0 auto;
    display: flex;
    gap: 0.5rem;
}

.search-box input {
    flex: 1;
    padding: 1rem;
    border: 1px solid #dee2e6;
    border-radius: 25px;
    font-size: 1rem;
    outline: none;
}

.search-box input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-box button {
    background: #667eea;
    color: white;
    border: none;
    padding: 1rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
}

.search-box button:hover {
    background: #5a6fd8;
}

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

.pagination button {
    background: white;
    border: 1px solid #dee2e6;
    color: #666;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
}

.pagination button:hover:not(:disabled) {
    background: #f8f9fa;
    border-color: #adb5bd;
}

.pagination button.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 加载更多 */
.load-more-section {
    text-align: center;
    margin: 2rem 0;
}

.load-more-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
}

.load-more-btn:hover {
    background: #5a6fd8;
}

/* 页脚 */
.footer {
    background: #333;
    color: white;
    padding: 3rem 0 1rem;
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3,
.footer-section h4 {
    margin-bottom: 1rem;
    color: #fff;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section ul li a {
    color: #ccc;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-section ul li a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #555;
    color: #ccc;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 10px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    color: #333;
}

.close {
    color: #aaa;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

.close:hover {
    color: #000;
}

.modal-body {
    padding: 1.5rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .nav-container { grid-template-columns: 1fr; gap: 0.75rem; }
    
    .nav-menu {
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }
    
    .hero-content h1 {
        font-size: 1.8rem;
    }
    
    .hero-content p {
        font-size: 1rem;
        margin-bottom: 1rem;
    }
    
    .category-grid {
        grid-template-columns: 1fr;
    }
    
    .video-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1rem;
    }
    
    .filter-buttons {
        justify-content: center;
    }
    
    .search-box {
        flex-direction: column;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }
    
    .hero-content h1 {
        font-size: 1.4rem;
    }
    
    .hero-content p {
        font-size: 0.9rem;
        margin-bottom: 1rem;
    }
    
    .hero-section {
        padding: 1.5rem 0;
    }
    
    .video-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
}
