/* 正文图片完整显示：禁用 object-fit 裁剪，保留原始比例 */
.post-content img,
.page-content img,
.markdown-body img {
  object-fit: contain !important;
  max-width: 100% !important;
  height: auto !important;
}

/* 全站标题统一品牌绿（与导航栏/文章标题一致） */
.index-header,
.index-header .index-pin,
.link-title,
.category .category-item,
.category .category-subitem,
.archive-title,
.tagcloud-title {
  color: var(--post-heading-color) !important;
}

/* 归档/分类/标签页标题 */
.archive-title a,
.category-title,
.tag-title {
  color: var(--post-heading-color) !important;
}

/* 文章正文标题兜底：确保覆盖 github-markdown-css 的继承色 */
.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6,
#seo-header {
  color: var(--post-heading-color) !important;
}

/* ===== 首页顶部大分类模块（光谱色带） ===== */
.spectrum-home {
  /* 保留原 Banner 壁纸，不覆盖背景 */
  height: 100vh !important;
  height: 100dvh !important;
  min-height: 560px;
}

/* 解除 fluid 对 header 的 max-height:100vw 限制（移动端会压扁 Banner 导致
   文章列表叠到 Banner 上），仅首页生效 */
.header-inner:has(#banner.spectrum-home) {
  max-height: none !important;
}

.spectrum-mod {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 33.33%;
  max-width: 460px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 1.4rem 1.4rem 1.8rem;
  color: #f4f1ea;
}

.spectrum-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.spectrum-cat {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0.45rem 0.7rem;
  border-radius: 10px;
  /* 玻璃磨砂：半透明白 + 背景模糊 + 细亮边 */
  background: rgba(255, 255, 255, 0.08);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  backdrop-filter: blur(14px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.14);
  color: #f4f1ea;
  text-decoration: none;
  overflow: hidden;
  text-align: center;
  transition: transform 0.22s var(--ease-out, cubic-bezier(0.16, 1, 0.3, 1)),
    box-shadow 0.22s ease, background-color 0.22s ease;
}

.spectrum-cat:hover,
.spectrum-cat:focus-visible {
  transform: translateY(-3px);
  text-decoration: none;
  color: #fff;
  background: rgba(255, 255, 255, 0.13);
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.22);
  outline: none;
}

/* 壁纸上的文字可读性兜底 */
.spectrum-cat-name {
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
}

/* 顶部加载进度条：绿色 → 彩虹渐变 */
#nprogress .bar {
  background: linear-gradient(90deg, #e53935, #f76d1c, #fbc02d, #43a047, #1e88e5, #8e24aa) !important;
}

#nprogress .peg {
  box-shadow: 0 0 10px rgba(142, 36, 170, 0.6), 0 0 5px rgba(142, 36, 170, 0.45) !important;
}

/* 顶部导航栏滚动后：暗色系彩虹渐变（透明 + 毛玻璃，保证白字可读） */
.navbar.top-nav-collapse {
  background: linear-gradient(
    90deg,
    rgba(198, 40, 40, 0.35),
    rgba(230, 81, 0, 0.35),
    rgba(249, 168, 37, 0.35),
    rgba(46, 125, 50, 0.35),
    rgba(21, 101, 192, 0.35),
    rgba(106, 27, 154, 0.35)
  ) !important;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.navbar.top-nav-collapse .navbar-brand,
.navbar.top-nav-collapse .nav-link {
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.55);
}

.spectrum-cat-bar {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  height: auto;
}

.spectrum-cat-name {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

/* 光谱色带：红 → 橙 → 琥珀 → 绿 → 青 → 蓝 → 靛 → 紫 → 品红 */
.c-red .spectrum-cat-bar { background: #d9534f; }
.c-orange .spectrum-cat-bar { background: #e08a3c; }
.c-amber .spectrum-cat-bar { background: #d9b13b; }
.c-green .spectrum-cat-bar { background: #57a05a; }
.c-teal .spectrum-cat-bar { background: #3aa6a0; }
.c-blue .spectrum-cat-bar { background: #4a7fb5; }
.c-indigo .spectrum-cat-bar { background: #5a6db8; }
.c-violet .spectrum-cat-bar { background: #8a63b8; }
.c-magenta .spectrum-cat-bar { background: #b85d8f; }

.c-red:hover .spectrum-cat-bar { background: #e86662; }
.c-orange:hover .spectrum-cat-bar { background: #ef9d50; }
.c-amber:hover .spectrum-cat-bar { background: #e6c04d; }
.c-green:hover .spectrum-cat-bar { background: #66b269; }
.c-teal:hover .spectrum-cat-bar { background: #49b5af; }
.c-blue:hover .spectrum-cat-bar { background: #5b91cb; }
.c-indigo:hover .spectrum-cat-bar { background: #6b7ec8; }
.c-violet:hover .spectrum-cat-bar { background: #9b75c9; }
.c-magenta:hover .spectrum-cat-bar { background: #c96fa0; }

@media (max-width: 767px) {
  .spectrum-home {
    height: 100vh !important;
    height: 100dvh !important;
    min-height: 560px;
  }
  .spectrum-mod {
    position: static;
    width: auto;
    max-width: none;
    padding: 0.9rem 0.9rem 1.4rem;
  }
  .spectrum-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
  }
  .spectrum-cat {
    min-height: 64px;
  }
  .spectrum-cat-name {
    font-size: 0.9rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .spectrum-cat {
    transition: none;
  }
  .spectrum-cat:hover,
  .spectrum-cat:focus-visible {
    transform: none;
  }
}
