/*
  static/style.css 文件说明

  这份文件是站点自定义样式总表，负责补充和覆盖主题默认样式。
  当前按以下顺序组织：
  1. 全局变量
  2. 全局基础
  3. 首页 Hero
  4. About
  5. Header
  6. Search
  7. Footer
  8. TOC
  9. 响应式

  维护约定：
  - 同类规则尽量放在同一分区中
  - 每个样式块前都补简洁注释，便于快速定位
  - 桌面规则写在前，响应式覆盖统一放在文件后部
  - 修改前先定位所属分区，再处理具体样式块
*/



/* 全局变量 */
/* 全局变量：深色主题与公共尺寸变量 */
:root {
  --background: #0c0c10;
  --foreground: #d7d7d7;
  --accent: #8a959e;
  --secondary: #d0d0da;
  --border-color: rgb(138, 149, 158);
  --theme-toggle-border: rgb(138, 149, 158);
  --theme-toggle-hover-bg: rgba(81, 16, 59, 0.62);
  --about-surface: #181a20;
  --about-surface-border: rgba(255, 255, 255, 0.08);
  --about-surface-shadow: 0 22px 48px rgba(0, 0, 0, 0.28);
  --about-avatar-ring: #181a20;

  --header-control-size: 38px;
}



/* 全局变量：浅色主题变量覆盖 */
html[data-theme="light"] {
  --background: #f7f4eb;
  --foreground: #1a1a1a;
  --accent: #222222;
  --secondary: #355c9a;
  --border-color: rgba(34, 34, 34, 0.3);
  --theme-toggle-border: rgba(34, 34, 34, 0.65);
  --theme-toggle-hover-bg: rgba(34, 34, 34, 0.08);
  --about-surface: #fffdf7;
  --about-surface-border: rgba(26, 26, 26, 0.08);
  --about-surface-shadow: 0 20px 44px rgba(27, 31, 35, 0.12);
  --about-avatar-ring: #fffdf7;
}



/* 全局基础 */
/* 全局基础：页面基础前景与背景 */
body {
  background: var(--background);
  color: var(--foreground);
}

/* 全局基础：主容器层级上下文 */
.container {
  position: relative;
  z-index: 1;
}

/* 全局基础：正文主区域弹性布局 */
.content {

  flex: 1 0 auto;
}

/* 全局基础：文章边框颜色 */
.post {
  border-color: var(--border-color);
}



/* 全局基础：像素粒子背景层 */
.pixel-snow {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
  opacity: 0.72;
}



/* 首页 Hero */
/* 首页 Hero：首页首屏容器 */
.flickering-grid-hero {
  --hero-border-color: #5f87ac;
  --hero-shadow-color: #055eae;
  --hero-title-color: #5f87ac;
  --hero-subtitle-color: var(--accent);
  --hero-text-color: #b8cae0;
  --hero-glyph-color: #6389b0;
  position: relative;
  isolation: isolate;
  display: block;
  min-height: 150px;
  margin: 8px 0 32px;
  border: 1px solid var(--hero-border-color);
  border-radius: 0;
  overflow: hidden;
  background: var(--background);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--hero-shadow-color) 32%, transparent);
}

/* 首页 Hero：字符矩阵背景层包裹 */
.flickering-grid-layer {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  overflow: hidden;
  pointer-events: none;
}

/* 首页 Hero：字符矩阵画布 */
.flickering-grid {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0.88;
  pointer-events: none;
}

/* 首页 Hero：首屏内容区 */
.flickering-grid-hero__content {
  position: relative;
  z-index: 1;
  width: 100%;
  margin: 0;
  padding: 28px 32px;
  color: var(--hero-text-color);
}

/* 首页 Hero：首屏主标题颜色 */
.flickering-grid-hero__content h1 {
  color: var(--hero-title-color);
  margin-bottom: 25px;
}

/* 首页 Hero：首屏副标题颜色 */
.flickering-grid-hero__content h2,
.flickering-grid-hero__content h3 {
  color: var(--hero-subtitle-color);
  margin-top: 0;
}

/* 首页 Hero：首元素上边距收口 */
.flickering-grid-hero__content > :first-child {
  margin-top: 0;
}

/* 首页 Hero：末元素下边距收口 */
.flickering-grid-hero__content > :last-child {
  margin-bottom: 0;
}



/* About */
/* About：About 页面外层容器 */
.about-page {
  position: relative;
  width: 100%;
  margin: -20px 0 0;
}

/* About：横幅全宽包裹层 */
.about-hero-shell {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}

/* About：资料区与热力图区定位基线 */
.about-hero__profile,
.about-hero__heatmap {
  position: relative;
}

/* About：顶部横幅背景 */
.about-hero__banner {
  position: relative;
  min-height: clamp(320px, 34vw, 660px);
  background:
    linear-gradient(
      165deg,
      #7b2cbf 0%,
      #7b2cbf 46%,
      #1665b3 46%,
      #1665b3 82%,
      #ea1d3b 82%,
      #ea1d3b 100%
    );
  overflow: hidden;
}

/* About：横幅前景装饰 */
.about-hero__banner::before {
  content: "";
  position: absolute;
  inset: auto auto 0 0;
  width: 42%;
  height: 46%;
  background: #f79b16;
  clip-path: polygon(0 0, 100% 36%, 100% 100%, 0 100%);
}

/* About：横幅暗化与光斑覆盖 */
.about-hero__banner::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 22% 22%, rgba(255, 255, 255, 0.06), transparent 22%),
    radial-gradient(circle at 86% 18%, rgba(255, 255, 255, 0.06), transparent 20%),
    linear-gradient(180deg, rgba(16, 18, 22, 0.74) 0%, rgba(16, 18, 22, 0.28) 18%, rgba(16, 18, 22, 0.08) 34%, rgba(16, 18, 22, 0) 48%);
  pointer-events: none;
}

/* About：自定义背景图模式 */
.about-hero__banner.has-image {
  background-color: color-mix(in srgb, var(--background) 92%, black 8%);
  background-position: center 42%;
  background-repeat: no-repeat;
  background-size: cover;
}

/* About：图片模式关闭前景装饰 */
.about-hero__banner.has-image::before {
  display: none;
}

/* About：主体卡片容器 */
.about-card {
  position: relative;
  z-index: 2;
  max-width: 980px;
  margin: -96px auto 48px;
  padding: 0 0 56px;
  border-radius: 10px;
  background: var(--about-surface);
  border: 1px solid var(--about-surface-border);
  border-top-color: transparent;
  box-shadow: var(--about-surface-shadow);
}

/* About：头像与资料区 */
.about-hero__profile {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0 32px;
  transform: translateY(-96px);
  margin-bottom: -60px;
}

/* About：头像样式 */
.about-hero__avatar {
  display: block;
  width: 168px;
  height: 168px;
  margin: 0;
  padding: 0;
  border-radius: 50%;
  object-fit: cover;
  border: none;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
  background: transparent;
  overflow: hidden;
}

/* About：昵称标题 */
.about-hero__name {
  margin: 22px 0 10px;
  font-size: clamp(2rem, 4vw, 3rem);
}

/* About：座右铭文字 */
.about-hero__motto {
  max-width: 620px;
  margin: 16px 0 0;
  color: color-mix(in srgb, var(--foreground) 82%, transparent);
  font-size: 1rem;
  line-height: 1.8;
}

/* About：社交链接容器 */
.about-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  width: 100%;
  margin: 18px auto -30px;
}

/* About：dock 风格社交组 */
.about-links--dock {
  gap: 12px;
  padding: 8px 12px;
}

/* About：社交按钮项 */
.about-links__item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 16px;
  border: 1px solid color-mix(in srgb, var(--foreground) 8%, transparent);
  background: color-mix(in srgb, var(--background) 94%, white 2%);
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.10),
    0 1px 0 color-mix(in srgb, var(--foreground) 6%, transparent) inset;
  color: var(--accent);
  text-decoration: none;
  line-height: 0;
  opacity: 0.82;
  transform: translateY(var(--dock-lift, 0)) scale(var(--dock-scale, 1));
  transform-origin: center bottom;
  transition:
    opacity 0.18s ease,
    color 0.18s ease,
    transform 0.16s ease,
    background-color 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease;
  will-change: transform;
}

/* About：社交按钮悬停态 */
.about-links__item:hover {
  opacity: 1;
  color: var(--accent);
}

/* About：dock 按钮悬停态 */
.about-links--dock .about-links__item:hover {
  background: color-mix(in srgb, var(--accent) 12%, var(--background));
  border-color: color-mix(in srgb, var(--accent) 20%, transparent);
  box-shadow:
    0 16px 30px rgba(0, 0, 0, 0.14),
    0 1px 0 color-mix(in srgb, var(--foreground) 10%, transparent) inset;
}

/* About：社交图标容器 */
.about-links__icon {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* About：社交图标尺寸 */
.about-links__icon svg {
  width: 20px;
  height: 20px;
  display: block;
  flex: 0 0 auto;
}



/* About */
/* About：浅色主题社交按钮 */
html[data-theme="light"] .about-links__item {
  background: color-mix(in srgb, white 92%, var(--background) 8%);
  box-shadow:
    0 12px 22px rgba(27, 31, 35, 0.10),
    0 1px 0 rgba(255, 255, 255, 0.65) inset;
}



/* About */
/* About：热力图区容器 */
.about-hero__heatmap {
  margin: 0 0 32px;
  display: flex;
  justify-content: center;
  padding: 0 32px;
}

/* About：热力图图片卡片 */
.about-hero__heatmap .about-hero__heatmap-image {
  display: block;
  width: min(100%, 680px);
  height: auto;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--foreground) 10%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--background) 94%, white 2%);
}

/* About：浅色热力图默认隐藏 */
.about-hero__heatmap .about-hero__heatmap-image--light {
  display: none;
}

/* About：深色热力图默认显示 */
.about-hero__heatmap .about-hero__heatmap-image--dark {
  display: block;
}



/* About */
/* About：浅色主题显示浅色热力图 */
html[data-theme="light"] .about-hero__heatmap .about-hero__heatmap-image--light {
  display: block;
}

/* About：浅色主题隐藏深色热力图 */
html[data-theme="light"] .about-hero__heatmap .about-hero__heatmap-image--dark {
  display: none;
}



/* About */
/* About：About 正文区 */
.about-body {
  max-width: 760px;
  margin: 0 auto;
  clear: both;
  padding: 0 32px;
}

/* About：打字机文字容器 */
.typewriter-hero {
  position: relative;
  display: inline-block;
  min-height: 1.2em;
}

/* About：打字机光标 */
.typewriter-hero::after {
  content: "";
  display: inline-block;
  width: 0.08em;
  height: 0.95em;
  margin-left: 0.08em;
  background: currentColor;
  vertical-align: -0.08em;
  animation: typewriter-caret 0.9s steps(1) infinite;
}

/* About：打字机光标动画 */
@keyframes typewriter-caret {
  /* About：关键帧：光标显示 */
  0%,
  49% {
    opacity: 1;
  }

  /* About：关键帧：光标隐藏 */
  50%,
  100% {
    opacity: 0;
  }
}



/* Header */
/* Header：常用元素过渡动画 */
.post,
.post-content,
.post-title,
.logo,
.navigation-menu a,
.menu a,
.footer,
.footer a {
  transition: background-color 0.5s ease, color 0.2s ease, border-color 0.2s ease;
}

/* Header：右侧控件容器 */
.header__controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: 16px;
}

/* Header：头部层级容器 */
.header {
  position: relative;
  z-index: 5;
  isolation: isolate;
}

/* Header：导航容器层级 */
.navigation-menu {
  position: relative;
  z-index: 4;
}

/* Header：logo 区默认布局 */
.header__logo {
  display: flex;
  flex: 1;
}

/* Header：logo 后默认竖线装饰 */
.header__logo::after {
  content: "";
  background: repeating-linear-gradient(
    90deg,
    var(--accent),
    var(--accent) 2px,
    transparent 0,
    transparent 10px
  );
  display: block;
  width: 100%;
  right: 10px;
}

/* Header：头部背景整屏延展 */
.header::before,
.navigation-menu::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 100vw;
  transform: translateX(-50%);
  background: var(--background);
  z-index: -1;
  pointer-events: none;
}

/* Header：导航链接去下划线 */
.navigation-menu a,
.menu__dropdown a {
  text-decoration: none;
}

/* Header：桌面导航字号 */
.navigation-menu .navigation-menu__inner > li > a {

  font-size: 1.18rem !important;
}

/* Header：当前导航激活态 */
.navigation-menu a.is-active,
.menu__dropdown a.is-active {
  text-decoration: underline;
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
}



/* Header：站点 logo 盒子 */
.logo {
  height: var(--header-control-size);
  padding: 0 10px;
  line-height: 1;
  display: flex;
  align-items: center;
  box-sizing: border-box;
  font-size: 1rem !important;
  font-family: "Noto Serif SC", "Source Han Serif SC", "Songti SC", serif;
  font-weight: 700;
}


/* Header：通用图标按钮 */
.header-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--accent);
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  width: var(--header-control-size);
  height: var(--header-control-size);
  min-width: var(--header-control-size);
  min-height: var(--header-control-size);
  padding: 0;
  flex: 0 0 auto;
  line-height: 0;
  opacity: 1;
  box-shadow: none;
  border-radius: 0;
  box-sizing: border-box;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

/* Header：图标按钮悬停态 */
.header-icon-button:hover {
  background: transparent;
  color: var(--accent);
}

/* Header：图标按钮激活态 */
.header-icon-button.is-active {
  background: transparent;
  color: var(--accent);
  opacity: 1;
  box-shadow: none;
}

/* Header：图标按钮焦点态 */
.header-icon-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Header：图标按钮内层容器 */
.header-icon-button__icon {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Header：图标按钮 SVG 尺寸 */
.header-icon-button__icon svg {
  width: 20px;
  height: 20px;
  display: block;
  flex: 0 0 auto;
}


/* Header：主题切换按钮 */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--accent);
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  width: var(--header-control-size);
  height: var(--header-control-size);
  min-width: var(--header-control-size);
  min-height: var(--header-control-size);
  padding: 0;
  opacity: 1;
  box-shadow: none;
  border-radius: 0;
  box-sizing: border-box;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

/* Header：主题按钮悬停态 */
.theme-toggle:hover {
  background: transparent;
  color: var(--accent);
}

/* Header：主题按钮焦点态 */
.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Header：主题图标容器 */
.theme-toggle__icon {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Header：主题图标 SVG 尺寸 */
.theme-toggle__icon svg {
  width: 20px;
  height: 20px;
  display: block;
  flex: 0 0 auto;
}

/* Header：深色图标默认隐藏 */
.theme-toggle__icon--dark {
  display: none;
}



/* Header */
/* Header：浅色主题隐藏浅色图标 */
html[data-theme="light"] .theme-toggle__icon--light {
  display: none;
}

/* Header：浅色主题显示深色图标 */
html[data-theme="light"] .theme-toggle__icon--dark {
  display: block;
}



/* Search */
/* Search：搜索弹层外壳 */
.site-search {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 80px 20px 20px;
}

/* Search：搜索弹层隐藏态 */
.site-search.hidden {
  display: none;
}

/* Search：搜索遮罩层 */
.site-search__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
}

/* Search：搜索面板 */
.site-search__panel {
  position: relative;
  z-index: 1;
  width: min(780px, 100%);
  background: color-mix(in srgb, var(--background) 94%, black);
  border: 1px solid var(--theme-toggle-border);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35);
}

/* Search：搜索头部与结果区内边距 */
.site-search__header,
.site-search__results {
  padding: 14px;
}

/* Search：搜索底部操作区 */
.site-search__footer {
  padding: 14px;
  border-top: 1px solid color-mix(in srgb, var(--theme-toggle-border) 40%, transparent);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* Search：搜索输入容器 */
.site-search__input {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid color-mix(in srgb, var(--secondary) 60%, transparent);
  background: transparent;
  padding: 10px 14px;
}

/* Search：搜索图标容器 */
.site-search__input-icon {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--secondary);
  flex: 0 0 auto;
}

/* Search：搜索图标尺寸 */
.site-search__input-icon svg {
  width: 24px;
  height: 24px;
  display: block;
}

/* Search：搜索输入字段 */
.site-search__field {
  border: none;
  outline: none;
  box-shadow: none;
  background: transparent;
  color: var(--foreground);
  padding: 0;
  width: 100%;
  font: inherit;
  font-size: 1.125rem;
  appearance: none;
  -webkit-appearance: none;
  border-radius: 0;
}

/* Search：输入字段交互态重置 */
.site-search__field:hover,
.site-search__field:focus,
.site-search__field:focus-visible,
.site-search__field:active {
  border: none;
  outline: none;
  box-shadow: none;
}

/* Search：占位文本颜色 */
.site-search__field::placeholder {
  color: color-mix(in srgb, var(--foreground) 55%, transparent);
}

/* Search：结果列表滚动区 */
.site-search__results {
  min-height: 120px;
  max-height: 380px;
  overflow: auto;
}

/* Search：空结果提示 */
.site-search__empty {
  color: color-mix(in srgb, var(--foreground) 72%, transparent);
  text-align: center;
  padding: 42px 20px;
}

/* Search：结果项 */
.site-search__item {
  display: block;
  padding: 16px 18px;
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--theme-toggle-border) 40%, transparent);
  color: var(--foreground);
}

/* Search：末项边框收口 */
.site-search__item:last-child {
  border-bottom: none;
}

/* Search：结果项悬停态 */
.site-search__item:hover {
  background: color-mix(in srgb, var(--secondary) 16%, transparent);
}

/* Search：结果标题 */
.site-search__item-title {
  color: var(--foreground);
  font-weight: bold;
  margin-bottom: 6px;
}

/* Search：标题高亮 */
.site-search__item-title mark {
  background: color-mix(in srgb, var(--accent) 32%, transparent);
  color: var(--foreground);
  padding: 0 2px;
}

/* Search：结果元信息 */
.site-search__item-meta {
  color: var(--secondary);
  font-size: 0.92rem;
}

/* Search：结果摘要 */
.site-search__item-snippet {
  margin-top: 8px;
  color: color-mix(in srgb, var(--foreground) 82%, transparent);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* Search：摘要高亮 */
.site-search__item-snippet mark {
  background: color-mix(in srgb, var(--accent) 32%, transparent);
  color: var(--foreground);
  padding: 0 2px;
}

/* Search：底部操作按钮 */
.site-search__action {
  min-width: 88px;
  min-height: 40px;
  padding: 8px 16px;
  border: 1px solid var(--theme-toggle-border);
  background: transparent;
  color: var(--accent);
}

/* Search：操作按钮悬停态 */
.site-search__action:hover {
  background: var(--theme-toggle-hover-bg);
}

/* Search：弱化按钮样式 */
.site-search__action--ghost {
  color: var(--foreground);
  border-color: color-mix(in srgb, var(--foreground) 28%, transparent);
}



/* Footer */
/* Footer：页脚基础布局 */
.footer {

  margin-top: auto;
}

/* Footer：页脚文字整体居中 */
.footer .footer__inner,
.footer .copyright,
.footer .copyright__beian {
  text-align: center;
}

/* Footer：版权信息垂直排列 */
.footer .copyright {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

/* Footer：备案链接去下划线 */
.footer .copyright__beian a {
  text-decoration: none;
}

/* Footer：备案信息块 */
.footer .copyright__beian {
  display: block;
  width: 100%;
  text-align: center;
}

/* Footer：页脚链接去下划线 */
.footer a {
  text-decoration: none;
}


/* Footer：统一页脚字号 */
.footer,
.footer a {
  font-size: 0.80rem;
}



/* Footer：sticky footer 容器高度基线 */
.container {

  min-height: 100vh !important;

  padding-bottom: 0 !important;
}

/* Footer：正文区撑开剩余高度 */
.container .content,
body .content {

  flex: 1 0 auto !important;
  flex-grow: 1 !important;

  min-height: 0 !important;
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}

/* Footer：正文末元素边距收口 */
.container .content > :last-child {

  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}

/* Footer：常见内容块末尾边距收口 */
.container .content :is(.post, .posts, .terms, .archive, .post-content, ul, ol):last-child {

  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}

/* Footer：内容块内部末元素边距收口 */
.container .content :is(.post, .posts, .terms, .archive, .post-content) > :last-child {

  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}

/* Footer：阅读更多按钮前间距恢复 */
.posts .post-content + div {

  margin-top: 25px !important;
}

/* Footer：分页区顶部间距 */
.pagination {

  margin-top: 16px !important;
}

/* Footer：空分页容器隐藏 */
.pagination:not(:has(a)) {

  display: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Footer：sticky footer 顶部留白 */
.container .footer {

  margin-top: auto !important;
  padding-top: 30px !important;
  padding-bottom: 0 !important;
}



/* TOC */
/* TOC：超文本效果容器 */
.hyper-text {
  display: inline-block;
  cursor: default;
  user-select: none;
}

/* TOC：标签列表容器 */
.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

/* TOC：术语页标签列表 */
.post-tags--terms {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  margin-top: 18px;
}

/* TOC：标签胶囊项 */
.post-tags .tag-chip {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

/* TOC：术语页标签显示方式 */
.post-tags--terms .tag-chip {
  display: inline-block;
}

/* TOC：标签配色 0 */
.post-tags .tag-chip--0 {
  color: #b54747;
}

/* TOC：标签配色 1 */
.post-tags .tag-chip--1 {
  color: #355c9a;
}

/* TOC：标签配色 2 */
.post-tags .tag-chip--2 {
  color: #2f7a4e;
}

/* TOC：标签配色 3 */
.post-tags .tag-chip--3 {
  color: #8c5a1e;
}

/* TOC：标签配色 4 */
.post-tags .tag-chip--4 {
  color: #7a3fa0;
}

/* TOC：标签配色 5 */
.post-tags .tag-chip--5 {
  color: #4f646f;
}

/* TOC：标签悬停态 */
.post-tags .tag-chip:hover {
  opacity: 0.8;
}

/* TOC：文章页目录布局开关 */
.post-layout.has-toc {
  position: static;
  display: block;
}

/* TOC：桌面侧边目录容器 */
.post-sidebar {
  --post-sidebar-width: 260px;
  position: fixed;
  top: 50%;
  right: var(--post-sidebar-runtime-right, 12px);
  width: var(--post-sidebar-runtime-width, var(--post-sidebar-width));
  height: 60vh;
  transform: translateY(-50%);
  display: flex;
  align-items: stretch;
  z-index: 6;
  pointer-events: none;
}

/* TOC：目录开关按钮 */
.toc-toggle {
  position: absolute;
  top: 4px;
  left: 0;
  right: auto;
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  background: transparent;
  color: color-mix(in srgb, var(--foreground) 62%, transparent);
  cursor: pointer;
  pointer-events: auto;
  box-shadow: none;
  z-index: 2;
}

/* TOC：目录按钮悬停态 */
.toc-toggle:hover {
  background: transparent;
  color: var(--foreground);
}

/* TOC：目录按钮焦点态 */
.toc-toggle:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 2px;
}

/* TOC：目录按钮图标容器 */
.toc-toggle__icon {
  width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* TOC：目录按钮图标尺寸 */
.toc-toggle__icon svg {
  width: 14px;
  height: 14px;
  display: block;
}

/* TOC：展开图标默认隐藏 */
.toc-toggle__icon--open {
  display: none;
}

/* TOC：折叠时显示展开图标 */
.post-sidebar.is-collapsed .toc-toggle__icon--open {
  display: inline-flex;
}

/* TOC：折叠时隐藏关闭图标 */
.post-sidebar.is-collapsed .toc-toggle__icon--close {
  display: none;
}

/* TOC：目录面板主体 */
.toc-sidebar {
  position: relative;
  top: auto;
  margin: 0;
  width: 100%;
  height: 100%;
  padding: 34px 0 24px;
  border-left: none;
  max-height: none;
  overflow: hidden;
  -ms-overflow-style: none;
  scrollbar-width: none;
  pointer-events: auto;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

/* TOC：折叠时隐藏目录面板 */
.post-sidebar.is-collapsed .toc-sidebar {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(16px);
}

/* TOC：隐藏目录滚动条 */
.toc-sidebar::-webkit-scrollbar {
  display: none;
}

/* TOC：目录标题 */
.toc-sidebar h2 {
  margin: 0 0 14px;
  font-size: 0.88rem;
  font-weight: 500;
  color: color-mix(in srgb, var(--foreground) 48%, transparent);
}

/* TOC：目录滚动容器 */
.toc-sidebar nav {
  display: block;
  overflow-y: auto;
  padding-right: 6px;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* TOC：隐藏内部滚动条 */
.toc-sidebar nav::-webkit-scrollbar {
  display: none;
}

/* TOC：目录列表重置 */
.toc-sidebar ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* TOC：子级目录缩进与分隔线 */
.toc-sidebar ul ul {
  margin-top: 8px;
  margin-left: 12px;
  padding-left: 12px;
  border-left: 1px solid color-mix(in srgb, var(--foreground) 14%, transparent);
}

/* TOC：目录项间距 */
.toc-sidebar li {
  margin: 0 0 12px;
}

/* TOC：关闭默认列表前缀 */
.toc-sidebar li::before {
  display: none !important;
}

/* TOC：目录链接 */
.toc-sidebar a {
  color: color-mix(in srgb, var(--foreground) 76%, transparent);
  text-decoration: none;
  line-height: 1.7;
}

/* TOC：目录链接悬停态 */
.toc-sidebar a:hover {
  color: var(--accent);
}

/* TOC：压缩桌面态保留侧栏并收紧按钮与标题 */
.post-sidebar.is-tight .toc-toggle {
  top: 2px;
  left: 10px;
  width: 20px;
  height: 20px;
  z-index: 3;
  background: var(--background);
}

.post-sidebar.is-tight .toc-sidebar {
  padding-top: 30px;
}

.post-sidebar.is-tight .toc-sidebar h2 {
  margin-bottom: 12px;
  padding-left: 30px;
  font-size: 0.82rem;
}

.post-sidebar.is-tight .toc-sidebar li {
  margin-bottom: 10px;
}

.post-sidebar.is-tight .toc-sidebar a {
  font-size: 0.94rem;
  line-height: 1.55;
}


/* 响应式 */
/* 响应式：移动端整体覆盖 */
@media (max-width: 684px) {
  /* 响应式：关闭横向溢出 */
  html,
  body {
    overflow-x: hidden;
  }

  /* 响应式：缩小头部控件间距 */
  .header__controls {
    margin-left: 12px;
    gap: 5px;
  }

  /* 响应式：收窄主容器内边距 */
  .container {
    padding: 16px 12px;
    max-width: 100%;
    overflow-x: clip;
  }

  /* 响应式：头部主行对齐调整 */
  .header__inner {
    align-items: center;
    gap: 10px;
  }

  /* 响应式：logo 区允许收缩 */
  .header__logo {
    min-width: 0;
  }

  /* 响应式：logo 后装饰线 */
  .header__logo::after {
    display: block;
    flex: 1 1 auto;
    min-width: 36px;
    margin-left: 8px;
    background: repeating-linear-gradient(
      90deg,
      var(--accent),
      var(--accent) 2px,
      transparent 2px,
      transparent 10px
    );
  }

  /* 响应式：logo 最大宽度约束 */
  .logo {
    max-width: 100%;
    overflow: hidden;
  }

  /* 响应式：导航顶部间距 */
  .navigation-menu {
    margin: 12px 0 0;
  }

  /* 响应式：导航允许换行 */
  .navigation-menu__inner {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    padding: 0;
  }

  /* 响应式：导航项内外边距重置 */
  .navigation-menu__inner li {
    margin: 0;
    padding: 0;
  }

  /* 响应式：导航项右间距 */
  .navigation-menu__inner > li:not(:last-of-type) {
    margin-right: 22px;
  }

  /* 响应式：主题按钮尺寸同步 */
  .theme-toggle {
    width: var(--header-control-size);
    height: var(--header-control-size);
    min-width: var(--header-control-size);
    min-height: var(--header-control-size);
  }

  /* 响应式：图标按钮尺寸同步 */
  .header-icon-button {
    width: var(--header-control-size);
    height: var(--header-control-size);
    min-width: var(--header-control-size);
    min-height: var(--header-control-size);
  }

  /* 响应式：隐藏语言菜单触发器 */
  .menu--language-selector .menu__trigger {
    display: none;
  }

  /* 响应式：缩小搜索弹层留白 */
  .site-search {
    padding: 24px 12px 12px;
  }

  /* 响应式：搜索面板铺满宽度 */
  .site-search__panel {
    width: 100%;
  }

  /* 响应式：缩小搜索区内边距 */
  .site-search__header,
  .site-search__results {
    padding: 12px;
  }

  /* 响应式：搜索底部操作重排 */
  .site-search__footer {
    padding: 12px;
    justify-content: space-between;
  }

  /* 响应式：缩小输入框内边距 */
  .site-search__input {
    padding: 10px 12px;
  }

  /* 响应式：缩小输入字号 */
  .site-search__field {
    font-size: 1rem;
  }

  /* 响应式：首页 Hero 高度与间距收缩 */
  .flickering-grid-hero {
    min-height: 180px;
    margin: 6px 0 24px;
    width: 100%;
  }

  /* 响应式：首页 Hero 留白收缩 */
  .flickering-grid-hero__content {
    padding: 20px 18px;
    overflow-wrap: anywhere;
  }

  /* 响应式：About 顶部外边距调整 */
  .about-page {
    margin: 10px 0 0;
  }

  /* 响应式：About 横幅恢复容器宽度 */
  .about-hero-shell {
    width: auto;
    margin-left: -12px;
    margin-right: -12px;
  }

  /* 响应式：About 横幅高度收缩 */
  .about-hero__banner {
    min-height: 240px;
    background-position: center 36%;
  }

  /* 响应式：About 头像缩小 */
  .about-hero__avatar {
    width: 124px;
    height: 124px;
    padding: 0;
  }

  /* 响应式：About 主卡片缩窄 */
  .about-card {
    margin: -62px 0 32px;
    max-width: 100%;
    padding-bottom: 32px;
    border-radius: 18px;
  }

  /* 响应式：About 资料区位移收缩 */
  .about-hero__profile {
    padding: 0 18px;
    transform: translateY(-64px);
    margin-bottom: -34px;
  }

  /* 响应式：About 热力图区间距收缩 */
  .about-hero__heatmap {
    margin-bottom: 22px;
    padding: 0 10px;
  }

  /* 响应式：About 热力图铺满宽度 */
  .about-hero__heatmap .about-hero__heatmap-image {
    width: 100%;
    padding: 8px;
  }

  /* 响应式：About 社交链接允许换行 */
  .about-links,
  .about-links--dock {
    flex-wrap: wrap;
    gap: 10px;
    padding: 6px 0;
  }

  /* 响应式：About 社交按钮放大触控区 */
  .about-links__item {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    transform: none !important;
  }

  /* 响应式：About 社交图标缩小 */
  .about-links__icon,
  .about-links__icon svg {
    width: 18px;
    height: 18px;
  }

  /* 响应式：About 正文左右留白 */
  .about-body {
    padding: 0 18px;
    overflow-wrap: anywhere;
  }

  /* 响应式：文章文本防止溢出 */
  .post,
  .posts,
  .post-content,
  .post-title,
  .post-title a {
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  /* 响应式：元信息与标签允许换行 */
  .post-meta,
  .post-tags {
    overflow-wrap: anywhere;
  }

  /* 响应式：页脚底部留白 */
  .footer {
    padding-bottom: 8px;
  }

  /* 响应式：版权区宽度与字号调整 */
  .footer .copyright {
    width: 100%;
    padding: 0 8px;
    gap: 4px;
    font-size: 0.82rem;
    line-height: 1.2;
  }

  /* 响应式：版权首行允许换行 */
  .footer .copyright > span:first-child {
    display: block;
    width: 100%;
    max-width: 100%;
    white-space: normal;
    word-break: break-word;
    line-height: 1.8;
    overflow-wrap: anywhere;
  }

  /* 响应式：备案区改为两行网格 */
  .footer .copyright__beian {
    font-size: 0.82rem;
    line-height: 1.8 !important;
    display: grid !important;
    grid-template-rows: auto auto;
    justify-items: center;
    row-gap: 0 !important;
    white-space: normal !important;
    word-break: break-word;
    overflow-wrap: anywhere;
  }

  /* 响应式：ICP 备案行独占一行 */
  .footer .copyright__beian-icp {
    display: block !important;
    margin: 0 !important;
    line-height: 1.8 !important;
    white-space: nowrap !important;
  }

  /* 响应式：公安备案行横向排列 */
  .footer .copyright__beian-police {
    display: inline-grid !important;
    grid-auto-flow: column;
    align-items: center;
    justify-content: center;
    column-gap: 4px;
    margin: 0 !important;
    line-height: 1.8 !important;
    white-space: nowrap !important;
  }

  /* 响应式：公安备案图标对齐 */
  .footer .copyright__beian-police .copyright__beian-logo {
    display: block;
    margin: 0;
    vertical-align: middle;
  }
}

