/* 遮罩层 */
.toast-mask {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.3);
    z-index: 9998;
    display: none;
}

/* Toast本体 */
.toast-container {
    position: fixed;
    z-index: 9999 !important;
    max-width: 90%;
    width: auto;
    padding: 20px;
    border-radius: 12px;
    background: #fff;
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.8);
    transition: all 0.3s ease;
    left: 50%;
    top: 50%;
	pointer-events: auto !important;
}

/* 显示动画 */
.toast-show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}
/* 隐藏动画 */
.toast-fadeout {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.8);
}

/* Toast位置控制 */
.toast-top { top: 20px; transform: translateX(-50%); }
.toast-bottom { bottom: 20px; top: auto; transform: translateX(-50%); }
.toast-left { left: 20px; top: 50%; transform: translateY(-50%); }
.toast-right { right: 20px; left: auto; top: 50%; transform: translateY(-50%); }

/* 主体flex布局 */
.toast-body {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 空状态不需要flex */
.toast-empty .toast-body {
    display: block;
}

/* 图标（伪元素） */
.toast-container:before {
    content: '';
    display: inline-block;
    width: 24px;
    height: 24px;
    margin-right: 8px;
    background-size: contain;
    background-repeat: no-repeat;
    flex-shrink: 0;
}

/* 各种类型图标 */
.toast-info:before { background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%232196F3"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"/></svg>'); }
.toast-success:before { background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%234CAF50"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"/></svg>'); }
.toast-warning:before { background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23FF9800"><path d="M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"/></svg>'); }
.toast-error:before { background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23F44336"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"/></svg>'); }
.toast-empty:before {
    display: none;
}

/* 内容区域 */
.toast-content {
    text-align: center;
    padding: 0 10px;
    word-break: break-word;
}

/* 关闭按钮 */
.toast-close {
    position: absolute;
    top: 51%;
    right: 5px;
    width: 20px;
    height: 20px;
    cursor: pointer;
    transform: translateY(-50%);
    opacity: 1;
    color: inherit;
    background: transparent;
    border: none;
}
.toast-close:hover {
    opacity: 1;
}
.toast-close:before, .toast-close:after {
    content: '';
    position: absolute;
    width: 16px;
    height: 2px;
    background: currentColor;
    top: 50%; left: 50%;
    transform-origin: center;
}
.toast-close:before { transform: translate(-50%, -50%) rotate(45deg); }
.toast-close:after { transform: translate(-50%, -50%) rotate(-45deg); }

/* 按钮组 */
.toast-buttons {
    margin-top: 15px;
    display: flex;
    justify-content: center;
    gap: 10px;
}
.toast-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}
.toast-btn:hover {
    opacity: 0.9;
}

/* 移动端适配 */
@media (max-width: 480px) {
    .toast-container {
        width: 80%;
        padding: 14px;
    }
    .toast-content {
        font-size: 3.8vw;
    }
}
