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

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f5f5f5;
}

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

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s;
}

ul {
    list-style: none;
}

/* 导航栏 */
.navbar {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 20px;
}

.nav-brand a {
    font-size: 1.5rem;
    font-weight: bold;
    color: #2c3e50;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-menu a {
    color: #333;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: all 0.3s;
}

.nav-menu a:hover {
    background: #f8f9fa;
    color: #667eea;
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 5px;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: #333;
    transition: all 0.3s;
}

/* 移动端响应式 */
@media (max-width: 768px) {
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #fff;
        flex-direction: column;
        padding: 1rem;
        box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
    }

    .nav-menu.active {
        display: flex;
    }

    .hamburger {
        display: flex;
    }
}

/* 首页横幅 */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    text-align: center;
    padding: 150px 20px 100px;
    margin-top: 60px;
}

/* 视频播放器区域 */
.player-section {
    background: #000;
    padding: 30px 0;
    position: relative;
}

.player-container {
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
}

.xgplayer-container {
    width: 100%;
    background: #000;
    border-radius: 10px;
    overflow: hidden;
}

.player-close {
    position: absolute;
    top: -15px;
    right: -15px;
    width: 40px;
    height: 40px;
    background: #e74c3c;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
    font-weight: bold;
    transition: all 0.3s;
    z-index: 100;
}

.player-close:hover {
    background: #c0392b;
    transform: scale(1.1);
}

.player-info {
    max-width: 1000px;
    margin: 20px auto 0;
    padding: 20px;
    background: #1a1a1a;
    border-radius: 10px;
    color: #fff;
}

.player-info h2 {
    font-size: 1.8rem;
    margin-bottom: 15px;
    color: #fff;
}

.player-info p {
    color: #bdc3c7;
    margin-bottom: 15px;
    line-height: 1.6;
}

.player-meta {
    display: flex;
    gap: 20px;
    color: #95a5a6;
    font-size: 0.95rem;
    padding-top: 15px;
    border-top: 1px solid #333;
}

.player-playlist {
    max-width: 1000px;
    margin: 30px auto 0;
    padding: 20px;
    background: #1a1a1a;
    border-radius: 10px;
    color: #fff;
}

.player-playlist h3 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: #fff;
}

#playlistItems {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

.playlist-item {
    background: #2a2a2a;
    border-radius: 8px;
    padding: 10px;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid transparent;
    display: flex;
    gap: 10px;
}

.playlist-item:hover {
    background: #3a3a3a;
    transform: translateY(-2px);
}

.playlist-item.playing {
    border-color: #667eea;
    background: #3a3a3a;
}

.playlist-thumb {
    width: 120px;
    height: 68px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.playlist-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.playlist-info h4 {
    font-size: 0.9rem;
    margin-bottom: 5px;
    color: #fff;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.playlist-views {
    font-size: 0.8rem;
    color: #95a5a6;
}

.hero-content h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.hero-content p {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
}

.btn-primary {
    background: #fff;
    color: #667eea;
}

.btn-primary:hover {
    background: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.btn-secondary {
    background: #95a5a6;
    color: #fff;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

/* 通用区块样式 */
.section {
    padding: 80px 0;
}

.section-gray {
    background: #f8f9fa;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 50px;
    color: #2c3e50;
}

/* 精选视频 */
.featured-video {
    max-width: 800px;
    margin: 0 auto;
}

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

.featured-video-card:hover {
    transform: translateY(-5px);
}

.featured-video-card .video-thumbnail {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    background: #000;
}

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

.video-preview {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    background: #000;
}

.preview-player {
    width: 100%;
    height: 100%;
}

.play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.video-thumbnail:hover .play-overlay {
    opacity: 1;
}

.play-button {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #667eea;
}

.featured-video-info {
    padding: 25px;
}

.featured-video-info h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #2c3e50;
}

.featured-video-info p {
    color: #7f8c8d;
    margin-bottom: 15px;
}

.video-meta {
    display: flex;
    gap: 10px;
    color: #95a5a6;
    font-size: 0.9rem;
}

/* 视频列表 */
.category-filter {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 8px 20px;
    border: 2px solid #667eea;
    background: transparent;
    color: #667eea;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

.filter-btn:hover,
.filter-btn.active {
    background: #667eea;
    color: #fff;
}

.videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

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

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

.video-card .video-thumbnail {
    position: relative;
    padding-top: 56.25%;
}

.duration-badge {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
}

.video-info {
    padding: 15px;
}

.video-info h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: #2c3e50;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.video-description {
    color: #7f8c8d;
    font-size: 0.9rem;
    margin-bottom: 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

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

#pageInfo {
    font-weight: 500;
    color: #2c3e50;
}

/* 分类网格 */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
}

.category-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

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

.category-card p {
    opacity: 0.9;
    font-size: 0.9rem;
}

/* 关于我们 */
.about-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.about-content h3 {
    font-size: 1.8rem;
    margin-bottom: 20px;
    color: #2c3e50;
}

.about-content p {
    margin-bottom: 15px;
    color: #7f8c8d;
    font-size: 1.1rem;
}

/* 联系我们 */
.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    max-width: 1000px;
    margin: 0 auto;
}

.contact-info h3,
.contact-form h3 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: #2c3e50;
}

.contact-info p {
    margin-bottom: 10px;
    color: #7f8c8d;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

/* 视频播放模态框 */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
}

.modal-content {
    background-color: #fff;
    margin: 2% auto;
    padding: 0;
    border-radius: 10px;
    width: 90%;
    max-width: 1000px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.video-modal {
    padding: 0;
    max-width: 1000px;
    width: 95%;
}

.video-player {
    width: 100%;
    background: #000;
    position: relative;
}

.video-player video {
    width: 100%;
    display: block;
    max-height: 70vh;
    background: #000;
}

.video-player .vjs-tech {
    max-height: 70vh;
}

.video-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    padding: 10px 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    opacity: 0;
    transition: opacity 0.3s;
}

.video-player:hover .video-controls {
    opacity: 1;
}

.control-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    padding: 5px;
    transition: transform 0.2s;
}

.control-btn:hover {
    transform: scale(1.2);
}

.progress-container {
    flex: 1;
    height: 8px;
    background: rgba(255,255,255,0.3);
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: #e74c3c;
    border-radius: 4px;
    position: relative;
    width: 0%;
    transition: width 0.1s;
}

.progress-buffer {
    height: 100%;
    background: rgba(255,255,255,0.5);
    border-radius: 4px;
    position: absolute;
    top: 0;
    left: 0;
    width: 0%;
}

.time-display {
    color: #fff;
    font-size: 14px;
    min-width: 100px;
    text-align: center;
}

.video-info {
    padding: 30px;
    background: #fff;
}

.video-info h2 {
    font-size: 1.8rem;
    margin-bottom: 15px;
    color: #2c3e50;
}

.video-info p {
    color: #7f8c8d;
    margin-bottom: 15px;
    line-height: 1.6;
}

.video-info .video-meta {
    display: flex;
    gap: 20px;
    color: #95a5a6;
    font-size: 0.95rem;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #ecf0f1;
}

.video-playlist {
    padding: 20px 30px;
    background: #f8f9fa;
    border-top: 1px solid #ecf0f1;
}

.video-playlist h3 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: #2c3e50;
}

.playlist-item {
    display: flex;
    gap: 15px;
    padding: 10px;
    margin-bottom: 10px;
    background: #fff;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.playlist-item:hover {
    background: #e8f4f8;
    transform: translateX(5px);
}

.playlist-thumb {
    width: 120px;
    height: 68px;
    object-fit: cover;
    border-radius: 4px;
}

.playlist-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.playlist-info h4 {
    font-size: 0.95rem;
    margin-bottom: 5px;
    color: #2c3e50;
    line-height: 1.4;
}

.playlist-views {
    font-size: 0.85rem;
    color: #95a5a6;
}

.close {
    position: absolute;
    right: -15px;
    top: -15px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #fff;
    z-index: 100;
    background: #e74c3c;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.close:hover {
    background: rgba(0, 0, 0, 0.8);
}

/* 页脚 */
.footer {
    background: #2c3e50;
    color: #ecf0f1;
    padding: 50px 0 20px;
}

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

.footer-section h3 {
    font-size: 1.3rem;
    margin-bottom: 20px;
    color: #fff;
}

.footer-section p {
    color: #bdc3c7;
    margin-bottom: 10px;
}

.footer-section ul li {
    margin-bottom: 10px;
}

.footer-section a {
    color: #bdc3c7;
}

.footer-section a:hover {
    color: #667eea;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #34495e;
    color: #95a5a6;
}

/* 响应式 */
@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 2rem;
    }

    .hero-content p {
        font-size: 1.2rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .contact-content {
        grid-template-columns: 1fr;
    }

    .videos-grid {
        grid-template-columns: 1fr;
    }

    .categories-grid {
        grid-template-columns: 1fr;
    }

    .modal-content {
        width: 95%;
        margin: 5% auto;
    }
}

/* 加载和错误状态 */
.loading,
.error {
    text-align: center;
    padding: 20px;
    color: #7f8c8d;
}

.error {
    color: #e74c3c;
}