/* 線上求籤：場景式參拜（介面沿用站內米杏/琥珀金/墨灰/靛藍；廟宇插畫依需求使用朱紅、深紅） */
.qq-hero { padding: 40px 0 20px; }
.qq-wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.qq { position: relative; }
.qq [hidden] { display: none !important; }
.qq-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.qq :focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

/* ---------------------------------------------------------------- 版面 */
.qq-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
.qq-stage {
  position: relative; aspect-ratio: 16 / 9; width: 100%; margin-top: 54px; overflow: visible;
  border: 1px solid var(--border); border-radius: 14px; background: #2C2A26;
  box-shadow: 0 10px 30px rgba(44, 42, 38, .14);
}
.qq-stage::before {
  content: ""; position: absolute; left: -1px; right: -1px; top: -54px; height: 54px; z-index: 2;
  box-sizing: border-box; border: 1px solid var(--border); border-bottom: 0;
  border-radius: inherit; border-bottom-left-radius: 0; border-bottom-right-radius: 0;
  background: linear-gradient(180deg, #3A2A20, #211610);
}
.qq-bg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; border-radius: inherit; }
.qq-photo-bg { z-index: 1; object-fit: cover; object-position: center; }
.qq-stage::after {
  content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: radial-gradient(ellipse at 50% 42%, transparent 44%, rgba(20, 13, 10, .2) 100%),
    linear-gradient(180deg, rgba(20, 13, 10, .06), rgba(20, 13, 10, .18));
  border-radius: inherit;
}
.qq-temple-photo { opacity: 0; transition: opacity .25s ease; }
.qq-hall[data-temple="mazu"] .qq-temple-photo--mazu,
.qq-hall[data-temple="guanyin"] .qq-temple-photo--guanyin,
.qq-hall[data-temple="guandi"] .qq-temple-photo--guandi { opacity: 1; }
.qq-figure { display: block; width: 100%; height: 100%; }

.qq-console {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  width: min(100%, 900px); margin: 0 auto; padding: 20px 20px 18px; position: static;
}
.qq-console-eyebrow { font-size: 12px; letter-spacing: .3em; color: var(--gold-dark); font-weight: 500; }
.qq-console-title { font-family: var(--serif); font-size: 22px; font-weight: 700; letter-spacing: .08em; margin: 2px 0 12px; line-height: 1.5; }
.qq-console-title:focus { outline: none; }
.qq-prompt {
  background: var(--bg); border: 1px solid var(--border); border-left: 3px solid var(--gold);
  padding: 10px 12px; font-size: 15.5px; line-height: 1.8; border-radius: 4px;
}
.qq-note-small { font-size: 13px; color: var(--muted); margin-top: 12px; line-height: 1.7; }

/* ---------------------------------------------------------------- 首頁：三扇門 */
.qq-doors {
  position: absolute; left: 8%; right: 8%; top: 20%; height: 52%;
  display: flex; gap: 6%; align-items: stretch;
  z-index: 3;
}
.qq-door {
  position: relative; flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center;
  gap: 4px; padding: 6px 4px 4px; border: 2px solid transparent; border-radius: 12px;
  background: transparent; cursor: pointer; font: inherit; color: inherit;
  transition: border-color .2s, background-color .2s, box-shadow .2s;
}
.qq-door:hover { background: rgba(250, 246, 235, .28); }
.qq-door-name {
  position: absolute; top: calc(-38.46154% - 50px); left: 50%; z-index: 4; transform: translateX(-50%); white-space: nowrap;
  font-family: var(--serif); font-weight: 700; letter-spacing: .3em; padding: 1px 6px 1px 12px;
  font-size: clamp(15px, 2vw, 20px); line-height: 1.6; color: #F6E3B0;
  background: linear-gradient(#3E2417, #2A170F); border: 1px solid #C9A961; border-radius: 4px;
}
.qq-door-svg {
  position: absolute; inset: 0; width: 100%; height: 100%; display: block; overflow: visible;
  opacity: 0; pointer-events: none;
}
.qq-door-inner { fill: #1A0F0B; }
.qq-door-mark {
  position: absolute; top: calc(-38.46154% - 23px); left: 50%; z-index: 4; transform: translateX(-50%); white-space: nowrap;
  font-size: 13px; font-weight: 700; letter-spacing: .1em; line-height: 1.7; padding: 0 10px;
  border-radius: 999px; background: var(--indigo); color: #fff; visibility: hidden;
}
.qq-door-mark::before { content: "✓ "; }
.qq-door[aria-pressed="true"] {
  border-color: var(--gold); background: rgba(250, 246, 235, .35);
  box-shadow: 0 0 0 3px rgba(201, 169, 97, .35), 0 0 26px 6px rgba(246, 227, 176, .55);
}
.qq-door[aria-pressed="true"] .qq-door-mark { visibility: visible; }
.qq-door[data-unavailable="true"] { opacity: .55; }
.qq-door[data-unavailable="true"] .qq-door-mark { visibility: visible; background: var(--muted); }
.qq-door[data-unavailable="true"] .qq-door-mark::before { content: ""; }
.qq-leaf { transform-box: view-box; }
.qq-leaf-l { transform-origin: 18px 174px; }
.qq-leaf-r { transform-origin: 222px 174px; }

.qq-gate-visitor { position: absolute; left: 50%; bottom: 1%; width: 9.5%; aspect-ratio: 120 / 300; transform: translateX(-50%); pointer-events: none; z-index: 3; }
.qq-gate-visitor .qq-figure { opacity: 0; transition: opacity .35s; }
.qq-gate-visitor[data-identity] .qq-figure { opacity: 1; }
.qq-visitor-empty {
  position: absolute; left: 50%; bottom: 4%; transform: translateX(-50%); white-space: nowrap;
  font-size: 13px; color: #5F533F; background: rgba(250, 246, 235, .82);
  border: 1px dashed #9C8B6C; border-radius: 999px; padding: 1px 12px;
}
.qq-gate-visitor[data-identity] .qq-visitor-empty { display: none; }

.qq-ids { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 14px 0 12px; }
.qq-id {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 8px 8px;
  border: 2px solid var(--border); border-radius: 10px; background: var(--bg); cursor: pointer;
  font: inherit; color: inherit; transition: border-color .2s, box-shadow .2s;
}
.qq-id:hover { border-color: var(--gold); }
.qq-id .qq-figure { width: auto; height: 150px; }
.qq-id-name { font-family: var(--serif); font-size: 18px; font-weight: 700; letter-spacing: .2em; margin-top: 4px; }
.qq-id-mark { font-size: 12.5px; font-weight: 700; color: #fff; background: var(--indigo); border-radius: 999px; padding: 0 10px; margin-top: 4px; visibility: hidden; }
.qq-id-mark::before { content: "✓ "; }
.qq-id[aria-pressed="true"] { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201, 169, 97, .3); background: #FFFDF6; }
.qq-id[aria-pressed="true"] .qq-id-mark { visibility: visible; }
.qq-picked { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; font-size: 14px; }
.qq-picked div { border: 1px solid var(--hairline); border-radius: 6px; padding: 6px 10px; background: var(--bg); }
.qq-picked dt { font-size: 12px; color: var(--muted); letter-spacing: .1em; }
.qq-picked dd { font-weight: 700; }

/* ---------------------------------------------------------------- 廟內：主題色 */
.qq-hall {
  --hall-wall: #E5D3B1; --hall-wall-top: #EFE2C6; --hall-beam: #4A2A1C; --hall-beam2: #7E2A20; --hall-gold: #C9A961;
  --hall-pillar: #A8382A; --hall-shrine: #7E2A20; --hall-niche: #3A1F17; --hall-glow: #F6D78F;
  --hall-cloth: #A8382A; --hall-lantern: #B5402F; --hall-floor: #BFAF94; --hall-floor-top: #D3C5AA; --hall-frame: #6B4430;
}
.qq-hall[data-temple="guanyin"] {
  --hall-wall: #ECE6D8; --hall-wall-top: #F5F1E7; --hall-beam: #7A5E44; --hall-beam2: #7E9A92; --hall-gold: #CDB57E;
  --hall-pillar: #9C7B57; --hall-shrine: #7E9A92; --hall-niche: #3D4A45; --hall-glow: #F4EAD0;
  --hall-cloth: #8FA79F; --hall-lantern: #EFE6D2; --hall-floor: #CFC6B4; --hall-floor-top: #DED7C8; --hall-frame: #8A6A4A;
}
.qq-hall[data-temple="guandi"] {
  --hall-wall: #4A3A30; --hall-wall-top: #5A473A; --hall-beam: #26190F; --hall-beam2: #2F4436; --hall-gold: #A88A4E;
  --hall-pillar: #7A2420; --hall-shrine: #2F4436; --hall-niche: #1E1712; --hall-glow: #D9B56A;
  --hall-cloth: #7A2420; --hall-lantern: #8E2E24; --hall-floor: #7F7363; --hall-floor-top: #948775; --hall-frame: #3A2216;
}
.hb-m { display: none; }
.qq-hall[data-temple="mazu"] .hb-m-mazu,
.qq-hall[data-temple="guanyin"] .hb-m-guanyin,
.qq-hall[data-temple="guandi"] .hb-m-guandi { display: inline; }
.hb-frame { fill: var(--hall-frame); }
.hb-lattice path { fill: none; stroke: var(--hall-gold); stroke-width: 4; opacity: .55; }
.hb-cloud path { fill: var(--hall-gold); opacity: .45; }
.hb-bamboo path { fill: none; stroke: #7E9A92; stroke-width: 7; stroke-linecap: round; opacity: .5; }
.hb-bamboo-leaf path { fill: #8FA79F; opacity: .55; }
.hb-fret path { fill: none; stroke: var(--hall-gold); stroke-width: 3; opacity: .6; }
.hb-fret-k path { fill: none; stroke: var(--hall-gold); stroke-width: 2; opacity: .7; }
.hb-rack { fill: #3A2216; }
.hb-pole { fill: none; stroke: #4A2E1E; stroke-width: 10; stroke-linecap: round; }
.hb-blade { fill: #C9AE6E; stroke: #6E5428; stroke-width: 2; }
.hb-blade-back { fill: #A88A4E; stroke: #6E5428; stroke-width: 1.6; }
.hb-pommel { fill: #C9A961; }
.hb-beam { fill: var(--hall-beam); }
.hb-beam-line { fill: var(--hall-gold); opacity: .55; }
.hb-beam2 { fill: var(--hall-beam2); }
.hb-beam-art path { fill: none; stroke: var(--hall-gold); stroke-width: 3; opacity: .85; }
.hb-bracket path { fill: var(--hall-gold); opacity: .8; }
.hb-plaque-board { fill: #2B1A12; stroke: var(--hall-gold); stroke-width: 4; }
.hb-plaque-inner { fill: none; stroke: var(--hall-gold); stroke-width: 1.5; opacity: .7; }
.hb-plaque-text { fill: #F0D68E; font-family: var(--serif); font-weight: 700; font-size: 46px; letter-spacing: 10px; }
.hb-lantern-cord { stroke: #3A2216; stroke-width: 3; }
.hb-lantern-body { fill: var(--hall-lantern); }
.hb-lantern-band { stroke: var(--hall-gold); stroke-width: 6; }
.hb-lantern-tassel { stroke: var(--hall-gold); stroke-width: 4; }
.hb-pillar { fill: var(--hall-pillar); }
.hb-capital, .hb-base { fill: var(--hall-gold); }
.hb-base { fill: #8A7F6C; }
.hb-pillar-line { fill: none; stroke: #000; stroke-width: 2; opacity: .12; }
.hb-shrine-frame { fill: var(--hall-frame); }
.hb-shrine-trim { fill: none; stroke: var(--hall-gold); stroke-width: 5; }
.hb-drape { fill: var(--hall-shrine); opacity: .95; }
.hb-valance { fill: var(--hall-shrine); }
.hb-valance-trim { fill: none; stroke: var(--hall-gold); stroke-width: 3; }
.hb-floor-line path { fill: none; stroke: #000; stroke-width: 2; opacity: .1; }
.hb-table-top { fill: #5E3A26; stroke: #2E1B12; stroke-width: 2; }
.hb-table-body { fill: #4A2C1C; }
.hb-table-leg { fill: #3A2216; }
.hb-cloth { fill: var(--hall-cloth); }
.hb-cloth-trim { fill: none; stroke: var(--hall-gold); stroke-width: 4; }
.hb-waves path { fill: none; stroke: var(--hall-gold); stroke-width: 3; opacity: .85; }
.hb-lotus path { fill: #F4EEE2; stroke: var(--hall-gold); stroke-width: 2; opacity: .92; }
.hb-emblem-ring { fill: none; stroke: var(--hall-gold); stroke-width: 4; }
.hb-emblem-text { fill: #E6C77A; font-family: var(--serif); font-weight: 700; font-size: 34px; letter-spacing: 2px; }
.hb-vase { fill: #E9EEE6; stroke: #6D8580; stroke-width: 2; }

/* ---------------------------------------------------------------- 廟內：可互動器物（電影 16:9 構圖） */
.qq-obj {
  position: absolute; display: block; padding: 0; margin: 0; border: 0; background: transparent;
  cursor: pointer; font: inherit; color: inherit; border-radius: 12px; min-width: 44px; min-height: 44px;
  z-index: 3;
}
.qq-obj > svg { display: block; width: 100%; height: 100%; overflow: visible; }
.qq-obj--cabinet { left: 63%; top: 40%; width: 7%; height: 20%; }
.qq-obj--candle { left: 83%; top: 34%; width: 11%; height: 10%; }
.qq-obj--burner { left: 39%; top: 44%; width: 22%; height: 40%; }
.qq-obj--cups { left: 68%; top: 57%; width: 3%; height: 3%; z-index: 4; }
.qq-obj--tube { left: 10%; top: 33%; width: 13%; height: 44%; }
.qq-obj--candle > svg { visibility: hidden; }
.qq-obj--cabinet > svg use,
.qq-obj--candle > svg > use,
.qq-obj--burner > svg > use:last-child,
.qq-obj--cups > svg use,
.qq-obj--tube > svg use { opacity: 0; }
.qq-obj.is-active { z-index: 5; }
.qq-visitor { position: absolute; left: 25%; bottom: 4%; width: 14%; aspect-ratio: 120 / 410; pointer-events: none; z-index: 3; }

/* 主殿不顯示神明名稱橫條：拿掉場景上方 54px 深色條（三扇門首頁仍保留，門名放在條上） */
.qq-stage.qq-hall { margin-top: 0; }
.qq-hall::before { content: none; }

.qq-tag {
  position: absolute; left: 50%; top: -6px; transform: translate(-50%, -100%); white-space: nowrap;
  font-size: 13px; font-weight: 700; letter-spacing: .08em; line-height: 1.7; padding: 0 10px;
  color: #2C2A26; background: #F6E3B0; border: 1px solid #C9A961; border-radius: 999px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .25); opacity: 0; pointer-events: none; transition: opacity .2s;
}
.qq-obj--tube .qq-tag { top: -8px; }
.qq-obj--burner .qq-tag { left: 0; transform: translate(-20%, -100%); }
.qq-obj:focus-visible .qq-tag, .qq-obj:hover .qq-tag, .qq-obj.is-active .qq-tag, .qq-tag--on { opacity: 1; }
.qq-obj.is-active::before {
  content: ""; position: absolute; inset: -4%; border-radius: 16px; pointer-events: none;
  box-shadow: 0 0 0 2px rgba(240, 214, 142, .95), 0 0 22px 8px rgba(246, 227, 176, .5);
  animation: qq-pulse 2.4s ease-in-out infinite;
}
.qq-obj[aria-disabled="true"] { cursor: help; }
.qq-obj.is-nudge { animation: qq-nudge .5s ease-in-out 2; }

/* 香的狀態 */
.qq-held, .qq-planted { display: none; }
.qq-hall[data-incense="taken"] .qq-held,
.qq-hall[data-incense="lit"] .qq-held { display: inline; }
.qq-hall[data-incense="planted"] .qq-planted { display: inline; }
.qq-hall[data-incense="taken"] .qq-held .qq-ember,
.qq-hall[data-incense="taken"] .qq-held .qq-smoke { display: none; }
.qq-ember circle { fill: #F4A640; filter: drop-shadow(0 0 3px #FFC45E); animation: qq-ember 2.6s ease-in-out infinite; }
.qq-smoke path { fill: none; stroke: #F2EEE6; stroke-width: 1.8; stroke-linecap: round; opacity: 0; animation: qq-smoke 4.2s ease-out infinite; }
.qq-smoke path:nth-child(2) { animation-delay: 1.4s; }
.qq-smoke path:nth-child(3) { animation-delay: 2.8s; }

/* 燭火 */
.qq-flame { fill: #F7C25A; transform-box: fill-box; transform-origin: 50% 100%; animation: qq-flicker 2.8s ease-in-out infinite; }
.qq-flame--b { animation-delay: .9s; }
.qq-flame-core { fill: #FFF6DC; }
.qq-flame-glow circle { fill: #FFD98A; opacity: .28; }

/* ---------------------------------------------------------------- 筊杯／籤筒操作區 */
.qq-closeup {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 4% 4% 5%;
  background: radial-gradient(ellipse at 50% 46%, rgba(102, 64, 37, .96), rgba(30, 17, 11, .99) 82%),
    repeating-linear-gradient(90deg, rgba(201, 169, 97, .04) 0 1px, transparent 1px 30px);
  border-radius: inherit;
  -webkit-backdrop-filter: blur(1.5px);
  backdrop-filter: blur(1.5px); z-index: 10;
}
.qq-cu-inner { width: 100%; height: 100%; display: grid; grid-template-columns: auto 1fr; grid-template-rows: 1fr auto; gap: 10px 4%; align-items: center; justify-items: center; }
.qq-cu-lot { grid-row: 1 / 3; display: flex; align-items: center; gap: 10px; height: 92%; }
.qq-cu-stick { height: 100%; width: auto; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .4)); }
.qq-cu-lotno { display: flex; flex-direction: column; align-items: center; color: #F6E3B0; }
.qq-cu-lotno-zh { writing-mode: vertical-rl; font-family: var(--serif); font-weight: 700; font-size: clamp(22px, 3.2vw, 34px); letter-spacing: .15em; }
.qq-cu-lotno-num { font-size: 14px; letter-spacing: .1em; margin-top: 6px; color: #E6D3A3; }
.qq-cu-tube {
  grid-column: 1 / 3; position: relative; height: 82%; aspect-ratio: 100 / 190; border: 0; padding: 0;
  background: transparent; cursor: pointer; border-radius: 12px;
}
.qq-cu-tube > svg:first-child { width: 100%; height: 100%; display: block; overflow: visible; transform-origin: 50% 95%; }
.qq-rising-stick { position: absolute; left: 38%; top: -8%; height: 70%; opacity: 0; pointer-events: none; }
.qq-cu-tube .qq-tag { top: auto; bottom: -12px; transform: translate(-50%, 100%); opacity: 1; }
.qq-cu-cups { grid-column: 2; position: relative; width: 100%; height: 100%; display: flex; flex-wrap: wrap; align-items: center; align-content: center; justify-content: center; gap: 0 6%; }
.qq-cu-inner:not(.has-lot) .qq-cu-cups { grid-column: 1 / 3; }
.qq-cup-pair { width: 34%; max-width: 230px; height: auto; display: none; filter: drop-shadow(0 8px 10px rgba(0, 0, 0, .35)); }
.qq-cu-cups[data-state="idle"] .qq-cup-pair { display: block; }
.qq-cu-cups[data-state="idle"] .qq-cupbox { display: none; }
.qq-cupbox { width: 30%; max-width: 200px; display: flex; flex-direction: column; align-items: center; }
.qq-cup { width: 100%; height: auto; display: block; overflow: visible; filter: drop-shadow(0 8px 10px rgba(0, 0, 0, .35)); }
.qq-cup-face { margin-top: 4px; font-size: 14px; font-weight: 700; color: #F6E3B0; letter-spacing: .1em; min-height: 1.6em; }
.qq-cu-outcome { width: 100%; text-align: center; color: #fff; font-size: 15px; letter-spacing: .1em; min-height: 1.8em; }
.qq-cu-outcome b { display: inline-block; font-family: var(--serif); font-size: clamp(24px, 3.4vw, 36px); letter-spacing: .3em; color: #F6E3B0; margin-right: .3em; }
.qq-cu-progress { grid-column: 2; display: flex; align-items: center; gap: 12px; color: #fff; font-size: 16px; font-weight: 700; letter-spacing: .08em; }
.qq-cu-inner:not(.has-lot) .qq-cu-progress { grid-column: 1 / 3; }
.qq-dots { display: inline-flex; gap: 6px; }
.qq-dots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #F6E3B0; }
.qq-dots i.is-on { background: #F6E3B0; }

/* ---------------------------------------------------------------- 操作台 */
.qq-steps { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 0 0 14px; counter-reset: qqstep; }
.qq-steps li {
  font-size: 13px; line-height: 1.7; padding: 1px 10px 1px 8px; border: 1px solid var(--border);
  border-radius: 999px; color: var(--muted); background: var(--bg); counter-increment: qqstep;
}
.qq-steps li::before { content: counter(qqstep) " "; font-weight: 700; color: var(--gold-dark); }
.qq-steps li.is-done { color: var(--ink); border-color: var(--gold); }
.qq-steps li.is-done::before { content: "✓ "; }
.qq-steps li[aria-current="step"] { background: var(--indigo); border-color: var(--indigo); color: #fff; font-weight: 700; }
.qq-steps li[aria-current="step"]::before { color: #F6E3B0; }
.qq-msg { background: var(--bg); border: 1px solid var(--border); border-left: 3px solid var(--gold); border-radius: 4px; padding: 10px 12px; }
.qq-msg-lead { font-weight: 700; font-size: 15.5px; line-height: 1.8; }
.qq-msg-body { font-size: 15.5px; line-height: 1.85; margin-top: 2px; }
.qq-msg-tip { font-size: 13.5px; color: var(--gold-dark); margin-top: 6px; line-height: 1.7; }
.qq-msg-tip:empty, .qq-msg-lead:empty, .qq-msg-body:empty { display: none; }
.qq-legend { margin-top: 12px; font-size: 13.5px; }
.qq-legend-title { font-size: 12px; letter-spacing: .2em; color: var(--muted); margin-bottom: 2px; }
.qq-legend ul { list-style: none; padding: 0; display: grid; gap: 4px; }
.qq-legend li { display: flex; align-items: center; gap: 8px; }
.qq-legend b { font-family: var(--serif); letter-spacing: .1em; }
.qq-mini { display: inline-flex; gap: 2px; flex: none; }
.qq-mini svg { width: 30px; height: 20px; }
.qq-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.qq-actions:empty { display: none; }
.qq-btn {
  font: inherit; font-size: 16px; font-weight: 700; letter-spacing: .06em; line-height: 1.5;
  min-height: 46px; padding: 10px 20px; border-radius: 6px; cursor: pointer; border: 1px solid transparent;
}
.qq-btn--primary { background: var(--indigo); color: #fff; box-shadow: 0 3px 0 #13263F; }
.qq-btn--primary:hover { background: #24476F; }
.qq-btn--ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.qq-btn--ghost:hover { color: var(--gold-dark); border-color: var(--gold-dark); }
.qq-console-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.qq-btn--home { flex: none; min-height: 44px; padding: 6px 14px; font-size: 14px; }
.qq[data-busy="true"] .qq-btn--primary { opacity: .7; cursor: progress; }

/* ---------------------------------------------------------------- 籤詩卷軸 */
.qq-result { max-width: 760px; margin: 28px auto 0; }
.qq-scroll { position: relative; padding: 0 12px; }
.qq-rod {
  position: relative; height: 18px; margin: 0 -12px; border-radius: 9px;
  background: linear-gradient(#7A4E32, #3A2216); box-shadow: 0 3px 8px rgba(44, 42, 38, .25);
}
.qq-rod::before, .qq-rod::after {
  content: ""; position: absolute; top: -3px; width: 24px; height: 24px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #F0D68E, #8E6A2C);
}
.qq-rod::before { left: -14px; } .qq-rod::after { right: -14px; }
.qq-paper {
  background: linear-gradient(180deg, #FCF6E6, #F6EDD5); border-left: 1px solid #E2D2AE; border-right: 1px solid #E2D2AE;
  padding: 26px 28px 22px; text-align: center;
}
.qq-paper-deity { font-size: 14px; letter-spacing: .2em; color: var(--gold-dark); }
.qq-paper-title { font-family: var(--serif); font-size: 30px; font-weight: 700; letter-spacing: .16em; margin: 6px 0 4px; }
.qq-paper-title:focus { outline: none; }
.qq-paper-meta { color: var(--muted); font-size: 15px; letter-spacing: .05em; }
.qq-paper-meta:empty { display: none; }
.qq-poem {
  writing-mode: vertical-rl; width: fit-content; margin: 22px auto 18px; padding: 18px 22px;
  font-family: var(--serif); font-size: 28px; font-weight: 600; line-height: 2.1; letter-spacing: .2em;
  border: 1px solid #D9C79F; background: #FFFCF3; user-select: text;
}
.qq-poem p { margin: 0 .15em; }
.qq-source { text-align: left; border-top: 1px dashed #D9C79F; padding-top: 6px; font-size: 14px; line-height: 1.8; }
.qq-source summary { cursor: pointer; color: var(--indigo); font-weight: 700; min-height: 44px; display: flex; align-items: center; }
.qq-source-list { display: grid; grid-template-columns: 6.5em minmax(0, 1fr); gap: 4px 10px; padding: 4px 0 8px; }
.qq-source-list dt { color: var(--muted); }
.qq-source-list dd { overflow-wrap: anywhere; }
.qq-source-list a { border-bottom: 1px solid var(--gold); }
.qq-done {
  margin-top: 16px; background: var(--card); border: 1px solid var(--gold); border-left: 4px solid var(--gold);
  border-radius: 8px; padding: 14px 18px;
}
.qq-done p { font-weight: 700; line-height: 1.8; }
.qq-done-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.qq-result-foot { text-align: center; margin-top: 14px; }

/* 入廟轉場光幕 */
.qq-curtain {
  position: fixed; inset: 0; z-index: 60; pointer-events: none; opacity: 0;
  background: radial-gradient(circle at 50% 45%, #FFF2CC 0%, #E7C27A 35%, #3A1F17 85%);
}

.qq-about { max-width: 860px; margin: 40px auto 0; font-size: 14px; color: var(--muted); line-height: 1.85; }
.qq-about h2 { font-family: var(--serif); font-size: 18px; color: var(--ink); letter-spacing: .1em; margin-bottom: 6px; }
.qq-about ul { padding-left: 20px; }

/* ---------------------------------------------------------------- 動畫 */
@keyframes qq-pulse { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
@keyframes qq-nudge { 0%, 100% { transform: translateX(0); } 30% { transform: translateX(-4px); } 70% { transform: translateX(4px); } }
@keyframes qq-flicker { 0%, 100% { transform: scale(1, 1); } 40% { transform: scale(.94, 1.05); } 70% { transform: scale(1.03, .97); } }
@keyframes qq-ember { 0%, 100% { opacity: .75; } 50% { opacity: 1; } }
@keyframes qq-smoke { 0% { opacity: 0; transform: translateY(0); } 25% { opacity: .55; } 100% { opacity: 0; transform: translateY(-34px); } }

/* ---------------------------------------------------------------- 響應式 */
@media (max-width: 979px) {
  .qq-layout { grid-template-columns: minmax(0, 1fr); }
  .qq-stage { max-width: none; margin: 54px auto 0; }
  .qq-console { max-width: 900px; width: 100%; margin: 0 auto; }
}

/* 手機：改為直式構圖，器物重新配置並放大，操作台移到場景下方 */
@media (max-width: 600px) {
  .qq-hero { padding: 28px 0 14px; }
  .qq-wrap { padding: 0 12px; }
  .qq-layout { gap: 12px; }
  .qq-stage { aspect-ratio: 16 / 9; border-radius: 10px; }
  .qq-console { padding: 14px 14px 12px; }
  .qq-console-title { font-size: 20px; }
  .qq-doors { left: 8%; right: 8%; top: 20%; height: 52%; gap: 6%; }
  .qq-door { padding: 4px 1px 2px; border-radius: 8px; }
  .qq-door-name { font-size: 15px; letter-spacing: .15em; padding: 0 4px 0 7px; }
  .qq-door-mark { font-size: 12px; padding: 0 6px; }
  .qq-gate-visitor { width: 13%; }
  .qq-ids { gap: 8px; }
  .qq-id .qq-figure { height: 120px; }

  .qq-obj--cabinet { left: 63%; top: 40%; width: 7%; height: 20%; }
  .qq-obj--candle { left: 83%; top: 34%; width: 11%; height: 10%; }
  .qq-obj--burner { left: 39%; top: 44%; width: 22%; height: 40%; }
  .qq-obj--cups { left: 65%; top: 47%; width: 10%; height: 16%; z-index: 4; }
  .qq-obj--tube { left: 10%; top: 33%; width: 13%; height: 44%; }
  .qq-visitor { left: 25%; bottom: 4%; width: 14%; }
  .qq-tag { font-size: 12px; padding: 0 8px; }

  .qq-cu-inner { grid-template-columns: 1fr; grid-template-rows: auto 1fr auto; gap: 6px; }
  .qq-cu-lot { grid-row: auto; height: auto; flex-direction: row; }
  .qq-cu-stick { height: 58px; }
  .qq-cu-lotno-zh { writing-mode: horizontal-tb; font-size: 20px; }
  .qq-cu-cups, .qq-cu-progress { grid-column: 1; }
  .qq-cupbox { width: 28%; }
  .qq-cup-pair { width: 44%; }
  .qq-cu-tube { height: 64%; }

  .qq-paper { padding: 20px 14px 16px; }
  .qq-paper-title { font-size: 25px; }
  .qq-poem { font-size: 24px; padding: 14px 14px; }
  .qq-source-list { grid-template-columns: 1fr; gap: 0; }
  .qq-source-list dd { margin-bottom: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  .qq-obj.is-active::before, .qq-flame, .qq-ember circle { animation: none; }
  .qq-smoke path { animation: none; opacity: .35; }
  .qq-obj.is-nudge { animation: none; }
  .qq-door, .qq-id, .qq-tag, .qq-gate-visitor .qq-figure { transition: none; }
}
