/* ==========================================================================
   五个 tab 的布局
   命名：教派 sect / 人物 figure / 壁画 mural / 事件（历史）event / 寺庙 temple
   ========================================================================== */

/* -------------------------- 公共：渐变遮罩 / 轨道 --------------- */
.tab-mask {
  position: absolute;
  left: 0;
  right: 0;
  pointer-events: none;
  z-index: 3;
}
.tab-mask--top {
  top: 100px;
  height: 80px;
  background: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, .8) 50%, rgba(0, 0, 0, 0) 100%);
}
.tab-mask--bottom {
  bottom: 0;
  height: 80px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, #000 100%);
}

.drag-x { cursor: grab; }
.drag-x.is-dragging { cursor: grabbing; }
.drag-x.is-dragging * { pointer-events: none; }

/* 左侧竖排分类（人物 / 事件共用，200 宽渐变面板，渐变块 640 高居中） */
.rail {
  position: absolute;
  left: 0;
  top: 0;
  width: 200px;
  height: 100%;
  z-index: 6;
}
.rail::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 200px;
  height: 640px;
  transform: translateY(-50%);
  background: linear-gradient(270deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, .8) 50%, #000 100%);
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 14%, #000 86%, transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0%, #000 14%, #000 86%, transparent 100%);
  pointer-events: none;
}
.rail__list {
  position: absolute;
  left: 90px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--rail-gap, 64px); /* 设计稿 6 类时 64；由 JS 按视口高度收敛 */
}
.rail__item {
  position: relative;
  display: block;
  width: max-content;
  font-size: 16px;
  line-height: 22px;
  font-weight: 400;
  color: var(--ink);
  opacity: .5;
  white-space: nowrap;
  transition: opacity var(--dur-2) var(--ease-out), font-size var(--dur-2) var(--ease-out), transform var(--dur-2) var(--ease-spring);
}
.rail__item.is-empty { opacity: .5; pointer-events: none; cursor: default; }
.rail__item:hover { opacity: .8; }
.rail__item.is-active {
  font-size: 20px;
  line-height: 28px;
  font-weight: 500;
  opacity: 1;
}
.rail__line {
  position: absolute;
  left: 65px;
  top: 50%;
  width: 1px;
  height: 640px; /* 设计稿 800 高时 = 640 */
  transform: translateY(-50%);
  background: linear-gradient(180deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, .2) 14%,
    rgba(255, 255, 255, .2) 86%,
    rgba(255, 255, 255, 0) 100%);
}
.rail__dot {
  position: absolute;
  left: 60px;
  top: 50%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: top var(--dur-3) var(--ease-spring);
  pointer-events: none;
}

/* 手机：竖轨文字热区只有 16~40px 宽，手指很难点准。
   用透明伪元素把热区扩到约 44px 高、两侧各 20px 以上，不改变视觉位置 */
@media (max-width: 799px) {
  .rail__item::after {
    content: "";
    position: absolute;
    left: -22px;
    right: -28px;
    top: -11px;
    bottom: -11px;
  }
}

/* ============================== 教派 tab ============================== */

.sect {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.sect__track {
  display: flex;
  gap: 10px;
  height: 100%;
  padding: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  will-change: transform;
}
.sect__track::-webkit-scrollbar { display: none; }
.sect-card {
  position: relative;
  flex: 0 0 400px;
  width: 400px;
  height: 100%;
  overflow: hidden;
  background: #0d0d0d;
  text-align: left;
  isolation: isolate;
}
.sect-card__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.sect-card__veil {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, .3) 30%, #000 80%);
}
.sect-card__body {
  position: absolute;
  left: 80px;
  right: 80px;
  bottom: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.sect-card__head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
}
.sect-card__name {
  font-size: 28px;
  line-height: 39px;
  font-weight: 500;
  color: var(--ink);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.sect-card__rule {
  width: 100%;
  height: 1px;
  background: #fff;
  opacity: .1;
}
.sect-card__stats {
  display: flex;
  gap: 40px;
  justify-content: center;
  width: 100%;
}
.sect-stat { display: flex; flex-direction: column; align-items: center; gap: 8px; flex: none; }
.sect-stat abbr {
  font-style: normal;
  font-size: 16px;
  line-height: 22px;
  color: var(--ink);
  opacity: .5;
  text-decoration: none;
  white-space: nowrap;
}
.sect-stat b {
  font-size: 16px;
  line-height: 22px;
  font-weight: 600;
  color: var(--ink);
  text-align: center;
  white-space: nowrap;
}

/* ============================== 人物 tab ============================== */

.figure {
  position: absolute;
  inset: 0;
  overflow: hidden;
  touch-action: none;
  cursor: grab;
  -webkit-user-select: none;
  user-select: none;
}
.figure__stack {
  position: absolute;
  inset: 0;
  will-change: transform;
}
.figure__stack.is-instant { transition: none !important; }
.figure__stack.is-snap { transition: transform .62s var(--ease-out); }
.figure__row {
  position: absolute;
  left: 0;
  width: 100%;
  height: 100%;
}
.figure__track {
  position: absolute;
  left: 240px; /* 首卡避开左侧 200 宽身份竖轨 */
  /* 卡片总高 511（图 400 + 名称 39 + 简介 40 + 两处 16 间距），在视口内上下居中 */
  top: calc(50% - 256px);
  display: flex;
  gap: 100px;
  will-change: transform;
}
.figure-card {
  width: 300px;
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
  transition: opacity var(--dur-3) var(--ease-out), transform var(--dur-3) var(--ease-out);
}
.figure-card__img {
  width: 300px;
  height: 400px;
  border-radius: var(--r-lg);
  object-fit: cover;
  object-position: 50% 50%;
  background: #101010;
  -webkit-user-drag: none;
  transform: translateZ(0) scale(1);
  transition: transform .8s var(--ease-out), filter var(--dur-2);
  will-change: transform;
}
.figure-card:hover .figure-card__img { transform: scale(1.035); filter: brightness(1.06); }
.figure-card__name {
  font-size: 28px;
  line-height: 39px;
  font-weight: 500;
  color: var(--ink);
  max-width: 300px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.figure-card__intro {
  font-size: 14px;
  line-height: 20px;
  color: var(--ink-50);
  max-width: 300px;
  height: 40px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.figure-card.enter { animation: figIn .6s var(--ease-out) both; }
@keyframes figIn { from { opacity: 0; transform: translateY(45px); } to { opacity: 1; transform: none; } }

/* ============================== 壁画 tab ============================== */

.mural {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
}
.mural::-webkit-scrollbar { display: none; }
.mural__plane {
  position: relative;
  /* 宽度由 JS 按「视口宽 − 72×2 安全边距」计算列数后设定 */
  margin: 0 auto;
  min-height: 100%;
}
.mural__spacer { width: 1px; }

.mural-card {
  position: absolute;
  left: 0;
  top: 0;
  display: block;
  text-align: left;
  width: 144px;
  height: 224px;
  /* 位移用 transform 交给合成层，滚动与筛选重排都不触发布局 */
  backface-visibility: hidden;
}
.mural-card__media {
  display: block;
  width: 144px;
  height: 144px;
  border-radius: var(--r-md);
  overflow: hidden;
  background: #101010;
}
.mural-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .8s var(--ease-out), filter var(--dur-2);
  will-change: transform;
}
.mural-card:hover .mural-card__media img { transform: scale(1.06); filter: brightness(1.06); }

.mural-card__name {
  display: block;
  font-size: 14px;
  line-height: 22px;
  font-weight: 500;
  color: var(--ink);
  margin-top: 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mural-card__rows { display: block; margin-top: 8px; }
.mural-row { display: flex; align-items: flex-start; font-size: 12px; line-height: 17px; white-space: nowrap; }
.mural-row i { font-style: normal; color: var(--ink); width: 60px; flex: none; }
.mural-row b {
  font-weight: 400;
  color: var(--ink);
  opacity: .5;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 批量修改：勾选点 + 选择态描边（默认隐藏，进入选择模式后出现） */
.mural-card__tick {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .55);
  background: rgba(0, 0, 0, .35);
  opacity: 0;
  transition: opacity var(--dur-1), background-color var(--dur-1), border-color var(--dur-1);
  pointer-events: none;
}
.mural-card__tick::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 3px;
  width: 5px;
  height: 9px;
  border: solid #0d0d0d;
  border-width: 0 1.6px 1.6px 0;
  transform: rotate(42deg) scale(.6);
  opacity: 0;
  transition: opacity var(--dur-1), transform var(--dur-1) var(--ease-spring);
}
.mural.is-selecting { touch-action: none; }
.mural.is-selecting .mural-card { cursor: pointer; }
.mural.is-selecting .mural-card__tick { opacity: 1; }
.mural.is-selecting .mural-card:hover .mural-card__media img { transform: none; filter: none; }
.mural-card.is-selected .mural-card__media {
  box-shadow: inset 0 0 0 2px var(--ink), 0 0 0 2px var(--ink);
}
.mural-card.is-selected .mural-card__tick { background: var(--ink); border-color: var(--ink); }
.mural-card.is-selected .mural-card__tick::after { opacity: 1; transform: rotate(42deg) scale(1); }

.mural-marquee {
  position: fixed;
  z-index: 120;
  border: 1px solid rgba(255, 255, 255, .55);
  background: rgba(255, 255, 255, .08);
  pointer-events: none;
  border-radius: 2px;
}

/* 底部悬浮操作条：未进入选择模式时是「批量修改」，进入后变为计数 + 修改 / 取消 */
.mural-batch {
  position: absolute;
  left: 50%;
  bottom: 36px;
  transform: translateX(-50%);
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 12px;
}
.mural-batch__toggle { height: 40px; padding: 8px 20px; gap: 6px; font-size: 14px; }
.mural-batch__toggle .ico { width: 14px; height: 14px; }
.mural-batch__panel {
  display: none;
  align-items: center;
  gap: 12px;
  padding: 6px 6px 6px 20px;
  border-radius: var(--r-pill);
  background: var(--glass);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14), inset 0 1px 0 rgba(255, 255, 255, .16);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}
.mural-batch__count { font-size: 14px; line-height: 20px; color: var(--ink-80); white-space: nowrap; }
.mural-batch__apply { height: 32px; padding: 4px 18px; font-size: 14px; }
.mural-batch__cancel { height: 32px; padding: 4px 16px; font-size: 14px; }
.mural-batch.is-selecting .mural-batch__toggle { display: none; }
.mural-batch.is-selecting .mural-batch__panel { display: flex; }
.mural-batch__apply[disabled] { opacity: .4; pointer-events: none; }

/* 导航中部筛选（仅壁画 tab）：纯文本触发器，字号 14
   三块均布：左 logo / 中间筛选 / 右侧按钮；宽度不足时折叠为「筛选」菜单 */
.nav__filters {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 24px;
  flex: 0 1 auto;
  min-width: 0;
  pointer-events: auto;
}
.nav__filters.is-collapsed .filter { display: none; }
.nav__filter-toggle {
  display: none;
  align-items: center;
  gap: 4px;
  height: 20px;
  font-size: 14px;
  line-height: 20px;
  color: var(--ink);
  white-space: nowrap;
  transition: opacity var(--dur-1);
}
.nav__filter-toggle:hover { opacity: .8; }
.nav__filter-toggle .ico {
  width: 10px;
  height: 10px;
  opacity: .5;
  transition: transform var(--dur-2) var(--ease-out);
}
.nav__filters.is-collapsed .nav__filter-toggle { display: flex; }
.nav__filters.is-collapsed .nav__filter-toggle.is-open .ico { transform: rotate(180deg); }
.nav__filter-toggle.is-set::after {
  content: "";
  width: 4px;
  height: 4px;
  margin-left: 2px;
  border-radius: 50%;
  background: #fff;
}
.filter-menu {
  position: fixed;
  z-index: 300;
  width: 220px;
  padding: 8px;
  border-radius: 8px;
  background: linear-gradient(180deg, #1A1A1A 0%, #0D0D0D 100%);
  box-shadow: inset 0 0 0 1px #333, 0 24px 60px rgba(0, 0, 0, .6);
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity var(--dur-1) var(--ease-out), transform var(--dur-1) var(--ease-out);
}
.filter-menu.is-open { opacity: 1; transform: none; }
.filter-menu__opt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  height: 40px;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 20px;
  color: rgba(255, 255, 255, .5);
  text-align: left;
  transition: background-color var(--dur-1), color var(--dur-1);
}
.filter-menu__opt:hover { background: rgba(255, 255, 255, .05); color: var(--ink); }
.filter-menu__opt.is-set { color: var(--ink); }
.filter-menu__opt b {
  font-weight: 400;
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.filter-menu__opt .ico { width: 10px; height: 10px; flex: none; opacity: .5; }
body[data-tab="mural"] .nav__filters { display: flex; }
body[data-tab="mural"] .btn-enter { visibility: visible; }
.filter { position: relative; }
.filter__btn {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 20px;
  font-size: 14px;
  line-height: 20px;
  color: var(--ink);
  white-space: nowrap;
  transition: opacity var(--dur-1);
}
.filter__btn:hover { opacity: .8; }
.filter__btn span {
  max-width: 96px;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.filter__btn .ico {
  width: 10px;
  height: 10px;
  opacity: .5;
  transition: transform var(--dur-2) var(--ease-out), opacity var(--dur-1);
}
.filter.is-open .filter__btn .ico { transform: rotate(180deg); opacity: .9; }
.filter.is-set .filter__btn { color: #fff; }

/* ============================== 事件 tab ============================== */

/* 设计稿：内容区原点 (303,120)，纵向时间轴 x=492，行 144 高 + 64 间距 */
.event {
  --event-pad-l: 303px;
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.event__line {
  position: absolute;
  left: calc(var(--event-pad-l) + 189px);
  top: 80px;
  width: 1px;
  height: 640px;
  background: linear-gradient(180deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, .2) 10%,
    rgba(255, 255, 255, .2) 90%,
    rgba(255, 255, 255, 0) 100%);
  z-index: 1;
}
.event__list {
  position: relative;
  z-index: 2;
  height: 100%;
  overflow-y: auto;
  scrollbar-width: none;
  /* 右侧安全边距 48：窄窗时简介自动折行，始终与右缘保持 48 */
  padding: 120px 48px 200px var(--event-pad-l);
  scroll-behavior: smooth;
}
.event__list::-webkit-scrollbar { display: none; }
.event__inner { width: 1034px; max-width: 100%; }
/* 超宽屏：右侧安全边距放大到 120，内容区在安全边距内继续拉长 */
@media (min-width: 1600px) {
  .event__list { padding-right: 120px; }
  .event__inner { width: auto; max-width: none; }
}

.event-row {
  display: flex;
  align-items: center;
  gap: 40px;
  width: 100%;
  height: auto;
  min-height: 144px;
  margin: 0 0 64px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.event-row:last-child { margin-bottom: 0; }
.event-row__img {
  flex: none;
  width: 144px;
  height: 144px;
  border-radius: 8px;
  object-fit: cover;
  background: #101010;
  transition: transform .8s var(--ease-out);
}
.event-row:hover .event-row__img { transform: scale(1.03); }
.event-row__dot {
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: transform var(--dur-2) var(--ease-out);
}
.event-row:hover .event-row__dot { transform: scale(1.3); }
.event-row__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.event-row__head { display: flex; flex-direction: column; gap: 8px; }
.event-row__time {
  font-size: 14px;
  line-height: 20px;
  font-weight: 400;
  color: var(--ink);
  opacity: .5;
  font-variant-numeric: tabular-nums;
}
.event-row__name {
  font-size: 20px;
  line-height: 28px;
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.event-row__intro {
  font-size: 14px;
  line-height: 20px;
  color: var(--ink);
  opacity: .5;
  white-space: normal;
  overflow-wrap: break-word;
}
.event-row__meta { display: flex; gap: 50px; height: 20px; }
.event-meta {
  display: flex;
  align-items: center;
  height: 20px;
  min-width: 0;
  font-size: 12px;
  line-height: 20px;
}
.event-meta__k { flex: none; width: 60px; color: var(--ink); white-space: nowrap; }
.event-meta__v {
  color: var(--ink);
  opacity: .5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}

@keyframes eventRowIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}
.event-row.is-enter { animation: eventRowIn .55s var(--ease-out) both; }

@media (prefers-reduced-motion: reduce) {
  .event-row.is-enter { animation: none; }
  .event-row__img, .event-row__dot { transition: none; }
}

/* ============================== 寺庙 tab ============================== */

/* 真实底图：高德栅格瓦片 + 暗色滤镜；标注卡 / 落点 / 引线按屏幕坐标叠加 */
.temple {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #0b0b0b;
}
.temple__map-view {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: #0b0b0b;
  touch-action: none;
}
.leaflet-container {
  background: #0b0b0b;
  font-family: inherit;
  cursor: grab;
  outline: none;
}
.leaflet-container.leaflet-dragging { cursor: grabbing; }
.temple__map-view .leaflet-tile {
  filter: invert(1) hue-rotate(180deg) brightness(.72) saturate(.35) contrast(1.08);
}
.temple__map-view .leaflet-control-container { display: none; }

.temple__veil {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: radial-gradient(115% 88% at 50% 48%, rgba(0, 0, 0, 0) 46%, rgba(0, 0, 0, .58) 100%);
}

/* ---------- 标注卡 120×205（设计稿：标题 84×43 + 图框 120×120 + 尾切图 56×30） ---------- */
.temple__cards {
  position: absolute;
  inset: 0;
  z-index: 6;
  overflow: hidden;
  pointer-events: none;
}
.temple-card {
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 120px;
  height: 175px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  text-align: center;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  -webkit-tap-highlight-color: transparent;
  will-change: transform, opacity;
  transition: opacity var(--dur-2) var(--ease-out);
}
.temple.is-cards .temple-card { opacity: 1; pointer-events: auto; }
/* 抽稀/移出视口的卡片：只做渐隐，避免拖动时突然消失 */
.temple.is-cards .temple-card.is-hidden { opacity: 0; pointer-events: none; }
.temple.is-zooming .temple-card { opacity: 0; transition: opacity .12s linear; }

.temple-card__title {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 84px;
  height: 43px;
  flex: none;
}
.temple-card__name {
  width: 84px;
  height: 22px;
  font-size: 16px;
  line-height: 22px;
  font-weight: 500;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 0 12px rgba(0, 0, 0, .9);
}
.temple-card__year {
  width: 84px;
  height: 17px;
  font-size: 12px;
  line-height: 20px;
  color: rgba(255, 255, 255, 1);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 10px rgba(0, 0, 0, .95);
}
.temple-card__year b { font-weight: 400; color: rgba(255, 255, 255, .5); }

.temple-card__frame {
  position: relative;
  display: block;
  width: 120px;
  height: 120px;
  flex: none;
}
.temple-card__img {
  display: block;
  width: 120px;
  height: 120px;
  border: 1px solid #fff;
  border-radius: 8px;
  box-sizing: border-box;
  object-fit: cover;
  background: #101010;
  transition: transform .6s var(--ease-out), filter var(--dur-2) var(--ease-out);
  will-change: transform;
}
.temple-card:hover .temple-card__img { transform: scale(1.04); filter: brightness(1.08); }

/* 图外三角切图：用户切图 64×32，展示 56×30，固定居中于卡片，不做任何横向补差 */
.temple-card__tail {
  position: absolute;
  left: 50%;
  top: 100%;
  width: 56px;
  height: 30px;
  margin-left: -28px;
  background: url("../assets/design/temple-tail-arrow.png") center / 100% 100% no-repeat;
  pointer-events: none;
}
/* 卡片落到落点下方：切图整体 180° 翻转，尖端朝上 */
.temple-card.is-flip { flex-direction: column-reverse; }
.temple-card.is-flip .temple-card__tail {
  top: auto;
  bottom: 100%;
  transform: rotate(180deg);
}
.temple-card:focus-visible,

/* ---------- 控件 / 提示 ---------- */
.temple__ctrl {
  position: absolute;
  right: 40px;
  bottom: 40px;
  z-index: 7;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.temple__zoom {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: var(--ink);
  background: var(--glass);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  transition: background-color var(--dur-1) var(--ease-out), transform var(--dur-2) var(--ease-spring);
}
.temple__zoom:hover { background: var(--glass-hover); }
.temple__zoom:active { transform: scale(.92); }
.temple__hint {
  position: absolute;
  left: 40px;
  bottom: 40px;
  z-index: 7;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 18px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, .06);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  font-size: 14px;
  line-height: 20px;
  color: var(--ink-80);
  pointer-events: none;
}
.temple__hint .ico { opacity: .55; }
/* 搜索无结果提示：浮在地图中央，不拦截拖拽 */
.temple__empty {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 8;
  transform: translate(-50%, -50%);
  padding: 14px 28px;
  border-radius: var(--r-pill);
  background: rgba(26, 26, 26, .9);
  box-shadow: inset 0 0 0 1px var(--ink-10);
  font-size: 14px;
  line-height: 20px;
  color: var(--ink-60);
  white-space: nowrap;
  pointer-events: none;
}
.temple__empty[hidden] { display: none; }
.temple__credit {
  position: absolute;
  left: 44px;
  bottom: 92px;
  z-index: 6;
  font-size: 12px;
  line-height: 16px;
  color: rgba(255, 255, 255, .28);
  pointer-events: none;
  transition: opacity var(--dur-2) var(--ease-out);
}

/* ============================== 补充：人物分组 ============================== */

/* 人物轨道：两组相同卡片无缝循环 */
.figure__group { display: flex; gap: 100px; flex: none; }
.figure__track { gap: 100px; }
.figure.is-dragging { cursor: grabbing; }
.figure.is-dragging * { pointer-events: none; user-select: none; }

/* 诊断开关：?perf=nowc 关闭卡片常驻合成层，默认访问不受影响 */
html.perf-nowc .sect__track,
html.perf-nowc .figure__stack,
html.perf-nowc .figure__track,
html.perf-nowc .figure-card__img,
html.perf-nowc .mural-card__media img,
html.perf-nowc .temple-card,
html.perf-nowc .temple-card__img {
  will-change: auto;
}
html.perf-nowc .figure-card__img { transform: none; }

/* 诊断开关：?perf=flat 关闭逐卡合成层，?perf=noblur 关闭毛玻璃，?perf=nodrift 关闭无限动画 */
html.perf-flat .sect__track,
html.perf-flat .figure__stack,
html.perf-flat .figure__track,
html.perf-flat .figure-card__img,
html.perf-flat .mural-card__media img,
html.perf-flat .temple-card,
html.perf-flat .temple-card__img {
  will-change: auto;
}
html.perf-flat .figure-card__img { transform: none; }
html.perf-noblur * { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
html.perf-nodrift * { animation: none !important; }
.temple__nodiag {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, .7);
  font-size: 14px;
  letter-spacing: .1em;
}
