/**
 * Toast 提示组件样式
 * 用于显示临时通知消息，自动消失，不阻塞用户操作
 */

/* Toast 容器 - 固定在页面顶部中央 */
.toast-container {
    position: fixed !important;
    top: 20px !important;
    bottom: auto !important;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    z-index: 10000 !important;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
    max-width: 90%;
    width: auto;
}

/* Toast 单项 */
.toast-item {
    background: #ffffff;
    color: #1f2937;
    padding: 14px 20px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 280px;
    max-width: 500px;
    pointer-events: auto;
    animation: toastSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 14px;
    line-height: 1.5;
    border-left: 4px solid #6366f1;
}

/* Toast 图标 */
.toast-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

/* Toast 内容 */
.toast-message {
    flex: 1;
    word-break: break-word;
}

/* Toast 类型样式 */
.toast-item.success {
    border-left-color: #10b981;
    background: linear-gradient(135deg, #ffffff 0%, #f0fdf4 100%);
}

.toast-item.success .toast-icon {
    color: #10b981;
}

.toast-item.error {
    border-left-color: #ef4444;
    background: linear-gradient(135deg, #ffffff 0%, #fef2f2 100%);
}

.toast-item.error .toast-icon {
    color: #ef4444;
}

.toast-item.warning {
    border-left-color: #f59e0b;
    background: linear-gradient(135deg, #ffffff 0%, #fffbeb 100%);
}

.toast-item.warning .toast-icon {
    color: #f59e0b;
}

.toast-item.info {
    border-left-color: #3b82f6;
    background: linear-gradient(135deg, #ffffff 0%, #eff6ff 100%);
}

.toast-item.info .toast-icon {
    color: #3b82f6;
}

/* 进入动画 */
@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 退出动画 */
.toast-item.toast-exit {
    animation: toastSlideOut 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes toastSlideOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

/* 移动端适配 */
@media (max-width: 768px) {
    .toast-container {
        top: 10px;
        max-width: calc(100% - 32px);
    }
    
    .toast-item {
        min-width: 260px;
        padding: 12px 16px;
        font-size: 13px;
    }
    
    .toast-icon {
        width: 20px;
        height: 20px;
        font-size: 16px;
    }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    .toast-item {
        background: #1f2937;
        color: #f9fafb;
    }
    
    .toast-item.success {
        background: linear-gradient(135deg, #1f2937 0%, #064e3b 100%);
    }
    
    .toast-item.error {
        background: linear-gradient(135deg, #1f2937 0%, #7f1d1d 100%);
    }
    
    .toast-item.warning {
        background: linear-gradient(135deg, #1f2937 0%, #78350f 100%);
    }
    
    .toast-item.info {
        background: linear-gradient(135deg, #1f2937 0%, #1e3a8a 100%);
    }
}

