/* R92 祈福许愿页 H5 */
:root {
  --primary: #D4A574;
  --primary-dark: #B8860B;
  --bg-deep: #1A1A2E;
  --card-bg: #FFF8F0;
  --text-main: #F5F0E0;
  --text-dim: rgba(245, 240, 224, 0.65);
  --glass-bg: rgba(255, 248, 240, 0.08);
  --glass-border: rgba(212, 165, 116, 0.3);
  --bottom-nav-h: 56px;
  --contact-footer-h: 72px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; font-family: "PingFang SC", -apple-system, sans-serif; background: var(--bg-deep); color: var(--text-main); min-height: 100%; }
.hidden { display: none !important; }

#bgCanvas { position: fixed; inset: 0; z-index: 0; pointer-events: none; }

.page-root { position: relative; z-index: 1; padding-bottom: calc(var(--bottom-nav-h) + var(--contact-footer-h) + 80px); min-height: 100vh; }

.hero { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 48px 24px 24px; min-height: 55vh; justify-content: center; }
.hero-eyebrow { font-size: 13px; color: var(--primary); margin: 0 0 8px; }
.hero h1 { margin: 0 0 8px; font-size: 26px; color: var(--primary); letter-spacing: 1px; }
.subtitle { font-size: 14px; color: var(--text-dim); margin: 0 0 24px; }
.real-time-counter { font-size: 13px; color: var(--text-dim); margin-bottom: 32px; }
.real-time-counter span { color: var(--primary); font-weight: 700; font-size: 16px; }

.btn-gold {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 14px 48px; font-size: 17px; font-weight: 600; color: #1A1A2E;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border: none; border-radius: 24px; cursor: pointer;
  animation: breathe 3s ease-in-out infinite;
}
.btn-gold:active { transform: scale(0.96); }
.btn-outline-gold {
  background: transparent; border: 1px solid var(--primary); color: var(--primary);
  border-radius: 24px; padding: 12px 20px; font-size: 15px; cursor: pointer;
}
.btn-full { width: 100%; display: block; margin-top: 10px; text-align: center; }

@keyframes breathe {
  0%, 100% { box-shadow: 0 0 20px rgba(212, 165, 116, 0.35); }
  50% { box-shadow: 0 0 36px rgba(212, 165, 116, 0.65); }
}

.glass-panel {
  background: var(--glass-bg); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border); border-radius: 16px; padding: 20px; margin: 12px 16px;
}
.glass-panel h2 { margin: 0 0 12px; font-size: 16px; }

.ritual-list { display: flex; gap: 10px; overflow-x: auto; padding: 4px 0; scroll-snap-type: x mandatory; }
.ritual-item {
  flex: 0 0 130px; display: flex; flex-direction: column; align-items: center; padding: 14px 10px;
  border-radius: 12px; background: rgba(255,255,255,0.05); cursor: pointer; scroll-snap-align: center;
  transition: all 0.25s;
}
.ritual-item.active { background: rgba(212,165,116,0.2); border: 1px solid var(--primary); transform: translateY(-4px); }
.ritual-icon { font-size: 36px; margin-bottom: 6px; }
.ritual-name { font-size: 14px; font-weight: 600; }
.ritual-desc { font-size: 11px; color: var(--text-dim); text-align: center; margin-top: 4px; line-height: 1.3; }

.scene-chips, .filter-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.scene-chip, .chip {
  border: 1px solid var(--glass-border); background: rgba(255,255,255,0.06);
  border-radius: 999px; padding: 6px 12px; font-size: 12px; color: var(--text-main); cursor: pointer;
}
.scene-chip.active, .chip.active { background: var(--primary); color: #1A1A2E; border-color: var(--primary); }

.section-title { padding: 16px 16px 8px; margin: 0; font-size: 18px; }

.candle-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding: 0 16px 16px; }
.candle-unit { text-align: center; cursor: pointer; }
.lotus-visual { position: relative; width: 52px; height: 72px; margin: 0 auto; }
.lotus-glow {
  position: absolute; left: 50%; top: 8px; width: 40px; height: 40px; margin-left: -20px;
  background: radial-gradient(circle, rgba(255,213,79,0.55) 0%, rgba(255,140,0,0) 70%);
  border-radius: 50%; animation: glow-pulse 2.5s ease-in-out infinite;
}
.lotus-flower { position: absolute; left: 50%; top: 14px; width: 40px; height: 32px; margin-left: -20px; }
.lotus-petal {
  position: absolute; left: 50%; top: 50%; width: 11px; height: 20px; margin: -10px 0 0 -5.5px;
  background: linear-gradient(180deg, #FFB7C5 0%, #E8899E 100%);
  border-radius: 50% 50% 42% 42%; transform-origin: 50% 85%;
}
.lotus-petal:nth-child(1) { transform: rotate(0deg); }
.lotus-petal:nth-child(2) { transform: rotate(45deg); }
.lotus-petal:nth-child(3) { transform: rotate(90deg); }
.lotus-petal:nth-child(4) { transform: rotate(135deg); }
.lotus-petal:nth-child(5) { transform: rotate(180deg); }
.lotus-petal:nth-child(6) { transform: rotate(225deg); }
.lotus-petal:nth-child(7) { transform: rotate(270deg); }
.lotus-petal:nth-child(8) { transform: rotate(315deg); }
.lotus-core {
  position: absolute; left: 50%; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px;
  background: radial-gradient(circle, #FFE082, #F4A261); border-radius: 50%;
  box-shadow: 0 0 6px rgba(255,213,79,0.8);
}
.lotus-stem {
  position: absolute; left: 50%; bottom: 4px; width: 3px; height: 28px; margin-left: -1.5px;
  background: linear-gradient(180deg, #4A7C59, #3D6B4F); border-radius: 2px;
}
.lotus-leaf {
  position: absolute; left: 4px; bottom: 10px; width: 18px; height: 8px;
  background: rgba(74,124,89,0.6); border-radius: 50%; transform: rotate(-25deg);
}
.candle-unit small { font-size: 10px; color: var(--text-dim); display: block; margin-top: 4px; }

@keyframes glow-pulse {
  0%, 100% { opacity: 0.7; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.08); }
}

.tabs { display: flex; gap: 8px; padding: 0 16px 12px; }
.tab { flex: 1; border: 1px solid var(--glass-border); background: transparent; color: var(--text-dim); border-radius: 999px; padding: 8px; font-size: 13px; cursor: pointer; }
.tab.active { background: var(--primary); color: #1A1A2E; border-color: var(--primary); font-weight: 600; }

.masonry-grid { columns: 2; column-gap: 10px; padding: 0 16px; }
.wish-card { break-inside: avoid; margin-bottom: 10px; cursor: pointer; }
.soft-card { background: var(--card-bg); color: #2C2C2C; border-radius: 14px; padding: 14px; box-shadow: 0 4px 16px rgba(0,0,0,0.2); }
.wish-card__head { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 8px; color: #888; }
.wish-card__text { font-size: 14px; line-height: 1.5; margin: 0 0 10px; }
.wish-card__foot { display: flex; justify-content: space-between; font-size: 11px; color: #999; }
.like-btn { color: #C41E1E; }

.merit-card { text-align: center; padding: 32px 20px; margin: 16px; background: var(--glass-bg); border-radius: 16px; border: 1px solid var(--glass-border); }
.merit-number { font-size: 48px; font-weight: 800; color: var(--primary); }
.merit-label { font-size: 13px; color: var(--text-dim); margin-top: 4px; }
.mine-row { font-size: 13px; padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,0.08); margin: 0; }
.empty-tip { text-align: center; padding: 24px; color: var(--text-dim); font-size: 14px; column-span: all; }
.p-desc { font-size: 13px; color: var(--text-dim); margin: 8px 0; }

.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-end; justify-content: center; }
.modal.hidden { display: none; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.7); }
.modal-content { position: relative; width: 100%; max-width: 480px; border-radius: 20px 20px 0 0; padding: 24px 20px 32px; z-index: 1; }
.modal-content h3 { margin: 0 0 12px; color: #2C2C2C; }
.modal-content textarea { width: 100%; height: 110px; padding: 14px; border: none; border-radius: 12px; background: #F5F0EB; font-size: 16px; resize: none; outline: none; }
.word-count { font-size: 12px; color: #999; text-align: right; margin: 6px 0; }
.anon-toggle { display: flex; align-items: center; gap: 8px; font-size: 14px; color: #666; margin: 10px 0; }
.intent-chips { margin-bottom: 8px; }

.fullscreen-overlay { position: fixed; inset: 0; z-index: 200; background: rgba(0,0,0,0.85); }
.fullscreen-overlay.hidden { display: none; }
#playerCanvas { width: 100%; height: 100%; display: block; }

.share-sheet { text-align: center; background: var(--card-bg); color: #2C2C2C; }
#posterCanvas { max-width: 100%; border-radius: 12px; margin: 12px 0; }

.fab {
  position: fixed; right: 20px; bottom: calc(var(--bottom-nav-h) + var(--contact-footer-h) + 16px);
  width: 56px; height: 56px; border-radius: 50%; border: 0;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  font-size: 24px; box-shadow: 0 4px 16px rgba(212,165,116,0.45); cursor: pointer; z-index: 40;
}

.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: calc(var(--contact-footer-h) + env(safe-area-inset-bottom));
  max-width: 480px; margin: 0 auto; display: flex;
  background: rgba(26,26,46,0.95); backdrop-filter: blur(16px);
  border-top: 1px solid rgba(212,165,116,0.15); z-index: 50; height: var(--bottom-nav-h);
}
.nav-item { flex: 1; border: 0; background: none; color: var(--text-dim); font-size: 10px; cursor: pointer; padding-top: 6px; }
.nav-item.active { color: var(--primary); font-weight: 600; }
.nav-icon { display: block; font-size: 20px; margin-bottom: 2px; }

.toast { position: fixed; top: 50%; left: 50%; transform: translate(-50%,-50%); background: rgba(0,0,0,0.78); color: #fff; padding: 12px 20px; border-radius: 8px; z-index: 300; }

.contact-footer {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  background: rgba(26,26,46,0.98); border-top: 1px solid rgba(212,165,116,0.12);
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); max-width: 480px; margin: 0 auto;
}
.contact-footer__btns { display: flex; gap: 8px; }
.contact-footer__cta { flex: 1; text-align: center; background: var(--primary); color: #1A1A2E !important; padding: 10px; border-radius: 999px; font-size: 13px; font-weight: 600; text-decoration: none; }
.contact-footer__btn { flex: 1; text-align: center; background: rgba(255,255,255,0.08); padding: 10px; border-radius: 999px; font-size: 13px; border: 0; cursor: pointer; text-decoration: none; color: var(--text-main); }
.contact-footer__brand { margin: 6px 0 0; text-align: center; font-size: 10px; color: var(--text-dim); }

.share-page { min-height: 100vh; display: flex; justify-content: center; padding: 24px 16px calc(24px + var(--contact-footer-h)); position: relative; z-index: 1; }
.share-card { max-width: 400px; width: 100%; text-align: center; }
.share-eyebrow { color: var(--primary); font-weight: 700; font-size: 13px; }
.share-card h1 { font-size: 26px; margin: 8px 0; color: var(--primary); }
.share-desc { color: var(--text-dim); font-size: 14px; line-height: 1.6; }
.share-stats { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin: 20px 0; }
.share-stats div { background: var(--glass-bg); padding: 12px; border-radius: 10px; border: 1px solid var(--glass-border); }
.share-stats strong { display: block; font-size: 20px; color: var(--primary); }
.share-stats span { font-size: 11px; color: var(--text-dim); }

.sub-header { display: flex; align-items: center; gap: 10px; padding: 12px 16px; }
.sub-back { border: 0; background: none; color: var(--primary); font-size: 14px; cursor: pointer; }
.p-desc.center { text-align: center; padding: 0 16px; }

/* P1 快捷入口 */
.p1-shortcuts { display: flex; gap: 8px; padding: 0 16px 12px; margin-top: -4px; }
.p1-shortcut { flex: 1; border: 1px solid var(--glass-border); background: rgba(255,255,255,0.05); border-radius: 10px; padding: 10px 4px; cursor: pointer; color: var(--text-main); }
.p1-shortcut span { display: block; font-size: 20px; }
.p1-shortcut small { font-size: 10px; color: var(--text-dim); }

.merit-badge { font-size: 14px; margin-top: 8px; color: var(--primary); }
.merit-progress { height: 6px; background: rgba(255,255,255,0.1); border-radius: 3px; margin: 12px 20px 6px; overflow: hidden; }
.merit-progress__bar { height: 100%; background: linear-gradient(90deg, var(--primary), var(--primary-dark)); border-radius: 3px; transition: width 0.5s; }
.merit-next { display: block; font-size: 11px; color: var(--text-dim); margin-top: 4px; }

.checkin-panel h3 { margin: 0 0 12px; font-size: 15px; }
.checkin-calendar { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 12px; }
.checkin-day { width: 100%; aspect-ratio: 1; display: flex; align-items: center; justify-content: center; border-radius: 50%; font-size: 11px; background: rgba(255,255,255,0.04); color: var(--text-dim); }
.checkin-day.checked { background: rgba(212,165,116,0.25); color: var(--primary); font-size: 14px; }
.checkin-day.today { border: 1px solid var(--primary); }
.checkin-day.empty { visibility: hidden; }
.btn-gold:disabled { opacity: 0.5; animation: none; }

.tree-wrap { display: flex; justify-content: center; padding: 8px 16px 16px; transition: transform 0.6s ease; }
.wish-tree-svg { width: 100%; max-width: 360px; height: auto; }
.tree-leaf { cursor: pointer; animation: leafSway 4s ease-in-out infinite; }
.tree-crown { animation: treeGrow 3s ease-in-out infinite alternate; }
@keyframes leafSway { 0%, 100% { transform: rotate(0deg); } 50% { transform: rotate(3deg); } }
@keyframes treeGrow { from { transform: scale(1); } to { transform: scale(1.02); } }
.p1-links { margin-top: 0; }

/* P2 AR 天灯 */
.ar-overlay { position: fixed; inset: 0; z-index: 300; background: #000; }
.ar-overlay.hidden { display: none; }
#arVideo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
#arCanvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.ar-ui {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
  background: linear-gradient(transparent, rgba(0,0,0,0.75));
}
.ar-tip { font-size: 12px; color: rgba(255,255,255,0.8); margin: 0 0 10px; text-align: center; }
#arWishInput {
  width: 100%; border: 0; border-radius: 12px; padding: 12px; font-size: 15px; margin-bottom: 10px;
}
.p2-shortcuts { display: flex; gap: 8px; padding: 0 16px 12px; }
.p2-shortcut { flex: 1; border: 1px solid var(--glass-border); background: rgba(255,255,255,0.05); border-radius: 10px; padding: 10px 4px; cursor: pointer; color: var(--text-main); }
.p2-shortcut span { display: block; font-size: 20px; }
.p2-shortcut small { font-size: 10px; color: var(--text-dim); }

.p3-shortcuts { display: flex; gap: 8px; padding: 0 16px 12px; }
.p3-shortcut { flex: 1; border: 1px solid var(--glass-border); background: rgba(255,255,255,0.05); border-radius: 10px; padding: 10px 4px; cursor: pointer; color: var(--text-main); }
.p3-shortcut span { display: block; font-size: 20px; }
.p3-shortcut small { font-size: 10px; color: var(--text-dim); }

.muyu-modal { align-items: center; justify-content: center; z-index: 150; }
.muyu-modal .modal__backdrop { position: absolute; inset: 0; }
.muyu-sheet { position: relative; z-index: 1; width: min(320px, 90vw); text-align: center; padding: 28px 20px; background: var(--glass-bg); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid var(--glass-border); border-radius: var(--radius-card); }
.muyu-title { font-size: 17px; font-weight: 600; color: var(--primary); margin-bottom: 20px; }
.muyu-drum { position: relative; width: 140px; height: 100px; margin: 0 auto 16px; border: none; background: transparent; cursor: pointer; overflow: visible; }
.muyu-drum:active .muyu-drum__body { transform: scale(0.94); }
.muyu-drum__body { display: block; width: 120px; height: 72px; margin: 0 auto; border-radius: 50% 50% 45% 45%; background: linear-gradient(145deg, #8B6914, #5C4033); box-shadow: 0 8px 24px rgba(0,0,0,0.4), inset 0 -4px 8px rgba(0,0,0,0.3); transition: transform 0.12s; }
.muyu-drum__label { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 28px; font-weight: 700; color: #FFD700; text-shadow: 0 2px 8px rgba(0,0,0,0.5); pointer-events: none; }
.muyu-hint { font-size: 12px; color: var(--text-dim); margin-bottom: 16px; }
.muyu-ripple { position: absolute; width: 20px; height: 20px; margin: -10px 0 0 -10px; border-radius: 50%; border: 2px solid var(--primary); animation: muyuRipple 0.7s ease-out forwards; pointer-events: none; }
.muyu-float { position: absolute; font-size: 14px; font-weight: 600; color: var(--primary); animation: muyuFloat 0.9s ease-out forwards; pointer-events: none; white-space: nowrap; transform: translateX(-50%); }
@keyframes muyuRipple { from { transform: scale(1); opacity: 0.8; } to { transform: scale(5); opacity: 0; } }
@keyframes muyuFloat { from { transform: translate(-50%, 0); opacity: 1; } to { transform: translate(-50%, -48px); opacity: 0; } }

.audio-settings h3 { margin-bottom: 12px; font-size: 15px; }
.setting-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,0.06); font-size: 14px; }
.setting-row:last-of-type { border-bottom: none; }
.setting-hint { font-size: 12px; color: var(--text-dim); margin-top: 8px; }
.toggle-switch { width: 48px; height: 28px; border-radius: 14px; border: none; background: rgba(255,255,255,0.15); position: relative; cursor: pointer; transition: background 0.25s; flex-shrink: 0; }
.toggle-switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform 0.25s; }
.toggle-switch.on { background: var(--primary); }
.toggle-switch.on::after { transform: translateX(20px); }
.p2-links { margin-top: 0; }
.btn-voice {
  width: 100%; margin: 8px 0 4px; padding: 10px; border: 1px dashed var(--primary);
  background: rgba(212,165,116,0.12); color: #8B6914; border-radius: 12px; font-size: 14px; cursor: pointer;
}
