/* =========================================================
   云隐禅寺 · ZenSpace 宋代禅意美学样式表
   ========================================================= */

:root {
  --bg-obsidian: #0e0b09;
  --bg-timber: rgba(24, 18, 14, 0.78);
  --bg-timber-solid: #1a130e;
  --bg-lacquer: #231812;
  --border-gold: rgba(218, 178, 102, 0.28);
  --border-gold-strong: rgba(232, 194, 118, 0.56);
  --gold: #e0b768;
  --gold-bright: #f5d896;
  --cinnabar: #a83328;
  --cinnabar-bright: #cf4638;
  --jade: #7ec4b5;
  --paper: #f3ead8;
  --paper-deep: #e6d7bd;
  --ink: #271e17;
  --text-main: #f3ead8;
  --text-muted: rgba(236, 223, 200, 0.68);
  --text-soft: rgba(236, 223, 200, 0.45);
  --font-serif: 'Noto Serif SC', 'Songti SC', 'STSong', 'SimSun', serif;
  --font-calligraphy: 'Ma Shan Zheng', 'STKaiti', 'Kaiti SC', 'Noto Serif SC', serif;
  --shadow-deep: 0 16px 48px rgba(0, 0, 0, 0.65);
  --radius-md: 14px;
  --radius-lg: 20px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-obsidian);
  color: var(--text-main);
  font-family: var(--font-serif);
  -webkit-font-smoothing: antialiased;
  user-select: none;
}

button, input, textarea {
  font-family: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: none;
}

[hidden] {
  display: none !important;
}

/* ---------------- 山门入殿遮罩 ---------------- */
.entrance-veil {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 50% 38%, rgba(164, 114, 48, 0.16), transparent 58%),
    radial-gradient(circle at 50% 100%, rgba(110, 38, 28, 0.18), transparent 55%),
    linear-gradient(180deg, #0c0907 0%, #16100c 52%, #0b0806 100%);
  transition: opacity 1.1s cubic-bezier(0.22, 1, 0.36, 1), visibility 1.1s ease;
}

.entrance-veil.is-exiting {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.entrance-mist {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(ellipse 75% 45% at 50% 50%, rgba(224, 183, 104, 0.06), transparent 70%);
  animation: mistBreath 8s ease-in-out infinite;
  pointer-events: none;
}

@keyframes mistBreath {
  0%, 100% { opacity: 0.55; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.06); }
}

.entrance-content {
  position: relative;
  z-index: 2;
  max-width: 460px;
  padding: 40px 28px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.entrance-seal {
  width: 54px;
  height: 54px;
  border: 2px solid rgba(204, 68, 54, 0.85);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1.18;
  font-size: 16px;
  letter-spacing: 2px;
  color: #e45e4f;
  background: rgba(168, 51, 40, 0.12);
  box-shadow: 0 0 28px rgba(168, 51, 40, 0.25);
  margin-bottom: 6px;
}

.entrance-title {
  font-family: var(--font-calligraphy);
  font-size: clamp(46px, 8vw, 66px);
  font-weight: 400;
  letter-spacing: 0.18em;
  text-indent: 0.18em;
  color: var(--gold-bright);
  text-shadow: 0 4px 32px rgba(224, 183, 104, 0.32);
}

.entrance-subtitle {
  font-size: 16px;
  letter-spacing: 0.28em;
  text-indent: 0.28em;
  color: var(--text-muted);
}

.entrance-divider {
  width: 210px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--gold);
  opacity: 0.6;
  margin: 4px 0;
}

.entrance-divider span {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.entrance-divider i {
  font-style: normal;
  font-size: 12px;
}

.entrance-desc {
  font-size: 14px;
  line-height: 1.9;
  color: var(--text-muted);
  max-width: 360px;
}

.entrance-actions {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

/* 通用按钮 */
.btn-primary-ritual {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: 999px;
  font-size: 15px;
  letter-spacing: 0.12em;
  color: #20140a;
  font-weight: 600;
  background: linear-gradient(135deg, #f0cf87 0%, #d4a04a 55%, #b98233 100%);
  box-shadow: 0 8px 26px rgba(212, 160, 74, 0.34), inset 0 1px 0 rgba(255, 245, 220, 0.65);
  transition: transform 0.22s ease, box-shadow 0.22s ease, filter 0.22s ease;
}

.btn-primary-ritual:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
  box-shadow: 0 10px 32px rgba(224, 183, 104, 0.48), inset 0 1px 0 rgba(255, 245, 220, 0.75);
}

.btn-primary-ritual:active {
  transform: translateY(1px) scale(0.98);
}

.btn-outline-gold {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 999px;
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--gold-bright);
  border: 1px solid var(--border-gold-strong);
  background: rgba(224, 183, 104, 0.08);
  transition: all 0.2s ease;
}

.btn-outline-gold:hover,
.btn-outline-gold.is-active {
  background: rgba(224, 183, 104, 0.22);
  border-color: var(--gold-bright);
}

.btn-ghost-ritual {
  padding: 8px 18px;
  font-size: 13px;
  letter-spacing: 0.12em;
  color: var(--text-soft);
  border-radius: 999px;
  transition: color 0.2s ease, background 0.2s ease;
}

.btn-ghost-ritual:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.06);
}

.btn-small {
  font-size: 12px;
  padding: 7px 14px;
}

/* ---------------- 主殿堂沉浸式舞台 ---------------- */
.sanctuary-stage {
  position: relative;
  width: 100vw;
  height: 100dvh;
  overflow: hidden;
  background-color: var(--bg-obsidian);
}

.hall-backdrop-layer {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hall-bg {
  position: absolute;
  inset: -1.5%;
  background-size: cover;
  background-position: center 42%;
  background-repeat: no-repeat;
  opacity: 0;
  transform: scale(1.03);
  transition: opacity 1.1s ease, transform 1.6s ease;
}

.hall-bg.is-active {
  opacity: 1;
  transform: scale(1);
}

.hall-vignette {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(10, 8, 6, 0.62) 0%, rgba(10, 8, 6, 0.08) 22%, rgba(10, 8, 6, 0.04) 64%, rgba(10, 8, 6, 0.72) 100%),
    radial-gradient(ellipse 80% 75% at 50% 42%, transparent 45%, rgba(8, 6, 5, 0.62) 100%);
  pointer-events: none;
}

.hall-ambient-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 38%, rgba(229, 173, 74, 0.16), transparent 46%);
  animation: candleBreath 6.5s ease-in-out infinite;
  pointer-events: none;
  mix-blend-mode: screen;
}

@keyframes candleBreath {
  0%, 100% { opacity: 0.65; }
  50% { opacity: 1; }
}

.sanctuary-canvas {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}

/* ---------------- 两侧楹联 ---------------- */
.couplet {
  position: absolute;
  top: 50%;
  transform: translateY(-56%);
  z-index: 5;
  padding: 18px 10px;
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(110, 26, 20, 0.52), rgba(76, 18, 14, 0.42));
  border: 1px solid rgba(218, 178, 102, 0.28);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
  writing-mode: vertical-rl;
  text-orientation: upright;
  letter-spacing: 0.36em;
  font-size: 16px;
  color: rgba(245, 224, 176, 0.86);
  backdrop-filter: blur(4px);
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.couplet-left { left: 26px; }
.couplet-right { right: 26px; }

/* ---------------- 顶部禅意导航栏 ---------------- */
.temple-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 26px;
  background: linear-gradient(180deg, rgba(12, 9, 7, 0.78) 0%, rgba(12, 9, 7, 0.0) 100%);
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.mini-seal {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border: 1.5px solid rgba(212, 74, 58, 0.85);
  border-radius: 6px;
  background: rgba(168, 51, 40, 0.22);
  color: #ee7263;
  font-size: 12px;
  line-height: 1.15;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  letter-spacing: 1px;
}

.hall-title-row {
  display: flex;
  align-items: center;
  gap: 9px;
}

.hall-name {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--gold-bright);
}

.deity-tag {
  font-size: 12px;
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(224, 183, 104, 0.14);
  border: 1px solid rgba(224, 183, 104, 0.3);
  color: var(--gold);
  letter-spacing: 0.08em;
}

.hall-subtitle {
  margin-top: 2px;
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.1em;
}

.hall-switcher {
  display: inline-flex;
  align-items: center;
  padding: 4px;
  border-radius: 999px;
  background: rgba(20, 15, 11, 0.72);
  border: 1px solid var(--border-gold);
  backdrop-filter: blur(12px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
}

.hall-tab {
  padding: 7px 16px;
  border-radius: 999px;
  font-size: 13px;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  transition: all 0.26s ease;
  white-space: nowrap;
}

.hall-tab:hover {
  color: var(--text-main);
}

.hall-tab.is-active {
  color: #1f140a;
  font-weight: 600;
  background: linear-gradient(135deg, #f0cf87, #cf9a45);
  box-shadow: 0 2px 12px rgba(212, 160, 74, 0.35);
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tool-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: 999px;
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--text-main);
  background: rgba(22, 16, 12, 0.72);
  border: 1px solid var(--border-gold);
  backdrop-filter: blur(10px);
  transition: all 0.2s ease;
}

.tool-pill:hover {
  border-color: var(--border-gold-strong);
  background: rgba(42, 31, 22, 0.85);
}

.merit-badge {
  min-width: 22px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(224, 183, 104, 0.22);
  color: var(--gold-bright);
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* 顶部禅语轻提示条 */
.zen-quote-strip {
  position: absolute;
  top: 74px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 12;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 16px;
  border-radius: 999px;
  background: rgba(18, 14, 10, 0.45);
  border: 1px solid rgba(218, 178, 102, 0.16);
  backdrop-filter: blur(6px);
  font-size: 12.5px;
  letter-spacing: 0.12em;
  color: rgba(242, 230, 206, 0.82);
  cursor: pointer;
  max-width: min(90vw, 560px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.zen-quote-strip:hover {
  background: rgba(28, 21, 15, 0.65);
  border-color: rgba(218, 178, 102, 0.36);
}

.quote-dot {
  color: var(--gold);
  font-size: 11px;
}

/* 实时轻吐司 */
.ritual-toast {
  position: absolute;
  top: 116px;
  left: 50%;
  transform: translate(-50%, -10px);
  z-index: 40;
  padding: 9px 22px;
  border-radius: 999px;
  background: rgba(26, 18, 13, 0.88);
  border: 1px solid var(--border-gold-strong);
  color: var(--gold-bright);
  font-size: 13.5px;
  letter-spacing: 0.1em;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(12px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.ritual-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------------- 礼拜三拜遮罩 ---------------- */
.bow-overlay {
  position: absolute;
  inset: 0;
  z-index: 35;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 45%, rgba(28, 20, 12, 0.45), rgba(8, 6, 4, 0.78));
  backdrop-filter: blur(3px);
  animation: fadeIn 0.45s ease;
}

.bow-halo {
  position: absolute;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(242, 200, 114, 0.28) 0%, rgba(224, 183, 104, 0.06) 55%, transparent 72%);
  animation: bowHaloPulse 1.7s ease-in-out infinite;
}

@keyframes bowHaloPulse {
  0%, 100% { transform: scale(0.92); opacity: 0.6; }
  50% { transform: scale(1.16); opacity: 1; }
}

.bow-hands {
  position: relative;
  font-size: 56px;
  filter: drop-shadow(0 0 20px rgba(242, 200, 114, 0.55));
  animation: gentleBow 1.7s ease-in-out infinite;
}

@keyframes gentleBow {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(10px) scale(0.95); }
}

.bow-step-title {
  position: relative;
  margin-top: 18px;
  font-size: 24px;
  letter-spacing: 0.22em;
  color: var(--gold-bright);
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.7);
}

.bow-step-desc {
  position: relative;
  margin-top: 8px;
  font-size: 14px;
  letter-spacing: 0.16em;
  color: var(--text-muted);
}

/* ---------------- 交互式供桌祭坛 ---------------- */
.altar-surface {
  position: absolute;
  left: 50%;
  bottom: 94px;
  transform: translateX(-50%);
  z-index: 10;
  width: min(94vw, 860px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: clamp(14px, 3vw, 42px);
  pointer-events: none;
}

.altar-surface > * {
  pointer-events: auto;
}

/* 青铜香炉区域 */
.censer-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.incense-status-pill {
  position: absolute;
  bottom: 100%;
  margin-bottom: 62px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(20, 14, 10, 0.72);
  border: 1px solid rgba(224, 183, 104, 0.34);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  color: var(--gold-bright);
  white-space: nowrap;
  backdrop-filter: blur(6px);
}

.ember-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ff7738;
  box-shadow: 0 0 8px #ff6a24;
  animation: emberPulse 1.5s ease-in-out infinite;
}

@keyframes emberPulse {
  0%, 100% { opacity: 0.65; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.25); }
}

.incense-sticks {
  position: absolute;
  bottom: 84px;
  left: 50%;
  transform: translateX(-50%);
  width: 58px;
  height: 78px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s ease;
}

.incense-sticks.is-burning {
  opacity: 1;
}

.incense-stick {
  position: absolute;
  bottom: 0;
  width: 3px;
  height: 68px;
  border-radius: 2px;
  background: linear-gradient(180deg, #b83c2c 0%, var(--stick-color, #c89b54) 16%, #593b21 100%);
  transform-origin: bottom center;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.55);
  transition: height 0.6s ease;
}

.incense-stick.stick-1 { left: 16px; transform: rotate(-6deg); height: 64px; }
.incense-stick.stick-2 { left: 27px; transform: rotate(0deg); height: 72px; }
.incense-stick.stick-3 { left: 38px; transform: rotate(6deg); height: 64px; }

.stick-ember {
  position: absolute;
  top: -3px;
  left: 50%;
  transform: translateX(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff3c4 0%, #ff7a2f 48%, rgba(255, 70, 20, 0) 100%);
  box-shadow: 0 0 10px 2px rgba(255, 110, 42, 0.85);
  animation: emberPulse 1.3s ease-in-out infinite;
}

.censer-button {
  display: block;
  padding: 0;
  transition: transform 0.25s ease, filter 0.25s ease;
}

.censer-button:hover {
  transform: translateY(-2px);
  filter: drop-shadow(0 0 14px rgba(224, 183, 104, 0.32));
}

.censer-svg {
  width: clamp(160px, 19vw, 210px);
  height: auto;
  display: block;
}

/* 琉璃莲花灯 */
.lamp-pair {
  display: flex;
  align-items: flex-end;
  gap: clamp(10px, 2vw, 22px);
  padding-bottom: 8px;
}

.lotus-lamp {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 6px 8px;
  border-radius: 14px;
  transition: transform 0.25s ease;
}

.lotus-lamp:hover {
  transform: translateY(-3px);
}

.lamp-glow {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--lamp-color, #f5b855) 0%, rgba(245, 184, 85, 0.2) 38%, transparent 72%);
  opacity: 0;
  transition: opacity 0.6s ease;
  pointer-events: none;
  mix-blend-mode: screen;
}

.lotus-lamp.is-lit .lamp-glow {
  opacity: 0.82;
  animation: flameHalo 2.6s ease-in-out infinite;
}

@keyframes flameHalo {
  0%, 100% { transform: translateX(-50%) scale(0.95); opacity: 0.72; }
  50% { transform: translateX(-50%) scale(1.08); opacity: 0.94; }
}

.lamp-svg {
  position: relative;
  width: 58px;
  height: 54px;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.68));
}

.lamp-flame {
  opacity: 0;
  transform-origin: 32px 24px;
  transition: opacity 0.45s ease;
}

.lotus-lamp.is-lit .lamp-flame {
  opacity: 1;
  animation: flameFlicker 1.8s ease-in-out infinite;
}

@keyframes flameFlicker {
  0%, 100% { transform: scale(1) rotate(-1.5deg); }
  45% { transform: scale(1.06, 1.12) rotate(1.5deg); }
  75% { transform: scale(0.96, 1.04) rotate(-1deg); }
}

.lamp-name {
  font-size: 11.5px;
  letter-spacing: 0.08em;
  white-space: nowrap;
  color: var(--text-soft);
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(16, 12, 9, 0.56);
  border: 1px solid rgba(218, 178, 102, 0.16);
  transition: all 0.3s ease;
}

.lotus-lamp.is-lit .lamp-name {
  color: var(--gold-bright);
  border-color: rgba(242, 200, 114, 0.48);
  background: rgba(42, 28, 14, 0.75);
}

/* 供桌清供陈列 */
.altar-offerings {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding-bottom: 12px;
  min-width: 44px;
}

.offering-plate {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 10px 5px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(64, 46, 26, 0.62), rgba(24, 17, 11, 0.85));
  border: 1px solid rgba(218, 178, 102, 0.34);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.55);
  animation: fadeInUp 0.45s ease;
}

.offering-plate-icon {
  font-size: 20px;
  line-height: 1;
}

.offering-plate-name {
  font-size: 10.5px;
  color: var(--gold);
  letter-spacing: 0.08em;
}

/* ---------------- 底部参拜法器栏 ---------------- */
.ritual-dock {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 25;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(20, 14, 10, 0.82);
  border: 1px solid var(--border-gold);
  backdrop-filter: blur(16px);
  box-shadow: 0 12px 38px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(245, 216, 150, 0.12);
}

.dock-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: 999px;
  color: var(--text-main);
  font-size: 13.5px;
  letter-spacing: 0.08em;
  white-space: nowrap;
  transition: all 0.22s ease;
}

.dock-btn:hover {
  background: rgba(224, 183, 104, 0.16);
  color: var(--gold-bright);
  transform: translateY(-1px);
}

.dock-btn.is-active {
  background: linear-gradient(135deg, rgba(224, 183, 104, 0.28), rgba(168, 51, 40, 0.28));
  border: 1px solid rgba(232, 194, 118, 0.5);
  color: var(--gold-bright);
}

.dock-icon {
  font-size: 16px;
  line-height: 1;
}

/* ---------------- 快捷弹出面板（香品 / 供灯供花） ---------------- */
.ritual-popover {
  position: absolute;
  bottom: 84px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  width: min(92vw, 480px);
  border-radius: var(--radius-lg);
  background: rgba(24, 17, 13, 0.94);
  border: 1px solid var(--border-gold-strong);
  box-shadow: var(--shadow-deep);
  backdrop-filter: blur(18px);
  padding: 18px 20px 20px;
  animation: fadeInUp 0.26s ease;
}

.popover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.popover-title {
  font-size: 16px;
  letter-spacing: 0.14em;
  color: var(--gold-bright);
}

.icon-close {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  transition: all 0.2s ease;
}

.icon-close:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.14);
}

.incense-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.incense-option {
  text-align: left;
  padding: 14px 12px;
  border-radius: 12px;
  background: rgba(255, 245, 224, 0.04);
  border: 1px solid rgba(218, 178, 102, 0.22);
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all 0.22s ease;
}

.incense-option:hover {
  border-color: var(--gold-bright);
  background: rgba(224, 183, 104, 0.12);
  transform: translateY(-2px);
}

.incense-swatch {
  width: 28px;
  height: 4px;
  border-radius: 99px;
}

.incense-option-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--gold-bright);
  letter-spacing: 0.08em;
}

.incense-option-desc {
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--text-muted);
}

.incense-option-merit {
  margin-top: auto;
  padding-top: 4px;
  font-size: 11px;
  color: var(--gold);
}

.offerings-section-label {
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  margin: 0 0 8px;
}

.offerings-section-label + .offerings-grid {
  margin-bottom: 14px;
}

.offerings-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.offering-tile {
  padding: 10px 8px;
  border-radius: 12px;
  background: rgba(255, 245, 224, 0.04);
  border: 1px solid rgba(218, 178, 102, 0.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
}

.offering-tile:hover {
  border-color: var(--gold);
  background: rgba(224, 183, 104, 0.12);
}

.offering-tile.is-active {
  border-color: var(--gold-bright);
  background: rgba(224, 183, 104, 0.22);
}

.offering-tile-icon { font-size: 20px; }
.offering-tile-name { font-size: 12.5px; color: var(--text-main); letter-spacing: 0.08em; }
.offering-tile-status { font-size: 10.5px; color: var(--gold); }

/* ---------------- 悬浮电子木鱼面板 ---------------- */
.woodfish-panel {
  position: absolute;
  right: 24px;
  bottom: 88px;
  z-index: 28;
  width: 288px;
  border-radius: var(--radius-lg);
  background: rgba(24, 17, 13, 0.9);
  border: 1px solid var(--border-gold-strong);
  box-shadow: var(--shadow-deep);
  backdrop-filter: blur(18px);
  padding: 16px 18px 18px;
  animation: fadeInUp 0.28s ease;
}

.woodfish-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.woodfish-title {
  font-size: 16px;
  letter-spacing: 0.14em;
  color: var(--gold-bright);
}

.woodfish-sub {
  margin-top: 3px;
  font-size: 11.5px;
  color: var(--text-muted);
}

.woodfish-stage {
  position: relative;
  height: 156px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 8px 0 4px;
}

.woodfish-float-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: visible;
}

.merit-float-text {
  position: absolute;
  left: 50%;
  top: 42%;
  transform: translate(-50%, 0);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--gold-bright);
  text-shadow: 0 2px 12px rgba(224, 183, 104, 0.7);
  white-space: nowrap;
  animation: meritFloatUp 1.05s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

@keyframes meritFloatUp {
  0% { opacity: 0; transform: translate(var(--dx, -50%), 6px) scale(0.9); }
  20% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--dx, -50%), -68px) scale(1.08); }
}

.woodfish-btn {
  width: 196px;
  height: 142px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.08s ease;
}

.woodfish-btn.is-struck .woodfish-body {
  transform: scale(0.965, 0.94);
}

.woodfish-body {
  transform-origin: 100px 92px;
  transition: transform 0.1s ease;
}

.woodfish-mallet {
  transform-origin: 185px 14px;
  transform: rotate(16deg);
  transition: transform 0.09s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}

.woodfish-btn.is-struck .woodfish-mallet {
  transform: rotate(-14deg);
}

.woodfish-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.woodfish-stat {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 6px 12px;
  border-radius: 10px;
  background: rgba(255, 244, 224, 0.04);
  font-size: 12.5px;
  color: var(--text-muted);
}

.woodfish-stat strong {
  font-size: 18px;
  color: var(--gold-bright);
}

.woodfish-presets {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.chip-btn {
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 12px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(218, 178, 102, 0.18);
  transition: all 0.2s ease;
}

.chip-btn:hover {
  color: var(--text-main);
  border-color: rgba(218, 178, 102, 0.4);
}

.chip-btn.is-active {
  color: var(--gold-bright);
  background: rgba(224, 183, 104, 0.18);
  border-color: var(--gold-bright);
}

.woodfish-auto-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.shortcut-hint {
  font-size: 11px;
  color: var(--text-soft);
}

/* ---------------- 通用弹窗基底 ---------------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(8, 6, 4, 0.72);
  backdrop-filter: blur(8px);
  animation: fadeIn 0.24s ease;
}

.modal-card {
  width: min(94vw, 600px);
  max-height: 88dvh;
  overflow-y: auto;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, #211711 0%, #16100c 100%);
  border: 1px solid var(--border-gold-strong);
  box-shadow: var(--shadow-deep);
  padding: 24px 26px 26px;
}

.modal-wish {
  width: min(95vw, 780px);
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(218, 178, 102, 0.18);
}

.modal-title {
  font-size: 20px;
  letter-spacing: 0.14em;
  color: var(--gold-bright);
}

.modal-subtitle {
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--text-muted);
  letter-spacing: 0.06em;
}

/* ---------------- 求签弹窗 ---------------- */
.fortune-draw-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 18px 0 8px;
  gap: 18px;
}

.fortune-cylinder-stage {
  height: 220px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.bamboo-tube {
  position: relative;
  width: 96px;
  height: 166px;
  transform-origin: bottom center;
}

.bamboo-tube.is-shaking {
  animation: shakeTube 0.9s ease-in-out;
}

@keyframes shakeTube {
  0%, 100% { transform: rotate(0deg) translateY(0); }
  12% { transform: rotate(-14deg) translateY(-10px); }
  26% { transform: rotate(13deg) translateY(-16px); }
  40% { transform: rotate(-12deg) translateY(-12px); }
  56% { transform: rotate(11deg) translateY(-18px); }
  72% { transform: rotate(-8deg) translateY(-8px); }
  86% { transform: rotate(5deg) translateY(-3px); }
}

.tube-sticks {
  position: absolute;
  top: -32px;
  left: 12px;
  right: 12px;
  height: 60px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
}

.tube-sticks span {
  width: 6px;
  height: 44px;
  border-radius: 3px 3px 0 0;
  background: linear-gradient(180deg, #b83a2c 0%, #b83a2c 16%, #dfc18a 16%, #b28a4f 100%);
  transform: rotate(calc((var(--i, 0)) * 2deg));
  transition: transform 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}

.tube-sticks span:nth-child(odd) { height: 50px; }
.tube-sticks span:nth-child(3n) { height: 40px; }

.bamboo-tube.is-drawn .chosen-stick {
  transform: translateY(-48px) rotate(4deg) scale(1.12);
  box-shadow: 0 0 18px rgba(242, 200, 114, 0.8);
}

.tube-body {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  border-radius: 12px 12px 18px 18px;
  background: linear-gradient(90deg, #4b2f16 0%, #8b5b2f 32%, #6d4420 68%, #3c2410 100%);
  border: 1.5px solid rgba(224, 183, 104, 0.48);
  box-shadow: inset 0 10px 16px rgba(0, 0, 0, 0.48), 0 16px 32px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
}

.tube-band {
  width: 100%;
  height: 8px;
  background: linear-gradient(90deg, #573d1c, #d9ae5e, #573d1c);
  opacity: 0.72;
}

.tube-label {
  padding: 12px 9px;
  border-radius: 4px;
  background: #8f261e;
  border: 1px solid #e3ba6d;
  color: #fce7bd;
  font-size: 20px;
  letter-spacing: 0.2em;
  writing-mode: vertical-rl;
  text-orientation: upright;
}

.fortune-prompt {
  font-size: 14px;
  letter-spacing: 0.12em;
  color: var(--text-muted);
}

/* 灵签宣纸卡片 */
.fortune-slip-paper {
  background:
    radial-gradient(circle at 90% 10%, rgba(168, 51, 40, 0.08), transparent 40%),
    linear-gradient(180deg, #f7f0e2 0%, #ebdfc7 100%);
  color: var(--ink);
  border-radius: 14px;
  padding: 22px 24px;
  border: 2px solid #c6a162;
  box-shadow: inset 0 0 0 5px rgba(198, 161, 98, 0.22);
}

.slip-top-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.slip-number {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: #6a4d2c;
}

.slip-level {
  padding: 3px 12px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.slip-level.level-top {
  background: #a12c22;
  color: #fdf1d6;
}

.slip-level.level-high {
  background: #8a5d1f;
  color: #fff5df;
}

.slip-level.level-mid {
  background: #365c53;
  color: #edf9f5;
}

.slip-title {
  font-size: 21px;
  letter-spacing: 0.16em;
  text-align: center;
  color: #2b1d12;
  margin-bottom: 14px;
}

.slip-poem {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 14px 16px;
  border-top: 1px solid rgba(138, 93, 31, 0.26);
  border-bottom: 1px solid rgba(138, 93, 31, 0.26);
  font-size: 17px;
  font-weight: 500;
  letter-spacing: 0.24em;
  color: #362214;
  margin-bottom: 14px;
}

.slip-summary {
  font-size: 13.5px;
  line-height: 1.75;
  color: #4b3828;
  margin-bottom: 14px;
}

.slip-details {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.slip-detail-item {
  padding: 9px 11px;
  border-radius: 8px;
  background: rgba(138, 93, 31, 0.08);
  font-size: 12.5px;
  line-height: 1.55;
  color: #3d2c1e;
}

.slip-detail-item strong {
  color: #8f261e;
  margin-right: 4px;
}

.slip-zen-box {
  padding: 11px 14px;
  border-radius: 10px;
  background: rgba(161, 44, 34, 0.08);
  border-left: 3px solid #a12c22;
}

.slip-zen-tag {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: #a12c22;
  margin-bottom: 3px;
}

.slip-zen-box p {
  font-size: 13px;
  line-height: 1.65;
  color: #3b291c;
}

.fortune-result-actions {
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

/* ---------------- 祈福墙弹窗 ---------------- */
.wish-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(255, 244, 224, 0.04);
  border: 1px solid rgba(218, 178, 102, 0.22);
}

.wish-form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.zen-input {
  background: rgba(12, 9, 7, 0.65);
  border: 1px solid rgba(218, 178, 102, 0.28);
  border-radius: 10px;
  padding: 9px 13px;
  font-size: 13.5px;
  color: var(--text-main);
  outline: none;
  transition: border-color 0.2s ease;
}

.zen-input:focus {
  border-color: var(--gold-bright);
}

.zen-input::placeholder {
  color: var(--text-soft);
}

.wish-author-input {
  flex: 1;
  min-width: 200px;
}

.ribbon-picker {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ribbon-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid transparent;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.ribbon-dot[data-ribbon="cinnabar"] { background: #a83328; }
.ribbon-dot[data-ribbon="gold"] { background: #b28232; }
.ribbon-dot[data-ribbon="jade"] { background: #2f6c60; }
.ribbon-dot[data-ribbon="lotus"] { background: #964f5a; }

.ribbon-dot.is-active {
  border-color: var(--gold-bright);
  transform: scale(1.16);
}

.wish-textarea-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.wish-textarea {
  flex: 1;
  resize: none;
  line-height: 1.6;
}

.btn-hang-wish {
  padding: 0 20px;
  border-radius: 12px;
  white-space: nowrap;
}

.wish-wall-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(212px, 1fr));
  gap: 14px;
}

.wish-ribbon-card {
  position: relative;
  padding: 16px 15px 13px;
  border-radius: 6px 6px 14px 14px;
  border: 1px solid var(--ribbon-border, rgba(224, 183, 104, 0.45));
  background: linear-gradient(180deg, var(--ribbon-bg, #8e2820) 0%, rgba(30, 14, 12, 0.92) 100%);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.42);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transform-origin: top center;
  animation: gentleSway 5.5s ease-in-out infinite;
  animation-delay: var(--sway-delay, 0s);
}

.wish-ribbon-card::before {
  content: '';
  position: absolute;
  top: -7px;
  left: 50%;
  transform: translateX(-50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #e0b768;
  border: 2px solid #2b1a0e;
}

@keyframes gentleSway {
  0%, 100% { transform: rotate(-0.6deg); }
  50% { transform: rotate(0.6deg); }
}

.wish-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: rgba(255, 240, 212, 0.72);
}

.wish-card-text {
  font-size: 13.5px;
  line-height: 1.68;
  color: #fff6e6;
  flex: 1;
}

.wish-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 232, 196, 0.16);
  font-size: 12px;
}

.wish-card-author {
  color: rgba(255, 236, 200, 0.85);
}

.btn-bless-wish {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(255, 240, 208, 0.14);
  color: #fce7bc;
  font-size: 11.5px;
  transition: all 0.2s ease;
}

.btn-bless-wish:hover,
.btn-bless-wish.is-blessed {
  background: rgba(242, 200, 114, 0.32);
  color: #fff8e6;
}

/* ---------------- 功德簿弹窗 ---------------- */
.merit-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}

.merit-stat-card {
  padding: 14px 10px;
  border-radius: 12px;
  text-align: center;
  background: rgba(255, 245, 224, 0.04);
  border: 1px solid rgba(218, 178, 102, 0.22);
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.stat-label {
  font-size: 11.5px;
  color: var(--text-muted);
}

.stat-value {
  font-size: 19px;
  color: var(--gold-bright);
  font-weight: 600;
}

.merit-section-title {
  font-size: 13.5px;
  letter-spacing: 0.12em;
  color: var(--gold);
  margin-bottom: 10px;
}

.merit-log-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 7px;
  max-height: 220px;
  overflow-y: auto;
  padding-right: 4px;
}

.merit-log-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 10px;
  background: rgba(255, 245, 224, 0.035);
  border: 1px solid rgba(218, 178, 102, 0.12);
  font-size: 12.5px;
}

.merit-log-time {
  color: var(--text-soft);
  font-size: 11px;
  white-space: nowrap;
}

.merit-footer-actions {
  margin-top: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

/* ---------------- 动画与响应式适配 ---------------- */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.woodfish-panel {
  animation-name: fadeInUpSimple;
}

@keyframes fadeInUpSimple {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1024px) {
  .couplet { display: none; }
  .temple-header {
    padding: 12px 16px;
    flex-wrap: wrap;
    row-gap: 10px;
  }
  .hall-switcher {
    order: 3;
    width: 100%;
    justify-content: center;
  }
  .zen-quote-strip {
    top: 116px;
  }
  .ritual-toast {
    top: 152px;
  }
}

@media (max-width: 720px) {
  .hall-subtitle { display: none; }
  .deity-tag {
    max-width: 112px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .tool-label { display: none; }
  .altar-surface {
    bottom: 84px;
    gap: 6px;
  }
  .altar-offerings { display: none; }
  .lamp-pair { gap: 4px; }
  .lotus-lamp { padding: 4px 3px; }
  .lamp-svg { width: 42px; height: 40px; }
  .lamp-name { font-size: 10.5px; padding: 2px 6px; letter-spacing: 0.04em; }
  .censer-svg { width: 140px; }
  .incense-sticks { bottom: 65px; }
  .ritual-dock {
    width: 96vw;
    justify-content: space-around;
    padding: 6px 6px;
    gap: 2px;
  }
  .dock-btn {
    flex-direction: column;
    gap: 3px;
    padding: 6px 8px;
    font-size: 11px;
  }
  .woodfish-panel {
    right: 50%;
    transform: translateX(50%);
    bottom: 86px;
    width: min(92vw, 310px);
  }
  .incense-grid { grid-template-columns: 1fr; }
  .merit-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .slip-details { grid-template-columns: 1fr; }
  .wish-textarea-row { flex-direction: column; }
  .btn-hang-wish { padding: 10px 18px; }
}
