/**
 * 通用视频播放组件 - 独立样式（仅本组件，类名前缀 vp-）
 * 字体：Microsoft YaHei
 */
.vp-overlay {
    position: fixed;
    inset: 0;
    z-index: 220000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.82);
    font-family: "Microsoft YaHei", "微软雅黑", "SimSun", "宋体", Arial, sans-serif;
    font-size: 14px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 160ms ease-out, visibility 0s linear 160ms;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}
.vp-overlay.vp-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: opacity 160ms ease-out;
}
.vp-container {
    position: relative;
    width: min(1280px, 92vw);
    max-height: 92vh;
    background: #1a1a1a;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    transform: scale(0.92);
    opacity: 0;
}
.vp-container * {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}
.vp-overlay.vp-open .vp-container {
    animation: vp-pop-in 160ms ease-out both;
}
@keyframes vp-pop-in {
    from {
        transform: scale(0.92);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}
@media (prefers-reduced-motion: reduce) {
    .vp-overlay {
        transition: none;
    }
    .vp-container {
        transform: none;
        opacity: 1;
    }
    .vp-overlay.vp-open .vp-container {
        animation: none;
    }
}
.vp-close {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    font-family: inherit;
}
.vp-close:hover {
    background: rgba(255, 255, 255, 0.25);
}
.vp-video-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
}

/* 全屏时占满容器 */
.vp-container:fullscreen {
    width: 100%;
    max-height: none;
    border-radius: 0;
}
.vp-container:fullscreen .vp-video-wrap {
    aspect-ratio: auto;
    height: calc(100vh - 52px);
}
.vp-container:fullscreen .vp-controls {
    min-height: 52px;
}
.vp-video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.vp-loading,
.vp-error {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 14px;
    background: rgba(0, 0, 0, 0.6);
}
.vp-video-wrap.vp-loading .vp-loading {
    display: flex;
}
.vp-video-wrap.vp-error .vp-error {
    display: flex;
}
.vp-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: #252525;
    color: #e0e0e0;
}
.vp-controls-left {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 14px;
}
.vp-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
}
.vp-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}
/* 循环开关：图标按钮，视觉与其它按钮一致（无绿色状态） */
.vp-btn-loop {
    min-width: 36px;
    padding: 6px 12px; /* 与 .vp-btn 一致，保证同高度 */
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.vp-btn-loop::before {
    /* 关闭：单箭头环形 */
    content: "↻";
    font-size: 16px;
    line-height: 1;
    color: currentColor;
}
.vp-btn-loop.vp-loop-on::before {
    /* 开启：双箭头环形 */
    content: "⟲";
}
.vp-controls-progress {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
.vp-time {
    flex-shrink: 0;
    font-size: 12px;
    color: #aaa;
    min-width: 36px;
    text-align: right;
}
.vp-time-current {
    text-align: left;
}
.vp-progress-wrap {
    flex: 1;
    position: relative;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.2);
    cursor: pointer;
    min-width: 60px;
}
.vp-progress-bar {
    position: absolute;
    inset: 0;
    border-radius: 3px;
}
.vp-progress-fill {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0%;
    border-radius: 3px;
    background: #4a9eff;
    pointer-events: none;
}
.vp-controls-volume {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.vp-volume {
    width: 72px;
    height: 6px;
    accent-color: #4a9eff;
    cursor: pointer;
}
.vp-controls-speed {
    position: relative;
    flex-shrink: 0;
}
.vp-btn-speed {
    min-width: 44px;
}
.vp-speed-menu {
    position: absolute;
    bottom: 100%;
    right: 0;
    margin-bottom: 4px;
    padding: 6px 0;
    background: #333;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    z-index: 10;
    max-height: 200px;
    overflow-y: auto;
}
.vp-speed-menu[hidden] {
    display: none !important;
}
.vp-speed-option {
    display: block;
    width: 100%;
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: #e0e0e0;
    font-size: 13px;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
}
.vp-speed-option:hover {
    background: rgba(255, 255, 255, 0.1);
}
.vp-speed-option.vp-active {
    color: #4a9eff;
    font-weight: bold;
}
