Repository navigation
Expand file tree
/
Copy pathindex.html
More file actions
905 lines (875 loc) · 57.1 KB
/
Copy pathindex.html
File metadata and controls
905 lines (875 loc) · 57.1 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
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>AI Image Studio</title>
<link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text y='.9em' font-size='90'>🎨</text></svg>">
<script>
(() => {
try {
const storage = window.localStorage;
const token = String(storage.getItem('img-gen-admin-token') || '').trim();
const expiresAt = Number(storage.getItem('img-gen-admin-token-expires-at') || 0);
const legacyToken = String(storage.getItem('img-gen-config-admin-token') || '').trim();
const hasActiveSession = token
? Number.isFinite(expiresAt) && expiresAt > Date.now()
: !!legacyToken;
document.documentElement.dataset.adminSession = hasActiveSession ? 'active' : 'locked';
} catch {
document.documentElement.dataset.adminSession = 'locked';
}
})();
</script>
<link rel="stylesheet" href="style.css">
</head>
<body>
<section id="adminLoginShell" class="admin-gate-shell" aria-labelledby="adminGateTitle">
<!-- Animated background blobs -->
<div class="gate-bg-blobs" aria-hidden="true">
<div class="gate-blob gate-blob-1"></div>
<div class="gate-blob gate-blob-2"></div>
<div class="gate-blob gate-blob-3"></div>
</div>
<div class="admin-gate-card">
<!-- Left gradient accent strip -->
<div class="gate-accent" aria-hidden="true"></div>
<!-- Main content -->
<div class="gate-body">
<!-- Logo & Branding -->
<div class="gate-brand">
<div class="gate-logo-ring" aria-hidden="true">
<div class="gate-logo">🎨</div>
</div>
<h1 id="adminGateTitle">AI Image Studio</h1>
<p class="gate-subtitle">管理员登录</p>
</div>
<!-- Login form -->
<div class="gate-form">
<label class="gate-label" for="adminGateTokenInput">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="11" width="18" height="11" rx="2" ry="2"/><path d="M7 11V7a5 5 0 0 1 10 0v4"/></svg>
管理员鉴权
</label>
<div class="gate-input-wrap">
<input type="password" id="adminGateTokenInput" autocomplete="current-password" placeholder="输入 IMAGE_GEN_ADMIN_TOKEN">
</div>
<button id="adminGateLoginBtn" class="gate-login-btn" type="button">
<span>登录</span>
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><line x1="5" y1="12" x2="19" y2="12"/><polyline points="12 5 19 12 12 19"/></svg>
</button>
<p id="adminGateStatus" class="gate-status" role="status" aria-live="polite">请输入管理员鉴权后进入</p>
</div>
<!-- Footer hint -->
<p class="gate-hint">登录后可使用全部管理功能:设置保存、账号同步、Upstash 配置等</p>
</div>
</div>
</section>
<div id="mainAppShell" class="app-shell hidden">
<div id="app">
<!-- Top Bar -->
<nav class="topbar">
<div class="topbar-left">
<div class="logo">
<div class="logo-icon" aria-hidden="true">🎨</div>
<span>AI Image Studio</span>
</div>
</div>
<div class="topbar-right">
<div class="topbar-actions">
<button class="topbar-btn" id="openSettings" type="button" title="设置" aria-label="打开设置">
<svg aria-hidden="true" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"/><circle cx="12" cy="12" r="3"/></svg>
</button>
<button class="topbar-btn admin-logout-top" id="adminLogoutTopBtn" type="button" title="退出管理员登录" aria-label="退出管理员登录">
<svg aria-hidden="true" width="17" height="17" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"/><polyline points="16 17 21 12 16 7"/><line x1="21" y1="12" x2="9" y2="12"/></svg>
</button>
</div>
<div class="account-switcher" id="accountSwitcher">
<button class="switcher-btn" id="switcherBtn" type="button" aria-haspopup="menu" aria-expanded="false" aria-controls="switcherDropdown">
<span class="switcher-dot" id="switcherDot"></span>
<span class="switcher-name" id="switcherName">未配置账号</span>
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5"><path d="M6 9l6 6 6-6"/></svg>
</button>
<div class="switcher-dropdown hidden" id="switcherDropdown" role="menu" aria-label="账号切换">
<div class="dropdown-list" id="dropdownList"></div>
<div class="dropdown-divider"></div>
<button class="dropdown-item dropdown-manage" id="dropdownManage" type="button" role="menuitem" tabindex="-1">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"/><circle cx="12" cy="12" r="3"/></svg>
管理账号
</button>
</div>
</div>
</div>
</nav>
<!-- Settings Overlay -->
<div id="settingsOverlay" class="overlay hidden" role="dialog" aria-modal="true" aria-labelledby="settingsTitle">
<div class="modal modal-settings settings-center-modal">
<div class="modal-header">
<div>
<h2 id="settingsTitle">设置</h2>
<p class="modal-subtitle">这里只放全局偏好和运维项;账号、OAuth、Upstash 保存位置在“账号管理”里配置。</p>
</div>
<button id="closeSettings" class="close-btn" type="button" aria-label="关闭设置">×</button>
</div>
<div class="modal-body settings-body">
<div class="settings-center-shell">
<nav id="settingsCenterNav" class="settings-center-nav" role="tablist" aria-label="设置导航">
<button id="settingsNavGeneration" class="settings-nav-item active" type="button" role="tab" aria-selected="true" aria-controls="settingsPanelGeneration" data-panel="generation">生成</button>
<button id="settingsNavAppearance" class="settings-nav-item" type="button" role="tab" aria-selected="false" aria-controls="settingsPanelAppearance" data-panel="appearance">外观</button>
<button id="settingsNavStorage" class="settings-nav-item" type="button" role="tab" aria-selected="false" aria-controls="settingsPanelStorage" data-panel="storage">图片存储</button>
<button id="settingsNavDeploy" class="settings-nav-item" type="button" role="tab" aria-selected="false" aria-controls="settingsPanelDeploy" data-panel="deploy">部署</button>
<button id="settingsNavBackup" class="settings-nav-item" type="button" role="tab" aria-selected="false" aria-controls="settingsPanelBackup" data-panel="backup">备份</button>
</nav>
<div class="settings-center-panels">
<section id="settingsPanelGeneration" class="settings-panel active" role="tabpanel" aria-labelledby="settingsNavGeneration">
<div class="settings-panel-head">
<div>
<h3>生成</h3>
<p>这里只保留生成时会直接影响画面的偏好;API Key、OAuth 和账号 API 地址请到“账号管理”里配置。</p>
</div>
</div>
<section class="settings-section">
<h3>
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="3" y="3" width="18" height="18" rx="2"/><circle cx="8.5" cy="8.5" r="1.5"/><path d="M21 15l-5-5L5 21"/></svg>
<span>生成默认值</span>
</h3>
<div class="settings-grid">
<div class="form-group">
<label for="settingsDefaultSize">默认尺寸</label>
<select id="settingsDefaultSize">
<option value="auto">自动</option>
<option value="1024x1024">方形 1:1</option>
<option value="1056x1408">竖版 3:4</option>
<option value="864x1536">故事 9:16</option>
<option value="1408x1056">横屏 4:3</option>
<option value="1536x864">宽屏 16:9</option>
</select>
</div>
<div class="form-group">
<label for="settingsDefaultQuality">默认质量</label>
<select id="settingsDefaultQuality">
<option value="low">低</option>
<option value="medium">中</option>
<option value="high">高</option>
</select>
</div>
<div class="form-group">
<label for="settingsDefaultFormat">默认格式</label>
<select id="settingsDefaultFormat">
<option value="png">PNG</option>
<option value="webp">WebP</option>
<option value="jpeg">JPEG</option>
</select>
</div>
<div class="form-group">
<label for="settingsDefaultBackground">默认背景</label>
<select id="settingsDefaultBackground">
<option value="auto">自动</option>
<option value="opaque">不透明</option>
<option value="transparent">透明</option>
</select>
</div>
<div class="form-group">
<label for="settingsDefaultCount">默认数量</label>
<select id="settingsDefaultCount">
<option value="1">1 张</option>
<option value="2">2 张</option>
<option value="3">3 张</option>
<option value="4">4 张</option>
</select>
</div>
</div>
</section>
<section class="settings-section">
<h3>
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M3 12h18"/><path d="M3 6h18"/><path d="M3 18h18"/></svg>
<span>连接与代理</span>
</h3>
<label class="switch-label compact">
<span>强制代理</span>
<input type="checkbox" id="useProxy">
<span class="switch"></span>
</label>
<small class="section-hint">普通用户无需开启;仅当目标接口在浏览器里 CORS 失败时使用服务端代理。</small>
</section>
</section>
<section id="settingsPanelAppearance" class="settings-panel hidden" role="tabpanel" aria-labelledby="settingsNavAppearance">
<div class="settings-panel-head">
<div>
<h3>增强与外观</h3>
<p>提示词增强和水印只影响生成体验与图片输出,不保存账号密钥。</p>
</div>
</div>
<section class="settings-section">
<h3>
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M12 3l1.8 5.4L19 10.2l-5.2 1.8L12 17l-1.8-5L5 10.2l5.2-1.8L12 3z"/><path d="M5 16l.9 2.6L8.5 19.5l-2.6.9L5 23l-.9-2.6-2.6-.9 2.6-.9L5 16z"/></svg>
<span>提示词增强</span>
</h3>
<label class="switch-label compact">
<span>开启 AI 提示词修饰</span>
<input type="checkbox" id="promptEnhancementEnabled">
<span class="switch"></span>
</label>
<small class="section-hint">默认关闭。开启后可选择手动润色或生成时自动润色;自动模式不会显示输入框润色按钮。</small>
<div id="promptEnhancementOptions" class="prompt-enhancement-options hidden">
<div class="settings-grid">
<div class="form-group">
<label for="promptEnhancementRunMode">修饰词模式</label>
<select id="promptEnhancementRunMode">
<option value="manual">手动:显示润色按钮</option>
<option value="auto">自动:生成前自动修饰</option>
</select>
</div>
<div class="form-group">
<label for="promptEnhancementMode">修饰风格</label>
<select id="promptEnhancementMode">
<option value="balanced">平衡增强</option>
<option value="professional">专业摄影/海报</option>
<option value="faithful">保留原意</option>
</select>
</div>
<div class="form-group wide">
<label for="promptEnhancementModel">优化模型</label>
<input type="text" id="promptEnhancementModel" placeholder="留空则跟随图片模型">
</div>
<div class="form-group">
<label for="promptEnhancementLanguage">输出语言</label>
<select id="promptEnhancementLanguage">
<option value="auto">跟随输入</option>
<option value="zh">中文</option>
<option value="en">英文</option>
</select>
</div>
</div>
</div>
</section>
<section class="settings-section">
<h3>
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"/></svg>
<span>水印设置</span>
</h3>
<label class="switch-label compact">
<span>开启水印</span>
<input type="checkbox" id="watermarkEnabled">
<span class="switch"></span>
</label>
<div class="settings-grid">
<div class="form-group">
<label for="watermarkTemporaryMode">临时开关</label>
<select id="watermarkTemporaryMode">
<option value="default">跟随设置</option>
<option value="on">仅本次开启</option>
<option value="off">仅本次关闭</option>
</select>
</div>
<div class="form-group">
<label for="watermarkMode">水印类型</label>
<select id="watermarkMode">
<option value="custom">自定义文字</option>
<option value="time">当前时间</option>
<option value="camera-time">相机时间</option>
<option value="custom-time">文字 + 时间</option>
</select>
</div>
<div class="form-group wide">
<label for="watermarkText">水印文字</label>
<input type="text" id="watermarkText" maxlength="80" placeholder="AI Image Studio">
</div>
<div class="form-group">
<label for="watermarkTimeFormat">时间格式</label>
<select id="watermarkTimeFormat">
<option value="camera">2026.04.25 11:32</option>
<option value="slash">2026/04/25 11:32</option>
<option value="dash">2026-04-25 11:32</option>
<option value="iso">2026-04-25T11:32</option>
</select>
</div>
<div class="form-group">
<label for="watermarkPosition">位置</label>
<select id="watermarkPosition">
<option value="bottom-right">右下</option>
<option value="bottom-left">左下</option>
<option value="top-right">右上</option>
<option value="top-left">左上</option>
<option value="center">居中</option>
</select>
</div>
<div class="form-group">
<label for="watermarkOpacity">透明度</label>
<input type="range" id="watermarkOpacity" min="0.12" max="1" step="0.04">
</div>
<div class="form-group">
<label for="watermarkFontSize">字号</label>
<input type="range" id="watermarkFontSize" min="12" max="96" step="1">
</div>
<div class="form-group">
<label for="watermarkColor">颜色</label>
<input type="color" id="watermarkColor" value="#ffffff">
</div>
</div>
<div class="settings-inline">
<label><input type="checkbox" id="watermarkShadow" checked> 阴影</label>
<label><input type="checkbox" id="watermarkBackground" checked> 半透明背景条</label>
</div>
<div id="watermarkPreview" class="watermark-preview">
<span class="wm-line">AI Image Studio</span>
<span class="wm-line small">2026.04.25 11:32</span>
</div>
</section>
</section>
<section id="settingsPanelStorage" class="settings-panel hidden" role="tabpanel" aria-labelledby="settingsNavStorage">
<div class="settings-panel-head">
<div>
<h3>图片存储</h3>
<p>只管理图片历史和页面数据清理;账号保存位置请到“账号管理 → 保存位置”。</p>
</div>
</div>
<section class="settings-section">
<h3>
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"/><polyline points="3.27 6.96 12 12.01 20.73 6.96"/><line x1="12" y1="22.08" x2="12" y2="12"/></svg>
<span>图片历史</span>
</h3>
<label class="switch-label compact">
<span>保存生成图片</span>
<input type="checkbox" id="storageEnabled" checked>
<span class="switch"></span>
</label>
<small class="section-hint">图片保存到后端数据目录,刷新页面后仍可在历史记录中看到</small>
<div id="storageStats" class="storage-stats">正在读取存储状态...</div>
<div id="storageDiagnostics" class="storage-diagnostics hidden"></div>
<div class="danger-zone">
<button id="clearConversationData" class="btn btn-outline" type="button">清理页面对话</button>
<button id="clearImageData" class="btn btn-outline danger" type="button">清理服务端图片</button>
<button id="clearAllData" class="btn btn-outline danger" type="button">清理页面和图片</button>
</div>
</section>
</section>
<section id="settingsPanelDeploy" class="settings-panel hidden" role="tabpanel" aria-labelledby="settingsNavDeploy">
<section class="settings-section deployment-sync-section">
<h3>
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M4 4h16v16H4z"/><path d="M9 9h6v6H9z"/></svg>
<span>部署同步</span>
</h3>
<small class="section-hint">保存服务端配置只影响当前运行实例;云平台通常还需要同步环境变量并重新部署。首次配置平台 token 时建议先手动校验,再开启自动同步。</small>
<div class="settings-grid">
<div class="form-group">
<label for="deployPlatform">平台</label>
<select id="deployPlatform">
<option value="node">node / docker</option>
<option value="vercel">vercel</option>
<option value="netlify">netlify</option>
<option value="cloudflare">cloudflare</option>
<option value="edgeone">edgeone</option>
</select>
</div>
<div class="form-group">
<label for="deployAccountId">Account ID</label>
<input type="text" id="deployAccountId" placeholder="可选 / 按平台填写">
</div>
<div class="form-group">
<label for="deployProjectId">Project ID</label>
<input type="text" id="deployProjectId" placeholder="项目 ID / Site ID / Script 名称">
</div>
<div class="form-group wide">
<label for="deployApiToken">平台 API Token</label>
<input type="password" id="deployApiToken" placeholder="仅保存到服务端 config/.env,不会显示到仓库">
</div>
</div>
<div class="settings-inline account-advanced-checks">
<label><input type="checkbox" id="deployAutoSync"> 保存时自动同步云平台环境变量</label>
<label><input type="checkbox" id="deployAutoRedeploy"> 保存时自动触发重新部署</label>
</div>
<div class="danger-zone">
<button id="configPlatformCheck" class="btn btn-outline" type="button">校验平台配置</button>
<button id="configPlatformSync" class="btn btn-outline" type="button">同步环境变量</button>
<button id="configPlatformDeploy" class="btn btn-outline danger" type="button">触发重新部署</button>
</div>
</section>
</section>
<section id="settingsPanelBackup" class="settings-panel hidden" role="tabpanel" aria-labelledby="settingsNavBackup">
<section class="settings-section" id="backupSettingsSection">
<h3>
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M12 3v12"/><path d="M8 11l4 4 4-4"/><path d="M5 21h14"/></svg>
<span>导入 / 导出</span>
</h3>
<small class="section-hint">安全导出不会包含 API key、OAuth token、Cookie、session;完整导出必须先用密码加密。</small>
<div class="settings-grid">
<div class="form-group wide">
<label for="backupPassword">完整加密导出 / 导入密码</label>
<input type="password" id="backupPassword" placeholder="用于加密完整备份;安全导出可留空">
</div>
</div>
<div class="backup-actions">
<button id="exportSafeBackup" class="btn btn-outline" type="button">安全导出</button>
<button id="exportEncryptedBackup" class="btn btn-outline" type="button">完整加密导出</button>
<button id="importBackupPick" class="btn btn-ghost" type="button">选择导入文件</button>
<input id="importBackupFile" type="file" accept="application/json" hidden>
</div>
<div class="settings-inline settings-inline-check-grid">
<label><input type="checkbox" id="importBackupAccounts" checked> 导入账号</label>
<label><input type="checkbox" id="importBackupSettings" checked> 导入设置</label>
<label><input type="checkbox" id="importBackupPromptHistory" checked> 导入提示词历史</label>
</div>
<div id="importBackupPreview" class="backup-preview hidden" aria-live="polite"></div>
<div class="backup-actions">
<button id="confirmImportBackup" class="btn btn-primary" type="button" disabled>确认导入预览内容</button>
</div>
</section>
</section>
</div>
</div>
<div class="modal-footer">
<button id="cancelSettings" class="btn btn-ghost" type="button">取消</button>
<button id="saveSettings" class="btn btn-primary" type="button">保存</button>
</div>
</div>
</div>
</div>
<!-- Account Management Overlay -->
<div id="accountOverlay" class="overlay hidden" role="dialog" aria-modal="true" aria-labelledby="accountManagerTitle">
<div class="modal modal-lg">
<div class="modal-header">
<div>
<h2 id="accountManagerTitle">账号管理</h2>
<p class="modal-subtitle">在这里添加 API Key、登录 ChatGPT,并配置账号保存位置;登录管理员后这些操作默认拥有管理权限。</p>
</div>
<button id="closeAccountManager" class="close-btn" type="button" aria-label="关闭账号管理">×</button>
</div>
<div class="modal-body account-manager-body">
<div class="account-tabs" role="tablist" aria-label="账号管理分类">
<button id="accountTabApi" class="account-tab active" type="button" role="tab" aria-selected="true" aria-controls="accountPanelApi">API Key 账号</button>
<button id="accountTabOauth" class="account-tab" type="button" role="tab" aria-selected="false" aria-controls="accountPanelOauth">ChatGPT 登录</button>
<button id="accountTabAdvanced" class="account-tab" type="button" role="tab" aria-selected="false" aria-controls="accountPanelAdvanced">保存位置</button>
</div>
<section id="accountPanelApi" class="account-panel active" role="tabpanel" aria-labelledby="accountTabApi">
<div class="account-panel-head">
<div>
<h3>API Key 账号</h3>
<p>管理 OpenAI 兼容接口账号,点击账号卡片即可设为当前使用。</p>
</div>
<button id="addManualBtn" class="btn btn-primary" type="button">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><line x1="12" y1="5" x2="12" y2="19"/><line x1="5" y1="12" x2="19" y2="12"/></svg>
添加 API Key
</button>
</div>
<div id="accountList" class="account-list"></div>
</section>
<section id="accountPanelOauth" class="account-panel hidden" role="tabpanel" aria-labelledby="accountTabOauth">
<div class="oauth-account-section">
<div class="account-subhead">已登录 ChatGPT 账号</div>
<div id="oauthAccountList" class="account-list oauth-account-list"></div>
</div>
<div class="oauth-login-card">
<div class="oauth-login-copy">
<div class="oauth-login-kicker">ChatGPT OAuth</div>
<h3>登录 ChatGPT 账号</h3>
<p>登录后会保存到当前浏览器,用于 ChatGPT 后端图片流程。未开始登录时不会显示“等待登录”。</p>
<div class="oauth-login-state"><span class="oauth-state-dot"></span><span id="oauthLoginStateText">未登录</span></div>
</div>
<button id="oauthLoginBtn" class="btn btn-oauth" type="button">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4"/><polyline points="10 17 15 12 10 7"/><line x1="15" y1="12" x2="3" y2="12"/></svg>
登录 ChatGPT
</button>
</div>
<div id="oauthStatus" class="oauth-status hidden">
<span class="spinner"></span>
<span id="oauthStatusText">未登录</span>
</div>
<div id="oauthManual" class="oauth-manual hidden">
<div class="oauth-manual-title">完成 ChatGPT 登录</div>
<div class="oauth-manual-desc">第一步:复制或打开下面的授权链接完成登录。不要依赖弹窗自动跳转,手机浏览器/内置浏览器可能会拦截。</div>
<textarea id="oauthAuthUrl" rows="3" readonly placeholder="授权链接会显示在这里"></textarea>
<div class="oauth-manual-actions">
<button id="oauthOpenBtn" class="btn btn-primary" type="button">打开授权页面</button>
<button id="oauthCopyBtn" class="btn btn-outline" type="button">复制授权链接</button>
</div>
<div class="oauth-manual-desc oauth-manual-step2">第二步:登录完成后,如果页面显示授权码,复制授权码;如果地址栏出现 localhost 回调链接,复制完整地址。然后粘贴到下面。</div>
<textarea id="oauthCallbackInput" rows="3" placeholder="粘贴授权码,或 http://localhost:1455/auth/callback?code=***&state=..."></textarea>
<div class="oauth-manual-actions">
<button id="oauthExchangeBtn" class="btn btn-primary" type="button">完成登录</button>
<button id="oauthCancelBtn" class="btn btn-ghost" type="button">取消</button>
</div>
</div>
</section>
<section id="accountPanelAdvanced" class="account-panel hidden" role="tabpanel" aria-labelledby="accountTabAdvanced">
<div class="advanced-account-section">
<h3>账号保存位置</h3>
<p>Node / Docker 将优先保存到服务端账号存储;云平台配置 Upstash 后保存到远程存储;未配置时继续保存到当前浏览器。</p>
<div class="settings-note-card account-store-card" aria-live="polite">
<strong id="accountStoreType">当前浏览器缓存</strong>
<span id="accountStoreDetail">当前部署未检测到可用的服务端账号存储或 Upstash,API Key 与 OAuth 账号会按旧逻辑保存在此浏览器。</span>
<small id="accountStoreEncrypted" class="section-hint">敏感字段:仅保存在当前浏览器;换设备、无痕模式或清理浏览器数据后需要重新配置。</small>
</div>
<div class="account-migration-actions">
<button id="migrateBrowserAccountsBtn" class="btn btn-outline" type="button">迁移当前浏览器账号到服务端</button>
<span id="accountMigrationStatus" class="section-hint" aria-live="polite">管理员登录并启用服务端账号存储后,可以把当前浏览器账号迁移到服务端。</span>
</div>
<small class="section-hint">迁移不会自动清空浏览器副本;这样即使服务端存储暂时不可用,也能继续沿用旧缓存。</small>
</div>
<section class="settings-section account-store-config-section">
<h3>
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><ellipse cx="12" cy="5" rx="9" ry="3"/><path d="M3 5v14c0 1.66 4.03 3 9 3s9-1.34 9-3V5"/><path d="M3 12c0 1.66 4.03 3 9 3s9-1.34 9-3"/></svg>
<span>账号存储配置</span>
</h3>
<small class="section-hint">云平台不适合依赖本地文件保存账号时,可选择 Upstash。保存后敏感字段不会回显;留空会保留已有配置,未配置完整则自动回退浏览器缓存。</small>
<div class="settings-grid">
<div class="form-group">
<label for="accountStoreTypeSelect">账号保存策略</label>
<select id="accountStoreTypeSelect">
<option value="auto">自动选择</option>
<option value="file">服务端文件</option>
<option value="upstash">Upstash</option>
<option value="browser">仅浏览器缓存</option>
</select>
</div>
<div class="form-group">
<label for="accountStoreNamespace">Namespace</label>
<input type="text" id="accountStoreNamespace" placeholder="image-gen">
</div>
<div class="form-group">
<label for="accountStoreDeploymentId">Deployment ID</label>
<input type="text" id="accountStoreDeploymentId" placeholder="default / 项目名">
</div>
<div class="form-group wide">
<label for="accountStoreUpstashRestUrl">Upstash REST URL</label>
<input type="password" id="accountStoreUpstashRestUrl" autocomplete="off" placeholder="https://...upstash.io">
</div>
<div class="form-group wide">
<label for="accountStoreUpstashRestToken">Upstash REST Token</label>
<input type="password" id="accountStoreUpstashRestToken" autocomplete="off" placeholder="保存后不回显,留空保留已有值">
</div>
<div class="form-group wide">
<label for="accountStoreEncryptionKey">账号加密 Key</label>
<input type="password" id="accountStoreEncryptionKey" autocomplete="off" placeholder="建议使用长随机字符串,保存后不回显">
</div>
</div>
<div class="danger-zone account-store-config-actions">
<button id="saveAccountStoreConfig" class="btn btn-primary" type="button">保存账号存储设置</button>
<button id="testAccountStoreConfig" class="btn btn-outline" type="button">测试账号存储</button>
<span id="accountStoreConfigStatus" class="section-hint" aria-live="polite">保存服务端配置后,账号会优先写入可用的服务端或 Upstash 存储。</span>
</div>
</section>
<div class="account-test-footer">
<button id="testConnection" class="btn btn-outline" type="button">测试当前账号连接</button>
</div>
<div id="accountTestResult" class="toast hidden"></div>
</section>
</div>
</div>
</div>
<!-- Add/Edit Account Modal -->
<div id="editOverlay" class="overlay hidden" role="dialog" aria-modal="true" aria-labelledby="editTitle">
<div class="modal">
<div class="modal-header">
<h2 id="editTitle">添加账号</h2>
<button id="closeEdit" class="close-btn" type="button" aria-label="关闭账号编辑">×</button>
</div>
<div class="modal-body">
<input type="hidden" id="editId">
<div class="form-group">
<label for="editName">名称</label>
<input type="text" id="editName" placeholder="我的 API">
</div>
<div class="form-group">
<label for="editUrl">此账号的 API 地址</label>
<input type="url" id="editUrl" placeholder="https://api.openai.com">
<small>当前账号实际请求会优先使用这里的地址;兼容 OpenAI 格式的 API 地址(不含 /v1 路径)。</small>
</div>
<div class="form-group">
<label for="editKey">API Key</label>
<div class="input-row">
<input type="password" id="editKey" placeholder="sk-...">
<button id="toggleEditKey" class="icon-btn-sm" type="button" title="显示 API Key" aria-label="显示 API Key" aria-pressed="false">
<svg aria-hidden="true" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"/><circle cx="12" cy="12" r="3"/></svg>
</button>
</div>
</div>
<div class="form-group">
<label for="editModel">模型</label>
<input type="text" id="editModel" value="gpt-image-2">
<small>用于非流式 Images API 的图片模型,例如 `gpt-image-2`。</small>
</div>
<div class="form-group">
<label for="editResponsesModel">流式主模型</label>
<input type="text" id="editResponsesModel" value="gpt-5.4">
<small>仅在开启流式模式时使用,调用 `/v1/responses` + `image_generation`。</small>
</div>
<div id="editStreamSection" class="stream-mode-section">
<label class="switch-label">
<span>流式模式(Responses API)</span>
<input type="checkbox" id="editStream">
<span class="switch"></span>
</label>
<small class="section-hint">默认关闭。开启后 API Key 账号走 /v1/responses + image_generation;关闭时走 /images/generations 或 /images/edits。</small>
</div>
<div id="editFallbackSection" class="stream-mode-section">
<label class="switch-label">
<span>流式失败自动回退到非流式</span>
<input type="checkbox" id="editResponsesAutoFallback">
<span class="switch"></span>
</label>
<small class="section-hint">默认开启。开启后 /v1/responses 报错会自动改走非流式图片接口;关闭则直接返回原始流式错误。</small>
</div>
<div id="editCompatSection" class="stream-mode-section">
<label class="switch-label">
<span>图生图兼容模式(旧版 multipart)</span>
<input type="checkbox" id="editImageEditsCompat">
<span class="switch"></span>
</label>
<small class="section-hint">默认关闭。仅在部分中转站 /v1/images/edits 不兼容官方 JSON `images[].image_url` 时开启。</small>
</div>
<div id="editOAuthFlowInfo" class="oauth-flow-info hidden">
<strong>OAuth 账号固定走 ChatGPT 后端图片流程</strong>
<span>实际链路:chat-requirements → conversation/prepare → conversation → 下载图片。它不使用 /v1/responses 或 /v1/images 的流式开关。</span>
</div>
<div class="modal-footer">
<button id="cancelEdit" class="btn btn-ghost">取消</button>
<button id="saveEdit" class="btn btn-primary">保存</button>
</div>
</div>
</div>
</div>
<!-- Main -->
<main class="main">
<!-- Hero Section -->
<div class="hero-section">
<div class="hero-content">
<h1 class="hero-title">AI Image Studio</h1>
<p class="hero-desc">描述你的想法,让 AI 为你生成精美图片</p>
</div>
</div>
<div class="workspace">
<!-- Input Area -->
<div class="input-section">
<div class="input-card">
<label class="sr-only" for="prompt">图片提示词</label>
<textarea id="prompt" placeholder="描述你想生成的图片..." rows="3"></textarea>
<div class="input-toolbar">
<div class="toolbar-left">
<div class="prompt-tools">
<button class="tool-btn" id="uploadLabel" type="button" title="上传参考图,最多 3 张" aria-label="上传参考图,最多 3 张">
<svg aria-hidden="true" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="3" y="3" width="18" height="18" rx="2"/><circle cx="8.5" cy="8.5" r="1.5"/><path d="M21 15l-5-5L5 21"/></svg>
</button>
<input type="file" id="refImage" accept="image/*" multiple hidden>
<button id="enhancePromptBtn" class="tool-btn enhance-prompt-btn hidden" type="button" title="润色提示词" aria-label="润色提示词">
<svg class="enhance-icon" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9"><path d="M12 3l1.7 5.2L19 10l-5.3 1.8L12 17l-1.7-5.2L5 10l5.3-1.8L12 3z"/><path d="M5 16l.7 2.2L8 19l-2.3.8L5 22l-.7-2.2L2 19l2.3-.8L5 16z"/></svg>
<span class="enhance-label">润色</span>
<span class="enhance-loading hidden"><span class="spinner"></span></span>
</button>
</div>
<div id="refPreview" class="ref-preview-list hidden"></div>
</div>
<div class="toolbar-right">
<span id="generationHint" class="hint" title="Ctrl+Enter 发送" role="status" aria-live="polite">Ctrl+Enter 发送</span>
<button id="generateBtn" class="btn btn-primary btn-send" aria-busy="false">
<span class="btn-text">生成</span>
<span class="btn-loading hidden"><span class="spinner"></span></span>
</button>
</div>
</div>
</div>
<div id="activeJobBanner" class="active-job-banner active-job-pill hidden" role="status" aria-live="polite" aria-atomic="true">
<span class="active-job-dot" aria-hidden="true"></span>
<div class="active-job-main">
<div id="activeJobBannerTitle" class="active-job-title">后台任务恢复中</div>
<div id="activeJobBannerMeta" class="active-job-meta">正在同步任务状态…</div>
</div>
<div class="active-job-actions">
<button id="retryActiveJobBtn" class="btn btn-ghost active-job-view" type="button" aria-label="查看后台任务结果">查看</button>
<button id="cancelActiveJobBtn" class="btn btn-outline active-job-stop" type="button" aria-label="停止后台任务">停止</button>
</div>
</div>
</div> <!-- /input-section -->
<!-- Controls Section -->
<div class="controls-section">
<!-- Options Bar -->
<div class="options-bar">
<div class="opt">
<label id="qualitySegLabel">质量</label>
<div class="seg" data-field="quality" role="group" aria-labelledby="qualitySegLabel">
<button type="button" data-value="low" aria-pressed="false">低</button>
<button type="button" data-value="medium" class="active" aria-pressed="true">中</button>
<button type="button" data-value="high" aria-pressed="false">高</button>
</div>
</div>
<div class="opt">
<label>尺寸 / 数量</label>
<div class="opt-row">
<div class="custom-select" id="sizeSelect" data-value="auto">
<button class="cs-trigger" type="button" aria-haspopup="listbox" aria-expanded="false">自动</button>
<div class="cs-dropdown hidden" role="listbox" aria-label="选择图片尺寸">
<div class="cs-item active" data-value="auto" data-label="自动" role="option" tabindex="-1" aria-selected="true">自动</div>
<div class="cs-divider"></div>
<div class="cs-item" data-value="1024x1024" data-label="方形 1:1" role="option" tabindex="-1" aria-selected="false">方形 1:1</div>
<div class="cs-item" data-value="1056x1408" data-label="竖版 3:4" role="option" tabindex="-1" aria-selected="false">竖版 3:4</div>
<div class="cs-item" data-value="864x1536" data-label="故事 9:16" role="option" tabindex="-1" aria-selected="false">故事 9:16</div>
<div class="cs-item" data-value="1408x1056" data-label="横屏 4:3" role="option" tabindex="-1" aria-selected="false">横屏 4:3</div>
<div class="cs-item" data-value="1536x864" data-label="宽屏 16:9" role="option" tabindex="-1" aria-selected="false">宽屏 16:9</div>
</div>
</div>
<select id="countSelect" title="数量">
<option value="1" selected>1 张</option>
<option value="2">2 张</option>
<option value="3">3 张</option>
<option value="4">4 张</option>
</select>
</div>
</div>
<div class="opt">
<label id="backgroundSegLabel">背景</label>
<div class="seg" data-field="background" role="group" aria-labelledby="backgroundSegLabel">
<button type="button" data-value="auto" class="active" aria-pressed="true">自动</button>
<button type="button" data-value="opaque" aria-pressed="false">不透明</button>
<button type="button" data-value="transparent" aria-pressed="false">透明</button>
</div>
</div>
<div class="opt">
<label for="formatSelect">格式</label>
<select id="formatSelect">
<option value="png" selected>PNG</option>
<option value="webp">WebP</option>
<option value="jpeg">JPEG</option>
</select>
</div>
</div>
<!-- Advanced Options -->
<details class="advanced-panel">
<summary>高级选项</summary>
<div class="advanced-grid">
<div class="adv-group">
<label for="styleSelect">风格</label>
<select id="styleSelect">
<option value="">默认</option>
<option value="natural">自然</option>
<option value="vivid">鲜明</option>
<option value="cinematic">电影感</option>
<option value="anime">动漫</option>
<option value="watercolor">水彩</option>
<option value="oil-painting">油画</option>
<option value="pixel-art">像素风</option>
<option value="3d-render">3D 渲染</option>
</select>
</div>
<div class="adv-group">
<label for="typeSelect">类型</label>
<select id="typeSelect">
<option value="">默认</option>
<option value="photo">照片</option>
<option value="illustration">插画</option>
<option value="icon">图标</option>
<option value="logo">Logo</option>
<option value="poster">海报</option>
<option value="texture">纹理</option>
<option value="concept-art">概念艺术</option>
</select>
</div>
</div>
<section id="promptHistoryPanel" class="prompt-history-panel" aria-label="提示词历史记录">
<div class="prompt-history-header">
<div>
<h2>提示词历史</h2>
<p>自动记录最近生成和润色过的提示词,也可以手动保存当前提示词。</p>
</div>
<button id="savePromptHistory" class="btn btn-outline" type="button">保存当前提示词</button>
</div>
<div class="prompt-history-row">
<label for="promptHistorySelect">历史提示词</label>
<select id="promptHistorySelect"></select>
<button id="restorePromptBefore" class="btn btn-ghost" type="button">恢复原始</button>
<button id="restorePromptAfter" class="btn btn-ghost" type="button">恢复最终</button>
<button id="clearPromptHistory" class="btn btn-ghost danger" type="button">清空历史</button>
</div>
<div id="promptHistoryStatus" class="prompt-history-status" aria-live="polite"></div>
</section>
</details>
</div> <!-- /controls-section -->
</div> <!-- /workspace -->
<!-- Results Section -->
<div class="results-section">
<div id="historyToolbar" class="history-toolbar" aria-label="历史记录工具栏">
<input id="historySearch" class="history-search" type="search" placeholder="搜索提示词、标签或批次">
<div class="history-actions">
<button id="historyFavoriteOnly" class="btn btn-outline history-fav-btn" type="button" aria-pressed="false">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"/></svg>
收藏
</button>
<button id="historyRefresh" class="btn btn-outline" type="button">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M23 4v6h-6"/><path d="M1 20v-6h6"/><path d="M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15"/></svg>
刷新
</button>
</div>
<span id="historyStatus" class="history-status" aria-live="polite"></span>
</div>
<div id="results" class="gallery"></div>
<!-- Error -->
<div id="errorMsg" class="error-bar hidden" role="alert" aria-live="assertive"></div>
</div> <!-- /results-section -->
</main>
<!-- Generation Progress Dialog -->
<div id="generationProgressOverlay" class="overlay hidden" role="dialog" aria-modal="true" aria-labelledby="generationProgressTitle" aria-describedby="generationProgressMeta" aria-busy="false">
<div class="modal generation-progress-dialog">
<div class="generation-progress-body">
<div class="generation-image-skeleton" aria-hidden="true">
<div class="generation-image-outline">
<span class="generation-skeleton-sun"></span>
<span class="generation-skeleton-mountain generation-skeleton-mountain-a"></span>
<span class="generation-skeleton-mountain generation-skeleton-mountain-b"></span>
</div>
</div>
<div class="generation-progress-copy">
<p class="generation-progress-eyebrow">AI Image Studio</p>
<h2 id="generationProgressTitle">正在生成图片</h2>
<p id="generationProgressMeta" class="generation-progress-meta" role="status" aria-live="polite">正在整理提示词</p>
</div>
<div class="generation-progress-meter-row">
<span id="generationProgressLabel" class="generation-progress-label">预计进度</span>
<span id="generationProgressPercent" class="generation-progress-percent">0%</span>
</div>
<div id="generationProgressBar" class="generation-progress-bar" role="progressbar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0" aria-label="图片生成进度">
<span id="generationProgressFill" class="generation-progress-fill" style="width: 0%"></span>
</div>
<p id="generationProgressDetail" class="generation-progress-detail">单张生成进度为阶段估算;批量完成比例会显示真实进度。</p>
<div class="modal-footer generation-progress-actions">
<button id="generationProgressMinimize" class="btn btn-ghost" type="button">最小化</button>
<button id="generationProgressCancel" class="btn btn-outline danger" type="button">停止任务</button>
</div>
</div>
</div>
</div>
<!-- Error Dialog -->
<div id="generationErrorOverlay" class="overlay hidden" role="alertdialog" aria-modal="true" aria-labelledby="generationErrorTitle" aria-describedby="generationErrorMessage">
<div class="modal error-dialog">
<div class="modal-header error-dialog-header">
<div class="error-dialog-title-wrap">
<span class="error-dialog-icon" aria-hidden="true">!</span>
<h2 id="generationErrorTitle">操作失败</h2>
</div>
<button id="generationErrorClose" class="close-btn" type="button" aria-label="关闭错误提示">×</button>
</div>
<div class="modal-body error-dialog-body">
<p id="generationErrorSummary" class="error-dialog-summary">操作没有完成,请查看下面的错误信息。</p>
<div class="error-dialog-kind-row">
<span id="generationErrorKind" class="error-dialog-kind" data-tone="danger">操作错误</span>
<span id="generationErrorMeta" class="error-dialog-meta hidden"></span>
</div>
<div id="generationErrorSuggestion" class="error-dialog-suggestion">请根据错误信息调整后重试。</div>
<div id="generationErrorMessage" class="error-dialog-message"></div>
<details id="generationErrorDebug" class="error-dialog-debug">
<summary>调试详情</summary>
<pre id="generationErrorDebugText" class="error-dialog-debug-text"></pre>
</details>
<div class="modal-footer error-dialog-actions">
<button id="generationErrorConfirm" class="btn btn-primary" type="button">知道了</button>
</div>
</div>
</div>
</div>
<!-- Lightbox -->
<div id="lightbox" class="lightbox hidden" role="dialog" aria-modal="true" aria-label="图片预览">
<img id="lightboxImg" alt="预览">
<button id="lightboxClose" class="lightbox-close" type="button" aria-label="关闭图片预览">×</button>
</div>
</div>
</div>
<script type="module" src="app.js"></script>
</body>
</html>