dsh-ppt 0.22.1 → 0.23.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.
@@ -3,7 +3,7 @@ import { resolve, dirname, extname, basename } from 'node:path'
3
3
  import { createHash, randomUUID } from 'node:crypto'
4
4
  import { inflateSync } from 'node:zlib'
5
5
  import { buildPptx, renderHtml, normalizeBuildOptions, normalizeSlides, resolveLanguage, resolveDeckFileName, commitDeckArtifacts, DECK_VERSION, buildDeck } from './deck-core.mjs'
6
- import { listThemes, resolveTheme, buildThemePreview as buildThemePreviewFromThemes, deriveBrandedTheme, pptxEastAsianFont } from './deck-themes.mjs'
6
+ import { listThemes, listMasterPresets, resolveTheme, buildThemePreview as buildThemePreviewFromThemes, deriveBrandedTheme, pptxEastAsianFont } from './deck-themes.mjs'
7
7
  import { CORE_LAYOUTS, LAYOUT_ALIASES, stripInlineMarkdown } from './deck-layouts.mjs'
8
8
  import { MEDIA_LAYOUTS, mediaBoxes, LOGO_BOX, FOOTER_BOX, normalizeChart, buildOfficeKitChartSpec, computeWaterfallGeometry } from './deck-media.mjs'
9
9
  import { normalizeDataModel, prepareDataSlides, validateDataSnapshot, previewDataChange, dataNotes, dataReport } from './deck-data.mjs'
@@ -13,7 +13,7 @@ import { SCENARIO_TEMPLATES, findScenarioTemplate, buildScenarioSlides, listScen
13
13
  export { readRenderReceipt } from './deck-render.mjs'
14
14
  export { dataNotes, dataReport } from './deck-data.mjs'
15
15
  export { buildDeck, resolveLanguage } from './deck-core.mjs'
16
- export { listThemes, resolveTheme } from './deck-themes.mjs'
16
+ export { listThemes, listMasterPresets, resolveTheme } from './deck-themes.mjs'
17
17
  export { absorbPptx } from './deck-absorb.mjs'
18
18
  export { inferThemeFromContent } from './deck-director.mjs'
19
19
 
@@ -101,16 +101,23 @@ function normalizeBrand(input, assets, cwd) {
101
101
  if (input === undefined || input === null) return undefined
102
102
  if (typeof input !== 'object' || Array.isArray(input)) fail('brand 必须是对象')
103
103
  const brand = {}
104
- for (const key of ['primaryColor', 'backgroundColor', 'textColor']) {
105
- if (input[key] !== undefined && input[key] !== '') {
104
+ for (const key of ['primaryColor', 'secondaryColor', 'backgroundColor', 'textColor', 'coverBg']) {
105
+ if (input[key] !== undefined && input[key] !== null && input[key] !== '') {
106
106
  if (!/^#[\da-f]{6}$/i.test(input[key])) fail(`brand.${key} 必须为 #RRGGBB`)
107
107
  brand[key] = input[key].toUpperCase()
108
108
  }
109
109
  }
110
- if (input.fontFamily) {
111
- const font = String(input.fontFamily).trim()
112
- if (font.length > 80 || !/^[\p{L}\p{N} _-]+$/u.test(font)) fail('brand.fontFamily 需单个字体名称,最多 80 字符')
113
- brand.fontFamily = font
110
+ for (const fontKey of ['fontFamily', 'headingFont']) {
111
+ if (input[fontKey]) {
112
+ const font = String(input[fontKey]).trim()
113
+ if (font.length > 80 || !/^[\p{L}\p{N} _-]+$/u.test(font)) fail(`brand.${fontKey} 需单个字体名称,最多 80 字符`)
114
+ brand[fontKey] = font
115
+ }
116
+ }
117
+ if (input.coverMode !== undefined && input.coverMode !== null && input.coverMode !== '') {
118
+ const cm = String(input.coverMode).trim()
119
+ if (!['standard', 'inverted-accent'].includes(cm)) fail('brand.coverMode 仅支持 standard / inverted-accent')
120
+ brand.coverMode = cm
114
121
  }
115
122
  if (input.name) brand.name = String(input.name).slice(0, 100)
116
123
  if (input.footer) {
@@ -456,7 +463,7 @@ function validateSnapshot(value, assets) {
456
463
  validateDataSnapshot(value, normalizeSlides)
457
464
  if (value.brand != null) {
458
465
  if (Object.hasOwn(value.brand, 'logo')) fail('工程品牌仅支持嵌入的 logoAssetId,不读取本地 logo 路径')
459
- for (const key of ['primaryColor', 'backgroundColor', 'textColor', 'fontFamily', 'name', 'footer', 'chromeStyle']) {
466
+ for (const key of ['primaryColor', 'secondaryColor', 'backgroundColor', 'textColor', 'fontFamily', 'headingFont', 'coverMode', 'coverBg', 'name', 'footer', 'chromeStyle']) {
460
467
  if (value.brand[key] !== undefined && typeof value.brand[key] !== 'string') fail('工程 brand.' + key + ' 必须为字符串')
461
468
  }
462
469
  normalizeBrand(value.brand, assets, '.')
@@ -498,7 +505,7 @@ function mapSlidesToAbsorbedSkeleton(slides, slideSkeleton, langId) {
498
505
  const metricHits = bullets.filter((b) => SKELETON_METRIC_RE.test(stripInlineMarkdown(b))).length
499
506
  const hasMetrics = n >= 2 && n <= 4 && (metricHits / n) >= 0.75
500
507
  // Avoid breaking Markdown-only slides that lack media assets (chart/image) by mapping media slots to visual card equivalents
501
- if (want === 'chart' || want === 'chart-split') {
508
+ if (want === 'chart' || want === 'chart-split' || want === 'waterfall') {
502
509
  return { ...slide, layout: hasMetrics ? 'kpi' : 'cards', variant: hasMetrics ? 'grid' : 'bento' }
503
510
  }
504
511
  if (want === 'image' || want === 'image-left' || want === 'image-right') {
@@ -516,7 +523,7 @@ function mapSlidesToAbsorbedSkeleton(slides, slideSkeleton, langId) {
516
523
  if (want === 'harvey' && (!Array.isArray(slide.rows) || slide.rows.length === 0)) {
517
524
  return { ...slide, layout: 'comparison', variant: 'versus' }
518
525
  }
519
- if (['cards', 'kpi', 'comparison', 'matrix', 'process', 'callout', 'statement', 'bullets', 'gantt', 'architecture', 'tam', 'org'].includes(want)) {
526
+ if (['cards', 'kpi', 'comparison', 'matrix', 'process', 'callout', 'statement', 'quote', 'bullets', 'gantt', 'architecture', 'tam', 'org'].includes(want)) {
520
527
  return {
521
528
  ...slide,
522
529
  layout: want,
@@ -796,7 +803,10 @@ export async function editDeck(options = {}) {
796
803
  if (options.referencePptx !== undefined && options.referencePptx !== null && String(options.referencePptx).trim() !== '') {
797
804
  const absorbed = await absorbPptx({ pptxPath: String(options.referencePptx).trim(), cwd, extractLogo: true, signal: options.signal })
798
805
  if (options.theme === undefined) next.theme = absorbed.recommendedTheme
799
- const absorbedBrand = { ...absorbed.sanitizedBrand }
806
+ const absorbedBrand = {
807
+ ...absorbed.sanitizedBrand,
808
+ ...(absorbed.recommendedChrome && !next.brand?.chromeStyle && !options.brand?.chromeStyle ? { chromeStyle: absorbed.recommendedChrome } : {}),
809
+ }
800
810
  if (
801
811
  absorbed.sanitizedTokens?.coverMode === 'inverted-accent' &&
802
812
  resolveTheme(next.theme).tokens?.coverMode === 'inverted-accent' &&
@@ -30,6 +30,8 @@ import {
30
30
  resolveTheme,
31
31
  resolveChromeStyle,
32
32
  listThemes,
33
+ CURATED_MASTER_PRESETS,
34
+ listMasterPresets,
33
35
  deriveBrandedTheme,
34
36
  sanitizeAbsorbedTheme,
35
37
  pptxFontName,
@@ -77,6 +79,8 @@ export {
77
79
  resolveTheme,
78
80
  resolveChromeStyle,
79
81
  listThemes,
82
+ CURATED_MASTER_PRESETS,
83
+ listMasterPresets,
80
84
  deriveBrandedTheme,
81
85
  sanitizeAbsorbedTheme,
82
86
  pptxFontName,
@@ -1135,6 +1135,309 @@ export const SCENARIO_TEMPLATES = Object.freeze([
1135
1135
  subtitle: ['待填写:策展机构、预约通道与展览日期', 'To fill: atelier, RSVP contact and exhibition dates'],
1136
1136
  },
1137
1137
  },
1138
+ {
1139
+ id: 'quarterly-okr',
1140
+ persona: 'consulting',
1141
+ theme: 'bcg-emerald',
1142
+ name: { zh: '季度经营与 OKR 复盘', en: 'Quarterly OKR review' },
1143
+ sections: [
1144
+ {
1145
+ title: ['本季 OKR 核心目标打分与经营指标总览', 'Quarterly OKR scorecards and headline metrics'],
1146
+ kicker: ['01 · OKR 总览', '01 · OKR Scorecard'],
1147
+ layout: 'kpi',
1148
+ variant: 'grid',
1149
+ bullets: [
1150
+ ['**O1 核心增长达成**:待填写 KR 完成率与关键量化结果', '**O2 产品体验升级**:待填写留存/NPS 变化与里程碑状态', '**O3 组织与效率**:待填写人效或成本优化幅度'],
1151
+ ['**O1 Growth target**: To fill: KR score and headline metric', '**O2 Product quality**: To fill: retention/NPS delta', '**O3 Operational efficiency**: To fill: unit economics gain'],
1152
+ ],
1153
+ },
1154
+ {
1155
+ title: ['端到端业务价值链各环节转化与协同复盘', 'End-to-end value-chain execution review'],
1156
+ kicker: ['02 · 价值链拆解', '02 · Value Chain'],
1157
+ layout: 'process',
1158
+ variant: 'chevron',
1159
+ items: [
1160
+ [
1161
+ { tag: '01', title: '需求洞察与立项', text: '待填写商机/需求命中率', conversion: '待填写转化率' },
1162
+ { tag: '02', title: '敏捷研发与交付', text: '待填写按期上线率', conversion: '待填写周期' },
1163
+ { tag: '03', title: '标杆落地与验证', text: '待填写客户采纳成效', conversion: '待填写留存' },
1164
+ { tag: '04', title: '规模化续费增购', text: '待填写净留存贡献', conversion: '待填写 NRR' },
1165
+ ],
1166
+ [
1167
+ { tag: '01', title: 'Discovery & Intake', text: 'To fill: hit rate', conversion: 'To fill' },
1168
+ { tag: '02', title: 'Agile Delivery', text: 'To fill: on-time ship rate', conversion: 'To fill' },
1169
+ { tag: '03', title: 'Pilot Adoption', text: 'To fill: activation impact', conversion: 'To fill' },
1170
+ { tag: '04', title: 'Expansion & NRR', text: 'To fill: upsell contribution', conversion: 'To fill' },
1171
+ ],
1172
+ ],
1173
+ bullets: [
1174
+ ['**价值链瓶颈**:待填写本季最关键的漏损环节与提效抓手'],
1175
+ ['**Chain bottleneck**: To fill: primary conversion drop-off and fix'],
1176
+ ],
1177
+ },
1178
+ {
1179
+ title: ['未达预期项根因剖析与跨部门纠偏动作', 'Misses, root causes and corrective actions'],
1180
+ kicker: ['03 · 差距纠偏', '03 · Gap & Action'],
1181
+ layout: 'comparison',
1182
+ variant: 'issue-action',
1183
+ bullets: [
1184
+ ['**待填写未达标 KR 与核心根因**:待填写下季改进举措、责任人与量化验收线'],
1185
+ ['**To fill: missed KR and root cause**: To fill: corrective action, owner and target'],
1186
+ ],
1187
+ },
1188
+ {
1189
+ title: ['下季度 OKR 关键战役排期与里程碑', 'Next-quarter OKR roadmap and milestones'],
1190
+ kicker: ['04 · 下季排期', '04 · Next Quarter'],
1191
+ layout: 'gantt',
1192
+ variant: 'quarters',
1193
+ columns: [
1194
+ ['M1', 'M2', 'M3'],
1195
+ ['M1', 'M2', 'M3'],
1196
+ ],
1197
+ items: [
1198
+ [
1199
+ { tag: '战役一', title: '核心增长引擎攻坚', text: '待填写 KR 目标', start: 0, span: 2, status: 'accent' },
1200
+ { tag: '战役二', title: '关键能力底座补齐', text: '待填写交付物', start: 1, span: 2, status: 'positive' },
1201
+ { tag: '里程碑', title: '季度末经营验收节点', text: '待填写日期', start: 2, span: 0, milestone: true, status: 'warning' },
1202
+ ],
1203
+ [
1204
+ { tag: 'Bet 1', title: 'Primary growth initiative', text: 'To fill: KR target', start: 0, span: 2, status: 'accent' },
1205
+ { tag: 'Bet 2', title: 'Platform capability upgrade', text: 'To fill: deliverable', start: 1, span: 2, status: 'positive' },
1206
+ { tag: 'Gate', title: 'QBR Sign-off Milestone', text: 'To fill: date', start: 2, span: 0, milestone: true, status: 'warning' },
1207
+ ],
1208
+ ],
1209
+ bullets: [
1210
+ ['**资源锁定**:待填写下季度预算与编制需求'],
1211
+ ['**Resource lock**: To fill: headcount and budget dependencies'],
1212
+ ],
1213
+ },
1214
+ ],
1215
+ closing: {
1216
+ title: ['对齐下季北极星指标,立即启动首周拆解', 'Align on next-quarter north star and kick off Week 1'],
1217
+ subtitle: ['待填写:团队负责人与复盘日期', 'To fill: team lead and review date'],
1218
+ },
1219
+ },
1220
+ {
1221
+ id: 'product-prd',
1222
+ persona: 'tech-pitch',
1223
+ theme: 'stripe-craft',
1224
+ name: { zh: '产品需求与方案评审(PRD)', en: 'Product PRD & design review' },
1225
+ sections: [
1226
+ {
1227
+ title: ['真实用户场景痛点与新旧交互路径对比', 'User friction and before/after workflow'],
1228
+ kicker: ['01 · 用户痛点', '01 · User Friction'],
1229
+ layout: 'comparison',
1230
+ variant: 'before-after',
1231
+ bullets: [
1232
+ ['**改版前操作断点**:待填写用户在旧流程中的步骤耗时与流失率数据', '**改版后顺滑路径**:待填写新交互如何消除断点并缩短完成时长'],
1233
+ ['**Current friction**: To fill: drop-off rate and manual steps today', '**Proposed flow**: To fill: streamlined interaction and time saved'],
1234
+ ],
1235
+ },
1236
+ {
1237
+ title: ['本期核心功能模块与优先级范围边界', 'Core feature scope and Bento breakdown'],
1238
+ kicker: ['02 · 功能范围', '02 · Feature Scope'],
1239
+ layout: 'cards',
1240
+ variant: 'bento',
1241
+ bullets: [
1242
+ ['**P0 核心体验闭环**:待填写首期必须上线的主路径能力与验收口径', '**P1 效率增强项**:待填写批处理、快捷键或推荐辅助能力', '**明确不做(Out of Scope)**:待填写延后至二期的非核心诉求'],
1243
+ ['**P0 Core loop**: To fill: must-ship user journey and acceptance criteria', '**P1 Power UX**: To fill: shortcuts, presets and assistive defaults', '**Non-goals**: To fill: explicitly deferred items'],
1244
+ ],
1245
+ },
1246
+ {
1247
+ title: ['前后端系统交互与数据埋点分层方案', 'System integration and telemetry architecture'],
1248
+ kicker: ['03 · 技术与埋点', '03 · Architecture & Metrics'],
1249
+ layout: 'architecture',
1250
+ variant: 'layered',
1251
+ items: [
1252
+ [
1253
+ { tag: '交互层', title: '客户端组件与状态反馈', bullets: ['待填写关键视图', '异常兜底态'] },
1254
+ { tag: '服务层', title: '接口契约与权限校验', bullets: ['待填写核心 API', '幂等与限流'] },
1255
+ { tag: '数据层', title: '核心漏斗埋点与实验归因', bullets: ['待填写北极星指标', 'A/B 实验分组'] },
1256
+ ],
1257
+ [
1258
+ { tag: 'UI Layer', title: 'Client components & states', bullets: ['To fill: key views', 'Error recovery'] },
1259
+ { tag: 'API Layer', title: 'Contracts & permissions', bullets: ['To fill: endpoints', 'Rate limits'] },
1260
+ { tag: 'Telemetry', title: 'Funnel events & A/B flags', bullets: ['To fill: success metric', 'Experiment cohorts'] },
1261
+ ],
1262
+ ],
1263
+ bullets: [
1264
+ ['**上线衡量标准**:待填写发布后 14 天核心转化或留存验收阈值'],
1265
+ ['**Success threshold**: To fill: 14-day post-launch metric target'],
1266
+ ],
1267
+ },
1268
+ {
1269
+ title: ['设计走查、联调提测与灰度放量排期', 'Design QA, engineering build and rollout plan'],
1270
+ kicker: ['04 · 交付排期', '04 · Rollout Plan'],
1271
+ layout: 'gantt',
1272
+ variant: 'weeks',
1273
+ columns: [
1274
+ ['W1', 'W2', 'W3', 'W4'],
1275
+ ['W1', 'W2', 'W3', 'W4'],
1276
+ ],
1277
+ items: [
1278
+ [
1279
+ { tag: '设计定稿', title: '交互走查与视觉交付', start: 0, span: 1, status: 'accent' },
1280
+ { tag: '研发联调', title: '前后端开发与埋点自测', start: 1, span: 2 },
1281
+ { tag: '灰度全量', title: '10% 灰度验证与全量发布', start: 3, span: 1, status: 'positive' },
1282
+ ],
1283
+ [
1284
+ { tag: 'Design', title: 'Figma sign-off & copy review', start: 0, span: 1, status: 'accent' },
1285
+ { tag: 'Build', title: 'Implementation & integration', start: 1, span: 2 },
1286
+ { tag: 'Rollout', title: '10% canary to 100% GA', start: 3, span: 1, status: 'positive' },
1287
+ ],
1288
+ ],
1289
+ bullets: [
1290
+ ['**评审待决项**:待填写需产研测当场拍板的边界问题'],
1291
+ ['**Open decisions**: To fill: edge cases requiring sign-off today'],
1292
+ ],
1293
+ },
1294
+ ],
1295
+ closing: {
1296
+ title: ['确认 P0 范围与排期,进入研发排期锁定', 'Sign off P0 scope and lock sprint schedule'],
1297
+ subtitle: ['待填写:产品经理、设计及研发接口人', 'To fill: PM, design and engineering leads'],
1298
+ },
1299
+ },
1300
+ {
1301
+ id: 'vc-daylight',
1302
+ persona: 'tech-pitch',
1303
+ theme: 'venture-daylight',
1304
+ name: { zh: '创投融资简报(明亮阅读版)', en: 'Daylight investor deck' },
1305
+ sections: [
1306
+ {
1307
+ title: ['结构性市场拐点与刚性未被满足的痛点', 'Structural catalyst and urgent customer pain'],
1308
+ kicker: ['01 · 痛点与拐点', '01 · Why Now'],
1309
+ layout: 'cards',
1310
+ variant: 'pillars',
1311
+ bullets: [
1312
+ ['**存量方案高昂代价**:待填写目标客户当前损耗的真实成本数据', '**技术与供给侧拐点**:待填写使 10 倍体验跃迁成为可能的关键变化', '**切入楔子(Wedge)**:待填写高频、高留存的首发刚需场景'],
1313
+ ['**Incumbent tax**: To fill: quantified time & cost pain today', '**Why now**: To fill: enabling technology or regulatory shift', '**Initial wedge**: To fill: high-frequency entry workflow'],
1314
+ ],
1315
+ },
1316
+ {
1317
+ title: ['早期商业化验证:高增速与健康单位经济模型', 'Early traction and unit economics proof'],
1318
+ kicker: ['02 · 增长验证', '02 · Traction'],
1319
+ layout: 'kpi',
1320
+ variant: 'grid',
1321
+ bullets: [
1322
+ ['**核心营收 / ARR**:待填写当前规模与月/季复合增速', '**净收入留存(NRR)**:待填写付费留存与扩购表现', '**毛利率与回收期**:待填写毛利水平与 CAC Payback 月数'],
1323
+ ['**ARR / GMV**: To fill: current run-rate and MoM/QoQ growth', '**Net retention**: To fill: cohort retention and expansion', '**Payback & margin**: To fill: gross margin and CAC payback'],
1324
+ ],
1325
+ },
1326
+ {
1327
+ title: ['从首发细分市场向百亿级可触达空间扩张', 'Bottom-up market sizing from SOM to TAM'],
1328
+ kicker: ['03 · 市场空间', '03 · Market Size'],
1329
+ layout: 'tam',
1330
+ variant: 'concentric',
1331
+ items: [
1332
+ [
1333
+ { tag: 'TAM', value: '待填写总额', title: '全球目标行业总体潜在市场', text: '待填写自下而上测算口径' },
1334
+ { tag: 'SAM', value: '待填写规模', title: '核心产品线可服务市场空间', text: '待填写目标客群数量 × 客单价' },
1335
+ { tag: 'SOM', value: '待填写目标', title: '未来 24 个月可拿下份额', text: '待填写标杆渠道转化路径' },
1336
+ ],
1337
+ [
1338
+ { tag: 'TAM', value: 'To fill', title: 'Total addressable spend', text: 'To fill: bottom-up sizing formula' },
1339
+ { tag: 'SAM', value: 'To fill', title: 'Serviceable target segment', text: 'To fill: account count × ACV' },
1340
+ { tag: 'SOM', value: 'To fill', title: '24-month obtainable target', text: 'To fill: GTM wedge capture' },
1341
+ ],
1342
+ ],
1343
+ bullets: [
1344
+ ['**测算依据**:待填写客单价与目标客户基数的核验来源'],
1345
+ ['**Sizing basis**: To fill: verified account count and ACV assumptions'],
1346
+ ],
1347
+ },
1348
+ {
1349
+ title: ['核心技术护城河与主流竞品全维度对比', 'Defensibility and competitive landscape'],
1350
+ kicker: ['04 · 竞争壁垒', '04 · Moat & Matrix'],
1351
+ layout: 'harvey',
1352
+ rows: [
1353
+ [
1354
+ ['关键能力', '我们', '传统巨头', '同类初创'],
1355
+ ['开箱即用交付速度', '●', '◔', '◑'],
1356
+ ['数据飞轮与专有壁垒', '●', '◑', '◔'],
1357
+ ['总体拥有成本优势', '●', '○', '◑'],
1358
+ ],
1359
+ [
1360
+ ['Capability', 'Us', 'Incumbents', 'Point Startups'],
1361
+ ['Time-to-value', '●', '◔', '◑'],
1362
+ ['Proprietary data moat', '●', '◑', '◔'],
1363
+ ['TCO advantage', '●', '○', '◑'],
1364
+ ],
1365
+ ],
1366
+ bullets: [
1367
+ ['**复利壁垒**:待填写随规模扩大而增强的网络效应或切换成本'],
1368
+ ['**Compounding moat**: To fill: switching costs or data network effects'],
1369
+ ],
1370
+ },
1371
+ ],
1372
+ closing: {
1373
+ title: ['本轮融资规划与未来 18 个月关键里程碑', 'Fundraising terms & 18-month milestones'],
1374
+ subtitle: ['待填写:融资金额、资金用途比例与创始人联系方式', 'To fill: round size, use of proceeds and founder contact'],
1375
+ },
1376
+ },
1377
+ {
1378
+ id: 'industry-research',
1379
+ persona: 'consulting',
1380
+ theme: 'economist-brief',
1381
+ tableStyle: 'booktabs',
1382
+ name: { zh: '行业研究与宏观洞察', en: 'Macro & industry research' },
1383
+ sections: [
1384
+ {
1385
+ title: ['核心研判:技术成本曲线下移正触发产业链利润池重分配', 'Core thesis: falling cost curves are redistributing value-chain profit pools'],
1386
+ kicker: ['01 · 核心研判', '01 · Core Thesis'],
1387
+ layout: 'statement',
1388
+ bullets: [
1389
+ ['待填写:一句话浓缩本篇行研最具洞察力的非共识结论与时间窗口'],
1390
+ ['To fill: one non-consensus analytical thesis with timeframe and magnitude'],
1391
+ ],
1392
+ },
1393
+ {
1394
+ title: ['产业链上中下游价值分布与议价权演进', 'Value-chain profit pool and bargaining power'],
1395
+ kicker: ['02 · 产业链图谱', '02 · Value Chain'],
1396
+ layout: 'process',
1397
+ variant: 'chevron',
1398
+ items: [
1399
+ [
1400
+ { tag: '上游', title: '核心原材料与算力底座', text: '待填写集中度与毛利带', conversion: '毛利 待填写' },
1401
+ { tag: '中游', title: '模组平台与系统集成', text: '待填写规模效应拐点', conversion: '毛利 待填写' },
1402
+ { tag: '下游', title: '垂直场景与品牌终端', text: '待填写渠道壁垒与复购', conversion: '毛利 待填写' },
1403
+ ],
1404
+ [
1405
+ { tag: 'Upstream', title: 'Core inputs & infrastructure', text: 'To fill: concentration', conversion: 'GM: To fill' },
1406
+ { tag: 'Midstream', title: 'Platform & integration', text: 'To fill: scale economics', conversion: 'GM: To fill' },
1407
+ { tag: 'Downstream', title: 'Vertical apps & distribution', text: 'To fill: customer lock-in', conversion: 'GM: To fill' },
1408
+ ],
1409
+ ],
1410
+ bullets: [
1411
+ ['**利润迁移方向**:待填写未来三年高毛利环节转移证据'],
1412
+ ['**Profit migration**: To fill: where margin expansion accrues next'],
1413
+ ],
1414
+ },
1415
+ {
1416
+ title: ['主要玩家战略定位与竞争格局四象限', 'Competitive positioning 2x2 matrix'],
1417
+ kicker: ['03 · 竞争格局', '03 · Landscape'],
1418
+ layout: 'matrix',
1419
+ variant: '2x2',
1420
+ bullets: [
1421
+ ['**全栈领军者(高壁垒·广覆盖)**:待填写代表企业与份额', '**垂直隐形冠军(高壁垒·深场景)**:待填写高利基玩家', '**规模挑战者(成本领先·标准化)**:待填写价格带玩家', '**长尾出清区(同质化·低毛利)**:待填写整合趋势'],
1422
+ ['**Full-stack leaders**: To fill: share & moat', '**Vertical specialists**: To fill: high-margin niche winners', '**Scale challengers**: To fill: cost-curve disruptors', '**Consolidation zone**: To fill: commoditized tail'],
1423
+ ],
1424
+ },
1425
+ {
1426
+ title: ['关键跟踪指标、情景假设与下行风险提示', 'Key signposts, scenarios and downside risks'],
1427
+ kicker: ['04 · 风险与跟踪', '04 · Signposts & Risks'],
1428
+ layout: 'comparison',
1429
+ variant: 'issue-action',
1430
+ bullets: [
1431
+ ['**待填写核心宏观/政策/技术证伪风险**:待填写高频先行观察指标与应对配置建议'],
1432
+ ['**To fill: primary thesis-falsifying risk**: To fill: leading indicator signpost and hedge'],
1433
+ ],
1434
+ },
1435
+ ],
1436
+ closing: {
1437
+ title: ['研究结论摘要与重点跟踪标的清单', 'Summary takeaways & coverage watchlist'],
1438
+ subtitle: ['待填写:研究团队、数据截止日期与免责声明', 'To fill: research team, data cutoff date and disclosures'],
1439
+ },
1440
+ },
1138
1441
  ])
1139
1442
 
1140
1443
  export function findScenarioTemplate(id) {
@@ -1240,9 +1543,20 @@ export function inferThemeFromContent(input = {}) {
1240
1543
  }
1241
1544
  if (persona === 'tech-pitch') {
1242
1545
  const keynoteLightHit = /苹果风|极简白|空间留白|消费电子|硬件生态|cupertino|spatial\s*keynote|keynote\s*light/i.test(corpus)
1546
+ const ventureDaylightHit = /创投简报|明亮路演|阅读版\s*BP|投资备忘录|日间路演|partner\s*memo|daylight\s*pitch|investor\s*memo/i.test(corpus)
1547
+ const stripeCraftHit = /PRD评审|需求评审|产品需求文档|开发者平台|产品迭代评审|SaaS\s*方案|product\s*review|\bprd\b|developer\s*platform|stripe\s*craft/i.test(corpus)
1548
+ const auroraStageHit = /极光发布|算力底座|芯片发布|大模型训练集群|AI基础设施发布|aurora\s*keynote|gpu\s*cluster|ai\s*infra\s*launch/i.test(corpus)
1243
1549
  const stageHit = /路演|融资|商业计划|种子轮|天使轮|[ABC]\s*轮|产品发布|新品发布|发布会|开发者大会|大模型|智能体|算力|keynote|pitch\s*deck|seed\s*round|series\s*[abc]|product\s*launch|developer/i.test(corpus)
1244
1550
  const b2bHit = /技术方案|架构设计|系统重构|工程效能|云原生|微服务|中台|数字化转型|安全合规|接口规范|运维|选型评审|故障复盘/i.test(corpus)
1245
- const theme = keynoteLightHit ? 'keynote-light' : (b2bHit && !stageHit ? 'cobalt-cream' : 'linear-dark')
1551
+ const theme = keynoteLightHit
1552
+ ? 'keynote-light'
1553
+ : ventureDaylightHit
1554
+ ? 'venture-daylight'
1555
+ : stripeCraftHit
1556
+ ? 'stripe-craft'
1557
+ : auroraStageHit
1558
+ ? 'aurora-stage'
1559
+ : (b2bHit && !stageHit ? 'cobalt-cream' : 'linear-dark')
1246
1560
  return {
1247
1561
  persona: 'tech-pitch',
1248
1562
  theme,
@@ -1250,6 +1564,18 @@ export function inferThemeFromContent(input = {}) {
1250
1564
  chartHighlight: 'last',
1251
1565
  }
1252
1566
  }
1567
+ const terminalAmberHit = /彭博终端|量化交易|安全态势|攻防演练|SRE作战室|高频风控|quant\s*trading|threat\s*intel|war\s*room|bloomberg/i.test(corpus)
1568
+ if (terminalAmberHit) {
1569
+ return { persona: 'consulting', theme: 'obsidian-amber', tableStyle: 'consulting', chartHighlight: 'max' }
1570
+ }
1571
+ const economistHit = /经济学人|行业研究|宏观洞察|地缘政治|通胀展望|智库报告|并购尽调|产业白皮书|产业链图谱|economist|macro\s*research|geopolitic|industry\s*research|think\s*tank|due\s*diligence/i.test(corpus)
1572
+ if (economistHit) {
1573
+ return { persona: 'consulting', theme: 'economist-brief', tableStyle: 'booktabs', chartHighlight: 'max' }
1574
+ }
1575
+ const bcgEmeraldHit = /\bBCG\b|波士顿咨询|OKR\s*复盘|绿色转型|双碳战略|低碳转型|翡翠战略|增长转型|green\s*transformation|okr\s*review|emerald\s*strategy|decarbonization/i.test(corpus)
1576
+ if (bcgEmeraldHit) {
1577
+ return { persona: 'consulting', theme: 'bcg-emerald', tableStyle: 'consulting', chartHighlight: 'max' }
1578
+ }
1253
1579
  const financialFtHit = /财报|业绩会|季报业绩|IPO|二级市场|投研|资产配置|宏观经济|金融时报|净值|估值模型|earnings|financial\s*report|investor\s*relations|ebitda|valuation|consensus/i.test(corpus)
1254
1580
  if (financialFtHit) {
1255
1581
  return { persona: 'consulting', theme: 'financial-ft', tableStyle: 'consulting', chartHighlight: 'max' }
@@ -1285,8 +1611,8 @@ export function inferThemeFromContent(input = {}) {
1285
1611
  addMatches('academic', /论文|答辩|综述|实验结果|消融实验|基线模型|定理|假设检验|显著性|参考文献|学位|导师|课题组|自然科学基金|临床|病例|诊疗|病理|患者|thesis|dissertation|ablation|methodology|empirical|et\s+al\.|arxiv|clinical|medical|diagnosis/gi, 3.2)
1286
1612
  addMatches('education', /课程|教学|培训|讲义|课堂|学习目标|知识点|课后练习|随堂|章节导读|实训|工坊|新员工|onboarding|workshop|syllabus|curriculum|lesson/gi, 3.0)
1287
1613
  addMatches('editorial', /品牌故事|人文|策展|可持续发展|碳中和|社会责任|非遗|文化洞察|建筑设计|工业设计|作品集|摄影集|奢侈品|高定|画册|黑金|ESG|sustainability|editorial|monograph|bauhaus|lookbook|luxury|atelier/gi, 2.9)
1288
- addMatches('tech-pitch', /路演|融资|商业计划|种子轮|天使轮|[ABC]\s*轮|产品发布|新品发布|发布会|开发者大会|大模型|智能体|算力|苹果风|消费电子|keynote|pitch\s*deck|product\s*launch/gi, 3.1)
1289
- addMatches('consulting', /战略|咨询|经营分析|商业复盘|周报|月报|季报|财报|业绩会|投研|预算|利润率|成本拆解|ROI|同比|环比|项目汇报|矩阵|漏斗|里程碑|earnings|ebitda/gi, 2.4)
1614
+ addMatches('tech-pitch', /路演|融资|商业计划|种子轮|天使轮|[ABC]\s*轮|产品发布|新品发布|发布会|开发者大会|大模型|智能体|算力|苹果风|消费电子|创投简报|PRD评审|需求评审|开发者平台|极光发布|keynote|pitch\s*deck|product\s*launch|partner\s*memo|\bprd\b|developer\s*platform/gi, 3.1)
1615
+ addMatches('consulting', /战略|咨询|\bBCG\b|波士顿咨询|双碳战略|绿色转型|低碳转型|经营分析|商业复盘|周报|月报|季报|财报|业绩会|投研|预算|利润率|成本拆解|ROI|同比|环比|项目汇报|矩阵|漏斗|里程碑|OKR\s*复盘|行业研究|宏观洞察|地缘政治|通胀展望|智库报告|并购尽调|量化交易|安全态势|earnings|ebitda|okr\s*review|industry\s*research|macro\s*research/gi, 2.6)
1290
1616
 
1291
1617
  let bestPersona = 'consulting'
1292
1618
  let bestScore = 0
@@ -1479,6 +1805,20 @@ export function promoteMarkdownSlides(slides, options = {}) {
1479
1805
  continue
1480
1806
  }
1481
1807
 
1808
+ if (n >= 3 && n <= 6 && /价值链|端到端|全链路|研产销|产业链|业务链路|value\s*chain|end-to-end/i.test(titleText) && maxLen <= 74) {
1809
+ slide.layout = 'process'
1810
+ slide.variant = 'chevron'
1811
+ consecutiveBullets = 0
1812
+ continue
1813
+ }
1814
+
1815
+ if (n >= 3 && n <= 6 && /转化漏斗|销售漏斗|获客漏斗|漏斗转化|conversion\s*funnel|sales\s*funnel/i.test(titleText) && maxLen <= 74) {
1816
+ slide.layout = 'process'
1817
+ slide.variant = 'funnel'
1818
+ consecutiveBullets = 0
1819
+ continue
1820
+ }
1821
+
1482
1822
  if (n >= 3 && n <= 6 && stepHits / n >= 0.66 && maxLen <= 68) {
1483
1823
  slide.layout = 'process'
1484
1824
  slide.variant = /Q[1-4]\b|20\d{2}|月|周|年|季度/.test(bullets.join(' ')) ? 'timeline' : 'steps'
@@ -50,6 +50,8 @@ export const LAYOUT_ALIASES = Object.freeze({
50
50
  layers: { layout: 'process', variant: 'layers' },
51
51
  funnel: { layout: 'process', variant: 'funnel' },
52
52
  flywheel: { layout: 'process', variant: 'flywheel' },
53
+ chevron: { layout: 'process', variant: 'chevron' },
54
+ 'value-chain': { layout: 'process', variant: 'chevron' },
53
55
  'issue-action': { layout: 'comparison', variant: 'issue-action' },
54
56
  'before-after': { layout: 'comparison', variant: 'before-after' },
55
57
  'matrix-2x2': { layout: 'matrix', variant: '2x2' },
@@ -3424,6 +3426,86 @@ export function renderCoreSlidePptx(slide, index, total, theme, langAttr, manife
3424
3426
  shapes.push(ooxmlShape(nextId(), 'Flywheel Arrow Right', { x: corners[1].x + cardW / 2 - 0.14, y: centerY - 0.22, w: 0.28, h: 0.44 }, { preset: 'downArrow', fill: tk.accentPrimary }))
3425
3427
  shapes.push(ooxmlShape(nextId(), 'Flywheel Arrow Bottom', { x: centerX - 0.26, y: corners[2].y + cardH / 2 - 0.14, w: 0.52, h: 0.28 }, { preset: 'leftArrow', fill: tk.accentPrimary }))
3426
3428
  shapes.push(ooxmlShape(nextId(), 'Flywheel Arrow Left', { x: corners[0].x + cardW / 2 - 0.14, y: centerY - 0.22, w: 0.28, h: 0.44 }, { preset: 'upArrow', fill: tk.accentPrimary }))
3429
+ } else if (variant === 'chevron') {
3430
+ // McKinsey / BCG Interlocking Value-Chain Chevrons + Supporting Detail Cards
3431
+ const overlap = n > 1 ? 0.08 : 0
3432
+ const chevW = (12.09 + (n - 1) * overlap) / n
3433
+ const chevY = bodyTopY + 0.08
3434
+ const chevH = 0.88
3435
+ const detailGap = 0.16
3436
+ const colW = (12.09 - detailGap * (n - 1)) / n
3437
+ const detailY = chevY + chevH + 0.20
3438
+ const detailH = Math.max(1.55, bodyBottomY - detailY - 0.06)
3439
+
3440
+ items.forEach((it, idx) => {
3441
+ const isFirst = idx === 0
3442
+ const isLast = idx === n - 1 && n >= 3
3443
+ const cx = 0.62 + idx * (chevW - overlap)
3444
+ const fillHex = isFirst ? tk.accentPrimary : isLast ? tk.accentSecondary : tk.surface2
3445
+ const inkHex = isFirst
3446
+ ? tk.inkOnAccent
3447
+ : isLast
3448
+ ? (relativeLuminance(tk.accentSecondary) > 0.36 ? '#0F172A' : '#FFFFFF')
3449
+ : tk.inkPrimary
3450
+ const stageTag = it.tag || String(idx + 1).padStart(2, '0')
3451
+ const chevLabel = (stageTag ? stageTag + ' · ' : '') + (it.title || '')
3452
+
3453
+ shapes.push(ooxmlShape(nextId(), 'Chevron Stage ' + (idx + 1), { x: cx, y: chevY, w: chevW, h: chevH }, {
3454
+ preset: isFirst ? 'homePlate' : 'chevron',
3455
+ adjs: { adj: 20000 },
3456
+ fill: fillHex,
3457
+ stroke: tk.canvas,
3458
+ strokePt: 2.0,
3459
+ anchor: 'ctr',
3460
+ marginsIn: { l: isFirst ? 0.14 : 0.28, r: 0.24, t: 0.06, b: 0.06 },
3461
+ paragraphs: [
3462
+ ooxmlRichParagraph(chevLabel, {
3463
+ sizePt: n >= 5 ? 13 : 14.5,
3464
+ color: inkHex,
3465
+ bold: true,
3466
+ lang: langAttr,
3467
+ align: 'ctr',
3468
+ font: theme.fonts.heading,
3469
+ lineHeight: 1.18,
3470
+ }),
3471
+ ],
3472
+ }))
3473
+
3474
+ const dx = 0.62 + idx * (colW + detailGap)
3475
+ const cardBox = { x: dx, y: detailY, w: colW, h: detailH }
3476
+ shapes.push(renderSurfaceCardPptx('Chevron Detail Surface ' + (idx + 1), cardBox, {
3477
+ fill: isFirst ? tk.accentSoft : tk.surface1,
3478
+ focal: isFirst,
3479
+ }, nextId, chromeCfg, theme))
3480
+
3481
+ const convNote = it.conversion || it.delta || (it.value ? it.value + (it.unit ? ' ' + it.unit : '') : '')
3482
+ const detailLines = [
3483
+ ...(convNote ? ['**' + convNote + '**'] : []),
3484
+ ...(it.text ? [it.text] : []),
3485
+ ...(Array.isArray(it.bullets) ? it.bullets : []),
3486
+ ]
3487
+ const innerBox = { x: cardBox.x + 0.16, y: cardBox.y + 0.16, w: cardBox.w - 0.32, h: cardBox.h - 0.30 }
3488
+ const fit = computeTextFit(detailLines, innerBox, 'cardBody', { maxPt: 14, minPt: 12.5 })
3489
+ if (detailLines.length > 0) {
3490
+ shapes.push(ooxmlShape(nextId(), 'Chevron Detail ' + (idx + 1), innerBox, {
3491
+ txBox: true,
3492
+ anchor: 't',
3493
+ marginsIn: { l: 0, r: 0, t: 0, b: 0 },
3494
+ fontScale: fit.fontScale,
3495
+ paragraphs: detailLines.map((line, lIdx) =>
3496
+ ooxmlRichParagraph(line, {
3497
+ sizePt: fit.fontPt,
3498
+ color: lIdx === 0 && convNote ? tk.accentText : tk.inkSecondary,
3499
+ accentColor: tk.accentText,
3500
+ lang: langAttr,
3501
+ font: theme.fonts.body,
3502
+ lineHeight: 1.36,
3503
+ spaceAfterPt: 4,
3504
+ }),
3505
+ ),
3506
+ }))
3507
+ }
3508
+ })
3427
3509
  } else if (variant === 'layers' || variant === 'funnel') {
3428
3510
  const gapY = 0.14
3429
3511
  const rowH = Math.min(0.92, (bodyH - gapY * (n - 1)) / n)
@@ -4256,6 +4338,32 @@ export function renderCoreSlideHtml(slide, index, total, ui, langId, manifest =
4256
4338
  )
4257
4339
  }).join('') +
4258
4340
  '</div>'
4341
+ } else if (variant === 'chevron') {
4342
+ inner =
4343
+ renderHeader() +
4344
+ '<ol class="layout-grid chevron-board cols-' + Math.max(1, items.length) + '">' +
4345
+ items.map((it, idx) => {
4346
+ const isFirst = idx === 0
4347
+ const isLast = idx === items.length - 1 && items.length >= 3
4348
+ const conv = it.conversion || it.delta || (it.value ? it.value + (it.unit ? ' ' + it.unit : '') : '')
4349
+ const bodyLines = [
4350
+ ...(it.text ? [it.text] : []),
4351
+ ...(Array.isArray(it.bullets) ? it.bullets : []),
4352
+ ]
4353
+ return (
4354
+ '<li class="chevron-col" data-item-index="' + idx + '">' +
4355
+ '<div class="chevron-arrow' + (isFirst ? ' is-first' : isLast ? ' is-last' : '') + '">' +
4356
+ '<span class="chevron-tag">' + escapeHtml(it.tag || String(idx + 1).padStart(2, '0')) + '</span>' +
4357
+ (it.title ? '<span class="chevron-title" data-item-field="title">' + renderInlineHtml(it.title) + '</span>' : '') +
4358
+ '</div>' +
4359
+ '<div class="surface-card chevron-detail' + (isFirst ? ' is-focal' : '') + '">' +
4360
+ (conv ? '<span class="funnel-conversion-badge chevron-metric">' + escapeHtml(conv) + '</span>' : '') +
4361
+ (bodyLines.length ? '<div class="card-body" data-item-field="text">' + bodyLines.map((ln) => renderInlineHtml(ln)).join('<br>') + '</div>' : '') +
4362
+ '</div>' +
4363
+ '</li>'
4364
+ )
4365
+ }).join('') +
4366
+ '</ol>'
4259
4367
  } else {
4260
4368
  const modeClass = variant === 'timeline' ? 'is-timeline' : variant === 'layers' ? 'is-layers' : variant === 'funnel' ? 'is-funnel' : 'is-steps'
4261
4369
  inner =
@@ -4445,6 +4553,14 @@ export const LAYOUT_CSS = `
4445
4553
  .flywheel-stage{position:relative;display:grid;grid-template-columns:1fr 1fr;gap:clamp(22px,3vw,42px) clamp(120px,14vw,220px);align-items:center;padding:8px 0}
4446
4554
  .flywheel-hub{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:clamp(130px,13vw,190px);height:clamp(130px,13vw,190px);border-radius:50%;background:var(--accent);color:var(--ink-on-accent);border:4px solid var(--bg);display:flex;align-items:center;justify-content:center;text-align:center;padding:14px;font-family:var(--font-heading);font-weight:800;font-size:clamp(14px,1.4vw,20px);z-index:2;box-shadow:0 12px 32px rgba(0,0,0,.14)}
4447
4555
  .flywheel-node-top{display:flex;align-items:center;justify-content:space-between;gap:8px}
4556
+ .chevron-board{gap:12px;align-items:stretch}
4557
+ .chevron-col{display:flex;flex-direction:column;gap:12px;min-width:0;list-style:none}
4558
+ .chevron-arrow{min-height:68px;padding:12px 24px 12px 28px;background:var(--surface2);color:var(--fg);font-family:var(--font-heading);font-weight:700;font-size:clamp(13px,1.2vw,16px);display:flex;flex-direction:column;justify-content:center;align-items:center;text-align:center;gap:3px;clip-path:polygon(0 0,calc(100% - 16px) 0,100% 50%,calc(100% - 16px) 100%,0 100%,16px 50%)}
4559
+ .chevron-arrow.is-first{padding-left:16px;background:var(--accent);color:var(--ink-on-accent);clip-path:polygon(0 0,calc(100% - 16px) 0,100% 50%,calc(100% - 16px) 100%,0 100%)}
4560
+ .chevron-arrow.is-last{background:var(--accent2);color:#FFF}
4561
+ .chevron-tag{font-size:11px;opacity:.86;letter-spacing:.06em}
4562
+ .chevron-detail{flex:1;padding:14px 16px;gap:8px}
4563
+ .chevron-metric{margin-left:0;align-self:flex-start}
4448
4564
  .callout-hero{background:var(--surface2);border:1px solid var(--accent);border-left:5px solid var(--accent);border-radius:var(--radius);padding:20px 26px;font-size:clamp(17px,1.8vw,26px);font-weight:700;line-height:1.4}
4449
4565
  .callout-hero.is-formula{font-family:Georgia,"Times New Roman",serif;text-align:center}
4450
4566
  .callout-row{flex-direction:row;align-items:center;padding:12px 18px}