/* ============================================================
   1. 字体声明 (Font Declaration)
   说明：告诉浏览器本地字体文件的位置。
   路径 ../fonts/ 表示从当前 css 文件夹向上跳一级，再进入 fonts 文件夹。
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@600;700;800&family=Source+Serif+4:opsz,wght@8..60,400;8..60,500;8..60,600&display=swap');

@font-face {
  font-family: 'LXGW WenKai Screen';
  /* 确保文件名与你文件夹中的 .ttf 文件名大小写完全一致 */
  src: url('../fonts/LXGWWenKaiMonoScreen.ttf') format('truetype');
  font-display: swap; /* 性能优化：字体加载前先用系统字体占位，防止白屏 */
}

/* 仅用于中文字符，确保正文中文优先走 LXGW WenKai */
@font-face {
  font-family: 'LXGW WenKai Screen CJK';
  src: url('../fonts/LXGWWenKaiMonoScreen.ttf') format('truetype');
  font-display: swap;
  unicode-range: U+2E80-2EFF, U+2F00-2FDF, U+3000-303F, U+31C0-31EF, U+3200-32FF, U+3300-33FF, U+3400-4DBF, U+4E00-9FFF, U+F900-FAFF, U+FF00-FFEF;
}

/* ============================================================
   2. 全局变量与正文设置 (Global & Body Styles)
   说明：定义基础字号、行高及首选字体序列。
   ============================================================ */
:root {
  /* 定义主题基础字号变量 */
  --md-typeset-font-size: 0.9rem;
  --strong-text-color: #1f6f8b;
  --md-code-font-family: 'Consolas', 'SFMono-Regular', 'Liberation Mono', 'Menlo', monospace;
}

body, .md-typeset {
  /* 英文优先 Source Serif 4，中文字符优先 LXGW WenKai */
  font-family: 'Source Serif 4', 'LXGW WenKai Screen CJK', 'Noto Serif SC', 'LXGW WenKai Screen', 'Georgia', 'Times New Roman', serif;
  font-size: 0.9rem; /* 按照你的要求调小正文字号 */
  line-height: 1.6;  /* 增加行高，提升阅读舒适度 */
}

[data-md-color-scheme="slate"] {
  --strong-text-color: #9fd6e1;
}

/* Markdown 加粗文本着色 */
.md-typeset p strong,
.md-typeset li strong,
.md-typeset td strong,
.md-typeset blockquote strong,
.md-typeset .admonition strong,
.md-typeset details strong {
  color: var(--strong-text-color);
}

/* ============================================================
   3. 提示框适配 (Admonition Styles)
   说明：针对 !!! success, !!! note 等提示框的字体微调。
   ============================================================ */
/* 调整提示框内部正文的大小 */
.md-typeset .md-admonition, 
.md-typeset .admonition {
  font-size: 0.9rem;      
  line-height: 1.6;     
}

.md-typeset details {
  font-size: 0.9rem;
  line-height: 1.6;
}

/* 调整提示框标题的大小 */
.md-typeset .admonition-title, 
.md-typeset summary {
  font-size: 0.9rem !important;
  font-weight: 700; /* 加粗标题，使其在小字号下依然醒目 */
}

/* ============================================================
   4. 代码块适配 (Code Styles)
   说明：针对行内代码和块级代码的字号调整。
   ============================================================ */
/* 调整行内代码 (如 `code`) 字号 */
.md-typeset code {
  font-size: 0.85em; 
  font-family: var(--md-code-font-family);
}

/* 行内代码空格友好：适合你已手动加空格的写法，避免看起来过松
.md-typeset :not(pre) > code {
  margin-left: 0;
  margin-right: 0;
  padding-left: 0.14em;
  padding-right: 0.14em;
} */

/* 调整大块代码区域 (Code blocks) 字号 */
.md-typeset pre code {
  font-size: 0.9em;  
  font-family: var(--md-code-font-family) !important; /* 强制代码使用等宽字体 */
}

.md-typeset details pre code {
  font-size: 0.9em;
}

/* ============================================================
   5. 表格字号适配 (Table Font Size)
   说明：覆盖 Material 对 Markdown 表格的默认缩小设置，使其接近正文大小。
   ============================================================ */
.md-typeset__table,
.md-typeset table:not([class]) {
  font-size: 0.9rem;
}

.md-typeset table:not([class]) th,
.md-typeset table:not([class]) td {
  font-size: inherit;
}

/* ============================================================
   6. 页脚时间戳适配 (Footer Timestamp)
   说明：确保页面底部的时间戳也同步使用新字体。
   ============================================================ */
.md-source-file {
  font-family: 'LXGW WenKai Screen', sans-serif;
  font-size: 0.75rem; /* 页脚信息通常比正文略小 */
  color: var(--md-default-fg-color--light);
}

/* ============================================================
   7. 标题增强 (Heading Styles)
   说明：让 Markdown 标题（# ~ ######）在视觉上更醒目。
   ============================================================ */
:root {
  --heading-accent: #2f8ea1;
  --heading-main: #1f6f8b;
  --heading-sub: #0f4f73;
  --heading-font: 'Noto Serif SC', 'Source Han Serif SC', 'Songti SC', serif;
}

[data-md-color-scheme="slate"] {
  --heading-accent: #6fb8c6;
  --heading-main: #9fd6e1;
  --heading-sub: #d7ecf2;
}

.md-typeset h1,
.md-typeset h2,
.md-typeset h3,
.md-typeset h4,
.md-typeset h5,
.md-typeset h6 {
  font-family: var(--heading-font);
  letter-spacing: 0.02em;
  line-height: 1.3;
}

.md-typeset h1 {
  color: var(--heading-sub);
  font-size: 1.95em;
  font-weight: 800;
  border-left: 0.25rem solid var(--heading-accent);
  padding-left: 0.6rem;
  margin-top: 1.2em;
}

.md-typeset h2 {
  color: var(--heading-sub);
  font-size: 1.45em;
  font-weight: 760;
  border-bottom: 0.12rem solid color-mix(in srgb, var(--heading-accent) 70%, transparent);
  padding-bottom: 0.2rem;
}

.md-typeset h3 {
  color: var(--heading-main);
  font-size: 1.2em;
  font-weight: 720;
}

.md-typeset h4,
.md-typeset h5,
.md-typeset h6 {
  color: var(--heading-sub);
  font-weight: 680;
}

/* 同步强化标题锚点图标颜色 */
.md-typeset .headerlink {
  color: var(--heading-accent);
}


/* ============================================================
   8. 目录字号增强 (Sidebar Font Size Enhancement)
   ============================================================ */
/* 左右侧目录字号增强 */
.md-sidebar--primary .md-nav__link {
    font-size: 0.86rem;
    line-height: 1.5;
}

.md-sidebar--primary .md-nav__item .md-nav__item .md-nav__link {
    font-size: 0.82rem;
}

.md-sidebar--secondary .md-nav__link {
    font-size: 0.8rem;
    line-height: 1.45;
}

