-
+
📈 数据图表
+
+ 📊 动态图表: 选择不同的时间范围查看数据趋势变化
+
+
+
-
\ No newline at end of file
diff --git a/src/chat/utils/templates/report.css b/src/chat/utils/templates/report.css
index 2229be785..ff8930f23 100644
--- a/src/chat/utils/templates/report.css
+++ b/src/chat/utils/templates/report.css
@@ -1,111 +1,164 @@
+/* Material Design 3 - Blue White Gray Theme */
+:root {
+ --md-sys-color-primary: #1976D2;
+ --md-sys-color-primary-container: #E3F2FD;
+ --md-sys-color-on-primary: #FFFFFF;
+ --md-sys-color-secondary: #546E7A;
+ --md-sys-color-secondary-container: #ECEFF1;
+ --md-sys-color-surface: #FFFFFF;
+ --md-sys-color-surface-variant: #F5F5F5;
+ --md-sys-color-background: #FAFAFA;
+ --md-sys-color-on-surface: #1C1B1F;
+ --md-sys-color-outline: #BDBDBD;
+ --md-sys-color-shadow: rgba(0, 0, 0, 0.1);
+}
+
/* General Body Styles */
body {
- font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
+ font-family: 'Roboto', -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
margin: 0;
padding: 20px;
- background-color: #f0f4f8; /* Light blue-gray background */
- color: #333; /* Darker text for better contrast */
+ background: var(--md-sys-color-background);
+ color: var(--md-sys-color-on-surface);
line-height: 1.6;
+ min-height: 100vh;
}
/* Main Container */
.container {
- max-width: 95%; /* Make container almost full-width */
+ max-width: 95%;
margin: 20px auto;
- background-color: #FFFFFF; /* Pure white background */
- padding: 30px;
- border-radius: 12px; /* Slightly more rounded corners */
- box-shadow: 0 8px 25px rgba(0, 0, 0, 0.07); /* Softer, deeper shadow */
+ background-color: var(--md-sys-color-surface);
+ padding: 40px;
+ border-radius: 28px;
+ box-shadow: 0 4px 16px var(--md-sys-color-shadow);
+ animation: slideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
+}
+
+@keyframes slideIn {
+ from {
+ opacity: 0;
+ transform: translateY(-8px);
+ }
+ to {
+ opacity: 1;
+ transform: translateY(0);
+ }
}
/* Dashboard Layout */
.dashboard-layout {
display: flex;
- gap: 30px;
+ flex-direction: column;
+ gap: 32px;
}
.main-content {
- flex: 65%;
+ width: 100%;
min-width: 0;
}
.sidebar-content {
- flex: 35%;
+ width: 100%;
min-width: 0;
}
-/* Responsive Design for Mobile */
-@media (max-width: 992px) {
- .dashboard-layout {
- flex-direction: column;
- }
- .main-content, .sidebar-content {
- flex: 1;
- }
-}
-
-/* Typography */
+/* Typography - Material Design 3 */
h1, h2 {
- color: #212529;
+ color: var(--md-sys-color-on-surface);
padding-bottom: 10px;
margin-top: 0;
}
h1 {
text-align: center;
- font-size: 2.2em;
- margin-bottom: 20px;
- color: #2A6CB5; /* A deeper, more professional blue */
+ font-size: 2.5em;
+ margin-bottom: 30px;
+ color: var(--md-sys-color-primary);
+ font-weight: 500;
+ letter-spacing: 0;
}
h2 {
font-size: 1.5em;
margin-top: 40px;
- margin-bottom: 15px;
- border-bottom: 2px solid #DDE6ED; /* Lighter border color */
+ margin-bottom: 20px;
+ border-bottom: 2px solid var(--md-sys-color-primary);
+ padding-bottom: 12px;
+ color: var(--md-sys-color-on-surface);
+ font-weight: 500;
+ display: flex;
+ align-items: center;
+ gap: 8px;
}
-/* Info Banners */
+/* Info Banners - MD3 Style */
.info-item {
- background-color: #E9F2FA; /* Light blue background */
- padding: 12px 18px;
- border-radius: 8px;
- margin-bottom: 20px;
+ background: var(--md-sys-color-primary-container);
+ padding: 16px 24px;
+ border-radius: 16px;
+ margin-bottom: 24px;
font-size: 0.95em;
- border: 1px solid #D1E3F4; /* Light blue border */
+ border-left: 4px solid var(--md-sys-color-primary);
+ box-shadow: 0 1px 3px var(--md-sys-color-shadow);
+ transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
+}
+
+.info-item:hover {
+ box-shadow: 0 2px 6px var(--md-sys-color-shadow);
}
.info-item strong {
- color: #2A6CB5; /* Deeper blue for emphasis */
+ color: var(--md-sys-color-primary);
+ font-weight: 500;
}
-/* Tabs */
+/* Tabs - MD3 Style */
.tabs {
- border-bottom: 2px solid #DEE2E6;
+ border-bottom: 1px solid var(--md-sys-color-outline);
display: flex;
- margin-bottom: 20px;
+ margin-bottom: 32px;
+ flex-wrap: wrap;
+ gap: 8px;
}
.tabs button {
background: none;
border: none;
outline: none;
- padding: 14px 20px;
+ padding: 16px 24px;
cursor: pointer;
- transition: all 0.3s ease;
- font-size: 16px;
- color: #6C757D;
- border-bottom: 3px solid transparent;
- margin-bottom: -2px; /* Align with container border */
+ transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
+ font-size: 14px;
+ color: var(--md-sys-color-on-surface);
+ border-radius: 16px 16px 0 0;
+ margin-bottom: -1px;
+ font-weight: 500;
+ position: relative;
+}
+
+.tabs button::after {
+ content: '';
+ position: absolute;
+ bottom: 0;
+ left: 0;
+ right: 0;
+ height: 3px;
+ background: var(--md-sys-color-primary);
+ transform: scaleX(0);
+ transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.tabs button:hover {
- color: #2A6CB5;
- background-color: #f0f4f8; /* Subtle hover background */
+ background: var(--md-sys-color-surface-variant);
}
.tabs button.active {
- color: #2A6CB5; /* Active tab color */
- border-bottom-color: #2A6CB5; /* Active tab border color */
+ color: var(--md-sys-color-primary);
+ font-weight: 600;
+}
+
+.tabs button.active::after {
+ transform: scaleX(1);
}
.tab-content {
@@ -117,83 +170,277 @@ h2 {
display: block;
}
-/* Summary Cards */
+/* Summary Cards - MD3 Style */
.summary-cards {
display: grid;
- grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
- gap: 20px;
- margin: 20px 0;
+ grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
+ gap: 16px;
+ margin: 32px 0;
}
.card {
- background-color: #FFFFFF;
- padding: 20px;
- border-radius: 8px;
+ background: var(--md-sys-color-surface);
+ padding: 24px;
+ border-radius: 16px;
text-align: center;
- border: 1px solid #DDE6ED; /* Lighter border */
- transition: all 0.3s ease;
+ border: 1px solid var(--md-sys-color-outline);
+ transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
+ box-shadow: 0 1px 3px var(--md-sys-color-shadow);
}
.card:hover {
- transform: translateY(-5px);
- box-shadow: 0 6px 15px rgba(0,0,0,0.08);
+ box-shadow: 0 4px 12px var(--md-sys-color-shadow);
+ transform: translateY(-4px);
+ border-color: var(--md-sys-color-primary);
}
.card h3 {
- margin: 0 0 10px;
- font-size: 1em;
- color: #6C757D;
+ margin: 0 0 16px;
+ font-size: 0.875rem;
+ color: var(--md-sys-color-secondary);
+ font-weight: 500;
+ letter-spacing: 0.1px;
}
.card p {
margin: 0;
- font-size: 1.8em;
- font-weight: bold;
- color: #212529;
+ font-size: 2rem;
+ font-weight: 600;
+ color: var(--md-sys-color-primary);
+ line-height: 1.2;
}
-/* Tables */
+/* Tables - MD3 Style */
table {
width: 100%;
border-collapse: collapse;
- margin-top: 15px;
- font-size: 0.9em;
+ margin-top: 24px;
+ font-size: 0.875rem;
+ border-radius: 16px;
+ overflow: hidden;
+ box-shadow: 0 1px 3px var(--md-sys-color-shadow);
+ border: 1px solid var(--md-sys-color-outline);
}
th, td {
- padding: 12px 15px;
+ padding: 16px;
text-align: left;
- border-bottom: 1px solid #EAEAEA;
+ border-bottom: 1px solid var(--md-sys-color-outline);
}
+
th {
- background-color: #4A90E2; /* Main theme blue */
- color: white;
- font-weight: bold;
- font-size: 0.95em;
- text-transform: uppercase;
- letter-spacing: 0.5px;
+ background: var(--md-sys-color-primary);
+ color: var(--md-sys-color-on-primary);
+ font-weight: 500;
+ font-size: 0.875rem;
+ letter-spacing: 0.1px;
+}
+
+tbody tr {
+ transition: background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
tr:nth-child(even) {
- background-color: #F7FAFC; /* Very light blue for alternate rows */
+ background-color: var(--md-sys-color-surface-variant);
}
-tr:hover {
- background-color: #E9F2FA; /* Light blue for hover */
+tbody tr:hover {
+ background-color: var(--md-sys-color-primary-container);
}
-/* Chart Container in Sidebar */
+/* Chart Container - MD3 Style */
.chart-container {
position: relative;
- height: 300px; /* Adjust height as needed */
width: 100%;
- margin-bottom: 20px;
+ padding: 24px;
+ background: var(--md-sys-color-surface);
+ border-radius: 16px;
+ box-shadow: 0 1px 3px var(--md-sys-color-shadow);
+ border: 1px solid var(--md-sys-color-outline);
+ transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
-/* Footer */
+.chart-container:hover {
+ box-shadow: 0 4px 12px var(--md-sys-color-shadow);
+}
+
+.chart-container canvas {
+ max-width: 100%;
+ height: auto !important;
+}
+
+/* Chart Wrapper for dynamic charts */
+.chart-wrapper {
+ position: relative;
+ width: 100%;
+ height: 350px;
+ padding: 24px;
+ background: var(--md-sys-color-surface);
+ border-radius: 16px;
+ box-shadow: 0 1px 3px var(--md-sys-color-shadow);
+ border: 1px solid var(--md-sys-color-outline);
+}
+
+.chart-wrapper canvas {
+ max-height: 300px !important;
+}
+
+.chart-grid {
+ display: flex;
+ flex-direction: column;
+ gap: 24px;
+ margin-top: 24px;
+}
+
+/* Time Range Buttons - MD3 Filled Button */
+.time-range-btn {
+ background: var(--md-sys-color-primary);
+ color: var(--md-sys-color-on-primary);
+ border: none;
+ padding: 10px 24px;
+ margin: 0 8px;
+ border-radius: 20px;
+ cursor: pointer;
+ font-size: 14px;
+ font-weight: 500;
+ transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
+ box-shadow: 0 1px 3px var(--md-sys-color-shadow);
+}
+
+.time-range-btn:hover {
+ box-shadow: 0 2px 6px var(--md-sys-color-shadow);
+}
+
+.time-range-btn.active {
+ background: var(--md-sys-color-secondary);
+ box-shadow: 0 2px 6px var(--md-sys-color-shadow);
+}
+
+/* Statistics Badge - MD3 */
+.stat-badge {
+ display: inline-block;
+ padding: 4px 12px;
+ background: var(--md-sys-color-primary-container);
+ color: var(--md-sys-color-primary);
+ border-radius: 16px;
+ font-size: 0.875rem;
+ font-weight: 500;
+ margin-left: 8px;
+}
+
+/* Loading Animation */
+@keyframes pulse {
+ 0%, 100% {
+ opacity: 1;
+ }
+ 50% {
+ opacity: 0.5;
+ }
+}
+
+.loading {
+ animation: pulse 1.5s ease-in-out infinite;
+}
+
+/* Scrollbar Styling - MD3 */
+::-webkit-scrollbar {
+ width: 12px;
+ height: 12px;
+}
+
+::-webkit-scrollbar-track {
+ background: var(--md-sys-color-surface-variant);
+ border-radius: 8px;
+}
+
+::-webkit-scrollbar-thumb {
+ background: var(--md-sys-color-primary);
+ border-radius: 8px;
+ border: 2px solid var(--md-sys-color-surface-variant);
+}
+
+::-webkit-scrollbar-thumb:hover {
+ background: var(--md-sys-color-secondary);
+}
+
+/* Footer - MD3 */
.footer {
text-align: center;
- margin-top: 40px;
- font-size: 0.85em;
- color: #6C757D;
+ margin-top: 48px;
+ padding-top: 24px;
+ border-top: 1px solid var(--md-sys-color-outline);
+ font-size: 0.875rem;
+ color: var(--md-sys-color-secondary);
+}
+
+.footer p {
+ margin: 8px 0;
+}
+
+/* Responsive Design */
+@media (max-width: 768px) {
+ .container {
+ padding: 20px;
+ border-radius: 16px;
+ }
+
+ h1 {
+ font-size: 2em;
+ }
+
+ h2 {
+ font-size: 1.25em;
+ }
+
+ .summary-cards {
+ grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
+ gap: 12px;
+ }
+
+ .card {
+ padding: 16px;
+ }
+
+ .card h3 {
+ font-size: 0.8rem;
+ margin-bottom: 12px;
+ }
+
+ .card p {
+ font-size: 1.5rem;
+ }
+
+ table {
+ font-size: 0.8rem;
+ }
+
+ th, td {
+ padding: 12px 8px;
+ }
+
+ .tabs button {
+ padding: 12px 16px;
+ font-size: 13px;
+ }
+
+ .time-range-btn {
+ padding: 8px 16px;
+ margin: 4px;
+ font-size: 13px;
+ }
+
+ .chart-wrapper,
+ .chart-container {
+ height: 250px;
+ }
+}
+
+@media (max-width: 480px) {
+ .summary-cards {
+ grid-template-columns: 1fr 1fr;
+ }
+
+ .card p {
+ font-size: 1.25rem;
+ }
}
diff --git a/src/chat/utils/templates/report.html b/src/chat/utils/templates/report.html
index b70146063..23726641b 100644
--- a/src/chat/utils/templates/report.html
+++ b/src/chat/utils/templates/report.html
@@ -4,15 +4,21 @@
{{ report_title }}
+
+
{{ report_title }}
-
统计截止时间: {{ generation_time }}
+
📅 统计截止时间: {{ generation_time }}
{{ tab_list }}
{{ tab_content }}
+