/* 后台剧集预览弹窗。只作用于带 .aw-preview-root 的 Modal，不影响客户端播放页。 */

.modal:has(.aw-preview-root) .modal-dialog {
    width: min(440px, calc(100vw - 28px)) !important;
    max-width: min(440px, calc(100vw - 28px)) !important;
    margin: 14px auto !important;
}
.modal:has(.aw-preview-stage.is-landscape) .modal-dialog {
    width: min(900px, calc(100vw - 28px)) !important;
    max-width: min(900px, calc(100vw - 28px)) !important;
}
.modal:has(.aw-preview-root) .modal-content {
    height: fit-content !important;
    min-height: 0 !important;
    max-height: calc(100vh - 28px) !important;
    border: 1px solid rgba(255, 255, 255, .10) !important;
    border-radius: 14px !important;
    overflow: hidden;
    box-shadow: 0 28px 72px rgba(0, 0, 0, .58) !important;
}
.modal:has(.aw-preview-root) .modal-header {
    min-height: 52px;
    padding: 10px 14px 10px 18px !important;
}
.modal:has(.aw-preview-root) .modal-header .close {
    display: grid !important;
    place-items: center;
    width: 36px;
    height: 36px;
    margin: -2px -2px -2px auto !important;
    padding: 0 !important;
    border: 1px solid rgba(255, 255, 255, .16) !important;
    border-radius: 10px;
    background: rgba(255, 255, 255, .07) !important;
    color: #f8fafc !important;
    font-size: 24px !important;
    line-height: 1 !important;
    opacity: 1 !important;
    text-shadow: none !important;
    transition: background .16s ease, border-color .16s ease, transform .16s ease;
}
.modal:has(.aw-preview-root) .modal-header .close:hover {
    border-color: rgba(248, 113, 113, .55) !important;
    background: rgba(239, 68, 68, .18) !important;
    color: #fecaca !important;
    transform: scale(1.04);
}
.modal:has(.aw-preview-root) .modal-body {
    flex: 0 0 auto !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: calc(100vh - 82px) !important;
    overflow: auto;
    padding: 12px 14px 14px !important;
}
.modal:has(.aw-preview-root) .modal-body :is(
    form, .fields-group, .form-group,
    .col-md-8, .col-md-9, .col-md-10,
    .col-sm-8, .col-sm-9, .col-sm-10
) {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 100% !important;
    height: auto !important;
    min-height: 0 !important;
    margin-left: 0 !important;
}
.modal:has(.aw-preview-root) .modal-body :is(.form-group, .fields-group) {
    margin-bottom: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

.aw-preview-stage {
    position: relative;
    width: min(100%, 38.25vh, 360px);
    height: auto;
    aspect-ratio: 9 / 16;
    margin: 0 auto;
    background: #000;
    border-radius: 9px;
    overflow: hidden;
}
.aw-preview-stage.is-landscape {
    width: 100%;
    max-width: 860px;
    aspect-ratio: 16 / 9;
}
.aw-preview-stage video,
.aw-preview-stage iframe {
    width: 100%;
    height: 100%;
    border: 0;
    object-fit: contain;
    background: #000;
}
.aw-preview-stage video::-webkit-media-controls-loading-panel,
.aw-preview-stage video::-internal-media-controls-loading-panel {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
}
.aw-preview-cues {
    position: absolute;
    left: 8%;
    right: 8%;
    bottom: 58px;
    z-index: 4;
    text-align: center;
    pointer-events: none;
    color: #fff;
    font-size: 16px;
    line-height: 1.4;
    text-shadow: 0 1px 2px #000;
}
.aw-preview-cues span {
    display: inline-block;
    background: rgba(0, 0, 0, .62);
    padding: 3px 10px;
    border-radius: 4px;
    white-space: pre-line;
}
.aw-preview-langs {
    padding: 0 8px 8px;
}
.aw-preview-langs button {
    margin: 0 6px 6px 0;
    padding: 2px 8px;
    border: 1px solid #334155;
    background: #0f172a;
    color: #e2e8f0;
    border-radius: 999px;
    font-size: 12px;
}
.aw-preview-langs button.is-on {
    border-color: #f59e0b;
    color: #fbbf24;
}
.aw-preview-status {
    position: absolute;
    inset: 0;
    z-index: 6;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: #0b0d14;
    color: #e2e8f0;
    text-align: center;
}
.aw-preview-status[hidden] {
    display: none !important;
}
body:not(.login-page):not(.aw-workspace-picker) .aw-preview-status .aw-cinema-loader__card {
    min-width: 0;
    width: min(88%, 196px);
    grid-template-columns: 36px auto;
    grid-template-rows: auto 5px;
    column-gap: 10px;
    row-gap: 8px;
    padding: 10px 12px 8px;
    border-radius: 10px;
    transform: none !important;
    pointer-events: none;
}
.aw-preview-status .aw-cinema-loader__mark {
    width: 36px;
    height: 36px;
    box-shadow:
        0 0 0 3px rgba(245,158,11,.055),
        0 4px 12px rgba(0,0,0,.32);
}
.aw-preview-status .aw-cinema-loader__reel {
    inset: 4px;
    border-width: 1.5px;
}
.aw-preview-status .aw-cinema-loader__reel i {
    width: 5px;
    height: 5px;
}
.aw-preview-status .aw-cinema-loader__play {
    border-top-width: 4px;
    border-bottom-width: 4px;
    border-left-width: 6px;
}
.aw-preview-status .aw-cinema-loader__copy {
    gap: 2px;
}
.aw-preview-status .aw-cinema-loader__copy strong {
    font-size: 12px;
    letter-spacing: .03em;
}
.aw-preview-status .aw-cinema-loader__copy span {
    font-size: 10px;
}
.aw-preview-status .aw-cinema-loader__film {
    height: 5px;
    gap: 3px;
    padding: 0;
}
.aw-preview-status.is-err {
    color: #fecaca;
}
.aw-preview-status.is-err .aw-cinema-loader__reel {
    animation: none;
    border-color: rgba(248,113,113,.55);
}
.aw-preview-hint {
    margin: 6px 8px 0;
    color: #9aa6b8;
    font-size: 12px;
}

@media (max-width: 640px) {
    .modal:has(.aw-preview-root) .modal-dialog {
        width: calc(100vw - 14px) !important;
        max-width: calc(100vw - 14px) !important;
        margin: 7px auto !important;
    }
    .modal:has(.aw-preview-root) .modal-body {
        padding: 8px !important;
    }
    .aw-preview-stage {
        width: min(100%, 33.75vh, 320px);
    }
    .aw-preview-stage.is-landscape {
        width: 100%;
    }
}
