/**
 * 全局提示消息样式
 * 简约、友好、现代化
 */

/* 确保Toast系统内部也隐藏滚动条 */
.custom-dialog,
.custom-loading,
.modal-content {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE 和 Edge */
}
.custom-dialog::-webkit-scrollbar,
.custom-loading::-webkit-scrollbar,
.modal-content::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

/* Toast提示样式 */
.custom-toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    max-width: 90%;
    min-width: 300px;
}

.custom-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.toast-message {
    font-size: 15px;
    color: #374151;
    font-weight: 500;
}

/* 不同类型的Toast */
.toast-success .toast-icon {
    color: #10b981;
}

.toast-error .toast-icon {
    color: #ef4444;
}

.toast-warning .toast-icon {
    color: #f59e0b;
}

.toast-info .toast-icon {
    color: #3b82f6;
}

/* 确认对话框遮罩 */
.custom-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(2px);
}

.custom-overlay.show {
    opacity: 1;
}

/* 确认对话框 */
.custom-dialog {
    background: white;
    border-radius: 16px;
    padding: 32px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.custom-dialog.show {
    transform: scale(1);
    opacity: 1;
}

.dialog-icon {
    text-align: center;
    font-size: 48px;
    margin-bottom: 16px;
}

.dialog-title {
    font-size: 20px;
    font-weight: 600;
    color: #111827;
    text-align: center;
    margin-bottom: 12px;
}

.dialog-message {
    font-size: 15px;
    color: #6b7280;
    text-align: center;
    line-height: 1.6;
    margin-bottom: 24px;
}

.dialog-buttons {
    display: flex;
    gap: 12px;
}

.dialog-btn {
    flex: 1;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.dialog-btn-cancel {
    background: #f3f4f6;
    color: #6b7280;
}

.dialog-btn-cancel:hover {
    background: #e5e7eb;
}

.dialog-btn-confirm {
    background: #3b82f6;
    color: white;
}

.dialog-btn-confirm:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* Loading加载提示 */
.custom-loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(2px);
}

.custom-loading.show {
    opacity: 1;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    margin-top: 16px;
    color: white;
    font-size: 15px;
    font-weight: 500;
}

/* 响应式优化 */
@media (max-width: 640px) {
    .custom-toast {
        min-width: auto;
        max-width: calc(100% - 32px);
    }
    
    .custom-dialog {
        padding: 24px;
        max-width: calc(100% - 32px);
    }
    
    .dialog-icon {
        font-size: 40px;
    }
    
    .dialog-title {
        font-size: 18px;
    }
    
    .dialog-message {
        font-size: 14px;
    }
    
    .dialog-buttons {
        flex-direction: column;
    }
    
    .dialog-btn {
        width: 100%;
    }
}

/* 暗色主题支持（可选） */
@media (prefers-color-scheme: dark) {
    .custom-toast {
        background: #1f2937;
    }
    
    .toast-message {
        color: #f3f4f6;
    }
    
    .custom-dialog {
        background: #1f2937;
    }
    
    .dialog-title {
        color: #f9fafb;
    }
    
    .dialog-message {
        color: #d1d5db;
    }
    
    .dialog-btn-cancel {
        background: #374151;
        color: #d1d5db;
    }
    
    .dialog-btn-cancel:hover {
        background: #4b5563;
    }
}
