/* 视频播放器样式 */
.video-player-container {
    background: #000;
    position: relative;
    width: 100%;
    max-width: 1200px;
    margin: 20px auto;
    border-radius: 8px;
    overflow: hidden;
    /* 固定宽高比，防止尺寸跳跃 */
    aspect-ratio: 16/9;
    min-height: 500px;
    /* 确保不会阻止视频控制条的交互 */
}

.video-player-container::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50px; /* 为原生控制条预留空间 */
    pointer-events: none;
    z-index: -1;
}

.video-player {
    width: 100%;
    height: 100%; /* 填满容器 */
    display: block;
    background: #000;
    position: relative;
    z-index: 0; /* 确保控制条可以正常显示和交互 */
    object-fit: contain; /* 保持视频比例，避免拉伸 */
}

/* 视频加载前的占位符样式 */
.video-player:not([src]):not([data-hls-url]) {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    background-image: 
        radial-gradient(circle at center, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        linear-gradient(45deg, transparent 49%, rgba(255, 255, 255, 0.05) 49%, rgba(255, 255, 255, 0.05) 51%, transparent 51%);
}

/* 视频加载中的样式 */
.video-player[data-loading="true"] {
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-player[data-loading="true"]::before {
    content: "正在加载视频...";
    color: rgba(255, 255, 255, 0.7);
    font-size: 16px;
    font-weight: 500;
}

.video-controls {
    position: absolute;
    bottom: 60px; /* 进一步提高位置，确保完全不遮挡原生控制条 */
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.6)); /* 降低不透明度 */
    padding: 15px 20px; /* 减少垂直内边距 */
    color: white;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none; /* 允许点击穿透到下面的视频控制条 */
    z-index: 1; /* 确保在视频上方但不阻止交互 */
}

/* 中央播放/暂停按钮 */
.center-play-button {
    position: absolute;
    top: 45%; /* 稍微上移，避免与底部控制条重叠 */
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: rgba(0, 0, 0, 0.7);
    border: 3px solid rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10; /* 低于原生控制条 */
    opacity: 0;
    pointer-events: auto;
}

.center-play-button:hover {
    background: rgba(0, 0, 0, 0.9);
    border-color: #ff6b35;
    transform: translate(-50%, -50%) scale(1.1);
}

.center-play-button.show {
    opacity: 1;
}

.center-play-button.hide {
    opacity: 0;
    pointer-events: none;
}

/* 播放图标 */
.play-icon {
    width: 0;
    height: 0;
    border-left: 20px solid white;
    border-top: 12px solid transparent;
    border-bottom: 12px solid transparent;
    margin-left: 4px; /* 视觉居中调整 */
}

/* 暂停图标 */
.pause-icon {
    width: 20px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.pause-icon::before,
.pause-icon::after {
    content: '';
    width: 6px;
    height: 24px;
    background: white;
}

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

/* 确保原生视频控制条始终在最顶层 */
.video-player::-webkit-media-controls-panel {
    z-index: 2147483647 !important; /* 最高层级 */
}

.video-player::-webkit-media-controls {
    z-index: 2147483647 !important;
}

/* Firefox */
.video-player::-moz-media-controls {
    z-index: 2147483647 !important;
}

/* 通用进度条样式 */
.video-player {
    outline: none !important;
}

.video-player:focus {
    outline: none !important;
}

.video-info-section {
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
    background: #1a1a1a;
    color: white;
    border-radius: 8px;
    margin-bottom: 20px;
    box-sizing: border-box;
}

.video-title {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 15px;
    color: white;
}

.video-meta {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 15px;
    font-size: 14px;
    color: #aaa;
}

.video-description {
    line-height: 1.6;
    color: #ccc;
    max-height: 100px;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.video-description.expanded {
    max-height: none;
}

.expand-btn {
    color: orange;
    cursor: pointer;
    text-decoration: none;
    margin-top: 10px;
    display: inline-block;
}

/* 详细描述样式 */
.video-detailed-description {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #333;
}

.video-detailed-description h3 {
    color: white;
    font-size: 18px;
    margin-bottom: 15px;
    font-weight: bold;
}

.video-detailed-description p {
    color: #ccc;
    line-height: 1.6;
    font-size: 14px;
    text-align: justify;
    text-justify: inter-word;
}

/* 相关视频推荐样式 */
.related-videos-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.related-videos-title {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 20px;
    color: white;
}

.related-videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.related-video-item {
    background: #222;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.related-video-item:hover {
    transform: translateY(-5px);
}

.related-video-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.related-video-thumbnail {
    width: 100%;
    height: 160px;
    background-color: #333;
    position: relative;
    overflow: hidden;
}

.related-video-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.related-video-image.lazy-loaded {
    opacity: 1;
}

.related-video-duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
}

.related-video-info {
    padding: 15px 15px 8px 15px;
}

.related-video-title {
    font-size: 13px;
    font-weight: bold;
    color: white;
    margin-bottom: 6px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 34px; /* 确保标题区域固定高度 */
}

.related-video-description {
    font-size: 11px;
    font-weight: 400;
    line-height: 1.3;
    margin: 0 0 6px 0;
    color: #999;
    font-style: italic;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 15px;
}

.related-video-meta {
    font-size: 11px;
    color: #aaa;
    padding: 0 15px 15px 15px;
    line-height: 1.2;
}

.related-video-meta .video-source {
    margin-right: 8px;
}

/* 面包屑导航 */
.breadcrumb {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    color: #aaa;
}

.breadcrumb a {
    color: orange;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

/* 广告内容样式 */
.ad-content {
    margin-bottom: 15px;
    line-height: 1.8;
}

.ad-text {
    color: #ccc;
    line-height: 1.8;
    display: block;
}

.ad-link {
    margin: 20px 0;
    text-align: center;
    padding: 15px;
    background: rgba(255, 107, 53, 0.1);
    border-radius: 8px;
}

.highlight-url {
    color: #ff6b35;
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease;
    padding: 10px 20px;
    border-radius: 6px;
    background: rgba(255, 107, 53, 0.1);
    border: 2px solid #ff6b35;
    display: inline-block;
}

.highlight-url:hover {
    color: #fff;
    background: #ff6b35;
    border-color: #ff6b35;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}

.video-detailed-description .ad-content {
    margin-bottom: 12px;
}

.video-detailed-description .ad-link {
    margin: 15px 0;
    padding: 12px;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .video-player-container {
        margin: 10px;
        border-radius: 0;
        min-height: 200px; /* 移动端最小高度 */
        aspect-ratio: 16/9; /* 保持宽高比 */
    }
    
    .video-player {
        width: 100%;
        height: 100%; /* 填满容器 */
    }
    
    /* 移动端中央播放按钮稍小 */
    .center-play-button {
        width: 60px;
        height: 60px;
    }
    
    .play-icon {
        border-left-width: 15px;
        border-top-width: 9px;
        border-bottom-width: 9px;
        margin-left: 3px;
    }
    
    .pause-icon {
        width: 15px;
        height: 18px;
    }
    
    .pause-icon::before,
    .pause-icon::after {
        width: 4px;
        height: 18px;
    }
    
    .video-info-section,
    .related-videos-section {
        margin: 10px;
        padding: 15px;
    }
    
    .video-title {
        font-size: 18px;
    }
    
    .video-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .related-videos-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }
    
    .related-video-thumbnail {
        height: 100px;
    }
    
    .breadcrumb {
        padding: 10px;
        font-size: 14px;
    }
    
    .ad-link {
        margin: 15px 0;
        padding: 10px;
    }
    
    .highlight-url {
        font-size: 14px;
        padding: 8px 16px;
    }
}