skeleton.html 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  1. <!DOCTYPE html>
  2. <!--
  3. reformat-default skeleton
  4. -------------------------
  5. Used by `bash make.sh reformat`. Placeholders are replaced by
  6. scripts/reformat_parse.py:
  7. <!-- TITLE --> document title (H1 lifted from source if absent)
  8. <!-- SUBTITLE --> cover line 2 (optional)
  9. <!-- AUTHOR --> cover meta line — author
  10. <!-- DATE --> cover meta line — date (YYYY-MM-DD; defaults to today)
  11. <!-- ACCENT --> CSS hex (--accent), drives section rule + link + table head
  12. <!-- BODY_HTML --> markdown-it rendered HTML (h1/h2/h3/p/ul/ol/table/code/…)
  13. Render:
  14. node scripts/render_html.cjs --in page.html --out report.pdf
  15. -->
  16. <html lang="zh-CN">
  17. <head>
  18. <meta charset="UTF-8">
  19. <title><!-- TITLE --></title>
  20. <style>
  21. @page { size: A4 portrait; margin: 18mm 16mm; }
  22. * { box-sizing: border-box; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  23. :root {
  24. --ink: #1a1a1a;
  25. --ink-2: #444;
  26. --ink-3: #666;
  27. --ink-4: #999;
  28. --rule: #e5e5e5;
  29. --hairline: #efefef;
  30. --mute: #f7f7f7;
  31. --accent: <!-- ACCENT -->;
  32. --code-bg: #f4f4f6;
  33. }
  34. html, body {
  35. margin: 0; padding: 0;
  36. font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display",
  37. "PingFang SC", "Hiragino Sans", "Helvetica Neue", Arial, sans-serif;
  38. color: var(--ink);
  39. font-size: 10.5pt; line-height: 1.65;
  40. -webkit-font-smoothing: antialiased;
  41. }
  42. /* ── Cover ───────────────────────────────────────────────────────────── */
  43. .cover {
  44. height: 261mm; /* A4 297 - 36 margins */
  45. display: flex; flex-direction: column; justify-content: space-between;
  46. padding: 16mm 4mm; page-break-after: always;
  47. border-top: 4px solid var(--accent);
  48. }
  49. .cover-top { display: flex; flex-direction: column; gap: 6mm; }
  50. .cover-eyebrow {
  51. font-size: 9pt; letter-spacing: 4px; text-transform: uppercase;
  52. color: var(--accent); font-weight: 600;
  53. }
  54. .cover-title {
  55. font-size: 32pt; font-weight: 700; line-height: 1.2;
  56. letter-spacing: -0.5px; color: var(--ink); margin: 0;
  57. }
  58. .cover-subtitle {
  59. font-size: 14pt; color: var(--ink-2); line-height: 1.5;
  60. margin: 4mm 0 0; max-width: 150mm;
  61. }
  62. .cover-meta {
  63. display: flex; gap: 24mm; font-size: 10pt; color: var(--ink-3);
  64. border-top: 1px solid var(--rule); padding-top: 6mm;
  65. }
  66. .cover-meta dt {
  67. font-size: 8pt; letter-spacing: 1.5px; text-transform: uppercase;
  68. color: var(--ink-4); font-weight: 600; margin-bottom: 2mm;
  69. }
  70. .cover-meta dd { margin: 0; font-weight: 500; color: var(--ink); }
  71. /* ── Body ────────────────────────────────────────────────────────────── */
  72. .body { padding: 0 4mm; }
  73. .body h1, .body h2, .body h3, .body h4 {
  74. color: var(--ink); letter-spacing: -0.2px; line-height: 1.3;
  75. page-break-after: avoid;
  76. }
  77. .body h1 {
  78. font-size: 22pt; font-weight: 700; margin: 14mm 0 6mm;
  79. padding-bottom: 3mm; border-bottom: 2px solid var(--accent);
  80. page-break-before: always;
  81. }
  82. .body > h1:first-child { page-break-before: auto; margin-top: 0; }
  83. .body h2 {
  84. font-size: 15pt; font-weight: 700; margin: 10mm 0 4mm;
  85. padding-left: 4mm; border-left: 3px solid var(--accent);
  86. }
  87. .body h3 { font-size: 12pt; font-weight: 600; margin: 7mm 0 3mm; }
  88. .body h4 { font-size: 10.5pt; font-weight: 600; margin: 5mm 0 2mm; color: var(--ink-2); }
  89. .body p { margin: 0 0 4mm; }
  90. .body strong { color: var(--ink); font-weight: 600; }
  91. .body em { font-style: italic; }
  92. .body a { color: var(--accent); text-decoration: none; border-bottom: 0.5px solid currentColor; }
  93. .body ul, .body ol { margin: 0 0 5mm; padding-left: 6mm; }
  94. .body li { margin-bottom: 1.5mm; }
  95. .body li > ul, .body li > ol { margin: 1.5mm 0 0; }
  96. .body blockquote {
  97. margin: 5mm 0; padding: 3mm 5mm;
  98. background: var(--mute); border-left: 3px solid var(--accent);
  99. color: var(--ink-2); border-radius: 2px;
  100. }
  101. .body blockquote p { margin: 0 0 2mm; }
  102. .body blockquote p:last-child { margin: 0; }
  103. /* ── Code ────────────────────────────────────────────────────────────── */
  104. .body code {
  105. font-family: "SF Mono", Menlo, Consolas, monospace; font-size: 9pt;
  106. background: var(--code-bg); color: #c7254e; padding: 1px 5px;
  107. border-radius: 3px; border: 0.5px solid var(--hairline);
  108. }
  109. .body pre {
  110. background: var(--code-bg); border: 0.5px solid var(--hairline);
  111. border-radius: 6px; padding: 4mm 5mm; overflow-x: auto;
  112. margin: 5mm 0; font-size: 9pt; line-height: 1.5;
  113. page-break-inside: avoid;
  114. }
  115. .body pre code {
  116. background: transparent; color: var(--ink); border: 0; padding: 0;
  117. font-size: inherit;
  118. }
  119. /* ── Tables ──────────────────────────────────────────────────────────── */
  120. .body table {
  121. width: 100%; border-collapse: collapse; margin: 5mm 0;
  122. font-size: 9.5pt; page-break-inside: avoid;
  123. border: 1px solid var(--rule); border-radius: 4px; overflow: hidden;
  124. }
  125. .body table thead th {
  126. background: var(--accent); color: #fff; padding: 2.5mm 3mm;
  127. text-align: left; font-weight: 600; font-size: 9pt;
  128. letter-spacing: 0.2px;
  129. }
  130. .body table tbody td {
  131. padding: 2mm 3mm; border-top: 1px solid var(--hairline);
  132. color: var(--ink-2); vertical-align: top;
  133. }
  134. .body table tbody tr:nth-child(even) td { background: #fbfbfd; }
  135. /* ── Images / figures ───────────────────────────────────────────────── */
  136. .body img {
  137. max-width: 100%; height: auto; border-radius: 4px;
  138. display: block; margin: 5mm auto;
  139. }
  140. /* ── Hr ──────────────────────────────────────────────────────────────── */
  141. .body hr {
  142. border: 0; border-top: 1px solid var(--rule); margin: 8mm 0;
  143. }
  144. /* ── Footer rule ─────────────────────────────────────────────────────── */
  145. .footer {
  146. margin-top: 14mm; padding-top: 4mm; border-top: 1px solid var(--rule);
  147. font-size: 8.5pt; color: var(--ink-4); text-align: center;
  148. }
  149. /* === Screen-emulation: open in browser → looks like the A4 PDF =========== */
  150. @media screen {
  151. html { background: #d0d0d0; }
  152. body { margin: 0; padding: 20px 0; }
  153. body > section {
  154. width: 210mm; min-height: 297mm; margin: 0 auto 20px;
  155. background: #fff; box-shadow: 0 4px 24px rgba(0,0,0,0.18);
  156. box-sizing: border-box; overflow: hidden;
  157. }
  158. }
  159. </style>
  160. </head>
  161. <body>
  162. <section class="cover">
  163. <div class="cover-top">
  164. <div class="cover-eyebrow">REPORT · <!-- DATE --></div>
  165. <h1 class="cover-title"><!-- TITLE --></h1>
  166. <p class="cover-subtitle"><!-- SUBTITLE --></p>
  167. </div>
  168. <dl class="cover-meta">
  169. <div>
  170. <dt>Author</dt>
  171. <dd><!-- AUTHOR --></dd>
  172. </div>
  173. <div>
  174. <dt>Date</dt>
  175. <dd><!-- DATE --></dd>
  176. </div>
  177. </dl>
  178. </section>
  179. <section class="body">
  180. <!-- BODY_HTML -->
  181. </section>
  182. <div class="footer">— end of document —</div>
  183. </body>
  184. </html>