/* 竖版经书阅读器：大字楷体 + 古文句读 + Flash 式侧栏翻页 */

.nj-vreader {
  --nj-paper: #f6efd4;
  --nj-ink: #1a1206;
  --nj-rule: #a8905c;
  --nj-frame: #7a6236;
  --nj-frame-soft: #c4ae7a;
  --nj-col-w: 56px; /* 正文列：字与竖线留呼吸 */
  --nj-title-col-w: 92px; /* 经题列：更疏 */
  --nj-font: 40px;
  --nj-track: 0.02em; /* 列内更密，上下顶满（参考刻本） */
  /* 有句读的字下方略增呼吸（侧旁挂角仍不占格） */
  --nj-pause: 0.32em;
  --nj-side-w: 48px;

  width: 100%;
  max-width: 1226px;
  margin: 0 auto;
  margin-bottom: 0;
  clear: both;
  background: var(--nj-paper);
  border: 3px solid var(--nj-frame);
  outline: 1px solid var(--nj-frame-soft);
  outline-offset: -7px;
  box-sizing: border-box;
  font-family: "LXGW WenKai", "KaiTi", "STKaiti", "DFKai-SB", "SimSun", serif;
  direction: ltr;
}

/* 画面左「下一页」| 经文 | 右「上一页」
   必须 direction:ltr：页面若继承 rtl，flex 会把 order:1 甩到右边 */
.nj-vreader-body {
  display: flex;
  flex-direction: row;
  direction: ltr;
  align-items: stretch;
  /* 预留顶栏+回向；余高给经文，放不下自动第 2 页 */
  height: clamp(360px, calc(100vh - 300px), 620px);
  max-height: 620px;
}

.nj-side-next {
  order: 1;
  position: relative;
  /* 标签仍垂直居中；页码绝对贴底，不挤开「下一页」 */
}

.nj-side-prev {
  order: 3;
}

.nj-side {
  flex: 0 0 var(--nj-side-w);
  align-self: stretch;
  width: var(--nj-side-w);
  height: auto;
  min-height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-right: 1px solid var(--nj-rule);
  background: linear-gradient(90deg, #e8d7a0 0%, #dcc888 100%);
  color: #3d2a10;
  font-family: inherit;
  cursor: pointer;
  /* 父级 flex 只负责上下居中；竖排写在子元素上 */
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
  box-shadow: inset -1px 0 0 rgba(255, 248, 220, 0.35);
}

.nj-side-label {
  display: block;
  writing-mode: vertical-rl;
  text-orientation: upright;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.45em;
  line-height: 1;
  white-space: nowrap;
  pointer-events: none;
}

.nj-side-prev {
  border-right: 0;
  border-left: 1px solid var(--nj-rule);
  background: linear-gradient(270deg, #efe4bc 0%, #e8d9a8 100%);
}

.nj-side:hover {
  background: #d9c789;
  color: #2c1806;
}

.nj-side:focus-visible {
  outline: 2px solid #6b5528;
  outline-offset: -2px;
}

/* 隐藏时不占位，首页右侧让给经题 */
.nj-side.is-hidden {
  display: none;
}

.nj-side:disabled:not(.is-hidden) {
  opacity: 0.38;
  cursor: default;
  background: #e6dcb0;
  pointer-events: none;
}

/* 页码：更小更淡，不抢经文注意力 */
.nj-side-next .nj-page-indicator {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 8px;
  z-index: 2;
  width: 100%;
  min-width: 0;
  padding: 0 2px;
  box-sizing: border-box;
  line-height: 1.15;
  text-align: center;
  writing-mode: horizontal-tb;
  text-orientation: mixed;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: rgba(90, 70, 40, 0.42);
  pointer-events: none;
  font-family: inherit;
  background: transparent;
}

.nj-vreader-stage {
  order: 2;
  position: relative;
  flex: 1 1 auto;
  align-self: stretch;
  min-width: 0;
  height: 100%;
  /* 上下无 padding：竖线通到外框（信纸）；字的上下留白在列内 */
  padding: 0 6px 0 8px;
  overflow: hidden;
  box-sizing: border-box;
  direction: ltr;
  background:
    linear-gradient(90deg, rgba(122, 98, 54, 0.07), transparent 36px),
    linear-gradient(270deg, rgba(122, 98, 54, 0.07), transparent 36px),
    var(--nj-paper);
}

.nj-vreader-stage::before {
  content: "";
  position: absolute;
  left: -2%;
  bottom: 2%;
  width: min(62%, 720px);
  height: 78%;
  background: url("../jing-img/lotus.svg") no-repeat left bottom;
  background-size: contain;
  opacity: 0.075;
  pointer-events: none;
  z-index: 0;
  filter: saturate(0.75);
}

.nj-vreader-cols {
  position: relative;
  z-index: 1;
  margin: 0;
  padding: 0;
  list-style: none;
  height: 100%;
  overflow: visible;
}

.nj-vreader-cols li {
  float: right;
  display: flex;
  flex-direction: column;
  align-items: center; /* 字在竖栏内水平居中，与竖线留空 */
  justify-content: flex-start;
  width: var(--nj-col-w);
  height: 100%;
  margin: 0;
  /* 竖线通栏；上下内边距对称（页码已移到经题列下） */
  padding: 14px 6px 14px;
  box-sizing: border-box;
  border-right: 1.5px solid var(--nj-rule);
  font-size: var(--nj-font);
  font-weight: 500;
  color: var(--nj-ink);
  overflow: hidden; /* 防测量溢出时字被画到框外；容量按 content 盒计算 */
  font-family: "LXGW WenKai", "KaiTi", "STKaiti", "DFKai-SB", "SimSun", serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.nj-vreader-cols .nj-ch {
  position: relative;
  display: block;
  writing-mode: horizontal-tb;
  text-orientation: mixed;
  width: 1em;
  height: 1em;
  line-height: 1;
  margin: 0 0 var(--nj-track);
  flex: 0 0 auto;
  text-align: center;
}

.nj-vreader-cols .nj-ch:last-child {
  margin-bottom: 0;
}

.nj-vreader-cols .nj-ch-pause {
  margin-bottom: calc(var(--nj-track) + var(--nj-pause));
}

.nj-vreader-cols .nj-ch-pause:last-child {
  margin-bottom: 0;
}

.nj-vreader-cols .nj-jd {
  position: absolute;
  display: block;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  pointer-events: none;
  z-index: 2;
}

.nj-vreader-cols .nj-jd-ju {
  background-image: url("../jing-img/marks/juhao.svg");
  width: 0.48em;
  height: 0.48em;
  right: -0.08em;
  bottom: -0.28em;
}

.nj-vreader-cols .nj-jd-dou {
  background-image: url("../jing-img/marks/douhao.svg");
  width: 0.44em;
  height: 0.44em;
  right: -0.06em;
  bottom: -0.26em;
}

.nj-vreader-cols li.nj-col-title {
  width: var(--nj-title-col-w);
  font-weight: 700;
  color: #2c1806;
  /* 右侧已有外框，去掉标题列右边多余竖线 */
  border-right: 0 none transparent;
  box-shadow: none;
  /* 与正文列之间再多留一点栏距；贴紧外框 */
  margin-left: 12px;
  margin-right: 0;
  padding-left: 6px;
  padding-right: 2px;
}

/* 品题列：介于经名与正文之间，略细略淡，避免与正文混排 */
.nj-vreader {
  --nj-pin-col-w: 72px;
}

.nj-vreader-cols li.nj-col-pin {
  width: var(--nj-pin-col-w);
  font-weight: 700;
  font-size: 0.92em;
  color: #5c4018;
  border-right: 0 none transparent;
  box-shadow: none;
  margin-left: 6px;
  margin-right: 2px;
  padding-left: 4px;
  padding-right: 2px;
  letter-spacing: 0.08em;
}

.nj-vreader-cols .nj-title-mark {
  width: 0.92em;
  height: 0.92em;
  margin-bottom: 0.5em;
  background: url("../jing-img/marks/tingchan.svg") center / contain no-repeat;
  opacity: 0.88;
  filter: invert(18%) sepia(28%) saturate(900%) hue-rotate(350deg) brightness(0.55);
}

/* —— 短咒：标题仍竖排，正文超大横排 —— */
.nj-vreader.nj-short-h {
  --nj-h-font: 96px;
}

.nj-vreader.nj-short-h .nj-vreader-cols {
  display: flex;
  flex-direction: row-reverse; /* 右侧经题，左侧正文 */
  float: none;
  width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  height: 100%;
  align-items: stretch;
  box-sizing: border-box;
}

.nj-vreader.nj-short-h .nj-vreader-cols > li {
  float: none;
  height: auto;
  min-height: 100%;
  overflow: visible;
}

.nj-vreader.nj-short-h .nj-vreader-cols > li.nj-col-title {
  flex: 0 0 var(--nj-title-col-w);
  width: var(--nj-title-col-w);
  margin-left: 0;
  margin-right: 0;
  border-left: 1.5px solid var(--nj-rule);
  border-right: 0 none transparent;
}

.nj-vreader.nj-short-h .nj-vreader-cols > li.nj-col-body-h {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start; /* 换行时左对齐 */
  align-content: center;
  gap: 0.12em 0.18em;
  padding: 24px 28px;
  border-right: 0 none transparent;
  writing-mode: horizontal-tb;
  font-size: var(--nj-h-font);
  font-weight: 600;
  letter-spacing: 0.06em;
  line-height: 1.05;
  color: var(--nj-ink);
}

.nj-vreader.nj-short-h .nj-vreader-cols > li.nj-col-body-h.is-centered {
  justify-content: center;
}

.nj-vreader.nj-short-h .nj-col-body-h .nj-ch {
  display: inline-block;
  width: auto;
  height: auto;
  margin: 0;
  flex: 0 0 auto;
  font-size: 1em;
  line-height: 1;
  writing-mode: horizontal-tb;
}

/*
 * 注音开：
 * - 普通经文页：正文字号不变，每字预留拼音高度 → 重测后换列/翻页（可增页），禁止裁切
 * - 首页一屏：额外缩小字号，保证仍装进一屏；句读挂角仍可见
 */
.nj-vreader.nj-py-on {
  --nj-py-size: 13px;
  --nj-track: 0.04em;
  /* 品题列本身字小，注音需更宽列，避免拼音横向挤叠 */
  --nj-pin-col-w: 96px;
}

.nj-vreader.nj-onescreen.nj-py-on {
  --nj-font: 26px; /* 一屏略收，仍尽量铺满；fitOnescreen 可再微调 */
  --nj-title-col-w: 74px;
  --nj-pin-col-w: 78px;
  --nj-py-size: 10px;
  --nj-track: 0.04em;
  --nj-pause: 0.3em;
}

/* 测量探针与正式字共用：开注音时所有 .nj-ch 预留下沿（含探针） */
.nj-vreader.nj-py-on .nj-vreader-cols .nj-ch:not(.nj-title-mark) {
  position: relative;
  height: auto;
  min-height: 1em;
  padding-top: 0.48em; /* 与 --nj-py-size 平衡：够放拼音、少浪费列高 */
  box-sizing: content-box;
}

.nj-vreader.nj-py-on .nj-vreader-cols .nj-col-title,
.nj-vreader.nj-py-on .nj-vreader-cols .nj-col-pin {
  overflow: visible;
  padding-top: 10px;
}

.nj-vreader.nj-py-on .nj-vreader-cols .nj-col-title .nj-ch:not(.nj-title-mark) {
  padding-top: 0.62em;
}

/*
 * 品题（序品第一等）：字更小，宁可字距拉开、多占一列，也要拼音与字形分离清晰
 */
.nj-vreader.nj-py-on .nj-vreader-cols .nj-col-pin {
  padding-top: 16px;
  font-size: 0.86em;
  letter-spacing: 0.04em;
}

.nj-vreader.nj-py-on .nj-vreader-cols .nj-col-pin .nj-ch:not(.nj-title-mark) {
  padding-top: 1.2em;
  margin-bottom: 0.58em !important;
  min-height: 1.05em;
  height: auto;
  line-height: 1.05;
}

.nj-vreader.nj-py-on .nj-col-title .nj-py {
  font-size: 11px;
  font-weight: 600;
}

.nj-vreader.nj-py-on .nj-col-pin .nj-py {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: -0.03em;
  white-space: nowrap;
  top: 0.06em;
  line-height: 1;
}

.nj-vreader.nj-onescreen.nj-py-on .nj-col-pin .nj-py {
  font-size: 8px;
}

/* 开注音时句读挂角勿被裁：列底略松、挂角仍 overflow 可见于字盒内 */
.nj-vreader.nj-py-on .nj-vreader-cols .nj-ch-pause {
  margin-bottom: calc(var(--nj-track) + var(--nj-pause));
}

.nj-vreader .nj-py {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  font-size: var(--nj-py-size, 13px);
  line-height: 1;
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
  writing-mode: horizontal-tb;
  text-orientation: mixed;
  color: #7a4a12;
  font-family: "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  pointer-events: none;
  user-select: none;
}

.nj-vreader.nj-short-h.nj-py-on {
  --nj-py-size: 15px;
}

.nj-vreader.nj-short-h.nj-py-on .nj-col-body-h .nj-ch {
  position: relative;
  padding-top: 0.4em;
  margin-top: 0.04em;
}

.nj-vreader.nj-short-h .nj-col-body-h .nj-py {
  font-size: var(--nj-py-size, 15px);
  top: 0;
  color: #7a4e14;
}

/* 夹注：圆括号已换成 ⸢⸥，字号略小以免抢正文 */
.nj-vreader-cols .nj-ch-bracket,
.nj-vreader-cols .nj-ch-anno {
  font-size: 0.55em;
  font-weight: 500;
  color: #5a3f18;
  line-height: 1.1;
  opacity: 0.92;
}

.nj-vreader-cols .nj-ch-bracket {
  font-size: 0.48em;
  opacity: 0.75;
}

.nj-vreader.nj-short-h .nj-col-body-h .nj-ch-anno,
.nj-vreader.nj-short-h .nj-col-body-h .nj-ch-bracket {
  font-size: 0.42em;
  letter-spacing: 0;
}

@media (max-width: 720px) {
  .nj-vreader.nj-short-h {
    --nj-h-font: 48px;
  }
  .nj-vreader.nj-short-h .nj-col-body-h {
    padding: 16px 10px;
    letter-spacing: 0.04em;
  }
}

.nj-vreader-empty {
  padding: 48px 24px;
  text-align: center;
  color: #666;
  background: var(--nj-paper);
  font-size: 20px;
  font-family: "LXGW WenKai", "KaiTi", serif;
}

/*
 * 旧站 style.css：#xj{ height:630px; overflow:hidden } —— 阅读器加高后
 * 下半截经文会被裁成「半个字」。竖版以内容撑开高度，裁切交给列内排版/翻页。
 */
#xj {
  width: 1226px !important;
  max-width: 100%;
  height: auto !important;
  min-height: 0 !important;
  overflow: visible !important;
  direction: ltr !important;
  float: none !important;
  margin: 0 auto !important;
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
  border-bottom: none !important;
  background: #f6efd4 !important;
  background-image: none !important;
  position: relative;
  clear: both;
}

/* 回向区：原版「正文 + 右下横排按钮」布局，轻量精致化 */
#huixiang.nj-huixiang,
#huixiang {
  clear: both;
  float: none !important;
  overflow: hidden;
  width: 1226px;
  max-width: 100%;
  margin: -3px auto 0 !important; /* 贴紧经文框，消掉缝隙 */
  box-sizing: border-box;
  padding: 12px 18px 10px !important;
  height: auto !important;
  min-height: 0 !important;
  font-size: 15px !important;
  line-height: 1.75 !important;
  color: #333;
  background: #fffef8 !important;
  border: 1px solid #d4c4a0 !important;
  border-top: 1px solid #c4ae7a !important;
  border-radius: 0 0 12px 12px;
  outline: none;
  position: relative;
  z-index: 1;
  font-family: "LXGW WenKai", "KaiTi", "STKaiti", "SimSun", "Microsoft YaHei", sans-serif;
}

.nj-hx-copy {
  margin: 0;
  padding: 0 2px 4px;
  text-align: justify;
  color: #333;
}

.nj-hx-lead {
  color: #1a5fb4;
  font-weight: 700;
  margin-right: 2px;
  letter-spacing: 0.06em;
}

.nj-hx-sign {
  display: inline-block;
  min-width: 5em;
  margin: 0 4px;
  padding: 0 6px 1px !important;
  border: none !important;
  border-bottom: 2px solid #333 !important;
  background: transparent !important;
  color: #222 !important;
  font-size: 18px !important;
  font-weight: 700 !important;
  font-family: inherit !important;
  text-align: center;
  vertical-align: baseline;
  line-height: 1.2;
}

.nj-hx-sign:focus {
  outline: none;
  border-bottom-color: #1a5fb4 !important;
}

/* 右下横排操作条（对齐原版） */
#huixiang .nj-hx-bar,
#huixiang #demo1.nj-hx-bar {
  float: right !important;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 10px;
  width: auto !important;
  margin: 10px 0 4px 16px !important;
  padding: 6px 10px !important;
  background: #f4f1e8 !important;
  border: 1px solid #e0d6c0 !important;
  border-radius: 4px;
  box-sizing: border-box;
  line-height: 1 !important;
}

.nj-hx-btn,
#huixiang .nj-hx-btn,
#huixiang input.nj-hx-btn,
#huixiang input.jisu {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  margin: 0 !important;
  border: none !important;
  border-radius: 3px;
  height: 36px;
  min-height: 36px;
  padding: 0 16px !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  letter-spacing: 0.08em;
  font-family: inherit !important;
  cursor: pointer;
  line-height: 1 !important;
  overflow: hidden !important;
  white-space: nowrap;
  text-align: center;
  vertical-align: middle;
  transition: filter 0.15s ease, box-shadow 0.15s ease;
}

.nj-hx-btn-chant,
#huixiang .jisu.nj-hx-btn-chant,
#huixiang input.jisu.nj-hx-btn-chant {
  background: linear-gradient(180deg, #ff9a2e 0%, #f07900 55%, #e36a00 100%) !important;
  color: #fff !important;
  width: auto !important;
  min-width: 118px;
  box-shadow: 0 1px 0 rgba(140, 70, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.nj-hx-btn-chant:hover,
#huixiang .jisu.nj-hx-btn-chant:hover {
  filter: brightness(1.06);
}

.nj-hx-btn-offer,
#huixiang input.nj-hx-btn-offer {
  background: linear-gradient(180deg, #3d8cff 0%, #1f6fe0 55%, #1660c9 100%) !important;
  color: #fff !important;
  width: auto !important;
  min-width: 100px;
  box-shadow: 0 1px 0 rgba(20, 60, 120, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.nj-hx-btn-offer:hover {
  filter: brightness(1.06);
}

.nj-hx-count {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 0;
  background: transparent;
  border: none;
  color: #444;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

.nj-hx-count i,
#huixiang .nj-hx-count #count {
  display: inline-block;
  font-style: normal !important;
  min-width: 1.6em;
  margin: 0 3px;
  padding: 3px 8px !important;
  background: #fff !important;
  border: 1px solid #ccc !important;
  border-radius: 2px;
  color: #111 !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  text-align: center;
  line-height: 1.2;
}

/* 旧皮肤 body.slide 曾 overflow:hidden */
body.slide.slide3 {
  overflow-x: hidden;
  overflow-y: auto;
  padding-bottom: 0;
}

/* 去掉底部伸缩菜单 */
#bottomNav {
  display: none !important;
}

/* 导航：logo 下方，与提示条紧贴成一组 */
.nj-site-nav {
  width: 100%;
  max-width: 1226px;
  margin: 8px 0 0;
  box-sizing: border-box;
  background: linear-gradient(180deg, #1a140c 0%, #0d0a06 100%);
  border: 1px solid #3d3220;
  border-bottom: none;
  box-shadow: inset 0 1px 0 rgba(255, 220, 140, 0.12);
  overflow: visible;
}

.nj-site-nav ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: stretch;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nj-site-nav li {
  position: relative;
  flex: 1 1 auto;
  margin: 0;
  padding: 0;
  text-align: center;
  border-right: 1px solid rgba(180, 150, 90, 0.22);
}

.nj-site-nav li:last-child {
  border-right: 0;
}

/* 导航右上角标：黑体气泡 + 尖角 */
.nj-nav-badge {
  position: absolute;
  top: -8px;
  right: -10px;
  z-index: 3;
  display: inline-block;
  padding: 3px 7px 4px;
  line-height: 1.2;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  pointer-events: none;
  border-radius: 4px;
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", "SimHei",
    "Heiti SC", sans-serif;
  -webkit-font-smoothing: antialiased;
}

.nj-nav-badge-free {
  color: #fffdf6;
  background: linear-gradient(180deg, #e85a3a 0%, #c93a22 55%, #a82a16 100%);
  border: 1px solid #ffb090;
  text-shadow: 0 1px 0 rgba(80, 10, 0, 0.35);
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(255, 200, 160, 0.25) inset,
    0 0 10px rgba(220, 70, 40, 0.35);
}

/* 左下小尖角，指向菜单项 */
.nj-nav-badge-free::after {
  content: "";
  position: absolute;
  left: 8px;
  bottom: -5px;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 6px 5px 0 0;
  border-color: #a82a16 transparent transparent transparent;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.2));
}

/* 须压过 style.css 的 #logo a { color:#ccff00 } */
#logo .nj-site-nav a,
.nj-site-nav a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.32em;
  padding: 8px 10px;
  color: #e8d9a8 !important;
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.12em;
  font-family: "LXGW WenKai", "KaiTi", "STKaiti", "SimSun", serif;
  white-space: nowrap;
  transition: color 0.15s ease, background 0.15s ease, box-shadow 0.2s ease;
}

.nj-nav-ico {
  display: inline-block;
  flex: 0 0 auto;
  width: 1.15em;
  height: 1.15em;
  background-color: currentColor;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
}

/* 相对 js2/vertical-jing.css → ../jing-img/nav/ */
.nj-nav-ico-home {
  -webkit-mask-image: url("../jing-img/nav/home.svg");
  mask-image: url("../jing-img/nav/home.svg");
}
.nj-nav-ico-jing {
  -webkit-mask-image: url("../jing-img/nav/jing.svg");
  mask-image: url("../jing-img/nav/jing.svg");
}
.nj-nav-ico-zhou {
  -webkit-mask-image: url("../jing-img/nav/zhou.svg");
  mask-image: url("../jing-img/nav/zhou.svg");
}
.nj-nav-ico-chao {
  -webkit-mask-image: url("../jing-img/nav/chao.svg");
  mask-image: url("../jing-img/nav/chao.svg");
}
.nj-nav-ico-gongde {
  -webkit-mask-image: url("../jing-img/nav/gongde.svg");
  mask-image: url("../jing-img/nav/gongde.svg");
}
.nj-nav-ico-yuan {
  -webkit-mask-image: url("../jing-img/nav/yuan.svg");
  mask-image: url("../jing-img/nav/yuan.svg");
}
.nj-nav-ico-qianfo {
  width: 1.35em;
  height: 1.35em;
  -webkit-mask-image: url("../jing-img/nav/qianfo.svg");
  mask-image: url("../jing-img/nav/qianfo.svg");
}

#logo .nj-site-nav a:hover,
#logo .nj-site-nav a:focus,
.nj-site-nav a:hover,
.nj-site-nav a:focus {
  color: #fff6d6 !important;
  background: rgba(180, 140, 60, 0.22);
}

#logo .nj-site-nav a.is-current,
.nj-site-nav a.is-current {
  color: #ffe9a8 !important;
  background: rgba(120, 90, 30, 0.35);
}

/* 千佛模式：更醒目的可点入口 */
.nj-site-nav li.nj-nav-qianfo {
  flex: 1.15 1 auto;
}

#logo .nj-site-nav .nj-qianfo-link,
.nj-site-nav .nj-qianfo-link {
  /* 与其它导航项同高对齐，避免「千佛模式」上浮错位 */
  margin: 0 4px;
  padding: 8px 12px;
  box-sizing: border-box;
  color: #1a1206 !important;
  background: linear-gradient(180deg, #f0d078 0%, #d4a84a 55%, #c4962e 100%);
  border: 1px solid #8a6a20;
  border-radius: 3px;
  box-shadow:
    0 0 0 1px rgba(255, 230, 150, 0.25) inset,
    0 0 10px rgba(255, 200, 80, 0.35);
  letter-spacing: 0.1em;
  animation: nj-qianfo-pulse 2.4s ease-in-out infinite;
}

#logo .nj-site-nav .nj-qianfo-link:hover,
#logo .nj-site-nav .nj-qianfo-link:focus,
.nj-site-nav .nj-qianfo-link:hover,
.nj-site-nav .nj-qianfo-link:focus {
  color: #1a1206 !important;
  background: linear-gradient(180deg, #ffe09a 0%, #e0b85a 55%, #d0a438 100%);
  box-shadow:
    0 0 0 1px rgba(255, 240, 180, 0.4) inset,
    0 0 14px rgba(255, 210, 100, 0.55);
}

#logo .nj-site-nav .nj-qianfo-link.is-on,
.nj-site-nav .nj-qianfo-link.is-on {
  color: #fff8e0 !important;
  background: linear-gradient(180deg, #c45a2a 0%, #a34418 100%);
  border-color: #7a2e0c;
  box-shadow:
    0 0 0 1px rgba(255, 200, 140, 0.3) inset,
    0 0 16px rgba(255, 140, 40, 0.45);
  animation: none;
}

@keyframes nj-qianfo-pulse {
  0%,
  100% {
    box-shadow:
      0 0 0 1px rgba(255, 230, 150, 0.25) inset,
      0 0 8px rgba(255, 200, 80, 0.28);
  }
  50% {
    box-shadow:
      0 0 0 1px rgba(255, 240, 180, 0.45) inset,
      0 0 16px rgba(255, 210, 90, 0.55);
  }
}

/* 默认：保持站点原图自然尺寸（与旧版一致） */
body.slide.slide3:not(.nj-qianfo-on) {
  background-size: auto !important;
}

/* 开启千佛：缩到很小再平铺 → 同屏佛像更密 */
body.slide.slide3.nj-qianfo-on {
  background-repeat: repeat !important;
  background-size: 30px auto !important;
  background-position: top left !important;
  background-attachment: scroll !important;
}

/* 顶栏恢复首页原高度：上方露出佛像背景，内容整体下移 */
#header-wrapper {
  height: auto !important;
  min-height: 175px !important;
  box-sizing: border-box;
  overflow: visible !important;
}
#header-wrapper::after {
  content: "";
  display: table;
  clear: both;
}

#header {
  /* 与 jing-img/style.css 首页一致：顶部留白展示背景 */
  padding: 66px 0 0 !important;
  width: 1226px;
  max-width: 100%;
  margin: 0 auto;
  overflow: visible !important;
}

#logo {
  overflow: visible !important;
}

#logo h1 {
  margin: 0;
  line-height: 0;
}

#logo h1 img {
  height: auto !important;
  width: auto !important;
  max-width: none;
  display: block;
}

/* 提示条 + 右侧拼音开关：无外框；公告与开关之间仅淡短竖线分隔 */
.nj-tip-bar {
  --nj-tip-tools: 188px;
  display: flex;
  align-items: stretch;
  width: 100%;
  max-width: 100%;
  margin: 0;
  box-sizing: border-box;
  overflow: hidden;
  border: none;
  outline: none;
  background: linear-gradient(180deg, #5a4528 0%, #3f301c 100%);
}

.nj-tip-bar .scrollDiv {
  flex: 1 1 auto !important;
  width: auto !important;
  min-width: 0 !important;
  max-width: calc(100% - var(--nj-tip-tools)) !important;
  border: none !important;
  background: transparent !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
}

.nj-tip-tools {
  position: relative;
  flex: 0 0 var(--nj-tip-tools);
  width: var(--nj-tip-tools);
  min-width: var(--nj-tip-tools);
  max-width: var(--nj-tip-tools);
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
  z-index: 2;
}

/* 淡、短竖分隔：高度约一半，上下留白 */
.nj-tip-tools::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 12px;
  background: rgba(240, 226, 192, 0.32);
  pointer-events: none;
}

.nj-py-toggle {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 10px;
  margin: 0;
  border: none;
  background: transparent;
  color: #f0e2c0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 26px;
  height: 26px;
  cursor: pointer;
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
  box-sizing: border-box;
  white-space: nowrap;
  overflow: hidden;
  transition: background 0.15s ease, color 0.15s ease;
}

.nj-py-toggle-label {
  flex: 0 0 auto;
  white-space: nowrap;
}

.nj-py-toggle:hover,
.nj-py-toggle:focus-visible {
  background: rgba(255, 255, 255, 0.06);
  color: #f6ecd4;
  outline: none;
}

.nj-py-toggle.is-on {
  background: transparent;
  color: #f0e2c0;
}

.nj-py-toggle.is-loading {
  opacity: 0.65;
  cursor: wait;
}

/* 胶囊开关：关=深褐；开=暗金（弱化，不抢千佛模式） */
.nj-py-switch {
  position: relative;
  flex: 0 0 auto;
  width: 34px;
  height: 18px;
  border-radius: 999px;
  background: #2a1e10;
  border: 1px solid rgba(180, 150, 90, 0.28);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.35);
  transition: background 0.18s ease, border-color 0.18s ease;
}

.nj-py-switch-knob {
  position: absolute;
  top: 1px;
  left: 1px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: linear-gradient(180deg, #e8dcc0 0%, #cfc0a0 100%);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  transition: transform 0.18s ease, background 0.18s ease;
}

.nj-py-toggle.is-on .nj-py-switch {
  background: linear-gradient(180deg, #8a7348 0%, #6a5530 100%);
  border-color: rgba(200, 170, 110, 0.45);
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.2);
}

.nj-py-toggle.is-on .nj-py-switch-knob {
  transform: translateX(16px);
  background: linear-gradient(180deg, #f0e6d0 0%, #ddd0b0 100%);
}

@media (max-width: 720px) {
  .nj-tip-bar {
    --nj-tip-tools: 168px;
  }
  .nj-tip-bar > .scrollDiv,
  #logo .nj-tip-bar .scrollDiv {
    max-width: calc(100% - 168px) !important;
  }
  .nj-py-toggle {
    padding: 0 6px;
    gap: 6px;
    font-size: 11px;
  }
  .nj-py-switch {
    width: 30px;
    height: 16px;
  }
  .nj-py-switch-knob {
    width: 12px;
    height: 12px;
  }
  .nj-py-toggle.is-on .nj-py-switch-knob {
    transform: translateX(14px);
  }
}

/* 提示条：深褐金；无边框线框，避免整条像嵌套盒子 */
.scrollDiv {
  width: 100% !important;
  max-width: 1226px;
  height: 26px !important;
  line-height: 26px !important;
  margin: 0 !important;
  box-sizing: border-box;
  background: linear-gradient(180deg, #5a4528 0%, #3f301c 100%) !important;
  color: #f0e2c0 !important;
  border: none !important;
  outline: none !important;
}

/* 压过上方通用 .scrollDiv{width:100%}，保证右侧槽位 */
#logo .nj-tip-bar .scrollDiv,
.nj-tip-bar > .scrollDiv {
  flex: 1 1 auto !important;
  width: auto !important;
  max-width: calc(100% - var(--nj-tip-tools, 188px)) !important;
  min-width: 0 !important;
}

.scrollDiv li {
  height: 26px !important;
  margin-left: 10px;
  font-size: 13px !important;
  letter-spacing: 1px !important;
  color: #f0e2c0 !important;
}

.scrollDiv a {
  color: #ffd78a !important;
}

.scrollDiv font {
  color: #ffc9a0 !important;
}

@media (max-width: 900px) {
  .nj-vreader {
    --nj-col-w: 44px;
    --nj-title-col-w: 64px;
    --nj-font: 32px;
    --nj-track: 0.04em;
    --nj-pause: 0.28em;
    --nj-side-w: 34px;
  }
  .nj-vreader.nj-py-on {
    --nj-py-size: 12px;
  }
  .nj-vreader-body {
    height: clamp(320px, calc(100vh - 260px), 520px);
    max-height: 520px;
  }
  .nj-vreader-stage {
    height: 100%;
    padding: 0 6px 0 6px;
  }
  .nj-vreader-cols li {
    padding: 12px 4px 12px;
  }
  .nj-side-next .nj-page-indicator {
    bottom: 6px;
    font-size: 10px;
  }
  .nj-side-label {
    font-size: 17px;
    letter-spacing: 0.36em;
  }
  .nj-site-nav a {
    font-size: 13px;
    padding: 7px 6px;
    letter-spacing: 0.06em;
  }
}

@media (max-width: 560px) {
  .nj-vreader {
    --nj-col-w: 40px;
    --nj-title-col-w: 56px;
    --nj-font: 28px;
    --nj-side-w: 30px;
  }
  .nj-side-label {
    font-size: 15px;
    letter-spacing: 0.28em;
  }
}
/* 经文页统一页脚（与目录页一致） */
body.slide.slide3 #footer.nj-site-footer,
#footer.nj-site-footer {
  width: 100%;
  max-width: 1226px;
  height: auto !important;
  min-height: 0 !important;
  margin: 0 auto !important;
  float: none !important;
  clear: both;
  border: 3px solid #7a6236;
  border-top: 2px solid #c9a227;
  background: linear-gradient(180deg, #2a1c0e 0%, #16100a 100%) !important;
  box-sizing: border-box;
  text-align: center;
  padding: 14px 16px 16px;
}

/* 目录/念诵内容与页脚之间不要露出背景空隙 */
body.slide.slide3:has(#nj-jing-toc) #footer.nj-site-footer,
body.slide.slide3:has(#xj) #footer.nj-site-footer {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}
body.slide.slide3:has(#nj-jing-toc) .nj-toc {
  margin-bottom: 0;
  border-bottom: 0;
}
body.slide.slide3:has(#nj-jing-toc) #footer.nj-site-footer {
  border-top-width: 3px;
}

/* 念诵页：回向 / 全品直达 / 页脚贴紧，不透出背景缝 */
body.slide.slide3 #huixiang.nj-huixiang {
  float: none !important;
  width: 100% !important;
  max-width: 1226px;
  margin: -3px auto 0 !important;
  box-sizing: border-box;
}
body.slide.slide3 .nj-pin-nav {
  margin: 0 auto !important;
  border-top: 0;
}
body.slide.slide3:has(.nj-pin-nav) #footer.nj-site-footer,
body.slide.slide3:has(#huixiang) #footer.nj-site-footer {
  border-top: 0;
  margin: 0 auto !important;
  height: auto !important;
  float: none !important;
}
body.slide.slide3 #wrapper {
  overflow: hidden;
  padding-bottom: 0;
  margin-bottom: 0;
}
.nj-site-footer .nj-footer-inner,
.nj-site-footer .pfd {
  width: 100% !important;
  max-width: 100%;
  margin: 0 auto;
  color: #d4c090;
  font-size: 13px;
}
.nj-site-footer .nj-footer-brand {
  margin: 0 0 4px !important;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.36em;
  text-indent: 0.36em;
  color: #f0d078;
  font-family: "SimSun", "Songti SC", "STSong", serif;
}
.nj-site-footer .nj-footer-aka {
  margin-left: 0.15em;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: #cbb890;
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  vertical-align: middle;
}
.nj-site-footer .nj-footer-copy {
  margin: 0 0 4px !important;
  font-size: 12px;
  color: #a89468;
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
}
.nj-site-footer .nj-footer-slogan {
  margin: 0 !important;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: #cbb890;
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
}
.nj-site-footer .nj-footer-slogan::before,
.nj-site-footer .nj-footer-slogan::after {
  content: " · ";
  color: #8a7348;
}
