.custom-footer {
  background: #111;
  color: #fff;
  padding: 1rem;
  text-align: center;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin-top: 0.5rem;
  display: flex;
  justify-content: center;
  gap: 1rem;
}

.footer-links a {
  color: #ccc;
  text-decoration: none;
}

.footer-links a:hover {
  color: white;
}

/* 列表页：左文右图 */
.post-list {
  max-width: 1100px;       /* 可按主题宽度微调 */
  margin: 0 auto;
}

.post-row {
  display: flex;
  gap: 28px;
  align-items: flex-start;
  padding: 28px 0;
  border-bottom: 1px solid rgba(0,0,0,.06);
}

.post-left {
  flex: 1 1 auto;
  min-width: 0;
}

.post-title {
  margin: 0 0 6px;
  line-height: 1.25;
}

.post-meta {
  margin: 0 0 10px;
  opacity: .7;
  font-size: 0.95rem;
}

.post-summary {
  color: inherit;
  opacity: .9;
}

.post-right {
  flex: 0 0 320px;     /* 右侧图宽度，可改 280/320/360 */
  display: block;
}

.post-right img {
  width: 100%;
  height: 200px;       /* 给个统一高度，配合 object-fit 裁切 */
  object-fit: cover;
  border-radius: 10px;
  box-shadow: 0 2px 12px rgba(0,0,0,.06);
}

/* 窄屏降级为上下排 */
@media (max-width: 900px) {
  .post-row {
    flex-direction: column;
  }
  .post-right {
    flex-basis: auto;
    width: 100%;
  }
  .post-right img {
    height: auto;
  }
}

/* 阅读进度条相关样式现已内联在 head-additions.html 中 */

/* D3 小实验页面通用容器（如果被 Hugo 主题引用也不会冲突） */
.d3-demo-page {
  max-width: 960px;
  margin: 0 auto;
}

/* 首页文章卡片悬浮特效 */
.home-post-card {
  position: relative;
  margin-bottom: 0.9rem;
  background: rgba(255, 255, 255, 0.34);
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 8px;
  backdrop-filter: blur(8px) saturate(130%);
  -webkit-backdrop-filter: blur(8px) saturate(130%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.42),
    0 10px 22px rgba(15, 23, 42, 0.1);
  transition: transform 0.15s ease-out, box-shadow 0.15s ease-out, background 0.15s ease-out, border-color 0.15s ease-out;
}

.home-post-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(132deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.01) 36%, rgba(255, 255, 255, 0.1) 100%);
  opacity: 0.62;
}

.home-post-card:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    0 12px 28px rgba(15, 23, 42, 0.14);
  background: rgba(255, 255, 255, 0.42);
  border-color: rgba(255, 255, 255, 0.4);
  z-index: 2;
}

/* 首页底部：电子生命网格背景 */
.home-life-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 1;
  background: transparent;
  box-shadow: none;
  will-change: clip-path;
}

.home-life-grid::before {
  content: none;
}

.home-life-grid-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.home-main-shell {
  position: relative;
  z-index: 1;
  isolation: isolate;
}

.home-main-content {
  position: relative;
  z-index: 1;
}

/* 预览：默认适度裁剪，悬浮时展开更多 */
.home-post-preview {
  max-height: 4.5em; /* 大约 3 行 */
  overflow: hidden;
  position: relative;
  transition: max-height 0.2s ease-out;
}

.home-post-card:hover .home-post-preview {
  max-height: 12em; /* 悬浮时展示更多文字作为预览 */
}

/* 首页：文章 Markdown 下载按钮 */
.home-post-download-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  padding: 0 0.7rem;
  border-radius: 999px;
  font-size: 0.8rem;
  border: 1px solid rgba(15, 23, 42, 0.22);
  color: #0f172a;
  background: rgba(148, 163, 184, 0.08);
  text-decoration: none;
  cursor: pointer;
}

.home-post-download-btn,
.home-post-qr-btn {
  box-sizing: border-box;
  height: 32px;
  min-height: 32px;
  line-height: 1;
  font-family: inherit;
  font-weight: inherit;
}

.home-post-download-btn:hover {
  background: rgba(148, 163, 184, 0.18);
  border-color: rgba(15, 23, 42, 0.35);
}

.home-post-download-btn.is-copied {
  background: rgba(34, 197, 94, 0.15);
  border-color: rgba(22, 163, 74, 0.6);
  color: #166534;
}

.home-post-download-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.home-post-download-text {
  letter-spacing: 0.02em;
}

.home-post-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}


.home-post-qr-btn {
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
  vertical-align: middle;
}

.home-post-qr-btn:hover {
  background: rgba(148, 163, 184, 0.18);
  border-color: rgba(15, 23, 42, 0.35);
}

.home-post-qr-inline {
  margin-top: 0.55rem;
  width: min(86vw, 250px);
  padding: 0.48rem;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  background: rgba(248, 250, 252, 0.96);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
}

.home-post-qr-image {
  width: 100%;
  max-width: 220px;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  display: none;
  margin: 0 auto;
  background: #ffffff;
  border: 1px solid rgba(148, 163, 184, 0.45);
  border-radius: 10px;
}

.home-post-qr-loading {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.4;
  color: #475569;
  text-align: center;
}

.home-subtitle-row,
.category-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.home-category-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  padding: 0.5rem 1.15rem;
  font-size: 0.98rem;
  font-weight: 600;
  text-decoration: none;
  color: #e5e7eb;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.home-category-btn:hover {
  transform: translateY(-1px);
  background: rgba(15, 23, 42, 0.84);
  box-shadow: 0 8px 20px rgba(2, 6, 23, 0.45);
}

.category-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 0.8rem 0 1rem;
}

.category-filter-btn {
  border: 1px solid rgba(148, 163, 184, 0.55);
  border-radius: 999px;
  padding: 0.36rem 0.85rem;
  font-size: 0.84rem;
  color: #e5e7eb;
  background: rgba(15, 23, 42, 0.72);
  cursor: pointer;
}

.category-filter-btn:hover {
  background: rgba(15, 23, 42, 0.86);
}

.category-filter-btn.is-active {
  background: rgba(56, 189, 248, 0.22);
  border-color: rgba(125, 211, 252, 0.88);
  color: #f8fafc;
}

.category-panel {
  display: none;
}

.category-panel.is-active {
  display: block;
}

body:not(.dark-mode) .home-category-btn {
  background: rgba(241, 245, 249, 0.82);
  color: #111827;
  border-color: rgba(148, 163, 184, 0.8);
}

body:not(.dark-mode) .home-category-btn:hover {
  background: rgba(226, 232, 240, 0.9);
}

body:not(.dark-mode) .category-filter-btn {
  background: rgba(241, 245, 249, 0.82);
  color: #111827;
  border-color: rgba(148, 163, 184, 0.8);
}

body:not(.dark-mode) .category-filter-btn:hover {
  background: rgba(226, 232, 240, 0.92);
}

body:not(.dark-mode) .category-filter-btn.is-active {
  background: rgba(59, 130, 246, 0.16);
  border-color: rgba(59, 130, 246, 0.58);
}

/* 首页 hero 区域中的搜索条：稍微拉高背景区域 */
.home-hero-search {
  max-width: 720px;
  margin: 0 auto;
}

.home-hero-search form {
  /* 去掉横向深色背景条，只保留输入框和按钮本身 */
  background: transparent;
  border-radius: 0;
  padding: 0;
}

.home-hero-search input[type="search"] {
  background-color: #ffffff;
}

body.dark-mode .home-hero-search form {
  background: transparent;
}

.site-nav-brand-row {
  display: inline-flex;
  align-items: center;
  gap: 1.25rem;
  min-width: 0;
}

.repo-stats-badge {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 0.34rem;
}

.repo-stats-badge-link {
  display: inline-flex;
  align-items: center;
  gap: 0.34rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: #f8fafc;
  font-family: inherit;
  font-size: 1.00rem;
  font-weight: 200;
  line-height: 1.2;
  letter-spacing: 0;
  text-decoration: none !important;
  border-bottom: 0 !important;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  transition: opacity 0.14s ease-out;
}

.repo-stats-badge-link:hover,
.repo-stats-badge-link:focus-visible {
  opacity: 0.82;
  text-decoration: none !important;
  border-bottom: 0 !important;
}

.repo-stats-label {
  opacity: 0.9;
}

.repo-stats-sep {
  opacity: 0.62;
}

.repo-stats-icon {
  color: inherit;
  font-variant-emoji: text;
}

.repo-stats-icon--person {
  color: #111827 !important;
  display: inline-block;
  filter: grayscale(1) brightness(0) contrast(1.1);
  -webkit-filter: grayscale(1) brightness(0) contrast(1.1);
}

.site-nav-fixed .repo-stats-badge-link,
.site-nav-fixed .repo-stats-badge-link:hover,
.site-nav-fixed .repo-stats-badge-link:focus-visible,
.site-nav-fixed .repo-stats-badge-link:active {
  text-decoration: none !important;
  border-bottom: 0 !important;
}

@media (max-width: 900px) {
  .site-nav-brand-row {
    gap: 0.72rem;
  }

  .repo-stats-badge-link {
    font-size: 0.96rem;
    gap: 0.26rem;
  }
}

@media (max-width: 540px) {
  .repo-stats-badge-link {
    font-size: 0.82rem;
  }
}

/* 首页舞台幕布：绳索 + 幕布收放 */
.hero-curtain-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 14;
  overflow: visible;
  background: transparent !important;
}

.hero-curtain-panel {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  transform: translateY(-118%);
  transform-origin: top center;
  transition: transform 0.78s cubic-bezier(0.24, 1.04, 0.25, 1);
  background: transparent !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  overflow: visible;
}

.hero-curtain-panel::before,
.hero-curtain-panel::after {
  content: none !important;
}

.hero-curtain-panel.is-open {
  transform: translateY(0);
}

.hero-curtain-board {
  position: absolute;
  left: 50%;
  top: 12px;
  transform: translateX(-50%);
  width: min(92vw, 1020px);
  height: auto;
  min-height: min(72vh, 520px);
  padding: 20px 22px 28px 40px;
  isolation: isolate;
  border: 16px solid #8b5a2b;
  border-bottom-width: 22px;
  border-radius: 4px;
  background:
    radial-gradient(circle at 22% 12%, rgba(255, 255, 255, 0.08), transparent 42%),
    radial-gradient(circle at 74% 76%, rgba(255, 255, 255, 0.06), transparent 36%),
    linear-gradient(165deg, #1f5f43 0%, #1d5a41 48%, #194c37 100%);
  box-shadow:
    inset 0 0 0 2px rgba(36, 85, 62, 0.62),
    inset 0 0 22px rgba(0, 0, 0, 0.24),
    0 18px 42px rgba(15, 23, 42, 0.5);
}

.hero-curtain-board::before {
  content: "";
  position: absolute;
  inset: -14px;
  border-radius: 3px;
  pointer-events: none;
  background: linear-gradient(125deg, rgba(255, 255, 255, 0.2), transparent 20%, transparent 80%, rgba(255, 255, 255, 0.14));
  mix-blend-mode: multiply;
}

.hero-curtain-board::after {
  content: "";
  position: absolute;
  left: -18px;
  right: -18px;
  bottom: -18px;
  height: 16px;
  border-radius: 0 0 7px 7px;
  background:
    linear-gradient(180deg, #9a6230 0%, #7f4b21 100%);
  z-index: 1;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.26),
    0 3px 6px rgba(0, 0, 0, 0.28);
}

.hero-curtain-writing {
  position: relative;
  z-index: 2;
  overflow: visible;
  color: rgba(249, 252, 245, 0.96);
  font-family: "HanziPen SC", "Xingkai SC", "STXingkai", "Kaiti SC", "STKaiti", "Chalkboard SE", "Bradley Hand", "Segoe Print", "Comic Sans MS", cursive;
  font-size: clamp(11.6px, 1.14vw, 16.8px);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0.02em;
  text-shadow:
    0.3px 0.7px 0 rgba(255, 255, 255, 0.5),
    -0.6px 1.2px 0 rgba(215, 227, 205, 0.22),
    1.2px 1.8px 2px rgba(0, 0, 0, 0.18);
  scrollbar-width: thin;
  scrollbar-color: rgba(229, 231, 235, 0.46) rgba(15, 23, 42, 0.18);
}

.hero-curtain-writing p {
  margin: 0 0 0.36rem;
}

.hero-curtain-writing-title {
  margin-top: 0.2rem;
  margin-bottom: 0.34rem;
  font-size: 1.14em;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.98);
}

.hero-curtain-writing-list {
  margin: 0 0 0.42rem;
  padding-left: 0;
  list-style: none;
}

.hero-curtain-writing-list li {
  margin: 0 0 0.28rem;
}

.hero-curtain-writing-list li::before {
  content: "- ";
}

.hero-curtain-writing a {
  color: rgba(255, 255, 255, 0.98);
  text-decoration-color: rgba(255, 255, 255, 0.7);
  text-underline-offset: 0.08em;
}

.hero-curtain-chalk {
  position: absolute;
  bottom: -8px;
  height: 8px;
  z-index: 3;
  border-radius: 3px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.3);
}

.hero-curtain-chalk--white {
  right: 142px;
  width: 31px;
  background: linear-gradient(180deg, #ffffff, #dbe2ea);
  transform: rotate(-8deg);
}

.hero-curtain-chalk--red {
  right: 101px;
  width: 28px;
  background: linear-gradient(180deg, #fda4af, #dc2626);
  transform: rotate(5deg);
}

.hero-curtain-eraser {
  position: absolute;
  right: 37px;
  bottom: -10px;
  width: 55px;
  height: 21px;
  z-index: 3;
  border-radius: 4px;
  background:
    linear-gradient(180deg, #7dd3fc 0%, #0284c7 70%, #0369a1 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.36),
    0 1px 3px rgba(15, 23, 42, 0.35);
}

.hero-curtain-rope {
  position: absolute;
  left: 26px;
  top: 4px;
  z-index: 20;
  width: 73px;
  height: 229px;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transform-origin: center top;
}

.hero-curtain-rope-thread {
  position: absolute;
  left: 50%;
  top: -34px;
  width: 9px;
  height: 200px;
  transform: translateX(-50%);
  border-radius: 6px;
  background:
    linear-gradient(
      90deg,
      rgba(255, 244, 176, 0.72) 0%,
      rgba(255, 244, 176, 0.38) 22%,
      rgba(255, 244, 176, 0.08) 38%,
      rgba(255, 244, 176, 0) 52%
    ),
    repeating-linear-gradient(
      143deg,
      rgba(151, 96, 32, 0.78) 0,
      rgba(151, 96, 32, 0.78) 2px,
      rgba(252, 202, 62, 0.95) 2px,
      rgba(252, 202, 62, 0.95) 4.8px
    ),
    linear-gradient(90deg, #b0671a 0%, #ffd44f 50%, #c1721b 100%);
  box-shadow:
    0 0 0 1px rgba(161, 96, 27, 0.28),
    0 2px 6px rgba(126, 73, 20, 0.34);
}

.hero-curtain-rope-knot {
  position: absolute;
  left: 50%;
  top: 153px;
  width: 21px;
  height: 21px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle at 30% 24%, #ffe8a2 0%, #ffc84e 44%, #d57f15 100%);
  box-shadow: 0 2px 4px rgba(132, 72, 16, 0.4);
}

.hero-curtain-rope-grip {
  position: absolute;
  left: 50%;
  top: 171px;
  width: 36px;
  height: 40px;
  transform: translateX(-50%);
  border-radius: 13px;
  border: 1px solid rgba(155, 84, 18, 0.72);
  background:
    radial-gradient(circle at 34% 18%, rgba(255, 250, 224, 0.82), rgba(255, 250, 224, 0) 44%),
    radial-gradient(circle at 72% 78%, rgba(133, 71, 16, 0.28), rgba(133, 71, 16, 0) 54%),
    radial-gradient(circle at 18% 68%, rgba(255, 184, 72, 0.26), rgba(255, 184, 72, 0) 42%),
    linear-gradient(172deg, #ffd56a 0%, #f5a623 56%, #d57c13 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.52),
    inset -3px -5px 8px rgba(124, 62, 14, 0.3),
    0 3px 8px rgba(120, 61, 15, 0.36);
}

.hero-curtain-rope-grip::before,
.hero-curtain-rope-grip::after {
  content: none;
}

.hero-curtain-rope.is-pulling {
  animation: hero-curtain-pull 600ms cubic-bezier(0.2, 0.84, 0.22, 1);
}

@keyframes hero-curtain-pull {
  0% { transform: translateY(0); }
  42% { transform: translateY(24px); }
  70% { transform: translateY(-8px); }
  100% { transform: translateY(0); }
}

.hero-curtain-rope:hover .hero-curtain-rope-grip,
.hero-curtain-rope:focus-visible .hero-curtain-rope-grip {
  filter: brightness(1.06);
  transform: translateX(-50%) scale(1.03);
}

@media (max-width: 640px) {
  .hero-curtain-board {
    width: min(94vw, 560px);
    height: auto;
    min-height: min(58vh, 360px);
    padding: 12px 10px 24px 18px;
    border-width: 12px;
    border-bottom-width: 16px;
  }

  .hero-curtain-writing {
    font-size: 11.4px;
    line-height: 1.22;
  }

  .hero-curtain-writing p {
    margin-bottom: 0.3rem;
  }

  .hero-curtain-writing-list {
    margin-bottom: 0.34rem;
  }

  .hero-curtain-board::after {
    left: -14px;
    right: -14px;
    bottom: -14px;
  }

  .hero-curtain-chalk--white {
    right: 112px;
  }

  .hero-curtain-chalk--red {
    right: 78px;
  }

  .hero-curtain-eraser {
    right: 34px;
    bottom: -8px;
  }

  .hero-curtain-rope {
    left: 12px;
    top: 2px;
    height: 200px;
  }

  .hero-curtain-rope-thread {
    height: 177px;
  }

  .hero-curtain-rope-knot {
    top: 133px;
  }

  .hero-curtain-rope-grip {
    top: 151px;
    width: 32px;
    height: 36px;
  }
}

/* 首页 hero 内部整体上移一点，下面多留空间给人物 */
.home-hero-inner {
  padding-top: 3rem;
  padding-bottom: 11rem;
}

@media (min-width: 960px) {
  .home-hero-inner {
    padding-top: 3.5rem;
    padding-bottom: 15rem;
  }
}

/* 顶部固定导航栏：始终可见 */
.site-nav-fixed {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 980;
  background-color: rgba(15, 23, 42, 0.96); /* 默认深色底 */
  color: #f9fafb;
}

.site-nav-fixed a {
  color: #f9fafb;
  text-decoration: underline;
}

.site-nav-fixed .site-nav-title {
  text-decoration: none;
}

/* 顶部导航：菜单链接悬浮特效，提醒可点击 */
.site-nav-fixed .site-nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0.26rem 0.82rem;
  font-size: 1.05rem;
  line-height: 1;
  white-space: nowrap;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.28) 0%, rgba(255,255,255,0.04) 100%),
    rgba(15, 23, 42, 0.34);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.38),
    0 8px 20px rgba(2, 6, 23, 0.28);
  backdrop-filter: blur(12px) saturate(145%);
  -webkit-backdrop-filter: blur(12px) saturate(145%);
  text-decoration: none !important;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.site-nav-fixed .site-nav-link:hover {
  transform: translateY(-1px) scale(1.03);
  border-color: rgba(191, 219, 254, 0.75);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.48),
    0 12px 24px rgba(2, 6, 23, 0.34);
}

.site-nav-fixed .site-nav-link:active {
  transform: translateY(0) scale(1.01);
}

.site-nav-fixed .site-nav-icon-item {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
}

.site-nav-fixed .site-nav-icon-plain {
  min-height: 34px;
  min-width: 34px;
  width: 34px;
  height: 34px;
  padding: 0;
  margin: 0;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #4b5563 !important;
  transform: none !important;
  text-decoration: none !important;
  line-height: 1;
}

.site-nav-fixed .site-nav-icon-plain .site-nav-icon {
  color: #374151;
  display: inline-flex;
  width: 26px;
  height: 26px;
  align-items: center;
  justify-content: center;
  line-height: 1;
  filter: none;
}

.site-nav-fixed .site-nav-icon-plain .site-nav-icon svg {
  display: block;
  width: 26px;
  height: 26px;
}

.site-nav-fixed .site-nav-icon-plain .site-nav-icon-img {
  display: block;
  width: 26px;
  height: 26px;
  object-fit: contain;
  filter: grayscale(1) brightness(0) saturate(0) opacity(0.72) !important;
}

.site-nav-fixed .site-nav-icon-plain .site-nav-icon-img--pixiv {
  width: 26px;
  height: 26px;
}

.site-nav-fixed .site-nav-icon-plain .site-nav-icon-emoji {
  display: block;
  width: 26px;
  height: 26px;
  line-height: 26px;
  text-align: center;
  font-size: 22px;
  filter: grayscale(1) brightness(0) saturate(0) opacity(0.72) !important;
}

.site-nav-fixed .site-nav-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-nav-fixed a:hover {
  color: #ffffff;
}

.site-nav-fixed a.site-nav-icon-plain:hover {
  color: #4b5563 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  transform: none !important;
}

/* 让页面内容不被顶部导航遮住 */
body {
  padding-top: 3.8rem;
}

/* 亮/暗模式下导航栏背景切换 */
body.dark-mode .site-nav-fixed {
  background-color: rgba(15, 23, 42, 0.96);
  color: #f9fafb;
}

body.dark-mode .site-nav-fixed a {
  color: #f9fafb;
  text-decoration: underline;
}

body.dark-mode .site-nav-fixed .site-nav-link:hover {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.34) 0%, rgba(255,255,255,0.07) 100%),
    rgba(15, 23, 42, 0.44);
}

body.dark-mode .site-nav-fixed .site-nav-title {
  text-decoration: none;
}

body:not(.dark-mode) .site-nav-fixed {
  background-color: rgba(249, 250, 251, 0.98); /* 亮色：近白色 */
  color: #111827;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.15);
}

body:not(.dark-mode) .site-nav-fixed a {
  color: #111827;
  text-decoration: underline;
}

body:not(.dark-mode) .site-nav-fixed .site-nav-title {
  text-decoration: none;
}

body:not(.dark-mode) .site-nav-fixed .site-nav-link:hover {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.74) 0%, rgba(255,255,255,0.3) 100%),
    rgba(241, 245, 249, 0.58);
  border-color: rgba(100, 116, 139, 0.55);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.9),
    0 12px 24px rgba(15, 23, 42, 0.18);
}

body:not(.dark-mode) .site-nav-fixed .site-nav-link {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.84) 0%, rgba(255,255,255,0.38) 100%),
    rgba(241, 245, 249, 0.62);
  border-color: rgba(148, 163, 184, 0.62);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.95),
    0 8px 20px rgba(15, 23, 42, 0.16);
}

body.dark-mode .site-nav-fixed .site-nav-icon-plain,
body.dark-mode .site-nav-fixed .site-nav-icon-plain:hover,
body.dark-mode .site-nav-fixed .site-nav-icon-plain:active {
  color: #f8fafc !important;
  border-color: transparent !important;
  background: transparent !important;
  box-shadow: none !important;
}

body:not(.dark-mode) .site-nav-fixed .site-nav-icon-plain,
body:not(.dark-mode) .site-nav-fixed .site-nav-icon-plain:hover,
body:not(.dark-mode) .site-nav-fixed .site-nav-icon-plain:active {
  color: #4b5563 !important;
  border-color: transparent !important;
  background: transparent !important;
  box-shadow: none !important;
}

body.dark-mode .site-nav-fixed .site-nav-icon-plain .site-nav-icon {
  color: #f8fafc !important;
}

body:not(.dark-mode) .site-nav-fixed .site-nav-icon-plain .site-nav-icon {
  color: #374151 !important;
}

body.dark-mode .site-nav-fixed .site-nav-icon-plain .site-nav-icon-img,
body.dark-mode .site-nav-fixed .site-nav-icon-plain .site-nav-icon-emoji {
  filter: grayscale(1) brightness(0) invert(1) opacity(0.9) !important;
}

/* 顶部导航右侧搜索框：根据深浅模式反色显示 */
.site-nav-fixed .site-nav-search {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.site-nav-fixed .site-nav-search input[type="search"] {
  border-radius: 999px;
  padding: 0.1rem 1.6rem 0.1rem 0.5rem; /* 右侧多留出空间给 emoji */
  border: 1px solid transparent;
}

.site-nav-fixed .site-nav-search-emoji {
  position: absolute;
  right: 0.55rem;
  font-size: 1.50rem;
  pointer-events: none;
}

body.dark-mode .site-nav-fixed .site-nav-search-emoji {
  color: #111827; /* 深色模式：符号为深色，配白底 */
}

body:not(.dark-mode) .site-nav-fixed .site-nav-search-emoji {
  color: #f9fafb; /* 浅色模式：符号为浅色，配深底 */
}

body.dark-mode .site-nav-fixed .site-nav-search input[type="search"] {
  background-color: #ffffff;
  color: #111827;
  border-color: rgba(148, 163, 184, 0.8);
}

body:not(.dark-mode) .site-nav-fixed .site-nav-search input[type="search"] {
  background-color: #31343a;
  color: #f9fafb;
  border-color: rgba(0, 0, 0, 0.85);
}

body:not(.dark-mode) .site-nav-fixed a:hover {
  color: #000000;
}

/* 文章页右侧目录（TOC）悬浮卡片 */
.post-toc {
  position: fixed;
  bottom: 0.0rem;
  right: 1.5rem;
  width: 260px;
  font-size: 0.9rem;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  border: 1px solid rgba(148, 163, 184, 0.6);
  border-radius: 6px;
  z-index: 900;
}

.post-toc-header {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: -0.5rem -0.5rem 0.5rem;
  padding: 0.35rem 0.6rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.5);
  background: #f9fafb;
}

.post-toc-toggle {
  flex: 0 0 auto;
  margin-right: auto;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 2px solid #eab308; /* amber-500 */
  background: #facc15;       /* amber-400 */
  cursor: pointer;
  box-shadow: 0 0 6px rgba(0,0,0,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.post-toc-toggle::before {
  content: "-";
  font-size: 1.1rem;
  line-height: 1;
  color: rgba(0,0,0,0.45);
  transform: translateY(-1px);
}

.post-toc-header-title {
  flex: 0 1 auto;
  font-size: 0.8rem;
  color: #9ca3af; /* gray-400 */
}

.post-toc-mini {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  padding: 0.25rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(225, 226, 228, 0.9);
  background: #2b2d2f; /* gray-700 */
  color: #ffffff;
  font-size: 0.85rem;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0,0,0,0.16);
  display: none; /* 默认隐藏，最小化后显示 */
}

.post-toc-inner {
  max-height: 45vh;
  overflow-y: auto;
}

.post-toc-inner nav > ul {
  margin: 0;
  padding-left: 1rem;
}

.post-toc-inner ul {
  list-style: none;
  padding-left: 0.8rem;
}

.post-toc-inner a {
  display: block;
  border-left: 3px solid transparent;
  padding: 0.08rem 0.2rem 0.08rem 0.45rem;
  border-radius: 0 6px 6px 0;
  transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
  text-decoration: none;
}

.post-toc-inner a:hover {
  text-decoration: underline;
}

.post-toc-inner a.post-toc-active {
  color: #07955c;
  background: rgba(16, 185, 129, 0.2);
  font-weight: 700;
  border-left-color: #10b981;
}

/* 目录层级样式：h1 / h2 / h3 区分 */
.post-toc-inner #TableOfContents > ul > li > a {
  font-size: 0.95rem;   /* 一级标题稍大 */
  font-weight: 600;
}

.post-toc-inner #TableOfContents > ul > li > ul > li > a {
  font-size: 0.9rem;    /* 二级标题中等 */
  font-weight: 500;
}

.post-toc-inner #TableOfContents ul ul ul > li > a {
  font-size: 0.85rem;   /* 三级标题更小 */
  font-weight: 400;
}

@media (max-width: 960px) {
  .post-toc {
    display: none;
  }
  .post-toc-mini {
    display: none !important;
  }
}

/* 左下角 Liquid Glass 任务坞 */
.liquid-dock {
  position: fixed;
  left: 1.5rem;
  bottom: 1.5rem;
  z-index: 950;
}

.liquid-dock-main,
.liquid-dock-item {
  width: 52px;
  height: 52px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.55);
  background: radial-gradient(circle at 30% 20%, rgba(255,255,255,0.58), rgba(71,85,105,0.22));
  background-color: rgba(10, 16, 30, 0.74);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  box-shadow: 0 16px 38px rgba(2, 6, 23, 0.62);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  color: #e5e7eb;
}

.liquid-dock-item {
  position: relative;
  overflow: visible;
}

.liquid-dock-main {
  position: relative;
  overflow: visible;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.liquid-dock-main-dot {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 20%, #f8fafc, #cbd5e1);
  box-shadow: 0 0 5px rgba(255,255,255,0.35);
  opacity: 0.85;
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}

.liquid-dock-main::after {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255,255,255,0.9) 0%, rgba(191,219,254,0.45) 38%, rgba(191,219,254,0) 74%);
  opacity: 0;
  transform: scale(0.65);
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.liquid-dock-main:hover,
.liquid-dock-main:focus-visible {
  transform: translateY(-1px) scale(1.06);
  box-shadow: 0 20px 44px rgba(2, 6, 23, 0.74);
}

.liquid-dock-main:active {
  transform: translateY(0) scale(1.1);
}

.liquid-dock-main:hover .liquid-dock-main-dot,
.liquid-dock-main:focus-visible .liquid-dock-main-dot,
.liquid-dock-main:active .liquid-dock-main-dot {
  transform: scale(1.34);
  filter: brightness(1.38);
  opacity: 1;
  box-shadow: 0 0 14px rgba(255,255,255,0.96), 0 0 30px rgba(191, 219, 254, 0.85), 0 0 52px rgba(191, 219, 254, 0.62);
}

.liquid-dock-main:hover::after,
.liquid-dock-main:focus-visible::after,
.liquid-dock-main:active::after,
.liquid-dock.dock-open .liquid-dock-main::after {
  opacity: 1;
  transform: scale(1.2);
}

.liquid-dock.dock-open .liquid-dock-main-dot {
  transform: scale(1.22);
  filter: brightness(1.28);
  opacity: 1;
  box-shadow: 0 0 12px rgba(255,255,255,0.9), 0 0 24px rgba(191, 219, 254, 0.72);
}

.liquid-dock-menu {
  position: absolute;
  left: 4px;
  bottom: 64px;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  pointer-events: none;
}

.liquid-dock-item {
  opacity: 0;
  transform: translateY(14px) scale(0.9);
  pointer-events: none;
  transition: opacity 0.22s ease-out, transform 0.22s ease-out;
}

/* Ensure anchor-based dock items (like the 🫧 link) have no underline but keep their circular border */
.liquid-dock a.liquid-dock-item,
.liquid-dock a.liquid-dock-item:hover,
.liquid-dock a.liquid-dock-item:focus {
  text-decoration: none !important;
  border-bottom: none !important;
}

.liquid-dock.dock-open .liquid-dock-item {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.liquid-dock-icon {
  font-size: 1.1rem;
}

.liquid-dock-icon-text {
  font-size: 0.7rem;
}

.liquid-dock-tooltip {
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  background: #ffffff;
  color: #111111;
  border: 1px solid rgba(0, 0, 0, 0.28);
  border-radius: 8px;
  padding: 0.32rem 0.56rem;
  font-size: 0.74rem;
  line-height: 1.2;
  white-space: nowrap;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.28);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0s linear 0.16s;
  z-index: 9999;
}

.liquid-dock-tooltip::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 50%;
  width: 10px;
  height: 10px;
  transform: translateY(-50%) rotate(45deg);
  background: #ffffff;
  border-left: 1px solid rgba(0, 0, 0, 0.28);
  border-bottom: 1px solid rgba(0, 0, 0, 0.28);
}

.liquid-dock-item:hover .liquid-dock-tooltip,
.liquid-dock-item:focus-visible .liquid-dock-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) translateX(2px);
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0s;
}

.liquid-dock-item:hover {
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.7);
}

.liquid-dock-item:active {
  transform: translateY(0) scale(1.05);
}

@media (max-width: 640px) {
  .liquid-dock {
    left: 1rem;
    bottom: 1rem;
  }

  .liquid-dock-main,
  .liquid-dock-item {
    width: 46px;
    height: 46px;
  }
}

/* 简单深色模式：通过 body.dark-mode 切换 */
body.dark-mode {
  background-color: #020617;
  color: #e5e7eb;
}

body.dark-mode a {
  color: #38bdf8;
}

/* 暗色模式下：顶部搜索条和首页卡片背景调整 */
body.dark-mode .bg-near-white,
body.dark-mode .bg-white {
  background-color: #020617 !important;
}

body.dark-mode .b--black-10 {
  border-color: rgba(148, 163, 184, 0.4) !important;
}

body.dark-mode .home-post-card {
  background: rgba(15, 23, 42, 0.34);
  border-color: rgba(148, 163, 184, 0.22);
  box-shadow:
    inset 0 1px 0 rgba(203, 213, 225, 0.12),
    0 10px 24px rgba(2, 6, 23, 0.42);
}

body.dark-mode .home-post-card:hover {
  background: rgba(15, 23, 42, 0.4);
  border-color: rgba(148, 163, 184, 0.3);
}

body.dark-mode .home-life-grid {
  background: transparent;
  box-shadow: none;
}

body.dark-mode .home-life-grid::before {
  content: none;
}

body.dark-mode .home-post-card .dark-gray,
body.dark-mode .home-post-card .link.dark-gray {
  color: #e5e7eb;
}

body.dark-mode .home-post-card .gray,
body.dark-mode .home-post-card .mid-gray {
  color: #9ca3af;
}

body.dark-mode .home-post-download-btn {
  border-color: rgba(148, 163, 184, 0.6);
  background: rgba(15, 23, 42, 0.85);
  color: #e5e7eb;
}

body.dark-mode .home-post-download-btn:hover {
  background: rgba(15, 23, 42, 1);
  border-color: rgba(148, 163, 184, 0.9);
}

body.dark-mode .home-post-qr-inline {
  background: rgba(15, 23, 42, 0.96);
  border-color: rgba(148, 163, 184, 0.5);
}

body.dark-mode .home-post-qr-image {
  background: #f8fafc;
}

body.dark-mode .home-post-qr-loading {
  color: #94a3b8;
}

body.dark-mode .home-post-qr-meta {
  color: #94a3b8;
}

/* 暗色模式下：顶部搜索框与按钮 */
body.dark-mode input[type="search"] {
  background-color: #020617;
  color: #e5e7eb;
  border-color: rgba(148, 163, 184, 0.7);
}

body.dark-mode input[type="search"]::placeholder {
  color: #6b7280;
}

body.dark-mode .bg-black-80 {
  background-color: #111827 !important;
}

/* 暗色模式下：单篇 blog 正文区域 */
body.dark-mode .nested-copy-line-height {
  color: #e5e7eb;
}

body.dark-mode .nested-copy-line-height h1,
body.dark-mode .nested-copy-line-height h2,
body.dark-mode .nested-copy-line-height h3,
body.dark-mode .nested-copy-line-height h4,
body.dark-mode .nested-copy-line-height h5,
body.dark-mode .nested-copy-line-height h6 {
  color: #f9fafb;
}

body.dark-mode .nested-copy-line-height code,
body.dark-mode .nested-copy-line-height pre {
  background-color: #020617;
  color: #e5e7eb;
}

/* 暗色模式下：「历史上的今天」短代码块 */
body.dark-mode .history-today {
  background-color: rgba(15, 23, 42, 0.9);
  border-radius: 0.5rem;
  padding: 1.25rem 1.5rem;
}

body.dark-mode .history-today h2 {
  color: #f9fafb;
}

body.dark-mode .history-today-list li {
  color: #e5e7eb;
}

body.dark-mode .history-today p[style] {
  color: #9ca3af !important;
}

/* Disqus 区域在亮/暗模式下的文字颜色（本地占位提示 + 外层容器） */
body.dark-mode #disqus_thread {
  color: #e5e7eb;
}

body:not(.dark-mode) #disqus_thread {
  color: #111827;
}
