/* ===== 字体：统一现代无衬线风格（中英文一致），代码用等宽字体 ===== */

/* 全局无衬线字体栈：中文在 Windows 走微软雅黑、Mac 走苹方，避免 fallback 成宋体衬线体 */
:root {
  --site-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC",
    sans-serif;
  --site-mono: "JetBrains Mono Variable", "JetBrains Mono", "Cascadia Code",
    Consolas, Menlo, monospace;

  /* 同时覆盖 Material 的字体变量（main.css 通过 var() 引用） */
  --md-text-font-family: var(--site-sans);
  --md-code-font-family: var(--site-mono);
}

/* 直接作用于真实元素，用 !important 确保不被主题默认样式或变量缺省覆盖 */
body,
input,
button,
.md-typeset,
.md-header,
.md-tabs,
.md-nav,
.md-nav__link,
.md-typeset h1,
.md-typeset h2,
.md-typeset h3,
.md-typeset h4,
.md-typeset h5,
.md-typeset h6 {
  font-family: var(--site-sans) !important;
}

/* 代码块与行内代码保持等宽字体 */
code,
pre,
kbd,
.md-typeset code,
.md-typeset pre,
.md-typeset kbd,
.highlight span {
  font-family: var(--site-mono) !important;
}

/* ===== 布局：加宽正文区域，接近参考站的阅读宽度 ===== */
.md-grid {
  max-width: 1500px;
}

/* ===== 图片：限制显示尺寸，避免占满整行 ===== */
.md-typeset img {
  display: block;
  margin: 1.2rem auto;
  max-width: 60%;
  max-height: 50vh;
}

/* ===== 字号 ===== */

/* 正文基础字号 */
.md-typeset {
  font-size: 0.7rem; /* ~14px */
  line-height: 1.65;
}

/* 代码块与行内代码字号：与正文一致 */
.md-typeset code,
.md-typeset pre {
  font-size: 1em;
}

/* ===== 标题：加粗 + 拉开层级梯度，简洁不花哨 ===== */
.md-typeset h1,
.md-typeset h2,
.md-typeset h3,
.md-typeset h4 {
  font-weight: 700;
  line-height: 1.3;
}

.md-typeset h1 {
  font-size: 1.6rem; /* ~32px */
  margin: 0 0 0.8em;
}

.md-typeset h2 {
  font-size: 1.4rem; /* ~28px */
  font-weight: 600;
  margin: 1.6em 0 0.6em;
}

.md-typeset h3 {
  font-size: 1.15rem; /* ~23px */
  font-weight: 600;
  margin: 1.4em 0 0.5em;
}

.md-typeset h4 {
  font-size: 1rem; /* ~20px */
  font-weight: 600;
}
