dsh-ppt 0.26.0 → 0.27.0

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 (33) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/README.en.md +5 -4
  3. package/README.md +5 -4
  4. package/docs/USAGE.en.md +1 -0
  5. package/docs/USAGE.md +1 -0
  6. package/docs/VALIDATION.md +4 -0
  7. package/docs/assets/intro/workflow-en-dark.svg +1 -1
  8. package/docs/assets/intro/workflow-en-light.svg +1 -1
  9. package/docs/assets/intro/workflow-en-mobile-dark.svg +1 -1
  10. package/docs/assets/intro/workflow-en-mobile-light.svg +1 -1
  11. package/docs/assets/intro/workflow-zh-dark.svg +1 -1
  12. package/docs/assets/intro/workflow-zh-light.svg +1 -1
  13. package/docs/assets/intro/workflow-zh-mobile-dark.svg +1 -1
  14. package/docs/assets/intro/workflow-zh-mobile-light.svg +1 -1
  15. package/lib/client.js +83 -9
  16. package/lib/execution.js +8 -4
  17. package/lib/tools.js +56 -1
  18. package/lib/types.d.ts +64 -0
  19. package/lib/workbench.js +67 -3
  20. package/package.json +1 -1
  21. package/skills/dsh-ppt/SKILL.md +3 -3
  22. package/skills/dsh-ppt/package.json +1 -1
  23. package/skills/dsh-ppt/scripts/build-deck.mjs +15 -3
  24. package/skills/dsh-ppt/scripts/deck-absorb.mjs +114 -1
  25. package/skills/dsh-ppt/scripts/deck-advanced.mjs +106 -15
  26. package/skills/dsh-ppt/scripts/deck-chrome.mjs +114 -6
  27. package/skills/dsh-ppt/scripts/deck-core.mjs +6 -0
  28. package/skills/dsh-ppt/scripts/deck-covers.mjs +804 -0
  29. package/skills/dsh-ppt/scripts/deck-director.mjs +118 -1
  30. package/skills/dsh-ppt/scripts/deck-icons.mjs +469 -0
  31. package/skills/dsh-ppt/scripts/deck-layouts.mjs +519 -92
  32. package/skills/dsh-ppt/scripts/deck-media.mjs +159 -15
  33. package/skills/dsh-ppt/scripts/deck-taste.mjs +347 -0
@@ -10,7 +10,23 @@
10
10
  * 零外部运行时依赖,仅使用 Node 内置模块。
11
11
  */
12
12
 
13
- import { relativeLuminance, resolveChromeStyle } from './deck-themes.mjs'
13
+ import { relativeLuminance, resolveChromeStyle, mixHex } from './deck-themes.mjs'
14
+ import {
15
+ normalizeIconName,
16
+ resolveSemanticIcon,
17
+ renderIconBadgePptx,
18
+ renderIconBadgeHtml,
19
+ } from './deck-icons.mjs'
20
+ import { resolveActiveTaste } from './deck-taste.mjs'
21
+ import {
22
+ POSTER_COVER_VARIANTS,
23
+ renderPosterCoverPptx,
24
+ renderPosterCoverHtml,
25
+ resolveSectionAgendaChapters,
26
+ renderSectionAgendaPptx,
27
+ renderSectionAgendaHtml,
28
+ AESTHETIC_STUDIO_CSS,
29
+ } from './deck-covers.mjs'
14
30
  import {
15
31
  containsLatexMath,
16
32
  looksLikeRawLatex,
@@ -141,6 +157,9 @@ export {
141
157
  renderMermaidPptx,
142
158
  renderMermaidHtml,
143
159
  MERMAID_CSS,
160
+ POSTER_COVER_VARIANTS,
161
+ resolveSectionAgendaChapters,
162
+ AESTHETIC_STUDIO_CSS,
144
163
  }
145
164
 
146
165
  export const CORE_LAYOUTS = new Set([
@@ -339,6 +358,14 @@ export function renderCoreSlidePptx(slide, index, total, theme, langAttr, manife
339
358
 
340
359
  const layout = slide.layout || 'bullets'
341
360
  const variant = slide.variant || ''
361
+ const taste = resolveActiveTaste(manifest, slide)
362
+ const cardMaterial = variant === 'frameless' ? 'frameless' : taste.cardMaterial
363
+ const resolveItemIcon = (it, idx) => {
364
+ const explicit = normalizeIconName(it?.icon)
365
+ if (explicit) return explicit
366
+ if (it?.icon === 'auto' || taste.iconMode === 'auto') return resolveSemanticIcon(it, idx)
367
+ return ''
368
+ }
342
369
  const title = slide.title || ''
343
370
  const subtitle = slide.subtitle || ''
344
371
  const kicker = slide.kicker || ''
@@ -352,7 +379,26 @@ export function renderCoreSlidePptx(slide, index, total, theme, langAttr, manife
352
379
  const shapes = []
353
380
 
354
381
  if (layout === 'cover') {
355
- const inverted = variant === 'inverted' || (!variant && tk.coverMode === 'inverted-accent')
382
+ const coverVariant = variant || taste.recipe?.coverVariant || ''
383
+ const metaParts = [slide.text, slide.source, manifest.brand?.footer].filter(Boolean)
384
+ const metaText = metaParts.join(' · ')
385
+
386
+ const posterCover = renderPosterCoverPptx(slide, {
387
+ coverVariant,
388
+ title,
389
+ subtitle,
390
+ kicker,
391
+ metaText,
392
+ total,
393
+ theme,
394
+ langAttr,
395
+ manifest,
396
+ idBase,
397
+ nextId,
398
+ })
399
+ if (posterCover !== null) return posterCover
400
+
401
+ const inverted = coverVariant === 'inverted' || (!coverVariant && tk.coverMode === 'inverted-accent')
356
402
  const coverFill = inverted ? tk.coverBg : tk.canvas
357
403
  const coverDark = relativeLuminance(coverFill) < 0.36
358
404
  const fg = inverted ? (coverDark ? '#F8FAFC' : '#0F172A') : tk.inkPrimary
@@ -365,7 +411,7 @@ export function renderCoreSlidePptx(slide, index, total, theme, langAttr, manife
365
411
  preset: 'rect',
366
412
  fill: coverFill,
367
413
  }))
368
- } else if (variant === 'monolith') {
414
+ } else if (coverVariant === 'monolith') {
369
415
  shapes.push(ooxmlShape(nextId(), 'Cover monolith band', { x: 0, y: 0, w: 0.42, h: CANVAS_IN.h }, {
370
416
  preset: 'rect',
371
417
  fill: tk.accentPrimary,
@@ -456,7 +502,6 @@ export function renderCoreSlidePptx(slide, index, total, theme, langAttr, manife
456
502
  color: inverted ? hexToRgbaSafeHex(accentRule, coverFill, 0.45) : tk.hairline,
457
503
  widthPt: 0.75,
458
504
  }))
459
- const metaText = [slide.text, slide.source, manifest.brand?.footer].filter(Boolean).join(' · ')
460
505
  if (metaText) {
461
506
  shapes.push(ooxmlShape(nextId(), 'Cover meta', { x: 0.88, y: 6.62, w: 8.3, h: 0.36 }, {
462
507
  txBox: true,
@@ -562,6 +607,24 @@ export function renderCoreSlidePptx(slide, index, total, theme, langAttr, manife
562
607
  }
563
608
 
564
609
  if (layout === 'section') {
610
+ const secVariant = variant || taste.recipe?.sectionVariant || ''
611
+ if (secVariant === 'agenda') {
612
+ const agendaPptx = renderSectionAgendaPptx(slide, {
613
+ index,
614
+ total,
615
+ title,
616
+ subtitle,
617
+ kicker,
618
+ theme,
619
+ langAttr,
620
+ manifest,
621
+ chromeCfg,
622
+ idBase,
623
+ nextId,
624
+ })
625
+ if (agendaPptx !== null) return agendaPptx
626
+ }
627
+
565
628
  shapes.push(ooxmlShape(nextId(), 'Section side band', { x: 0, y: 0, w: 0.16, h: CANVAS_IN.h }, {
566
629
  preset: 'rect',
567
630
  fill: tk.accentPrimary,
@@ -885,25 +948,213 @@ export function renderCoreSlidePptx(slide, index, total, theme, langAttr, manife
885
948
 
886
949
  if (layout === 'kpi') {
887
950
  const items = resolveEffectiveItems(slide).slice(0, 4)
951
+ const kpiVariant = variant || taste.recipe?.kpiVariant || ''
888
952
  const n = Math.max(1, items.length)
953
+ const cardH = Math.min(3.75, bodyH - 0.24)
954
+ const cardY = bodyTopY + (bodyH - cardH) / 2
955
+
956
+ // 非对称 Spotlight 主次聚光灯变体(Hero 50% + 右侧无框细线副指标栈 —— 破除等宽三联框疲劳)
957
+ if (kpiVariant === 'spotlight' && items.length >= 2) {
958
+ const hero = items[0]
959
+ const sats = items.slice(1, 4)
960
+ const heroBox = { x: 0.62, y: cardY, w: 5.82, h: cardH }
961
+ const heroMat = cardMaterial === 'glass' ? 'glass' : (cardMaterial === 'solid' ? 'solid' : 'editorial-rule')
962
+ shapes.push(renderSurfaceCardPptx('KPI Hero Surface', heroBox, {
963
+ fill: tk.surface2,
964
+ focal: true,
965
+ cardMaterial: heroMat,
966
+ }, nextId, chromeCfg, theme))
967
+
968
+ const heroIcon = resolveItemIcon(hero, 0)
969
+ let labelX = heroBox.x + 0.30
970
+ if (heroIcon) {
971
+ shapes.push(renderIconBadgePptx('KPI Hero Badge', { x: heroBox.x + 0.30, y: heroBox.y + 0.28, w: 0.44, h: 0.44 }, heroIcon, nextId, theme, {
972
+ style: taste.iconBadgeStyle,
973
+ }))
974
+ labelX += 0.56
975
+ }
976
+ const heroLabel = hero.value ? (hero.title || '') : ''
977
+ if (heroLabel) {
978
+ shapes.push(ooxmlShape(nextId(), 'KPI Hero Label', { x: labelX, y: heroBox.y + 0.30, w: heroBox.x + heroBox.w - labelX - 0.26, h: 0.40 }, {
979
+ txBox: true,
980
+ anchor: 'ctr',
981
+ marginsIn: { l: 0, r: 0, t: 0, b: 0 },
982
+ paragraphs: [
983
+ ooxmlRichParagraph(heroLabel, {
984
+ sizePt: 15,
985
+ color: tk.inkSecondary,
986
+ bold: true,
987
+ lang: langAttr,
988
+ font: theme.fonts.body,
989
+ }),
990
+ ],
991
+ }))
992
+ }
993
+ const heroValText = (hero.value || hero.title || '—') + (hero.unit ? ' ' + hero.unit : '')
994
+ const hvBox = { x: heroBox.x + 0.30, y: heroBox.y + 0.88, w: heroBox.w - 0.60, h: 1.38 }
995
+ const hvFit = computeTextFit(heroValText, hvBox, 'kpiValue', { maxPt: 60, minPt: 30, padXPt: 2, padYPt: 2 })
996
+ shapes.push(ooxmlShape(nextId(), 'KPI Hero Value', hvBox, {
997
+ txBox: true,
998
+ anchor: 'ctr',
999
+ marginsIn: { l: 0, r: 0, t: 0, b: 0 },
1000
+ fontScale: hvFit.fontScale,
1001
+ paragraphs: [
1002
+ ooxmlRichParagraph(heroValText, {
1003
+ sizePt: hvFit.fontPt,
1004
+ color: tk.accentText,
1005
+ bold: true,
1006
+ lang: langAttr,
1007
+ font: theme.fonts.heading,
1008
+ lineHeight: 1.02,
1009
+ }),
1010
+ ],
1011
+ }))
1012
+ const heroSt = statusPalette(hero.status, tk)
1013
+ if (hero.delta) {
1014
+ const pw = computeBadgePillWidth(hero.delta, 12.5, heroBox.w - 0.60, 1.25)
1015
+ shapes.push(ooxmlShape(nextId(), 'KPI Hero Delta', { x: heroBox.x + 0.30, y: heroBox.y + 2.34, w: pw, h: 0.38 }, {
1016
+ preset: 'roundRect',
1017
+ adj: 50000,
1018
+ fill: heroSt.bg,
1019
+ stroke: tk.accentPrimary,
1020
+ strokePt: 0.6,
1021
+ anchor: 'ctr',
1022
+ marginsIn: { l: 0.06, r: 0.06, t: 0.02, b: 0.02 },
1023
+ paragraphs: [
1024
+ ooxmlRichParagraph(hero.delta, {
1025
+ sizePt: 12.5,
1026
+ color: heroSt.fg,
1027
+ bold: true,
1028
+ lang: langAttr,
1029
+ align: 'ctr',
1030
+ font: theme.fonts.body,
1031
+ }),
1032
+ ],
1033
+ }))
1034
+ }
1035
+ if (hero.text) {
1036
+ const dy = hero.delta ? heroBox.y + 2.84 : heroBox.y + 2.40
1037
+ shapes.push(ooxmlShape(nextId(), 'Card 1', { x: heroBox.x + 0.30, y: dy, w: heroBox.w - 0.60, h: Math.max(0.55, heroBox.y + heroBox.h - dy - 0.16) }, {
1038
+ txBox: true,
1039
+ anchor: 't',
1040
+ marginsIn: { l: 0, r: 0, t: 0, b: 0 },
1041
+ paragraphs: [
1042
+ ooxmlRichParagraph(hero.text, {
1043
+ sizePt: 14.5,
1044
+ color: tk.inkSecondary,
1045
+ lang: langAttr,
1046
+ font: theme.fonts.body,
1047
+ lineHeight: 1.4,
1048
+ }),
1049
+ ],
1050
+ }))
1051
+ }
1052
+
1053
+ // 右侧副指标栈(无框细线通透分层)
1054
+ const rightX = 6.86
1055
+ const rightW = 5.85
1056
+ const satGap = 0.18
1057
+ const satH = (cardH - satGap * (sats.length - 1)) / sats.length
1058
+ sats.forEach((it, si) => {
1059
+ const sy = cardY + si * (satH + satGap)
1060
+ const sIcon = resolveItemIcon(it, si + 1)
1061
+ const st = statusPalette(it.status, tk)
1062
+ shapes.push(ooxmlLine(nextId(), 'KPI Sat Top ' + (si + 1), { x: rightX, y: sy }, { x: rightX + rightW, y: sy }, {
1063
+ color: si === 0 ? tk.accentPrimary : tk.hairline,
1064
+ widthPt: si === 0 ? 1.5 : 0.75,
1065
+ }))
1066
+ if (si === sats.length - 1) {
1067
+ shapes.push(ooxmlLine(nextId(), 'KPI Sat Bot', { x: rightX, y: sy + satH }, { x: rightX + rightW, y: sy + satH }, {
1068
+ color: tk.hairline,
1069
+ widthPt: 0.6,
1070
+ }))
1071
+ }
1072
+ let infoX = rightX + 0.04
1073
+ if (sIcon) {
1074
+ shapes.push(renderIconBadgePptx('KPI Sat Icon ' + (si + 1), { x: rightX + 0.04, y: sy + (satH - 0.38) / 2, w: 0.38, h: 0.38 }, sIcon, nextId, theme, {
1075
+ style: taste.iconBadgeStyle,
1076
+ }))
1077
+ infoX += 0.50
1078
+ }
1079
+ const valText = (it.value || it.title || '—') + (it.unit ? ' ' + it.unit : '')
1080
+ const lblText = it.value ? (it.title || '') : ''
1081
+ const valW = Math.min(2.35, Math.max(1.55, rightW * 0.38))
1082
+ const leftW = Math.max(1.8, rightX + rightW - valW - infoX - 0.16)
1083
+ shapes.push(ooxmlShape(nextId(), 'Card ' + (si + 2), { x: infoX, y: sy + 0.10, w: leftW, h: satH - 0.18 }, {
1084
+ txBox: true,
1085
+ anchor: 'ctr',
1086
+ marginsIn: { l: 0, r: 0, t: 0, b: 0 },
1087
+ paragraphs: [
1088
+ ...(lblText ? [ooxmlRichParagraph(lblText, { sizePt: 14, color: tk.inkPrimary, bold: true, lang: langAttr, font: theme.fonts.heading, spaceAfterPt: it.text ? 3 : 0 })] : []),
1089
+ ...(it.text ? [ooxmlRichParagraph(it.text, { sizePt: 12.5, color: tk.inkSecondary, lang: langAttr, font: theme.fonts.body, lineHeight: 1.3 })] : []),
1090
+ ],
1091
+ }))
1092
+ const valX = rightX + rightW - valW
1093
+ shapes.push(ooxmlShape(nextId(), 'KPI Sat Val ' + (si + 1), { x: valX, y: sy + 0.08, w: valW, h: satH - (it.delta ? 0.38 : 0.14) }, {
1094
+ txBox: true,
1095
+ anchor: 'ctr',
1096
+ marginsIn: { l: 0, r: 0, t: 0, b: 0 },
1097
+ paragraphs: [
1098
+ ooxmlRichParagraph(valText, {
1099
+ sizePt: sats.length >= 3 ? 26 : 32,
1100
+ color: tk.inkPrimary,
1101
+ bold: true,
1102
+ lang: langAttr,
1103
+ align: 'r',
1104
+ font: theme.fonts.heading,
1105
+ lineHeight: 1.05,
1106
+ }),
1107
+ ],
1108
+ }))
1109
+ if (it.delta) {
1110
+ shapes.push(ooxmlShape(nextId(), 'KPI Sat Delta ' + (si + 1), { x: valX, y: sy + satH - 0.34, w: valW, h: 0.28 }, {
1111
+ txBox: true,
1112
+ anchor: 'ctr',
1113
+ marginsIn: { l: 0, r: 0, t: 0, b: 0 },
1114
+ paragraphs: [
1115
+ ooxmlRichParagraph(it.delta, {
1116
+ sizePt: 11.5,
1117
+ color: st.fg,
1118
+ bold: true,
1119
+ lang: langAttr,
1120
+ align: 'r',
1121
+ font: theme.fonts.body,
1122
+ }),
1123
+ ],
1124
+ }))
1125
+ }
1126
+ })
1127
+ shapes.push(renderSlideChromePptx(slide, index, total, theme, langAttr, manifest, nextId))
1128
+ return shapes.join('')
1129
+ }
1130
+
889
1131
  const gap = 0.28
890
1132
  const cardW = (12.09 - gap * (n - 1)) / n
891
- const cardH = Math.min(3.55, bodyH - 0.3)
892
- const cardY = bodyTopY + (bodyH - cardH) / 2
1133
+ const effKpiMat = kpiVariant === 'frameless' ? 'frameless' : cardMaterial
893
1134
 
894
1135
  items.forEach((it, idx) => {
895
1136
  const x = 0.62 + idx * (cardW + gap)
896
1137
  const st = statusPalette(it.status, tk)
897
1138
  const valText = (it.value || it.title || '—') + (it.unit ? ' ' + it.unit : '')
898
1139
  const labelText = it.value ? (it.title || '') : ''
1140
+ const iconName = resolveItemIcon(it, idx)
899
1141
 
900
1142
  shapes.push(renderSurfaceCardPptx('KPI Surface ' + (idx + 1), { x, y: cardY, w: cardW, h: cardH }, {
901
1143
  fill: tk.surface1,
902
1144
  focal: idx === 0,
1145
+ cardMaterial: effKpiMat,
903
1146
  }, nextId, chromeCfg, theme))
904
1147
 
1148
+ const padX = effKpiMat === 'frameless' || effKpiMat === 'editorial-rule' ? 0.04 : 0.24
1149
+ let lblLeft = x + padX
1150
+ if (iconName) {
1151
+ shapes.push(renderIconBadgePptx('KPI Icon ' + (idx + 1), { x: lblLeft, y: cardY + 0.22, w: 0.38, h: 0.38 }, iconName, nextId, theme, {
1152
+ style: taste.iconBadgeStyle,
1153
+ }))
1154
+ lblLeft += 0.48
1155
+ }
905
1156
  if (labelText) {
906
- shapes.push(ooxmlShape(nextId(), 'KPI Label ' + (idx + 1), { x: x + 0.24, y: cardY + 0.24, w: cardW - 0.48, h: 0.38 }, {
1157
+ shapes.push(ooxmlShape(nextId(), 'KPI Label ' + (idx + 1), { x: lblLeft, y: cardY + 0.24, w: Math.max(0.8, x + cardW - padX - lblLeft), h: 0.38 }, {
907
1158
  txBox: true,
908
1159
  anchor: 'ctr',
909
1160
  marginsIn: { l: 0, r: 0, t: 0, b: 0 },
@@ -919,8 +1170,8 @@ export function renderCoreSlidePptx(slide, index, total, theme, langAttr, manife
919
1170
  }))
920
1171
  }
921
1172
 
922
- const vBox = { x: x + 0.24, y: cardY + 0.72, w: cardW - 0.48, h: 1.15 }
923
- const vFit = computeTextFit(valText, vBox, 'kpiValue', { maxPt: n >= 4 ? 38 : 46, minPt: 24, padXPt: 2, padYPt: 2 })
1173
+ const vBox = { x: x + padX, y: cardY + 0.72, w: cardW - padX * 2, h: 1.15 }
1174
+ const vFit = computeTextFit(valText, vBox, 'kpiValue', { maxPt: effKpiMat === 'frameless' ? (n >= 4 ? 42 : 52) : (n >= 4 ? 38 : 46), minPt: 24, padXPt: 2, padYPt: 2 })
924
1175
  shapes.push(ooxmlShape(nextId(), 'KPI Value ' + (idx + 1), vBox, {
925
1176
  txBox: true,
926
1177
  anchor: 'ctr',
@@ -939,8 +1190,8 @@ export function renderCoreSlidePptx(slide, index, total, theme, langAttr, manife
939
1190
  }))
940
1191
 
941
1192
  if (it.delta) {
942
- const pillW = computeBadgePillWidth(it.delta, 12, cardW - 0.48, 1.15)
943
- shapes.push(ooxmlShape(nextId(), 'KPI Delta ' + (idx + 1), { x: x + 0.24, y: cardY + 1.98, w: pillW, h: 0.36 }, {
1193
+ const pillW = computeBadgePillWidth(it.delta, 12, cardW - padX * 2, 1.15)
1194
+ shapes.push(ooxmlShape(nextId(), 'KPI Delta ' + (idx + 1), { x: x + padX, y: cardY + 1.98, w: pillW, h: 0.36 }, {
944
1195
  preset: 'roundRect',
945
1196
  adj: 50000,
946
1197
  fill: st.bg,
@@ -963,7 +1214,7 @@ export function renderCoreSlidePptx(slide, index, total, theme, langAttr, manife
963
1214
 
964
1215
  if (it.text) {
965
1216
  const descY = it.delta ? cardY + 2.46 : cardY + 2.02
966
- const descBox = { x: x + 0.24, y: descY, w: cardW - 0.48, h: Math.max(0.5, cardY + cardH - descY - 0.18) }
1217
+ const descBox = { x: x + padX, y: descY, w: cardW - padX * 2, h: Math.max(0.5, cardY + cardH - descY - 0.18) }
967
1218
  const dFit = computeTextFit(it.text, descBox, 'cardBody', { maxPt: 14.5, minPt: 13.5, padXPt: 2, padYPt: 2 })
968
1219
  shapes.push(ooxmlShape(nextId(), 'Card ' + (idx + 1), descBox, {
969
1220
  txBox: true,
@@ -988,13 +1239,17 @@ export function renderCoreSlidePptx(slide, index, total, theme, langAttr, manife
988
1239
 
989
1240
  if (layout === 'cards') {
990
1241
  const items = resolveEffectiveItems(slide)
1242
+ const cardsVariant = variant || taste.recipe?.cardsVariant || ''
1243
+ const isBentoHero = cardsVariant === 'bento-hero' && items.length >= 2 && items.length <= 4
1244
+ const isFramelessCards = cardsVariant === 'frameless'
1245
+ const effCardMat = isFramelessCards ? 'frameless' : cardMaterial
991
1246
  const n = Math.max(1, items.length)
992
- const gap = 0.24
1247
+ const gap = isFramelessCards ? 0.34 : 0.24
993
1248
  let topOffset = bodyTopY
994
1249
  let availH = bodyH
995
1250
 
996
1251
  // exec-summary 变体:顶部通栏核心论断横幅 + 下方支柱卡
997
- if (variant === 'exec-summary' && (subtitle || slide.text)) {
1252
+ if (cardsVariant === 'exec-summary' && (subtitle || slide.text)) {
998
1253
  const thesisText = slide.text || subtitle
999
1254
  const bannerBox = { x: 0.62, y: bodyTopY, w: 12.09, h: 0.96 }
1000
1255
  shapes.push(ooxmlShape(nextId(), 'Exec thesis banner', bannerBox, {
@@ -1020,26 +1275,98 @@ export function renderCoreSlidePptx(slide, index, total, theme, langAttr, manife
1020
1275
  availH = bodyBottomY - topOffset
1021
1276
  }
1022
1277
 
1023
- // 计算每张卡片的几何坐标(支持 bento 非对称网格与 pillars 等分网格)
1024
- const cardBoxes = computeCardGridBoxes(n, variant, { x: 0.62, y: topOffset, w: 12.09, h: availH }, gap)
1278
+ // 计算每张卡片的几何坐标(支持 bento / bento-hero 非对称网格与 pillars/frameless 等分网格)
1279
+ const cardBoxes = isBentoHero
1280
+ ? (() => {
1281
+ const leftW = 12.09 * 0.43 - gap / 2
1282
+ const rightW = 12.09 - leftW - gap
1283
+ const rightCount = items.length - 1
1284
+ const rH = (availH - gap * (rightCount - 1)) / rightCount
1285
+ return [
1286
+ { x: 0.62, y: topOffset, w: leftW, h: availH },
1287
+ ...Array.from({ length: rightCount }, (_, ri) => ({
1288
+ x: 0.62 + leftW + gap,
1289
+ y: topOffset + ri * (rH + gap),
1290
+ w: rightW,
1291
+ h: rH,
1292
+ })),
1293
+ ]
1294
+ })()
1295
+ : computeCardGridBoxes(n, cardsVariant, { x: 0.62, y: topOffset, w: 12.09, h: availH }, gap)
1296
+
1025
1297
  items.slice(0, cardBoxes.length).forEach((it, idx) => {
1026
1298
  const box = cardBoxes[idx]
1027
- const isHero = variant === 'bento' && idx === 0
1028
- shapes.push(renderSurfaceCardPptx('Card Surface ' + (idx + 1), box, {
1029
- fill: isHero ? tk.surface2 : tk.surface1,
1030
- focal: isHero || idx === 0,
1031
- }, nextId, chromeCfg, theme))
1299
+ const isInvertedHero = isBentoHero && idx === 0
1300
+ const isHero = (cardsVariant === 'bento' || isBentoHero) && idx === 0
1301
+ const iconName = resolveItemIcon(it, idx)
1302
+
1303
+ if (isInvertedHero) {
1304
+ const heroGradA = tk.coverBg || tk.accentPrimary
1305
+ const heroGradB = mixHex(heroGradA, tk.accentSecondary, 0.35)
1306
+ shapes.push(ooxmlShape(nextId(), 'Card Hero Surface', box, {
1307
+ preset: 'roundRect',
1308
+ adj: roundRectAdj(box.w, box.h, Math.max(10, chromeCfg.cardRadiusPx)),
1309
+ gradientStops: [
1310
+ { offset: 0, color: heroGradA },
1311
+ { offset: 1, color: heroGradB },
1312
+ ],
1313
+ gradientAngle: 140,
1314
+ shadow: theme.shadow,
1315
+ }))
1316
+ } else {
1317
+ shapes.push(renderSurfaceCardPptx('Card Surface ' + (idx + 1), box, {
1318
+ fill: isHero ? tk.surface2 : tk.surface1,
1319
+ focal: isHero || idx === 0,
1320
+ cardMaterial: effCardMat,
1321
+ }, nextId, chromeCfg, theme))
1322
+ if (isFramelessCards && idx > 0 && box.y === cardBoxes[idx - 1].y) {
1323
+ shapes.push(ooxmlLine(nextId(), 'Frameless Divider ' + idx, { x: box.x - gap / 2, y: box.y + 0.10 }, { x: box.x - gap / 2, y: box.y + box.h - 0.10 }, {
1324
+ color: tk.hairline,
1325
+ widthPt: 0.5,
1326
+ }))
1327
+ }
1328
+ }
1032
1329
 
1330
+ const padX = !isInvertedHero && (effCardMat === 'frameless' || effCardMat === 'editorial-rule') ? 0.04 : 0.24
1033
1331
  const badge = it.tag || String(idx + 1).padStart(2, '0')
1034
- if (chromeCfg.useDisplayNumeral) {
1035
- shapes.push(ooxmlShape(nextId(), 'Card Badge ' + (idx + 1), { x: box.x + 0.22, y: box.y + 0.16, w: Math.min(2.8, box.w - 0.44), h: 0.44 }, {
1332
+ const titleColor = isInvertedHero ? '#F8FAFC' : tk.inkPrimary
1333
+ const bodyColor = isInvertedHero ? '#E2E8F0' : tk.inkSecondary
1334
+ const statColor = isInvertedHero ? '#FDE68A' : tk.accentText
1335
+
1336
+ let headerRowH = 0.42
1337
+ if (iconName) {
1338
+ shapes.push(renderIconBadgePptx('Card Icon ' + (idx + 1), { x: box.x + padX, y: box.y + 0.20, w: 0.40, h: 0.40 }, iconName, nextId, theme, {
1339
+ style: isInvertedHero ? 'ring' : taste.iconBadgeStyle,
1340
+ color: isInvertedHero ? '#FFFFFF' : tk.accentPrimary,
1341
+ stroke: isInvertedHero ? '#FFFFFF' : tk.accentPrimary,
1342
+ }))
1343
+ if (it.tag) {
1344
+ shapes.push(ooxmlShape(nextId(), 'Card Tag ' + (idx + 1), { x: box.x + padX + 0.50, y: box.y + 0.22, w: Math.max(0.8, box.w - padX * 2 - 0.50), h: 0.34 }, {
1345
+ txBox: true,
1346
+ anchor: 'ctr',
1347
+ marginsIn: { l: 0, r: 0, t: 0, b: 0 },
1348
+ paragraphs: [
1349
+ ooxmlRichParagraph(it.tag.toUpperCase(), {
1350
+ sizePt: 10.5,
1351
+ color: isInvertedHero ? '#CBD5E1' : tk.accentText,
1352
+ bold: true,
1353
+ lang: langAttr,
1354
+ font: theme.fonts.body,
1355
+ spc: 120,
1356
+ }),
1357
+ ],
1358
+ }))
1359
+ }
1360
+ headerRowH = 0.52
1361
+ } else if (chromeCfg.useDisplayNumeral || isFramelessCards) {
1362
+ shapes.push(ooxmlShape(nextId(), 'Card Badge ' + (idx + 1), { x: box.x + padX, y: box.y + 0.16, w: Math.min(2.8, box.w - padX * 2), h: 0.44 }, {
1036
1363
  txBox: true,
1037
1364
  anchor: 'ctr',
1038
1365
  marginsIn: { l: 0, r: 0, t: 0, b: 0 },
1039
1366
  paragraphs: [
1040
1367
  ooxmlRichParagraph(badge, {
1041
- sizePt: /^\d+$/.test(badge) ? 24 : 12.5,
1042
- color: tk.accentText,
1368
+ sizePt: /^\d+$/.test(badge) ? 24 : 12,
1369
+ color: isInvertedHero ? '#FDE68A' : tk.accentText,
1043
1370
  bold: true,
1044
1371
  lang: langAttr,
1045
1372
  font: theme.fonts.heading,
@@ -1047,18 +1374,20 @@ export function renderCoreSlidePptx(slide, index, total, theme, langAttr, manife
1047
1374
  }),
1048
1375
  ],
1049
1376
  }))
1377
+ headerRowH = 0.50
1050
1378
  } else {
1051
- const badgeW = computeBadgePillWidth(badge, 11, box.w - 0.44, 0.54)
1052
- shapes.push(ooxmlShape(nextId(), 'Card Badge ' + (idx + 1), { x: box.x + 0.22, y: box.y + 0.20, w: badgeW, h: 0.30 }, {
1379
+ const badgeW = computeBadgePillWidth(badge, 11, box.w - padX * 2, 0.54)
1380
+ shapes.push(ooxmlShape(nextId(), 'Card Badge ' + (idx + 1), { x: box.x + padX, y: box.y + 0.20, w: badgeW, h: 0.30 }, {
1053
1381
  preset: cardPreset,
1054
1382
  adj: roundRectAdj(badgeW, 0.30, Math.min(6, chromeCfg.cardRadiusPx)),
1055
- fill: isHero ? tk.accentPrimary : tk.accentSoft,
1383
+ fill: isInvertedHero ? '#FFFFFF' : (isHero ? tk.accentPrimary : tk.accentSoft),
1384
+ fillAlpha: isInvertedHero ? 0.16 : 1,
1056
1385
  anchor: 'ctr',
1057
1386
  marginsIn: { l: 0.04, r: 0.04, t: 0.01, b: 0.01 },
1058
1387
  paragraphs: [
1059
1388
  ooxmlRichParagraph(badge, {
1060
1389
  sizePt: 11,
1061
- color: isHero ? tk.inkOnAccent : tk.accentText,
1390
+ color: isInvertedHero ? '#FFFFFF' : (isHero ? tk.inkOnAccent : tk.accentText),
1062
1391
  bold: true,
1063
1392
  lang: langAttr,
1064
1393
  align: 'ctr',
@@ -1066,31 +1395,32 @@ export function renderCoreSlidePptx(slide, index, total, theme, langAttr, manife
1066
1395
  }),
1067
1396
  ],
1068
1397
  }))
1398
+ headerRowH = 0.42
1069
1399
  }
1070
1400
 
1071
- const innerTop = box.y + (chromeCfg.useDisplayNumeral ? 0.66 : 0.58)
1072
- const innerBox = { x: box.x + 0.22, y: innerTop, w: box.w - 0.44, h: Math.max(0.5, box.y + box.h - innerTop - 0.16) }
1401
+ const innerTop = box.y + 0.20 + headerRowH
1402
+ const innerBox = { x: box.x + padX, y: innerTop, w: box.w - padX * 2, h: Math.max(0.5, box.y + box.h - innerTop - 0.16) }
1073
1403
  const bodyLines = [
1074
1404
  ...(it.text ? [it.text] : []),
1075
1405
  ...(it.bullets ?? []),
1076
1406
  ]
1077
- const fit = computeTextFit([it.title || '', ...bodyLines], innerBox, 'cardBody', { maxPt: 15.5, minPt: 13.5, padXPt: 2, padYPt: 2 })
1407
+ const fit = computeTextFit([it.title || '', ...bodyLines], innerBox, 'cardBody', { maxPt: isInvertedHero ? 16 : 15.5, minPt: 13.5, padXPt: 2, padYPt: 2 })
1078
1408
  const paras = []
1079
1409
  if (it.title) {
1080
1410
  paras.push(ooxmlRichParagraph(it.title, {
1081
- sizePt: Math.min(18, fit.fontPt + 2),
1082
- color: tk.inkPrimary,
1411
+ sizePt: Math.min(isInvertedHero ? 21 : 18, fit.fontPt + (isInvertedHero ? 4 : 2)),
1412
+ color: titleColor,
1083
1413
  bold: true,
1084
1414
  lang: langAttr,
1085
1415
  font: theme.fonts.heading,
1086
1416
  lineHeight: 1.25,
1087
- spaceAfterPt: bodyLines.length ? 6 : 0,
1417
+ spaceAfterPt: bodyLines.length || it.value ? 6 : 0,
1088
1418
  }))
1089
1419
  }
1090
1420
  if (it.value) {
1091
1421
  paras.push(ooxmlRichParagraph(it.value + (it.unit ? ' ' + it.unit : ''), {
1092
- sizePt: 24,
1093
- color: tk.accentText,
1422
+ sizePt: isInvertedHero ? 30 : 24,
1423
+ color: statColor,
1094
1424
  bold: true,
1095
1425
  lang: langAttr,
1096
1426
  font: theme.fonts.heading,
@@ -1100,8 +1430,8 @@ export function renderCoreSlidePptx(slide, index, total, theme, langAttr, manife
1100
1430
  if (it.text) {
1101
1431
  paras.push(ooxmlRichParagraph(it.text, {
1102
1432
  sizePt: fit.fontPt,
1103
- color: tk.inkSecondary,
1104
- accentColor: tk.accentText,
1433
+ color: bodyColor,
1434
+ accentColor: statColor,
1105
1435
  lang: langAttr,
1106
1436
  font: theme.fonts.body,
1107
1437
  lineHeight: 1.42,
@@ -1111,10 +1441,10 @@ export function renderCoreSlidePptx(slide, index, total, theme, langAttr, manife
1111
1441
  for (const b of it.bullets ?? []) {
1112
1442
  paras.push(ooxmlRichParagraph(b, {
1113
1443
  sizePt: fit.fontPt,
1114
- color: tk.inkSecondary,
1115
- accentColor: tk.accentText,
1444
+ color: bodyColor,
1445
+ accentColor: statColor,
1116
1446
  bullet: true,
1117
- bulletColor: tk.accentPrimary,
1447
+ bulletColor: isInvertedHero ? '#FDE68A' : tk.accentPrimary,
1118
1448
  lang: langAttr,
1119
1449
  font: theme.fonts.body,
1120
1450
  lineHeight: 1.38,
@@ -1661,12 +1991,22 @@ function computeCardGridBoxes(count, variant, area, gap) {
1661
1991
  export function renderCoreSlideHtml(slide, index, total, ui, langId, manifest = {}, theme) {
1662
1992
  const layout = slide.layout || 'bullets'
1663
1993
  const variant = slide.variant || ''
1994
+ const taste = resolveActiveTaste(manifest, slide)
1995
+ const cardMaterial = variant === 'frameless' ? 'frameless' : taste.cardMaterial
1996
+ const matClass = cardMaterial && cardMaterial !== 'solid' ? ' mat-' + cardMaterial : ''
1997
+ const resolveItemIcon = (it, idx) => {
1998
+ const explicit = normalizeIconName(it?.icon)
1999
+ if (explicit) return explicit
2000
+ if (it?.icon === 'auto' || taste.iconMode === 'auto') return resolveSemanticIcon(it, idx)
2001
+ return ''
2002
+ }
1664
2003
  const kicker = slide.kicker || (layout === 'cover' ? ui.coverKicker : '')
1665
2004
  const title = slide.title || ''
1666
2005
  const subtitle = slide.subtitle || ''
1667
2006
  const bullets = Array.isArray(slide.bullets) ? slide.bullets : []
1668
2007
  const isFraming = layout === 'cover' || layout === 'closing'
1669
- const inverted = isFraming && (variant === 'inverted' || (!variant && theme.tokens.coverMode === 'inverted-accent'))
2008
+ const coverVariant = layout === 'cover' ? (variant || taste.recipe?.coverVariant || '') : variant
2009
+ const inverted = isFraming && (coverVariant === 'inverted' || (!coverVariant && theme.tokens.coverMode === 'inverted-accent'))
1670
2010
  const chromeStyle = resolveChromeStyle(theme, slide, manifest.brand)
1671
2011
  const folioText = String(index + 1).padStart(2, '0') + ' / ' + String(total).padStart(2, '0')
1672
2012
  const renderHeader = (fallbackKicker = '') =>
@@ -1677,15 +2017,30 @@ export function renderCoreSlideHtml(slide, index, total, ui, langId, manifest =
1677
2017
 
1678
2018
  if (layout === 'cover') {
1679
2019
  const meta = [slide.text, slide.source, !manifest.brand?.footer ? ui.generatedBy : ''].filter(Boolean)[0] || ''
1680
- inner =
1681
- '<div class="cover-shell' + (inverted ? ' is-inverted' : '') + '">' +
1682
- '<div class="cover-lockup">' +
1683
- (kicker !== '' ? '<div class="kicker">' + escapeHtml(kicker) + '</div>' : '') +
1684
- '<h1>' + renderInlineHtml(title) + '</h1>' +
1685
- (subtitle !== '' ? '<div class="subtitle">' + renderInlineHtml(subtitle) + '</div>' : '') +
1686
- '</div>' +
1687
- (meta !== '' ? '<div class="meta">' + escapeHtml(meta) + '</div>' : '') +
1688
- '</div>'
2020
+ const posterHtml = renderPosterCoverHtml(slide, {
2021
+ coverVariant,
2022
+ title,
2023
+ subtitle,
2024
+ kicker,
2025
+ meta,
2026
+ total,
2027
+ langId,
2028
+ manifest,
2029
+ theme,
2030
+ })
2031
+ if (posterHtml !== null) {
2032
+ inner = posterHtml
2033
+ } else {
2034
+ inner =
2035
+ '<div class="cover-shell' + (inverted ? ' is-inverted' : '') + '">' +
2036
+ '<div class="cover-lockup">' +
2037
+ (kicker !== '' ? '<div class="kicker">' + escapeHtml(kicker) + '</div>' : '') +
2038
+ '<h1>' + renderInlineHtml(title) + '</h1>' +
2039
+ (subtitle !== '' ? '<div class="subtitle">' + renderInlineHtml(subtitle) + '</div>' : '') +
2040
+ '</div>' +
2041
+ (meta !== '' ? '<div class="meta">' + escapeHtml(meta) + '</div>' : '') +
2042
+ '</div>'
2043
+ }
1689
2044
  } else if (layout === 'closing') {
1690
2045
  const items = resolveEffectiveItems(slide)
1691
2046
  const showCtaCards = (variant === 'cta-cards' || items.length >= 2) && (slide.items?.length || bullets.length >= 2)
@@ -1697,7 +2052,7 @@ export function renderCoreSlideHtml(slide, index, total, ui, langId, manifest =
1697
2052
  (showCtaCards
1698
2053
  ? '<div class="layout-grid cols-' + Math.min(3, items.length) + ' closing-cards">' +
1699
2054
  items.slice(0, 3).map((it) =>
1700
- '<div class="surface-card"><div class="card-title">' + renderInlineHtml(it.title || '') + '</div>' +
2055
+ '<div class="surface-card' + matClass + '"><div class="card-title">' + renderInlineHtml(it.title || '') + '</div>' +
1701
2056
  (it.text ? '<div class="card-body">' + renderInlineHtml(it.text) + '</div>' : '') + '</div>',
1702
2057
  ).join('') +
1703
2058
  '</div>'
@@ -1705,14 +2060,22 @@ export function renderCoreSlideHtml(slide, index, total, ui, langId, manifest =
1705
2060
  (!manifest.brand?.footer ? '<div class="meta">' + escapeHtml(ui.generatedBy) + '</div>' : '') +
1706
2061
  '</div>'
1707
2062
  } else if (layout === 'section') {
1708
- inner =
1709
- (chromeStyle === 'editorial-folio'
1710
- ? '<div class="editorial-folio-bar"><span class="kicker">' + escapeHtml(kicker || '') + '</span><span class="slide-folio">' + folioText + '</span></div>'
1711
- : '') +
1712
- (kicker !== '' && kicker !== title ? '<div class="kicker section-index">' + escapeHtml(kicker) + '</div>' : '') +
1713
- '<div class="accent-line"></div>' +
1714
- '<h2>' + renderInlineHtml(title) + '</h2>' +
1715
- (subtitle !== '' ? '<div class="subtitle">' + renderInlineHtml(subtitle) + '</div>' : '')
2063
+ const secVariant = variant || taste.recipe?.sectionVariant || ''
2064
+ const agendaHtml = secVariant === 'agenda'
2065
+ ? renderSectionAgendaHtml(slide, { index, title, subtitle, kicker, langId, manifest })
2066
+ : null
2067
+ if (agendaHtml !== null) {
2068
+ inner = agendaHtml
2069
+ } else {
2070
+ inner =
2071
+ (chromeStyle === 'editorial-folio'
2072
+ ? '<div class="editorial-folio-bar"><span class="kicker">' + escapeHtml(kicker || '') + '</span><span class="slide-folio">' + folioText + '</span></div>'
2073
+ : '') +
2074
+ (kicker !== '' && kicker !== title ? '<div class="kicker section-index">' + escapeHtml(kicker) + '</div>' : '') +
2075
+ '<div class="accent-line"></div>' +
2076
+ '<h2>' + renderInlineHtml(title) + '</h2>' +
2077
+ (subtitle !== '' ? '<div class="subtitle">' + renderInlineHtml(subtitle) + '</div>' : '')
2078
+ }
1716
2079
  } else if (layout === 'statement') {
1717
2080
  inner =
1718
2081
  (chromeStyle === 'editorial-folio'
@@ -1766,43 +2129,106 @@ export function renderCoreSlideHtml(slide, index, total, ui, langId, manifest =
1766
2129
  '</ol>'
1767
2130
  } else if (layout === 'kpi') {
1768
2131
  const items = resolveEffectiveItems(slide).slice(0, 4)
1769
- inner =
1770
- renderHeader() +
1771
- '<div class="layout-grid kpi-grid cols-' + Math.max(1, items.length) + '">' +
1772
- items.map((it, idx) =>
1773
- '<div class="surface-card kpi-card' + (idx === 0 ? ' is-focal' : '') + '" data-item-index="' + idx + '">' +
1774
- (it.value && it.title ? '<div class="kpi-label" data-item-field="title">' + renderInlineHtml(it.title) + '</div>' : '') +
1775
- '<div class="kpi-value"><span data-item-field="value">' + escapeHtml(it.value || it.title || '—') + '</span>' +
1776
- (it.unit ? '<small class="kpi-unit" data-item-field="unit">' + escapeHtml(it.unit) + '</small>' : '') + '</div>' +
1777
- (it.delta ? '<span class="kpi-delta tone-' + escapeHtml(it.status || 'positive') + '" data-item-field="delta">' + escapeHtml(it.delta) + '</span>' : '') +
1778
- (it.text ? '<div class="card-body" data-item-field="text">' + renderInlineHtml(it.text) + '</div>' : '') +
1779
- '</div>',
1780
- ).join('') +
1781
- '</div>'
2132
+ const kpiVariant = variant || taste.recipe?.kpiVariant || ''
2133
+ const effKpiMatClass = kpiVariant === 'frameless' ? ' mat-frameless' : matClass
2134
+ if (kpiVariant === 'spotlight' && items.length >= 2) {
2135
+ const hero = items[0]
2136
+ const heroIcon = resolveItemIcon(hero, 0)
2137
+ const heroHeadMarkup = heroIcon
2138
+ ? '<div class="kpi-head-row">' + renderIconBadgeHtml(heroIcon, { style: taste.iconBadgeStyle, size: 20 }) +
2139
+ (hero.value && hero.title ? '<div class="kpi-label" data-item-field="title">' + renderInlineHtml(hero.title) + '</div>' : '') +
2140
+ '</div>'
2141
+ : (hero.value && hero.title ? '<div class="kpi-label" data-item-field="title">' + renderInlineHtml(hero.title) + '</div>' : '')
2142
+ const sats = items.slice(1, 4)
2143
+ inner =
2144
+ renderHeader() +
2145
+ '<div class="kpi-spotlight">' +
2146
+ '<div class="surface-card kpi-card kpi-hero is-focal' + effKpiMatClass + '" data-item-index="0">' +
2147
+ heroHeadMarkup +
2148
+ '<div class="kpi-value is-hero-val"><span data-item-field="value">' + escapeHtml(hero.value || hero.title || '—') + '</span>' +
2149
+ (hero.unit ? '<small class="kpi-unit" data-item-field="unit">' + escapeHtml(hero.unit) + '</small>' : '') + '</div>' +
2150
+ (hero.delta ? '<span class="kpi-delta tone-' + escapeHtml(hero.status || 'positive') + '" data-item-field="delta">' + escapeHtml(hero.delta) + '</span>' : '') +
2151
+ (hero.text ? '<div class="card-body" data-item-field="text">' + renderInlineHtml(hero.text) + '</div>' : '') +
2152
+ '</div>' +
2153
+ '<div class="kpi-sat-stack">' +
2154
+ sats.map((it, si) => {
2155
+ const sIcon = resolveItemIcon(it, si + 1)
2156
+ return (
2157
+ '<div class="kpi-sat-row" data-item-index="' + (si + 1) + '">' +
2158
+ (sIcon ? renderIconBadgeHtml(sIcon, { style: taste.iconBadgeStyle, size: 18 }) : '') +
2159
+ '<div class="kpi-sat-copy">' +
2160
+ (it.value && it.title ? '<div class="card-title" data-item-field="title">' + renderInlineHtml(it.title) + '</div>' : '') +
2161
+ (it.text ? '<div class="card-body" data-item-field="text">' + renderInlineHtml(it.text) + '</div>' : '') +
2162
+ '</div>' +
2163
+ '<div class="kpi-sat-metric">' +
2164
+ '<div class="kpi-sat-val"><span data-item-field="value">' + escapeHtml(it.value || it.title || '—') + '</span>' +
2165
+ (it.unit ? '<small class="kpi-unit" data-item-field="unit">' + escapeHtml(it.unit) + '</small>' : '') + '</div>' +
2166
+ (it.delta ? '<span class="kpi-sat-delta tone-' + escapeHtml(it.status || 'positive') + '" data-item-field="delta">' + escapeHtml(it.delta) + '</span>' : '') +
2167
+ '</div></div>'
2168
+ )
2169
+ }).join('') +
2170
+ '</div></div>'
2171
+ } else {
2172
+ inner =
2173
+ renderHeader() +
2174
+ '<div class="layout-grid kpi-grid cols-' + Math.max(1, items.length) + '">' +
2175
+ items.map((it, idx) => {
2176
+ const iconName = resolveItemIcon(it, idx)
2177
+ const headMarkup = iconName
2178
+ ? '<div class="kpi-head-row">' + renderIconBadgeHtml(iconName, { style: taste.iconBadgeStyle, size: 18 }) +
2179
+ (it.value && it.title ? '<div class="kpi-label" data-item-field="title">' + renderInlineHtml(it.title) + '</div>' : '') +
2180
+ '</div>'
2181
+ : (it.value && it.title ? '<div class="kpi-label" data-item-field="title">' + renderInlineHtml(it.title) + '</div>' : '')
2182
+ return (
2183
+ '<div class="surface-card kpi-card' + (idx === 0 ? ' is-focal' : '') + effKpiMatClass + '" data-item-index="' + idx + '">' +
2184
+ headMarkup +
2185
+ '<div class="kpi-value"><span data-item-field="value">' + escapeHtml(it.value || it.title || '—') + '</span>' +
2186
+ (it.unit ? '<small class="kpi-unit" data-item-field="unit">' + escapeHtml(it.unit) + '</small>' : '') + '</div>' +
2187
+ (it.delta ? '<span class="kpi-delta tone-' + escapeHtml(it.status || 'positive') + '" data-item-field="delta">' + escapeHtml(it.delta) + '</span>' : '') +
2188
+ (it.text ? '<div class="card-body" data-item-field="text">' + renderInlineHtml(it.text) + '</div>' : '') +
2189
+ '</div>'
2190
+ )
2191
+ }).join('') +
2192
+ '</div>'
2193
+ }
1782
2194
  } else if (layout === 'cards') {
1783
2195
  const items = resolveEffectiveItems(slide)
1784
- const thesis = variant === 'exec-summary' && (slide.text || subtitle)
2196
+ const cardsVariant = variant || taste.recipe?.cardsVariant || ''
2197
+ const isBentoHero = cardsVariant === 'bento-hero' && items.length >= 2 && items.length <= 4
2198
+ const isFramelessCards = cardsVariant === 'frameless'
2199
+ const effMatClass = isFramelessCards ? ' mat-frameless' : matClass
2200
+ const thesis = cardsVariant === 'exec-summary' && (slide.text || subtitle)
1785
2201
  ? '<div class="exec-thesis">' + renderInlineHtml(slide.text || subtitle) + '</div>'
1786
2202
  : ''
1787
- const gridClass = variant === 'bento'
1788
- ? 'bento-grid bento-' + Math.min(6, Math.max(2, items.length))
1789
- : 'cols-' + Math.min(4, Math.max(2, items.length <= 4 ? items.length : 3))
1790
- const badgeClass = chromeStyle === 'editorial-folio' ? 'item-badge is-editorial-num' : 'item-badge'
2203
+ const gridClass = isBentoHero
2204
+ ? 'bento-hero-grid bento-hero-' + items.length
2205
+ : cardsVariant === 'bento'
2206
+ ? 'bento-grid bento-' + Math.min(6, Math.max(2, items.length))
2207
+ : 'cols-' + Math.min(4, Math.max(2, items.length <= 4 ? items.length : 3)) + (isFramelessCards ? ' is-frameless-grid' : '')
2208
+ const badgeClass = chromeStyle === 'editorial-folio' || isFramelessCards ? 'item-badge is-editorial-num' : 'item-badge'
1791
2209
  inner =
1792
2210
  renderHeader() +
1793
2211
  thesis +
1794
2212
  '<div class="layout-grid cards-grid ' + gridClass + '">' +
1795
- items.slice(0, 6).map((it, idx) =>
1796
- '<article class="surface-card' + (variant === 'bento' && idx === 0 ? ' is-hero' : '') + '" data-item-index="' + idx + '">' +
1797
- '<span class="' + badgeClass + '">' + escapeHtml(it.tag || String(idx + 1).padStart(2, '0')) + '</span>' +
1798
- (it.title ? '<h3 class="card-title" data-item-field="title">' + renderInlineHtml(it.title) + '</h3>' : '') +
1799
- (it.value ? '<div class="card-stat" data-item-field="value">' + escapeHtml(it.value + (it.unit ? ' ' + it.unit : '')) + '</div>' : '') +
1800
- (it.text ? '<div class="card-body" data-item-field="text">' + renderInlineHtml(it.text) + '</div>' : '') +
1801
- (it.bullets?.length
1802
- ? '<ul class="card-bullets">' + it.bullets.map((b) => '<li>' + renderInlineHtml(b, { autoLeadBold: true }) + '</li>').join('') + '</ul>'
1803
- : '') +
1804
- '</article>',
1805
- ).join('') +
2213
+ items.slice(0, 6).map((it, idx) => {
2214
+ const isInvHero = isBentoHero && idx === 0
2215
+ const iconName = resolveItemIcon(it, idx)
2216
+ const badgeMarkup = iconName
2217
+ ? '<div class="card-icon-row">' + renderIconBadgeHtml(iconName, { style: isInvHero ? 'ring' : taste.iconBadgeStyle, size: 19 }) +
2218
+ (it.tag ? '<span class="card-icon-tag">' + escapeHtml(it.tag) + '</span>' : '') + '</div>'
2219
+ : '<span class="' + badgeClass + '">' + escapeHtml(it.tag || String(idx + 1).padStart(2, '0')) + '</span>'
2220
+ return (
2221
+ '<article class="surface-card' + (isInvHero ? ' is-inverted-hero' : ((cardsVariant === 'bento' && idx === 0) ? ' is-hero' : '') + effMatClass) + '" data-item-index="' + idx + '">' +
2222
+ badgeMarkup +
2223
+ (it.title ? '<h3 class="card-title" data-item-field="title">' + renderInlineHtml(it.title) + '</h3>' : '') +
2224
+ (it.value ? '<div class="card-stat" data-item-field="value">' + escapeHtml(it.value + (it.unit ? ' ' + it.unit : '')) + '</div>' : '') +
2225
+ (it.text ? '<div class="card-body" data-item-field="text">' + renderInlineHtml(it.text) + '</div>' : '') +
2226
+ (it.bullets?.length
2227
+ ? '<ul class="card-bullets">' + it.bullets.map((b) => '<li>' + renderInlineHtml(b, { autoLeadBold: true }) + '</li>').join('') + '</ul>'
2228
+ : '') +
2229
+ '</article>'
2230
+ )
2231
+ }).join('') +
1806
2232
  '</div>'
1807
2233
  } else if (layout === 'comparison') {
1808
2234
  const items = resolveEffectiveItems(slide)
@@ -2027,12 +2453,13 @@ math.deck-math.is-block{display:block;font-size:clamp(20px,2.2vw,32px);margin:4p
2027
2453
  math.deck-math.is-inline{font-size:1.06em;vertical-align:middle}
2028
2454
  .callout-hero.is-omath{padding:22px 30px;display:flex;align-items:center;justify-content:center}
2029
2455
  .formula-caption{text-align:center;color:var(--ink-secondary);font-size:clamp(14px,1.35vw,18px);margin-top:-6px}
2456
+ ${AESTHETIC_STUDIO_CSS}
2030
2457
  ${DIAGRAMS_CSS}
2031
2458
  ${CHROME_CSS}
2032
2459
  ${MERMAID_CSS}
2033
2460
  @media (max-width:900px){
2034
- .cols-3,.cols-4,.cols-5,.cols-6,.bento-grid.bento-3,.bento-grid.bento-4,.bento-grid.bento-5,.bento-grid.bento-6,.tam-board,.arch-board.has-sidecar,.org-children,.flywheel-stage,.mekko-board,.porter-board,.swot-cross{grid-template-columns:1fr}
2035
- .bento-grid.bento-3 > :first-child,.bento-grid.bento-4 > *{grid-row:auto;grid-column:auto}
2461
+ .cols-3,.cols-4,.cols-5,.cols-6,.bento-grid.bento-3,.bento-grid.bento-4,.bento-grid.bento-5,.bento-grid.bento-6,.bento-hero-grid,.kpi-spotlight,.section-agenda-shell,.cover-shell.is-architectural,.ed-main-grid,.ed-meta-strip,.tam-board,.arch-board.has-sidecar,.org-children,.flywheel-stage,.mekko-board,.porter-board,.swot-cross{grid-template-columns:1fr}
2462
+ .bento-grid.bento-3 > :first-child,.bento-grid.bento-4 > *,.bento-hero-grid > :first-child{grid-row:auto;grid-column:auto}
2036
2463
  .issue-action-row,.gantt-head,.gantt-row,.arch-tier,.porter-support-zone{grid-template-columns:1fr}
2037
2464
  .flywheel-hub,.swot-anchor{position:static;transform:none;margin:0 auto}
2038
2465
  }