-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathstyles.css
More file actions
389 lines (358 loc) · 15.9 KB
/
Copy pathstyles.css
File metadata and controls
389 lines (358 loc) · 15.9 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
/* ========================================================================
可视化拼图编辑器 - 样式表
用途:主界面布局、组件样式、画布网格、交互反馈
======================================================================== */
/* ==================== 全局 / 基础重置 ==================== */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
overflow: hidden; height: 100vh; background: #f0f2f5;
}
#app { display: flex; flex-direction: column; height: 100vh; }
/* ==================== 顶部工具栏 ==================== */
.toolbar-btn {
display: inline-flex; align-items: center; gap: 4px;
padding: 5px 10px; border-radius: 6px; font-size: 12px; font-weight: 500;
color: #4b5563; background: transparent; border: none; cursor: pointer;
transition: all .12s; white-space: nowrap;
}
.toolbar-btn:hover { background: #f3f4f6; color: #1f2937; }
.toolbar-btn:active { transform: scale(0.96); }
.toolbar-btn svg { flex-shrink: 0; }
/* ==================== 左侧面板 ==================== */
.left-panel {
width: 240px; min-width: 240px; background: #fff;
border-right: 1px solid #e5e7eb; display: flex; flex-direction: column;
overflow: hidden;
}
.panel-section { padding: 14px 12px; }
.panel-section h3 { font-size: 13px; font-weight: 600; color: #374151; margin-bottom: 10px; }
/* —— 模板网格 —— */
.template-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.template-item {
display: flex; flex-direction: column; align-items: center; gap: 4px;
padding: 11px 4px 9px; border: 1px solid #e5e7eb; border-radius: 8px;
cursor: pointer; transition: all .15s; font-size: 11px; color: #4b5563;
user-select: none;
}
.template-item:hover {
border-color: #3b82f6; background: #eff6ff; color: #2563eb;
transform: translateY(-1px); box-shadow: 0 2px 8px rgba(59,130,246,.15);
}
.template-item .icon { font-size: 22px; line-height: 1; }
/* —— 侧边栏 Tab 切换 —— */
.sidebar-tabs {
display: flex; border-bottom: 1px solid #e5e7eb;
background: #f9fafb;
}
.sidebar-tab {
flex: 1; padding: 8px 0; border: none; background: transparent;
font-size: 12px; font-weight: 500; color: #6b7280;
cursor: pointer; transition: all .12s;
border-bottom: 2px solid transparent;
}
.sidebar-tab:hover { background: #f3f4f6; color: #1f2937; }
.sidebar-tab.active {
color: #2563eb; background: #fff;
border-bottom-color: #2563eb; font-weight: 600;
}
/* —— 布局模板库 —— */
.template-library {
display: flex; flex-direction: column; gap: 8px;
max-height: 360px; overflow-y: auto;
}
.tpl-card {
padding: 10px 12px; border: 1px solid #e5e7eb; border-radius: 8px;
cursor: pointer; transition: all .15s; background: #fff;
display: flex; align-items: center; gap: 10px;
}
.tpl-card:hover {
border-color: #3b82f6; background: #eff6ff;
transform: translateY(-1px); box-shadow: 0 2px 8px rgba(59,130,246,.15);
}
.tpl-thumb {
font-size: 22px; line-height: 1;
width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
background: #f3f4f6; border-radius: 6px; flex-shrink: 0;
}
.tpl-name { font-size: 12px; font-weight: 600; color: #1f2937; margin-bottom: 2px; }
.tpl-desc { font-size: 10px; color: #9ca3af; line-height: 1.3; }
/* —— AI 占位面板 —— */
.ai-panel-placeholder {
border: 1px dashed #d1d5db; border-radius: 8px; background: #fafafa;
}
/* —— AI 输入面板 —— */
.ai-field { margin-bottom: 10px; }
.ai-field label {
display: block; font-size: 11px; font-weight: 600; color: #6b7280;
margin-bottom: 4px; text-transform: uppercase; letter-spacing: .3px;
}
.ai-input, .ai-select, .ai-textarea {
width: 100%; padding: 6px 8px; font-size: 12px;
border: 1px solid #d1d5db; border-radius: 6px;
font-family: inherit; color: #1f2937; background: #fff;
transition: border-color .15s;
}
.ai-input:focus, .ai-select:focus, .ai-textarea:focus {
outline: none; border-color: #3b82f6; box-shadow: 0 0 0 2px rgba(59,130,246,.15);
}
.ai-textarea { resize: vertical; min-height: 70px; font-family: inherit; }
.ai-key-actions { display: flex; gap: 6px; margin-top: 6px; }
.ai-mini-btn {
padding: 4px 10px; font-size: 11px; border: 1px solid #d1d5db;
background: #fff; color: #4b5563; border-radius: 4px; cursor: pointer;
transition: all .12s;
}
.ai-mini-btn:hover { background: #f3f4f6; border-color: #9ca3af; }
.ai-hint {
font-size: 10px; color: #9ca3af; margin-top: 4px; line-height: 1.4;
}
.ai-generate-btn {
width: 100%; padding: 8px 12px; font-size: 13px; font-weight: 600;
background: linear-gradient(135deg, #6366f1, #8b5cf6);
color: #fff; border: none; border-radius: 6px; cursor: pointer;
display: flex; align-items: center; justify-content: center; gap: 6px;
transition: all .15s;
}
.ai-generate-btn:hover:not(:disabled) {
background: linear-gradient(135deg, #4f46e5, #7c3aed);
transform: translateY(-1px); box-shadow: 0 2px 8px rgba(99,102,241,.3);
}
.ai-generate-btn:disabled { opacity: .6; cursor: not-allowed; }
.ai-spinner {
width: 14px; height: 14px; border: 2px solid rgba(255,255,255,.4);
border-top-color: #fff; border-radius: 50%;
animation: ai-spin .7s linear infinite;
}
@keyframes ai-spin { to { transform: rotate(360deg); } }
.ai-status {
margin-top: 8px; padding: 8px 10px; font-size: 11px; border-radius: 6px;
line-height: 1.5;
}
.ai-status.error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.ai-status.info { background: #eff6ff; color: #1d4ed8; border: 1px solid #dbeafe; }
.ai-status.success { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
/* —— 生成位置确认弹窗 —— */
.ai-dialog-overlay {
position: fixed; inset: 0; background: rgba(0,0,0,.4);
display: flex; align-items: center; justify-content: center; z-index: 1000;
}
.ai-dialog {
background: #fff; border-radius: 8px; padding: 20px;
width: 320px; box-shadow: 0 10px 40px rgba(0,0,0,.2);
}
.ai-dialog h4 {
font-size: 14px; font-weight: 600; color: #1f2937; margin-bottom: 8px;
}
.ai-dialog p {
font-size: 12px; color: #6b7280; margin-bottom: 16px; line-height: 1.5;
}
.ai-dialog-actions {
display: flex; gap: 8px; justify-content: flex-end;
}
.ai-dialog-actions button {
padding: 6px 14px; font-size: 12px; font-weight: 500;
border: 1px solid #d1d5db; background: #fff; color: #4b5563;
border-radius: 6px; cursor: pointer; transition: all .12s;
}
.ai-dialog-actions button:hover { background: #f3f4f6; }
.ai-dialog-actions .primary {
background: #2563eb; color: #fff; border-color: #2563eb;
}
.ai-dialog-actions .primary:hover { background: #1d4ed8; }
/* —— 页面列表 —— */
.page-list { max-height: 260px; overflow-y: auto; }
.page-item {
display: flex; align-items: center; gap: 4px;
padding: 6px 8px; border-radius: 6px; cursor: pointer;
font-size: 13px; color: #374151; margin-bottom: 2px; transition: all .12s;
}
.page-item:hover { background: #f3f4f6; }
.page-item.active { background: #eff6ff; color: #2563eb; font-weight: 500; }
.page-item .page-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.page-item .page-actions { display: none; gap: 2px; }
.page-item:hover .page-actions { display: flex; }
.page-item .page-actions button {
width: 22px; height: 22px; border: none; background: transparent;
border-radius: 4px; cursor: pointer; font-size: 12px; line-height: 1;
display: flex; align-items: center; justify-content: center;
color: #9ca3af; transition: all .12s;
}
.page-item .page-actions button:hover { background: #e5e7eb; color: #374151; }
.page-item .page-actions .btn-del-page:hover { background: #fee2e2; color: #dc2626; }
/* 页面名内联编辑 */
.page-name-input {
border: 1px solid #3b82f6; border-radius: 4px; padding: 1px 4px;
font-size: 13px; outline: none; width: 100%; background: white;
}
/* ==================== 右侧属性面板 ==================== */
.right-panel {
width: 280px; min-width: 280px; background: #fff;
border-left: 1px solid #e5e7eb; overflow-y: auto;
}
.prop-group { margin-bottom: 14px; }
.prop-group label {
display: block; font-size: 11px; font-weight: 600; color: #6b7280;
margin-bottom: 4px; text-transform: uppercase; letter-spacing: .3px;
}
.prop-group input,
.prop-group select,
.prop-group textarea {
width: 100%; padding: 6px 8px; border: 1px solid #d1d5db;
border-radius: 6px; font-size: 13px; outline: none; transition: border .12s;
background: #fff; color: #1f2937;
}
.prop-group input:focus,
.prop-group select:focus,
.prop-group textarea:focus { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,.1); }
.prop-group textarea { resize: vertical; min-height: 60px; font-family: inherit; }
.prop-group input[type="color"] { height: 34px; padding: 2px; cursor: pointer; }
.prop-row { display: flex; gap: 8px; }
.prop-row > * { flex: 1; }
.prop-btn {
padding: 6px 10px; font-size: 12px; border: 1px solid #e5e7eb;
background: #fff; color: #374151; border-radius: 6px; cursor: pointer;
transition: all .12s;
}
.prop-btn:hover { background: #3b82f6; color: #fff; border-color: #3b82f6; }
/* ==================== 画布 ==================== */
/* —— 网格背景 —— */
.canvas-wrapper {
padding: 32px; min-height: 100%; display: flex; justify-content: center;
align-items: flex-start; position: relative;
}
#canvas {
position: relative; background: #ffffff;
border-radius: 4px;
box-shadow: 0 1px 4px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.05);
/* 背景网格:20px 格子 */
background-image:
linear-gradient(rgba(0,0,0,.04) 1px, transparent 1px),
linear-gradient(90deg, rgba(0,0,0,.04) 1px, transparent 1px);
background-size: 20px 20px;
/* 尺寸由 JS 动态设置 */ width: 1200px; min-height: 700px;
transition: width .3s ease;
}
/* 预览模式画布 */
.preview-mode #canvas {
box-shadow: 0 2px 20px rgba(0,0,0,.12);
border: 1px solid #e5e7eb;
}
/* 画布元素容器 */
.canvas-elements { width: 100%; min-height: 700px; position: relative; }
/* ==================== 画布上的元素 ==================== */
.canvas-el {
position: absolute; cursor: move; user-select: none;
border: 2px solid transparent; border-radius: 6px;
transition: box-shadow .12s;
overflow: hidden;
}
.canvas-el:hover { border-color: rgba(59,130,246,.3); }
/* 选中状态:显示手柄和选中边框,且优先级最高 */
.canvas-el.selected {
border-color: #3b82f6; z-index: 20 !important;
box-shadow: 0 0 0 1px rgba(59,130,246,.2);
}
.canvas-el.selected .resize-handle { display: block; }
/* 多选:除主选中外的次选中元素,使用虚线边框 */
.canvas-el.selected:not(.main-selected) {
border-style: dashed;
border-color: #60a5fa;
box-shadow: 0 0 0 1px rgba(96,165,250,.15);
}
.canvas-el.selected:not(.main-selected) .resize-handle { display: none; }
/* 预览模式下隐藏选中态及手柄 */
.preview-mode .canvas-el { cursor: default; border-color: transparent !important; }
.preview-mode .canvas-el:hover { border-color: transparent !important; }
.preview-mode .resize-handle { display: none !important; }
.preview-mode .canvas-el.selected { border-color: transparent !important; box-shadow: none !important; }
/* —— 调整大小手柄 —— */
.resize-handle {
display: none; position: absolute; width: 10px; height: 10px;
background: #3b82f6; border: 2px solid #fff; border-radius: 50%;
box-shadow: 0 1px 3px rgba(0,0,0,.2); z-index: 10;
}
.resize-handle.nw { top: -5px; left: -5px; cursor: nw-resize; }
.resize-handle.ne { top: -5px; right: -5px; cursor: ne-resize; }
.resize-handle.sw { bottom: -5px; left: -5px; cursor: sw-resize; }
.resize-handle.se { bottom: -5px; right: -5px; cursor: se-resize; }
.resize-handle.n { top: -5px; left: 50%; margin-left: -5px; cursor: n-resize; }
.resize-handle.s { bottom: -5px; left: 50%; margin-left: -5px; cursor: s-resize; }
.resize-handle.w { top: 50%; left: -5px; margin-top: -5px; cursor: w-resize; }
.resize-handle.e { top: 50%; right: -5px; margin-top: -5px; cursor: e-resize; }
/* ==================== 选择框(拖拽创建) ==================== */
#selection-box {
position: absolute; z-index: 100;
border: 2px dashed #3b82f6; background: rgba(59,130,246,.06);
border-radius: 4px; pointer-events: none;
}
/* ==================== 组件选择弹窗 ==================== */
.picker-item {
display: flex; flex-direction: column; align-items: center;
gap: 6px; padding: 16px 8px 12px;
border: 2px solid #e5e7eb; border-radius: 10px; cursor: pointer;
transition: all .15s; user-select: none;
}
.picker-item:hover {
border-color: #3b82f6; background: #eff6ff; transform: translateY(-2px);
box-shadow: 0 4px 12px rgba(59,130,246,.15);
}
.picker-icon { font-size: 28px; line-height: 1; }
.picker-label { font-size: 12px; color: #374151; font-weight: 500; }
.picker-item:hover .picker-label { color: #2563eb; }
/* ==================== 元素内部内容样式 ==================== */
.el-text { padding: 12px 16px; font-size: 15px; color: #1f2937; line-height: 1.6; word-break: break-word; }
.el-text h1 { font-size: 28px; font-weight: 700; margin-bottom: 8px; }
.el-text h2 { font-size: 22px; font-weight: 600; margin-bottom: 6px; }
.el-text p { margin-bottom: 6px; }
.el-text .small { font-size: 13px; color: #6b7280; }
.el-image { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; background: #f9fafb; }
.el-image img { width: 100%; height: 100%; object-fit: cover; }
.el-image .placeholder {
display: flex; flex-direction: column; align-items: center; gap: 6px;
color: #9ca3af; font-size: 13px;
}
.el-image .placeholder svg { width: 40px; height: 40px; }
.el-video { width: 100%; height: 100%; background: #111; display: flex; align-items: center; justify-content: center; }
.el-video video, .el-video iframe { width: 100%; height: 100%; border: none; }
.el-video .placeholder {
display: flex; flex-direction: column; align-items: center; gap: 8px;
color: #9ca3af; font-size: 13px; cursor: pointer;
}
.el-button { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.el-button button {
padding: 10px 28px; border-radius: 8px; font-size: 15px; font-weight: 500;
border: none; cursor: pointer; transition: all .15s;
white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.el-button button:hover { filter: brightness(1.08); transform: translateY(-1px); }
.el-button button:active { transform: translateY(0); }
.el-card {
width: 100%; height: 100%; display: flex; flex-direction: column;
border-radius: 8px; overflow: hidden;
}
.el-card .card-img { height: 55%; background: #e5e7eb; display: flex; align-items: center; justify-content: center; color: #9ca3af; font-size: 24px; }
.el-card .card-img img { width: 100%; height: 100%; object-fit: cover; }
.el-card .card-body { padding: 12px 14px; flex: 1; }
.el-card .card-body .card-title { font-weight: 600; font-size: 15px; margin-bottom: 4px; color: #1f2937; }
.el-card .card-body .card-desc { font-size: 12px; color: #6b7280; line-height: 1.4; }
/* ==================== 滚动条美化 ==================== */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #9ca3af; }
/* ==================== 空状态提示 ==================== */
.empty-hint {
position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
text-align: center; color: #d1d5db; pointer-events: none;
}
.empty-hint svg { width: 56px; height: 56px; margin: 0 auto 12px; }
.empty-hint p { font-size: 14px; }
/* ==================== 导出预览 ==================== */
.toast {
position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%);
background: #1f2937; color: #fff; padding: 10px 24px; border-radius: 8px;
font-size: 13px; z-index: 999; box-shadow: 0 4px 20px rgba(0,0,0,.2);
animation: toastIn .3s ease;
}
@keyframes toastIn { from { opacity: 0; transform: translateX(-50%) translateY(20px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }