/* media-viewer.css — 图片 / 视频通用预览灯箱（用户端 + 后台共用） */

.mv-root {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100000;
    align-items: center;
    justify-content: center;
}

.mv-mask {
    position: absolute;
    inset: 0;
    background: rgba(2, 6, 16, 0.92);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.mv-panel {
    position: relative;
    z-index: 1;
    width: min(1080px, 92vw);
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    background: #0b1220;
    border: 1px solid rgba(255, 211, 112, 0.18);
    border-radius: 12px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.65);
    overflow: hidden;
    animation: mvIn .18s ease;
}

@keyframes mvIn {
    from { opacity: 0; transform: scale(.97); }
    to   { opacity: 1; transform: scale(1); }
}

.mv-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px 10px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    background: rgba(255, 255, 255, 0.02);
    flex-shrink: 0;
}

.mv-name {
    flex: 1;
    min-width: 0;
    color: #e2e8f0;
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mv-count {
    color: #8899aa;
    font-size: 12px;
    flex-shrink: 0;
}

.mv-icon-btn {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.06);
    border: none;
    border-radius: 6px;
    color: #cbd5e1;
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
    transition: background .2s, color .2s;
}
.mv-icon-btn:hover { background: rgba(255, 211, 112, 0.16); color: #ffd370; }

.mv-stage {
    position: relative;
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #05080f;
    padding: 0;
    overflow: hidden;
}

.mv-media {
    display: block;
    max-width: 100%;
    max-height: calc(92vh - 52px);
    width: auto;
    height: auto;
    background: #000;
    object-fit: contain;
}

.mv-frame {
    width: min(1080px, 92vw);
    height: calc(92vh - 52px);
    border: 0;
    background: #fff;
}

.mv-codec-hint {
    position: absolute;
    left: 50%;
    bottom: 74px;
    transform: translateX(-50%);
    padding: 8px 16px;
    background: rgba(245, 158, 11, 0.92);
    color: #1a1a2e;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    z-index: 4;
    pointer-events: none;
}

.mv-missing {
    padding: 48px 24px;
    text-align: center;
    color: #8899aa;
    font-size: 14px;
    line-height: 1.9;
    word-break: break-all;
}
.mv-missing span { font-size: 12px; color: #64748b; }
.mv-missing a { color: #ffd370; }

.mv-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 50%;
    color: #fff;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    transition: background .2s, border-color .2s;
}
.mv-nav:hover { background: rgba(255, 211, 112, 0.25); border-color: rgba(255, 211, 112, 0.5); }
.mv-prev { left: 14px; }
.mv-next { right: 14px; }

/* ---------- 缩略图通用样式：视频不再使用原生控件，避免遮住点击 ---------- */
.mv-thumb {
    position: relative;
    display: block;
    overflow: hidden;
    background: #0d1526;
    cursor: zoom-in;
}
.mv-thumb video,
.mv-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;   /* 关键：点击交给外层容器 */
}
.mv-thumb .mv-play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    background: rgba(0, 0, 0, 0.28);
    transition: background .2s;
}
.mv-thumb .mv-play::before {
    content: '';
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 9px 0 9px 15px;
    border-color: transparent transparent transparent #fff;
    filter: drop-shadow(0 1px 4px rgba(0, 0, 0, .6));
}
.mv-thumb:hover .mv-play { background: rgba(0, 0, 0, 0.12); }
.mv-thumb:hover .mv-play::before { border-left-color: #ffd370; }

/* 透明点击层：<video>/<iframe> 内部不冒泡，靠它把点击交回外层容器 */
.mv-thumb .mv-hit {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: block;
    background: transparent;
    cursor: pointer;
}

/* 缩略图右上角的删除按钮要盖在点击层之上 */
.mv-thumb-del,
.work-del,
.admin-prod-del {
    z-index: 5;
}

@media (max-width: 640px) {
    .mv-panel { width: 96vw; max-height: 88vh; }
    .mv-media { max-height: calc(88vh - 52px); }
    .mv-nav { width: 34px; height: 34px; font-size: 20px; }
    .mv-prev { left: 8px; }
    .mv-next { right: 8px; }
}
