/* Toast通知系统样式 */

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    pointer-events: none;
    max-width: 400px;
}

.toast {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    margin-bottom: 10px;
    padding: 16px;
    pointer-events: auto;
    position: relative;
    transform: translateX(100%);
    transition: all 0.3s ease;
    border-left: 4px solid #007bff;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-width: 300px;
    max-width: 400px;
    word-wrap: break-word;
}

.toast.show {
    transform: translateX(0);
}

.toast.hide {
    transform: translateX(100%);
    opacity: 0;
}

/* Toast类型样式 */
.toast.success {
    border-left-color: #28a745;
}

.toast.error {
    border-left-color: #dc3545;
}

.toast.warning {
    border-left-color: #ffc107;
}

.toast.info {
    border-left-color: #17a2b8;
}

.toast.debug {
    border-left-color: #6c757d;
}

/* Toast图标 */
.toast-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin-top: 2px;
}

.toast.success .toast-icon {
    color: #28a745;
}

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

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

.toast.info .toast-icon {
    color: #17a2b8;
}

.toast.debug .toast-icon {
    color: #6c757d;
}

/* Toast内容 */
.toast-content {
    flex: 1;
    min-width: 0;
}

.toast-title {
    font-weight: 600;
    font-size: 14px;
    line-height: 1.4;
    margin: 0 0 4px 0;
    color: #333;
}

.toast-message {
    font-size: 13px;
    line-height: 1.4;
    margin: 0;
    color: #666;
    word-break: break-word;
}

/* Toast关闭按钮 */
.toast-close {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    font-size: 18px;
    line-height: 1;
    color: #999;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #666;
}

/* Toast进度条 */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 0 0 8px 8px;
    overflow: hidden;
}

.toast-progress-bar {
    height: 100%;
    background: currentColor;
    transition: width linear;
    opacity: 0.7;
}

.toast.success .toast-progress-bar {
    background: #28a745;
}

.toast.error .toast-progress-bar {
    background: #dc3545;
}

.toast.warning .toast-progress-bar {
    background: #ffc107;
}

.toast.info .toast-progress-bar {
    background: #17a2b8;
}

.toast.debug .toast-progress-bar {
    background: #6c757d;
}

/* 响应式设计 */
@media (max-width: 480px) {
    .toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .toast {
        min-width: auto;
        max-width: none;
        margin-bottom: 8px;
    }
}

/* 暗色主题支持 */
@media (prefers-color-scheme: dark) {
    .toast {
        background: #2d3748;
        color: #e2e8f0;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    }
    
    .toast-title {
        color: #f7fafc;
    }
    
    .toast-message {
        color: #cbd5e0;
    }
    
    .toast-close {
        color: #a0aec0;
    }
    
    .toast-close:hover {
        background: rgba(255, 255, 255, 0.1);
        color: #e2e8f0;
    }
}

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

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

.toast.animate-in {
    animation: slideInRight 0.3s ease;
}

.toast.animate-out {
    animation: slideOutRight 0.3s ease;
}

/* 兼容旧版本toast样式 */
.toast-notification {
    /* 保持与现有toast样式的兼容性 */
}

/* 特殊状态样式 */
.toast.loading {
    border-left-color: #007bff;
}

.toast.loading .toast-icon {
    animation: spin 1s linear infinite;
}

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

/* 堆叠效果 */
.toast-container .toast:nth-child(n+4) {
    opacity: 0.8;
    transform: translateX(0) scale(0.95);
}

.toast-container .toast:nth-child(n+5) {
    opacity: 0.6;
    transform: translateX(0) scale(0.9);
}

.toast-container .toast:nth-child(n+6) {
    display: none;
}