Template:图书排版/styles.css:修订间差异
外观
删除的内容 添加的内容
字体顺序:思源宋体(Noto Serif SC)提到最前,苹方作为备选 |
以 heti 官方规则为底补齐版式类,并把版式改为模板参数开关({{图书排版|行间注}} 等) |
||
| (未显示2个用户的38个中间版本) | |||
| 第1行: | 第1行: | ||
/* ===== 字体 |
/* ===== 字体栈:正文黑体优先,衬线族走宋体 ===== |
||
常用字 → 雅黑/苹方(屏幕阅读舒服) |
|||
@font-face { |
|||
生僻字 → SimSun-ExtB/G / Jigmo / HanaMin |
|||
font-family: "TemplateStyles CJK Punct"; |
|||
========================================================== */ |
|||
src: local("Noto Serif SC"), local("NotoSerifSC-Regular"), |
|||
/* ===== 字体回退栈说明(混合方案)===== |
|||
local("Source Han Serif SC"), local("Songti SC"), |
|||
顺序:西文无衬线 → 黑体(系统默认) → 宋体 → 扩展B/G → 生僻字兜底 |
|||
local("STSong"), local("SimSun"), local("宋体"), local("Microsoft YaHei UI"); |
|||
- 标点跟随正文字体:2026-09 删去标点专用的 @font-face(它原先把标点强制交给宋体 |
|||
unicode-range: U+2000-206F, U+3000-303F; |
|||
全角,用于修复「引号贴字」);现在引号、逗号等一律用正文字体,简繁各自随其汉字字体。 |
|||
} |
|||
- 常用字走 "PingFang SC" / "Microsoft YaHei"(黑体,屏幕阅读舒服) |
|||
@font-face { |
|||
- 生僻字自动往后掉:SimSun-ExtB → SimSun-ExtG → Jigmo → HanaMin |
|||
font-family: "TemplateStyles CJK Body"; |
|||
参考 ctext.org 的长栈逻辑。 |
|||
src: local("Noto Serif SC"), local("NotoSerifSC-Regular"), |
|||
(宋体栈的西文用 Georgia——与衬线中文协调;黑体栈的西文用 Verdana/Arial——与黑体协调) |
|||
local("PingFang SC Regular"), local("PingFang SC"), local("PingFangSC-Regular"), |
|||
========================================================== */ |
|||
local("Hiragino Sans GB"), local("HiraginoSansGB-W3"), |
|||
local("Microsoft YaHei UI"), local("Microsoft YaHei"), |
|||
local("WenQuanYi Micro Hei"), local("ST Heiti"), local("SimSun"); |
|||
unicode-range: U+2E80-2EFF, U+31C0-31EF, U+3200-32FF, |
|||
U+3400-4DBF, U+4E00-9FFF, U+F900-FAFF, U+FE10-FE6F, U+FF00-FFEF, |
|||
U+1F200-1F2FF, U+20000-2A6DF; |
|||
} |
|||
/* 段距:2026-09 删去自身声明,交回站点默认(.mw-body p{margin:0.5em 0 1em 0})。 |
|||
p { |
|||
原先声明的 0.4em/0.5em 特异性低于 .mw-body p,实际从未生效。 */ |
|||
margin-top:12px;margin-bottom:24px;text-align:justify |
|||
} |
|||
p:not(:lang(zh)):not(:lang(ja)):not(:lang(ko)), p:not(:lang(zh)) { |
|||
text-align:start |
|||
} |
|||
h1, h2, h3, h4, h5, h6 { |
h1, h2, h3, h4, h5, h6 { |
||
position:relative;margin:0;margin-top:24px;margin-bottom:12px;font-weight:600 |
position:relative;margin:0;margin-top:24px;margin-bottom:12px;font-weight:600; |
||
color:#202122; |
|||
font-family: Verdana, Arial, Helvetica, -apple-system, |
|||
"PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", |
|||
"SimSun", "SimSun-ExtB", "SimSun-ExtG", |
|||
"Jigmo3", "Jigmo2", "Jigmo", "HanaMinA", "HanaMinB", |
|||
sans-serif; |
|||
} |
} |
||
h2, h3, h4, h5, h6 { font-weight: bold; } |
|||
/* 标题阶梯:按正文 20px(1.25rem)重定,字号全部用 rem 相对根字号;行高统一 1.4 倍。 |
|||
原阶梯 32/28/24/20/18/16px 是在正文 17px 下设的,正文放大到 20px 后 h6(16px) 会小于正文, |
|||
且原行高是固定 px、比例不齐(h4 为 1.2、h6 为 1.5);改用倍数后随字号缩放。 */ |
|||
h1 { |
h1 { |
||
margin-bottom:24px;font-size: |
margin-bottom:24px;font-size:2.25rem;line-height:1.4 |
||
} |
} |
||
h2 { |
h2 { |
||
font-size: |
font-size:1.875rem;line-height:1.4 |
||
} |
} |
||
h3 { |
h3 { |
||
font-size: |
font-size:1.625rem;line-height:1.4 |
||
} |
} |
||
h4 { |
h4 { |
||
font-size: |
font-size:1.5rem;line-height:1.4 |
||
} |
} |
||
h5 { |
h5 { |
||
font-size: |
font-size:1.375rem;line-height:1.4 |
||
} |
} |
||
h6 { |
h6 { |
||
font-size: |
font-size:1.25rem;line-height:1.4 |
||
} |
|||
h1, h2, h3 { |
|||
letter-spacing:.05em |
|||
} |
|||
h1:not(:lang(zh)):not(:lang(ja)):not(:lang(ko)), h1:not(:lang(zh)), h2:not(:lang(zh)):not(:lang(ja)):not(:lang(ko)), h2:not(:lang(zh)), h3:not(:lang(zh)):not(:lang(ja)):not(:lang(ko)), h3:not(:lang(zh)) { |
|||
letter-spacing:0 |
|||
} |
} |
||
h1+h2, h2+h3, h3+h4, h4+h5, h5+h6 { |
h1+h2, h2+h3, h3+h4, h4+h5, h5+h6 { |
||
margin-top:12px |
margin-top:12px |
||
} |
} |
||
.heti--serif, .heti--song, .heti--poetry { |
|||
font-family: Georgia, |
|||
.heti--serif { |
|||
"SimSun", "Songti SC", "Noto Serif SC", |
|||
"PMingLiU", "PMingLiu-ExtB", "SimSun-ExtB", "SimSun-ExtG", 新細明體, |
|||
"Jigmo3", "Jigmo2", "Jigmo", "HanaMinA", "HanaMinB", |
|||
serif |
|||
} |
} |
||
.heti-- |
.heti--columns-2 { |
||
max-width:none;column-gap:2em;column-count:2 |
|||
font-family:"TemplateStyles CJK Punct","Songti SC","SimSun","Noto Serif SC",Georgia,serif |
|||
} |
|||
.heti--classic h1, .heti--classic h2, .heti--classic h3, .heti--classic h4, .heti--classic h5, .heti--classic h6 { |
|||
font-family:"TemplateStyles CJK Punct","Kaiti SC","STKaiti","KaiTi",Georgia,serif;font-weight:800 |
|||
} |
|||
.heti--classic blockquote, .heti--classic cite, .heti--classic q { |
|||
font-family:"TemplateStyles CJK Punct","Kaiti SC","STKaiti","KaiTi",Georgia,serif |
|||
} |
|||
.heti--classic figcaption, .heti--classic caption, .heti--classic th { |
|||
font-family:"TemplateStyles CJK Punct","TemplateStyles CJK Body",Georgia,-apple-system,"Nimbus Roman No9 L","PingFang SC","Hiragino Sans GB","Noto Serif SC","Microsoft YaHei UI","WenQuanYi Micro Hei","ST Heiti",sans-serif |
|||
} |
|||
.heti--hei { |
|||
font-family:"TemplateStyles CJK Punct","TemplateStyles CJK Body",Georgia,-apple-system,"Nimbus Roman No9 L","PingFang SC","Hiragino Sans GB","Noto Serif SC","Microsoft YaHei UI","WenQuanYi Micro Hei","ST Heiti",sans-serif |
|||
} |
|||
.heti--song { |
|||
font-family:"TemplateStyles CJK Punct","Songti SC","SimSun","Noto Serif SC",Georgia,serif |
|||
} |
|||
.heti--kai { |
|||
font-family:"TemplateStyles CJK Punct","Kaiti SC","STKaiti","KaiTi",Georgia,serif |
|||
} |
|||
.heti--columns-1, .heti--columns-2, .heti--columns-3, .heti--columns-4, .heti--columns-16em, .heti--columns-20em, .heti--columns-24em, .heti--columns-28em, .heti--columns-32em, .heti--columns-36em, .heti--columns-40em, .heti--columns-44em, .heti--columns-48em { |
|||
max-width:none;column-gap:2em |
|||
} |
} |
||
.heti--columns-2 p { |
|||
.heti--columns-1 p, .heti--columns-2 p, .heti--columns-3 p, .heti--columns-4 p, .heti--columns-16em p, .heti--columns-20em p, .heti--columns-24em p, .heti--columns-28em p, .heti--columns-32em p, .heti--columns-36em p, .heti--columns-40em p, .heti--columns-44em p, .heti--columns-48em p { |
|||
margin-top:6px;margin-bottom:12px;text-indent:2em |
margin-top:6px;margin-bottom:12px;text-indent:2em |
||
} |
} |
||
/* 诗词标题:2026-09 起不再用楷体(楷体版式已整体移除),改为继承容器的宋体栈,仍居中加粗。 */ |
|||
.heti--columns-1 { |
|||
.heti--poetry h1, .heti--poetry h2, .heti--poetry h3, .heti--poetry h4, .heti--poetry h5, .heti--poetry h6 { |
|||
column-count:1 |
|||
font-family:inherit;font-weight:800;text-align:center |
|||
} |
|||
.heti--columns-2 { |
|||
column-count:2 |
|||
} |
|||
.heti--columns-3 { |
|||
column-count:3 |
|||
} |
|||
.heti--columns-4 { |
|||
column-count:4 |
|||
} |
|||
.heti--columns-16em { |
|||
column-width:16em |
|||
} |
|||
.heti--columns-20em { |
|||
column-width:20em |
|||
} |
|||
.heti--columns-24em { |
|||
column-width:24em |
|||
} |
|||
.heti--columns-28em { |
|||
column-width:28em |
|||
} |
|||
.heti--columns-32em { |
|||
column-width:32em |
|||
} |
|||
.heti--columns-36em { |
|||
column-width:36em |
|||
} |
|||
.heti--columns-40em { |
|||
column-width:40em |
|||
} |
|||
.heti--columns-44em { |
|||
column-width:44em |
|||
} |
|||
.heti--columns-48em { |
|||
column-width:48em |
|||
} |
|||
.heti--vertical { |
|||
max-width:none;max-height:42em;writing-mode:vertical-rl;letter-spacing:.125em |
|||
} |
|||
.heti--vertical h1, .heti--vertical h2, .heti--vertical h3, .heti--vertical h4, .heti--vertical h5, .heti--vertical h6 { |
|||
text-align:start |
|||
} |
|||
.heti--vertical q { |
|||
quotes:"「" "」" "『" "』" |
|||
} |
|||
.heti--ancient, .heti--poetry { |
|||
font-family:"TemplateStyles CJK Punct","Songti SC","SimSun","Noto Serif SC",Georgia,serif |
|||
} |
|||
.heti--ancient h1, .heti--ancient h2, .heti--ancient h3, .heti--ancient h4, .heti--ancient h5, .heti--ancient h6, .heti--poetry h1, .heti--poetry h2, .heti--poetry h3, .heti--poetry h4, .heti--poetry h5, .heti--poetry h6 { |
|||
font-family:"TemplateStyles CJK Punct","Kaiti SC","STKaiti","KaiTi",Georgia,serif;font-weight:800;text-align:center |
|||
} |
|||
.heti--ancient h1 .heti-meta, .heti--ancient h2 .heti-meta, .heti--ancient h3 .heti-meta, .heti--ancient h4 .heti-meta, .heti--ancient h5 .heti-meta, .heti--ancient h6 .heti-meta, .heti--poetry h1 .heti-meta, .heti--poetry h2 .heti-meta, .heti--poetry h3 .heti-meta, .heti--poetry h4 .heti-meta, .heti--poetry h5 .heti-meta, .heti--poetry h6 .heti-meta { |
|||
font-weight:400 |
|||
} |
|||
@media screen and (min-width: 640px){ |
|||
.heti--ancient h1 .heti-meta, .heti--ancient h2 .heti-meta, .heti--ancient h3 .heti-meta, .heti--ancient h4 .heti-meta, .heti--ancient h5 .heti-meta, .heti--ancient h6 .heti-meta, .heti--poetry h1 .heti-meta, .heti--poetry h2 .heti-meta, .heti--poetry h3 .heti-meta, .heti--poetry h4 .heti-meta, .heti--poetry h5 .heti-meta, .heti--poetry h6 .heti-meta { |
|||
position:absolute;line-height:inherit;text-indent:0;display:inline;margin-top:4px;margin-left:8px |
|||
} |
|||
} |
|||
.heti--ancient .heti-meta, .heti--poetry .heti-meta { |
|||
line-height:24px;text-align:center;text-indent:0 |
|||
} |
|||
.heti--ancient p { |
|||
text-indent:2em |
|||
} |
} |
||
.heti--poetry p { |
.heti--poetry p { |
||
text-align:center;text-indent:0 |
text-align:center;text-indent:0 |
||
} |
} |
||
.heti--annotation p { |
|||
margin-top:0;margin-bottom:0;line-height:2.25;text-indent:2em |
|||
} |
|||
.heti--annotation em { |
|||
text-emphasis:filled circle;text-emphasis-position:under right;font-weight:400 |
|||
} |
|||
.heti--annotation em:not(:lang(zh)):not(:lang(ja)):not(:lang(ko)), .heti--annotation em:not(:lang(zh)) { |
|||
text-emphasis:none |
|||
} |
|||
.heti--annotation .heti-meta { |
|||
margin-top:12px;margin-bottom:24px |
|||
} |
|||
.heti-meta { |
|||
display:block;text-indent:0 |
|||
} |
|||
.heti-verse { |
|||
text-align:center;text-indent:0 |
|||
} |
|||
.heti-large { |
|||
font-size:18px;line-height:24px |
|||
} |
|||
.heti-x-large { |
|||
font-size:20px;line-height:30px;letter-spacing:.05em |
|||
} |
|||
.heti-small { |
|||
font-size:14px;line-height:24px |
|||
} |
|||
.heti-x-small { |
|||
font-size:12px;line-height:18px |
|||
} |
|||
.heti-list-latin { |
|||
list-style-type:upper-latin |
|||
} |
|||
.heti-list-latin ol { |
|||
list-style-type:lower-roman |
|||
} |
|||
.heti-list-latin ol ol { |
|||
list-style-type:lower-latin |
|||
} |
|||
.heti-list-han { |
|||
} |
|||
.heti-list-han ol { |
|||
list-style-type:decimal |
|||
} |
|||
.heti-list-han ol ol { |
|||
list-style-type:decimal-leading-zero |
|||
} |
|||
.heti-fn { |
|||
margin-top:59px;border-top:1px solid;border-top-color:#ccc;font-size:14px;font-family:"TemplateStyles CJK Punct","TemplateStyles CJK Body",Georgia,-apple-system,"Nimbus Roman No9 L","PingFang SC","Hiragino Sans GB","Noto Serif SC","Microsoft YaHei UI","WenQuanYi Micro Hei","ST Heiti",sans-serif;line-height:24px |
|||
} |
|||
.heti-fn ol { |
|||
margin-top:12px;margin-bottom:0 |
|||
} |
|||
.heti-fn li:target { |
|||
background-color:#dbedff |
|||
} |
|||
.heti-hang { |
|||
position:absolute;line-height:inherit;text-indent:0 |
|||
} |
|||
.heti-em { |
|||
text-emphasis:filled circle;text-emphasis-position:under right |
|||
} |
|||
.heti-em:not(:lang(zh)):not(:lang(ja)):not(:lang(ko)), .heti-em:not(:lang(zh)) { |
|||
text-emphasis:none |
|||
} |
|||
.heti-ruby--inline { |
|||
display:inline-flex;flex-direction:column-reverse;height:1.5em;vertical-align:top |
|||
} |
|||
.heti-ruby--inline rt { |
|||
display:inline;margin-bottom:-0.25em;line-height:1;text-align:center |
|||
}/* ===== 基础正文排版(自 heti 字号阶梯)===== *//* ===== 页面底色与文字色(站点原有)===== *//* ===== 中文标点与中文字体别名 ===== *//* ===== 正文与标题字体栈(引号走全角字体)===== */ |
|||
h1, h2, h3, h4, h5, h6 { |
|||
font-family: "TemplateStyles CJK Punct","TemplateStyles CJK Body",Georgia,-apple-system,"Nimbus Roman No9 L","PingFang SC","Hiragino Sans GB","Noto Serif SC","Microsoft YaHei UI","WenQuanYi Micro Hei","ST Heiti",sans-serif; |
|||
font-weight: 600; |
|||
} |
|||
h2, h3, h4, h5, h6 { font-weight: bold; } |
|||
p { text-indent: 2em; } |
|||
p:not(:lang(zh)) { text-align: start; text-indent: 0; } |
|||
/* ===== 正文段落(仅 p)===== */ |
/* ===== 正文段落(仅 p)===== */ |
||
p { |
p { |
||
font-size: 1.25rem; /* 20px(1.25 × 根字号 16px);原为固定 17px */ |
|||
font-size: 16px; |
|||
line-height: |
line-height: 2; |
||
text-align: justify; |
|||
letter-spacing: .02em; |
|||
overflow-wrap: break-word; |
overflow-wrap: break-word; |
||
word-wrap: break-word; |
word-wrap: break-word; |
||
| 第248行: | 第81行: | ||
text-indent: 2em; |
text-indent: 2em; |
||
color: #202122; |
color: #202122; |
||
font-family: Verdana, Arial, Helvetica, -apple-system, |
|||
font-family: "TemplateStyles CJK Punct","TemplateStyles CJK Body",Georgia,-apple-system,"Nimbus Roman No9 L","PingFang SC","Hiragino Sans GB","Noto Serif SC","Microsoft YaHei UI","WenQuanYi Micro Hei","ST Heiti",sans-serif; |
|||
"PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", |
|||
"SimSun", "SimSun-ExtB", "SimSun-ExtG", |
|||
"Jigmo3", "Jigmo2", "Jigmo", "HanaMinA", "HanaMinB", |
|||
sans-serif; |
|||
} |
} |
||
p:not(:lang(zh)) { |
p:not(:lang(zh)) { |
||
| 第255行: | 第92行: | ||
} |
} |
||
/* ===== 2026-09 补齐(依据 scripts/survey-heti.js --diff)============================== |
|||
/* ===== 标题(仅 h1-h6)===== */ |
|||
参考 Wikisource SKQS 的正文行宽(下方 .heti--line-length)。 |
|||
h1, h2, h3, h4, h5, h6 { |
|||
(.heti-adjacent-* / .heti-spacing-* 间距类、.heti--columns-1/3/4 与 -16em~-48em 共 16 类, |
|||
color: #202122; |
|||
以及 .heti--sans / .heti--hei 黑体类,均已移除:158 个嵌入页零引用。) |
|||
font-family: "TemplateStyles CJK Punct","TemplateStyles CJK Body",Georgia,-apple-system,"Nimbus Roman No9 L","PingFang SC","Hiragino Sans GB","Noto Serif SC","Microsoft YaHei UI","WenQuanYi Micro Hei","ST Heiti",sans-serif; |
|||
================================================================================== */ |
|||
/* 正文行宽 —— 参考 Wikisource SKQS 的 .skqs-body(max-width:42em + 居中); |
|||
heti 的 $line-length 也是 42em(两处独立收敛到同一值)。由 {{图书排版|限宽}} 触发。 */ |
|||
.heti--line-length { |
|||
max-width: 42em; |
|||
margin-inline: auto; |
|||
} |
} |
||
/* ===== 行间注注音(站点原有)===== */ |
|||
/* 诗词 + 多栏、以及 <poem> 的缩进/对齐,统一由下方 .tushu-body 作用域的规则处理 |
|||
ruby { ruby-align: center; } |
|||
(原先这里有两条「版式类 + p」的规则,特异性与 .tushu-body 版相同且被其覆盖,已合并) */ |
|||
ruby rt { font-size: 0.55em; font-weight: normal; } |
|||
/* ===== <poem> 在图书排版容器内自动套用诗排版(2026-09)========================= |
|||
Poem 扩展的 <poem> 只负责“把换行变成 <br>”,本身不带任何诗排版。 |
|||
此前要居中和不缩进必须额外写 |诗词;现在只要放在 {{图书排版}} 的容器里, |
|||
<poem> 的诗行就自动居中、不缩进,可省去 |诗词 参数。 |
|||
(若某处想左对齐,可在该 <poem> 外套一层 <div class="heti--columns-2">, |
|||
多栏语境下通常左对齐更好读——但注意多栏内仍会居中,如需左对齐请说明。) |
|||
============================================================================== */ |
|||
.tushu-body .poem p { |
|||
text-align: center; |
|||
text-indent: 0; |
|||
} |
|||
/* ===== 诗词容器内的段落一律居中且不缩进(2026-09)============================== |
|||
用「.tushu-body + 版式类 + p」(0,2,1)提升特异性,保证诗词容器内的段落 |
|||
一定是居中且不缩进,不受全局或外层规则影响(原先 |古籍/|行间注 与 |诗词 嵌套时, |
|||
外层规则会覆盖诗词的 text-indent:0,使居中文本首行右移 2em)。 |
|||
============================================================================== */ |
|||
.tushu-body .heti--poetry p { |
|||
text-align: center; |
|||
text-indent: 0; |
|||
} |
|||
/* |诗词|双栏(分栏诗词):分栏时诗句改为左对齐。多栏每栏本就窄,居中的诗行左右参差 |
|||
反而难读;标题仍继承 .heti--poetry 的居中(只针对 p,不动 h1–h6)。 */ |
|||
.tushu-body .heti--poetry.heti--columns-2 p { |
|||
text-align: start; |
|||
text-indent: 0; |
|||
} |
|||
/* ===== 多栏内顶部外边距归零(2026-09)========================================== |
|||
多栏里 CSS 无法选中“每一栏的首元素”,而各块级元素自带的 margin-top 不同 |
|||
(h2 是 24px、p 是 6px),导致两栏起始位置错开。把多栏内所有直接子元素的 |
|||
margin-top 归零,各栏即从同一基线开始;段间距改由 margin-bottom 承担。 |
|||
============================================================================== */ |
|||
.heti--columns-2 > * { |
|||
margin-top: 0; |
|||
} |
|||
/* ===== 基础容器 ================================================================ |
|||
.tushu-body 由 Module:图书排版 **总是**输出(无参数时也输出),但本身不设任何样式。 |
|||
保留它的唯一原因是:153 个页面已于 2026-09 加上 {{图书排版/尾}}, |
|||
若模板不输出容器,那些 </div> 会变成孤立的闭合标签。 |
|||
正文限宽已于 2026-09 改回**由 |限宽 参数触发**(见下方 .heti--line-length)。 |
|||
============================================================================== */ |
|||
/* ===== 繁体(zh-Hant):改用繁体系字体栈 ========================================= |
|||
简体走黑体(苹方 SC/雅黑),繁体改用繁体系(正黑體/苹方 TC),与 Vector 皮肤一致。 |
|||
:lang() 匹配大小写不敏感;MediaWiki 繁体变体给出的是 <html lang="zh-Hant">。 */ |
|||
:lang(zh-hant) p, |
|||
:lang(zh-hant) h1, :lang(zh-hant) h2, :lang(zh-hant) h3, :lang(zh-hant) h4, :lang(zh-hant) h5, :lang(zh-hant) h6 { |
|||
font-family: Verdana, Arial, Helvetica, -apple-system, |
|||
"PingFang TC", "Microsoft JhengHei", "Source Han Sans TC", "Noto Sans CJK TC", |
|||
"MingLiU", "PMingLiU", |
|||
"SimSun-ExtB", "SimSun-ExtG", |
|||
"Jigmo3", "Jigmo2", "Jigmo", "HanaMinA", "HanaMinB", |
|||
sans-serif; |
|||
} |
|||
:lang(zh-hant) .heti--serif, :lang(zh-hant) .heti--song, :lang(zh-hant) .heti--poetry { |
|||
font-family: Georgia, |
|||
"Songti TC", "Noto Serif TC", "Source Han Serif TC", "PMingLiU", "MingLiU", |
|||
"SimSun-ExtB", "SimSun-ExtG", |
|||
"Jigmo3", "Jigmo2", "Jigmo", "HanaMinA", "HanaMinB", |
|||
serif; |
|||
} |
|||
2026年9月22日 (二) 21:16的最新版本
/* ===== 字体栈:正文黑体优先,衬线族走宋体 =====
常用字 → 雅黑/苹方(屏幕阅读舒服)
生僻字 → SimSun-ExtB/G / Jigmo / HanaMin
========================================================== */
/* ===== 字体回退栈说明(混合方案)=====
顺序:西文无衬线 → 黑体(系统默认) → 宋体 → 扩展B/G → 生僻字兜底
- 标点跟随正文字体:2026-09 删去标点专用的 @font-face(它原先把标点强制交给宋体
全角,用于修复「引号贴字」);现在引号、逗号等一律用正文字体,简繁各自随其汉字字体。
- 常用字走 "PingFang SC" / "Microsoft YaHei"(黑体,屏幕阅读舒服)
- 生僻字自动往后掉:SimSun-ExtB → SimSun-ExtG → Jigmo → HanaMin
参考 ctext.org 的长栈逻辑。
(宋体栈的西文用 Georgia——与衬线中文协调;黑体栈的西文用 Verdana/Arial——与黑体协调)
========================================================== */
/* 段距:2026-09 删去自身声明,交回站点默认(.mw-body p{margin:0.5em 0 1em 0})。
原先声明的 0.4em/0.5em 特异性低于 .mw-body p,实际从未生效。 */
h1, h2, h3, h4, h5, h6 {
position:relative;margin:0;margin-top:24px;margin-bottom:12px;font-weight:600;
color:#202122;
font-family: Verdana, Arial, Helvetica, -apple-system,
"PingFang SC", "Microsoft YaHei", "Hiragino Sans GB",
"SimSun", "SimSun-ExtB", "SimSun-ExtG",
"Jigmo3", "Jigmo2", "Jigmo", "HanaMinA", "HanaMinB",
sans-serif;
}
h2, h3, h4, h5, h6 { font-weight: bold; }
/* 标题阶梯:按正文 20px(1.25rem)重定,字号全部用 rem 相对根字号;行高统一 1.4 倍。
原阶梯 32/28/24/20/18/16px 是在正文 17px 下设的,正文放大到 20px 后 h6(16px) 会小于正文,
且原行高是固定 px、比例不齐(h4 为 1.2、h6 为 1.5);改用倍数后随字号缩放。 */
h1 {
margin-bottom:24px;font-size:2.25rem;line-height:1.4
}
h2 {
font-size:1.875rem;line-height:1.4
}
h3 {
font-size:1.625rem;line-height:1.4
}
h4 {
font-size:1.5rem;line-height:1.4
}
h5 {
font-size:1.375rem;line-height:1.4
}
h6 {
font-size:1.25rem;line-height:1.4
}
h1+h2, h2+h3, h3+h4, h4+h5, h5+h6 {
margin-top:12px
}
.heti--serif, .heti--song, .heti--poetry {
font-family: Georgia,
"SimSun", "Songti SC", "Noto Serif SC",
"PMingLiU", "PMingLiu-ExtB", "SimSun-ExtB", "SimSun-ExtG", 新細明體,
"Jigmo3", "Jigmo2", "Jigmo", "HanaMinA", "HanaMinB",
serif
}
.heti--columns-2 {
max-width:none;column-gap:2em;column-count:2
}
.heti--columns-2 p {
margin-top:6px;margin-bottom:12px;text-indent:2em
}
/* 诗词标题:2026-09 起不再用楷体(楷体版式已整体移除),改为继承容器的宋体栈,仍居中加粗。 */
.heti--poetry h1, .heti--poetry h2, .heti--poetry h3, .heti--poetry h4, .heti--poetry h5, .heti--poetry h6 {
font-family:inherit;font-weight:800;text-align:center
}
.heti--poetry p {
text-align:center;text-indent:0
}
/* ===== 正文段落(仅 p)===== */
p {
font-size: 1.25rem; /* 20px(1.25 × 根字号 16px);原为固定 17px */
line-height: 2;
text-align: justify;
overflow-wrap: break-word;
word-wrap: break-word;
hyphens: auto;
text-indent: 2em;
color: #202122;
font-family: Verdana, Arial, Helvetica, -apple-system,
"PingFang SC", "Microsoft YaHei", "Hiragino Sans GB",
"SimSun", "SimSun-ExtB", "SimSun-ExtG",
"Jigmo3", "Jigmo2", "Jigmo", "HanaMinA", "HanaMinB",
sans-serif;
}
p:not(:lang(zh)) {
text-align: start;
text-indent: 0;
}
/* ===== 2026-09 补齐(依据 scripts/survey-heti.js --diff)==============================
参考 Wikisource SKQS 的正文行宽(下方 .heti--line-length)。
(.heti-adjacent-* / .heti-spacing-* 间距类、.heti--columns-1/3/4 与 -16em~-48em 共 16 类,
以及 .heti--sans / .heti--hei 黑体类,均已移除:158 个嵌入页零引用。)
================================================================================== */
/* 正文行宽 —— 参考 Wikisource SKQS 的 .skqs-body(max-width:42em + 居中);
heti 的 $line-length 也是 42em(两处独立收敛到同一值)。由 {{图书排版|限宽}} 触发。 */
.heti--line-length {
max-width: 42em;
margin-inline: auto;
}
/* 诗词 + 多栏、以及 <poem> 的缩进/对齐,统一由下方 .tushu-body 作用域的规则处理
(原先这里有两条「版式类 + p」的规则,特异性与 .tushu-body 版相同且被其覆盖,已合并) */
/* ===== <poem> 在图书排版容器内自动套用诗排版(2026-09)=========================
Poem 扩展的 <poem> 只负责“把换行变成 <br>”,本身不带任何诗排版。
此前要居中和不缩进必须额外写 |诗词;现在只要放在 {{图书排版}} 的容器里,
<poem> 的诗行就自动居中、不缩进,可省去 |诗词 参数。
(若某处想左对齐,可在该 <poem> 外套一层 <div class="heti--columns-2">,
多栏语境下通常左对齐更好读——但注意多栏内仍会居中,如需左对齐请说明。)
============================================================================== */
.tushu-body .poem p {
text-align: center;
text-indent: 0;
}
/* ===== 诗词容器内的段落一律居中且不缩进(2026-09)==============================
用「.tushu-body + 版式类 + p」(0,2,1)提升特异性,保证诗词容器内的段落
一定是居中且不缩进,不受全局或外层规则影响(原先 |古籍/|行间注 与 |诗词 嵌套时,
外层规则会覆盖诗词的 text-indent:0,使居中文本首行右移 2em)。
============================================================================== */
.tushu-body .heti--poetry p {
text-align: center;
text-indent: 0;
}
/* |诗词|双栏(分栏诗词):分栏时诗句改为左对齐。多栏每栏本就窄,居中的诗行左右参差
反而难读;标题仍继承 .heti--poetry 的居中(只针对 p,不动 h1–h6)。 */
.tushu-body .heti--poetry.heti--columns-2 p {
text-align: start;
text-indent: 0;
}
/* ===== 多栏内顶部外边距归零(2026-09)==========================================
多栏里 CSS 无法选中“每一栏的首元素”,而各块级元素自带的 margin-top 不同
(h2 是 24px、p 是 6px),导致两栏起始位置错开。把多栏内所有直接子元素的
margin-top 归零,各栏即从同一基线开始;段间距改由 margin-bottom 承担。
============================================================================== */
.heti--columns-2 > * {
margin-top: 0;
}
/* ===== 基础容器 ================================================================
.tushu-body 由 Module:图书排版 **总是**输出(无参数时也输出),但本身不设任何样式。
保留它的唯一原因是:153 个页面已于 2026-09 加上 {{图书排版/尾}},
若模板不输出容器,那些 </div> 会变成孤立的闭合标签。
正文限宽已于 2026-09 改回**由 |限宽 参数触发**(见下方 .heti--line-length)。
============================================================================== */
/* ===== 繁体(zh-Hant):改用繁体系字体栈 =========================================
简体走黑体(苹方 SC/雅黑),繁体改用繁体系(正黑體/苹方 TC),与 Vector 皮肤一致。
:lang() 匹配大小写不敏感;MediaWiki 繁体变体给出的是 <html lang="zh-Hant">。 */
:lang(zh-hant) p,
:lang(zh-hant) h1, :lang(zh-hant) h2, :lang(zh-hant) h3, :lang(zh-hant) h4, :lang(zh-hant) h5, :lang(zh-hant) h6 {
font-family: Verdana, Arial, Helvetica, -apple-system,
"PingFang TC", "Microsoft JhengHei", "Source Han Sans TC", "Noto Sans CJK TC",
"MingLiU", "PMingLiU",
"SimSun-ExtB", "SimSun-ExtG",
"Jigmo3", "Jigmo2", "Jigmo", "HanaMinA", "HanaMinB",
sans-serif;
}
:lang(zh-hant) .heti--serif, :lang(zh-hant) .heti--song, :lang(zh-hant) .heti--poetry {
font-family: Georgia,
"Songti TC", "Noto Serif TC", "Source Han Serif TC", "PMingLiU", "MingLiU",
"SimSun-ExtB", "SimSun-ExtG",
"Jigmo3", "Jigmo2", "Jigmo", "HanaMinA", "HanaMinB",
serif;
}