forked from lioensky/VCPChat
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.html
More file actions
executable file
·1947 lines (1853 loc) · 140 KB
/
main.html
File metadata and controls
executable file
·1947 lines (1853 loc) · 140 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">
<meta http-equiv="Content-Security-Policy" content="default-src 'self' data:;
script-src 'self' 'unsafe-inline';
style-src 'self' 'unsafe-inline' https:;
img-src * data: file: blob:;
media-src * data: file:;
font-src *;
connect-src * ws: wss:;">
<title>VCPChat</title>
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="Flowlockmodules/flowlock.css">
<link rel="stylesheet" href="Promptmodules/prompt-modules.css">
<link rel="stylesheet" href="vendor/katex.min.css" crossorigin="anonymous">
<script defer src="vendor/katex.min.js" crossorigin="anonymous"></script>
<script defer src="vendor/auto-render.min.js" crossorigin="anonymous"></script>
<script src="vendor/marked.min.js"></script> <!-- 添加 marked.js -->
<script src="vendor/highlight.min.js"></script>
<script src="vendor/anime.min.js"></script>
<script src="vendor/mermaid.min.js"></script>
<script src="vendor/three.min.js"></script> <!-- 全局引入 three.js -->
<script src="vendor/morphdom.min.js"></script>
</head>
<body>
<div class="seam-fixer" id="title-bar-seam-fixer"></div>
<div class="title-bar">
<div class="title-bar-text"><img src="assets/icon.png" alt="Logo" class="title-bar-logo"> VCPChat</div>
<div class="title-bar-controls">
<button id="themes-btn" class="title-bar-button" title="主题商店"
onclick="(window.chatAPI || window.electronAPI)?.openThemesWindow?.()">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16"
style="width: 12px; height: 12px;">
<path
d="M15.825.12a.5.5 0 0 1 .132.584c-1.53 3.43-4.743 8.17-7.095 10.64a6.067 6.067 0 0 1-2.373 1.534c-.018.227-.06.538-.16.868-.201.659-.667 1.479-1.708 1.74a8.118 8.118 0 0 1-3.078.132 3.659 3.659 0 0 1-.562-.135 1.382 1.382 0 0 1-.466-.247.714.714 0 0 1-.204-.288.622.622 0 0 1 .004-.443c.095-.245.316-.38.461-.452.394-.197.625-.453.867-.826.095-.144.184-.297.287-.472l.117-.198c.151-.255.326-.5.527-.734.206-.236.438-.46.693-.659.26-.2.548-.37.848-.487.306-.12.624-.19.958-.21a3.36 3.36 0 0 1 .82.025c.28.04.554.12.81.24.26.12.5.28.7.49.2.21.36.46.48.74.12.28.2.6.22.94.02.34-.02.69-.1.99-.08.3-.2.59-.35.86-.15.27-.35.52-.58.75-.23.23-.5.43-.78.58-.28.15-.59.26-.92.32-.33.06-.67.06-1.01-.02a4.007 4.007 0 0 1-1.12-.328.5.5 0 0 1-.28-.88c.24-.17.54-.38.87-.58.33-.19.68-.42 1.05-.68.37-.26.76-.55 1.18-.86.42-.3.87-.62 1.34-.94.47-.32.96-.64 1.48-.96.52-.32 1.05-.63 1.6-.92.55-.29 1.1-.56 1.65-.8.55-.24 1.1-.47 1.6-.68.5-.2.95-.38 1.36-.51a.5.5 0 0 1 .585.132z" />
</svg>
</button>
<button id="minimize-to-tray-btn" class="title-bar-button" title="最小化到托盘">
<svg viewBox="0 0 10 10">
<polygon points="5,8 0,2 10,2"></polygon>
</svg>
</button>
<button id="minimize-btn" class="title-bar-button" title="最小化">
<svg x="0px" y="0px" viewBox="0 0 10.2 1">
<rect x="0" y="0" width="10.2" height="1"></rect>
</svg>
</button>
<button id="maximize-btn" class="title-bar-button" title="最大化">
<svg viewBox="0 0 10 10">
<path d="M0,0v10h10V0H0z M9,9H1V1h8V9z"></path>
</svg>
</button>
<button id="restore-btn" class="title-bar-button" title="还原" style="display: none;">
<svg viewBox="0 0 10.2 10.1">
<path d="M2.1,0v2H0v8.1h8.2v-2h2V0H2.1z M7.2,9.2H1.1V3h6.1V9.2z M9.2,7.1h-1V2H3.1V1h6.1V7.1z">
</path>
</svg>
</button>
<button id="close-btn" class="title-bar-button close-button" title="关闭">
<svg viewBox="0 0 10 10">
<polygon
points="10,1.01 8.99,0 5,3.99 1.01,0 0,1.01 3.99,5 0,8.99 1.01,10 5,6.01 8.99,10 10,8.99 6.01,5">
</polygon>
</svg>
</button>
</div>
</div>
<div class="container">
<aside class="sidebar active">
<div class="sidebar-tabs" role="tablist" aria-label="Sidebar sections">
<button class="sidebar-tab-button active" data-tab="agents">助手</button>
<button class="sidebar-tab-button" data-tab="topics">话题</button>
<button class="sidebar-tab-button" data-tab="settings">设置</button>
</div>
<div class="sidebar-tab-content active" id="tabContentAgents" role="tabpanel" aria-hidden="false">
<div class="agents-header">
<div class="sidebar-subtab-item sidebar-search-subtab">
<div class="topic-search-container">
<span class="agent-search-icon" aria-hidden="true">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"
fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"
stroke-linejoin="round">
<circle cx="11" cy="11" r="7"></circle>
<path d="m20 20-3.5-3.5"></path>
</svg>
</span>
<input type="text" id="agentSearchInput" placeholder="搜索助手或群..." class="topic-search-input">
</div>
</div>
</div>
<div class="sidebar-list-scroll">
<ul class="agent-list" id="agentList">
<!-- 示例:
<li class="active" data-agent-id="xiaoke">
<img src="path/to/xiaoke_avatar.png" alt="小克头像" class="avatar">
<span class="agent-name">猫娘小克</span>
</li>
-->
</ul>
</div>
<div class="sidebar-actions">
<button id="createNewAgentBtn" class="sidebar-button create-agent-btn small-button">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"
stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
aria-hidden="true">
<path d="M2 21a8 8 0 0 1 13.292-6"></path>
<circle cx="10" cy="8" r="5"></circle>
<path d="M19 16v6"></path>
<path d="M22 19h-6"></path>
</svg>
<span class="sidebar-button-label">
<span class="sidebar-button-prefix">创建</span>
<span class="sidebar-button-keyword">Agent</span>
</span>
</button>
<button id="createNewGroupBtn" class="sidebar-button create-group-btn small-button">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"
stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
aria-hidden="true">
<path d="M18 21a8 8 0 0 0-16 0"></path>
<circle cx="10" cy="8" r="5"></circle>
<path d="M22 20c0-3.37-2-6.5-4-8a5 5 0 0 0-.45-8.3"></path>
</svg>
<span class="sidebar-button-label">
<span class="sidebar-button-prefix">创建</span>
<span class="sidebar-button-keyword">Group</span>
</span>
</button>
</div>
</div>
<div class="sidebar-tab-content" id="tabContentTopics" role="tabpanel" aria-hidden="true">
<!-- 话题内容区 -->
<div class="topics-header-container">
<div class="sidebar-subtab-item sidebar-search-subtab">
<div class="topic-search-container">
<span class="agent-search-icon" aria-hidden="true">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"
fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"
stroke-linejoin="round">
<circle cx="11" cy="11" r="7"></circle>
<path d="m20 20-3.5-3.5"></path>
</svg>
</span>
<input type="text" id="topicSearchInput" placeholder="搜索话题..." class="topic-search-input">
</div>
</div>
</div>
<div class="sidebar-list-scroll">
<ul class="topic-list" id="topicList">
<!-- 话题列表将在这里动态加载 -->
</ul>
</div>
</div>
<div class="sidebar-tab-content" id="tabContentSettings" role="tabpanel" aria-hidden="true">
<!-- 设置内容区 -->
<div class="settings-header-bar">
<h2>设置</h2>
<button id="globalSettingsBtn" class="sidebar-button global-settings-btn">全局设置</button>
</div>
<div id="agentSettingsContainer" style="display: none;"> <!-- Initially hidden -->
<h3 id="agentSettingsContainerTitle">助手设置: <span id="selectedAgentNameForSettings"></span></h3>
<form id="agentSettingsForm">
<input type="hidden" id="editingAgentId" name="agentId">
<!-- Agent名称和头像容器 -->
<div class="agent-settings-collapsible-container agent-settings-section collapsed" data-section-key="identity">
<div class="agent-settings-section-header" id="identityToggleHeader">
<span class="agent-settings-section-title">基础信息</span>
<div class="agent-settings-section-summary" id="identitySummary"></div>
<button type="button" class="agent-settings-toggle-btn" id="identityToggleBtn" aria-label="展开或收起基础信息">
<svg class="toggle-icon" width="16" height="16" viewBox="0 0 24 24" fill="none"
stroke="currentColor" stroke-width="2">
<polyline points="6 9 12 15 18 9"></polyline>
</svg>
</button>
</div>
<div class="agent-settings-section-content" id="identityContent">
<div class="agent-identity-container">
<div class="agent-identity-main">
<div class="agent-avatar-wrapper">
<img id="agentAvatarPreview" src="assets/default_avatar.png" alt="头像预览"
class="agent-avatar-display" style="display: block;">
<label for="agentAvatarInput" class="avatar-upload-overlay">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none"
stroke="currentColor" stroke-width="2">
<path
d="M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z">
</path>
<circle cx="12" cy="13" r="4"></circle>
</svg>
</label>
<input type="file" id="agentAvatarInput" name="avatar"
accept="image/png, image/jpeg, image/gif" style="display: none;">
</div>
<div class="agent-name-wrapper">
<label for="agentNameInput">Agent 名称</label>
<input type="text" id="agentNameInput" name="name" required>
</div>
</div>
<!-- 自定义样式设置 - 可折叠 -->
<div class="agent-style-collapsible-container collapsed">
<div class="style-collapse-header" id="styleCollapseHeader">
<span class="style-collapse-icon">▶</span>
<span class="style-collapse-title">自定义样式设置</span>
</div>
<div class="agent-style-controls">
<!-- 禁用自定义颜色开关 -->
<div class="style-control-item full-width">
<div class="form-group-inline"
style="justify-content: space-between; align-items: center; margin-bottom: 10px;">
<label for="disableCustomColors"
style="margin-bottom: 0;">助手页面中使用主题默认颜色</label>
<label class="switch" style="margin-bottom: 0;">
<input type="checkbox" id="disableCustomColors"
name="disableCustomColors">
<span class="slider round"></span>
</label>
</div>
</div>
<!-- 会话中使用主题颜色开关 -->
<div class="style-control-item full-width">
<div class="form-group-inline"
style="justify-content: space-between; align-items: center; margin-bottom: 10px;">
<label for="useThemeColorsInChat"
style="margin-bottom: 0;">会话界面中使用主题默认颜色</label>
<label class="switch" style="margin-bottom: 0;">
<input type="checkbox" id="useThemeColorsInChat"
name="useThemeColorsInChat">
<span class="slider round"></span>
</label>
</div>
</div>
<div class="style-control-item">
<label for="agentAvatarBorderColor">头像外框颜色:</label>
<div class="color-input-group">
<input type="color" id="agentAvatarBorderColor" name="avatarBorderColor"
value="#3d5a80">
<input type="text" id="agentAvatarBorderColorText" placeholder="#3d5a80"
maxlength="7">
</div>
</div>
<div class="style-control-item">
<label for="agentNameTextColor">名称文字颜色:</label>
<div class="color-input-group">
<input type="color" id="agentNameTextColor" name="nameTextColor"
value="#ffffff">
<input type="text" id="agentNameTextColorText" placeholder="#ffffff"
maxlength="7">
</div>
</div>
<!-- 重置颜色按钮 -->
<div class="style-control-item full-width">
<button type="button" id="resetAvatarColorsBtn" class="reset-colors-btn">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none"
stroke="currentColor" stroke-width="2">
<path d="M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8"></path>
<path d="M21 3v5h-5"></path>
<path d="M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16"></path>
<path d="M3 21v-5h5"></path>
</svg>
重置为头像默认颜色
</button>
</div>
<div class="style-control-item full-width">
<label for="agentCustomCss">列表项自定义CSS:</label>
<textarea id="agentCustomCss" name="customCss"
placeholder="例如: border-radius: 10px; box-shadow: 0 2px 8px rgba(0,0,0,0.2);"
rows="3"></textarea>
<small
style="color: var(--text-secondary); font-size: 0.85em;">提示:此CSS将应用于【助手】页面的Agent列表项容器</small>
</div>
<div class="style-control-item full-width">
<label for="agentCardCss">名片样式CSS:</label>
<textarea id="agentCardCss" name="cardCss"
placeholder="例如: border-radius: 15px; background: linear-gradient(135deg, rgba(138, 43, 226, 0.1), rgba(75, 0, 130, 0.05));"
rows="3"></textarea>
<small
style="color: var(--text-secondary); font-size: 0.85em;">提示:此CSS将应用于【设置】页面中Agent的名片区域(头像和名称)</small>
</div>
<div class="style-control-item full-width">
<label for="agentChatCss">会话样式CSS:</label>
<textarea id="agentChatCss" name="chatCss"
placeholder="例如: .message-avatar { filter: drop-shadow(0 0 10px rgba(100,150,255,0.8)); } .sender-name { text-shadow: 0 0 8px currentColor; }"
rows="4"></textarea>
<small
style="color: var(--text-secondary); font-size: 0.85em;">提示:此CSS将应用于【聊天会话】中Agent的头像和名称。可使用
.message-avatar 控制头像,.sender-name 控制名称</small>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="agent-settings-collapsible-container agent-settings-section collapsed" data-section-key="prompt">
<div class="agent-settings-section-header" id="promptToggleHeader">
<span class="agent-settings-section-title">系统提示词</span>
<div class="agent-settings-section-summary" id="promptSummary"></div>
<button type="button" class="agent-settings-toggle-btn" id="promptToggleBtn" aria-label="展开或收起系统提示词">
<svg class="toggle-icon" width="16" height="16" viewBox="0 0 24 24" fill="none"
stroke="currentColor" stroke-width="2">
<polyline points="6 9 12 15 18 9"></polyline>
</svg>
</button>
</div>
<div class="agent-settings-section-content" id="promptContent">
<div class="agent-settings-card-shell agent-settings-prompt-shell">
<div class="prompt-section-note">三个模块独立编辑后,注意保存以生效</div>
<div id="systemPromptContainer" class="system-prompt-container">
<!-- Promptmodules will be initialized here -->
</div>
</div>
</div>
</div>
<div class="agent-settings-collapsible-container agent-settings-section collapsed" data-section-key="model">
<div class="agent-settings-section-header" id="modelToggleHeader">
<span class="agent-settings-section-title">模型设置</span>
<div class="agent-settings-section-summary" id="modelSummary"></div>
<button type="button" class="agent-settings-toggle-btn" id="modelToggleBtn" aria-label="展开或收起模型设置">
<svg class="toggle-icon" width="16" height="16" viewBox="0 0 24 24" fill="none"
stroke="currentColor" stroke-width="2">
<polyline points="6 9 12 15 18 9"></polyline>
</svg>
</button>
</div>
<div class="agent-settings-section-content" id="modelContent">
<div class="agent-settings-card-shell agent-settings-model-shell">
<div class="model-input-container">
<input type="text" id="agentModel" name="model"
placeholder="例如 gemini-2.5-flash-preview-05-20">
<button type="button" id="openModelSelectBtn" class="small-button" title="选择模型">
<svg data-slot="icon" fill="none" stroke-width="2" stroke="currentColor"
viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" aria-hidden="true"
width="14" height="14">
<path stroke-linecap="round" stroke-linejoin="round"
d="M19.5 8.25l-7.5 7.5-7.5-7.5"></path>
</svg>
</button>
</div>
</div>
</div>
</div>
<!-- 参数设置可折叠容器 -->
<div class="agent-settings-collapsible-container agent-params-collapsible-container agent-settings-section collapsed" data-section-key="params">
<div class="agent-settings-section-header params-header" id="paramsToggleHeader">
<span class="agent-settings-section-title params-title">模型参数配置</span>
<div class="agent-settings-section-summary params-summary" id="paramsSummary"></div>
<button type="button" class="agent-settings-toggle-btn params-toggle-btn" id="paramsToggleBtn"
aria-label="展开/折叠参数">
<svg class="toggle-icon" width="16" height="16" viewBox="0 0 24 24" fill="none"
stroke="currentColor" stroke-width="2">
<polyline points="6 9 12 15 18 9"></polyline>
</svg>
</button>
</div>
<div class="agent-settings-section-content params-content" id="paramsContent">
<div>
<label for="agentTemperature">Temperature (0-2):</label>
<input type="number" id="agentTemperature" name="temperature" min="0" max="2"
step="0.1">
</div>
<div>
<label for="agentContextTokenLimit">上下文Token上限:</label>
<input type="number" id="agentContextTokenLimit" name="contextTokenLimit" min="0"
step="100">
</div>
<div>
<label for="agentMaxOutputTokens">最大输出Token上限:</label>
<input type="number" id="agentMaxOutputTokens" name="maxOutputTokens" min="0"
step="50">
</div>
<div>
<label for="agentTopP">Top P (0-2):</label>
<input type="number" id="agentTopP" name="top_p" min="0" max="2" step="0.05">
</div>
<div>
<label for="agentTopK">Top K (0-64):</label>
<input type="number" id="agentTopK" name="top_k" min="0" max="64" step="1">
</div>
<div class="form-group-inline">
<label>输出模式:</label>
<label for="agentStreamOutputTrue" style="margin-left: 10px;">
<input type="radio" id="agentStreamOutputTrue" name="streamOutput" value="true"
checked> 流
</label>
<label for="agentStreamOutputFalse" style="margin-left: 15px;">
<input type="radio" id="agentStreamOutputFalse" name="streamOutput"
value="false"> 非流
</label>
</div>
</div>
</div>
<!-- 语音设置可折叠容器 -->
<div class="agent-settings-collapsible-container agent-params-collapsible-container agent-settings-section collapsed" data-section-key="tts">
<div class="agent-settings-section-header params-header" id="ttsToggleHeader">
<span class="agent-settings-section-title params-title">语音设置 (Sovits TTS)</span>
<div class="agent-settings-section-summary params-summary" id="ttsSummary"></div>
<button type="button" class="agent-settings-toggle-btn params-toggle-btn" id="ttsToggleBtn"
aria-label="展开/折叠语音设置">
<svg class="toggle-icon" width="16" height="16" viewBox="0 0 24 24" fill="none"
stroke="currentColor" stroke-width="2">
<polyline points="6 9 12 15 18 9"></polyline>
</svg>
</button>
</div>
<div class="agent-settings-section-content params-content" id="ttsContent">
<div>
<label for="agentTtsVoicePrimary">主语言模型:</label>
<div class="model-input-container">
<select id="agentTtsVoicePrimary" name="ttsVoicePrimary">
<option value="">不使用语音</option>
</select>
<button type="button" id="refreshTtsModelsBtn" class="small-button"
title="刷新模型列表">
<svg data-slot="icon" fill="none" stroke-width="2" stroke="currentColor"
viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"
aria-hidden="true" width="16" height="16">
<path stroke-linecap="round" stroke-linejoin="round" d="M21 5H3"></path>
<path stroke-linecap="round" stroke-linejoin="round" d="M7 12H3"></path>
<path stroke-linecap="round" stroke-linejoin="round" d="M7 19H3"></path>
<path stroke-linecap="round" stroke-linejoin="round"
d="M12 18a5 5 0 0 0 9-3 4.5 4.5 0 0 0-4.5-4.5c-1.33 0-2.54.54-3.41 1.41L11 14">
</path>
<path stroke-linecap="round" stroke-linejoin="round" d="M11 10v4h4"></path>
</svg>
</button>
</div>
</div>
<div>
<label for="agentTtsRegexPrimary">主语言正则 (留空则匹配全部):</label>
<input type="text" id="agentTtsRegexPrimary" name="ttsRegexPrimary"
placeholder="例如 [^\[\]]+">
</div>
<div>
<label for="agentTtsVoiceSecondary">副语言模型:</label>
<div class="model-input-container">
<select id="agentTtsVoiceSecondary" name="ttsVoiceSecondary">
<option value="">不使用</option>
</select>
</div>
</div>
<div>
<label for="agentTtsRegexSecondary">副语言正则:</label>
<input type="text" id="agentTtsRegexSecondary" name="ttsRegexSecondary"
placeholder="例如 \[(.*?)\]">
</div>
<div>
<label for="agentTtsSpeed">语速:</label>
<div class="slider-container">
<input type="range" id="agentTtsSpeed" name="ttsSpeed" min="0.5" max="2.0"
step="0.1" value="1.0">
<span id="ttsSpeedValue">1.0</span>
</div>
</div>
</div>
</div>
<div class="form-actions">
<button type="submit">保存Agent设置</button>
<div class="delete-button-container">
<button type="button" id="deleteAgentBtn" class="danger-button">删除此Agent</button>
</div>
</div>
</form>
</div>
<p id="selectAgentPromptForSettings" style="display: block;">请先在“助手”标签页选择一个Agent以查看或修改其设置。</p>
</div>
</aside>
<div class="resizer" id="resizerLeft"></div>
<main class="main-content">
<header class="chat-header">
<h3 id="currentChatAgentName">选择一个Agent开始聊天</h3>
<div class="chat-actions">
<button id="toggleAssistantBtn" class="header-button" title="左键划词助手/右键折叠侧栏">
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none"
stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
aria-hidden="true">
<path d="M12 20h-1a2 2 0 0 1-2-2 2 2 0 0 1-2 2H6"></path>
<path d="M13 8h7a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2h-7"></path>
<path d="M5 16H4a2 2 0 0 1-2-2v-4a2 2 0 0 1 2-2h1"></path>
<path d="M6 4h1a2 2 0 0 1 2 2 2 2 0 0 1 2-2h1"></path>
<path d="M9 6v12"></path>
</svg>
</button>
<button id="toggleNotificationsBtn" class="header-button" title="左键启动通知/右键监控面板">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"
stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
aria-hidden="true">
<path d="M10.268 21a2 2 0 0 0 3.464 0"></path>
<path
d="M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326">
</path>
</svg>
</button>
<button id="themeToggleBtn" class="header-button" title="深色/浅色模式">
<svg id="sun-icon" class="theme-icon" xmlns="http://www.w3.org/2000/svg" width="24" height="24"
viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
<circle cx="12" cy="12" r="4"></circle>
<path d="M12 2v2"></path>
<path d="M12 20v2"></path>
<path d="m4.93 4.93 1.41 1.41"></path>
<path d="m17.66 17.66 1.41 1.41"></path>
<path d="M2 12h2"></path>
<path d="M20 12h2"></path>
<path d="m6.34 17.66-1.41 1.41"></path>
<path d="m19.07 4.93-1.41 1.41"></path>
</svg>
<svg id="moon-icon" class="theme-icon" xmlns="http://www.w3.org/2000/svg" width="24" height="24"
viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
<path
d="M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401">
</path>
</svg>
</button>
<button id="currentAgentSettingsBtn" class="header-button" title="当前Agent设置" style="display: none;">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 110 44" width="110" height="44"
aria-hidden="true">
<g transform="translate(1 2) scale(1.62)" stroke="currentColor" stroke-width="2" fill="none"
stroke-linejoin="round" stroke-linecap="round">
<path
d="M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z">
</path>
<path d="M12 8v6"></path>
<path d="M9 11h6"></path>
</g>
<g fill="currentColor" font-family="system-ui, -apple-system, sans-serif" font-size="15"
font-weight="500">
<text x="45" y="17">CREATE</text>
<text x="45" y="33">TOPIC</text>
</g>
</svg>
<span class="button-label">新建聊天话题</span>
</button>
<button id="voiceChatBtn" class="header-button" title="语音聊天"
style="margin-right: 5px; display: none;">
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none"
stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M12 19v3"></path>
<path d="M19 10v2a7 7 0 0 1-14 0v-2"></path>
<rect x="9" y="2" width="6" height="13" rx="3"></rect>
</svg>
</button>
</div>
</header>
<div class="chat-messages-container">
<div class="chat-messages" id="chatMessages">
</div>
</div>
<footer class="chat-input-area">
<div class="chat-input-card">
<div class="attachment-preview-area" id="attachmentPreviewArea"></div>
<textarea id="messageInput" placeholder="输入消息... (Shift+Enter 换行)" rows="1" disabled></textarea>
<div class="chat-input-actions">
<button id="quickNewTopicBtn" title="新建聊天话题" disabled>
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"
fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"
stroke-linejoin="round" aria-hidden="true">
<path
d="M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z">
</path>
<path d="M12 8v6"></path>
<path d="M9 11h6"></path>
</svg>
</button>
<button id="attachFileBtn" title="发送文件" disabled>
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"
fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"
stroke-linejoin="round" class="lucide lucide-paperclip-icon lucide-paperclip"
aria-hidden="true">
<path
d="m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551" />
</svg>
</button>
<button id="emoticonTriggerBtn" title="打开表情包" disabled>
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"
fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"
stroke-linejoin="round" class="lucide lucide-sticker-icon lucide-sticker"
aria-hidden="true">
<path
d="M21 9a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 15 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2z" />
<path d="M15 3v5a1 1 0 0 0 1 1h5" />
<path d="M8 13h.01" />
<path d="M16 13h.01" />
<path d="M10 16s.8 1 2 1c1.3 0 2-1 2-1" />
</svg>
</button>
<button id="sendMessageBtn" title="发送消息 (Ctrl+Enter)" disabled>
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"
fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"
stroke-linejoin="round" aria-hidden="true">
<path d="m5 12 7-7 7 7"></path>
<path d="M12 19V5"></path>
</svg>
</button>
</div>
</div>
</footer>
</main>
<div class="resizer" id="resizerRight"></div>
<aside class="notifications-sidebar" id="notificationsSidebar">
<header class="notifications-header">
<h4 id="notificationTitle" style="display: none;">VCP 通知</h4>
<div class="datetime-container">
<div id="digitalClock" class="digital-clock"></div>
<div id="dateDisplay" class="date-display"></div>
</div>
<div class="notification-header-actions">
<button id="openForumBtn" class="header-button" title="左键VCP论坛/右键VCPMemo中心">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"
stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M16 10a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 14.286V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z"></path>
<path d="M20 9a2 2 0 0 1 2 2v10.286a.71.71 0 0 1-1.212.502l-2.202-2.202A2 2 0 0 0 17.172 19H10a2 2 0 0 1-2-2v-1"></path>
</svg>
</button>
<button id="doNotDisturbBtn" class="header-button" title="过滤模式(左键总开关/右键设置过滤规则)">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"
fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"
stroke-linejoin="round" class="lucide lucide-funnel-plus-icon lucide-funnel-plus"
aria-hidden="true">
<path d="M13.354 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14v6a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341l1.218-1.348"></path>
<path d="M16 6h6"></path>
<path d="M19 3v6"></path>
</svg>
</button>
<button id="clearNotificationsBtn" class="header-button" title="清空通知">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"
fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"
stroke-linejoin="round" class="lucide lucide-trash-icon lucide-trash" aria-hidden="true">
<path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6"></path>
<path d="M3 6h18"></path>
<path d="M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"></path>
</svg>
</button>
</div>
</header>
<div class="notifications-status" id="vcpLogConnectionStatus">
VCPLog: 未连接
</div>
<ul class="notifications-list" id="notificationsList">
</ul>
<div id="inviteAgentButtonsContainer" class="invite-agent-buttons-container"
style="display: none; padding: 10px; border-top: 1px solid var(--border-color); margin-top:10px;">
<!-- 邀请发言按钮将由 JavaScript 动态填充到这里 -->
</div>
<hr class="section-divider">
<div id="vchatAppTray" class="notes-section">
<!-- App tray UI -->
<div id="appTrayPinnedApps" class="app-tray-pinned-apps"></div>
<button id="appTrayMoreBtn" class="app-tray-more-btn" title="更多应用">
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<circle cx="12" cy="12" r="1"></circle>
<circle cx="19" cy="12" r="1"></circle>
<circle cx="5" cy="12" r="1"></circle>
</svg>
</button>
<div id="appTrayDrawer" class="app-tray-drawer">
<div class="app-tray-drawer-header">
<span class="app-tray-drawer-title">全部应用</span>
<div class="app-tray-drawer-actions">
<button id="appTraySettingsBtn" class="app-tray-settings-btn" title="设置托盘显示的按钮">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<circle cx="12" cy="12" r="3"></circle>
<path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"></path>
</svg>
</button>
</div>
</div>
<div id="appTrayDrawerGrid" class="app-tray-drawer-grid"></div>
</div>
</div>
</aside>
</div>
<div id="modal-container"></div>
<template id="globalSettingsModalTemplate">
<div class="modal" id="globalSettingsModal">
<div class="modal-content global-settings-modal-content">
<span class="close-button" onclick="uiHelperFunctions.closeModal('globalSettingsModal')">×</span>
<h2 class="global-settings-title">全局设置</h2>
<div class="global-settings-layout">
<!-- 左侧导航菜单 -->
<nav class="global-settings-nav">
<ul class="settings-nav-list">
<li class="settings-nav-item active" data-section="user-identity">
<svg class="settings-nav-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor"
stroke-width="2">
<path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"></path>
<circle cx="12" cy="7" r="4"></circle>
</svg>
<span>用户身份</span>
</li>
<li class="settings-nav-item" data-section="server-connection">
<svg class="settings-nav-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor"
stroke-width="2">
<rect x="2" y="2" width="20" height="8" rx="2" ry="2"></rect>
<rect x="2" y="14" width="20" height="8" rx="2" ry="2"></rect>
<line x1="6" y1="6" x2="6.01" y2="6"></line>
<line x1="6" y1="18" x2="6.01" y2="18"></line>
</svg>
<span>服务器连接</span>
</li>
<li class="settings-nav-item" data-section="render-settings">
<svg class="settings-nav-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor"
stroke-width="2">
<circle cx="12" cy="12" r="3"></circle>
<path
d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z">
</path>
</svg>
<span>渲染设置</span>
</li>
<li class="settings-nav-item" data-section="selection-assistant">
<svg class="settings-nav-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor"
stroke-width="2">
<path d="M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"></path>
<path d="M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"></path>
</svg>
<span>划词助手</span>
</li>
<li class="settings-nav-item" data-section="voice-settings">
<svg class="settings-nav-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor"
stroke-width="2">
<path d="M12 19v3"></path>
<path d="M19 10v2a7 7 0 0 1-14 0v-2"></path>
<rect x="9" y="2" width="6" height="13" rx="3"></rect>
</svg>
<span>语音设置</span>
</li>
<li class="settings-nav-item" data-section="advanced-features">
<svg class="settings-nav-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor"
stroke-width="2">
<polygon points="12 2 2 7 12 12 22 7 12 2"></polygon>
<polyline points="2 17 12 22 22 17"></polyline>
<polyline points="2 12 12 17 22 12"></polyline>
</svg>
<span>高级功能</span>
</li>
<li class="settings-nav-item" data-section="quick-actions">
<svg class="settings-nav-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor"
stroke-width="2">
<path d="M13 2L3 14h9l-1 8 10-12h-9l1-8z"></path>
</svg>
<span>快捷操作</span>
</li>
</ul>
</nav>
<!-- 右侧内容区域 -->
<div class="global-settings-content">
<form id="globalSettingsForm">
<!-- 用户身份 -->
<div class="settings-section active" id="section-user-identity">
<h3 class="settings-section-title">用户身份</h3>
<div class="agent-identity-container">
<div class="agent-identity-main">
<div class="agent-avatar-wrapper">
<img id="userAvatarPreview" src="assets/default_user_avatar.png"
alt="用户头像预览" class="agent-avatar-display" style="display: block;">
<label for="userAvatarInput" class="avatar-upload-overlay">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none"
stroke="currentColor" stroke-width="2">
<path
d="M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z">
</path>
<circle cx="12" cy="13" r="4"></circle>
</svg>
</label>
<input type="file" id="userAvatarInput" name="userAvatar"
accept="image/png, image/jpeg, image/gif" style="display: none;">
</div>
<div class="agent-name-wrapper">
<label for="userName">用户名:</label>
<input type="text" id="userName" name="userName" placeholder="您的用户名"
required>
</div>
</div>
<!-- 用户自定义样式设置 - 可折叠 -->
<div class="agent-style-collapsible-container collapsed">
<div class="style-collapse-header" id="userStyleCollapseHeader">
<span class="style-collapse-icon">▶</span>
<span class="style-collapse-title">自定义样式设置</span>
</div>
<div class="agent-style-controls">
<div class="style-control-item">
<label for="userAvatarBorderColor">头像外框颜色:</label>
<div class="color-input-group">
<input type="color" id="userAvatarBorderColor"
name="userAvatarBorderColor" value="#3d5a80">
<input type="text" id="userAvatarBorderColorText"
placeholder="#3d5a80" maxlength="7">
</div>
</div>
<div class="style-control-item">
<label for="userNameTextColor">名称文字颜色:</label>
<div class="color-input-group">
<input type="color" id="userNameTextColor" name="userNameTextColor"
value="#ffffff">
<input type="text" id="userNameTextColorText" placeholder="#ffffff"
maxlength="7">
</div>
</div>
<!-- 重置颜色按钮 -->
<div class="style-control-item full-width">
<button type="button" id="resetUserAvatarColorsBtn"
class="reset-colors-btn">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none"
stroke="currentColor" stroke-width="2">
<path d="M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8">
</path>
<path d="M21 3v5h-5"></path>
<path d="M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16">
</path>
<path d="M3 21v-5h5"></path>
</svg>
重置为头像默认颜色
</button>
</div>
</div>
</div>
</div>
<!-- 管理员账号设置 -->
<div class="settings-form-group" style="margin-top: 15px;">
<label for="adminUsername">管理员账号:</label>
<input type="text" id="adminUsername" name="adminUsername" placeholder="论坛管理员账号">
</div>
<div class="settings-form-group">
<label for="adminPassword">管理员密码:</label>
<input type="password" id="adminPassword" name="adminPassword" placeholder="论坛管理员密码">
</div>
</div>
<!-- 服务器连接 -->
<div class="settings-section" id="section-server-connection">
<h3 class="settings-section-title">服务器连接</h3>
<div class="settings-form-group">
<label for="vcpServerUrl">VCP 服务器 URL:</label>
<input type="url" id="vcpServerUrl" name="vcpServerUrl"
placeholder="将自动补全 /v1/chat/completions" required>
</div>
<div class="settings-form-group">
<label for="vcpApiKey">VCP API Key:</label>
<input type="password" id="vcpApiKey" name="vcpApiKey">
</div>
<div class="settings-form-group">
<label for="vcpLogUrl">VCP WebSocket服务器 URL:</label>
<input type="url" id="vcpLogUrl" name="vcpLogUrl">
</div>
<div class="settings-form-group">
<label for="fileKey">VCP文件/图床密码:</label>
<input type="password" id="fileKey" name="fileKey" placeholder="用于拼接表情包图片地址">
<small style="color: var(--text-secondary); margin-top: 5px; display: block;">
用于访问VCP返回的文件/图片地址,将拼接为 [`/pw=密码/images或files/分类/文件名`]。
</small>
</div>
<div class="settings-form-group">
<label for="vcpLogKey">VCP WebSocket鉴权 Key:</label>
<input type="password" id="vcpLogKey" name="vcpLogKey">
</div>
<div class="settings-form-group">
<label>网络笔记路径:</label>
<div id="networkNotesPathsContainer"
style="display: flex; flex-direction: column; gap: 8px;">
<!-- Path inputs will be dynamically added here -->
</div>
<button type="button" id="addNetworkPathBtn" class="sidebar-button small-button"
style="margin-top: 8px; width: auto; padding: 4px 10px;">添加路径</button>
</div>
</div>
<!-- 渲染设置 -->
<div class="settings-section" id="section-render-settings">
<h3 class="settings-section-title">渲染设置</h3>
<div class="settings-subsection">
<div class="settings-subsection-heading">
<div class="settings-subsection-title">基础渲染</div>
<p class="settings-subsection-description">控制气泡主题、流式输出以及基础渲染节奏。</p>
</div>
<div class="form-group-inline"
style="justify-content: space-between; align-items: center; margin-bottom: 15px;">
<label for="enableAgentBubbleTheme">开启Agent自定义气泡主题</label>
<label class="switch">
<input type="checkbox" id="enableAgentBubbleTheme" name="enableAgentBubbleTheme"
checked>
<span class="slider round"></span>
</label>
</div>
<div class="form-group-inline"
style="justify-content: space-between; align-items: center; margin-bottom: 15px;">
<label for="enableSmoothStreaming">开启高级流式渲染</label>
<label class="switch">
<input type="checkbox" id="enableSmoothStreaming" name="enableSmoothStreaming">
<span class="slider round"></span>
</label>
</div>
<div class="settings-inline-number-row">
<div>
<label for="minChunkBufferSize"
style="display: block; margin-bottom: 4px;">最小渲染Chunk字数 (≥1):</label>
<input type="number" id="minChunkBufferSize" name="minChunkBufferSize" min="1"
value="16" style="width: 80px;">
</div>
<div>
<label for="smoothStreamIntervalMs"
style="display: block; margin-bottom: 4px;">最小渲染Chunk间隔 (ms, ≥1):</label>
<input type="number" id="smoothStreamIntervalMs" name="smoothStreamIntervalMs"
min="1" value="100" style="width: 80px;">
</div>
</div>
<div class="settings-form-group" id="chatFontSettingsGroup" style="margin-top: 18px;">
<label for="chatFontPreset">聊天字体</label>
<select id="chatFontPreset" name="chatFontPreset">
<option value="system">系统默认</option>
<option value="segoe">Segoe UI</option>
<option value="ubuntu">Ubuntu</option>
<option value="yahei">Microsoft YaHei</option>
<option value="pingfang">PingFang SC</option>
<option value="source-han">Source Han Sans SC</option>
<option value="serif">衬线体</option>
<option value="custom">自定义</option>
</select>
<div id="chatFontCustomRow" style="display: none; margin-top: 8px;">
<input type="text" id="chatFontCustom" name="chatFontCustom"
placeholder='例如: "LXGW WenKai", "Microsoft YaHei", sans-serif'>
<small style="color: var(--text-secondary); margin-top: 5px; display: block;">
支持输入完整的 CSS `font-family` 值,保存后会立即应用到聊天正文。
</small>
</div>
</div>
<div class="settings-form-group" id="chatCodeFontSettingsGroup" style="margin-top: 15px;">
<label for="chatCodeFontPreset">代码字体</label>
<select id="chatCodeFontPreset" name="chatCodeFontPreset">
<option value="cascadia">Cascadia Code</option>
<option value="fira">Fira Code</option>
<option value="consolas">Consolas</option>
<option value="system">系统默认</option>
<option value="jetbrains">JetBrains Mono</option>
<option value="monaspace">Monaspace</option>
<option value="custom">自定义</option>
</select>
<div id="chatCodeFontCustomRow" style="display: none; margin-top: 8px;">
<input type="text" id="chatCodeFontCustom" name="chatCodeFontCustom"
placeholder='例如: "Maple Mono", "JetBrains Mono", monospace'>
<small style="color: var(--text-secondary); margin-top: 5px; display: block;">
会应用到聊天代码块、行内代码,以及工具/思维链中的代码样式。
</small>
</div>
</div>
<div class="settings-form-group" style="margin-top: 18px;">
<label>场景预览</label>
<div class="scenario-preview-grid" id="fontScenarioPreviewGrid">
<div class="scenario-preview-card">
<div class="scenario-preview-title">聊天正文</div>
<div class="scenario-preview-body" id="scenarioPreviewBody">
这是普通聊天正文的显示效果,适合长段阅读与自然对话。
</div>
</div>
<div class="scenario-preview-card scenario-preview-card-code">
<div class="scenario-preview-title">代码块</div>
<pre class="scenario-preview-body scenario-preview-code" id="scenarioPreviewCode">const sum = (a, b) =>
a + b;</pre>
</div>
<div class="scenario-preview-card scenario-preview-card-diary">
<div class="scenario-preview-title">日记 / 文学块</div>
<div class="scenario-preview-body" id="scenarioPreviewDiary">
晚风穿过窗边,纸页轻轻翻动,像一段被放慢的心事。
</div>
<div class="scenario-preview-controls">
<label for="chatDiaryFontPreset">场景字体</label>
<select id="chatDiaryFontPreset" name="chatDiaryFontPreset">
<option value="serif">衬线体</option>
<option value="system">系统默认</option>
<option value="segoe">Segoe UI</option>
<option value="ubuntu">Ubuntu</option>
<option value="yahei">Microsoft YaHei</option>
<option value="pingfang">PingFang SC</option>
<option value="source-han">Source Han Sans SC</option>
<option value="custom">自定义</option>
</select>
<div id="chatDiaryFontCustomRow" style="display: none; margin-top: 8px;">
<input type="text" id="chatDiaryFontCustom" name="chatDiaryFontCustom"
placeholder='例如: "Noto Serif SC", Georgia, serif'>