/* ===== FOUT 防护：字体未就绪时隐藏正文，就绪后淡入 ===== */
/* html:not(.fonts-ready) .l_body {
  opacity: 0;
}
html.fonts-ready .l_body {
  opacity: 1;
  transition: opacity 0.1s ease;
} */

/* ===== 字体加载（Medium / SemiBold 作为常规字重） ===== */

@font-face {
  font-family: 'LXGW WenKai';
  src: url('/fonts/LXGWWenKaiScreen.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Klee One';
  src: url('/fonts/KleeOne-SemiBold.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ===== 伪加粗 ===== */
/* 只声明 normal，不声明 bold @font-face → 浏览器自动合成粗体 */
body {
  font-synthesis: weight style !important;
}

article.md-text strong,
article.md-text b,
article.md-text h1,
article.md-text h2,
article.md-text h3,
article.md-text h4,
article.md-text h5,
article.md-text h6 {
  -webkit-text-stroke: 0.5px currentColor !important; 
  font-weight: 600;
}

/* ===== 伪斜体 ===== */
.fake-italic {
  font-style: oblique 10deg !important; /* 强制使用倾斜伪造斜体 */
}

/* ===== 日语文本 ===== */
:lang(ja) {
  font-family: 'Klee One', 'LXGW WenKai', system-ui, sans-serif !important;
}

/* ===== 数学公式部分 ===== */
/* 强制行间公式容器可滚动 */
.katex-display {
  overflow-x: auto;
  overflow-y: hidden;
  /* 使用 CSS 变量，深浅色自动切换 */
  scrollbar-color: rgba(128, 128, 128, 0.4) transparent;  /* Firefox */
}

/* Webkit 内核（Chrome/Edge/Safari） */
.katex-display::-webkit-scrollbar {
  height: 6px;
  background: transparent;
}

.katex-display::-webkit-scrollbar-thumb {
  background: rgba(128, 128, 128, 0.4);  /* 半透明灰色，深浅通用 */
  border-radius: 3px;
  border: 1px solid transparent;  /* 增加点击区域 */
  background-clip: padding-box;
}

.katex-display::-webkit-scrollbar-thumb:hover {
  background: rgba(128, 128, 128, 0.7);
}

/* 鼠标悬停在公式区域时才显示滚动条（更优雅） */
.katex-display:not(:hover)::-webkit-scrollbar {
  height: 3px;  /* 变细 */
  opacity: 0.5;
}

/* 大定界符（括号等）确保不被 clip */
.katex .delimsizing,
.katex .vlist-t,
.katex .vlist-r,
.katex .vlist {
  overflow: visible !important;
}

/* 留存行间距 */
.katex-display {
  padding: 0.5em 0 !important;
}