/**
 * 移动端视频播放器样式 - 专为《寻找林则徐》项目定制
 * 版本: v1.0
 * 更新时间: 2025年1月
 * 功能: 响应式设计、触摸优化、现代化UI
 */



/* 视频控制层样式 */
.video-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: auto;
    z-index: 30;
    transform: translateZ(1px);
}

/* 控制层隐藏状态 */
.video-controls.hidden {
    opacity: 0;
    pointer-events: none;
}

/* 控制层显示状态 */
.video_box.controls-visible .video-controls,
.p1_video.controls-visible .video-controls,
.p2_video.controls-visible .video-controls,
.p2_video_2_0_a.controls-visible .video-controls,
.p2_video_2_0_b.controls-visible .video-controls,
.p2_video_2_1.controls-visible .video-controls,
.p2_video_2_2.controls-visible .video-controls,
.p2_video_2_3.controls-visible .video-controls,
.p2_video_2_4.controls-visible .video-controls,
.p3_video.controls-visible .video-controls,
.p4_video.controls-visible .video-controls,
.p5_video.controls-visible .video-controls,
.p6_video.controls-visible .video-controls,
.p7_video.controls-visible .video-controls,
.p8_video.controls-visible .video-controls {
    opacity: 1;
    pointer-events: auto;
}

/* 播放/暂停按钮样式 */
.control-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
    flex-shrink: 0;
}

.control-btn:hover,
.control-btn:active {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.control-btn svg {
    width: 24px;
    height: 24px;
    fill: white;
}

/* 进度条容器样式 */
.progress-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

/* 进度条样式 */
.progress-bar {
    position: relative;
    height: 6px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    cursor: pointer;
    overflow: visible;
    /* 增加触摸区域 */
    min-height: 12px;
    padding: 3px 0;
}

.progress-filled {
    height: 100%;
    background: #ffe156;
    border-radius: 3px;
    width: 0%;
    transition: width 0.1s ease;
}

.progress-thumb {
    position: absolute;
    top: 50%;
    left: 0%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    /* 移除拖拽相关样式 */
    /* cursor: grab; */
    /* transition: transform 0.2s ease; */
    pointer-events: none; /* 拖拽头不接收事件，避免干扰点击 */
}

.progress-thumb:active {
    cursor: grabbing;
    transform: translate(-50%, -50%) scale(1.2);
}

.drag-hint {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: contain;
}

/* 时间显示样式 */
.time-display {
    display: flex;
    align-items: center;
    gap: 5px;
    color: white;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
}

/* 移动端触摸优化 */
@media (max-width: 768px) {
    .video-controls {
        padding: 15px;
        gap: 12px;
    }
    
    .control-btn {
        width: 44px;
        height: 44px;
    }
    
    .control-btn svg {
        width: 20px;
        height: 20px;
    }
    
    .progress-bar {
        height: 8px;
    }
    
    .progress-thumb {
        width: 24px;
        height: 24px;
    }
    
    .time-display {
        font-size: 12px;
    }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    /* .video-controls {
        opacity: 1;
    } */
    
    .progress-thumb {
        width: 28px;
        height: 28px;
    }
    
    .control-btn {
        min-height: 48px;
        min-width: 48px;
    }
}

/* 加载状态 */
.video_box.loading .progress-bar,
.p2_video.loading .progress-bar,
.p2_video_2_1.loading .progress-bar,
.p2_video_2_2.loading .progress-bar,
.p2_video_2_3.loading .progress-bar,
.p2_video_2_4.loading .progress-bar {
    background: rgba(255, 255, 255, 0.1);
}

.video_box.loading .progress-filled,
.p2_video.loading .progress-filled,
.p2_video_2_1.loading .progress-filled,
.p2_video_2_2.loading .progress-filled,
.p2_video_2_3.loading .progress-filled,
.p2_video_2_4.loading .progress-filled {
    background: linear-gradient(90deg, #ff6b6b, #4ecdc4);
    animation: loading 2s ease-in-out infinite;
}

@keyframes loading {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* 触摸状态样式 */
.video_box.touching,
.p2_video.touching,
.p2_video_2_1.touching,
.p2_video_2_2.touching,
.p2_video_2_3.touching,
.p2_video_2_4.touching {
    /* 触摸时的特殊效果 */
}



/* 播放/暂停按钮样式优化 */
.control-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
    flex-shrink: 0;
    /* 确保按钮可以点击 */
    z-index: 31 !important;
    pointer-events: auto !important;
    position: relative !important;
}

/* 进度条容器样式优化 */
.progress-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
    /* 确保进度条可以点击 */
    pointer-events: auto !important;
    position: relative !important;
}

/* 进度条样式优化 */
.progress-bar {
    position: relative;
    height: 6px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    cursor: pointer; /* 保持点击样式 */
    overflow: visible;
    /* 增加触摸区域 */
    min-height: 12px;
    padding: 3px 0;
    /* 确保进度条可以点击 */
    pointer-events: auto !important;
    z-index: 31 !important;
}

/* 响应式设计 */
@media (max-width: 480px) {
    .video-controls {
        padding: 10px;
        gap: 8px;
    }
    
    .control-btn {
        width: 40px;
        height: 40px;
    }
    
    .control-btn svg {
        width: 18px;
        height: 18px;
    }
    
    .time-display {
        font-size: 11px;
    }
}

/* 横屏模式优化 */
@media (orientation: landscape) {
    .video-controls {
        padding: 15px 20px;
    }
    
    .control-btn {
        width: 44px;
        height: 44px;
    }
    
    .control-btn svg {
        width: 20px;
        height: 20px;
    }
    
    .progress-bar {
        height: 8px;
        /* 横屏时增加触摸区域 */
        min-height: 12px;
        padding: 2px 0;
    }
    
    .progress-thumb {
        width: 28px;
        height: 28px;
    }
    
    .time-display {
        font-size: 12px;
    }
}

/* 横屏且高度较小的情况 */
@media (orientation: landscape) and (max-height: 500px) {
    .video-controls {
        padding: 10px 15px;
    }
    
    .control-btn {
        width: 40px;
        height: 40px;
    }
    
    .control-btn svg {
        width: 18px;
        height: 18px;
    }
    
    .progress-bar {
        height: 6px;
        min-height: 10px;
    }
    
    .progress-thumb {
        width: 24px;
        height: 24px;
    }
    
    .time-display {
        font-size: 11px;
    }
}

/* 针对rotate(90deg)状态的进度条优化 */
/* 当容器被旋转时，确保进度条触摸区域足够大 */
.video_box[style*="transform"],
.p2_video[style*="transform"],
.p2_video_2_1[style*="transform"],
.p2_video_2_2[style*="transform"],
.p2_video_2_3[style*="transform"],
.p2_video_2_4[style*="transform"] {
    /* 确保旋转后的容器仍然保持正确的尺寸 */
    transform-origin: center center;
}

/* 90度旋转状态下的特殊处理 */
.video_box[style*="rotate(90deg)"],
.p2_video[style*="rotate(90deg)"],
.p2_video_2_1[style*="rotate(90deg)"],
.p2_video_2_2[style*="rotate(90deg)"],
.p2_video_2_3[style*="rotate(90deg)"],
.p2_video_2_4[style*="rotate(90deg)"],
.video_box[style*="rotate(90deg)"],
.p2_video[style*="rotate(90deg)"],
.p2_video_2_1[style*="rotate(90deg)"],
.p2_video_2_2[style*="rotate(90deg)"],
.p2_video_2_3[style*="rotate(90deg)"],
.p2_video_2_4[style*="rotate(90deg)"] {
    /* 90度旋转后的特殊样式 */
    transform-origin: center center;
}

/* 90度旋转状态下的进度条样式 */
.video_box[style*="rotate(90deg)"] .progress-bar,
.p2_video[style*="rotate(90deg)"] .progress-bar,
.p2_video_2_1[style*="rotate(90deg)"] .progress-bar,
.p2_video_2_2[style*="rotate(90deg)"] .progress-bar,
.p2_video_2_3[style*="rotate(90deg)"] .progress-bar,
.p2_video_2_4[style*="rotate(90deg)"] .progress-bar,
.video_box[style*="rotate(90deg)"] .progress-bar,
.p2_video[style*="rotate(90deg)"] .progress-bar,
.p2_video_2_1[style*="rotate(90deg)"] .progress-bar,
.p2_video_2_2[style*="rotate(90deg)"] .progress-bar,
.p2_video_2_3[style*="rotate(90deg)"] .progress-bar,
.p2_video_2_4[style*="rotate(90deg)"] .progress-bar {
    /* 90度旋转后，进度条可能需要调整触摸区域 */
    min-height: 16px;
    padding: 4px 0;
    /* 确保触摸事件正确触发 */
    touch-action: pan-x pan-y;
    /* 增加触摸区域 */
    position: relative;
}

/* 90度旋转状态下的拖拽头样式 */
.video_box[style*="rotate(90deg)"] .progress-thumb,
.p2_video[style*="rotate(90deg)"] .progress-thumb,
.p2_video_2_1[style*="rotate(90deg)"] .progress-thumb,
.p2_video_2_2[style*="rotate(90deg)"] .progress-thumb,
.p2_video_2_3[style*="rotate(90deg)"] .progress-thumb,
.p2_video_2_4[style*="rotate(90deg)"] .progress-thumb,
.video_box[style*="rotate(90deg)"] .progress-thumb,
.p2_video[style*="rotate(90deg)"] .progress-thumb,
.p2_video_2_1[style*="rotate(90deg)"] .progress-thumb,
.p2_video_2_2[style*="rotate(90deg)"] .progress-thumb,
.p2_video_2_3[style*="rotate(90deg)"] .progress-thumb,
.p2_video_2_4[style*="rotate(90deg)"] .progress-thumb {
    /* 90度旋转后，拖拽头需要更大 */
    width: 32px;
    height: 32px;
    /* 增加触摸反馈 */
    transition: transform 0.1s ease;
    /* 确保拖拽头在旋转后仍然可见 */
    z-index: 30;
}

/* 90度旋转状态下的触摸反馈 */
.video_box[style*="rotate(90deg)"] .progress-thumb:active,
.p2_video[style*="rotate(90deg)"] .progress-thumb:active,
.p2_video_2_1[style*="rotate(90deg)"] .progress-thumb:active,
.p2_video_2_2[style*="rotate(90deg)"] .progress-thumb:active,
.p2_video_2_3[style*="rotate(90deg)"] .progress-thumb:active,
.p2_video_2_4[style*="rotate(90deg)"] .progress-thumb:active,
.video_box[style*="rotate(90deg)"] .progress-thumb:active,
.p2_video[style*="rotate(90deg)"] .progress-thumb:active,
.p2_video_2_1[style*="rotate(90deg)"] .progress-thumb:active,
.p2_video_2_2[style*="rotate(90deg)"] .progress-thumb:active,
.p2_video_2_3[style*="rotate(90deg)"] .progress-thumb:active,
.p2_video_2_4[style*="rotate(90deg)"] .progress-thumb:active {
    /* 触摸时的视觉反馈 */
    transform: translate(-50%, -50%) scale(1.4);
    /* 增加触摸反馈的可见性 */
    box-shadow: 0 0 20px rgba(255, 225, 86, 0.8);
}