/* ---------- 国色变量（案卷 013 · 礼部） ---------- */
:root {
  --xuanchang: #1E2330;   /* 玄常 · 卡片底 */
  --gold: #D4AF37;        /* 金章 · 框/角/官职名 */
  --shuqing: #E8633E;     /* 曙庆 · 底端细线 */
  --xuanhui: #9AA0B5;     /* 玄灰 · 职司 */
  --xuanzhi: #EDE8DC;     /* 宣纸白 · 姓名 */
  --cards-per-row: 6;     /* 人物卡片每行张数（后台 cards_per_row 内联覆盖） */
  --serif: "Shanhai Jiangnan", "STXingkai", "Xingkai SC", "KaiTi", "Kaiti SC", serif;  /* 全局字体统一山海江南 */
  --sans: "Shanhai Jiangnan", "STXingkai", "Xingkai SC", "KaiTi", "Kaiti SC", serif;
}
/* ============================================================
   主站增强层（2026-08-15 主站版 · 去掉 1 字体 / 8 加粗）
   按火火钦定清单实施：2 面包屑、3 目录、4 题字诗词导语三开关、
   5 自定义栏目、6 人物卡片、7 阅读量、9 回到顶部按钮。
   （未点名的暗色模式 / 菜单居中 / 背景图增强等一律不带入）
   ============================================================ */

/* ---------- 2. 面包屑 ---------- */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  margin: 0 0 1.2rem;
  color: var(--muted);
  font-size: 0.85rem;
}
.breadcrumb a {
  color: var(--muted);
  transition: color 0.18s;
}
.breadcrumb a:hover {
  color: var(--accent);
}
.breadcrumb .breadcrumb-current {
  color: var(--ink);
}
.breadcrumb-sep {
  opacity: 0.55;
}

/* ---------- 3. 文章目录（卷目） ---------- */
.article-toc {
  margin: 1.4rem 0 2rem;
  padding: 1rem 1.2rem;
  border: 1px solid var(--faint);
  border-radius: 8px;
  background: var(--paper-soft);
}
.article-toc-title {
  margin: 0 0 0.6rem;
  font-family: var(--serif);
  color: var(--accent);
  font-size: 0.95rem;
  letter-spacing: 0.12em;
}
.article-toc-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.article-toc-list a {
  color: var(--muted);
}
.article-toc-list a:hover {
  color: var(--accent);
}
.toc-item-h3 {
  padding-left: 1.1rem;
  font-size: 0.92em;
}

/* ---------- 4. 首页题字 / 诗词 / 导语（火火谕：金章题字诗词 + 3:2:1 字号 + 左对齐栏目） ---------- */
/* 题字如匾、诗词如刻本、导语如落款，三层由重到轻（题字3/诗词2/导语1）；
   题字诗词用金章，导语低调小字；hero 整体左移与栏目区（office-grid）左缘对齐 */
.home-hero {
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  text-align: left;
  padding-left: clamp(1.5rem, 6vw, 5rem);       /* 取消左移：恢复栏目对齐的合理内边距（火火谕，位置以现状为准） */
  padding-top: clamp(3rem, 12vh, 7rem);
  padding-bottom: clamp(1rem, 3vh, 2rem);
}
.hero-title {
  align-self: flex-start;
  margin-bottom: 2.8rem;
  font-size: clamp(3.5rem, 6.5vw, 13rem);  /* 题字 3 档 · 调大 */
}
/* 题字主题色：跟随主题 --accent（覆盖原生 .hero-mark em，含 text-shadow） */
.hero-title .hero-mark em {
  color: var(--accent);
  text-shadow: 0.035em 0.035em 0 rgba(211, 63, 79, 0.18);
}
.hero-poem {
  color: var(--accent);                     /* 诗词主题色 · 2 档 */
  text-align: left;
  white-space: pre-line;
  font-family: Shanhai Jiangnan, STXingkai, Xingkai SC, KaiTi, Kaiti SC, serif;
  font-size: clamp(0.3rem, 2.4vw, 1.2rem);  /* 诗词调大 */
  font-weight: 400;
  line-height: 2.0;
  letter-spacing: 0.08em;
  margin: 0 0 2rem;
}
.hero-poem em {
  font-style: normal;
}
/* 导语：低调小字 · 1 档，勿喧宾夺主 */
.hero-summary {
  position: static;
  margin-top: 0;
  text-align: left;
  max-width: 30rem;
  color: var(--ink-soft);                    /* 低调：墨柔原色 */
  font-size: clamp(0.8rem, 1vw, 1rem);    /* 导语调小 */
  line-height: 1.9;
  white-space: pre-line;                    /* 保留换行，空格可自行折行，不做行数限制 */
  -webkit-line-clamp: unset;                /* 保险：清除任何行数钳制 */
  overflow: visible;                        /* 保险：不裁剪 */
  display: block;                           /* 保险：块级正常显示 */
}

/* ---------- 4b. 首页背景图截断虚化（火火旨：背景图只到栏目区上方，底部透明虚化） ---------- */
/* 背景图从 main 移到 ::before 伪元素，用 mask-image 在 hero 底部渐隐到透明，
   不再穿透到栏目区；内容（.container）自然绘制在负 z-index 伪元素之上 */
.site-main-home {
  z-index: 0;
  background-image: none;
}
.site-main-home::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: clamp(520px, 55vw, 700px);
  background-image: var(--home-background-image, url(/themes/theme-halo-gui/assets/background-DJUFOhyE.png));
  background-position: top center;
  background-size: max(1160px, 100vw) auto;
  background-repeat: no-repeat;
  background-blend-mode: multiply;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 90%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0%, #000 90%, transparent 100%);
  pointer-events: none;
  z-index: -1;
}
@media (max-width: 720px) {
  .site-main-home::before {
    height: 510px;
    background-size: auto 510px;
    background-position: 58% 0;
  }
}

/* ---------- 5. 首页自定义栏目 ---------- */
.home-section {
  margin-top: clamp(2.4rem, 5vw, 3.6rem);
}
.home-section .section-kicker {
  margin-bottom: 1rem;
}
.section-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem 1.4rem;
}
.section-link {
  display: flex;
  gap: 0.8rem;
  align-items: baseline;
  color: var(--ink-soft);
  transition: color 0.18s;
}
.section-link:hover {
  color: var(--accent);
}
.section-link .section-date {
  color: var(--muted);
  font-size: 0.82rem;
  white-space: nowrap;
  font-family: var(--mono);
}
.section-link .section-title {
  font-family: var(--serif);
}
.section-cats,
.section-tags {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.6rem;
}
.section-cats a {
  color: var(--muted);
  border: 1px solid var(--faint);
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.82rem;
  transition:
    color 0.18s,
    border-color 0.18s;
}
.section-cats a:hover {
  color: var(--accent);
  border-color: var(--accent);
}
.section-tags a {
  color: var(--muted);
  font-size: 0.85rem;
}
.section-tags a:hover {
  color: var(--accent);
}

/* ---------- 6. 人物卡片（栏目）· 原生简约款 ----------
   恢复最初主题原生风格：纸色浅底 + 细边框 + 圆角 10px + hover 边框变色微升
   11 位 + 第 12 格「全览列传」入口卡 */
.office-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(var(--cards-per-row), minmax(0, 1fr));
  gap: 0.8rem;
  align-items: stretch;
}
.office-card {
  display: flex;
  min-width: 0;
}
.office-card a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.3rem;
  flex: 1;
  min-height: 4.25rem;
  padding: 0.5rem 0.5rem;
  border: 1px solid var(--faint);
  border-radius: 10px;
  background: var(--paper-soft);
  transition: border-color 0.18s, transform 0.18s;
}
.office-card a:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}
.office-card .office-up {
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  white-space: nowrap;
}
.office-card .office-down {
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.05rem;
  white-space: nowrap;
}
.office-card.office-entry a {
  text-align: center;
}

/* 响应式：6 → 3 → 2 → 1 列（窄屏自动降列，保证可读） */
@media (max-width: 1024px) {
  .office-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
  .office-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
  .office-grid { grid-template-columns: repeat(1, minmax(0, 1fr)); gap: 0.7rem; }
}

/* ---------- 7. 阅读量 N 人已阅 ---------- */
.post-meta-views,
.article-meta-item {
  color: var(--muted);
}

/* ---------- 9. 回到顶部按钮 ---------- */
.back-to-top {
  position: fixed;
  right: 1.4rem;
  bottom: 1.4rem;
  z-index: 99;
  width: 2.6rem;
  height: 2.6rem;
  border: 1px solid var(--faint);
  border-radius: 50%;
  background: var(--paper-soft);
  color: var(--accent);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  box-shadow: 0 6px 18px rgb(0 0 0 / 0.08);
  transition:
    opacity 0.2s,
    transform 0.2s,
    visibility 0.2s,
    border-color 0.18s,
    background-color 0.18s,
    color 0.18s;
}
.back-to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.back-to-top:hover {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--paper-soft);
}

/* ---------- 10. 菜单下拉（无限层级） ---------- */
.site-nav li {
  position: relative;
}

/* 有子项的菜单项：右侧留箭头位 */
.site-nav li.has-children > a {
  padding-right: 1rem;
}
.site-nav li.has-children > a::before {
  content: "\25BE";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.6em;
  line-height: 1;
  color: var(--muted);
  opacity: 0.7;
}
.site-nav .submenu li.has-children > a::before {
  content: "\25B8";
}

/* 子菜单浮层 */
.site-nav .submenu {
  position: absolute;
  top: calc(100% + 0.4rem);
  left: 0;
  display: block; /* 覆盖 .site-nav ul 的 flex，子项纵向排列 */
  margin: 0;
  padding: 0.4rem 0;
  list-style: none;
  background-color: var(--paper);
  background-image: repeating-linear-gradient(0deg, #322e2804 0 1px, #0000 1px 4px);
  border: 1px solid var(--faint);
  border-radius: 6px;
  box-shadow: 0 12px 30px rgb(0 0 0 / 0.12);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity .18s ease, transform .18s ease, visibility .18s;
  pointer-events: none;
  z-index: 40;
}
.site-nav li:hover > .submenu,
.site-nav li.open > .submenu,
.site-nav .submenu:hover,
.site-nav li:focus-within > .submenu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}
.site-nav .submenu li {
  display: block;
}
/* 子菜单项之间的横杠分割（参考文章列表渐变细线） */
.site-nav .submenu li + li::before {
  content: "";
  display: block;
  height: 1px;
  margin: 0 1rem;
  background: linear-gradient(90deg, #0000, #35312b2e 16% 84%, #0000);
}
.site-nav .submenu a {
  display: block;
  padding: 0.5rem 1.1rem;
  white-space: nowrap;
  font-size: 0.88rem;
  letter-spacing: 0.06em;
  line-height: 1.5;
  color: var(--ink-soft);
}
.site-nav .submenu a::after {
  display: none;
}
.site-nav .submenu a:hover {
  color: var(--accent);
}

/* 二级及更深子菜单：向右侧展开 */
.site-nav .submenu .submenu {
  top: -0.4rem;
  left: 100%;
  margin: 0;
}

/* 移动端：点击展开（zhao-theme.js 切换 .open） */
@media (max-width: 720px) {
  .site-nav li.open > .submenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
  }
}

/* ============================================================
   案卷014 视觉三形制（2026-08-15 礼部形制 · 太史令施行）
   一、函套门面（典制栏） 二、一句提要（列表页） 三、年表区分
   ============================================================ */

/* ---------- 一、函套门面·典制栏 ---------- */
.hansetao {
  background: #1E2330;                 /* 玄常底 */
  border: 2px solid #D4AF37;           /* 金章框 */
  border-radius: 4px;
  padding: 32px 24px 28px;
  margin-bottom: 40px;
  position: relative;
  text-align: center;
}

/* 四角 L 形装饰 */
.hansetao::before,
.hansetao::after {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  border-color: #D4AF37;
  border-style: solid;
}
.hansetao::before {
  top: 6px; left: 6px;
  border-width: 2px 0 0 2px;
}
.hansetao::after {
  top: 6px; right: 6px;
  border-width: 2px 2px 0 0;
}

/* 底部两角 */
.hansetao-corners {
  position: absolute;
  inset: 6px;
  pointer-events: none;
  border-top: none;
  border-left: none;
  border-right: none;
  border-bottom: 2px solid #D4AF37;
  width: auto;
  height: auto;
}
.hansetao-corners::before,
.hansetao-corners::after {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  border-color: #D4AF37;
  border-style: solid;
}
.hansetao-corners::before {
  bottom: 0; left: 0;
  border-width: 0 0 2px 2px;
}
.hansetao-corners::after {
  bottom: 0; right: 0;
  border-width: 0 2px 2px 0;
}

/* 签条网格 */
.hansetao-labels {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.hansetao-label {
  width: 140px;
  height: 64px;
  background: #EDE8DC;                /* 宣纸白 */
  border: 1px solid #D4AF37;           /* 金章描边 */
  border-radius: 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: box-shadow 220ms ease, transform 220ms ease;
}

.hansetao-label:hover {
  box-shadow: 0 2px 8px rgba(212, 175, 55, 0.25);
  transform: translateY(-2px);
}

.hansetao-label-name {
  font-family: var(--serif);
  font-size: 1.1rem;
  color: #D4AF37;                     /* 金章 */
  letter-spacing: 0.12em;
}

.hansetao-label-count {
  font-size: 0.75rem;
  color: #9AA0B5;                     /* 玄灰 */
  letter-spacing: 0.06em;
}

/* 函套底部渐变分隔线 */
.hansetao-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, #D4AF3766 16% 84%, transparent);
  margin: 0;
}

/* 响应式：<768px 2×2 网格 */
@media (max-width: 767px) {
  .hansetao {
    padding: 20px 16px 18px;
    margin-bottom: 28px;
  }
  .hansetao-labels {
    gap: 12px;
  }
  .hansetao-label {
    width: calc(50% - 6px);
  }
}

/* ---------- 二、一句提要·仿四库总目 ---------- */
.post-summary {
  max-width: none;                     /* 20260816g：摘要去限宽，占满正文列 */
  margin: 0 0 0.65rem;
  padding: 0;
  color: #D4AF37;                     /* 金章 */
  opacity: 0.85;
  font-family: var(--serif);
  font-size: 0.88rem;
  line-height: 1.6;
  letter-spacing: 0.06em;
}

.post-summary::before {
  content: "◈";
  font-size: 0.6rem;
  margin-right: 0.4em;
  vertical-align: middle;
  opacity: 0.7;
}

/* ---------- 三、年表·可点/待刊视觉区分 ---------- */
.timeline-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
}

.timeline-dot {
  flex-shrink: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  transition: transform 220ms ease, box-shadow 220ms ease;
}

/* 可点·金章实心 */
.timeline-dot--published {
  background: #D4AF37;
  border: none;
}
.timeline-item--published:hover .timeline-dot--published {
  transform: scale(1.2);
  box-shadow: 0 0 6px rgba(212, 175, 55, 0.4);
}

/* 待刊·玄灰空心 */
.timeline-dot--draft {
  background: transparent;
  border: 1.5px solid #9AA0B5;
}

.timeline-item--published .timeline-text {
  color: var(--ink, #1E2330);
}
.timeline-item--published .timeline-text:hover {
  color: var(--accent-dark, #b94f32);
}
.timeline-item--draft .timeline-text {
  color: #9AA0B5;
  cursor: default;
}
.timeline-item--draft .timeline-text:hover {
  color: #9AA0B5;
}


/* ---------- 10b. 菜单七栏平铺视觉（钦定 2026-08-15） ----------
   金章下划线从中心展开 + active 曙庆字 + 移动端折叠 */
.site-nav a::after {
  background: var(--accent);
  height: 2px;
  transition: left 0.25s ease, right 0.25s ease;
}
.site-nav a:hover::after,
.site-nav a:focus-visible::after {
  left: 20%;
  right: 20%;
}
.site-nav a.active,
.site-nav a[aria-current="page"] {
  color: var(--accent);
  font-weight: 500;
}
.site-nav a.active::after,
.site-nav a[aria-current="page"]::after {
  left: 20%;
  right: 20%;
  background: var(--accent);
}
/* ---------- 10c. 菜单移动端（<768px）汉堡折叠 + 手风琴子菜单（2026-08-17 火火钦定方案甲） ---------- */
/* 汉堡按钮（zhao-theme.js 注入）：桌面隐藏，移动端显示 */
.nav-toggle {
  display: none;
}

@media (max-width: 768px) {
  /* 常驻 header 压至一行（logo + 汉堡 ≈48–56px）；不 sticky 遮正文；玄常底 + 金章描边 */
  .site-header {
    position: static;
    background: var(--paper);              /* 主题纸底 */
    border-bottom: 1px solid var(--faint); /* 主题细线 */
    padding-top: 6px;
    padding-bottom: 6px;
  }
  .site-header .container {
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
  }
  .site-title {
    color: var(--ink);                  /* 主题墨色 */
  }

  /* 汉堡按钮：玄常底 + 金章描边 + 金章三线 */
  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    background: var(--paper);             /* 主题纸底 */
    border: 1px solid var(--accent);       /* 主题主色描边 */
    border-radius: 4px;
    cursor: pointer;
  }
  .nav-toggle-bar {
    position: relative;
    width: 18px;
    height: 2px;
    background: var(--accent);             /* 主题主色线 */
    border-radius: 1px;
    transition: background 0.2s ease;
  }
  .nav-toggle-bar::before,
  .nav-toggle-bar::after {
    content: "";
    position: absolute;
    left: 0;
    width: 18px;
    height: 2px;
    background: var(--accent);
    border-radius: 1px;
    transition: transform 0.22s ease, top 0.22s ease;
  }
  .nav-toggle-bar::before { top: -6px; }
  .nav-toggle-bar::after  { top: 6px; }
  /* 展开态：三线变 X */
  .site-header.nav-open .nav-toggle-bar {
    background: transparent;
  }
  .site-header.nav-open .nav-toggle-bar::before {
    top: 0;
    transform: rotate(45deg);
  }
  .site-header.nav-open .nav-toggle-bar::after {
    top: 0;
    transform: rotate(-45deg);
  }

  /* 导航默认收起（JS 就绪 html.nav-ready 后才折叠，无 JS 时菜单正常显示兜底） */
  .nav-ready .site-nav {
    display: none;
  }
  .nav-ready .site-header.nav-open .site-nav {
    display: block;
    width: 100%;
    order: 3;
    animation: navFadeIn 0.2s ease;
  }
  @keyframes navFadeIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  /* 展开时：菜单纵向排列、全宽 */
  .nav-ready .site-header.nav-open .site-nav ul {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    overflow-x: visible;
    padding-bottom: 0;
    margin-top: 4px;
  }
  .nav-ready .site-header.nav-open .site-nav > ul > li {
    width: 100%;
    text-align: left;
  }
  .nav-ready .site-header.nav-open .site-nav > ul > li > a {
    width: 100%;
    text-align: left;
    padding: 12px 6px;
    color: var(--ink);                  /* 主题墨色 */
    border-bottom: 1px solid var(--faint); /* 主题细线 */
  }
  .nav-ready .site-header.nav-open .site-nav > ul > li.has-children > a {
    padding-right: 24px;             /* 给箭头留位 */
  }
  .nav-ready .site-header.nav-open .site-nav a::after {
    display: none;
  }
  .nav-ready .site-header.nav-open .site-nav a.active,
  .nav-ready .site-header.nav-open .site-nav a[aria-current="page"] {
    color: var(--accent);                  /* 主题主色 · 激活项 */
  }
  .nav-ready .site-header.nav-open .site-nav > ul > li:last-child > a {
    border-bottom: none;
  }

  /* ---- 手风琴子菜单：内联展开推挤、全宽（不做绝对定位浮层） ---- */
  .nav-ready .site-nav .submenu {
    position: static;
    top: auto;
    left: auto;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 0;
    box-shadow: none;
    background: none;
    background-image: none;
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: none;
    pointer-events: auto;
    display: none;                   /* 默认收起 */
  }
  .nav-ready .site-nav li.open > .submenu {
    display: block;                  /* 展开即内联占位推挤 */
  }
  .nav-ready .site-nav .submenu li {
    display: block;
    width: 100%;
  }
  .nav-ready .site-nav .submenu li + li::before {
    display: none;                   /* 移动端去掉横杠分割 */
  }
  .nav-ready .site-nav .submenu a {
    display: block;
    width: 100%;
    padding: 11px 6px 11px 22px;     /* 左缩进表示层级 */
    white-space: normal;
    font-size: 0.88rem;
    color: var(--ink-soft);                  /* 主题墨柔 */
    border-bottom: 1px solid var(--faint);
  }
  .nav-ready .site-nav .submenu a:hover,
  .nav-ready .site-nav .submenu a.active {
    color: var(--accent);                  /* 主题主色 */
  }
  /* 父项展开时箭头翻转（\25BE → 朝上） */
  .nav-ready .site-nav li.has-children.open > a::before {
    transform: translateY(-50%) rotate(180deg);
  }
}

/* ---------- 卷宗页·标签入口（标签降为卷宗页内嵌） ---------- */
.archive-tags {
  margin: 0 0 1.2rem;
  padding: 0.7rem 1rem;
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: 4px;
  background: rgba(30, 35, 48, 0.4);
}
.archive-tags a {
  color: #D4AF37;
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-decoration: none;
}
.archive-tags a:hover {
  color: #EDE8DC;
}

/* 朝堂人物卡片（朝堂页 /chaogang）· 原生简约款
   复用首页 .office-grid 简约卡，去掉 hover 弹出 */
.chaotang-cards {
  margin: 2rem 0 3rem;
}


/* ---------- 12. 写真头像 & 列传插图（20260816a：列传去卡片，写真改普通插图） ---------- */
.office-avatar {
  display: block;
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border: 1px solid var(--faint);
  border-radius: 8px;
  margin-bottom: 0.35rem;
  background: var(--paper);
  transition: border-color 0.18s;
}
.office-card a:hover .office-avatar {
  border-color: var(--accent);
}
.liezhuan-hero {
  margin: 1.8rem auto 2.4rem;
  max-width: 400px;
  text-align: center;
}
.liezhuan-hero img {
  display: block;
  width: 100%;
  height: auto;
}
.liezhuan-hero figcaption {
  margin-top: 0.7rem;
  font-size: 0.88rem;
  letter-spacing: 0.18em;
  color: var(--muted);
}
@media (max-width: 480px) {
  .liezhuan-hero { max-width: 300px; }
}


/* ---------- 13. 列传图录·非卡片式（火火谕：列传去卡片，写真保留非卡片式） ---------- */
.office-grid--portrait .office-card a {
  border: none;
  background: transparent;
  border-radius: 0;
  padding: 0.25rem 0;
  min-height: auto;
  gap: 0.5rem;
  transition: opacity 0.18s;
}
.office-grid--portrait .office-card a:hover {
  border-color: transparent;
  transform: none;
  opacity: 0.88;
}
.office-grid--portrait .office-avatar {
  border: none;
  border-radius: 6px;
  margin-bottom: 0;
}

/* ---------- 14. renwu 列传写真·左图右文（20260816f：flex 布局，图固定不缩放，长介绍不绕图下） ---------- */
.article-content .renwu-entry {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 1.5rem;
  margin: 1.6rem 0;
}
.article-content .renwu-entry .renwu-portrait {
  flex: 0 0 128px;
  width: 128px;
  max-width: 128px;
  height: auto;
  margin: 0;
  padding: 0;
  background: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  display: block;
}
.article-content .renwu-entry .renwu-body {
  flex: 1 1 auto;
  min-width: 0;
}
.article-content .renwu-entry .renwu-body h3 {
  margin-top: 0;
}
.article-content hr {
  clear: both;
}
@media (max-width: 640px) {
  .article-content .renwu-entry {
    flex-direction: column;
    align-items: center;
  }
  .article-content .renwu-entry .renwu-portrait {
    flex: 0 0 auto;
    width: 220px;
    max-width: 220px;
    margin: 0 auto;
  }
}

/* ---------- 15. 文章列表·摘要撑满整行（20260816g：钦谕删右侧特色图位，描述补位） ---------- */
/* 圣谕：文章卡右侧 Featured Image 位彻底删除（HTML 已无封面 figure、post-item-no-cover 两列），
   文章描述（标题+摘要+元信息）占满整行，视觉左右平衡不再偏左 */
.post-excerpt {
  max-width: none;                     /* 摘要去 42rem 限宽，占满正文列 */
}


/* ---------- 16. 评论组件 PluginCommentNext 主题色跟随（20260817 火火钦谕，礼部把关） ---------- */
/* 组件原生暴露 --halo-cw-primary-1/2/3-color 三变量（纯引用，可继承覆盖），默认 Tailwind 蓝；
   覆盖为跟随主题 --accent（后台 primary_color，宣纸站暖调）：
   主色 var(--accent) / hover 深（80% accent+黑）/ 边框聚焦环 中浅（50% accent+白）/ 浅底 极浅（12% accent+白）。
   color-mix 不识别时落静态兜底值（同色系），不致回蓝。 */
comment-next,
comment-widget {
  --halo-cw-primary-1-color: var(--accent);              /* 主色：链接/按钮/活动项/徽章字 */
  --halo-cw-primary-2-color: #e39ba3;                    /* 静态兜底：边框/聚焦环（约 50% accent+白） */
  --halo-cw-primary-3-color: #fae8ea;                    /* 静态兜底：浅底（约 12% accent+白） */
  --comment-next-primary-hover-color: #a9323f !important;/* hover 加深（约 80% accent+黑） */
  --comment-next-link-hover-color: #a9323f !important;
  --comment-next-focus-shadow-color: rgba(211,63,79,.14) !important;  /* 聚焦阴影（原固定蓝） */
  --comment-next-reaction-hover-bg-color: rgba(211,63,79,.12) !important; /* 反应 hover 底（原固定蓝） */
  --comment-next-badge-admin-color: #a9323f !important;   /* 徽章文字深档（与 hover 同值，礼部 20260817 定，浅底可读性达标） */
}
@supports (color: color-mix(in srgb, red 50%, white)) {
  comment-next,
  comment-widget {
    --halo-cw-primary-2-color: color-mix(in srgb, var(--accent) 50%, white);
    --halo-cw-primary-3-color: color-mix(in srgb, var(--accent) 12%, white);
    --comment-next-primary-hover-color: color-mix(in srgb, var(--accent) 80%, black) !important;
    --comment-next-link-hover-color: color-mix(in srgb, var(--accent) 80%, black) !important;
    --comment-next-focus-shadow-color: color-mix(in srgb, var(--accent) 15%, transparent) !important;
    --comment-next-reaction-hover-bg-color: color-mix(in srgb, var(--accent) 12%, transparent) !important;
    --comment-next-badge-admin-color: color-mix(in srgb, var(--accent) 80%, black) !important;
  }
}

/* ---------- 12. 搜索功能（2026-08-17 增：导航搜索入口 + /search 检索页） ----------
   配色一律主题变量（--paper/--paper-soft/--ink/--ink-soft/--muted/--faint/--accent），
   断点遵守 768px 统一约定；桌面内联输入框，移动端随汉堡面板展开 */

/* 12a. 导航搜索入口 */
.site-search {
  margin-left: 0.25rem;
}
.site-search-field {
  position: relative;
  display: flex;
  align-items: center;
}
.site-search-input {
  width: 9.5rem;
  padding: 0.34rem 2.1rem 0.34rem 0.75rem;
  border: 1px solid var(--faint);
  border-radius: 999px;
  background: color-mix(in srgb, var(--paper-soft) 72%, transparent);
  color: var(--ink);
  font-family: inherit;
  font-size: 0.85rem;
  line-height: 1.4;
  outline: none;
  transition: width 0.25s ease, border-color 0.2s ease, background-color 0.2s ease;
}
.site-search-input::placeholder {
  color: var(--muted);
}
.site-search-input:focus {
  width: 13rem;
  border-color: var(--accent);
  background: var(--paper-soft);
}
.site-search-btn {
  position: absolute;
  right: 3px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.55rem;
  height: 1.55rem;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: none;
  color: var(--ink-soft);
  cursor: pointer;
  transition: color 0.18s ease;
}
.site-search-btn:hover {
  color: var(--accent);
}

@media (min-width: 769px) {
  /* 桌面：菜单与搜索框同行 */
  .site-nav {
    display: flex;
    align-items: center;
    gap: clamp(16px, 2.2vw, 30px);
  }
}

@media (max-width: 768px) {
  /* 移动端：搜索框随汉堡面板内联展开、全宽 */
  .site-search {
    width: 100%;
    margin: 0;
    padding: 10px 6px 12px;
  }
  .site-search-field {
    width: 100%;
  }
  .site-search-input,
  .site-search-input:focus {
    width: 100%;
    font-size: 0.95rem;
    padding: 9px 42px 9px 12px;
    border-radius: 6px;
  }
  .site-search-btn {
    width: 34px;
    height: 34px;
    right: 3px;
  }
}

/* 12b. 搜索页 /search */
.search-page {
  max-width: 46rem;
  margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 3rem) 0 3rem;
}
.search-page-title {
  margin: 0 0 1.6rem;
  padding-left: 1rem;
  border-left: 3px solid var(--accent);
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 400;
  letter-spacing: 0.2em;
}
.search-form {
  margin-bottom: 1rem;
}
.search-field {
  position: relative;
  display: flex;
  align-items: center;
}
.search-input {
  width: 100%;
  padding: 0.72rem 3.2rem 0.72rem 1rem;
  border: 1px solid var(--faint);
  border-radius: 8px;
  background: var(--paper-soft);
  color: var(--ink);
  font-family: inherit;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.search-input::placeholder {
  color: var(--muted);
}
.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent);
}
.search-submit {
  position: absolute;
  right: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: none;
  color: var(--ink-soft);
  cursor: pointer;
  transition: color 0.18s ease, background-color 0.18s ease;
}
.search-submit:hover {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}

.search-status {
  min-height: 1.4rem;
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.88rem;
  letter-spacing: 0.04em;
}
.search-status-error {
  color: var(--accent);
}

.search-results {
  margin: 0;
  padding: 0;
  list-style: none;
}
.search-item + .search-item {
  margin-top: 0.9rem;
}
.search-item-link {
  display: block;
  padding: 1rem 1.1rem;
  border: 1px solid var(--faint);
  border-radius: 8px;
  background: var(--paper-soft);
  transition: border-color 0.18s ease, transform 0.18s ease;
}
.search-item-link:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}
.search-item-title {
  margin: 0 0 0.45rem;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.08rem;
  font-weight: 400;
  line-height: 1.5;
}
.search-item-link:hover .search-item-title {
  color: var(--accent);
}
.search-item-title mark,
.search-item-excerpt mark {
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--accent-dark);
  padding: 0 0.1em;
  border-radius: 2px;
}
.search-item-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.7rem;
  margin: 0 0 0.5rem;
  color: var(--muted);
  font-size: 0.8rem;
}
.search-item-meta a {
  color: var(--muted);
}
.search-item-meta a:hover {
  color: var(--accent);
}
.search-item-tag {
  opacity: 0.85;
}
.search-item-excerpt {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.9rem;
  line-height: 1.8;
}

.search-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.8rem;
}
.search-pager button {
  padding: 0.4rem 1.1rem;
  border: 1px solid var(--faint);
  border-radius: 6px;
  background: var(--paper-soft);
  color: var(--ink);
  font-family: inherit;
  font-size: 0.88rem;
  cursor: pointer;
  transition: border-color 0.18s ease, color 0.18s ease;
}
.search-pager button:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}
.search-pager button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.search-pager span {
  color: var(--muted);
  font-size: 0.85rem;
}

/* ---------- 17. 版权声明（2026-08-18 火火钦谕版权保护第一层） ---------- */
/* 页脚版权行：站名之下、备案之上，serif 同风、略小一档 */
.site-footer .site-copyright {
  margin-top: 0.4rem;
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
}
/* 关于页「版权与转载」节：与正文间留一截空隙，段末收束 */
.copyright-block {
  margin-top: 2.4rem;
}
.copyright-block h2 {
  scroll-margin-top: 5rem;
}

/* ---------- 18. 页脚可配置化布局（2026-08-20 通政司派工） ---------- */
/* 左 LOGO + 右内容 flex 布局 */
.footer-layout {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 2rem;
}
.footer-logo {
  flex-shrink: 0;
}
.footer-logo img {
  height: 48px;
  width: auto;
  opacity: 0.85;
  transition: opacity 0.2s ease;
}
.footer-logo img:hover {
  opacity: 1;
}
.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  text-align: center;
}
/* 站名 */
.footer-site-name {
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  margin: 0;
}
/* 诗句 */
.footer-poem {
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
  margin: 0.15rem 0 0;
}
/* 自定义文本 */
.footer-custom {
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
  margin: 0.15rem 0 0;
}
/* 页脚非备案项挂链接时的通用链接样式（站名/版权/诗句/自定义） */
.footer-site-name a,
.site-copyright a,
.footer-poem a,
.footer-custom a {
  color: inherit;
  text-decoration: none;
  transition: opacity 0.18s ease;
}
.footer-site-name a:hover,
.site-copyright a:hover,
.footer-poem a:hover,
.footer-custom a:hover {
  opacity: 1;
  text-decoration: underline;
}
/* 备案号行 */
.footer-beian {
  font-size: 0.75rem;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}
/* 备案图标 — ICP（type=icp 的链接 ::before） */
.footer-beian a.beian-icp::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 0.35rem;
  background: url(/themes/theme-halo-gui/assets/IPC.webp) no-repeat center / contain;
  vertical-align: -2px;
}
/* 备案图标 — 公安（type=police 的链接 ::before） */
.footer-beian a.beian-police::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 0.35rem;
  background: url(/themes/theme-halo-gui/assets/police.webp) no-repeat center / contain;
  vertical-align: -2px;
}
.footer-beian a {
  color: inherit;
  text-decoration: none;
  transition: opacity 0.18s ease;
}
.footer-beian a:hover {
  opacity: 1;
  text-decoration: underline;
}
/* 移动端：LOGO 上方、内容下方，纵向排列 */
@media (max-width: 720px) {
  .footer-layout {
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
  }
  .footer-logo img {
    height: 36px;
  }
}
/* 行末装饰方块开关 */
.site-footer.no-decoration p::after {
  display: none !important;
}
}

/* ---------- 19. 链接管理页（PluginLinks 适配 · 2026-08-20 工部） ---------- */
.links-groups {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}
.links-group-link {
  display: inline-block;
  padding: 0.3rem 0.8rem;
  border: 1px solid var(--accent, #d33f4f);
  border-radius: 999px;
  color: var(--accent, #d33f4f);
  text-decoration: none;
  font-size: 0.85rem;
  transition: all 0.2s ease;
}
.links-group-link:hover,
.links-group-link.active {
  background: var(--accent, #d33f4f);
  color: #fff;
}
.links-section {
  margin-bottom: 2rem;
}
.links-group-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 0.8rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}
.links-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}
.link-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.link-card:hover {
  border-color: var(--accent, #d33f4f);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.link-logo {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}
.link-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.link-name {
  font-weight: 500;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.link-desc {
  font-size: 0.8rem;
  color: #888;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.links-empty {
  text-align: center;
  color: #999;
  padding: 2rem 0;
}
/* 友链申请表单 */
.links-apply {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(0,0,0,0.08);
}
.links-apply-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 1rem;
}
.links-apply-status {
  padding: 0.6rem 1rem;
  border-radius: 6px;
  background: #e8f5e9;
  color: #2e7d32;
  font-size: 0.9rem;
}
.links-apply-error {
  background: #fce4ec;
  color: #c62828;
}
.form-field {
  margin-bottom: 1rem;
}
.form-field label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 0.3rem;
}
.form-field input,
.form-field textarea {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 6px;
  font-size: 0.9rem;
  background: #fff;
  color: inherit;
  box-sizing: border-box;
}
.form-field input:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--accent, #d33f4f);
  box-shadow: 0 0 0 2px rgba(211,63,79,0.12);
}
.form-captcha {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.form-captcha img {
  border-radius: 6px;
  cursor: pointer;
}
.required { color: var(--accent, #d33f4f); }
.form-submit {
  display: inline-block;
  padding: 0.55rem 1.5rem;
  background: var(--accent, #d33f4f);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: opacity 0.2s ease;
}
.form-submit:hover { opacity: 0.85; }
@media (max-width: 720px) {
  .links-list { grid-template-columns: 1fr; }
}

/* ---------- 20. 文档管理页（plugin-docsme 适配 · 2026-08-20 工部） ---------- */
/* 把插件默认的翡翠绿/灰蓝配色，重映射为「归」主题的朱红纸墨 */
.dm-main-content {
  --dm-c-brand-rgb: 211, 63, 79;
  --dm-c-brand: rgb(var(--dm-c-brand-rgb));
  --dm-c-brand-hover: rgba(var(--dm-c-brand-rgb), 0.8);
  --dm-c-brand-active: rgba(var(--dm-c-brand-rgb), 0.9);
  --dm-c-brand-soft: rgba(var(--dm-c-brand-rgb), 0.1);
  --dm-c-brand-mute: rgba(var(--dm-c-brand-rgb), 0.05);
  --dm-c-text-1: #25231f;
  --dm-c-text-2: #777166;
  --dm-c-text-3: #9a9384;
  --dm-c-bg: #fbf7ee;
  --dm-c-bg-alt: #faf8f2;
  --dm-c-bg-elv: #fffdf8;
  --dm-c-bg-soft: #faf8f2;
  --dm-c-border: #e5dcc8;
  --dm-c-border-dark: #cfc5ac;
  --dm-c-divider: #e5dcc8;
  --dm-font-family-base: "HY XinRenWenSong", "PingFang SC", "Microsoft YaHei", sans-serif;
}

/* 页面大标题：对齐站内 article-title 的山海江南大字 */
.dm-projects-header {
  padding: 2rem 0 1.4rem;
  border-bottom: 1px solid var(--dm-c-divider);
  margin-bottom: 2rem;
}
.dm-projects-header__title {
  color: var(--accent);
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.6rem, 7vw, 4.8rem);
  line-height: 1.15;
  margin: 0;
}
.dm-projects-header__description {
  margin: 0.6rem 0 0 0;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 1.05rem;
  letter-spacing: 0.05em;
  line-height: 1.5;
}

/* 卡片文字走宋体，标题用墨色 */
.dm-project-card__title {
  font-family: var(--serif);
  color: var(--dm-c-text-1);
}
.dm-project-card__info {
  font-family: var(--serif);
  color: var(--dm-c-text-2);
}
.dm-project-card__info li:before {
  color: var(--dm-c-brand);
}

/* 背景装饰：去掉左右光晕，只保留纸纹条纹 */
body {
  background-image: repeating-linear-gradient(0deg, #322e2804 0 1px, #0000 1px 4px) !important;
}
