
/* =========================================================
   Modal Base
   通用弹窗
========================================================= */

.modal {
    position: fixed;
    inset: 0;
    z-index: 100;

    display: grid;
    place-items: center;
}

.modal.hidden {
    display: none;
}

/* 遮罩层 */

.modal-backdrop {
    position: absolute;
    inset: 0;

    background: rgba(20, 27, 40, .48);

    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* =========================================================
   Modal Panels
   视频与设置弹窗的通用面板
========================================================= */

.video-modal,
.settings-modal {
    position: relative;

    box-sizing: border-box;

    background: #fff;

    border-radius: 15px;

    box-shadow: 0 30px 90px rgba(0, 0, 0, .24);

    padding: 20px;
}

/* 视频弹窗 */

.video-modal {
    width: min(920px, 90vw);
}

/* 设置弹窗 */

.settings-modal {
    width: min(620px, 90vw);
}

/* =========================================================
   Modal Close Button
   通用关闭按钮
========================================================= */

.modal-close {
    position: absolute;

    top: 12px;
    right: 15px;

    display: inline-flex;

    align-items: center;
    justify-content: center;

    width: 31px;
    height: 31px;

    padding: 0;

    border: 0;
    border-radius: 50%;

    background: #f2f4f7;

    color: #667084;

    font-size: 22px;
    line-height: 1;

    cursor: pointer;

    transition:
        background .2s ease,
        color .2s ease;
}

.modal-close:hover {
    background: #e8ebf1;
    color: #172033;
}

.modal-close:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* =========================================================
   Video Modal
========================================================= */

.video-head {
    display: flex;

    align-items: center;
    justify-content: space-between;

    padding-right: 42px;
    margin-bottom: 14px;
}

.video-head h2,
.settings-modal h2 {
    margin: 4px 0 16px;

    font-size: 19px;
}

.download-btn {
    display: inline-block;

    padding: 9px 13px;

    border-radius: 8px;

    background: var(--primary);
    color: #fff;

    font-size: 12px;
    font-weight: 700;

    text-decoration: none;
}

.video-modal video {
    display: block;

    width: 100%;
    max-height: 70vh;

    border-radius: 9px;

    background: #111;
}

/* =========================================================
   Settings Modal
========================================================= */

.settings-grid {
    display: grid;

    grid-template-columns: 1fr 1fr;

    gap: 10px;
}

.settings-grid label {
    color: #788396;
    font-size: 10px;
}

.settings-grid .input {
    margin-top: 5px;
}

/* =========================================================
   PNG Export Preview
========================================================= */

.png-preview {
    display: flex;

    align-items: center;
    justify-content: center;

    width: 100%;
    max-height: 70vh;

    box-sizing: border-box;
    padding: 16px;

    overflow: hidden;
}

.png-preview img {
    display: block;

    width: auto;
    height: auto;

    max-width: 100%;
    max-height: 65vh;

    object-fit: contain;

    border: 1px solid #d1d5db;
    border-radius: 6px;

    box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
}

/* =========================================================
   PPTX Export Result
========================================================= */

.pptx-result {
    display: flex;
    flex-direction: column;

    align-items: center;
    justify-content: center;

    min-height: 180px;

    text-align: center;
}

.pptx-icon {
    margin-bottom: 16px;

    font-size: 28px;
    font-weight: 700;
}

/* =========================================================
   Mobile
========================================================= */

@media (max-width: 520px) {

    .video-modal,
    .settings-modal {
        width: calc(100vw - 24px);
        max-height: calc(100vh - 24px);

        overflow-y: auto;

        padding: 16px;

        border-radius: 13px;
    }

    .settings-grid {
        grid-template-columns: 1fr;
    }
}
