|
4 | 4 | * 支持响应式调整 |
5 | 5 | */ |
6 | 6 |
|
| 7 | +/* 最高优先级:覆盖所有冲突的 tab-content 样式 */ |
| 8 | +.tab-content#chat-tab, |
| 9 | +#chat-tab.tab-content, |
| 10 | +.tab-content#chat-tab.active, |
| 11 | +div.tab-content#chat-tab { |
| 12 | + display: flex !important; |
| 13 | + flex-direction: column !important; |
| 14 | + height: 100vh !important; |
| 15 | + max-height: 100vh !important; |
| 16 | + overflow: hidden !important; |
| 17 | + padding: 0 !important; |
| 18 | + position: relative !important; |
| 19 | +} |
| 20 | + |
| 21 | +/* 覆盖通用 tab-content 在 main-content 中的样式 */ |
| 22 | +.main-content .tab-content#chat-tab, |
| 23 | +.main-content #chat-tab.tab-content { |
| 24 | + overflow-y: hidden !important; |
| 25 | + height: 100vh !important; |
| 26 | +} |
| 27 | + |
7 | 28 | /* 聊天标签页容器 - 使用 flexbox 布局 */ |
8 | 29 | #chat-tab { |
9 | | - display: flex !important; |
10 | | - flex-direction: column; |
| 30 | + display: grid !important; |
| 31 | + grid-template-rows: auto 1fr; |
11 | 32 | height: 100vh !important; |
12 | 33 | max-height: 100vh !important; |
13 | 34 | padding: 0 !important; |
|
17 | 38 |
|
18 | 39 | /* 聊天容器 - 占据所有可用空间 */ |
19 | 40 | #chat-tab .chat-container { |
| 41 | + grid-row: 2; |
20 | 42 | flex: 1 1 auto; |
21 | 43 | display: flex !important; |
22 | 44 | flex-direction: column !important; |
23 | 45 | min-height: 0 !important; /* 重要:允许 flex 子元素缩小 */ |
24 | 46 | height: 100% !important; |
25 | 47 | padding: 15px 20px 10px 20px; |
26 | | - overflow: hidden !important; |
| 48 | + overflow: visible !important; |
| 49 | + position: relative; |
27 | 50 | } |
28 | 51 |
|
29 | 52 | /* 消息区域 - 可滚动,会被压缩以容纳输入框 */ |
|
36 | 59 | background: white; |
37 | 60 | border-radius: 16px; |
38 | 61 | padding: 20px; |
| 62 | + padding-bottom: 140px; |
| 63 | + scroll-padding-bottom: 140px; |
39 | 64 | margin-bottom: 12px; |
40 | 65 | box-shadow: 0 4px 20px rgba(0,0,0,0.08); |
41 | 66 | } |
|
49 | 74 | padding: 12px 16px; |
50 | 75 | box-shadow: 0 4px 20px rgba(0,0,0,0.08); |
51 | 76 | margin-bottom: 10px; |
52 | | - position: relative; |
| 77 | + margin-top: auto; |
| 78 | + position: sticky; |
| 79 | + bottom: 0; |
| 80 | + left: 0; |
| 81 | + right: 0; |
53 | 82 | z-index: 10; |
54 | 83 | } |
55 | 84 |
|
|
125 | 154 | padding: 10px 14px; |
126 | 155 | margin-bottom: 8px; |
127 | 156 | } |
| 157 | + |
| 158 | + #chat-tab .chat-header { |
| 159 | + padding: 10px 16px !important; |
| 160 | + gap: 12px; |
| 161 | + } |
| 162 | + |
| 163 | + #chat-tab .chat-header .header-controls { |
| 164 | + width: 100%; |
| 165 | + justify-content: flex-start; |
| 166 | + gap: 10px; |
| 167 | + } |
| 168 | + |
| 169 | + #chat-tab .chat-header .model-selector { |
| 170 | + flex: 1 1 220px; |
| 171 | + max-width: none; |
| 172 | + } |
128 | 173 | } |
129 | 174 |
|
130 | 175 | /* 响应式调整 - 小屏幕 */ |
|
165 | 210 | width: 36px; |
166 | 211 | height: 36px; |
167 | 212 | } |
| 213 | + |
| 214 | + #chat-tab .chat-header { |
| 215 | + padding: 8px 12px !important; |
| 216 | + gap: 10px; |
| 217 | + } |
| 218 | + |
| 219 | + #chat-tab .chat-header h1 { |
| 220 | + font-size: 18px !important; |
| 221 | + } |
| 222 | + |
| 223 | + #chat-tab .chat-header .header-controls { |
| 224 | + flex-direction: column; |
| 225 | + align-items: stretch; |
| 226 | + gap: 8px; |
| 227 | + } |
| 228 | + |
| 229 | + #chat-tab .chat-header .model-selector, |
| 230 | + #chat-tab .btn-new-conversation { |
| 231 | + width: 100%; |
| 232 | + } |
168 | 233 | } |
169 | 234 |
|
170 | 235 | /* 响应式调整 - 超小屏幕 */ |
|
288 | 353 | } |
289 | 354 |
|
290 | 355 | /* 优化顶部标题和按钮区域 */ |
291 | | -#chat-tab > div:first-child { |
292 | | - flex-shrink: 0; |
293 | | - padding: 10px 20px !important; |
| 356 | +#chat-tab .chat-header { |
| 357 | + grid-row: 1; |
| 358 | + display: flex; |
| 359 | + flex-wrap: wrap; |
| 360 | + align-items: center; |
| 361 | + justify-content: space-between; |
| 362 | + gap: 16px; |
| 363 | + padding: 12px 20px !important; |
294 | 364 | background: var(--color-bg-secondary, #ffffff); |
295 | 365 | border-bottom: 1px solid var(--color-border-primary, #e0e0e0); |
296 | 366 | } |
297 | 367 |
|
| 368 | +#chat-tab .chat-header .header-left { |
| 369 | + flex: 1 1 auto; |
| 370 | + min-width: 0; |
| 371 | +} |
| 372 | + |
| 373 | +#chat-tab .chat-header h1 { |
| 374 | + font-size: 22px !important; |
| 375 | + margin: 0 !important; |
| 376 | + white-space: nowrap; |
| 377 | + overflow: hidden; |
| 378 | + text-overflow: ellipsis; |
| 379 | +} |
| 380 | + |
| 381 | +#chat-tab .chat-header .header-controls { |
| 382 | + display: flex; |
| 383 | + align-items: center; |
| 384 | + gap: 12px; |
| 385 | + flex-wrap: wrap; |
| 386 | + justify-content: flex-end; |
| 387 | +} |
| 388 | + |
298 | 389 | #chat-tab .btn-new-conversation { |
299 | 390 | padding: 8px 16px !important; |
300 | 391 | font-size: 14px !important; |
|
308 | 399 | } |
309 | 400 |
|
310 | 401 | /* 针对页面顶部的 flex 容器 */ |
311 | | -#chat-tab > div:first-child > div { |
| 402 | +#chat-tab .chat-header > div { |
312 | 403 | display: flex; |
313 | 404 | align-items: center; |
314 | 405 | justify-content: space-between; |
|
0 commit comments