/* ==========================================================================
   五个 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;
  transform: translateZ(0) scale(1);
  transition: transform .8s var(--ease-out), filter var(--dur-2);
  will-change: transform;
}
.sect-card:hover .sect-card__img { transform: scale(1.035); filter: brightness(1.06); }
.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;
}

/* 桌面档位：400(设计稿) → 380 → 360 → 320，逐档收卡宽与内边距，
   让 800–1439 之间也有过渡，不会从手机档位直接跳到 1440 设计稿 */
@media (min-width: 800px) and (max-width: 1023px) {
  .sect-card { flex-basis: 320px; width: 320px; }
  .sect-card__body { left: 40px; right: 40px; bottom: 64px; gap: 14px; }
  .sect-card__name { font-size: 26px; line-height: 36px; }
  .sect-card__stats { gap: 24px; }
  .sect-stat { width: auto !important; }
  .sect-stat abbr, .sect-stat b { font-size: 14px; line-height: 20px; }
}

@media (min-width: 1024px) and (max-width: 1199px) {
  .sect-card { flex-basis: 360px; width: 360px; }
  .sect-card__body { left: 56px; right: 56px; bottom: 72px; gap: 14px; }
  .sect-card__name { font-size: 27px; line-height: 38px; }
  .sect-card__stats { gap: 30px; }
  .sect-stat { width: auto !important; }
  .sect-stat abbr, .sect-stat b { font-size: 15px; line-height: 21px; }
}

@media (min-width: 1200px) and (max-width: 1439px) {
  .sect-card { flex-basis: 380px; width: 380px; }
  .sect-card__body { left: 68px; right: 68px; bottom: 76px; }
  .sect-card__stats { gap: 34px; }
  .sect-stat { width: auto !important; }
}

/* 手机：教派卡按视口收窄（最多 320，窄屏 60vw），与桌面最窄档 320 对齐，
   跨 800 时卡宽不跳；
   对应收小卡内边距、名称与字段，避免三列统计挤出卡片 */
@media (max-width: 799px) {
  body[data-tab="sect"] { min-width: 0; }
  .sect-card { flex-basis: min(320px, 60vw); width: min(320px, 60vw); }
  .sect-card__body { left: 20px; right: 20px; bottom: 56px; gap: 12px; }
  .sect-card__name { font-size: 24px; line-height: 34px; }
  .sect-card__stats { gap: 16px; }
  .sect-stat { width: auto !important; }
  .sect-stat abbr, .sect-stat b { font-size: 13px; line-height: 18px; }
}

/* 小手机（卡宽 < 300）：标题/字段与卡内边距再压一档 */
@media (max-width: 479px) {
  .sect-card__body { left: 14px; right: 14px; bottom: 40px; gap: 10px; }
  .sect-card__name { font-size: 20px; line-height: 28px; }
  .sect-card__stats { gap: 10px; }
  .sect-stat abbr, .sect-stat b { font-size: 12px; line-height: 16px; }
}

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

/* 纯黑底：卡片图多为黑底器物照，避免背景灰度让图片边缘显出色差 */
#view-deity { background: #000; }

.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);
  -webkit-tap-highlight-color: transparent;
  outline: none;
}
.figure-card__img {
  width: 300px;
  height: 400px;
  border-radius: var(--r-lg);
  object-fit: cover;
  object-position: 50% 50%;
  background: #000;
  -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__title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  max-width: 300px;
}
.figure-card__name {
  font-size: 28px;
  line-height: 39px;
  font-weight: 500;
  color: var(--ink);
  max-width: 300px;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* 有 360° 视频的卡片角标：设计稿 47:14346「360°旋转」金渐变胶囊 58×18 / r2 / 12px */
.figure-card__3d {
  flex: none;
  width: 58px;
  height: 18px;
  border-radius: 2px;
  background: linear-gradient(270deg, #B58A53 0%, #FFD586 99%);
  color: #080808;
  font-size: 12px;
  line-height: 18px;
  font-weight: 500;
  text-align: center;
  white-space: nowrap;
}
.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; }
/* 手机：壁画 / 历史按可见视口排版，body 不再撑到 800，一屏放得下，不用右滑 */
@media (max-width: 799px) {
  body[data-tab="mural"],
  body[data-tab="history"] { min-width: 0; }
}
.mural__plane {
  position: relative;
  /* 宽度由 JS 按「视口宽 − 安全边距×2」计算列数后设定：
     大屏 120 / 800–1099 为 40 / 手机目标 56（为放下两列可收到 20 多），图间距 16–48，窄屏折列不横滚 */
  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 {
  /* 图片左缘 = 竖轨文字右缘（左 90 + 高亮两字 20px ≈ 130）+ 右侧安全边距，
     两侧留白随屏宽保持一致；手机最小态在 ≤799 单独保留 88 布局 */
  --event-rail-edge: 130px;
  --event-safe-r: 48px;
  --event-pad-l: calc(var(--event-rail-edge) + var(--event-safe-r));
  --event-img: 144px;
  --event-gap: 40px;
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.event__line {
  position: absolute;
  left: calc(var(--event-pad-l) + var(--event-img) + var(--event-gap) + 5px);
  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;
}
/* 图片左缘贴近竖轨时，让竖轨底板不挡住图片左侧的点击；文字项仍可点 */
body[data-tab="history"] .rail { pointer-events: none; }
body[data-tab="history"] .rail__list { pointer-events: auto; }
.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: auto; max-width: none; }
/* 超宽屏：左右安全边距同步放大到 120，左侧间距仍与右侧一致 */
@media (min-width: 1600px) {
  .event { --event-safe-r: 120px; }
  .event__list { padding-right: 120px; }
}

.event-row {
  display: flex;
  align-items: center;
  gap: var(--event-gap);
  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: var(--event-img);
  height: var(--event-img);
  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; }
}

/* 手机：历史列表按可见视口排版，压缩左轨与行距，文字在右侧自动折行 */
@media (max-width: 799px) {
  .event {
    --event-pad-l: 88px;
    --event-img: 88px;
    --event-gap: 16px;
  }
  .event__list { padding: 104px 24px 160px var(--event-pad-l); }
  .event__inner { width: auto; max-width: none; }
  .event-row { min-height: 88px; margin-bottom: 40px; }
  /* 窄屏文本列只有 150～190 宽，长简介不截断会把每行撑到 400px；列表里保留 3 行，全文进详情看 */
  .event-row__intro {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
  }
  .event-row__meta { flex-direction: column; gap: 4px; height: auto; }
  .event-meta { height: auto; }
  .event-meta__v { max-width: none; white-space: normal; }

  /* 左轨收窄到 96：去掉 200 宽渐变面板，文字/线/圆点一起左移，给列表腾出宽度 */
  body[data-tab="history"] .rail { width: 96px; }
  body[data-tab="history"] .rail::before { display: none; }
  body[data-tab="history"] .rail__list { left: 36px; }
  body[data-tab="history"] .rail__line { left: 22px; }
  body[data-tab="history"] .rail__dot { left: 17px; }
}

/* ============================== 寺庙 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__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; }
/* 每排最后一张卡右侧留 80px，滑到尽头时不贴视口右缘（measureRow 按 offsetWidth 计入） */
.figure__group .figure-card:last-child { margin-right: 80px; }
.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;
}

/* 手机：神明取消整页 800 画布，竖轨 200→64、轨道起点 240→72、卡间距 100→24；
   卡宽最多 300，更窄的屏按 100vw-88 等比收（左右安全边距约 72/16），高度随宽度保持 3:4 */
@media (max-width: 799px) {
  body[data-tab="deity"] { min-width: 0; }
  .figure { --fig-w: min(300px, calc(100vw - 88px)); }
  .figure-card { width: var(--fig-w); }
  .figure-card__img { width: var(--fig-w); height: auto; aspect-ratio: 3 / 4; }
  .figure-card__title, .figure-card__name, .figure-card__intro { max-width: var(--fig-w); }
  .figure__track {
    left: 72px;
    gap: 24px;
    top: calc(50% - (var(--fig-w) * 4 / 3 + 111px) / 2);
  }
  .figure__group { gap: 24px; }
  .figure__group .figure-card:last-child { margin-right: 24px; }
  body[data-tab="deity"] .rail { width: 64px; }
  body[data-tab="deity"] .rail::before { display: none; }
  /* 与历史轨道（36/22/17）统一左偏移，文字左缘对齐 */
  body[data-tab="deity"] .rail__list { left: 36px; }
  body[data-tab="deity"] .rail__line { left: 22px; }
  body[data-tab="deity"] .rail__dot { left: 17px; }
}
