/* ==========================================================================
   桌面端全站字体层级规范  typography.css
   ==========================================================================
   为什么要单独有这个文件：
     1. BookStack 默认的 h1~h5 用的是 em 单位（h1=3.425em、h2=2.8275em、
        h3=2.333em、h4=1.666em、h5=1.4em），会跟着 body 字号成倍放大。
        themes/bookstack_cn/functions.php 曾把 body 注入成 22px，
        于是 h1 实际渲染到 75px、h5 到 31px，各页面观感彻底失控。
     2. 主题 CSS 里还有 rem 单位，html 根字号被注入成 22px 时会被放大 1.375 倍。

   本文件做什么：
     把桌面端字号收敛成一套固定层级（显式 px + !important），
     尺度对齐首页 home.css 的 24 / 20 / 18 / 16 / 15 / 14 / 13 / 12。

   层级表：
     首页 hero 区块标题  .section-title ................ 28px
     页面主标题  h1 .................................. 24px
     页面区块    h2 .................................. 20px
     卡片区块    .list-heading ....................... 18px
     卡片标题    h3 .................................. 18px
     小标题      h4 .................................. 16px
     侧栏小标题  h5 .................................. 14px
     最小标题    h6 .................................. 13px
     正文        body / p / li / td .................. 14px
     元信息      .text-muted ......................... 13px
     辅助小字    small / .text-small / .meta ......... 12px

   加载时机（functions.php）：
     只在「桌面端 + 非阅读页」注入本文件。
     阅读页（/books/*/page/*、/pages/*）的字号由阅读器的 A+/A- 控制，
     不加载本文件，避免把用户选的字号钉死。

   ⚠️ 维护提示：本项目的字号会被阅读器设置污染（html/body 曾被注入 22px），
      所以这里一律写「显式 px + !important」，不要依赖继承，也不要用 em/rem。
   ========================================================================== */

/* --------------------------------------------------------------------------
   0. 根字号回到 1:1，避免 rem 被放大 1.375 倍
   -------------------------------------------------------------------------- */
html {
    font-size: 16px !important;
}

/* --------------------------------------------------------------------------
   1. 正文基准
   -------------------------------------------------------------------------- */
body {
    font-size: 14px !important;
    line-height: 1.7 !important;
}

p, li, dd, dt, blockquote, label, legend, figcaption, td, th {
    font-size: 14px;
}

.page-content {
    font-size: 14px !important;
    line-height: 1.75 !important;
}

/* --------------------------------------------------------------------------
   2. 标题层级 24 / 20 / 16 / 15 / 14 / 13
   -------------------------------------------------------------------------- */
h1 {
    font-size: 24px !important;
    line-height: 1.4 !important;
    font-weight: 600 !important;
}

h2 {
    font-size: 20px !important;
    line-height: 1.4 !important;
    font-weight: 600 !important;
}

h3 {
    font-size: 18px !important;
    line-height: 1.5 !important;
    font-weight: 600 !important;
}

h4 {
    font-size: 16px !important;
    line-height: 1.5 !important;
    font-weight: 600 !important;
}

h5 {
    font-size: 14px !important;
    line-height: 1.5 !important;
    font-weight: 600 !important;
}

h6 {
    font-size: 13px !important;
    line-height: 1.5 !important;
    font-weight: 600 !important;
}

/* 首页 hero 区块标题（「继续阅读」「大家都在看」…）
   原来写的是 1.4em，会随 body 字号漂移（22px 时 = 30.8px）；
   这里固定成 28px，首页观感基本不变，也不再依赖 body 字号 */
.section-title {
    font-size: 28px !important;
    line-height: 1.3 !important;
}

/* 卡片/区块标题：比 h2 低一档，和 h2 拉开层次
   （BookStack 里 .list-heading 原本是 2rem / h2.list-heading 是 1.333rem，两套混用） */
.list-heading {
    font-size: 18px !important;
    line-height: 1.4 !important;
    font-weight: 600 !important;
}

h2.list-heading {
    font-size: 18px !important;
}

/* --------------------------------------------------------------------------
   3. 元信息 / 辅助小字
   -------------------------------------------------------------------------- */
.text-muted {
    font-size: 13px !important;
}

small, p.small, span.small, .small, .text-small, .meta {
    font-size: 12px !important;
}

/* --------------------------------------------------------------------------
   4. 覆盖 BookStack 的 em / rem 文字工具类
   -------------------------------------------------------------------------- */
.text-bigger {
    font-size: 15px !important;
}

.text-large {
    font-size: 17px !important;
}

/* 列表项：名称 15px、摘要 13px、活动条目 13px */
.entity-list-item-name {
    font-size: 15px !important;
}

.entity-list-item p {
    font-size: 13px !important;
}

.activity-list-item {
    font-size: 13px !important;
}

/* 表格与代码块跟随正文，不要被 em 放大 */
table {
    font-size: 14px !important;
}

pre, code, .code-base {
    font-size: 13px !important;
}
