/* 视频播放器基础样式 */
.video-player {
    width: 1010px;
    height: auto;
    aspect-ratio: 16 / 9;
    background-color: transparent !important;
    user-select: none;
    margin: auto;
    overflow: hidden;
    position: relative;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

.video-js {
    width: auto;
    height: 100%;
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    background-color: transparent !important;
}

/* 修复：确保video标签本身没有边框且背景透明 */
.video-js video {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    margin: 0 !important;
    padding: 0 !important;
    background-color: transparent !important;
}

/* 修复：确保tech层也是透明的 */
.video-js .vjs-tech {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none !important;
    outline: none !important;
    background-color: transparent !important;
}

/* iOS原生播放器特殊处理 - 修复白色块问题 */
.video-player.ios-native {
    background: transparent !important;
    border: none !important;
    margin: 0 auto !important;
    padding: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
}

.video-player.ios-native video,
.video-player.ios-native .native-video-player {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    background: transparent !important;
    border: none !important;
    margin: 0 !important;
    padding: 0 !important;
    display: block !important;
    /* 确保iOS原生控制栏显示 */
    -webkit-appearance: none !important;
    appearance: none !important;
}

/* iOS下禁用自定义点击覆盖层 */
.video-player.ios-native .vjs-tap-overlay {
    display: none !important;
    pointer-events: none !important;
}

/* iOS下确保原生控制栏不被遮盖 */
.video-player.ios-native video::-webkit-media-controls-panel {
    display: flex !important;
}

.video-player.ios-native video::-webkit-media-controls {
    display: flex !important;
}

.video-player.ios-native video::-webkit-media-controls-enclosure {
    display: flex !important;
}

/* 移除可能导致白色块的样式 */
.video-player.ios-native,
.video-player.ios-native * {
    box-shadow: none !important;
    border: none !important;
    outline: none !important;
}

/* iOS原生播放器样式优化 */
.video-player video.video-js {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    background-color: transparent !important;
}

/* 修复大播放按钮居中问题 - 关键样式 */
.video-js .vjs-big-play-button {
    display: block !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    font-size: 7.5em !important;
    line-height: 1.5em !important;
    height: 1.5em !important;
    width: 1.5em !important;
    border-radius: 50% !important;
    background-color: rgba(43, 51, 63, 0.7) !important;
    border: none !important;
    margin: 0 !important;
    padding: 0 !important;
    transition: background-color 0.3s ease !important;
    z-index: 100 !important;
}

/* iOS原生播放器不显示大播放按钮 */
.video-player.ios-native .vjs-big-play-button {
    display: none !important;
}

/* 确保在所有状态下都显示播放按钮 */
.video-js.vjs-paused .vjs-big-play-button,
.video-js.vjs-ended .vjs-big-play-button,
.video-js:not(.vjs-playing) .vjs-big-play-button {
    display: block !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    margin: 0 !important;
    padding: 0 !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* iOS原生播放器不显示VideoJS的播放按钮 */
.video-player.ios-native .vjs-big-play-button {
    display: none !important;
}

/* 播放时隐藏播放按钮 */
.video-js.vjs-playing .vjs-big-play-button {
    display: none !important;
}

.video-js .vjs-big-play-button:hover {
    background-color: rgba(0, 0, 0, 0.7) !important;
}

.video-js .vjs-big-play-button:focus {
    outline: 3px solid #4a90e2 !important;
    outline-offset: 2px !important;
}

/* 确保播放按钮图标居中 */
.video-js .vjs-big-play-button:before {
    font-size: 1em !important;
    line-height: 1.5em !important;
    text-align: center !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* 点击左右侧快进后退覆盖层 */
.vjs-tap-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    z-index: 50;
    pointer-events: none;
}

.vjs-tap-left,
.vjs-tap-center,
.vjs-tap-right {
    position: relative;
    pointer-events: auto;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    transition: background-color 0.2s ease;
}

.vjs-tap-left {
    justify-content: flex-start;
    padding-left: 20%;
}

.vjs-tap-center {
    justify-content: center;
}

.vjs-tap-right {
    justify-content: flex-end;
    padding-right: 20%;
}

.vjs-tap-left:hover,
.vjs-tap-center:hover,
.vjs-tap-right:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

/* 点击指示器样式 */
.vjs-tap-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 20px;
    border-radius: 12px;
    min-width: 80px;
    min-height: 80px;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.3s ease;
    pointer-events: none;
}

.vjs-tap-indicator.vjs-tap-active {
    opacity: 1;
    transform: scale(1);
}

.vjs-tap-icon {
    font-size: 24px;
    margin-bottom: 8px;
    display: block;
}

.vjs-tap-text {
    font-size: 14px;
    font-weight: bold;
    display: block;
}

/* 确保大播放按钮在点击区域之上 */
.video-js .vjs-big-play-button {
    z-index: 200 !important;
}

/* 跳转按钮样式 */
.video-js .vjs-skip-button {
    cursor: pointer;
    font-weight: bold;
    font-size: 14px;
    padding: 0 10px;
    transition: opacity 0.3s ease;
}

.video-js .vjs-skip-button:hover {
    opacity: 0.8;
}

.video-js .vjs-skip-forward::after {
    content: ">";
}

.video-js .vjs-skip-backward::after {
    content: "<";
}

/* 控制条样式优化 */
.video-js .vjs-control-bar {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    background-color: rgba(0, 0, 0, 0.7) !important;
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 100 !important;
}

.video-js.vjs-user-inactive .vjs-control-bar,
.video-js.vjs-user-active .vjs-control-bar {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* 响应式设计 */
@media only screen and (max-width: 1024px) {
    .video-player {
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
        position: relative;
        margin: 0;
    }

    .video-js .vjs-big-play-button {
        font-size: 5em !important;
        height: 1.5em !important;
        width: 1.5em !important;
    }

    /* 移动端点击区域调整 */
    .vjs-tap-left {
        padding-left: 15%;
    }

    .vjs-tap-center {
        padding: 0 5%;
    }

    .vjs-tap-right {
        padding-right: 15%;
    }

    .vjs-tap-indicator {
        min-width: 60px;
        min-height: 60px;
        padding: 15px;
    }

    .vjs-tap-icon {
        font-size: 20px;
        margin-bottom: 6px;
    }

    .vjs-tap-text {
        font-size: 12px;
    }
}

@media only screen and (max-width: 768px) {
    .video-js .vjs-big-play-button {
        font-size: 4em !important;
        height: 1.5em !important;
        width: 1.5em !important;
    }

    /* 小屏幕点击区域调整 */
    .vjs-tap-left {
        padding-left: 10%;
    }

    .vjs-tap-center {
        padding: 0 3%;
    }

    .vjs-tap-right {
        padding-right: 10%;
    }

    .vjs-tap-indicator {
        min-width: 50px;
        min-height: 50px;
        padding: 12px;
    }

    .vjs-tap-icon {
        font-size: 18px;
        margin-bottom: 4px;
    }

    .vjs-tap-text {
        font-size: 11px;
    }

    .video-js .vjs-control-bar .vjs-skip-button,
    .video-js .vjs-control-bar .vjs-skip-forward,
    .video-js .vjs-control-bar .vjs-skip-backward,
    .video-js .vjs-control-bar .vjs-picture-in-picture-control {
        display: none !important;
    }
}

/* 触摸设备优化 */
@media (pointer: coarse) {

    .vjs-tap-left,
    .vjs-tap-center,
    .vjs-tap-right {
        min-height: 44px;
    }

    .vjs-tap-indicator {
        transform: scale(1.1);
    }

    .vjs-tap-indicator.vjs-tap-active {
        transform: scale(1.2);
    }

    /* 在触摸设备上隐藏hover效果 */
    .vjs-tap-left:hover,
    .vjs-tap-center:hover,
    .vjs-tap-right:hover {
        background-color: transparent !important;
    }
}

/* 确保整个播放器和视频内容都是透明背景 */
.video-player,
.video-js,
.video-js video,
.video-js .vjs-tech {
    background: transparent !important;
}

/* 但保持控制条的背景 */
.video-js .vjs-control-bar {
    background-color: rgba(0, 0, 0, 0.7) !important;
}