/**
 * Toast 通知组件样式
 * 支持 success / error / warning / info 四种类型
 * 右上角弹出，3秒自动消失，支持多个堆叠
 */

/* Toast 容器 */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 16px;
    pointer-events: none;
}

/* 单个 Toast */
#toast-container > div {
    pointer-events: auto;
    min-width: 320px;
    max-width: 420px;
    padding: 16px 20px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-left-width: 4px;
    transform: translateX(120%) scale(0.9);
    opacity: 0;
    transition: all 0.35s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-sizing: border-box;
}

#toast-container > div.show {
    transform: translateX(0) scale(1);
    opacity: 1;
}

#toast-container > div.removing {
    transform: translateX(120%) scale(0.9);
    opacity: 0;
}

/* 四种类型颜色 */
#toast-container > .toast-success {
    background: rgba(240, 249, 255, 0.95);
    border-left-color: #00B42A;
    color: #00B42A;
}

#toast-container > .toast-error {
    background: rgba(254, 242, 242, 0.95);
    border-left-color: #F53F3F;
    color: #F53F3F;
}

#toast-container > .toast-warning {
    background: rgba(255, 251, 235, 0.95);
    border-left-color: #FF7D00;
    color: #FF7D00;
}

#toast-container > .toast-info {
    background: rgba(240, 249, 255, 0.95);
    border-left-color: #165DFF;
    color: #165DFF;
}

/* Toast 图标 */
.toast-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-icon svg {
    width: 24px;
    height: 24px;
}

/* Toast 内容 */
.toast-content {
    flex: 1;
    word-break: break-word;
}

/* 动画 */
@keyframes toastDraw {
    to { stroke-dashoffset: 0; }
}

@keyframes toastShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-4px) rotate(-2deg); }
    40% { transform: translateX(4px) rotate(2deg); }
    60% { transform: translateX(-4px) rotate(2deg); }
    80% { transform: translateX(4px) rotate(-2deg); }
}

@keyframes toastPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

@keyframes toastSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.toast-success .toast-icon-path {
    stroke-dasharray: 30;
    stroke-dashoffset: 30;
    animation: toastDraw 0.5s ease-out 0.2s forwards;
}

.toast-error .toast-icon svg {
    animation: toastShake 0.5s ease-in-out 0.2s;
}

.toast-warning .toast-icon svg {
    animation: toastPulse 0.8s ease-in-out 0.2s;
}

.toast-info .toast-icon svg {
    animation: toastPulse 0.8s ease-in-out 0.2s;
}

/* 响应式 */
@media (max-width: 480px) {
    #toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
        align-items: stretch;
    }

    #toast-container > div {
        min-width: auto;
        max-width: 100%;
    }
}
