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
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
:root {
  /* 基础颜色变量 */
  --primary-color: #2196F3;
  --primary-dark: #1976D2;
  --primary-color-alpha: rgba(33, 150, 243, 0.1);
  --success-color: #4CAF50;
  --error-color: #F44336;
  --background-color: #F5F5F5;
  --card-background: #FFFFFF;
  --text-primary: #333333;
  --text-secondary: #757575;
  --border-color: #e0e0e0;
  --disabled-bg: #f5f5f5;

  /* 布局变量 */
  --border-radius: 8px;
  --spacing: 20px;

  /* 动画变量 */
  --transition-fast: 0.2s;
  --transition-slow: 0.3s;
}

/* 暗色模式 */
@media (prefers-color-scheme: dark) {
  :root {
    --primary-color: #90CAF9;
    --primary-dark: #64B5F6;
    --background-color: #121212;
    --card-background: #1e1e1e;
    --text-primary: #e0e0e0;
    --text-secondary: #9e9e9e;
    --border-color: #404040;
    --disabled-bg: #2d2d2d;
    color-scheme: dark;
  }
}

/* 基础样式 */
html {
  scroll-behavior: smooth;
  box-sizing: border-box;
}

*,
*:before,
*:after {
  box-sizing: inherit;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--spacing);
  background: var(--background-color);
  color: var(--text-primary);
  line-height: 1.6;
}

/* 容器样式 */
.container {
  background: var(--card-background);
  padding: var(--spacing);
  border-radius: var(--border-radius);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  margin-bottom: var(--spacing);
  transition: transform var(--transition-fast);
}

.container:hover {
  transform: translateY(-2px);
}

/* 标题样式 */
h1,
h2,
h3 {
  color: var(--text-primary);
  margin-top: 0;
  line-height: 1.2;
}

/* 表单元素样式 */
.form-group {
  margin-bottom: 20px;
}

/* 标签样式 */
label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--text-primary);
}

input,
select,
textarea,
.form-control {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background: var(--card-background);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.5;
  transition: all var(--transition-fast);
  appearance: none;
}

input[type="checkbox"] {
  width: auto;
  margin-right: 8px;
  cursor: pointer;
  appearance: auto;
}

input[type="checkbox"]+label {
  cursor: pointer;
  color: var(--text-primary);
  user-select: none;
}

input:hover,
select:hover,
textarea:hover,
.form-control:hover {
  border-color: var(--primary-color);
}

input:focus,
select:focus,
textarea:focus,
.form-control:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px var(--primary-color-alpha);
  outline: none;
}

/* 禁用状态 */
input:disabled,
select:disabled,
textarea:disabled,
.form-control:disabled {
  background-color: var(--disabled-bg);
  border-color: var(--border-color);
  cursor: not-allowed;
  opacity: 0.7;
}

/* 错误状态 */
input.error,
select.error,
textarea.error,
.form-control.error {
  border-color: var(--error-color);
}

/* Select 特殊样式 */
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23757575'%3E%3Cpath d='M7 10l5 5 5-5H7z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 20px;
  padding-right: 36px;
}

/* Textarea 特殊样式 */
textarea {
  min-height: 150px;
  resize: vertical;
  font-family: monospace;
  line-height: 1.4;
}

/* 按钮基础样式 */
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 24px;
  border: none;
  border-radius: var(--border-radius);
  background: var(--primary-color);
  color: white;
  font-size: 16px;
  font-weight: 500;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* 按钮状态 */
button:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--primary-color-alpha);
}

button:active {
  transform: translateY(1px);
}

button:disabled {
  background: var(--disabled-bg);
  color: var(--text-secondary);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* 次要按钮样式 */
button.secondary {
  background: transparent;
  border: 1px solid var(--primary-color);
  color: var(--primary-color);
}

button.secondary:hover {
  background: var(--primary-color-alpha);
  border-color: var(--primary-dark);
  color: var(--primary-dark);
}

button.danger {
  background: var(--error-color);
  border: none;
}

button.danger:hover {
  background: #d32f2f;
  /* 深红色 */
  box-shadow: 0 4px 12px rgba(244, 67, 54, 0.2);
}

/* 激活状态的按钮 */
button.active {
  background: var(--primary-dark);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
  transform: translateY(1px);
}

button.secondary.active {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-dark);
}

/* 按钮组 */
.button-group {
  display: flex;
  gap: 10px;
  margin: var(--spacing) 0;
}

/* 按钮组中的按钮间距调整 */
.button-group button {
  flex: 1;
  min-width: 120px;
}

/* 消息容器 - 固定在顶部中间 */
.message-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
  /* 允许点击穿透 */
}

/* 单个消息样式 */
.message {
  padding: 12px 20px;
  border-radius: 4px;
  background: var(--card-background);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  margin-bottom: 10px;
  pointer-events: auto;
  /* 允许消息本身可以交互 */
  min-width: 300px;
  max-width: 500px;
  display: flex;
  align-items: center;
  transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
  animation: messageIn 0.3s ease-in-out;
}

.message.success {
  background: #f0f9eb;
  border: 1px solid #e1f3d8;
}

.message.error {
  background: #fef0f0;
  border: 1px solid #fde2e2;
}

@keyframes messageIn {
  0% {
    opacity: 0;
    transform: translateY(-20px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes messageOut {
  0% {
    opacity: 1;
    transform: translateY(0);
  }

  100% {
    opacity: 0;
    transform: translateY(-20px);
  }
}

/* 深色模式适配 */
@media (prefers-color-scheme: dark) {
  .message {
    background: #2c2c2c;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  }

  .message.success {
    background: #294929;
    border-color: #1c321c;
  }

  .message.error {
    background: #4d2c2c;
    border-color: #321c1c;
  }
}

/* 表格样式 */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: var(--spacing);
  background: var(--card-background);
  border-radius: var(--border-radius);
  overflow: hidden;
}

th,
td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid var(--text-secondary);
}

th {
  background: var(--primary-color);
  color: white;
  font-weight: 500;
}

tr:nth-child(even) {
  background: rgba(0, 0, 0, 0.02);
}

tr:hover {
  background: rgba(0, 0, 0, 0.04);
}

/* 辅助类 */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.text-center {
  text-align: center;
}

.help-text {
  margin-top: 4px;
  font-size: 14px;
  color: var(--text-secondary);
}

.error-text {
  color: var(--error-color);
}

.mt-0 {
  margin-top: 0;
}

.mb-0 {
  margin-bottom: 0;
}

/* 响应式设计 */
@media (max-width: 768px) {
  :root {
    --spacing: 16px;
  }

  body {
    padding: 10px;
  }

  .button-group {
    flex-direction: column;
  }

  button {
    width: 100%;
    padding: 12px 20px;
  }

  input,
  select,
  textarea,
  .form-control {
    font-size: 16px;
    padding: 14px 16px;
  }

  table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  th,
  td {
    white-space: nowrap;
  }
}