:root {
    --side-bar-bg-color: #fafafa;
    --control-text-color: #777;
    /* 简化的字体设置 - 统一中英文 */
    --font: "FiraCode", "NotoSansSC", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
    --code-font: "FiraCode", "NotoSansSC", monospace, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji";
    --code-font-feature-settings: "cv02" 1, "cv13" 1, "cv14" 1, "cv16" 1, "cv31" 1, "ss01" 1, "ss03" 1, "ss05" 1;
    --font-title: "京華老宋体", monospace;
    /* 简化的字体字重设置 */
    --font-weight-normal: 400;
    --font-weight-bold: 700;
    --heading-font-weight: 700;
    /* 字体大小设置 */
    --font-size-normal: 18px;
    --font-size-small: 16px;
    --font-size-large: 20px;
    /* 页面宽度 */
    --article-max-width: 1200px;

    /* 代码块颜色变量 - 仅还原背景色和普通文本颜色，保留语法高亮颜色 */
    --code-block-bg-color: #F4F4F4; /* 还原为浅灰色背景 */
    --code-block-color: #333; /* 还原为深灰色文字 */
    --code-text-color: #333; /* 还原为深灰色文字 */
    --inline-code-bg-color: #efefef; /* 行内代码背景色 */
    --highlight-color: #f15642; /* 高亮颜色 - 红色，与 theme_colors.toml 同步 */
    --orange-code: #fba922; /* 保留黄色 */
    --red-code: #cc342b; /* 保留红色 */
    --grey-code: #969896; /* 保留亮黑色 */
    --green-code-light: #198844; /* 保留绿色 */
    --green-code-dark: #198844; /* 保留绿色 */
    --blue-code-light: #3971ed; /* 保留蓝色 */
    --blue-code-dark: #3971ed; /* 保留蓝色 */
    --magenta-code: #a36ac7; /* 保留品红色 */
    /* 链接颜色 */
    --link-color: #1533FF;
    --tag-hover-color: #007bff;
    /* 目录颜色 */
    --toc-link-color: #666;
    --toc-title-color: #333;
    /* 背景和文本颜色 */
    --bg-color: #ffffff;
    --text-color: #333333;
    /* 边框颜色 */
    --border-color: #333;
    --table-bg-color-header: #f9f9fb;
    --table-bg-color-dark: #f9f9fb;
    /* --table-bg-color-light: #f9f9fb; */

}

/* 暗色主题变量 */
[data-theme="dark"] {
    --side-bar-bg-color: #1a1a1a;
    --control-text-color: #999;
    /* 字体设置保持不变 */
    --font: "FiraCode", "NotoSansSC", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
    --code-font: "FiraCode", "NotoSansSC", monospace, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji";
    --code-font-feature-settings: "cv02" 1, "cv13" 1, "cv14" 1, "cv16" 1, "cv31" 1, "ss01" 1, "ss03" 1, "ss05" 1;
    --font-title: "京華老宋体", monospace;
    /* 字体字重设置保持不变 */
    --font-weight-normal: 400;
    --font-weight-bold: 700;
    --heading-font-weight: 700;
    /* 字体大小设置保持不变 */
    --font-size-normal: 18px;
    --font-size-small: 16px;
    --font-size-large: 20px;
    /* 页面宽度保持不变 */
    --article-max-width: 1200px;

    /* 代码块颜色变量 - 暗色模式 */
    --code-block-bg-color: #2a2a2a;
    --code-block-color: #e0e0e0;
    --code-text-color: #e0e0e0;
    --inline-code-bg-color: #383838; /* 行内代码背景色 */
    --highlight-color: #96c24e; /* 高亮颜色 - 绿色，与 theme_colors.toml 同步 */
    /* 语法高亮颜色保持鲜艳，适合暗色背景 */
    --orange-code: #fba922;
    --red-code: #ff6b6b;
    --grey-code: #969896;
    --green-code-light: #4ec9b0;
    --green-code-dark: #4ec9b0;
    --blue-code-light: #61afef;
    --blue-code-dark: #61afef;
    --magenta-code: #c678dd;
    /* 链接颜色 - 暗色模式下更亮 */
    --link-color: #4d7cff;
    --tag-hover-color: #4d94ff;
    /* 目录颜色 - 暗色模式 */
    --toc-link-color: #999;
    --toc-title-color: #ccc;
    /* 背景和文本颜色 */
    --bg-color: #1a1a1a;
    --text-color: #e0e0e0;
    /* 边框颜色 */
    --border-color: #e0e0e0;
    --table-bg-color-header: #2a2a2a;
    --table-bg-color-dark: #252525;
}

/* NotoSansSC - 中文字符和中文标点（包括引号） */
@font-face {
    font-family: 'NotoSansSC';
    src: url('/fonts/NotoSansSC-Regular.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    unicode-range: U+4E00-9FFF, U+3400-4DBF, U+20000-2A6DF, U+2A700-2B73F, U+2B740-2B81F, U+2B820-2CEAF, U+3000-303F, U+FF00-FFEF, U+201C, U+201D;
}
@font-face {
    font-family: 'NotoSansSC';
    src: url('/fonts/NotoSansSC-Bold.woff2') format('woff2');
    font-weight: bold;
    font-style: normal;
    unicode-range: U+4E00-9FFF, U+3400-4DBF, U+20000-2A6DF, U+2A700-2B73F, U+2B740-2B81F, U+2B820-2CEAF, U+3000-303F, U+FF00-FFEF, U+201C, U+201D;
}

/* FiraCode - Latin 字符和代码符号（排除中文标点） */
@font-face {
    font-family: 'FiraCode';
    src: url('/fonts/FiraCode-Regular.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    unicode-range: U+0000-007F, U+00A0-00FF, U+2000-201B, U+201E-20CF, U+2100-21FF, U+2200-22FF, U+2400-24FF;
}
@font-face {
    font-family: 'FiraCode';
    src: url('/fonts/FiraCode-SemiBold.woff2') format('woff2');
    font-weight: bold;
    font-style: normal;
    unicode-range: U+0000-007F, U+00A0-00FF, U+2000-201B, U+201E-20CF, U+2100-21FF, U+2200-22FF, U+2400-24FF;
}

/* 京華老宋体 */
@font-face {
    font-family: '京華老宋体';
    src: url('/fonts/京華老宋体v2.002.woff') format('woff');
}

/* Libertinus Math - 数学公式字体 */
@font-face {
    font-family: 'Libertinus Math';
    src: url('/fonts/LibertinusMath-Regular.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
}

/* 方正新楷体 - 公式中文字体 */
@font-face {
    font-family: 'FangZheng XinKaiTi';
    src: url('/fonts/FangZheng_XinKaiTi.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}

/* LXGWWenKaiMono - 引用字体（中英文） */
@font-face {
    font-family: 'LXGWWenKaiMono';
    src: url('/fonts/LXGWWenKaiMono-Medium.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
}

/* Courier Prime - 引用英文字体 */
@font-face {
    font-family: 'Courier Prime';
    src: url('/fonts/CourierPrime-Regular.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
}
@font-face {
    font-family: 'Courier Prime';
    src: url('/fonts/CourierPrime-Bold.woff2') format('woff2');
    font-weight: bold;
    font-style: normal;
}
@font-face {
    font-family: 'Courier Prime';
    src: url('/fonts/CourierPrime-Italic.woff2') format('woff2');
    font-weight: normal;
    font-style: italic;
}
@font-face {
    font-family: 'Courier Prime';
    src: url('/fonts/CourierPrime-BoldItalic.woff2') format('woff2');
    font-weight: bold;
    font-style: italic;
}

/* 根据不同的分辨率设置字体大小 */
/* --- 平板设备 --- */
/* 适用于屏幕宽度大于等于 768px 的设备 */
@media (min-width: 768px) {
  :root {
    --font-size-large: 16px;
    --font-size-normal: 14px;
    --font-size-small: 12px;
    /* 平板屏幕较宽，可以适当增加文章最大宽度 */
    --article-max-width: 400px;
  }
}

/* --- 小型桌面显示器 / 大型平板 --- */
/* 适用于屏幕宽度大于等于 992px 的设备 */
@media (min-width: 992px) {
  :root {
    --font-size-large: 16px;
    --font-size-normal: 14px;
    --font-size-small: 12px;
    --article-max-width: 500px;
  }
}

/* --- 中型桌面显示器 --- */
/* 适用于屏幕宽度大于等于 1200px 的设备 */
@media (min-width: 1200px) {
  :root {
    /* 字体大小可以保持不变，或者略微增大 */
    --font-size-large: 16px;
    --font-size-normal: 14px;
    --font-size-small: 12px;
    --article-max-width: 600px;
  }
}

/* --- 大型桌面显示器 / 4K 显示器 --- */
/* 适用于屏幕宽度大于等于 1600px 的设备 */
@media (min-width: 1600px) {
  :root {
    --font-size-large: 17px;
    --font-size-normal: 15px;
    --font-size-small: 13px;
    --article-max-width: 800px;
  }
}

/* 适用于屏幕宽度大于等于 1920px 的设备 */
@media (min-width: 1920px) {
  :root {
    --font-size-large: 18px;
    --font-size-normal: 16px;
    --font-size-small: 14px;
    --article-max-width: 1000px;
  }
}

/* --- 超宽屏 (2K 及以上) --- */
/* 适用于屏幕宽度大于等于 2560px 的设备 */
@media (min-width: 2560px) {
  :root {
    --font-size-large: 20px;
    --font-size-normal: 18px;
    --font-size-small: 16px;
    --article-max-width: 1200px;
  }
}


body {
    font-family: var(--font);
    font-weight: var(--font-weight-normal);
    color: var(--text-color);
    margin: 0 20px;
    line-height: 1.6;
    background-color: var(--bg-color);
    font-variant-ligatures: common-ligatures;
    font-feature-settings: var(--code-font-feature-settings);
}

/* 悬浮目录基础样式（保留你的原有样式） */
.floating-toc {
    position: fixed;
    right: 2rem;
    top: 50%; /* 设置顶部为视口50%位置 */
    transform: translateY(-50%); /* 向上平移自身高度的一半，实现垂直居中 */
    width: 280px;
    background: white;
    padding: 1rem;
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
    z-index: 9999;
    margin: 0;
    opacity: 0;
    pointer-events: none; /* 默认不响应鼠标事件 */
    /* 隐藏滚动条但保留滚动功能 - 适用于Chrome, Safari, Opera */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

/* 隐藏滚动条 - Chrome, Safari and Opera */
.floating-toc::-webkit-scrollbar {
    display: none;
}

/* --- 调整后：H1 作为顶层的计数器规则 --- */
/* 1. 在目录容器的 nav > ul 上初始化 H1 计数器（对应 # 标题） */
.floating-toc > nav > ul {
    counter-reset: h1-counter; /* 初始化 H1 计数器 */
    list-style: none;
    padding-left: 0;
    margin: 0;
}

/* 为了实现稳定的悬挂缩进，重新设计序号和内容布局 */
/* 为所有列表项设置相对定位 */
.floating-toc > nav > ul > li,
.floating-toc > nav > ul > li > ul > li,
.floating-toc > nav > ul > li > ul > li > ul > li {
    position: relative;
    display: block;
    word-wrap: break-word;
}

/* 为各级标题序号设置固定宽度和绝对定位，确保悬挂缩进效果 */
/* H1 序号样式 */
.floating-toc > nav > ul > li::before {
    content: counter(h1-counter);
    font-weight: bold;
    color: var(--highlight-color);
    position: absolute;
    left: 0;
    top: 0;
    width: 2em; /* 固定宽度，支持最多两位数 */
    text-align: right; /* 右对齐，确保个位和十位数对齐 */
}

/* H2 序号样式 */
.floating-toc > nav > ul > li > ul > li::before {
    content: counter(h1-counter) "." counter(h2-counter);
    font-weight: normal;
    color: var(--highlight-color);
    position: absolute;
    left: 0;
    top: 0;
    width: 3.5em; /* 固定宽度，支持 99.99 格式 */
    text-align: right; /* 右对齐 */
}

/* H3 序号样式 */
.floating-toc > nav > ul > li > ul > li > ul > li::before {
    content: counter(h1-counter) "." counter(h2-counter) "." counter(h3-counter);
    font-weight: normal;
    color: var(--highlight-color);
    position: absolute;
    left: 0;
    top: 0;
    width: 5em; /* 固定宽度，支持 99.99.99 格式 */
    text-align: right; /* 右对齐 */
}

/* 激活状态的序号样式 - 使用高亮颜色 */
.floating-toc > nav > ul > li.active::before,
.floating-toc > nav > ul > li > ul > li.active::before,
.floating-toc > nav > ul > li > ul > li > ul > li.active::before {
    color: var(--highlight-color, #f15642);
}

/* 为链接添加合适的左侧内边距，确保文本与序号有适当间距并保持悬挂缩进 */
/* padding-left = 编号宽度 + 间距，确保文本位置固定 */
.floating-toc > nav > ul > li > a {
    display: block;
    padding-left: 2.5em; /* H1 编号宽度 2em + 间距 0.5em */
}

.floating-toc > nav > ul > li > ul > li > a {
    display: block;
    padding-left: 4.5em; /* H2 编号宽度 3.5em + 间距 1em */
}

.floating-toc > nav > ul > li > ul > li > ul > li > a {
    display: block;
    padding-left: 6em; /* H3 编号宽度 5em + 间距 1em */
}

/* 2. H1 标题（#）- 顶层目录项 */
.floating-toc > nav > ul > li {
    counter-increment: h1-counter; /* H1 计数器递增 */
    counter-reset: h2-counter;     /* 重置子级 H2 计数器 */
    margin: 0.75rem 0;
}

/* 3. H2 标题（##）- H1 的子级目录项 */
.floating-toc > nav > ul > li > ul {
    counter-reset: h2-counter; /* 初始化 H2 计数器 */
    list-style: none;
    margin: 0.25rem 0 0 0;
    padding-left: 1rem; /* 原始缩进宽度 */
}

.floating-toc > nav > ul > li > ul > li {
    counter-increment: h2-counter; /* H2 计数器递增 */
    counter-reset: h3-counter;     /* 重置孙级 H3 计数器 */
    margin: 0.5rem 0;
}

/* 4. H3 标题（###）- H2 的子级目录项 */
.floating-toc > nav > ul > li > ul > li > ul {
    counter-reset: h3-counter;
    list-style: none;
    margin: 0.25rem 0 0 0;
    padding-left: 1rem; /* 原始缩进宽度 */
}

.floating-toc > nav > ul > li > ul > li > ul > li {
    counter-increment: h3-counter;
    margin: 0.25rem 0;
}

/* 隐藏 H4 及更深层级的标题 */
.floating-toc > nav > ul > li > ul > li > ul > li > ul,
.floating-toc > nav > ul > li > ul > li > ul > li > ul > li {
    display: none !important;
}

/* --- 原有样式保留，确保链接正常显示 --- */
.floating-toc h3 {
    margin-top: 0;
    padding-bottom: 0.5rem;
    font-size: 1.2rem;
    color: var(--toc-title-color);
    border-bottom: 1px solid #eee;
}

.floating-toc a {
    font-size: 0.95rem;
    color: var(--toc-link-color);
    text-decoration: none;
    display: block;
    /* 为了实现悬挂缩进，我们需要一些特殊处理 */
    transition: color 0.2s ease-in-out;
}

.floating-toc a:hover {
    color: var(--tag-hover-color);
    text-decoration: none;
}

/* 当前激活的目录项样式 - 使用与 mark 标签相同的高亮颜色 */
.floating-toc a.active {
    color: var(--highlight-color, #f15642);
    font-weight: 500;
}

/* floating-toc 中的行内代码样式 - 字体和大小与 TOC 文本保持一致 */
.floating-toc code {
    font-family: var(--font);
    font-size: 0.95rem;
    padding: 0.1em 0.3em;
    margin: 0;
    background-color: var(--inline-code-bg-color);
    border-radius: 3px;
}

/* 浮动目录默认已设置为隐藏 */

/* 响应式设计：在小屏幕设备上调整样式 */
@media (max-width: 768px) {
    .floating-toc {
        width: 220px; /* 小屏幕上缩小宽度 */
        right: 1rem; /* 减少右边距 */
        top: 50%; /* 保持垂直居中 */
        transform: translateY(-50%); /* 保持垂直居中 */
        font-size: 0.9rem; /* 缩小字体 */
    }
    
    .floating-toc a {
        font-size: 0.85rem;
    }
}

/* 当屏幕宽度大于等于 1024px 时显示浮动目录 */
@media (min-width: 1024px) {
    .floating-toc {
        opacity: 1;
        pointer-events: auto;
    }
}


/* 当屏幕宽度大于等于 1920px 时显示浮动目录 */
@media (min-width: 1920px) and (min-aspect-ratio: 1) {
    .floating-toc {
        opacity: 1;
        pointer-events: auto;
    }
}

/* 超链接 */
/* a[href]:not(#TableOfContents a) {
    color: var(--link-color);
} */

a[href]:not(#TableOfContents a):not(.header-title a):hover {
  color: var(--link-color);
  font-weight: 400 ;
    /* text-decoration: underline; */
}

.row.posts-line time{
  font-weight: 600;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    position: relative;
    margin-top: 1rem;
    margin-bottom: 1rem;
    font-family: var(--font-title);
    font-weight: var(--heading-font-weight);
    line-height: 1.4;
    cursor: text;
}

h1 {
    font-size: 2em;
    border-bottom: none;
    margin-top: 1.5em;
    margin-bottom: 1em;
    padding-bottom: 0;
}

h2 {
    font-size: 1.75em;
    border-bottom: none;
    margin-top: 1.5em;
    margin-bottom: 1em;
    padding-bottom: 0;
}

h3 {
    font-size: 1.5em;
}

h4 {
    font-size: 1.25em;
}

h5 {
    font-size: 1em;
}

h6 {
    font-size: 0.875em;
}

h1:hover a.anchor,
h2:hover a.anchor,
h3:hover a.anchor,
h4:hover a.anchor,
h5:hover a.anchor,
h6:hover a.anchor {
    text-decoration: none;
}

/* static/css/custom.css */
/* 在 .post-content 容器内重置并定义计数器 */
.post-content {
  counter-reset: h1-counter;  /* 重置一级标题计数器 */
}

/* 一级标题 (h1) */
.post-content h1 {
  counter-increment: h1-counter;  /* 递增一级标题计数器 */
  counter-reset: h2-counter;  /* 重置二级标题计数器，因为每一个新的 h1 都意味着一个新的章节 */
}

.post-content h1::before {
  /* 显示一级标题计数器的值 */
  content: counter(h1-counter) " ";
  font-weight: bold;
  color: #666;
}

/* 二级标题 (h2) */
.post-content h2 {
  counter-increment: h2-counter;
  counter-reset: h3-counter; /* 重置三级标题计数器 */
}

.post-content h2::before {
  /* 显示一级和二级计数器的值，用点分隔 */
  content: counter(h1-counter) "." counter(h2-counter) " ";
  font-weight: bold;
  color: #666;
}

/* 三级标题 (h3) */
.post-content h3 {
  counter-increment: h3-counter;
  counter-reset: h4-counter;
}

.post-content h3::before {
  /* 显示一、二、三级计数器的值 */
  content: counter(h1-counter) "." counter(h2-counter) "." counter(h3-counter) " ";
  font-weight: bold;
  color: #666;
}

/* 禁用归档页面分类标题的自动编号 */
.post-content h1.category-title::before {
  content: none;
}

/* 禁用归档页面中年份标题的自动编号 */
.post-content h1.site-date-catalog::before {
  content: none;
}

.post-content h4 {
  counter-increment: h4-counter;
  counter-reset: h5-counter;
}
.post-content h4::before {
  content: counter(h1-counter) "." counter(h2-counter) "." counter(h3-counter) "." counter(h4-counter) " ";
  font-weight: bold;
  color: #666;
}

.post-content h5 {
  counter-increment: h5-counter;
  counter-reset: h6-counter;
}
.post-content h5::before {
  content: counter(h1-counter) "." counter(h2-counter) "." counter(h3-counter) "." counter(h4-counter) "." counter(h5-counter) " ";
  font-weight: bold;
  color: #666;
}

.post-content h6 {
  counter-increment: h6-counter;
}
.post-content h6::before {
  content: counter(h1-counter) "." counter(h2-counter) "." counter(h3-counter) "." counter(h4-counter) "." counter(h5-counter) "." counter(h6-counter) " ";
  font-weight: bold;
  color: #666;
}


article {
  max-width: var(--article-max-width);
  margin-left: auto;
  margin-right: auto;
}

a {
  color: var(--text-color);
  text-decoration: none;
}

a:hover {
  font-weight: 600;
  text-decoration: underline;
}

.post-ads {
  margin: 50px 0;
}

.markdown-body {
  font-size: var(--font-size-normal);
  max-width: 100%;
}

.markdown-body a {
  color: var(--link-color);
  font-weight: 500;
  text-decoration: none;
  text-decoration-color: var(--link-color);
}

/* 引用样式 */
.markdown-body blockquote {
  padding: 0 1em;
  padding-left: 2em;
  color: #6a737d;
  margin: 0 0 16px 0;
  font-family: 'LXGWWenKaiMono', serif;
  font-size: 0.9em;
}

blockquote p {
  /* margin: 0.2em 0 0.2em 0; */
  line-height: 1.4 !important;
  margin-bottom: 0.5rem !important;
  margin-block-start: 0;
  margin-block-end: 0;
}

.markdown-body pre {
  padding: 16px;
  overflow: auto;
  font-family: var(--code-font);
  font-feature-settings: var(--code-font-feature-settings);
  /* border-radius: 10px; */
}



/* i18n */

.Chinese .markdown-body {
  line-height: 200%;
}

/* header */

.site-date-catalog {
  font-size: 2rem;
}

.header-title {
  font-size: 2rem;
  font-weight: bold;
  margin-top: 32px;
  font-family: "Bungee Shade", sans-serif;
}
.header-title a {
  text-decoration: none;
}

.header-subtitle {
  color: #666;
}

.header-items {
  margin: 10px 0;
}

.header-item {
  margin: 0 10px;
}

.header-line {
  display: none;
}

.lang-switch {
  font-weight: 600;
}

/* Header 导航栏布局 */
.header-nav {
  display: flex !important;
  justify-content: space-between;
  align-items: center;
  padding-top: 10px;
  position: sticky !important;
  top: 0 !important;
  z-index: 100;
  background-color: var(--bg-color);
  border-bottom: 2px solid #482936;
  padding-bottom: 8px;
}

/* 确保在不同页面类型中导航栏都能 sticky */
.row .header-nav,
.col-xs-12 .header-nav,
article .header-nav {
  position: sticky !important;
  top: 0 !important;
}

/* Dark 模式下导航栏边框颜色 */
[data-theme="dark"] .header-nav {
  border-bottom-color: #999 !important;
}

.header-nav-left,
.header-nav-right {
  display: flex;
  align-items: center;
  gap: 15px;
}

.header-nav-left {
  justify-content: flex-start;
}

.header-nav-right {
  justify-content: flex-end;
}

.header-link {
  color: var(--text-color);
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.2s ease;
  white-space: nowrap;
  cursor: pointer;
}

.header-link:hover {
  color: var(--tag-hover-color);
}

/* 隐藏原有的 theme-toggle 按钮 */
#theme-toggle {
  display: none;
}

/* 主题切换按钮样式 */
.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-size: 1.2rem;
  transition: transform 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle:hover {
  transform: scale(1.1);
}

.theme-toggle:active {
  transform: scale(0.95);
}

.theme-icon-light,
.theme-icon-dark {
  display: inline-block;
  transition: opacity 0.3s ease;
}

/* posts list */

#posts-list .archive-list  {
  min-height: 600px;
}

.posts-line, .archive-list {
  font-size: 1.2rem;
  margin: 12px 0;
}

.row.archive-list time {
  font-weight: 600;
}

.posts-categories {
  font-size: 0.95rem;
  margin: auto;
  text-align: left;
}

.posts-categories a:hover {
  color: #fff;
  background-color: var(--link-color);
  display: inline;
  font-weight: 500;
  padding: 2px 5px;
  margin-right: 6px;
  border: none;
  border-radius: 5px;
  text-decoration: none;
  transition: all 0.3s ease;
}

.posts-categories a:hover strong {
  color: #fff !important;
}

.posts-categories a::before {
  color: var(--grey-code);
  content: "# ";
}

.posts-categories a:hover::before {
   color: #fff;
 }

.posts-categories strong {
  color: var(--grey-code);
  font-weight: 500;
}

.posts-category {
  padding: 3px 0;
  /* border: #000 2px solid;
  border-radius: 5px; */
  /* margin-bottom: 3px; */
}

.site-footer {
  margin-top: 50px;
  /* margin-bottom: 80px; */
  /* display: flex; */
  /* justify-content: flex-end; */
  /* flex-wrap: wrap; */
  /* padding: 12px 0; */
  /* border-width: 3px; */
  /* border-style: solid none; */
  /* border-color: #000; */
}

.site-footer-item {
  margin-right: 12px;
}

/* post */

.post-header {
  margin-bottom: 25px;
}

.post-title {
  font-size: 3rem;
  font-weight: 800;
  text-align: center;
}

.post-tags {
  display: inline;
  font-weight: 500;
  padding: 2px 5px;
  margin-right: 6px;
  border: none;
  border-radius: 5px;
  text-decoration: none;
  transition: all 0.3s ease;
}

.post-tags a {
  text-decoration: none;
  transition: all 0.3s ease;
}

.post-tags:hover {
  background-color: var(--highlight-color);
}

.post-tags:hover a {
  color: var(--bg-color) !important;
  font-weight: 500;
}

/* Tags 行左右布局 */
.post-tags-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.post-tags-left {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
}

.post-tags-right {
  display: flex;
  align-items: center;
}

.post-word-count {
  font-size: inherit;
  color: var(--text-secondary, #666);
  font-weight: 500;
}

.post-word-count .word-number {
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
}

[data-theme="dark"] .post-word-count {
  color: var(--text-secondary, #999);
}

/* 标签云样式 */
.tags-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 20px 0;
  justify-content: center;
}

.tag-cloud-item {
  display: inline;
  font-weight: 500;
  padding: 2px 5px;
  margin-right: 6px;
  border: none;
  border-radius: 5px;
  text-decoration: none;
  transition: all 0.3s ease;
  background-color: #e0e0e0;
}

.tag-cloud-item a {
  text-decoration: none;
  transition: all 0.3s ease;
  color: var(--text-color) !important;
}

[data-theme="dark"] .tag-cloud-item {
  background-color: #333333;
}

[data-theme="dark"] .tag-cloud-item a {
  color: var(--text-color) !important;
}

[data-theme="dark"] .post-content figcaption {
  color: #595959 !important;
}

[data-theme="dark"] .markdown-body figcaption {
  color: #595959 !important;
}

.tag-cloud-item:hover {
  background-color: var(--highlight-color);
}

.tag-cloud-item:hover a {
  color: var(--bg-color) !important;
  font-weight: 500;
}

[data-theme="dark"] .tag-cloud-item:hover a {
  color: var(--bg-color) !important;
}

.tag-item {
  display: inline-block;
  padding: 6px 12px;
  border: 1px solid #ddd;
  border-radius: 16px;
  text-decoration: none;
  color: #333;
  transition: all 0.3s ease;
  font-size: 14px;
}

.tag-item:hover {
  background-color: #000;
  color: var(--bg-color) !important;
  text-decoration: none;
  border-color: #000;
}

.tag-count {
  font-size: 12px;
  color: #666;
  margin-left: 4px;
}

.tag-item:hover .tag-count {
  color: #ccc;
}

.post-date, .post-email, .post-author {
  display: block;
  float: none; 
  font-weight: var(--font-weight-normal);
  font-size: var(--font-size-normal);
  font-style: normal;
  text-align: center;
  margin: 5px 0;
}

/* static/css/custom.css */

/* 确保 post-desc 内的元素垂直排列 */
.post-desc {
  /* 清除可能存在的浮动影响 */
  clear: both; 
}

/* .post-author {
  float: right;
  font-weight: 600;
} */

.page-content {
  min-height: 60%;
}

.post-content {
  margin-bottom: 50px;
}

.post-content p {
  hyphens: auto;
  line-height: 1.8;
  /* text-align: justify; */
  text-justify: ideographic;
  margin-bottom: 1em;
}

.post-content img {
  max-width: 100%;
  display: block;
  margin-right: auto;
  margin-top: 6px;
}

.post-content figcaption {
  font-size: 0.85em;
  text-align: center;
  color: #bbb !important;
  margin-top: 0.5em;
  line-height: 1.4;
}

.markdown-body figcaption {
  font-size: 0.85em;
  text-align: center;
  color: #bbb !important;
  margin-top: 0.5em;
  line-height: 1.4;
}

.post-content .post-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.post-content .post-gallery img {
  margin-right: auto;
  margin-top: auto;
  width: calc(50% - 3px);
}

.related-content {
  border-width: 3px;
  border-style: solid;
  border-color: var(--border-color);
  padding: 0 10px;
  margin-bottom: 50px;
  margin-top: 50px;
}

.related-content li {
  margin: 5px 0;
}

/* taxonomy */

.taxonomy-term {
  font-size: 3rem;
}

/* gallery */

.gallery-img {
  text-align: center;
}

.gallery-img span {
  text-align: center;
}

.gallery-img-desc {
  font-size: 0.8em;
  font-weight: 800;
}


@media screen and (max-width: 600px) {
  .header-title,
  .header-subtitle,
  .header-items {
    text-align: center;
  }

  .posts-line {
    font-size: 16px;
  }

  .markdown-body {
    font-size: 16px;
  }
  .post-title {
    font-size: 2rem;
  }
  .post-content p {
    letter-spacing: 0.05em;
  }
  .post-content .post-gallery img {
    width: 100%;
  }
}

@media screen and (max-width: 48em) {
  .posts-category {
    display: none;
  }
}

/* 表格样式 */
table {
    font-size: 0.9em;
    border-collapse: collapse;
    margin-bottom: 16px;
    width: 100%;
    overflow: auto;
}

table th {
    font-style: bold;
    font-weight: var(--font-weight-bold);
    font-size: var(--font-size-small);
    line-height: 1.4 !important;
    text-align: left;
    background-color: var(--table-bg-color-header);
    padding: 6px 13px;
    border: 2px solid var(--border-color);
    border-left: none;
    border-right: none ;
}

table td {
    padding: 6px 13px;
    font-size: var(--font-size-small);
    line-height: 1.4 !important;
    border: 1.5px solid var(--border-color);
    border-left: none;
    border-right: none ;
}

table > tbody > tr:last-child > td {
    border-bottom: 2px solid var(--border-color);
}

/* table tr:nth-child(2n) {
    background-color: var(--table-bg-color-dark);
} */

/* 分割线样式 */
hr {
    height: 0.2em;
    padding: 0;
    margin: 24px 0;
    background-color: #e1e4e8;
    border: 0;
}

/* 行内代码 */
.markdown-body code {
  padding: 0.2em;
  margin: 0.1em;
  font-family: var(--code-font);
  font-feature-settings: var(--code-font-feature-settings);
  background-color: var(--inline-code-bg-color);
  border-radius: 3px;
}

p code, ul code, li code {
  font-size: var(--font-size-small);
}

/* 代码框 */
.markdown-body pre > code {
  padding: 0;
  margin: 0;
  line-height: 1.5;
  font-size: var(--font-size-small);
  background-color: inherit;
  border: 0;
}

/* 自定义高亮标签 */
hl, .hl {
  color: var(--highlight-color, var(--text-color));
}

hlb, .hlb {
  color: var(--highlight-color, var(--text-color));
  font-weight: bold;
}

/* mark 标签 - 红色高亮 */
mark {
  background-color: transparent;
  color: var(--highlight-color, #f15642) !important;
  padding: 0;
}

/* q 标签样式 */
q {
  color: #ccc;
  quotes: none;
}

/* 博文末尾分割线样式 */
.post-footer-divider {
  color: #ccc;
}

/* 暗色模式下 q 标签样式 */
[data-theme="dark"] q {
  color: #666;
}

/* 暗色模式下博文末尾分割线样式 */
[data-theme="dark"] .post-footer-divider {
  color: #666;
}

/* 自定义 checkbox 样式 */
input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-color, #333);
  border-radius: 3px;
  background-color: var(--bg-color, #fff);
  cursor: pointer;
  position: relative;
  vertical-align: middle;
  transition: all 0.2s ease;
}

/* 暗色模式下的 checkbox 边框 */
[data-theme="dark"] input[type="checkbox"] {
  border-color: var(--border-color, #e0e0e0);
}

/* checkbox hover 状态 */
input[type="checkbox"]:hover {
  border-color: var(--highlight-color, #f15642);
}

/* checkbox checked 状态 */
input[type="checkbox"]:checked {
  background-color: var(--highlight-color, #f15642);
  border-color: var(--highlight-color, #f15642);
}

/* checkbox checked 状态的勾选标记 */
input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 1px;
  width: 4px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

input[type="checkbox"]:indeterminate::after {
  content: '';
  position: absolute;
  left: 3px;
  top: 6px;
  width: 10px;
  height: 2px;
  background-color: white;
}

/* .markdown-body  */
/* code {
  background-color: #efefef;
  color: #c7254e;
  color: #333;
  padding: 10px;
} */

element.style {
    /* background-color: #f5f5f5; */
    background-color: transparent !important; /* 强制透明 */
    border: none; /* 可选：移除边框 */
}


/* 主题中的 CSS 样式 */
.highlight {
  font-family: var(--code-font);
  font-feature-settings: var(--code-font-feature-settings);
  background-color: var(--code-block-bg-color);
  color: var(--code-text-color);
  line-height: 1;
  border-radius: 3px;
  padding: 0;
  display: block;
} 

.highlight pre {
  padding: 0;
  background-color: transparent !important; /* 强制透明 */
  white-space: pre-wrap; /* 保留代码缩进，超出自动换行 */
  word-break: break-all; /* 强制长单词/URL换行 */
  overflow-wrap: break-word; /* 兼容不同浏览器的长单词换行 */
}



#fastSearch {
    display: none;
    position: fixed;
    left: 50%;
    top: calc(5vw + 40px);
    transform: translateX(-50%);
    z-index: 4;
    width: 650px;
    background-color: var(--bg-color, #ffffff);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    overflow: hidden;
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color, rgba(0, 0, 0, 0.08));

    input {
        padding: 16px 20px;
        width: 100%;
        height: 52px;
        font-size: var(--font-size-normal);
        line-height: 20px;
        border: none;
        outline: none;
        font-family: var(--font);
        background: transparent;
        color: var(--text-color, #333);
        box-sizing: border-box;
        transition: all 0.3s ease;
    }

    input::placeholder {
        color: var(--text-secondary, #999);
        opacity: 0.7;
    }

    input:focus {
        background: var(--input-focus-bg, rgba(0, 0, 0, 0.02));
    }

    #searchResults {
        display: none;
        overflow-y: auto;
        max-height: 60vh;
        padding-left: 0;
        margin: 0;
        border-top: 1px solid var(--border-color, rgba(0, 0, 0, 0.08));
        text-align: left;

        /* 自定义滚动条 */
        &::-webkit-scrollbar {
            width: 6px;
        }

        &::-webkit-scrollbar-track {
            background: transparent;
        }

        &::-webkit-scrollbar-thumb {
            background: var(--scrollbar-thumb, rgba(0, 0, 0, 0.2));
            border-radius: 3px;
        }

        &::-webkit-scrollbar-thumb:hover {
            background: var(--scrollbar-thumb-hover, rgba(0, 0, 0, 0.3));
        }

        .search-highlight {
            color: var(--highlight-color, #f15642);
            font-weight: 500;
        }

        li {
            list-style: none;
            margin: 0;
            text-align: left;
            border-bottom: 1px solid var(--border-color-light, rgba(0, 0, 0, 0.05));
            transition: all 0.2s ease;

            a {
                text-decoration: none;
                color: inherit;
                padding: 14px 20px;
                display: block;
                font-size: var(--font-size-small);
                letter-spacing: 0.02em;
                transition: all 0.2s ease;
            }

            a:hover,
            a:focus {
                outline: 0;
                background: var(--item-hover-bg, rgba(0, 0, 0, 0.04));
                padding-left: 24px;
            }

            .title {
                font-weight: 600;
                color: var(--text-color, #333);
                margin-bottom: 1px;
                display: block;
            }

            .sc {
                color: var(--text-secondary, #666);
                font-size: 0.9em;
                display: block;
                line-height: 1.5;
            }
        }

        li:last-child {
            border-bottom: none;
        }

        li.noSearchResult {
            text-align: center;
            padding: 32px 20px;
            color: var(--text-secondary, #888);
            font-size: var(--font-size-small);
        }

        /* 搜索结果加载动画 */
        @keyframes slideIn {
            from {
                opacity: 0;
                transform: translateY(-8px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        li {
            animation: slideIn 0.2s ease forwards;
        }

        /* 为每个结果项添加延迟动画效果 */
        li:nth-child(1) { animation-delay: 0.02s; }
        li:nth-child(2) { animation-delay: 0.04s; }
        li:nth-child(3) { animation-delay: 0.06s; }
        li:nth-child(4) { animation-delay: 0.08s; }
        li:nth-child(5) { animation-delay: 0.1s; }
    }
}

/* 搜索按钮样式 */
#search-click {
    list-style: none !important;
    position: relative;
    transition: all 0.3s ease;
}

#search-click:hover {
    transform: scale(1.05);
}

/* 确保移除搜索菜单项的项目符号 */
#search-click {
    list-style: none !important;
}

/* 或者针对 .menu-item，如果它应该是通用的 */
.menu-item {
    list-style: none !important;
}针对 .menu-item，如果它应该是通用的 */
.menu-item {
    list-style: none !important;
}

/* ========================================
   数学公式样式 (KaTeX)
   ======================================== */

/* 确保 KaTeX 公式与文本对齐 */
.katex-display {
    margin: 1em 0;
}

/* 行内公式样式调整 */
.katex {
    font-size: 1em;
    font-family: 'Times New Roman', 'FangZheng XinKaiTi', serif !important;
    /* 通过 text-shadow 增加字重效果 */
    text-shadow:
        0 0 0px rgba(0,0,0,0.01),
        0 0 0px rgba(0,0,0,0.01);
    -webkit-text-stroke: 0.01em rgba(0,0,0,0.1);
}

/* KaTeX 数学符号使用 Times New Roman，fallback 为数学字体 */
.katex .mord,
.katex .mop,
.katex .mrel,
.katex .mbin,
.katex .mpunct,
.katex .mopen,
.katex .mclose,
.katex .minner,
.katex .mspace,
.katex .mfrac,
.katex .msqrt,
.katex .mroot,
.katex .mtable,
.katex .munder,
.katex .mover,
.katex .munderover,
.katex .maccent,
.katex .mord + .vlist-t,
.katex .sqrt > .root {
    font-family: 'Times New Roman', 'Cambria Math', 'Latin Modern Math', 'KaTeX_Math', 'STIX Two Math', 'FangZheng XinKaiTi', serif !important;
    /* 通过 text-shadow 增加字重效果 */
    text-shadow:
        0 0 0.5px rgba(0,0,0,0.05),
        0 0 1px rgba(0,0,0,0.03);
    font-weight: 500; /* 略微增加字重 */
}

/* KaTeX 文本（包括中文）使用方正新楷体 */
.katex .text,
.katex .mtext {
    font-family: 'FangZheng XinKaiTi', 'Times New Roman', serif !important;
    font-weight: 500;
}

/* 块级公式样式调整 */
.katex-display > .katex {
    text-align: left;
}

/* 确保公式在代码块中不被渲染 */
pre code .katex,
.highlight .katex {
    display: none;
}

/* 公式容器的响应式调整 */
@media screen and (max-width: 600px) {
    .katex-display {
        font-size: 0.9em;
        overflow-x: auto;
    }
}