/* 中文排版优化：
   1) "CJK Punct" 虚拟字体仅覆盖弯引号、破折号、间隔号、省略号等
      "西文字体里也有、但按西文排版在中文中很丑"的标点码位，
      强制这些字符由本地中文字体渲染（全宽引号、居中间隔号）。
      须放在正文栈最前，靠 unicode-range 抢先命中这些码位。
   2) --bs-body-font-family 补齐各平台中文字体兜底
      （simplex 原栈止于 Arial/sans-serif，汉字全靠浏览器隐式回退）。 */
@font-face {
  font-family: "CJK Punct";
  /* Chrome local() 只匹配全名/PostScript 名，不匹配家族名；
     每个字体同时写显示名 + PS 名，跨 CoreText/DirectWrite 兼容 */
  src:
    local("PingFang SC"), local("PingFangSC-Regular"),
    local("Hiragino Sans GB"), local("HiraginoSansGB-W3"),
    local("Microsoft YaHei"), local("MicrosoftYaHei"),
    local("Microsoft JhengHei"), local("MicrosoftJhengHei"),
    local("Noto Sans CJK SC"), local("NotoSansCJKsc-Regular"),
    local("Source Han Sans SC"), local("SourceHanSansSC-Regular"),
    local("WenQuanYi Micro Hei"), local("WenQuanYiMicroHei-Regular");
  unicode-range: U+00B7, U+2013-2014, U+2018-2019, U+201C-201D, U+2026-2027, U+30FB;
}

:root {
  --bs-body-font-family:
    "CJK Punct", "Open Sans", -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, "Helvetica Neue", Arial,
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Microsoft JhengHei",
    "Noto Sans CJK SC", "Source Han Sans SC", "WenQuanYi Micro Hei",
    sans-serif;
  --bs-font-monospace:
    SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New",
    "PingFang SC", "Microsoft YaHei", monospace;
}

.chapter-number::before {
  content: "第";
}

.chapter-number::after {
  content: "章";
}

em {
  font-style: normal;
  color: #4a5568;
}

#quarto-content img {
  max-width: 100%;
  height: auto;
}

/* 表头单元格顶对齐：带 <br> 的多行表头旁，短表头（如"年"）与长表头顶部齐平；
   浏览器默认 th 垂直居中 */
th {
  vertical-align: top;
}

/* 表尾注释（display_df 的"截至"行、章节内表格注，独立于表格之外的段落）：
   小字弱化于题注；灰色由行内 em 提供；
   负上边距抵消 float/表格的下边距，使注释贴近表格而非下文 */
.tbl-note {
  font-size: 0.8rem;
  margin-top: -0.8em;
  margin-bottom: 1em;
}

/* 图/表题注统一居中：Quarto 内置样式只给 quarto-float-tbl 的题注设了
   text-align:center，图题注默认左对齐，补上使其一致（EPUB 同生效） */
figcaption.quarto-float-caption {
  text-align: center;
}

/* 引言/题词的署名行右对齐（PDF 端另用 =latex 的 flushright，见章节内用法） */
.epigraph-author {
  text-align: right;
}

.csl-bib-body {
  font-size: 0.9em;
  line-height: 1.6;
  color: #4a5568;
}

.csl-entry {
  margin-bottom: 0.8em;
  padding-left: 2em;
  text-indent: -2em;
}

.csl-entry a {
  color: #2b6cb0;
  text-decoration: none;
}

.csl-entry a:hover {
  text-decoration: underline;
}
