mail-editor-pancake 0.0.0 → 0.0.8

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 (45) hide show
  1. package/README.md +79 -6
  2. package/package.json +1 -1
  3. package/packages/blocks/dist/index.d.ts +55 -3
  4. package/packages/blocks/dist/index.js +267 -208
  5. package/packages/blocks/dist/index.js.map +1 -1
  6. package/packages/blocks/node_modules/.bin/resolve +21 -0
  7. package/packages/blocks/package.json +1 -0
  8. package/packages/blocks/src/button.ts +1 -0
  9. package/packages/blocks/src/hero.ts +2 -0
  10. package/packages/blocks/src/image.ts +1 -0
  11. package/packages/blocks/src/index.ts +19 -2
  12. package/packages/blocks/src/logo.ts +1 -0
  13. package/packages/blocks/src/social.ts +47 -22
  14. package/packages/blocks/src/socialGroup.ts +49 -22
  15. package/packages/blocks/src/socialShared.ts +39 -2
  16. package/packages/blocks/src/text.ts +25 -19
  17. package/packages/blocks/tsconfig.json +0 -3
  18. package/packages/blocks/vite.config.ts +2 -0
  19. package/packages/core/dist/index.d.ts +90 -7
  20. package/packages/core/dist/index.js +2505 -1462
  21. package/packages/core/dist/index.js.map +1 -1
  22. package/packages/core/dist/style.css +1 -1
  23. package/packages/core/src/editor/Canvas.ts +107 -53
  24. package/packages/core/src/editor/ColorPickerPopover.ts +291 -0
  25. package/packages/core/src/editor/Editor.ts +129 -8
  26. package/packages/core/src/editor/ExportModal.ts +2 -1
  27. package/packages/core/src/editor/FocusBreadcrumb.ts +120 -0
  28. package/packages/core/src/editor/ImageGalleryModal.ts +3 -3
  29. package/packages/core/src/editor/InlineEditor.ts +308 -66
  30. package/packages/core/src/editor/LeftPanel.ts +1 -2
  31. package/packages/core/src/editor/PreviewModal.ts +77 -7
  32. package/packages/core/src/editor/RichTextToolbar.ts +66 -44
  33. package/packages/core/src/editor/RightPanel.ts +773 -171
  34. package/packages/core/src/editor/SourceView.ts +2 -1
  35. package/packages/core/src/editor/Topbar.ts +150 -5
  36. package/packages/core/src/editor/styles.css +644 -81
  37. package/packages/core/src/index.ts +18 -1
  38. package/packages/core/src/renderer/mjml.ts +2 -1
  39. package/packages/core/src/store/store.ts +44 -3
  40. package/packages/core/src/types.ts +34 -3
  41. package/packages/core/src/utils/fontWeightSteps.ts +31 -0
  42. package/packages/core/src/utils/lockedMjml.ts +2 -1
  43. package/packages/core/src/utils/richTextCommand.ts +30 -0
  44. package/packages/core/src/utils/sectionLayout.ts +13 -0
  45. package/playground/vanilla/src/main.ts +1 -1
@@ -34,9 +34,15 @@
34
34
  --sm-empty-column-border: #d6d8dd;
35
35
  --sm-empty-column-stripe: rgba(0, 0, 0, 0.02);
36
36
  --sm-on-primary: #ffffff;
37
- --sm-gallery-cell-bg: #f4f5f7;
38
- --sm-gallery-thumb-bg: #e9ebef;
37
+ --sm-gallery-cell-bg: #ebecef;
38
+ --sm-gallery-thumb-bg: #dde1e8;
39
39
  --sm-gallery-cell-hover-border: #d6d9df;
40
+ /* 三栏与画布边距(窄屏见文末 @media) */
41
+ --sm-layout-col-left: 240px;
42
+ --sm-layout-col-right: 300px;
43
+ --sm-canvas-pad-top: 48px;
44
+ --sm-canvas-pad-x: 24px;
45
+ --sm-canvas-pad-bottom: 24px;
40
46
 
41
47
  position: relative;
42
48
  display: grid;
@@ -49,6 +55,13 @@
49
55
  background: var(--sm-bg);
50
56
  }
51
57
 
58
+ .sm-root:fullscreen,
59
+ .sm-root:-webkit-full-screen {
60
+ width: 100%;
61
+ height: 100%;
62
+ background: var(--sm-bg);
63
+ }
64
+
52
65
  .sm-root *,
53
66
  .sm-root *::before,
54
67
  .sm-root *::after {
@@ -77,8 +90,8 @@
77
90
  --sm-empty-column-border: #3d444d;
78
91
  --sm-empty-column-stripe: rgba(255, 255, 255, 0.04);
79
92
  --sm-on-primary: #ffffff;
80
- --sm-gallery-cell-bg: #21262d;
81
- --sm-gallery-thumb-bg: #30363d;
93
+ --sm-gallery-cell-bg: #252c36;
94
+ --sm-gallery-thumb-bg: #343d4a;
82
95
  --sm-gallery-cell-hover-border: #484f58;
83
96
  }
84
97
 
@@ -105,8 +118,8 @@
105
118
  --sm-empty-column-border: #3d444d;
106
119
  --sm-empty-column-stripe: rgba(255, 255, 255, 0.04);
107
120
  --sm-on-primary: #ffffff;
108
- --sm-gallery-cell-bg: #21262d;
109
- --sm-gallery-thumb-bg: #30363d;
121
+ --sm-gallery-cell-bg: #252c36;
122
+ --sm-gallery-thumb-bg: #343d4a;
110
123
  --sm-gallery-cell-hover-border: #484f58;
111
124
  }
112
125
  }
@@ -138,6 +151,55 @@
138
151
  flex: 1;
139
152
  }
140
153
 
154
+ .sm-focus-crumb {
155
+ display: flex;
156
+ align-items: center;
157
+ flex-wrap: wrap;
158
+ gap: 2px;
159
+ width: 100%;
160
+ min-width: 0;
161
+ font-size: 12px;
162
+ line-height: 1.35;
163
+ color: var(--sm-text-muted);
164
+ }
165
+ .sm-focus-crumb__sep {
166
+ flex-shrink: 0;
167
+ padding: 0 2px;
168
+ color: var(--sm-text-muted);
169
+ opacity: 0.55;
170
+ user-select: none;
171
+ }
172
+ .sm-focus-crumb__item {
173
+ display: inline-block;
174
+ max-width: 9em;
175
+ overflow: hidden;
176
+ text-overflow: ellipsis;
177
+ white-space: nowrap;
178
+ border: 0;
179
+ background: transparent;
180
+ padding: 2px 6px;
181
+ margin: 0;
182
+ border-radius: var(--sm-radius-sm);
183
+ font: inherit;
184
+ font-size: 12px;
185
+ color: var(--sm-text-muted);
186
+ cursor: pointer;
187
+ vertical-align: middle;
188
+ }
189
+ .sm-focus-crumb__item:hover {
190
+ background: var(--sm-ghost-hover-bg);
191
+ color: var(--sm-text);
192
+ }
193
+ .sm-focus-crumb__item--current {
194
+ color: var(--sm-text);
195
+ font-weight: 600;
196
+ cursor: default;
197
+ }
198
+ .sm-focus-crumb__item--current:hover {
199
+ background: transparent;
200
+ color: var(--sm-text);
201
+ }
202
+
141
203
  .sm-topbar__theme-seg {
142
204
  flex-shrink: 0;
143
205
  }
@@ -179,6 +241,31 @@
179
241
  flex-shrink: 0;
180
242
  }
181
243
 
244
+ .sm-topbar__icon-btn {
245
+ flex-shrink: 0;
246
+ min-width: 28px;
247
+ width: 28px;
248
+ height: 28px;
249
+ padding: 0;
250
+ justify-content: center;
251
+ gap: 0;
252
+ }
253
+ .sm-topbar__icon-btn svg {
254
+ display: block;
255
+ flex-shrink: 0;
256
+ }
257
+ .sm-topbar__toggle-btn[aria-pressed="true"] {
258
+ background: var(--sm-primary-soft);
259
+ color: var(--sm-primary);
260
+ }
261
+ .sm-topbar__toggle-btn .sm-layout-borders-check {
262
+ opacity: 0;
263
+ transition: opacity 0.12s ease;
264
+ }
265
+ .sm-topbar__toggle-btn[aria-pressed="true"] .sm-layout-borders-check {
266
+ opacity: 1;
267
+ }
268
+
182
269
  .sm-btn {
183
270
  display: inline-flex;
184
271
  align-items: center;
@@ -199,7 +286,16 @@
199
286
  border-color: var(--sm-primary);
200
287
  color: var(--sm-on-primary);
201
288
  }
202
- .sm-btn--primary:hover { filter: brightness(1.05); }
289
+ /*
290
+ * .sm-btn:hover 会给所有按钮铺上 surface-hover 背景;主按钮若不覆盖 background,
291
+ * 会出现浅色底 + --sm-on-primary 白字(导出/下载/图库插入等在外层页面里几乎看不见)。
292
+ */
293
+ .sm-btn--primary:hover:not([disabled]) {
294
+ background: var(--sm-primary);
295
+ border-color: var(--sm-primary);
296
+ color: var(--sm-on-primary);
297
+ filter: brightness(1.05);
298
+ }
203
299
  .sm-btn--ghost { border-color: transparent; background: transparent; }
204
300
  .sm-btn--ghost:hover { background: var(--sm-ghost-hover-bg); }
205
301
  .sm-btn--secondary {
@@ -225,6 +321,9 @@
225
321
  background: var(--sm-surface);
226
322
  }
227
323
  .sm-segmented__item {
324
+ display: inline-flex;
325
+ align-items: center;
326
+ justify-content: center;
228
327
  height: 28px;
229
328
  padding: 0 12px;
230
329
  border: 0;
@@ -238,22 +337,62 @@
238
337
  color: var(--sm-primary);
239
338
  font-weight: 600;
240
339
  }
340
+ .sm-segmented--fill {
341
+ display: flex;
342
+ width: 100%;
343
+ align-self: stretch;
344
+ }
345
+ .sm-segmented--fill .sm-segmented__item {
346
+ flex: 1;
347
+ min-width: 0;
348
+ padding: 0 6px;
349
+ }
241
350
 
242
351
  /* 主体三栏 ---------------------------------------------------------------- */
243
352
  .sm-body {
244
353
  position: relative;
245
354
  z-index: 2;
246
355
  display: grid;
247
- grid-template-columns: 240px 1fr 300px;
356
+ grid-template-columns: var(--sm-layout-col-left) minmax(0, 1fr)
357
+ var(--sm-layout-col-right);
248
358
  min-height: 0;
359
+ overflow: auto;
360
+ }
361
+
362
+ .sm-body.sm-body--source {
363
+ grid-template-columns: minmax(0, 1fr);
249
364
  }
250
365
 
251
366
  .sm-panel {
252
367
  background: var(--sm-panel-bg);
253
368
  border-right: 1px solid var(--sm-border);
254
369
  overflow: auto;
370
+ min-width: 0;
371
+ }
372
+ .sm-panel--right {
373
+ border-right: 0;
374
+ border-left: 1px solid var(--sm-border);
375
+ display: flex;
376
+ flex-direction: column;
377
+ overflow: hidden;
378
+ }
379
+
380
+ .sm-panel__head {
381
+ flex-shrink: 0;
382
+ padding: 10px 12px 8px;
383
+ border-bottom: 1px solid var(--sm-border);
384
+ background: var(--sm-panel-bg);
385
+ }
386
+
387
+ .sm-panel__head[hidden] {
388
+ display: none;
389
+ }
390
+
391
+ .sm-panel__body {
392
+ flex: 1;
393
+ min-height: 0;
394
+ overflow: auto;
255
395
  }
256
- .sm-panel--right { border-right: 0; border-left: 1px solid var(--sm-border); }
257
396
 
258
397
  .sm-panel__title {
259
398
  font-size: 12px;
@@ -310,8 +449,30 @@
310
449
  /* 中栏:画布 ------------------------------------------------------------- */
311
450
  .sm-canvas-wrap {
312
451
  background: var(--sm-canvas-bg);
313
- padding: 48px 24px 24px;
452
+ padding: var(--sm-canvas-pad-top) var(--sm-canvas-pad-x)
453
+ var(--sm-canvas-pad-bottom);
314
454
  overflow: auto;
455
+ min-width: 0;
456
+ }
457
+
458
+ @media (max-width: 1366px) {
459
+ .sm-root {
460
+ --sm-layout-col-left: 208px;
461
+ --sm-layout-col-right: 268px;
462
+ --sm-canvas-pad-top: 36px;
463
+ --sm-canvas-pad-x: 16px;
464
+ --sm-canvas-pad-bottom: 20px;
465
+ }
466
+ }
467
+
468
+ @media (max-width: 1180px) {
469
+ .sm-root {
470
+ --sm-layout-col-left: 184px;
471
+ --sm-layout-col-right: 244px;
472
+ --sm-canvas-pad-top: 28px;
473
+ --sm-canvas-pad-x: 12px;
474
+ --sm-canvas-pad-bottom: 16px;
475
+ }
315
476
  }
316
477
 
317
478
  .sm-canvas {
@@ -325,28 +486,85 @@
325
486
  /* 由 Canvas 在运行时设为 doc.styles.linkColor;兜底与默认邮件 link 橙一致 */
326
487
  --sm-editor-link-color: #ff5a00;
327
488
  }
328
- /* 用户代理对 <a> 的默认色会盖过继承的 color,需与预览/MJML 全局链接色对齐 */
329
- .sm-canvas a,
330
- .sm-canvas a:link,
331
- .sm-canvas a:visited,
332
- .sm-canvas a:hover,
333
- .sm-canvas a:active {
334
- color: var(--sm-editor-link-color) !important;
489
+ /*
490
+ * 无 inline color 时使用文档级链接色;局部 style 优先于全局(不用 !important,避免盖过 foreColor)。
491
+ * 属性选择器排除 background-color 等误匹配(仅匹配 style 中的 color: 声明)。
492
+ */
493
+ .sm-canvas a:not([style^="color:"]):not([style*=";color:"]):not([style*="; color:"]),
494
+ .sm-canvas a:not([style^="color:"]):not([style*=";color:"]):not([style*="; color:"]):link,
495
+ .sm-canvas a:not([style^="color:"]):not([style*=";color:"]):not([style*="; color:"]):visited,
496
+ .sm-canvas a:not([style^="color:"]):not([style*=";color:"]):not([style*="; color:"]):hover,
497
+ .sm-canvas a:not([style^="color:"]):not([style*=";color:"]):not([style*="; color:"]):active {
498
+ color: var(--sm-editor-link-color);
335
499
  }
336
500
 
337
501
  .sm-canvas .sm-text-content :where(p) {
338
502
  margin: 0;
339
503
  }
340
504
 
341
- /* Section 在画布中的呈现层(包了一层壳便于选中/排序) */
505
+ /* 宿主全局 reset(如 p/strong { font-weight:400 })会盖过块级字重配置,子节点须继承容器 */
506
+ .sm-canvas .sm-text-content :where(
507
+ p,
508
+ li,
509
+ td,
510
+ th,
511
+ span,
512
+ div,
513
+ h1,
514
+ h2,
515
+ h3,
516
+ h4,
517
+ h5,
518
+ h6,
519
+ address,
520
+ caption
521
+ ) {
522
+ font-weight: inherit;
523
+ }
524
+
525
+ .sm-canvas .sm-text-content :where(strong, b) {
526
+ font-weight: bolder;
527
+ }
528
+
529
+ .sm-canvas .sm-text-content :where(ul, ol) {
530
+ margin: 0.5em 0;
531
+ padding-left: 1.5em;
532
+ list-style-position: outside;
533
+ }
534
+
535
+ .sm-canvas .sm-text-content ul {
536
+ list-style-type: disc;
537
+ }
538
+
539
+ .sm-canvas .sm-text-content ol {
540
+ list-style-type: decimal;
541
+ }
542
+
543
+ /* Section 外层:Sortable 拖拽壳,与列内 Sortable 分离避免嵌套冲突 */
544
+ .sm-section-host {
545
+ position: relative;
546
+ }
547
+ .sm-section-host:hover,
548
+ .sm-section-host.is-selected,
549
+ .sm-section-host.sm-chosen,
550
+ .sm-section-host.sm-drag {
551
+ z-index: 5;
552
+ }
553
+
554
+ /* Section 在画布中的呈现层 */
342
555
  .sm-section {
343
556
  position: relative;
344
557
  outline: 1px dashed transparent;
345
558
  outline-offset: -1px;
346
559
  transition: outline-color 0.12s;
347
560
  }
348
- .sm-section:hover { outline-color: var(--sm-outline-muted); }
349
- .sm-section.is-selected {
561
+ .sm-root.sm-show-layout-borders .sm-section {
562
+ outline-color: var(--sm-outline-muted);
563
+ }
564
+ .sm-section-host:hover .sm-section {
565
+ outline-color: var(--sm-outline-muted);
566
+ }
567
+ .sm-section-host.is-selected .sm-section {
350
568
  outline: 2px solid var(--sm-primary);
351
569
  }
352
570
  .sm-section__toolbar {
@@ -354,19 +572,37 @@
354
572
  top: auto;
355
573
  bottom: 100%;
356
574
  right: 8px;
575
+ left: auto;
357
576
  margin-bottom: 10px;
358
- z-index: 1;
577
+ z-index: 10;
359
578
  display: none;
360
579
  align-items: center;
361
580
  gap: 6px;
362
581
  flex-direction: row;
363
582
  flex-wrap: nowrap;
364
583
  max-width: calc(100% - 16px);
365
- /* 贴在 Section 上沿之上,避免压住白纸圆角与选中描边(translateY(-100%) 在部分布局下仍会叠在内容上) */
584
+ pointer-events: auto;
585
+ transition: margin-bottom 0.12s ease;
586
+ /* 贴在 Section 上沿之上,避免压住白纸圆角与选中描边 */
366
587
  transform: none;
367
588
  }
368
- .sm-section.is-selected .sm-section__toolbar,
369
- .sm-section:hover .sm-section__toolbar {
589
+ /* 内部 Block 工具条可见时,Section 工具条上移让位(尤其多列第一列 Block 条在左侧,避免叠层抢点击) */
590
+ .sm-section-host:has(.sm-block:hover) .sm-section__toolbar,
591
+ .sm-section-host:has(.sm-block.is-selected) .sm-section__toolbar,
592
+ .sm-section-host:has(.sm-block.is-editing) .sm-section__toolbar {
593
+ /* margin-bottom: calc(10px + 44px); */
594
+ }
595
+ /* Block 交互时抬高内容层,保证列内工具条(z-index:30)在 Section 工具条之上可点 */
596
+ .sm-section-host:has(.sm-block:hover) .sm-section,
597
+ .sm-section-host:has(.sm-block.is-selected) .sm-section,
598
+ .sm-section-host:has(.sm-block.is-editing) .sm-section {
599
+ position: relative;
600
+ z-index: 20;
601
+ }
602
+ .sm-section-host.is-selected .sm-section__toolbar,
603
+ .sm-section-host:hover .sm-section__toolbar,
604
+ .sm-section-host.sm-chosen .sm-section__toolbar,
605
+ .sm-section-host.sm-drag .sm-section__toolbar {
370
606
  display: inline-flex;
371
607
  }
372
608
  .sm-section__toolbar-label {
@@ -382,7 +618,7 @@
382
618
  user-select: none;
383
619
  flex-shrink: 0;
384
620
  }
385
- .sm-section.is-selected .sm-section__toolbar-label {
621
+ .sm-section-host.is-selected .sm-section__toolbar-label {
386
622
  border-color: var(--sm-primary-soft);
387
623
  color: var(--sm-primary);
388
624
  }
@@ -392,9 +628,28 @@
392
628
  gap: 4px;
393
629
  flex-shrink: 0;
394
630
  }
395
- .sm-section.is-selected .sm-section__toolbar-actions {
631
+ .sm-section-host.is-selected .sm-section__toolbar-actions,
632
+ .sm-section-host.sm-chosen .sm-section__toolbar-actions,
633
+ .sm-section-host.sm-drag .sm-section__toolbar-actions {
396
634
  display: inline-flex;
397
635
  }
636
+ .sm-section-host.is-selected .sm-section__toolbar,
637
+ .sm-section-host.sm-chosen .sm-section__toolbar,
638
+ .sm-section-host.sm-drag .sm-section__toolbar {
639
+ background: rgba(31, 35, 40, 0.92);
640
+ padding: 4px 6px;
641
+ border-radius: 6px;
642
+ box-shadow: 0 4px 14px rgba(16, 24, 40, 0.14);
643
+ }
644
+ .sm-section-host.is-selected .sm-section__toolbar-label,
645
+ .sm-section-host.sm-chosen .sm-section__toolbar-label,
646
+ .sm-section-host.sm-drag .sm-section__toolbar-label {
647
+ background: transparent;
648
+ border: 0;
649
+ box-shadow: none;
650
+ padding: 0;
651
+ color: rgba(255, 255, 255, 0.88);
652
+ }
398
653
  .sm-tool-btn {
399
654
  width: 24px;
400
655
  height: 24px;
@@ -409,13 +664,18 @@
409
664
  }
410
665
  .sm-tool-btn:hover { filter: brightness(1.1); }
411
666
  .sm-tool-btn--danger { background: var(--sm-danger); }
667
+ .sm-section__handle { cursor: grab; }
668
+ .sm-section__handle:active { cursor: grabbing; }
412
669
 
413
670
  .sm-section__columns {
414
671
  position: relative;
415
- z-index: 2;
416
672
  display: flex;
417
673
  width: 100%;
418
674
  }
675
+ .sm-section-host.sm-chosen .sm-section__columns,
676
+ .sm-section-host.sm-drag .sm-section__columns {
677
+ pointer-events: none;
678
+ }
419
679
 
420
680
  .sm-column {
421
681
  flex: 1 1 auto;
@@ -448,13 +708,30 @@
448
708
  .sm-block {
449
709
  position: relative;
450
710
  outline: 1px dashed transparent;
451
- outline-offset: -2px;
711
+ /* 不用负 offset,避免行首 caret 被描边盖住 */
712
+ outline-offset: 0;
452
713
  }
453
- .sm-block:hover { outline-color: var(--sm-outline-muted); }
454
- .sm-block.is-selected { outline: 2px solid var(--sm-primary); }
455
- .sm-block.is-editing {
714
+ .sm-root.sm-show-layout-borders .sm-block:not(.is-selected):not(.is-editing) {
715
+ outline-color: var(--sm-outline-muted);
716
+ }
717
+ .sm-block:hover:not(.is-selected):not(.is-editing) {
718
+ outline-color: var(--sm-outline-muted);
719
+ }
720
+ .sm-block.is-selected:not(.is-editing) {
456
721
  outline: 2px solid var(--sm-primary);
722
+ }
723
+ .sm-block.is-editing {
724
+ /* 编辑中:块级虚线框(偏外),与内层 focus 实线区分 */
725
+ outline: 1px dashed color-mix(in srgb, var(--sm-primary) 55%, var(--sm-border));
726
+ outline-offset: 3px;
457
727
  cursor: text;
728
+ /* 列内 Block 按 DOM 顺序绘制;下方块(如 padding-top:0 的分割线)会盖住 offset 描边 */
729
+ z-index: 3;
730
+ }
731
+ /* hover / 选中态同样抬升,避免 2px 实线描边被相邻块遮挡(编辑态 z-index 更高,见 .is-editing) */
732
+ .sm-block:hover:not(.is-editing),
733
+ .sm-block.is-selected:not(.is-editing) {
734
+ z-index: 2;
458
735
  }
459
736
  .sm-block__content { position: relative; }
460
737
 
@@ -464,7 +741,7 @@
464
741
  bottom: 100%;
465
742
  right: 0;
466
743
  margin-bottom: 8px;
467
- z-index: 20;
744
+ z-index: 30;
468
745
  display: none;
469
746
  align-items: center;
470
747
  gap: 6px;
@@ -641,6 +918,7 @@
641
918
  align-items: center;
642
919
  }
643
920
  .sm-social-link-list__color {
921
+ cursor: pointer;
644
922
  width: 100%;
645
923
  height: 32px;
646
924
  padding: 2px;
@@ -761,6 +1039,16 @@
761
1039
  text-align: center;
762
1040
  line-height: 1.2;
763
1041
  }
1042
+ .sm-spacing-row input[type='range'],
1043
+ .sm-field__slider-row input[type='range'],
1044
+ .sm-width-field__slider-row input[type='range'] {
1045
+ cursor: pointer;
1046
+ }
1047
+ .sm-spacing-row input[type='range']::-webkit-slider-thumb,
1048
+ .sm-field__slider-row input[type='range']::-webkit-slider-thumb,
1049
+ .sm-width-field__slider-row input[type='range']::-webkit-slider-thumb {
1050
+ cursor: pointer;
1051
+ }
764
1052
  .sm-spacing-row input[type='range'] {
765
1053
  flex: 1 1 auto;
766
1054
  min-width: 0;
@@ -768,8 +1056,9 @@
768
1056
  accent-color: var(--sm-primary);
769
1057
  }
770
1058
  .sm-spacing-row .sm-input {
771
- flex: 0 0 52px;
772
- width: 52px;
1059
+ flex: 0 0 64px;
1060
+ width: 64px;
1061
+ min-width: 64px;
773
1062
  text-align: center;
774
1063
  }
775
1064
 
@@ -787,11 +1076,67 @@
787
1076
  font-size: 11px;
788
1077
  }
789
1078
 
1079
+ .sm-field__label-row {
1080
+ display: flex;
1081
+ align-items: center;
1082
+ justify-content: space-between;
1083
+ gap: 8px;
1084
+ }
1085
+
1086
+ .sm-inherit-switch {
1087
+ display: flex;
1088
+ align-items: center;
1089
+ justify-content: space-between;
1090
+ gap: 8px;
1091
+ }
1092
+ .sm-inherit-switch__label {
1093
+ display: inline-flex;
1094
+ align-items: center;
1095
+ gap: 6px;
1096
+ cursor: pointer;
1097
+ user-select: none;
1098
+ }
1099
+ .sm-inherit-switch__text {
1100
+ font-size: 12px;
1101
+ color: var(--sm-text-muted);
1102
+ }
1103
+ .sm-inherit-switch__input {
1104
+ width: 28px;
1105
+ height: 16px;
1106
+ margin: 0;
1107
+ accent-color: var(--sm-primary);
1108
+ cursor: pointer;
1109
+ }
1110
+ .sm-inherit-switch__value {
1111
+ font-size: 12px;
1112
+ color: var(--sm-text-muted);
1113
+ font-variant-numeric: tabular-nums;
1114
+ }
1115
+ .sm-inherit-switch__value[hidden] {
1116
+ display: none;
1117
+ }
1118
+ .sm-segmented--disabled {
1119
+ opacity: 0.45;
1120
+ }
1121
+
790
1122
  .sm-field__slider-row {
791
1123
  display: flex;
792
1124
  align-items: center;
793
1125
  gap: 8px;
794
1126
  }
1127
+ .sm-field__slider-row--inherit {
1128
+ opacity: 0.55;
1129
+ }
1130
+ .sm-field__slider-row--inherit input[type='range'] {
1131
+ accent-color: var(--sm-outline-muted);
1132
+ }
1133
+ .sm-field__slider-row--inherit input[type='number']:disabled {
1134
+ background: var(--sm-surface-hover);
1135
+ color: var(--sm-text-muted);
1136
+ }
1137
+ .sm-input--inherit-disabled {
1138
+ opacity: 0.55;
1139
+ }
795
1140
  .sm-field__slider-row input[type='range'] {
796
1141
  flex: 1;
797
1142
  min-width: 0;
@@ -799,11 +1144,12 @@
799
1144
  accent-color: var(--sm-primary);
800
1145
  }
801
1146
  .sm-field__slider-row .sm-input {
802
- width: 52px;
1147
+ flex: 0 0 64px;
1148
+ width: 64px;
1149
+ min-width: 64px;
803
1150
  flex-shrink: 0;
804
1151
  text-align: center;
805
1152
  }
806
-
807
1153
  .sm-segmented--wrap {
808
1154
  flex-wrap: wrap;
809
1155
  max-width: 100%;
@@ -825,8 +1171,9 @@
825
1171
  accent-color: var(--sm-primary);
826
1172
  }
827
1173
  .sm-width-field__slider-row .sm-input {
828
- flex: 0 0 60px;
829
- width: 60px;
1174
+ flex: 0 0 64px;
1175
+ width: 64px;
1176
+ min-width: 64px;
830
1177
  text-align: center;
831
1178
  }
832
1179
  .sm-width-field__slider-row.is-disabled {
@@ -842,6 +1189,11 @@
842
1189
  border: 1px solid var(--sm-border);
843
1190
  border-radius: 6px;
844
1191
  background: none;
1192
+ cursor: pointer;
1193
+ }
1194
+ .sm-color-row input[type='color'].sm-color-row__pick--inherit {
1195
+ opacity: 0.55;
1196
+ border-style: dashed;
845
1197
  }
846
1198
 
847
1199
  .sm-empty-form {
@@ -914,13 +1266,26 @@
914
1266
 
915
1267
  /* 内联编辑 + 富文本浮动工具条 -------------------------------------------- */
916
1268
  .sm-inline-editing {
917
- outline: 2px dashed var(--sm-primary) !important;
1269
+ /* 编辑中未聚焦(如点浮动工具条):虚线 + 淡底;正 offset 不挡行首 caret */
1270
+ outline: 2px dashed color-mix(in srgb, var(--sm-primary) 70%, var(--sm-outline-muted)) !important;
918
1271
  outline-offset: 2px;
1272
+ box-shadow: none;
1273
+ border-radius: 2px;
1274
+ background-color: color-mix(in srgb, var(--sm-primary-soft) 55%, transparent);
919
1275
  cursor: text;
920
1276
  min-height: 1em;
921
1277
  caret-color: var(--sm-primary);
1278
+ transition:
1279
+ outline-color 0.12s ease,
1280
+ box-shadow 0.12s ease,
1281
+ background-color 0.12s ease;
1282
+ }
1283
+ .sm-inline-editing:focus {
1284
+ outline: 2px solid var(--sm-primary) !important;
1285
+ outline-offset: 2px;
1286
+ box-shadow: 0 0 0 4px var(--sm-primary-soft);
1287
+ background-color: color-mix(in srgb, var(--sm-primary-soft) 35%, transparent);
922
1288
  }
923
- .sm-inline-editing:focus { outline-style: solid !important; }
924
1289
  .sm-inline-editing:empty::before {
925
1290
  content: attr(data-placeholder);
926
1291
  color: var(--sm-placeholder);
@@ -1017,6 +1382,89 @@
1017
1382
  .sm-floating-toolbar__link-panel .sm-input::placeholder { color: rgba(255,255,255,0.5); }
1018
1383
  .sm-floating-toolbar__link-panel .sm-btn { height: 26px; }
1019
1384
 
1385
+ /* 自定义色板(右栏 / 富文本色卡) ---------------------------------------- */
1386
+ .sm-color-picker-layer {
1387
+ position: absolute;
1388
+ z-index: 210;
1389
+ }
1390
+ .sm-color-picker {
1391
+ width: 220px;
1392
+ padding: 10px;
1393
+ background: var(--sm-surface, #fff);
1394
+ border: 1px solid var(--sm-border, #e6e8ec);
1395
+ border-radius: var(--sm-radius-sm, 6px);
1396
+ box-shadow: var(--sm-shadow-md, 0 4px 16px rgba(16, 24, 40, 0.08));
1397
+ }
1398
+ .sm-color-picker__head {
1399
+ display: flex;
1400
+ align-items: center;
1401
+ justify-content: space-between;
1402
+ gap: 8px;
1403
+ margin-bottom: 8px;
1404
+ }
1405
+ .sm-color-picker__title {
1406
+ font-size: 12px;
1407
+ font-weight: 600;
1408
+ color: var(--sm-text, #1f2328);
1409
+ }
1410
+ .sm-color-picker__close {
1411
+ flex-shrink: 0;
1412
+ width: 24px;
1413
+ height: 24px;
1414
+ padding: 0;
1415
+ border: 0;
1416
+ border-radius: var(--sm-radius-sm, 6px);
1417
+ background: transparent;
1418
+ color: var(--sm-text-muted, #6b7280);
1419
+ font-size: 18px;
1420
+ line-height: 1;
1421
+ cursor: pointer;
1422
+ }
1423
+ .sm-color-picker__close:hover {
1424
+ background: var(--sm-ghost-hover-bg, #f0f1f4);
1425
+ color: var(--sm-text, #1f2328);
1426
+ }
1427
+ .sm-color-picker__swatches {
1428
+ display: grid;
1429
+ grid-template-columns: repeat(8, 1fr);
1430
+ gap: 4px;
1431
+ margin-bottom: 8px;
1432
+ }
1433
+ .sm-color-picker__swatch {
1434
+ width: 100%;
1435
+ aspect-ratio: 1;
1436
+ padding: 0;
1437
+ border: 1px solid rgba(0, 0, 0, 0.08);
1438
+ border-radius: 4px;
1439
+ cursor: pointer;
1440
+ }
1441
+ .sm-color-picker__swatch:hover {
1442
+ outline: 2px solid var(--sm-primary, #4f46e5);
1443
+ outline-offset: 1px;
1444
+ }
1445
+ .sm-color-picker__native {
1446
+ width: 100%;
1447
+ height: 32px;
1448
+ margin-bottom: 6px;
1449
+ padding: 0;
1450
+ border: 1px solid var(--sm-border, #e6e8ec);
1451
+ border-radius: 6px;
1452
+ cursor: pointer;
1453
+ }
1454
+ .sm-color-picker__hex {
1455
+ width: 100%;
1456
+ text-align: center;
1457
+ }
1458
+ .sm-color-picker__foot {
1459
+ display: flex;
1460
+ justify-content: flex-end;
1461
+ margin-top: 8px;
1462
+ }
1463
+ .sm-color-picker__clear {
1464
+ height: 26px;
1465
+ font-size: 12px;
1466
+ }
1467
+
1020
1468
  /* 弹层(变量插入) ------------------------------------------------------- */
1021
1469
  .sm-popover {
1022
1470
  position: absolute;
@@ -1046,6 +1494,7 @@
1046
1494
  .sm-popover__label { font-size: 11px; color: var(--sm-text-muted); }
1047
1495
 
1048
1496
  /* Modal -------------------------------------------------------------------- */
1497
+ /* 弹层常挂在 document.body,无 .sm-root 祖先时 CSS 变量不存在;凡 var(...) 须带浅色兜底,避免卡片「透明」与页面叠在一起 */
1049
1498
  .sm-modal__mask {
1050
1499
  position: fixed;
1051
1500
  inset: 0;
@@ -1056,16 +1505,43 @@
1056
1505
  background: rgba(15, 23, 42, 0.45);
1057
1506
  opacity: 0;
1058
1507
  transition: opacity 0.18s ease;
1508
+ /*
1509
+ * 子树内的 .sm-btn / .sm-input 依赖 --sm-border、--sm-surface 等;
1510
+ * body 下无继承链时在此补齐与浅色 .sm-root 一致的令牌,按钮不再像「纯文字」。
1511
+ */
1512
+ --sm-border: #e6e8ec;
1513
+ --sm-outline-muted: #c7cad1;
1514
+ --sm-surface: #ffffff;
1515
+ --sm-surface-hover: #f5f6f8;
1516
+ --sm-text: #1f2328;
1517
+ --sm-text-muted: #6b7280;
1518
+ --sm-primary: #4f46e5;
1519
+ --sm-primary-soft: #eef2ff;
1520
+ --sm-on-primary: #ffffff;
1521
+ --sm-danger: #dc2626;
1522
+ --sm-ghost-hover-bg: #f0f1f4;
1523
+ --sm-code-bg: #fafbfc;
1524
+ --sm-modal-footer-bg: #fafbfc;
1525
+ --sm-canvas-bg: #eceef2;
1526
+ --sm-panel-bg: #ffffff;
1527
+ --sm-radius-sm: 6px;
1528
+ --sm-radius: 8px;
1529
+ --sm-shadow: 0 1px 2px rgba(16, 24, 40, 0.06);
1530
+ --sm-shadow-md: 0 4px 16px rgba(16, 24, 40, 0.08);
1059
1531
  }
1060
1532
  .sm-modal__mask.is-open { opacity: 1; }
1061
1533
 
1062
1534
  .sm-modal__card {
1063
1535
  display: flex;
1064
1536
  flex-direction: column;
1065
- background: var(--sm-panel-bg);
1066
- color: var(--sm-text);
1537
+ background: var(--sm-panel-bg, #ffffff);
1538
+ color: var(--sm-text, #1f2328);
1067
1539
  border-radius: 12px;
1068
- box-shadow: 0 20px 60px rgba(15, 23, 42, 0.25);
1540
+ border: 1px solid var(--sm-border, #e6e8ec);
1541
+ box-shadow:
1542
+ 0 0 0 1px rgba(255, 255, 255, 0.08) inset,
1543
+ 0 24px 48px rgba(15, 23, 42, 0.14),
1544
+ 0 8px 24px rgba(15, 23, 42, 0.08);
1069
1545
  max-width: 96vw;
1070
1546
  max-height: 92vh;
1071
1547
  transform: translateY(8px) scale(0.98);
@@ -1076,12 +1552,35 @@
1076
1552
  transform: translateY(0) scale(1);
1077
1553
  }
1078
1554
 
1555
+ /* 预览邮件:弹框高度随内容(JS 测量 iframe),整体不超过视口 */
1556
+ .sm-modal__card.sm-modal--preview {
1557
+ max-height: calc(100vh - 24px);
1558
+ min-height: 50%;
1559
+ height: auto;
1560
+ }
1561
+ .sm-modal__card.sm-modal--preview .sm-modal__body {
1562
+ flex: 1 1 auto;
1563
+ min-height: 0;
1564
+ overflow: hidden;
1565
+ }
1566
+ .sm-modal__card.sm-modal--preview .sm-modal__body.sm-modal__body--center {
1567
+ flex-direction: column;
1568
+ align-items: center;
1569
+ justify-content: flex-start;
1570
+ }
1571
+ .sm-modal__card.sm-modal--preview .sm-preview__viewport {
1572
+ flex: 0 0 auto;
1573
+ width: var(--sm-preview-w);
1574
+ max-width: 100%;
1575
+ }
1576
+
1079
1577
  .sm-modal__header {
1080
1578
  display: flex;
1081
1579
  align-items: center;
1082
1580
  gap: 8px;
1083
1581
  padding: 12px 16px;
1084
- border-bottom: 1px solid var(--sm-border);
1582
+ background: var(--sm-panel-bg, #ffffff);
1583
+ border-bottom: 1px solid var(--sm-border, #e6e8ec);
1085
1584
  }
1086
1585
  .sm-modal__title {
1087
1586
  font-weight: 600;
@@ -1102,21 +1601,25 @@
1102
1601
  border: 0;
1103
1602
  border-radius: 6px;
1104
1603
  background: transparent;
1105
- color: var(--sm-text-muted);
1604
+ color: var(--sm-text-muted, #6b7280);
1106
1605
  cursor: pointer;
1107
1606
  }
1108
- .sm-modal__close:hover { background: var(--sm-ghost-hover-bg); color: var(--sm-text); }
1607
+ .sm-modal__close:hover {
1608
+ background: var(--sm-ghost-hover-bg, #f0f1f4);
1609
+ color: var(--sm-text, #1f2328);
1610
+ }
1109
1611
 
1110
1612
  .sm-modal__body {
1111
1613
  flex: 1;
1112
1614
  min-height: 0;
1113
1615
  overflow: auto;
1616
+ background: var(--sm-panel-bg, #ffffff);
1114
1617
  }
1115
1618
  .sm-modal__body--center {
1116
1619
  display: flex;
1117
1620
  align-items: flex-start;
1118
1621
  justify-content: center;
1119
- background: var(--sm-canvas-bg);
1622
+ background: var(--sm-canvas-bg, #eceef2);
1120
1623
  padding: 16px;
1121
1624
  }
1122
1625
 
@@ -1125,8 +1628,8 @@
1125
1628
  justify-content: flex-end;
1126
1629
  gap: 8px;
1127
1630
  padding: 10px 16px;
1128
- border-top: 1px solid var(--sm-border);
1129
- background: var(--sm-modal-footer-bg);
1631
+ border-top: 1px solid var(--sm-border, #e6e8ec);
1632
+ background: var(--sm-modal-footer-bg, #fafbfc);
1130
1633
  }
1131
1634
  .sm-modal__footer:empty { display: none; }
1132
1635
 
@@ -1137,9 +1640,27 @@
1137
1640
  min-height: 240px;
1138
1641
  }
1139
1642
 
1643
+ .sm-modal--gallery .sm-modal__header {
1644
+ padding: 14px 18px;
1645
+ background: linear-gradient(
1646
+ 180deg,
1647
+ var(--sm-modal-footer-bg, #fafbfc) 0%,
1648
+ var(--sm-panel-bg, #ffffff) 100%
1649
+ );
1650
+ }
1651
+ .sm-modal--gallery .sm-modal__title {
1652
+ font-size: 15px;
1653
+ font-weight: 600;
1654
+ letter-spacing: -0.02em;
1655
+ }
1656
+ .sm-modal--gallery .sm-modal__footer {
1657
+ padding: 12px 18px;
1658
+ gap: 10px;
1659
+ }
1660
+
1140
1661
  .sm-gallery-modal {
1141
- --sm-gallery-gap: 10px;
1142
- --sm-gallery-cell-border: var(--sm-border);
1662
+ --sm-gallery-gap: 12px;
1663
+ --sm-gallery-cell-border: var(--sm-border, #e6e8ec);
1143
1664
  --sm-gallery-cell-radius: 8px;
1144
1665
  --sm-gallery-thumb-h: 88px;
1145
1666
 
@@ -1149,9 +1670,9 @@
1149
1670
  gap: var(--sm-gallery-gap);
1150
1671
  flex: 1;
1151
1672
  min-height: 0;
1152
- padding: 12px;
1153
- background: var(--sm-panel-bg);
1154
- color: var(--sm-text);
1673
+ padding: 14px 16px 16px;
1674
+ background: var(--sm-panel-bg, #ffffff);
1675
+ color: var(--sm-text, #1f2328);
1155
1676
  }
1156
1677
 
1157
1678
  .sm-gallery-modal__toolbar {
@@ -1161,12 +1682,18 @@
1161
1682
  display: flex;
1162
1683
  flex-wrap: wrap;
1163
1684
  align-items: center;
1164
- gap: 8px;
1685
+ gap: 10px;
1165
1686
  }
1166
1687
  .sm-gallery-modal__search {
1167
1688
  flex: 1 1 140px;
1168
1689
  min-width: 100px;
1169
1690
  height: 32px;
1691
+ padding-left: 32px;
1692
+ background-color: var(--sm-surface, #ffffff);
1693
+ background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' stroke='%236b7280' stroke-width='1.6' stroke-linecap='round'%3E%3Ccircle cx='6' cy='6' r='4.25'/%3E%3Cpath d='M9.5 9.5 12 12'/%3E%3C/svg%3E");
1694
+ background-repeat: no-repeat;
1695
+ background-position: 10px center;
1696
+ background-size: 14px 14px;
1170
1697
  }
1171
1698
  .sm-gallery-modal__addurl-input {
1172
1699
  flex: 1 1 min(220px, 36vw);
@@ -1176,8 +1703,11 @@
1176
1703
  .sm-gallery-modal__toolbar-action {
1177
1704
  flex-shrink: 0;
1178
1705
  height: 32px;
1706
+ min-width: 72px;
1707
+ justify-content: center;
1179
1708
  font-size: 12px;
1180
- padding: 0 12px;
1709
+ font-weight: 500;
1710
+ padding: 0 14px;
1181
1711
  }
1182
1712
  .sm-gallery-modal__file {
1183
1713
  position: absolute;
@@ -1189,7 +1719,7 @@
1189
1719
 
1190
1720
  .sm-gallery-modal__error {
1191
1721
  font-size: 12px;
1192
- color: var(--sm-danger);
1722
+ color: var(--sm-danger, #dc2626);
1193
1723
  flex-shrink: 0;
1194
1724
  }
1195
1725
 
@@ -1200,17 +1730,30 @@
1200
1730
  display: flex;
1201
1731
  flex-direction: column;
1202
1732
  gap: 10px;
1733
+ padding: 4px;
1734
+ margin-top: 2px;
1735
+ background: var(--sm-modal-footer-bg, #fafbfc);
1736
+ border: 1px solid var(--sm-border, #e6e8ec);
1737
+ border-radius: var(--sm-radius-sm, 6px);
1203
1738
  }
1204
1739
 
1205
1740
  .sm-gallery-modal__grid {
1206
1741
  display: grid;
1742
+ /* minmax 下限由列承担;子项须 min-width:0,否则大图固有宽度会撑破网格导致重叠 */
1207
1743
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
1208
1744
  gap: 8px;
1745
+ width: 100%;
1746
+ min-width: 0;
1747
+ }
1748
+
1749
+ .sm-gallery-modal__grid > * {
1750
+ min-width: 0;
1209
1751
  }
1210
1752
 
1211
1753
  .sm-gallery-modal__cell-wrap {
1212
1754
  position: relative;
1213
1755
  min-width: 0;
1756
+ max-width: 100%;
1214
1757
  }
1215
1758
 
1216
1759
  .sm-gallery-modal__cell-delete {
@@ -1224,8 +1767,8 @@
1224
1767
  margin: 0;
1225
1768
  border: 0;
1226
1769
  border-radius: 4px;
1227
- background: rgba(15, 23, 42, 0.65);
1228
- color: var(--sm-on-primary);
1770
+ background: rgba(15, 23, 42, 0.82);
1771
+ color: var(--sm-on-primary, #ffffff);
1229
1772
  font-size: 16px;
1230
1773
  line-height: 1;
1231
1774
  cursor: pointer;
@@ -1234,7 +1777,7 @@
1234
1777
  justify-content: center;
1235
1778
  }
1236
1779
  .sm-gallery-modal__cell-delete:hover {
1237
- background: var(--sm-danger);
1780
+ background: var(--sm-danger, #dc2626);
1238
1781
  }
1239
1782
 
1240
1783
  .sm-gallery-modal__cell {
@@ -1245,66 +1788,82 @@
1245
1788
  padding: 6px;
1246
1789
  border: 2px solid transparent;
1247
1790
  border-radius: var(--sm-gallery-cell-radius);
1248
- background: var(--sm-gallery-cell-bg);
1791
+ background: var(--sm-gallery-cell-bg, #ebecef);
1249
1792
  cursor: pointer;
1250
1793
  text-align: left;
1251
1794
  font: inherit;
1252
1795
  color: inherit;
1253
1796
  transition: border-color 0.12s, box-shadow 0.12s;
1797
+ box-sizing: border-box;
1798
+ min-width: 0;
1799
+ width: 100%;
1800
+ max-width: 100%;
1801
+ overflow: hidden;
1802
+ box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
1254
1803
  }
1255
1804
  .sm-gallery-modal__cell:hover {
1256
- border-color: var(--sm-gallery-cell-hover-border);
1805
+ border-color: var(--sm-gallery-cell-hover-border, #d6d9df);
1806
+ box-shadow: 0 4px 12px rgba(15, 23, 42, 0.07);
1257
1807
  }
1258
1808
  .sm-gallery-modal__cell.is-selected {
1259
- border-color: var(--sm-primary);
1260
- box-shadow: 0 0 0 2px var(--sm-primary-soft);
1809
+ border-color: var(--sm-primary, #4f46e5);
1810
+ box-shadow:
1811
+ 0 0 0 2px var(--sm-primary-soft, #eef2ff),
1812
+ 0 4px 14px rgba(79, 70, 229, 0.12);
1261
1813
  }
1262
1814
 
1263
1815
  .sm-gallery-modal__thumb {
1816
+ display: block;
1817
+ flex-shrink: 0;
1264
1818
  width: 100%;
1265
- height: var(--sm-gallery-thumb-h);
1266
- object-fit: cover;
1819
+ max-width: 100%;
1820
+ /* height: var(--sm-gallery-thumb-h); */
1821
+ max-height: var(--sm-gallery-thumb-h);
1822
+ /* object-fit: cover; */
1267
1823
  border-radius: 4px;
1268
- background: var(--sm-gallery-thumb-bg);
1824
+ background: var(--sm-gallery-thumb-bg, #dde1e8);
1269
1825
  }
1270
1826
 
1271
1827
  .sm-gallery-modal__caption {
1272
1828
  font-size: 11px;
1273
- color: var(--sm-text-muted);
1829
+ color: var(--sm-text-muted, #6b7280);
1274
1830
  margin-top: 4px;
1275
1831
  overflow: hidden;
1276
1832
  text-overflow: ellipsis;
1277
1833
  white-space: nowrap;
1834
+ min-width: 0;
1278
1835
  }
1279
1836
 
1280
1837
  .sm-gallery-modal__empty {
1281
1838
  grid-column: 1 / -1;
1282
1839
  text-align: center;
1283
1840
  font-size: 13px;
1284
- color: var(--sm-text-muted);
1841
+ color: var(--sm-text-muted, #6b7280);
1285
1842
  padding: 28px 12px;
1286
1843
  }
1287
1844
 
1288
1845
  .sm-gallery-modal__loadmore {
1289
1846
  align-self: center;
1290
- margin-top: 4px;
1291
- height: 32px;
1847
+ margin-top: 10px;
1848
+ height: 34px;
1849
+ min-width: 128px;
1850
+ justify-content: center;
1292
1851
  font-size: 12px;
1852
+ font-weight: 500;
1293
1853
  }
1294
1854
 
1295
1855
  /* Preview ------------------------------------------------------------------ */
1296
1856
  .sm-preview__viewport {
1297
1857
  --sm-preview-w: 800px;
1298
- --sm-preview-h: 700px;
1299
1858
  width: var(--sm-preview-w);
1300
1859
  max-width: 100%;
1301
- height: var(--sm-preview-h);
1302
- max-height: 100%;
1860
+ min-height: 200px;
1861
+ /* 高度由 PreviewModal 根据 iframe 文档 scrollHeight 写入 */
1303
1862
  /* 预览 iframe 内为邮件 HTML,外框保持白纸 */
1304
1863
  background: #ffffff;
1305
1864
  border-radius: 12px;
1306
- border: 1px solid var(--sm-border);
1307
- box-shadow: var(--sm-shadow-md);
1865
+ border: 1px solid var(--sm-border, #e6e8ec);
1866
+ box-shadow: var(--sm-shadow-md, 0 4px 16px rgba(16, 24, 40, 0.08));
1308
1867
  overflow: hidden;
1309
1868
  transition: width 0.2s ease, height 0.2s ease;
1310
1869
  }
@@ -1319,18 +1878,22 @@
1319
1878
  .sm-modal--export .sm-modal__body,
1320
1879
  .sm-modal--block-code .sm-modal__body {
1321
1880
  padding: 0;
1322
- background: var(--sm-code-bg);
1881
+ background: var(--sm-code-bg, #fafbfc);
1323
1882
  }
1324
1883
  .sm-export__editor {
1325
1884
  height: 100%;
1326
- background: var(--sm-code-bg);
1885
+ background: var(--sm-code-bg, #fafbfc);
1327
1886
  }
1328
1887
  .sm-export__editor .cm-editor {
1329
1888
  height: 100%;
1330
- background: var(--sm-code-bg) !important;
1331
- color: var(--sm-text);
1889
+ background: var(--sm-code-bg, #fafbfc) !important;
1890
+ color: var(--sm-text, #1f2328);
1891
+ }
1892
+ .sm-export__editor .cm-content {
1893
+ padding: 12px;
1894
+ font-size: 12px;
1895
+ color: var(--sm-text, #1f2328);
1332
1896
  }
1333
- .sm-export__editor .cm-content { padding: 12px; font-size: 12px; color: var(--sm-text); }
1334
1897
 
1335
1898
  /* Toast -------------------------------------------------------------------- */
1336
1899
  .sm-toast {