/* 网页楷体：霞鹜文楷（LXGW WenKai） */
@font-face {
  font-family: "LXGW WenKai";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/LXGWWenKai-Regular.woff2") format("woff2"),
       url("/assets/fonts/LXGWWenKai-Regular.woff") format("woff"),
       url("/assets/fonts/LXGWWenKai-Regular.ttf") format("truetype");
  /* 仅限常用中日韩字符范围，避免影响英文的 Verdana 渲染 */
  unicode-range: U+3000-303F, U+3400-4DBF, U+4E00-9FFF, U+FF00-FFEF, U+20000-2A6DF;
}

/* 全局字体设置：英文使用 Verdana，中文使用系统默认字体 */
body {
  font-family: Verdana, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
  text-autospace: normal;
}

/* 在文章页优先使用 Verdana 显示英文，中文使用楷体系列 */
.single {
  font-family: Verdana,
    /* Kai-family fallbacks across platforms */
    "Kaiti SC", "Kaiti TC", "STKaiti", KaiTi, "楷体", "BiauKai", "DFKai-SB", "AR PL UKai CN", "AR PL UKai TW",
    -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, serif;
}

/* 对正文内容应用混排：Latin 优先 Verdana，CJK 优先楷体，之后再回退 */
.single, .single body, .single .content, .single article {
  font-family: Verdana,
    /* Web 楷体优先，确保跨设备一致 */
    "LXGW WenKai",
    /* Kai-family fallbacks across platforms */
    "Kaiti SC", "Kaiti TC", "STKaiti", KaiTi, "楷体", "BiauKai", "DFKai-SB", "AR PL UKai CN", "AR PL UKai TW",
    "PingFang SC", -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, serif;
}

/* 提升文章页正文字号一点点，增强中文可读性 */
.single {
  font-size: 1.0625rem; /* ≈ 17px */
  line-height: 1.7;
}

/* 代码与等宽字体不受影响 */
code, pre, kbd, samp {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace !important;
}

/* 去掉文章标题的斜体 */
.toc-line > a {
  font-style: normal;
}

/* 文章列表样式 */
.post-item {
  line-height: 2.0;
  margin-bottom: 1em;
}

.post-date {
  color: #666;
  margin-right: 0.5em;
}

.post-separator {
  color: #999;
  margin-right: 0.5em;
}

.post-title {
  font-style: normal;
}

/* 隐藏文章中的目录 */
#TableOfContents {
  display: none;
}

/* 去掉四个角的瞄准线 */
.crop-h, .crop-v, .crop-c {
  display: none;
}

/* 去掉页面左上角的灰色图形背景水印 */
body::before,
body::after,
h1.title::before {
  display: none !important;
}

/* 在文章页面隐藏底部的 Categories, Tags, Subscribe, Back to Top */
.single .menu-bottom {
  display: none;
}

/* footer 上方的虚线样式 - post list 和 single post 页面共享 */
hr {
  border: none;
  border-top: 1px dashed #ccc;
  margin: 2em 0 0 0;  /* 上边距 2em，下边距 0 */
}

/* 确保 footer 紧跟虚线，无额外间距 */
hr + footer {
  margin-top: 0 !important;
  padding-top: 0.5em;
}

footer.small {
  margin-top: 0;
}

/* 让代码块与文本同宽 */
pre, table, .fullwidth {
  width: 100% !important;
  max-width: var(--text-width) !important;
  margin-left: auto !important;
  margin-right: auto !important;
  box-sizing: border-box !important;
}

/* 确保代码块不溢出容器 */
.highlight, .chroma {
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: auto !important;
  box-sizing: border-box !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
}

.highlight pre, .chroma pre {
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: auto !important;
  white-space: pre !important;
  word-wrap: normal !important;
  word-break: normal !important;
  overflow-wrap: normal !important;
  margin: 0 !important;
  padding: 1em !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
}

/* 移除所有可能的阴影和边框 */
.highlight, .chroma, .highlight pre, .chroma pre {
  box-shadow: none !important;
  border: none !important;
  outline: none !important;
  text-shadow: none !important;
  filter: none !important;
}

/* 覆盖主题的阴影变量 */
:root {
  --box-shadow: none !important;
}

/* 确保代码块完全扁平 */
.highlight, .chroma {
  --box-shadow: none !important;
  box-shadow: none !important;
}

/* 确保代码永远不换行 */
.highlight, .chroma, .highlight pre, .chroma pre, .highlight code, .chroma code {
  white-space: pre !important;
  word-wrap: normal !important;
  word-break: normal !important;
  overflow-wrap: normal !important;
  white-space: pre !important;
}

/* 确保代码行不换行 */
.chroma .line, .chroma .cl {
  white-space: pre !important;
  word-wrap: normal !important;
  word-break: normal !important;
  overflow-wrap: normal !important;
}

/* 处理没有语言指定的代码块 (plain pre/code) */
pre code, pre {
  white-space: pre !important;
  word-wrap: normal !important;
  word-break: normal !important;
  overflow-wrap: normal !important;
  overflow-x: auto !important;
  width: 100% !important;
  max-width: 100% !important;
  display: block !important;
}

/* 确保所有pre元素都不换行 */
pre {
  white-space: pre !important;
  word-wrap: normal !important;
  word-break: normal !important;
  overflow-wrap: normal !important;
  overflow-x: auto !important;
}

/* 增加文章内容和导航链接之间的间距 */
.post-nav {
  margin-top: 3em !important;
  padding-top: 2em !important;
}

/* 让 post-nav 在移动端与正文同宽且不溢出 */
.post-nav {
  width: 100% !important;
  max-width: var(--text-width) !important;
  margin-left: auto !important;
  margin-right: auto !important;
  box-sizing: border-box !important;
}

.post-nav span {
  min-width: 0; /* 防止超出容器 */
}

/* 修复文章列表标题对齐问题 */
.post-item {
  display: flex;
  align-items: center; /* 改为center对齐，让日期和标题在同一水平线上 */
  margin-bottom: 1em;
  line-height: 1.4; /* 调整行高 */
}

.post-date {
  flex-shrink: 0;
  margin-right: 0.5em;
  vertical-align: baseline; /* 确保基线对齐 */
}

.post-separator {
  flex-shrink: 0;
  margin-right: 0.5em;
  vertical-align: baseline; /* 确保基线对齐 */
}

.post-title-wrapper {
  flex: 1;
  min-width: 0; /* 允许内容收缩 */
  display: flex;
  align-items: center; /* 确保标题在容器内垂直居中 */
}

.post-title {
  display: inline-block; /* 改为inline-block */
  text-indent: 0; /* 确保标题从左边开始 */
  word-wrap: break-word;
  overflow-wrap: break-word;
  vertical-align: baseline; /* 确保基线对齐 */
  line-height: 1.4; /* 与整体行高保持一致 */
}

