/* ===== 设计变量 · 淡紫浅杏治愈风 ===== */
:root {
  --cream: #fbf8f5;
  --purple: #9d83c7;
  --purple-soft: #b7a3da;
  --purple-bg: #efe9f7;
  --apricot: #e2b48f;
  --apricot-bg: #f8ede2;
  --ink: #53484f;
  --ink-soft: #94878d;
  --card: #ffffff;
  --shadow: 0 12px 32px rgba(150, 130, 170, 0.16);
  --shadow-soft: 0 6px 18px rgba(150, 130, 170, 0.12);
  --radius: 24px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; touch-action: manipulation; -webkit-text-size-adjust: 100%; }

body {
  min-height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(120% 50% at 90% -5%, var(--purple-bg) 0%, rgba(239, 233, 247, 0) 55%),
    radial-gradient(120% 50% at -10% 8%, var(--apricot-bg) 0%, rgba(248, 237, 226, 0) 55%),
    linear-gradient(180deg, #fdfaf7 0%, var(--cream) 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}

#app {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 16px 16px calc(26px + env(safe-area-inset-bottom, 0px));
}

/* ===== 视图切换 ===== */
.view { display: none; animation: fadeUp 0.45s ease both; }
.view.is-active { display: block; }
.view[data-view="result"] { position: relative; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== 通用 ===== */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 18px;
  margin-bottom: 16px;
}
.btn {
  border: none; cursor: pointer; font-family: inherit; font-weight: 700;
  border-radius: 999px;
  transition: transform 0.15s ease, opacity 0.15s ease;
}
.btn:active { transform: scale(0.97); opacity: 0.92; }
.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--purple-soft) 0%, var(--purple) 100%);
  box-shadow: 0 10px 24px rgba(157, 131, 199, 0.35);
}
.btn-lg { width: 100%; padding: 17px; font-size: 17px; }
.block-title { font-size: 16px; font-weight: 900; margin-bottom: 16px; }
.meta-line { text-align: center; font-size: 12.5px; color: var(--ink-soft); margin: 14px 0 10px; }
.disclaimer { text-align: center; font-size: 11px; line-height: 1.7; color: #b3a8ad; }

/* ===== 兑换码解锁页 ===== */
.gate-box {
  min-height: 76vh;
  display: flex; flex-direction: column; justify-content: center;
  text-align: center; padding: 28px 4px;
}
.gate-badge {
  width: 64px; height: 64px; margin: 0 auto 18px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--purple-soft), var(--purple));
  color: #fff; font-size: 26px; font-weight: 900;
  box-shadow: 0 10px 24px rgba(157, 131, 199, 0.35);
}
.gate-title { font-size: 24px; font-weight: 900; margin-bottom: 14px; }
.gate-pill {
  font-size: 12.5px; color: var(--apricot); line-height: 1.5;
  background: var(--apricot-bg); border-radius: 999px;
  padding: 8px 16px; display: inline-block; margin: 0 auto 26px;
}
.gate-input-wrap { position: relative; }
.gate-input {
  width: 100%; font-family: inherit; font-size: 16px; font-weight: 700;
  color: var(--ink); text-align: center; letter-spacing: 1px;
  border: 2px solid #ece4f3; border-radius: 16px;
  padding: 17px 16px; outline: none; background: #fff;
  transition: border-color 0.15s ease;
}
.gate-input:focus { border-color: var(--purple); }
.gate-error {
  min-height: 20px; margin: 10px 0 4px;
  font-size: 13px; color: #d98a7a; font-weight: 700;
}
.gate-disclaimer { margin-top: 18px; }

/* ===== 首页封面 ===== */
.cover {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}
.cover-img { display: block; width: 100%; height: auto; }
.cover-text { position: absolute; top: 0; left: 0; right: 0; padding: 30px 24px 0; text-align: center; }
.cover-title { font-size: 27px; line-height: 1.4; font-weight: 900; color: var(--ink); letter-spacing: 1px; }
.cover-sub { margin-top: 12px; font-size: 13px; color: var(--ink-soft); }

.tags-card { padding: 16px; }
.sell-tags { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.sell-tags li { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--ink-soft); line-height: 1.4; }
.sell-tags b { display: block; color: var(--ink); font-size: 13.5px; }
.tag-no {
  width: 40px; height: 40px; flex: 0 0 40px;
  display: grid; place-items: center;
  background: var(--purple-bg);
  color: var(--purple);
  font-weight: 900; font-size: 14px;
  border-radius: 12px;
}

/* ===== 引导页 ===== */
.intro-visual { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); margin-bottom: 16px; }
.intro-visual img { display: block; width: 100%; height: auto; }
.intro-card { text-align: center; }
.intro-title { font-size: 22px; font-weight: 900; margin-bottom: 10px; }
.intro-desc { font-size: 14px; line-height: 1.8; color: var(--ink-soft); }

/* ===== 答题页 ===== */
.quiz-top { display: flex; align-items: center; gap: 14px; padding: 4px 0 16px; }
.icon-btn {
  width: 38px; height: 38px; flex: 0 0 38px;
  border: none; background: #fff; border-radius: 12px;
  box-shadow: var(--shadow-soft);
  font-size: 26px; line-height: 1; color: var(--ink); cursor: pointer;
}
.icon-btn:active { opacity: 0.7; }
.progress-wrap { flex: 1; }
.progress-bar { height: 10px; background: #efe9f7; border-radius: 999px; overflow: hidden; }
.progress-bar span {
  display: block; height: 100%; width: 4%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--purple-soft), var(--purple));
  transition: width 0.35s ease;
}
.progress-text { margin-top: 6px; font-size: 12px; color: var(--ink-soft); text-align: right; font-weight: 700; }

.quiz-stage { text-align: center; }
.q-illu { width: 140px; height: 140px; border-radius: 24px; object-fit: cover; margin-bottom: 14px; }
.question {
  font-size: 19px; line-height: 1.55; font-weight: 800;
  min-height: 58px; display: grid; place-items: center;
  padding: 0 2px; margin-bottom: 18px;
}
.options { display: grid; gap: 10px; text-align: left; }
.option {
  border: 2px solid #ece4f3; background: #fff; border-radius: 16px;
  padding: 14px 16px; font-family: inherit; font-size: 14.5px;
  font-weight: 600; color: var(--ink); cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.option:active { transform: scale(0.98); }
.option.is-picked { border-color: var(--purple); background: var(--purple-bg); color: var(--purple); }

/* ===== 加载页 ===== */
.loading-box { padding: 70px 6px 0; text-align: center; }
.loading-eyebrow { font-size: 12px; letter-spacing: 3px; font-weight: 800; color: var(--purple); }
.loading-title { font-size: 23px; font-weight: 900; margin: 12px 0 30px; }
.loading-steps { list-style: none; display: grid; gap: 16px; text-align: left; }
.loading-steps li { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.step-dot {
  width: 26px; height: 26px; flex: 0 0 26px;
  border-radius: 50%;
  background: var(--purple-bg);
  position: relative;
}
.step-dot.is-on { background: var(--purple); }
.step-dot.is-on::after {
  content: "✓"; color: #fff; font-size: 13px;
  position: absolute; inset: 0; display: grid; place-items: center;
}
.step-name { flex: 1; color: var(--ink); font-weight: 600; }
.step-pct { font-size: 13px; color: var(--ink-soft); font-weight: 700; }
.loading-steps li.is-done .step-name { color: var(--purple); }

/* ===== 结果报告头 ===== */
.report-head { text-align: center; padding: 18px 0 22px; }
.head-badge {
  width: 58px; height: 58px; display: inline-grid; place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--purple-soft), var(--purple));
  color: #fff; font-size: 24px; font-weight: 900;
  box-shadow: 0 8px 20px rgba(157, 131, 199, 0.35);
}
.head-title { font-size: 24px; font-weight: 900; margin-top: 14px; }
.head-en { font-size: 12px; letter-spacing: 3px; color: var(--ink-soft); margin-top: 8px; font-weight: 700; }
.head-meta {
  margin-top: 16px; padding-top: 14px;
  border-top: 1px solid #efe9f7;
  display: flex; justify-content: space-between;
  font-size: 12px; color: var(--ink-soft);
}

/* ===== 主结果 ===== */
.report-main { text-align: center; }
.main-eyebrow { font-size: 11px; letter-spacing: 3px; color: var(--purple); font-weight: 800; }
.main-pill {
  margin: 12px auto 0;
  display: inline-block;
  font-size: 13px; color: var(--ink-soft);
  background: var(--purple-bg);
  padding: 6px 16px; border-radius: 999px;
}
.main-name { font-size: 40px; font-weight: 900; margin-top: 12px; color: var(--ink); }
.main-title {
  margin-top: 10px; display: inline-block;
  font-size: 14px; font-weight: 700; color: var(--purple);
  background: var(--purple-bg); padding: 6px 16px; border-radius: 999px;
}

.verse-box {
  margin-top: 18px; text-align: left;
  background: linear-gradient(135deg, #faf6fd, #fdf8f3);
  border-radius: 16px; padding: 16px;
}
.verse-box p { font-size: 14px; line-height: 1.7; color: var(--ink); margin-bottom: 10px; }
.verse-box p:last-child { margin-bottom: 0; }
.verse-box .src { color: var(--ink-soft); font-size: 12px; }

.match-box { margin-top: 20px; display: grid; justify-items: center; }
.match-ring {
  width: 140px; height: 140px; border-radius: 50%;
  background: conic-gradient(var(--purple) calc(var(--p, 0) * 1%), #efe9f7 0);
  display: grid; place-items: center;
}
.match-inner {
  width: 106px; height: 106px; background: #fff; border-radius: 50%;
  display: grid; place-items: center; align-content: center;
}
.match-inner b { font-size: 28px; font-weight: 900; color: var(--purple); line-height: 1; }
.match-inner span { font-size: 11px; color: var(--ink-soft); margin-top: 4px; }
.match-note { margin-top: 14px; font-size: 13px; line-height: 1.7; color: var(--ink-soft); }

/* ===== 六维度 ===== */
.dim-list { display: grid; gap: 14px; }
.dim-item h3 { font-size: 14px; font-weight: 800; color: var(--purple); margin-bottom: 4px; }
.dim-item p { font-size: 13.5px; line-height: 1.75; color: var(--ink-soft); }

/* ===== 线索 ===== */
.clue-list { display: grid; gap: 12px; }
.clue-item {
  background: var(--purple-bg); border-radius: 16px; padding: 14px 16px;
}
.clue-q { font-size: 13px; font-weight: 800; color: var(--ink); margin-bottom: 6px; line-height: 1.6; }
.clue-a { font-size: 13px; line-height: 1.7; color: var(--purple); font-weight: 600; }

/* ===== 次优诗人 ===== */
.alt-list { display: grid; gap: 12px; }
.alt-item {
  display: flex; align-items: center; gap: 12px;
  border: 1.5px solid #efe9f7; border-radius: 16px; padding: 12px 14px;
}
.alt-avatar {
  width: 46px; height: 46px; flex: 0 0 46px;
  border-radius: 50%; background: var(--purple-bg);
  display: grid; place-items: center;
  color: var(--purple); font-weight: 900; font-size: 18px;
}
.alt-info { flex: 1; }
.alt-info b { font-size: 15px; display: block; }
.alt-info span { font-size: 12px; color: var(--ink-soft); }
.alt-pct { font-size: 14px; font-weight: 800; color: var(--purple); }

/* ===== 水印 ===== */
.watermark {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) rotate(-24deg);
  font-size: 13px; letter-spacing: 1px;
  color: var(--purple); opacity: 0.1;
  white-space: nowrap; pointer-events: none; user-select: none;
}

/* ===== 雷达图 ===== */
.radar-wrap { display: grid; place-items: center; }
#radarCanvas { width: 100%; max-width: 320px; height: auto; display: block; }
.radar-legend {
  display: flex; justify-content: center; gap: 22px;
  margin-top: 14px; font-size: 12.5px; color: var(--ink-soft);
}
.radar-legend span { display: flex; align-items: center; gap: 6px; }
.radar-legend i { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }
.lg-you { background: rgba(157, 131, 199, 0.55); }
.lg-poet { background: rgba(226, 180, 143, 0.55); }

/* ===== 深度卡片 ===== */
.deep-list { display: grid; gap: 12px; }
.deep-item {
  display: flex; gap: 12px;
  background: linear-gradient(135deg, #faf7fd, #fdf8f3);
  border-radius: 16px; padding: 14px;
}
.deep-no {
  width: 34px; height: 34px; flex: 0 0 34px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--purple-soft), var(--purple));
  color: #fff; font-weight: 900; font-size: 13px; border-radius: 10px;
}
.deep-body h4 { font-size: 14px; font-weight: 800; color: var(--ink); margin-bottom: 4px; }
.deep-body p { font-size: 13px; line-height: 1.7; color: var(--ink-soft); }

/* ===== 小屏微调 ===== */
@media (max-width: 340px) {
  .cover-title { font-size: 24px; }
  .question { font-size: 17.5px; }
  .main-name { font-size: 34px; }
}
