/**
 * 文件：assets/css/toast.css
 * 作用：全局横条 Toast（左右留白、横向撑满）
 */

.toast-host {
    position: fixed;
    top: calc(12px + env(safe-area-inset-top, 0px));
    left: max(0.75rem, env(safe-area-inset-left, 0px));
    right: max(0.75rem, env(safe-area-inset-right, 0px));
    z-index: 10050;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    pointer-events: none;
}

.admin-body .toast-host {
    top: calc(var(--topbar-height, 3.5rem) + 8px + env(safe-area-inset-top, 0px));
}

.toast {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    min-height: 2.75rem;
    padding: 0.625rem 1rem;
    border-radius: var(--btn-radius, 0.5rem);
    font-size: 0.875rem;
    line-height: 1.45;
    color: #fff;
    background: rgba(15, 23, 42, 0.92);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.16);
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.28s ease, transform 0.28s ease;
    text-align: left;
    word-break: break-word;
    pointer-events: auto;
}

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

.toast--success {
    background: rgba(21, 128, 61, 0.94);
}

.toast--error {
    background: rgba(185, 28, 28, 0.94);
}

.toast--info {
    background: rgba(15, 23, 42, 0.92);
}

@media (max-width: 767px) {
    .toast-host {
        top: calc(10px + env(safe-area-inset-top, 0px));
        left: max(0.625rem, env(safe-area-inset-left, 0px));
        right: max(0.625rem, env(safe-area-inset-right, 0px));
    }

    .admin-body .toast-host {
        top: calc(var(--topbar-height, 3.5rem) + 6px + env(safe-area-inset-top, 0px));
    }

    .toast {
        font-size: 0.8125rem;
        padding: 0.5625rem 0.875rem;
        min-height: 2.5rem;
    }
}
