/* Video 预览组件样式（基于 video.js） */

/* 组件根容器 - 全屏遮罩，定位最上层 */
.video-preview-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #000000;
    z-index: 9999;
    display: none;
    flex-direction: column;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.video-preview-overlay.active {
    display: flex;
}

.video-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.video-toolbar {
    width: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    z-index: 2;
}

.video-js .vjs-seek-to-live-control {
    display: none;
}

.video-title {
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 60%;
}

.video-close-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    transition: background-color 0.15s ease;
}

.video-close-btn:hover {
    background-color: rgba(255, 255, 255, 0.15);
}

.video-close-btn:active {
    background-color: rgba(255, 255, 255, 0.25);
}

.video-player-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #000000;
    overflow: hidden;
    position: relative;
    width: 100%;
}

/* video.js 容器自适应 + 视频完整展示不裁剪 */
.video-player-wrapper .video-js {
    width: 100%;
    height: 100%;
}

.video-player-wrapper .video-js .vjs-tech {
    object-fit: contain;
}

/* loading 遮罩 */
.video-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    pointer-events: none;
}

.video-loading-overlay.hidden {
    display: none;
}

.video-loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid #4080ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* 错误提示 */
.video-error-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #ff6b6b;
    font-size: 16px;
    text-align: center;
    padding: 24px;
    display: none;
    z-index: 10;
}

.video-error-message.show {
    display: block;
}

/* 响应式适配 */
@media (max-width: 768px) {
  .video-player-wrapper {
    padding-bottom: 120px;
  }
    .video-toolbar {
        padding: 8px 12px;
    }

    .video-title {
        font-size: 13px;
        max-width: 50%;
    }

    .video-close-btn {
        width: 40px;
        height: 40px;
    }

    .video-close-btn svg {
        width: 24px;
        height: 24px;
    }
}

@media (max-width: 480px) {
    .video-toolbar {
        padding: 6px 8px;
    }

    .video-title {
        font-size: 12px;
        max-width: 45%;
    }

    .video-close-btn {
        width: 36px;
        height: 36px;
    }
}
