/* Toast 通知组件样式 */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    background: white;
    border-radius: 8px;
    padding: 12px 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 250px;
    max-width: 400px;
    animation: slideIn 0.3s ease;
    pointer-events: auto;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.toast.hiding {
    animation: slideOut 0.3s ease;
    opacity: 0;
    transform: translateX(100%);
}

.toast-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.toast-message {
    flex: 1;
    color: #333;
    font-size: 14px;
    line-height: 1.5;
}

.toast-close {
    flex-shrink: 0;
    cursor: pointer;
    color: #999;
    font-size: 18px;
    line-height: 1;
    padding: 0;
    background: none;
    border: none;
    transition: color 0.2s;
}

.toast-close:hover {
    color: #666;
}

/* Toast 进度条 */
.toast-progress {
    position: absolute;
    bottom: 0;
    right: 0;  /* 改为从右边定位 */
    height: 3px;
    background: currentColor;
    opacity: 0.3;
    transition: width linear;
    border-radius: 0 0 8px 0;  /* 调整圆角方向 */
}

/* Toast 类型样式 */
.toast.toast-success {
    border-left: 4px solid #52c41a;
}

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

.toast.toast-error {
    border-left: 4px solid #ff4d4f;
}

.toast.toast-error .toast-icon {
    color: #ff4d4f;
}

.toast.toast-warning {
    border-left: 4px solid #faad14;
}

.toast.toast-warning .toast-icon {
    color: #faad14;
}

.toast.toast-info {
    border-left: 4px solid #1890ff;
}

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

.toast.toast-loading {
    border-left: 4px solid #1890ff;
}

.toast.toast-loading .toast-icon {
    color: #1890ff;
    animation: spin 1s linear infinite;
}

/* 动画 */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* 响应式适配 */
@media (max-width: 768px) {
    .toast-container {
        top: 10px;
        left: 10px;
        right: 10px;
        align-items: center;
    }
    
    .toast {
        min-width: auto;
        max-width: 100%;
    }
}