/* 念经网访客地图 · 浅金纸本（贴合站点 #bd870b / 白底暖金） */
.nj-vm {
  --nj-vm-ink: #4a3a22;
  --nj-vm-muted: #8a7350;
  --nj-vm-gold: #bd870b;
  --nj-vm-gold-soft: rgba(189, 135, 11, 0.28);
  --nj-vm-paper: #fffef9;
  --nj-vm-paper-deep: #faf3e4;
  --nj-vm-head: #7a5a18;
  --nj-vm-accent: #c45a4a;
  margin: 2px 0 4px;
  font-size: 13px;
  color: var(--nj-vm-ink);
}

/* 大卡片：地图 + 数据 + 愿文 同一外框，避免套娃小卡 */
.nj-vm-panel {
  margin: 0;
  padding: 0;
  border: 1px solid rgba(189, 135, 11, 0.34);
  border-radius: 12px 12px 0 0;
  background: linear-gradient(180deg, #fffef9 0%, #faf4e6 100%);
  box-shadow: 0 2px 10px rgba(120, 85, 35, 0.06);
  overflow: hidden;
}

.nj-vm-thumb {
  position: relative;
  display: block;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: #f7efdc;
  box-shadow: none;
  cursor: pointer;
  overflow: hidden;
  text-align: left;
  font: inherit;
  color: inherit;
  line-height: normal;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
}

.nj-vm-thumb:hover {
  filter: brightness(0.985);
}

.nj-vm-thumb:focus {
  outline: 2px solid rgba(189, 135, 11, 0.55);
  outline-offset: -2px;
}

.nj-vm-thumb-stage {
  position: relative;
  display: block;
  width: 100%;
  height: 0;
  padding-top: 46%;
  overflow: hidden;
  background: #f7efdc;
}

.nj-vm-thumb-canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

/* 侧栏棕色 h2 标题统一加活佛图标 */
#sidebar h2 {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 8px !important;
  box-sizing: border-box;
}

#sidebar h2::before {
  content: "";
  display: inline-block;
  width: 22px;
  height: 22px;
  flex: none;
  background: url("huofo.svg") center / contain no-repeat;
}

.nj-vm-dash {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin: 0;
  padding: 12px 4px 10px;
  border: none;
  border-top: 1px solid rgba(189, 135, 11, 0.16);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

/* 愿文：不再单独成卡，仅作大卡片内一行说明 */
#sidebar .nj-vm-blurb,
.nj-vm-blurb {
  clear: both !important;
  margin: 0 !important;
  padding: 11px 12px 13px !important;
  border: none !important;
  border-top: 1px dashed rgba(189, 135, 11, 0.22) !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: #6a5330 !important;
  font-size: 12px !important;
  line-height: 1.75 !important;
  letter-spacing: 0.01em;
  text-align: left !important;
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
}

#sidebar .nj-vm-blurb .nj-nowrap,
.nj-vm-blurb .nj-nowrap {
  white-space: nowrap;
}

.nj-vm-dash-item {
  position: relative;
  min-width: 0;
  text-align: center;
  padding: 2px 4px 4px;
}

.nj-vm-dash-item + .nj-vm-dash-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 16%;
  bottom: 16%;
  width: 1px;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(189, 135, 11, 0.32) 28%,
    rgba(189, 135, 11, 0.32) 72%,
    transparent 100%
  );
}

.nj-vm-dash-num {
  /* 强制无衬线等宽数字；侧栏里再加一层覆盖防站点全局 serif */
  font-family: Consolas, "Courier New", "Segoe UI", Arial, "Microsoft YaHei", monospace !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  line-height: 22px !important;
  height: 22px !important;
  letter-spacing: 0 !important;
  color: #8a5a22 !important;
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nj-vm-dash-label {
  margin-top: 5px;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: #7a5a18;
  white-space: nowrap;
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
}

.nj-vm-dash-label span {
  margin-left: 1px;
  color: #a07a30;
  font-size: 10px;
  letter-spacing: 0;
}

/* —— 「今日在念经」接下方面板，拼成同一张大卡 —— */
#sidebar .nj-feed,
.nj-feed {
  float: none !important;
  width: auto !important;
  margin: 0 0 8px !important;
  padding: 0 !important;
  border: 1px solid rgba(189, 135, 11, 0.34) !important;
  border-top: 1px solid rgba(189, 135, 11, 0.16) !important;
  border-radius: 0 0 12px 12px !important;
  background: #fffef9 !important;
  overflow: hidden;
  text-align: left !important;
  clear: both;
  box-sizing: border-box;
  box-shadow: none;
}

#sidebar .nj-feed-head,
.nj-feed-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  float: none !important;
  width: auto !important;
  margin: 0 !important;
  padding: 9px 12px !important;
  border: none !important;
  border-bottom: 1px solid rgba(189, 135, 11, 0.12) !important;
  background: transparent !important;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #6b4e12;
  text-align: left !important;
}

.nj-feed-head-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.nj-feed-head-title .nj-feed-icon {
  width: 20px;
  height: 20px;
}

.nj-feed-head-title .nj-feed-icon img {
  width: 18px;
  height: 18px;
}

#sidebar .nj-feed-head small,
.nj-feed-head small {
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0;
  color: #a07a30;
}

#sidebar .nj-feed-list,
.nj-feed-list {
  float: none !important;
  width: auto !important;
  margin: 0 !important;
  padding: 4px 6px 6px !important;
  max-height: none;
  overflow: visible;
  border: none !important;
  background: transparent !important;
  list-style: none;
}

#sidebar .nj-feed-row,
#sidebar .nj-feed .nj-feed-row,
.nj-feed-row {
  display: grid !important;
  grid-template-columns: 28px minmax(0, 1fr) !important;
  gap: 8px !important;
  align-items: center !important;
  float: none !important;
  clear: both !important;
  width: auto !important;
  max-width: none !important;
  margin: 0 0 4px !important;
  padding: 8px 8px !important;
  border: 1px solid transparent !important;
  border-radius: 8px !important;
  background: transparent !important;
  text-align: left !important;
  line-height: 1.35 !important;
  box-sizing: border-box;
  transition: background 0.15s ease, border-color 0.15s ease;
}

#sidebar .nj-feed-row:last-child,
.nj-feed-row:last-child {
  margin-bottom: 0 !important;
}

#sidebar .nj-feed-row:hover,
.nj-feed-row:hover {
  background: rgba(255, 248, 230, 0.85) !important;
  border-color: rgba(189, 135, 11, 0.18) !important;
}

.nj-feed-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex: none;
  background: none;
  border: none;
  box-shadow: none;
  border-radius: 0;
}

/* 标题活佛：去圆形底，只保留图标 */
.nj-feed-icon-head {
  width: 20px;
  height: 20px;
}

/* 列表合十：轻圆底衬托彩色图标 */
.nj-feed-icon-heshi,
.nj-feed-icon-chao {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, #fff8e8 0%, #f3e2b8 55%, #e8d29a 100%);
  border: 1px solid rgba(189, 135, 11, 0.22);
}

.nj-feed-icon img {
  display: block;
  width: 16px;
  height: 16px;
  object-fit: contain;
}

.nj-feed-icon-heshi img,
.nj-feed-icon-chao img {
  width: 15px;
  height: 15px;
}

/* 抄经毛笔：暖褐金，避免纯黑跳出纸本色板 */
.nj-feed-icon-chao img {
  filter: brightness(0) saturate(100%) invert(42%) sepia(42%) saturate(650%)
    hue-rotate(8deg) brightness(92%) contrast(92%);
}

/* 抄经榜：独立卡片（不贴地图底边），四角圆角 */
#sidebar .nj-feed-chao,
.nj-feed-chao {
  margin-top: 10px !important;
  border-radius: 12px !important;
  border-top: 1px solid rgba(189, 135, 11, 0.34) !important;
}

.nj-feed-main {
  min-width: 0;
}

.nj-feed-line1 {
  display: flex;
  align-items: baseline;
  flex-wrap: nowrap;
  gap: 4px 6px;
  min-width: 0;
  font-size: 12px;
  color: #5c4a2e;
}

.nj-feed-name {
  flex: none;
  max-width: 28%;
  font-weight: 700;
  color: #6b4e1e;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nj-feed-verb {
  flex: none;
  color: #8a7350;
  font-weight: 500;
}

.nj-feed-times {
  flex: none;
  color: #8a5a22;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.nj-feed-jing {
  min-width: 0;
  color: #5c4a2e;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nj-feed-line2 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 4px;
  font-size: 11px;
  color: #9a8260;
}

.nj-feed-line2 time {
  font-variant-numeric: tabular-nums;
  font-family: "Segoe UI", Arial, "Microsoft YaHei", sans-serif;
}

.nj-feed-badge {
  flex: none;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(189, 135, 11, 0.1);
  border: 1px solid rgba(189, 135, 11, 0.22);
  color: #8a6a28;
  font-size: 10px;
  letter-spacing: 0.04em;
  line-height: 1.5;
}

#sidebar .nj-feed-empty,
.nj-feed-empty {
  float: none !important;
  width: auto !important;
  margin: 0 !important;
  padding: 18px 12px !important;
  border: none !important;
  background: transparent !important;
  text-align: center !important;
  font-size: 12px;
  color: #8a7350;
  line-height: 1.6 !important;
}

.nj-vm-modal {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(60, 42, 18, 0.28);
}

.nj-vm-modal.is-open {
  display: flex;
}

.nj-vm-dialog {
  display: flex;
  flex-direction: column;
  width: min(940px, 100%);
  max-height: min(90vh, 740px);
  overflow: hidden;
  background: linear-gradient(180deg, #fffef9 0%, #faf4e6 100%);
  border: 1px solid rgba(189, 135, 11, 0.42);
  border-radius: 14px;
  box-shadow: 0 12px 36px rgba(80, 50, 10, 0.16);
}

.nj-vm-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px 12px 16px;
  background:
    linear-gradient(180deg, rgba(255, 248, 230, 0.98) 0%, rgba(247, 232, 196, 0.92) 100%);
  color: var(--nj-vm-head);
  border-bottom: 1px solid rgba(189, 135, 11, 0.28);
}

.nj-vm-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.nj-vm-title-ornament {
  flex: none;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 35%, #fff4c8 0%, #d4a24a 50%, #bd870b 100%);
  box-shadow: 0 0 0 3px rgba(189, 135, 11, 0.16);
}

.nj-vm-title-text {
  min-width: 0;
}

.nj-vm-dialog-head h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #6b4e12;
  text-shadow: none;
}

.nj-vm-close {
  position: relative;
  flex: none;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid rgba(189, 135, 11, 0.35);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.7);
  color: var(--nj-vm-head);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.nj-vm-close-x,
.nj-vm-close-x::before,
.nj-vm-close-x::after {
  display: block;
  position: absolute;
  left: 50%;
  top: 50%;
  width: 13px;
  height: 1.5px;
  background: #8a6a28;
  border-radius: 1px;
}

.nj-vm-close-x {
  width: 0;
  height: 0;
  background: transparent;
}

.nj-vm-close-x::before {
  content: "";
  transform: translate(-50%, -50%) rotate(45deg);
}

.nj-vm-close-x::after {
  content: "";
  transform: translate(-50%, -50%) rotate(-45deg);
}

.nj-vm-close:hover {
  border-color: rgba(189, 135, 11, 0.6);
  background: #fff6d8;
  transform: scale(1.04);
}

.nj-vm-close:focus {
  outline: 2px solid rgba(189, 135, 11, 0.45);
  outline-offset: 2px;
}

.nj-vm-dialog-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  min-height: 0;
  flex: 1;
}

.nj-vm-dialog-body-solo {
  grid-template-columns: 1fr;
  flex: 1;
  min-height: 0;
}

.nj-vm-map-wrap {
  position: relative;
  min-height: min(52vh, 480px);
  height: 100%;
  overflow: hidden;
  background: #f7efdc;
  touch-action: none;
}

.nj-vm-map-wrap canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
}

.nj-vm-map-wrap.is-dragging canvas {
  cursor: grabbing;
}

.nj-vm-side {
  border-left: 1px solid rgba(189, 135, 11, 0.22);
  padding: 14px;
  overflow: auto;
  background: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  color: var(--nj-vm-ink);
}

.nj-vm-side h4 {
  margin: 0 0 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(189, 135, 11, 0.22);
  font-size: 14px;
  color: var(--nj-vm-head);
  letter-spacing: 0.06em;
}

.nj-vm-side p {
  margin: 0 0 8px;
  line-height: 1.6;
  color: var(--nj-vm-muted);
}

.nj-vm-side p b {
  color: var(--nj-vm-ink);
}

.nj-vm-side ul {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.nj-vm-side li {
  padding: 8px 0;
  border-bottom: 1px dashed rgba(189, 135, 11, 0.22);
  color: var(--nj-vm-ink);
  line-height: 1.45;
}

.nj-vm-side li b {
  color: var(--nj-vm-accent);
}

.nj-vm-toolbar {
  position: absolute;
  right: 12px;
  top: 12px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: auto;
}

.nj-vm-toolbar button {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(189, 135, 11, 0.38);
  border-radius: 50%;
  background: rgba(255, 253, 248, 0.96);
  color: #6b4e12;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(80, 50, 10, 0.08);
  pointer-events: auto;
}

.nj-vm-toolbar button:hover {
  background: #fff6d8;
  border-color: rgba(189, 135, 11, 0.6);
}

.nj-vm-toolbar button:active {
  transform: scale(0.96);
}

.nj-vm-empty {
  padding: 6px 0;
  color: #8a7350;
}

@media (max-width: 720px) {
  .nj-vm-dialog-body {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(260px, 52vh) minmax(140px, 38vh);
  }

  .nj-vm-side {
    border-left: 0;
    border-top: 1px solid rgba(189, 135, 11, 0.22);
  }

  .nj-vm-map-wrap {
    min-height: 260px;
  }
}
