/* 视频播放器样式 */
.video-player-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.video-player-container {
    background-color: #1a1a1a;
    border-radius: 10px;
    overflow: hidden;
    width: 90%;
    max-width: 1000px;
    max-height: 90vh;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
}

.video-player-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: #2c3e50;
    color: white;
}

.video-player-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.video-player-controls {
    display: flex;
    gap: 10px;
}

.video-player-close,
.video-player-fullscreen {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.video-player-fullscreen {
    font-size: 16px;
}

.video-player-close:hover,
.video-player-fullscreen:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.video-player-content {
    position: relative;
    padding: 0;
}

.video-player-content video {
    width: 100%;
    height: auto;
    display: block;
}

/* 全屏模式下的样式 */
:-webkit-full-screen video {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain;
}

:-moz-full-screen video {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain;
}

:-ms-fullscreen video {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain;
}

:fullscreen video {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain;
}

.video-watermark {
    position: absolute;
    bottom: 10px;
    right: 10px;
    color: rgba(255, 255, 255, 0.2);
    font-size: max(2vw, 14px);
    font-weight: bold;
    pointer-events: none;
    white-space: nowrap;
    overflow: hidden;
    z-index: 5;
}

/* 确保水印在全屏模式下也能显示 */
:-webkit-full-screen .video-watermark {
    position: absolute;
    bottom: 10px;
    right: 10px;
    color: rgba(255, 255, 255, 0.2);
    font-size: max(2vw, 14px);
    font-weight: bold;
    pointer-events: none;
    white-space: nowrap;
    overflow: hidden;
    z-index: 5;
}

:-moz-full-screen .video-watermark {
    position: absolute;
    bottom: 10px;
    right: 10px;
    color: rgba(255, 255, 255, 0.2);
    font-size: max(2vw, 14px);
    font-weight: bold;
    pointer-events: none;
    white-space: nowrap;
    overflow: hidden;
    z-index: 5;
}

:-ms-fullscreen .video-watermark {
    position: absolute;
    bottom: 10px;
    right: 10px;
    color: rgba(255, 255, 255, 0.2);
    font-size: max(2vw, 14px);
    font-weight: bold;
    pointer-events: none;
    white-space: nowrap;
    overflow: hidden;
    z-index: 5;
}

:fullscreen .video-watermark {
    position: absolute;
    bottom: 10px;
    right: 10px;
    color: rgba(255, 255, 255, 0.2);
    font-size: max(2vw, 14px);
    font-weight: bold;
    pointer-events: none;
    white-space: nowrap;
    overflow: hidden;
    z-index: 5;
}

/* 确保视频播放器内容在全屏模式下正确定位 */
:-webkit-full-screen .video-player-content {
    position: relative;
    width: 100%;
    height: 100%;
}

:-moz-full-screen .video-player-content {
    position: relative;
    width: 100%;
    height: 100%;
}

:-ms-fullscreen .video-player-content {
    position: relative;
    width: 100%;
    height: 100%;
}

:fullscreen .video-player-content {
    position: relative;
    width: 100%;
    height: 100%;
}

/* 隐藏视频播放器中的下载按钮 */
video::-webkit-media-controls-download-button {
    display: none !important;
}

video::-webkit-media-controls-enclosure {
    overflow: hidden;
}

video::-webkit-media-controls-panel {
    width: calc(100% + 30px);
}

/* 禁用右键菜单 */
.video-player-overlay {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* 允许点击视频但禁用拖动 */
video {
    pointer-events: auto;
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    user-drag: none;
}

/* 透明提示框样式 */
.transparent-tooltip {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 15px 25px;
    border-radius: 8px;
    font-size: 16px;
    text-align: center;
    z-index: 2000;
    opacity: 1;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

/* 链接保护 */
a[onclick*="open"] {
    display: inline-block;
    position: relative;
    z-index: 1;
}

/* 视频卡片样式 */
.video-card {
    background-color: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin-bottom: 20px;
}

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

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

.video-placeholder {
    width: 100%;
    height: 200px;
    background-color: #3498db;
    border-radius: 10px 10px 0 0;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* 为不同组别的视频卡片添加不同的默认背景 */
.video-card:nth-child(4n+1) .video-placeholder {
    background-color: #3498db;
}

.video-card:nth-child(4n+2) .video-placeholder {
    background-color: #2ecc71;
}

.video-card:nth-child(4n+3) .video-placeholder {
    background-color: #9b59b6;
}

.video-card:nth-child(4n+4) .video-placeholder {
    background-color: #f1c40f;
}

.video-placeholder::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.5));
    z-index: 1;
}

.play-icon {
    font-size: 60px;
    color: white;
    position: relative;
    z-index: 2;
    transition: transform 0.3s ease, color 0.3s ease;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.video-card:hover .play-icon {
    transform: scale(1.1);
    color: #f39c12;
}

.video-info {
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 0 0 10px 10px;
}

.video-info h4 {
    margin: 0 0 8px 0;
    color: #1a5276;
    font-size: 16px;
    font-weight: 600;
}

.video-info p {
    margin: 0;
    color: #666;
    font-size: 14px;
}

/* 视频分组样式 */
.video-group {
    margin-bottom: 40px;
}

.video-group-title {
    color: #1a5276;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #3498db;
    display: flex;
    align-items: center;
}

.video-group-title::before {
    content: '';
    margin-right: 0;
    font-size: 20px;
}

/* 视频网格样式 */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .video-player-container {
        width: 95%;
    }
    
    .video-placeholder {
        height: 150px;
    }
    
    .play-icon {
        font-size: 40px;
    }
    
    .video-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 15px;
    }
    
    .video-group-title {
        font-size: 16px;
    }
}

/* 文章元信息样式 */
.article-meta {
    text-align: center;
    margin: 10px 0 25px 0;
}

.article-meta .view-count {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #666;
    font-size: 14px;
    background: #f5f5f5;
    padding: 6px 14px;
    border-radius: 20px;
}

/* 页面标题居中 */
.container h1 {
    text-align: center;
}

/* 播放目录按钮 */
.playlist-toggle {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

/* 默认隐藏播放列表按钮（当没有视频片段时由JavaScript控制显示） */
.playlist-toggle.hidden {
    display: none;
}

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

/* 视频播放器主体 */
.video-player-body {
    display: flex;
    overflow: hidden;
}

.video-player-content {
    flex: 1;
    position: relative;
    background-color: #000;
    min-height: 400px;
}

.video-player-content video {
    width: 100%;
    height: 100%;
    min-height: 400px;
    display: block;
    object-fit: contain;
    background-color: #000;
}

/* 播放目录面板 */
.video-playlist {
    width: 280px;
    background-color: #2c3e50;
    display: none;
    flex-direction: column;
    overflow: hidden;
    border-left: 1px solid #34495e;
}

.video-playlist.expanded {
    display: flex;
}

.playlist-open .video-player-content {
    max-width: calc(100% - 280px);
}

.playlist-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background-color: #34495e;
    border-bottom: 1px solid #34495e;
}

.playlist-title {
    color: white;
    font-size: 14px;
    font-weight: 600;
}

.playlist-close {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.playlist-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.playlist-content {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.playlist-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    margin-bottom: 4px;
    background-color: #34495e;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.playlist-item:hover {
    background-color: #3d5269;
}

.playlist-item.active {
    background-color: #3498db;
}

.playlist-name {
    color: white;
    font-size: 13px;
    font-weight: 500;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: left;
}

.playlist-duration {
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    font-family: monospace;
    flex-shrink: 0;
    margin-left: 10px;
}

/* 加载指示器 */
.loading-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 18px;
    z-index: 10;
    background-color: rgba(0, 0, 0, 0.7);
    padding: 15px 25px;
    border-radius: 8px;
}

/* 错误消息 */
.error-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #e74c3c;
    font-size: 18px;
    z-index: 10;
    background-color: rgba(0, 0, 0, 0.8);
    padding: 20px 30px;
    border-radius: 8px;
    display: none;
}

/* 响应式设计 - 移动端适配 */
@media (max-width: 768px) {
    .video-player-overlay {
        padding: 0;
        margin: 0;
        justify-content: flex-start;
        align-items: stretch;
        align-content: stretch;
    }
    
    /* 关键修复：移除播放列表对视频宽度的限制 */
    .playlist-open .video-player-content {
        max-width: 100% !important;
        width: 100% !important;
    }
    
    .video-player-container {
        width: 100%;
        max-width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }
    
    .video-player-header {
        padding: 10px 15px;
        flex-shrink: 0;
        background-color: #2c3e50;
        z-index: 10;
    }
    
    .video-player-header h3 {
        font-size: 14px;
        margin: 0;
        color: white;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        flex: 1;
    }
    
    .video-player-body {
        flex: 1;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        background-color: #000;
        min-height: 0; /* 重要：允许flex子项收缩 */
    }
    
    .video-player-content {
        flex: 1;
        position: relative;
        background-color: #000;
        min-height: 200px; /* 视频区域最小高度 */
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .video-player-content video {
        width: 100% !important;
        max-height: 100% !important;
        display: block;
        object-fit: contain; /* 保持视频比例 */
        background-color: #000;
    }
    
    /* 有播放列表时的布局 - 视频区域优先，播放列表自适应剩余空间 */
    .playlist-open .video-player-content {
        flex: 1;
        min-height: 200px;
        max-height: 60vh;
        padding-bottom: 50px; /* 预留播放控制条空间 */
        box-sizing: border-box;
    }
    
    /* 无播放列表时视频区域占满 */
    .no-playlist .video-player-content {
        flex: 1;
        min-height: 0;
    }
    
    /* 播放目录面板 - 移动端显示在底部，自适应高度 */
    .video-playlist {
        width: 100%;
        flex-shrink: 1;
        flex-grow: 0;
        position: relative;
        border-left: none;
        border-top: 1px solid #34495e;
        display: flex;
        flex-direction: column;
        background-color: #2c3e50;
        max-height: 60vh; /* 播放列表最大高度 */
        min-height: 120px; /* 播放列表最小高度 */
        height: auto; /* 自适应高度 */
    }
    
    .video-playlist.collapsed {
        display: none;
    }
    
    .video-playlist.expanded {
        display: flex;
    }
    
    .playlist-content {
        flex: 1;
        overflow-y: auto;
        padding: 8px;
    }
    
    .playlist-item {
        padding: 10px 12px;
    }
    
    .playlist-name {
        font-size: 12px;
    }
    
    .playlist-toggle,
    .video-player-fullscreen,
    .video-player-close {
        font-size: 16px;
        width: 30px;
        height: 30px;
    }
    
    /* 视频占位区域优化 */
    .video-placeholder {
        height: 150px;
    }
    
    .play-icon {
        font-size: 40px;
    }
    
    .video-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 15px;
    }
    
    .video-group-title {
        font-size: 16px;
    }
}

/* 横屏模式移动设备适配 */
@media (max-width: 768px) and (orientation: landscape) {
    .video-player-container {
        height: 100vh;
        flex-direction: column;
    }
    
    .video-player-body {
        flex-direction: row;
    }
    
    .video-player-content {
        flex: 1;
        min-width: 0;
        height: auto;
        width: 100%;
    }
    
    .playlist-open .video-player-content {
        flex: 1;
        height: auto;
        max-width: none !important;
        width: 100% !important;
    }
    
    .video-playlist {
        width: 35%;
        max-width: 280px;
        height: auto;
        flex-shrink: 0;
        border-top: none;
        border-left: 1px solid #34495e;
        max-height: 100vh;
    }
    
    .video-playlist.expanded {
        display: flex;
    }
}

/* 小屏幕设备适配 */
@media (max-width: 480px) {
    .video-player-container {
        width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }
    
    .video-player-header h3 {
        font-size: 12px;
    }
    
    .playlist-open .video-player-content {
        flex: 1;
        min-height: 180px;
        max-height: 55vh;
    }
    
    .video-playlist {
        max-height: 55vh;
        min-height: 100px;
        height: auto;
    }
    
    .playlist-content {
        padding: 6px;
    }
    
    .playlist-item {
        padding: 8px 10px;
    }
    
    .playlist-name {
        font-size: 11px;
    }
}

/* 超小屏幕设备适配 */
@media (max-width: 320px) {
    .video-player-header {
        padding: 8px 10px;
    }
    
    .video-player-header h3 {
        font-size: 11px;
    }
    
    .playlist-toggle,
    .video-player-fullscreen,
    .video-player-close {
        font-size: 14px;
        width: 28px;
        height: 28px;
    }
    
    .playlist-open .video-player-content {
        height: 30vh;
        min-height: 150px;
    }
}

/* 全局视频铺满修复 - 最关键的样式 */
@media only screen and (max-width: 768px) and (orientation: portrait) {
    /* 强制视频区域铺满宽度 */
    .video-player-content {
        width: 100% !important;
        left: 0 !important;
        right: 0 !important;
        max-width: 100% !important;
    }
    
    /* 播放列表展开时视频区域也要占满宽度 */
    .playlist-open .video-player-content {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 auto;
        height: 40vh;
    }
    
    .video-player-content video {
        width: 100% !important;
        height: 100% !important;
        object-fit: contain !important;
        background-color: #000;
    }
    
    /* 移除可能导致黑边的父容器限制 */
    .video-player-body {
        width: 100% !important;
        overflow-x: hidden !important;
        max-width: 100% !important;
    }
    
    /* 确保容器也占满宽度 */
    .video-player-container {
        width: 100% !important;
        max-width: 100% !important;
    }
}

/* 全屏模式下的视频样式 */
:-webkit-full-screen video,
:-moz-full-screen video,
:-ms-fullscreen video,
:fullscreen video {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    background-color: #000;
}

/* 移除可能冲突的旧样式 */
@media only screen and (max-width: 768px) {
    /* 覆盖之前可能导致问题的样式 */
    body .video-container,
    body .video-wrapper,
    body .video-item,
    body .player-container,
    body .video-box {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }
}



