/* 云上伽蓝 · 殿堂夜景设计系统（单文件，无框架） */

:root {
  --bg: #17100a;
  --bg2: #1e150c;
  --wood: #2a1e12;
  --wood2: #332515;
  --ink: #ece2ca;
  --muted: #a6946f;
  --faint: #8a7854;
  --gold: #c9a35c;
  --gold2: #e2c185;
  --flame: #ffb84d;
  --ember: #e07b39;
  --cinnabar: #b8452f;
  --cinnabar2: #d0563a;
  --line: #3a2c19;
  --card: rgba(255, 220, 160, 0.04);
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.55);
  --serif: "Songti SC", "STSong", "Noto Serif SC", "Noto Serif CJK SC", "Source Han Serif SC", serif;
  --sans: -apple-system, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--serif); line-height: 1.9; letter-spacing: 0.02em;
  background-image:
    radial-gradient(1200px 700px at 50% -8%, rgba(255, 176, 76, 0.09), transparent 62%),
    radial-gradient(900px 900px at 50% 118%, rgba(0, 0, 0, 0.6), transparent 55%);
}
body::after { /* 暗角 */
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background: radial-gradient(140% 100% at 50% 42%, transparent 55%, rgba(0,0,0,.42));
}
main, header.bian, header.page-head, footer.site-footer, #festival { position: relative; z-index: 1; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--gold2); text-decoration: none; }
a:hover { color: var(--flame); }
.skip { position: absolute; left: -9999px; top: 0; background: var(--gold); color: #241505; padding: 8px 14px; z-index: 99; }
.skip:focus { left: 8px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ── 匾额 ─────────────────────────────── */
header.bian { text-align: center; padding: 56px 16px 10px; }
.bian-e {
  margin: 0 0 18px; color: var(--faint); font-size: 13px; letter-spacing: 0.55em; text-indent: 0.55em;
}
header.bian h1 {
  margin: 0; font-size: clamp(38px, 9vw, 64px); font-weight: 700; letter-spacing: 0.18em; text-indent: 0.18em;
  color: var(--gold2);
  text-shadow: 0 0 1px rgba(0,0,0,.4), 0 2px 26px rgba(226, 193, 133, 0.18);
}
.bian-sub { margin: 12px 0 26px; color: var(--muted); font-size: 15px; letter-spacing: 0.24em; text-indent: 0.24em; }

/* 导航 */
.site-nav {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 22px;
  padding: 10px 12px; margin: 0 auto 8px; max-width: 720px;
  font-family: var(--sans); font-size: 14px;
}
.site-nav a { color: var(--muted); }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--gold2); }

/* 节令横幅 */
.festival {
  max-width: 720px; margin: 10px auto 0; padding: 9px 18px; text-align: center;
  border: 1px solid var(--line); border-left: 3px solid var(--cinnabar); border-right: 3px solid var(--cinnabar);
  background: linear-gradient(180deg, rgba(184, 69, 47, 0.12), rgba(184, 69, 47, 0.05));
  color: var(--gold2); font-size: 15px; letter-spacing: 0.12em;
}
.festival small { color: var(--muted); letter-spacing: 0.05em; margin-left: 10px; }

/* ── 圣位 ─────────────────────────────── */
.shengwei {
  display: grid; grid-template-columns: minmax(280px, 460px) minmax(220px, 1fr);
  gap: 34px; align-items: center; justify-content: center;
  max-width: 980px; margin: 26px auto 0; padding: 0 20px;
}
.sw-fig { margin: 0; position: relative; }
.sw-fig::before {
  content: ""; position: absolute; inset: -14px; z-index: -1;
  border: 1px solid rgba(201, 163, 92, 0.28);
  box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.55);
  background:
    linear-gradient(180deg, rgba(201,163,92,.05), transparent 30%),
    linear-gradient(0deg, rgba(0,0,0,.35), transparent 40%);
}
.sw-fig img {
  width: 100%; border: 6px solid var(--wood2);
  filter: sepia(0.22) brightness(0.92) contrast(1.04);
  box-shadow: var(--shadow);
}
.sw-fig figcaption {
  margin-top: 10px; text-align: center; color: var(--faint); font-size: 12.5px; letter-spacing: 0.08em;
}
.pai {
  display: inline-block; writing-mode: vertical-rl; letter-spacing: 0.3em;
  color: var(--gold2); font-size: clamp(20px, 3.4vw, 30px);
  border: 2px solid rgba(201, 163, 92, 0.5); padding: 26px 10px 22px; margin: 0 26px 18px 0;
  background: linear-gradient(180deg, rgba(201, 163, 92, 0.07), transparent);
  text-shadow: 0 2px 18px rgba(226, 193, 133, 0.25);
}
.sw-side p.sw-note { color: var(--ink); max-width: 40ch; margin: 0 0 14px; }
.sw-side .muted { color: var(--muted); font-size: 14px; }
.sw-side b { color: var(--gold2); }

/* ── 香炉与供桌 ───────────────────────── */
.gongzhuo { max-width: 860px; margin: 34px auto 0; padding: 0 18px; text-align: center; }
.incense-zone { position: relative; height: 150px; }
.lu {
  position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%);
  width: 148px; height: 64px; cursor: pointer; outline: none;
  background:
    radial-gradient(60% 90% at 50% 118%, #4a3416 0 60%, transparent 61%),
    linear-gradient(180deg, #553c1b 0 14px, #3a2a12 14px 42px, #241804 42px 100%);
  border-radius: 10px 10px 46% 46% / 10px 10px 22px 22px;
  border: 1px solid #5e431e;
  box-shadow: 0 8px 26px rgba(0,0,0,.6), inset 0 2px 4px rgba(255, 200, 120, 0.12);
}
.lu::before { /* 炉口 */
  content: ""; position: absolute; inset: 4px 26px auto; height: 10px;
  background: linear-gradient(180deg, #120b03, #2e1f0b);
  border-radius: 50%; box-shadow: inset 0 2px 5px #000;
}
.lu:focus-visible { outline: 2px solid var(--gold); }
.lu-label { position: absolute; left: 0; right: 0; bottom: -22px; color: var(--faint); font-size: 12.5px; letter-spacing: 0.2em; }
/* 三炷香（点燃后出现） */
.incense-zone.on .lu::after {
  content: ""; position: absolute; left: 50%; top: -56px; transform: translateX(-50%);
  width: 10px; height: 56px; border-radius: 4px 4px 2px 2px;
  background: linear-gradient(180deg, #b8452f 0 6px, #3a2a12 6px);
  box-shadow: -18px 0 0 #3a2a12, 18px 0 0 #3a2a12;
}
.smoke { position: absolute; left: 50%; top: -34px; width: 0; }
.smoke i {
  position: absolute; left: -1px; width: 2px; height: 46px; border-radius: 50%;
  background: linear-gradient(180deg, transparent, rgba(226, 193, 133, 0.34));
  opacity: 0; transform-origin: 50% 100%;
}
.incense-zone.on .smoke i { animation: rise 6s ease-out infinite; }
.incense-zone.on .smoke i:nth-child(2) { animation-delay: 2s; animation-duration: 7s; }
.incense-zone.on .smoke i:nth-child(3) { animation-delay: 4s; animation-duration: 8s; }
@keyframes rise {
  0% { opacity: 0; transform: translate(0, 0) scaleY(.4) rotate(0); }
  22% { opacity: .8; }
  100% { opacity: 0; transform: translate(var(--dx, 14px), -104px) scaleY(1) rotate(24deg); }
}
.smoke i:nth-child(2) { --dx: -16px; }
.smoke i:nth-child(3) { --dx: 6px; }

/* 五动作 */
.ritual-row {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px;
  max-width: 700px; margin: 40px auto 6px;
}
.ritual {
  appearance: none; background: var(--card); color: var(--ink);
  border: 1px solid var(--line); border-radius: 10px;
  padding: 14px 6px 11px; cursor: pointer; font-family: var(--serif);
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  transition: border-color .2s, background .2s, transform .06s;
}
.ritual:hover { border-color: rgba(201, 163, 92, 0.55); background: rgba(255, 220, 160, 0.06); }
.ritual:active { transform: translateY(1px); }
.ritual:focus-visible { outline: 2px solid var(--gold); }
.r-name { font-size: 16px; letter-spacing: 0.18em; color: var(--gold2); }
.r-hint { font-size: 11.5px; color: var(--faint); font-family: var(--sans); }
.r-icon { width: 30px; height: 34px; position: relative; display: inline-block; }
/* 灯火 */
.r-lamp::after {
  content: ""; position: absolute; inset: 8px 7px 2px;
  background: radial-gradient(46% 62% at 50% 68%, #fff3cf 0 22%, var(--flame) 46%, var(--ember) 62%, transparent 70%);
  border-radius: 50% 50% 46% 46%; filter: blur(0.4px);
  animation: flick 1.6s infinite steps(3);
}
@keyframes flick { 0%{transform:scale(1) rotate(-1deg)} 45%{transform:scale(1.06) rotate(1deg)} 70%{transform:scale(.96)} 100%{transform:scale(1)} }
/* 香 */
.r-incense::after {
  content: ""; position: absolute; left: 13px; top: 2px; width: 4px; height: 26px;
  border-radius: 2px; background: linear-gradient(180deg, #d0563a 0 5px, #5c431f 5px);
  box-shadow: 9px 0 0 #5c431f, -9px 0 0 #5c431f, 9px -5px 0 #d0563a, -9px -5px 0 #d0563a;
}
/* 水 */
.r-water::after {
  content: ""; position: absolute; inset: 9px 5px 3px;
  border: 1px solid rgba(201,163,92,.5); border-radius: 3px 3px 8px 8px;
  background: linear-gradient(180deg, rgba(120,160,190,.14) 0 55%, rgba(201,163,92,.08));
}
/* 花 */
.r-flower::after {
  content: ""; position: absolute; inset: 4px 6px;
  background:
    radial-gradient(6px at 50% 42%, #e8c98e 58%, transparent 60%),
    radial-gradient(5px at 36% 34%, #d0563a 60%, transparent 62%),
    radial-gradient(5px at 64% 34%, #d0563a 60%, transparent 62%),
    radial-gradient(5px at 30% 52%, #d0563a 60%, transparent 62%),
    radial-gradient(5px at 70% 52%, #d0563a 60%, transparent 62%),
    radial-gradient(5px at 50% 26%, #d0563a 60%, transparent 62%);
}
/* 磬 */
.r-bell::after {
  content: ""; position: absolute; inset: 7px 4px 10px;
  border: 2px solid rgba(201,163,92,.75); border-radius: 4px 4px 16px 16px;
  background: linear-gradient(180deg, rgba(201,163,92,.16), transparent);
}
.r-bell.rung::after { animation: qing .8s ease-out; }
@keyframes qing { 30% { transform: translateY(1.5px); box-shadow: 0 4px 20px rgba(255,184,77,.28);} }
.r-water.ripple::after { animation: ripple .9s ease-out; }
@keyframes ripple { 35% { box-shadow: 0 0 22px rgba(160,190,220,.3); } }

.stats {
  margin: 14px auto 0; text-align: center; color: var(--muted); font-size: 14px;
  max-width: 600px; font-family: var(--sans); letter-spacing: 0.04em;
}
.stats b { color: var(--gold2); font-weight: 600; }

/* ── 灯墙 ─────────────────────────────── */
main { max-width: 1060px; margin: 0 auto; padding: 0 16px 40px; }
.lamps-sec { margin-top: 56px; }
h2 { font-size: 21px; letter-spacing: 0.22em; color: var(--gold2); font-weight: 600; margin: 0 0 6px; }
.sec-sub { margin: 0 0 16px; color: var(--muted); font-size: 14px; font-family: var(--sans); }
.lamp-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 12px;
}
.lamp {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 16px 12px 12px; text-align: center; cursor: pointer;
  transition: border-color .2s, background .2s; position: relative; overflow: hidden;
}
.lamp:hover { border-color: rgba(201,163,92,.6); background: rgba(255,220,160,.05); }
.lamp .fl {
  width: 22px; height: 30px; margin: 0 auto 8px;
  background: radial-gradient(48% 64% at 50% 70%, #fff3cf 0 20%, var(--flame) 50%, var(--ember) 68%, transparent 76%);
  border-radius: 50% 50% 40% 40%; filter: blur(.4px); animation: flick 1.9s infinite steps(3);
}
.lamp.off .fl { background: none; border: 1px solid var(--faint); border-radius: 50% 50% 40% 40%; animation: none; }
.lamp .nm { font-size: 14.5px; color: var(--ink); }
.lamp .dt { font-size: 11px; color: var(--faint); font-family: var(--sans); margin-top: 3px; }
.lamp .seal {
  position: absolute; top: 8px; right: 8px; width: 26px; height: 26px;
  border: 1.5px solid rgba(184,69,47,.85); border-radius: 3px; color: #e0705a;
  font-size: 12px; display: flex; align-items: center; justify-content: center;
  transform: rotate(3deg); background: rgba(184,69,47,.08);
}
.ghost, .primary {
  font-family: var(--serif); cursor: pointer; border-radius: 8px; letter-spacing: .14em;
}
.ghost { background: none; border: 1px solid var(--line); color: var(--muted); padding: 8px 22px; font-size: 14px; }
.ghost:hover { color: var(--gold2); border-color: rgba(201,163,92,.5); }
.lamp-more { text-align: center; margin: 18px 0 0; }

/* ── 晨香印 ───────────────────────────── */
.calendar-sec { margin-top: 56px; max-width: 560px; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 7px; }
.cal i {
  aspect-ratio: 1; border: 1px solid var(--line); border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: var(--faint); font-style: normal; font-family: var(--sans);
}
.cal i.today { border-color: rgba(201,163,92,.5); color: var(--muted); }
.cal i.st {
  background: radial-gradient(circle at 34% 30%, rgba(184,69,47,.16), rgba(184,69,47,.55));
  border-color: rgba(184,69,47,.8); color: #eccfc4;
  box-shadow: inset 0 0 8px rgba(0,0,0,.35);
  font-family: var(--serif); letter-spacing: .05em; transform: rotate(-2deg);
}
.cal i.off { visibility: hidden; }
.cal-note { color: var(--faint); font-size: 12.5px; font-family: var(--sans); margin-top: 14px; }

/* ── 入殿四问 ─────────────────────────── */
.ke-sec { margin-top: 56px; }
.ke-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.ke {
  display: flex; flex-direction: column; gap: 8px; padding: 18px 16px;
  background: var(--card); border: 1px solid var(--line); border-left: 3px solid var(--cinnabar);
  border-radius: 10px; color: var(--ink);
}
.ke:hover { border-color: rgba(201,163,92,.5); background: rgba(255,220,160,.05); }
.ke b { color: var(--gold2); font-size: 16.5px; letter-spacing: .06em; }
.ke span { color: var(--muted); font-size: 13.5px; line-height: 1.8; }

/* ── 文章页 ───────────────────────────── */
body.page { background-image: radial-gradient(1100px 640px at 50% -6%, rgba(255,176,76,.06), transparent 60%), var(--bg); }
.page-head { max-width: 880px; margin: 0 auto; padding: 26px 18px 0; }
.crumb { font-family: var(--sans); font-size: 13px; color: var(--faint); margin: 0 0 10px; letter-spacing: .03em; }
.prose { max-width: 760px; margin: 0 auto; padding: 14px 20px 46px; }
.prose h1 { font-size: clamp(26px, 5vw, 34px); letter-spacing: .1em; color: var(--gold2); margin: 18px 0 4px; line-height: 1.5; }
.prose .lede { color: var(--muted); font-size: 16.5px; margin: 10px 0 26px; }
.prose h2 { margin: 40px 0 10px; font-size: 18px; letter-spacing: .16em; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.prose p { margin: 14px 0; }
.prose ul { padding-left: 1.3em; }
.prose li { margin: 7px 0; }
.prose b { color: var(--gold2); font-weight: 600; }
.prose .sa { color: var(--gold2); font-style: italic; }
.name-list {
  text-align: center; letter-spacing: .5em; line-height: 2.3; color: var(--ink);
  background: var(--card); border: 1px dashed var(--line); border-radius: 10px; padding: 18px 8px;
}
blockquote.zan {
  margin: 26px auto; max-width: 480px; text-align: center; color: var(--gold2);
  letter-spacing: .16em; line-height: 2.4; font-size: 16.5px;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 22px 0;
}
blockquote.zan p { margin: 0; }
.fig { margin: 30px 0; }
.fig img { border: 5px solid var(--wood2); box-shadow: var(--shadow); margin: 0 auto; filter: sepia(.18) brightness(.94) contrast(1.03); }
.fig figcaption { margin-top: 10px; text-align: center; color: var(--faint); font-size: 12.5px; line-height: 1.8; }
.tbl-note { color: var(--faint); font-size: 12.5px; font-family: var(--sans); }
.table { width: 100%; border-collapse: collapse; font-size: 14.5px; margin: 8px 0 10px; }
.table th { text-align: left; color: var(--gold2); font-weight: 600; letter-spacing: .1em; border-bottom: 1px solid var(--line); padding: 8px 10px; font-family: var(--serif); }
.table td { border-bottom: 1px dashed var(--line); padding: 9px 10px; vertical-align: top; color: var(--ink); }
.table td:first-child { color: var(--muted); white-space: nowrap; font-family: var(--sans); font-size: 13px; }
.map-note {
  text-align: center; color: var(--gold2); letter-spacing: .12em; line-height: 2.2;
  border: 1px dashed rgba(201,163,92,.4); border-radius: 10px; padding: 16px 8px; margin: 22px 0;
}
.next { margin: 44px 0 0; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); }
.src-note { margin-top: 46px; color: var(--faint); font-size: 12.5px; font-family: var(--sans); border-top: 1px dashed var(--line); padding-top: 14px; }

/* ── 页脚 ─────────────────────────────── */
.site-footer { border-top: 1px solid var(--line); margin-top: 70px; padding: 34px 20px 30px; }
.foot-grid {
  max-width: 980px; margin: 0 auto; display: grid; gap: 20px;
  grid-template-columns: 2fr 1.4fr 1fr;
}
.foot-name { color: var(--gold2); font-size: 17px; letter-spacing: .2em; margin: 0 0 8px; }
.foot-name span { color: var(--faint); font-size: 12px; letter-spacing: .1em; margin-left: 8px; font-family: var(--sans); }
.foot-h { color: var(--ink); margin: 0 0 6px; font-size: 14px; letter-spacing: .12em; }
.foot-muted { color: var(--muted); font-size: 13px; line-height: 1.9; margin: 0 0 6px; font-family: var(--sans); }
.foot-legal { max-width: 980px; margin: 22px auto 0; color: var(--faint); font-size: 12px; font-family: var(--sans); text-align: center; }

/* ── 模态 ─────────────────────────────── */
.modal[hidden] { display: none; }
.modal { position: fixed; inset: 0; z-index: 40; background: rgba(8, 4, 0, 0.74); display: flex; align-items: center; justify-content: center; padding: 18px; }
.modal-card {
  background: var(--bg2); border: 1px solid rgba(201, 163, 92, 0.4); border-radius: 14px;
  max-width: 520px; width: 100%; max-height: 92vh; overflow-y: auto;
  padding: 24px 22px 20px; position: relative; box-shadow: var(--shadow);
}
.modal-card h3 { margin: 0 0 6px; color: var(--gold2); letter-spacing: .16em; font-size: 20px; }
.m-sub { color: var(--muted); font-size: 13px; font-family: var(--sans); margin: 0 0 16px; }
.modal-x {
  position: absolute; top: 10px; right: 12px; background: none; border: none;
  color: var(--muted); font-size: 22px; cursor: pointer; line-height: 1; padding: 4px 8px;
}
fieldset { border: 1px solid var(--line); border-radius: 10px; margin: 0 0 14px; padding: 10px 12px 12px; }
legend { color: var(--faint); font-size: 12.5px; letter-spacing: .16em; padding: 0 8px; font-family: var(--sans); }
.f-tier label, .f-cat label, .f-pay label { display: block; cursor: pointer; }
.f-tier input, .f-cat input, .f-pay input { accent-color: var(--cinnabar2); margin-right: 8px; }
.f-tier span { display: inline-flex; gap: 10px; align-items: baseline; }
.f-tier b { color: var(--ink); font-weight: 600; }
.f-tier i { color: var(--muted); font-style: normal; font-size: 12.5px; font-family: var(--sans); }
.f-tier em { color: var(--gold2); font-style: normal; font-size: 12.5px; margin-left: auto; }
.f-cat label { display: inline-block; margin: 3px 4px; }
.f-cat span {
  display: inline-block; padding: 4px 10px; border: 1.5px solid var(--line); border-radius: 4px;
  color: var(--muted); transform: rotate(-1.5deg); font-size: 14px;
}
.f-cat input:checked + span {
  border-color: rgba(184, 69, 47, .9); color: #e8998a; background: rgba(184, 69, 47, .12);
}
.f-pay span { font-size: 13.5px; font-family: var(--sans); color: var(--ink); }
.f-nick, .f-note, .f-email { display: block; margin: 0 0 14px; font-size: 13.5px; color: var(--muted); font-family: var(--sans); }
.f-nick input, .f-note textarea, .f-email input {
  display: block; width: 100%; margin-top: 6px; padding: 9px 11px;
  background: rgba(0, 0, 0, 0.3); border: 1px solid var(--line); border-radius: 8px;
  color: var(--ink); font-family: var(--serif); font-size: 15px; letter-spacing: .04em;
}
.f-nick input:focus, .f-note textarea:focus, .f-email input:focus { outline: none; border-color: rgba(201, 163, 92, .6); }
.primary {
  display: block; width: 100%; padding: 13px; margin-top: 4px;
  background: linear-gradient(180deg, var(--cinnabar2), var(--cinnabar)); color: #ffe9dd;
  border: none; font-size: 17px; letter-spacing: .3em; text-indent: .3em;
}
.primary:hover { filter: brightness(1.08); }
.primary:disabled { opacity: .5; cursor: wait; }
.m-fine { color: var(--faint); font-size: 11.5px; font-family: var(--sans); margin: 12px 0 0; line-height: 1.8; }
.lv-flame { width: 40px; height: 54px; margin: 2px auto 8px; background: radial-gradient(48% 64% at 50% 70%, #fff3cf 0 20%, var(--flame) 50%, var(--ember) 68%, transparent 76%); border-radius: 50% 50% 40% 40%; animation: flick 1.9s infinite steps(3); }
.lv-meta { text-align: center; color: var(--muted); font-family: var(--sans); font-size: 13.5px; }
.lv-note { text-align: center; color: var(--ink); }
#lv-title { text-align: center; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 60;
  background: rgba(30, 21, 12, 0.94); border: 1px solid rgba(201, 163, 92, .5);
  color: var(--gold2); padding: 10px 20px; border-radius: 10px; font-size: 14.5px;
  font-family: var(--sans); letter-spacing: .05em; box-shadow: var(--shadow); max-width: 86vw; text-align: center;
}

/* ── 响应式 ───────────────────────────── */
@media (max-width: 880px) {
  .shengwei { grid-template-columns: 1fr; gap: 22px; max-width: 480px; }
  .sw-side { text-align: center; }
  .pai { margin: 0 0 14px; }
  .sw-side p.sw-note { margin: 0 auto 14px; }
  .ritual-row { grid-template-columns: repeat(5, 1fr); gap: 6px; }
  .r-hint { display: none; }
  .foot-grid { grid-template-columns: 1fr; }
  header.bian { padding-top: 40px; }
}
@media (max-width: 480px) {
  .ritual-row { grid-template-columns: repeat(3, 1fr); }
  .ritual-row .ritual:nth-child(4), .ritual-row .ritual:nth-child(5) { grid-column: span 1; }
  .lamp-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  .lamp .fl, .r-lamp::after, .smoke i, .lv-flame { animation: none !important; }
}

/* ── 求签页 ───────────────────────────── */
.qian { max-width: 720px; }
.q-stage { text-align: center; padding: 9vh 0 2vh; }
.q-lede { color: var(--muted); letter-spacing: .14em; }
.q-tube {
  position: relative; width: 168px; height: 240px; margin: 26px auto 0;
  cursor: pointer; outline: none;
  background: linear-gradient(180deg, #553c1b 0 26px, #3a2a12 26px 62%, #241804 62% 100%);
  border: 1px solid #5e431e; border-radius: 18px 18px 46% 46% / 14px 14px 30px 30px;
  box-shadow: inset 0 4px 10px rgba(0,0,0,.5), 0 10px 30px rgba(0,0,0,.5);
}
.q-tube::before {
  content: "籤"; position: absolute; left: 50%; top: 44%; transform: translate(-50%,-50%);
  color: rgba(236,226,202,.16); font-size: 44px;
}
.q-sticks::after {
  content: ""; position: absolute; left: 50%; top: -34px; transform: translateX(-50%);
  width: 74px; height: 44px;
  background:
    linear-gradient(180deg, #b8452f 0 6px, #6b4b20 6px 8px, #3a2a12 8px),
    linear-gradient(90deg, transparent 8px, #6b4b20 8px 10px, #3a2a12 10px 66px, transparent 66px);
  clip-path: polygon(6% 100%, 14% 0, 26% 8%, 38% 0, 50% 10%, 62% 0, 74% 8%, 86% 0, 94% 100%);
}
.q-tube-label { position: absolute; left: -90px; right: -90px; top: calc(100% + 46px); color: var(--gold2); font-size: 14.5px; letter-spacing: .2em; }
.q-hold {
  position: absolute; left: 18%; right: 18%; bottom: -78px; height: 3px;
  background: linear-gradient(90deg, var(--ember), var(--flame)); transform: scaleX(0); transform-origin: left; opacity: 0;
}
.q-tube.shaking { animation: qshake .5s ease-in-out 2; }
@keyframes qshake {
  0%,100% { transform: rotate(0) }
  25% { transform: rotate(-7deg) translateY(-3px) }
  75% { transform: rotate(7deg) translateY(-3px) }
}
.q-result { padding-top: 4vh; }
.q-grade { text-align: center; color: var(--cinnabar2); letter-spacing: .5em; text-indent: .5em; margin: 0; font-size: 15px; }
.q-num { text-align: center; color: var(--gold2); font-size: clamp(30px, 7vw, 44px); letter-spacing: .16em; margin: 6px 0 2px; }
.q-story { text-align: center; color: var(--muted); margin: 0 0 26px; letter-spacing: .1em; }
.q-poem { text-align: center; margin: 0 auto 30px; max-width: 480px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 26px 0; }
.q-poem p { margin: 10px 0; color: var(--ink); font-size: clamp(18px, 4.2vw, 23px); letter-spacing: .3em; text-indent: .3em; }
.q-poem span { display: inline-block; opacity: 0; animation: charIn .6s forwards; }
@keyframes charIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .q-poem span { animation: none; opacity: 1; } .q-tube.shaking { animation: none; } }
.q-sec { background: var(--card); border: 1px solid var(--line); border-left: 3px solid var(--cinnabar); border-radius: 10px; padding: 14px 16px; margin: 14px 0; }
.q-sec h3 { margin: 0 0 6px; color: var(--gold2); font-size: 14.5px; letter-spacing: .2em; }
.q-sec p { margin: 0; color: var(--ink); line-height: 2.1; }
.q-more { margin: 20px 0; border: 1px dashed var(--line); border-radius: 10px; padding: 10px 16px; color: var(--muted); }
.q-more summary { cursor: pointer; color: var(--faint); letter-spacing: .1em; }
.q-more h3 { color: var(--gold2); font-size: 14px; letter-spacing: .2em; margin: 14px 0 6px; }
.q-more p { color: var(--muted); line-height: 2.05; }
.q-actions { text-align: center; margin: 26px 0; }
.q-actions button { margin: 0 8px; }
.q-dis { color: var(--faint); font-size: 12px; font-family: var(--sans); line-height: 1.9; border-top: 1px dashed var(--line); padding-top: 14px; }

/* 求签入口横幅 */
.qian-call {
  display: block; max-width: 720px; margin: 50px auto 0; padding: 16px 20px;
  border: 1px solid var(--line); border-left: 3px solid var(--cinnabar); border-radius: 10px;
  color: var(--ink); background: var(--card);
}
.qian-call:hover { border-color: rgba(201,163,92,.55); }
.qian-call b { color: var(--gold2); }
.qian-call span { display: block; color: var(--faint); font-size: 12.5px; margin-top: 4px; font-family: var(--sans); }

/* 梵呗开关 */
.amb-row { text-align: center; margin: 16px 0 0; }
.amb { font-size: 13px; color: var(--faint); border-color: var(--line); }
.amb span { color: var(--faint); }
.amb[aria-pressed="true"] { color: var(--gold2); border-color: rgba(201,163,92,.5); }
