/* =====================================================
   情感修復診斷頁 — 手機優先設計
   基調：暖玫瑰 × 奶油白 × LINE 綠行動鍵
   ===================================================== */
:root {
  --rose: #d94f68;
  --rose-deep: #b23a52;
  --rose-soft: #fdeef1;
  --rose-line: #f6c8d2;
  --ink: #3a2530;
  --ink-2: #7a6470;
  --bg: #fffaf8;
  --card: #ffffff;
  --gold: #e8b04b;
  --line-green: #06c755;
  --shadow: 0 6px 24px rgba(58, 37, 48, .08);
  --radius: 18px;
}
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; }
body {
  font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.7;
  max-width: 520px;
  margin: 0 auto;
  min-height: 100vh;
}

/* ---------- 畫面切換 ---------- */
.screen { display: none; animation: fadeIn .35s ease; }
.screen.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- 通用按鈕 ---------- */
.btn-primary, .btn-line {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; border: none; border-radius: 999px;
  font-family: inherit; font-weight: 700; cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn-primary:active, .btn-line:active { transform: scale(.97); }
.btn-primary {
  background: linear-gradient(135deg, #e8637c, var(--rose));
  color: #fff; font-size: 18px; padding: 16px 20px;
  box-shadow: 0 8px 20px rgba(217, 79, 104, .35);
}
.btn-xl { font-size: 19px; padding: 18px 22px; animation: pulse 2.2s ease-in-out infinite; }
@keyframes pulse {
  0%, 100% { box-shadow: 0 8px 20px rgba(217, 79, 104, .35); }
  50% { box-shadow: 0 8px 30px rgba(217, 79, 104, .6); }
}
.btn-icon { font-size: 22px; }
.btn-line {
  background: var(--line-green); color: #fff; font-size: 18px;
  box-shadow: 0 8px 20px rgba(6, 199, 85, .35);
}
.line-logo {
  background: #fff; color: var(--line-green);
  font-weight: 900; font-size: 14px; padding: 2px 8px; border-radius: 6px;
}
/* WhatsApp 按鈕：直接開 wa.me 對話（不走派號，故不套用 pulse 動畫） */
.btn-wa {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; border: none; border-radius: 999px;
  font-family: inherit; font-weight: 700; cursor: pointer;
  background: #25d366; color: #fff; font-size: 17px; padding: 15px 20px;
  box-shadow: 0 8px 20px rgba(37, 211, 102, .32);
  transition: transform .15s ease, box-shadow .15s ease;
  margin-top: 12px; text-decoration: none; white-space: nowrap;
}
.btn-wa:active { transform: scale(.97); }
.wa-logo {
  width: 26px; height: 26px; border-radius: 50%; background: #fff;
  display: flex; align-items: center; justify-content: center; flex: none;
}
.wa-logo svg { width: 15px; height: 15px; }

/* ---------- Hero ---------- */
.hero {
  text-align: center; padding: 52px 24px 40px;
  background:
    radial-gradient(circle at 85% 8%, #ffe4ea 0%, transparent 42%),
    radial-gradient(circle at 10% 90%, #fff2e0 0%, transparent 40%),
    linear-gradient(180deg, #fff7f4, var(--bg));
  border-bottom: 1px solid var(--rose-line);
}
.hero-badge {
  display: inline-block; font-size: 13px; font-weight: 700; color: var(--rose-deep);
  background: var(--rose-soft); border: 1px solid var(--rose-line);
  border-radius: 999px; padding: 5px 14px; margin-bottom: 18px;
}
.hero-title { font-size: 30px; font-weight: 900; line-height: 1.35; letter-spacing: .5px; }
.hero-title em { font-style: normal; color: var(--rose); }
.hero-sub { margin: 16px auto 26px; max-width: 400px; font-size: 15.5px; color: var(--ink-2); }
.hero-sub .hl { color: var(--rose); font-weight: 700; }
.hero-sub b { color: var(--ink); }
.hero-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; margin-top: 16px; font-size: 12.5px; color: var(--ink-2); }

/* ---------- 區塊 ---------- */
.section { padding: 40px 20px; }
.section-alt { background: #fff; border-top: 1px solid #f3e7e2; border-bottom: 1px solid #f3e7e2; }
.sec-title { text-align: center; font-size: 22px; font-weight: 900; margin-bottom: 24px; }
.sec-title::after {
  content: ""; display: block; width: 36px; height: 4px; border-radius: 4px;
  background: var(--rose); margin: 10px auto 0;
}

/* 痛點 */
.pain-list { display: grid; gap: 10px; }
.pain-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border: 1px solid #f3e7e2; border-radius: 14px;
  padding: 14px 16px; font-size: 15px;
}
.pain-ic { font-size: 20px; flex: none; }
.pain-note {
  margin-top: 20px; text-align: center; font-size: 15.5px; color: var(--ink-2);
  background: var(--rose-soft); border-radius: 14px; padding: 14px;
}
.pain-note b { color: var(--rose-deep); }

/* 價值卡 */
.value-grid { display: grid; gap: 14px; }
.value-card {
  background: var(--card); border-radius: var(--radius); padding: 20px;
  box-shadow: var(--shadow); text-align: center;
}
.value-ic { font-size: 34px; margin-bottom: 8px; }
.value-card h3 { font-size: 16.5px; margin-bottom: 6px; }
.value-card p { font-size: 14px; color: var(--ink-2); }

/* 步驟 */
.steps { list-style: none; display: grid; gap: 16px; counter-reset: s; }
.steps li { display: flex; gap: 14px; align-items: flex-start; }
.step-num {
  flex: none; width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, #e8637c, var(--rose));
  color: #fff; font-weight: 900; display: flex; align-items: center; justify-content: center;
}
.steps b { display: block; font-size: 16px; }
.steps p { font-size: 13.5px; color: var(--ink-2); }

/* 見證 */
.testi-grid { display: grid; gap: 14px; }
.testi { background: var(--card); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.testi-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.avatar {
  width: 44px; height: 44px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 900; color: #fff;
}
.av1 { background: #b2637a; } .av2 { background: #7a63b2; } .av3 { background: #6388b2; }
.testi-meta b { display: block; font-size: 14px; }
.testi-meta span { font-size: 12.5px; color: var(--ink-2); }
.testi p { font-size: 14.5px; color: #554150; }
.testi-note { text-align: center; font-size: 12px; color: #b0a3ab; margin-top: 14px; }

/* FAQ */
.faq {
  background: var(--card); border: 1px solid #f3e7e2; border-radius: 14px;
  padding: 14px 16px; margin-bottom: 10px;
}
.faq summary { font-weight: 700; font-size: 15px; cursor: pointer; list-style: none; position: relative; padding-right: 24px; }
.faq summary::after {
  content: "+"; position: absolute; right: 0; top: 0;
  color: var(--rose); font-weight: 900; font-size: 18px;
}
.faq[open] summary::after { content: "–"; }
.faq p { margin-top: 8px; font-size: 14px; color: var(--ink-2); }

/* 底部 CTA */
.final-cta { text-align: center; padding: 48px 24px 32px; background: linear-gradient(180deg, var(--bg), #fdeef1); }
.final-cta h2 { font-size: 22px; font-weight: 900; margin-bottom: 22px; }
.final-cta h2 b { color: var(--rose); }
.final-note { margin-top: 14px; font-size: 13.5px; color: var(--ink-2); }
.page-footer { text-align: center; font-size: 11.5px; color: #c2b5bc; padding: 18px 20px 32px; }
/* 浮動條浮出時才預留底部空間，避免平時頁尾留大白 */
body.on-landing.show-sticky .page-footer { padding-bottom: 90px; }

/* 浮動 CTA —— 讀到頁面中段才浮出，避免與首屏按鈕同時出現 */
.sticky-cta {
  position: fixed; bottom: 0; left: 50%;
  transform: translateX(-50%) translateY(115%);
  width: 100%; max-width: 520px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: rgba(255, 250, 248, .92); backdrop-filter: blur(10px);
  border-top: 1px solid var(--rose-line); z-index: 50;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: transform .34s cubic-bezier(.22,.68,.32,1), opacity .28s ease, visibility .34s;
  will-change: transform, opacity;
}
body.on-landing.show-sticky .sticky-cta {
  transform: translateX(-50%) translateY(0);
  opacity: 1; visibility: visible; pointer-events: auto;
}
body:not(.on-landing) .sticky-cta { display: none; }
@media (prefers-reduced-motion: reduce) {
  .sticky-cta { transition: opacity .2s ease; transform: translateX(-50%) translateY(0); }
}

/* ================= 測試 ================= */
#quiz { min-height: 100vh; display: none; flex-direction: column; }
#quiz.active { display: flex; }
.quiz-top {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 12px;
  background: var(--bg); padding: 14px 16px;
  border-bottom: 1px solid #f3e7e2;
}
.quiz-back {
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--rose-line);
  background: #fff; color: var(--rose); font-size: 18px; font-weight: 900; cursor: pointer; flex: none;
}
.quiz-progress { flex: 1; height: 10px; background: #f3e2e2; border-radius: 99px; overflow: hidden; }
.quiz-progress-bar {
  height: 100%; width: 0; border-radius: 99px;
  background: linear-gradient(90deg, #e8637c, var(--rose));
  transition: width .4s ease;
}
.quiz-count { font-size: 13px; font-weight: 700; color: var(--rose); flex: none; }
.quiz-body { padding: 28px 20px 40px; animation: fadeIn .3s ease; }
.quiz-tag {
  display: inline-block; font-size: 12px; font-weight: 700; color: #fff;
  background: var(--rose); border-radius: 99px; padding: 3px 12px; margin-bottom: 12px;
}
.quiz-q h2 { font-size: 21px; font-weight: 900; line-height: 1.5; margin-bottom: 6px; }
.quiz-hint { font-size: 13.5px; color: var(--ink-2); margin-bottom: 24px; }
.quiz-options { display: grid; gap: 12px; }
.opt {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border: 2px solid #f0e2e0; border-radius: 16px;
  padding: 16px; font-size: 15.5px; font-weight: 500; cursor: pointer;
  font-family: inherit; text-align: left; color: var(--ink);
  transition: all .15s ease; animation: fadeIn .3s ease backwards;
}
.opt:nth-child(1) { animation-delay: .02s; } .opt:nth-child(2) { animation-delay: .07s; }
.opt:nth-child(3) { animation-delay: .12s; } .opt:nth-child(4) { animation-delay: .17s; }
.opt:active { transform: scale(.97); }
.opt.selected { border-color: var(--rose); background: var(--rose-soft); }
.opt .opt-radio {
  flex: none; width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid #dcc7ce; position: relative;
}
.opt.selected .opt-radio { border-color: var(--rose); }
.opt.selected .opt-radio::after {
  content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--rose);
}

/* ================= 分析中 ================= */
#analyzing.active { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.an-box { text-align: center; padding: 40px 30px; width: 100%; }
.an-ring {
  position: relative; width: 96px; height: 96px; margin: 0 auto 22px;
}
.an-ring-spin {
  position: absolute; inset: 0; border-radius: 50%;
  border: 5px solid var(--rose-soft); border-top-color: var(--rose);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.an-ring-emoji { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 34px; }
.an-box h2 { font-size: 20px; margin-bottom: 24px; }
.an-steps { list-style: none; text-align: left; max-width: 280px; margin: 0 auto; display: grid; gap: 12px; }
.an-steps li {
  font-size: 14.5px; color: #c7b9c0; padding-left: 30px; position: relative;
  transition: color .3s ease;
}
.an-steps li::before {
  content: "○"; position: absolute; left: 4px; color: #d9cbd2; font-size: 15px;
}
.an-steps li.on { color: var(--ink); font-weight: 700; }
.an-steps li.on::before { content: "●"; color: var(--rose); }
.an-steps li.done { color: var(--rose); }
.an-steps li.done::before { content: "✓"; color: var(--rose); font-weight: 900; }

/* ================= 結果 ================= */
.result-head { text-align: center; padding: 44px 24px 20px; }
.result-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 54px; height: 54px; border-radius: 50%;
  background: linear-gradient(135deg, #e8b04b, #d99330);
  color: #fff; font-size: 26px; font-weight: 900; margin-bottom: 10px;
  box-shadow: 0 6px 18px rgba(217, 147, 48, .4);
}
.result-head h2 { font-size: 24px; font-weight: 900; color: var(--rose); }
.result-head p { font-size: 14px; color: var(--ink-2); margin-top: 4px; }

.score-card { margin: 8px 20px 18px; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 26px 20px; text-align: center; }
.score-ring { position: relative; width: 170px; height: 170px; margin: 0 auto 18px; }
.score-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: #f6e3e3; stroke-width: 11; }
.ring-val { fill: none; stroke: var(--rose); stroke-width: 11; stroke-linecap: round; stroke-dasharray: 326.7; stroke-dashoffset: 326.7; transition: stroke-dashoffset 1.6s ease; }
.score-num {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; line-height: 1.1;
}
.score-num b { font-size: 52px; font-weight: 900; color: var(--rose); }
.score-num i { font-style: normal; font-size: 20px; color: var(--rose); font-weight: 700; margin-left: 2px; }
.score-num em { font-style: normal; font-size: 12.5px; color: var(--ink-2); margin-top: 6px; }
.score-summary { font-size: 14.5px; color: #554150; text-align: left; }

.dim-card { margin: 0 20px 18px; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px 20px; }
.dim-card h3, .insight-card h3, .cta-card h3 { font-size: 17px; margin-bottom: 16px; }
.dim-row { margin-bottom: 14px; }
.dim-row:last-child { margin-bottom: 0; }
.dim-top { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 5px; }
.dim-top b { font-weight: 700; }
.dim-top span { color: var(--ink-2); font-size: 13px; }
.dim-bar { height: 10px; background: #f3e2e2; border-radius: 99px; overflow: hidden; }
.dim-fill { height: 100%; width: 0; border-radius: 99px; transition: width 1.2s ease; }

.insight-card { margin: 0 20px 18px; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px 20px; }
.insight-item { display: flex; gap: 12px; margin-bottom: 14px; }
.insight-item:last-child { margin-bottom: 0; }
.insight-dot {
  flex: none; width: 26px; height: 26px; border-radius: 50%;
  background: var(--rose-soft); color: var(--rose); font-size: 13px; font-weight: 900;
  display: flex; align-items: center; justify-content: center; margin-top: 2px;
}
.insight-item p { font-size: 14px; color: #554150; }

.cta-card {
  margin: 0 20px 18px; padding: 24px 20px;
  background: linear-gradient(160deg, #fff, var(--rose-soft));
  border: 2px solid var(--rose-line); border-radius: var(--radius);
  text-align: center;
}
.cta-head { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 14px; }
.cta-av {
  width: 48px; height: 48px; border-radius: 50%; background: var(--rose);
  display: flex; align-items: center; justify-content: center; font-size: 22px;
  overflow: hidden;
}
.cta-av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cta-head b { display: block; font-size: 15px; }
.cta-head div { text-align: left; }
.cta-online { font-size: 12px; color: var(--line-green); font-weight: 700; }
.cta-card h3 { font-size: 19px; font-weight: 900; }
.cta-card > p { font-size: 14px; color: #554150; margin-bottom: 18px; text-align: left; }
.cta-card > p strong { color: var(--rose-deep); }
/* LINE 專屬諮詢編號提示（引導用戶進 LINE 後發送系統自動帶出的編號） */
.cta-line-hint { margin: 12px auto 0; max-width: 300px; font-size: 12px; line-height: 1.6; color: #6b7a8f; text-align: center; }
.cta-scarcity { margin-top: 14px; font-size: 12.5px; color: var(--rose-deep); font-weight: 700; }

.risk-note { margin: 0 20px 24px; background: #fff8ec; border: 1px solid #f0dcae; border-radius: 14px; padding: 16px; }
.risk-note h4 { font-size: 14.5px; margin-bottom: 6px; color: #9a7520; }
.risk-note p { font-size: 13.5px; color: #7d6a45; }

/* 桌面微調 */
@media (min-width: 521px) {
  body { box-shadow: 0 0 60px rgba(58, 37, 48, .06); }
}
