/* ============================================================
 * style.css — 国庆出行人格 · 秋日国风（柿红/鎏金/月白米）
 * ============================================================ */
:root {
  --bg: #F6F1E7;
  --card: #FFFDF8;
  --ink: #2B2620;
  --muted: #8C8272;
  --primary: #C8452F;
  --primary-deep: #A33322;
  --gold: #C9A063;
  --gold-soft: #E8E0D0;
  --serif: "Noto Serif SC", "Songti SC", "SimSun", serif;
  --sans: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
}
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { overflow-x: hidden; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  min-height: 100vh;
  min-height: 100svh;
}
#app { max-width: 480px; margin: 0 auto; min-height: 100vh; min-height: 100svh; }
.screen { min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; padding: 24px 20px calc(24px + env(safe-area-inset-bottom)); }
.hidden { display: none !important; }

/* ---------- 通用按钮 ---------- */
.btn-primary {
  display: block; width: 100%; height: 52px; border: none; border-radius: 26px;
  background: linear-gradient(180deg, var(--primary), var(--primary-deep));
  color: #FFF9F0; font-size: 17px; font-weight: 600; letter-spacing: 2px;
  font-family: var(--sans); cursor: pointer;
  box-shadow: 0 6px 18px rgba(200, 69, 47, .28);
  transition: transform .12s ease;
}
.btn-primary:active { transform: scale(.97); }
.btn-ghost {
  display: block; width: 100%; height: 48px; margin-top: 12px;
  background: transparent; border: 1px solid var(--gold); border-radius: 24px;
  color: var(--primary-deep); font-size: 15px; letter-spacing: 1px;
  font-family: var(--sans); cursor: pointer;
}
.btn-ghost:active { background: rgba(201, 160, 99, .12); }

/* ---------- ① 封面 ---------- */
#screen-cover { justify-content: space-between; text-align: center; }
.top-note { font-size: 12px; color: var(--muted); letter-spacing: 3px; text-align: center; padding-top: 8px; }
.cover-center { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.cover-title {
  font-family: var(--serif); font-weight: 900; font-size: 34px;
  line-height: 1.5; letter-spacing: 2px; margin-top: 12vh;
}
.seal {
  width: 44px; height: 44px; border-radius: 8px;
  background: linear-gradient(160deg, var(--primary), var(--primary-deep));
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 10px rgba(163, 51, 34, .3);
}
.seal span { color: #FFF9F0; font-family: var(--serif); font-size: 15px; font-weight: 600; letter-spacing: 1px; }
.cover-sub { color: var(--muted); font-size: 14px; letter-spacing: 1px; }
.cover-bottom { display: flex; flex-direction: column; gap: 12px; }
.cover-meta { font-size: 12px; color: var(--muted); text-align: center; letter-spacing: 1px; }

/* ---------- ② 答题 ---------- */
#screen-quiz { padding-top: 0; }
.quiz-head { display: flex; align-items: center; gap: 12px; padding: 18px 0 8px; }
.btn-prev {
  flex: none; width: 30px; height: 30px; border-radius: 50%;
  border: 1px solid var(--gold); background: var(--card); color: var(--primary-deep);
  font-size: 20px; line-height: 1; cursor: pointer; padding: 0 0 2px;
}
.btn-prev:active { background: rgba(201, 160, 99, .18); }
.progress-track { flex: 1; height: 2px; background: var(--gold-soft); border-radius: 1px; overflow: hidden; }
.progress-fill { height: 100%; width: 8%; background: var(--primary); transition: width .3s ease; }
.progress-num { font-size: 12px; color: var(--muted); min-width: 34px; text-align: right; }
.quiz-body { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 26px; padding: 12px 0; }
.scene {
  font-family: var(--serif); font-weight: 600; font-size: 22px;
  line-height: 1.6; text-align: center; padding: 0 6px;
}
.options { display: flex; flex-direction: column; gap: 12px; }
.option {
  position: relative; background: var(--card); border: 1px solid var(--gold);
  border-radius: 12px; padding: 15px 14px 15px 46px;
  font-size: 15px; line-height: 1.55; cursor: pointer; user-select: none;
  transition: transform .12s ease, border-color .15s ease, background .15s ease;
  animation: opt-in .3s ease both;
}
.option:active { transform: scale(.98); border-color: var(--primary); background: rgba(200, 69, 47, .06); }
.option .opt-key {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  width: 22px; height: 22px; border: 1px solid var(--gold); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: var(--gold);
}
@keyframes opt-in { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
.quiz-anim-out { animation: q-out .25s ease both; }
@keyframes q-out { to { opacity: 0; transform: translateX(-14px); } }

/* ---------- ③ 过渡 ---------- */
#screen-loading { justify-content: center; align-items: center; gap: 28px; }
.loading-text { font-size: 15px; color: var(--muted); letter-spacing: 1px; animation: fade-swap .8s ease both; }
@keyframes fade-swap { from { opacity: 0; } to { opacity: 1; } }
.loading-line { position: relative; width: 180px; height: 2px; background: var(--gold-soft); }
.loading-block {
  position: absolute; top: -3px; width: 8px; height: 8px; border-radius: 2px;
  background: var(--primary); animation: slide 1.1s ease-in-out infinite alternate;
}
@keyframes slide { from { left: 0; } to { left: 172px; } }

/* ---------- ④ 结果 ---------- */
#screen-result { padding-top: 40px; text-align: center; }
.result-eyebrow { font-size: 14px; color: var(--muted); letter-spacing: 1px; }
.result-name {
  font-family: var(--serif); font-weight: 900; font-size: 30px;
  margin: 12px auto 14px; letter-spacing: 1px;
  /* 块级flex+justify居中：不依赖父级text-align，规避XWEB内核行内排版怪癖 */
  display: flex; justify-content: center; align-items: center; gap: 12px;
}
.result-name::before, .result-name::after {
  content: ""; width: 26px; height: 1px; background: var(--gold); flex: none;
}
.tag-pill {
  /* table+margin auto：永远独占一行、宽度收缩、绝对居中，任何内核通用 */
  display: table; margin: 0 auto; background: var(--primary); color: #FFF9F0;
  font-size: 13px; letter-spacing: 3px; padding: 6px 18px; border-radius: 16px;
  white-space: nowrap;
}
.quote-card {
  position: relative; margin: 26px 6px 22px; padding: 26px 20px 20px;
  background: var(--card); border-radius: 4px;
  box-shadow: 0 2px 14px rgba(43, 38, 32, .06);
}
.quote-card p {
  font-family: var(--serif); font-size: 19px; font-weight: 600;
  line-height: 1.8; letter-spacing: .5px;
}
.qmark { position: absolute; font-family: var(--serif); font-size: 26px; color: var(--gold); }
.qmark-open { left: 10px; top: 4px; }
.qmark-close { right: 10px; bottom: 2px; }
/* 四角鎏金角标 */
.quote-card::before, .quote-card::after,
.quote-card .qmark-open::before, .quote-card .qmark-close::before { content: none; }
.result-desc { font-size: 15px; line-height: 1.85; text-align: left; color: var(--ink); margin: 0 4px; }
.purity-list { margin: 22px 2px 26px; display: flex; flex-direction: column; gap: 12px; }
.purity-row { display: flex; align-items: center; gap: 10px; font-size: 12px; }
.purity-label { width: 76px; text-align: left; color: var(--muted); flex: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.purity-track { flex: 1; height: 8px; background: var(--gold-soft); border-radius: 4px; overflow: hidden; }
.purity-fill { height: 100%; background: linear-gradient(90deg, var(--gold), var(--primary)); border-radius: 4px; }
.purity-num { width: 40px; text-align: right; color: var(--muted); flex: none; }
.purity-row.top .purity-label { color: var(--primary-deep); font-weight: 600; }
.purity-row.top .purity-num { color: var(--primary); font-weight: 700; }
.again-row { margin-top: 16px; font-size: 12px; color: var(--muted); }
.again-row a { color: var(--muted); text-decoration: underline; }
.again-row .dot { color: var(--gold-soft); }

/* ---------- ⑤ 人格卡 ---------- */
#screen-card { justify-content: center; align-items: center; gap: 16px; }
#card-canvas { width: min(100%, 360px); height: auto; border-radius: 10px; box-shadow: 0 8px 30px rgba(43, 38, 32, .18); }
.card-tip { font-size: 13px; color: var(--muted); letter-spacing: 1px; }
#btn-back { width: min(100%, 360px); }

/* ---------- 分享引导浮层 ---------- */
#share-mask {
  position: fixed; inset: 0; background: rgba(43, 38, 32, .55);
  display: flex; align-items: center; justify-content: center; z-index: 50;
  padding: 30px;
}
.share-pop {
  background: var(--card); border-radius: 14px; padding: 26px 22px;
  max-width: 320px; width: 100%; text-align: center;
}
.share-pop p { font-size: 15px; line-height: 1.8; margin-bottom: 18px; }
