/**
 * Copyright：ChengDu YunSu Technology Company Ltd.
 * Author：Criss
 * File：public/assets/app/css/erp-toast.css
 * Date：2026-07-26
 */
/* 右下角消息冒泡栈（V2 + 旧版 ui-tips 共用） */
.erp-toast-stack {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-end;
    gap: 0.625rem;
    max-width: min(22rem, calc(100vw - 2rem));
    pointer-events: none;
}

.erp-toast-stack > * {
    pointer-events: auto;
    flex-shrink: 0;
}

.erp-toast-pop-in {
    animation: erp-toast-pop-in 0.32s cubic-bezier(0.21, 1.02, 0.37, 1);
}

.erp-toast-pop-out {
    animation: erp-toast-pop-out 0.22s ease forwards;
}

@keyframes erp-toast-pop-in {
    from {
        opacity: 0;
        transform: translateY(1rem) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes erp-toast-pop-out {
    to {
        opacity: 0;
        transform: translateY(0.5rem) scale(0.96);
    }
}

/* V2 现代 toast */
.erp-toast {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    width: 100%;
    padding: 0.75rem 0.875rem;
    border-radius: 0.625rem;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 8px 28px rgba(15, 23, 42, 0.12);
    font-size: 0.875rem;
    line-height: 1.45;
    color: #334155;
    opacity: 0;
    transform: translateY(1rem) scale(0.96);
    transition: opacity 0.28s ease, transform 0.28s cubic-bezier(0.21, 1.02, 0.37, 1);
}

.erp-toast.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.erp-toast-icon {
    flex-shrink: 0;
    width: 1.375rem;
    height: 1.375rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 0.8125rem;
}

.erp-toast-icon .ti {
    font-family: "tabler-icons" !important;
    line-height: 1;
}

.erp-toast-body {
    flex: 1;
    min-width: 0;
    word-break: break-word;
}

.erp-toast-close {
    flex-shrink: 0;
    border: 0;
    background: transparent;
    color: #94a3b8;
    font-size: 1.125rem;
    line-height: 1;
    padding: 0;
    cursor: pointer;
    margin: -0.125rem -0.125rem 0 0;
}

.erp-toast-close:hover {
    color: #64748b;
}

.erp-toast--success .erp-toast-icon {
    background: rgba(47, 179, 68, 0.12);
    color: #2fb344;
}

.erp-toast--error .erp-toast-icon {
    background: rgba(214, 57, 57, 0.12);
    color: #d63939;
}

.erp-toast--warning .erp-toast-icon {
    background: rgba(247, 103, 7, 0.12);
    color: #f76707;
}

/* 旧版 ui-tips 在栈内 */
.erp-toast-stack .ui-tips {
    position: relative !important;
    left: auto !important;
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    margin: 0 !important;
    width: 100%;
    max-width: 100%;
    box-shadow: 0 8px 28px rgba(15, 23, 42, 0.12);
}

[data-bs-theme="dark"] .erp-toast {
    background: #1e293b;
    border-color: rgba(255, 255, 255, 0.08);
    color: #e2e8f0;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}

[data-bs-theme="dark"] .erp-toast-close {
    color: #64748b;
}

[data-bs-theme="dark"] .erp-toast-close:hover {
    color: #94a3b8;
}

@media (max-width: 575.98px) {
    .erp-toast-stack {
        right: 0.75rem;
        bottom: 0.75rem;
        left: 0.75rem;
        max-width: none;
        align-items: stretch;
    }
}
