:root {
  --ink: #1b1a17;
  --ink-soft: #4e4940;
  --paper: #f3ede0;
  --paper-edge: #e3d7c0;
  --gold: #d4a359;
  --ember: #e36a27;
  --border-subtle: rgba(243, 237, 224, 0.16);
  --font-serif: 'Noto Serif SC', 'Songti SC', 'STSong', Georgia, serif;
  --font-serif-en: 'Cormorant Garamond', Georgia, 'Noto Serif SC', serif;
  --font-hand: 'Ma Shan Zheng', 'Long Cang', 'STKaiti', 'KaiTi', '楷体', serif;
  --font-hand-en: 'Caveat', 'Cormorant Garamond', Georgia, cursive;
  --font-sans: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

body.lang-en {
  font-family: var(--font-serif-en);
}

body.lang-en .worry-textarea {
  font-family: var(--font-hand-en);
  font-size: 29px;
  line-height: 1.5;
  letter-spacing: 0.01em;
}

body.lang-en .brand-sub,
body.lang-en .mode-btn,
body.lang-en .paper-title,
body.lang-en .primary-btn,
body.lang-en .ghost-btn,
body.lang-en .caption-main,
body.lang-en .caption-sub,
body.lang-en .completion-quote,
body.lang-en .completion-sub {
  letter-spacing: 0.04em;
}

.lang-pill {
  min-width: 52px;
  justify-content: center;
  font-weight: 500;
}

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

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  background: #0b0a08;
  color: var(--paper);
  font-family: var(--font-serif);
  -webkit-font-smoothing: antialiased;
  touch-action: manipulation;
}

.sanctuary {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/* 宏大古刹场景与四帧同机位叠加 */
.scene-layer {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.scene-stack {
  position: absolute;
  inset: -1.6%;
  width: 103.2%;
  height: 103.2%;
  transform-origin: 58% 50%;
  animation: templeBreathe 28s ease-in-out infinite alternate;
  will-change: transform;
}

.scene-frame,
.scene-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 58% 50%;
  opacity: 0;
  transition: opacity 1.15s cubic-bezier(0.37, 0, 0.25, 1), filter 1.2s ease;
  filter: contrast(1.03) brightness(0.95);
  user-select: none;
  pointer-events: none;
}

.scene-frame.is-active,
.scene-video.is-active {
  opacity: 1;
}

.scene-video {
  z-index: 2;
}

.sanctuary.is-burning .scene-frame,
.sanctuary.is-burning .scene-video {
  transition: opacity 0.85s ease-in-out, filter 1s ease;
  filter: contrast(1.06) brightness(0.94) saturate(1.08);
}

@keyframes templeBreathe {
  0% {
    transform: scale(1) translate3d(0, 0, 0);
  }
  100% {
    transform: scale(1.028) translate3d(-0.4%, -0.25%, 0);
  }
}

.scene-vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 60% 48%, transparent 32%, rgba(8, 7, 6, 0.56) 100%),
    linear-gradient(90deg, rgba(10, 9, 7, 0.55) 0%, rgba(10, 9, 7, 0.1) 46%, rgba(10, 9, 7, 0.24) 100%),
    linear-gradient(180deg, rgba(9, 8, 6, 0.48) 0%, transparent 22%, transparent 74%, rgba(7, 6, 5, 0.68) 100%);
  pointer-events: none;
}

.brazier-glow {
  position: absolute;
  left: 58%;
  top: 73%;
  width: 420px;
  height: 290px;
  transform: translate(-50%, -56%);
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(255, 166, 68, 0.44) 0%,
    rgba(232, 98, 28, 0.2) 44%,
    transparent 74%
  );
  filter: blur(22px);
  opacity: 0.24;
  pointer-events: none;
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.sanctuary.is-burning .brazier-glow {
  opacity: 1;
  animation: firePulse 0.42s ease-in-out infinite alternate;
}

@keyframes firePulse {
  0% {
    opacity: 0.78;
    transform: translate(-50%, -58%) scale(1.25);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -62%) scale(1.48);
  }
}

.ambient-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* 顶栏 */
.top-bar {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 28px;
  gap: 14px;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 6px;
  letter-spacing: 0.12em;
  user-select: none;
}

.brand-en {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.24em;
  color: rgba(243, 237, 224, 0.94);
}

.brand-sep {
  color: rgba(201, 154, 91, 0.55);
}

.brand-zh {
  font-size: 16px;
  color: var(--paper);
}

.brand-sub {
  margin-left: 10px;
  font-size: 12px;
  letter-spacing: 0.18em;
  color: rgba(243, 237, 224, 0.58);
}

.mode-switch {
  display: inline-flex;
  background: rgba(13, 11, 9, 0.56);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  padding: 3px;
  backdrop-filter: blur(10px);
}

.mode-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: rgba(243, 237, 224, 0.68);
  font-family: var(--font-serif);
  font-size: 14px;
  letter-spacing: 0.16em;
  padding: 7px 22px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.35s ease;
}

.mode-btn.is-active {
  background: rgba(243, 237, 224, 0.16);
  color: var(--paper);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.practitioner-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(13, 11, 9, 0.48);
  border: 1px solid rgba(243, 237, 224, 0.12);
  color: rgba(243, 237, 224, 0.78);
  font-family: var(--font-sans);
  font-size: 12px;
  letter-spacing: 0.06em;
  padding: 7px 14px;
  border-radius: 999px;
  backdrop-filter: blur(10px);
}

.status-pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #d8a764;
  box-shadow: 0 0 10px rgba(216, 167, 100, 0.8);
  animation: gentlePulse 2.8s ease-in-out infinite;
}

.sanctuary.is-burning .status-pulse {
  background: #ff8a3d;
  box-shadow: 0 0 12px rgba(255, 138, 61, 0.95);
  animation-duration: 1.1s;
}

@keyframes gentlePulse {
  0%,
  100% {
    opacity: 0.45;
    transform: scale(0.9);
  }
  50% {
    opacity: 1;
    transform: scale(1.18);
  }
}

.icon-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(13, 11, 9, 0.56);
  border: 1px solid var(--border-subtle);
  color: rgba(243, 237, 224, 0.82);
  font-family: var(--font-sans);
  font-size: 12px;
  letter-spacing: 0.08em;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: border-color 0.25s ease, color 0.25s ease;
}

.icon-pill:hover {
  border-color: rgba(201, 154, 91, 0.55);
  color: var(--paper);
}

.sound-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 8px rgba(201, 154, 91, 0.7);
}

.icon-pill[aria-pressed='false'] .sound-dot {
  background: #6c675e;
  box-shadow: none;
}

/* 主舞台 */
.stage-panel {
  position: absolute;
  inset: 0;
  z-index: 10;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease;
}

.stage-panel.is-visible {
  opacity: 1;
  pointer-events: auto;
}

/* 宣纸书写区 */
.paper-stage {
  position: absolute;
  left: clamp(22px, 5vw, 76px);
  top: 52%;
  transform: translateY(-50%);
  width: min(430px, calc(100vw - 44px));
  transition:
    opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.75s cubic-bezier(0.22, 1, 0.36, 1),
    left 0.75s cubic-bezier(0.22, 1, 0.36, 1),
    top 0.75s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 14;
}

.paper-stage.is-centered {
  left: 44%;
  top: 48%;
  transform: translate(-50%, -50%) scale(1.01);
}

.paper-stage.is-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -44%) scale(0.92);
}

.rice-paper,
.wish-card {
  position: relative;
  background:
    radial-gradient(circle at 18% 15%, rgba(255, 252, 244, 0.8), transparent 55%),
    radial-gradient(circle at 86% 85%, rgba(217, 198, 165, 0.44), transparent 58%),
    linear-gradient(168deg, #f6f0e4 0%, #ede3cf 58%, #e5d8bf 100%);
  color: var(--ink);
  border-radius: 3px;
  padding: 25px 26px 20px;
  box-shadow:
    0 26px 68px rgba(0, 0, 0, 0.58),
    0 2px 10px rgba(0, 0, 0, 0.28),
    inset 0 0 0 1px rgba(124, 102, 72, 0.22),
    inset 0 0 38px rgba(168, 140, 98, 0.16);
}

.rice-paper::before,
.wish-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 3px;
  background-image: repeating-linear-gradient(
      0deg,
      rgba(95, 78, 52, 0.025) 0px,
      rgba(95, 78, 52, 0.025) 1px,
      transparent 1px,
      transparent 4px
    ),
    repeating-linear-gradient(
      90deg,
      rgba(95, 78, 52, 0.018) 0px,
      rgba(95, 78, 52, 0.018) 1px,
      transparent 1px,
      transparent 7px
    );
  pointer-events: none;
}

.paper-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(112, 92, 66, 0.18);
  margin-bottom: 14px;
}

.paper-title {
  font-size: 14px;
  letter-spacing: 0.16em;
  color: #5b5245;
}

.paper-seal {
  font-size: 11px;
  letter-spacing: 0.12em;
  color: #9f3c2d;
  border: 1px solid rgba(159, 60, 45, 0.58);
  padding: 2px 6px;
  border-radius: 2px;
  opacity: 0.82;
  user-select: none;
}

.paper-body {
  position: relative;
}

.worry-textarea {
  position: relative;
  width: 100%;
  min-height: 188px;
  border: 0;
  outline: none;
  resize: none;
  background: transparent;
  color: #201c17;
  font-family: var(--font-hand);
  font-size: 27px;
  line-height: 1.62;
  letter-spacing: 0.06em;
  background-image: linear-gradient(transparent 96%, rgba(120, 98, 70, 0.11) 96%);
  background-size: 100% 44px;
  padding: 2px 2px 8px;
}

.worry-textarea::placeholder {
  font-family: var(--font-serif);
  font-size: 14px;
  line-height: 2;
  letter-spacing: 0.08em;
  color: rgba(91, 82, 69, 0.54);
}

/* 停顿确认态：纸面正中浮现可点击的微光撕裂引导线，视觉焦点 100% 留在纸上 */
.tear-guide-overlay {
  display: none;
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(243, 237, 224, 0.08);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 0;
  z-index: 4;
}

.paper-stage.is-centered .tear-guide-overlay {
  display: flex;
  animation: fadeInSoft 0.55s ease forwards;
}

.tear-line {
  width: 92%;
  height: 0;
  border-top: 2px dashed rgba(178, 72, 32, 0.58);
  transform: rotate(-7deg);
  box-shadow: 0 0 14px rgba(214, 96, 38, 0.35);
  animation: tearLinePulse 2s ease-in-out infinite;
}

.tear-hint-pill {
  margin-top: 14px;
  background: rgba(34, 28, 22, 0.82);
  color: #f6efe2;
  font-family: var(--font-sans);
  font-size: 12px;
  letter-spacing: 0.08em;
  padding: 6px 14px;
  border-radius: 999px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
  transition: transform 0.25s ease, background 0.25s ease;
}

.tear-guide-overlay:hover .tear-hint-pill {
  background: #a9401d;
  transform: scale(1.04);
}

@keyframes tearLinePulse {
  0%,
  100% {
    opacity: 0.45;
  }
  50% {
    opacity: 0.95;
  }
}

@keyframes fadeInSoft {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.paper-footer {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(112, 92, 66, 0.15);
}

/* 停顿确认态：隐藏原编辑栏，就地显示醒目的撕碎确认栏 */
.pause-footer {
  display: none;
}

.paper-stage.is-centered #editFooter {
  display: none;
}

.paper-stage.is-centered #pauseFooter {
  display: flex;
  animation: fadeInSoft 0.45s ease forwards;
}

.pause-whisper {
  margin: 0;
  font-size: 13px;
  line-height: 1.65;
  letter-spacing: 0.08em;
  color: #5c4936;
}

.pause-bar {
  width: 100%;
  justify-content: space-between;
}

.tear-cta {
  flex: 1;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.16em;
  animation: ctaGlow 2.2s ease-in-out infinite;
}

@keyframes ctaGlow {
  0%,
  100% {
    box-shadow: 0 8px 24px rgba(196, 87, 34, 0.36);
  }
  50% {
    box-shadow: 0 10px 34px rgba(218, 96, 36, 0.62);
  }
}

.paper-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.voice-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid rgba(91, 82, 69, 0.25);
  background: rgba(255, 255, 255, 0.35);
  color: #5b5245;
  font-family: var(--font-sans);
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.25s ease;
}

.voice-btn:hover {
  border-color: rgba(159, 60, 45, 0.45);
  color: #2a241d;
}

.voice-btn.is-listening {
  border-color: #b4432a;
  color: #9f3c2d;
  background: rgba(196, 78, 45, 0.12);
}

.privacy-note {
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: rgba(88, 79, 67, 0.72);
}

.paper-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.primary-btn {
  appearance: none;
  border: 0;
  background: #221f1a;
  color: #f4eee1;
  font-family: var(--font-serif);
  font-size: 14px;
  letter-spacing: 0.14em;
  padding: 11px 22px;
  min-height: 44px;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.28s ease;
}

.primary-btn:hover:not(:disabled) {
  background: #352e25;
  transform: translateY(-1px);
}

.primary-btn:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.ember-btn {
  background: linear-gradient(135deg, #a63f1c 0%, #cf5d24 100%);
  box-shadow: 0 8px 28px rgba(196, 87, 34, 0.44);
}

.ember-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #bb4920 0%, #e1692a 100%);
}

.ghost-btn {
  appearance: none;
  border: 1px solid rgba(78, 70, 58, 0.28);
  background: transparent;
  color: #554c40;
  font-family: var(--font-serif);
  font-size: 13px;
  letter-spacing: 0.12em;
  padding: 10px 16px;
  min-height: 44px;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.25s ease;
}

.ghost-btn:hover {
  border-color: rgba(78, 70, 58, 0.56);
  color: var(--ink);
}

.light-ghost {
  border-color: rgba(243, 237, 224, 0.28);
  color: rgba(243, 237, 224, 0.88);
  background: rgba(13, 11, 9, 0.46);
  backdrop-filter: blur(8px);
}

.light-ghost:hover {
  border-color: rgba(243, 237, 224, 0.6);
  color: #fff;
}

/* 燃烧诵经时的字幕 */
.ritual-caption {
  position: absolute;
  left: clamp(24px, 5vw, 76px);
  bottom: 12%;
  z-index: 18;
  text-align: left;
  width: min(470px, calc(100vw - 44px));
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.8s ease;
}

.ritual-caption.is-visible {
  opacity: 1;
}

.caption-main {
  margin: 0 0 8px;
  font-size: clamp(19px, 2.2vw, 25px);
  letter-spacing: 0.2em;
  color: rgba(248, 242, 230, 0.98);
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.88);
}

.caption-sub {
  margin: 0;
  font-size: 14px;
  line-height: 1.75;
  letter-spacing: 0.14em;
  color: rgba(232, 212, 180, 0.88);
  text-shadow: 0 1px 14px rgba(0, 0, 0, 0.92);
}

/* 动效画布（放下燃烧 + 心愿飞信共用） */
.ritual-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 16;
  pointer-events: none;
}

/* 完成后的静谧面板 & 寄信回执面板 */
.completion-panel,
.wish-receipt-panel {
  position: absolute;
  left: clamp(24px, 6vw, 84px);
  top: 50%;
  transform: translateY(-50%);
  z-index: 19;
  text-align: left;
  width: min(460px, calc(100vw - 40px));
  padding: 34px 30px;
  background: rgba(12, 10, 8, 0.68);
  border: 1px solid rgba(243, 237, 224, 0.16);
  border-radius: 4px;
  backdrop-filter: blur(14px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.9s ease;
}

.completion-panel.is-visible,
.wish-receipt-panel.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.completion-quote {
  margin: 0 0 10px;
  font-size: 21px;
  line-height: 1.55;
  letter-spacing: 0.14em;
  color: var(--paper);
}

.completion-sub {
  margin: 0 0 24px;
  font-size: 14px;
  line-height: 1.7;
  letter-spacing: 0.1em;
  color: rgba(235, 223, 202, 0.74);
}

.completion-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* 心愿池顶部悬浮徽标 */
.wish-pool-badge {
  position: absolute;
  right: 28px;
  bottom: 24px;
  z-index: 15;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(14, 12, 9, 0.56);
  border: 1px solid rgba(212, 163, 89, 0.28);
  color: rgba(244, 234, 214, 0.86);
  font-family: var(--font-sans);
  font-size: 12px;
  letter-spacing: 0.06em;
  backdrop-filter: blur(10px);
}

.lantern-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f2be6b;
  box-shadow: 0 0 12px rgba(242, 190, 107, 0.9);
  animation: gentlePulse 2.4s ease-in-out infinite;
}

/* 心愿卡片 */
.wish-card {
  position: absolute;
  left: clamp(22px, 5vw, 76px);
  top: 52%;
  transform: translateY(-50%);
  width: min(472px, calc(100vw - 44px));
  max-height: calc(100vh - 116px);
  overflow-y: auto;
  transition: opacity 0.55s ease, transform 0.65s ease;
}

.wish-card.is-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-46%) scale(0.95);
}

.wish-path-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.wish-tab {
  appearance: none;
  text-align: left;
  padding: 11px 12px;
  border-radius: 3px;
  border: 1px solid rgba(112, 92, 66, 0.24);
  background: rgba(255, 255, 255, 0.34);
  color: #4b4338;
  cursor: pointer;
  transition: all 0.25s ease;
}

.wish-tab strong {
  display: block;
  font-family: var(--font-serif);
  font-size: 13px;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}

.wish-tab span {
  display: block;
  font-family: var(--font-sans);
  font-size: 11px;
  color: #6b6154;
  line-height: 1.45;
}

.wish-tab.is-active {
  border-color: #9e5c26;
  background: rgba(196, 140, 72, 0.17);
  color: #1f1b16;
}

.wish-prompts {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.prompt-chip {
  appearance: none;
  border: 1px solid rgba(112, 92, 66, 0.24);
  background: rgba(255, 255, 255, 0.38);
  color: #5b4d3e;
  font-family: var(--font-sans);
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.prompt-chip:hover {
  border-color: #9e5c26;
  background: rgba(196, 140, 72, 0.16);
  color: #241e17;
}

.wish-textarea {
  min-height: 118px;
  font-size: 24px;
}

.practitioner-picker {
  display: none;
  margin-top: 10px;
  padding: 12px;
  border-radius: 3px;
  background: rgba(91, 82, 69, 0.08);
  border: 1px solid rgba(112, 92, 66, 0.16);
}

.practitioner-picker.is-visible {
  display: block;
}

.picker-label {
  margin: 0 0 8px;
  font-family: var(--font-sans);
  font-size: 12px;
  color: #4c4439;
}

.picker-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.picker-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 12px;
  color: #2c2720;
  cursor: pointer;
}

.picker-note {
  margin: 10px 0 0;
  font-family: var(--font-sans);
  font-size: 11px;
  line-height: 1.55;
  color: #6b6154;
}

/* 寄信回执与真实追踪时间轴 */
.receipt-badge {
  display: inline-block;
  margin: 0 0 12px;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid rgba(212, 163, 89, 0.45);
  color: #e6ba74;
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0.12em;
}

.receipt-timeline {
  display: none;
  margin: 0 0 22px;
  padding: 14px 16px;
  border-radius: 4px;
  background: rgba(243, 237, 224, 0.06);
  border: 1px solid rgba(243, 237, 224, 0.12);
}

.receipt-timeline.is-visible {
  display: block;
}

.timeline-code {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid rgba(243, 237, 224, 0.1);
  font-family: var(--font-sans);
  font-size: 12px;
  color: rgba(243, 237, 224, 0.72);
}

.timeline-code strong {
  font-size: 15px;
  letter-spacing: 0.16em;
  color: #f3c984;
}

.timeline-steps {
  margin: 0;
  padding-left: 18px;
  font-family: var(--font-sans);
  font-size: 12px;
  line-height: 1.85;
  color: rgba(243, 237, 224, 0.52);
}

.timeline-steps li.is-done {
  color: #e9c487;
}

.timeline-steps li.is-current {
  color: #f7efe0;
}

/* 平板竖屏适配（iPad Portrait）：保留大殿师兄与火盆视野，宣纸优雅居中偏下 */
@media (max-width: 1024px) and (orientation: portrait) {
  .scene-frame,
  .scene-video {
    object-position: 70% 42%;
  }

  .scene-stack {
    transform-origin: 70% 42%;
  }

  .paper-stage,
  .wish-card {
    left: 50%;
    top: auto;
    bottom: max(28px, env(safe-area-inset-bottom));
    transform: translateX(-50%);
    width: min(520px, calc(100vw - 44px));
  }

  .paper-stage.is-centered {
    left: 50%;
    top: 56%;
    bottom: auto;
    transform: translate(-50%, -50%) scale(1);
  }

  .paper-stage.is-hidden {
    transform: translate(-50%, 16px) scale(0.94);
  }

  .completion-panel,
  .wish-receipt-panel {
    left: 50%;
    top: auto;
    bottom: max(36px, env(safe-area-inset-bottom));
    transform: translateX(-50%);
    width: min(500px, calc(100vw - 44px));
  }
}

@media (max-width: 900px) {
  .practitioner-status {
    display: none;
  }
}

/* 手机竖屏专项适配（上神圣大殿师兄与火盆，下宣纸书写，完美适配软键盘与安全区） */
@media (max-width: 768px) {
  .scene-frame,
  .scene-video {
    object-position: 73% 38%;
  }

  .scene-stack {
    transform-origin: 73% 38%;
  }

  .scene-vignette {
    background:
      linear-gradient(180deg, rgba(10, 9, 7, 0.52) 0%, transparent 20%, transparent 46%, rgba(8, 7, 6, 0.84) 100%);
  }

  .top-bar {
    padding: max(12px, env(safe-area-inset-top)) 14px 10px;
    gap: 8px;
  }

  .brand-en {
    font-size: 12px;
    letter-spacing: 0.16em;
  }

  .brand-zh {
    font-size: 14px;
  }

  .brand-sub {
    display: none;
  }

  .mode-btn {
    padding: 6px 14px;
    font-size: 13px;
  }

  .icon-pill {
    padding: 6px 10px;
    font-size: 11px;
  }

  .paper-stage,
  .wish-card {
    left: 50%;
    top: auto;
    bottom: max(14px, env(safe-area-inset-bottom));
    transform: translateX(-50%);
    width: calc(100vw - 24px);
    max-height: 58dvh;
  }

  .paper-stage.is-centered {
    left: 50%;
    top: 56%;
    bottom: auto;
    transform: translate(-50%, -50%) scale(1);
  }

  .paper-stage.is-hidden {
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 14px) scale(0.95);
  }

  .completion-panel,
  .wish-receipt-panel {
    left: 50%;
    top: auto;
    bottom: max(22px, env(safe-area-inset-bottom));
    transform: translateX(-50%);
    width: calc(100vw - 28px);
    padding: 24px 20px;
  }

  .ritual-caption {
    left: 50%;
    bottom: max(24px, env(safe-area-inset-bottom));
    transform: translateX(-50%);
    text-align: center;
    width: calc(100vw - 32px);
  }

  .rice-paper,
  .wish-card {
    padding: 16px 16px 14px;
  }

  .paper-header {
    padding-bottom: 10px;
    margin-bottom: 10px;
  }

  .worry-textarea {
    min-height: 112px;
    font-size: 22px;
    line-height: 1.52;
    background-size: 100% 36px;
  }

  .wish-textarea {
    min-height: 88px;
    font-size: 21px;
  }

  .wish-path-tabs {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .wish-tab {
    padding: 8px 9px;
  }

  .wish-tab span {
    display: none;
  }

  .wish-pool-badge {
    right: auto;
    left: 50%;
    top: 64px;
    bottom: auto;
    transform: translateX(-50%);
    white-space: nowrap;
    padding: 5px 12px;
    font-size: 11px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .scene-stack,
  .brazier-glow,
  .status-pulse,
  .tear-cta,
  .tear-line {
    animation: none !important;
  }
}
