/* ============================================================
   神仙渡 · 许愿司
   夜色宫观 — 墨底 / 鎏金 / 朱砂 / 宣纸
   ============================================================ */

/* 字体：Space Mono 已本地化（数字/西文）；中文 webfont 异步加载，失败时回落系统衬线/楷体 */

/* ---- Space Mono（本地） ---- */
@font-face {
  font-family: 'Space Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../vendor/fonts/spacemono-400-i7dPIFZifjKcF5UAWdDRYEF8RQ.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Space Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../vendor/fonts/spacemono-400-i7dPIFZifjKcF5UAWdDRYE98RWq7.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Space Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../vendor/fonts/spacemono-400-i7dPIFZifjKcF5UAWdDRYE58RWq7.woff2') format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: 'Space Mono';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../vendor/fonts/spacemono-700-i7dMIFZifjKcF5UAWdDRaPpZUFWaHg.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Space Mono';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../vendor/fonts/spacemono-700-i7dMIFZifjKcF5UAWdDRaPpZUFuaHjyV.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Space Mono';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../vendor/fonts/spacemono-700-i7dMIFZifjKcF5UAWdDRaPpZUFqaHjyV.woff2') format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}

:root {
  --ink:        #0d0a08;
  --ink-2:      #14100c;
  --ink-3:      #1d1712;
  --ink-4:      #2a2119;
  --gold:       #e4b95f;
  --gold-hi:    #f6dfa4;
  --gold-dim:   #9a7b3c;
  --cinnabar:   #b3271e;
  --cinnabar-hi:#d8453a;
  --paper:      #f0e4cb;
  --paper-dim:  #b6a892;
  --stone:      #2e4a45;
  --ash:        #8b8172;

  --line:       rgba(228,185,95,.18);
  --line-soft:  rgba(228,185,95,.09);
  --panel:      rgba(29,23,18,.72);
  --panel-2:    rgba(20,16,12,.86);

  --font-cn:    'Ma Shan Zheng', 'STKaiti', 'KaiTi', 'Kaiti SC', 'STSong', 'Songti SC', serif;
  --font-body:  'Noto Serif SC', 'Songti SC', 'SimSun', 'STSong', serif;
  --font-num:   'Space Mono', 'Courier New', monospace;

  --ease: cubic-bezier(.2,.8,.25,1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* html 与 body 双层 overflow-x:hidden：任一层单独都能兜住横向溢出，
   避免日后某元素从 body 之外撑破时暴露横向滚动条 */
html { scroll-behavior: smooth; overflow-x: hidden; }

body {
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-body);
  font-weight: 300;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* 背景：庙堂的暗 + 香雾的暖 */
.bg-layer {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(1100px 620px at 18% -8%, rgba(179,39,30,.20), transparent 62%),
    radial-gradient(900px 700px at 92% 8%,  rgba(228,185,95,.13), transparent 60%),
    radial-gradient(1200px 800px at 50% 108%, rgba(46,74,69,.22), transparent 66%),
    linear-gradient(178deg, #0f0b08 0%, #0b0806 48%, #070504 100%);
}
.bg-grain {
  position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.bg-temple {              /* 背景里的殿宇剪影 */
  position: fixed; left: 50%; bottom: 0; transform: translateX(-50%);
  /* 原为 min(1600px, 130vw)：130vw 在手机上必然超出视口 30%，
     虽被 body 的 overflow-x:hidden 兜住（实测拖不动），但仍会撑大
     documentElement.scrollWidth，且 html 层无防线、隐患。
     改为 100% —— 剪影居中铺满，配合 translateX(-50%) 两侧自然对称出血。 */
  width: 100%; max-width: 1600px; height: 46vh; z-index: 0; pointer-events: none;
  opacity: .3;
}

/* ==================== 太极八卦映像（背景最底层） ====================
   z-index 0 与 .bg-layer / .bg-temple 同级，靠 DOM 顺序压在它们之上、
   盖在 .bg-grain（z-index 1）之下；.wrap 是 z-index 2，故内容不受影响。 */
.bg-taiji {
  position: fixed; left: 50%; top: 45%; transform: translate(-50%, -50%);
  width: min(62vmin, 540px); height: min(62vmin, 540px);
  z-index: 0; pointer-events: none;
  color: var(--gold); opacity: .11;
  animation: taiji-spin 150s linear infinite;
}
/* 旋转须连 translate 一起写，否则 keyframes 的 transform 会把居中位移顶掉 */
@keyframes taiji-spin {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to   { transform: translate(-50%, -50%) rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  .bg-taiji { animation: none; }
}
.bg-taiji line, .bg-taiji circle, .bg-taiji path {
  vector-effect: non-scaling-stroke;   /* 线宽不随 viewBox 缩放变粗 */
}
.tj-bagua { fill: none; stroke: currentColor; stroke-width: 3.5; }
.tj-disc  { fill: currentColor; fill-opacity: .05; stroke: currentColor; stroke-width: 4; }
.tj-yang  { fill: currentColor; fill-opacity: .5;  stroke: none; }
.tj-yin   { fill: none;               stroke: currentColor; stroke-width: 2.5; }
.tj-eye   { fill: none;               stroke: currentColor; stroke-width: 2.5; }
.tj-pupil { fill: currentColor; fill-opacity: .85;  stroke: none; }

/* 手机屏小，八卦环须收着点，否则 8 卦挤成一团 */
@media (max-width: 640px) {
  .bg-taiji { width: min(76vmin, 420px); height: min(76vmin, 420px); top: 42%; opacity: .1; }
}

/* ==================== 顶栏 ==================== */
.topbar {
  position: sticky; top: 0; z-index: 60;
  display: flex; align-items: center; gap: 26px;
  padding: 14px clamp(16px, 4vw, 54px);
  background: linear-gradient(180deg, rgba(10,7,5,.95), rgba(10,7,5,.72));
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: baseline; gap: 12px; cursor: pointer; }
.brand-seal {
  width: 42px; height: 42px; flex: none;
  display: grid; place-items: center;
  font-family: var(--font-cn); font-size: 26px; color: var(--paper);
  background: linear-gradient(150deg, var(--cinnabar), #7d1a14);
  border: 1px solid rgba(246,223,164,.45);
  box-shadow: inset 0 0 14px rgba(0,0,0,.5), 0 3px 12px rgba(0,0,0,.6);
  transform: rotate(-2deg);
  writing-mode: vertical-rl; letter-spacing: 1px;
}
.brand-name { font-family: var(--font-cn); font-size: 25px; letter-spacing: 4px; color: var(--gold-hi); }
.brand-sub  { font-size: 11px; letter-spacing: 3px; color: var(--ash); font-family: var(--font-num); }

.nav { display: flex; gap: 2px; margin-left: auto; flex-wrap: wrap; }
.nav button {
  background: none; border: none; cursor: pointer;
  font-family: var(--font-body); font-size: 14px; letter-spacing: 2px;
  color: var(--paper-dim); padding: 9px 15px; position: relative;
  transition: color .25s var(--ease);
}
.nav button::after {
  content: ''; position: absolute; left: 15px; right: 15px; bottom: 3px; height: 1px;
  background: var(--gold); transform: scaleX(0); transform-origin: left;
  transition: transform .3s var(--ease);
}
.nav button:hover { color: var(--gold-hi); }
.nav button.on { color: var(--gold-hi); }
.nav button.on::after { transform: scaleX(1); }

.wallet {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 14px; border: 1px solid var(--line);
  background: var(--panel-2); font-family: var(--font-num); font-size: 13px;
  color: var(--gold); white-space: nowrap;
}
.wallet i { color: var(--cinnabar-hi); }
.wallet button {
  background: none; border: 1px solid var(--line); color: var(--paper-dim);
  font-size: 11px; padding: 3px 8px; cursor: pointer; font-family: var(--font-body);
  transition: .2s;
}
.wallet button:hover { color: var(--gold-hi); border-color: var(--gold-dim); }
.wallet button:disabled { opacity: .3; cursor: not-allowed; }
.wallet button:disabled:hover { color: var(--paper-dim); border-color: var(--line); }

/* ==================== 通用 ==================== */
.wrap { position: relative; z-index: 2; max-width: 1440px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 54px); }
.view { display: none; animation: rise .55s var(--ease) both; }
.view.on { display: block; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

h2.sec-title {
  font-family: var(--font-cn); font-weight: 400;
  font-size: clamp(26px, 3.4vw, 40px); letter-spacing: 6px; color: var(--gold-hi);
  display: flex; align-items: center; gap: 16px; margin: 54px 0 8px;
}
h2.sec-title::before {
  content: ''; width: 46px; height: 1px; background: linear-gradient(90deg, transparent, var(--gold));
}
h2.sec-title small { font-family: var(--font-body); font-size: 12px; letter-spacing: 2px; color: var(--ash); }
.sec-note { font-size: 13px; color: var(--ash); letter-spacing: 1px; margin-bottom: 26px; }

.btn {
  cursor: pointer; border: 1px solid var(--gold-dim);
  background: linear-gradient(180deg, rgba(228,185,95,.12), rgba(228,185,95,.04));
  color: var(--gold-hi); font-family: var(--font-body);
  font-size: 14px; letter-spacing: 3px; padding: 12px 28px;
  transition: .28s var(--ease); position: relative; overflow: hidden;
  isolation: isolate;
}
.btn::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, var(--gold), var(--gold-dim));
  transform: translateY(101%); transition: transform .32s var(--ease); z-index: -1;
}
.btn:hover { color: #1a1208; border-color: var(--gold); }
.btn:hover::before { transform: translateY(0); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .35; cursor: not-allowed; }
.btn:disabled::before { display: none; }
.btn.red { border-color: #7d1a14; background: linear-gradient(180deg, rgba(179,39,30,.3), rgba(179,39,30,.12)); color: #f0c9c4; }
.btn.red:hover { color: #fff; background: linear-gradient(180deg, var(--cinnabar-hi), var(--cinnabar)); border-color: var(--cinnabar-hi); }
.btn.sm { padding: 7px 15px; font-size: 12px; letter-spacing: 1.5px; }

.tagg {
  font-size: 11px; letter-spacing: 1px; padding: 3px 9px;
  border: 1px solid var(--line); color: var(--paper-dim); font-family: var(--font-num);
}
.panel { background: var(--panel); border: 1px solid var(--line-soft); backdrop-filter: blur(8px); }

/* ==================== 四神兽 ==================== */
/* 神兽立于大雄宝殿两旁：左青龙/朱雀，右白虎/玄武，如门神夹道护殿。
   置于 .great-hall 内部（该容器已 position:relative，故窄屏可绝对定位）。
   素材为「纯黑底鎏金」方图：黑底用 mix-blend-mode:screen 消掉，
   鎏金主体即直接透在殿宇夜色中，如剪影贴金、无框而立。
   因主体近方形，立轴不再拉成细高条（那会使主体只占十之二三），
   而按主体比例 4/5 自成一体，以宽度定体量。 */
.beast {
  position: absolute; z-index: 4;   /* 殿宇构件之上，方能夹立于殿前 */
  /* 体量：以宽度定高（立轴 420×525，主体近方形）。
     放大是安全的 —— 外悬量由 --hang 随宽度自动反解（见下），
     主体始终向外长，不会挤进殿内。 */
  --beast-w: clamp(160px, 14vw, 250px);
  width: var(--beast-w);
  /* 脚底与殿基持平：台基 .gh-plinth 外悬 40px，其 ::after 阶楣再下探 14px，
     故殿宇视觉底沿在盒底之下 54px（≤720 断点台基为 -32px，故为 46px）。
     原来取 42px（悬在台基上方 82px），神兽显得浮着、不落地。 */
  --foot: -54px;
  bottom: var(--foot);
  /* 外悬量：令鎏金主体右缘恰好停在殿内文字左侧 4px 处。
     主体在画布内的右缘最靠外为 0.967（朱雀、青龙；白虎 0.926、玄武 0.895），
     故主体右缘 ≈ left + 0.97 × 宽；据此反解：
       left = padding − 4px − 0.97 × 宽
     宽度放大时自动向外让位，故「放大」与「不压殿内文字」互不冲突。
     ≤720 单栏时 hall-pad(64px) 大于主体宽，算出的 left 为正值，
     神兽即贴在殿壁内侧 —— 与该断点原有的贴内侧设计一致，无需特判。 */
  --hang: calc(var(--hall-pad) - 4px - 0.97 * var(--beast-w));
  margin: 0; display: flex; flex-direction: column;
  min-width: 0;
  /* 殿宇外悬：贴殿壁外侧，如门神分立，不遮挡殿内主位 */
  filter: drop-shadow(0 16px 30px rgba(0,0,0,.6));
}
/* 殿宇 padding 仅 30px（中列 566~640px 宽），故神兽大部分悬在殿壁之外
   （殿左右各留 1fr 空列，此处即那片空白），不占殿内空间。 */
.beast-l { left: var(--hang); text-align: left; }
.beast-l figcaption { text-align: left; }
.beast-r { right: var(--hang); text-align: right; }
/* 题名置于主体上方：黑底已被 screen 消掉，主体无框；
   题名不占主体位置，只在其上垫一小段间距。
   .beast 底边 = 鎏金主体脚底，与殿基阶楣下沿齐平。

   墨底衬是神兽区唯一不透明元素 —— 它的左右边缘会盖到殿内文字，
   故衬底只包住题名本身（inline-block 随内容收缩），
   整块再随主体一起退到殿壁之外。 */
.beast figcaption {
  margin: 0 0 5px; padding: 4px 2px 5px;
  text-align: center;
  /* 衬底随题名宽度收缩，不撑满神兽框，避免边缘盖住殿内文字 */
  width: max-content; max-width: 100%; margin-inline: auto;
  background: linear-gradient(180deg, rgba(8,6,5,.9) 45%, transparent);
  pointer-events: none;
}
.beast figcaption b {
  display: block; font-family: var(--font-body); font-weight: 400;
  font-size: 14px; letter-spacing: 2px; color: var(--gold);
  text-shadow: 0 2px 10px rgba(0,0,0,.9);
}
.beast figcaption i {
  display: block; font-style: normal; font-size: 10px;
  color: var(--ash); letter-spacing: .5px;
}
.beast img {
  display: block; width: 100%; height: auto;
  /* 预制图为 1:5 窄高构图，主体已按立轴比例裁好；
     cover 只取中央窄条会切掉主体，故按原比例完整显示 */
  object-fit: contain; object-position: 50% 100%;
  /* screen 混合把纯黑底消掉，鎏金直接透在殿宇夜色里，如剪影贴金、无框而立 */
  mix-blend-mode: screen;
  filter: saturate(1.06) brightness(1.04) contrast(1.02);
  transition: filter .4s var(--ease);
}
.beast:hover img { filter: saturate(1.16) brightness(1.14) contrast(1.02); }
/* 神兽宽度随视口等比缩放（见 --beast-w），外悬量自动反解，各断点只调宽度 */
@media (max-width: 1180px) {
  .beast figcaption b { font-size: 13px; letter-spacing: 1px; }
  .beast figcaption i { font-size: 9px; }
}
@media (max-width: 720px) {
  /* 单栏时殿宇近满幅，左右内边距已加宽到 64px 供神兽站位，
     神兽即贴殿壁内侧（--hang 算出为正值），不再外悬 */
  .beast { --beast-w: clamp(52px, 15vw, 62px); --foot: -46px; }
  .beast figcaption b { font-size: 11px; letter-spacing: 0; }
  .beast figcaption i { display: none; }
}

/* 神像条：横向可滚动的神像选择条。滚动条空间用 margin 让出，
   避免 padding-bottom 抬高内容盒。 */
.deity-strip {
  display: flex; gap: 10px; overflow-x: auto; padding: 8px 2px 14px;
  scrollbar-width: thin; scrollbar-color: var(--gold-dim) transparent;
  /* 不加此约束，flex 内容的 min-content 会撑破 .view，整页横向溢出 */
  min-width: 0; max-width: 100%;
}
.deity-strip::-webkit-scrollbar { height: 5px; }
.deity-strip::-webkit-scrollbar-thumb { background: var(--gold-dim); }
.dchip {
  flex: none; width: 96px; cursor: pointer; text-align: center;
  padding: 10px 6px 10px; border: 1px solid var(--line-soft);
  background: var(--panel); transition: .3s var(--ease); position: relative;
}
.dchip:hover { border-color: var(--gold-dim); transform: translateY(-4px); }
.dchip .g {
  width: 100%; aspect-ratio: 2/3; margin: 0 auto 7px; display: grid; place-items: center;
  border: 1px solid var(--line); background: radial-gradient(circle at 50% 34%, rgba(228,185,95,.16), rgba(10,8,6,.9) 72%);
  transition: .3s; overflow: hidden;
}
.dchip .g svg { width: 100%; height: 100%; display: block; }
.dchip .g img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dchip b { display: block; font-family: var(--font-body); font-weight: 400; font-size: 13px; letter-spacing: 1px; color: var(--paper); }
.dchip span { font-size: 10px; color: var(--ash); letter-spacing: .5px; }
.dchip.on { border-color: var(--gold); background: rgba(228,185,95,.09); box-shadow: 0 0 22px rgba(228,185,95,.18) inset; }
.dchip.on .g { background: radial-gradient(circle at 50% 34%, rgba(228,185,95,.3), rgba(10,8,6,.9) 72%); box-shadow: 0 0 20px rgba(228,185,95,.32) inset; }

/* ==================== 正殿（左许愿 / 中大雄宝殿 / 右还愿，中列下方为燃香求签） ==================== */
/* 上边距留出「殿宇拔高」的空间：殿顶须浮于左右两栏之上，故须避开上方神像条。
   殿顶组件总高约 220px，加上 148px 上提量，故须 172px 上边距容得下。 */
.hall {
  display: grid; grid-template-columns: 1fr 1.62fr 1fr;
  /* 列间距为殿宇三栏之距，行间距为殿宇与香案之距 */
  column-gap: 26px; row-gap: 40px;
  margin-top: 172px; align-items: start;
}
/* 中列拆为两个独立网格项：殿宇独占首行，香案与左右两栏同行，
   故「许愿 / 燃香 / 还愿」三者顶端落在同一水平线上。 */
.hall-center { display: contents; }
/* 中列：大雄宝殿（殿顶 + 匾额 + 台基阶陛 + 高位主位） */
.great-hall { grid-column: 2; grid-row: 1; }

/* ---- 殿宇外壳 ---- */
.great-hall {
  position: relative; width: 100%; max-width: 640px;
  /* 上：上檐+斗拱+匾额+下檐共需 220px 悬空高度；下：须弥座落地余量。
     左右仅 30px：神兽靠「外悬」贴在殿壁之外，不占殿内空间——
     早期尝试把左右内边距加到 190px 让神兽站进来，实测会把殿内
     神像与匾额挤窄变形（殿内可用宽 640-380=260px），故不取。
     --hall-pad：左右内边距，供神兽反解外悬量（见 .beast 的 --hang），
     改 padding 时须同步改此值。 */
  --hall-pad: 30px;
  padding: 220px var(--hall-pad) 58px;
  /* 殿宇居于中列首行：左右两栏自第二行（香案一线）起，故殿顶仍高出两栏一头 */
  justify-self: center;
  min-width: 0;
}

/* ============ 上檐（重檐之上层） ============ */
/* 琉璃瓦顶面：底色为黄琉璃，叠瓦垄纹理 */
.gh-roof {
  position: absolute; left: 0; right: 0; top: 0; height: 92px;
  pointer-events: none; z-index: 3;
}
/* 瓦垄：细密的竖向筒瓦纹理 */
.gh-tiles {
  position: absolute; left: 0; right: 0; top: 20px; height: 46px;
  background:
    repeating-linear-gradient(90deg,
      rgba(120,86,20,.42) 0 1px,
      rgba(255,236,170,.30) 1px 2px,
      rgba(214,168,78,.22) 2px 5px,
      rgba(120,86,20,.34) 5px 6px);
  clip-path: polygon(0 44%, 50% 0, 100% 44%, 100% 100%, 0 100%);
}
/* 正脊：鎏金琉璃脊瓦，两端鸱吻（骑凤仙人），脊中置宝瓶 */
.gh-ridge {
  position: absolute; left: 50%; top: 8px; transform: translateX(-50%);
  width: 90%; height: 18px; border-radius: 3px 3px 0 0;
  background:
    linear-gradient(180deg,
      rgba(255,246,214,.98) 0%, #f2d488 22%, #d9a845 48%,
      #a9781f 74%, #6b4a12 92%, #3d2a08 100%);
  box-shadow:
    0 0 22px rgba(228,185,95,.55),
    inset 0 1px 0 rgba(255,252,238,.85),
    inset 0 -2px 3px rgba(90,60,16,.5);
}
/* 鸱吻：正脊两端的兽头，卷尾向内 */
.gh-ridge::before, .gh-ridge::after {
  content: ''; position: absolute; top: -9px; width: 14px; height: 24px;
  background: linear-gradient(170deg, #f7e2a4 0%, #e0b45c 40%, #a9781f 76%, #5d400f 100%);
  clip-path: polygon(50% 0, 100% 46%, 82% 100%, 18% 100%, 0 46%);
  filter: drop-shadow(0 2px 3px rgba(0,0,0,.6));
}
.gh-ridge::before { left: -7px; }
.gh-ridge::after  { right: -7px; }
/* 脊中宝瓶 */
.gh-vase {
  position: absolute; left: 50%; top: -13px; transform: translateX(-50%);
  width: 13px; height: 18px; border-radius: 46% 46% 34% 34%;
  background: linear-gradient(180deg, #fdf0c2, #e2bb68 46%, #a9781f 82%, #5d400f);
  box-shadow: 0 0 12px rgba(246,223,164,.7);
}
.gh-vase::before {   /* 瓶口 */
  content: ''; position: absolute; left: 50%; top: -3px; transform: translateX(-50%);
  width: 7px; height: 4px; border-radius: 2px;
  background: linear-gradient(90deg, #d9a845, #f7e2a4, #d9a845);
}
/* 正吻小兽：脊上列坐的脊兽剪影 */
.gh-beast {
  position: absolute; left: 50%; top: -6px; transform: translateX(-50%) translateX(-42px);
  width: 7px; height: 10px;
  background: linear-gradient(180deg, #f0d290, #9d701c);
  clip-path: polygon(30% 100%, 34% 42%, 62% 8%, 100% 30%, 74% 46%, 72% 100%);
}
/* 垂脊：正脊两端垂下的戗脊（歇山顶特征） */
.gh-hip {
  position: absolute; top: 24px; width: 40%; height: 9px;
  background: linear-gradient(180deg, rgba(246,223,164,.9), #c9973f 58%, #7a5518);
  border-radius: 0 0 4px 4px;
  box-shadow: 0 2px 5px rgba(0,0,0,.55);
}
.hip-l { left: 5%;  transform: rotate(23deg); transform-origin: left center; border-radius: 4px 0 0 4px; }
.hip-r { right: 5%; transform: rotate(-23deg); transform-origin: right center; border-radius: 0 4px 4px 0; }
/* 飞檐：上檐出挑，檐角起翘 */
.gh-eave {
  position: absolute; top: 42px; width: 50%; height: 48px;
  background: linear-gradient(180deg,
    rgba(240,205,124,.95) 0%, #c9973f 34%, #8e6222 66%, rgba(48,32,10,.86) 100%);
  box-shadow: 0 10px 24px rgba(0,0,0,.66);
}
.gh-eave-l {
  left: -4%;
  clip-path: polygon(0 0, 100% 28%, 100% 100%, 0 62%);
  border-radius: 5px 0 0 0;
}
.gh-eave-r {
  right: -4%;
  clip-path: polygon(0 28%, 100% 0, 100% 62%, 0 100%);
  border-radius: 0 5px 0 0;
}
/* 檐下阴影，令出檐有厚度 */
.gh-eave::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 8px;
  background: linear-gradient(180deg, transparent, rgba(20,12,4,.6));
}

/* ============ 斗拱：檐下密铺，承托出檐 ============ */
.gh-brackets {
  position: absolute; left: 8%; right: 8%; top: 82px; height: 30px;
  z-index: 3; pointer-events: none; opacity: .96;
  /* 三层叠涩：斗口 + 升 + 昂，逐层外挑 */
  background:
    repeating-linear-gradient(90deg,
      rgba(246,223,164,.85) 0 4px, transparent 4px 9px,
      rgba(214,168,78,.7) 9px 12px, transparent 12px 20px),
    linear-gradient(180deg,
      rgba(214,168,78,.55) 0 6px,
      rgba(150,106,36,.5) 6px 13px,
      rgba(88,58,18,.62) 13px 19px,
      rgba(46,30,10,.8) 19px 26px);
  clip-path: polygon(0 0, 100% 0, 100% 74%, 50% 100%, 0 74%);
  filter: drop-shadow(0 5px 9px rgba(0,0,0,.6));
}

/* ---- 殿名匾额：悬于上下两檐之间 ---- */
.gh-sign {
  position: absolute; left: 50%; top: 114px; transform: translateX(-50%);
  z-index: 4; white-space: nowrap;
  padding: 9px 38px 10px;
  background: linear-gradient(180deg, #6f4d19, #3b270e 70%, #26180a);
  border: 1px solid rgba(246,223,164,.7); border-radius: 3px;
  background-image:
    linear-gradient(180deg, rgba(255,240,200,.95), #f0cd7c 40%, #c9973f 74%, #8e6222);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  font-family: var(--font-cn); font-size: 29px; letter-spacing: 12px; text-indent: 12px;
  text-shadow: 0 2px 0 rgba(0,0,0,.28);
  box-shadow:
    inset 0 0 0 4px rgba(38,24,10,.55),
    0 10px 28px rgba(0,0,0,.7),
    0 0 40px rgba(228,185,95,.34);
}
/* 匾额下的鎏金垂花 */
.gh-sign::after {
  content: ''; position: absolute; left: 50%; bottom: -7px; transform: translateX(-50%);
  width: 46%; height: 5px;
  background: linear-gradient(90deg, transparent, rgba(246,223,164,.9), transparent);
}
/* 匾额左右题跋（传统匾额的两侧小字款识） */
.gh-sign::before {
  content: '大 覺 世 尊\A\hA 寶 覺 禪 寺';
  white-space: pre; text-align: center;
  position: absolute; right: calc(100% + 9px); top: 50%; transform: translateY(-50%);
  font-family: var(--font-cn); font-size: 10px; line-height: 1.5;
  letter-spacing: 2px;
  color: rgba(228,185,95,.5);
  text-shadow: 0 0 8px rgba(228,185,95,.28);
}

/* ============ 下檐：重檐之第二重，檐角起翘更甚 ============ */
/* 垂直层叠：上檐 0~92 · 斗拱 82~112 · 匾额 114~164 · 下檐 166~208 · 神龛 226+ */
.gh-roof2 {
  position: absolute; left: -2%; right: -2%; top: 166px; height: 42px;
  pointer-events: none; z-index: 2;
}
.gh-ridge2 {          /* 下檐压顶的檐脊 */
  position: absolute; left: 50%; top: 0; transform: translateX(-50%);
  width: 94%; height: 8px; border-radius: 2px;
  background: linear-gradient(180deg, rgba(255,240,200,.9), #c9973f 52%, #7a5518);
  box-shadow: 0 2px 7px rgba(0,0,0,.6);
}
.gh-eave2 {
  position: absolute; top: 8px; width: 50%; height: 34px;
  background: linear-gradient(180deg,
    rgba(226,180,96,.95) 0%, #b3832f 38%, #7a5518 72%, rgba(40,26,8,.88) 100%);
  box-shadow: 0 8px 18px rgba(0,0,0,.6);
}
.e2-l { left: 0;  clip-path: polygon(0 0, 100% 34%, 100% 100%, 0 62%); border-radius: 4px 0 0 0; }
.e2-r { right: 0; clip-path: polygon(0 34%, 100% 0, 100% 62%, 0 100%); border-radius: 0 4px 0 0; }

/* ============ 台基与阶陛：神位立于须弥座上，故为高位 ============ */
.gh-plinth {
  position: absolute; left: 50%; bottom: -40px; transform: translateX(-50%);
  width: 108%; height: 46px; pointer-events: none; z-index: 0;
}
/* 阶陛：五级递升，中间宽、两端窄 */
.gh-step {
  position: absolute; left: 50%; transform: translateX(-50%);
  height: 9px; border-radius: 2px;
  background: linear-gradient(180deg, rgba(112,90,54,.9), rgba(36,26,14,.94));
  border-top: 1px solid rgba(228,185,95,.45);
  box-shadow: 0 3px 9px rgba(0,0,0,.62);
}
.gh-step.s1 { bottom: 32px; width: 36%; }
.gh-step.s2 { bottom: 24px; width: 50%; }
.gh-step.s3 { bottom: 16px; width: 64%; }
.gh-step.s4 { bottom: 8px;  width: 80%; }
.gh-step.s5 { bottom: 0;   width: 97%; }
/* 台基石身（须弥座束腰） */
.gh-plinth::after {
  content: ''; position: absolute; left: -2%; right: -2%; bottom: -14px; height: 14px;
  background:
    linear-gradient(180deg, rgba(88,68,40,.8), rgba(20,14,8,.94));
  border-top: 1px solid rgba(228,185,95,.34);
  box-shadow: 0 6px 16px rgba(0,0,0,.6);
}
/* 栏板望柱：台基两侧汉白玉栏 */
.gh-rail {
  position: absolute; top: 4px; height: 9px;
  background: linear-gradient(180deg, rgba(238,232,214,.85), rgba(150,140,118,.6));
  border-radius: 2px; box-shadow: 0 2px 6px rgba(0,0,0,.5);
}
.gh-rail::before, .gh-rail::after {   /* 望柱 */
  content: ''; position: absolute; top: -5px; width: 5px; height: 15px;
  background: linear-gradient(180deg, #f2ecdc, #9a8c72);
  border-radius: 2px; box-shadow: 0 1px 4px rgba(0,0,0,.55);
}
.gh-rail::before { left: -3px; }
.gh-rail::after  { right: -3px; }
.rail-l { left: 3%;  width: 26%; }
.rail-r { right: 3%; width: 26%; }

/* ============ 殿身：朱柱、格扇门、藻井 ============ */
.gh-body {
  position: absolute; inset: 0; pointer-events: none; z-index: 0;
}
/* 朱漆立柱（金漆柱头，柱身朱红）——柱仅承檐，不贯穿全高 */
.gh-pillar {
  position: absolute; top: 4px; height: 152px; width: 13px; z-index: 1;
  background:
    linear-gradient(90deg, #4d0f0b 0%, var(--cinnabar) 34%, #9c2a1e 58%, #4d0f0b 100%);
  box-shadow:
    inset 0 0 0 1px rgba(246,223,164,.3),
    0 0 18px rgba(0,0,0,.62);
}
.gh-pillar::before {   /* 柱头鎏金斗栱 */
  content: ''; position: absolute; left: -5px; right: -5px; top: -5px; height: 8px;
  background: linear-gradient(180deg, rgba(255,244,206,.96), #c9973f 62%, #7a5518);
  border-radius: 2px;
  box-shadow: 0 2px 6px rgba(0,0,0,.55);
}
.gh-pillar::after {    /* 柱础宝莲 */
  content: ''; position: absolute; left: -5px; right: -5px; bottom: -4px; height: 10px;
  background: linear-gradient(180deg, #a99678, #5c4e38);
  border-radius: 3px 3px 5px 5px;
  box-shadow: 0 3px 8px rgba(0,0,0,.6);
}
.p1 { left: -14px; }
.p4 { right: -14px; }
.p2 { left: 22%; opacity: .92; }
.p3 { right: 22%; opacity: .92; }
/* 格扇门：殿心隔扇，棂条透光 */
.gh-door {
  position: absolute; left: 50%; bottom: -8px; transform: translateX(-50%);
  width: 30%; height: 30%; z-index: 0; opacity: .5;
  background:
    repeating-linear-gradient(90deg, rgba(228,185,95,.55) 0 1px, transparent 1px 7px),
    linear-gradient(180deg, rgba(228,185,95,.16), transparent);
  border: 1px solid rgba(228,185,95,.28);
  border-radius: 2px 2px 0 0;
}
/* 藻井：殿内天花，中心法轮 */
.gh-caisson {
  position: absolute; left: 50%; top: 3px; transform: translateX(-50%);
  width: 56px; height: 30px; z-index: 0; opacity: .62;
  background: radial-gradient(ellipse at 50% 40%, rgba(228,185,95,.3), transparent 72%);
  border-bottom: 1px solid rgba(228,185,95,.26);
}
.gh-cai-ring {   /* 法轮 */
  position: absolute; left: 50%; top: 42%; transform: translate(-50%,-50%);
  width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid rgba(228,185,95,.6);
}
.gh-cai-core {
  position: absolute; left: 50%; top: 42%; transform: translate(-50%,-50%);
  width: 6px; height: 6px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,244,206,.9), rgba(201,151,63,.5));
}

/* 神位：坐在须弥座之上，视觉上高于两侧 */
.hall-shrine {
  position: relative; z-index: 1;
  width: 100%; max-width: 548px;
}
/* 左右两栏与中列香案同行：许愿、燃香、还愿顶端齐平 */
.hall-offer { grid-column: 1; grid-row: 2; min-width: 0; }
.hall-repay { grid-column: 3; grid-row: 2; min-width: 0; }

/* 主位背后的辉煌光背（自台基向上辉散） */
.hall-shrine::before {
  content: ''; position: absolute; left: 50%; top: -40px; transform: translateX(-50%);
  width: 138%; height: 340px; pointer-events: none; z-index: 0;
  background:
    radial-gradient(ellipse 50% 44% at 50% 42%, rgba(228,185,95,.19), transparent 72%),
    radial-gradient(ellipse 34% 26% at 20% 24%, rgba(255,214,120,.09), transparent 70%),
    radial-gradient(ellipse 34% 26% at 80% 24%, rgba(255,214,120,.09), transparent 70%);
}
/* 主位之后的鎏金匾额光带 */
.hall-shrine::after {
  content: ''; position: absolute; left: 50%; top: -52px; transform: translateX(-50%);
  width: 74%; height: 3px; z-index: 0; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(246,223,164,.75), rgba(255,238,190,.95), rgba(246,223,164,.75), transparent);
  box-shadow: 0 0 22px rgba(228,185,95,.55), 0 0 46px rgba(228,185,95,.24);
  border-radius: 2px;
}

/* 主位神龛：金边加厚、内透金辉，比左右更隆重 */
.shrine.hall-main {
  position: relative; z-index: 1;
  padding: 30px 26px 26px;
  border: 1px solid rgba(246,223,164,.5);
  background:
    radial-gradient(ellipse 68% 42% at 50% 0%, rgba(228,185,95,.13), transparent 72%),
    linear-gradient(180deg, rgba(66,49,30,.5), rgba(13,10,8,.34));
  box-shadow:
    inset 0 0 0 1px rgba(228,185,95,.2),
    inset 0 20px 46px rgba(228,185,95,.09),
    0 18px 44px rgba(0,0,0,.62),
    0 0 42px rgba(228,185,95,.14);
}
/* 檐下彩画梁枋：箍头—藻头—枋心三段式，旋子彩画意匠 */
.shrine.hall-main::after {
  content: ''; position: absolute; left: 50%; top: -2px; transform: translateX(-50%);
  width: 92%; height: 11px; pointer-events: none; z-index: 3;
  background:
    /* 枋心：中央方光 */
    linear-gradient(90deg,
      rgba(28,60,110,0) 0%, rgba(38,74,130,.9) 26%, rgba(120,180,220,.55) 38%,
      rgba(38,74,130,.9) 62%, rgba(28,60,110,0) 100%),
    /* 通身绿底 */
    linear-gradient(180deg, rgba(228,185,95,.5), rgba(20,58,40,.95));
  background-blend-mode: overlay, normal;
  border-top: 1px solid rgba(255,240,200,.55);
  border-radius: 2px;
  box-shadow: 0 3px 12px rgba(0,0,0,.5);
  opacity: .9;
}
.shrine.hall-main::before {      /* 主位顶上鎏金檐牙 */
  content: ''; position: absolute; left: 50%; top: -15px; transform: translateX(-50%);
  width: 84%; height: 15px; pointer-events: none;
  background: linear-gradient(180deg, rgba(246,223,164,.92), rgba(160,120,48,.7) 58%, rgba(60,42,18,.32));
  clip-path: polygon(0 100%, 3% 0, 97% 0, 100% 100%);
  box-shadow: 0 3px 16px rgba(228,185,95,.42);
}
.shrine.hall-main h3 { font-size: 38px; letter-spacing: 7px; }
.shrine.hall-main .shrine-art { max-width: 250px; }

/* 匾额：主位上方题名 */
.hall-plaque {
  position: relative; z-index: 2; margin: 0 auto 14px; width: fit-content;
  padding: 9px 34px 10px; text-align: center;
  background: linear-gradient(180deg, #6a4a18, #38260e 72%, #241708);
  border: 1px solid rgba(246,223,164,.62);
  border-radius: 3px;
  box-shadow: inset 0 1px 0 rgba(255,240,200,.36), 0 6px 22px rgba(0,0,0,.6), 0 0 26px rgba(228,185,95,.2);
}
.hall-plaque b {
  display: block; font-family: var(--font-cn); font-weight: 400;
  font-size: 25px; letter-spacing: 9px; text-indent: 9px;
  background: linear-gradient(180deg, #fff3d0, #f0cd7c 46%, #c9973f 78%, #8e6222);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  text-shadow: 0 1px 0 rgba(0,0,0,.3);
}
.hall-plaque i {
  display: block; font-style: normal; font-size: 10.5px; letter-spacing: 4px;
  color: rgba(255,232,178,.72); margin-top: 4px;
}

/* 殿内立柱（装饰，金漆朱柱） */
.hall-col {
  position: absolute; top: 0; bottom: 0; width: 15px; z-index: 2; pointer-events: none;
  background: linear-gradient(90deg, #5c120e, var(--cinnabar) 38%, #8e2018 62%, #4d0f0b);
  box-shadow: inset 0 0 0 1px rgba(246,223,164,.34), 0 0 16px rgba(0,0,0,.6);
}
.hall-col::after {              /* 柱头鎏金 */
  content: ''; position: absolute; left: -3px; right: -3px; top: -3px; height: 7px;
  background: linear-gradient(180deg, rgba(246,223,164,.95), rgba(150,112,44,.8));
  border-radius: 2px;
}
.hall-col.l { left: -15px; }
.hall-col.r { right: -15px; }

/* 殿内地面金光（香案下方） */
.hall-altar { grid-column: 2; grid-row: 2; position: relative; width: 100%; max-width: 520px; justify-self: center; }
.hall-altar::after {
  content: ''; position: absolute; left: 50%; bottom: -14px; transform: translateX(-50%);
  width: 120%; height: 34px; pointer-events: none; z-index: 0;
  background: radial-gradient(ellipse 50% 50% at 50% 50%, rgba(228,185,95,.15), transparent 72%);
}

/* ---- 左右两殿柱题 ---- */
.offer-tit { display: flex; align-items: center; gap: 9px; margin-bottom: 6px; }
.offer-tit i { color: var(--gold); font-size: 15px; }
.offer-tit h4 { font-family: var(--font-cn); font-weight: 400; font-size: 21px; letter-spacing: 3px; color: var(--gold); margin: 0; }
.offer .hint b { color: #d8a08f; font-weight: 400; }

/* ---- 还愿面板（右） ---- */
.repay { padding: 22px 18px; position: relative; }
.repay-list { list-style: none; margin-top: 4px; }
.repay-list li {
  display: flex; align-items: flex-start; gap: 9px;
  padding: 10px 0; border-bottom: 1px solid var(--line-soft); font-size: 12.5px;
}
.repay-list li:last-child { border-bottom: none; }
.repay-list .rp-txt { flex: 1; color: var(--paper-dim); line-height: 1.75; min-width: 0; }
.repay-list .rp-txt small { display: block; color: var(--ash); font-size: 11px; margin-top: 3px; }
.repay-list .rp-btn {
  flex-shrink: 0; white-space: nowrap;
  padding: 5px 12px; font-size: 11.5px; cursor: pointer;
  background: linear-gradient(180deg, rgba(228,185,95,.2), rgba(160,120,48,.1));
  border: 1px solid rgba(228,185,95,.5); border-radius: 2px;
  color: var(--gold-hi); font-family: var(--font-body);
  transition: .2s;
}
.repay-list .rp-btn:hover { background: rgba(228,185,95,.28); box-shadow: 0 0 14px rgba(228,185,95,.3); }
.repay-list li.done .rp-txt { color: var(--ash); }
.repay-list .rp-ok { flex-shrink: 0; color: #7fc3a4; font-size: 11.5px; white-space: nowrap; }
.repay-foot { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); font-size: 11px; color: var(--ash); line-height: 1.9; }
.repay-foot b { color: var(--gold-dim); font-weight: 400; }
.repay-empty { padding: 22px 0; text-align: center; color: var(--ash); font-size: 12px; line-height: 2; }
.repay-empty i { display: block; font-size: 24px; margin-bottom: 10px; color: var(--gold-dim); opacity: .55; }

@media (max-width: 1180px) {
  /* 中列收窄但仍为三栏：殿宇独占首行，香案与许愿、还愿仍同一水平线 */
  .hall { grid-template-columns: 1fr 1.34fr 1fr; column-gap: 18px; row-gap: 30px; }
  .great-hall { grid-column: 2; grid-row: 1; --hall-pad: 12px; padding: 186px var(--hall-pad) 52px; }
  .hall-altar { grid-column: 2; grid-row: 2; }
  .hall-offer { grid-column: 1; grid-row: 2; }
  .hall-repay { grid-column: 3; grid-row: 2; }
}
@media (max-width: 720px) {
  .hall { grid-template-columns: 1fr; column-gap: 20px; row-gap: 20px; }
  /* 单栏竖排：殿宇 → 燃香 → 许愿 → 还愿 */
  .great-hall, .hall-altar, .hall-offer, .hall-repay { grid-column: 1 / span 1; }
  .great-hall { grid-row: 1; }
  .hall-altar { grid-row: 2; }
  .hall-offer { grid-row: 3; }
  .hall-repay { grid-row: 4; }
  .hall-shrine, .hall-altar { max-width: 100%; }
  /* 殿宇左右各留出神兽的站位（神兽已改为绝对定位，见 .beast 段）。
     --hall-pad 60px 须 ≥ 神兽宽 + 4px，否则 --hang 算成负值、神兽反会探出殿壁。
     该断点台基为 -32px，故神兽脚底 --foot 取 -46px。 */
  .great-hall { max-width: 100%; --hall-pad: 60px; padding: 142px var(--hall-pad) 38px; }

  /* 殿顶整体收缩：上檐 74 / 斗拱 22 / 匾额 88 / 下檐 34 → 神龛 142 */
  .gh-roof  { height: 74px; }
  .gh-ridge { width: 96%; height: 14px; top: 6px; }
  .gh-ridge::before, .gh-ridge::after { width: 11px; height: 19px; top: -7px; }
  .gh-vase  { width: 10px; height: 14px; top: -10px; }
  .gh-beast { display: none; }
  .gh-tiles { top: 16px; height: 34px; }
  .gh-hip   { top: 19px; height: 6px; }
  .gh-eave  { top: 33px; height: 36px; }
  .gh-brackets { top: 66px; height: 20px; }

  .gh-sign { font-size: 20px; letter-spacing: 7px; text-indent: 7px; padding: 8px 22px 9px; top: 88px; }
  .gh-sign::before { display: none; }

  .gh-roof2 { top: 132px; height: 28px; left: 0; right: 0; }
  .gh-ridge2 { height: 5px; }
  .gh-eave2  { top: 5px; height: 23px; }

  .gh-plinth { height: 38px; bottom: -32px; }
  .gh-step   { height: 7px; }
  .gh-step.s1 { bottom: 26px; } .gh-step.s2 { bottom: 19px; }
  .gh-step.s3 { bottom: 13px; } .gh-step.s4 { bottom: 6px; }
  .gh-step.s5 { bottom: 0; }
  .gh-rail   { height: 7px; top: 3px; }
  .gh-rail::before, .gh-rail::after { width: 4px; height: 12px; top: -4px; }

  .gh-pillar { width: 9px; }
  .p1 { left: -9px; } .p4 { right: -9px; }
  .p2, .p3 { display: none; }
  .gh-caisson { display: none; }
  .gh-door { width: 42%; height: 22%; }

  .shrine.hall-main h3 { font-size: 30px; letter-spacing: 5px; }
  .shrine.hall-main .shrine-art { max-width: 200px; }
  .hall-plaque b { font-size: 20px; letter-spacing: 6px; text-indent: 6px; }
  .hall-col { display: none; }
  .hall-shrine::after { width: 88%; }
}

/* 神龛 */
.shrine { position: relative; padding: 26px 22px 24px; overflow: hidden; }
.shrine::before {           /* 斜插的幡旗 */
  content: ''; position: absolute; top: -18px; right: -6px; width: 66px; height: 168px;
  background: linear-gradient(180deg, var(--cinnabar), #6d1611);
  transform: rotate(9deg); opacity: .32;
  box-shadow: 0 0 22px rgba(0,0,0,.6);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 84%, 0 100%);
}
/* 神像画像 */
.shrine-art {
  position: relative; z-index: 2;
  width: 100%; max-width: 210px; margin: 0 auto 16px; aspect-ratio: 2/3;
  background: radial-gradient(ellipse at 50% 28%, rgba(228,185,95,.13), transparent 68%);
}
.shrine-art svg { width: 100%; height: 100%; display: block;
  filter: drop-shadow(0 6px 18px rgba(0,0,0,.6)); }
/* 供后台上传图与 assets/img/deities 实拍图共用：2/3 竖构图，object-fit 居中偏上 */
.shrine-art img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 38%; display: block;
  filter: drop-shadow(0 6px 18px rgba(0,0,0,.6)); }
.deity-portrait {
  width: 100%; aspect-ratio: 2/3; margin-bottom: 14px; overflow: hidden;
  background: radial-gradient(ellipse at 50% 30%, rgba(228,185,95,.12), rgba(8,6,5,.6) 76%);
  border-bottom: 1px solid var(--line-soft);
}
.deity-portrait svg { width: 100%; height: 100%; display: block; }
.deity-portrait img { width: 100%; height: 100%; object-fit: cover; display: block; }
.deity-card:hover .deity-portrait { background: radial-gradient(ellipse at 50% 30%, rgba(228,185,95,.2), rgba(8,6,5,.6) 76%); }
.shrine h3 { position: relative; z-index: 2; font-family: var(--font-cn); font-weight: 400; font-size: 34px; letter-spacing: 5px; color: var(--gold-hi); }
.shrine .sub { position: relative; z-index: 2; font-size: 12px; letter-spacing: 2px; color: var(--gold-dim); margin: 4px 0 14px; }
.shrine .desc { position: relative; z-index: 2; font-size: 13.5px; line-height: 2; color: var(--paper-dim); }
.shrine .realm { position: relative; z-index: 2; margin: 14px 0 10px; padding-top: 12px; border-top: 1px dashed var(--line); font-size: 12.5px; color: var(--gold); letter-spacing: 1px; }
.shrine .taboo { position: relative; z-index: 2; font-size: 12px; color: #c08b84; line-height: 1.9; }
.accept-row { position: relative; z-index: 2; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.accept-row .tagg { border-color: rgba(228,185,95,.28); color: var(--gold); }

/* 香案 + 香炉 */
.altar { position: relative; padding: 0 0 26px; }
.altar-roof {              /* 檐 */
  height: 26px;
  background: linear-gradient(180deg, #3a2b1d, #1a120c);
  border-bottom: 2px solid var(--gold-dim);
  clip-path: polygon(0 100%, 4% 0, 96% 0, 100% 100%);
  position: relative;
}
.altar-roof::after {
  content: ''; position: absolute; left: 50%; bottom: -7px; transform: translateX(-50%);
  width: 128px; height: 8px; border: 2px solid var(--gold-dim); border-top: none;
  border-radius: 0 0 60% 60%;
}
.altar-body {
  position: relative; padding: 40px 26px 0; text-align: center;
  background: linear-gradient(180deg, rgba(58,43,29,.34), rgba(13,10,8,.2));
  border-left: 1px solid var(--line-soft); border-right: 1px solid var(--line-soft);
}
.altar-body::before, .altar-body::after {   /* 朱红立柱 */
  content: ''; position: absolute; top: 0; width: 15px; height: 100%;
  background: linear-gradient(90deg, #6d1611, var(--cinnabar) 40%, #6d1611);
  box-shadow: 0 0 18px rgba(0,0,0,.65);
}
.altar-body::before { left: -8px; }
.altar-body::after  { right: -8px; }

/* 香炉 */
.censer { position: relative; height: 178px; display: grid; place-items: end center; margin-bottom: 16px; }
.censer-bowl {
  position: absolute; bottom: 0; width: 190px; height: 66px;
  background: linear-gradient(180deg, #6b5227, #35280f 62%, #1c140a);
  border: 1px solid rgba(246,223,164,.36); border-radius: 12px 12px 42% 42%;
  box-shadow: inset 0 8px 18px rgba(0,0,0,.6), 0 12px 26px rgba(0,0,0,.66);
}
.censer-bowl::before {
  content: ''; position: absolute; inset: 6px 12px auto; height: 8px;
  background: linear-gradient(90deg, transparent, rgba(246,223,164,.4), transparent);
  border-radius: 50%;
}
.censer-bowl::after {   /* 炉足 */
  content: ''; position: absolute; bottom: -12px; left: 22px; right: 22px; height: 14px;
  background: linear-gradient(180deg, #4a3718, #1c140a);
  border-radius: 0 0 8px 8px;
  box-shadow: 18px 8px 0 -6px #241a0c, -18px 8px 0 -6px #241a0c;
}
.censer-flame {          /* 炉内金光 */
  position: absolute; bottom: 34px; width: 150px; height: 92px;
  background: radial-gradient(ellipse at 50% 100%, rgba(228,185,95,.5), transparent 68%);
  filter: blur(9px); opacity: 0; transition: opacity .7s var(--ease);
  pointer-events: none;
}
.lit .censer-flame { opacity: 1; animation: flicker 2.6s infinite; }
@keyframes flicker { 0%,100% { opacity: .82; transform: scale(1); } 45% { opacity: 1; transform: scale(1.08); } 70% { opacity: .68; transform: scale(.95); } }

/* 香束：宽度不得超过炉口内径（190px 减两侧留白约 28px，即约 162px 可用） */
.sticks {
  position: absolute; bottom: 52px;
  display: flex; align-items: flex-end; justify-content: center;
  /* gap 由 JS 按支数动态写入：香越多、间距越窄，保证香根始终落在炉口内 */
  gap: var(--stick-gap, 26px);
  max-width: 166px;
}
.stick { position: relative; width: 3px; height: 118px; background: linear-gradient(180deg, #7a4a3a, #4a2b22); border-radius: 2px 2px 0 0; transform-origin: bottom center; }
.stick::after {
  content: ''; position: absolute; top: -5px; left: 50%; transform: translateX(-50%);
  width: 7px; height: 7px; border-radius: 50%; background: #4a2b22; transition: .4s;
}
.lit .stick::after { background: radial-gradient(circle, #fff5d0, var(--cinnabar-hi) 55%, #4a0f08); box-shadow: 0 0 14px 4px rgba(216,69,58,.6); animation: ember 1.5s infinite; }
@keyframes ember { 0%,100% { box-shadow: 0 0 12px 3px rgba(216,69,58,.5); } 50% { box-shadow: 0 0 20px 7px rgba(255,190,120,.75); } }

.smoke { position: absolute; bottom: 170px; left: 50%; width: 2px; height: 2px; pointer-events: none; }
.smoke i {
  position: absolute; display: block; width: 7px; height: 7px; border-radius: 50%;
  background: radial-gradient(circle, rgba(240,228,203,.34), transparent 70%);
  animation: smokeUp 4.6s linear infinite;
}
@keyframes smokeUp {
  0%   { transform: translate(0,0) scale(.3); opacity: 0; }
  18%  { opacity: .55; }
  100% { transform: translate(40px,-190px) scale(3.6); opacity: 0; }
}

/* 烛台 */
.candle {
  position: absolute; bottom: 26px; width: 16px; height: 62px;
  background: linear-gradient(180deg, #e9d9bb, #b09a78);
  border-radius: 4px 4px 2px 2px; box-shadow: 0 4px 12px rgba(0,0,0,.6);
}
.candle .wick {
  position: absolute; top: -7px; left: 50%; transform: translateX(-50%);
  width: 2px; height: 8px; background: #2a1c10;
}
.candle.side-l { left: calc(50% - 152px); }
.candle.side-r { left: calc(50% + 136px); }
.candle::before {   /* 烛泪 */
  content: ''; position: absolute; top: 14px; left: 2px; width: 12px; height: 10px;
  border-radius: 50% 50% 40% 40%; background: linear-gradient(180deg, #f4e8d0, #cdb894);
}
.candle::after {    /* 烛台托 */
  content: ''; position: absolute; bottom: -9px; left: -11px; width: 38px; height: 11px;
  background: linear-gradient(180deg, #7d6127, #3a2b11);
  border: 1px solid rgba(246,223,164,.3);
  border-radius: 50% 50% 5px 5px; box-shadow: 0 5px 14px rgba(0,0,0,.66);
}
.flame {
  position: absolute; top: -26px; left: 50%; transform: translateX(-50%);
  width: 13px; height: 22px; opacity: 0; transition: opacity .5s;
  background: radial-gradient(ellipse at 50% 78%, #fff8dc 0%, #ffc85c 34%, #e0661f 66%, transparent 74%);
  border-radius: 50% 50% 44% 44%; filter: blur(.5px);
}
.lit .flame { opacity: 1; animation: fire .9s infinite alternate; }
@keyframes fire { from { transform: translateX(-50%) scaleY(1) skewX(-3deg); } to { transform: translateX(-50%) scaleY(1.18) skewX(3deg); } }
.glow {
  position: absolute; top: -70px; left: 50%; transform: translateX(-50%);
  /* 宽度跟随视口：右侧烛台位于 50%+90px 处，固定 190px 的光晕在窄屏
     会被推到视口右缘之外（390px 时溢出 6px）。clamp 上限即原值，下限保证收得住。 */
  width: clamp(96px, 30vw, 190px); height: 150px;
  opacity: 0; transition: opacity .6s; pointer-events: none;
  background: radial-gradient(circle, rgba(255,190,120,.22), transparent 66%); filter: blur(6px);
}
.lit .glow { opacity: 1; }

/* 幡条文案 */
.burn-slogan {
  font-family: var(--font-cn); font-size: 17px; letter-spacing: 5px; color: var(--paper-dim);
  margin: 4px 0 14px; min-height: 26px;
}
.burn-slogan.on { color: var(--gold-hi); text-shadow: 0 0 18px rgba(228,185,95,.45); }

.stick-ctl { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 14px; }
.stick-ctl span { font-size: 12px; color: var(--ash); letter-spacing: 2px; }
.stepper { display: flex; align-items: center; gap: 2px; border: 1px solid var(--line); }
.stepper button {
  width: 30px; height: 28px; border: none; cursor: pointer; color: var(--gold);
  background: rgba(228,185,95,.07); font-size: 15px; transition: .2s;
}
.stepper button:hover { background: rgba(228,185,95,.2); }
.stepper b { min-width: 40px; text-align: center; font-family: var(--font-num); font-size: 14px; color: var(--gold-hi); font-weight: 400; }

.opt-row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-bottom: 18px; }
.opt {
  cursor: pointer; border: 1px solid var(--line-soft); background: var(--panel-2);
  padding: 9px 15px; font-size: 12.5px; letter-spacing: 1px; color: var(--paper-dim);
  display: flex; align-items: center; gap: 7px; transition: .25s var(--ease);
}
.opt:hover { border-color: var(--gold-dim); color: var(--paper); }
.opt.on { border-color: var(--gold); background: rgba(228,185,95,.13); color: var(--gold-hi); }
.opt .cnt { font-family: var(--font-num); font-size: 11px; color: var(--gold-dim); }
.opt .cnt.zero { color: #b3564c; }

/* 供奉台 */
.offer { padding: 22px 18px; }
.offer h4 { font-family: var(--font-cn); font-weight: 400; font-size: 21px; letter-spacing: 3px; color: var(--gold); margin-bottom: 4px; }
.offer .hint { font-size: 11.5px; color: var(--ash); line-height: 1.9; margin-bottom: 14px; }
.offer textarea {
  width: 100%; min-height: 108px; resize: vertical;
  background: rgba(7,5,4,.7); border: 1px solid var(--line);
  color: var(--paper); font-family: var(--font-body); font-size: 13.5px; line-height: 2;
  padding: 12px; outline: none; transition: .25s;
}
.offer textarea:focus { border-color: var(--gold-dim); box-shadow: 0 0 0 3px rgba(228,185,95,.07); }
.offer textarea::placeholder { color: #5f574b; }
.char-num { text-align: right; font-family: var(--font-num); font-size: 11px; color: var(--ash); margin-top: 4px; }
.offer .btn { width: 100%; margin-top: 12px; }

.supply { margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--line); }
.supply h5 { font-size: 12px; letter-spacing: 2px; color: var(--gold-dim); font-weight: 400; margin-bottom: 10px; }
.supply ul { list-style: none; max-height: 218px; overflow-y: auto; }
.supply li { display: flex; align-items: center; gap: 9px; padding: 7px 0; border-bottom: 1px solid var(--line-soft); font-size: 12.5px; }
.supply li i { color: var(--gold); width: 15px; }
.supply li b { font-weight: 400; flex: 1; color: var(--paper-dim); }
.supply li em { font-style: normal; font-family: var(--font-num); color: var(--gold); }
/* 功德增量：原为行内 style="font-size:10.5px"（行内样式 CSS 改不动），已改为类 */
.supply li .bn-add { font-size: 11px; color: var(--ash); }

/* ==================== 签文弹层 ==================== */
.modal {
  position: fixed; inset: 0; z-index: 200; display: none;
  align-items: center; justify-content: center; padding: 22px;
  background: rgba(4,3,2,.84); backdrop-filter: blur(9px);
}
.modal.on { display: flex; animation: fade .35s both; }
.modal-x {
  position: absolute; top: 20px; right: 22px; z-index: 5;
  width: 42px; height: 42px; border-radius: 50%; cursor: pointer;
  background: rgba(20,16,12,.85); border: 1px solid var(--gold-dim); color: var(--gold-hi);
  font-size: 16px; display: grid; place-items: center; transition: .25s;
}
.modal-x:hover { background: var(--cinnabar); color: #fff; transform: rotate(90deg); }
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
.scroll-card {
  width: min(620px, 100%); max-height: 90vh; overflow-y: auto; position: relative;
  padding: 40px clamp(24px, 5vw, 52px) 34px; text-align: center;
  background: linear-gradient(170deg, #221a13, #120d09 62%);
  border: 1px solid var(--gold-dim);
  box-shadow: 0 0 70px rgba(228,185,95,.18), inset 0 0 46px rgba(0,0,0,.62);
  animation: pop .5s var(--ease) both;
}
@keyframes pop { from { transform: translateY(30px) scale(.94); opacity: 0 } to { transform: none; opacity: 1 } }
.scroll-card::before {   /* 卷轴上下轴头 */
  content: ''; position: absolute; left: -10px; right: -10px; top: 12px; height: 12px;
  background: linear-gradient(180deg, var(--gold), #6b5227);
  box-shadow: 0 0 14px rgba(228,185,95,.35);
}
.scroll-card::after {
  content: ''; position: absolute; left: -10px; right: -10px; bottom: 12px; height: 12px;
  background: linear-gradient(0deg, var(--gold), #6b5227);
  box-shadow: 0 0 14px rgba(228,185,95,.35);
}
.grade-badge {
  display: inline-grid; place-items: center; width: 88px; height: 88px; margin: 6px auto 16px;
  font-family: var(--font-cn); font-size: 30px; letter-spacing: 2px; color: #1a1208;
  background: linear-gradient(150deg, var(--gold-hi), var(--gold-dim));
  border-radius: 50%; box-shadow: 0 0 34px rgba(228,185,95,.45);
  writing-mode: vertical-rl;
}
.grade-badge.g-上上 { background: linear-gradient(150deg, #ffe9a8, #d18d2c); box-shadow: 0 0 46px rgba(255,214,120,.65); }
.grade-badge.g-上吉 { background: linear-gradient(150deg, #f6dfa4, #b58a3a); }
.grade-badge.g-下下 { background: linear-gradient(150deg, #8c8477, #4c453b); color: #e6ded0; box-shadow: 0 0 22px rgba(0,0,0,.5); }
.oracle-text {
  font-family: var(--font-cn); font-size: clamp(21px, 3vw, 28px); line-height: 2.1;
  color: var(--gold-hi); letter-spacing: 5px; margin: 12px 0 20px; text-indent: 5px;
}
.oracle-judge {
  text-align: left; font-size: 13.5px; line-height: 2.25; color: var(--paper-dim);
  border-top: 1px dashed var(--line); padding-top: 18px; margin-top: 8px;
}
.oracle-meta { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.wish-echo {
  margin-top: 18px; padding: 13px 16px; text-align: left;
  background: rgba(179,39,30,.12); border-left: 2px solid var(--cinnabar);
  font-size: 13px; line-height: 1.95; color: var(--paper);
}
.wish-echo b { color: var(--gold); font-weight: 400; display: block; margin-bottom: 4px; font-size: 11px; letter-spacing: 2px; }

/* ==================== 许愿墙（左墙 + 右侧我的愿望） ==================== */
.wall-wrap {
  display: grid; grid-template-columns: minmax(0,1fr) 316px;
  gap: 26px; margin-top: 30px; align-items: start;
}
.wall-main { min-width: 0; }
.wall-side { min-width: 0; }

/* --- 墙体 --- */
/* 高度：桌面约占 78vh、窄屏 62vh，再与「愿牌需要的高度」取大。
   --wall-rows 由 fitWall() 渲染后实测写入。
   曾经的坑：.wtag 的 top 是百分比，定位基点是 .wall-stage（relative），
   于是墙越高 → 牌 top 越大 → 需要更高的墙，形成正反馈、越算越夸张
   （40 牌时实测 1504px 仍差 267px）。解法是给 #tagCloud 显式像素高度，
   让牌的百分比基于它；墙的 min-height 再用 max() 合成。 */
.wall-stage {
  position: relative; margin-top: 22px;
  min-height: max(78vh, var(--wall-rows, 460px));
  padding: 0;
  border: 1px solid var(--line-soft);
  background:
    linear-gradient(180deg, rgba(24,18,14,.5), rgba(10,8,6,.62)),
    radial-gradient(ellipse 70% 40% at 50% 0%, rgba(228,185,95,.07), transparent 70%);
  overflow: hidden;
}
/* 愿牌容器：高度由 JS 按行数写成 --cloud-h（像素）。
   不设 inset:0 —— 那会被墙的 min-height 撑高，牌的 top:% 随之放大。 */
#tagCloud {
  position: relative; width: 100%;
  height: var(--cloud-h, 460px);
}
/* 砖缝 */
.wall-bricks {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    repeating-linear-gradient(0deg, rgba(0,0,0,.3) 0 1px, transparent 1px 30px),
    repeating-linear-gradient(90deg, rgba(0,0,0,.3) 0 1px, transparent 1px 62px);
  opacity: .6;
}
.wall-bricks::after {           /* 错缝砖块高光 */
  content: ''; position: absolute; inset: 0;
  background-image:
    repeating-linear-gradient(90deg, rgba(255,225,175,.045) 0 60px, transparent 60px 62px);
  background-size: 124px 30px;
}
/* 墙上横幅匾额 */
.wall-stage::before {
  content: '有 求 必 应'; position: absolute; left: 50%; top: 14px; transform: translateX(-50%);
  padding: 7px 30px 8px; z-index: 6; pointer-events: none;
  background: linear-gradient(180deg, #6a4a18, #38260e 74%, #241708);
  border: 1px solid rgba(246,223,164,.6); border-radius: 2px;
  font-family: var(--font-cn); font-size: 17px; letter-spacing: 6px; text-indent: 6px;
  background-clip: padding-box;
  color: transparent;
  background-image:
    linear-gradient(180deg, rgba(246,223,164,.92), rgba(150,112,44,.82));
  -webkit-background-clip: text;
  text-shadow: 0 0 18px rgba(228,185,95,.3);
  box-shadow: inset 0 1px 0 rgba(255,240,200,.32), 0 5px 18px rgba(0,0,0,.6), 0 0 22px rgba(228,185,95,.16);
}
/* 两侧宫灯 */
.wall-lanterns { position: absolute; inset: 0; pointer-events: none; z-index: 5; }
.wall-lanterns .wl {
  position: absolute; top: 20px; width: 20px; height: 46px; border-radius: 46% 46% 40% 40%;
  background: radial-gradient(ellipse at 50% 34%, #e8604a, #8e1c14 68%, #5c100b);
  box-shadow: 0 0 22px rgba(200,60,40,.42), inset 0 -6px 10px rgba(0,0,0,.42);
}
.wall-lanterns .wl::before {
  content: ''; position: absolute; left: 50%; top: -13px; transform: translateX(-50%);
  width: 1px; height: 13px; background: rgba(228,185,95,.5);
}
.wall-lanterns .wl::after {
  content: ''; position: absolute; left: 50%; bottom: -9px; transform: translateX(-50%);
  width: 9px; height: 9px; background: rgba(228,185,95,.5); border-radius: 50%;
}
.wall-lanterns .wl.l { left: 26px; }
.wall-lanterns .wl.r { right: 26px; }
/* 墙基石 */
.wall-base {
  position: absolute; left: 0; right: 0; bottom: 0; height: 34px; z-index: 4; pointer-events: none;
  background: linear-gradient(180deg, rgba(58,43,29,.5), rgba(13,10,8,.86));
  border-top: 2px solid rgba(228,185,95,.28);
}

.tag-cloud { position: absolute; inset: 52px 0 34px; }

/* --- 贴在墙上的愿牌 --- */
.wtag {
  position: absolute; width: 152px; padding: 11px 12px 12px; cursor: pointer;
  background: linear-gradient(168deg, #f4e6c8, #dcc79c 62%, #cdb887);
  color: #3a2a18; font-size: 12px; line-height: 1.78;
  box-shadow: 0 10px 22px rgba(0,0,0,.6), 0 0 0 1px rgba(90,60,26,.35);
  transform-origin: top center; transition: transform .3s var(--ease), box-shadow .3s;
  border-top: 2px solid var(--cinnabar);
}
.wtag .pin {                 /* 图钉 */
  position: absolute; left: 50%; top: -6px; width: 11px; height: 11px; margin-left: -5.5px;
  border-radius: 50%; z-index: 3;
  background: radial-gradient(circle at 34% 30%, #f4d98c, #b8862c 58%, #6d4d14);
  box-shadow: 0 2px 5px rgba(0,0,0,.6);
}
.wtag:hover {
  transform: translateX(-50%) rotate(0deg) scale(1.07) !important;
  z-index: 20; box-shadow: 0 18px 40px rgba(0,0,0,.85), 0 0 0 1px rgba(228,185,95,.6), 0 0 26px rgba(228,185,95,.3);
}
.wtag .d { font-size: 10.5px; color: #8a6b3a; letter-spacing: 1px; display: flex; justify-content: space-between; margin-bottom: 5px; }
.wtag .tx { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.wtag .lk { margin-top: 6px; font-family: var(--font-num); font-size: 10.5px; color: #9a6b4a; }
.wtag.granted { border-top-color: #3c7a5c; }
.wtag.granted .d i { font-style: normal; color: #2f6b4c; }
.wtag.watch { border-top-color: #4a4a6a; background: linear-gradient(168deg,#ded6c6,#c4bba6); }
.wtag.hidden { display: none; }

.wall-empty {
  position: absolute; left: 50%; top: 46%; transform: translate(-50%,-50%);
  text-align: center; color: var(--ash); line-height: 2.2;
}
.wall-empty i { display: block; font-size: 30px; margin-bottom: 12px; color: var(--gold-dim); opacity: .5; }
.wall-empty span { font-size: 12px; }

.tree-legend {
  position: absolute; left: 16px; bottom: 12px; display: flex; gap: 14px; flex-wrap: wrap;
  font-size: 11.5px; color: var(--ash); letter-spacing: 1px; z-index: 5;
}
.tree-legend i { display: inline-block; width: 9px; height: 9px; margin-right: 5px; transform: rotate(45deg); }

.tree-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.tree-filters .opt { padding: 7px 13px; }

/* --- 右栏：我的愿望 --- */
.mywishes { padding: 22px 18px; position: sticky; top: 16px; }
.mywishes .hint { font-size: 11.5px; color: var(--ash); line-height: 1.9; margin-bottom: 14px; }
.mw-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 16px; }
.mw-kpis .kpi {
  text-align: center; padding: 9px 3px;
  background: rgba(0,0,0,.26); border: 1px solid var(--line-soft); border-radius: 2px;
}
.mw-kpis .lb { font-size: 10.5px; color: var(--ash); letter-spacing: 1px; }
.mw-kpis .vl { font-family: var(--font-num); font-size: 19px; color: var(--gold); margin-top: 3px; }
.mw-kpis .vl small { font-size: 10px; color: var(--ash); margin-left: 1px; }
.mw-kpis .vl.ok { color: #7fc3a4; }

.mw-list { list-style: none; max-height: 560px; overflow-y: auto; }
.mw-item {
  padding: 12px 0 13px; border-bottom: 1px solid var(--line-soft);
  border-left: 2px solid var(--cinnabar); padding-left: 11px; margin-bottom: 2px;
}
.mw-item.granted { border-left-color: #3c7a5c; }
.mw-item.watch { border-left-color: #5a5a8a; }
.mw-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.mw-deity { font-family: var(--font-cn); font-size: 13px; color: var(--gold); letter-spacing: 1px; }
.mw-mark { font-size: 10.5px; color: var(--ash); flex-shrink: 0; }
.mw-item.granted .mw-mark { color: #7fc3a4; }
.mw-text { font-size: 12.5px; color: var(--paper-dim); line-height: 1.8; margin: 6px 0 7px; }
.mw-meta {
  display: flex; justify-content: space-between; font-family: var(--font-num);
  font-size: 10.5px; color: var(--ash);
}
.mw-likes i { color: var(--gold-dim); }
.mw-act { display: flex; gap: 7px; margin-top: 9px; flex-wrap: wrap; }
.mw-ok { font-size: 11.5px; color: #7fc3a4; }
.mw-lamp {
  padding: 5px 10px; font-size: 11px; cursor: pointer;
  background: rgba(228,185,95,.07); border: 1px solid var(--line); border-radius: 2px;
  color: var(--gold-dim); font-family: var(--font-body); transition: .2s;
}
.mw-lamp:hover { border-color: var(--gold-dim); color: var(--gold-hi); background: rgba(228,185,95,.15); }
.mw-empty {
  padding: 30px 0; text-align: center; color: var(--ash); font-size: 12px; line-height: 2.1;
}
.mw-empty i { display: block; font-size: 24px; margin-bottom: 10px; color: var(--gold-dim); opacity: .5; }
/* 原 11px，低于全站 12px 可读下限（.mw-empty 自身已是 12px，此行却是 11px）。
   空态只在「新注册且尚未许愿」时出现，故游客态与老账号都测不到，
   须登录态 + 清空愿望后才验得出。 */
.mw-empty span { font-size: 12px; }
.mw-foot { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); font-size: 11px; color: var(--ash); line-height: 1.9; }
.mw-foot b { color: var(--gold-dim); font-weight: 400; }

@media (max-width: 1080px) {
  .wall-wrap { grid-template-columns: 1fr; }
  .mywishes { position: static; }
  .mw-list { max-height: none; }
}
@media (max-width: 780px) {
  .wall-stage { min-height: max(62vh, var(--wall-rows, 380px)); }
  .wtag { width: 122px; font-size: 11px; padding: 9px 10px 10px; }
  .wall-lanterns .wl { width: 15px; height: 36px; }
  .wall-lanterns .wl.l { left: 12px; }
  .wall-lanterns .wl.r { right: 12px; }
}

/* ==================== 求签司 ==================== */
.lots-wrap {
  display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr);
  gap: 24px; margin-top: 26px; align-items: start;
}
.lots-left { min-width: 0; }
.lots-right { min-width: 0; }

/* 签种选择：卡片是「左内容 + 右摇签钮」两栏。
   卡片本体只负责点选（换签种），右侧钮负责直接摇这一路。 */
.lots-types { display: grid; gap: 10px; margin-bottom: 18px; }
.lot-type {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: stretch;
  background: var(--panel); border: 1px solid var(--line-soft); color: var(--paper-dim);
  transition: .28s var(--ease); position: relative; overflow: hidden;
}
.lot-type:hover { border-color: var(--gold-dim); }
.lot-type.on { border-color: var(--gold); background: rgba(228,185,95,.07); }
/* 摇签中：钮自身左右摇动七拍。签筒已撤（六路签各摇各的要六只筒），
   「签在手中」的那几下挪到这里。 */
.lot-type .lt-go.shaking { animation: go-shake .22s 7; pointer-events: none; }
@keyframes go-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}
@media (prefers-reduced-motion: reduce) {
  .lot-type .lt-go.shaking { animation: none; }
}
.lot-type.on::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--gold);
}
.lot-type .lt-pick {
  text-align: left; display: grid; gap: 3px; padding: 13px 15px 12px; min-width: 0;
  background: none; border: none; color: inherit; cursor: pointer;
}
.lot-type .lt-nm { font-family: var(--font-cn); font-size: 17px; letter-spacing: 3px; color: var(--gold-hi); }
.lot-type .lt-god { font-size: 12px; color: var(--ash); letter-spacing: 1px; }
.lot-type .lt-cnt { font-family: var(--font-num); font-size: 12px; color: var(--gold-dim); }
.lot-type .lt-desc { font-size: 12px; color: var(--ash); line-height: 1.75; margin-top: 3px; }
/* 卡上摇签钮：未选中时是描边态，选中后填金——一眼看得出「点它就摇这一路」 */
.lot-type .lt-go {
  align-self: center; justify-self: end; margin-right: 12px;
  min-height: 44px; padding: 0 17px; white-space: nowrap;
  font-family: var(--font-cn); font-size: 14px; letter-spacing: 3px;
  color: var(--gold); background: rgba(228,185,95,.08);
  border: 1px solid rgba(228,185,95,.4); cursor: pointer;
  transition: .25s var(--ease);
}
.lot-type .lt-go:hover { background: rgba(228,185,95,.18); border-color: var(--gold); }
.lot-type.on .lt-go { color: #2a1c0c; background: var(--gold); border-color: var(--gold); }


/* 所求之事：自愿填写，挂在右栏签文解读之上（问在先，解读在后）。
   不作门禁，故框线与底色比 .panel 略轻，免得看着像一道必答的题。
   复选框是 44px 点击区（label 撑开），文本框行高也按触屏标准放。 */
.lots-vow {
  padding: 14px 16px 12px;
  border: 1px solid var(--line-soft); background: rgba(7,5,4,.28);
}
.tv-hint { font-size: 12px; color: var(--ash); line-height: 1.9; margin-top: 8px; }
.tv-lb {
  display: block; font-family: var(--font-cn); font-size: 13px;
  letter-spacing: 3px; color: var(--gold-dim); margin-bottom: 8px;
}
/* 题标旁的「可留空」：明说这一栏不是必填，免得人以为不写就摇不了 */
.tv-lb i {
  font-style: normal; font-family: var(--font-body); font-size: 12px;
  letter-spacing: 1px; color: var(--ash);
  border: 1px solid var(--line-soft); padding: 1px 6px 2px; margin-left: 6px;
  vertical-align: 1px;
}
.tv-input {
  width: 100%; box-sizing: border-box; resize: none;
  background: rgba(0,0,0,.3); border: 1px solid var(--line-soft);
  color: var(--paper); font-size: 13px; line-height: 1.9; letter-spacing: 1px;
  padding: 9px 11px;
}
.tv-input::placeholder { color: var(--ash); opacity: .75; }
.tv-input:focus { outline: none; border-color: var(--gold-dim); }
/* 复选框：原生 input 只有 17px，达不到 44px 触控标准。
   故外裹一层 44×44 的点击区（input 铺满其中、透明），
   可见的方框由 .bx 画成 18px——触控面积与观感两全。 */
.tv-check {
  display: flex; align-items: center; gap: 10px;
  min-height: 44px; margin-top: 4px; padding: 0 2px;
  cursor: pointer; font-size: 12.5px; color: var(--paper-dim); line-height: 1.6;
}
.tv-box { position: relative; flex: none; width: 44px; height: 44px; display: grid; place-items: center; }
.tv-box input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.tv-box .bx {
  width: 18px; height: 18px; display: block; pointer-events: none;
  border: 1px solid var(--line); background: rgba(0,0,0,.32);
}
.tv-box input:checked + .bx { background: var(--gold); border-color: var(--gold); }
.tv-box input:checked + .bx::after {
  content: ''; display: block; width: 9px; height: 5px; margin: 4px auto 0;
  border-left: 2px solid #2a1c0c; border-bottom: 2px solid #2a1c0c;
  transform: rotate(-45deg);
}
.tv-box input:focus-visible + .bx { outline: 2px solid var(--gold-dim); outline-offset: 2px; }
.tv-tx { line-height: 1.6; }

.lh-vow { display: block; font-style: normal; font-size: 12px; color: var(--ash); margin-top: 3px; }

/* 功德箱：放在签文解读之下。求签是「问」，随手功德是「谢」——
   谢意起于得签之后，入口该在这个位置，不该挨着签筒。 */
.lots-donate {
  margin-top: 18px; padding: 14px 18px;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.lots-donate .ld-tx { display: grid; gap: 2px; min-width: 0; }
.lots-donate .ld-tx strong {
  font-family: var(--font-cn); font-weight: 400; font-size: 16px;
  letter-spacing: 3px; color: var(--gold-hi);
}
.lots-donate .ld-tx span { font-size: 12px; color: var(--ash); letter-spacing: 1px; }
.lots-donate .btn { margin-left: auto; }
.sf-links { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; }

/* 空态 */
.lot-empty {
  padding: 54px 24px; text-align: center; color: var(--ash); line-height: 2.1;
}
.lot-empty > i { display: block; font-size: 30px; margin-bottom: 14px; color: var(--gold-dim); opacity: .7; }
.lot-empty p span { font-size: 12.5px; color: var(--ash); }

/* 签文 */
.lot-slip {
  background: var(--panel); border: 1px solid var(--line-soft); padding: 24px 26px 20px;
  position: relative;
}
.lot-slip.drop { animation: slip-in .5s var(--ease) both; }
@keyframes slip-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) { .lot-slip.drop { animation: none; } }
.slip-head { display: flex; align-items: baseline; gap: 12px; }
.slip-no { font-family: var(--font-cn); font-size: 15px; letter-spacing: 3px; color: var(--ash); }
.slip-grade {
  font-size: 12px; letter-spacing: 2px; padding: 3px 11px 4px;
  border: 1px solid var(--line); color: var(--ash);
}
.slip-grade.g-1 { color: #c9302c; border-color: rgba(201,48,44,.55); background: rgba(201,48,44,.1); }
.slip-grade.g-2 { color: #e4a13c; border-color: rgba(228,161,60,.5); background: rgba(228,161,60,.08); }
.slip-grade.g-3 { color: var(--gold); border-color: rgba(228,185,95,.4); }
.slip-grade.g-4 { color: #8f9aa8; border-color: rgba(143,154,168,.4); }
.slip-grade.g-5 { color: #7f8a76; border-color: rgba(127,138,118,.4); }
.slip-title {
  font-family: var(--font-cn); font-weight: 400; font-size: 27px; letter-spacing: 6px;
  color: var(--gold-hi); margin: 12px 0 16px;
}
.slip-poem {
  padding: 16px 18px; margin-bottom: 18px; background: rgba(7,5,4,.34);
  border-left: 2px solid var(--gold-dim);
  display: flex; flex-direction: column; gap: 7px;
}
.slip-poem span {
  font-family: var(--font-cn); font-size: 17px; letter-spacing: 3px; line-height: 1.9; color: var(--paper);
}
.slip-judge { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 12px; margin-bottom: 20px; }
.slip-judge .sj-lb {
  font-family: var(--font-cn); font-size: 14px; letter-spacing: 2px; color: var(--gold-dim);
  padding-top: 2px;
}
.slip-judge p { font-size: 13px; line-height: 2.05; color: var(--paper-dim); }

/* 签等释义：题下的一行小注，按签等取总纲（同签等各签一律） */
.slip-gnote {
  margin: -6px 0 16px; font-size: 12.5px; color: var(--ash);
  letter-spacing: 1px; line-height: 1.9;
}

/* 宜 · 忌 · 应期：签本的通例，解曰之后、分项之断之前。
   三枚筹码横排——「宜」青、「忌」赤、「应期」金，一眼分清该做什么、
   避什么、等什么。窄屏折成竖列。 */
.slip-luck {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px;
  margin-bottom: 20px;
}
.sl-chip {
  display: grid; gap: 5px; padding: 10px 13px 11px;
  border: 1px solid var(--line-soft); background: rgba(7,5,4,.3);
}
.sl-chip .sl-lb {
  font-family: var(--font-cn); font-size: 13px; letter-spacing: 3px;
}
.sl-chip:nth-child(1) .sl-lb { color: #6fb592; }
.sl-chip:nth-child(2) .sl-lb { color: #d8453a; }
.sl-chip:nth-child(3) .sl-lb { color: var(--gold-dim); }
.sl-chip b {
  font-weight: 400; font-size: 12.5px; color: var(--paper-dim);
  line-height: 1.85; letter-spacing: .5px;
}
.slip-aspects { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px 20px; }
.sa-item {
  padding: 11px 13px 12px; background: rgba(7,5,4,.3); border: 1px solid var(--line-soft);
}
.sa-item .sa-lb {
  display: block; font-size: 12px; letter-spacing: 1px; color: var(--gold-dim); margin-bottom: 4px;
}
.sa-item p { font-size: 12.5px; line-height: 1.95; color: var(--paper-dim); }
.sa-none { grid-column: 1 / -1; font-size: 12px; color: var(--ash); line-height: 2; }
.slip-foot {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--line-soft);
  font-size: 12px; color: var(--ash); letter-spacing: 1px;
}
.slip-foot #btnRedraw { margin-left: auto; }

/* 求签记录 */
.lots-history { margin-top: 20px; }
.lots-history h4 {
  font-family: var(--font-cn); font-weight: 400; font-size: 15px; letter-spacing: 3px;
  color: var(--gold-dim); margin-bottom: 10px;
}
.lh-empty { font-size: 12px; color: var(--ash); line-height: 2; }
.lh-list { list-style: none; }
.lh-list li {
  display: flex; align-items: center; gap: 11px; padding: 9px 0;
  border-bottom: 1px solid var(--line-soft); font-size: 12px;
}
.lh-list li:last-child { border-bottom: none; }
.lh-g {
  flex: none; font-size: 12px; letter-spacing: 1px; padding: 2px 9px 3px;
  border: 1px solid var(--line); color: var(--ash);
}
.lh-g.g-1 { color: #c9302c; border-color: rgba(201,48,44,.5); }
.lh-g.g-2 { color: #e4a13c; border-color: rgba(228,161,60,.45); }
.lh-g.g-3 { color: var(--gold); border-color: rgba(228,185,95,.35); }
.lh-g.g-4 { color: #8f9aa8; }
.lh-g.g-5 { color: #7f8a76; }
.lh-tx { flex: 1; min-width: 0; color: var(--paper-dim); }
.lh-d { flex: none; font-family: var(--font-num); font-size: 12px; color: var(--ash); }

@media (max-width: 900px) {
  .lots-wrap { grid-template-columns: 1fr; }
  .lots-types { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
  .slip-title { font-size: 24px; }
  .slip-poem span { font-size: 16px; }
}
@media (max-width: 640px) {
  .lot-type .lt-desc { display: none; }
  .lots-types { grid-template-columns: 1fr; }
  .slip-luck { grid-template-columns: 1fr; }
  .slip-aspects { grid-template-columns: 1fr; }
  .slip-judge { grid-template-columns: 1fr; gap: 4px; }
  .slip-foot #btnRedraw { margin-left: 0; width: 100%; min-height: 44px; }
}

/* ==================== 香烛司（商城） ==================== */
.shop-head {
  display: flex; align-items: flex-end; gap: 20px; flex-wrap: wrap;
  margin-top: 34px; padding: 20px 24px; position: relative; overflow: hidden;
}
.shop-head h3 { font-family: var(--font-cn); font-weight: 400; font-size: 28px; letter-spacing: 5px; color: var(--gold-hi); }
.shop-head p { font-size: 12.5px; color: var(--ash); line-height: 1.9; max-width: 520px; }
.shop-head .fx { margin-left: auto; text-align: right; font-family: var(--font-num); font-size: 12px; color: var(--paper-dim); }
.shop-head .fx b { display: block; font-size: 26px; color: var(--gold); font-weight: 400; }

.kind-tabs { display: flex; gap: 2px; margin: 26px 0 18px; flex-wrap: wrap; }
.kind-tabs button {
  cursor: pointer; border: 1px solid var(--line-soft); background: var(--panel);
  color: var(--paper-dim); font-family: var(--font-body); font-size: 13px; letter-spacing: 2px;
  padding: 9px 20px; transition: .25s;
}
.kind-tabs button:hover { color: var(--paper); border-color: var(--gold-dim); }
.kind-tabs button.on { background: rgba(228,185,95,.14); color: var(--gold-hi); border-color: var(--gold); }

/* ==================== 游客每日免费香（香烛司） ==================== */
.guest-grant { margin: 0 0 22px; border-color: rgba(111,181,146,.34); }
.guest-grant::after {
  content: '赠'; position: absolute; right: 26px; top: 50%; transform: translateY(-50%) rotate(8deg);
  font-family: var(--font-cn); font-size: 108px; line-height: 1; color: rgba(111,181,146,.07);
  pointer-events: none;
}
.gg-head { display: flex; gap: 14px; align-items: flex-start; padding: 18px 20px 0; position: relative; }
.gg-head .seal {
  flex: none; width: 38px; height: 38px; display: grid; place-items: center;
  border: 1px solid rgba(111,181,146,.5); color: #8fc7a8;
  font-family: var(--font-cn); font-size: 19px; transform: rotate(-3deg);
}
.gg-head h3 { font-family: var(--font-cn); font-weight: 400; font-size: 19px; letter-spacing: 4px; color: var(--paper); }
.gg-head p { font-size: 12px; color: var(--ash); line-height: 1.9; margin-top: 5px; }
.gg-head p b { color: #8fc7a8; font-weight: 400; }
.gg-body {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px; padding: 16px 20px 4px; position: relative;
}
.gg-it {
  display: flex; align-items: center; gap: 11px; padding: 12px 14px;
  border: 1px solid var(--line-soft); background: rgba(7,5,4,.32);
}
.gg-it > i { font-size: 17px; color: var(--gold-dim); flex: none; }
.gi-t { flex: 1; min-width: 0; }
.gi-t b { display: block; font-size: 13px; color: var(--paper); font-weight: 400; letter-spacing: 1px; }
.gi-t span { font-size: 11.5px; color: var(--ash); }
.gi-c { font-family: var(--font-num); font-size: 12px; color: var(--paper-dim); white-space: nowrap; }
.gg-it .btn { flex: none; min-width: 78px; }
.gg-tip {
  padding: 12px 20px 18px; font-size: 12px; line-height: 2; color: var(--ash); position: relative;
}
.gg-tip b { color: #8fc7a8; font-weight: 400; }

/* 正殿游客许愿额度提示 */
.guest-quota {
  margin: 12px 0 2px; padding: 10px 14px; font-size: 12px; line-height: 1.9;
  color: var(--ash); border-left: 2px solid rgba(111,181,146,.5); background: rgba(111,181,146,.06);
}
.guest-quota b { color: #8fc7a8; font-weight: 400; }

.sku-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(258px, 1fr));
  gap: 18px; padding-bottom: 10px;
}
/* 请神页：画像占位更宽 */
#deityGrid { grid-template-columns: repeat(auto-fill, minmax(292px, 1fr)); }
.sku {
  position: relative; padding: 20px 18px 18px; display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--line-soft);
  transition: .35s var(--ease); overflow: hidden;
}
.sku::before {   /* 破格：右上角斜切金线 */
  content: ''; position: absolute; top: -30px; right: -30px; width: 76px; height: 76px;
  background: linear-gradient(135deg, rgba(228,185,95,.16), transparent 60%);
  transform: rotate(45deg);
}
.sku:hover { transform: translateY(-6px); border-color: var(--gold-dim); box-shadow: 0 16px 36px rgba(0,0,0,.55); }
.sku .ic {
  width: 46px; height: 46px; display: grid; place-items: center; font-size: 19px;
  color: var(--gold-hi); border: 1px solid var(--line);
  background: radial-gradient(circle at 34% 26%, rgba(228,185,95,.22), transparent 68%);
  margin-bottom: 12px;
}
.sku h4 { font-family: var(--font-body); font-weight: 400; font-size: 16px; letter-spacing: 2px; color: var(--paper); margin-bottom: 6px; }
.sku .ds { font-size: 12px; line-height: 1.95; color: var(--ash); flex: 1; margin-bottom: 12px; }
.sku .bt { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.sku .pr { font-family: var(--font-num); font-size: 20px; color: var(--gold); }
.sku .pr small { font-size: 11px; color: var(--ash); margin-left: 4px; }
.sku .bn { font-size: 11px; color: var(--stone); letter-spacing: 1px; }
.sku .st { position: absolute; top: 14px; right: 14px; font-size: 10px; color: #b3564c; font-family: var(--font-num); }
.sku .fl {
  position: absolute; top: 0; left: 0; padding: 3px 10px; font-size: 10px; letter-spacing: 1px;
  background: var(--gold-dim); color: #1a1208;
}
.sku .fl.lux { background: linear-gradient(90deg, #b58a3a, #f6dfa4); }
.sku .fl.popular { background: linear-gradient(90deg, #8d2019, #d8453a); color: #f6dfa4; }
.sku .btn.sm { margin-left: auto; margin-top: 14px; }
.sku .btn.wide { width: 100%; margin-left: 0; }
/* 角标出现时给图标让位 */
.sku .ic { margin-bottom: 12px; }
.sku:has(.fl) .ic, .sku:has(.st) .ic { margin-left: 2px; }
.sku .bt .bn { margin-left: auto; }

/* 购物车抽屉 */
.cart-fab {
  position: fixed; right: 26px; bottom: 26px; z-index: 70; cursor: pointer;
  width: 62px; height: 62px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(150deg, var(--cinnabar), #6d1611); color: var(--gold-hi);
  border: 1px solid var(--gold-dim); font-size: 21px;
  box-shadow: 0 10px 30px rgba(0,0,0,.7); transition: .3s var(--ease);
}
.cart-fab:hover { transform: scale(1.07); }
.cart-fab .badge {
  position: absolute; top: -3px; right: -3px; min-width: 23px; height: 23px; padding: 0 5px;
  display: grid; place-items: center; border-radius: 12px; font-size: 12px;
  background: var(--gold); color: #1a1208; font-family: var(--font-num); font-weight: 700;
}
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 120; width: min(430px, 100%);
  background: linear-gradient(180deg, #17110c, #0c0907); border-left: 1px solid var(--gold-dim);
  display: flex; flex-direction: column;
  /* 关闭态整体移出视口右侧（translateX 102%），必然超宽。
     visibility:hidden 令关闭时既不可交互、也不参与横向溢出计算。
     visibility 是离散属性，须配合 transition 延迟：
     关闭时「先滑走、到 .42s 再隐藏」，打开时「立即显示、同时滑入」，
     否则抽屉会瞬移而非滑入。 */
  transform: translateX(102%);
  visibility: hidden;
  transition: transform .42s var(--ease), visibility 0s .42s;
}
.drawer.on {
  transform: none; visibility: visible;
  transition: transform .42s var(--ease), visibility 0s 0s;
}
.drawer header {
  padding: 20px 22px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
}
.drawer header h4 { font-family: var(--font-cn); font-weight: 400; font-size: 23px; letter-spacing: 4px; color: var(--gold-hi); }
.drawer .x { cursor: pointer; color: var(--ash); font-size: 17px; background: none; border: none; }
.drawer .x:hover { color: var(--cinnabar-hi); }
.drawer .items { flex: 1; overflow-y: auto; padding: 14px 22px; }
.drawer .it { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line-soft); }
.drawer .it .ic { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--line); color: var(--gold); }
.drawer .it .info { flex: 1; }
.drawer .it .info b { display: block; font-weight: 400; font-size: 13.5px; color: var(--paper); letter-spacing: 1px; }
.drawer .it .info span { font-size: 11px; color: var(--ash); }
.drawer .it .pr { font-family: var(--font-num); font-size: 14px; color: var(--gold); }
.drawer footer { padding: 18px 22px; border-top: 1px solid var(--line); background: rgba(7,5,4,.6); }
.drawer .sum { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; font-size: 13px; color: var(--paper-dim); letter-spacing: 1px; }
.drawer .sum b { font-family: var(--font-num); font-size: 26px; color: var(--gold); font-weight: 400; }
.drawer footer .btn { width: 100%; }
.drawer .empty { text-align: center; color: var(--ash); font-size: 13px; padding: 54px 0; line-height: 2; }

/* 背包 */
.bag-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }

/* ---- 卡片网格的响应式断点（须放在三个网格的基础定义之后）----
   原只有 auto-fill + minmax，没有任何断点覆盖：390px 视口的内容区约 358px，
   装不下两列（258×2+18=534），于是请神 15 张卡全堆成单列、整页 13 屏。
   曾把此块放在 .sku-grid 之后，结果 .bag-grid 的基础定义在更后面，
   同特异性下后者胜，bag 在 430px 以下仍是单列——断点必须晚于所有被它覆盖的规则。
   两列时卡宽已不足 180px，故用 minmax(0,1fr) 而非再留 minmax 下限，
   留了下限会把轨道顶爆、反而溢出。 */
@media (max-width: 640px) {
  .sku-grid, #deityGrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .bag-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  /* 两列后卡宽不足 180px，「燃/用一件」与「用五件」横排会溢出卡右缘，
     故改竖排——顺带让每个按钮都拿到全宽，触控目标比横排时更大。 */
  .bag-item .use-btns { flex-direction: column; }
  .bag-item .use-btns .mini { width: 100%; }
}

.bag-item {
  padding: 16px; border: 1px solid var(--line-soft); background: var(--panel);
  display: flex; flex-direction: column; gap: 9px;
}
.bag-item .t { display: flex; align-items: center; gap: 10px; }
.bag-item .t .ic { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--line); color: var(--gold); }
.bag-item .t b { font-weight: 400; font-size: 14px; letter-spacing: 1px; }
.bag-item .t em { margin-left: auto; font-style: normal; font-family: var(--font-num); color: var(--gold); font-size: 15px; }
.bag-item .ds { font-size: 11.5px; color: var(--ash); line-height: 1.8; }
.bag-item .use-btns { display: flex; gap: 6px; margin-top: 4px; }

/* ==================== 后台遗留的通用表格 / 指标件 ==================== */
.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 24px; }
.kpi { padding: 18px; background: var(--panel); border: 1px solid var(--line-soft); position: relative; overflow: hidden; }
.kpi::after {
  content: ''; position: absolute; right: -18px; bottom: -18px; width: 62px; height: 62px;
  border: 1px solid var(--line-soft); transform: rotate(45deg);
}
.kpi .lb { font-size: 11.5px; color: var(--ash); letter-spacing: 2px; }
.kpi .vl { font-family: var(--font-num); font-size: 30px; color: var(--gold); margin: 6px 0 2px; }
.kpi .vl small { font-size: 12px; color: var(--ash); margin-left: 5px; }
.kpi .df { font-size: 11px; color: var(--stone); }

.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th {
  text-align: left; padding: 11px 12px; font-weight: 400; font-size: 11.5px; letter-spacing: 2px;
  color: var(--gold); border-bottom: 1px solid var(--line); background: rgba(228,185,95,.05); white-space: nowrap;
}
.tbl td { padding: 11px 12px; border-bottom: 1px solid var(--line-soft); color: var(--paper-dim); vertical-align: middle; }
.tbl tr:hover td { background: rgba(228,185,95,.035); color: var(--paper); }
.tbl .num { font-family: var(--font-num); color: var(--gold); }
.tbl input, .tbl select {
  background: rgba(7,5,4,.7); border: 1px solid var(--line-soft); color: var(--paper);
  padding: 6px 9px; font-family: var(--font-body); font-size: 12.5px; outline: none; width: 100%; min-width: 80px;
}
.tbl input:focus, .tbl select:focus { border-color: var(--gold-dim); }
.mini {
  cursor: pointer; border: 1px solid var(--line); background: rgba(228,185,95,.06);
  color: var(--paper-dim); font-size: 11.5px; padding: 5px 11px; font-family: var(--font-body);
  letter-spacing: 1px; transition: .2s; white-space: nowrap;
}
.mini:hover { color: var(--gold-hi); border-color: var(--gold-dim); background: rgba(228,185,95,.14); }
.mini.danger:hover { color: #fff; background: var(--cinnabar); border-color: var(--cinnabar); }

.status-pill { font-size: 11px; padding: 3px 10px; border: 1px solid; letter-spacing: 1px; white-space: nowrap; }
.st-paid    { color: var(--gold); border-color: rgba(228,185,95,.4); }
.st-shipped { color: #7fb0c4; border-color: rgba(127,176,196,.4); }
.st-done    { color: #6fb592; border-color: rgba(111,181,146,.4); }
.st-cancel  { color: #a3706a; border-color: rgba(163,112,106,.4); }
.st-pending { color: var(--gold); border-color: rgba(228,185,95,.35); }
.st-granted { color: #6fb592; border-color: rgba(111,181,146,.35); }
.st-watch   { color: #9a9ad0; border-color: rgba(154,154,208,.35); }
.st-hidden  { color: #777; border-color: rgba(119,119,119,.4); text-decoration: line-through; }

.split { display: grid; grid-template-columns: 1fr 340px; gap: 20px; align-items: start; }
@media (max-width: 1080px) { .split { grid-template-columns: 1fr; } }


/* ==================== 页脚 / 提示 ==================== */
.footer {
  position: relative; z-index: 2; margin-top: 90px; padding: 34px clamp(16px, 4vw, 54px);
  border-top: 1px solid var(--line-soft); display: flex; gap: 22px; flex-wrap: wrap;
  align-items: center; font-size: 11.5px; color: var(--ash); letter-spacing: 1px; line-height: 2;
}
.footer .fm { font-family: var(--font-cn); font-size: 19px; color: var(--gold-dim); letter-spacing: 4px; }
.footer .sp { margin-left: auto; text-align: right; }

/* ---- 页脚寺志：把散在各页 sec-note 的口径收拢到一处 ---- */
.temple-note {
  position: relative; z-index: 2; margin-top: 26px;
  padding: 30px clamp(16px, 4vw, 54px) 22px;
  border-top: 1px solid var(--line-soft); background: rgba(7,5,4,.4);
}
.tn-grid {
  max-width: 1440px; margin: 0 auto; display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 26px 34px;
}
.tn-col h4 {
  font-family: var(--font-cn); font-weight: 400; font-size: 14px; letter-spacing: 3px;
  color: var(--gold-dim); margin-bottom: 12px;
  padding-bottom: 8px; border-bottom: 1px solid var(--line-soft);
}
.tn-col p { font-size: 12px; color: var(--ash); line-height: 2.1; margin-bottom: 10px; }
.tn-col p:last-child { margin-bottom: 0; }
.tn-col b { color: var(--paper-dim); font-weight: 400; }
.tn-foot {
  max-width: 1440px; margin: 24px auto 0; padding-top: 14px;
  border-top: 1px solid var(--line-soft);
  font-size: 12px; color: var(--ash); letter-spacing: 2px; text-align: center;
}

/* ==================== 香囊页 · 香火账 ==================== */
.incense-ledger {
  margin-top: 24px; padding: 24px 26px 22px;
  background: var(--panel); border: 1px solid var(--line-soft); position: relative;
}
.led-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.led-head h3 { font-family: var(--font-cn); font-weight: 400; font-size: 22px; letter-spacing: 5px; color: var(--gold-hi); }
.led-head p { font-size: 12px; color: var(--ash); line-height: 2; }
.led-head p b { color: var(--gold-dim); font-weight: 400; }
.led-grid {
  display: grid; grid-template-columns: minmax(0, 200px) minmax(0, 1fr) minmax(0, 150px);
  gap: 18px; align-items: stretch;
}
.led-kpi, .led-split {
  padding: 14px 16px; border: 1px solid var(--line-soft); background: rgba(7,5,4,.32);
  display: flex; flex-direction: column; justify-content: center; gap: 4px;
}
.led-kpi .lb, .led-split .lb { font-size: 12px; color: var(--ash); letter-spacing: 1px; }
.led-kpi .vl, .led-split .vl { font-family: var(--font-num); font-size: 26px; color: var(--gold); font-weight: 400; }
.led-kpi .vl small, .led-split .vl small { font-size: 12px; color: var(--ash); margin-left: 4px; }
.led-split .vl { font-size: 20px; }
.led-split .vl i { font-style: normal; color: var(--ash); margin: 0 4px; }
.led-src { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 18px; align-content: center; }
.led-row {
  display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--paper-dim);
  padding: 7px 0; border-bottom: 1px solid var(--line-soft);
}
.led-row i { width: 18px; text-align: center; font-size: 12px; color: var(--gold-dim); flex: none; }
.led-row span { flex: 1; min-width: 0; }
.led-row b { font-family: var(--font-num); font-weight: 400; flex: none; }
.led-row.in b { color: #6fb592; }
.led-row.out b { color: #d8453a; }
.led-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.led-card {
  padding: 13px 15px; border: 1px solid var(--line-soft); background: rgba(7,5,4,.32);
  display: flex; flex-direction: column; gap: 5px;
}
.led-card .lb { font-size: 12px; color: var(--ash); letter-spacing: 1px; }
.led-card .vl { font-family: var(--font-num); font-size: 22px; color: var(--gold); font-weight: 400; }
.led-card .vl small { font-size: 12px; color: var(--ash); margin-left: 3px; }
.led-card .sub { font-size: 12px; color: var(--ash); line-height: 1.7; }
.led-guest {
  display: flex; align-items: center; gap: 16px; padding: 22px 26px;
  border: 1px dashed var(--line); background: rgba(7,5,4,.3);
}
.led-guest > i { font-size: 22px; color: var(--gold-dim); flex: none; }
.led-guest b { color: var(--paper-dim); font-weight: 400; }
.led-guest div { font-size: 12px; color: var(--ash); line-height: 2; }

@media (max-width: 900px) {
  .led-grid { grid-template-columns: 1fr 1fr; }
  .led-src { grid-column: 1 / -1; }
  .led-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .led-grid { grid-template-columns: 1fr; }
  .led-src { grid-template-columns: 1fr; gap: 0; }
  .led-head h3 { font-size: 19px; }
  .tn-col p { font-size: 12px; }
}

.toast-wrap { position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%); z-index: 300; display: flex; flex-direction: column; gap: 9px; align-items: center; }
.toast {
  padding: 12px 26px; font-size: 13px; letter-spacing: 2px; color: var(--gold-hi);
  background: rgba(20,16,12,.96); border: 1px solid var(--gold-dim);
  box-shadow: 0 10px 32px rgba(0,0,0,.7); animation: tin .35s var(--ease) both;
}
.toast.bad { color: #f0b3ac; border-color: rgba(216,69,58,.6); }
@keyframes tin { from { transform: translateY(16px); opacity: 0 } to { transform: none; opacity: 1 } }

/* 飘香粒子背景（纯 CSS，少量） */
.motes { position: fixed; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; }
.motes i {
  position: absolute; bottom: -8px; width: 2px; height: 2px; border-radius: 50%;
  background: rgba(228,185,95,.5); animation: float 14s linear infinite;
}
@keyframes float {
  0% { transform: translateY(0) translateX(0); opacity: 0; }
  15% { opacity: .7; }
  100% { transform: translateY(-102vh) translateX(30px); opacity: 0; }
}

@media (max-width: 640px) {
  .topbar { flex-wrap: wrap; gap: 12px; padding: 12px 16px; }
  .nav { order: 3; width: 100%; margin-left: 0; overflow-x: auto; }
  .wallet { margin-left: auto; }
  .brand-sub { display: none; }
  /* 神龛斜幡不再越界 */
  .shrine::before { right: 4px; width: 44px; height: 118px; opacity: .26; }
  .shrine { padding: 20px 16px 18px; }
  .shrine-glyph { width: 76px; height: 76px; font-size: 40px; }
  .shrine h3 { font-size: 28px; letter-spacing: 3px; }
  /* 香炉与烛台在窄屏内收拢 */
  .censer { height: 156px; }
  .censer-bowl { width: 150px; height: 56px; }
  .candle.side-l { left: calc(50% - 106px); }
  .candle.side-r { left: calc(50% + 90px); }
  .stick { height: 96px; }
  .altar-body { padding: 30px 12px 0; }
  .altar-body::before, .altar-body::after { width: 9px; }
  .cart-fab { width: 52px; height: 52px; right: 16px; bottom: 16px; font-size: 18px; }
  .toast-wrap { bottom: 82px; }
  .toast { font-size: 12px; padding: 10px 18px; letter-spacing: 1px; }
  .modal-x { top: 10px; right: 12px; width: 36px; height: 36px; }
  .footer { gap: 12px; }
  .footer .sp { margin-left: 0; text-align: left; }

  }

/* ==================== 触控目标与可读字号（≤900px，覆盖平板竖屏）====================
   为什么是 900 而不是 640：原先这套补足只写在 640px 断点内，而 iPad 竖屏
   768px、横向 820~900px 恰好落在 641~900 这段「断点空档」里——触控目标与字号
   一项都没生效（实测 768 下小触控 12~27 个、小字号 13~18 个）。
   iPad 同样靠手指操作，44px / 12px 标准不该只照顾手机。
   断点由 640 提到 900 后，640 断点内只保留布局性调整（换行、收拢、隐藏），
   「加高 / 放大 / 补tap 高亮」全部上移到此处，避免两处重复维护。

   注意两条覆盖铁律：
   ① 原规则自带后代选择器时，覆盖须同权重（.sku .bn 压不过 .sku .bn 的低权重版），
      必要时用 id（#btnCheckin 特异性 (1,0,0) 高于一切类选择器）。
   ② 类定义在哪个 CSS 文件，就得写进那个文件——写错文件等于无效。
      本段只放 main.css 里的类；fortune.css / nether.css / donate.css /
      account.css 各自的类在各自文件的 900px 断点内补。 */
@media (max-width: 900px) {
  /* 导航按钮原高 38px（padding 9px + 14px 字号），低于 44px 建议下限，
     手指易误触相邻项；并补 tap 高亮（移动端无 hover，点击无反馈是常见缺陷）。 */
  .nav button { padding: 13px 16px; min-height: 44px; -webkit-tap-highlight-color: rgba(228,185,95,.16); }
  .nav button::after { left: 16px; right: 16px; bottom: 6px; }

  .btn.sm { padding: 12px 18px; font-size: 13px; min-height: 44px; }
  .btn { min-height: 46px; }
  /* 页头钱包内的「添香油」（id 选择器特异性最高，须用 id 覆盖） */
  .wallet button, #btnCheckin { min-height: 44px; padding: 10px 14px; }
  .ft-tabs button { min-height: 44px; }
  .adj { min-width: 44px; min-height: 44px; display: grid; place-items: center; }
  .ft-sel { min-height: 44px; }
  .user-btn { min-height: 44px; min-width: 64px; padding: 8px 14px; }
  .opt { min-height: 44px; }              /* 香案「点一对红烛」等（原 138×39） */
  .drawer input, .offer input, input[type="text"], input[type="number"] { min-height: 44px; }
  .drawer .x, .modal-x { min-width: 44px; min-height: 44px; display: grid; place-items: center; }
  /* 以下三条原选择器自带后代/类组合，须同权重才不被压制 */
  .sku .btn.sm.wide { min-height: 44px; }
  .ft-actions .btn.sm { min-height: 44px; }
  /* 商城品类页签（原 72×39） */
  .kind-tabs button { min-height: 44px; }
  /* 请神页香支步进器「−/+」（原 30×28） */
  .stepper button { min-height: 44px; min-width: 44px; }
  /* 香囊页「燃/用一件」次级按钮（原 79×28，本尺寸在平板上尤其难点） */
  .use-btns .mini { min-height: 44px; padding: 10px 14px; }
  /* 许愿墙筛选页签（原 55×35） */
  .tree-filters .opt { min-height: 44px; }
  /* 还愿列表「还愿」按钮（原 49×28）与我方愿望「代点一盏灯」（原 85×28）。
     这两个只在登录后有内容，故游客态审计测不出，须登录态复测才不漏。 */
  .repay-list .rp-btn, .mw-lamp { min-height: 44px; padding: 10px 14px; }

  /* ---- 最小 12px：11px 及以下的标签在触屏上已难辨读 ---- */
  .tagg, .sku .bn, .opt .cnt, .fl, .st,
  .offer .hint, .mywishes .hint, .auth-form .hint, .pay-fields .hint,
  .lbl, .tip,
  .hd-form .tip, .pay-code .tip { font-size: 12px; }
  /* 以下几条原规则自带后代选择器，须同权重才不被压制 */
  .sku .st, .hall-plaque i, .char-num, .repay-foot b, .repay-foot { font-size: 12px; }
  .beast figcaption i { font-size: 12px; }
  .beast figcaption b { font-size: 12px; }
  .supply li em, .supply li { font-size: 12px; }
  .supply li .bn-add { font-size: 12px; }
  .ft-shichen-t, .ft-sec-tit { font-size: 12px; }
  .sku .pr small, .repay-list .rp-txt small, .mw-kpis .vl small,
  .fl.popular, .fl.lux, .sku .fl, .sec-note, .shop-coin-tip { font-size: 12px; }
  .dchip span { font-size: 12px; }        /* 请神页香牌档位「道家/佛家/…」（原 10px） */
  .wallet button { font-size: 12px; }
  .brand-sub { font-size: 12px; }
  .footer { font-size: 12px; }
  /* 许愿墙：愿牌（.wtag）内的神名/状态/正文/点赞数，原10~11px */
  .wtag .d span, .wtag .d i, .wtag .tx, .wtag .lk { font-size: 12px; }
  .tree-legend span, .mw-foot, .mw-foot b { font-size: 12px; }
  /* 香囊页物品描述 */
  .bag-item .ds { font-size: 12px; }
  .use-btns .mini { font-size: 12px; }
  /* 还愿列表与其余小标签（原 11 / 11.5px） */
  .repay-list .rp-btn, .mw-lamp, .repay-list .rp-ok, .mw-ok { font-size: 12px; }
  .repay-list .rp-txt small { font-size: 12px; }
  .mw-mark { font-size: 12px; }
  .mw-kpis .lb { font-size: 12px; }
  .kpi .lb { font-size: 12px; }
  /* 我方愿望条目：神名 11px、日期与点赞数 10.5px */
  .mw-deity { font-size: 12px; }
  .mw-meta { font-size: 12px; }
  /* 表格表头（香单/日期/品名等，11.5px）与状态徽标（在狱/待验，11px） */
  .tbl th { font-size: 12px; }
  .status-pill { font-size: 12px; }
  /* 游客免费香区 */
  .gg-head p, .gi-t span, .gi-c, .gg-tip, .guest-quota { font-size: 12px; }
  .gg-head h3 { font-size: 19px; }
  .gg-head { padding: 16px 16px 0; }
  .gg-body { grid-template-columns: 1fr; padding: 14px 16px 2px; }
  .gg-it { padding: 12px; }
  .gg-it .btn { min-height: 44px; min-width: 92px; }
  .guest-grant::after { right: 14px; font-size: 84px; }

  /* 点击反馈：触屏无 hover，须补 tap 高亮 */
  .btn, .opt, .adj, .ft-tabs button, .user-btn, .cart-fab, .drawer .x, .modal-x,
  .kind-tabs button, .stepper button, .mini, .tree-filters .opt {
    -webkit-tap-highlight-color: rgba(228,185,95,.16);
  }
}