/* 佛经 / 咒语封面目录 · 书架式（一区单列 / 二区双列） */

.nj-catalog {
  --nj-wood: #6b4a28;
  --nj-wood-deep: #4a3018;
  --nj-wood-hi: #9a7344;

  width: 100%;
  max-width: 1226px;
  margin: 0 auto;
  padding: 0 0 16px;
  box-sizing: border-box;
  clear: both;
  background: linear-gradient(
    180deg,
    rgba(255, 248, 230, 0.92) 0%,
    rgba(236, 220, 180, 0.95) 100%
  );
  border: 3px solid #7a6236;
  border-bottom: none;
  outline: 1px solid #c4ae7a;
  outline-offset: -7px;
  box-shadow: 0 10px 28px rgba(20, 10, 0, 0.22);
}

/* 压掉旧站 #footer{height:150px;白底;float} 露底纹的大空隙 */
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 16px !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;
}

.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;
}

/* —— 页眉：矮匾；题前小图标 + 右侧大佛手裁切底纹 —— */
.nj-catalog-head {
  position: relative;
  margin: 0 0 6px;
  padding: 8px 18px 6px;
  text-align: center;
  background: linear-gradient(180deg, #2a1c0e 0%, #16100a 100%);
  border-bottom: 2px solid #c9a227;
  box-shadow: inset 0 1px 0 rgba(255, 220, 140, 0.16);
  overflow: hidden;
}

/* 压过 style.css：.slide.slide3 h2 { margin:35px } */
.nj-catalog-head h2,
.nj-catalog-head .nj-catalog-title {
  margin: 0 0 2px !important;
  padding: 0 !important;
}

.nj-catalog-head p {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

/* 大佛手：偏右下被裁切，作背景气韵 */
.nj-catalog-bg-hand {
  position: absolute;
  right: -4%;
  bottom: -42%;
  width: min(220px, 34%);
  height: 145%;
  pointer-events: none;
  opacity: 0.13;
  background-color: #e8d9a8;
  -webkit-mask-image: url("../jing-img/nav/catalog-deco-hand.svg");
  mask-image: url("../jing-img/nav/catalog-deco-hand.svg");
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center top;
  mask-position: center top;
  -webkit-mask-size: contain;
  mask-size: contain;
  transform: rotate(-8deg);
}

.nj-catalog-title {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.26em;
  line-height: 1.1;
}

.nj-catalog-title-ico {
  display: inline-block;
  flex: 0 0 auto;
  width: 1.05em;
  height: 1.05em;
  background-color: #f0d078;
  -webkit-mask-image: url("../jing-img/nav/catalog-deco-hall.svg");
  mask-image: url("../jing-img/nav/catalog-deco-hall.svg");
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
}

.nj-catalog-title-text {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-indent: 0.06em;
  color: #f3e0a8;
  /* 与封面竖题同系宋体 */
  font-family: "SimSun", "Songti SC", "Noto Serif SC", "STSong", serif;
}

.nj-catalog-head .nj-catalog-lead {
  position: relative;
  z-index: 1;
  margin: 0 auto !important;
  max-width: 42em;
  font-size: 12px;
  line-height: 1.3;
  color: #d4c090;
  letter-spacing: 0.06em;
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
}

.nj-catalog-head .nj-catalog-lead b {
  color: #f0d078;
  font-weight: 700;
}

.nj-catalog-head .nj-catalog-note {
  position: relative;
  z-index: 1;
  margin: 1px auto 0 !important;
  max-width: 42em;
  font-size: 11px;
  line-height: 1.3;
  color: #8f7d55;
  letter-spacing: 0.02em;
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
}

/* —— 收藏+热门：统一外框，与下方全部区区分 —— */
.nj-catalog-spotlight {
  margin: 12px 14px 6px;
  padding: 8px 10px 14px;
  background:
    linear-gradient(180deg, rgba(255, 248, 230, 0.55), rgba(245, 230, 190, 0.35));
  border: 1.5px solid rgba(160, 120, 50, 0.45);
  border-radius: 6px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    0 4px 14px rgba(60, 35, 10, 0.1);
}

.nj-catalog-spotlight .nj-catalog-section {
  margin: 10px 0 0;
  padding: 0 2px 4px;
}

.nj-catalog-spotlight .nj-catalog-section:first-child {
  margin-top: 0;
}

/* 框内木架：偏深、略厚，像「案几」 */
.nj-catalog-spotlight .nj-shelf-plank {
  height: 12px;
  background: linear-gradient(
    180deg,
    #8a6238 0%,
    #5c3c1e 45%,
    #3d2814 100%
  );
  box-shadow:
    0 2px 0 #2a1a0c,
    0 4px 8px rgba(20, 8, 0, 0.22),
    inset 0 1px 0 rgba(255, 220, 160, 0.28);
}

/* —— 分区 —— */
.nj-catalog-section {
  margin: 18px 16px 0;
  padding: 0 4px 8px;
}

.nj-catalog-section[hidden] {
  display: none !important;
}

/* 全部经书区：更轻的隔板，避免与上框木架雷同 */
.nj-catalog-all {
  margin-top: 22px;
  padding-top: 14px;
  border-top: 1px dashed rgba(122, 98, 54, 0.28);
}

.nj-catalog-all .nj-shelf-plank {
  height: 8px;
  border-radius: 1px;
  background: linear-gradient(
    180deg,
    #c4a878 0%,
    #a88858 50%,
    #8a6e44 100%
  );
  box-shadow:
    0 1px 0 rgba(90, 60, 30, 0.35),
    0 3px 6px rgba(40, 20, 0, 0.12),
    inset 0 1px 0 rgba(255, 240, 200, 0.4);
}

.nj-catalog-all .nj-shelf-band + .nj-shelf-band {
  margin-top: 6px;
}

.nj-catalog-section-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0 0 10px;
  padding: 0 4px;
}

.nj-catalog-section-title h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: #3d2a10;
  font-family: "LXGW WenKai", "KaiTi", "STKaiti", serif;
}

.nj-catalog-section-title span {
  font-size: 12px;
  color: #8a7348;
  letter-spacing: 0.06em;
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
}

.nj-shelf-empty {
  margin: 0 8px 12px;
  padding: 14px 16px;
  font-size: 13px;
  color: #7a6540;
  background: rgba(255, 255, 255, 0.35);
  border: 1px dashed rgba(122, 98, 54, 0.35);
  border-radius: 4px;
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
}

.nj-shelf-stack {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.nj-shelf-band-label {
  margin: 0 0 6px 6px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: #5a4020;
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
}

.nj-shelf-row {
  position: relative;
  padding: 0 6px;
}

.nj-shelf-books {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 18px 16px;
  justify-content: flex-start;
  padding: 8px 8px 0;
  min-height: 40px;
}

.nj-shelf-plank {
  height: 14px;
  margin-top: 2px;
  border-radius: 2px;
  background: linear-gradient(
    180deg,
    #a07848 0%,
    var(--nj-wood) 40%,
    var(--nj-wood-deep) 100%
  );
  box-shadow:
    0 3px 0 var(--nj-wood-deep),
    0 6px 10px rgba(20, 8, 0, 0.28),
    inset 0 1px 0 rgba(255, 220, 160, 0.35);
  position: relative;
}

.nj-shelf-plank::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, rgba(255, 230, 170, 0.35), transparent);
}

/* —— 单本封面 —— */
.nj-cover {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: inherit;
  transition: transform 0.18s ease;
  flex: 0 0 auto;
}

.nj-cover:hover,
.nj-cover:focus {
  transform: translateY(-6px);
  z-index: 2;
}

.nj-cover:focus-visible {
  outline: 2px solid #8a6a20;
  outline-offset: 4px;
}

/* 爱心收藏：默认很轻，点亮才明显 */
.nj-cover-fav {
  position: absolute;
  top: -2px;
  right: 2px;
  z-index: 4;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  background: rgba(255, 250, 235, 0.55);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.72;
  transition: opacity 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.nj-cover:hover .nj-cover-fav,
.nj-cover-fav.is-on {
  opacity: 1;
}

.nj-cover-fav .nj-heart {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: #8a6a48;
  stroke-width: 1.7;
  stroke-linejoin: round;
}

.nj-cover-fav:hover .nj-heart {
  stroke: #c45a4a;
}

.nj-cover-fav.is-on {
  background: rgba(255, 240, 235, 0.92);
  transform: scale(1.05);
}

.nj-cover-fav.is-on .nj-heart {
  fill: #d4533f;
  stroke: #b83a2a;
}

/* 顶栏移除：叉号 */
.nj-cover-remove {
  opacity: 0.78;
  color: #6a5430;
  background: rgba(255, 250, 235, 0.7);
}

.nj-cover-remove .nj-x {
  width: 12px;
  height: 12px;
  display: block;
}

.nj-cover-remove:hover,
.nj-cover.is-pin:hover .nj-cover-remove {
  opacity: 1;
  color: #8a2a1a;
  background: rgba(255, 236, 230, 0.95);
}

.nj-cover-book {
  position: relative;
  filter: drop-shadow(2px 4px 5px rgba(40, 20, 0, 0.3));
}

.nj-cover-face {
  position: absolute;
  inset: 0 8px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 2px 0 0 2px;
  box-sizing: border-box;
  border: 1px solid rgba(255, 235, 180, 0.28);
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.06), rgba(0, 0, 0, 0.1)),
    repeating-linear-gradient(
      60deg,
      rgba(255, 255, 255, 0.045) 0 1px,
      transparent 1px 10px
    ),
    repeating-linear-gradient(
      -60deg,
      rgba(0, 0, 0, 0.05) 0 1px,
      transparent 1px 10px
    );
}

.nj-cover-pages {
  position: absolute;
  top: 3px;
  right: 0;
  bottom: 3px;
  width: 8px;
  background: repeating-linear-gradient(180deg, #f8f4ea 0 2px, #e8e0d0 2px 3px);
  border-radius: 0 2px 2px 0;
  box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.65);
}

.nj-cover-label {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  padding: 10px 5px;
  background: #fbf7ea;
  border: 1.5px solid #1a1206;
  box-shadow: inset 0 0 0 2px #fbf7ea, inset 0 0 0 3.5px #1a1206;
  /* 不裁切题名 */
  overflow: visible;
}

.nj-cover-title {
  writing-mode: vertical-rl;
  text-orientation: upright;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: 0.08em;
  color: #1a1206;
  font-family: "SimSun", "Songti SC", "Noto Serif SC", "STSong", serif;
  overflow: visible;
  word-break: keep-all;
}

.nj-cover-caption {
  margin-top: 8px;
  max-width: 100%;
  font-size: 12px;
  line-height: 1.3;
  text-align: center;
  color: #3d2a10;
  letter-spacing: 0.04em;
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 一区：短题（约 ≤4 字） */
.nj-cover-size-s {
  width: 100px;
}
.nj-cover-size-s .nj-cover-book {
  width: 92px;
  height: 136px;
}
.nj-cover-size-s .nj-cover-face {
  overflow: hidden;
}
.nj-cover-size-s .nj-cover-label {
  width: 34px;
  height: auto;
  min-height: 0;
  max-height: none;
  padding: 12px 4px;
}
.nj-cover-size-s .nj-cover-title {
  font-size: 17px;
  letter-spacing: 0.22em;
  height: auto;
  max-height: none;
}
.nj-cover-size-s .nj-cover-caption {
  max-width: 100px;
}

/* 二区：中题单列加高（如心经、金刚经全题） */
.nj-cover-size-m {
  width: 112px;
}
.nj-cover-size-m .nj-cover-book {
  width: 104px;
  height: 210px;
}
.nj-cover-size-m .nj-cover-face {
  overflow: hidden;
}
.nj-cover-size-m .nj-cover-label {
  width: 36px;
  height: auto;
  min-height: 0;
  max-height: none;
  padding: 12px 5px;
}
.nj-cover-size-m .nj-cover-title {
  font-size: 15px;
  letter-spacing: 0.1em;
  height: auto;
  max-height: none;
}
.nj-cover-size-m .nj-cover-caption {
  max-width: 112px;
}

/* 三区：长题均分双/三列，签条随内容收紧 */
.nj-cover-size-l {
  width: 132px;
}
.nj-cover-size-l .nj-cover-book {
  width: 124px;
  height: auto;
  min-height: 168px;
}
.nj-cover-size-l .nj-cover-face {
  position: relative;
  inset: auto;
  width: calc(100% - 8px);
  min-height: 168px;
  height: 100%;
  overflow: visible;
}
.nj-cover-size-l .nj-cover-book {
  display: flex;
  align-items: stretch;
}
.nj-cover-size-l .nj-cover-pages {
  position: relative;
  top: auto;
  right: auto;
  bottom: auto;
  flex: 0 0 8px;
  align-self: stretch;
}
.nj-cover-size-l .nj-cover-label {
  width: auto;
  max-width: 100%;
  height: auto;
  min-height: 0;
  max-height: none;
  padding: 12px 8px;
  align-items: center;
  justify-content: center;
}
.nj-cover-size-l .nj-cover-title-cols {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: center;
  gap: 0.22em;
  writing-mode: horizontal-tb;
  height: auto;
  width: auto;
  max-height: none;
  overflow: visible;
}
.nj-cover-size-l .nj-cover-col {
  writing-mode: vertical-rl;
  text-orientation: upright;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: 0.08em;
  color: #1a1206;
  font-family: "SimSun", "Songti SC", "Noto Serif SC", "STSong", serif;
  height: auto;
}
.nj-cover-size-l .nj-cover-caption {
  max-width: 140px;
}

/* 三列超长 */
.nj-cover-size-l.nj-cover-cols-3 {
  width: 156px;
}
.nj-cover-size-l.nj-cover-cols-3 .nj-cover-book {
  width: 148px;
  min-height: 176px;
}
.nj-cover-size-l.nj-cover-cols-3 .nj-cover-face {
  min-height: 176px;
}
.nj-cover-size-l.nj-cover-cols-3 .nj-cover-col {
  font-size: 13px;
  letter-spacing: 0.06em;
}
.nj-cover-size-l.nj-cover-cols-3 .nj-cover-caption {
  max-width: 156px;
}

/* 封面色 */
.nj-cover-tone-0 .nj-cover-face {
  background-color: #d6b03a;
}
.nj-cover-tone-1 .nj-cover-face {
  background-color: #b05528;
}
.nj-cover-tone-2 .nj-cover-face {
  background-color: #2c3348;
}
.nj-cover-tone-3 .nj-cover-face {
  background-color: #c99622;
}
.nj-cover-tone-2 .nj-cover-label {
  background: #f3edd8;
}

@media (max-width: 720px) {
  .nj-catalog-head {
    padding: 10px 14px 9px;
  }
  .nj-catalog-title-text {
    font-size: 26px;
    letter-spacing: 0.22em;
  }
  .nj-catalog-bg-hand {
    width: min(180px, 38%);
    opacity: 0.11;
    right: -8%;
  }
  .nj-catalog-section {
    margin-left: 8px;
    margin-right: 8px;
  }
  .nj-shelf-books {
    gap: 14px 12px;
  }
}
