@chengzhao-dev/dsh-quarto-book 0.4.3 → 0.6.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 (86) hide show
  1. package/README.en.md +3 -3
  2. package/README.md +3 -3
  3. package/lib/tools/render-check.js +5 -2
  4. package/package.json +5 -2
  5. package/skills/designing-theme/SKILL.md +3 -2
  6. package/skills/designing-theme/assets/theme/css/base.css +216 -55
  7. package/skills/designing-theme/assets/theme/css/callouts.css +32 -23
  8. package/skills/designing-theme/assets/theme/css/code.css +84 -2
  9. package/skills/designing-theme/assets/theme/css/content.css +152 -36
  10. package/skills/designing-theme/assets/theme/css/landing.css +175 -54
  11. package/skills/designing-theme/assets/theme/css/nav.css +462 -35
  12. package/skills/designing-theme/assets/theme/css/sidebar.css +76 -31
  13. package/skills/designing-theme/assets/theme/css/tokens.css +34 -16
  14. package/skills/designing-theme/assets/theme/includes/fonts.html +1 -1
  15. package/skills/designing-theme/assets/theme/includes/footer.html +16 -7
  16. package/skills/designing-theme/assets/theme/includes/palette.html +420 -0
  17. package/skills/designing-theme/assets/theme/palettes/flexoki/brand-mark.svg +3 -0
  18. package/skills/designing-theme/assets/theme/palettes/flexoki/favicon-dark.svg +5 -0
  19. package/skills/designing-theme/assets/theme/palettes/flexoki/favicon-light.svg +5 -0
  20. package/skills/designing-theme/assets/theme/palettes/flexoki/highlight-dark.theme +214 -0
  21. package/skills/designing-theme/assets/theme/palettes/flexoki/highlight-light.theme +214 -0
  22. package/skills/designing-theme/assets/theme/palettes/flexoki/meta.md +53 -0
  23. package/skills/designing-theme/assets/theme/palettes/flexoki/theme-dark.scss +43 -0
  24. package/skills/designing-theme/assets/theme/palettes/flexoki/theme-light.scss +40 -0
  25. package/skills/designing-theme/assets/theme/palettes/flexoki/tokens.css +156 -0
  26. package/skills/designing-theme/assets/theme/palettes/hill-light/brand-mark.svg +3 -0
  27. package/skills/designing-theme/assets/theme/palettes/hill-light/favicon-dark.svg +5 -0
  28. package/skills/designing-theme/assets/theme/palettes/hill-light/favicon-light.svg +5 -0
  29. package/skills/designing-theme/assets/theme/palettes/hill-light/meta.md +78 -0
  30. package/skills/designing-theme/assets/theme/palettes/hill-light/syntax.css +150 -0
  31. package/skills/designing-theme/assets/theme/palettes/hill-light/tokens.css +322 -0
  32. package/skills/designing-theme/assets/theme/palettes/solarized/brand-mark.svg +3 -0
  33. package/skills/designing-theme/assets/theme/palettes/solarized/favicon-dark.svg +5 -0
  34. package/skills/designing-theme/assets/theme/palettes/solarized/favicon-light.svg +5 -0
  35. package/skills/designing-theme/assets/theme/palettes/solarized/highlight-dark.theme +214 -0
  36. package/skills/designing-theme/assets/theme/palettes/solarized/highlight-light.theme +214 -0
  37. package/skills/designing-theme/assets/theme/palettes/solarized/meta.md +66 -0
  38. package/skills/designing-theme/assets/theme/palettes/solarized/syntax.css +67 -0
  39. package/skills/designing-theme/assets/theme/palettes/solarized/theme-dark.scss +43 -0
  40. package/skills/designing-theme/assets/theme/palettes/solarized/theme-light.scss +41 -0
  41. package/skills/designing-theme/assets/theme/palettes/solarized/tokens.css +154 -0
  42. package/skills/designing-theme/knowledge/reading-surface.md +27 -15
  43. package/skills/designing-theme/references/theme-spine.md +2 -2
  44. package/skills/designing-theme/references/theme-system.md +82 -36
  45. package/skills/designing-theme/scripts/checking-layout.py +306 -48
  46. package/skills/designing-theme/scripts/measuring-pages.mjs +40 -3
  47. package/skills/writing-quarto/examples/01-language-scope.md +3 -3
  48. package/skills/writing-quarto/examples/02-structure-shape.md +5 -5
  49. package/skills/writing-quarto/examples/03-block-after.md +2 -2
  50. package/skills/writing-quarto/examples/03-excerpt-lead.md +6 -6
  51. package/skills/writing-quarto/examples/03-layout-list.md +15 -15
  52. package/skills/writing-quarto/examples/03-qmd-elements.md +4 -4
  53. package/skills/writing-quarto/examples/04-paragraph-cases.md +5 -5
  54. package/skills/writing-quarto/examples/04-paragraph-opening.md +3 -3
  55. package/skills/writing-quarto/examples/05-sentence-brevity.md +5 -5
  56. package/skills/writing-quarto/examples/05-sentence-frame.md +6 -6
  57. package/skills/writing-quarto/examples/05-sentence-reference.md +5 -5
  58. package/skills/writing-quarto/examples/06-wording-cases.md +8 -8
  59. package/skills/writing-quarto/examples/08-appendix.md +4 -4
  60. package/skills/writing-quarto/quarto/basics.md +24 -2
  61. package/skills/writing-quarto/quarto/comments.md +43 -0
  62. package/skills/writing-quarto/quarto/coords.md +4 -4
  63. package/skills/writing-quarto/quarto/encoding.md +35 -0
  64. package/skills/writing-quarto/quarto/mermaid.md +1 -1
  65. package/skills/writing-quarto/quarto/prose.md +86 -0
  66. package/skills/writing-quarto/quarto/render.md +17 -16
  67. package/skills/writing-quarto/quarto/terminal.md +3 -3
  68. package/skills/writing-quarto/scripts/checking-dom.py +20 -8
  69. package/skills/writing-quarto/scripts/verifying-content.py +12 -3
  70. package/skills/writing-quarto/steps/01-task.md +6 -6
  71. package/skills/writing-quarto/steps/02-structure.md +19 -19
  72. package/skills/writing-quarto/steps/03-blocks.md +40 -40
  73. package/skills/writing-quarto/steps/04-paragraphs.md +55 -55
  74. package/skills/writing-quarto/steps/05-sentences.md +42 -43
  75. package/skills/writing-quarto/steps/06-wording.md +9 -11
  76. package/skills/writing-quarto/steps/07-layout.md +21 -17
  77. package/skills/writing-quarto/steps/08-reread.md +9 -13
  78. package/templates/quarto-book-project/SKILL.md +1 -1
  79. package/skills/designing-theme/assets/theme/assets/brand-mark.svg +0 -4
  80. package/skills/designing-theme/assets/theme/assets/favicon.svg +0 -9
  81. package/skills/designing-theme/assets/theme/palettes/github/highlight-dark.theme +0 -213
  82. package/skills/designing-theme/assets/theme/palettes/github/highlight-light.theme +0 -213
  83. package/skills/designing-theme/assets/theme/palettes/github/meta.md +0 -38
  84. package/skills/designing-theme/assets/theme/palettes/github/theme-dark.scss +0 -35
  85. package/skills/designing-theme/assets/theme/palettes/github/theme-light.scss +0 -34
  86. package/skills/designing-theme/assets/theme/palettes/github/tokens.css +0 -160
@@ -1,31 +1,34 @@
1
- /* dsh-quarto-book Quarto 主题 · 提示卡片 callout(左色条 + 浅底 + 小圆角)
1
+ /* dsh-quarto-book Quarto 主题 · 编辑注 callout(2px 色条 + 无底色 + 无圆角)
2
2
  *
3
+ * 书籍阅读方向:callout 不是「卡片」,而是正文外侧的编辑注。
4
+ * 类型只在左色条和图标上出现,标题回到正文色,避免 GitHub admonition 的彩色小卡观感。
3
5
  * 下面的 border: none 简写会把 border-left-color 重置为 currentColor,
4
6
  * Bootstrap 的 div.callout-<type>.callout 又是 (0,2,1),因此类型规则必须写成
5
- * div.callout.callout-<type> 才能特异性相同、靠加载顺序胜出,让左条按类型着色。 */
7
+ * div.callout.callout-<type> 才能特异性相同、靠加载顺序胜出。 */
6
8
 
7
9
  div.callout.callout-style-default,
8
10
  div.callout.callout-style-simple {
9
11
  border: none;
10
- border-left-width: 3px;
12
+ border-left-width: 2px;
11
13
  border-left-style: solid;
12
- border-radius: var(--radius-sm);
14
+ border-radius: 0;
13
15
  margin: 0;
14
- padding: 1rem;
16
+ padding: 0.1rem 0 0.1rem 1.1rem;
15
17
  overflow-wrap: break-word;
16
18
  display: block;
19
+ background-color: transparent;
17
20
  }
18
21
 
19
22
  div.callout.callout-style-default > .callout-header,
20
23
  div.callout.callout-style-simple > .callout-header {
21
- margin: 0 0 0.5rem;
24
+ margin: 0 0 0.35rem;
22
25
  padding: 0;
23
26
  background-color: transparent;
24
27
  border-radius: 0;
25
28
  opacity: 1;
26
29
  display: flex;
27
- align-items: center;
28
- gap: 0.375rem;
30
+ align-items: baseline;
31
+ gap: 0.4rem;
29
32
  }
30
33
 
31
34
  div.callout.callout-style-default:not(.no-icon) div.callout-icon-container,
@@ -33,21 +36,28 @@ div.callout.callout-style-simple:not(.no-icon) div.callout-icon-container {
33
36
  padding: 0;
34
37
  display: inline-flex;
35
38
  align-items: center;
39
+ align-self: center;
36
40
  }
37
41
 
38
42
  .callout .callout-title-container {
39
- /* 单字面字体 + font-synthesis: none 下 600 不会变粗;标注标题靠色条与字号区分 */
40
- font-size: 0.9375rem;
41
- letter-spacing: normal;
43
+ /* 标题一面用黑体栈:13px 下才有真正的 600(正文楷体在 font-synthesis: none
44
+ 下请求 600 仍是常规笔画);色条仍标类型,字重与字面差把标签从正文里拎出来。 */
45
+ font-family: var(--heading-font);
46
+ font-size: 0.8125rem;
47
+ font-weight: 600;
48
+ letter-spacing: 0;
49
+ /* 中文汉字等宽,加字距只把词拉散:标签层级靠字重与字号。 */
42
50
  text-transform: none;
51
+ color: var(--body-color);
43
52
  }
44
53
 
45
54
  div.callout .callout-body,
46
55
  div.callout.callout-style-default .callout-body {
47
56
  padding: 0;
48
57
  font-size: 1rem;
49
- line-height: 1.75;
58
+ line-height: 1.85;
50
59
  font-weight: 400;
60
+ color: var(--body-color);
51
61
  }
52
62
 
53
63
  div.callout.callout-style-default .callout-body > :first-child,
@@ -58,41 +68,40 @@ div.callout.callout-style-default .callout-body > :first-child,
58
68
 
59
69
  #quarto-document-content > .callout,
60
70
  #quarto-document-content section > .callout {
61
- margin-top: 1.25rem;
71
+ margin-top: 1.4rem;
62
72
  }
63
73
  #quarto-document-content > .callout + .callout,
64
74
  #quarto-document-content section > .callout + .callout {
65
- margin-top: 2.5rem;
75
+ margin-top: 1.6rem;
66
76
  }
67
77
 
78
+ /* 图标按类型着色;标题保持正文色,避免整块变成彩色便签。 */
68
79
  .callout.callout-note .callout-title-container,
69
- .callout.callout-note .callout-icon { color: var(--callout-note-border); }
70
80
  .callout.callout-tip .callout-title-container,
71
- .callout.callout-tip .callout-icon { color: var(--callout-tip-border); }
72
81
  .callout.callout-warning .callout-title-container,
73
- .callout.callout-warning .callout-icon { color: var(--callout-warning-border); }
74
82
  .callout.callout-important .callout-title-container,
83
+ .callout.callout-caution .callout-title-container {
84
+ color: var(--body-color);
85
+ }
86
+
87
+ .callout.callout-note .callout-icon { color: var(--callout-note-border); }
88
+ .callout.callout-tip .callout-icon { color: var(--callout-tip-border); }
89
+ .callout.callout-warning .callout-icon { color: var(--callout-warning-border); }
75
90
  .callout.callout-important .callout-icon { color: var(--callout-important-border); }
76
- .callout.callout-caution .callout-title-container,
77
91
  .callout.callout-caution .callout-icon { color: var(--callout-caution-border); }
78
92
 
79
93
  div.callout.callout-note {
80
94
  border-left-color: var(--callout-note-border);
81
- background-color: var(--callout-note-bg);
82
95
  }
83
96
  div.callout.callout-tip {
84
97
  border-left-color: var(--callout-tip-border);
85
- background-color: var(--callout-tip-bg);
86
98
  }
87
99
  div.callout.callout-warning {
88
100
  border-left-color: var(--callout-warning-border);
89
- background-color: var(--callout-warning-bg);
90
101
  }
91
102
  div.callout.callout-important {
92
103
  border-left-color: var(--callout-important-border);
93
- background-color: var(--callout-important-bg);
94
104
  }
95
105
  div.callout.callout-caution {
96
106
  border-left-color: var(--callout-caution-border);
97
- background-color: var(--callout-caution-bg);
98
107
  }
@@ -50,11 +50,11 @@ pre:not(.sourceCode) code {
50
50
  }
51
51
  pre.sourceCode code > span { line-height: var(--code-line-height); }
52
52
 
53
- /* GitHub 风格高亮只区分颜色,不用额外字重强调命令名或输出 token。 */
53
+ /* 高亮只区分颜色,不用额外字重强调命令名或输出 token。 */
54
54
  pre.sourceCode code span { font-weight: 400; }
55
55
 
56
56
  /*
57
- * 颜色只由 GitHub 风格的语义 token 提供。不要按字符、位置或命令名
57
+ * 颜色只由语义 token 提供。不要按字符、位置或命令名
58
58
  * 覆盖 span,否则同一行的括号、版本号和普通文本会出现突兀的颜色切换。
59
59
  */
60
60
  /* 语言代码块和普通文本代码块共享布局;只有语言代码块保留语义 token。 */
@@ -206,6 +206,88 @@ pre.sourceCode code > span:hover { background-color: var(--line-hover-bg); }
206
206
  }
207
207
  .code-copy-button-checked { opacity: 1; color: var(--link-color); }
208
208
 
209
+ /* ---------- 代码工具(code-tools) ----------
210
+ 浮在代码块右上角的「代码」按钮与下拉菜单来自 Bootstrap,默认 16px 灰蓝字、
211
+ 无本轮语义;接到令牌:次要色 → 悬停主色,菜单与分隔线用卡片层令牌。 */
212
+ .code-tools-button {
213
+ color: var(--text-secondary) !important;
214
+ font-family: var(--ui-font);
215
+ font-size: 0.8125rem;
216
+ line-height: 1.4;
217
+ padding: 0.15rem 0.45rem;
218
+ border-radius: var(--radius-sm);
219
+ background: transparent;
220
+ }
221
+ .code-tools-button:hover,
222
+ .code-tools-button:focus-visible {
223
+ color: var(--body-color) !important;
224
+ background: var(--surface-raised);
225
+ }
226
+ .code-tools-menu {
227
+ border: 1px solid var(--card-border);
228
+ border-radius: var(--radius-md);
229
+ background: var(--surface-raised);
230
+ box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
231
+ font-family: var(--ui-font);
232
+ font-size: 0.875rem;
233
+ padding: 0.25rem;
234
+ }
235
+ .code-tools-menu .dropdown-item {
236
+ color: var(--body-color);
237
+ border-radius: var(--radius-sm);
238
+ padding: 0.3rem 0.55rem;
239
+ }
240
+ .code-tools-menu .dropdown-item:hover {
241
+ background: var(--surface-raised);
242
+ color: var(--body-color);
243
+ }
244
+ .code-tools-menu .dropdown-divider {
245
+ border-top-color: var(--card-border);
246
+ }
247
+
248
+ /* ---------- 代码标注(code-annotation) ----------
249
+ Quarto 自带的标注样式是 Bootstrap 默认:gutter 一块浅灰底、行号是主色圆点,
250
+ 暗色下浅灰块会发亮、圆点色与本书强调色不同源。这里只接令牌:gutter 透明、
251
+ 行内编号与注释列表编号共用动作色描边,注释正文走 14px 次要色。 */
252
+ .code-annotation-gutter,
253
+ .code-annotation-gutter-bg {
254
+ background-color: transparent;
255
+ }
256
+ #quarto-document-content code.sourceCode .code-annotation-anchor,
257
+ #quarto-document-content .code-annotation-container-grid dt {
258
+ display: inline-flex;
259
+ align-items: center;
260
+ justify-content: center;
261
+ min-width: 1.15rem;
262
+ height: 1.15rem;
263
+ border: 1px solid var(--accent);
264
+ border-radius: 999px;
265
+ background: transparent;
266
+ color: var(--accent);
267
+ font-family: var(--ui-font);
268
+ font-size: 0.6875rem;
269
+ font-weight: 400;
270
+ line-height: 1;
271
+ text-decoration: none;
272
+ }
273
+ #quarto-document-content code.sourceCode .code-annotation-anchor {
274
+ margin-right: 0.4rem;
275
+ }
276
+ .code-annotation-container-grid {
277
+ margin: 0.6rem 0 1.5rem;
278
+ }
279
+ .code-annotation-container-grid dt {
280
+ border-color: var(--text-secondary);
281
+ color: var(--text-secondary);
282
+ font-family: var(--ui-font);
283
+ }
284
+ .code-annotation-container-grid dd {
285
+ margin: 0 0 0.45rem;
286
+ color: var(--text-secondary);
287
+ font-size: 0.875rem;
288
+ line-height: 1.65;
289
+ }
290
+
209
291
  /* 打印时横向滚动不存在,屏幕上的 white-space: pre 会把 100 列截掉;
210
292
  打印恢复折行,屏幕规则不动。 */
211
293
  @media print {
@@ -1,6 +1,6 @@
1
1
  /* dsh-quarto-book Quarto 主题 · 正文内容(表格 / 引用 / 正文组件与排版;自 common.css 拆分) */
2
2
 
3
- /* ---------- 表格(冷灰 docs:无外框、表头底线 + 行 hairline) ---------- */
3
+ /* ---------- 表格(booktabs:顶/底粗线、表头细线,无行线与竖线) ---------- */
4
4
  .table {
5
5
  --bs-table-hover-bg: transparent;
6
6
  /* 表体与正文同档:表格字号一旦小于正文,正文里嵌表格就会出现两次字级跳变,
@@ -17,11 +17,11 @@
17
17
  font-variant-numeric: tabular-nums;
18
18
  }
19
19
  .table > :not(caption) > * > * {
20
- padding: 0.5rem 1rem;
20
+ padding: 0.55rem 0.9rem;
21
21
  vertical-align: baseline;
22
- border-bottom: 1px solid var(--table-hairline);
22
+ border-bottom: 0;
23
23
  }
24
- /* 首尾列贴边(docs 表格无左右内边距) */
24
+ /* 首尾列贴边,让表格与正文左缘对齐 */
25
25
  .table > :not(caption) > * > :first-child {
26
26
  padding-inline-start: 0;
27
27
  }
@@ -31,9 +31,15 @@
31
31
  .table thead th {
32
32
  background-color: transparent;
33
33
  font-weight: 600;
34
- font-size: 0.8125rem;
34
+ /* 表头比表体小 1px(17px → 15px),层级靠字重与字号,不靠比顶线更粗的线。 */
35
+ font-size: 0.9375rem;
35
36
  text-align: left;
36
37
  padding-top: 0;
38
+ padding-bottom: 0.45rem;
39
+ border-top: 1px solid var(--table-border);
40
+ border-bottom: 1px solid var(--table-border);
41
+ }
42
+ .table > tbody > tr:last-child > * {
37
43
  border-bottom: 1px solid var(--table-border);
38
44
  }
39
45
 
@@ -59,55 +65,151 @@
59
65
  padding-inline-end: 0;
60
66
  }
61
67
 
62
- /* ---------- 引用块(> 标记,用于「注意」等提示;GitHub markdown-body 灰风:灰边 + 灰字,无彩色底) ---------- */
68
+ /* 表题:Pandoc 输出 <caption>,Bootstrap 默认把它放表下(caption-side: bottom),
69
+ 这里统一提到表上、左对齐,与图注一样小一号。 */
70
+ #quarto-document-content .table > caption {
71
+ caption-side: top;
72
+ text-align: left;
73
+ font-size: 0.875rem;
74
+ line-height: 1.65;
75
+ color: var(--text-secondary);
76
+ padding: 0 0 0.5rem;
77
+ }
78
+
79
+ /* 斑马纹压平:书籍表格靠表头线与列距,不靠交替底色(打印时还要 print-color-adjust)。 */
80
+ #quarto-document-content .table-striped > tbody > tr:nth-of-type(odd) > * {
81
+ background-color: transparent;
82
+ }
83
+
84
+ /* 任务列表:checkbox 跟强调色,不加卡片。 */
85
+ #quarto-document-content input[type="checkbox"] {
86
+ accent-color: var(--action-color);
87
+ margin-inline-end: 0.4em;
88
+ }
89
+
90
+ /* 脚注:比正文小一档(17px → 14px),顶部一条通栏发丝线与正文分开。 */
91
+ #quarto-document-content .footnotes {
92
+ margin-top: 3rem;
93
+ padding-top: 1rem;
94
+ border-top: 1px solid var(--card-border);
95
+ font-size: 0.875rem;
96
+ line-height: 1.7;
97
+ color: var(--text-secondary);
98
+ }
99
+ #quarto-document-content .footnotes ol {
100
+ padding-inline-start: 1.25rem;
101
+ margin-bottom: 0;
102
+ }
103
+ #quarto-document-content .footnotes li + li {
104
+ margin-top: 0.35rem;
105
+ }
106
+ #quarto-document-content .footnotes a {
107
+ color: var(--text-secondary);
108
+ }
109
+
110
+ /* ---------- 引用块(上下各一条通栏发丝线 + 正文色,无底色、无竖线;书籍引文而非灰卡) ----------
111
+ 横线规则:全书正文里的分隔一律是「通栏 1px 卡片发丝线」,与表格线、顶栏底边同一档颜色;
112
+ 引用块左右贯通正文列,靠这两条线界定范围,不再用左侧 2px 竖条(竖条与通栏规则相斥)。 */
63
113
  blockquote,
64
114
  blockquote.blockquote {
65
- font-size: 0.9375rem; /* 略小于正文(次要提示定位),并压掉 Quarto .blockquote 命中的 Bootstrap 1.25rem */
66
- margin: 1.375rem 0;
67
- border-left: 3px solid var(--quote-border);
68
- background-color: var(--quote-bg);
69
- color: var(--text-secondary);
70
- padding: 0 1rem;
115
+ font-size: inherit;
116
+ margin: 1.75rem 0;
117
+ /* Quarto 默认给引用块画 4px 左竖条,这里显式清零,否则上下横线之外还挂着一根竖墙。 */
118
+ border: 0;
119
+ border-top: 1px solid var(--card-border);
120
+ border-bottom: 1px solid var(--card-border);
121
+ background-color: transparent;
122
+ color: var(--body-color);
123
+ padding: 1.1rem 0 1.15rem;
71
124
  font-style: normal;
72
125
  }
73
- /* 分隔线(---)样式与节奏统一在下方「正文排版」段定义(docs 风:每个小节标题前一条细线,上方 3.375rem) */
74
126
 
75
127
  /* ---------- 正文组件润色 ---------- */
76
- /* 正文链接:强调色 + 细下划线 */
128
+ /* 正文链接:常态与正文同色 + 下划线;hover 才转为 accent,underline 用 action 色 */
77
129
  #quarto-document-content a {
78
130
  color: var(--text-link);
79
131
  text-decoration: underline;
80
132
  text-decoration-color: var(--text-underline);
81
133
  text-decoration-thickness: 1px;
82
- text-underline-offset: 0.2em;
134
+ text-underline-offset: 0.18em;
83
135
  }
84
136
  #quarto-document-content a:hover {
85
- color: var(--link-color);
86
- text-decoration-color: var(--link-underline);
137
+ color: var(--link-hover-color);
138
+ text-decoration-color: var(--action-color);
87
139
  }
88
- /* 图片 / 图:圆角 + 细边 + 居中图注 */
140
+ /* 图片 / 图:小圆角 + 细边 + 居中图注 */
89
141
  #quarto-document-content img:not(.no-border) {
90
- border-radius: var(--radius-lg);
142
+ border-radius: var(--radius-sm);
91
143
  border: 1px solid var(--code-border);
92
144
  max-width: 100%;
93
145
  }
94
- #quarto-document-content figure figcaption {
146
+ #quarto-document-content figure figcaption,
147
+ #quarto-document-content .quarto-float-caption,
148
+ #quarto-document-content .figure-caption {
95
149
  color: var(--text-secondary);
96
- font-size: 0.88rem;
150
+ font-size: 0.875rem;
151
+ line-height: 1.65;
97
152
  text-align: center;
98
153
  margin-top: 0.5rem;
99
154
  }
155
+ /* MathJax:行内公式默认缩到正文的 94%,夹在中文里会显得「小一号」;
156
+ 拉到 1em 与正文同档,display 公式单独给上下呼吸。 */
157
+ /* MathJax 会把 94% 写进 mjx-container 的行内 style,样式表必须 !important 才压得住。 */
158
+ #quarto-document-content mjx-container {
159
+ font-size: 1em !important;
160
+ }
161
+ mjx-container[display="true"] {
162
+ margin: 1.3rem 0;
163
+ }
164
+
165
+ /* 源码模态(code-tools):Bootstrap 默认 1000px,平板宽度下会顶满整屏。
166
+ 这里在 ≥576px 时封顶并留出 1rem 边距;更窄沿用 Bootstrap 的 .5rem 边距。 */
167
+ @media (min-width: 576px) {
168
+ #quarto-embedded-source-code-modal .modal-dialog {
169
+ max-width: min(1000px, calc(100vw - 2rem));
170
+ }
171
+ }
172
+
173
+ /* 图片灯箱(GLightbox,format.html.lightbox: true 时启用)
174
+ 默认遮罩 0.7 黑、页面图注会从图片后面透出来,读起来像「标签贴错位置」;
175
+ 这里加深遮罩把图单独抬出来,关闭/翻页按钮统一成白描边胶囊。 */
176
+ .glightbox-container .goverlay {
177
+ background: rgba(0, 0, 0, 0.86);
178
+ }
179
+ .glightbox-container .gbtn {
180
+ background: rgba(0, 0, 0, 0.45);
181
+ border-radius: 999px;
182
+ }
183
+ .glightbox-container .gbtn:hover,
184
+ .glightbox-container .gbtn:focus-visible {
185
+ background: rgba(0, 0, 0, 0.7);
186
+ }
187
+ .glightbox-container .gbtn svg path {
188
+ fill: #fff;
189
+ }
190
+ .glightbox-container .gslide-image img {
191
+ border-radius: var(--radius-sm);
192
+ }
193
+ /* 透明底的 SVG(品牌标记、图表)在深色遮罩上会「消失」:给矢量图垫白卡,
194
+ 位图不加任何装饰,避免给照片套白边。 */
195
+ .glightbox-container .gslide-image img[src$=".svg"],
196
+ .glightbox-container .gslide-image img[src*=".svg?"] {
197
+ background: #fff;
198
+ padding: 0.9rem;
199
+ box-sizing: border-box;
200
+ }
201
+
100
202
  /* jupyter 单元的图必须用 IPython.display.HTML 输出保持 SVG 内联:image/svg+xml 输出会被
101
203
  Quarto 外置成 <img>,无法继承站点 data-bs-theme 明暗与文档字体。text/html 输出不被
102
204
  Quarto 识别为图像,fig-cap 退化为图后一个裸 <p>,这里按 figcaption 同款图注样式居中。 */
103
205
  #quarto-document-content .cell-output-display > svg.coords-grid + p {
104
206
  color: var(--text-secondary);
105
- font-size: 0.88rem;
207
+ font-size: 0.875rem;
106
208
  text-align: center;
107
209
  margin-top: 0.5rem;
108
210
  }
109
211
  /* mermaid / dot 图表样式见 mermaid.css(SVG 居中规则已迁入) */
110
- /* 坐标图:GitHub 文档图的做法是抬起一块浅底、不加实线外框。
212
+ /* 坐标图:常见文档图的做法是抬起一块浅底、不加实线外框。
111
213
  内联 SVG 用 currentColor,跟着正文颜色走;独立 svg 文件再用
112
214
  prefers-color-scheme 兜住系统明暗。 */
113
215
  #quarto-document-content :is(figure, .cell-output-display) svg.coords-grid {
@@ -118,7 +220,7 @@ blockquote.blockquote {
118
220
  height: auto;
119
221
  color: var(--body-color);
120
222
  background: var(--surface-raised);
121
- border-radius: var(--radius-md);
223
+ border-radius: var(--radius-sm);
122
224
  padding: 0.75rem;
123
225
  box-sizing: border-box;
124
226
  }
@@ -127,6 +229,15 @@ blockquote.blockquote {
127
229
  #quarto-document-content section :is(.code-copy-outer-scaffold, .code-with-filename, pre) + :is(p, ul, ol) {
128
230
  font-family: var(--ui-font);
129
231
  }
232
+ /* 行内代码遇到无空格的类型名(std::array<std::array<CellType, 3>, 3>)时,
233
+ 窄屏会把正文列顶宽;此时允许行内代码换行,桌面保持原样。 */
234
+ @media (max-width: 575.98px) {
235
+ #quarto-document-content :is(p, li, dd, td, th) code {
236
+ white-space: pre-wrap;
237
+ overflow-wrap: anywhere;
238
+ }
239
+ }
240
+
130
241
  /* 键盘键 */
131
242
  #quarto-document-content kbd {
132
243
  font-family: var(--mono-font);
@@ -157,23 +268,28 @@ dd {
157
268
  color: var(--text-secondary);
158
269
  }
159
270
  #quarto-document-content details.answer-disclosure {
160
- border: 1px solid var(--card-border);
161
- border-radius: var(--radius-md);
162
- padding: 0.6rem 1rem;
163
- margin: 1.2rem 0;
271
+ border: 0;
272
+ border-top: 1px solid var(--card-border);
273
+ border-bottom: 1px solid var(--card-border);
274
+ border-radius: 0;
275
+ background: transparent;
276
+ padding: 0.7rem 0;
277
+ margin: 1.4rem 0;
164
278
  }
165
279
  /* 摘要文字用正文色;折叠三角显式着色——部分浏览器的 marker 不跟随文字色,
166
280
  暗色底上会以黑色渲染导致消失。 */
167
281
  #quarto-document-content details.answer-disclosure > summary {
168
282
  cursor: pointer;
169
283
  color: var(--body-color);
284
+ font-size: 0.9375rem;
285
+ line-height: 1.5;
170
286
  }
171
287
  #quarto-document-content details.answer-disclosure > summary::marker,
172
288
  #quarto-document-content details.answer-disclosure > summary::before {
173
289
  color: var(--body-color);
174
290
  }
175
291
  #quarto-document-content details.answer-disclosure[open] > summary {
176
- margin-bottom: 0.5rem;
292
+ margin-bottom: 0.6rem;
177
293
  }
178
294
 
179
295
  /* ---------- 正文排版 ---------- */
@@ -201,19 +317,19 @@ html {
201
317
  ::selection {
202
318
  background-color: var(--selection-bg);
203
319
  }
204
- /* 键盘导航焦点可见 */
320
+ /* 键盘导航焦点可见:用 action 色,不把正文链接染蓝 */
205
321
  :focus-visible {
206
- outline: 2px solid var(--link-color);
322
+ outline: 2px solid var(--action-color);
207
323
  outline-offset: 2px;
208
324
  border-radius: 2px;
209
325
  }
210
- /* 列表项间距:li+li 0.625rem、嵌套列表上距 0.625rem(docs 节奏;仅正文内容,不碰侧栏) */
326
+ /* 列表项间距:li+li 0.5rem、嵌套列表上距 0.5rem(仅正文内容,不碰侧栏) */
211
327
  #quarto-document-content li + li {
212
- margin-top: 0.625rem;
328
+ margin-top: 0.5rem;
213
329
  }
214
330
  #quarto-document-content li > ul,
215
331
  #quarto-document-content li > ol {
216
- margin-top: 0.625rem;
332
+ margin-top: 0.5rem;
217
333
  }
218
334
  /* 列表 marker(圆点/序号):显式用次要文字色,暗色底上浏览器默认 marker 可能
219
335
  以黑色渲染导致消失。 */
@@ -262,7 +378,7 @@ code {
262
378
  text-autospace: no-autospace;
263
379
  }
264
380
 
265
- /* GitHub Markdown 正文约束:普通段落使用正文列的实际宽度,组件不撑破三栏布局。
381
+ /* Markdown 正文约束:普通段落使用正文列的实际宽度,组件不撑破三栏布局。
266
382
  页面列宽由 Quarto grid 与 --content-width 决定;不要再用 75ch 对段落做第二次限宽。 */
267
383
  #quarto-document-content {
268
384
  max-width: min(100%, var(--content-width));
@@ -278,7 +394,7 @@ code {
278
394
  #quarto-document-content hr {
279
395
  border: 0;
280
396
  border-top: 1px solid var(--card-border);
281
- margin: 2rem 0;
397
+ margin: 2.5rem 0;
282
398
  opacity: 1;
283
399
  }
284
400
  /* 锚点 / 深链跳转后的目标标题轻微高亮,便于定位(复用行 hover 的浅强调底) */