@iasiv5/dsh-skills 1.0.0 → 1.0.2

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 (37) hide show
  1. package/locale/en.json +6 -0
  2. package/locale/zh.json +6 -0
  3. package/package.json +4 -2
  4. package/skills/answer-me-with-html/SKILL.md +4 -2
  5. package/skills/answer-me-with-html/scripts/am.mjs +627 -192
  6. package/skills/guizang-ppt-skill/README.en.md +10 -8
  7. package/skills/guizang-ppt-skill/README.md +10 -8
  8. package/skills/guizang-ppt-skill/SKILL.md +20 -16
  9. package/skills/guizang-ppt-skill/assets/template-swiss.html +1068 -456
  10. package/skills/guizang-ppt-skill/assets/template.html +991 -225
  11. package/skills/guizang-ppt-skill/references/checklist.md +5 -4
  12. package/skills/guizang-ppt-skill/references/components.md +9 -5
  13. package/skills/guizang-ppt-skill/references/gz-components.md +289 -0
  14. package/skills/guizang-ppt-skill/references/layouts-swiss.md +17 -17
  15. package/skills/guizang-ppt-skill/references/layouts.md +1 -1
  16. package/skills/guizang-ppt-skill/references/themes-swiss.md +57 -86
  17. package/skills/guizang-ppt-skill/references/themes.md +65 -63
  18. package/skills/guizang-ppt-skill/scripts/gz-theme.mjs +434 -0
  19. package/skills/guizang-social-card-skill/HANDOFF.md +19 -1
  20. package/skills/guizang-social-card-skill/README.en.md +20 -7
  21. package/skills/guizang-social-card-skill/README.md +20 -7
  22. package/skills/guizang-social-card-skill/SKILL.md +7 -5
  23. package/skills/guizang-social-card-skill/assets/template-editorial-card.html +954 -126
  24. package/skills/guizang-social-card-skill/assets/template-swiss-card.html +588 -84
  25. package/skills/guizang-social-card-skill/package-lock.json +90 -1
  26. package/skills/guizang-social-card-skill/package.json +7 -4
  27. package/skills/guizang-social-card-skill/references/background-systems.md +7 -15
  28. package/skills/guizang-social-card-skill/references/components.md +16 -10
  29. package/skills/guizang-social-card-skill/references/gz-components.md +289 -0
  30. package/skills/guizang-social-card-skill/references/layout-recipes.md +1 -1
  31. package/skills/guizang-social-card-skill/references/production-workflow.md +10 -12
  32. package/skills/guizang-social-card-skill/references/style-system.md +1 -1
  33. package/skills/guizang-social-card-skill/references/theme-presets.md +59 -111
  34. package/skills/guizang-social-card-skill/scripts/gz-fonts.mjs +654 -0
  35. package/skills/guizang-social-card-skill/scripts/gz-theme.mjs +434 -0
  36. package/skills/guizang-social-card-skill/scripts/render.mjs +92 -0
  37. package/skills/guizang-social-card-skill/validate-social-deck.mjs +11 -6
@@ -1,12 +1,14 @@
1
1
  <!doctype html>
2
- <html lang="zh-CN" data-theme="ink-classic">
2
+ <html lang="zh-CN" data-theme="ink-classic" data-family="magazine" data-medium="card">
3
3
  <head>
4
4
  <meta charset="utf-8">
5
5
  <title>[必填] 替换为社交卡组标题 · Social Card Set</title>
6
6
  <meta name="viewport" content="width=device-width,initial-scale=1">
7
- <link rel="preconnect" href="https://fonts.googleapis.com">
8
- <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
9
- <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;500;700;900&family=Noto+Sans+SC:wght@300;400;500;700&family=Playfair+Display:ital,wght@0,400;0,700;1,400&family=Inter:wght@300;400;500;700&family=IBM+Plex+Mono:wght@400;500&display=swap">
7
+ <!-- GZ:FONTS:START · 字体由 guizang-design 字体清单生成;需要把字体内置进 HTML 时用 gz-fonts.mjs embed(卡片 skill 的 render.mjs 会自动内置) -->
8
+ <link rel="preconnect" href="https://fonts.googleapis.com">
9
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
10
+ <link rel="stylesheet" data-gz-fonts="playfair-display noto-serif-sc source-serif-4 noto-sans-sc ibm-plex-mono" href="https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400..900;1,400..900&family=Noto+Serif+SC:wght@200..900&family=Source+Serif+4:ital,wght@0,200..900;1,200..900&family=Noto+Sans+SC:wght@100..900&family=IBM+Plex+Mono:wght@400;500;600&display=swap">
11
+ <!-- GZ:FONTS:END -->
10
12
  <style>
11
13
  /* =========================================================
12
14
  Editorial Magazine × E-ink — Social Card Seed Template
@@ -25,93 +27,575 @@
25
27
  references/layout-recipes.md.
26
28
  ========================================================= */
27
29
 
28
- /* ---------- 1. Theme tokens ---------- */
29
- :root,
30
- [data-theme="ink-classic"] {
31
- --paper: #f3f0e8;
32
- --paper-2: #ebe6da;
33
- --ink: #0a0a0b;
34
- --muted: #68625a;
35
- --line: rgba(10,10,11,.22);
36
- --accent: #111111;
37
- --accent-soft: #d8d2c6;
38
- --ink-rgb: 10,10,11;
39
- --paper-rgb: 243,240,232;
40
- --accent-rgb: 17,17,17;
41
- }
42
- [data-theme="indigo-porcelain"] {
43
- --paper: #f2f4f5;
44
- --paper-2: #e5ebef;
45
- --ink: #0a1f3d;
46
- --muted: #5f6d78;
47
- --line: rgba(10,31,61,.20);
48
- --accent: #315d93;
49
- --accent-soft: #d7e1ec;
50
- --ink-rgb: 10,31,61;
51
- --paper-rgb: 242,244,245;
52
- --accent-rgb: 49,93,147;
53
- }
54
- [data-theme="forest-ink"] {
55
- --paper: #f5f1e8;
56
- --paper-2: #e8dfcf;
57
- --ink: #16251b;
58
- --muted: #5d665d;
59
- --line: rgba(22,37,27,.22);
60
- --accent: #2e6b4f;
61
- --accent-soft: #d4dfd2;
62
- --ink-rgb: 22,37,27;
63
- --paper-rgb: 245,241,232;
64
- --accent-rgb: 46,107,79;
65
- }
66
- [data-theme="kraft-paper"] {
67
- --paper: #eedfc7;
68
- --paper-2: #dfc9a8;
69
- --ink: #2a1e13;
70
- --muted: #755f49;
71
- --line: rgba(42,30,19,.24);
72
- --accent: #9b5a2e;
73
- --accent-soft: #d5b58f;
74
- --ink-rgb: 42,30,19;
75
- --paper-rgb: 238,223,199;
76
- --accent-rgb: 155,90,46;
77
- }
78
- [data-theme="dune"] {
79
- --paper: #f0e6d2;
80
- --paper-2: #ded0b7;
81
- --ink: #1f1a14;
82
- --muted: #6f6557;
83
- --line: rgba(31,26,20,.22);
84
- --accent: #8f7650;
85
- --accent-soft: #d4c2a4;
86
- --ink-rgb: 31,26,20;
87
- --paper-rgb: 240,230,210;
88
- --accent-rgb: 143,118,80;
89
- }
90
- /* Midnight Ink — the ONLY official dark Editorial palette.
91
- Use for game key art, night scenes, dark photography, cinematic covers.
92
- Do not improvise other dark backgrounds. */
93
- [data-theme="midnight-ink"] {
94
- --paper: #0e0d0c;
95
- --paper-2: #1a1714;
96
- --ink: #ece2cf;
97
- --muted: #9a8c75;
98
- --line: rgba(236,226,207,.22);
99
- --accent: #d4a04a;
100
- --accent-soft: #3a2a14;
101
- --ink-rgb: 236,226,207;
102
- --paper-rgb: 14,13,12;
103
- --accent-rgb: 212,160,74;
104
- }
105
-
106
- /* ---------- 2. Typography stack ---------- */
107
- :root {
108
- --serif-zh: "Noto Serif SC", "Songti SC", "STSong", serif;
109
- --serif-en: "Playfair Display", "Noto Serif SC", serif;
110
- --sans-zh: "Noto Sans SC", -apple-system, "PingFang SC", "Microsoft YaHei UI", sans-serif;
111
- --sans-en: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
112
- --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Consolas, monospace;
113
- }
30
+ /* GZ:TOKENS:START · guizang-design v0.1.0 生成,不要手改;改设计请改 guizang-design 后运行 scripts/sync-skill.mjs */
31
+ :root{
32
+ --font-display:'Playfair Display','Noto Serif SC','Source Han Serif SC','Songti SC',serif;
33
+ --font-serif:'Source Serif 4','Noto Serif SC','Source Han Serif SC','Songti SC','STSong',Georgia,serif;
34
+ --font-serif-zh:'Noto Serif SC','Source Han Serif SC','Songti SC','STSong',serif;
35
+ --font-sans:'Noto Sans SC','PingFang SC','Hiragino Sans GB','Microsoft YaHei',system-ui,sans-serif;
36
+ --font-mono:'IBM Plex Mono','Noto Sans SC',ui-monospace,'SF Mono',Menlo,monospace;
37
+ --sp-1:2px;
38
+ --sp-2:4px;
39
+ --sp-3:8px;
40
+ --sp-4:12px;
41
+ --sp-5:16px;
42
+ --sp-6:24px;
43
+ --sp-7:32px;
44
+ --sp-8:40px;
45
+ --sp-9:48px;
46
+ --sp-10:64px;
47
+ --sp-11:80px;
48
+ --sp-12:96px;
49
+ --sp-13:160px;
50
+ --radius-none:0px;
51
+ --radius-xs:3px;
52
+ --radius-sm:6px;
53
+ --radius-md:14px;
54
+ --radius-pill:999px;
55
+ --ease-standard:cubic-bezier(.2,0,.38,.9);
56
+ --ease-expressive:cubic-bezier(.4,.14,.3,1);
57
+ --ease-entrance:cubic-bezier(0,0,.3,1);
58
+ --ease-entrance-standard:cubic-bezier(0,0,.38,.9);
59
+ --ease-editorial:cubic-bezier(.22,1,.36,1);
60
+ --ease-page:cubic-bezier(.77,0,.175,1);
61
+ --dur-fast-1:70ms;
62
+ --dur-fast-2:110ms;
63
+ --dur-moderate-1:150ms;
64
+ --dur-moderate-2:240ms;
65
+ --dur-slow-1:400ms;
66
+ --dur-slow-2:700ms;
67
+ --dur-page:900ms;
68
+ --stagger-tight:70ms;
69
+ --stagger-base:100ms;
70
+ --stagger-loose:160ms;
71
+ --move-sm:8px;
72
+ --move-md:16px;
73
+ --move-lg:24px;
74
+ --paper:#f1efea;
75
+ --paper-2:#e8e5de;
76
+ --ink:#0a0a0b;
77
+ --muted:#68625a;
78
+ --accent:#111111;
79
+ --accent-soft:#d8d2c6;
80
+ --accent-on:#f1efea;
81
+ --accent-ink:#111111;
82
+ --accent-display:#111111;
83
+ --accent-ink-inverse:#b2b2b2;
84
+ --text-primary:#0a0a0b;
85
+ --text-body:#2c2b2c;
86
+ --text-secondary:#404040;
87
+ --text-helper:#68625a;
88
+ --line-strong:#7e7d7b;
89
+ --line:#b7b5b2;
90
+ --line-subtle:#d1cfcb;
91
+ --ink-rgb:10,10,11;
92
+ --paper-rgb:241,239,234;
93
+ --accent-rgb:17,17,17;
94
+ --accent-on-rgb:241,239,234;
95
+ --accent-on-text:#f1efea;
96
+ --accent-on-text-rgb:241,239,234;
97
+ color-scheme:light;
98
+ }
99
+ [data-theme="ink-classic"]{
100
+ --paper:#f1efea;
101
+ --paper-2:#e8e5de;
102
+ --ink:#0a0a0b;
103
+ --muted:#68625a;
104
+ --accent:#111111;
105
+ --accent-soft:#d8d2c6;
106
+ --accent-on:#f1efea;
107
+ --accent-ink:#111111;
108
+ --accent-display:#111111;
109
+ --accent-ink-inverse:#b2b2b2;
110
+ --text-primary:#0a0a0b;
111
+ --text-body:#2c2b2c;
112
+ --text-secondary:#404040;
113
+ --text-helper:#68625a;
114
+ --line-strong:#7e7d7b;
115
+ --line:#b7b5b2;
116
+ --line-subtle:#d1cfcb;
117
+ --ink-rgb:10,10,11;
118
+ --paper-rgb:241,239,234;
119
+ --accent-rgb:17,17,17;
120
+ --accent-on-rgb:241,239,234;
121
+ --accent-on-text:#f1efea;
122
+ --accent-on-text-rgb:241,239,234;
123
+ color-scheme:light;
124
+ }
125
+ [data-theme="indigo-porcelain"]{
126
+ --paper:#f1f3f5;
127
+ --paper-2:#e4e8ec;
128
+ --ink:#0a1f3d;
129
+ --muted:#5f6d78;
130
+ --accent:#315d93;
131
+ --accent-soft:#d7e1ec;
132
+ --accent-on:#f1f3f5;
133
+ --accent-ink:#315d93;
134
+ --accent-display:#315d93;
135
+ --accent-ink-inverse:#89b9f5;
136
+ --text-primary:#0a1f3d;
137
+ --text-body:#2e415c;
138
+ --text-secondary:#43546d;
139
+ --text-helper:#5f6d78;
140
+ --line-strong:#808d9e;
141
+ --line:#b8c0ca;
142
+ --line-subtle:#d2d7dd;
143
+ --ink-rgb:10,31,61;
144
+ --paper-rgb:241,243,245;
145
+ --accent-rgb:49,93,147;
146
+ --accent-on-rgb:241,243,245;
147
+ --accent-on-text:#f1f3f5;
148
+ --accent-on-text-rgb:241,243,245;
149
+ color-scheme:light;
150
+ }
151
+ [data-theme="forest-ink"]{
152
+ --paper:#f5f1e8;
153
+ --paper-2:#ece7da;
154
+ --ink:#1a2e1f;
155
+ --muted:#5d665d;
156
+ --accent:#2e6b4f;
157
+ --accent-soft:#d4dfd2;
158
+ --accent-on:#f5f1e8;
159
+ --accent-ink:#2e6b4f;
160
+ --accent-display:#2e6b4f;
161
+ --accent-ink-inverse:#88c6a6;
162
+ --text-primary:#1a2e1f;
163
+ --text-body:#3d4d3e;
164
+ --text-secondary:#515f51;
165
+ --text-helper:#5d665d;
166
+ --line-strong:#8b9386;
167
+ --line:#c0c2b7;
168
+ --line-subtle:#d8d7cd;
169
+ --ink-rgb:26,46,31;
170
+ --paper-rgb:245,241,232;
171
+ --accent-rgb:46,107,79;
172
+ --accent-on-rgb:245,241,232;
173
+ --accent-on-text:#f5f1e8;
174
+ --accent-on-text-rgb:245,241,232;
175
+ color-scheme:light;
176
+ }
177
+ [data-theme="kraft-paper"]{
178
+ --paper:#eedfc7;
179
+ --paper-2:#e0d0b6;
180
+ --ink:#2a1e13;
181
+ --muted:#755f49;
182
+ --accent:#9b5a2e;
183
+ --accent-soft:#d5b58f;
184
+ --accent-on:#eedfc7;
185
+ --accent-ink:#804212;
186
+ --accent-display:#9b5a2e;
187
+ --accent-ink-inverse:#eda679;
188
+ --text-primary:#2a1e13;
189
+ --text-body:#493c2f;
190
+ --text-secondary:#5b4e3f;
191
+ --text-helper:#755f49;
192
+ --line-strong:#8f816f;
193
+ --line:#bfb09b;
194
+ --line-subtle:#d4c5af;
195
+ --ink-rgb:42,30,19;
196
+ --paper-rgb:238,223,199;
197
+ --accent-rgb:155,90,46;
198
+ --accent-on-rgb:238,223,199;
199
+ --accent-on-text:#ffffff;
200
+ --accent-on-text-rgb:255,255,255;
201
+ color-scheme:light;
202
+ }
203
+ [data-theme="dune"]{
204
+ --paper:#f0e6d2;
205
+ --paper-2:#e3d7bf;
206
+ --ink:#1f1a14;
207
+ --muted:#6f6557;
208
+ --accent:#8f7650;
209
+ --accent-soft:#d4c2a4;
210
+ --accent-on:#f0e6d2;
211
+ --accent-ink:#705833;
212
+ --accent-display:#8f7650;
213
+ --accent-ink-inverse:#cbb088;
214
+ --text-primary:#1f1a14;
215
+ --text-body:#3f3931;
216
+ --text-secondary:#524c42;
217
+ --text-helper:#6f6557;
218
+ --line-strong:#8a8275;
219
+ --line:#bdb4a3;
220
+ --line-subtle:#d4cab8;
221
+ --ink-rgb:31,26,20;
222
+ --paper-rgb:240,230,210;
223
+ --accent-rgb:143,118,80;
224
+ --accent-on-rgb:240,230,210;
225
+ --accent-on-text:#ffffff;
226
+ --accent-on-text-rgb:255,255,255;
227
+ color-scheme:light;
228
+ }
229
+ [data-theme="midnight-ink"]{
230
+ --paper:#0e0d0c;
231
+ --paper-2:#1a1714;
232
+ --ink:#ece2cf;
233
+ --muted:#9a8c75;
234
+ --accent:#d4a04a;
235
+ --accent-soft:#3a2a14;
236
+ --accent-on:#0e0d0c;
237
+ --accent-ink:#e0ab56;
238
+ --accent-display:#d4a04a;
239
+ --accent-ink-inverse:#875c00;
240
+ --text-primary:#ece2cf;
241
+ --text-body:#d5ccbb;
242
+ --text-secondary:#b9b2a3;
243
+ --text-helper:#b9b2a3;
244
+ --line-strong:#67635b;
245
+ --line:#373430;
246
+ --line-subtle:#23211f;
247
+ --ink-rgb:236,226,207;
248
+ --paper-rgb:14,13,12;
249
+ --accent-rgb:212,160,74;
250
+ --accent-on-rgb:14,13,12;
251
+ --accent-on-text:#0e0d0c;
252
+ --accent-on-text-rgb:14,13,12;
253
+ color-scheme:dark;
254
+ }
255
+
256
+ :root{
257
+ --fs-display:124px;
258
+ --fw-display:500;
259
+ --lh-display:1.06;
260
+ --ls-display:.04em;
261
+ --ff-display:var(--font-serif-zh);
262
+ --fst-display:normal;
263
+ --tt-display:none;
264
+ --fs-title:88px;
265
+ --fw-title:500;
266
+ --lh-title:1.1;
267
+ --ls-title:.03em;
268
+ --ff-title:var(--font-serif-zh);
269
+ --fst-title:normal;
270
+ --tt-title:none;
271
+ --fs-heading:56px;
272
+ --fw-heading:500;
273
+ --lh-heading:1.18;
274
+ --ls-heading:.02em;
275
+ --ff-heading:var(--font-serif-zh);
276
+ --fst-heading:normal;
277
+ --tt-heading:none;
278
+ --fs-subhead:36px;
279
+ --fw-subhead:400;
280
+ --lh-subhead:1.3;
281
+ --ls-subhead:0;
282
+ --ff-subhead:var(--font-display);
283
+ --fst-subhead:italic;
284
+ --tt-subhead:none;
285
+ --fs-lead:28px;
286
+ --fw-lead:400;
287
+ --lh-lead:1.55;
288
+ --ls-lead:0;
289
+ --ff-lead:var(--font-serif-zh);
290
+ --fst-lead:normal;
291
+ --tt-lead:none;
292
+ --fs-body:24px;
293
+ --fw-body:400;
294
+ --lh-body:1.65;
295
+ --ls-body:0;
296
+ --ff-body:var(--font-serif-zh);
297
+ --fst-body:normal;
298
+ --tt-body:none;
299
+ --fs-small:22px;
300
+ --fw-small:400;
301
+ --lh-small:1.55;
302
+ --ls-small:0;
303
+ --ff-small:var(--font-serif-zh);
304
+ --fst-small:normal;
305
+ --tt-small:none;
306
+ --fs-caption:20px;
307
+ --fw-caption:400;
308
+ --lh-caption:1.4;
309
+ --ls-caption:.08em;
310
+ --ff-caption:var(--font-mono);
311
+ --fst-caption:normal;
312
+ --tt-caption:uppercase;
313
+ --fs-label:21px;
314
+ --fw-label:500;
315
+ --lh-label:1.3;
316
+ --ls-label:.22em;
317
+ --ff-label:var(--font-mono);
318
+ --fst-label:normal;
319
+ --tt-label:uppercase;
320
+ --fs-meta:18px;
321
+ --fw-meta:500;
322
+ --lh-meta:1.3;
323
+ --ls-meta:.20em;
324
+ --ff-meta:var(--font-mono);
325
+ --fst-meta:normal;
326
+ --tt-meta:uppercase;
327
+ --fs-quote:64px;
328
+ --fw-quote:500;
329
+ --lh-quote:1.28;
330
+ --ls-quote:0;
331
+ --ff-quote:var(--font-serif-zh);
332
+ --fst-quote:normal;
333
+ --tt-quote:none;
334
+ --fs-num-xl:160px;
335
+ --fw-num-xl:500;
336
+ --lh-num-xl:0.92;
337
+ --ls-num-xl:-.01em;
338
+ --ff-num-xl:var(--font-display);
339
+ --fst-num-xl:normal;
340
+ --tt-num-xl:none;
341
+ --fs-num-l:112px;
342
+ --fw-num-l:500;
343
+ --lh-num-l:0.95;
344
+ --ls-num-l:0;
345
+ --ff-num-l:var(--font-display);
346
+ --fst-num-l:normal;
347
+ --tt-num-l:none;
348
+ --fs-num-m:72px;
349
+ --fw-num-m:500;
350
+ --lh-num-m:1;
351
+ --ls-num-m:0;
352
+ --ff-num-m:var(--font-display);
353
+ --fst-num-m:normal;
354
+ --tt-num-m:none;
355
+ --fs-display-zh:124px;
356
+ --fw-display-zh:500;
357
+ --lh-display-zh:1.06;
358
+ --ls-display-zh:.04em;
359
+ --ff-display-zh:var(--font-serif-zh);
360
+ --fst-display-zh:normal;
361
+ --tt-display-zh:none;
362
+ --fs-title-zh:88px;
363
+ --fw-title-zh:500;
364
+ --lh-title-zh:1.1;
365
+ --ls-title-zh:.03em;
366
+ --ff-title-zh:var(--font-serif-zh);
367
+ --fst-title-zh:normal;
368
+ --tt-title-zh:none;
369
+ }
370
+ :root,[data-board="xhs"]{
371
+ --board-w:1080px;
372
+ --board-h:1440px;
373
+ --canvas-padding:96px 88px;
374
+ }
375
+ [data-board="square"]{
376
+ --board-w:1080px;
377
+ --board-h:1080px;
378
+ --canvas-padding:88px;
379
+ --fs-display:116px;
380
+ --fs-title:78px;
381
+ --fs-heading:48px;
382
+ --fs-body:26px;
383
+ }
384
+ [data-board="wide"]{
385
+ --board-w:2100px;
386
+ --board-h:900px;
387
+ --canvas-padding:88px 120px;
388
+ --fs-display:128px;
389
+ --fs-title:96px;
390
+ --fs-lead:34px;
391
+ }
392
+ .gz-t-display{font-family:var(--ff-display);font-size:var(--fs-display);font-weight:var(--fw-display);line-height:var(--lh-display);letter-spacing:var(--ls-display);font-style:var(--fst-display);text-transform:var(--tt-display)}
393
+ .gz-t-title{font-family:var(--ff-title);font-size:var(--fs-title);font-weight:var(--fw-title);line-height:var(--lh-title);letter-spacing:var(--ls-title);font-style:var(--fst-title);text-transform:var(--tt-title)}
394
+ .gz-t-heading{font-family:var(--ff-heading);font-size:var(--fs-heading);font-weight:var(--fw-heading);line-height:var(--lh-heading);letter-spacing:var(--ls-heading);font-style:var(--fst-heading);text-transform:var(--tt-heading)}
395
+ .gz-t-subhead{font-family:var(--ff-subhead);font-size:var(--fs-subhead);font-weight:var(--fw-subhead);line-height:var(--lh-subhead);letter-spacing:var(--ls-subhead);font-style:var(--fst-subhead);text-transform:var(--tt-subhead)}
396
+ .gz-t-lead{font-family:var(--ff-lead);font-size:var(--fs-lead);font-weight:var(--fw-lead);line-height:var(--lh-lead);letter-spacing:var(--ls-lead);font-style:var(--fst-lead);text-transform:var(--tt-lead)}
397
+ .gz-t-body{font-family:var(--ff-body);font-size:var(--fs-body);font-weight:var(--fw-body);line-height:var(--lh-body);letter-spacing:var(--ls-body);font-style:var(--fst-body);text-transform:var(--tt-body)}
398
+ .gz-t-small{font-family:var(--ff-small);font-size:var(--fs-small);font-weight:var(--fw-small);line-height:var(--lh-small);letter-spacing:var(--ls-small);font-style:var(--fst-small);text-transform:var(--tt-small)}
399
+ .gz-t-caption{font-family:var(--ff-caption);font-size:var(--fs-caption);font-weight:var(--fw-caption);line-height:var(--lh-caption);letter-spacing:var(--ls-caption);font-style:var(--fst-caption);text-transform:var(--tt-caption)}
400
+ .gz-t-label{font-family:var(--ff-label);font-size:var(--fs-label);font-weight:var(--fw-label);line-height:var(--lh-label);letter-spacing:var(--ls-label);font-style:var(--fst-label);text-transform:var(--tt-label)}
401
+ .gz-t-meta{font-family:var(--ff-meta);font-size:var(--fs-meta);font-weight:var(--fw-meta);line-height:var(--lh-meta);letter-spacing:var(--ls-meta);font-style:var(--fst-meta);text-transform:var(--tt-meta)}
402
+ .gz-t-quote{font-family:var(--ff-quote);font-size:var(--fs-quote);font-weight:var(--fw-quote);line-height:var(--lh-quote);letter-spacing:var(--ls-quote);font-style:var(--fst-quote);text-transform:var(--tt-quote)}
403
+ .gz-t-num-xl{font-family:var(--ff-num-xl);font-size:var(--fs-num-xl);font-weight:var(--fw-num-xl);line-height:var(--lh-num-xl);letter-spacing:var(--ls-num-xl);font-style:var(--fst-num-xl);text-transform:var(--tt-num-xl)}
404
+ .gz-t-num-l{font-family:var(--ff-num-l);font-size:var(--fs-num-l);font-weight:var(--fw-num-l);line-height:var(--lh-num-l);letter-spacing:var(--ls-num-l);font-style:var(--fst-num-l);text-transform:var(--tt-num-l)}
405
+ .gz-t-num-m{font-family:var(--ff-num-m);font-size:var(--fs-num-m);font-weight:var(--fw-num-m);line-height:var(--lh-num-m);letter-spacing:var(--ls-num-m);font-style:var(--fst-num-m);text-transform:var(--tt-num-m)}
406
+ .gz-t-display-zh{font-family:var(--ff-display-zh);font-size:var(--fs-display-zh);font-weight:var(--fw-display-zh);line-height:var(--lh-display-zh);letter-spacing:var(--ls-display-zh);font-style:var(--fst-display-zh);text-transform:var(--tt-display-zh)}
407
+ .gz-t-title-zh{font-family:var(--ff-title-zh);font-size:var(--fs-title-zh);font-weight:var(--fw-title-zh);line-height:var(--lh-title-zh);letter-spacing:var(--ls-title-zh);font-style:var(--fst-title-zh);text-transform:var(--tt-title-zh)}
408
+
409
+ :lang(zh){line-break:strict;text-spacing-trim:normal;text-autospace:normal;overflow-wrap:break-word}
410
+ :lang(zh) .gz-prose em:not(:lang(en)){font-style:normal;text-emphasis:filled dot;text-emphasis-position:under right}
411
+ .gz-tnum{font-variant-numeric:tabular-nums}
412
+
413
+ /* 歸藏设计系统 · 共享组件
414
+ *
415
+ * 一份结构,三种介质:根节点 <html data-family="magazine|swiss" data-medium="slide|card|page">。
416
+ * 这里只管布局、颜色和间距;字号、字重、行高一律由 gz-t-<角色> 类提供,
417
+ * 所以同一个组件放进 PPT、卡片、网页会自动换成各自的字号。
418
+ * 颜色只用语义 token(--text-* / --line-* / --accent*),换主题不需要改组件。
419
+ */
420
+
421
+ /* ---------- 家族差异 ---------- */
422
+ /* 单张卡片 / 单页换主题([data-theme])或反色([data-surface])时,线条变量要在那一层重新计算,否则沿用根节点的颜色 */
423
+ [data-family="magazine"], [data-family="magazine"] [data-theme], [data-family="magazine"] [data-surface] { --img-pos: center top; --rule: 1px solid var(--line-strong); --rule-strong: 1px solid var(--line-strong) }
424
+ [data-family="swiss"], [data-family="swiss"] [data-theme], [data-family="swiss"] [data-surface] { --img-pos: center center; --rule: 1px solid var(--line); --rule-strong: 2px solid var(--ink) }
425
+
426
+ /* ---------- 表面:反色块里文字角色跟着换 ---------- */
427
+ [data-surface="ink"] {
428
+ background: var(--ink); color: var(--paper);
429
+ --text-primary: var(--paper); --text-body: rgba(var(--paper-rgb), .86); --text-secondary: rgba(var(--paper-rgb), .72);
430
+ --text-helper: rgba(var(--paper-rgb), .62); --line: rgba(var(--paper-rgb), .22); --line-strong: rgba(var(--paper-rgb), .45);
431
+ --accent-ink: var(--accent-ink-inverse); --accent-display: var(--accent-ink-inverse); --rule-strong: 2px solid var(--paper);
432
+ }
433
+ [data-family="magazine"] [data-surface="ink"], [data-family="magazine"][data-surface="ink"] { --rule-strong: 1px solid rgba(var(--paper-rgb), .45) }
434
+ [data-surface="accent"] {
435
+ background: var(--accent); color: var(--accent-on);
436
+ --text-primary: var(--accent-on); --text-body: rgba(var(--accent-on-rgb), .88); --text-secondary: rgba(var(--accent-on-rgb), .78);
437
+ --text-helper: rgba(var(--accent-on-rgb), .7); --line: rgba(var(--accent-on-rgb), .3); --line-strong: rgba(var(--accent-on-rgb), .55);
438
+ --accent-ink: var(--accent-on); --accent-display: var(--accent-on); --rule-strong: 2px solid var(--accent-on);
439
+ }
440
+ [data-surface="paper-2"] { background: var(--paper-2) }
441
+
442
+ /* 强调色文字:小字用 accent-ink,大字 / 大数字用 accent-display(浅色强调色在纸上会自动加深;反色块里自动切换) */
443
+ .gz-c-accent { color: var(--accent-ink) }
444
+ .gz-c-accent-display { color: var(--accent-display) }
445
+
446
+ /* ---------- 页眉页脚 chrome ---------- */
447
+ .gz-chrome { display: flex; justify-content: space-between; align-items: baseline; gap: var(--sp-6); color: var(--text-helper); border-top: var(--rule); padding-top: var(--sp-4) }
448
+ .gz-chrome[data-pos="top"] { border-top: 0; border-bottom: var(--rule); padding: 0 0 var(--sp-4) }
449
+ .gz-chrome__group { display: flex; gap: var(--sp-5); min-width: 0 }
450
+ .gz-chrome__accent { color: var(--accent-ink) }
451
+
452
+ /* ---------- 封面 cover ---------- */
453
+ .gz-cover { display: flex; flex-direction: column; gap: var(--sp-6); color: var(--text-primary) }
454
+ .gz-cover__kicker { color: var(--text-helper) }
455
+ [data-family="swiss"] .gz-cover__kicker { color: var(--accent-ink) }
456
+ .gz-cover__body { width: 100%; container-type: inline-size }
457
+ /* 标题按最长一行的字数自动收字号:--chars 由 components/render.mjs 算好写进 style;手写时填最长一行的字数(中文 1、西文约 0.56)。上限仍是 token 定的展示字号 */
458
+ .gz-cover__title { margin: 0; font-size: min(var(--fs-display-zh), calc(100cqi / var(--chars, 1) * .94)) }
459
+ .gz-cover__rule { width: 96px; height: 0; border-top: 2px solid var(--accent) }
460
+ [data-family="swiss"] .gz-cover__rule { border-top-width: 3px }
461
+ .gz-cover__sub { margin: 0; color: var(--text-body); max-width: 32em }
462
+ .gz-cover__meta { margin-top: auto }
463
+ /* 幻灯片、卡片:封面撑满画布,标题压在下半部 */
464
+ [data-medium="slide"] .gz-cover, [data-medium="card"] .gz-cover { height: 100% }
465
+ [data-medium="slide"] .gz-cover__body, [data-medium="card"] .gz-cover__body { margin-top: auto; display: flex; flex-direction: column; gap: var(--sp-7) }
466
+ [data-medium="slide"] .gz-cover__meta, [data-medium="card"] .gz-cover__meta { margin-top: var(--sp-10) }
467
+ /* 网页:杂志风居中,瑞士风左对齐 */
468
+ [data-medium="page"] .gz-cover { padding: var(--sp-11) 0 var(--sp-9); border-bottom: var(--rule) }
469
+ [data-medium="page"] .gz-cover__body { display: flex; flex-direction: column; gap: var(--sp-6) }
470
+ [data-medium="page"][data-family="magazine"] .gz-cover { align-items: center; text-align: center }
471
+ [data-medium="page"][data-family="magazine"] .gz-cover__body { align-items: center }
472
+ [data-medium="page"] .gz-cover__meta { margin-top: var(--sp-6); border-top: 0; padding-top: 0; justify-content: center }
473
+ [data-medium="page"][data-family="swiss"] .gz-cover__meta { justify-content: flex-start }
474
+
475
+ /* ---------- 大数字 stat ---------- */
476
+ .gz-stats { display: grid; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); gap: var(--sp-9) var(--sp-7) }
477
+ .gz-stats[data-count="1"] { --cols: 1 } .gz-stats[data-count="2"] { --cols: 2 } .gz-stats[data-count="4"] { --cols: 4 }
478
+ [data-medium="card"] .gz-stats { --cols: 2 }
479
+ [data-medium="card"] .gz-stats[data-count="1"], [data-medium="card"] .gz-stats[data-count="3"] { --cols: 1 }
480
+ .gz-stat { display: flex; flex-direction: column; gap: var(--sp-4); border-top: var(--rule-strong); padding-top: var(--sp-5); min-width: 0 }
481
+ .gz-stat__label { color: var(--text-helper) }
482
+ .gz-stat__value { display: flex; align-items: baseline; gap: .06em; font-variant-numeric: tabular-nums lining-nums; white-space: nowrap }
483
+ .gz-stat__unit { font-size: .4em; font-weight: 500; letter-spacing: 0; color: var(--text-secondary) }
484
+ .gz-stat.is-accent .gz-stat__num { color: var(--accent-ink) }
485
+ .gz-stat__note { margin: 0; color: var(--text-secondary); max-width: 24em }
486
+ [data-medium="card"] .gz-stats[data-count="3"] .gz-stat { display: grid; grid-template-columns: auto 1fr; align-items: end; column-gap: var(--sp-7) }
487
+ [data-medium="card"] .gz-stats[data-count="3"] .gz-stat__label { grid-column: 1 / -1 }
488
+ [data-medium="card"] .gz-stats[data-count="3"] .gz-stat__note { padding-bottom: .6em }
489
+
490
+ /* ---------- 引言 quote ---------- */
491
+ .gz-quote { margin: 0; display: flex; flex-direction: column; gap: var(--sp-7) }
492
+ .gz-quote__text { margin: 0; color: var(--text-primary); text-wrap: balance }
493
+ .gz-quote__text p { margin: 0; text-wrap: balance }
494
+ [data-family="magazine"] .gz-quote__text::before { content: "\201C"; display: block; font-family: var(--font-display); font-style: normal; color: var(--accent); font-size: 1.8em; line-height: 1; height: .55em }
495
+ [data-family="swiss"] .gz-quote { border-top: var(--rule-strong); padding-top: var(--sp-7) }
496
+ .gz-quote__source { color: var(--text-helper) }
497
+ [data-medium="page"][data-family="magazine"] .gz-quote { align-items: center; text-align: center; padding: var(--sp-9) 0 }
498
+
499
+ /* ---------- 流程 process:幻灯片 / 网页横排,卡片竖排 ---------- */
500
+ .gz-process { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); gap: var(--sp-7) }
501
+ .gz-process__step { display: flex; flex-direction: column; gap: var(--sp-4); border-top: var(--rule-strong); padding-top: var(--sp-5); min-width: 0 }
502
+ .gz-process__nb { color: var(--accent-ink) }
503
+ .gz-process__title { margin: 0 }
504
+ .gz-process__desc { margin: 0; color: var(--text-secondary) }
505
+ [data-medium="card"] .gz-process { grid-template-columns: 1fr; gap: 0; border-bottom: var(--rule) }
506
+ [data-medium="card"] .gz-process__step { display: grid; grid-template-columns: 112px minmax(0, 1fr); column-gap: var(--sp-6); row-gap: var(--sp-3); padding: var(--sp-7) 0 }
507
+ [data-medium="card"] .gz-process__step + .gz-process__step { border-top: var(--rule) }
508
+ [data-medium="card"] .gz-process__nb { grid-row: span 2 }
509
+ [data-medium="page"] .gz-process { --n: 2; row-gap: var(--sp-8) }
510
+
511
+ /* ---------- 对比 compare:左右分栏,卡片上下叠 ---------- */
512
+ .gz-compare { display: grid; grid-template-columns: minmax(0, 1fr) 1px minmax(0, 1fr); gap: 0 var(--sp-9) }
513
+ .gz-compare__rule { background: var(--line-strong) }
514
+ .gz-compare__side { display: flex; flex-direction: column; gap: var(--sp-5); min-width: 0 }
515
+ .gz-compare__tag { color: var(--text-helper) }
516
+ .gz-compare__side[data-side="after"] .gz-compare__tag { color: var(--accent-ink) }
517
+ .gz-compare__title { margin: 0 }
518
+ .gz-compare__side[data-side="before"] .gz-compare__title { color: var(--text-secondary) }
519
+ .gz-compare__desc { margin: 0; color: var(--text-secondary) }
520
+ .gz-compare__list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: var(--sp-3); color: var(--text-body) }
521
+ .gz-compare__list li { padding-left: 1.2em; position: relative }
522
+ .gz-compare__list li::before { content: ""; position: absolute; left: 0; top: .72em; width: .5em; border-top: 1px solid currentColor }
523
+ [data-family="swiss"] .gz-compare__side[data-side="after"][data-surface] { padding: var(--sp-8) }
524
+ [data-medium="card"] .gz-compare { grid-template-columns: 1fr; gap: var(--sp-8) 0 }
525
+ [data-medium="card"] .gz-compare__rule { height: 1px }
526
+
527
+ /* ---------- 图框 figure:照片 cover 裁切,截图 contain 放在底台上 ---------- */
528
+ .gz-figure { margin: 0; display: flex; flex-direction: column; gap: var(--sp-4); min-width: 0 }
529
+ .gz-figure__well { position: relative; aspect-ratio: var(--ratio, 16 / 10); overflow: hidden; background: var(--paper-2) }
530
+ .gz-figure__well > img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: var(--img-pos) }
531
+ .gz-figure[data-ratio="16x9"] { --ratio: 16 / 9 } .gz-figure[data-ratio="16x10"] { --ratio: 16 / 10 } .gz-figure[data-ratio="4x3"] { --ratio: 4 / 3 }
532
+ .gz-figure[data-ratio="3x2"] { --ratio: 3 / 2 } .gz-figure[data-ratio="1x1"] { --ratio: 1 } .gz-figure[data-ratio="3x4"] { --ratio: 3 / 4 } .gz-figure[data-ratio="21x9"] { --ratio: 21 / 9 }
533
+ .gz-figure[data-kind="screenshot"] .gz-figure__well { display: flex; align-items: center; justify-content: center; padding: var(--inset, var(--sp-8)) }
534
+ .gz-figure[data-kind="screenshot"] .gz-figure__well > img { width: auto; height: auto; max-width: 100%; max-height: 100%; object-fit: contain; border-radius: var(--radius-sm); box-shadow: 0 0 0 1px var(--line) }
535
+ [data-family="magazine"] .gz-figure[data-kind="screenshot"] .gz-figure__well > img { box-shadow: 0 0 0 1px var(--line), 0 18px 40px -24px rgba(var(--ink-rgb), .45) }
536
+ [data-family="swiss"] .gz-figure[data-kind="screenshot"] .gz-figure__well { background: var(--grey-1); border-top: 3px solid var(--accent) }
537
+ [data-family="swiss"] .gz-figure[data-kind="screenshot"] .gz-figure__well > img { border-radius: 0 }
538
+ .gz-figure__cap { color: var(--text-helper); display: flex; gap: var(--sp-4) }
539
+ .gz-figure__idx { color: var(--accent-ink); flex: none }
540
+
541
+ /* ---------- 图片网格 gallery ---------- */
542
+ .gz-gallery { display: grid; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); gap: var(--sp-7) var(--sp-6) }
543
+ [data-medium="card"] .gz-gallery { --cols: 2 }
544
+ [data-medium="card"] .gz-gallery[data-count="3"] > :first-child { grid-column: 1 / -1; --ratio: 16 / 9 }
114
545
 
546
+ /* ---------- 条目清单 ledger ---------- */
547
+ .gz-ledger { list-style: none; margin: 0; padding: 0; border-top: var(--rule-strong) }
548
+ .gz-ledger__row { display: grid; grid-template-columns: var(--nb-w, 3.2em) minmax(0, 1fr) auto; column-gap: var(--sp-6); align-items: baseline; padding: var(--sp-6) 0; border-bottom: var(--rule) }
549
+ .gz-ledger__nb { color: var(--accent-ink) }
550
+ .gz-ledger__title { margin: 0 }
551
+ .gz-ledger__note { margin: var(--sp-2) 0 0; color: var(--text-secondary) }
552
+ .gz-ledger__value { color: var(--text-helper); text-align: right; white-space: nowrap }
553
+ [data-medium="card"] .gz-ledger__row { --nb-w: 72px; padding: var(--sp-7) 0 }
554
+
555
+ /* 歸藏设计系统 · 纹理与特效图层(纯 CSS,颜色全部来自 token)
556
+ * 来源:PPT 瑞士风 .dots / .dot-mat / .ring-mat / .cross-mat / .hatch,卡片杂志风 .grain / .paper-wash。
557
+ */
558
+
559
+ /* 特效画布:铺满父容器、在内容下面、不挡点击。父容器需要 position: relative */
560
+ .gz-effect { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; z-index: 0 }
561
+ .gz-layer-content { position: relative; z-index: 1 }
562
+
563
+ /* 点阵:前景色画点,跟随所在表面的文字色 */
564
+ .gz-dots { background-image: radial-gradient(currentColor 1px, transparent 1.2px); background-size: 12px 12px; opacity: .18 }
565
+ .gz-dots-fine { background-image: radial-gradient(currentColor .8px, transparent 1px); background-size: 8px 8px; opacity: .14 }
566
+ .gz-dots-bold { background-image: radial-gradient(currentColor 1.4px, transparent 1.6px); background-size: 18px 18px; opacity: .22 }
567
+
568
+ .gz-dot-mat { --mat: 14px; background-image: radial-gradient(currentColor 1.4px, transparent 1.6px); background-size: var(--mat) var(--mat); opacity: .5 }
569
+ .gz-dot-mat.is-lg { --mat: 22px } .gz-dot-mat.is-xl { --mat: 34px }
570
+ .gz-dot-mat.is-dense{ --mat: 9px; opacity: .62 }
571
+ .gz-ring-mat { --mat: 18px; background-image: radial-gradient(circle, transparent 2px, currentColor 2px, currentColor 2.7px, transparent 2.9px); background-size: var(--mat) var(--mat); opacity: .55 }
572
+ .gz-ring-mat.is-lg { --mat: 28px }
573
+ .gz-cross-mat { --mat: 22px; background: currentColor; opacity: .42;
574
+ -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22'%3E%3Cpath d='M8 8l6 6M14 8l-6 6' stroke='%23000' stroke-width='1.4'/%3E%3C/svg%3E") 0 0 / var(--mat) var(--mat);
575
+ mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22'%3E%3Cpath d='M8 8l6 6M14 8l-6 6' stroke='%23000' stroke-width='1.4'/%3E%3C/svg%3E") 0 0 / var(--mat) var(--mat) }
576
+ .gz-cross-mat.is-lg { --mat: 32px }
577
+ .gz-hatch { background-image: repeating-linear-gradient(135deg, currentColor 0 1px, transparent 1px 8px); opacity: .55 }
578
+
579
+ /* 纸张颗粒与墨色晕染:杂志风卡片的「氛围层」,叠在特效画布上、内容下 */
580
+ .gz-grain { position: absolute; inset: 0; pointer-events: none; z-index: 0; mix-blend-mode: multiply; opacity: .35;
581
+ background-image: radial-gradient(rgba(0,0,0,.045) 1px, transparent 1px); background-size: 3px 3px }
582
+ [data-scheme="dark"] .gz-grain, .gz-grain.is-dark { mix-blend-mode: screen; opacity: .26; background-image: radial-gradient(rgba(255,244,214,.10) 1px, transparent 1px) }
583
+ .gz-paper-wash { position: absolute; inset: 0; pointer-events: none; z-index: 0;
584
+ background: linear-gradient(180deg, rgba(var(--ink-rgb), .02), rgba(var(--ink-rgb), .05) 60%, rgba(var(--ink-rgb), .08)) }
585
+ .gz-ink-vignette { position: absolute; inset: 0; pointer-events: none; z-index: 0;
586
+ background: radial-gradient(circle at 18% 12%, rgba(var(--ink-rgb), .10), transparent 34%), radial-gradient(circle at 82% 80%, rgba(var(--accent-rgb), .10), transparent 38%) }
587
+
588
+ /* PPT 杂志风:WebGL 背景上的纸 / 墨蒙版,保证文字可读(原 .slide.light/.dark::before) */
589
+ .gz-veil { position: absolute; inset: 0; pointer-events: none; z-index: 0; backdrop-filter: blur(3px); background: rgba(var(--paper-rgb), .78) }
590
+ .gz-veil.is-ink{ background: rgba(var(--ink-rgb), .78) }
591
+ .gz-veil.is-hero { backdrop-filter: none; background: rgba(var(--paper-rgb), .16) }
592
+ .gz-veil.is-hero.is-ink { background: rgba(var(--ink-rgb), .12) }
593
+
594
+ @media (prefers-reduced-motion: reduce) { .gz-effect { animation: none } }
595
+
596
+ /* 旧变量名别名(迁移期保留) */
597
+ :root{--serif-zh:var(--font-serif-zh);--serif-en:var(--font-display);--sans-zh:var(--font-sans);--mono:var(--font-mono)}
598
+ /* GZ:TOKENS:END */
115
599
  /* ---------- 3. Reset & sheet ---------- */
116
600
  *,*::before,*::after { box-sizing: border-box; }
117
601
  html, body { margin: 0; padding: 0; }
@@ -210,7 +694,7 @@
210
694
  font-size: 124px;
211
695
  line-height: 1.06;
212
696
  letter-spacing: .04em;
213
- margin: 0 0 24px;
697
+ margin: 0 0 28px;
214
698
  color: var(--ink);
215
699
  }
216
700
  .h-xl {
@@ -219,7 +703,7 @@
219
703
  font-size: 88px;
220
704
  line-height: 1.10;
221
705
  letter-spacing: .03em;
222
- margin: 0 0 24px;
706
+ margin: 0 0 28px;
223
707
  color: var(--ink);
224
708
  }
225
709
  .h-md {
@@ -269,9 +753,10 @@
269
753
  text-transform: uppercase;
270
754
  color: rgba(var(--ink-rgb), .55);
271
755
  }
756
+ /* 中文不用斜体:中文字体没有斜体字形,italic 会被浏览器硬掰变形(D8) */
272
757
  .pullquote {
273
758
  font-family: var(--serif-zh);
274
- font-style: italic;
759
+ font-style: normal;
275
760
  font-weight: 500;
276
761
  font-size: 64px;
277
762
  line-height: 1.28;
@@ -573,7 +1058,7 @@
573
1058
  text-transform: uppercase;
574
1059
  color: var(--muted);
575
1060
  }
576
- .map-pin.accent .card .name { color: var(--accent); }
1061
+ .map-pin.accent .card .name { color: var(--accent-ink); }
577
1062
 
578
1063
  .map-legend {
579
1064
  position: absolute;
@@ -595,7 +1080,7 @@
595
1080
  border-left: 3px solid var(--accent);
596
1081
  padding: 18px 28px;
597
1082
  font-family: var(--serif-zh);
598
- font-style: italic;
1083
+ font-style: normal;
599
1084
  font-size: 36px;
600
1085
  line-height: 1.35;
601
1086
  color: var(--ink);
@@ -623,7 +1108,7 @@
623
1108
  .ledger-row .ledger-nb {
624
1109
  font-family: var(--mono);
625
1110
  font-size: 28px;
626
- color: var(--accent);
1111
+ color: var(--accent-ink);
627
1112
  letter-spacing: .08em;
628
1113
  }
629
1114
  .ledger-row .ledger-title {
@@ -671,14 +1156,14 @@
671
1156
  .pipeline-v .step-nb {
672
1157
  font-family: var(--mono);
673
1158
  font-size: 32px;
674
- color: var(--accent);
1159
+ color: var(--accent-ink);
675
1160
  }
676
1161
  .pipeline-v .step-title {
677
1162
  font-family: var(--serif-zh);
678
1163
  font-weight: 500;
679
1164
  font-size: 40px;
680
1165
  letter-spacing: .02em;
681
- margin: 0 0 8px;
1166
+ margin: 0 0 16px;
682
1167
  }
683
1168
  .pipeline-v .step-desc {
684
1169
  font-family: var(--serif-zh);
@@ -703,14 +1188,16 @@
703
1188
  .beforeafter .ba-block.before { opacity: .68; }
704
1189
 
705
1190
  /* ---------- 11. Pair preview frame ---------- */
1191
+ /* 宽幅 + 方形并排预览:宽度随内容(2100 + 1080 + 间距),两张顶部对齐 */
706
1192
  .pair-preview {
707
- width: 2400px;
708
- min-height: 1180px;
1193
+ align-self: flex-start;
1194
+ width: max-content;
709
1195
  background: var(--paper-2);
710
1196
  padding: 48px;
711
1197
  display: grid;
712
1198
  grid-template-columns: 2100px 1080px;
713
- grid-template-rows: 900px 1080px;
1199
+ grid-template-rows: auto;
1200
+ align-items: start;
714
1201
  gap: 48px;
715
1202
  align-content: center;
716
1203
  justify-content: center;
@@ -805,34 +1292,375 @@
805
1292
 
806
1293
  </main>
807
1294
 
808
- <!-- Magazine WebGL background (deterministic ink-flow) -->
809
- <script src="assets/magazine-bg-webgl.js"></script>
1295
+ <!-- 背景特效:墨流等高线(gz-effects inkflow),定格在 12.5s,每次渲染结果一致。
1296
+ 每张卡片里的 <canvas class="mag-bg"> 自动挂载;data-strength 可单张覆盖(默认 .32,封面 / 金句页可到 .62),
1297
+ data-frozen 可换定格时刻。颜色读当前主题的 --ink / --paper / --accent。 -->
810
1298
  <script>
811
- (function () {
812
- function cssVarRgb(name, fallback) {
813
- var raw = getComputedStyle(document.documentElement).getPropertyValue(name).trim();
814
- if (!raw) return fallback;
815
- var parts = raw.split(',').map(function (x) { return parseInt(x.trim(), 10); });
816
- return parts.length === 3 && parts.every(function (n) { return !isNaN(n); }) ? parts : fallback;
1299
+ /* GZ:EFFECTS:START · guizang-design 特效运行时,不要手改;运行 scripts/sync-skill.mjs 更新 */
1300
+ /* 歸藏设计系统 · 特效运行时(无依赖,可直接内联进单文件 HTML)
1301
+ *
1302
+ * 用法:<canvas class="gz-effect" data-gz-effect="vortex" data-strength=".3" data-frozen="12.5"></canvas>
1303
+ * 页面加载后自动挂载;也可以 GZEffects.mount(canvas, { effect, strength, frozen, colors })。
1304
+ *
1305
+ * 特效:
1306
+ * dispersion 全息色散(PPT 杂志风深色页)
1307
+ * vortex 银色涡流(PPT 杂志风浅色页)
1308
+ * grid 漂移网格 + 点阵(PPT 瑞士风)
1309
+ * inkflow 墨流等高线(图文卡片杂志风,带透明度,叠在纸色上)
1310
+ * ascii ASCII 呼吸场(瑞士风封面 / 封底的强调色块)
1311
+ *
1312
+ * 统一行为:
1313
+ * - 一个 requestAnimationFrame 循环驱动全部特效,不在视口里的不画
1314
+ * - 动效开关:localStorage gz-motion、系统「减少动态效果」、<html data-motion="off">;
1315
+ * 关闭时停在一帧静态画面,不留空白。兼容旧事件 ppt-low-power-change / swiss-low-power-change
1316
+ * - data-frozen 把时间定格:卡片出 PNG 时每次渲染结果一致。GZEffects.ready 在首帧画完后 resolve
1317
+ * - 颜色从 canvas 所在位置的 token 读(--ink-rgb / --paper-rgb / --accent-rgb / --accent-on-rgb),
1318
+ * 放进反色块或切换 data-theme 时自动跟随
1319
+ *
1320
+ * 性能(弱机器也要流畅):
1321
+ * - 渲染分辨率按特效分档(data-scale 可覆盖):背景压在遮罩和模糊下,色散 / 涡流用 0.5 倍 CSS 像素,
1322
+ * Retina 屏上像素量只有全分辨率的 1/16;网格有细线用 1 倍;定格出图时用全分辨率
1323
+ * - WebGL 特效限 30fps(data-fps 可覆盖),ASCII 24fps;不在视口、透明度为 0 的画布不画
1324
+ * - 申请低功耗 GPU;持续掉到 25fps 以下时自动降分辨率,降到底仍卡就切成静态画面
1325
+ */
1326
+ (function () {
1327
+ 'use strict'
1328
+ if (window.GZEffects) return
1329
+
1330
+ var VS = 'attribute vec2 p;void main(){gl_Position=vec4(p,0.,1.);}'
1331
+ var HEAD = 'precision highp float;uniform vec2 R;uniform float T;uniform vec2 M;uniform vec3 INK;uniform vec3 PAPER;uniform vec3 ACC;uniform float S;uniform float DARK;'
1332
+ var NOISE =
1333
+ 'float hash(vec2 p){return fract(sin(dot(p,vec2(127.1,311.7)))*43758.5453);}' +
1334
+ 'float noise(vec2 p){vec2 i=floor(p),f=fract(p);vec2 u=f*f*(3.-2.*f);' +
1335
+ 'return mix(mix(hash(i),hash(i+vec2(1,0)),u.x),mix(hash(i+vec2(0,1)),hash(i+vec2(1,1)),u.x),u.y);}'
1336
+
1337
+ // 各特效的默认渲染倍率(相对 CSS 像素):柔和的背景低分辨率看不出差别,细线和文字需要更高
1338
+ var SCALE = { dispersion: 0.5, vortex: 0.5, inkflow: 0.75, grid: 1, ascii: 1 }
1339
+ var FPS = { dispersion: 30, vortex: 30, inkflow: 30, grid: 30 }
1340
+
1341
+ var SHADERS = {
1342
+ // 原 PPT template.html FS_DARK,颜色是设计时定死的钛金暗色(themes.md 注明不跟主题)
1343
+ dispersion: HEAD +
1344
+ 'vec3 pal(float t,vec3 a,vec3 b,vec3 c,vec3 d){return a+b*cos(6.28318*(c*t+d));}' +
1345
+ 'void main(){vec2 uv=gl_FragCoord.xy/R;vec2 p=uv*2.-1.;p.x*=R.x/R.y;vec2 m=M*2.-1.;m.x*=R.x/R.y;' +
1346
+ 'float md=length(p-m);p+=sin(md*15.-T*4.)*exp(-md*3.)*.08;vec2 p0=p;' +
1347
+ 'for(float i=1.;i<4.;i++){p.x+=.1/i*sin(i*3.*p.y+T*.4)+.05;p.y+=.1/i*cos(i*2.*p.x+T*.3)-.05;}' +
1348
+ 'float r=length(p);float ang=atan(p.y,p.x);' +
1349
+ 'vec3 col=pal(r*1.5+p0.x*.5+T*.1,vec3(.12,.12,.13),vec3(.03,.04,.05),vec3(1.),vec3(.1,.2,.4));' +
1350
+ 'float disp=sin(r*25.-T*1.5+ang*2.)*.5+.5;col+=vec3(disp*.015,disp*.01,disp*.02);' +
1351
+ 'col+=pow(sin(p.x*4.+p.y*3.+T)*.5+.5,8.)*.08;col=mix(vec3(.05,.05,.06),col,.85);gl_FragColor=vec4(col,1.);}',
1352
+
1353
+ // 原 FS_LIGHT。colors:"theme" 时用主题纸色替换银白,深浅关系不变
1354
+ vortex: HEAD + NOISE +
1355
+ 'float fbm(vec2 p){float v=0.,a=.5;mat2 m=mat2(.8,.6,-.6,.8);for(int i=0;i<5;i++){v+=a*noise(p);p=m*p*2.02;a*=.5;}return v;}' +
1356
+ 'uniform float THEME;' +
1357
+ 'void main(){vec2 uv=gl_FragCoord.xy/R;vec2 p=uv;p.x*=R.x/R.y;vec2 m=M;m.x*=R.x/R.y;vec2 md=p-m;float dl=length(md);' +
1358
+ 'p+=normalize(md+vec2(.0001))*exp(-dl*5.)*.03;' +
1359
+ 'vec2 q=vec2(fbm(p*1.8+T*.07),fbm(p*1.8+vec2(5.2,1.3)+T*.06));' +
1360
+ 'vec2 r=vec2(fbm(p*2.+q*1.3+vec2(1.7,9.2)+T*.05),fbm(p*2.+q*1.3+vec2(8.3,2.8)+T*.04));' +
1361
+ 'float f=fbm(p*2.2+r*1.5);' +
1362
+ 'vec3 hi=mix(vec3(.955,.945,.925),PAPER,THEME);vec3 lo=mix(vec3(.86,.85,.84),mix(PAPER,INK,.1),THEME);' +
1363
+ 'vec3 col=mix(lo,hi,f);float ph=r.x*2.2+T*.35;' +
1364
+ 'col+=vec3(.78,.62,.92)*sin(ph)*.055;col+=vec3(.55,.72,.95)*sin(ph*.8+2.)*.05;col+=smoothstep(.48,.92,f)*.06;' +
1365
+ 'gl_FragColor=vec4(col,1.);}',
1366
+
1367
+ // 原 PPT template-swiss.html 网格背景
1368
+ grid: HEAD +
1369
+ 'float gl(vec2 uv,float s,float t){vec2 g=abs(fract(uv/s)-.5);float d=min(g.x,g.y);return 1.-smoothstep(t-.005,t+.005,d);}' +
1370
+ 'void main(){vec2 uv=gl_FragCoord.xy/R;float a=R.x/R.y;vec2 p=uv;p.x*=a;vec2 gp=p+vec2(T*.008,T*.005);' +
1371
+ 'float g=gl(gp,.12,.012)+gl(gp,.024,.04)*.2;vec2 m=M;m.x*=a;float mi=exp(-length(p-m)*4.)*.5;' +
1372
+ 'vec2 dg=fract(gp*50.)-.5;float dm=1.-smoothstep(.05,.14,length(dg));' +
1373
+ 'dm*=smoothstep(-.3,.6,sin(gp.x*1.4+T*.15)*cos(gp.y*1.6-T*.12))*.6;' +
1374
+ 'vec3 line=mix(vec3(.08),vec3(.92),DARK);vec3 bg=PAPER;' +
1375
+ 'vec3 col=mix(bg,line,g*(.45+mi)*.55);col=mix(col,line,dm*.35);col=mix(col,ACC,mi*.18);gl_FragColor=vec4(col,1.);}',
1376
+
1377
+ // 原卡片 magazine-bg-webgl.js:输出带透明度,叠在纸色上
1378
+ inkflow: HEAD + NOISE +
1379
+ 'float fbm(vec2 p){float v=0.,a=.5;mat2 m=mat2(1.6,1.2,-1.2,1.6);for(int i=0;i<5;i++){v+=a*noise(p);p=m*p*1.18;a*=.52;}return v;}' +
1380
+ 'void main(){vec2 p=(gl_FragCoord.xy-.5*R)/min(R.x,R.y);float t=T*.045;' +
1381
+ 'float n=fbm(p*2.2+vec2(t,-t*.7));float n2=fbm(p*5.4-vec2(t*1.7,t));' +
1382
+ 'float contour=smoothstep(.015,0.,abs(fract((n+n2*.35)*7.)-.5));float wash=smoothstep(.22,.88,n);' +
1383
+ 'float vig=1.-smoothstep(.28,.92,length(p));vec3 col=mix(PAPER,INK,wash*.42+contour*.18);' +
1384
+ 'col=mix(col,ACC,(.18+.25*n2)*contour);float al=S*(.18+wash*.42+contour*.3)*(.55+.45*vig);' +
1385
+ 'gl_FragColor=vec4(col*al,al);}',
1386
+ }
1387
+
1388
+ // ---------- 动效开关 ----------
1389
+ var KEY = 'gz-motion'
1390
+ function storedMotion() { try { return localStorage.getItem(KEY) } catch (e) { return null } }
1391
+ function computeMotion() {
1392
+ if (document.documentElement.getAttribute('data-motion') === 'off') return false
1393
+ var s = storedMotion()
1394
+ if (s === 'off') return false
1395
+ if (s === 'on') return true
1396
+ return !(window.matchMedia && matchMedia('(prefers-reduced-motion: reduce)').matches)
1397
+ }
1398
+ var motion = computeMotion()
1399
+
1400
+ // ---------- 颜色 ----------
1401
+ function rgbVar(cs, name, fb) {
1402
+ var v = cs.getPropertyValue(name).trim()
1403
+ if (!v) return fb
1404
+ var n = v.split(',').map(Number)
1405
+ return n.length === 3 && n.every(isFinite) ? n.map(function (x) { return x / 255 }) : fb
1406
+ }
1407
+ function readColors(el) {
1408
+ var cs = getComputedStyle(el)
1409
+ var paper = rgbVar(cs, '--paper-rgb', [0.97, 0.97, 0.96])
1410
+ return {
1411
+ ink: rgbVar(cs, '--ink-rgb', [0.04, 0.04, 0.04]),
1412
+ paper: paper,
1413
+ accent: rgbVar(cs, '--accent-rgb', [0, 0.18, 0.65]),
1414
+ accentOn: rgbVar(cs, '--accent-on-rgb', [1, 1, 1]),
1415
+ dark: 0.2126 * paper[0] + 0.7152 * paper[1] + 0.0722 * paper[2] < 0.5 ? 1 : 0,
1416
+ mono: (cs.getPropertyValue('--font-mono') || 'ui-monospace,monospace').trim(),
1417
+ }
1418
+ }
1419
+
1420
+ var mouse = [0.5, 0.5]
1421
+ addEventListener('mousemove', function (e) { mouse = [e.clientX / innerWidth, 1 - e.clientY / innerHeight] }, { passive: true })
1422
+
1423
+ // ---------- WebGL 特效 ----------
1424
+ function glEffect(canvas, o) {
1425
+ var gl = canvas.getContext('webgl', { alpha: o.effect === 'inkflow', premultipliedAlpha: true, antialias: false, powerPreference: 'low-power', preserveDrawingBuffer: o.frozen != null })
1426
+ if (!gl) return null
1427
+ function sh(t, s) {
1428
+ var x = gl.createShader(t); gl.shaderSource(x, s); gl.compileShader(x)
1429
+ if (!gl.getShaderParameter(x, gl.COMPILE_STATUS)) throw new Error('gz-effects ' + o.effect + ': ' + gl.getShaderInfoLog(x))
1430
+ return x
1431
+ }
1432
+ var prog = gl.createProgram()
1433
+ gl.attachShader(prog, sh(gl.VERTEX_SHADER, VS))
1434
+ gl.attachShader(prog, sh(gl.FRAGMENT_SHADER, SHADERS[o.effect]))
1435
+ gl.linkProgram(prog); gl.useProgram(prog)
1436
+ gl.bindBuffer(gl.ARRAY_BUFFER, gl.createBuffer())
1437
+ gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([-1, -1, 1, -1, -1, 1, -1, 1, 1, -1, 1, 1]), gl.STATIC_DRAW)
1438
+ var loc = gl.getAttribLocation(prog, 'p'); gl.enableVertexAttribArray(loc); gl.vertexAttribPointer(loc, 2, gl.FLOAT, false, 0, 0)
1439
+ var U = {}
1440
+ ;['R', 'T', 'M', 'INK', 'PAPER', 'ACC', 'S', 'DARK', 'THEME'].forEach(function (n) { U[n] = gl.getUniformLocation(prog, n) })
1441
+ return function (t, c) {
1442
+ gl.viewport(0, 0, canvas.width, canvas.height)
1443
+ gl.clearColor(0, 0, 0, 0); gl.clear(gl.COLOR_BUFFER_BIT)
1444
+ gl.uniform2f(U.R, canvas.width, canvas.height); gl.uniform1f(U.T, t); gl.uniform2f(U.M, mouse[0], mouse[1])
1445
+ gl.uniform3fv(U.INK, c.ink); gl.uniform3fv(U.PAPER, c.paper); gl.uniform3fv(U.ACC, c.accent)
1446
+ gl.uniform1f(U.S, o.strength); gl.uniform1f(U.DARK, o.dark != null ? +o.dark : c.dark)
1447
+ if (U.THEME) gl.uniform1f(U.THEME, o.colors === 'theme' ? 1 : 0)
1448
+ gl.drawArrays(gl.TRIANGLES, 0, 6)
1449
+ }
1450
+ }
1451
+
1452
+ // ---------- ASCII 呼吸场(Canvas 2D) ----------
1453
+ var PALETTE = ' ...:::---+++***◦◦••▢▣'
1454
+ function asciiEffect(canvas) {
1455
+ var ctx = canvas.getContext('2d')
1456
+ var cell = 16, atlas = null, atlasKey = ''
1457
+ // 字形图集:每个字符只排一次版,之后每帧按格子 drawImage,比逐格 fillText 快一个数量级
1458
+ function buildAtlas(font, rgb, dpr) {
1459
+ var key = font + rgb + dpr
1460
+ if (key === atlasKey) return
1461
+ atlas = document.createElement('canvas')
1462
+ atlas.width = Math.ceil(PALETTE.length * cell * dpr); atlas.height = Math.ceil(cell * dpr)
1463
+ var a = atlas.getContext('2d')
1464
+ a.setTransform(dpr, 0, 0, dpr, 0, 0)
1465
+ a.font = font; a.textBaseline = 'top'; a.fillStyle = 'rgb(' + rgb + ')'
1466
+ for (var i = 0; i < PALETTE.length; i++) if (PALETTE[i] !== ' ') a.fillText(PALETTE[i], i * cell, 0)
1467
+ atlasKey = key
1468
+ }
1469
+ var draw = function (t, c, w, h, dpr) {
1470
+ ctx.setTransform(1, 0, 0, 1, 0, 0)
1471
+ ctx.clearRect(0, 0, canvas.width, canvas.height)
1472
+ var rgb = c.accentOn.map(function (x) { return Math.round(x * 255) }).join(',')
1473
+ buildAtlas('500 13px ' + c.mono, rgb, dpr)
1474
+ // 字色取 accent-on:IKB / 橙上是白字,黄 / 绿上是墨色字(修复原来只画白字的问题)
1475
+ var blend = c.accentOn[0] + c.accentOn[1] + c.accentOn[2] > 1.5 ? 'screen' : 'multiply'
1476
+ if (canvas.style.mixBlendMode !== blend) canvas.style.mixBlendMode = blend
1477
+ var cols = Math.ceil(w / cell), rows = Math.ceil(h / cell), tt = t * 0.55, sz = cell * dpr
1478
+ for (var r = 0; r < rows; r++) for (var k = 0; k < cols; k++) {
1479
+ var n = (Math.sin(k * 0.18 + tt) + Math.sin(r * 0.24 - tt * 0.7) + Math.sin((k + r) * 0.12 + tt * 0.45) +
1480
+ Math.sin(Math.hypot(k - cols * 0.5, r - rows * 0.5) * 0.16 - tt * 0.55)) / 4
1481
+ var v = (n + 1) / 2
1482
+ if (v < 0.22) continue
1483
+ var idx = Math.min(PALETTE.length - 1, Math.floor(v * PALETTE.length))
1484
+ if (PALETTE[idx] === ' ') continue
1485
+ ctx.globalAlpha = 0.08 + (v - 0.22) * 0.55
1486
+ ctx.drawImage(atlas, idx * sz, 0, sz, sz, k * sz, r * sz, sz, sz)
817
1487
  }
818
- function mountAll() {
819
- if (!window.MagazineBg || !window.MagazineBg.mount) return;
820
- var ink = cssVarRgb('--ink-rgb', [10, 10, 11]);
821
- var paper = cssVarRgb('--paper-rgb', [243, 240, 232]);
822
- var accent = cssVarRgb('--accent-rgb', [17, 17, 17]);
823
- document.querySelectorAll('canvas.mag-bg').forEach(function (c) {
824
- window.MagazineBg.mount(c, {
825
- ink: ink,
826
- paper: paper,
827
- accent: accent,
828
- strength: 0.32,
829
- frozenTime: 12.5
830
- });
831
- });
1488
+ ctx.globalAlpha = 1
1489
+ }
1490
+ // 呼吸场变化很慢,24 帧和 60 帧肉眼无差别;逐字绘制在 CPU 上开销大,限帧省电
1491
+ draw.interval = 1000 / 24
1492
+ return draw
1493
+ }
1494
+
1495
+ // WebGL 不可用时:几层径向渐变,模拟墨色晕染(不画椭圆,遵守卡片「不用椭圆」规则)。深色背景特效用墨色打底
1496
+ function fallback2d(canvas, o) {
1497
+ var ctx = canvas.getContext('2d')
1498
+ return function (t, c, w, h, dpr) {
1499
+ ctx.setTransform(dpr, 0, 0, dpr, 0, 0)
1500
+ ctx.fillStyle = 'rgb(' + (o.effect === 'dispersion' ? c.ink : c.paper).map(function (x) { return Math.round(x * 255) }).join(',') + ')'
1501
+ ctx.fillRect(0, 0, w, h)
1502
+ for (var i = 0; i < 5; i++) {
1503
+ var x = w * (0.14 + ((i * 0.19 + 0.17) % 0.72)), y = h * (0.1 + ((i * 0.29 + 0.23) % 0.78)), r = Math.max(w, h) * (0.22 + i * 0.045)
1504
+ var g = ctx.createRadialGradient(x, y, 0, x, y, r)
1505
+ var col = (i % 2 ? c.accent : c.ink).map(function (v) { return Math.round(v * 255) }).join(',')
1506
+ g.addColorStop(0, 'rgba(' + col + ',' + (i % 2 ? 0.1 : 0.12) + ')'); g.addColorStop(1, 'rgba(' + col + ',0)')
1507
+ ctx.fillStyle = g; ctx.fillRect(0, 0, w, h)
832
1508
  }
833
- if (document.readyState === 'complete') mountAll();
834
- else window.addEventListener('load', mountAll);
835
- })();
1509
+ }
1510
+ }
1511
+
1512
+ // ---------- 挂载与循环 ----------
1513
+ // 自动降级的状态(见 governor):各级渲染倍率与当前级别
1514
+ var ADAPT = [1, 0.7, 0.5]
1515
+ var perf = { start: 0, frames: 0, level: 0, settleUntil: 0 }
1516
+ var items = []
1517
+ var STATIC_T = 12.5 // 动效关闭时的静态帧时刻
1518
+ var readyResolve
1519
+ var ready = new Promise(function (r) { readyResolve = r })
1520
+ var pendingFirst = 0
1521
+
1522
+ function size(it) {
1523
+ var rect = it.canvas.getBoundingClientRect()
1524
+ var device = Math.min(window.devicePixelRatio || 1, 2)
1525
+ // 定格出图用全分辨率;实时播放按特效倍率 × 自适应降级系数
1526
+ var dpr = it.o.frozen != null || it.o.scale == null ? device : Math.max(0.2, it.o.scale * it.adapt)
1527
+ var w = Math.max(1, Math.round(rect.width)), h = Math.max(1, Math.round(rect.height))
1528
+ if (it.w !== w || it.h !== h || it.dpr !== dpr) {
1529
+ it.w = w; it.h = h; it.dpr = dpr
1530
+ it.canvas.width = Math.round(w * dpr); it.canvas.height = Math.round(h * dpr)
1531
+ it.dirty = true
1532
+ }
1533
+ }
1534
+
1535
+ function drawOne(it, now) {
1536
+ size(it)
1537
+ if (!it.colors || it.colorsStale) { it.colors = readColors(it.canvas); it.colorsStale = false }
1538
+ var t = it.o.frozen != null ? it.o.frozen : motion ? (now - it.t0) / 1000 : STATIC_T
1539
+ it.draw(t, it.colors, it.w, it.h, it.dpr)
1540
+ it.dirty = false
1541
+ if (!it.drawn) { it.drawn = true; if (--pendingFirst === 0) readyResolve() }
1542
+ }
1543
+
1544
+ function mount(canvas, opts) {
1545
+ if (typeof canvas === 'string') canvas = document.querySelector(canvas)
1546
+ if (!canvas || canvas.__gz) return canvas && canvas.__gz
1547
+ var d = canvas.dataset
1548
+ var o = Object.assign({
1549
+ effect: d.gzEffect || 'vortex',
1550
+ strength: d.strength != null ? +d.strength : 0.34,
1551
+ frozen: d.frozen != null ? +d.frozen : null,
1552
+ colors: d.colors || 'fixed',
1553
+ dark: d.dark != null ? d.dark === 'true' || d.dark === '1' : null,
1554
+ }, opts || {})
1555
+ var eff = o.effect
1556
+ if (o.scale == null) o.scale = d.scale != null ? +d.scale : SCALE[eff]
1557
+ var fps = d.fps != null ? +d.fps : FPS[eff]
1558
+ var draw = eff === 'ascii' ? asciiEffect(canvas) : SHADERS[eff] ? glEffect(canvas, o) : null
1559
+ if (!draw && eff !== 'ascii') draw = fallback2d(canvas, o)
1560
+ var it = { canvas: canvas, o: o, draw: draw, t0: performance.now(), visible: true, last: 0, adapt: 1,
1561
+ interval: (draw && draw.interval) || (fps ? 1000 / fps : 0) }
1562
+ canvas.__gz = it
1563
+ items.push(it)
1564
+ pendingFirst++
1565
+ if ('IntersectionObserver' in window) {
1566
+ // 只贴着视口边缘(面积为 0)不算可见:幻灯片左右相邻页正好贴边,isIntersecting 会误报为 true
1567
+ new IntersectionObserver(function (es) { es.forEach(function (e) { it.visible = e.isIntersecting && e.intersectionRatio > 0 }) }, { threshold: [0, 0.01] }).observe(canvas)
1568
+ }
1569
+ // 刚挂载时字体加载、着色器编译都会卡一下,先观察 1.5 秒再开始判断是否降级
1570
+ perf.settleUntil = Math.max(perf.settleUntil, performance.now() + 1500)
1571
+ drawOne(it, performance.now())
1572
+ schedule()
1573
+ return it
1574
+ }
1575
+
1576
+ // 透明度为 0 的画布(杂志风深浅两张背景交叉淡入时,看不见的那张)不画
1577
+ function shown(c) {
1578
+ if (c.checkVisibility) return c.checkVisibility({ opacityProperty: true, visibilityProperty: true })
1579
+ return getComputedStyle(c).opacity !== '0'
1580
+ }
1581
+
1582
+ // 自动降级:每 2 秒看一次页面帧率,持续低于 25 就降渲染倍率;降到底仍卡,切成静态画面
1583
+ function governor(now, animating) {
1584
+ if (!animating || document.hidden) { perf.start = 0; return }
1585
+ if (now < perf.settleUntil) return
1586
+ if (!perf.start) { perf.start = now; perf.frames = 0; return }
1587
+ perf.frames++
1588
+ var span = now - perf.start
1589
+ if (span < 2000) return
1590
+ var fps = (perf.frames * 1000) / span
1591
+ perf.start = 0
1592
+ if (fps >= 25) return
1593
+ perf.level++
1594
+ if (perf.level < ADAPT.length) {
1595
+ items.forEach(function (it) { it.adapt = ADAPT[perf.level]; it.dirty = true })
1596
+ perf.settleUntil = now + 1000
1597
+ } else {
1598
+ if (window.console) console.info('[gz-effects] 帧率持续偏低(' + fps.toFixed(0) + 'fps),背景已切换为静态画面')
1599
+ setMotion(false, false)
1600
+ }
1601
+ }
1602
+
1603
+ var raf = 0
1604
+ function schedule() { if (!raf) raf = requestAnimationFrame(loop) }
1605
+ function loop(now) {
1606
+ raf = 0
1607
+ var again = false
1608
+ for (var i = 0; i < items.length; i++) {
1609
+ var it = items[i]
1610
+ var live = motion && it.o.frozen == null
1611
+ var due = now - it.last >= it.interval
1612
+ if ((live && it.visible && due && shown(it.canvas)) || it.dirty || it.colorsStale) { drawOne(it, now); it.last = now }
1613
+ if (live) again = true
1614
+ }
1615
+ governor(now, again)
1616
+ if (again) schedule()
1617
+ }
1618
+
1619
+ function setMotion(on, persist) {
1620
+ motion = !!on
1621
+ if (persist !== false) try { localStorage.setItem(KEY, on ? 'on' : 'off') } catch (e) {}
1622
+ items.forEach(function (it) { it.dirty = true; if (on) it.t0 = performance.now() - STATIC_T * 1000 })
1623
+ schedule()
1624
+ dispatchEvent(new CustomEvent('gz-motion-change', { detail: { on: motion } }))
1625
+ }
1626
+
1627
+ // 旧模板的低功耗事件:迁移期间继续认
1628
+ ;['ppt-low-power-change', 'swiss-low-power-change'].forEach(function (n) {
1629
+ addEventListener(n, function (e) { if (e.detail && 'on' in e.detail) setMotion(!e.detail.on, false) })
1630
+ })
1631
+ if (window.matchMedia) {
1632
+ var mq = matchMedia('(prefers-reduced-motion: reduce)')
1633
+ mq.addEventListener && mq.addEventListener('change', function () { if (!storedMotion()) setMotion(computeMotion(), false) })
1634
+ }
1635
+ // 主题、反色块切换:标记颜色过期,下一帧重读
1636
+ new MutationObserver(function () {
1637
+ if (computeMotion() !== motion && document.documentElement.getAttribute('data-motion') === 'off') setMotion(false, false)
1638
+ items.forEach(function (it) { it.colorsStale = true }); schedule()
1639
+ }).observe(document.documentElement, { attributes: true, subtree: true, attributeFilter: ['data-theme', 'data-surface', 'data-motion', 'class'] })
1640
+ addEventListener('resize', function () { items.forEach(function (it) { it.dirty = true }); perf.settleUntil = performance.now() + 1000; schedule() }, { passive: true })
1641
+
1642
+ function autoMount() {
1643
+ var list = document.querySelectorAll('canvas[data-gz-effect]')
1644
+ for (var i = 0; i < list.length; i++) mount(list[i])
1645
+ if (!list.length) readyResolve()
1646
+ }
1647
+ if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', autoMount)
1648
+ else autoMount()
1649
+
1650
+ window.GZEffects = {
1651
+ mount: mount, ready: ready, setMotion: setMotion,
1652
+ get motion() { return motion },
1653
+ effects: Object.keys(SHADERS).concat('ascii'),
1654
+ }
1655
+ })()
1656
+ /* GZ:EFFECTS:END */
1657
+ </script>
1658
+ <script>
1659
+ document.querySelectorAll('canvas.mag-bg').forEach(function (c) {
1660
+ c.dataset.gzEffect = 'inkflow'
1661
+ if (c.dataset.frozen == null) c.dataset.frozen = '12.5'
1662
+ if (c.dataset.strength == null) c.dataset.strength = '.32'
1663
+ })
836
1664
  </script>
837
1665
  </body>
838
1666
  </html>