/* ============================================================
   山海有灵 · 组件层
   导航 / 印章 / 按钮 / 远山分隔 / 竖排卷标 / 卷首标题
   版画国风，克制点睛
   ============================================================ */

/* —— 顶部导航 —— */
.nav-bar {
  position: sticky;
  top: 0;
  z-index: var(--z-nav);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-5);
  padding: var(--sp-3) var(--sp-6);
  background: rgba(244, 236, 216, 0.86);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: var(--line-hair) solid var(--ink-ghost);
  /* 底部双线：细墨线 + 朱砂细线，古籍版口感 */
  box-shadow: 0 1px 0 0 rgba(178, 58, 46, 0.18);
}

/* 品牌印章 */
.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-3);
  font-family: var(--font-display);
  color: var(--ink);
}
.nav-brand .brand-seal {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  background: var(--cinnabar);
  color: var(--paper);
  font-size: var(--fs-lg);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-seal);
  transform: rotate(-3deg);
  letter-spacing: 0;
  line-height: 1;
}
.nav-brand .brand-name {
  font-size: var(--fs-md);
  letter-spacing: var(--ls-wide);
}
.nav-brand .brand-sub {
  font-family: var(--font-sub);
  font-size: var(--fs-xs);
  color: var(--ink-faint);
  letter-spacing: var(--ls-wide);
  margin-left: var(--sp-1);
}
/* logo 即卷首入口：home 时朱砂方印轻微强调，呼应 nav-link active */
.nav-brand.is-active .brand-seal {
  transform: rotate(-3deg) scale(1.06);
  box-shadow: 0 2px 8px rgba(178,58,46,0.40), 0 0 0 2px rgba(178,58,46,0.18);
}
.nav-brand.is-active .brand-name { color: var(--cinnabar-deep); }

/* 导航链接 */
.nav-links {
  display: flex;
  align-items: center;
  gap: var(--sp-5);
}
.nav-link {
  position: relative;
  font-family: var(--font-sub);
  font-size: var(--fs-base);
  color: var(--ink-soft);
  letter-spacing: var(--ls-wide);
  padding: var(--sp-2) 2px;
  transition: color var(--dur-fast) var(--ease-ink);
}
.nav-link::before {
  /* 朱砂方点 · 激活态指示 */
  content: "";
  position: absolute;
  top: -2px;
  left: 50%;
  transform: translateX(-50%) scale(0);
  width: 6px;
  height: 6px;
  background: var(--cinnabar);
  border-radius: var(--r-sm);
  transition: transform var(--dur-base) var(--ease-ink);
}
.nav-link::after {
  /* 底部墨线 · hover/active */
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: var(--line-ink);
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform var(--dur-base) var(--ease-ink);
}
.nav-link:hover { color: var(--ink); }
.nav-link:hover::after { transform: scaleX(0.7); }
.nav-link.active { color: var(--ink); font-weight: 600; }
.nav-link.active::before { transform: translateX(-50%) scale(1); }
.nav-link.active::after { transform: scaleX(1); background: var(--cinnabar); }

.nav-link .nav-glyph {
  display: block;
  font-family: var(--font-display);
  font-size: var(--fs-md);
  color: var(--cinnabar);
  line-height: 1;
  margin-bottom: 2px;
  text-align: center;
}

/* 移动端：导航折叠为横滑 */
@media (max-width: 880px) {
  .nav-bar { padding: var(--sp-2) var(--sp-4); gap: var(--sp-3); }
  .nav-brand .brand-sub { display: none; }
  .nav-links {
    gap: var(--sp-4);
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .nav-links::-webkit-scrollbar { display: none; }
  .nav-link { font-size: var(--fs-sm); white-space: nowrap; }
  .nav-link .nav-glyph { font-size: var(--fs-base); }
}

/* —— 页脚（关于入口 + 落款） —— */
.site-footer {
  position: relative;
  z-index: var(--z-content);
  padding: var(--sp-5) var(--sp-4) var(--sp-6);
  background: rgba(244, 236, 216, 0.6);
  border-top: var(--line-hair) solid var(--ink-ghost);
  box-shadow: 0 1px 0 0 rgba(178, 58, 46, 0.14);
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--sp-2) var(--sp-3);
  font-family: var(--font-sub);
  font-size: var(--fs-sm);
  color: var(--ink-faint);
  letter-spacing: var(--ls-normal);
}
.footer-seal {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  background: var(--cinnabar);
  color: var(--paper);
  font-family: var(--font-display);
  font-size: var(--fs-sm);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-seal);
  transform: rotate(-3deg);
  line-height: 1;
}
.footer-link {
  color: var(--ink-soft);
  border-bottom: var(--line-hair) solid transparent;
  transition: color var(--dur-fast) var(--ease-ink), border-color var(--dur-fast) var(--ease-ink);
}
.footer-link:hover { color: var(--cinnabar); border-bottom-color: var(--cinnabar); }
.footer-dot { color: var(--ink-ghost); }
.footer-note { color: var(--ink-faint); }
@media (max-width: 480px) {
  .footer-note { display: none; }
}

/* —— 朱砂方印（通用装饰组件） —— */
.seal {
  display: inline-grid;
  place-items: center;
  background: var(--cinnabar);
  color: var(--paper);
  font-family: var(--font-display);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-seal);
  line-height: 1;
  text-align: center;
  /* 印章略歪，手作感 */
  transform: rotate(-2deg);
}
.seal-sm { width: 44px; height: 44px; font-size: var(--fs-md); }
.seal-md { width: 64px; height: 64px; font-size: var(--fs-xl); }
.seal-lg { width: 96px; height: 96px; font-size: var(--fs-2xl); }

/* —— 按钮 —— */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-family: var(--font-sub);
  font-size: var(--fs-base);
  letter-spacing: var(--ls-wide);
  padding: var(--sp-3) var(--sp-5);
  border: var(--line-ink) solid var(--ink);
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-ink);
  position: relative;
}
.btn:hover { background: var(--ink); color: var(--paper); }
.btn:active { transform: translateY(1px); }

.btn-seal {
  background: var(--cinnabar);
  color: var(--paper);
  border-color: var(--cinnabar-deep);
  box-shadow: var(--shadow-seal);
}
.btn-seal:hover { background: var(--cinnabar-deep); color: var(--paper); }

/* V8.8 印章按钮 glyph 增强：盖印仪式感（hover 印章转正 + active 印章下沉） */
.btn .glyph {
  display: inline-grid;
  place-items: center;
  width: 1.55em;
  height: 1.55em;
  font-family: var(--font-display);
  font-size: 1.15em;
  line-height: 1;
  color: var(--paper);
  background: var(--cinnabar-deep);
  border-radius: var(--r-sm);
  transform: rotate(-2deg);
  transition: transform var(--dur-fast) var(--ease-ink);
}
.btn-seal .glyph { background: var(--cinnabar-deep); }
.btn-seal:hover .glyph { transform: rotate(0deg); background: var(--cinnabar); }
.btn:active .glyph { transform: translateY(1px) rotate(0deg); }

.btn-ghost {
  border-color: var(--ink-ghost);
  color: var(--ink-faint);
}
.btn-ghost:hover { border-color: var(--ink); color: var(--ink); background: transparent; }

/* —— 远山分隔 —— */
.mountain-divider {
  position: relative;
  width: 100%;
  height: 64px;
  margin: var(--sp-7) 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
}
.mountain-divider svg {
  width: 100%;
  height: 100%;
  display: block;
}
.mountain-divider .seal-tiny {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-3deg);
  width: 28px; height: 28px;
  font-size: var(--fs-sm);
}

/* —— 墨线分隔 —— */
.ink-divider {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin: var(--sp-6) 0;
  color: var(--ink-faint);
}
.ink-divider::before,
.ink-divider::after {
  content: "";
  flex: 1;
  height: var(--line-hair);
  background: linear-gradient(90deg, transparent, var(--ink-ghost), transparent);
}
.ink-divider .glyph {
  font-family: var(--font-display);
  color: var(--cinnabar);
  font-size: var(--fs-md);
}

/* —— 竖排卷标 —— */
.vertical-label {
  writing-mode: vertical-rl;
  text-orientation: upright;
  font-family: var(--font-sub);
  font-size: var(--fs-sm);
  letter-spacing: var(--ls-wide);
  color: var(--ink-faint);
  line-height: var(--lh-loose);
}
.vertical-label.ink { color: var(--ink-soft); }

/* —— 卷首标题（古籍语汇） —— */
.section-title {
  position: relative;
  display: inline-block;
  font-family: var(--font-serif);
  font-size: var(--fs-2xl);
  font-weight: 900;
  color: var(--ink);
  letter-spacing: var(--ls-tight);
  margin-bottom: var(--sp-3);
}
.section-title .glyph {
  font-family: var(--font-display);
  color: var(--cinnabar);
  font-size: 1.1em;
  margin-right: var(--sp-2);
}
.section-title::after {
  content: "";
  display: block;
  width: 48px;
  height: 3px;
  background: var(--cinnabar);
  margin-top: var(--sp-3);
  border-radius: var(--r-sm);
}
.section-subtitle {
  font-family: var(--font-sub);
  font-size: var(--fs-md);
  color: var(--ink-faint);
  letter-spacing: var(--ls-wide);
  margin-bottom: var(--sp-5);
}

/* —— 占位说明 —— */
.placeholder {
  margin-top: var(--sp-6);
  padding: var(--sp-6);
  border: 1px dashed var(--ink-ghost);
  border-radius: var(--r-md);
  background: rgba(227, 212, 179, 0.32);
  color: var(--ink-faint);
  font-size: var(--fs-base);
  line-height: var(--lh-base);
  text-align: center;
  max-width: var(--container-narrow);
}
.placeholder .ph-glyph {
  display: block;
  font-family: var(--font-display);
  font-size: var(--fs-2xl);
  color: var(--cinnabar);
  margin-bottom: var(--sp-3);
  opacity: 0.7;
}

/* —— 角落朱砂落款 —— */
.corner-seal {
  position: absolute;
  bottom: var(--sp-5);
  right: var(--sp-5);
  pointer-events: none;
  opacity: 0.85;
}
