/* ==========================================================================
   观·藏密壁画 — design tokens & shell
   设计基准：1920×1080（MasterGo），PingFang SC
   ========================================================================== */

:root {
  /* color */
  --bg: #000000;
  --bg-raise: #1A1A1A;
  --ink: #FFFFFF;
  --ink-80: rgba(255, 255, 255, .8);
  --ink-60: rgba(255, 255, 255, .6);
  --ink-50: rgba(255, 255, 255, .5);
  --ink-40: rgba(255, 255, 255, .4);
  --ink-30: rgba(255, 255, 255, .3);
  --ink-20: rgba(255, 255, 255, .2);
  --ink-10: rgba(255, 255, 255, .1);
  --ink-06: rgba(255, 255, 255, .06);
  --glass: rgba(255, 255, 255, .1);
  --glass-hover: rgba(255, 255, 255, .17);
  --glass-active: rgba(255, 255, 255, .24);
  /* effect_13:6848 设计稿玻璃效果 */
  --glass-blur: blur(20px) saturate(140%);
  --danger: #FF4D4F;
  --req: #FF0000;

  /* radius */
  --r-pill: 100px;
  --r-lg: 20px;
  --r-md: 8px;
  --r-sm: 4px;

  /* layout */
  --nav-h: 80px;
  --pad-x: 48px;
  --card-w: 480px;
  --card-gap: 10px;

  /* type */
  --font: "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Microsoft YaHei", system-ui, -apple-system, sans-serif;

  /* motion */
  --ease-out: cubic-bezier(.22, .61, .36, 1);
  --ease-in-out: cubic-bezier(.65, .05, .36, 1);
  --ease-spring: cubic-bezier(.34, 1.35, .44, 1);
  --dur-1: .22s;
  --dur-2: .38s;
  --dur-3: .58s;
  --dur-4: .86s;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overscroll-behavior: none;
}
/* 视口比设计稿窄时横向可滚，不做缩小 */
html { overflow-x: auto; overflow-y: hidden; }

body {
  /* 设计基准 1440：1 设计 px = 1 CSS px，不缩放；窄于 800 时横向滚动 */
  position: relative;
  width: 100%;
  min-width: 800px;
  height: 100%;
  margin: 0 auto;
  overflow: hidden;
  background:
    radial-gradient(110% 90% at 50% 42%, #1A1A1A 0%, #0a0a0a 55%, #000 100%);
}

img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
input, textarea, select { font: inherit; color: inherit; }
::selection { background: rgba(255, 255, 255, .22); }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ico { width: 20px; height: 20px; flex: none; display: block; }
.ico--16 { width: 16px; height: 16px; }
.ico--20 { width: 20px; height: 20px; }
.ico--24 { width: 24px; height: 24px; }
.ico--28 { width: 28px; height: 28px; }
.ico--40 { width: 40px; height: 40px; opacity: .35; }

/* scrollbars */
* { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.18) transparent; }
*::-webkit-scrollbar { width: 6px; height: 6px; }
*::-webkit-scrollbar-thumb { background: rgba(255,255,255,.16); border-radius: 10px; }
*::-webkit-scrollbar-track { background: transparent; }

/* ==========================================================================
   Navigation
   ========================================================================== */

.nav {
  position: absolute;
  inset: 0 0 auto 0;
  height: var(--nav-h);
  /* 设计稿 47:08574：左右 48 安全边距 */
  padding: 0 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  column-gap: 24px;
  z-index: 60;
  pointer-events: none;
  /* 导航固定在视口上：点按时的横向抖动不允许带动整页横向平移，
     否则一点 tab 整个舞台就被推走、竖轨也滑出屏幕 */
  touch-action: pan-y;
}
/* touch-action 不继承且固定定位下祖先值不生效，交互元素上要各自声明 */
.nav button,
.nav a,
.nav input { touch-action: pan-y; }
.nav::before {
  content: "";
  position: absolute;
  inset: 0;
  background: #000;
  z-index: -1;
}
.nav::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 40px;
  background: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, .8) 50%, transparent 100%);
  pointer-events: none;
  z-index: -1;
}
.nav__left { display: flex; align-items: center; gap: 16px; min-width: 0; flex: 0 1 auto; pointer-events: auto; }

.brand { display: flex; align-items: center; gap: 8px; flex: none; }
.brand__logo { width: 32px; height: 32px; object-fit: contain; flex: none; }
.brand__name {
  flex: none;
  font-size: 20px;
  font-weight: 600;
  line-height: 32px;
  letter-spacing: .01em;
  white-space: nowrap;
  word-break: keep-all;
}

.nav__tabs {
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}

/* 导航搜索（壁画 / 寺庙 tab）：200×36 胶囊，#1A1A1A，16 图标 + 14 文字 */
.nav-search {
  display: none;
  align-items: center;
  gap: 4px;
  flex: none;
  width: 200px;
  height: 36px;
  padding: 0 12px;
  border-radius: var(--r-pill);
  background: #1A1A1A;
  pointer-events: auto;
}
body[data-tab="mural"] .nav-search,
body[data-tab="temple"] .nav-search { display: flex; }
.nav-search__ico {
  flex: none;
  display: block;
  width: 16px;
  height: 16px;
  opacity: .5;
}
.nav-search__input {
  flex: 1;
  min-width: 0;
  height: 20px;
  padding: 0;
  border: 0;
  outline: none;
  background: none;
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 20px;
}
.nav-search__input::placeholder { color: var(--ink); opacity: .5; }
.nav-search__input::-webkit-input-placeholder { color: var(--ink); opacity: .5; }
.nav__tabs::-webkit-scrollbar { display: none; }
.nav__tab {
  position: relative;
  z-index: 1;
  height: 38px;
  padding: 8px 20px;
  border-radius: var(--r-pill);
  font-size: 16px;
  line-height: 22px;
  font-weight: 400;
  color: var(--ink);
  white-space: nowrap;
  transition: color var(--dur-1) var(--ease-out), background-color var(--dur-2) var(--ease-out), opacity var(--dur-1);
}
.nav__tab:hover { opacity: .8; }
.nav__tab.is-active { color: var(--ink); background: transparent; opacity: 1; }
.nav__glider {
  position: absolute;
  top: 0;
  left: 0;
  height: 38px;
  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);
  transition: transform var(--dur-3) var(--ease-spring), width var(--dur-3) var(--ease-spring);
  pointer-events: none;
}
body.is-booting .nav__glider { transition: none; }

/* 切换 tab 时玻璃框描边「放大再收回」 */
.nav__glider-ring {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px solid rgba(255, 255, 255, .6);
  opacity: 0;
  pointer-events: none;
}
.nav__glider.is-pulse .nav__glider-ring {
  animation: gliderPulse .66s var(--ease-out) both;
}
@keyframes gliderPulse {
  0% { transform: scale(1); opacity: .55; }
  46% { transform: scale(1.09); opacity: .34; }
  100% { transform: scale(1); opacity: 0; }
}

/* glass buttons */
.btn-glass {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 8px 24px;
  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);
  font-size: 16px;
  line-height: 22px;
  font-weight: 400;
  color: var(--ink);
  white-space: nowrap;
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  transition: background-color var(--dur-2) var(--ease-out), transform var(--dur-2) var(--ease-spring);
}
.btn-glass:hover { background: var(--glass-hover); }
.btn-glass:active { transform: scale(.97); background: var(--glass-active); }
.btn-glass--quiet { color: var(--ink-80); }
.btn-glass--danger { background: rgba(255,77,79,.16); }
.btn-glass--danger:hover { background: rgba(255,77,79,.28); }
/* 右侧操作组：搜索 + 下载 + 录入，设计稿 47:08053 间距 16、高 36 */
.nav__actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: none;
  pointer-events: auto;
}
.btn-enter {
  flex: none;
  pointer-events: auto;
  height: 36px;
  padding: 8px 20px;
  gap: 4px;
  font-size: 14px;
  line-height: 20px;
  /* 设计稿 47:08640：1px 20% 白描边胶囊，无底色 */
  background: transparent;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .2);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.btn-enter:hover { background: rgba(255, 255, 255, .06); }
.btn-enter:active { background: rgba(255, 255, 255, .12); }
.btn-enter .ico { width: 14px; height: 14px; }
/* 下载：设计稿 47:08053 —— 1px 20% 白描边胶囊，无底色 */
.btn-export {
  flex: none;
  pointer-events: auto;
  height: 36px;
  padding: 8px 20px;
  border-radius: var(--r-pill);
  background: transparent;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .2);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  font-size: 14px;
  line-height: 20px;
}
.btn-export:hover { background: rgba(255, 255, 255, .06); }
.btn-export:active { background: rgba(255, 255, 255, .12); }
.btn-export[disabled] { opacity: .45; pointer-events: none; }
/* 账号：与下载/录入同为 36 高 1px 20% 白描边胶囊，登录前后描边保持一致 */
.btn-account {
  flex: none;
  pointer-events: auto;
  height: 36px;
  padding: 8px 20px 8px 18px;
  gap: 4px;
  border-radius: var(--r-pill);
  background: transparent;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .2);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  font-size: 14px;
  line-height: 20px;
}
.btn-account:hover { background: rgba(255, 255, 255, .06); }
.btn-account:active { background: rgba(255, 255, 255, .12); }
.btn-account .ico { width: 18px; height: 18px; }
/* hidden 属性会被 .btn-glass 的 display 覆盖，这里明确兜底 */
.btn-glass[hidden] { display: none !important; }

/* 加功德：搜索左侧的木鱼按钮，点击下压回弹，+1 从图标处上浮消散 */
.merit {
  position: relative;
  flex: none;
  pointer-events: auto;
  height: 36px;
  padding: 8px 14px;
  gap: 6px;
  font-size: 14px;
  line-height: 20px;
  background: transparent;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .2);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.merit:hover { background: rgba(255, 255, 255, .06); }
.merit:active { background: rgba(255, 255, 255, .12); }
.merit__ico {
  width: 20px;
  height: 20px;
  color: #E3C07C;
  overflow: visible;
}
.merit__ico .pw-swing,
.merit__ico .pw-tube { will-change: transform; }
.merit__label { white-space: nowrap; }
.merit__count {
  min-width: 1ch;
  font-weight: 400;
  color: #E3C07C;
  font-variant-numeric: tabular-nums;
}
/* 锚点对准转经筒图标中心（14 padding + 10），圈与 +1 都从这里长出来 */
.merit__fx {
  position: absolute;
  left: 24px;
  top: 18px;
  width: 0;
  height: 0;
  pointer-events: none;
  z-index: 2;
}
.merit__plus {
  position: absolute;
  left: -8px;
  top: 0;
  font-size: 14px;
  line-height: 16px;
  font-weight: 600;
  color: #F0CE8C;
  white-space: nowrap;
  text-shadow: 0 1px 6px rgba(0, 0, 0, .75);
  animation: meritPlus 1s var(--ease-out) forwards;
  will-change: transform, opacity;
}
.merit__ring {
  position: absolute;
  left: -9px;
  top: -9px;
  width: 18px;
  height: 18px;
  border: 1px solid rgba(240, 206, 140, .85);
  border-radius: 50%;
  animation: meritRing .52s var(--ease-out) forwards;
}
@keyframes meritPlus {
  0% { opacity: 0; transform: translate3d(0, 6px, 0) scale(.7); }
  14% { opacity: 1; transform: translate3d(0, 0, 0) scale(1.06); }
  68% { opacity: 1; }
  100% { opacity: 0; transform: translate3d(0, -38px, 0) scale(1.12); }
}
@keyframes meritRing {
  0% { transform: scale(.55); opacity: .85; }
  100% { transform: scale(2); opacity: 0; }
}

/* 登录 / 注册弹窗（设计稿 144:8949）
   580×334：32 内边距、标题与表单 32、行间 12、标签 56 + 输入 448、
   输入 40 高、底部 100 圆角玻璃按钮 */
.auth-modal .modal__panel { width: 580px; }
.auth-body { display: block; }
.modal__body.auth-body { margin-top: 32px; overflow: visible; }
.auth-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.auth-row:last-of-type { margin-bottom: 0; }
.auth-row[hidden] { display: none; }
.auth-row__label {
  width: 56px;
  flex: none;
  font-size: 14px;
  line-height: 20px;
  color: var(--ink);
  white-space: nowrap;
}
.auth-row__label i { font-style: normal; color: var(--req); }
.auth-input { position: relative; display: block; flex: 1 1 auto; min-width: 0; }
.auth-input input {
  width: 100%;
  height: 40px;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  background: rgba(0, 0, 0, .5);
  padding: 11px 12px;
  font-size: 14px;
  line-height: 18px;
  color: var(--ink);
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color var(--dur-1) var(--ease-out), background-color var(--dur-1);
}
.auth-input input::placeholder { color: var(--ink-30); }
.auth-input input:focus { border-color: rgba(255, 255, 255, .34); background: rgba(0, 0, 0, .62); }
.auth-input input:-webkit-autofill,
.auth-input input:-webkit-autofill:hover {
  -webkit-text-fill-color: var(--ink);
  -webkit-box-shadow: 0 0 0 1000px rgba(0, 0, 0, .5) inset;
  caret-color: var(--ink);
  transition: background-color 9999s ease-in-out 0s;
}
.auth-input input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px rgba(0, 0, 0, .62) inset;
}
.auth-input input:autofill {
  -webkit-text-fill-color: var(--ink);
  box-shadow: 0 0 0 1000px rgba(0, 0, 0, .5) inset;
  caret-color: var(--ink);
  transition: background-color 9999s ease-in-out 0s;
}
.auth-input input:autofill:focus {
  box-shadow: 0 0 0 1000px rgba(0, 0, 0, .62) inset;
}
#authNick { padding-right: 52px; }
.auth-count {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-style: normal;
  font-size: 12px;
  line-height: 17px;
  color: var(--ink-30);
  pointer-events: none;
}
.auth-error { margin: 12px 0 0; font-size: 13px; line-height: 18px; color: #FF8080; }
.auth-error[hidden] { display: none; }
.auth-error.is-ok { color: #8FD18F; }
.auth-foot .modal__submit {
  height: 40px;
  border-radius: 100px;
  font-size: 16px;
  line-height: 22px;
  font-weight: 500;
}
.auth-switch-line {
  margin: 16px 0 0;
  font-size: 12px;
  line-height: 17px;
  color: var(--ink-30);
  text-align: center;
}
.auth-switch {
  padding: 0 4px;
  font-size: 12px;
  line-height: 17px;
  color: var(--ink-80);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.auth-switch:hover { color: var(--ink); }

/* 宽度不足时的让位顺序（与显示优先级相反）：下载 → 录入 → 站名 → 搜索 → 筛选 → 加功德。
   由 js/main.js 的 NavFit 按实测宽度逐步加类；logo / 账号 / tab 永不隐藏，
   「文字收成图标」「筛选收成胶囊」等既有适配照旧由媒体查询负责。 */
.nav.is-drop-export .btn-export,
.nav.is-drop-enter .btn-enter,
.nav.is-drop-merit .merit,
.nav.is-drop-name .brand__name,
.nav.is-drop-search .nav-search,
.nav.is-drop-filters .nav__filters { display: none !important; }
/* NavFit 量宽：临时取消伸缩、按自然宽度铺开，量完立即移除（不产生可见帧） */
.nav.is-measuring .nav__left,
.nav.is-measuring .nav__tabs,
.nav.is-measuring .nav__filters,
.nav.is-measuring .nav__actions { flex: none; }
.nav.is-measuring .nav__tabs { overflow: visible; }
.nav.is-measuring .nav__tab { flex: none; }

/* 中等宽度：右侧操作组（加功德/搜索/下载/录入/账号）间距略收，给 tab 条留余量 */
@media (max-width: 1200px) {
  .nav__actions { gap: 12px; }
}
/* 窄窗：导航三块继续均布，收紧 tab / 按钮的横向留白，保证 tab 与右侧按钮同时可见 */
@media (max-width: 1100px) {
  .nav__tab { padding-left: 12px; padding-right: 12px; }
  .nav__left { gap: 16px; }
  .btn-enter { padding-left: 16px; padding-right: 16px; }
}
/* 视口小于 800（内容保留 800 最小宽横向滚动）时，导航固定在视口上，
   右侧「录入」按钮始终贴视口右缘 48px，不被 body 最小宽挤出屏幕 */
@media (max-width: 799px) {
  .nav { position: fixed; }
}
/* 手机视口：收紧导航边距，tab 条占剩余空间并可横滑；
   站名 / 搜索 / 下载 是否保留不在这里一刀切，交给 NavFit 按优先级让位 */
@media (max-width: 799px) {
  .nav { padding: 0 12px; column-gap: 8px; }
  .nav__left { flex: 1 1 auto; gap: 8px; }
  /* 5 个 tab 平分剩余宽度：等分后「寺庙 / 壁画」不会被挤出可视区，
     也不会被右侧「录入」按钮压住导致点错 */
  .nav__tabs { flex: 1 1 auto; gap: 0; }
  .nav__tab { flex: 1 1 0; padding-left: 0; padding-right: 0; }
  .nav__actions { gap: 8px; }
  .nav__actions .btn-glass { padding-left: 14px; padding-right: 14px; }
  /* 手机宽度下「筛选」固定收成一枚胶囊（点开仍是同一组筛选），
     并在所有 tab 上占位（壁画 tab 才可见），避免切到壁画时 tab 条突然缩短 */
  .nav .nav__filters { display: flex; visibility: hidden; }
  .nav__filters .filter { display: none !important; }
  .nav__filters .nav__filter-toggle { display: flex; }
  body[data-tab="mural"] .nav__filters { visibility: visible; }
  /* 手机宽度下搜索框沿用旧适配直接隐藏，宽度让给 tab；800px 以上才按优先级让位 */
  .nav-search { display: none !important; }
  /* 录入 / 下载 / 站名不在这里写死，统一交给 NavFit 按优先级让位 */
  /* 账号收成 36px 图标，访客只看到它，不挤占 tab 条 */
  .nav__actions .btn-account { width: 36px; padding-left: 0; padding-right: 0; justify-content: center; }
  .btn-account #accountLabel { display: none; }
}

/* 访客只读：批量修改入口一律不出现 */
body[data-role="guest"] .mural-batch { display: none; }

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: var(--ink-80);
  transition: background-color var(--dur-1) var(--ease-out), color var(--dur-1), transform var(--dur-2) var(--ease-spring);
}
.btn-icon:hover { background: var(--ink-10); color: var(--ink); }
.btn-icon:active { transform: scale(.92); }

/* ==========================================================================
   可搜索下拉（弹窗选择器 / 壁画导航筛选共用）
   设计稿 47:08053 组 298 · 320×344 · 渐变 #1A1A1A→#0D0D0D · 1px #333 · r8
   搜索框 304×40 r4 · 选项行 304×40 · 文字 14/20 · 选中行 r4
   ========================================================================== */
.sel-pop {
  position: fixed;
  z-index: 300;
  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);
}
.sel-pop.is-open { opacity: 1; transform: none; }
.sel-pop__search {
  position: relative;
  height: 40px;
  border-radius: 4px;
  background: rgba(0, 0, 0, .5);
  overflow: hidden;
}
.sel-pop__input {
  width: 100%;
  height: 40px;
  border: 0;
  outline: none;
  background: transparent;
  padding: 9px 12px;
  font-size: 14px;
  line-height: 20px;
  color: var(--ink);
}
.sel-pop__input::placeholder { color: rgba(255, 255, 255, .3); }
.sel-pop__list {
  margin-top: 8px;
  max-height: 280px;
  overflow-y: auto;
  /* 人物/寺庙可达上百项，保留细滚动条提示还有更多选项 */
  padding-right: 4px;
}
.sel-pop__list::-webkit-scrollbar { width: 6px; height: 6px; }
.sel-pop__list::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .22); border-radius: 10px; }
.sel-pop__opt {
  display: flex;
  align-items: center;
  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;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background-color var(--dur-1), color var(--dur-1), border-radius var(--dur-1);
}
.sel-pop__opt:hover,
.sel-pop__opt.is-cursor { background: rgba(255, 255, 255, .05); color: var(--ink); }
.sel-pop__label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.sel-pop__count { flex: none; margin-left: 12px; font-size: 12px; color: rgba(255, 255, 255, .3); font-variant-numeric: tabular-nums; }
.sel-pop__opt.is-active .sel-pop__count { color: rgba(255, 255, 255, .5); }
.sel-pop__opt.is-active { background: rgba(255, 255, 255, .05); color: var(--ink); border-radius: 4px; }
.sel-pop__empty {
  padding: 16px 12px;
  font-size: 14px;
  line-height: 20px;
  color: rgba(255, 255, 255, .3);
  text-align: center;
}

/* ==========================================================================
   Stage & views
   ========================================================================== */

.stage { position: absolute; inset: 0; overflow: hidden; }

.view {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate3d(0, 18px, 0);
  transition:
    opacity var(--dur-3) var(--ease-out),
    transform var(--dur-3) var(--ease-out),
    visibility 0s linear var(--dur-3);
  will-change: opacity, transform;
}
.view.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: none;
  transition:
    opacity var(--dur-3) var(--ease-out),
    transform var(--dur-3) var(--ease-out),
    visibility 0s;
}
.view.is-leaving { transform: translate3d(0, -10px, 0); }

/* entrance stagger helper */
.view.is-active .rise { animation: riseIn var(--dur-3) var(--ease-out) both; }
@keyframes riseIn {
  from { opacity: 0; transform: translate3d(0, 26px, 0); }
  to { opacity: 1; transform: none; }
}

/* empty / loading */
.state {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  text-align: center;
  color: var(--ink-50);
  padding: 0 24px;
  z-index: 3;
}
.state__title { margin: 0; font-size: 28px; font-weight: 500; color: var(--ink-80); letter-spacing: .02em; }
.state__text { margin: 0; font-size: 16px; line-height: 26px; max-width: 460px; }
.state__hint { margin: 0; font-size: 14px; color: var(--ink-30); }
.state .btn-glass { margin-top: 10px; height: 44px; font-size: 16px; }

/* skeleton shimmer */
.skeleton {
  position: relative;
  overflow: hidden;
  background: rgba(255,255,255,.04);
}
.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.08), transparent);
  animation: shimmer 1.8s var(--ease-in-out) infinite;
}
@keyframes shimmer { to { transform: translateX(100%); } }

/* toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 48px;
  transform: translate3d(-50%, 24px, 0);
  padding: 12px 22px;
  border-radius: var(--r-pill);
  background: rgba(26,26,26,.92);
  border: 1px solid var(--ink-10);
  backdrop-filter: blur(18px);
  font-size: 14px;
  color: var(--ink-80);
  opacity: 0;
  pointer-events: none;
  z-index: 200;
  transition: opacity var(--dur-2) var(--ease-out), transform var(--dur-2) var(--ease-spring);
}
.toast.is-show { opacity: 1; transform: translate3d(-50%, 0, 0); }

/* 同步状态提示条：只在本地文件模式或保存失败时出现 */
.sync-warning {
  position: fixed;
  left: 50%;
  top: 96px;
  transform: translate3d(-50%, -12px, 0);
  display: flex;
  align-items: center;
  gap: 12px;
  width: max-content;
  max-width: calc(100vw - 32px);
  padding: 10px 16px;
  border-radius: var(--r-pill);
  background: rgba(64, 24, 24, .88);
  border: 1px solid rgba(255, 120, 120, .32);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  font-size: 13px;
  line-height: 20px;
  color: rgba(255, 240, 240, .92);
  opacity: 0;
  pointer-events: none;
  /* 详情浮层 120 / 下拉确认 300–400 之上：提示条被盖住时看得到点不到 */
  z-index: 500;
  transition: opacity var(--dur-2) var(--ease-out), transform var(--dur-2) var(--ease-out);
}
/* 提示条只让自身按钮可点，整条胶囊不得吞掉页面点击（弹窗内的删除按钮等） */
.sync-warning.is-on { opacity: 1; transform: translate3d(-50%, 0, 0); }
.sync-warning.is-on .sync-warning__link,
.sync-warning.is-on .sync-warning__retry { pointer-events: auto; }
.sync-warning__link,
.sync-warning__retry {
  flex: none;
  font: inherit;
  color: #fff;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, .5);
}
.sync-warning__link:hover,
.sync-warning__retry:hover { border-bottom-color: #fff; }

/* utility */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* 图片/视频防保存（只能提高门槛：去掉 iOS 长按菜单与桌面拖拽，截图/录屏无法拦截） */
img, video {
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
  user-select: none;
  -webkit-user-select: none;
}
/* 图片本身不接收指针事件：长按/右键落在卡片或图片容器上，浏览器不再给出「存储图像」；
   点击查看、横向拖拽、放大仍由父级容器处理 */
img { pointer-events: none; }
.d-thumb__img { pointer-events: none; }

/* 加功德随导航收窄：<1100 收起文字，<480 连计数一起收起（点按后提示总数） */
@media (max-width: 1099px) {
  .merit__label { display: none; }
  .nav__actions .merit { padding-left: 12px; padding-right: 12px; }
}
@media (max-width: 479px) {
  .merit__count { display: none; }
  .nav__actions .merit { width: 36px; padding-left: 0; padding-right: 0; justify-content: center; }
  .merit__fx { left: 50%; }
}
