/* ============================================================
   云隐观 · 云端道场
   ============================================================ */

:root {
  --ink: #0b0d0c;
  --ink-2: #0f1311;
  --ink-3: #141a16;
  --paper: #e8e0cd;
  --paper-dim: #b9b2a0;
  --muted: #7e7a6c;
  --gold: #c9a86a;
  --gold-soft: rgba(201, 168, 106, .18);
  --gold-bright: #eed595;
  --cinnabar: #a83a32;
  --jade: #6f9d84;
  --line: rgba(201, 168, 106, .16);
  --serif: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", "SimSun", serif;
  --kai: "Kaiti SC", "STKaiti", "KaiTi", "Noto Serif SC", serif;
  --radius: 18px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background:
    radial-gradient(1200px 700px at 78% -10%, rgba(201, 168, 106, .07), transparent 60%),
    radial-gradient(900px 600px at 6% 110%, rgba(90, 120, 100, .08), transparent 60%),
    var(--ink);
  color: var(--paper);
  font-family: var(--serif);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: .5;
  background-image:
    radial-gradient(rgba(232, 224, 205, .045) 1px, transparent 1px);
  background-size: 5px 5px;
  mix-blend-mode: soft-light;
}

button, input { font-family: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
[hidden] { display: none !important; }

::selection { background: rgba(201, 168, 106, .3); color: #fff; }

/* ---------- 顶栏功德 ---------- */
.hud {
  position: fixed;
  top: 18px;
  right: 22px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 40;
}
.hud-merit {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(13, 17, 14, .72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-size: 13px;
  color: var(--paper-dim);
}
.hud-merit strong {
  color: var(--gold-bright);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .04em;
  font-variant-numeric: tabular-nums;
}
.hud-glyph {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid rgba(201, 168, 106, .5);
  color: var(--gold);
  font-family: var(--kai);
  font-size: 13px;
}
.hud-sound {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(13, 17, 14, .72);
  color: var(--gold);
  font-family: var(--kai);
  font-size: 14px;
  transition: .2s;
}
.hud-sound:hover { border-color: rgba(201, 168, 106, .5); background: rgba(201, 168, 106, .1); }
.hud-sound.is-off { color: var(--muted); text-decoration: line-through; }

/* ---------- 侧边导航 ---------- */
.rail {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 82px;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: linear-gradient(180deg, rgba(10, 13, 11, .88), rgba(8, 10, 9, .94));
  border-right: 1px solid var(--line);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.rail-brand {
  font-family: var(--kai);
  font-size: 24px;
  color: var(--gold);
  margin-bottom: 26px;
  text-shadow: 0 0 18px rgba(201, 168, 106, .35);
  opacity: .9;
}
.rail-btn {
  width: 60px;
  padding: 10px 0 8px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: var(--muted);
  transition: color .25s, background .25s, transform .25s;
}
.rail-btn span {
  font-family: var(--kai);
  font-size: 21px;
  line-height: 1.2;
}
.rail-btn em {
  font-style: normal;
  font-size: 10px;
  letter-spacing: .1em;
  opacity: .75;
}
.rail-btn:hover { color: var(--paper); background: rgba(201, 168, 106, .06); }
.rail-btn.is-active {
  color: var(--gold-bright);
  background: rgba(201, 168, 106, .1);
  box-shadow: inset 0 0 0 1px rgba(201, 168, 106, .18);
}
.rail-btn.is-active span { text-shadow: 0 0 14px rgba(238, 213, 149, .5); }

/* ---------- 主内容 ---------- */
main {
  margin-left: 82px;
  position: relative;
  z-index: 1;
  min-height: 100vh;
}
.view {
  display: none;
  max-width: 1180px;
  margin: 0 auto;
  padding: 64px clamp(22px, 5vw, 72px) 100px;
}
.view.is-active { display: block; animation: fadeUp .55s cubic-bezier(.22, .8, .3, 1); }
.view-gate { max-width: none; padding: 0; }

.view-head { margin-bottom: 38px; }
.eyebrow {
  margin: 0 0 10px;
  font-size: 11px;
  letter-spacing: .42em;
  color: var(--gold);
  text-transform: uppercase;
}
.view-head h2 {
  margin: 0 0 10px;
  font-family: var(--kai);
  font-size: clamp(26px, 3.4vw, 36px);
  font-weight: 500;
  letter-spacing: .08em;
  color: #efe6d2;
}
.view-head .desc {
  margin: 0;
  font-size: 14px;
  color: var(--paper-dim);
  letter-spacing: .04em;
}
.view-head .desc b { color: var(--gold-bright); font-weight: 600; }

.hint {
  font-size: 13px;
  color: var(--muted);
  letter-spacing: .08em;
}
.hint.center { text-align: center; margin-top: 26px; }

/* ---------- 通用按钮 ---------- */
.btn-primary {
  padding: 13px 34px;
  border-radius: 999px;
  background: linear-gradient(135deg, #e3c992, #c9a86a 45%, #a8874c);
  color: #191712;
  font-size: 15px;
  letter-spacing: .22em;
  text-indent: .22em;
  box-shadow: 0 10px 30px rgba(201, 168, 106, .18), inset 0 1px 0 rgba(255, 255, 255, .4);
  transition: transform .25s, box-shadow .25s, filter .25s;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 40px rgba(201, 168, 106, .26), inset 0 1px 0 rgba(255, 255, 255, .5);
  filter: brightness(1.04);
}
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: .45; cursor: not-allowed; transform: none; }

.btn-ghost {
  padding: 10px 22px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--paper-dim);
  font-size: 13px;
  letter-spacing: .12em;
  transition: .25s;
}
.btn-ghost:hover { border-color: rgba(201, 168, 106, .5); color: var(--gold-bright); background: rgba(201, 168, 106, .07); }
.btn-ghost.danger:hover { border-color: rgba(168, 58, 50, .6); color: #e39a92; background: rgba(168, 58, 50, .12); }

/* ============================================================
   山门
   ============================================================ */
.hero {
  position: relative;
  min-height: 100svh;
  overflow: hidden;
  display: grid;
  place-items: center;
  isolation: isolate;
  background:
    radial-gradient(80% 60% at 60% 20%, rgba(201, 168, 106, .05), transparent 65%),
    linear-gradient(180deg, #0a0d0b, #080a09);
}
.hero-sky {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}
.hero-sky .stars circle { animation: twinkle 5s ease-in-out infinite alternate; }
.hero-sky .stars circle:nth-child(2n) { animation-delay: 1.6s; }
.hero-sky .stars circle:nth-child(3n) { animation-delay: 3.1s; }
.hero-sky .pavilion { opacity: .9; }

.mist {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  pointer-events: none;
  z-index: 0;
  opacity: .5;
}
.mist-a {
  width: 62vw; height: 20vh;
  left: -12vw; bottom: 24vh;
  background: rgba(150, 170, 155, .16);
  animation: drift 26s ease-in-out infinite alternate;
}
.mist-b {
  width: 55vw; height: 16vh;
  right: -10vw; bottom: 16vh;
  background: rgba(180, 190, 170, .12);
  animation: drift 32s ease-in-out infinite alternate-reverse;
}
.mist-c {
  width: 40vw; height: 12vh;
  left: 30vw; bottom: 31vh;
  background: rgba(160, 180, 165, .1);
  animation: drift 22s ease-in-out infinite alternate;
  animation-delay: -8s;
}

.hero-inner {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 0 24px 16vh;
  animation: riseIn 1.2s cubic-bezier(.22, .8, .3, 1) both;
}
.hero-inner .eyebrow { margin-bottom: 18px; }
.hero-title {
  margin: 0;
  font-family: var(--kai);
  font-weight: 500;
  font-size: clamp(64px, 11vw, 128px);
  line-height: 1.05;
  letter-spacing: .16em;
  text-indent: .16em;
  color: #eadfca;
  text-shadow:
    0 0 26px rgba(238, 213, 149, .28),
    0 0 90px rgba(201, 168, 106, .18);
}
.hero-sub {
  margin: 20px 0 42px;
  letter-spacing: .5em;
  text-indent: .5em;
  font-size: 14px;
  color: var(--paper-dim);
}
.gate-stats {
  display: flex;
  justify-content: center;
  gap: clamp(28px, 6vw, 64px);
  margin-top: 54px;
}
.gate-stats > div { display: flex; flex-direction: column; gap: 2px; }
.gate-stats strong {
  font-family: var(--kai);
  font-size: 26px;
  font-weight: 500;
  color: var(--gold-bright);
  font-variant-numeric: tabular-nums;
}
.gate-stats span { font-size: 11px; letter-spacing: .24em; color: var(--muted); }
.gate-note {
  margin: 44px auto 0;
  max-width: 420px;
  font-size: 11px;
  letter-spacing: .1em;
  color: rgba(126, 122, 108, .8);
}

/* ============================================================
   三清殿
   ============================================================ */
.altar {
  position: relative;
  height: 500px;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid rgba(201, 168, 106, .14);
  background:
    radial-gradient(70% 60% at 50% 108%, rgba(201, 168, 106, .13), transparent 62%),
    radial-gradient(50% 42% at 50% 36%, rgba(201, 168, 106, .06), transparent 70%),
    linear-gradient(180deg, #0c110e, #090c0a 70%, #070908);
  box-shadow: inset 0 0 60px rgba(0, 0, 0, .6), 0 30px 80px rgba(0, 0, 0, .35);
}
#smokeCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 6;
  pointer-events: none;
}
.altar-glow {
  position: absolute;
  left: 50%;
  bottom: -60px;
  width: 420px;
  height: 260px;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(238, 213, 149, .16), transparent);
  filter: blur(18px);
  z-index: 1;
}

.shrine {
  position: absolute;
  top: 42px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: flex-start;
  gap: 22px;
  z-index: 2;
}
.shrine-panel {
  position: relative;
  width: 120px;
  height: 252px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  border: 1px solid rgba(201, 168, 106, .32);
  background: linear-gradient(180deg, rgba(201, 168, 106, .09), rgba(201, 168, 106, .015) 60%, transparent);
  box-shadow: 0 0 30px rgba(201, 168, 106, .06);
  animation: altarBreathe 7s ease-in-out infinite alternate;
  animation-delay: var(--delay, 0s);
}
.shrine-panel::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(201, 168, 106, .14);
  pointer-events: none;
}
.shrine-panel .deity {
  writing-mode: vertical-rl;
  font-family: var(--kai);
  font-size: 34px;
  letter-spacing: .22em;
  color: #e9d8ab;
  text-shadow: 0 0 20px rgba(233, 216, 171, .35);
}
.shrine-panel em {
  writing-mode: vertical-rl;
  font-style: normal;
  font-size: 11px;
  letter-spacing: .24em;
  color: #8d8876;
}
.shrine-panel.is-center {
  transform: translateY(-12px);
  border-color: rgba(238, 213, 149, .5);
  background: linear-gradient(180deg, rgba(201, 168, 106, .14), rgba(201, 168, 106, .02) 62%, transparent);
  box-shadow: 0 0 44px rgba(201, 168, 106, .1);
}

.candles {
  position: absolute;
  bottom: 150px;
  left: 50%;
  width: 620px;
  max-width: 82%;
  transform: translateX(-50%);
  display: flex;
  justify-content: space-between;
  z-index: 2;
  pointer-events: none;
}
.candle {
  position: relative;
  width: 5px;
  height: 30px;
  border-radius: 2px;
  background: linear-gradient(180deg, #d8c69d, #7c6a4b);
}
.candle::before {
  content: "";
  position: absolute;
  top: -3px;
  left: -1px;
  width: 7px;
  height: 5px;
  border-radius: 50%;
  background: #7c6a4b;
}
.candle i {
  position: absolute;
  top: -15px;
  left: 50%;
  width: 7px;
  height: 13px;
  transform: translateX(-50%);
  border-radius: 50% 50% 45% 45%;
  background: radial-gradient(circle at 50% 70%, #fff4c9, #ffc861 45%, rgba(255, 150, 60, 0) 78%);
  filter: blur(.3px);
  animation: flame 2.4s ease-in-out infinite alternate;
  box-shadow: 0 0 18px rgba(255, 190, 100, .6);
}
.candle:nth-child(2) i { animation-delay: .6s; animation-duration: 3.1s; }
.candle:nth-child(3) i { animation-delay: 1.3s; animation-duration: 2.7s; }
.candle:nth-child(4) i { animation-delay: .9s; animation-duration: 3.4s; }

.censer {
  position: absolute;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  width: 240px;
  height: 210px;
  z-index: 3;
}
.incense-row {
  position: absolute;
  bottom: 96px;
  left: 50%;
  transform: translateX(-50%);
  width: 190px;
  height: 160px;
  z-index: 1;
}
.incense-stick {
  position: absolute;
  bottom: 0;
  left: calc(50% + var(--dx, 0px));
  width: 4px;
  height: var(--h, 100px);
  border-radius: 2px;
  background: linear-gradient(180deg, #b08f5d 0%, #8a6b41 25%, #6a5030 100%);
  transform-origin: bottom center;
  animation: stickIn .55s cubic-bezier(.3, .9, .4, 1.2) both;
}
.incense-stick::before {
  content: "";
  position: absolute;
  top: -4px;
  left: 50%;
  width: 9px;
  height: 9px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: var(--tip, #ffb066);
  box-shadow: 0 0 10px var(--tip, #ffb066), 0 0 24px var(--tip, #ffb066);
  animation: ember 2.2s ease-in-out infinite;
}
.incense-stick::after {
  content: "";
  position: absolute;
  top: 10px;
  left: 1px;
  width: 2px;
  height: 10px;
  background: rgba(220, 220, 210, .18);
  border-radius: 1px;
}

.censer-body {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 240px;
  height: 104px;
  z-index: 2;
  border-radius: 16px 16px 110px 110px / 14px 14px 78px 78px;
  background:
    linear-gradient(180deg, rgba(255, 230, 180, .25), transparent 18%),
    linear-gradient(90deg, #3b2c1d, #7a5a35 18%, #a8824c 42%, #8a683d 62%, #4a3722 88%, #2c2116);
  border: 1px solid rgba(238, 213, 149, .38);
  box-shadow:
    inset 0 -22px 40px rgba(0, 0, 0, .5),
    inset 0 0 0 6px rgba(0, 0, 0, .12),
    0 16px 34px rgba(0, 0, 0, .5);
  display: grid;
  place-items: center;
}
.censer-body::before {
  content: "";
  position: absolute;
  top: 8px;
  left: 12px;
  right: 12px;
  height: 16px;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(0, 0, 0, .55), rgba(0, 0, 0, .15));
  box-shadow: inset 0 3px 8px rgba(0, 0, 0, .8);
}
.censer-char {
  font-family: var(--kai);
  font-size: 44px;
  color: #e9d7a9;
  opacity: .88;
  text-shadow: 0 1px 0 rgba(0, 0, 0, .5), 0 0 22px rgba(238, 213, 149, .28);
  transform: translateY(6px);
}
.censer-ear {
  position: absolute;
  top: 18px;
  width: 30px;
  height: 34px;
  border: 5px solid #7a5a35;
  border-radius: 50%;
  z-index: -1;
}
.censer-ear.left { left: -24px; border-right-color: transparent; }
.censer-ear.right { right: -24px; border-left-color: transparent; }
.censer-leg {
  position: absolute;
  bottom: -16px;
  width: 13px;
  height: 22px;
  background: linear-gradient(180deg, #8a683d, #4a3722);
  border-radius: 3px 3px 6px 6px;
}
.censer-leg.left { left: 44px; transform: rotate(6deg); }
.censer-leg.center { left: 50%; transform: translateX(-50%); }
.censer-leg.right { right: 44px; transform: rotate(-6deg); }

.incense-choices {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 26px;
}
.incense-choice {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 12px;
  padding: 16px 18px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(165deg, rgba(20, 26, 22, .8), rgba(11, 14, 12, .85));
  transition: transform .25s, border-color .25s, background .25s;
}
.incense-choice:hover {
  transform: translateY(-3px);
  border-color: rgba(201, 168, 106, .45);
  background: linear-gradient(165deg, rgba(28, 36, 30, .9), rgba(13, 17, 14, .9));
}
.incense-choice b {
  grid-column: 2;
  font-family: var(--kai);
  font-weight: 500;
  font-size: 17px;
  letter-spacing: .12em;
  color: var(--paper);
}
.incense-choice span {
  grid-column: 2;
  font-size: 11px;
  letter-spacing: .18em;
  color: var(--muted);
}
.incense-choice em {
  grid-column: 3;
  grid-row: 1 / span 2;
  font-style: normal;
  font-size: 12px;
  color: var(--gold);
  letter-spacing: .06em;
}
.dot {
  grid-column: 1;
  grid-row: 1 / span 2;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.dot-jade { background: #7fd6a5; box-shadow: 0 0 12px rgba(127, 214, 165, .8); }
.dot-gold { background: #ffc861; box-shadow: 0 0 12px rgba(255, 200, 97, .8); }
.dot-rose { background: #ff8a7a; box-shadow: 0 0 12px rgba(255, 138, 122, .8); }

/* ============================================================
   求签
   ============================================================ */
.fortune-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 18px 0 6px;
}
.tube-wrap {
  position: relative;
  width: 200px;
  height: 250px;
  margin-bottom: 26px;
}
.tube {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 150px;
  height: 185px;
  transform: translateX(-50%);
  transform-origin: 50% 100%;
}
.tube.shaking { animation: shake .95s cubic-bezier(.36, .07, .19, .97) both; }
.tube-sticks {
  position: absolute;
  bottom: 120px;
  left: 50%;
  width: 116px;
  height: 120px;
  transform: translateX(-50%);
  z-index: 1;
}
.tube-stick {
  position: absolute;
  bottom: 0;
  left: calc(50% + var(--sx, 0px));
  width: 7px;
  height: var(--sh, 92px);
  border-radius: 4px 4px 2px 2px;
  background: linear-gradient(180deg, #e4d3ac 0%, #c2a878 30%, #9d7f50 100%);
  border: 1px solid rgba(60, 40, 20, .25);
  transform: rotate(var(--sr, 0deg));
  transform-origin: bottom center;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .4);
}
.tube-stick::after {
  content: "";
  position: absolute;
  top: 10px;
  left: 50%;
  width: 3px;
  height: 3px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: var(--cinnabar);
  opacity: .8;
}
.tube-body {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 132px;
  height: 150px;
  z-index: 2;
  border-radius: 12px 12px 22px 22px;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, .5), transparent 16%, rgba(255, 230, 180, .22) 46%, transparent 72%, rgba(0, 0, 0, .45)),
    linear-gradient(180deg, #6b4a2c, #8a5f35 16%, #a87845 50%, #7a5230 82%, #4a3018);
  border: 1px solid rgba(238, 213, 149, .4);
  box-shadow: inset 0 0 30px rgba(0, 0, 0, .5), 0 18px 34px rgba(0, 0, 0, .45);
  display: grid;
  place-items: center;
}
.tube-body::before {
  content: "";
  position: absolute;
  top: 5px;
  left: 8px;
  right: 8px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(0, 0, 0, .7), rgba(0, 0, 0, .2));
  box-shadow: inset 0 4px 8px rgba(0, 0, 0, .7);
}
.tube-body span {
  font-family: var(--kai);
  font-size: 54px;
  color: #f0dcae;
  opacity: .9;
  transform: translateY(8px);
  text-shadow: 0 2px 0 rgba(0, 0, 0, .35), 0 0 24px rgba(240, 220, 174, .3);
}
.tube-shadow {
  position: absolute;
  bottom: -10px;
  left: 50%;
  width: 190px;
  height: 30px;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(0, 0, 0, .65), transparent);
  filter: blur(6px);
}
.fortune-stage .hint { margin-top: 22px; }

.fortune-card {
  max-width: 680px;
  margin: 38px auto 0;
  padding: 34px 34px 26px;
  border: 1px solid rgba(201, 168, 106, .32);
  border-radius: 20px;
  background:
    radial-gradient(90% 60% at 50% 0%, rgba(201, 168, 106, .08), transparent 70%),
    linear-gradient(170deg, rgba(22, 28, 24, .92), rgba(11, 14, 12, .95));
  box-shadow: 0 30px 70px rgba(0, 0, 0, .4);
  text-align: center;
  animation: cardIn .7s cubic-bezier(.22, .8, .3, 1) both;
}
.fortune-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.fortune-level {
  padding: 4px 14px;
  border: 1px solid rgba(201, 168, 106, .45);
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: .18em;
  color: var(--gold-bright);
  background: rgba(201, 168, 106, .08);
}
.fortune-no {
  font-size: 12px;
  letter-spacing: .24em;
  color: var(--muted);
}
.fortune-title {
  margin: 0 0 22px;
  font-family: var(--kai);
  font-weight: 500;
  font-size: 30px;
  letter-spacing: .16em;
  color: #f0e3c6;
  text-shadow: 0 0 28px rgba(238, 213, 149, .25);
}
.fortune-poem {
  font-family: var(--kai);
  font-size: 21px;
  line-height: 2.1;
  letter-spacing: .14em;
  color: #e4d8bc;
  margin-bottom: 20px;
}
.fortune-poem span { display: block; }
.fortune-key {
  margin: 0 0 18px;
  font-size: 12px;
  letter-spacing: .2em;
  color: var(--gold);
}
.fortune-reading {
  margin: 0 auto;
  max-width: 500px;
  font-size: 14px;
  line-height: 2;
  color: var(--paper-dim);
  text-align: justify;
  text-align-last: center;
}
.fortune-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 26px;
}
.fortune-time {
  margin: 18px 0 0;
  font-size: 11px;
  letter-spacing: .12em;
  color: var(--muted);
}

/* ============================================================
   祈福
   ============================================================ */
.wish-form {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}
.wish-form input {
  flex: 1;
  min-width: 0;
  padding: 14px 20px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(13, 17, 14, .8);
  color: var(--paper);
  font-size: 15px;
  letter-spacing: .06em;
  outline: none;
  transition: border-color .25s, box-shadow .25s;
}
.wish-form input::placeholder { color: rgba(126, 122, 108, .75); letter-spacing: .1em; }
.wish-form input:focus {
  border-color: rgba(201, 168, 106, .5);
  box-shadow: 0 0 0 3px rgba(201, 168, 106, .08);
}
.wish-tip {
  margin: 0 0 22px;
  font-size: 12px;
  letter-spacing: .1em;
  color: var(--muted);
}

.lantern-sea {
  position: relative;
  height: 440px;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid var(--line);
  background:
    radial-gradient(60% 45% at 82% 6%, rgba(240, 225, 190, .12), transparent 70%),
    radial-gradient(80% 70% at 50% 120%, rgba(201, 168, 106, .12), transparent 60%),
    linear-gradient(180deg, #0a0d12 0%, #0c1110 55%, #101511 100%);
  box-shadow: inset 0 0 80px rgba(0, 0, 0, .55);
}
.sea-stars {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(rgba(232, 224, 205, .5) 1px, transparent 1.4px),
    radial-gradient(rgba(232, 224, 205, .28) 1px, transparent 1.2px);
  background-size: 190px 160px, 120px 110px;
  background-position: 20px 30px, 70px 90px;
  opacity: .5;
  animation: twinkle 6s ease-in-out infinite alternate;
}
.sea-moon {
  position: absolute;
  top: 42px;
  right: 12%;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 35%, #f6ebcb, #e5d3a4 60%, #cdb787);
  box-shadow: 0 0 50px rgba(238, 213, 149, .35), 0 0 110px rgba(238, 213, 149, .18);
  opacity: .85;
}
.lantern-layer { position: absolute; inset: 0; }

.lantern {
  position: absolute;
  bottom: -170px;
  left: var(--x, 50%);
  width: 82px;
  padding: 18px 10px 12px;
  border-radius: 42% 42% 46% 46% / 30% 30% 56% 56%;
  background:
    radial-gradient(ellipse at 50% 24%, #ffe7a8, #ffc766 42%, #ef9a3c 70%, #b95f20 92%);
  box-shadow:
    0 0 34px rgba(255, 172, 74, .55),
    0 0 90px rgba(255, 150, 60, .25),
    inset 0 0 22px rgba(255, 236, 186, .65);
  animation: lanternRise var(--dur, 18s) linear forwards;
  transform-origin: 50% 100%;
  will-change: transform, opacity;
}
.lantern::before,
.lantern::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 28px;
  height: 4px;
  border-radius: 2px;
  background: rgba(120, 60, 20, .55);
}
.lantern::before { top: -3px; }
.lantern::after { bottom: -4px; }
.lantern.is-static {
  bottom: auto;
  top: var(--y, 55%);
  animation: none !important;
  opacity: 1;
  transition: opacity .7s ease;
}
.lantern .label {
  writing-mode: vertical-rl;
  max-height: 104px;
  overflow: hidden;
  font-family: var(--kai);
  font-size: 11.5px;
  line-height: 1.5;
  letter-spacing: .16em;
  color: #5a2a10;
  text-shadow: 0 0 8px rgba(255, 240, 200, .9);
  word-break: break-all;
}
.sea-empty {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  font-size: 13px;
  letter-spacing: .2em;
  color: rgba(126, 122, 108, .85);
  transition: opacity .4s;
  pointer-events: none;
}

.wish-list-wrap { margin-top: 30px; }
.wish-list-wrap h3,
.records h3 {
  margin: 0 0 14px;
  font-family: var(--kai);
  font-weight: 500;
  font-size: 17px;
  letter-spacing: .16em;
  color: var(--paper);
}
.wish-list { display: flex; flex-wrap: wrap; gap: 10px; }
.wish-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(201, 168, 106, .04);
  font-size: 13px;
  color: var(--paper-dim);
  letter-spacing: .05em;
  max-width: 100%;
}
.wish-chip b { font-weight: 400; color: var(--gold-bright); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wish-chip em { font-style: normal; font-size: 10px; color: var(--muted); letter-spacing: .08em; flex: none; }
.wish-empty { font-size: 13px; color: var(--muted); letter-spacing: .1em; margin: 0; }

/* ============================================================
   静坐
   ============================================================ */
.meditator {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 28px 0 10px;
}
.breath-ring {
  position: relative;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1px solid rgba(201, 168, 106, .28);
  background: radial-gradient(closest-side, rgba(201, 168, 106, .1), transparent 72%);
  box-shadow:
    0 0 0 18px rgba(201, 168, 106, .03),
    0 0 70px rgba(201, 168, 106, .07),
    inset 0 0 60px rgba(201, 168, 106, .05);
  transition: transform 4s cubic-bezier(.4, 0, .4, 1), box-shadow 2s ease;
  margin-bottom: 34px;
}
.breath-ring::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 50%;
  border: 1px dashed rgba(201, 168, 106, .18);
}
.breath-ring.inhale { transform: scale(1.16); }
.breath-ring.hold { transform: scale(1.16); }
.breath-ring.exhale { transform: scale(.94); }
.breath-ring.is-active {
  box-shadow:
    0 0 0 18px rgba(201, 168, 106, .04),
    0 0 90px rgba(201, 168, 106, .18),
    inset 0 0 80px rgba(201, 168, 106, .1);
}
.breath-inner { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.breath-phase {
  font-family: var(--kai);
  font-size: 22px;
  letter-spacing: .3em;
  text-indent: .3em;
  color: var(--gold-bright);
}
.breath-time {
  font-size: 40px;
  font-weight: 300;
  letter-spacing: .06em;
  color: var(--paper);
  font-variant-numeric: tabular-nums;
}
.breath-inner em {
  font-style: normal;
  font-size: 11px;
  letter-spacing: .2em;
  color: var(--muted);
}
.duration-row { display: flex; gap: 10px; margin-bottom: 22px; }
.chip {
  padding: 9px 20px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  letter-spacing: .12em;
  transition: .25s;
}
.chip:hover { color: var(--paper); border-color: rgba(201, 168, 106, .35); }
.chip.is-active {
  color: #17150f;
  background: linear-gradient(135deg, #e3c992, #c9a86a);
  border-color: transparent;
}
.meditate-actions { display: flex; gap: 12px; }
.meditator .hint { margin-top: 24px; }

/* ============================================================
   功德
   ============================================================ */
.profile-card {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 30px 32px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background:
    radial-gradient(70% 100% at 0% 0%, rgba(201, 168, 106, .1), transparent 60%),
    linear-gradient(165deg, rgba(21, 27, 23, .9), rgba(11, 14, 12, .92));
  box-shadow: 0 24px 60px rgba(0, 0, 0, .3);
}
.seal {
  flex: none;
  width: 84px;
  height: 84px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 2px solid rgba(201, 168, 106, .55);
  color: var(--gold-bright);
  font-family: var(--kai);
  font-size: 40px;
  background: rgba(201, 168, 106, .07);
  box-shadow: inset 0 0 24px rgba(201, 168, 106, .12), 0 0 30px rgba(201, 168, 106, .08);
}
.profile-main { flex: 1; min-width: 0; }
.profile-label {
  margin: 0 0 4px;
  font-size: 11px;
  letter-spacing: .26em;
  color: var(--muted);
}
.profile-merit { display: flex; align-items: baseline; gap: 14px; margin-bottom: 14px; }
.profile-merit strong {
  font-family: var(--kai);
  font-size: 46px;
  font-weight: 500;
  line-height: 1;
  color: var(--gold-bright);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 30px rgba(238, 213, 149, .3);
}
.profile-merit span {
  padding: 3px 14px;
  border: 1px solid rgba(201, 168, 106, .4);
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: .2em;
  color: var(--gold);
  background: rgba(201, 168, 106, .06);
}
.level-bar {
  height: 6px;
  border-radius: 3px;
  background: rgba(201, 168, 106, .12);
  overflow: hidden;
}
.level-bar i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 3px;
  background: linear-gradient(90deg, #a8874c, #e3c992, #eed595);
  box-shadow: 0 0 12px rgba(238, 213, 149, .5);
  transition: width .8s cubic-bezier(.22, .8, .3, 1);
}
.level-hint {
  margin: 10px 0 0;
  font-size: 12px;
  letter-spacing: .08em;
  color: var(--muted);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 18px;
}
.stats-grid > div {
  padding: 20px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(17, 22, 18, .6);
  text-align: center;
}
.stats-grid strong {
  display: block;
  font-family: var(--kai);
  font-size: 28px;
  font-weight: 500;
  color: var(--paper);
  font-variant-numeric: tabular-nums;
}
.stats-grid span { font-size: 11px; letter-spacing: .14em; color: var(--muted); }

.records { margin-top: 36px; }
.record-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}
.record-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 4px;
  border-bottom: 1px solid rgba(201, 168, 106, .08);
  font-size: 13px;
  color: var(--paper-dim);
  letter-spacing: .04em;
}
.record-list li .rec-main { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.record-list li .rec-type {
  flex: none;
  font-size: 10px;
  letter-spacing: .16em;
  color: var(--gold);
  border: 1px solid rgba(201, 168, 106, .3);
  border-radius: 4px;
  padding: 1px 7px;
}
.record-list li .rec-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.record-list li .rec-time { flex: none; font-size: 11px; color: var(--muted); letter-spacing: .06em; }
.empty-note { font-size: 13px; color: var(--muted); letter-spacing: .08em; margin: 14px 0 0; }

.settings {
  display: flex;
  gap: 12px;
  margin-top: 34px;
  flex-wrap: wrap;
}
.footnote {
  margin: 34px 0 0;
  padding-top: 20px;
  border-top: 1px solid rgba(201, 168, 106, .08);
  font-size: 11px;
  letter-spacing: .1em;
  color: rgba(126, 122, 108, .8);
}

/* ============================================================
   Toast
   ============================================================ */
.toast {
  position: fixed;
  left: 50%;
  bottom: 42px;
  transform: translate(-50%, 20px);
  z-index: 60;
  padding: 10px 22px;
  border-radius: 999px;
  border: 1px solid rgba(201, 168, 106, .33);
  background: rgba(16, 21, 17, .94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--gold-bright);
  font-size: 13px;
  letter-spacing: .08em;
  opacity: 0;
  pointer-events: none;
  transition: opacity .35s, transform .35s;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .45);
  max-width: calc(100vw - 40px);
  text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ============================================================
   3D 山门
   ============================================================ */
.world {
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0;
  transition: opacity 1.4s ease;
  background: #070a08;
}
.hero.has-world .world { opacity: 1; }
#worldCanvas { display: block; width: 100%; height: 100%; touch-action: none; }
.world-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 48%, transparent 40%, rgba(0, 0, 0, .55) 100%),
    linear-gradient(180deg, rgba(0, 0, 0, .5), transparent 24%, transparent 68%, rgba(0, 0, 0, .66));
}
.hero.has-world .hero-sky,
.hero.has-world .mist { opacity: 0; transition: opacity .8s; pointer-events: none; }

.world-loading {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: radial-gradient(ellipse at 50% 40%, #0d1410, #060807 70%);
  color: rgba(232, 224, 205, .65);
  font-size: 12px;
  letter-spacing: .4em;
  transition: opacity .9s;
}
.hero.has-world .world-loading { opacity: 0; pointer-events: none; }
.world-loading-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 16px rgba(201, 168, 106, .8);
  animation: loadingPulse 1.4s ease-in-out infinite;
}

.hero .hero-inner { transition: opacity 1s ease, transform 1.2s cubic-bezier(.22, .8, .3, 1); }
.hero.is-entered .hero-inner { opacity: 0; transform: translateY(-26px); pointer-events: none; animation: none; }

.hotspots {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0;
  transition: opacity .8s ease .5s;
}
.hero.is-entered .hotspots { opacity: 1; }
.hotspot {
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 0;
  background: none;
  pointer-events: none;
  opacity: 0;
  transition: opacity .35s;
  transform: translate(-50%, -7px);
  white-space: nowrap;
}
.hero.is-entered .hotspot { pointer-events: auto; }
.hotspot.is-visible { opacity: 1; }
.hotspot i {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #ffdd9a;
  box-shadow: 0 0 10px rgba(255, 200, 100, .95), 0 0 26px rgba(255, 180, 80, .6);
  transition: transform .25s, box-shadow .25s;
  animation: hotspotPulse 2.6s ease-in-out infinite;
}
.hotspot span {
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid rgba(201, 168, 106, .32);
  background: rgba(9, 13, 10, .72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  font-size: 11.5px;
  letter-spacing: .14em;
  color: #e4d9bc;
  transition: .25s;
}
.hotspot:hover i,
.hotspot.is-near i { transform: scale(1.5); }
.hotspot:hover span,
.hotspot.is-near span {
  border-color: rgba(238, 213, 149, .75);
  color: var(--gold-bright);
  background: rgba(26, 33, 27, .9);
}

.world-hint {
  position: absolute;
  left: 50%;
  bottom: 30px;
  z-index: 2;
  transform: translate(-50%, 12px);
  font-size: 11px;
  letter-spacing: .24em;
  color: rgba(232, 224, 205, .55);
  opacity: 0;
  transition: opacity 1s ease 1.4s, transform 1s ease 1.4s;
  pointer-events: none;
  text-align: center;
}
.hero.is-entered .world-hint { opacity: .85; transform: translate(-50%, 0); }

.world-reset {
  position: absolute;
  right: 24px;
  bottom: 26px;
  z-index: 3;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid rgba(201, 168, 106, .22);
  background: rgba(9, 13, 10, .55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: rgba(232, 224, 205, .65);
  font-size: 11px;
  letter-spacing: .14em;
  opacity: 0;
  pointer-events: none;
  transition: opacity .8s, border-color .25s, color .25s;
}
.hero.is-entered .world-reset { opacity: 1; pointer-events: auto; transition-delay: 1s; }
.world-reset:hover { border-color: rgba(238, 213, 149, .6); color: var(--gold-bright); }

.world-panel {
  position: absolute;
  left: 50%;
  bottom: 92px;
  z-index: 4;
  transform: translateX(-50%);
  width: min(560px, calc(100% - 32px));
  padding: 18px 20px 14px;
  border-radius: 18px;
  border: 1px solid rgba(201, 168, 106, .38);
  background: linear-gradient(165deg, rgba(20, 27, 22, .94), rgba(9, 12, 10, .96));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .55), 0 0 0 1px rgba(0, 0, 0, .3);
  animation: cardIn .35s cubic-bezier(.22, .8, .3, 1);
}
.world-panel-title {
  margin: 0 0 12px;
  text-align: center;
  font-size: 12px;
  letter-spacing: .24em;
  color: var(--gold);
}
.world-panel-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.world-panel-actions button {
  display: grid;
  gap: 1px;
  padding: 12px 8px;
  border-radius: 12px;
  border: 1px solid rgba(201, 168, 106, .2);
  background: rgba(201, 168, 106, .04);
  text-align: center;
  transition: .22s;
}
.world-panel-actions button:hover {
  border-color: rgba(238, 213, 149, .6);
  background: rgba(201, 168, 106, .12);
  transform: translateY(-2px);
}
.world-panel-actions b {
  font-family: var(--kai);
  font-weight: 500;
  font-size: 15px;
  letter-spacing: .1em;
  color: var(--paper);
}
.world-panel-actions span { font-size: 10px; letter-spacing: .12em; color: var(--muted); }
.world-panel-actions em { font-style: normal; font-size: 11px; color: var(--gold); }
.world-panel-close {
  display: block;
  margin: 12px auto 0;
  font-size: 11px;
  letter-spacing: .18em;
  color: var(--muted);
  transition: color .2s;
}
.world-panel-close:hover { color: var(--gold-bright); }

@keyframes loadingPulse {
  0%, 100% { opacity: .35; transform: scale(.8); }
  50% { opacity: 1; transform: scale(1.1); }
}
@keyframes hotspotPulse {
  0%, 100% { box-shadow: 0 0 8px rgba(255, 200, 100, .8), 0 0 20px rgba(255, 180, 80, .45); }
  50% { box-shadow: 0 0 14px rgba(255, 210, 120, 1), 0 0 36px rgba(255, 180, 80, .7); }
}

/* ============================================================
   动画
   ============================================================ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes riseIn {
  from { opacity: 0; transform: translateY(26px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(18px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes drift {
  from { transform: translate3d(-3%, 0, 0); }
  to { transform: translate3d(4%, -2%, 0); }
}
@keyframes twinkle {
  from { opacity: .35; }
  to { opacity: .9; }
}
@keyframes altarBreathe {
  from { box-shadow: 0 0 26px rgba(201, 168, 106, .05); }
  to { box-shadow: 0 0 46px rgba(201, 168, 106, .14); }
}
@keyframes flame {
  0% { transform: translateX(-50%) scale(1, 1) rotate(-2deg); opacity: .92; }
  50% { transform: translateX(-50%) scale(.92, 1.08) rotate(2deg); opacity: 1; }
  100% { transform: translateX(-50%) scale(1.04, .94) rotate(-1deg); opacity: .88; }
}
@keyframes ember {
  0%, 100% { opacity: .85; transform: translateX(-50%) scale(1); }
  50% { opacity: 1; transform: translateX(-50%) scale(1.25); }
}
@keyframes stickIn {
  from { transform: scaleY(0); opacity: 0; }
  to { transform: scaleY(1); opacity: 1; }
}
@keyframes shake {
  0%, 100% { transform: translateX(-50%) rotate(0deg); }
  12% { transform: translateX(-52%) rotate(-7deg); }
  26% { transform: translateX(-48%) rotate(6deg); }
  40% { transform: translateX(-52%) rotate(-5deg); }
  54% { transform: translateX(-49%) rotate(4deg); }
  68% { transform: translateX(-51%) rotate(-2.5deg); }
  82% { transform: translateX(-50%) rotate(1.5deg); }
}
@keyframes lanternRise {
  0% { transform: translate3d(0, 0, 0) rotate(-1deg) scale(.94); opacity: 0; }
  8% { opacity: 1; }
  50% { transform: translate3d(var(--sway, 16px), -300px, 0) rotate(1.5deg) scale(1); opacity: .98; }
  100% { transform: translate3d(calc(var(--sway, 16px) * -0.5), -640px, 0) rotate(-1deg) scale(1.05); opacity: 0; }
}

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 900px) {
  .rail {
    top: auto;
    right: 0;
    width: auto;
    height: 68px;
    flex-direction: row;
    justify-content: space-around;
    gap: 0;
    padding: 0 6px calc(env(safe-area-inset-bottom, 0px));
    border-right: none;
    border-top: 1px solid var(--line);
    background: rgba(9, 12, 10, .94);
  }
  .rail-brand { display: none; }
  .rail-btn { width: 15vw; max-width: 76px; padding: 6px 0 4px; gap: 1px; }
  .rail-btn span { font-size: 18px; }
  .rail-btn em { font-size: 9px; }
  main { margin-left: 0; padding-bottom: 76px; }
  .view-gate { padding-bottom: 68px; }
  .hero { min-height: calc(100svh - 68px); }
  .hud { top: 14px; right: 14px; }
  .view { padding: 96px 20px 70px; }
  .view-gate { padding: 0; }
  .hero-inner { padding-bottom: 10vh; }
  .world-hint { bottom: 86px; font-size: 10px; letter-spacing: .16em; }
  .world-reset { bottom: 84px; right: 14px; padding: 7px 12px; }
  .world-panel { bottom: 86px; padding: 14px 14px 10px; }
  .hotspot span { font-size: 10.5px; letter-spacing: .08em; padding: 3px 9px; }
  .hotspot i { width: 9px; height: 9px; }
  .altar { height: 440px; }
  .shrine { top: 30px; gap: 12px; }
  .shrine-panel { width: 96px; height: 214px; }
  .shrine-panel .deity { font-size: 28px; }
  .candles { width: 78%; bottom: 140px; }
  .incense-choices { gap: 8px; }
  .incense-choice { grid-template-columns: auto 1fr; padding: 12px; column-gap: 8px; }
  .incense-choice em { grid-column: 2; grid-row: 3; font-size: 11px; margin-top: 2px; }
  .incense-choice b { font-size: 15px; }
  .incense-choice span { font-size: 10px; letter-spacing: .06em; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .profile-card { padding: 24px; gap: 20px; }
  .seal { width: 64px; height: 64px; font-size: 30px; }
  .profile-merit strong { font-size: 38px; }
}

@media (max-width: 640px) {
  .hero-title { font-size: clamp(56px, 18vw, 86px); }
  .hero-sub { letter-spacing: .26em; text-indent: .26em; font-size: 12px; }
  .gate-stats { gap: 26px; margin-top: 40px; }
  .gate-stats strong { font-size: 22px; }
  .view-head { margin-bottom: 28px; }
  .view-head h2 { letter-spacing: .04em; }
  .altar { height: 400px; border-radius: 18px; }
  .shrine { top: 24px; gap: 9px; }
  .shrine-panel { width: 82px; height: 186px; }
  .shrine-panel .deity { font-size: 24px; }
  .shrine-panel em { font-size: 9px; }
  .candles { bottom: 128px; }
  .candle { height: 24px; }
  .censer { transform: translateX(-50%) scale(.86); transform-origin: bottom center; }
  .incense-choices { grid-template-columns: 1fr; }
  .incense-choice { grid-template-columns: auto 1fr auto; grid-template-rows: auto auto; }
  .incense-choice em { grid-column: 3; grid-row: 1 / span 2; margin-top: 0; }
  .wish-form { flex-direction: column; }
  .wish-form .btn-primary { width: 100%; }
  .wish-form input { padding: 13px 18px; font-size: 14px; }
  .lantern-sea { height: 380px; }
  .sea-moon { width: 48px; height: 48px; top: 30px; }
  .breath-ring { width: 250px; height: 250px; }
  .breath-time { font-size: 34px; }
  .duration-row { gap: 8px; }
  .chip { padding: 8px 14px; }
  .record-list li { flex-direction: column; align-items: flex-start; gap: 4px; }
  .record-list li .rec-time { align-self: flex-end; }
  .fortune-card { padding: 26px 20px 22px; }
  .fortune-poem { font-size: 18px; }
  .fortune-actions { flex-wrap: wrap; }
  .toast { bottom: 88px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* ============================================================
   遇人 · 参悟对话
   ============================================================ */
.cast-roles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 26px;
}
.cast-role {
  display: grid;
  gap: 2px;
  padding: 16px 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: linear-gradient(170deg, rgba(20, 26, 22, .55), rgba(10, 13, 11, .7));
  text-align: center;
  transition: .25s;
}
.cast-role:hover {
  border-color: rgba(238, 213, 149, .55);
  transform: translateY(-2px);
  background: rgba(201, 168, 106, .06);
}
.cast-role.is-absent { opacity: .42; cursor: default; transform: none; }
.cast-glyph {
  font-family: var(--kai);
  font-size: 26px;
  line-height: 1.3;
  color: var(--gold);
  text-shadow: 0 0 16px rgba(201, 168, 106, .28);
}
.cast-role b { font-family: var(--kai); font-weight: 500; font-size: 15px; letter-spacing: .12em; color: var(--paper); }
.cast-role em { font-style: normal; font-size: 10.5px; letter-spacing: .06em; color: var(--muted); }

.cast-stage {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px 18px 14px;
  background: rgba(12, 16, 13, .6);
}
.cast-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(201, 168, 106, .12);
}
.cast-who { font-family: var(--kai); font-size: 19px; letter-spacing: .16em; color: var(--gold-bright); }
.cast-head em { font-style: normal; font-size: 11px; letter-spacing: .14em; color: var(--muted); }
.cast-exit { margin-left: auto; font-size: 11px; letter-spacing: .14em; color: var(--muted); transition: color .2s; }
.cast-exit:hover { color: var(--gold-bright); }

.cast-log {
  display: grid;
  gap: 12px;
  min-height: 200px;
  max-height: 46vh;
  overflow-y: auto;
  padding: 16px 2px;
}
.cast-line { display: grid; gap: 4px; max-width: 84%; animation: fadeUp .4s cubic-bezier(.22, .8, .3, 1); }
.cast-line.is-you { justify-self: end; text-align: right; }
.cast-line.is-them { justify-self: start; }
.cast-say { margin: 0; font-size: 15px; line-height: 1.85; letter-spacing: .03em; }
.cast-line.is-you .cast-say { color: var(--paper); }
.cast-line.is-them .cast-say { color: #dfd3b4; }
.cast-act { margin: 0; font-family: var(--kai); font-style: italic; font-size: 14px; letter-spacing: .06em; color: var(--muted); }
.cast-src { font-size: 10px; letter-spacing: .1em; color: rgba(201, 168, 106, .6); }

.cast-input { display: grid; gap: 10px; padding-top: 12px; border-top: 1px solid rgba(201, 168, 106, .12); }
.cast-input textarea {
  width: 100%;
  min-height: 56px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(8, 11, 9, .7);
  color: var(--paper);
  font-size: 14px;
  line-height: 1.7;
  letter-spacing: .03em;
  resize: vertical;
  outline: none;
  transition: border-color .2s;
}
.cast-input textarea:focus { border-color: rgba(238, 213, 149, .5); }
.cast-input textarea::placeholder { color: rgba(126, 122, 108, .75); }
.cast-actions { display: flex; align-items: center; gap: 10px; }
.cast-actions .btn-primary { padding: 10px 26px; font-size: 14px; }
.cast-tip { margin: 0; font-size: 11px; letter-spacing: .06em; color: var(--muted); }

.cast-result {
  display: grid;
  gap: 16px;
  padding: 22px 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(12, 16, 13, .55);
  animation: cardIn .4s cubic-bezier(.22, .8, .3, 1);
}
.cast-left { margin: 0; font-family: var(--kai); font-size: 15px; letter-spacing: .06em; color: var(--paper-dim); }
.cast-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.cast-stats > div {
  display: grid;
  gap: 2px;
  padding: 12px 8px;
  text-align: center;
  border-radius: 12px;
  border: 1px solid rgba(201, 168, 106, .1);
  background: rgba(201, 168, 106, .05);
}
.cast-stats strong { font-size: 22px; font-weight: 500; color: var(--gold-bright); }
.cast-stats span { font-size: 10.5px; letter-spacing: .06em; color: var(--muted); }
.cast-lost {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  margin: 0;
  font-size: 13px;
  letter-spacing: .04em;
  color: var(--paper-dim);
}
.cast-lost em { font-style: normal; font-family: var(--kai); font-size: 15px; letter-spacing: .08em; color: var(--cinnabar); }
.cast-result button { justify-self: start; }

.cast-echo {
  margin-top: 18px;
  padding: 14px 16px;
  border-left: 2px solid rgba(201, 168, 106, .35);
  border-radius: 0 12px 12px 0;
  background: rgba(201, 168, 106, .03);
  animation: fadeUp .5s ease;
}
.cast-echo-src { margin: 0 0 4px; font-size: 11px; letter-spacing: .1em; color: var(--muted); }
.cast-echo-text { margin: 0; font-family: var(--kai); font-size: 16px; letter-spacing: .06em; color: var(--paper); }

.cast-archive { margin-top: 26px; }
.cast-archive h3 {
  margin: 0 0 12px;
  font-family: var(--kai);
  font-weight: 500;
  font-size: 15px;
  letter-spacing: .14em;
  color: var(--gold);
}
.cast-archive-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.cast-archive-list li {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid rgba(201, 168, 106, .08);
  background: rgba(255, 255, 255, .015);
  font-size: 13px;
}
.cast-archive-list li b { font-weight: 400; color: var(--paper-dim); }
.cast-archive-list li em { font-style: normal; font-size: 11px; color: var(--muted); white-space: nowrap; }
.cast-archive-empty { justify-content: flex-start; color: var(--muted); }

@media (max-width: 900px) {
  .rail-btn { width: 13vw; }
  .cast-log { max-height: 40vh; }
}
@media (max-width: 640px) {
  .cast-roles { grid-template-columns: repeat(2, 1fr); }
  .cast-line { max-width: 92%; }
  .cast-stats { grid-template-columns: repeat(2, 1fr); }
}

/* ---- 遇人 · 座 ---- */
.cast-role.is-seat {
  border-style: dashed;
  border-color: rgba(201, 168, 106, .38);
  background: linear-gradient(170deg, rgba(201, 168, 106, .07), rgba(10, 13, 11, .7));
}
.cast-role.is-seat .cast-glyph { color: var(--gold-bright); }
.cast-role.is-empty-seat { opacity: .72; }

.cast-seat-panel {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding: 20px;
  border: 1px dashed rgba(201, 168, 106, .38);
  border-radius: 18px;
  background: linear-gradient(170deg, rgba(201, 168, 106, .05), rgba(10, 13, 11, .72));
  animation: cardIn .35s cubic-bezier(.22, .8, .3, 1);
}
.cast-panel-title { margin: 0; font-family: var(--kai); font-size: 17px; letter-spacing: .14em; color: var(--gold-bright); }
.cast-panel-desc { margin: 0; font-size: 12px; letter-spacing: .04em; color: var(--muted); line-height: 1.8; }
.cast-field-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.cast-field { display: grid; gap: 5px; }
.cast-field > span { font-size: 11px; letter-spacing: .1em; color: var(--gold); }
.cast-field input,
.cast-field select {
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(8, 11, 9, .7);
  color: var(--paper);
  font-size: 13px;
  letter-spacing: .03em;
  outline: none;
  transition: border-color .2s;
}
.cast-field input:focus,
.cast-field select:focus { border-color: rgba(238, 213, 149, .5); }
.cast-field input::placeholder { color: rgba(126, 122, 108, .7); }
.cast-panel-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.cast-panel-note { margin: 0; font-size: 11px; letter-spacing: .04em; color: var(--muted); }

/* ---- 不寄 ---- */
.cast-letter {
  display: grid;
  gap: 10px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed rgba(201, 168, 106, .22);
}
.cast-letter-head { display: flex; align-items: baseline; gap: 10px; }
.cast-letter-head span { font-family: var(--kai); font-size: 15px; letter-spacing: .18em; color: var(--gold); }
.cast-letter-head em { font-style: normal; font-size: 11px; letter-spacing: .08em; color: var(--muted); }
.cast-letter textarea {
  width: 100%;
  min-height: 54px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(8, 11, 9, .6);
  color: var(--paper);
  font-size: 13px;
  line-height: 1.8;
  letter-spacing: .03em;
  resize: vertical;
  outline: none;
}
.cast-letter textarea:focus { border-color: rgba(238, 213, 149, .45); }
.cast-letter-actions { display: flex; gap: 10px; }
.cast-letter-actions .btn-ghost { padding: 7px 18px; font-size: 12px; }
.cast-letter-burn { font-family: var(--kai); font-size: 15px; letter-spacing: .1em; color: var(--paper-dim); min-height: 22px; }
.cast-letter-burn span { transition: opacity .7s ease, transform .7s ease, filter .7s ease; display: inline-block; }
.cast-letter-burn span.is-burned { opacity: 0; transform: translateY(-7px) scale(.86); filter: blur(2px); }
.cast-letter-ash { margin: 0; font-size: 12px; letter-spacing: .12em; color: var(--muted); }
.cast-letter-list { display: grid; gap: 6px; }
.cast-letter-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 9px;
  border: 1px solid rgba(201, 168, 106, .08);
  background: rgba(255, 255, 255, .012);
  font-size: 12.5px;
}
.cast-letter-row p { margin: 0; color: var(--paper-dim); }
.cast-letter-row em { font-style: normal; font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.cast-letter-row.is-gone p { color: rgba(126, 122, 108, .8); text-decoration: line-through; text-decoration-thickness: 1px; }
.cast-empty-note { margin: 0; font-size: 11.5px; letter-spacing: .06em; color: var(--muted); }
.cast-persons { margin: 0; font-size: 13px; letter-spacing: .04em; color: var(--paper-dim); display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; }
.cast-persons em { font-style: normal; font-family: var(--kai); color: var(--cinnabar); letter-spacing: .06em; }

@media (max-width: 640px) {
  .cast-field-row { grid-template-columns: 1fr; }
}

/* ---- 云隐观记 ---- */
.chronicle { margin-top: 30px; }
.chronicle h3 {
  margin: 0 0 12px;
  font-family: var(--kai);
  font-weight: 500;
  font-size: 15px;
  letter-spacing: .14em;
  color: var(--gold);
}
.chronicle-list {
  margin: 0;
  padding: 16px 20px;
  list-style: none;
  border: 1px solid rgba(201, 168, 106, .12);
  border-radius: 14px;
  background: rgba(255, 255, 255, .012);
  display: grid;
  gap: 8px;
}
.chronicle-list li {
  font-family: var(--kai);
  font-size: 15px;
  line-height: 1.9;
  letter-spacing: .06em;
  color: var(--paper-dim);
}
.chronicle-list li:last-child { color: var(--gold); }
.chronicle-note { margin: 10px 0 0; font-size: 11px; letter-spacing: .06em; color: var(--muted); }

/* ---- 疑：参悟 ---- */
.doubt-raise { display: grid; gap: 14px; justify-items: start; padding: 26px 22px; border: 1px dashed rgba(201,168,106,.3); border-radius: 18px; background: rgba(12,16,13,.55); }
.doubt-raise-text { margin: 0; font-family: var(--kai); font-size: 17px; letter-spacing: .1em; color: var(--paper-dim); }
.doubt-msg { margin: 0; font-size: 12px; color: var(--muted); letter-spacing: .06em; }

.doubt-card { padding: 24px 22px; border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(170deg, rgba(201,168,106,.05), rgba(10,13,11,.7)); }
.doubt-meta { margin: 0 0 12px; font-size: 11px; letter-spacing: .14em; color: var(--muted); }
.doubt-hua { margin: 0; font-family: var(--kai); font-size: clamp(20px, 3vw, 27px); line-height: 1.9; letter-spacing: .1em; color: var(--paper); }
.doubt-hua::after { content: ""; display: block; width: 42px; height: 1px; margin-top: 16px; background: rgba(201,168,106,.4); }

.doubt-block { margin-top: 18px; padding: 18px 20px; border: 1px solid rgba(201,168,106,.12); border-radius: 16px; background: rgba(255,255,255,.012); display: grid; gap: 10px; justify-items: start; }
.doubt-block h4 { margin: 0; font-family: var(--kai); font-weight: 500; font-size: 15px; letter-spacing: .16em; color: var(--gold); }
.doubt-note { margin: 0; font-size: 12px; line-height: 1.8; letter-spacing: .04em; color: var(--muted); }
.doubt-block textarea { width: 100%; min-height: 52px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: rgba(8,11,9,.7); color: var(--paper); font-size: 14px; line-height: 1.8; letter-spacing: .04em; resize: vertical; outline: none; }
.doubt-block textarea:focus { border-color: rgba(238,213,149,.45); }
.doubt-block textarea:disabled { opacity: .45; }
.doubt-report { margin: 0; font-size: 12.5px; letter-spacing: .04em; color: var(--paper-dim); }
.doubt-state { margin: 0; font-size: 11px; letter-spacing: .12em; color: var(--muted); }
.doubt-taphint { font-size: 11px; color: var(--muted); letter-spacing: .1em; }
.doubt-settle { display: flex; align-items: center; gap: 10px; }
.doubt-settle label { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); letter-spacing: .06em; }
.doubt-settle input { width: 76px; padding: 7px 10px; border-radius: 8px; border: 1px solid var(--line); background: rgba(8,11,9,.7); color: var(--paper); font-size: 13px; outline: none; }
.doubt-verdict { margin: 0; font-family: var(--kai); font-size: 15px; letter-spacing: .08em; color: var(--muted); min-height: 22px; }
.doubt-verdict.is-refused { color: var(--cinnabar); }
.doubt-answers { display: grid; gap: 10px; width: 100%; }
.doubt-answer { padding: 10px 12px; border-left: 2px solid rgba(201,168,106,.25); background: rgba(0,0,0,.18); border-radius: 0 10px 10px 0; }
.doubt-answer em { font-style: normal; font-size: 10.5px; letter-spacing: .1em; color: var(--muted); }
.doubt-answer-text { margin: 4px 0 2px; font-size: 14px; color: var(--paper); letter-spacing: .03em; }
.doubt-answer-said { margin: 0; font-family: var(--kai); font-size: 13.5px; color: var(--cinnabar); letter-spacing: .06em; }

.doubt-archive { margin-top: 30px; }
.doubt-archive h3 { margin: 0 0 12px; font-family: var(--kai); font-weight: 500; font-size: 15px; letter-spacing: .14em; color: var(--gold); }
.doubt-archive-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.doubt-archive-item { padding: 14px 16px; border-radius: 12px; border: 1px solid rgba(201,168,106,.1); background: rgba(255,255,255,.012); display: grid; gap: 5px; }
.doubt-archive-item b { font-family: var(--kai); font-weight: 500; font-size: 15px; letter-spacing: .06em; color: var(--paper); }
.doubt-archive-item em { font-style: normal; font-size: 10.5px; letter-spacing: .08em; color: var(--muted); }
.doubt-archive-ans { margin: 2px 0 0; font-size: 13px; color: var(--paper-dim); letter-spacing: .03em; }
.doubt-archive-lost { margin: 4px 0 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; font-size: 12px; color: var(--muted); }
.doubt-archive-lost em { font-style: normal; font-family: var(--kai); font-size: 14px; color: var(--cinnabar); }
.doubt-archive-why { margin: 4px 0 0; font-family: var(--kai); font-size: 13px; color: var(--muted); letter-spacing: .04em; }
.doubt-archive-empty { color: var(--muted); font-size: 12.5px; }

@media (max-width: 900px) {
  .rail-btn { width: 11.5vw; }
  .rail-btn span { font-size: 17px; }
  .rail-btn em { font-size: 8.5px; }
}

/* ---- 观史 · 三通残碑 ---- */
.lore { margin-top: 30px; }
.lore h3 { margin: 0 0 12px; font-family: var(--kai); font-weight: 500; font-size: 15px; letter-spacing: .14em; color: var(--gold); }
.lore-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.lore-item { padding: 16px 18px; border-radius: 12px; border: 1px solid rgba(201,168,106,.12); background: rgba(255,255,255,.012); display: grid; gap: 8px; }
.lore-item b { font-family: var(--kai); font-weight: 500; font-size: 14px; letter-spacing: .12em; color: var(--gold-bright); }
.lore-text { margin: 0; font-family: var(--kai); font-size: 15px; line-height: 2; letter-spacing: .05em; color: var(--paper-dim); }
.lore-item.is-locked { opacity: .5; border-style: dashed; }
.lore-text.is-locked-text { color: var(--muted); letter-spacing: .2em; }
.lore-note { margin: 10px 0 0; font-size: 11px; letter-spacing: .06em; color: var(--muted); }
.cast-seat-motto { margin-top: 2px; color: rgba(201,168,106,.7); letter-spacing: .1em; }

/* ---- 寓言 · 濠梁：灯海下多一道游鱼的影子 ---- */
.sea-fish {
  position: absolute;
  left: -20%;
  top: 68%;
  width: 120px;
  height: 34px;
  border-radius: 60% 40% 55% 45% / 60% 55% 45% 40%;
  background: radial-gradient(ellipse at 40% 50%, rgba(10, 20, 16, .55), rgba(10, 20, 16, 0) 72%);
  filter: blur(3px);
  opacity: 0;
  animation: fishPass 9s cubic-bezier(.35, .1, .5, .9) forwards;
  pointer-events: none;
}
@keyframes fishPass {
  0% { opacity: 0; transform: translateX(0) scaleX(1); }
  12% { opacity: .9; }
  50% { opacity: .55; transform: translateX(70vw) scaleX(.8); }
  88% { opacity: .2; }
  100% { opacity: 0; transform: translateX(120vw) scaleX(.6); }
}

/* ---- 换位 ---- */
.cast-swap {
  display: grid;
  gap: 10px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed rgba(201, 168, 106, .22);
}
.cast-swap textarea {
  width: 100%;
  min-height: 50px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(8, 11, 9, .6);
  color: var(--paper);
  font-size: 13px;
  line-height: 1.8;
  letter-spacing: .03em;
  resize: vertical;
  outline: none;
}
.cast-swap textarea:focus { border-color: rgba(238, 213, 149, .45); }
.cast-swap-log { display: grid; gap: 8px; }
.cast-swap-row { padding: 9px 11px; border-left: 2px solid rgba(201, 168, 106, .22); background: rgba(0, 0, 0, .18); border-radius: 0 10px 10px 0; }
.cast-swap-q { margin: 0; font-size: 13px; color: #dfd3b4; letter-spacing: .03em; }
.cast-swap-a { margin: 3px 0 0; font-size: 13px; color: var(--paper-dim); letter-spacing: .03em; }

/* ---- 移动端手感 ---- */
button, .rail-btn, .hotspot, .chip, .incense-choice { touch-action: manipulation; }
@media (hover: none) {
  .rail-btn:hover, .cast-role:hover, .hotspot:hover i { background: none; }
  .cast-role:hover { transform: none; }
}
@media (orientation: landscape) and (max-height: 520px) {
  .hero { min-height: 100svh; }
  .view { padding-top: 40px; }
  .cast-log, .doubt-block { max-height: 46vh; }
}
