/* 统一提示信息库样式 - Toast Library */

/* Toast容器 */
.toast-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10000;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    max-width: 90vw;
}

/* Toast基础样式 */
.toast {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    padding: 16px 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid #e5e7eb;
    min-width: 300px;
    max-width: 500px;
    pointer-events: auto;
    opacity: 0;
    transform: translateY(-20px) scale(0.9);
    transition: all 0.3s ease-out;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    font-size: 14px;
    line-height: 1.5;
    position: relative;
    overflow: hidden;
}

/* Toast显示动画 */
.toast.show {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Toast隐藏动画 */
.toast.hide {
    opacity: 0;
    transform: translateY(-20px) scale(0.9);
}

/* Toast内容区域 */
.toast-content {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

/* Toast图标 */
.toast-icon {
    font-size: 20px;
    line-height: 1;
    flex-shrink: 0;
    margin-top: 1px;
}

/* Toast文本区域 */
.toast-text {
    flex: 1;
    min-width: 0;
}

.toast-title {
    font-weight: 600;
    margin: 0 0 4px 0;
    color: #111827;
}

.toast-message {
    margin: 0;
    color: #6b7280;
    word-break: break-word;
}

/* Toast关闭按钮 */
.toast-close {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #9ca3af;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.toast-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #6b7280;
}

/* Toast进度条 */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: currentColor;
    opacity: 0.3;
    transition: width linear;
}

/* Toast类型样式 */
.toast.toast-success {
    border-left: 4px solid #10b981;
}

.toast.toast-success .toast-icon {
    color: #10b981;
}

.toast.toast-error {
    border-left: 4px solid #ef4444;
}

.toast.toast-error .toast-icon {
    color: #ef4444;
}

.toast.toast-warning {
    border-left: 4px solid #f59e0b;
}

.toast.toast-warning .toast-icon {
    color: #f59e0b;
}

.toast.toast-info {
    border-left: 4px solid #3b82f6;
}

.toast.toast-info .toast-icon {
    color: #3b82f6;
}

.toast.toast-loading {
    border-left: 4px solid #8b5cf6;
}

.toast.toast-loading .toast-icon {
    color: #8b5cf6;
}

/* 加载动画 */
.toast-loading .toast-icon {
    animation: toast-spin 1s linear infinite;
}

@keyframes toast-spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* 响应式设计 */
@media (max-width: 640px) {
    .toast-container {
        padding: 0 16px;
    }
    
    .toast {
        min-width: 280px;
        max-width: calc(100vw - 32px);
        padding: 14px 20px;
    }
    
    .toast-content {
        gap: 10px;
    }
    
    .toast-icon {
        font-size: 18px;
    }
}
.toast-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10000;
    pointer-events: none;
}

.toast {
    background: white;
    border-radius: 12px;
    padding: 1.5rem 2rem;
    margin-bottom: 1rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    border: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 300px;
    max-width: 500px;
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: auto;
}

.toast.show {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.toast.hide {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
}

/* 不同类型的提示样式 */
.toast.success {
    border-left: 4px solid #10b981;
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
}

.toast.error {
    border-left: 4px solid #ef4444;
    background: linear-gradient(135deg, #fef2f2 0%, #fef2f2 100%);
}

.toast.warning {
    border-left: 4px solid #f59e0b;
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
}

.toast.info {
    border-left: 4px solid #3b82f6;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
}

.toast.loading {
    border-left: 4px solid #6b7280;
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
}

/* 提示图标 */
.toast-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.toast.success .toast-icon {
    color: #10b981;
}

.toast.error .toast-icon {
    color: #ef4444;
}

.toast.warning .toast-icon {
    color: #f59e0b;
}

.toast.info .toast-icon {
    color: #3b82f6;
}

.toast.loading .toast-icon {
    color: #6b7280;
}

/* 旋转动画用于loading */
.toast-icon.spinning {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* 提示内容 */
.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    font-size: 1rem;
    color: #1f2937;
    margin-bottom: 0.25rem;
}

.toast-message {
    font-size: 0.875rem;
    color: #6b7280;
    line-height: 1.4;
}

/* 关闭按钮 */
.toast-close {
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    font-size: 1.25rem;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.toast-close:hover {
    color: #6b7280;
    background: rgba(0, 0, 0, 0.05);
}

/* 进度条 */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: #e5e7eb;
    border-radius: 0 0 12px 12px;
    overflow: hidden;
}

.toast-progress-fill {
    height: 100%;
    background: #3b82f6;
    transition: width 0.1s linear;
}

.toast.success .toast-progress-fill {
    background: #10b981;
}

.toast.error .toast-progress-fill {
    background: #ef4444;
}

.toast.warning .toast-progress-fill {
    background: #f59e0b;
}

/* 响应式设计 */
@media (max-width: 480px) {
    .toast-container {
        top: 1rem;
        left: 1rem;
        right: 1rem;
        transform: none;
        width: calc(100% - 2rem);
    }
    
    .toast {
        min-width: auto;
        width: 100%;
        margin-bottom: 0.5rem;
        padding: 1rem 1.5rem;
    }
    
    .toast-icon {
        font-size: 1.25rem;
    }
    
    .toast-title {
        font-size: 0.95rem;
    }
    
    .toast-message {
        font-size: 0.8rem;
    }
}

/* 多个提示时的堆叠效果 */
.toast:not(:last-child) {
    margin-bottom: 0.75rem;
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    .toast {
        border-width: 2px;
    }
}

/* 减少动画模式支持 */
@media (prefers-reduced-motion: reduce) {
    .toast {
        transition: opacity 0.2s ease;
    }
    
    .toast-icon.spinning {
        animation: none;
    }
}
