/* 腾讯视频点播播放器前端样式 */

.tencent-vod-player {
    display: flex;
    margin: 20px 0;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    height: 500px; /* 固定整体高度为500px */
}

/* 左侧视频播放区域 (70%) */
.video-section {
    flex: 0 0 70%;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.video-player {
    position: relative;
    width: 100%;
    height: 500px; /* 固定高度为500px */
    background: #000;
    border-radius: 8px 0 0 8px;
    overflow: hidden;
}

.video-container {
    position: relative;
    width: 100%;
    height: 100%; /* 占满整个视频播放器区域 */
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* video元素样式 */
#tencent-vod-player {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    background: #000;
    object-fit: contain; /* 保持视频比例，完整显示 */
}

.video-info {
    display: none; /* 隐藏视频信息区域，让视频占满整个高度 */
}

.current-chapter-title {
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.video-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.control-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #007cba;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.control-btn:hover:not(:disabled) {
    background: #005a87;
    transform: translateY(-1px);
}

.control-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

.control-btn .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* 右侧章节列表区域 (30%) */
.chapters-sidebar {
    flex: 0 0 30%;
    min-width: 0;
    height: 500px; /* 固定高度为500px */
    background: #1a1a1a; /* 黑色背景 */
    border-left: 1px solid #333;
    display: flex;
    flex-direction: column;
}

.chapters-header {
    padding: 15px 20px;
    border-bottom: 2px solid #007cba;
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%); /* 深色渐变背景 */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.chapters-title {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 700;
    color: #ffffff; /* 白色文字 */
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.chapters-count {
    font-size: 13px;
    color: #00bfff; /* 亮蓝色文字 */
    font-weight: 500;
    background: rgba(0, 191, 255, 0.2); /* 半透明蓝色背景 */
    padding: 4px 8px;
    border-radius: 12px;
    display: inline-block;
}

.chapters-content {
    flex: 1;
    overflow-y: auto;
    max-height: calc(500px - 80px); /* 减去header高度 */
}

.chapters-list {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.chapter-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    cursor: pointer;
    border-bottom: 1px solid #333; /* 深色边框 */
    transition: all 0.3s ease;
    position: relative;
    background: #1a1a1a; /* 黑色背景 */
    color: #ffffff; /* 白色文字 */
}

.chapter-item:hover {
    background: #333; /* 深灰色悬停效果 */
    color: #ffffff;
}

.chapter-item.active {
    background: #ff6b35; /* 橙色背景，更醒目 */
    color: white;
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.3); /* 橙色阴影 */
    border-left: 4px solid #ff4500; /* 左侧橙色边框 */
}

.chapter-item.active .chapter-number {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.chapter-item.active .chapter-name {
    color: white;
}

.chapter-item.active .chapter-duration {
    color: rgba(255, 255, 255, 0.8);
}

.chapter-item.active .play-icon {
    color: white;
}

.chapter-number {
    flex: 0 0 24px;
    width: 24px;
    height: 24px;
    background: #444; /* 深灰色背景 */
    color: #ffffff; /* 白色文字 */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    margin-right: 10px;
}

.chapter-content {
    flex: 1;
    min-width: 0;
    margin-right: 10px;
}

.chapter-name {
    font-size: 13px;
    font-weight: 500;
    color: #ffffff; /* 白色文字 */
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chapter-duration {
    font-size: 11px;
    color: #ccc; /* 浅灰色文字 */
    flex: 0 0 auto;
    margin-right: 8px;
}

.chapter-status {
    flex: 0 0 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.play-icon {
    color: #00bfff; /* 亮蓝色图标 */
    font-size: 14px;
    width: 14px;
    height: 14px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .tencent-vod-player {
        flex-direction: column;
        height: auto; /* 改为自动高度 */
        gap: 0;
    }
    
    .video-section {
        flex: none;
        width: 100%;
    }
    
    .video-player {
        height: 250px; /* 手机版视频高度降低到250px */
        border-radius: 8px 8px 0 0;
    }
    
    .chapters-sidebar {
        flex: none;
        width: 100%;
        height: auto; /* 改为自动高度 */
        border-left: none;
        border-top: 1px solid #333;
        border-radius: 0 0 8px 8px;
    }
    
    .chapters-content {
        max-height: 300px; /* 增加章节列表高度 */
    }
    
    .video-info {
        padding: 15px;
    }
    
    .current-chapter-title {
        font-size: 16px;
    }
    
    .control-btn {
        padding: 8px 16px;
        font-size: 13px;
    }
}

/* 中等屏幕优化 */
@media (max-width: 600px) {
    .video-player {
        height: 220px; /* 中等屏幕视频高度 */
    }
    
    .chapters-content {
        max-height: 280px;
    }
}

@media (max-width: 480px) {
    .tencent-vod-player {
        margin: 10px 0;
        border-radius: 4px;
        height: auto; /* 确保小屏幕也是自动高度 */
    }
    
    .video-player {
        height: 200px; /* 小屏幕视频高度进一步降低 */
        border-radius: 4px 4px 0 0;
    }
    
    .chapters-sidebar {
        border-radius: 0 0 4px 4px;
        height: auto; /* 确保小屏幕也是自动高度 */
    }
    
    .chapters-content {
        max-height: 250px; /* 小屏幕章节列表高度 */
    }
    
    .video-info {
        padding: 12px;
    }
    
    .chapters-header {
        padding: 12px 10px 8px;
    }
    
    .chapters-title {
        font-size: 16px;
    }
    
    .chapters-count {
        font-size: 12px;
        padding: 3px 6px;
    }
    
    .chapter-item {
        padding: 8px 10px;
    }
    
    .chapter-name {
        font-size: 12px;
    }
    
    .chapter-duration {
        font-size: 10px;
    }
    
    .chapter-number {
        width: 20px;
        height: 20px;
        font-size: 11px;
        margin-right: 8px;
    }
}

/* 错误状态样式 */
.error {
    padding: 20px;
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    text-align: center;
    margin: 20px 0;
}

/* 加载状态样式 */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #666;
}

.loading::before {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid #e9ecef;
    border-top: 2px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 滚动条样式 */
.chapters-content::-webkit-scrollbar {
    width: 4px;
}

.chapters-content::-webkit-scrollbar-track {
    background: #333; /* 深色轨道 */
}

.chapters-content::-webkit-scrollbar-thumb {
    background: #666; /* 深灰色滑块 */
    border-radius: 2px;
}

.chapters-content::-webkit-scrollbar-thumb:hover {
    background: #888; /* 悬停时更亮的灰色 */
}