@c2-markdown-ui/react 0.0.0-stage → 0.4.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. package/README.md +93 -2
  2. package/dist/index.d.ts +2 -0
  3. package/dist/index.d.ts.map +1 -0
  4. package/dist/index.js +9453 -0
  5. package/dist/lib/MarkdownUI.d.ts +10 -0
  6. package/dist/lib/MarkdownUI.d.ts.map +1 -0
  7. package/dist/lib/index.d.ts +4 -0
  8. package/dist/lib/index.d.ts.map +1 -0
  9. package/dist/widgets/Button.d.ts +15 -0
  10. package/dist/widgets/Button.d.ts.map +1 -0
  11. package/dist/widgets/ButtonGroup.d.ts +11 -0
  12. package/dist/widgets/ButtonGroup.d.ts.map +1 -0
  13. package/dist/widgets/Cascader.d.ts +34 -0
  14. package/dist/widgets/Cascader.d.ts.map +1 -0
  15. package/dist/widgets/Chart.d.ts +20 -0
  16. package/dist/widgets/Chart.d.ts.map +1 -0
  17. package/dist/widgets/DatePicker.d.ts +28 -0
  18. package/dist/widgets/DatePicker.d.ts.map +1 -0
  19. package/dist/widgets/Form.d.ts +47 -0
  20. package/dist/widgets/Form.d.ts.map +1 -0
  21. package/dist/widgets/Incomplete.d.ts +3 -0
  22. package/dist/widgets/Incomplete.d.ts.map +1 -0
  23. package/dist/widgets/MultipleChoiceQuestion.d.ts +15 -0
  24. package/dist/widgets/MultipleChoiceQuestion.d.ts.map +1 -0
  25. package/dist/widgets/NumberInput.d.ts +26 -0
  26. package/dist/widgets/NumberInput.d.ts.map +1 -0
  27. package/dist/widgets/Quiz.d.ts +37 -0
  28. package/dist/widgets/Quiz.d.ts.map +1 -0
  29. package/dist/widgets/Radio.d.ts +24 -0
  30. package/dist/widgets/Radio.d.ts.map +1 -0
  31. package/dist/widgets/Select.d.ts +15 -0
  32. package/dist/widgets/Select.d.ts.map +1 -0
  33. package/dist/widgets/SelectMulti.d.ts +20 -0
  34. package/dist/widgets/SelectMulti.d.ts.map +1 -0
  35. package/dist/widgets/ShortAnswerQuestion.d.ts +16 -0
  36. package/dist/widgets/ShortAnswerQuestion.d.ts.map +1 -0
  37. package/dist/widgets/Slider.d.ts +13 -0
  38. package/dist/widgets/Slider.d.ts.map +1 -0
  39. package/dist/widgets/Switch.d.ts +17 -0
  40. package/dist/widgets/Switch.d.ts.map +1 -0
  41. package/dist/widgets/TextInput.d.ts +11 -0
  42. package/dist/widgets/TextInput.d.ts.map +1 -0
  43. package/dist/widgets/Widget.d.ts +7 -0
  44. package/dist/widgets/Widget.d.ts.map +1 -0
  45. package/dist/widgets/chartRemoteData.d.ts +18 -0
  46. package/dist/widgets/chartRemoteData.d.ts.map +1 -0
  47. package/dist/widgets/choiceUtils.d.ts +24 -0
  48. package/dist/widgets/choiceUtils.d.ts.map +1 -0
  49. package/dist/widgets/index.d.ts +18 -0
  50. package/dist/widgets/index.d.ts.map +1 -0
  51. package/package.json +44 -4
  52. package/src/index.ts +1 -0
  53. package/src/lib/MarkdownUI.tsx +73 -0
  54. package/src/lib/index.ts +3 -0
  55. package/src/lib/widgets.css +1373 -0
  56. package/src/widgets/Button.tsx +39 -0
  57. package/src/widgets/ButtonGroup.tsx +47 -0
  58. package/src/widgets/Cascader.tsx +399 -0
  59. package/src/widgets/Chart.tsx +238 -0
  60. package/src/widgets/DatePicker.tsx +434 -0
  61. package/src/widgets/Form.tsx +372 -0
  62. package/src/widgets/Incomplete.tsx +55 -0
  63. package/src/widgets/MultipleChoiceQuestion.tsx +82 -0
  64. package/src/widgets/NumberInput.tsx +169 -0
  65. package/src/widgets/Quiz.tsx +320 -0
  66. package/src/widgets/Radio.tsx +146 -0
  67. package/src/widgets/Select.tsx +142 -0
  68. package/src/widgets/SelectMulti.tsx +72 -0
  69. package/src/widgets/ShortAnswerQuestion.tsx +101 -0
  70. package/src/widgets/Slider.tsx +57 -0
  71. package/src/widgets/Switch.tsx +56 -0
  72. package/src/widgets/TextInput.tsx +38 -0
  73. package/src/widgets/Widget.tsx +83 -0
  74. package/src/widgets/chartRemoteData.ts +84 -0
  75. package/src/widgets/choiceUtils.ts +45 -0
  76. package/src/widgets/index.ts +17 -0
@@ -0,0 +1,1373 @@
1
+ /* Markdown UI React Widgets - Optional Styling */
2
+ /* Users can import this CSS file to apply consistent styling to all widget components */
3
+
4
+ /* Base widget container */
5
+ .widget {
6
+ margin: 1rem 0;
7
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
8
+ line-height: 1.5;
9
+ }
10
+
11
+ /* Form container */
12
+ .widget-form {
13
+ display: flex;
14
+ flex-direction: column;
15
+ gap: 1rem;
16
+ padding: 1.5rem;
17
+ border: 1px solid #e2e8f0;
18
+ border-radius: 8px;
19
+ background-color: #ffffff;
20
+ box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
21
+ }
22
+
23
+ .widget-form > button[type="button"]:last-child {
24
+ align-self: flex-start;
25
+ margin-top: 0.5rem;
26
+ padding: 0.75rem 1.5rem;
27
+ background-color: #3b82f6;
28
+ color: #ffffff;
29
+ border: none;
30
+ border-radius: 6px;
31
+ font-size: 0.875rem;
32
+ font-weight: 500;
33
+ cursor: pointer;
34
+ transition: background-color 0.2s ease;
35
+ }
36
+
37
+ /* Form actions(提交/取消/清空按钮组,data-align 控制对齐) */
38
+ .widget-form-actions {
39
+ display: flex;
40
+ gap: 0.5rem;
41
+ margin-top: 0.5rem;
42
+ }
43
+
44
+ .widget-form-actions[data-align="left"] { justify-content: flex-start; }
45
+ .widget-form-actions[data-align="center"] { justify-content: center; }
46
+ .widget-form-actions[data-align="right"] { justify-content: flex-end; }
47
+
48
+ .widget-form-actions button[type="button"] {
49
+ padding: 0.75rem 1.5rem;
50
+ border-radius: 6px;
51
+ font-size: 0.875rem;
52
+ font-weight: 500;
53
+ cursor: pointer;
54
+ transition: background-color 0.2s ease;
55
+ }
56
+
57
+ .widget-form-actions .widget-form-submit {
58
+ border: none;
59
+ background-color: #3b82f6;
60
+ color: #ffffff;
61
+ }
62
+
63
+ .widget-form-actions .widget-form-submit:hover {
64
+ background-color: #2563eb;
65
+ }
66
+
67
+ .widget-form-actions .widget-form-cancel,
68
+ .widget-form-actions .widget-form-reset {
69
+ background-color: #ffffff;
70
+ color: #374151;
71
+ border: 1px solid #d1d5db;
72
+ }
73
+
74
+ .widget-form-actions .widget-form-cancel:hover,
75
+ .widget-form-actions .widget-form-reset:hover {
76
+ background-color: #f9fafb;
77
+ border-color: #9ca3af;
78
+ }
79
+
80
+ .widget-form-actions button[type="button"]:focus {
81
+ outline: none;
82
+ box-shadow: 0 0 0 2px #3b82f6;
83
+ }
84
+
85
+ /* Button Group */
86
+
87
+ /* 单个按钮组件(大/中/小三档尺寸,背景色完全由 color 属性的内联 style 控制) */
88
+ .widget-button {
89
+ display: inline-flex;
90
+ align-items: center;
91
+ justify-content: center;
92
+ border: none;
93
+ border-radius: 6px;
94
+ font-weight: 500;
95
+ cursor: pointer;
96
+ transition: filter 0.2s ease;
97
+ }
98
+
99
+ .widget-button:hover { filter: brightness(0.9); }
100
+ .widget-button:focus { outline: none; box-shadow: 0 0 0 2px #3b82f6; }
101
+
102
+ .widget-button.size-small { padding: 0.25rem 0.75rem; font-size: 0.75rem; }
103
+ .widget-button.size-medium { padding: 0.5rem 1.25rem; font-size: 0.875rem; }
104
+ .widget-button.size-large { padding: 0.75rem 1.75rem; font-size: 1rem; }
105
+ .widget-button-group {
106
+ display: flex;
107
+ flex-direction: column;
108
+ gap: 0.5rem;
109
+ }
110
+
111
+ .widget-button-group label {
112
+ font-weight: 500;
113
+ color: #374151;
114
+ margin-bottom: 0.25rem;
115
+ }
116
+
117
+ .widget-button-group div[role="group"] {
118
+ display: flex;
119
+ gap: 0.25rem;
120
+ flex-wrap: wrap;
121
+ }
122
+
123
+ .widget-form .widget-button-group button,
124
+ .widget-button-group button {
125
+ padding: 0.5rem 1rem;
126
+ border: 1px solid #d1d5db;
127
+ background-color: #ffffff;
128
+ color: #374151;
129
+ border-radius: 6px;
130
+ cursor: pointer;
131
+ transition: all 0.2s ease;
132
+ font-size: 0.875rem;
133
+ font-weight: 500;
134
+ }
135
+
136
+ .widget-form .widget-button-group button:hover,
137
+ .widget-button-group button:hover {
138
+ background-color: #f9fafb;
139
+ border-color: #9ca3af;
140
+ }
141
+
142
+ .widget-form .widget-button-group button[aria-pressed="true"],
143
+ .widget-button-group button[aria-pressed="true"] {
144
+ background-color: #3b82f6;
145
+ color: #ffffff;
146
+ border-color: #3b82f6;
147
+ }
148
+
149
+ .widget-form .widget-button-group button:focus,
150
+ .widget-button-group button:focus {
151
+ outline: none;
152
+ box-shadow: 0 0 0 2px #3b82f6;
153
+ }
154
+
155
+ /* Text Input */
156
+ .widget-text-input {
157
+ display: flex;
158
+ flex-direction: column;
159
+ gap: 0.5rem;
160
+ }
161
+
162
+ .widget-text-input label {
163
+ font-weight: 500;
164
+ color: #374151;
165
+ }
166
+
167
+ .widget-text-input input[type="text"] {
168
+ padding: 0.75rem;
169
+ border: 1px solid #d1d5db;
170
+ border-radius: 6px;
171
+ font-size: 0.875rem;
172
+ background-color: #ffffff;
173
+ transition: border-color 0.2s ease, box-shadow 0.2s ease;
174
+ }
175
+
176
+ .widget-text-input input[type="text"]:focus {
177
+ outline: none;
178
+ border-color: #3b82f6;
179
+ box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
180
+ }
181
+
182
+ .widget-text-input input[type="text"]::placeholder {
183
+ color: #9ca3af;
184
+ }
185
+
186
+ /* Select and Select Multi */
187
+ .selector,
188
+ .selector-multi {
189
+ display: flex;
190
+ flex-direction: column;
191
+ gap: 0.5rem;
192
+ }
193
+
194
+ .selector label,
195
+ .selector-multi-label {
196
+ font-weight: 500;
197
+ color: #374151;
198
+ }
199
+
200
+ .selector select {
201
+ padding: 0.75rem;
202
+ border: 1px solid #d1d5db;
203
+ border-radius: 6px;
204
+ font-size: 0.875rem;
205
+ background-color: #ffffff;
206
+ cursor: pointer;
207
+ transition: border-color 0.2s ease, box-shadow 0.2s ease;
208
+ }
209
+
210
+ .selector select:focus {
211
+ outline: none;
212
+ border-color: #3b82f6;
213
+ box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
214
+ }
215
+
216
+ .selector option {
217
+ padding: 0.5rem;
218
+ }
219
+
220
+ /* Checkbox-based Multi Select */
221
+ .checkbox-group {
222
+ display: flex;
223
+ flex-direction: column;
224
+ gap: 0.5rem;
225
+ padding: 0.75rem;
226
+ border: 1px solid #d1d5db;
227
+ border-radius: 6px;
228
+ background-color: #ffffff;
229
+ max-height: 200px;
230
+ overflow-y: auto;
231
+ }
232
+
233
+ /* 选项布局:横向(flex-wrap 换行);自定义列数(grid,列宽由 inline style 注入) */
234
+ .checkbox-group[data-direction="horizontal"] {
235
+ flex-direction: row;
236
+ flex-wrap: wrap;
237
+ gap: 0.5rem 1.5rem;
238
+ }
239
+
240
+ .checkbox-group[data-direction="grid"] {
241
+ display: grid;
242
+ gap: 0.5rem;
243
+ }
244
+
245
+ .checkbox-item {
246
+ display: flex;
247
+ align-items: center;
248
+ gap: 0.5rem;
249
+ cursor: pointer;
250
+ padding: 0.25rem 0;
251
+ font-weight: normal;
252
+ }
253
+
254
+ .checkbox-item input[type="checkbox"] {
255
+ margin: 0;
256
+ cursor: pointer;
257
+ }
258
+
259
+ .checkbox-item span {
260
+ font-size: 0.875rem;
261
+ color: #374151;
262
+ }
263
+
264
+ /* --- 单选 RadioGroup:圆点单选(antd Radio 默认样式) --- */
265
+ .radio-group {
266
+ display: flex;
267
+ flex-direction: column;
268
+ gap: 0.5rem;
269
+ padding: 0.75rem;
270
+ border: 1px solid #d1d5db;
271
+ border-radius: 6px;
272
+ background-color: #ffffff;
273
+ }
274
+
275
+ /* 选项布局:横向(flex-wrap 换行);自定义列数(grid,列宽由 inline style 注入) */
276
+ .radio-group[data-direction="horizontal"] {
277
+ flex-direction: row;
278
+ flex-wrap: wrap;
279
+ gap: 0.5rem 1.5rem;
280
+ }
281
+
282
+ .radio-group[data-direction="grid"] {
283
+ display: grid;
284
+ gap: 0.5rem;
285
+ }
286
+
287
+ .radio-item {
288
+ display: flex;
289
+ align-items: center;
290
+ gap: 0.5rem;
291
+ cursor: pointer;
292
+ padding: 0.25rem 0;
293
+ font-weight: normal;
294
+ }
295
+
296
+ .radio-item input[type="radio"] {
297
+ margin: 0;
298
+ cursor: pointer;
299
+ accent-color: #3b82f6;
300
+ }
301
+
302
+ .radio-item span {
303
+ font-size: 0.875rem;
304
+ color: #374151;
305
+ }
306
+
307
+ .radio-item:hover {
308
+ background-color: #f9fafb;
309
+ border-radius: 4px;
310
+ margin: -0.25rem 0;
311
+ padding: 0.5rem 0.25rem;
312
+ }
313
+
314
+ /* --- 单选 RadioGroup:按钮组样式(antd Radio optionType:button) --- */
315
+ .radio-button-group {
316
+ display: flex;
317
+ gap: 0.25rem;
318
+ flex-wrap: wrap;
319
+ }
320
+
321
+ .radio-button-group[data-direction="vertical"] {
322
+ flex-direction: column;
323
+ flex-wrap: nowrap;
324
+ }
325
+
326
+ .radio-button-group[data-direction="grid"] {
327
+ display: grid;
328
+ gap: 0.5rem;
329
+ }
330
+
331
+ .checkbox-item:hover {
332
+ background-color: #f9fafb;
333
+ border-radius: 4px;
334
+ margin: -0.25rem 0;
335
+ padding: 0.5rem 0.25rem;
336
+ }
337
+
338
+ /* Slider */
339
+ .widget-slider {
340
+ display: flex;
341
+ flex-direction: column;
342
+ gap: 0.5rem;
343
+ }
344
+
345
+ .widget-slider label {
346
+ font-weight: 500;
347
+ color: #374151;
348
+ }
349
+
350
+ .slider-container {
351
+ display: flex;
352
+ flex-direction: column;
353
+ gap: 0.25rem;
354
+ }
355
+
356
+ .slider-values {
357
+ display: flex;
358
+ justify-content: space-between;
359
+ align-items: center;
360
+ font-size: 0.75rem;
361
+ color: #6b7280;
362
+ margin-bottom: 0.25rem;
363
+ }
364
+
365
+ .current-value {
366
+ font-weight: 600;
367
+ color: #3b82f6;
368
+ background: #eff6ff;
369
+ padding: 0.25rem 0.5rem;
370
+ border-radius: 4px;
371
+ min-width: 2rem;
372
+ text-align: center;
373
+ }
374
+
375
+ .min-value, .max-value {
376
+ font-weight: 500;
377
+ }
378
+
379
+ .widget-slider input[type="range"] {
380
+ width: 100%;
381
+ height: 6px;
382
+ border-radius: 3px;
383
+ background: #e2e8f0;
384
+ outline: none;
385
+ cursor: pointer;
386
+ }
387
+
388
+ .widget-slider input[type="range"]::-webkit-slider-thumb {
389
+ appearance: none;
390
+ width: 20px;
391
+ height: 20px;
392
+ border-radius: 50%;
393
+ background: #3b82f6;
394
+ cursor: pointer;
395
+ transition: background-color 0.2s ease;
396
+ }
397
+
398
+ .widget-slider input[type="range"]::-webkit-slider-thumb:hover {
399
+ background: #2563eb;
400
+ }
401
+
402
+ .widget-slider input[type="range"]::-moz-range-thumb {
403
+ width: 20px;
404
+ height: 20px;
405
+ border-radius: 50%;
406
+ background: #3b82f6;
407
+ cursor: pointer;
408
+ border: none;
409
+ transition: background-color 0.2s ease;
410
+ }
411
+
412
+ .widget-slider input[type="range"]::-moz-range-thumb:hover {
413
+ background: #2563eb;
414
+ }
415
+
416
+ /* Switch(参考 antd Switch) */
417
+ .widget-switch {
418
+ display: flex;
419
+ flex-direction: column;
420
+ gap: 0.5rem;
421
+ }
422
+
423
+ .widget-switch > label {
424
+ font-weight: 500;
425
+ color: #374151;
426
+ }
427
+
428
+ .switch-track {
429
+ position: relative;
430
+ display: inline-flex;
431
+ align-items: center;
432
+ box-sizing: content-box;
433
+ width: 44px;
434
+ height: 22px;
435
+ padding: 0;
436
+ border: none;
437
+ border-radius: 11px;
438
+ background-color: rgba(0, 0, 0, 0.25);
439
+ cursor: pointer;
440
+ transition: background-color 0.2s ease;
441
+ flex-shrink: 0;
442
+ }
443
+
444
+ .switch-track[data-checked="true"] {
445
+ background-color: #3b82f6;
446
+ }
447
+
448
+ .switch-track:hover:not(:disabled) {
449
+ background-color: rgba(0, 0, 0, 0.35);
450
+ }
451
+
452
+ .switch-track[data-checked="true"]:hover:not(:disabled) {
453
+ background-color: #2563eb;
454
+ }
455
+
456
+ .switch-track .switch-thumb {
457
+ display: block;
458
+ width: 18px;
459
+ height: 18px;
460
+ margin: 2px;
461
+ border-radius: 50%;
462
+ background-color: #ffffff;
463
+ box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.2);
464
+ transition: transform 0.2s ease;
465
+ }
466
+
467
+ .switch-track[data-checked="true"] .switch-thumb {
468
+ transform: translateX(22px);
469
+ }
470
+
471
+ .switch-track .switch-text {
472
+ position: absolute;
473
+ top: 50%;
474
+ transform: translateY(-50%);
475
+ font-size: 0.75rem;
476
+ font-weight: 500;
477
+ color: #ffffff;
478
+ line-height: 1;
479
+ user-select: none;
480
+ }
481
+
482
+ /* 文案位置与 antd 一致:选中后滑块移至右侧,选中文案露在左侧;未选中时滑块在左,未选中文案露在右侧 */
483
+ .switch-track .switch-text-unchecked {
484
+ right: 6px;
485
+ }
486
+
487
+ .switch-track .switch-text-checked {
488
+ left: 6px;
489
+ }
490
+
491
+ /* 仅显示当前状态对应的文案 */
492
+ .switch-track[data-checked="true"] .switch-text-unchecked {
493
+ display: none;
494
+ }
495
+
496
+ .switch-track[data-checked="false"] .switch-text-checked {
497
+ display: none;
498
+ }
499
+
500
+ .switch-track:disabled {
501
+ cursor: not-allowed;
502
+ opacity: 0.5;
503
+ }
504
+
505
+ .switch-track:focus-visible {
506
+ outline: none;
507
+ box-shadow: 0 0 0 2px #3b82f6;
508
+ }
509
+
510
+ /* Form submit button styling - hover and focus states */
511
+ .widget-form > button[type="button"]:last-child:hover {
512
+ background-color: #2563eb;
513
+ }
514
+
515
+ .widget-form > button[type="button"]:last-child:focus {
516
+ outline: none;
517
+ box-shadow: 0 0 0 2px #3b82f6;
518
+ }
519
+
520
+ /* Form row grid layout (24-column grid, similar to antd Row/Col) */
521
+ .widget-form-row {
522
+ display: grid;
523
+ grid-template-columns: repeat(24, minmax(0, 1fr));
524
+ column-gap: var(--row-gutter, 1rem);
525
+ }
526
+
527
+ .widget-form-row .widget-form-field {
528
+ min-width: 0;
529
+ }
530
+
531
+ /* 传统 fields 模式 + 显式 span:切换为 24 栅格(无 span 字段占满整行) */
532
+ .widget-form.widget-form-fields-grid {
533
+ display: grid;
534
+ grid-template-columns: repeat(24, minmax(0, 1fr));
535
+ column-gap: 1rem;
536
+ row-gap: 1rem;
537
+ align-items: start;
538
+ }
539
+
540
+ .widget-form-fields-grid .widget-form-field {
541
+ min-width: 0;
542
+ }
543
+
544
+ .widget-form-fields-grid .widget-form-field[data-field-type="button"] {
545
+ width: max-content;
546
+ max-width: 100%;
547
+ align-self: end;
548
+ padding-bottom: 0;
549
+ }
550
+
551
+ .widget-form-fields-grid .widget-form-actions {
552
+ grid-column: 1 / -1;
553
+ }
554
+
555
+ /* inline 模式 + 显式 span 覆盖 flex-basis 后,收回默认 flex-grow */
556
+ .widget-form-inline .widget-form-field[style*="flex: 0 1"] {
557
+ flex-grow: 0;
558
+ }
559
+
560
+ /* Error styling for unknown widgets */
561
+ .widget span[style*="color:red"] {
562
+ color: #ef4444 !important;
563
+ font-weight: 500;
564
+ padding: 0.75rem;
565
+ background-color: #fef2f2;
566
+ border: 1px solid #fecaca;
567
+ border-radius: 6px;
568
+ display: inline-block;
569
+ }
570
+
571
+ /* Multiple Choice Question */
572
+ .widget-mcq {
573
+ display: flex;
574
+ flex-direction: column;
575
+ gap: 1rem;
576
+ padding: 1.5rem;
577
+ border: 1px solid #e2e8f0;
578
+ border-radius: 8px;
579
+ background-color: #ffffff;
580
+ }
581
+
582
+ .mcq-question {
583
+ font-weight: 600;
584
+ font-size: 1.1rem;
585
+ color: #1f2937;
586
+ margin-bottom: 0.5rem;
587
+ }
588
+
589
+ .mcq-choices {
590
+ display: flex;
591
+ flex-direction: column;
592
+ gap: 0.75rem;
593
+ }
594
+
595
+ .mcq-choice {
596
+ padding: 1rem;
597
+ border: 2px solid #e5e7eb;
598
+ border-radius: 8px;
599
+ background-color: #ffffff;
600
+ text-align: left;
601
+ cursor: pointer;
602
+ transition: all 0.2s ease;
603
+ font-size: 0.9rem;
604
+ }
605
+
606
+ .mcq-choice:hover:not(:disabled) {
607
+ border-color: #9ca3af;
608
+ background-color: #f9fafb;
609
+ }
610
+
611
+ .mcq-choice-selected {
612
+ border-color: #3b82f6;
613
+ background-color: #eff6ff;
614
+ }
615
+
616
+ .mcq-choice-correct {
617
+ border-color: #10b981;
618
+ background-color: #ecfdf5;
619
+ color: #065f46;
620
+ }
621
+
622
+ .mcq-choice-incorrect {
623
+ border-color: #ef4444;
624
+ background-color: #fef2f2;
625
+ color: #991b1b;
626
+ }
627
+
628
+ .mcq-choice:disabled {
629
+ cursor: not-allowed;
630
+ opacity: 0.8;
631
+ }
632
+
633
+ .mcq-feedback {
634
+ padding: 0.75rem;
635
+ border-radius: 6px;
636
+ font-weight: 500;
637
+ font-size: 0.9rem;
638
+ }
639
+
640
+ .mcq-feedback.correct {
641
+ background-color: #ecfdf5;
642
+ color: #065f46;
643
+ border: 1px solid #a7f3d0;
644
+ }
645
+
646
+ .mcq-feedback.incorrect {
647
+ background-color: #fef2f2;
648
+ color: #991b1b;
649
+ border: 1px solid #fecaca;
650
+ }
651
+
652
+ /* Short Answer Question */
653
+ .widget-saq {
654
+ display: flex;
655
+ flex-direction: column;
656
+ gap: 1rem;
657
+ padding: 1.5rem;
658
+ border: 1px solid #e2e8f0;
659
+ border-radius: 8px;
660
+ background-color: #ffffff;
661
+ }
662
+
663
+ .saq-question {
664
+ font-weight: 600;
665
+ font-size: 1.1rem;
666
+ color: #1f2937;
667
+ margin-bottom: 0.5rem;
668
+ }
669
+
670
+ .saq-input-container {
671
+ display: flex;
672
+ gap: 0.75rem;
673
+ align-items: stretch;
674
+ }
675
+
676
+ .saq-input {
677
+ flex: 1;
678
+ padding: 0.75rem;
679
+ border: 2px solid #e5e7eb;
680
+ border-radius: 6px;
681
+ font-size: 0.9rem;
682
+ background-color: #ffffff;
683
+ transition: border-color 0.2s ease, box-shadow 0.2s ease;
684
+ }
685
+
686
+ .saq-input:focus {
687
+ outline: none;
688
+ border-color: #3b82f6;
689
+ box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
690
+ }
691
+
692
+ .saq-input-correct {
693
+ border-color: #10b981;
694
+ background-color: #ecfdf5;
695
+ }
696
+
697
+ .saq-input-incorrect {
698
+ border-color: #ef4444;
699
+ background-color: #fef2f2;
700
+ }
701
+
702
+ .saq-submit {
703
+ padding: 0.75rem 1.25rem;
704
+ background-color: #3b82f6;
705
+ color: #ffffff;
706
+ border: none;
707
+ border-radius: 6px;
708
+ font-size: 0.875rem;
709
+ font-weight: 500;
710
+ cursor: pointer;
711
+ transition: background-color 0.2s ease;
712
+ white-space: nowrap;
713
+ }
714
+
715
+ .saq-submit:hover:not(:disabled) {
716
+ background-color: #2563eb;
717
+ }
718
+
719
+ .saq-submit:disabled {
720
+ background-color: #f5f5f5;
721
+ color: rgba(0, 0, 0, 0.4);
722
+ cursor: not-allowed;
723
+ }
724
+
725
+ .saq-feedback {
726
+ padding: 0.75rem;
727
+ border-radius: 6px;
728
+ font-weight: 500;
729
+ font-size: 0.9rem;
730
+ }
731
+
732
+ .saq-feedback.correct {
733
+ background-color: #ecfdf5;
734
+ color: #065f46;
735
+ border: 1px solid #a7f3d0;
736
+ }
737
+
738
+ .saq-feedback.incorrect {
739
+ background-color: #fef2f2;
740
+ color: #991b1b;
741
+ border: 1px solid #fecaca;
742
+ }
743
+
744
+ /* Responsive design */
745
+ @media (max-width: 640px) {
746
+ .widget-button-group div[role="group"] {
747
+ flex-direction: column;
748
+ }
749
+
750
+ .widget-button-group button {
751
+ width: 100%;
752
+ }
753
+
754
+ .widget-form {
755
+ padding: 1rem;
756
+ }
757
+
758
+ .saq-input-container {
759
+ flex-direction: column;
760
+ }
761
+
762
+ .widget-mcq,
763
+ .widget-saq,
764
+ .widget-quiz {
765
+ padding: 1rem;
766
+ }
767
+ }
768
+
769
+ /* Quiz Component */
770
+ .widget-quiz {
771
+ max-width: 800px;
772
+ margin: 0 auto;
773
+ background: #ffffff;
774
+ border: 1px solid #e2e8f0;
775
+ border-radius: 12px;
776
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
777
+ }
778
+
779
+ .quiz-header {
780
+ padding: 2rem 2rem 1rem;
781
+ border-bottom: 1px solid #e2e8f0;
782
+ background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
783
+ color: white;
784
+ border-radius: 12px 12px 0 0;
785
+ }
786
+
787
+ .quiz-title {
788
+ font-size: 1.5rem;
789
+ font-weight: 700;
790
+ margin: 0 0 1rem 0;
791
+ text-align: center;
792
+ color: white;
793
+ }
794
+
795
+ .quiz-stats {
796
+ display: flex;
797
+ justify-content: space-between;
798
+ align-items: center;
799
+ gap: 2rem;
800
+ flex-wrap: wrap;
801
+ color: white;
802
+ }
803
+
804
+ .quiz-progress {
805
+ flex: 1;
806
+ min-width: 200px;
807
+ }
808
+
809
+ .quiz-progress-text {
810
+ font-size: 0.9rem;
811
+ font-weight: 500;
812
+ margin-bottom: 0.5rem;
813
+ display: block;
814
+ color: white;
815
+ }
816
+
817
+ .quiz-progress-bar {
818
+ width: 100%;
819
+ height: 8px;
820
+ background: rgba(255, 255, 255, 0.2);
821
+ border-radius: 4px;
822
+ overflow: hidden;
823
+ }
824
+
825
+ .quiz-progress-fill {
826
+ height: 100%;
827
+ background: linear-gradient(90deg, #10b981, #34d399);
828
+ border-radius: 4px;
829
+ transition: width 0.3s ease;
830
+ }
831
+
832
+ .quiz-score {
833
+ text-align: right;
834
+ }
835
+
836
+ .quiz-score-text {
837
+ font-size: 1.1rem;
838
+ font-weight: 600;
839
+ color: white;
840
+ }
841
+
842
+ .quiz-questions {
843
+ padding: 1.5rem;
844
+ }
845
+
846
+ .quiz-question {
847
+ margin-bottom: 2rem;
848
+ padding: 1.5rem;
849
+ border: 2px solid #f1f5f9;
850
+ border-radius: 8px;
851
+ background: #fafbfc;
852
+ transition: all 0.2s ease;
853
+ }
854
+
855
+ .quiz-question:hover {
856
+ border-color: #e2e8f0;
857
+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
858
+ }
859
+
860
+ .quiz-question-header {
861
+ display: flex;
862
+ justify-content: space-between;
863
+ align-items: flex-start;
864
+ margin-bottom: 1rem;
865
+ gap: 1rem;
866
+ }
867
+
868
+ .quiz-question-text {
869
+ font-size: 1.1rem;
870
+ font-weight: 600;
871
+ color: #1f2937;
872
+ margin: 0;
873
+ flex: 1;
874
+ }
875
+
876
+ .quiz-question-points {
877
+ background: #3b82f6;
878
+ color: white;
879
+ padding: 0.25rem 0.75rem;
880
+ border-radius: 12px;
881
+ font-size: 0.8rem;
882
+ font-weight: 600;
883
+ white-space: nowrap;
884
+ }
885
+
886
+ .quiz-choices {
887
+ display: flex;
888
+ flex-direction: column;
889
+ gap: 0.75rem;
890
+ }
891
+
892
+ .quiz-choice {
893
+ padding: 1rem 1.25rem;
894
+ border: 2px solid #e5e7eb;
895
+ border-radius: 8px;
896
+ background: #ffffff;
897
+ text-align: left;
898
+ cursor: pointer;
899
+ transition: all 0.2s ease;
900
+ font-size: 0.95rem;
901
+ font-weight: 500;
902
+ }
903
+
904
+ .quiz-choice:hover:not(:disabled) {
905
+ border-color: #3b82f6;
906
+ background: #eff6ff;
907
+ transform: translateY(-1px);
908
+ }
909
+
910
+ .quiz-choice-selected {
911
+ border-color: #3b82f6;
912
+ background: #eff6ff;
913
+ }
914
+
915
+ .quiz-choice-correct {
916
+ border-color: #10b981;
917
+ background: #ecfdf5;
918
+ color: #065f46;
919
+ }
920
+
921
+ .quiz-choice-incorrect {
922
+ border-color: #ef4444;
923
+ background: #fef2f2;
924
+ color: #991b1b;
925
+ }
926
+
927
+ .quiz-choice:disabled {
928
+ cursor: not-allowed;
929
+ opacity: 0.9;
930
+ }
931
+
932
+ .quiz-input-container {
933
+ display: flex;
934
+ gap: 0.75rem;
935
+ align-items: stretch;
936
+ }
937
+
938
+ .quiz-input {
939
+ flex: 1;
940
+ padding: 0.75rem 1rem;
941
+ border: 2px solid #e5e7eb;
942
+ border-radius: 6px;
943
+ font-size: 0.95rem;
944
+ background: #ffffff;
945
+ transition: border-color 0.2s ease, box-shadow 0.2s ease;
946
+ }
947
+
948
+ .quiz-input:focus {
949
+ outline: none;
950
+ border-color: #3b82f6;
951
+ box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
952
+ }
953
+
954
+ .quiz-input-correct {
955
+ border-color: #10b981;
956
+ background: #ecfdf5;
957
+ }
958
+
959
+ .quiz-input-incorrect {
960
+ border-color: #ef4444;
961
+ background: #fef2f2;
962
+ }
963
+
964
+ .quiz-submit {
965
+ padding: 0.75rem 1.5rem;
966
+ background: #3b82f6;
967
+ color: white;
968
+ border: none;
969
+ border-radius: 6px;
970
+ font-size: 0.875rem;
971
+ font-weight: 600;
972
+ cursor: pointer;
973
+ transition: background-color 0.2s ease;
974
+ white-space: nowrap;
975
+ }
976
+
977
+ .quiz-submit:hover:not(:disabled) {
978
+ background: #2563eb;
979
+ }
980
+
981
+ .quiz-submit:disabled {
982
+ background-color: #f5f5f5;
983
+ color: rgba(0, 0, 0, 0.4);
984
+ cursor: not-allowed;
985
+ }
986
+
987
+ .quiz-feedback {
988
+ margin-top: 1rem;
989
+ padding: 1rem;
990
+ border-radius: 6px;
991
+ font-weight: 600;
992
+ font-size: 0.95rem;
993
+ }
994
+
995
+ .quiz-feedback.correct {
996
+ background: #ecfdf5;
997
+ color: #065f46;
998
+ border: 1px solid #a7f3d0;
999
+ }
1000
+
1001
+ .quiz-feedback.incorrect {
1002
+ background: #fef2f2;
1003
+ color: #991b1b;
1004
+ border: 1px solid #fecaca;
1005
+ }
1006
+
1007
+ .quiz-summary {
1008
+ margin-top: 2rem;
1009
+ padding: 2rem;
1010
+ background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
1011
+ border-radius: 8px;
1012
+ text-align: center;
1013
+ border: 2px solid #e2e8f0;
1014
+ }
1015
+
1016
+ .quiz-summary h3 {
1017
+ font-size: 1.5rem;
1018
+ font-weight: 700;
1019
+ color: #1f2937;
1020
+ margin: 0 0 1rem 0;
1021
+ }
1022
+
1023
+ .quiz-final-score {
1024
+ font-size: 1.2rem;
1025
+ font-weight: 600;
1026
+ color: #374151;
1027
+ margin-bottom: 1rem;
1028
+ }
1029
+
1030
+ .quiz-result {
1031
+ font-size: 1.1rem;
1032
+ font-weight: 700;
1033
+ padding: 0.75rem 1.5rem;
1034
+ border-radius: 6px;
1035
+ display: inline-block;
1036
+ }
1037
+
1038
+ .quiz-result.passed {
1039
+ background: #ecfdf5;
1040
+ color: #065f46;
1041
+ border: 1px solid #a7f3d0;
1042
+ }
1043
+
1044
+ .quiz-result.failed {
1045
+ background: #fef2f2;
1046
+ color: #991b1b;
1047
+ border: 1px solid #fecaca;
1048
+ }
1049
+
1050
+ /* ============================================================ */
1051
+ /* === Disabled 状态统一置灰样式(所有交互组件 disabled 后视觉反馈) === */
1052
+ /* ============================================================ */
1053
+
1054
+ /* --- 单按钮组件 Button:含内联 color 时仅置灰文字 --- */
1055
+ .widget-button:disabled {
1056
+ background-color: #f5f5f5 !important;
1057
+ color: rgba(0, 0, 0, 0.4) !important;
1058
+ cursor: not-allowed;
1059
+ filter: none;
1060
+ }
1061
+ .widget-button:disabled:hover { filter: none; }
1062
+
1063
+ /* --- 按钮组 ButtonGroup --- */
1064
+ .widget-form .widget-button-group button:disabled,
1065
+ .widget-button-group button:disabled {
1066
+ background-color: #f5f5f5;
1067
+ color: rgba(0, 0, 0, 0.4);
1068
+ border-color: #e5e7eb;
1069
+ cursor: not-allowed;
1070
+ opacity: 1;
1071
+ }
1072
+ /* 选中态按钮禁用后保持浅蓝底可辨识 */
1073
+ .widget-form .widget-button-group button[aria-pressed="true"]:disabled,
1074
+ .widget-button-group button[aria-pressed="true"]:disabled {
1075
+ background-color: #93c5fd;
1076
+ border-color: #93c5fd;
1077
+ color: rgba(255, 255, 255, 0.8);
1078
+ cursor: not-allowed;
1079
+ }
1080
+
1081
+ /* --- 文本输入 TextInput --- */
1082
+ .widget-text-input input[type="text"]:disabled {
1083
+ background-color: #f5f5f5;
1084
+ color: rgba(0, 0, 0, 0.4);
1085
+ border-color: #e5e7eb;
1086
+ cursor: not-allowed;
1087
+ }
1088
+
1089
+ /* --- 数字输入 NumberInput --- */
1090
+ .ni-wrap input:disabled {
1091
+ background-color: #f5f5f5;
1092
+ color: rgba(0, 0, 0, 0.4);
1093
+ border-color: #e5e7eb;
1094
+ cursor: not-allowed;
1095
+ }
1096
+ .ni-steps button:disabled {
1097
+ color: #d1d5db;
1098
+ cursor: not-allowed;
1099
+ }
1100
+
1101
+ /* --- 滑块 Slider:轨道变浅 + 拇指置灰 --- */
1102
+ .widget-slider input[type="range"]:disabled {
1103
+ background: #f0f0f0;
1104
+ cursor: not-allowed;
1105
+ }
1106
+ .widget-slider input[type="range"]:disabled::-webkit-slider-thumb {
1107
+ background: #d1d5db;
1108
+ cursor: not-allowed;
1109
+ }
1110
+ .widget-slider input[type="range"]:disabled::-moz-range-thumb {
1111
+ background: #d1d5db;
1112
+ cursor: not-allowed;
1113
+ }
1114
+ .widget-slider input[type="range"]:disabled::-webkit-slider-thumb:hover {
1115
+ background: #d1d5db;
1116
+ }
1117
+ .widget-slider input[type="range"]:disabled::-moz-range-thumb:hover {
1118
+ background: #d1d5db;
1119
+ }
1120
+ /* 数字值徽标同步置灰 */
1121
+ .widget-slider:has(input:disabled) .current-value {
1122
+ color: rgba(0, 0, 0, 0.4);
1123
+ background: #f5f5f5;
1124
+ }
1125
+
1126
+ /* --- 下拉选择 Select --- */
1127
+ .selector select:disabled {
1128
+ background-color: #f5f5f5;
1129
+ color: rgba(0, 0, 0, 0.4);
1130
+ border-color: #e5e7eb;
1131
+ cursor: not-allowed;
1132
+ }
1133
+
1134
+ /* --- 多选 SelectMulti:checkbox 与文字置灰 --- */
1135
+ .checkbox-group:has(input:disabled) {
1136
+ background-color: #f5f5f5;
1137
+ border-color: #e5e7eb;
1138
+ }
1139
+ .checkbox-group:has(input:disabled) .checkbox-item {
1140
+ cursor: not-allowed;
1141
+ }
1142
+ .checkbox-group:has(input:disabled) .checkbox-item:hover {
1143
+ background-color: transparent;
1144
+ }
1145
+ .checkbox-group:has(input:disabled) .checkbox-item span {
1146
+ color: rgba(0, 0, 0, 0.4);
1147
+ }
1148
+
1149
+ /* --- 单选 RadioGroup:圆点与文字置灰 --- */
1150
+ .radio-group:has(input:disabled) {
1151
+ background-color: #f5f5f5;
1152
+ border-color: #e5e7eb;
1153
+ }
1154
+ .radio-group:has(input:disabled) .radio-item {
1155
+ cursor: not-allowed;
1156
+ }
1157
+ .radio-group:has(input:disabled) .radio-item:hover {
1158
+ background-color: transparent;
1159
+ }
1160
+ .radio-group:has(input:disabled) .radio-item span {
1161
+ color: rgba(0, 0, 0, 0.4);
1162
+ }
1163
+
1164
+ /* --- Form 提交/重置/取消按钮 --- */
1165
+ .widget-form-actions button[type="button"]:disabled {
1166
+ background-color: #f5f5f5;
1167
+ color: rgba(0, 0, 0, 0.4);
1168
+ border-color: #e5e7eb;
1169
+ cursor: not-allowed;
1170
+ box-shadow: none;
1171
+ }
1172
+ /* 主按钮禁用保持淡蓝底区分 */
1173
+ .widget-form-actions .widget-form-submit:disabled {
1174
+ background-color: #93c5fd;
1175
+ color: rgba(255, 255, 255, 0.8);
1176
+ }
1177
+ .widget-form-actions button[type="button"]:disabled:hover {
1178
+ background-color: #f5f5f5;
1179
+ border-color: #e5e7eb;
1180
+ }
1181
+ .widget-form-actions .widget-form-submit:disabled:hover {
1182
+ background-color: #93c5fd;
1183
+ }
1184
+
1185
+ /* 传统模式(无 actions 容器)的提交按钮 */
1186
+ .widget-form > button[type="button"]:last-child:disabled {
1187
+ background-color: #93c5fd;
1188
+ color: rgba(255, 255, 255, 0.8);
1189
+ cursor: not-allowed;
1190
+ }
1191
+ .widget-form > button[type="button"]:last-child:disabled:hover {
1192
+ background-color: #93c5fd;
1193
+ }
1194
+
1195
+ /* --- 选择题 MCQ 选项(反馈态对/错优先于置灰) --- */
1196
+ .mcq-choice:disabled {
1197
+ cursor: not-allowed;
1198
+ opacity: 1;
1199
+ }
1200
+ .mcq-choice:disabled:not(.mcq-choice-correct):not(.mcq-choice-incorrect):not(.mcq-choice-selected) {
1201
+ background-color: #f5f5f5;
1202
+ color: rgba(0, 0, 0, 0.4);
1203
+ border-color: #e5e7eb;
1204
+ }
1205
+
1206
+ /* --- 简答题 SAQ 输入框 --- */
1207
+ .saq-input:disabled {
1208
+ background-color: #f5f5f5;
1209
+ color: rgba(0, 0, 0, 0.4);
1210
+ border-color: #e5e7eb;
1211
+ cursor: not-allowed;
1212
+ }
1213
+
1214
+ /* --- Quiz 内题目选项与输入 --- */
1215
+ .quiz-choice:disabled {
1216
+ cursor: not-allowed;
1217
+ opacity: 1;
1218
+ }
1219
+ .quiz-choice:disabled:not(.quiz-choice-correct):not(.quiz-choice-incorrect):not(.quiz-choice-selected) {
1220
+ background-color: #f5f5f5;
1221
+ color: rgba(0, 0, 0, 0.4);
1222
+ border-color: #e5e7eb;
1223
+ }
1224
+ .quiz-input:disabled {
1225
+ background-color: #f5f5f5;
1226
+ color: rgba(0, 0, 0, 0.4);
1227
+ border-color: #e5e7eb;
1228
+ cursor: not-allowed;
1229
+ }
1230
+
1231
+ /* --- DatePicker 输入按钮 --- */
1232
+ .dp-input:disabled {
1233
+ background-color: #f5f5f5;
1234
+ color: rgba(0, 0, 0, 0.4);
1235
+ border-color: #e5e7eb;
1236
+ cursor: not-allowed;
1237
+ }
1238
+ .dp-input:disabled:hover {
1239
+ border-color: #e5e7eb;
1240
+ }
1241
+
1242
+ /* --- Cascader 级联选择器 --- */
1243
+ .widget-cascader {
1244
+ position: relative;
1245
+ }
1246
+
1247
+ .cas-input {
1248
+ display: flex;
1249
+ align-items: center;
1250
+ gap: 0.375rem;
1251
+ width: 100%;
1252
+ padding: 0.625rem 0.75rem;
1253
+ border: 1px solid #d1d5db;
1254
+ border-radius: 6px;
1255
+ font-size: 0.875rem;
1256
+ background-color: #ffffff;
1257
+ cursor: pointer;
1258
+ transition: border-color 0.2s ease, box-shadow 0.2s ease;
1259
+ text-align: left;
1260
+ }
1261
+ .cas-input:hover { border-color: #93c5fd; }
1262
+ .cas-input:focus {
1263
+ outline: none;
1264
+ border-color: #3b82f6;
1265
+ box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
1266
+ }
1267
+ /* 禁用态:置灰 + 禁止交互 */
1268
+ .cas-input:disabled {
1269
+ background-color: #f5f5f5;
1270
+ color: rgba(0, 0, 0, 0.4);
1271
+ border-color: #e5e7eb;
1272
+ cursor: not-allowed;
1273
+ }
1274
+ .cas-input:disabled:hover { border-color: #e5e7eb; }
1275
+
1276
+ .cas-input-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1 1 auto; min-width: 0; }
1277
+ .cas-placeholder { color: #9ca3af; }
1278
+ .cas-arrow { color: #9ca3af; font-size: 0.75rem; transition: transform 0.2s ease; }
1279
+ .cas-arrow-open { transform: rotate(180deg); }
1280
+ .cas-clear {
1281
+ padding: 0 0.25rem;
1282
+ color: #9ca3af;
1283
+ font-size: 1rem;
1284
+ line-height: 1;
1285
+ }
1286
+ .cas-clear:hover { color: #374151; }
1287
+
1288
+ /* 级联面板:横向多级菜单并排 */
1289
+ .cas-panel {
1290
+ position: absolute;
1291
+ z-index: 50;
1292
+ top: calc(100% + 4px);
1293
+ left: 0;
1294
+ display: flex;
1295
+ background: #ffffff;
1296
+ border: 1px solid #e5e7eb;
1297
+ border-radius: 8px;
1298
+ box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
1299
+ }
1300
+ .cas-menu {
1301
+ width: 160px;
1302
+ max-height: 240px;
1303
+ overflow-y: auto;
1304
+ padding: 0.375rem;
1305
+ }
1306
+ .cas-menu + .cas-menu {
1307
+ border-left: 1px solid #f3f4f6;
1308
+ }
1309
+ .cas-option {
1310
+ display: flex;
1311
+ align-items: center;
1312
+ justify-content: space-between;
1313
+ gap: 0.5rem;
1314
+ width: 100%;
1315
+ padding: 0.375rem 0.5rem;
1316
+ border: none;
1317
+ border-radius: 4px;
1318
+ background: transparent;
1319
+ font-size: 0.875rem;
1320
+ color: #111827;
1321
+ cursor: pointer;
1322
+ text-align: left;
1323
+ transition: background 0.15s ease;
1324
+ }
1325
+ .cas-option:hover { background: #f3f4f6; }
1326
+ .cas-option-active { background: #eff6ff; color: #1d4ed8; font-weight: 500; }
1327
+ .cas-option-active:hover { background: #dbeafe; }
1328
+ .cas-option-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
1329
+ .cas-option-arrow { color: #9ca3af; font-size: 0.875rem; flex: 0 0 auto; }
1330
+ .cas-empty {
1331
+ padding: 0.75rem 0.5rem;
1332
+ font-size: 0.8125rem;
1333
+ color: #9ca3af;
1334
+ text-align: center;
1335
+ }
1336
+
1337
+ /* --- Select 可搜索模式(searchable):面板内置搜索框的单列下拉 --- */
1338
+ /* 内容区:relative 供面板 absolute 定位(复用 .widget-field-content) */
1339
+ .widget-select-content {
1340
+ position: relative;
1341
+ display: flex;
1342
+ flex-direction: column;
1343
+ }
1344
+ /* 单列面板:纵向排搜索框 + 选项列表,宽度跟随触发按钮 */
1345
+ .cas-panel-single {
1346
+ flex-direction: column;
1347
+ min-width: 100%;
1348
+ width: auto;
1349
+ }
1350
+ /* 搜索框区:面板顶部固定,不随选项滚动 */
1351
+ .cas-search {
1352
+ padding: 0.5rem;
1353
+ border-bottom: 1px solid #f3f4f6;
1354
+ }
1355
+ .cas-search-input {
1356
+ width: 100%;
1357
+ padding: 0.375rem 0.625rem;
1358
+ border: 1px solid #d1d5db;
1359
+ border-radius: 4px;
1360
+ font-size: 0.8125rem;
1361
+ box-sizing: border-box;
1362
+ }
1363
+ .cas-search-input:focus {
1364
+ outline: none;
1365
+ border-color: #3b82f6;
1366
+ box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
1367
+ }
1368
+ /* 选项列表:占满面板宽度并滚动 */
1369
+ .cas-menu-full {
1370
+ width: 100%;
1371
+ flex: 1 1 auto;
1372
+ min-width: 0;
1373
+ }