/**
 * 媒体播放器样式文件
 * 包含音频播放器（Howler.js）和视频播放器（Plyr）的自定义样式
 * 专注于移动端适配和现代化设计
 */

/* ==================== 基础样式 ==================== */
.media-player-container {
    position: relative;
    width: 100%;
    margin: 16px 0;
    overflow: hidden;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.1);
    background: #ffffff;
    border: 1px solid #e1e7ef;
}

.media-player-container.audio-player {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.media-player-container.video-player {
    background: #000;
}

/* ==================== 音频播放器样式 ==================== */
.audio-player-wrapper {
    position: relative;
    padding: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
}

.audio-player-info {
    display: flex;
    align-items: flex-start; /* 改为顶部对齐 */
    gap: 12px;
    margin-bottom: 16px;
    position: relative;
    padding-right: 80px; /* PC端为音量控制留空间 */
}

.audio-player-cover {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.audio-player-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.audio-player-cover .default-icon {
    font-size: 24px;
    color: rgba(255, 255, 255, 0.7);
}

.audio-player-details {
    flex: 1;
    min-width: 0;
    padding-top: 2px; /* 微调对齐 */
}

.audio-player-title {
    font-size: 16px;
    font-weight: 600;
    color: white;
    margin: 0 0 6px 0; /* 增加间距 */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.audio-player-artist {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
    line-height: 1.2;
}

/* 音量控制移到右上角 */
.audio-volume-control-top {
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* PC端音量控制样式 */
.audio-player-wrapper .audio-volume-control-top .audio-volume-btn {
    background: transparent !important; /* 默认透明背景 */
    border: none !important;
    color: white !important;
    cursor: pointer !important;
    font-size: 14px !important;
    padding: 8px !important;
    border-radius: 50% !important;
    width: 32px !important;
    height: 32px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.3s ease !important;
}

.audio-player-wrapper .audio-volume-control-top .audio-volume-btn:hover {
    background: rgba(255, 255, 255, 0.2) !important; /* 悬浮时显示背景 */
}

.audio-player-wrapper .audio-volume-control-top .audio-volume-slider {
    width: 50px !important; /* 短音量条 */
    height: 4px !important;
    background: rgba(255, 255, 255, 0.2) !important;
    border-radius: 2px !important;
    outline: none !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    cursor: pointer !important;
}

.audio-player-wrapper .audio-volume-control-top .audio-volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none !important;
    appearance: none !important;
    width: 12px !important;
    height: 12px !important;
    border-radius: 50% !important;
    background: white !important;
    cursor: pointer !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3) !important;
}

.audio-player-wrapper .audio-volume-control-top .audio-volume-slider::-moz-range-thumb {
    width: 12px !important;
    height: 12px !important;
    border-radius: 50% !important;
    background: white !important;
    cursor: pointer !important;
    border: none !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3) !important;
}

/* PC端隐藏原来的音量控制 */
.audio-player-controls .audio-volume-container {
    display: none;
}

.audio-player-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.audio-control-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.audio-control-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.audio-control-btn.play-btn {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.9);
    color: #667eea;
}

.audio-control-btn.play-btn:hover {
    background: white;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

.audio-control-btn i {
    font-size: 16px;
}

.audio-control-btn.play-btn i {
    font-size: 18px;
}

.audio-progress-container {
    flex: 1;
    margin: 0 12px;
}

.audio-progress-bar {
    position: relative;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    cursor: pointer;
    margin-bottom: 6px;
}

.audio-progress-fill {
    height: 100%;
    background: white;
    border-radius: 2px;
    width: 0%;
    transition: width 0.1s ease;
}

.audio-progress-handle {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s ease;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.3);
}

.audio-progress-bar:hover .audio-progress-handle {
    opacity: 1;
}

.audio-time-display {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.8);
}

.audio-volume-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.audio-volume-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 16px;
    padding: 8px;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.audio-volume-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* 这个通用样式被更具体的样式覆盖 */
.audio-volume-slider {
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
    appearance: none;
    /* width 在具体的媒体查询中定义 */
}

.audio-volume-slider::-webkit-slider-thumb {
    appearance: none;
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.audio-volume-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* ==================== 视频播放器样式 - 现代化设计 ==================== */
.video-player-wrapper {
    position: relative;
    width: 100%;
    background: transparent;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    
    /* 让视频保持原始比例，不强制拉伸 */
    aspect-ratio: auto;
}

/* 修复播放器圆角显示问题，保持原始比例 */
.media-player-container.video-player {
    overflow: hidden;
    background: transparent;
    width: 100%;
    height: auto; /* 高度自适应 */
}

/* 确保播放器容器不会强制比例 */
.plyr--video {
    width: 100% !important;
    height: auto !important;
}

/* 移除可能导致拉伸的Plyr默认样式 */
.plyr--video .plyr__video-wrapper {
    padding-bottom: 0 !important; /* 移除固定的padding-bottom比例 */
}

/* Plyr播放器自定义样式 - 参考 plyr.io 设计 */
.plyr {
    border-radius: 16px;
    overflow: hidden;
    --plyr-color-main: #00b2ff;
    --plyr-video-background: #000;
    --plyr-menu-background: rgba(28, 28, 30, 0.95);
    --plyr-menu-color: #ffffff;
    --plyr-tooltip-background: rgba(28, 28, 30, 0.9);
    --plyr-tooltip-color: #ffffff;
    --plyr-control-icon-size: 18px;
    --plyr-control-spacing: 10px;
    --plyr-control-padding: 12px;
    --plyr-range-track-height: 5px;
    --plyr-range-fill-background: #00b2ff;
    --plyr-range-track-background: rgba(255, 255, 255, 0.25);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

/* 隐藏Plyr的SVG图标，使用FontAwesome代替 */
.plyr__control svg {
    display: none !important;
}

/* 使用FontAwesome图标替换Plyr图标 */
.plyr__control {
    font-family: "Font Awesome 6 Free", sans-serif !important;
    font-weight: 900 !important;
}

/* 播放/暂停按钮 */
.plyr__control[data-plyr="play"]::before {
    content: "\f04b" !important; /* fa-play */
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 900 !important;
    font-size: 16px !important;
}

.plyr--playing .plyr__control[data-plyr="play"]::before {
    content: "\f04c" !important; /* fa-pause */
}

/* 大播放按钮 */
.plyr__control--overlaid::before {
    content: "\f04b" !important; /* fa-play */
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 900 !important;
    font-size: 32px !important;
    color: white !important;
}

.plyr--playing .plyr__control--overlaid::before {
    content: "\f04c" !important; /* fa-pause */
}

/* 静音按钮 */
.plyr__control[data-plyr="mute"]::before {
    content: "\f028" !important; /* fa-volume-up */
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 900 !important;
    font-size: 16px !important;
}

.plyr--muted .plyr__control[data-plyr="mute"]::before {
    content: "\f6a9" !important; /* fa-volume-mute */
}

/* 全屏按钮 */
.plyr__control[data-plyr="fullscreen"]::before {
    content: "\f065" !important; /* fa-expand */
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 900 !important;
    font-size: 16px !important;
}

.plyr--fullscreen-active .plyr__control[data-plyr="fullscreen"]::before {
    content: "\f066" !important; /* fa-compress */
}



/* PIP按钮 */
.plyr__control[data-plyr="pip"]::before {
    content: "\f2d0" !important; /* fa-external-link-alt */
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 900 !important;
    font-size: 16px !important;
}

.plyr--video {
    background: transparent;
}

.plyr__video-wrapper {
    background: transparent;
    border-radius: 16px;
    overflow: hidden;
}

/* 确保视频元素有圆角，修复黑边问题，保持原始比例 */
.plyr video,
.plyr__video-wrapper video,
.plyr iframe,
.plyr__video-wrapper iframe,
.plyr__video-embed,
.plyr__video-embed iframe {
    overflow: hidden !important;
    width: 100% !important;
    height: auto !important; /* 保持原始比例 */
    object-fit: contain !important; /* 防止拉伸，保持比例 */
}

/* 修复Plyr播放器的圆角问题，保持原始比例 */
.plyr {
    border-radius: 16px !important;
    overflow: hidden !important;
    width: 100% !important;
    height: auto !important; /* 让高度自适应视频内容 */
}

.plyr__poster {
    border-radius: 16px !important;
    overflow: hidden !important;
}

/* 移除任何可能的标题栏或黑色背景 */
.media-player-container .video-title,
.media-player-container .player-title,
.video-player-wrapper .title,
.video-player-wrapper .header {
    display: none !important;
}

/* 隐藏播放器标题 */
.video-player-title {
    display: none;
}

/* ==================== 视频播放器按钮背景正方形样式 ==================== */
.plyr--video .plyr__control {
    background: transparent !important; /* 默认透明背景 */
    width: 40px !important; /* 正方形宽度 */
    height: 40px !important; /* 正方形高度 */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: background 0.3s ease !important;
}

.plyr--video .plyr__control:hover {
    background: rgba(0, 178, 255, 0.8) !important; /* 悬停时显示蓝色背景 */
}

/* 中央大播放按钮始终显示蓝色背景 */
.plyr--video .plyr__control--overlaid {
    background: rgba(0, 178, 255, 0.8) !important;
    width: 60px !important;
    height: 60px !important;
}

.plyr--video .plyr__control--overlaid:hover {
    background: rgba(0, 178, 255, 1) !important;
}

/* 确保图标颜色正确 */
.plyr--video .plyr__control::before {
    color: white !important;
}

/* 确保控制栏不会裁切设置菜单 - 精确修复 */
.plyr--video .plyr__controls {
    overflow: visible !important;
}



/* ==================== 编辑模式播放器样式 ==================== */
/* 编辑器内的播放器和预览悬停效果 */
#content-rich .media-player-container:hover,
.content-editor .media-player-container:hover,
#content-rich .media-preview:hover,
.content-editor .media-preview:hover {
    cursor: pointer;
    transform: scale(1.02);
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(52, 152, 219, 0.3);
    border: 2px solid #3498db;
}

/* 编辑器内的播放器和预览点击提示 */
#content-rich .media-player-container::after,
.content-editor .media-player-container::after,
#content-rich .media-preview::after,
.content-editor .media-preview::after {
    content: "✏️ 点击编辑";
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(52, 152, 219, 0.9);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 1000;
}

#content-rich .media-player-container:hover::after,
.content-editor .media-player-container:hover::after,
#content-rich .media-preview:hover::after,
.content-editor .media-preview:hover::after {
    opacity: 1;
}

/* 确保播放器容器和预览有相对定位 */
#content-rich .media-player-container,
.content-editor .media-player-container,
#content-rich .media-preview,
.content-editor .media-preview {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

/* ==================== 媒体插入按钮样式 ==================== */
.media-insert-buttons {
    display: flex;
    gap: 8px;
    margin-left: 8px;
}

.media-insert-btn {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 8px 12px;
    color: #495057;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.media-insert-btn:hover {
    background: #e9ecef;
    border-color: #ced4da;
    color: #212529;
}

.media-insert-btn.active {
    background: #3498db;
    border-color: #3498db;
    color: white;
}

.media-insert-btn i {
    font-size: 16px;
}

/* ==================== 媒体插入弹窗样式 ==================== */
.media-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.media-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.media-modal-content {
    background: white;
    border-radius: 12px;
    padding: 24px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.media-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e9ecef;
}

.media-modal-title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #2c3e50;
}

.media-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #6c757d;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.media-modal-close:hover {
    background: #f8f9fa;
    color: #495057;
}

.media-form-group {
    margin-bottom: 20px;
}

.media-form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #2c3e50;
}

.media-form-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.media-form-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.media-form-textarea {
    min-height: 80px;
    resize: vertical;
    font-family: inherit;
}

.media-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #e9ecef;
}

.media-form-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.media-form-btn.secondary {
    background: #f8f9fa;
    color: #6c757d;
    border: 1px solid #dee2e6;
}

.media-form-btn.secondary:hover {
    background: #e9ecef;
    color: #495057;
}

.media-form-btn.primary {
    background: #3498db;
    color: white;
}

.media-form-btn.primary:hover {
    background: #2980b9;
    transform: translateY(-1px);
}

/* ==================== 成功提示样式 ==================== */
.media-success-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(40, 167, 69, 0.3);
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 500;
    backdrop-filter: blur(20px);
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.media-success-toast.show {
    transform: translateX(0);
}

.media-success-toast i {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.9);
}

.media-success-toast .close-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    margin-left: 8px;
    padding: 4px;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.media-success-toast .close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* ==================== 响应式设计 ==================== */
@media (max-width: 768px) {
    .media-player-container {
        margin: 12px 0;
    }
    
    .audio-player-wrapper {
        padding: 12px;
    }
    
    .audio-player-info {
        gap: 10px;
        margin-bottom: 12px;
        padding-right: 50px; /* 为右上角音量控制留空间 */
    }
    
    .audio-player-cover {
        width: 50px;
        height: 50px;
        border-radius: 6px;
    }
    
    .audio-player-cover .default-icon {
        font-size: 20px;
    }
    
    .audio-player-details {
        padding-top: 1px;
    }
    
    .audio-player-title {
        font-size: 14px;
        margin-bottom: 4px;
    }
    
    .audio-player-artist {
        font-size: 12px;
    }
    
    /* 移动端音量控制放到右上角 */
    .audio-volume-control-top {
        top: 2px;
        right: 0;
        gap: 4px;
    }
    
    .audio-player-wrapper .audio-volume-control-top .audio-volume-btn {
        background: transparent !important; /* 默认透明背景 */
        border: none !important;
        color: white !important;
        cursor: pointer !important;
        font-size: 12px !important;
        padding: 6px !important;
        border-radius: 50% !important;
        width: 28px !important;
        height: 28px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        transition: all 0.3s ease !important;
    }
    
    .audio-player-wrapper .audio-volume-control-top .audio-volume-btn:hover {
        background: rgba(255, 255, 255, 0.15) !important; /* 悬浮时显示背景 */
    }
    
    .audio-player-wrapper .audio-volume-control-top .audio-volume-slider {
        width: 25px !important; /* 移动端更短音量条 */
        height: 3px !important;
        background: rgba(255, 255, 255, 0.2) !important;
        border-radius: 2px !important;
        outline: none !important;
        -webkit-appearance: none !important;
        appearance: none !important;
    }
    
    .audio-player-wrapper .audio-volume-control-top .audio-volume-slider::-webkit-slider-thumb {
        -webkit-appearance: none !important;
        appearance: none !important;
        width: 10px !important;
        height: 10px !important;
        border-radius: 50% !important;
        background: white !important;
        cursor: pointer !important;
    }
    
    /* 主控制区域移除音量控制 */
    .audio-player-controls {
        gap: 8px;
        margin-bottom: 8px;
    }
    
    .audio-player-controls .audio-volume-container {
        display: none; /* 隐藏原来的音量控制 */
    }
    
    .audio-control-btn {
        width: 36px;
        height: 36px;
    }
    
    .audio-control-btn.play-btn {
        width: 44px;
        height: 44px;
    }
    
    .audio-control-btn i {
        font-size: 14px;
    }
    
    .audio-control-btn.play-btn i {
        font-size: 16px;
    }
    
    .audio-progress-container {
        flex: 1;
        margin: 0;
    }
    
    .audio-progress-bar {
        height: 3px;
        margin-bottom: 4px;
    }
    
    .audio-progress-handle {
        width: 10px;
        height: 10px;
    }
    
    .audio-time-display {
        font-size: 10px;
    }
    
    .media-insert-buttons {
        flex-wrap: wrap;
        gap: 6px;
    }
    
    .media-insert-btn {
        padding: 6px 10px;
        font-size: 13px;
    }
    
    .media-modal-content {
        width: 95%;
        padding: 20px;
        margin: 20px;
    }
    
    .media-form-actions {
        flex-direction: column;
        gap: 8px;
    }
    
    .media-form-btn {
        width: 100%;
    }
    
    /* 移除Plyr相关的移动端样式以避免冲突 */
    .video-player-title {
        font-size: 16px;
        top: 15px;
        left: 15px;
        right: 15px;
    }
    
    .media-success-toast {
        right: 10px;
        top: 10px;
        padding: 12px 16px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .audio-player-wrapper {
        padding: 10px;
    }
    
    .audio-player-info {
        gap: 8px;
        margin-bottom: 10px;
        padding-right: 45px; /* 为右上角音量控制留空间 */
    }
    
    .audio-player-cover {
        width: 45px;
        height: 45px;
        border-radius: 5px;
    }
    
    .audio-player-cover .default-icon {
        font-size: 18px;
    }
    
    .audio-player-details {
        padding-top: 0;
    }
    
    .audio-player-title {
        font-size: 13px;
        margin-bottom: 3px;
    }
    
    .audio-player-artist {
        font-size: 11px;
    }
    
    /* 超小屏音量控制 */
    .audio-volume-control-top {
        top: 1px;
        right: 0;
        gap: 3px;
    }
    
    .audio-player-wrapper .audio-volume-control-top .audio-volume-btn {
        width: 26px !important;
        height: 26px !important;
        font-size: 11px !important;
        padding: 5px !important;
        background: transparent !important; /* 默认透明背景 */
    }
    
    .audio-player-wrapper .audio-volume-control-top .audio-volume-btn:hover {
        background: rgba(255, 255, 255, 0.15) !important; /* 悬浮时显示背景 */
    }
    
    .audio-player-wrapper .audio-volume-control-top .audio-volume-slider {
        width: 40px !important; /* 超小屏极短音量条 */
        height: 2px !important;
    }
    
    .audio-player-wrapper .audio-volume-control-top .audio-volume-slider::-webkit-slider-thumb {
        width: 8px !important;
        height: 8px !important;
    }
    
    .audio-player-controls {
        gap: 6px;
        margin-bottom: 6px;
    }
    
    .audio-control-btn {
        width: 32px;
        height: 32px;
    }
    
    .audio-control-btn.play-btn {
        width: 40px;
        height: 40px;
    }
    
    .audio-control-btn i {
        font-size: 12px;
    }
    
    .audio-control-btn.play-btn i {
        font-size: 14px;
    }
    
    .audio-progress-container {
        flex: 1;
        margin: 0;
    }
    
    .audio-progress-bar {
        height: 2px;
        margin-bottom: 3px;
    }
    
    .audio-progress-handle {
        width: 8px;
        height: 8px;
    }
    
    .audio-time-display {
        font-size: 9px;
    }
    
    .media-modal-content {
        padding: 16px;
    }
    
    .media-modal-title {
        font-size: 18px;
    }
    
    /* 更小屏幕的优化（移除冲突的Plyr样式） */
    .video-player-title {
        font-size: 14px;
        top: 12px;
        left: 12px;
        right: 12px;
    }
    
    .media-success-toast {
        right: 8px;
        top: 8px;
        padding: 10px 14px;
        font-size: 12px;
    }
}

/* ==================== 加载动画 ==================== */
.media-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #6c757d;
}

.media-loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 12px;
}

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

/* ==================== 错误状态 ==================== */
.media-error {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background: #fff5f5;
    border: 1px solid #fed7d7;
    border-radius: 8px;
    color: #c53030;
    margin: 20px 0;
}

.media-error i {
    font-size: 24px;
    margin-right: 12px;
}

/* ==================== 暗黑模式支持 ==================== */
@media (prefers-color-scheme: dark) {
    .media-player-container {
        background: #2d3748;
        border-color: #4a5568;
    }
    
    .media-modal-content {
        background: #2d3748;
        color: #e2e8f0;
    }
    
    .media-modal-title {
        color: #e2e8f0;
    }
    
    .media-form-input {
        background: #4a5568;
        border-color: #718096;
        color: #e2e8f0;
    }
    
    .media-form-input:focus {
        border-color: #63b3ed;
    }
    
    .media-form-btn.secondary {
        background: #4a5568;
        color: #e2e8f0;
        border-color: #718096;
    }
    
    .media-form-btn.secondary:hover {
        background: #718096;
    }
}

/* ==================== 视频控制栏自动隐藏样式（简化版） ==================== */

/* 基础隐藏样式 - 仅使用opacity避免transform问题 */
.plyr--controls-hidden .plyr__controls {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    pointer-events: none;
}

.plyr--controls-visible .plyr__controls {
    opacity: 1;
    transition: opacity 0.3s ease-in-out;
    pointer-events: auto;
}

/* 播放时鼠标指针自动隐藏 */
.plyr--playing.plyr--controls-hidden {
    cursor: none;
}

/* 中央播放按钮控制 - 彻底修复隐藏问题 */

/* 播放时完全隐藏中央播放按钮 - 使用所有可能的选择器 */
.plyr--playing .plyr__control--overlaid,
.plyr--playing [data-plyr="play-large"],
.plyr--playing .plyr__control[data-plyr="play"],
.plyr--playing .plyr__controls .plyr__control--overlaid,
.plyr--video.plyr--playing .plyr__control--overlaid {
    opacity: 0 !important;
    visibility: hidden !important;
    display: none !important;
    pointer-events: none !important;
    transform: scale(0) !important;
    transition: all 0.3s ease-in-out;
}

/* 控制栏隐藏时也隐藏中央播放按钮 */
.plyr--controls-hidden .plyr__control--overlaid,
.plyr--controls-hidden [data-plyr="play-large"],
.plyr--controls-hidden .plyr__control[data-plyr="play"] {
    opacity: 0 !important;
    visibility: hidden !important;
    display: none !important;
    pointer-events: none !important;
}

/* 暂停时恢复中央播放按钮显示 */
.plyr--paused .plyr__control--overlaid,
.plyr--paused [data-plyr="play-large"] {
    opacity: 1 !important;
    visibility: visible !important;
    display: flex !important;
    pointer-events: auto !important;
    transform: scale(1) !important;
    transition: all 0.3s ease-in-out;
}

/* 额外保险措施 - 通过伪类强制隐藏 */
.plyr--video.plyr--playing .plyr__control--overlaid::before,
.plyr--video.plyr--playing .plyr__control--overlaid::after {
    display: none !important;
}

/* 确保视频开始播放后立即隐藏 */
.plyr--video[data-plyr-state="playing"] .plyr__control--overlaid {
    opacity: 0 !important;
    visibility: hidden !important;
    display: none !important;
}

/* 确保画中画和全屏按钮始终可用 */
.plyr__control[data-plyr="fullscreen"],
.plyr__control[data-plyr="pip"] {
    pointer-events: auto !important;
    z-index: 100 !important;
    position: relative !important;
}

/* 确保画中画和全屏按钮在隐藏状态下仍然可用 */
.plyr--controls-hidden .plyr__control[data-plyr="fullscreen"],
.plyr--controls-hidden .plyr__control[data-plyr="pip"] {
    pointer-events: auto !important;
    opacity: 1 !important;
}

/* 画中画按钮图标确保可见 */
.plyr__control[data-plyr="pip"]::before {
    content: "\f2d0" !important; /* fa-external-link-alt */
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 900 !important;
    font-size: 16px !important;
    color: white !important;
}

/* 移动端视频播放器优化 */
@media (max-width: 768px) {
    /* 隐藏音量控制（手机可以直接调整音量） */
    .plyr__volume {
        display: none !important;
    }
    
    /* 隐藏画中画按钮（移动端不需要） */
    .plyr__control[data-plyr="pip"] {
        display: none !important;
    }
    
    /* 隐藏音量按钮和滑块 */
    .plyr__control[data-plyr="mute"],
    .plyr__control[data-plyr="volume"] {
        display: none !important;
    }
    
    /* 隐藏移动端自定义音量控制 */
    .mobile-volume-control {
        display: none !important;
    }
}

/* 小屏幕设备进一步优化 */
@media (max-width: 480px) {
    /* 确保画中画按钮完全隐藏 - 使用所有可能的选择器 */
    .plyr__control[data-plyr="pip"],
    button[data-plyr="pip"],
    .plyr__controls button[data-plyr="pip"],
    .plyr [data-plyr="pip"] {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
        width: 0 !important;
        height: 0 !important;
        overflow: hidden !important;
    }
    
    /* 确保所有音量相关控件隐藏 */
    .plyr__volume,
    .plyr__control[data-plyr="mute"],
    .plyr__control[data-plyr="volume"],
    button[data-plyr="mute"],
    button[data-plyr="volume"],
    .mobile-volume-control {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }
}

/* 全局强制隐藏移动端不需要的按钮 */
@media (max-width: 768px) {
    /* 强制隐藏画中画按钮的所有变体 */
    [data-plyr="pip"],
    button[data-plyr="pip"],
    .plyr__control[data-plyr="pip"] {
        display: none !important;
    }
    
    /* 强制隐藏音量控制的所有变体 */
    [data-plyr="mute"],
    [data-plyr="volume"],
    .plyr__volume {
        display: none !important;
    }
}
