/* ===== 人格验牌 全局样式（与 mintryu.com 主站一致：浅色纸面 + 粉蓝渐变 + 玻璃拟态） ===== */
:root {
  --paper: #fbfbff;
  --ink: #221c39;
  --muted: #6b6286;
  --pink: #ff6fbd;
  --pink-deep: #e0449e;
  --blue: #35ccf1;
  --blue-deep: #0096c7;
  --line: rgba(48, 52, 92, .14);
  --glass: linear-gradient(145deg, rgba(255, 255, 255, .78), rgba(255, 255, 255, .42));
  --r-lg: 20px;
  --r-md: 14px;
  --font-display: "Space Grotesk", "Noto Sans SC", "PingFang SC", ui-sans-serif, sans-serif;
  --font-body: "Noto Sans SC", "PingFang SC", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { height: 100%; }

body {
  font-family: var(--font-body);
  background:
    radial-gradient(ellipse 70% 45% at 15% -5%, rgba(255, 111, 189, .18), transparent),
    radial-gradient(ellipse 70% 45% at 90% 105%, rgba(53, 204, 241, .16), transparent),
    var(--paper);
  color: var(--ink);
  display: flex;
  justify-content: center;
}

#app { width: 100%; max-width: 480px; min-height: 100dvh; display: flex; }

.view {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
}
.hidden { display: none; }

h1, .home-title, .quiz-title { font-family: var(--font-display); }

/* ===== 首页 ===== */
.home-inner { text-align: center; }
.home-sub { color: var(--muted); letter-spacing: .3em; font-size: 13px; margin-bottom: 12px; }
.home-title {
  font-size: 56px;
  font-weight: 700;
  letter-spacing: .06em;
  background: linear-gradient(120deg, var(--pink), var(--blue));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 20px;
}
.home-desc { color: var(--muted); line-height: 2; margin-bottom: 36px; }
.home-desc .hl { color: var(--blue-deep); font-weight: 500; }
.home-tip { margin-top: 16px; font-size: 12px; color: var(--muted); }

/* ===== 按钮 ===== */
.btn-primary {
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  padding: 14px 48px;
  border-radius: 999px;
  background: linear-gradient(120deg, var(--pink), var(--blue));
  box-shadow: 0 8px 24px rgba(224, 68, 158, .28);
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn-primary:active { transform: scale(.96); box-shadow: 0 3px 12px rgba(224, 68, 158, .25); }
.btn-primary:disabled { opacity: .6; }

.btn-ghost {
  border: 1px solid var(--line);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 500;
  color: var(--ink);
  background: rgba(255, 255, 255, .6);
  padding: 12px 36px;
  border-radius: 999px;
  transition: background .15s ease;
}
.btn-ghost:active { background: rgba(255, 255, 255, .95); }

/* ===== 答题页 ===== */
.quiz-inner { width: 100%; animation: slide-in .3s ease; }
.quiz-inner.leaving { animation: slide-out .18s ease forwards; }

@keyframes slide-in { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@keyframes slide-out { to { opacity: 0; transform: translateX(-28px); } }

.progress-track {
  height: 4px;
  border-radius: 2px;
  background: rgba(48, 52, 92, .1);
  overflow: hidden;
  margin-bottom: 14px;
}
.progress-bar {
  height: 100%;
  width: 0;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--pink), var(--blue));
  transition: width .25s ease;
}
.quiz-step { color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.quiz-title { font-size: 28px; font-weight: 700; margin-bottom: 32px; letter-spacing: .02em; }

.options { display: flex; flex-direction: column; gap: 16px; }
.option {
  cursor: pointer;
  text-align: left;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.5;
  color: var(--ink);
  padding: 20px 22px;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: var(--glass);
  box-shadow: 0 4px 16px rgba(48, 52, 92, .06);
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.option:active {
  transform: scale(.98);
  border-color: var(--pink);
  box-shadow: 0 4px 20px rgba(255, 111, 189, .25);
}
.option .opt-key {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--pink-deep);
  margin-right: 10px;
}

/* ===== 计算中 ===== */
.computing-inner { text-align: center; }
.spinner {
  width: 52px; height: 52px;
  margin: 0 auto 20px;
  border-radius: 50%;
  border: 4px solid rgba(255, 111, 189, .18);
  border-top-color: var(--pink);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.computing-text { font-size: 20px; letter-spacing: .15em; color: var(--ink); font-weight: 500; }

/* ===== 结果卡片 ===== */
.card {
  width: min(340px, 100%);
  border-radius: 24px;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 16px 48px rgba(48, 52, 92, .14);
}
.card-art {
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  position: relative;
  background: radial-gradient(circle at 50% 42%, rgba(255,255,255,.96), transparent 48%), linear-gradient(145deg, var(--circle-color, #c7d2fe), #f8fbff);
}
.card-art::after { content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.card.spirit-S1 .card-art::after { background: radial-gradient(circle at 78% 18%, rgba(255, 111, 189, .46), transparent 30%), linear-gradient(145deg, transparent 58%, rgba(249, 168, 212, .22)); }
.card.spirit-S2 .card-art::after { background: linear-gradient(115deg, rgba(253, 224, 71, .16), transparent 28%, rgba(255, 111, 189, .14) 64%, transparent); mix-blend-mode: screen; }
.card.spirit-S3 .card-art::after { background: linear-gradient(to bottom, rgba(255, 255, 255, .04), rgba(251, 207, 232, .25)); }
.card.spirit-S4 .card-art::after { background: radial-gradient(circle at 50% 38%, transparent 35%, rgba(30, 27, 75, .48) 100%), linear-gradient(160deg, rgba(196, 181, 253, .18), transparent 44%); }
.card-art svg { height: 92%; display: block; }
.card-art img { position: relative; z-index: 1; width: 100%; height: 100%; padding: 8px 22px 0; display: block; object-fit: contain; }

.card-body { padding: 20px 20px 16px; }
.tags { display: flex; gap: 10px; justify-content: center; margin-bottom: 14px; }
.tag {
  font-size: 15px;
  font-weight: 700;
  padding: 8px 18px;
  border-radius: 999px;
  color: var(--ink);
}
.combo {
  text-align: center;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.7;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}
.result-proof {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: rgba(248, 248, 255, .82);
}
.meter-row, .runner-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.meter-row { font-size: 13px; font-weight: 700; }
.meter-row strong { color: var(--pink-deep); font-family: var(--font-display); font-size: 18px; }
.meter-track { height: 6px; margin: 8px 0; overflow: hidden; border-radius: 999px; background: rgba(48, 52, 92, .1); }
.meter-track i { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--pink), var(--blue)); }
.runner-row { color: var(--muted); font-size: 11px; }
.runner-row b { color: var(--ink); }
.score-note { margin: 7px 0 0; color: rgba(107, 98, 134, .72); font-size: 9px; text-align: right; }
.reason-title { margin: 14px 0 7px; color: var(--ink); font-size: 12px; font-weight: 700; }
.reason-list { display: grid; gap: 5px; margin: 0; padding: 0; list-style: none; color: var(--muted); font-size: 11px; line-height: 1.5; }
.reason-list li::before { content: "·"; margin-right: 6px; color: var(--pink-deep); font-weight: 900; }
.card-bottom {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-top: 12px;
}
.card-brand { font-size: 11px; color: var(--muted); letter-spacing: .1em; }
.qr {
  flex: 0 0 auto;
  background: #fff;
  border: 1px solid var(--line);
  padding: 12px;
  border-radius: 8px;
  line-height: 0;
}
.qr canvas { display: block !important; }
.qr img { display: none !important; }

/* ===== 结果页操作区 ===== */
.actions { display: flex; gap: 14px; margin-top: 24px; }
.share-hint { margin-top: 14px; font-size: 12px; color: var(--muted); }

/* ===== 手机保存兜底：不支持文件分享时长按图片 ===== */
body.preview-open { overflow: hidden; }
.save-preview {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(24, 19, 43, .84);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.save-preview-inner { width: min(390px, 100%); max-height: calc(100dvh - 36px); overflow: auto; text-align: center; }
.save-preview p { margin: 0 0 12px; color: #fff; }
.save-preview p strong, .save-preview p span { display: block; }
.save-preview p strong { font-size: 18px; }
.save-preview p span { margin-top: 4px; color: rgba(255,255,255,.7); font-size: 12px; }
.save-preview img { width: 100%; display: block; border-radius: 20px; box-shadow: 0 24px 70px rgba(0,0,0,.38); -webkit-touch-callout: default; }
.save-preview button {
  width: 100%; margin-top: 14px; padding: 13px; border: 0; border-radius: 999px;
  background: #fff; color: var(--ink); font: 700 15px var(--font-body); cursor: pointer;
}
