/* ============================================================
   Peachup 蜜桃測驗 — 樣式
   設計系統見 DESIGN.md（Soft Studio：暖桃漸層 + 霧面玻璃圓角卡片 +
   磚紅 terracotta 主色 + 柔和藥丸標籤 + 圓潤現代）
   ============================================================ */

:root {
  /* 色彩 */
  --terracotta: #c24a38;        /* 主色：磚紅 — 按鈕、選取、強調、日期 */
  --terracotta-deep: #a23a2b;   /* 主色加深：漸層／hover */
  --rose: #b0726e;              /* LOGO 暗玫瑰：副標、wordmark */
  --ink: #3f2d28;              /* 主要文字：深暖棕 */
  --ink-soft: #846b63;         /* 次要文字 */
  --butter: #f6e0a0;           /* 標籤底：奶油黃（中／一般） */
  --butter-ink: #946f1f;       /* 奶油標籤文字 */
  --coral: #ee8a72;            /* 標籤底：珊瑚（緊急／強調） */
  --green: #46c08a;            /* 成功（已儲存） */

  /* 霧面玻璃卡片 */
  --glass: rgba(255, 252, 250, .58);
  --glass-strong: rgba(255, 252, 250, .82);
  --glass-row: rgba(255, 255, 255, .72);
  --glass-border: rgba(255, 255, 255, .65);
  --shadow: 0 18px 40px -18px rgba(150, 70, 55, .42);
  --shadow-sm: 0 8px 22px -12px rgba(150, 70, 55, .38);
  --radius: 24px;
  --radius-sm: 16px;

  /* 字體：中英文一律思源宋體 */
  --font: "Noto Serif TC", "Source Han Serif TC", "Songti TC", serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font);
  font-weight: 400;
  color: var(--ink);
  /* 暖桃—珊瑚漸層（固定，內容捲動時背景不動） */
  background: linear-gradient(162deg, #f7c7b1 0%, #f3a98d 30%, #f6bca5 55%, #fbe6da 100%) fixed;
  min-height: 100svh;
  -webkit-font-smoothing: antialiased;
}

/* ---------- 畫布 ---------- */
.canvas {
  position: relative;
  min-height: 100svh;
  overflow: hidden;
}

/* ---------- 漂浮蜜桃背景（LOGO 桃子，低調點綴） ---------- */
.bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.bgp {
  position: absolute;
  opacity: .16;
  filter: blur(.3px);
  animation: float 13s ease-in-out infinite alternate;
}

.bgp:nth-child(1) { width: 240px; top: -76px;   left: -64px;  animation-delay: -2s; transform: rotate(-8deg); }
.bgp:nth-child(2) { width: 150px; top: 9%;      right: -46px; animation-delay: -5s; transform: rotate(6deg); }
.bgp:nth-child(3) { width: 104px; top: 46%;     left: -28px;  animation-delay: -8s; }
.bgp:nth-child(4) { width: 290px; bottom: -104px; right: -84px; animation-delay: -3s; transform: rotate(-5deg); }
.bgp:nth-child(5) { width: 86px;  bottom: 13%;  left: 7%;     animation-delay: -9s; opacity: .12; }
.bgp:nth-child(6) { width: 124px; top: 60%;     right: 11%;   animation-delay: -6s; opacity: .12; }

@keyframes float {
  from { translate: 0 -10px; }
  to   { translate: 0 13px; }
}

@media (max-width: 640px) {
  .bgp:nth-child(6) { display: none; }
}

/* ---------- 進度線 ---------- */
.progress-track {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: rgba(255, 252, 250, .4);
  z-index: 30;
}

.progress-fill {
  height: 100%;
  width: 0;
  background: var(--terracotta);
  border-radius: 0 99px 99px 0;
  transition: width .4s ease;
}

/* ---------- 頂部：LOGO + wordmark ---------- */
.site-top {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 26px 0;
  pointer-events: none;
}

.site-top .logo {
  width: clamp(58px, 7vw, 78px);
  height: auto;
  pointer-events: auto;
}

.site-top .wordmark {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .32em;
  color: var(--terracotta);
  line-height: 1.5;
}

.site-top .wordmark small {
  display: block;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: .3em;
  color: var(--ink-soft);
}

.site-label {
  position: absolute;
  left: 50%;
  top: 28px;
  transform: translateX(-50%);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .34em;
  color: var(--ink);
  pointer-events: none;
}

/* ---------- 常駐「官網」按鈕（固定右上，所有畫面可見） ---------- */
.to-site {
  position: fixed;
  top: 18px;
  right: 20px;
  z-index: 40;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 17px;
  border-radius: 99px;
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  backdrop-filter: blur(16px) saturate(1.3);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-sm);
  color: var(--terracotta);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .14em;
  text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease, background .15s, color .15s;
}

.to-site svg { width: 15px; height: 15px; }

.to-site:hover {
  transform: translateY(-1px);
  background: linear-gradient(135deg, var(--terracotta), var(--terracotta-deep));
  color: #fff7f3;
  border-color: transparent;
  box-shadow: 0 14px 24px -12px rgba(162, 58, 43, .7);
}

@media (max-width: 480px) {
  .to-site { top: 14px; right: 14px; padding: 8px 14px; font-size: 12.5px; }
}

/* ---------- 版面 ---------- */
#app {
  position: relative;
  z-index: 10;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 108px 22px 60px;
}

.screen {
  width: 100%;
  max-width: 520px;
  animation: fadeUp .42s cubic-bezier(.22, .9, .3, 1) both;
}

.screen.leaving { animation: fadeOut .18s ease both; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }

/* ---------- 霧面玻璃卡片 ---------- */
.glass,
.block,
.intro-note,
.photo-frame,
.result-foot {
  background: var(--glass);
  -webkit-backdrop-filter: blur(20px) saturate(1.3);
  backdrop-filter: blur(20px) saturate(1.3);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow);
}

/* ---------- 小標 ---------- */
.kicker {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .3em;
  color: var(--terracotta);
  text-align: center;
  margin: 0 0 16px;
}

.kicker .num { font-style: italic; letter-spacing: .16em; }

/* ---------- 藥丸按鈕（主要動作） ---------- */
.btn {
  font-family: var(--font);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 15px 40px;
  border: none;
  border-radius: 99px;
  background: linear-gradient(135deg, var(--terracotta), var(--terracotta-deep));
  color: #fff7f3;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .14em;
  cursor: pointer;
  box-shadow: 0 14px 26px -12px rgba(162, 58, 43, .8);
  transition: transform .16s ease, box-shadow .16s ease, opacity .16s;
}

.btn:hover { transform: translateY(-2px); box-shadow: 0 18px 30px -12px rgba(162, 58, 43, .85); }
.btn:active { transform: translateY(0) scale(.98); }
.btn:disabled { opacity: .4; cursor: not-allowed; transform: none; box-shadow: var(--shadow-sm); }

.btn-sm { padding: 12px 30px; font-size: 14.5px; }

/* ---------- 文字連結（次要動作） ---------- */
.text-cta {
  background: none;
  border: none;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .2em;
  color: var(--ink-soft);
  cursor: pointer;
  padding: 6px 4px;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color .15s, border-color .15s;
}

.text-cta:hover { color: var(--terracotta); border-color: var(--terracotta); }

/* ---------- 相框 ---------- */
.photo-frame {
  padding: 14px;
  border-radius: var(--radius);
  display: inline-block;
}

.photo-frame .inner {
  background: linear-gradient(155deg, #fbcdbd, #f3a48f);
  border-radius: calc(var(--radius) - 8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.photo-frame img { display: block; width: 100%; height: auto; filter: drop-shadow(0 6px 10px rgba(150, 70, 55, .2)); }

/* ---------- 開始頁 ---------- */
.intro { max-width: 900px; text-align: center; }

.intro-grid {
  display: grid;
  grid-template-columns: 1fr clamp(170px, 22vw, 210px) 1fr;
  gap: clamp(16px, 3.4vw, 38px);
  align-items: center;
  margin-bottom: 8px;
}

.intro-note {
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  font-size: 13px;
  line-height: 1.95;
  text-align: left;
  max-width: 250px;
  box-shadow: var(--shadow-sm) !important;
}

.intro-note .nlabel {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .26em;
  color: var(--terracotta);
  margin-bottom: 8px;
}

.intro-note.right { justify-self: end; align-self: start; margin-top: 16px; }
.intro-note.left  { justify-self: start; align-self: end; margin-bottom: 16px; }

.intro h1 {
  font-size: clamp(46px, 11vw, 88px);
  font-weight: 700;
  letter-spacing: .14em;
  color: var(--terracotta);
  margin: 20px 0 6px;
  line-height: 1.12;
  text-shadow: 0 8px 18px rgba(162, 58, 43, .18);
}

.intro .title-accent {
  display: block;
  font-size: clamp(15px, 2.4vw, 22px);
  font-style: italic;
  font-weight: 600;
  letter-spacing: .42em;
  margin-top: 4px;
  color: var(--rose);
}

.intro .cta-row {
  margin-top: 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

@media (max-width: 720px) {
  .intro-grid { grid-template-columns: 1fr; justify-items: center; }
  .intro-note, .intro-note.right, .intro-note.left {
    max-width: 320px;
    text-align: center;
    justify-self: center;
    align-self: auto;
    margin: 0;
  }
  .intro-note .nlabel { text-align: center; }
  .intro-grid .photo-frame { order: -1; width: clamp(170px, 50vw, 210px); }
}

/* ---------- 題目頁 ---------- */
.q-title {
  text-align: center;
  font-size: clamp(22px, 5.4vw, 30px);
  font-weight: 700;
  line-height: 1.55;
  color: var(--ink);
  margin: 0 0 12px;
  letter-spacing: .04em;
}

.q-hint {
  text-align: center;
  font-size: 12px;
  letter-spacing: .16em;
  color: var(--ink-soft);
  margin: 0 0 24px;
}

.q-hint .tag {
  display: inline-block;
  background: var(--butter);
  color: var(--butter-ink);
  font-weight: 700;
  padding: 3px 12px;
  font-size: 11px;
  letter-spacing: .18em;
  border-radius: 99px;
  margin-right: 10px;
}

.options { display: grid; gap: 11px; }

.opt {
  font-family: var(--font);
  text-align: left;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.6;
  color: var(--ink);
  background: var(--glass-row);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 15px 20px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform .14s ease, background .14s, color .14s, box-shadow .14s;
  display: flex;
  align-items: center;
  gap: 13px;
}

.opt .num {
  font-style: italic;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--terracotta);
  letter-spacing: .06em;
  flex: 0 0 24px;
}

.opt .mark {
  margin-left: auto;
  font-size: 13px;
  color: transparent;
  flex: 0 0 auto;
  transition: color .14s;
}

.opt:hover { transform: translateY(-2px); box-shadow: 0 14px 26px -14px rgba(150, 70, 55, .5); }

.opt.selected {
  background: linear-gradient(135deg, var(--terracotta), var(--terracotta-deep));
  border-color: transparent;
  color: #fff7f3;
}

.opt.selected .num { color: #ffe0d4; }
.opt.selected .mark { color: #fff7f3; }

.q-actions {
  margin-top: 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.next-count {
  font-size: 11.5px;
  letter-spacing: .2em;
  color: var(--ink-soft);
  margin: -8px 0 0;
}

/* ---------- 結果頁 ---------- */
.result {
  max-width: 560px;
  display: grid;
  gap: 18px;
  padding-bottom: 24px;
}

.block { border-radius: var(--radius); padding: clamp(22px, 4.5vw, 30px); }

.result-hero { text-align: center; }

.result-hero .photo-frame { width: clamp(150px, 36vw, 184px); margin: 6px auto 16px; }

.result-hero h2 {
  font-size: clamp(28px, 6.5vw, 38px);
  font-weight: 700;
  letter-spacing: .1em;
  color: var(--terracotta);
  margin: 6px 0 16px;
}

.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }

.chip {
  background: rgba(238, 138, 114, .18);
  color: var(--terracotta);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .1em;
  padding: 6px 15px;
  border-radius: 99px;
}

.sec-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .28em;
  color: var(--ink-soft);
  margin: 0 0 20px;
  text-align: center;
}

.sec-title::after { content: ""; display: block; width: 30px; height: 2px; border-radius: 2px; background: var(--terracotta); margin: 11px auto 0; }

/* 雷達圖 */
.radar-wrap { display: flex; justify-content: center; }
.radar-wrap svg { width: min(340px, 86vw); height: auto; }

.score-bars { display: grid; gap: 12px; margin-top: 12px; }

.score-row {
  display: grid;
  grid-template-columns: 78px 1fr 46px;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}

.score-row .lbl { font-weight: 600; letter-spacing: .06em; }

.score-row .track { height: 8px; background: rgba(255, 255, 255, .55); border-radius: 99px; overflow: hidden; }

.score-row .fill {
  height: 100%;
  background: linear-gradient(90deg, var(--coral), var(--terracotta));
  border-radius: 99px;
  width: 0;
  transition: width .9s cubic-bezier(.3, .8, .3, 1);
}

.score-row .pct { font-style: italic; font-weight: 600; font-size: 13px; color: var(--terracotta); text-align: right; }

/* 主要/次要膚況 */
.cond-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.cond {
  padding: 18px 14px;
  text-align: center;
  border-radius: var(--radius-sm);
  background: var(--glass-row);
  border: 1px solid var(--glass-border);
}

.cond.primary {
  background: linear-gradient(140deg, var(--coral), var(--terracotta));
  border-color: transparent;
  color: #fff7f3;
  box-shadow: 0 14px 26px -14px rgba(162, 58, 43, .8);
}

.cond .cap { font-size: 11px; letter-spacing: .26em; opacity: .82; margin-bottom: 8px; font-weight: 700; }
.cond .val { font-size: 16px; font-weight: 700; letter-spacing: .06em; line-height: 1.5; }

/* 推薦產品 */
.products { display: grid; gap: 10px; }

.product {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: var(--ink);
  background: var(--glass-row);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 15px 18px;
  box-shadow: var(--shadow-sm);
  transition: transform .14s ease, box-shadow .14s;
}

.product .p-num { font-style: italic; font-size: 12.5px; font-weight: 600; color: var(--terracotta); flex: 0 0 24px; align-self: flex-start; padding-top: 2px; }

.product .p-name { font-weight: 700; font-size: 15.5px; letter-spacing: .04em; color: var(--terracotta); }

.product .p-desc { font-size: 12.5px; line-height: 1.6; margin-top: 3px; color: var(--ink-soft); }

.product .p-arrow { margin-left: auto; color: var(--terracotta); font-size: 17px; align-self: center; }

.product:hover { transform: translateY(-2px); box-shadow: 0 16px 28px -14px rgba(150, 70, 55, .55); }

/* 回覆 + Email 表單 */
.form-note { font-size: 13px; line-height: 1.95; text-align: center; margin: -6px 0 18px; color: var(--ink-soft); }

.field { display: grid; gap: 8px; margin-bottom: 16px; }

.field label { font-size: 11.5px; font-weight: 700; letter-spacing: .22em; }

.field textarea,
.field input {
  font-family: var(--font);
  font-size: 14.5px;
  color: var(--ink);
  background: rgba(255, 255, 255, .6);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 13px 16px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  width: 100%;
}

.field textarea { min-height: 100px; resize: vertical; line-height: 1.8; }

.field textarea:focus,
.field input:focus { border-color: var(--terracotta); box-shadow: 0 0 0 3px rgba(194, 74, 56, .14); }

.field ::placeholder { color: rgba(132, 107, 99, .6); }

.submit-wrap { text-align: center; margin-top: 22px; }

.form-error { color: var(--terracotta); font-size: 12.5px; letter-spacing: .08em; text-align: center; margin: 14px 0 0; min-height: 1em; }

.success { text-align: center; padding: 8px 0 4px; }

.success .s-peach { width: 80px; margin: 0 auto 4px; display: block; filter: drop-shadow(0 8px 12px rgba(150, 70, 55, .25)); }

.success h3 { font-size: 18px; font-weight: 700; letter-spacing: .12em; color: var(--terracotta); margin: 12px 0; }

.success p { font-size: 13.5px; line-height: 1.95; margin: 0; color: var(--ink-soft); }

/* 結果頁底部 */
.result-foot {
  border-radius: var(--radius);
  padding: 22px;
  text-align: center;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px 22px;
  box-shadow: var(--shadow-sm) !important;
}

@media (prefers-reduced-motion: reduce) {
  .bgp { animation: none; }
  .screen { animation-duration: .01s; }
}
