/* ============ 答命卷专属样式（复用 theme.css 的 token 与全局背景/控件） ============ */

#progress { height: 2.5px; background: rgba(214,178,102,0.14); transform: none; }
#progressFill { display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, var(--underworld), var(--guide, var(--gold-bright)), var(--gold));
  box-shadow: 0 0 10px rgba(214,178,102,0.7); transition: width 0.7s var(--ease); }

/* 问卷页背景压暗一些，让卷卡浮起 */
#bg-veil { background:
  radial-gradient(120% 90% at 50% 0%, rgba(8,9,12,0.35), rgba(8,9,12,0.78) 90%),
  linear-gradient(to bottom, rgba(8,9,12,0.62), rgba(8,9,12,0.5) 35%, rgba(8,9,12,0.82)); }

.ritual[hidden] { display: none !important; }
.ritual {
  position: relative; z-index: 6;
  min-height: 100dvh;
  display: flex; align-items: center; justify-content: center;
  padding: calc(5.4rem + env(safe-area-inset-top)) 1.2rem calc(2.4rem + env(safe-area-inset-bottom));
}
.ritual-inner {
  width: min(var(--content-width), 100%);
  text-align: center;
  animation: rise 1.1s var(--ease) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(28px); filter: blur(6px); } to { opacity: 1; transform: none; filter: blur(0); } }

.ritual-title {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(3rem, 14vw, 4.6rem); letter-spacing: 0.22em; padding-left: 0.22em;
  margin: 1.1rem 0 0.5rem;
  background: linear-gradient(180deg, var(--gold-bright), var(--gold) 58%, #8f6f38);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 36px rgba(214,178,102,0.24));
}
.ritual-en { font-family: "Cinzel", serif; letter-spacing: 0.5em; padding-left: 0.5em;
  font-size: 0.74rem; color: var(--gold); opacity: 0.7; margin: 0; }
.ritual-guide { font-family: var(--font-display); letter-spacing: 0.4em; padding-left: 0.4em;
  font-size: 0.9rem; color: var(--guide, var(--xaro)); margin: 1.2rem 0 2.2rem;
  text-shadow: 0 0 22px rgba(0,0,0,0.8); }
.ritual-line { max-width: 30rem; margin: 0 auto 0.9rem;
  font-size: clamp(0.98rem, 3.9vw, 1.08rem); line-height: 2.05; letter-spacing: 0.05em;
  color: var(--paper); text-shadow: 0 1px 18px rgba(0,0,0,0.8); }
.ritual-sub { color: var(--paper-dim); letter-spacing: 0.18em; font-size: 0.84rem;
  margin: 0 0 2.8rem; }
.ritual-note { margin-top: 2.4rem; font-size: 0.74rem; color: var(--paper-faint);
  letter-spacing: 0.1em; line-height: 1.9; }

/* ============ 问卷卷卡 ============ */
.q-ritual { align-items: stretch; padding-top: calc(5rem + env(safe-area-inset-top)); }
.q-frame {
  width: min(40rem, 100%); margin: auto 0;
  background: linear-gradient(168deg, rgba(28,24,18,0.9), rgba(14,13,16,0.94));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 5vw, 2.4rem) clamp(1.2rem, 5vw, 2.4rem) clamp(1.4rem, 4vw, 2rem);
  box-shadow: 0 30px 90px rgba(0,0,0,0.6), 0 0 0 1px rgba(214,178,102,0.06) inset, 0 0 60px rgba(214,178,102,0.05);
  backdrop-filter: blur(14px);
  position: relative;
}
.q-frame::before, .q-frame::after {
  content: ""; position: absolute; left: 6%; right: 6%; height: 1px;
  background: linear-gradient(90deg, transparent, var(--line), transparent);
}
.q-frame::before { top: 0.7rem; } .q-frame::after { bottom: 0.7rem; }

.q-meta { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 0.8rem; }
.q-group { font-family: var(--font-display); font-size: 0.72rem; letter-spacing: 0.34em;
  padding-left: 0.34em; color: var(--guide, var(--gold)); opacity: 0.92; }
.q-count { font-family: "Cinzel", serif; font-size: 0.86rem; color: var(--paper-dim); }
.q-count b { color: var(--gold-bright); font-size: 1.2rem; font-weight: 600; }
.q-count i { font-style: normal; opacity: 0.5; margin: 0 0.15rem; }

.q-track { height: 2px; background: rgba(214,178,102,0.16); border-radius: 2px; overflow: hidden; margin-bottom: 1.7rem; }
#qTrackFill { display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, var(--underworld), var(--guide, var(--gold)));
  box-shadow: 0 0 8px rgba(214,178,102,0.6); transition: width 0.6s var(--ease); }

.q-title { font-family: var(--font-display); font-weight: 600;
  font-size: clamp(1.3rem, 5.4vw, 1.7rem); line-height: 1.5; letter-spacing: 0.06em;
  margin: 0 0 0.5rem; color: var(--paper); }
.q-tip { font-size: 0.78rem; letter-spacing: 0.12em; color: var(--paper-faint);
  margin: 0 0 1.5rem; }

.q-body { min-height: 8rem; }
.q-options { display: flex; flex-direction: column; gap: 0.7rem; }
.q-opt {
  display: flex; align-items: center; gap: 0.85rem; text-align: left;
  padding: 0.92rem 1.1rem; border-radius: var(--radius-md);
  border: 1px solid rgba(214,178,102,0.22);
  background: rgba(236,229,211,0.03);
  color: var(--paper-dim); font-size: 0.96rem; letter-spacing: 0.03em; line-height: 1.4;
  transition: border-color 0.3s, background 0.3s, color 0.3s, transform 0.25s var(--ease);
}
.q-opt:active { transform: scale(0.99); }
.q-dot { flex: none; width: 1.05rem; height: 1.05rem; border-radius: 50%;
  border: 1.5px solid rgba(214,178,102,0.45); position: relative; transition: border-color 0.3s; }
.is-multi .q-dot { border-radius: 3px; }
.q-opt .q-dot::after { content: ""; position: absolute; inset: 3px; border-radius: 50%;
  background: var(--guide, var(--gold)); transform: scale(0); transition: transform 0.28s var(--ease);
  box-shadow: 0 0 12px var(--guide, var(--gold)); }
.is-multi .q-opt .q-dot::after { border-radius: 1px; }
.q-opt.is-on { border-color: var(--guide, var(--gold));
  background: linear-gradient(180deg, rgba(214,178,102,0.16), rgba(214,178,102,0.07));
  color: var(--paper); }
.q-opt.is-on .q-dot { border-color: var(--guide, var(--gold)); }
.q-opt.is-on .q-dot::after { transform: scale(1); }

.q-date { display: flex; justify-content: center; padding: 0.5rem 0; }
.q-date input {
  font-family: var(--font-display); font-size: 1.05rem; letter-spacing: 0.08em;
  color: var(--paper); background: rgba(8,9,12,0.6);
  border: 1px solid var(--line); border-radius: var(--radius-md);
  padding: 0.95rem 1.3rem; color-scheme: dark; min-width: min(17rem, 80%);
  text-align: center;
}
.q-date input:focus { outline: none; border-color: var(--guide, var(--gold));
  box-shadow: 0 0 0 1px var(--guide, var(--gold)), 0 0 22px rgba(214,178,102,0.2); }

/* 开放题 */
.q-text { display: flex; flex-direction: column; gap: 0.5rem; padding: 0.2rem 0; }
.q-text textarea {
  width: 100%; resize: none;
  font-family: var(--font-display); font-size: 1rem; line-height: 1.9; letter-spacing: 0.03em;
  color: var(--paper); background: rgba(8,9,12,0.55);
  border: 1px solid var(--line); border-radius: var(--radius-md);
  padding: 1rem 1.15rem; min-height: 7.5rem;
  transition: border-color .25s, box-shadow .25s;
}
.q-text textarea::placeholder { color: var(--paper-faint); opacity: 0.6; font-size: .86rem; }
.q-text textarea:focus { outline: none; border-color: var(--guide, var(--gold));
  box-shadow: 0 0 0 1px var(--guide, var(--gold)), 0 0 22px rgba(214,178,102,0.18); }
.q-text-count { align-self: flex-end; font-size: .72rem; letter-spacing: .08em; color: var(--paper-faint); }

.q-nav { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1.8rem; }
.q-back { font-size: 0.8rem; letter-spacing: 0.14em; color: var(--paper-faint);
  padding: 0.5rem 0.4rem; transition: color 0.3s; }
.q-back:active { color: var(--gold); }
.q-next { min-width: 13rem; padding: 0.92rem 1.8rem; font-size: 0.92rem; letter-spacing: 0.22em;
  margin-left: auto; transition: opacity 0.35s, transform 0.4s var(--ease); }
.q-next:disabled { opacity: 0.32; pointer-events: none; box-shadow: none; }

/* 换题入画 */
.q-frame.q-in { animation: qIn 0.55s var(--ease) both; }
@keyframes qIn { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
.q-frame.q-in .q-title { animation: rise 0.6s var(--ease) 0.05s both; }
.q-frame.q-in .q-opt { animation: rise 0.5s var(--ease) both; }
.q-frame.q-in .q-opt:nth-child(1) { animation-delay: 0.05s; }
.q-frame.q-in .q-opt:nth-child(2) { animation-delay: 0.1s; }
.q-frame.q-in .q-opt:nth-child(3) { animation-delay: 0.15s; }
.q-frame.q-in .q-opt:nth-child(4) { animation-delay: 0.2s; }
.q-frame.q-in .q-opt:nth-child(5) { animation-delay: 0.25s; }
.q-frame.q-in .q-opt:nth-child(n+6) { animation-delay: 0.3s; }

/* ============ 回溯仪式 ============ */
.review-ritual { text-align: center; }
.review-inner { width: min(34rem, 100%); animation: rise 1s var(--ease) both; }
.review-seal { width: 7.5rem; height: 7.5rem; margin: 0 auto 2rem; position: relative;
  display: grid; place-items: center; }
.seal-glyph { font-family: var(--font-display); font-size: 3rem; color: var(--cinnabar);
  border: 2px solid var(--cinnabar); border-radius: 12px; width: 4.4rem; height: 4.4rem;
  display: grid; place-items: center; line-height: 1;
  background: rgba(158,59,50,0.08);
  box-shadow: 0 0 30px rgba(158,59,50,0.35);
  animation: sealPulse 2.6s ease-in-out infinite; }
@keyframes sealPulse { 0%,100% { transform: scale(1); box-shadow: 0 0 24px rgba(158,59,50,0.3);} 50% { transform: scale(1.05); box-shadow: 0 0 44px rgba(158,59,50,0.55);} }
.review-seal::before { content: ""; position: absolute; inset: 0; border-radius: 50%;
  border: 1px solid var(--line);
  animation: ringSpin 6s linear infinite;
  border-top-color: var(--guide, var(--gold)); }
@keyframes ringSpin { to { transform: rotate(360deg); } }

.review-title { font-family: var(--font-display); font-weight: 700;
  font-size: clamp(1.7rem, 7vw, 2.3rem); letter-spacing: 0.24em; padding-left: 0.24em;
  margin: 0 0 1.6rem; color: var(--gold-bright);
  text-shadow: 0 0 30px rgba(214,178,102,0.3); }
.review-line { min-height: 3.4em; max-width: 26rem; margin: 0 auto 2.2rem;
  font-size: 1rem; line-height: 1.9; letter-spacing: 0.05em; color: var(--paper); }
.review-line.line-in { animation: lineIn 0.8s var(--ease) both; }
@keyframes lineIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.review-steps { list-style: none; padding: 0; margin: 0 auto 2.4rem; max-width: 22rem; text-align: left; }
.review-steps li { position: relative; padding: 0.6rem 0 0.6rem 2rem;
  font-size: 0.92rem; letter-spacing: 0.06em; color: var(--paper-faint);
  transition: color 0.5s; }
.review-steps li::before { content: ""; position: absolute; left: 0.2rem; top: 0.95rem;
  width: 0.7rem; height: 0.7rem; border-radius: 50%;
  border: 1.5px solid rgba(214,178,102,0.4); }
.review-steps li.is-active { color: var(--paper); }
.review-steps li.is-active::before { border-color: var(--guide, var(--gold));
  box-shadow: 0 0 12px var(--guide, var(--gold)); animation: sealPulse 1.1s infinite; }
.review-steps li.is-done { color: var(--paper-dim); }
.review-steps li.is-done::before { background: var(--guide, var(--gold)); border-color: var(--guide, var(--gold)); }
.review-hint { font-size: 0.8rem; letter-spacing: 0.16em; color: var(--paper-faint); }

@media (max-width: 640px) {
  .q-ritual { padding-top: calc(4.2rem + env(safe-area-inset-top)); }
  .q-nav { flex-wrap: wrap; }
  .q-next { min-width: 100%; margin-left: 0; order: -1; }
  .q-back { margin: 0 auto; }
  .q-opt { font-size: 0.9rem; padding: 0.85rem 1rem; }
  .ritual-guide { margin: 1rem 0 1.8rem; }
}

/* 回溯完成·入剧场按钮 */
.btn-enter-reel{
  display:inline-block; margin-top:1.6rem; text-decoration:none;
  opacity:0; transform:translateY(10px); transition:opacity .7s ease, transform .7s ease;
}
.btn-enter-reel.is-in{opacity:1; transform:none;}
.btn-enter-reel[hidden]{display:none !important;}

@media (prefers-reduced-motion: reduce) {
  .q-frame.q-in, .q-frame.q-in .q-title, .q-frame.q-in .q-opt,
  .ritual-inner, .review-inner { animation: none; }
  .seal-glyph, .review-seal::before, .review-steps li.is-active::before { animation: none; }
}
