/* === 音频 / 视频播放器 === */

.media-player-overlay {
    position: fixed;
    inset: 0;
    z-index: 55;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    animation: modalBackdropIn 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
.media-player-overlay.hidden {
    display: none !important;
}

/* 视频播放器（亮色主题，可拖拽） */
.video-player {
    position: relative;
    width: 90%;
    max-width: 960px;
    background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
    border: 1px solid #e8eaed;
    border-radius: 18px;
    overflow: hidden;
    box-shadow:
        0 32px 96px rgba(0, 0, 0, 0.12),
        0 12px 32px rgba(0, 0, 0, 0.06);
    animation: modalIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    will-change: transform, opacity;
    user-select: none;
    cursor: default;
}
.video-player.dragging {
    opacity: 0.92;
    cursor: grabbing;
    box-shadow: 0 40px 120px rgba(0, 0, 0, 0.18);
    transition: opacity 0.15s, box-shadow 0.15s;
}

.video-player video {
    width: 100%;
    max-height: 70vh;
    display: block;
    background: #000;
}

/* 音频播放器 */
/* 音频播放器（亮色主题，可拖拽） */
.audio-player {
    position: relative;
    width: 90%;
    max-width: 520px;
    background: linear-gradient(135deg, #fff 0%, #f8fafc 100%);
    border: 1px solid #e8eaed;
    border-radius: 20px;
    padding: 36px 40px;
    box-shadow:
        0 32px 96px rgba(0, 0, 0, 0.12),
        0 12px 32px rgba(0, 0, 0, 0.06);
    animation: modalIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    will-change: transform, opacity;
    user-select: none;
    cursor: default;
}
.audio-player.dragging {
    opacity: 0.92;
    cursor: grabbing;
    box-shadow: 0 40px 120px rgba(0, 0, 0, 0.15);
}

/* 播放器顶部 */
.media-player-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #eef1f5;
    cursor: grab;
    flex-shrink: 0;
}
.media-player-header:active {
    cursor: grabbing;
}
.audio-player .media-player-header {
    border-bottom: 1px solid #eef1f5;
    padding: 0 0 16px 0;
}

.media-player-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
    pointer-events: none;
}

.media-player-title svg {
    flex-shrink: 0;
    color: #4a9eff;
}

.media-player-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: #f4f6f9;
    border: none;
    border-radius: 8px;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}
.media-player-close:hover {
    background: #eef1f5;
    color: #475569;
    transform: rotate(90deg);
}

/* 音频可视化区域 */
.audio-visual {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 4px;
    height: 120px;
    margin: 28px 0 24px 0;
    padding: 0 20px;
}

.audio-bar {
    width: 4px;
    background: linear-gradient(180deg, #4a9eff, #3a7eef);
    border-radius: 2px;
    transition: height 0.15s ease;
    opacity: 0.6;
}
.audio-bar:nth-child(odd) {
    opacity: 0.8;
}
.audio-bar:nth-child(3n) {
    background: linear-gradient(180deg, #60a5fa, #4a9eff);
}
.audio-bar:nth-child(5n) {
    background: linear-gradient(180deg, #93c5fd, #60a5fa);
    opacity: 0.4;
}

/* 播放器控制条 */
.media-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px 20px 16px 20px;
}
.audio-player .media-controls {
    padding: 16px 0 0 0;
}

/* 进度条 */
.media-progress {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.media-progress time {
    font-size: 11px;
    font-weight: 500;
    color: #94a3b8;
    min-width: 36px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.media-progress-track {
    flex: 1;
    height: 4px;
    background: #e2e6ec;
    border-radius: 2px;
    position: relative;
    cursor: pointer;
    overflow: hidden;
}

.media-progress-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: linear-gradient(90deg, #4a9eff, #60a5fa);
    border-radius: 2px;
    transition: width 0.1s linear;
    pointer-events: none;
}

.media-progress-thumb {
    position: absolute;
    top: 50%;
    width: 12px;
    height: 12px;
    background: #fff;
    border: 2px solid #4a9eff;
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    box-shadow: 0 1px 4px rgba(74, 158, 255, 0.3);
}
.media-progress-track:hover .media-progress-thumb {
    transform: translate(-50%, -50%) scale(1);
}

/* 控制按钮区 */
.media-buttons {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.media-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: #7b8494;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
}
.media-btn:hover {
    color: #1e293b;
    transform: scale(1.15);
}

.media-btn.play-pause {
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, #4a9eff, #3a7eef);
    color: #fff;
    box-shadow: 0 4px 16px rgba(74, 158, 255, 0.35);
    border-radius: 50%;
}
.media-btn.play-pause:hover {
    background: linear-gradient(135deg, #3a8eef, #2a7eef);
    transform: scale(1.1);
    box-shadow: 0 6px 24px rgba(74, 158, 255, 0.45);
}
.media-btn.play-pause:active {
    transform: scale(0.97);
}

/* 音量控制 */
.media-volume {
    display: flex;
    align-items: center;
    gap: 8px;
    position: absolute;
    right: 20px;
    bottom: 20px;
}
.audio-player .media-volume {
    position: static;
    margin-left: auto;
}

.media-volume-track {
    width: 60px;
    height: 3px;
    background: #e2e6ec;
    border-radius: 2px;
    position: relative;
    cursor: pointer;
}

.media-volume-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: #4a9eff;
    border-radius: 2px;
    pointer-events: none;
}
