byteplan-cli 1.0.2 → 1.2.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 (65) hide show
  1. package/package.json +7 -3
  2. package/skills/byteplan-analysis/SKILL.md +1078 -0
  3. package/skills/byteplan-api/API_REFERENCE.md +249 -0
  4. package/skills/byteplan-api/SKILL.md +96 -0
  5. package/skills/byteplan-api/package.json +16 -0
  6. package/skills/byteplan-api/scripts/api.js +973 -0
  7. package/skills/byteplan-excel/SKILL.md +212 -0
  8. package/skills/byteplan-excel/examples/margin-analysis.json +40 -0
  9. package/skills/byteplan-excel/package.json +12 -0
  10. package/skills/byteplan-excel/pnpm-lock.yaml +68 -0
  11. package/skills/byteplan-excel/scripts/generate_excel.js +156 -0
  12. package/skills/byteplan-html/SKILL.md +490 -0
  13. package/skills/byteplan-html/examples/example-output.html +184 -0
  14. package/skills/byteplan-html/examples/generate-ppt-style-html.js +611 -0
  15. package/skills/byteplan-html/examples/margin-contribution-analysis.json +152 -0
  16. package/skills/byteplan-html/package.json +18 -0
  17. package/skills/byteplan-html/scripts/generate_html.js +517 -0
  18. package/skills/byteplan-ppt/SKILL.md +394 -0
  19. package/skills/byteplan-ppt/examples/margin-contribution-analysis.json +152 -0
  20. package/skills/byteplan-ppt/package.json +16 -0
  21. package/skills/byteplan-ppt/pnpm-lock.yaml +138 -0
  22. package/skills/byteplan-ppt/scripts/check_ppt_overlap.js +318 -0
  23. package/skills/byteplan-ppt/scripts/generate_ppt.js +680 -0
  24. package/skills/byteplan-video/SKILL.md +606 -0
  25. package/skills/byteplan-video/examples/sample-video-data.json +82 -0
  26. package/skills/byteplan-video/remotion-project/package.json +22 -0
  27. package/skills/byteplan-video/remotion-project/pnpm-lock.yaml +1646 -0
  28. package/skills/byteplan-video/remotion-project/remotion.config.ts +6 -0
  29. package/skills/byteplan-video/remotion-project/scene_durations.json +32 -0
  30. package/skills/byteplan-video/remotion-project/scripts/generate_audio.js +279 -0
  31. package/skills/byteplan-video/remotion-project/src/DynamicReport.tsx +172 -0
  32. package/skills/byteplan-video/remotion-project/src/Root.tsx +51 -0
  33. package/skills/byteplan-video/remotion-project/src/SalesReport.tsx +107 -0
  34. package/skills/byteplan-video/remotion-project/src/index.tsx +4 -0
  35. package/skills/byteplan-video/remotion-project/src/scenes/ChartSlide.tsx +201 -0
  36. package/skills/byteplan-video/remotion-project/src/scenes/CoverSlide.tsx +61 -0
  37. package/skills/byteplan-video/remotion-project/src/scenes/EndSlide.tsx +60 -0
  38. package/skills/byteplan-video/remotion-project/src/scenes/InsightSlide.tsx +101 -0
  39. package/skills/byteplan-video/remotion-project/src/scenes/KpiSlide.tsx +84 -0
  40. package/skills/byteplan-video/remotion-project/src/scenes/RecommendationSlide.tsx +100 -0
  41. package/skills/byteplan-video/remotion-project/tsconfig.json +13 -0
  42. package/skills/byteplan-video/remotion-project/video_data.json +76 -0
  43. package/skills/byteplan-video/scripts/generate_video.js +270 -0
  44. package/skills/byteplan-video/templates/package.json +31 -0
  45. package/skills/byteplan-video/templates/pnpm-lock.yaml +2200 -0
  46. package/skills/byteplan-video/templates/remotion.config.ts +9 -0
  47. package/skills/byteplan-video/templates/scripts/generate-audio.ts +55 -0
  48. package/skills/byteplan-video/templates/src/components/BarChartScene.tsx +153 -0
  49. package/skills/byteplan-video/templates/src/components/InsightScene.tsx +135 -0
  50. package/skills/byteplan-video/templates/src/components/LineChartScene.tsx +214 -0
  51. package/skills/byteplan-video/templates/src/components/SceneFactory.tsx +34 -0
  52. package/skills/byteplan-video/templates/src/components/SummaryScene.tsx +155 -0
  53. package/skills/byteplan-video/templates/src/components/TitleScene.tsx +130 -0
  54. package/skills/byteplan-video/templates/src/compositions/AnalysisVideo.tsx +39 -0
  55. package/skills/byteplan-video/templates/src/index.tsx +28 -0
  56. package/skills/byteplan-video/templates/src/register-root.tsx +4 -0
  57. package/skills/byteplan-video/templates/src/storyboard/types.ts +46 -0
  58. package/skills/byteplan-video/templates/tsconfig.json +17 -0
  59. package/skills/byteplan-video/templates/tsconfig.scripts.json +13 -0
  60. package/skills/byteplan-word/SKILL.md +233 -0
  61. package/skills/byteplan-word/package.json +12 -0
  62. package/skills/byteplan-word/pnpm-lock.yaml +120 -0
  63. package/skills/byteplan-word/scripts/generate_word.js +548 -0
  64. package/src/cli.js +4 -0
  65. package/src/commands/skills.js +279 -0
@@ -0,0 +1,490 @@
1
+ ---
2
+ name: byteplan-html
3
+ description: 根据已有的分析数据生成网页报告。支持两种模式:1) 传统网页报告(滚动式);2) PPT风格演示报告(幻灯片切换)。支持交互式图表、响应式布局、键盘导航。需要先使用 byteplan-analysis skill 完成数据分析。
4
+ ---
5
+
6
+ # BytePlan 网页报告 Skill
7
+
8
+ ## 概述
9
+
10
+ 此 Skill 根据已有的分析数据生成网页报告,支持两种风格:
11
+
12
+ | 风格 | 说明 | 适用场景 |
13
+ |------|------|----------|
14
+ | **传统网页** | 滚动式布局,所有内容一页展示 | 详细数据分析报告 |
15
+ | **PPT风格** | 幻灯片切换,键盘/触摸导航 | 演示汇报、会议展示 |
16
+
17
+ **前置条件**:必须先使用 [byteplan-analysis](../byteplan-analysis/SKILL.md) skill 完成数据分析。
18
+
19
+ ---
20
+
21
+ ## PPT风格设计规范
22
+
23
+ ### 1. 页面结构(11页标准模板)
24
+
25
+ ```
26
+ 第1页 : 封面(紫色渐变背景)
27
+ 第2页 : 目录(深色背景 + 双列卡片)
28
+ 第3页 : 核心发现摘要(三卡片布局)
29
+ 第4页 : 关键指标概览(四卡片KPI)
30
+ 第5页 : 数据图表1(柱状图)
31
+ 第6页 : 数据图表2(横向条形图/贡献率)
32
+ 第7页 : 排行榜(TOP8横向条形图)
33
+ 第8页 : 数据明细表
34
+ 第9页 : 关键洞察(四卡片)
35
+ 第10页 : 行动建议(四卡片)
36
+ 第11页 : 结尾页(紫色渐变背景)
37
+ ```
38
+
39
+ ### 2. 颜色规范
40
+
41
+ ```css
42
+ /* 主题色 */
43
+ --purple: #667eea; /* 主强调色 */
44
+ --dark-purple: #764ba2; /* 渐变终点色 */
45
+
46
+ /* 背景色 */
47
+ --dark-bg: #1a1a2e; /* 主背景 */
48
+ --dark-bg-2: #16213e; /* 次背景 */
49
+ --dark-bg-3: #0f3460; /* 强调背景 */
50
+ --card-bg: rgba(255,255,255,0.1); /* 卡片背景 */
51
+
52
+ /* 文字色 */
53
+ --text-white: #FFFFFF; /* 标题文字 */
54
+ --text-gray: #CBD5E1; /* 正文文字 */
55
+ --text-muted: #94A3B8; /* 辅助文字 */
56
+
57
+ /* 数据色 */
58
+ --green: #4ade80; /* 正向数据/数值 */
59
+ --blue: #60a5fa; /* 链接/贡献率 */
60
+ --pink: #f472b6; /* 图表色 */
61
+ --orange: #fbbf24; /* 警告/排名 */
62
+ --red: #f87171; /* 负向数据 */
63
+ --cyan: #06B6D4; /* 图表色 */
64
+ ```
65
+
66
+ ### 3. 字体规范
67
+
68
+ ```css
69
+ /* 主字体:微软雅黑 */
70
+ font-family: 'Microsoft YaHei', '微软雅黑', Arial, sans-serif;
71
+
72
+ /* 封面标题 */
73
+ font-size: 44px; font-weight: bold;
74
+
75
+ /* 页面标题 */
76
+ font-size: 28px; font-weight: bold;
77
+
78
+ /* 卡片标题 */
79
+ font-size: 16-26px; font-weight: bold;
80
+
81
+ /* 正文内容 */
82
+ font-size: 12-14px;
83
+
84
+ /* 数据数值 */
85
+ font-size: 22-24px; font-weight: bold; color: var(--green);
86
+ ```
87
+
88
+ ### 4. 布局规范
89
+
90
+ #### 幻灯片容器
91
+ ```css
92
+ .slide {
93
+ width: 100vw;
94
+ height: 100vh;
95
+ position: absolute;
96
+ display: flex;
97
+ justify-content: center;
98
+ align-items: center;
99
+ padding: 30px 50px;
100
+ opacity: 0;
101
+ visibility: hidden;
102
+ transition: opacity 0.5s ease;
103
+ }
104
+ .slide.active {
105
+ opacity: 1;
106
+ visibility: visible;
107
+ }
108
+ ```
109
+
110
+ #### 卡片设计
111
+ ```css
112
+ /* 基础卡片 */
113
+ .card {
114
+ background: rgba(255,255,255,0.1);
115
+ border-radius: 18px;
116
+ padding: 25px;
117
+ border: 2px solid rgba(255,255,255,0.2);
118
+ }
119
+
120
+ /* 带边框强调的卡片 */
121
+ .card-accent {
122
+ border-left: 5px solid var(--purple);
123
+ /* 或警告色 */
124
+ border-left: 5px solid var(--orange);
125
+ }
126
+
127
+ /* 成功建议卡片 */
128
+ .card-success {
129
+ background: rgba(74,222,128,0.2);
130
+ border-left: 5px solid var(--green);
131
+ }
132
+ ```
133
+
134
+ ### 5. 导航规范
135
+
136
+ ```javascript
137
+ // 键盘导航
138
+ document.addEventListener('keydown', e => {
139
+ if (e.key === 'ArrowDown' || e.key === 'ArrowRight' || e.key === ' ') {
140
+ nextSlide();
141
+ }
142
+ if (e.key === 'ArrowUp' || e.key === 'ArrowLeft') {
143
+ prevSlide();
144
+ }
145
+ });
146
+
147
+ // 触摸导航
148
+ let touchX = 0;
149
+ document.addEventListener('touchstart', e => touchX = e.touches[0].clientX);
150
+ document.addEventListener('touchend', e => {
151
+ const diff = e.changedTouches[0].clientX - touchX;
152
+ if (diff > 50) prevSlide();
153
+ if (diff < -50) nextSlide();
154
+ });
155
+ ```
156
+
157
+ ### 6. 图表规范与智能选择
158
+
159
+ 支持四种图表类型,可根据分析目标自动选择最合适的类型:
160
+
161
+ | 图表类型 | 适用场景 | 触发关键词 |
162
+ |----------|----------|------------|
163
+ | **柱状图** | 类别对比、数值排名 | 对比、分析(默认) |
164
+ | **折线图** | 趋势变化、时间序列 | 趋势、增长、变化、季度、月度、年度 |
165
+ | **饼图** | 占比构成、市场份额 | 占比、构成、比例、份额、分布 |
166
+ | **横向条形图** | 排行榜、百分比展示 | 排行、排名、贡献率、比率 |
167
+
168
+ 使用 Chart.js,配置如下:
169
+
170
+ ```javascript
171
+ // 柱状图配置
172
+ {
173
+ type: 'bar',
174
+ data: { /* ... */ },
175
+ options: {
176
+ responsive: true,
177
+ maintainAspectRatio: true,
178
+ plugins: {
179
+ legend: { labels: { color: '#fff', font: { size: 14 } } }
180
+ },
181
+ scales: {
182
+ y: {
183
+ ticks: { color: '#CBD5E1', font: { size: 12 } },
184
+ grid: { color: 'rgba(255,255,255,0.1)' }
185
+ },
186
+ x: {
187
+ ticks: { color: '#fff', font: { size: 13 } },
188
+ grid: { display: false }
189
+ }
190
+ }
191
+ }
192
+ }
193
+
194
+ // 横向条形图配置
195
+ {
196
+ type: 'bar',
197
+ options: {
198
+ indexAxis: 'y',
199
+ // ...其他配置
200
+ }
201
+ }
202
+ ```
203
+
204
+ ### 7. 渐变背景
205
+
206
+ ```css
207
+ /* 封面/结尾页 - 紫色渐变 */
208
+ background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
209
+
210
+ /* 内容页 - 深色渐变 */
211
+ background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
212
+ background: linear-gradient(135deg, #0f3460 0%, #16213e 100%);
213
+ background: linear-gradient(135deg, #16213e 0%, #1a1a2e 100%);
214
+ ```
215
+
216
+ ### 8. 动画效果
217
+
218
+ ```css
219
+ /* 幻灯片切换 */
220
+ transition: opacity 0.5s ease, visibility 0.5s ease;
221
+
222
+ /* 进度条 */
223
+ transition: width 0.5s ease;
224
+
225
+ /* 卡片悬停 */
226
+ transition: transform 0.3s;
227
+ transform: scale(1.03); /* hover时 */
228
+ ```
229
+
230
+ ---
231
+
232
+ ## 使用方法
233
+
234
+ ### 方式一:命令行生成
235
+
236
+ ```bash
237
+ # 传统网页风格
238
+ node scripts/generate_html.js -o report.html
239
+
240
+ # PPT风格
241
+ node scripts/generate_html.js -o report_ppt.html --style ppt
242
+ ```
243
+
244
+ ### 方式二:Node.js 调用
245
+
246
+ ```javascript
247
+ const { generateHTMLReport, generatePPTStyleHTML } = require('./scripts/generate_html.js');
248
+
249
+ // 传统风格
250
+ generateHTMLReport('report.html', 'analysis_results.json');
251
+
252
+ // PPT风格
253
+ generatePPTStyleHTML('report_ppt.html', 'analysis_results.json');
254
+ ```
255
+
256
+ ### 方式三:直接生成并打开
257
+
258
+ ```bash
259
+ node scripts/generate_html.js -o report.html && open report.html
260
+ ```
261
+
262
+ ---
263
+
264
+ ## 数据格式
265
+
266
+ ### 新格式(推荐):使用 charts 数组
267
+
268
+ ```json
269
+ {
270
+ "title": "报告标题",
271
+ "subtitle": "副标题",
272
+ "period": "2026年3月",
273
+ "analysisGoal": "营收趋势分析",
274
+ "sections": ["章节1", "章节2"],
275
+ "summary": [
276
+ { "rank": "🥇 第一名", "name": "项目A", "type": "类型", "value": "¥1,000,000", "rate": "68%" }
277
+ ],
278
+ "kpis": [
279
+ { "icon": "💰", "label": "指标名称", "value": "1,000", "unit": "单位" }
280
+ ],
281
+ "charts": [
282
+ {
283
+ "title": "营收趋势",
284
+ "type": "line",
285
+ "data": [
286
+ { "name": "Q1", "value": 100 },
287
+ { "name": "Q2", "value": 150 },
288
+ { "name": "Q3", "value": 200 },
289
+ { "name": "Q4", "value": 180 }
290
+ ]
291
+ },
292
+ {
293
+ "title": "市场份额分布",
294
+ "type": "pie",
295
+ "data": [
296
+ { "name": "天猫", "value": 68 },
297
+ { "name": "京东", "value": 20 },
298
+ { "name": "其他", "value": 12 }
299
+ ]
300
+ },
301
+ {
302
+ "title": "渠道贡献对比",
303
+ "data": [
304
+ { "name": "天猫", "value": 16273934 },
305
+ { "name": "Amazon", "value": 2785991 }
306
+ ]
307
+ }
308
+ ],
309
+ "tableData": {
310
+ "title": "明细表",
311
+ "columns": ["列1", "列2"],
312
+ "rows": [["值1", "值2"]]
313
+ },
314
+ "insights": [
315
+ { "title": "洞察标题", "content": "洞察内容", "warning": false }
316
+ ],
317
+ "recommendations": [
318
+ { "title": "建议标题", "content": "建议内容" }
319
+ ],
320
+ "source": "BytePlan 数据平台"
321
+ }
322
+ ```
323
+
324
+ ### 图表类型说明
325
+
326
+ | type 值 | 图表类型 | 自动选择条件 |
327
+ |---------|----------|--------------|
328
+ | `"line"` | 折线图 | 标题含"趋势/增长/变化",或数据有时间标签(Q1/Q2/月度/年度) |
329
+ | `"pie"` | 饼图 | 标题含"占比/构成/比例/份额",且数据项 ≤ 8 |
330
+ | `"horizontalBar"` | 横向条形图 | 标题含"排行/排名/贡献率" |
331
+ | `"bar"` | 柱状图 | 默认类型 |
332
+ | 不指定 | 自动选择 | 根据 `analysisGoal` 和图表标题智能判断 |
333
+
334
+ ### 旧格式兼容
335
+
336
+ ```json
337
+ {
338
+ "title": "报告标题",
339
+ "subtitle": "副标题",
340
+ "period": "2026年3月",
341
+ "sections": ["章节1", "章节2"],
342
+ "summary": [
343
+ { "rank": "🥇 第一名", "name": "项目A", "type": "类型", "value": "¥1,000,000", "rate": "68%" }
344
+ ],
345
+ "kpis": [
346
+ { "icon": "💰", "label": "指标名称", "value": "1,000", "unit": "单位" }
347
+ ],
348
+ "barChart": {
349
+ "title": "图表标题",
350
+ "data": [{ "name": "类别A", "value": 100 }]
351
+ },
352
+ "rankingData": {
353
+ "title": "排行榜标题",
354
+ "data": [{ "name": "项目A", "value": 100 }]
355
+ },
356
+ "tableData": {
357
+ "title": "明细表",
358
+ "columns": ["列1", "列2"],
359
+ "rows": [["值1", "值2"]]
360
+ },
361
+ "insights": [
362
+ { "title": "洞察标题", "content": "洞察内容", "warning": false }
363
+ ],
364
+ "recommendations": [
365
+ { "title": "建议标题", "content": "建议内容" }
366
+ ],
367
+ "source": "BytePlan 数据平台"
368
+ }
369
+ ```
370
+
371
+ ---
372
+
373
+ ## 技术特性
374
+
375
+ - **Chart.js**: 交互式图表,支持悬停提示
376
+ - **响应式布局**: 自适应不同屏幕尺寸
377
+ - **键盘导航**: ↑↓ ←→ 空格键切换幻灯片
378
+ - **触摸导航**: 左右滑动切换
379
+ - **深色主题**: 专业数据分析风格
380
+ - **渐变配色**: 现代化视觉设计
381
+ - **单文件输出**: 无需服务器,直接浏览器打开
382
+
383
+ ---
384
+
385
+ ---
386
+
387
+ ## 完整示例
388
+
389
+ ### 示例:跨境电商边际贡献分析
390
+
391
+ 本案例展示如何使用 BytePlan 平台数据生成完整的网页报告。
392
+
393
+ #### 1. 准备数据文件
394
+
395
+ 参考示例数据文件:`examples/margin-contribution-analysis.json`
396
+
397
+ ```bash
398
+ # 复制示例数据
399
+ cp examples/margin-contribution-analysis.json ppt_data.json
400
+ ```
401
+
402
+ #### 2. 生成网页报告(PPT风格)
403
+
404
+ ```bash
405
+ cd skills/byteplan-html
406
+ node scripts/generate_html.js -o 边际贡献分析报告.html --style ppt
407
+ ```
408
+
409
+ #### 3. 打开查看
410
+
411
+ ```bash
412
+ open 边际贡献分析报告.html
413
+ ```
414
+
415
+ #### 4. 预期输出
416
+
417
+ 生成的网页报告包含以下功能:
418
+
419
+ **幻灯片导航**:
420
+ - 使用 `↑` `↓` 或 `←` `→` 键切换幻灯片
421
+ - 支持触摸滑动切换(移动端)
422
+ - 右下角显示页码,顶部显示进度条
423
+
424
+ **页面结构**(11页):
425
+
426
+ | 页码 | 内容 | 交互特性 |
427
+ |------|------|----------|
428
+ | 1 | 封面 | 紫色渐变背景 |
429
+ | 2 | 目录 | 卡片悬停缩放效果 |
430
+ | 3 | 核心发现摘要 | 三卡片展示 |
431
+ | 4 | 关键指标概览 | 四卡片KPI |
432
+ | 5 | 渠道边际贡献对比 | Chart.js 交互式柱状图 |
433
+ | 6 | 渠道贡献率对比 | Chart.js 交互式条形图 |
434
+ | 7 | TOP8排行榜 | Chart.js 交互式排行榜 |
435
+ | 8 | 数据明细表 | 表格,负值红色显示 |
436
+ | 9 | 关键洞察 | 四卡片,风险提示橙色边框 |
437
+ | 10 | 行动建议 | 四卡片,绿色边框 |
438
+ | 11 | 结尾页 | 紫色渐变背景 |
439
+
440
+ #### 5. 示例数据结构
441
+
442
+ ```json
443
+ {
444
+ "title": "跨境电商边际贡献分析报告",
445
+ "subtitle": "找出贡献最大的要素",
446
+ "period": "2026年3月31日",
447
+ "sections": ["核心发现摘要", "关键指标概览", ...],
448
+ "summary": [
449
+ { "rank": "🥇 第一名", "name": "天猫", "type": "渠道", "value": "¥16,273,934", "rate": "贡献率 68%" }
450
+ ],
451
+ "kpis": [
452
+ { "icon": "💰", "label": "最大边际贡献", "value": "16,273,934", "unit": "元(天猫)" }
453
+ ],
454
+ "barChart": {
455
+ "title": "渠道边际贡献对比",
456
+ "data": [{ "name": "天猫", "value": 16273934 }]
457
+ },
458
+ "ratioData": {
459
+ "title": "渠道边际贡献率对比",
460
+ "data": [{ "name": "天猫", "value": 68 }]
461
+ },
462
+ "rankingData": {
463
+ "title": "边际贡献 TOP8 排行榜",
464
+ "data": [{ "name": "天猫 (渠道)", "value": 16273934 }]
465
+ },
466
+ "tableData": {
467
+ "title": "边际贡献明细表",
468
+ "columns": ["要素名称", "类型", "收入(元)", "边际贡献(元)", "贡献率"],
469
+ "rows": [["天猫", "渠道", "17,742,456", "16,273,934", "68%"]]
470
+ },
471
+ "insights": [
472
+ { "title": "天猫渠道表现卓越", "content": "以68%贡献率成为最大贡献来源。", "warning": false },
473
+ { "title": "⚠️ 存在亏损产品", "content": "CD130P-B和CD140P边际贡献为负。", "warning": true }
474
+ ],
475
+ "recommendations": [
476
+ { "title": "加大天猫渠道投入", "content": "增加营销预算和运营资源。" }
477
+ ],
478
+ "source": "BytePlan 数据平台 · 跨境电商租户"
479
+ }
480
+ ```
481
+
482
+ ---
483
+
484
+ ## 注意事项
485
+
486
+ - **前置条件**:必须先完成数据分析
487
+ - **数据文件**:确保 `analysisPlan.json` 存在
488
+ - **浏览器兼容**:支持现代浏览器(Chrome、Firefox、Safari、Edge)
489
+ - **离线使用**:Chart.js 通过 CDN 加载,首次需要联网
490
+ - **字体**:推荐使用微软雅黑,确保中英文显示效果
@@ -0,0 +1,184 @@
1
+ <!DOCTYPE html>
2
+ <html lang="zh-CN">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>跨境电商边际贡献分析报告</title>
7
+ <script src="https://cdn.staticfile.org/Chart.js/4.4.1/chart.umd.min.js"></script>
8
+ <style>
9
+ * { margin: 0; padding: 0; box-sizing: border-box; }
10
+ body { font-family: 'Microsoft YaHei', Arial, sans-serif; background: #1a1a2e; color: #fff; overflow: hidden; }
11
+ .slides-container { width: 100vw; height: 100vh; position: relative; }
12
+ .slide { width: 100%; height: 100%; position: absolute; top: 0; left: 0; opacity: 0; visibility: hidden; transition: opacity 0.5s ease, visibility 0.5s ease; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 30px 50px; overflow: hidden; }
13
+ .slide.active { opacity: 1; visibility: visible; }
14
+ .bg-purple { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
15
+ .bg-dark { background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%); }
16
+ .bg-dark-alt { background: linear-gradient(135deg, #0f3460 0%, #16213e 100%); }
17
+ .bg-dark-reverse { background: linear-gradient(135deg, #16213e 0%, #1a1a2e 100%); }
18
+ .cover-content { text-align: center; max-width: 90%; }
19
+ .cover-content h1 { font-size: 3.5rem; font-weight: 700; margin-bottom: 20px; letter-spacing: 3px; }
20
+ .cover-content .subtitle { font-size: 1.5rem; opacity: 0.9; margin-bottom: 25px; }
21
+ .cover-content .meta { font-size: 1.1rem; opacity: 0.7; }
22
+ .cover-content .tenant { margin-top: 40px; padding: 15px 35px; background: rgba(255,255,255,0.15); border-radius: 10px; font-size: 1.2rem; }
23
+ .toc-content { width: 90%; max-width: 800px; }
24
+ .toc-content h2 { font-size: 2.5rem; margin-bottom: 35px; text-align: center; }
25
+ .toc-list { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
26
+ .toc-item { display: flex; align-items: center; padding: 18px 20px; background: rgba(255,255,255,0.1); border-radius: 12px; }
27
+ .toc-item .num { font-size: 1.8rem; font-weight: bold; color: #667eea; margin-right: 15px; }
28
+ .toc-item .text { font-size: 1.2rem; }
29
+ .summary-content { width: 90%; max-width: 900px; }
30
+ .summary-content h2 { font-size: 2.5rem; margin-bottom: 30px; text-align: center; }
31
+ .summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 25px; }
32
+ .summary-card { background: rgba(255,255,255,0.1); border-radius: 18px; padding: 25px; text-align: center; border: 2px solid rgba(255,255,255,0.2); }
33
+ .summary-card .rank { font-size: 1.5rem; color: #fbbf24; margin-bottom: 12px; }
34
+ .summary-card .name { font-size: 1.8rem; font-weight: bold; margin-bottom: 10px; }
35
+ .summary-card .type { font-size: 1rem; opacity: 0.7; margin-bottom: 15px; }
36
+ .summary-card .value { font-size: 2rem; color: #4ade80; font-weight: bold; }
37
+ .summary-card .rate { font-size: 1.2rem; color: #60a5fa; margin-top: 10px; }
38
+ .kpi-content { width: 90%; max-width: 900px; }
39
+ .kpi-content h2 { font-size: 2.5rem; margin-bottom: 30px; text-align: center; }
40
+ .kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
41
+ .kpi-card { background: rgba(255,255,255,0.1); border-radius: 15px; padding: 22px; text-align: center; }
42
+ .kpi-card .icon { font-size: 2.2rem; margin-bottom: 12px; }
43
+ .kpi-card .label { font-size: 0.95rem; opacity: 0.7; margin-bottom: 8px; }
44
+ .kpi-card .value { font-size: 1.8rem; font-weight: bold; color: #4ade80; }
45
+ .kpi-card .unit { font-size: 0.85rem; opacity: 0.6; }
46
+ .chart-content { width: 90%; max-width: 850px; }
47
+ .chart-content h2 { font-size: 2.2rem; margin-bottom: 25px; text-align: center; }
48
+ .chart-box { background: rgba(0,0,0,0.3); border-radius: 18px; padding: 25px; }
49
+ .table-content { width: 90%; max-width: 900px; }
50
+ .table-content h2 { font-size: 2rem; margin-bottom: 20px; text-align: center; }
51
+ .table-wrapper { background: rgba(0,0,0,0.3); border-radius: 15px; padding: 15px 20px; overflow: hidden; }
52
+ table { width: 100%; border-collapse: collapse; font-size: 1rem; }
53
+ th, td { padding: 10px 12px; text-align: center; }
54
+ th { background: rgba(102, 126, 234, 0.4); font-weight: 600; }
55
+ tr:nth-child(even) { background: rgba(255,255,255,0.05); }
56
+ .positive { color: #4ade80; font-weight: bold; }
57
+ .negative { color: #f87171; font-weight: bold; }
58
+ .insight-content, .rec-content { width: 90%; max-width: 850px; }
59
+ .insight-content h2, .rec-content h2 { font-size: 2.5rem; margin-bottom: 30px; text-align: center; }
60
+ .insight-grid, .rec-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
61
+ .insight-card, .rec-card { border-radius: 18px; padding: 25px; }
62
+ .insight-card { background: rgba(255,255,255,0.1); border-left: 5px solid #667eea; }
63
+ .insight-card.warning { border-left-color: #fbbf24; }
64
+ .insight-card h3 { font-size: 1.4rem; color: #667eea; margin-bottom: 12px; }
65
+ .insight-card.warning h3 { color: #fbbf24; }
66
+ .insight-card p { font-size: 1.1rem; line-height: 1.6; opacity: 0.9; }
67
+ .rec-card { background: rgba(74,222,128,0.2); border-left: 5px solid #4ade80; }
68
+ .rec-card h3 { font-size: 1.4rem; color: #4ade80; margin-bottom: 12px; }
69
+ .rec-card p { font-size: 1.1rem; line-height: 1.6; opacity: 0.9; }
70
+ .end-content { text-align: center; max-width: 90%; }
71
+ .end-content h1 { font-size: 4rem; font-weight: 700; margin-bottom: 25px; }
72
+ .end-content p { font-size: 1.4rem; opacity: 0.8; margin-bottom: 12px; }
73
+ .end-content .source { margin-top: 40px; padding: 20px 40px; background: rgba(255,255,255,0.15); border-radius: 10px; font-size: 1.1rem; }
74
+ .slide-counter { position: fixed; bottom: 25px; right: 25px; background: rgba(255,255,255,0.15); padding: 10px 18px; border-radius: 10px; font-size: 1rem; opacity: 0.7; }
75
+ .progress-bar { position: fixed; top: 0; left: 0; height: 4px; background: #667eea; transition: width 0.5s ease; z-index: 100; }
76
+ </style>
77
+ </head>
78
+ <body>
79
+ <div class="progress-bar" id="progressBar"></div>
80
+ <div class="slides-container">
81
+ <div class="slide bg-purple active" data-slide="1">
82
+ <div class="cover-content">
83
+ <h1>跨境电商边际贡献分析报告</h1>
84
+ <p class="subtitle">找出贡献最大的要素</p>
85
+ <p class="meta">2026年3月31日</p>
86
+ <div class="tenant">BytePlan 数据平台 · 跨境电商租户</div>
87
+ </div>
88
+ </div>
89
+ <div class="slide bg-dark" data-slide="2">
90
+ <div class="toc-content">
91
+ <h2>目录</h2>
92
+ <div class="toc-list">
93
+ <div class="toc-item"><span class="num">01</span><span class="text">核心发现摘要</span></div><div class="toc-item"><span class="num">02</span><span class="text">关键指标概览</span></div><div class="toc-item"><span class="num">03</span><span class="text">渠道贡献分析</span></div><div class="toc-item"><span class="num">04</span><span class="text">贡献率对比</span></div><div class="toc-item"><span class="num">05</span><span class="text">贡献排行榜</span></div><div class="toc-item"><span class="num">06</span><span class="text">数据明细表</span></div><div class="toc-item"><span class="num">07</span><span class="text">关键洞察</span></div><div class="toc-item"><span class="num">08</span><span class="text">行动建议</span></div>
94
+ </div>
95
+ </div>
96
+ </div>
97
+ <div class="slide bg-dark-alt" data-slide="3">
98
+ <div class="summary-content">
99
+ <h2>🏆 贡献最大的三个要素</h2>
100
+ <div class="summary-grid">
101
+ <div class="summary-card"><div class="rank">🥇 第一名</div><div class="name">天猫</div><div class="type">渠道</div><div class="value">¥16,273,934</div><div class="rate">贡献率 68%</div></div><div class="summary-card"><div class="rank">🥈 第二名</div><div class="name">CD120P</div><div class="type">产品</div><div class="value">¥5,635,209</div><div class="rate">贡献率 74%</div></div><div class="summary-card"><div class="rank">🥉 第三名</div><div class="name">美国</div><div class="type">国家</div><div class="value">¥4,983,568</div><div class="rate">贡献率 65%</div></div>
102
+ </div>
103
+ </div>
104
+ </div>
105
+ <div class="slide bg-dark" data-slide="4">
106
+ <div class="kpi-content">
107
+ <h2>📊 关键指标概览</h2>
108
+ <div class="kpi-grid">
109
+ <div class="kpi-card"><div class="icon">💰</div><div class="label">最大边际贡献</div><div class="value">16,273,934</div><div class="unit">元(天猫)</div></div><div class="kpi-card"><div class="icon">📈</div><div class="label">最高贡献率</div><div class="value">74%</div><div class="unit">(CD120P)</div></div><div class="kpi-card"><div class="icon">🌍</div><div class="label">核心市场贡献</div><div class="value">4,983,568</div><div class="unit">元(美国)</div></div><div class="kpi-card"><div class="icon">⚠️</div><div class="label">负贡献要素</div><div class="value">2</div><div class="unit">个(需关注)</div></div>
110
+ </div>
111
+ </div>
112
+ </div>
113
+ <div class="slide bg-dark-reverse" data-slide="5">
114
+ <div class="chart-content">
115
+ <h2>📊 渠道边际贡献对比</h2>
116
+ <div class="chart-box"><canvas id="barChart"></canvas></div>
117
+ </div>
118
+ </div>
119
+ <div class="slide bg-dark-alt" data-slide="6">
120
+ <div class="chart-content">
121
+ <h2>📈 渠道边际贡献率对比</h2>
122
+ <div class="chart-box"><canvas id="ratioChart"></canvas></div>
123
+ </div>
124
+ </div>
125
+ <div class="slide bg-dark" data-slide="7">
126
+ <div class="chart-content">
127
+ <h2>🏆 边际贡献 TOP8 排行榜</h2>
128
+ <div class="chart-box"><canvas id="rankingChart"></canvas></div>
129
+ </div>
130
+ </div>
131
+ <div class="slide bg-dark-reverse" data-slide="8">
132
+ <div class="table-content">
133
+ <h2>📋 边际贡献明细表</h2>
134
+ <div class="table-wrapper">
135
+ <table>
136
+ <thead><tr><th>要素名称</th><th>类型</th><th>数值</th><th>贡献</th><th>贡献率</th></tr></thead>
137
+ <tbody>
138
+ <tr><td>天猫</td><td>渠道</td><td class="positive">17,742,456</td><td class="positive">16,273,934</td><td class="positive">68%</td></tr><tr><td>CD120P</td><td>产品</td><td class="positive">27,538,152</td><td class="positive">5,635,209</td><td class="positive">74%</td></tr><tr><td>美国</td><td>国家</td><td class="positive">35,434,599</td><td class="positive">4,983,568</td><td class="positive">65%</td></tr><tr><td>Amazon</td><td>渠道</td><td class="positive">29,469,759</td><td class="positive">2,785,991</td><td class="positive">12%</td></tr><tr><td>品牌01</td><td>品牌</td><td class="positive">10,447,912</td><td class="positive">3,059,742</td><td class="positive">40%</td></tr><tr><td>Walmart</td><td>渠道</td><td class="positive">6,583,724</td><td class="positive">2,528,805</td><td class="positive">11%</td></tr><tr><td>CD130P-B</td><td>产品</td><td class="positive">3,134,013</td><td class="negative">-654,608</td><td class="negative">-9%</td></tr><tr><td>CD140P</td><td>产品</td><td class="positive">3,638,106</td><td class="negative">-388,318</td><td class="negative">-5%</td></tr>
139
+ </tbody>
140
+ </table>
141
+ </div>
142
+ </div>
143
+ </div>
144
+ <div class="slide bg-dark-alt" data-slide="9">
145
+ <div class="insight-content">
146
+ <h2>💡 关键洞察</h2>
147
+ <div class="insight-grid">
148
+ <div class="insight-card "><h3>天猫渠道表现卓越</h3><p>以68%贡献率和16,273,934元贡献额,成为最大贡献来源,运营效率高。</p></div><div class="insight-card "><h3>CD120P效率最高</h3><p>贡献率达74%,每单位收入创造边际贡献最大,是明星产品。</p></div><div class="insight-card "><h3>美国市场是核心</h3><p>贡献4,983,568元,贡献率65%,覆盖面广、效益稳定。</p></div><div class="insight-card warning"><h3>⚠️ 存在亏损产品</h3><p>CD130P-B和CD140P边际贡献为负,需评估定价策略。</p></div>
149
+ </div>
150
+ </div>
151
+ </div>
152
+ <div class="slide bg-dark" data-slide="10">
153
+ <div class="rec-content">
154
+ <h2>📝 行动建议</h2>
155
+ <div class="rec-grid">
156
+ <div class="rec-card"><h3>加大天猫渠道投入</h3><p>增加营销预算和运营资源,强化最大贡献渠道。</p></div><div class="rec-card"><h3>推广CD120P产品</h3><p>扩大生产规模并加强推广力度,打造明星产品。</p></div><div class="rec-card"><h3>深耕美国市场</h3><p>优化物流、客服和本地化服务,巩固核心市场。</p></div><div class="rec-card"><h3>调整亏损产品</h3><p>对CD130P-B和CD140P进行成本分析和定价评估。</p></div>
157
+ </div>
158
+ </div>
159
+ </div>
160
+ <div class="slide bg-purple" data-slide="11">
161
+ <div class="end-content">
162
+ <h1>谢谢观看</h1>
163
+ <p>跨境电商边际贡献分析报告</p>
164
+ <p>BytePlan 数据平台 · 跨境电商租户</p>
165
+ <div class="source">数据来源:BytePlan 数据平台 · 跨境电商租户<br>分析时间:2026年3月31日</div>
166
+ </div>
167
+ </div>
168
+ </div>
169
+ <div class="slide-counter" id="slideCounter">1 / 11</div>
170
+ <script>
171
+ let currentSlide = 1, totalSlides = 11;
172
+ function showSlide(n) { const slides = document.querySelectorAll('.slide'); slides.forEach(s => s.classList.remove('active')); slides[n - 1].classList.add('active'); document.getElementById('slideCounter').textContent = n + ' / ' + totalSlides; document.getElementById('progressBar').style.width = (n / totalSlides * 100) + '%'; currentSlide = n; }
173
+ function nextSlide() { if (currentSlide < totalSlides) showSlide(currentSlide + 1); }
174
+ function prevSlide() { if (currentSlide > 1) showSlide(currentSlide - 1); }
175
+ document.addEventListener('keydown', e => { if (e.key === 'ArrowDown' || e.key === 'ArrowRight' || e.key === ' ') nextSlide(); if (e.key === 'ArrowUp' || e.key === 'ArrowLeft') prevSlide(); });
176
+ let touchX = 0; document.addEventListener('touchstart', e => touchX = e.touches[0].clientX); document.addEventListener('touchend', e => { const diff = e.changedTouches[0].clientX - touchX; if (diff > 50) prevSlide(); if (diff < -50) nextSlide(); });
177
+ setTimeout(() => {
178
+ new Chart(document.getElementById('barChart'), { type: 'bar', data: { labels: ["天猫","Amazon","Walmart","Amazon_VC","Shopify"], datasets: [{ label: '数值', data: [16273934,2785991,2528805,1712695,624534], backgroundColor: ['#4ade80', '#60a5fa', '#f472b6', '#667eea', '#fbbf24'], borderRadius: 8 }] }, options: { responsive: true, plugins: { legend: { labels: { color: '#fff' } } }, scales: { y: { ticks: { color: '#CBD5E1' }, grid: { color: 'rgba(255,255,255,0.1)' } }, x: { ticks: { color: '#fff' }, grid: { display: false } } } } });
179
+ new Chart(document.getElementById('ratioChart'), { type: 'bar', data: { labels: ["天猫","Amazon","Walmart","Amazon_VC","Shopify"], datasets: [{ label: '贡献率 (%)', data: [68,12,11,7,3], backgroundColor: '#667eea', borderRadius: 8 }] }, options: { indexAxis: 'y', responsive: true, plugins: { legend: { labels: { color: '#fff' } } }, scales: { y: { ticks: { color: '#fff' }, grid: { display: false } }, x: { ticks: { color: '#CBD5E1' }, grid: { color: 'rgba(255,255,255,0.1)' }, max: 100 } } } });
180
+ new Chart(document.getElementById('rankingChart'), { type: 'bar', data: { labels: ["天猫 (渠道)","CD120P (产品)","美国 (国家)","Amazon (渠道)","品牌01","Walmart (渠道)","英国 (国家)","品牌03"], datasets: [{ label: '数值', data: [16273934,5635209,4983568,2785991,3059742,2528805,1712695,2445409], backgroundColor: '#4ade80', borderRadius: 6 }] }, options: { indexAxis: 'y', responsive: true, plugins: { legend: { display: false } }, scales: { y: { ticks: { color: '#fff' }, grid: { display: false } }, x: { ticks: { color: '#CBD5E1' }, grid: { color: 'rgba(255,255,255,0.1)' } } } } });
181
+ }, 100);
182
+ </script>
183
+ </body>
184
+ </html>