/* ========================================
   SweetAlert2 Toast 美化样式
   移植自 ripro-v2/app.css，暗黑模式按 ripro-v5 规范
   ======================================== */

.swal2-container.swal2-backdrop-show,
.swal2-container.swal2-noanimation {
    background: rgb(0 0 0 / 80%);
    pointer-events: auto;
    transition-duration: .2s;
}

.swal2-popup {
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    overflow: hidden;
}

.swal2-popup.swal2-toast {
    box-shadow: 0 0 0.4em rgba(0, 0, 0, 0.3);
    padding: 10px 30px;
}

.swal2-title {
    font-size: 1.025em;
}

.swal2-close {
    top: 5px;
    right: 5px;
    font-size: 1.5em;
    line-height: 1.2;
    cursor: pointer;
    color: #000;
    background-color: rgba(239, 239, 239, 0.5);
    border-radius: 50%;
    box-shadow: 0 5px 20px -5px rgba(0, 0, 0, 0.5);
    font-family: sans-serif;
}

.swal2-actions {
    margin: 0.5em auto 0.5em;
}

.swal2-timer-progress-bar-container {
    z-index: 999;
    height: .2em;
}

.swal2-popup.swal2-toast.swal2-show {
    animation: swal2-toast-show .3s;
}

.swal2-timer-progress-bar {
    background: #eee;
    border-radius: 10px;
}

/* ========================================
   暗黑模式（对齐 ripro-v5 [data-bs-theme=dark] 规范）
   ======================================== */

[data-bs-theme=dark] .swal2-popup.swal2-toast {
    background: #29292e;
    box-shadow: 0 0 0.4em rgba(0, 0, 0, 0.5);
}

[data-bs-theme=dark] .swal2-title {
    color: #fff;
}

[data-bs-theme=dark] .swal2-close {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 5px 20px -5px rgba(0, 0, 0, 0.8);
}

[data-bs-theme=dark] .swal2-timer-progress-bar {
    background: var(--ri-primary, #007cba);
}

/* ========================================
   动画关键帧
   ======================================== */

@keyframes swal2-show {
    0% {
        opacity: 0;
        transform: translate3d(0, 50px, 0);
    }
    100% {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

@keyframes swal2-hide {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(.5);
        opacity: 0;
    }
}

@keyframes swal2-toast-show {
    0% {
        transform: translateY(-5em);
    }
    100% {
        transform: translateY(0);
    }
}

@keyframes swal2-toast-hide {
    0% {
        transform: translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateY(-5em);
    }
}
