1. Auto-save reports when page closes:
- Added beforeunload handler to auto-save analysis to history
- Saves to local IndexedDB and cloud (if authenticated)
- Prevents data loss if user accidentally closes the page
2. Fix PDF download from history page:
- Made taskId optional in DownloadReports component
- Added direct mode: can pass reports data directly
- Updated backend to support both task-based and direct-data modes
- History reports now have download PDF option available
- Add gradient styles to workflow Card, Footer, and DownloadReports
- Simplify K-line chart implementation using BarChart with Cell coloring
- Fix TypeScript errors in chart components
- Ensure consistent visual design across all pages