/**
 * SaToast — 全局轻提示
 * 挂载点由 JS 自动创建（#sa-toast-host）
 */

#sa-toast-host {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    pointer-events: none;
    max-width: min(92vw, 400px);
}

.sa-toast {
    pointer-events: none;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-width: 240px;
    max-width: min(92vw, 400px);
    padding: 14px 18px;
    border-radius: 10px;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-left: 4px solid #1890ff;
    box-shadow: 0 8px 28px rgba(15, 23, 42, 0.12);
    color: #1f2937;
    font-size: 0.9rem;
    line-height: 1.45;
    animation: sa-toast-in 0.28s ease-out;
}

.sa-toast.is-hiding {
    animation: sa-toast-out 0.28s ease-in forwards;
}

.sa-toast--success {
    border-left-color: #52c41a;
}

.sa-toast--error {
    border-left-color: #f5222d;
}

.sa-toast--info {
    border-left-color: #1890ff;
}

.sa-toast--warning {
    border-left-color: #fa8c16;
}

.sa-toast__icon {
    flex-shrink: 0;
    margin-top: 1px;
    font-size: 1.15rem;
}

.sa-toast--success .sa-toast__icon {
    color: #52c41a;
}

.sa-toast--error .sa-toast__icon {
    color: #f5222d;
}

.sa-toast--info .sa-toast__icon {
    color: #1890ff;
}

.sa-toast--warning .sa-toast__icon {
    color: #fa8c16;
}

.sa-toast__body {
    flex: 1;
    min-width: 0;
}

.sa-toast__title {
    font-weight: 600;
    font-size: 0.9rem;
    color: #111827;
}

.sa-toast__title + .sa-toast__message {
    margin-top: 4px;
}

.sa-toast__message {
    font-size: 0.85rem;
    color: #4b5563;
    word-break: break-word;
}

.sa-toast--plain .sa-toast__message {
    font-size: 0.9rem;
    color: #1f2937;
}

@keyframes sa-toast-in {
    from {
        transform: translateX(18px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes sa-toast-out {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(18px);
        opacity: 0;
    }
}

@media (max-width: 768px) {
    #sa-toast-host {
        top: 12px;
        right: 12px;
        left: 12px;
        align-items: stretch;
        max-width: none;
    }

    .sa-toast {
        min-width: 0;
        max-width: none;
    }
}
