/* ==========================================================================
   自定义样式（NeXT 主题，通过 params.customFilePath.style 加载）
   仅保留对本站内容有实际价值的规则；选择器尽量作用于 KaTeX / function-plot
   自身的稳定类名，避免依赖主题私有类。
   ========================================================================== */

/* 宽数学公式（多矩阵并排、AdamW 更新式等）在窄屏可横向滚动，
   不撑破正文。KaTeX 块级公式渲染为 .katex-display */
.katex-display {
  overflow-x: auto;
  overflow-y: hidden;
  padding-top: 0.2em;
  padding-bottom: 0.2em;
}

/* KaTeX 字号：行内略小于正文，块级与正文齐平。
   auto-render 在运行时动态插入 katex.min.css（含 .katex{font:1.21em}），
   其 <link> 排在本文件之后、优先级相同，会覆盖普通规则，故用 !important 强制生效。 */
.katex {
  font-size: 0.95em !important;
}
.katex-display > .katex {
  font-size: 1.1em !important;
}

/* ===== 中文段首缩进 ===== */
/* 仅正文的直接段落首行缩进 2 字符（中文排版惯例）。
   用子选择器 > p 限定为正文直接段落，天然排除 blockquote、列表项内的段落；
   代码块 <pre>、表格、以及块级公式（$$ 渲染后为 .post-body 的裸节点，不在 <p> 内）
   均非直接 <p>，本就不受影响。 */
.post-body > p {
  text-indent: 2em;
}

/* ===== function-plot 函数图 ===== */
.fplot-figure {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}
.fplot {
  max-width: 100%;
}
.fplot svg {
  margin: 0 auto;
}

/* ===== 表格居中 ===== */
/* 表格块水平居中、内容宽度收缩；表头与单元格文字居中 */
.post-body table {
  width: fit-content;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
}
.post-body table th,
.post-body table td {
  text-align: center;
}
