/* =========================================================
 * CSS 变量（结构 / 布局）
 * 主要控制：字体、页面宽度、圆角、首页首屏、文章页基础显示项
 * ========================================================= */
:root {
  /* 全站基础字体 */
  --base-font-family:
    -apple-system,
    BlinkMacSystemFont,
    "PingFang SC",
    "Hiragino Sans GB",
    "Microsoft YaHei",
    "Noto Sans CJK SC",
    "Helvetica Neue",
    Arial,
    sans-serif;

  /* 全站基础字号 */
  --base-font-size: 16px;

  /* 页面主体最大宽度 */
  --page-content-max-width: 900px;

  /* 首页模块卡片圆角 */
  --box-border-radius: 10px;

  /* 顶部导航栏高度 */
  --header-height: 68px;

  /* 顶部站点标题字体 */
  --header-title-font-family:
    STHeiti,
    -apple-system,
    BlinkMacSystemFont,
    "PingFang SC",
    "Hiragino Sans GB",
    "Microsoft YaHei",
    "Noto Sans SC",
    "Helvetica Neue",
    Arial,
    sans-serif;

  /* 首页首屏标题字号 / 图标大小 */
  --first-screen-font-size: 30px;
  --first-screen-icon-size: 36px;

  /* 首页首屏标题颜色：亮色 / 暗色 */
  --first-screen-font-color-light: #003366;
  --first-screen-font-color-dark: #0099cc;

  /* 首页首屏图标颜色：亮色 / 暗色 */
  --first-screen-icon-color-light: #cc33ff;
  --first-screen-icon-color-dark: #cc99ff;

  /* 首页首屏 header 文字颜色：亮色 / 暗色 */
  --first-screen-header-font-color-light: #526e25;
  --first-screen-header-font-color-dark: #84cae7;

  /* 首页文章卡片 hover 放大比例 */
  --home-post-hover-scale: 1.02;

  /* 文章页创建时间：unset 显示，none 隐藏 */
  --post-create-datetime: unset;

  /* 文章页修改时间：unset 显示，none 隐藏 */
  --post-update-datetime: unset;

  /* 文章页头像：none 隐藏，unset 显示 */
  --post-author-avatar: none;

  /* 文章内图片居中 */
  --post-img-align: 0 auto;
}

/* =========================================================
 * 正文字号
 * UI 仍保持 16px，文章正文单独放大到 17px
 * ========================================================= */
.post-content,
.keep-markdown-body {
  font-size: 17px;
  line-height: 1.9;
}

/* =========================================================
 * 浅色主题颜色变量
 * 风格：干净、克制、蓝灰主调、青绿色链接
 * ========================================================= */
html {
  /* 页面背景 */
  --c-bg: #ffffff;
  --c-bg-card: #ffffff;
  --c-bg-soft: #f6f8fa;

  /* 文本层级 */
  --c-text-strong: #132a3a;
  --c-text: #3f4f5f;
  --c-text-muted: #6b7886;
  --c-text-faint: #9aa5b1;
  
  /* 代码块 */
  --c-code-toolbar: #f1f3f5;
  --c-code-bg: #fbfbfc;
  --c-code-gutter: #f3f4f6;

  /* 边框 */
  --c-border: #d8dee6;
  --c-border-soft: #edf0f3;

  /* 主色：蓝灰 */
  --c-accent: #1f4e6a;
  --c-accent-hover: #132a3a;
  --c-accent-soft: #6c8497;

  /* 正文链接：青绿色 */
  --article-link: #1f8f82;
  --article-link-hover: #1f4e6a;
  --article-link-line: rgba(31, 143, 130, 0.36);

  /* 文章辅助色 */
  --article-success: #4fa37a;
  --article-warning: #d97745;
  --article-special: #8f6bb3;
  --article-muted: #7c8a96;

  /* 组件表面 */
  --c-surface: #f3f4f6;
  --c-surface-hover: #1f4e6a;
  --c-on-hover: #ffffff;

  /* Header / Drawer */
  --c-header-bg: #ffffff;
  --c-drawer-bg: #ffffff;

  /* 菜单 */
  --c-menu-active: #132a3a;
  --c-menu-hover: #1f4e6a;

  /* 首页 / 置顶 / TOC */
  --c-home-title-hover: #1f4e6a;
  --c-sticky: #1f4e6a;
  --c-toc-active: #132a3a;
  --c-toc-bar: #132a3a;

  /* Tools */
  --c-tool-active-bg: #1f4e6a;
  --c-tool-active-text: #ffffff;

  /* hover 统一出口 */
  --link-hover-color: var(--article-link-hover);
  --nav-hover-color: var(--c-menu-hover);
  --pager-hover-color: var(--c-accent-soft);

  /* 输入框 */
  --page-input-fg: var(--c-text-strong);
  --page-input-bg: #ffffff;
  --page-input-border: var(--c-border);
  --page-input-border-active: var(--c-accent-soft);
  --page-input-ring: rgba(108, 132, 151, 0.24);

  /* 加密输入框 */
  --encrypt-input-fg: var(--page-input-fg);
  --encrypt-input-bg: var(--page-input-bg);
  --encrypt-input-border: var(--page-input-border);
  --encrypt-input-border-active: var(--page-input-border-active);
  --encrypt-input-ring: rgba(108, 132, 151, 0.22);

  --encrypt-hint: var(--c-text-muted);
  --encrypt-error: #ef4444;
}

/* =========================================================
 * 暗色主题颜色变量
 * 风格：深蓝灰背景、浅灰文字、青绿色链接
 * ========================================================= */
html.dark-mode {
  /* 页面背景 */
  --c-bg: #1e242a;
  --c-bg-card: #242b31;
  --c-bg-soft: #2a3138;

  /* 文本层级 */
  --c-text-strong: #e6ebf0;
  --c-text: #c9d1d9;
  --c-text-muted: #adbac5;
  --c-text-faint: #8b949e;
  
  /* 代码块 */
  --c-code-toolbar: #252d35;
  --c-code-bg: #20272f;
  --c-code-gutter: #252d35;

  /* 边框 */
  --c-border: #3a444f;
  --c-border-soft: #313a43;
 
  /* 主色：暗色下提亮 */
  --c-accent: #8fb8d8;
  --c-accent-hover: #e6ebf0;
  --c-accent-soft: #adbac5;

  /* 正文链接：暗色下提高亮度 */
  --article-link: #35c6ad;
  --article-link-hover: #e6ebf0;
  --article-link-line: rgba(53, 198, 173, 0.44);

  /* 文章辅助色 */
  --article-success: #64c28f;
  --article-warning: #f08a4b;
  --article-special: #c084d2;
  --article-muted: #9aa4ae;

  /* 组件表面 */
  --c-surface: #2a3138;
  --c-surface-hover: #36414c;
  --c-on-hover: #e6ebf0;

  /* Header / Drawer */
  --c-header-bg: #1e242a;
  --c-drawer-bg: #1e242a;

  /* 菜单 */
  --c-menu-active: #8fb8d8;
  --c-menu-hover: #e6ebf0;

  /* 首页 / 置顶 / TOC */
  --c-home-title-hover: #ffffff;
  --c-sticky: #8fb8d8;
  --c-toc-active: #e6ebf0;
  --c-toc-bar: #e6ebf0;

  /* Tools */
  --c-tool-active-bg: #36414c;
  --c-tool-active-text: #e6ebf0;

  /* hover 统一出口 */
  --link-hover-color: var(--article-link-hover);
  --nav-hover-color: var(--c-menu-hover);
  --pager-hover-color: var(--c-text-strong);

  /* 输入框 */
  --page-input-fg: var(--c-text-strong);
  --page-input-bg: #1e242a;
  --page-input-border: var(--c-border-soft);
  --page-input-border-active: var(--c-text-strong);
  --page-input-ring: rgba(230, 235, 240, 0.18);

  --encrypt-error: #f87171;
}

/* =========================================================
 * 全局背景
 * ========================================================= */
html,
body {
  background-color: var(--c-bg) !important;
}

/* =========================================================
 * Header / 顶部菜单栏
 * ========================================================= */
.header-wrapper {
  background-color: var(--c-header-bg) !important;
}

/* 站点名称 */
.header-wrapper .site-name {
  color: var(--c-text-strong) !important;
}

/* 顶部菜单默认颜色 */
.header-wrapper .menu-text-color,
.header-wrapper .menu-text-color i,
.header-wrapper .search i {
  color: var(--c-text-muted) !important;
}

/* 顶部菜单当前选中 */
.header-wrapper .menu-item.active .menu-text-color,
.header-wrapper .menu-item.active .menu-text-color i {
  color: var(--c-menu-active) !important;
}

/* 顶部菜单 hover */
.header-wrapper .menu-item:hover .menu-text-color,
.header-wrapper .menu-item:hover .menu-text-color i {
  color: var(--c-menu-hover) !important;
}

/* =========================================================
 * 首页卡片
 * ========================================================= */
.home-post-item {
  background-color: var(--c-bg-card) !important;
  border-radius: var(--box-border-radius);
}

/* 首页文章标题 */
.home-post-title a {
  color: var(--c-text-strong) !important;
}

.home-post-title a:hover {
  color: var(--c-home-title-hover) !important;
}

/* 首页置顶标识 */
.sticky-name,
.post-sticky-box i {
  color: var(--c-sticky) !important;
}

/* 首页摘要：PC 显示 3 行 */
.home-post-content {
  color: var(--c-text-faint) !important;

  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;

  overflow: hidden;
  line-height: 1.8;
}

/* 首页摘要：手机显示 2 行 */
@media (max-width: 768px) {
  .home-post-content {
    -webkit-line-clamp: 2;
  }
}

/* 首页 meta 时间和图标 */
.post-meta-info-container .home-post-history,
.post-meta-info-container .meta-info-item i {
  color: var(--c-text-faint) !important;
}

/* 首页阅读全文 */
.home-read-more {
  color: var(--c-text-muted) !important;
  flex-shrink: 0;
  white-space: nowrap;
}

.home-read-more i {
  color: inherit !important;
}

.home-read-more:hover {
  color: var(--c-accent) !important;
}

/* =========================================================
 * 首页卡片底部：时间 + 标签一行，标签整体超出裁切，阅读全文固定
 * ========================================================= */

/* grid：左侧 meta 占剩余空间，右侧“阅读全文”固定 */
.home-post-item .post-meta-info-container.home {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 16px;
}

/* 左侧 meta 强制一行 */
.home-post-item .post-meta-info-container.home .post-meta-info {
  min-width: 0;
  overflow: hidden;

  display: flex !important;
  align-items: center;
  flex-wrap: nowrap !important;
  gap: 12px;
}

/* meta 项不换行 */
.home-post-item .post-meta-info-container.home .meta-info-item {
  white-space: nowrap;
}

/* 时间等非标签项固定宽度 */
.home-post-item .post-meta-info-container.home .meta-info-item:not(.post-tag) {
  flex: 0 0 auto;
}

/* 标签区域占剩余空间，超出隐藏 */
.home-post-item .post-meta-info-container.home .post-tag {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
}

/* 标签整体超出显示省略号 */
.home-post-item .post-meta-info-container.home .post-tag-ul {
  display: block !important;

  min-width: 0;
  margin: 0;
  padding: 0;

  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* 单个标签保持完整，不单独省略 */
.home-post-item .post-meta-info-container.home .tag-item {
  display: inline-block !important;
  white-space: nowrap;
}

.home-post-item .post-meta-info-container.home .tag-item a {
  display: inline !important;

  max-width: none !important;
  overflow: visible !important;
  text-overflow: clip !important;
  white-space: nowrap !important;
}

/* 阅读全文固定在右侧 */
.home-post-item .post-meta-info-container.home .home-read-more {
  white-space: nowrap;
  justify-self: end;
}


/* =========================================================
 * Tag Cloud
 * ========================================================= */
.tagcloud-content a {
  color: var(--c-text-muted) !important;
}

.tagcloud-content a:hover {
  color: var(--c-menu-hover) !important;
}

/* =========================================================
 * 文章标题链接
 * ========================================================= */
a.post-title {
  color: var(--c-text-muted) !important;
  text-decoration: none;
}

a.post-title:hover {
  color: var(--c-text-strong) !important;
}

/* =========================================================
 * Header Drawer（手机端菜单）
 * ========================================================= */
.header-drawer {
  background-color: var(--c-drawer-bg) !important;
}

/* 抽屉菜单默认颜色 */
.drawer-menu-text-color,
.drawer-menu-text-color i {
  color: var(--c-text-muted) !important;
}

/* 抽屉菜单 hover */
.drawer-menu-item:hover .drawer-menu-text-color,
.drawer-menu-item:hover .drawer-menu-text-color i {
  color: var(--c-menu-hover) !important;
}

/* 抽屉菜单选中 */
.drawer-menu-item.active .drawer-menu-text-color,
.drawer-menu-item.active .drawer-menu-text-color i {
  color: var(--c-menu-active) !important;
}

/* =========================================================
 * 切换主题：关闭过渡
 * 解决切换明暗模式时颜色慢半拍、闪动的问题
 * ========================================================= */
html.theme-changing *,
html.theme-changing *::before,
html.theme-changing *::after {
  transition: none !important;
}

/* =========================================================
 * Audio: Keep-style wrapper
 * ========================================================= */
.keep-audio {
  margin: 18px 0;
  padding: 12px 12px 10px;

  background: var(--c-bg-card);
  border: 1px solid var(--page-input-border);
  border-radius: 14px;
}

/* 音频标题行 */
.keep-audio__meta {
  display: flex;
  align-items: center;
  gap: 10px;

  margin-bottom: 10px;

  color: var(--c-text-muted);
}

/* 音频图标 */
.keep-audio__meta i {
  width: 34px;
  height: 34px;
  border-radius: 50%;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  background: var(--c-surface);
  color: var(--c-text-muted);
  font-size: 16px;
}

/* 音频标题文字 */
.keep-audio__title {
  color: var(--c-text-strong);
  font-weight: 400;
  font-size: 14px;
  line-height: 1.2;
}

/* 原生 audio 控件 */
.keep-audio audio {
  width: 100%;
  height: 44px;
  border-radius: 12px;
}

/* WebKit 浏览器 audio 控件背景 */
.keep-audio audio::-webkit-media-controls-panel {
  background: var(--c-surface);
}

/* 原生控件跟随明暗模式 */
html:not(.dark-mode) .keep-audio audio {
  color-scheme: light;
}

html.dark-mode .keep-audio audio {
  color-scheme: dark;
}

/* 原生控件时间文字 */
.keep-audio audio::-webkit-media-controls-current-time-display,
.keep-audio audio::-webkit-media-controls-time-remaining-display {
  color: var(--c-text-muted);
}

/* 音频卡片 hover */
.keep-audio:hover {
  border-color: var(--page-input-border-active);
  box-shadow: 0 0 0 3px var(--page-input-ring);
}

/* =========================================================
 * Local Search 关键字高亮
 * ========================================================= */
html.dark-mode .search-pop-overlay .search-keyword {
  color: var(--c-accent) !important;
  border-bottom-color: var(--c-accent) !important;
}

/* =========================================================
 * App 限免卡片
 * 用法：配合 scripts/appcard.js 的 {% appcard ... %} 标签
 * ========================================================= */

/* 卡片外层 */
.app-item-card {
  display: flex;
  gap: 18px;

  margin: 24px 0;
  padding: 18px;

  background: var(--c-bg-card);
  border: 1px solid var(--c-border-soft);
  border-radius: 18px;
}

/* App 图标区域 */
.app-cover {
  width: 96px;
  flex-shrink: 0;
}

/* App 图标 */
.app-cover img {
  width: 96px;
  height: 96px;

  border-radius: 20px;
  object-fit: cover;
}

/* 中间内容区域 */
.app-main {
  flex: 1;
  min-width: 0;
}

/* 标题 + 原价 */
.app-title-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

/* App 名称 */
.app-title {
  color: var(--c-text-strong);

  font-size: 17px;
  font-weight: 400;
  line-height: 1.3;
}

/* 原价 */
.app-old-price {
  color: var(--c-text-faint);

  font-size: 15px;
  text-decoration: line-through;
}

/* App 描述：最多显示 2 行 */
.app-desc {
  margin-top: 12px;

  color: var(--c-text-muted);

  font-size: 15px;
  line-height: 1.7;

  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;

  overflow: hidden;
}

/* 右侧价格按钮区域 */
.app-price-box {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;

  min-width: 86px;
}

/* =========================================================
 * 手机端适配
 * ========================================================= */
@media (max-width: 768px) {
  .app-item-card {
    gap: 12px;
    padding: 14px;
  }

  .app-cover,
  .app-cover img {
    width: 72px;
    height: 72px;
  }

  .app-title {
    font-size: 17px;
  }

  .app-desc {
    margin-top: 8px;

    font-size: 14px;
    line-height: 1.6;

    -webkit-line-clamp: 2;
  }

  .app-price-box {
    min-width: 64px;
  }

  .app-free-btn {
    padding: 6px 12px;

    border-radius: 10px;

    font-size: 15px;
  }
}

/* =========================================================
 * 延伸推荐阅读
 * ========================================================= */
 
.related-posts {
  margin-top: 48px;
  padding-top: 2px;
  border-top: 1px solid var(--c-border-soft);
}

.related-posts h3 {
  margin-bottom: 22px;
  font-size: 1.4rem;
  font-weight: 400;
  color: var(--c-text-strong);
}


/* ===== 桌面端：2列 ===== */
.related-post-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.related-post-item {
  display: flex;
  flex-direction: column;
  justify-content: center;

  padding: 22px;

  border-radius: 18px;
  background: var(--c-bg-card);
  border: 1px solid var(--c-border-soft);

  text-decoration: none;
  transition: all .28s ease;

  font-size: 16px;
  color: var(--c-text-strong);
  line-height: 1.5;
}

.related-post-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 36px rgba(0,0,0,.08);
  border-color: var(--primary-color);
}


/* ===== 手机端：横向滑动 ===== */
@media (max-width: 768px) {

  .related-posts h3 {
    font-size: 1.26rem;
    margin-bottom: 18px;
  }

  .related-post-list {
    display: flex;
    gap: 14px;

    overflow-x: auto;
    scroll-snap-type: x mandatory;

    padding-bottom: 8px;

    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .related-post-list::-webkit-scrollbar {
    display: none;
  }

  .related-post-item {
    flex: 0 0 88%;
    min-width: 88%;

    padding: 18px;

    font-size: 16px;

    scroll-snap-align: start;
  }
}

/* Twikoo placeholder */

#twikoo input.el-input__inner::placeholder,
#twikoo textarea.el-textarea__inner::placeholder {
  color: rgba(160,170,185,.38);
}

#twikoo .el-input__count {
  color: rgba(160,170,185,.35);
}

/* =========================================================
 * About Page / 关于页
 * 简洁卡片版：不使用左右装饰
 * ========================================================= */

.wispath-about-page {
  position: relative;
  box-sizing: border-box;

  max-width: 760px;
  margin: 0 auto;
  padding: 0 0 3.2rem;

  background: var(--c-bg-card);
  border: 1px solid var(--c-border-soft);
  border-radius: 18px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.06);

  overflow: hidden;
}

html.dark-mode .wispath-about-page {
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.18);
}

/* 确保没有左右装饰 */
.wispath-about-page::before,
.wispath-about-page::after {
  display: none !important;
}

/* 正文内部留白 */
.wispath-about-page > h4,
.wispath-about-page > p,
.wispath-about-page > ul,
.wispath-about-page > blockquote {
  margin-left: 3.2rem;
  margin-right: 3.2rem;
}

/* 标题 */
.wispath-about-page h4 {
  margin-top: 2.8rem;
  margin-bottom: 1.4rem;

  color: var(--c-text-strong);
  font-size: 1.35rem;
  font-weight: 600;
}

/* 段落 */
.wispath-about-page p {
  color: var(--c-text);
  line-height: 2;
}

/* 列表 */
.wispath-about-page ul {
  padding-left: 1.4rem;
}

.wispath-about-page li {
  margin: 0.9rem 0;
  color: var(--c-text);
  line-height: 1.8;
}

/* 引用 */
.wispath-about-page blockquote {
  margin-top: 1.8rem;
  margin-bottom: 1.8rem;
  padding: 1.2rem 1.4rem;

  background: var(--c-bg-soft);
  border-left: 4px solid var(--article-link);
  border-radius: 0 12px 12px 0;
}

.wispath-about-page blockquote p {
  margin: 0;
  color: var(--c-text-muted);
}

/* 顶部封面图 */
.wispath-about-page .about-hero-img {
  display: block;
  width: 100%;
  height: 260px;
  object-fit: cover;

  margin: 0;
  border-radius: 18px 18px 0 0;
}

/* 中间插图 */
.wispath-about-page .about-inline-img {
  display: block;
  width: calc(100% - 6.4rem);
  max-height: 320px;
  object-fit: cover;

  margin: 2.8rem auto;
  border-radius: 16px;
}

/* 手机端 */
@media (max-width: 768px) {
  .wispath-about-page {
    border-radius: 14px;
  }

  .wispath-about-page .about-hero-img {
    height: 190px;
    border-radius: 14px 14px 0 0;
  }

  .wispath-about-page > h4,
  .wispath-about-page > p,
  .wispath-about-page > ul,
  .wispath-about-page > blockquote {
    margin-left: 1.4rem;
    margin-right: 1.4rem;
  }

  .wispath-about-page h4 {
    margin-top: 2.2rem;
  }

  .wispath-about-page .about-inline-img {
    width: calc(100% - 2.8rem);
    margin: 2.2rem auto;
    border-radius: 12px;
  }
}

/* =========================================================
 * Post TOC / 文章右侧大纲优化
 * 风格：轻卡片 + 左侧竖线，不使用内层圆角背景
 * 长标题：单行显示，超出使用 ...
 * ========================================================= */

/* 右侧目录整体容器 */
.post-toc,
.post-toc-container,
.toc-container {
  box-sizing: border-box;

  width: 230px;
  max-width: 230px;
  padding: 18px 20px;

  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--c-border-soft);
  border-radius: 18px;

  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.06);

  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);

  max-height: calc(100vh - var(--header-height) - 4rem);
  overflow-y: auto;

  scrollbar-width: none;
}

/* 隐藏 WebKit 滚动条 */
.post-toc::-webkit-scrollbar,
.post-toc-container::-webkit-scrollbar,
.toc-container::-webkit-scrollbar {
  width: 0;
  height: 0;
}

/* 暗色模式目录卡片 */
html.dark-mode .post-toc,
html.dark-mode .post-toc-container,
html.dark-mode .toc-container {
  background: rgba(36, 43, 49, 0.82);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.18);
}

/* 目录列表 */
.post-toc ol,
.post-toc ul,
.post-toc-container ol,
.post-toc-container ul,
.toc-container ol,
.toc-container ul {
  margin: 0;
  padding-left: 0;
  list-style: none !important;
}

/* 每一项 */
.post-toc li,
.post-toc-container li,
.toc-container li {
  margin: 0;
  padding: 0;
  list-style: none !important;
}

/* 目录链接：单行显示，超出用 ... */
.post-toc a,
.post-toc-container a,
.toc-container a {
  position: relative;
  display: block;

  padding: 8px 4px 8px 14px;

  color: var(--c-text-muted) !important;
  font-size: 15px;
  line-height: 1.55;
  text-decoration: none;

  border-radius: 0;
  background: transparent !important;

  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;

  transition: color 0.2s ease;
}

/* hover：只改文字颜色，不加背景块 */
.post-toc a:hover,
.post-toc-container a:hover,
.toc-container a:hover {
  color: var(--c-text-strong) !important;
  background: transparent !important;
}

/* 左侧竖线基础状态 */
.post-toc a::before,
.post-toc-container a::before,
.toc-container a::before {
  position: absolute;
  top: 50%;
  left: 0;

  width: 3px;
  height: 0;

  background: var(--article-link);
  border-radius: 999px;

  transform: translateY(-50%);
  content: "";

  transition: height 0.2s ease;
}

/* 当前项：只加深文字，不加圆角背景，保持单行省略 */
.post-toc a.active,
.post-toc .active > a,
.post-toc .toc-active > a,
.post-toc-container a.active,
.post-toc-container .active > a,
.post-toc-container .toc-active > a,
.toc-container a.active,
.toc-container .active > a,
.toc-container .toc-active > a {
  color: var(--c-text-strong) !important;
  background: transparent !important;
  font-weight: 600;

  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* 暗色模式当前项也不加背景 */
html.dark-mode .post-toc a.active,
html.dark-mode .post-toc .active > a,
html.dark-mode .post-toc .toc-active > a,
html.dark-mode .post-toc-container a.active,
html.dark-mode .post-toc-container .active > a,
html.dark-mode .post-toc-container .toc-active > a,
html.dark-mode .toc-container a.active,
html.dark-mode .toc-container .active > a,
html.dark-mode .toc-container .toc-active > a {
  background: transparent !important;
}

/* 当前项左侧竖线显示 */
.post-toc a.active::before,
.post-toc .active > a::before,
.post-toc .toc-active > a::before,
.post-toc-container a.active::before,
.post-toc-container .active > a::before,
.post-toc-container .toc-active > a::before,
.toc-container a.active::before,
.toc-container .active > a::before,
.toc-container .toc-active > a::before {
  height: 70%;
}

/* 二级目录 */
.post-toc li li a,
.post-toc-container li li a,
.toc-container li li a {
  padding-left: 24px;
  font-size: 14px;
  color: var(--c-text-faint) !important;
}

/* 二级目录当前项 */
.post-toc li li a.active,
.post-toc li li.active > a,
.post-toc li li.toc-active > a,
.post-toc-container li li a.active,
.post-toc-container li li.active > a,
.post-toc-container li li.toc-active > a,
.toc-container li li a.active,
.toc-container li li.active > a,
.toc-container li li.toc-active > a {
  color: var(--c-text-strong) !important;
}

/* 三级目录 */
.post-toc li li li a,
.post-toc-container li li li a,
.toc-container li li li a {
  padding-left: 34px;
  font-size: 13px;
  color: var(--c-text-faint) !important;
  opacity: 0.88;
}

/* 三级目录当前项 */
.post-toc li li li a.active,
.post-toc li li li.active > a,
.post-toc li li li.toc-active > a,
.post-toc-container li li li a.active,
.post-toc-container li li li.active > a,
.post-toc-container li li li.toc-active > a,
.toc-container li li li a.active,
.toc-container li li li.active > a,
.toc-container li li li.toc-active > a {
  color: var(--c-text-strong) !important;
  opacity: 1;
}

/* =========================================================
 * Post Prev / Next hover 修复
 * ========================================================= */

.post-nav a,
.post-nav a *,
.post-pagination a,
.post-pagination a *,
.post-next-prev a,
.post-next-prev a *,
.prev-post a,
.prev-post a *,
.next-post a,
.next-post a *,
.post-prev a,
.post-prev a *,
.post-next a,
.post-next a * {
  color: var(--c-text-muted) !important;
}

.post-nav a:hover,
.post-nav a:hover *,
.post-pagination a:hover,
.post-pagination a:hover *,
.post-next-prev a:hover,
.post-next-prev a:hover *,
.prev-post a:hover,
.prev-post a:hover *,
.next-post a:hover,
.next-post a:hover *,
.post-prev a:hover,
.post-prev a:hover *,
.post-next a:hover,
.post-next a:hover * {
  color: var(--c-text-strong) !important;
}

html.dark-mode .post-nav a:hover,
html.dark-mode .post-nav a:hover *,
html.dark-mode .post-pagination a:hover,
html.dark-mode .post-pagination a:hover *,
html.dark-mode .post-next-prev a:hover,
html.dark-mode .post-next-prev a:hover *,
html.dark-mode .prev-post a:hover,
html.dark-mode .prev-post a:hover *,
html.dark-mode .next-post a:hover,
html.dark-mode .next-post a:hover *,
html.dark-mode .post-prev a:hover,
html.dark-mode .post-prev a:hover *,
html.dark-mode .post-next a:hover,
html.dark-mode .post-next a:hover * {
  color: var(--c-text-strong) !important;
}