@keyframes show {
    0% {
        transform: translateX(-50%) translateY(-100%);
        opacity: 0;
    }

    100% {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

.dialog {
    text-align: left;
    overflow-y: auto;
    color: rgb(255 255 255 / 87%);
    background-color: #242424;

    @media (prefers-color-scheme: light) {
        color: #213547;
        background-color: #fff;
    }

    &Wrapper {
        z-index: 10;
        position: fixed;
        left: 50%;
        top: 0;
        width: calc(100% - 32px);
        max-width: 500px;
        bottom: 0;
        animation: ease-in-out show 0.3s both;
        transition: 0.3s;
        padding: 16px;
        display: flex;
        flex-flow: column nowrap !important;

        @media screen and (min-width: 1024px) {
            margin: 36px 0;
            border-radius: 16px;
            box-shadow: 0 19px 38px rgb(0 0 0 / 30%),
                0 15px 12px rgb(0 0 0 / 22%);
        }
    }

    .error {
        color: crimson;
    }

    h4 {
        margin: 8px 0;
    }
}

.add {
    &Btn {
        border-radius: 8px;
        width: 50px;
        height: 50px;
        border: 1px solid gray;
        overflow: hidden;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;

        &Empty::before {
            content: '+';
            color: #999;
            font-size: 2em;
        }

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

    &Dialog {
        position: absolute;
        left: 50%;
        top: 50%;
        width: 90%;
        padding: 12px;
        transform: translateX(-50%) translateY(-60vh);
        opacity: 0;
        transition: 0.3s;
        border-radius: 8px;
        border: 2px solid #535bf2;
        color: rgb(255 255 255 / 87%);
        background-color: #242424;

        // 写冗余了，待优化
        @media (prefers-color-scheme: light) {
            color: #213547;
            background-color: #fff;
        }

        &Show {
            transform: translateX(-50%) translateY(-50%);
            opacity: 1;
        }
    }
}

.delete {
    &Btn {
        flex-grow: 1;
        border-radius: 4px;
        display: flex;
        align-items: center;
        justify-content: center;
        background-color: #f9f9f9;
        font-size: 1.5em;
        color: #999;
        cursor: pointer;

        span {
            transform: rotate(45deg);
        }
    }
}
