/* 家庭模式测评 v3 · VI：藕荷紫＋金框 · 思源宋体标题 / 思源黑体正文 */
:root {
  --bg-center: #FCF9FD;
  --bg-edge: #E0D2ED;
  --text-main: #3D2B5E;
  --text-sub: #6B5E7A;
  --gold: #C4A35A;
  --gold-bright: #F5D76E;
  --card-bg: #FFFFFF;
  --selected-bg: #FBF5E6;
  --radius: 18px;
  --shadow: 0 4px 18px rgba(61, 43, 94, 0.08);
}

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

html, body { height: 100%; }

body {
  font-family: "Source Han Sans SC", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text-main);
  background:
    radial-gradient(120% 90% at 50% 0%, var(--bg-center) 0%, var(--bg-edge) 100%) fixed,
    var(--bg-center);
  line-height: 1.5;
}

h1, h2, .serif {
  font-family: "Source Han Serif SC", "Noto Serif SC", "Songti SC", "SimSun", serif;
  font-weight: 700;
}

#app { min-height: 100dvh; display: flex; flex-direction: column; }

.page {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: max(20px, env(safe-area-inset-top)) 22px max(20px, env(safe-area-inset-bottom));
  animation: fadein 0.25s ease;
}
@keyframes fadein { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.hidden { display: none !important; }

/* ---------- 通用组件 ---------- */
.btn {
  display: block;
  min-height: 48px;
  padding: 12px 24px;
  border: none;
  border-radius: 999px;
  font-size: 17px;
  letter-spacing: 2px;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-block { width: 100%; }
.btn-gold {
  background: linear-gradient(135deg, var(--gold-bright), var(--gold));
  color: var(--text-main);
  font-weight: 600;
  box-shadow: 0 6px 16px rgba(196, 163, 90, 0.35);
}
.btn-ghost {
  background: rgba(255, 255, 255, 0.7);
  color: var(--text-main);
  border: 1px solid rgba(196, 163, 90, 0.5);
}

.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}

.page-title { font-size: 26px; text-align: center; margin: 26px 0 8px; }
.page-hint { text-align: center; color: var(--text-sub); font-size: 14px; margin-bottom: 18px; }

.page-footer {
  margin-top: auto;
  padding-top: 28px;
  text-align: center;
  font-size: 12px;
  color: var(--text-sub);
  letter-spacing: 3px;
}

/* ---------- P0 欢迎页 ---------- */
.page-welcome {
  text-align: center;
  background:
    linear-gradient(180deg, rgba(252, 249, 253, 0.30) 0%, rgba(252, 249, 253, 0.05) 55%, rgba(224, 210, 237, 0.10) 100%),
    url("../assets/封面底图.jpg") center bottom / cover no-repeat,
    radial-gradient(120% 90% at 50% 0%, var(--bg-center) 0%, var(--bg-edge) 100%);
}
.welcome-top {
  margin-top: 9vh;
  color: var(--gold);
  font-size: 15px;
  letter-spacing: 6px;
  font-weight: 600;
}
.welcome-main { margin-top: 7vh; }
.welcome-title { font-size: 42px; line-height: 1.35; letter-spacing: 4px; }
.gold-divider {
  width: 72px; height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  margin: 26px auto 18px;
}
.welcome-sub { color: var(--text-sub); font-size: 15px; letter-spacing: 1px; }
.welcome-bottom { margin-top: auto; padding-top: 40px; }
.welcome-meta {
  margin-top: 14px; font-size: 13px; color: var(--text-main);
  text-shadow: 0 1px 6px rgba(252, 249, 253, 0.8);
}
/* 欢迎页底部压在水彩深色区，落款改浅色保证可读 */
.page-welcome .page-footer {
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 1px 4px rgba(61, 43, 94, 0.35);
}

/* ---------- P1 知情同意 ---------- */
.consent-card { margin: 12px 0 22px; font-size: 15px; }
.consent-card p + p { margin-top: 12px; }
.consent-detail { font-size: 13px; color: var(--text-sub); line-height: 1.7; }

.check-row {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 4px; margin-bottom: 16px;
  font-size: 15px; cursor: pointer; user-select: none;
}
.check-row input { display: none; }
.check-box {
  width: 22px; height: 22px; flex: 0 0 22px;
  border: 2px solid var(--gold); border-radius: 6px;
  background: #fff; position: relative; transition: background 0.15s;
}
.check-row input:checked + .check-box { background: var(--gold); }
.check-row input:checked + .check-box::after {
  content: ""; position: absolute; left: 6px; top: 2px;
  width: 5px; height: 10px;
  border: solid #fff; border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* ---------- P2 基本信息 ---------- */
.form-card { display: flex; flex-direction: column; gap: 20px; margin-bottom: 6px; }
.field-label { display: block; font-size: 14px; color: var(--text-sub); margin-bottom: 8px; }
.field input {
  width: 100%; min-height: 46px;
  border: 1px solid #E4DAF0; border-radius: 12px;
  padding: 10px 14px; font-size: 16px;
  background: #FBF9FE; color: var(--text-main);
  outline: none;
}
.field input:focus { border-color: var(--gold); background: #fff; }
.field-row { display: flex; gap: 12px; }
.field.half { flex: 1; }
.other-input { margin-top: 10px; }

.chip-group { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  min-height: 44px; padding: 8px 18px;
  border: 1px solid #E4DAF0; border-radius: 999px;
  background: #FBF9FE; color: var(--text-main);
  font-size: 15px; cursor: pointer; transition: all 0.15s;
}
.chip.selected {
  border: 2px solid var(--gold);
  background: var(--selected-bg);
  font-weight: 600;
}

.form-error { color: #C0564F; font-size: 14px; margin: 10px 2px 4px; text-align: center; }
#btn-profile-next { margin-top: 14px; }

/* ---------- P3 测评题 ---------- */
.page-quiz { padding-left: 18px; padding-right: 18px; }
.quiz-header { padding-top: 6px; }
.quiz-brand { text-align: center; font-size: 13px; color: var(--text-sub); letter-spacing: 1px; margin-bottom: 14px; }
.progress-track {
  height: 8px; border-radius: 999px; overflow: hidden;
  background: #E4DAF0;
}
.progress-fill {
  height: 100%; width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--gold), var(--gold-bright));
  transition: width 0.3s ease;
}
.progress-text { margin-top: 8px; font-size: 13px; color: var(--text-sub); }

.quiz-body { flex: 1; padding-top: 20px; }
.quiz-section { font-size: 13px; color: var(--gold); letter-spacing: 2px; margin-bottom: 8px; min-height: 18px; }
.quiz-stem { font-size: 21px; line-height: 1.5; margin-bottom: 20px; }

.options { display: flex; flex-direction: column; gap: 12px; }
.option {
  display: flex; align-items: center; gap: 12px;
  background: var(--card-bg);
  border: 1.5px solid rgba(196, 163, 90, 0.25);
  border-radius: 14px;
  padding: 13px 14px;
  font-size: 16px; line-height: 1.5;
  cursor: pointer; user-select: none;
  transition: border-color 0.15s, background 0.15s;
  min-height: 44px;
}
.option-letter {
  flex: 0 0 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 999px;
  background: #F1EBFA; color: var(--text-main);
  font-size: 14px; font-weight: 600;
}
.option.selected {
  border: 2px solid var(--gold);
  background: var(--selected-bg);
}
.option.selected .option-letter { background: var(--gold); color: #fff; }
.option .option-check { margin-left: auto; color: var(--gold); font-weight: 700; opacity: 0; }
.option.selected .option-check { opacity: 1; }

.quiz-nav { display: flex; gap: 12px; padding: 18px 0 8px; }
.quiz-nav .btn { flex: 1; min-height: 46px; font-size: 16px; letter-spacing: 1px; }

/* ---------- P4 提交中 ---------- */
.page-submitting { align-items: center; justify-content: center; }
.spinner {
  width: 46px; height: 46px;
  border: 4px solid #E4DAF0;
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.submitting-text { margin-top: 20px; color: var(--text-sub); font-size: 15px; letter-spacing: 2px; }

/* ---------- P5 回执页 ---------- */
.page-receipt { align-items: center; text-align: center; padding-top: 10vh; }
.receipt-ring { margin-bottom: 26px; }
.receipt-title { font-size: 24px; line-height: 1.6; margin-bottom: 12px; }
.receipt-line { color: var(--text-sub); font-size: 16px; margin-bottom: 26px; }
.receipt-promise { font-size: 15px; line-height: 1.8; width: 100%; margin-bottom: 30px; }
.receipt-promise strong { color: var(--gold); }

.receipt-qr { width: 100%; margin-bottom: 18px; }
.qr-box {
  width: 150px; height: 150px;
  margin: 0 auto 12px;
  background: #fff;
  border: 1.5px solid rgba(196, 163, 90, 0.5);
  border-radius: 14px;
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.qr-box img { width: 100%; height: 100%; object-fit: contain; }
.qr-placeholder { color: var(--text-sub); font-size: 13px; text-align: center; line-height: 1.6; }
.qr-placeholder-icon { color: var(--gold); font-size: 26px; margin-bottom: 4px; }
.qr-tip { font-size: 14px; color: var(--text-sub); }

.receipt-id { font-size: 13px; color: var(--text-sub); margin-top: 6px; letter-spacing: 1px; }

/* 小屏适配（320px 级） */
@media (max-width: 360px) {
  .welcome-title { font-size: 34px; }
  .quiz-stem { font-size: 19px; }
  .page { padding-left: 16px; padding-right: 16px; }
}
