File size: 14,441 Bytes
0abd8a5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ae86522
0abd8a5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ae86522
0abd8a5
 
 
 
 
ae86522
0abd8a5
 
 
 
ae86522
0abd8a5
 
ae86522
0abd8a5
 
 
 
ae86522
 
0abd8a5
 
 
 
 
 
 
 
 
ae86522
 
0abd8a5
 
 
 
 
 
 
 
ae86522
0abd8a5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
/* ================== 1. 核心变量 (Hugging Face 风格) ================== */
:root {
  --bg-body: #f3f4f6;          /* Tailwind gray-100: HF 外围背景色 */
  --bg-card: #ffffff;          /* 纯白卡片 */
  --bg-panel: #f9fafb;         /* Tailwind gray-50: 右侧控制栏底色 */
  --text-primary: #111827;     /* 深灰黑: 主文本 */
  --text-secondary: #4b5563;   /* 中灰: 次要文本 */
  --text-tertiary: #9ca3af;    /* 浅灰: 提示文本 */
  --border-light: #e5e7eb;     /* 浅灰边框 */
  --border-hover: #d1d5db;     /* 悬浮边框 */
  --radius-card: 16px;
  --radius-pill: 999px;
  --theme-hf-yellow: #ffd21e;  /* 🤗 Hugging Face 标志性黄色 */
  --theme-hf-yellow-hover: #fcd34d; 
  --theme-blue: #3b82f6;       /* HF 辅助链接蓝 */
  --theme-green: #10b981;      /* HF 成功绿 */
  --theme-red: #ef4444;
}

* { box-sizing: border-box; margin: 0; padding: 0; outline: none; -webkit-tap-highlight-color: transparent; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-body);
  color: var(--text-primary);
  line-height: 1.6;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
}
a { text-decoration: none; color: inherit; transition: 0.2s; }

/* ================== 2. 顶部统计导航栏 ================== */
.sticky-header-wrapper {
  width: 100%; display: flex; justify-content: center;
  padding: 15px 20px; z-index: 999; flex-shrink: 0;
}
.filter-bar {
  display: flex; gap: 15px; align-items: center; 
  background: #ffffff; padding: 10px 20px;
  border-radius: 12px; border: 1px solid var(--border-light);
  width: 100%; max-width: 1600px;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

#stats { display: flex; flex-wrap: wrap; gap: 8px; flex: 1; }
#stats div {
  font-size: 0.8rem; font-weight: 600; color: var(--text-secondary);
  background: #f3f4f6; padding: 4px 12px; border-radius: 6px;
  border: 1px solid var(--border-light); display: flex; align-items: center; white-space: nowrap;
}
#stats div span { color: var(--text-primary); margin-left: 6px; font-weight: 700; font-family: monospace; font-size: 0.9rem;}

.tag-btn {
  background: #ffffff; border: 1px solid var(--border-light); color: var(--text-primary);
  padding: 6px 16px; border-radius: 8px; font-size: 0.85rem;
  font-weight: 600; cursor: pointer; transition: all 0.2s ease; white-space: nowrap; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}
.tag-btn:hover { color: var(--text-primary); background: #f9fafb; border-color: var(--border-hover); box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);}

.global-key-input {
  background: #f9fafb; border: 1px solid var(--border-light); border-radius: 8px;
  color: var(--text-primary); padding: 6px 12px; width: 220px; font-size: 0.85rem; outline: none; transition: 0.3s;
}
.global-key-input:focus { border-color: var(--theme-blue); background: #ffffff; box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2); }

/* ================== 3. 宽屏工作台布局 ================== */
.workspace {
  width: 100%; max-width: 1600px; flex: 1; margin-bottom: 20px;
  background: var(--bg-card); border: 1px solid var(--border-light);
  border-radius: var(--radius-card); 
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  display: flex; overflow: hidden; animation: fadeUp 0.6s ease backwards;
}

/* 左侧:内容面板 */
.editor-panel {
  flex: 1; padding: 20px; display: flex; flex-direction: column; position: relative;
  background: var(--bg-card);
  overflow: hidden; min-width: 0;
}

/* 右侧:控制面板 */
.control-panel {
  flex: 0 0 360px; padding: 20px; display: flex; flex-direction: column; gap: 15px;
  border-left: 1px solid var(--border-light); background: var(--bg-panel);
  overflow-y: auto; overflow-x: hidden;
}

/* 统一滚动条 (亮色风格) */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #9ca3af; }

/* ================== 4. UI 控件样式 ================== */
.section-title {
  font-size: 0.85rem; font-weight: 700; color: var(--text-tertiary);
  text-transform: uppercase; letter-spacing: 1px; margin-bottom: 10px;
  display: flex; justify-content: space-between; align-items: center;
}

.glass-card { background: #ffffff; border: 1px solid var(--border-light); border-radius: 12px; padding: 15px; box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); }

.glass-input {
  width: 100%; background: #f9fafb; border: 1px solid var(--border-light);
  border-radius: 8px; color: var(--text-primary); padding: 10px 12px; font-family: inherit;
  font-size: 0.85rem; transition: all 0.2s; margin-bottom: 10px;
}
.glass-input::placeholder { color: var(--text-tertiary); }
.glass-input:focus { background: #ffffff; border-color: var(--theme-blue); box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15); }

select.glass-input {
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234b5563' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 14px; padding-right: 30px; cursor: pointer;
}
select.glass-input option { background-color: #ffffff; color: var(--text-primary); }
select.glass-input:disabled { opacity: 0.5; cursor: not-allowed; }

input[type="file"].glass-input { padding: 6px 12px; color: var(--text-secondary); cursor: pointer; background: #ffffff;}
input[type="file"]::file-selector-button { background: #f3f4f6; border: 1px solid var(--border-light); padding: 6px 12px; border-radius: 6px; color: var(--text-primary); margin-right: 10px; cursor: pointer; transition: 0.2s;}
input[type="file"]::file-selector-button:hover { background: #e5e7eb; }

.btn-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.btn {
  padding: 8px 10px; border-radius: 8px; font-size: 0.85rem; font-weight: 600;
  cursor: pointer; transition: all 0.2s; text-align: center; border: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.btn:active { transform: translateY(0); }

/* 原本的毛玻璃按钮变为清爽描边按钮 */
.btn-glass {
  background: #ffffff; border: 1px solid var(--border-light); color: var(--text-primary);
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}
.btn-glass:hover {
  background: #f9fafb; border-color: var(--border-hover);
  color: var(--text-primary); transform: translateY(-1px); box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
}

/* 核心行动按钮使用 HF 黄色 */
.bg-blue { background: var(--theme-hf-yellow); color: #000000; box-shadow: 0 1px 2px rgba(0,0,0,0.05); border: 1px solid #fbbf24;}
.bg-blue:hover { background: var(--theme-hf-yellow-hover); transform: translateY(-1px); box-shadow: 0 4px 10px rgba(251, 191, 36, 0.3);}
.bg-blue:disabled { background: #e5e7eb; color: var(--text-tertiary); border-color: var(--border-light); box-shadow: none; cursor: not-allowed; transform: none; }

/* TTS 样式 */
.tts-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; font-size: 0.8rem; color: var(--text-secondary); }
.tts-row input[type="range"] { width: 60%; accent-color: var(--text-primary); }
.tts-checkbox { display: flex; align-items: center; gap: 8px; font-size: 0.8rem; color: var(--text-secondary); margin-bottom: 10px;}
input[type="checkbox"] { accent-color: var(--theme-hf-yellow); width: 14px; height: 14px; cursor: pointer; }

/* 折叠面板 */
.collapsible-header { cursor: pointer; user-select: none; transition: color 0.2s; }
.collapsible-header:hover { color: var(--theme-blue); }
.collapsible-header::after { content: '▼'; font-size: 0.6rem; transition: transform 0.3s; margin-left: 5px;}
.collapsible-header.collapsed::after { transform: rotate(-90deg); }
.collapsible-content { display: block; overflow: hidden; transition: max-height 0.3s ease-out; }
.collapsible-content.collapsed { display: none; }

/* ================== 5. 左侧内容区 & Tab 切换 ================== */
.editor-tabs { display: flex; gap: 8px; margin-bottom: 15px; flex-shrink: 0; overflow-x: auto; padding-bottom: 5px;}
.editor-tabs::-webkit-scrollbar { display: none;}
.editor-tab {
  background: transparent; border: 1px solid transparent;
  color: var(--text-secondary); padding: 8px 16px; border-radius: 8px;
  cursor: pointer; font-size: 0.85rem; font-weight: 600; transition: 0.2s; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px;
}
/* 选中 Tab 呈现 HF 黄色标签 */
.editor-tab.active { background: var(--theme-hf-yellow); color: #000000; border-color: #fbbf24; }
.editor-tab:hover:not(.active) { background: #f3f4f6; color: var(--text-primary); border-color: var(--border-light);}

.workspace-view { flex: 1; display: flex; flex-direction: column; overflow: hidden; position: relative; min-height: 0; background: #ffffff; border: 1px solid var(--border-light); border-radius: 12px; }

/* 视图 1:文本视图 */
.view-header {
  display: flex; justify-content: space-between; align-items: center; gap: 15px;
  padding: 10px 15px; background: #f9fafb; border-bottom: 1px solid var(--border-light);
}
.view-header-title { font-size: 0.9rem; font-weight: 600; color: var(--text-primary); display: flex; align-items: center; gap: 8px; white-space: nowrap;}
.view-header-controls { display: flex; gap: 10px; align-items: center; flex: 1; justify-content: flex-end;}

#textarea {
  flex: 1; width: 100%; height: 100%; resize: none; background: transparent;
  border: none; padding: 20px; color: var(--text-primary); font-family: monospace;
  font-size: 0.95rem; line-height: 1.6; outline: none;
}

  /* ================== 6. 聊天对话区样式 ================== */
.chat-history {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 15px;
  background: #ffffff;
}

.chat-msg {
  max-width: 82%;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 0.95rem;
  line-height: 1.6;
  word-break: break-word;
  animation: fadeUp 0.3s ease forwards;
}

/* 用户气泡样式:右对齐 + 主题黄 */
.msg-user {
  align-self: flex-end;
  background: var(--theme-hf-yellow);
  color: #000000;
  border-bottom-right-radius: 4px;
  box-shadow: 0 2px 5px rgba(255, 210, 30, 0.2);
}

/* AI 气泡样式:左对齐 + 浅灰背景 */
.msg-ai {
  align-self: flex-start;
  background: #f3f4f6;
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
  border: 1px solid var(--border-light);
}

/* 底部输入框区域 */
.chat-input-area {
  display: flex;
  gap: 10px;
  padding: 12px 15px;
  background: #f9fafb;
  border-top: 1px solid var(--border-light);
  align-items: flex-end;
}

#chatInput {
  flex: 1;
  min-height: 44px;
  max-height: 120px;
  resize: none;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--border-light);
  background: #ffffff;
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: all 0.2s;
}

#chatInput:focus {
  border-color: var(--theme-blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* 视图 3:图像生成预览 */
.image-gen-container { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative; padding: 20px;}
.preview-placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; color: var(--text-tertiary); gap: 15px; text-align: center;}
.preview-placeholder svg { width: 64px; height: 64px; opacity: 0.5; color: var(--text-tertiary); }
.result-image { max-width: 100%; max-height: calc(100vh - 250px); object-fit: contain; border-radius: 12px; box-shadow: 0 10px 25px rgba(0,0,0,0.1); border: 1px solid var(--border-light); }

/* 视图 4:媒体解析与抽帧预览 */
.media-image-display { max-width: 100%; max-height: calc(100vh - 350px); object-fit: contain; border-radius: 12px; box-shadow: 0 10px 25px rgba(0,0,0,0.1); border: 1px solid var(--border-light); flex-shrink: 0;}
.media-time { color: var(--text-secondary); margin-top: 10px; font-size: 0.85rem; flex-shrink: 0;}
#mediaPlayerWrapper video, #mediaPlayerWrapper audio { max-width: 100%; max-height: calc(100vh - 300px); border-radius: 12px; outline: none; border: 1px solid var(--border-light); box-shadow: 0 4px 6px rgba(0,0,0,0.05); }
.media-toolbar { display: flex; flex-wrap: nowrap; overflow-x: auto; gap: 8px; margin-top: 5px; max-width: 100%; padding: 8px 4px 12px 4px; flex-shrink: 0; }

/* 视图 5:API 日志 */
.log-entry { margin-bottom: 15px; padding-bottom: 15px; border-bottom: 1px dashed var(--border-light); font-family: monospace; font-size: 0.85rem; word-break: break-all; }
.log-time { color: var(--text-tertiary); margin-bottom: 5px; font-size: 0.8rem;}
.log-req { color: var(--theme-blue); margin-bottom: 5px;}
.log-res { color: var(--theme-green); }
.log-err { color: var(--theme-red); }

/* 全局加载动画与报错 */
.loader-spinner { width: 40px; height: 40px; border: 3px solid #f3f4f6; border-top-color: var(--theme-hf-yellow); border-radius: 50%; animation: spin 1s linear infinite; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); display: none;}
.error-msg { position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); background: #fee2e2; border: 1px solid #f87171; color: #b91c1c; padding: 10px 20px; border-radius: 8px; font-weight: 500; font-size: 0.85rem; display: none; z-index: 30; box-shadow: 0 4px 6px rgba(0,0,0,0.1);}

@keyframes spin { 100% { transform: translate(-50%, -50%) rotate(360deg); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 1024px) {
  .workspace { flex-direction: column-reverse; overflow-y: auto; border-radius: 0; border: none; margin-bottom: 0; box-shadow: none;}
  .control-panel { flex: none; border-left: none; border-top: 1px solid var(--border-light); width: 100%; background: #ffffff;}
  .workspace-view { min-height: 400px; border-radius: 0; border-left: none; border-right: none;}
}