/* modou toast — derived from modouu.cn overall style (no native toast on the target). */
.toast-host {
    --toast-bg: #ffffff;
    --toast-border: #eceef4;
    --toast-text: #1b1d2a;
    --toast-muted: #6b7280;
    --toast-shadow: 0 12px 26px rgba(27, 29, 42, 0.09), 0 2px 8px rgba(27, 29, 42, 0.04);
    position: fixed;
    top: 80px;
    left: 50%;
    z-index: 1200;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: max-content;
    max-width: calc(100vw - 32px);
    transform: translateX(-50%);
    pointer-events: none;
}

.toast-item {
    position: relative;
    min-width: 168px;
    max-width: min(400px, calc(100vw - 32px));
    padding: 12px 18px 12px 14px;
    background: var(--toast-bg);
    box-shadow: var(--toast-shadow);
    border: 1px solid var(--toast-border);
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    box-sizing: border-box;
    color: var(--toast-text);
    font-size: 14px;
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    font-weight: 600;
    letter-spacing: 0.01em;
    line-height: 1.45;
    word-break: break-word;
    opacity: 0;
    transform: translateY(-8px);
    transition:
        opacity 0.28s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: none;
    overflow: hidden;
}

.toast-item::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    border-radius: 14px 0 0 14px;
    background: var(--toast-accent, #e11d48);
}

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

.toast-item.is-leaving {
    opacity: 0;
    transform: translateY(-6px);
}

.toast-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--toast-icon-bg, #f4f5f8);
    color: var(--toast-icon-fg, var(--toast-accent, #e11d48));
}

.toast-icon svg {
    width: 14px;
    height: 14px;
    display: block;
}

.toast-text {
    flex: 1;
    min-width: 0;
    padding-right: 2px;
}

.toast-item--info {
    --toast-accent: #9ca3af;
    --toast-icon-bg: #f4f5f8;
    --toast-icon-fg: #4b5563;
}

.toast-item--success {
    --toast-accent: #e11d48;
    --toast-icon-bg: #e11d48;
    --toast-icon-fg: #ffffff;
}

.toast-item--error {
    --toast-accent: #be123c;
    --toast-icon-bg: #be123c;
    --toast-icon-fg: #ffffff;
}

.toast-item--warning {
    --toast-accent: #ea580c;
    --toast-icon-bg: #fff7ed;
    --toast-icon-fg: #c2410c;
}

@media (max-width: 767px) {
    .toast-host {
        top: calc(64px + env(safe-area-inset-top, 0px));
        gap: 8px;
        max-width: calc(100vw - 24px);
    }

    .toast-item {
        min-width: 0;
        width: max-content;
        max-width: calc(100vw - 24px);
        padding: 11px 14px 11px 12px;
        border-radius: 14px;
        font-size: 13px;
        gap: 10px;
    }

    .toast-icon {
        width: 24px;
        height: 24px;
    }

    .toast-icon svg {
        width: 12px;
        height: 12px;
    }
}
