-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathindex.html
More file actions
1661 lines (1489 loc) · 60.8 KB
/
index.html
File metadata and controls
1661 lines (1489 loc) · 60.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>DeepSeek伴侣 - AI进化论-花生 出品</title>
<!-- 添加 favicon -->
<link rel="icon" type="image/svg+xml" href="logo.svg">
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-54EMVJZVN9"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-54EMVJZVN9');
</script>
<script src="https://unpkg.com/vue@3/dist/vue.global.prod.js"></script>
<link rel="stylesheet" href="https://unpkg.com/element-plus/dist/index.css">
<script src="https://unpkg.com/element-plus"></script>
<script src="https://unpkg.com/@element-plus/icons-vue@2.1.0/dist/index.iife.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/marked@4.3.0/lib/marked.umd.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/styles/github.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/highlight.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/languages/javascript.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/languages/python.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/languages/swift.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/languages/bash.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/languages/xml.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/languages/css.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/languages/json.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/languages/markdown.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/html2pdf.js/0.10.1/html2pdf.bundle.min.js"></script>
<script>
// 初始化 highlight.js
hljs.configure({
ignoreUnescapedHTML: true
});
// 初始化 marked
document.addEventListener('DOMContentLoaded', function() {
if (typeof marked === 'undefined') {
console.error('Marked library not loaded');
return;
}
// 创建渲染器
const renderer = new marked.Renderer();
// 自定义表格渲染
renderer.table = function(header, body) {
return '<div class="table-container"><table>\n'
+ '<thead>\n'
+ header
+ '</thead>\n'
+ '<tbody>\n'
+ body
+ '</tbody>\n'
+ '</table></div>\n';
};
// 自定义代码块渲染
renderer.code = function(code, language) {
const validLanguage = hljs.getLanguage(language) ? language : 'plaintext';
const highlighted = hljs.highlight(code, { language: validLanguage }).value;
return `<pre><code class="hljs language-${validLanguage}">${highlighted}</code></pre>`;
};
// 配置 marked
marked.setOptions({
renderer: renderer,
gfm: true,
breaks: true,
pedantic: false,
sanitize: false,
smartLists: true,
smartypants: true,
xhtml: false,
highlight: function(code, lang) {
if (lang && hljs.getLanguage(lang)) {
try {
return hljs.highlight(code, { language: lang }).value;
} catch (__) {}
}
return hljs.highlightAuto(code).value;
}
});
// 设置全局标志
window.markedInitialized = true;
});
</script>
<style>
body {
margin: 0;
padding: 0;
background: #f5f7fa; /* 更改为浅色背景 */
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
.chat-container {
max-width: 100%;
height: 100vh;
margin: 0 auto;
background: #ffffff;
overflow: hidden;
display: flex;
flex-direction: column;
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
}
@media (min-width: 768px) {
.chat-container {
max-width: 1200px;
height: 100vh;
margin: 0 auto;
border-radius: 15px;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
}
.message-list {
flex: 1;
padding: 20px;
overflow-y: auto;
background: #ffffff; /* 更改为白色背景 */
-webkit-overflow-scrolling: touch;
}
.message-bubble {
max-width: 85%;
margin: 10px 0;
padding: 12px 16px;
border-radius: 15px;
animation: fadeIn 0.3s ease-in;
word-wrap: break-word;
white-space: pre-wrap;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
position: relative;
}
.reasoning-content {
font-size: 0.9em;
color: #666;
background: #f8f9fa;
border-radius: 8px;
padding: 12px;
margin-bottom: 10px;
position: relative;
padding-right: 40px; /* 为复制按钮留出空间 */
}
.reasoning-toggle {
position: absolute;
top: 8px;
right: 8px;
cursor: pointer;
color: #94a3b8;
padding: 4px;
border-radius: 4px;
transition: background-color 0.2s;
}
.reasoning-toggle:hover {
background-color: #e2e8f0;
}
.reasoning-body {
margin-top: 4px;
transition: max-height 0.3s ease-out;
overflow: hidden;
}
.reasoning-body.collapsed {
max-height: 0;
}
.user-message {
background: #4096ff; /* 更改为更柔和的蓝色 */
color: white;
margin-left: auto;
border-bottom-right-radius: 5px;
}
.assistant-message {
background: #f5f7fa; /* 更改为浅灰色背景 */
color: #1f2937; /* 更改为深色文字 */
border: 1px solid #e5e7eb;
border-bottom-left-radius: 5px;
}
.typing-indicator {
display: inline-flex;
padding: 8px 12px;
background: #ffffff;
border-radius: 15px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}
.dot {
width: 6px;
height: 6px;
margin: 0 2px;
background: #94a3b8;
border-radius: 50%;
animation: bounce 1.4s infinite;
}
.input-footer {
background: #ffffff; /* 更改为白色背景 */
border-top: 1px solid #e5e7eb;
padding: 15px;
}
.settings-drawer {
padding: 20px;
}
.api-key-input {
margin-bottom: 20px;
}
@media (max-width: 768px) {
.message-bubble {
max-width: 90%;
}
.input-footer {
padding: 10px;
}
}
@keyframes bounce {
0%, 80%, 100% { transform: translateY(0) }
40% { transform: translateY(-4px) }
}
@keyframes fadeIn {
from {
opacity: 0;
transform: translateY(10px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
.mobile-header {
position: sticky;
top: 0;
z-index: 100;
padding: 0 15px;
background: #ffffff; /* 更改为白色背景 */
color: white;
height: 56px;
display: flex;
align-items: center;
justify-content: space-between;
-webkit-backdrop-filter: blur(10px);
backdrop-filter: blur(10px);
border-bottom: 1px solid #e5e7eb;
}
.mobile-header h2 {
margin: 0;
font-size: 18px;
font-weight: 600;
color: #1f2937; /* 改为深色文字 */
}
.app-container {
display: flex;
height: 100vh;
background: #f0f2f5;
}
.sidebar {
width: 260px;
background: #ffffff; /* 更改为白色背景 */
border-right: 1px solid #e5e7eb;
display: flex;
flex-direction: column;
overflow: hidden;
}
@media (max-width: 768px) {
.sidebar {
position: fixed;
left: -260px;
top: 0;
bottom: 0;
z-index: 1000;
transition: left 0.3s ease;
}
.sidebar.show {
left: 0;
}
.sidebar-overlay {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.5);
z-index: 999;
display: none;
}
.sidebar-overlay.show {
display: block;
}
}
.sidebar-header {
padding: 16px;
border-bottom: 1px solid #e2e8f0;
}
.chat-list {
flex: 1;
overflow-y: auto;
padding: 16px;
}
.chat-item {
padding: 12px;
margin-bottom: 8px;
border-radius: 12px;
cursor: pointer;
transition: all 0.2s ease;
display: flex;
align-items: center;
gap: 8px;
background: transparent;
color: #1f2937; /* 更改为深色文字 */
}
.chat-item:hover {
background: rgba(64, 150, 255, 0.1);
}
.chat-item.active {
background: rgba(64, 150, 255, 0.15);
}
.chat-item-title {
flex: 1;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
color: #1f2937; /* 改为深色文字 */
}
.main-content {
flex: 1;
display: flex;
flex-direction: column;
overflow: hidden;
}
.menu-button {
font-size: 24px;
color: #1f2937; /* 改为深色 */
background: none;
border: none;
padding: 8px;
cursor: pointer;
display: none;
}
@media (max-width: 768px) {
.menu-button {
display: block;
}
}
.empty-state {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100%;
color: #1f2937; /* 改为深色文字 */
text-align: center;
padding: 20px;
}
.empty-state-icon {
font-size: 48px;
margin-bottom: 16px;
color: #3b82f6;
}
.empty-state-title {
font-size: 24px;
margin-bottom: 8px;
color: #1f2937; /* 改为深色文字 */
font-weight: 600;
}
.empty-state-description {
max-width: 400px;
margin-bottom: 24px;
color: #4b5563; /* 稍微浅一点的深色 */
}
.footer {
padding: 12px 16px;
background: #ffffff;
border-top: 1px solid #e5e7eb;
font-size: 14px;
color: #64748b;
}
.footer-content {
max-width: 1200px;
margin: 0 auto;
}
.footer-basic {
display: flex;
align-items: center;
justify-content: center;
gap: 8px;
}
.divider {
color: #e5e7eb;
}
.author-link {
color: #4096ff;
text-decoration: none;
transition: color 0.2s;
}
.author-link:hover {
color: #1677ff;
}
.more-info-btn {
padding: 2px 4px;
color: #64748b !important;
}
.more-info-btn:hover {
color: #4096ff !important;
}
.author-dialog {
border-radius: 12px;
}
.author-info {
padding: 0 20px;
}
.author-info h3 {
margin: 0 0 16px;
color: #1f2937;
font-size: 18px;
}
.author-desc {
margin-bottom: 20px;
color: #4b5563;
}
.author-desc p {
margin: 8px 0;
}
.social-links {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
gap: 12px;
}
.social-link {
display: flex;
align-items: center;
gap: 8px;
padding: 8px 12px;
color: #4b5563;
text-decoration: none;
border-radius: 8px;
transition: all 0.2s;
background: #f8fafc;
}
.social-link:hover {
background: #f1f5f9;
color: #4096ff;
}
@media (max-width: 768px) {
.footer {
padding: 10px;
font-size: 12px;
}
.author-info {
padding: 0 10px;
}
.social-links {
grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
}
}
/* Markdown 内容样式优化 */
.markdown-content {
font-size: 1em;
line-height: 1.5;
color: var(--text-primary);
padding: 0.8em;
border-radius: 8px;
}
/* 标题样式优化 */
.markdown-content h1,
.markdown-content h2,
.markdown-content h3,
.markdown-content h4,
.markdown-content h5,
.markdown-content h6 {
margin-top: 0.8em; /* 减小标题上方间距 */
margin-bottom: 0.2em; /* 减小标题下方间距 */
font-weight: 600;
line-height: 1.2; /* 减小标题行高 */
color: var(--text-primary);
}
/* 段落样式优化 */
.markdown-content p {
margin: 0.2em 0; /* 进一步减小段落间距 */
line-height: 1.1; /* 保持较小的行高 */
}
/* 列表样式优化 */
.markdown-content ul,
.markdown-content ol {
padding-left: 1.1em;
margin: 0.2em 0; /* 减小列表外边距 */
}
.markdown-content li {
margin: 0.1em 0; /* 减小列表项间距 */
line-height: 1.1; /* 保持较小的行高 */
}
/* 嵌套列表优化 */
.markdown-content ul ul,
.markdown-content ul ol,
.markdown-content ol ul,
.markdown-content ol ol {
margin: 0.1em 0 0.1em 0.8em; /* 保持较小的嵌套列表间距 */
}
/* 代码块样式优化 */
.markdown-content pre {
margin: 0.5em 0; /* 减小代码块外边距 */
padding: 0.8em;
background: var(--element-bg);
border-radius: 12px;
box-shadow: var(--neumorphic-inset);
}
.markdown-content pre code {
line-height: 1.4; /* 调整代码块行高 */
font-family: ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace;
}
/* 行内代码样式 */
.markdown-content code {
font-size: 0.92em;
padding: 0.2em 0.4em;
margin: 0 0.2em;
border-radius: 6px;
background: var(--element-bg);
color: var(--accent-color);
box-shadow: var(--neumorphic-inset);
}
/* 引用块样式 */
.markdown-content blockquote {
margin: 0.5em 0; /* 减小引用块外边距 */
padding: 0.3em 0.8em;
border-left: 3px solid var(--accent-color);
background: var(--element-bg);
border-radius: 8px;
box-shadow: var(--neumorphic-inset);
}
/* 表格样式 */
.markdown-content table {
margin: 0.5em 0; /* 减小表格外边距 */
border-collapse: separate;
border-spacing: 0;
width: 100%;
background: var(--element-bg);
border-radius: 12px;
box-shadow: var(--neumorphic-shadow);
}
.markdown-content table th,
.markdown-content table td {
padding: 0.4em 0.6em;
border: none;
line-height: 1.4;
}
.markdown-content table th {
font-weight: 600;
background: rgba(74, 140, 255, 0.1);
}
/* 水平线样式 */
.markdown-content hr {
margin: 0.8em 0;
border: none;
height: 1px;
background: linear-gradient(
90deg,
transparent,
var(--shadow-dark),
transparent
);
}
/* 相邻元素间距优化 */
.markdown-content * + p {
margin-top: 0.3em; /* 减小段落前的间距 */
}
.markdown-content p + pre,
.markdown-content pre + p {
margin-top: 0.5em; /* 调整代码块与文本之间的间距 */
}
/* 修改移动端输入框样式 */
@media (max-width: 768px) {
/* 主内容区域布局 */
.main-content {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
display: flex;
flex-direction: column;
height: 100%;
}
/* 固定顶部导航栏 */
.mobile-header {
position: fixed;
top: 0;
left: 0;
right: 0;
z-index: 1000;
background: #ffffff;
height: 56px;
padding: 0 15px;
display: flex;
align-items: center;
justify-content: space-between;
border-bottom: 1px solid #e5e7eb;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}
/* 消息列表区域 */
.message-list {
flex: 1;
overflow-y: auto;
margin-top: 56px; /* 为顶部导航栏留出空间 */
margin-bottom: 64px; /* 为底部输入框留出空间 */
padding: 20px;
-webkit-overflow-scrolling: touch;
overscroll-behavior: contain;
}
/* 固定底部输入框 */
.input-footer {
position: fixed;
bottom: 0;
left: 0;
right: 0;
background: #ffffff;
padding: 10px;
border-top: 1px solid #e5e7eb;
z-index: 1000;
box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}
/* 处理 iOS 安全区域 */
@supports (padding-top: env(safe-area-inset-top)) {
.mobile-header {
padding-top: env(safe-area-inset-top);
height: calc(56px + env(safe-area-inset-top));
}
.message-list {
margin-top: calc(56px + env(safe-area-inset-top));
padding-bottom: calc(64px + env(safe-area-inset-bottom));
}
.input-footer {
padding-bottom: calc(10px + env(safe-area-inset-bottom));
}
}
/* 输入框样式优化 */
.el-textarea__inner {
min-height: 44px !important;
line-height: 1.5;
font-size: 16px !important;
padding: 10px 12px;
background: #ffffff !important;
border: 1px solid #e5e7eb !important;
color: #1f2937 !important;
border-radius: 12px !important;
transition: all 0.3s ease;
}
.el-textarea__inner:focus {
border-color: #4096ff !important;
box-shadow: 0 0 0 2px rgba(64, 150, 255, 0.2) !important;
}
/* 发送按钮优化 */
.input-footer .el-button {
height: 44px !important;
padding: 0 15px;
font-size: 16px;
}
}
/* 针对不同屏幕尺寸优化输入框宽度 */
@media (min-width: 768px) {
.input-footer {
max-width: 1200px;
}
}
/* 菜单按钮优化 */
.menu-button {
width: 40px;
height: 40px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 8px;
transition: background-color 0.2s;
}
.menu-button:active {
background-color: rgba(255, 255, 255, 0.1);
}
.menu-button .el-icon {
font-size: 24px;
}
/* 侧边栏优化 */
@media (max-width: 768px) {
.sidebar {
width: 280px;
box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
transform: translateX(-100%);
}
.sidebar.show {
transform: translateX(0);
}
/* 侧边栏动画优化 */
.sidebar-overlay {
transition: opacity 0.3s ease;
opacity: 0;
pointer-events: none;
}
.sidebar-overlay.show {
opacity: 1;
pointer-events: auto;
}
}
/* 消息气泡优化 */
@media (max-width: 768px) {
.message-bubble {
max-width: 88%;
padding: 12px 14px;
margin: 8px 0;
}
.user-message {
margin-left: auto;
margin-right: 8px;
}
.assistant-message {
margin-left: 8px;
margin-right: auto;
}
}
/* 设置抽屉优化 */
@media (max-width: 768px) {
.el-drawer {
width: 100% !important;
}
.settings-drawer {
padding: 16px;
}
}
/* 软键盘弹出时的处理 */
@media (max-width: 768px) {
.app-container {
height: 100%;
min-height: 100vh;
}
.chat-container {
height: 100%;
min-height: 100vh;
}
/* 防止iOS橡皮筋效果 */
.message-list {
-webkit-overflow-scrolling: touch;
overscroll-behavior: contain;
}
}
/* 滚动条美化 */
::-webkit-scrollbar {
width: 6px;
height: 6px;
}
::-webkit-scrollbar-track {
background: #0f172a;
}
::-webkit-scrollbar-thumb {
background: #334155;
border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
background: #475569;
}
/* 修改新对话按钮的样式 */
.sidebar-header .el-button {
background: #4096ff;
border-color: #4096ff;
color: #ffffff;
font-weight: 500;
}
.sidebar-header .el-button:hover {
background: #1677ff;
border-color: #1677ff;
}
/* 修改设置按钮颜色 */
.mobile-header .el-button {
color: #1f2937 !important; /* 改为深色 */
}
/* 调整消息操作按钮位置 */
.message-actions {
position: absolute;
top: 8px;
right: 8px;
display: flex;
gap: 4px;
opacity: 0;
transition: opacity 0.2s;
z-index: 2; /* 确保在最上层 */
}
.message-bubble:hover .message-actions {
opacity: 1;
}
.copy-button {
padding: 4px !important;
color: #4b5563 !important;
background: rgba(255, 255, 255, 0.9) !important;
border-radius: 4px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.copy-button:hover {
background: #ffffff !important;
color: #4096ff !important;
}
.header-actions {
display: flex;
gap: 8px;
}
.header-actions .el-button {
color: #1f2937 !important;
}
</style>
</head>
<body>
<div id="app">
<div class="app-container">
<!-- 侧边栏 -->
<div class="sidebar" :class="{ show: showSidebar }">
<div class="sidebar-header">
<el-button type="primary" style="width: 100%" @click="createNewChat">
<el-icon><Plus /></el-icon> 新对话
</el-button>
</div>
<div class="chat-list">
<div v-for="chat in chatHistory"
:key="chat.id"
class="chat-item"
:class="{ active: currentChatId === chat.id }"
@click="switchChat(chat.id)">
<el-icon><ChatRound /></el-icon>
<span class="chat-item-title">{{ chat.title || '新对话' }}</span>
<el-button
v-if="currentChatId === chat.id"
type="text"
@click.stop="deleteChat(chat.id)">
<el-icon><Delete /></el-icon>
</el-button>
</div>
</div>
</div>
<!-- 移动端遮罩 -->
<div class="sidebar-overlay"
:class="{ show: showSidebar }"
@click="showSidebar = false">
</div>
<!-- 主内容区 -->
<div class="main-content">
<div class="mobile-header">
<button class="menu-button" @click="showSidebar = true">
<el-icon><Expand /></el-icon>
</button>
<div style="display: flex; align-items: center; gap: 8px;">
<img src="logo.svg" alt="Logo" style="width: 24px; height: 24px;">
<h2>DeepSeek伴侣</h2>
</div>
<div class="header-actions">
<el-button type="text" @click="exportToPDF" :disabled="!currentChat?.messages?.length">
<el-icon><Download /></el-icon>
</el-button>
<el-button type="text" @click="showSettings = true">
<el-icon><Setting /></el-icon>
</el-button>
</div>
</div>
<el-main class="message-list">
<template v-if="!apiKey">
<div style="text-align: center; padding: 20px;">
<el-alert
type="info"
:closable="false"
show-icon>
<template #title>
<div style="font-size: 16px; margin-bottom: 8px; color: #1f2937;">
请先设置API Key
</div>
</template>
<template #default>
<div style="color: #4b5563; line-height: 1.6;">
请前往
<a
href='https://cloud.siliconflow.cn/i/FuAPK085'
target='_blank'
style="color: #4096ff; text-decoration: none;"
onmouseover="this.style.textDecoration='underline'"
onmouseout="this.style.textDecoration='none'"
>
硅基流动
</a>