/* 恋爱吸引力测评 · 柔雾粉 / 浅紫 / 香槟金 / 宋体标题，移动端优先 */
:root {
  --bg: #FBF8F6;
  --brand: #C7839F;
  --brand-deep: #A5627F;
  --title: #493D4A;
  --body: #665D68;
  --muted: #9A9099;
  --card: #FFFFFF;
  --pink: #F7EAF0;
  --purple: #EEEAF5;
  --gold: #D5B77F;
  --line: #EEE7E9;
  --shadow: 0 10px 30px rgba(73, 61, 74, .06);
  --shadow-lift: 0 16px 40px rgba(199, 131, 159, .16);
  /* 主题变量：默认是品牌色，报告页按主维度覆盖 */
  --accent: var(--brand);
  --accent-deep: var(--brand-deep);
  --accent-mid: #E6BFD0;
  --accent-soft: var(--pink);
  --cover-to: var(--purple);
  --serif: "Songti SC", "STSong", "SimSun", "Noto Serif CJK SC", "Source Han Serif SC", serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
}
.theme-WARM  { --accent: #DDA15E; --accent-deep: #A86F33; --accent-mid: #F3D3A8; --accent-soft: #FCF0E2; --cover-to: #F9E6E1; }
.theme-SPARK { --accent: #D47390; --accent-deep: #AE4E6C; --accent-mid: #F0C0CE; --accent-soft: #FAE6EC; --cover-to: #F7E4EC; }
.theme-FUN   { --accent: #E58C76; --accent-deep: #B4614E; --accent-mid: #F6CBBE; --accent-soft: #FDEDE7; --cover-to: #FBF1DC; }
.theme-MYST  { --accent: #9583C2; --accent-deep: #6C5A9C; --accent-mid: #D3CAE8; --accent-soft: #EEEAF5; --cover-to: #F3E7F0; }
.theme-SAFE  { --accent: #7FA58C; --accent-deep: #557C63; --accent-mid: #C7DCCD; --accent-soft: #E8F1EA; --cover-to: #F4EFE4; }
.theme-SOUL  { --accent: #7C9AC6; --accent-deep: #52719E; --accent-mid: #C8D5EA; --accent-soft: #E7EDF7; --cover-to: #EEEAF5; }
/* 内敛型（-IN）在同一主题上偏柔和、偏紫调 */
.theme-WARM-IN  { --accent: #D1956A; --cover-to: #EFE8F2; }
.theme-SPARK-IN { --accent: #C97A98; --cover-to: #EEE6F4; }
.theme-FUN-IN   { --accent: #D98B83; --cover-to: #EFE7F2; }
.theme-MYST-IN  { --accent: #8A82BE; --cover-to: #E6E9F5; }
.theme-SAFE-IN  { --accent: #78A096; --cover-to: #E9EEF2; }
.theme-SOUL-IN  { --accent: #8494C6; --cover-to: #ECE6F4; }

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--bg); color: var(--body); font: 16px/1.75 var(--sans);
  overflow-x: hidden; -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: default; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; margin: 0; letter-spacing: .02em; color: var(--title); }
p { margin: 0 0 .9em; }
body > header {
  display: flex; justify-content: space-between; align-items: center;
  max-width: 960px; width: 100%; margin: 0 auto;
  padding: max(14px, env(safe-area-inset-top)) max(22px, env(safe-area-inset-right)) 14px max(22px, env(safe-area-inset-left));
  font-size: 13px; color: var(--muted);
}
.brand { display: inline-flex; align-items: center; min-height: 44px; font-family: var(--serif); font-size: 18px; color: var(--title); text-decoration: none; }
.brand::before { content: "♡"; margin-right: 6px; color: var(--brand); }
/* 题卡滑入动画会短暂超出右边缘，裁掉横向溢出以免撑宽移动端视口 */
main { flex: 1; width: 100%; max-width: 960px; margin: 0 auto; padding: 16px 22px 48px; overflow-x: hidden; overflow-x: clip; }
footer {
  text-align: center; font-size: 12px; color: var(--muted);
  padding: 20px 24px max(20px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line);
}
body[data-view="quiz"] footer { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
.muted { color: var(--muted); }
.note { font-size: 13px; color: var(--muted); }
.eyebrow { margin: 0 0 10px; font: 12px/1.4 Georgia, serif; letter-spacing: .22em; color: var(--gold); }

/* 按钮 */
.primary {
  display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 0 36px;
  border: 0; border-radius: 14px; background: var(--brand); color: #fff; font-size: 17px; letter-spacing: .1em;
  box-shadow: 0 10px 24px rgba(199, 131, 159, .3); transition: transform .2s, box-shadow .2s, background .2s;
}
.primary:hover { transform: translateY(-2px); background: var(--brand-deep); box-shadow: 0 14px 28px rgba(199, 131, 159, .34); }
.primary:active { transform: translateY(0); }
.ghost {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 22px;
  border: 1px solid var(--accent-mid); border-radius: 14px; background: var(--card); color: var(--accent-deep); font-size: 15px;
  transition: border-color .2s, background .2s;
}
.ghost:hover { border-color: var(--accent); background: var(--accent-soft); }
.textbtn { min-height: 44px; min-width: 44px; padding: 0 6px; border: 0; background: none; color: var(--brand-deep); font-size: 15px; }
.textbtn:disabled { color: #D9D1D5; }

/* SVG 插画与符号 */
.art { display: block; width: 100%; height: auto; }
.art .halo { fill: var(--accent-soft); }
.art .halo-2 { fill: #fff; opacity: .7; }
.art .ring { fill: none; stroke: var(--gold); stroke-width: 1; stroke-dasharray: 2 6; opacity: .8; }
.s-main { fill: var(--accent); }
.s-soft { fill: var(--accent-mid); }
.s-gold { fill: var(--gold); }
.s-line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; }
.sym { display: block; width: 28px; height: 28px; flex: none; }

/* 首页 */
.hero { display: grid; grid-template-columns: .9fr 1.1fr; gap: 40px; align-items: center; padding: 32px 0 40px; }
.hero-art { max-width: 340px; margin: 0 auto; animation: float 6s ease-in-out infinite; }
.hero h1 { font-size: 42px; line-height: 1.35; }
.hero h1 span { font-size: .6em; color: var(--body); font-weight: 400; }
.hero h1 em { font-style: normal; color: var(--brand); }
.intro { margin: 18px 0 28px; color: var(--body); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.start-note { margin: 14px 0 0; font-size: 13px; color: var(--muted); }
.info { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.info > div {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 18px 8px;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); text-align: center;
}
.info strong { font: 400 28px/1.2 Georgia, var(--serif); color: var(--brand); white-space: nowrap; }
.info strong span { font-family: var(--serif); font-size: 13px; margin-left: 2px; color: var(--body); }
.info small { font-size: 13px; color: var(--muted); }
.home-line { margin: 36px 0 8px; text-align: center; font-family: var(--serif); font-size: 18px; color: var(--title); }
.home-line::before, .home-line::after { content: "·"; margin: 0 10px; color: var(--gold); }
.home-privacy { text-align: center; font-size: 12px; color: var(--muted); }
/* 答题 */
.quiz { max-width: 640px; margin: 0 auto; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 14px; }
.row > span:last-child { flex: none; font: 15px/1 Georgia, serif; color: var(--title); }
.progress { height: 6px; margin: 12px 0 24px; background: var(--line); border-radius: 6px; overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #E6BFD0, var(--brand)); border-radius: 6px; transition: width .3s ease; }
.qcard { padding: 26px 22px; background: var(--card); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); }
.qcard.enter { animation: slide-in .32s ease both; }
.qcard.from-left { animation-name: slide-in-left; }
.quiz h2 { font-size: 22px; line-height: 1.55; margin-bottom: 20px; outline: none; overflow-wrap: anywhere; }
.options { display: grid; gap: 12px; }
.option {
  display: flex; align-items: flex-start; gap: 12px; width: 100%; min-height: 56px; padding: 14px 16px;
  text-align: left; line-height: 1.6; background: var(--bg); border: 1px solid var(--line); border-radius: 14px;
  overflow-wrap: anywhere; transition: border-color .2s, background .2s, transform .2s;
}
.option b {
  flex: none; width: 26px; height: 26px; display: grid; place-items: center; margin-top: 1px;
  border-radius: 50%; background: #fff; border: 1px solid var(--line); font: 13px/1 Georgia, serif; color: var(--muted);
}
.option:hover:not(:disabled) { border-color: #E6BFD0; transform: translateY(-1px); }
.option.selected { border-color: var(--brand); background: var(--pink); color: var(--title); }
.option.selected b { background: var(--brand); border-color: var(--brand); color: #fff; }
.option:disabled:not(.selected) { opacity: .55; }
.quiz-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  padding: 8px max(18px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
  background: rgba(251, 248, 246, .94); border-top: 1px solid var(--line);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.quiz-nav-inner { max-width: 640px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.quiz-nav .note { text-align: right; }

/* 揭晓 */
.reveal { max-width: 420px; margin: 0 auto; padding: 24px 0 16px; text-align: center; }
.reveal-art { max-width: 200px; margin: 0 auto 12px; animation: pulse 1.6s ease-in-out infinite; }
.reveal.done .reveal-art { animation: none; }
.reveal-text { min-height: 1.8em; font-family: var(--serif); font-size: 18px; color: var(--title); }
.reveal-dims { list-style: none; margin: 18px 0 28px; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.reveal-dims li {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 6px;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; font-size: 13px; color: var(--muted);
  opacity: .4; filter: grayscale(1); transition: opacity .4s, filter .4s, transform .4s, border-color .4s;
}
.reveal-dims li.on { opacity: 1; filter: none; transform: translateY(-2px); border-color: var(--accent-mid); color: var(--title); }
.reveal .primary { animation: rise .4s ease both; }
/* 报告 */
.report { max-width: 680px; margin: 0 auto; display: grid; gap: 18px; }
.cover {
  position: relative; padding: 22px 22px 28px; text-align: center; border-radius: 24px;
  background: linear-gradient(180deg, #fff 0%, var(--cover-to) 100%); border: 1px solid var(--line); box-shadow: var(--shadow-lift);
  overflow: hidden;
}
.cover-top { display: flex; justify-content: space-between; gap: 8px; font: 11px/1.4 Georgia, serif; letter-spacing: .16em; color: var(--gold); }
.cover-sub { margin: 14px 0 0; font-family: var(--serif); font-size: 15px; color: var(--body); }
.cover .art { max-width: 180px; margin: 6px auto 4px; }
.cover-kicker { margin: 0 0 4px; font-size: 13px; color: var(--muted); letter-spacing: .1em; }
.cover h1 { font-size: 32px; line-height: 1.35; color: var(--accent-deep); overflow-wrap: anywhere; }
.tags { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.tags li { padding: 4px 12px; border-radius: 999px; background: rgba(255, 255, 255, .8); border: 1px solid var(--accent-mid); font-size: 13px; color: var(--accent-deep); }
.quote { margin: 18px auto 0; max-width: 26em; font-family: var(--serif); font-size: 16px; color: var(--title); }
.quote::before { content: "「"; color: var(--gold); }
.quote::after { content: "」"; color: var(--gold); }
.score { margin: 18px 0 0; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.score span { font-size: 13px; color: var(--muted); letter-spacing: .1em; }
.score strong { font: 400 52px/1.1 Georgia, var(--serif); color: var(--accent-deep); }

.summary { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.sum-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; padding: 16px;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow);
}
.sum-sym { width: 36px; height: 36px; padding: 6px; margin-bottom: 6px; border-radius: 12px; background: var(--accent-soft); }
.sum-card span { font-size: 12px; color: var(--muted); }
.sum-card b { font-family: var(--serif); font-size: 17px; font-weight: 600; color: var(--accent-deep); overflow-wrap: anywhere; }
.sum-card small { font-size: 12px; color: var(--muted); }

.card, .chapter { padding: 24px 22px; background: var(--card); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); }
.card h2 { font-size: 21px; }
.lead { margin: 4px 0 0; font-size: 14px; color: var(--muted); }
.radar { display: block; width: 100%; max-width: 400px; height: auto; margin: 10px auto 6px; overflow: visible; }
.radar .grid { fill: none; stroke: var(--line); stroke-width: 1; }
.radar .grid:last-of-type { stroke: var(--accent-mid); }
.radar .axis { stroke: var(--line); stroke-width: 1; }
.radar .shape { fill: var(--accent); fill-opacity: .22; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; }
.radar .dot { fill: #fff; stroke: var(--accent); stroke-width: 2; }
.radar .label { font: 13px var(--sans); fill: var(--title); }
.radar .label-v { font-family: Georgia, serif; fill: var(--accent-deep); }
.signals { display: grid; gap: 16px; margin: 10px 0 16px; }
.signal-meta { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.signal-meta span { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; min-width: 0; }
.signal-meta b { font-family: var(--serif); font-size: 16px; color: var(--title); }
.signal-meta em { font-style: normal; font-size: 12px; padding: 1px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-deep); }
.signal-meta small { flex-basis: 100%; font-size: 12px; color: var(--muted); line-height: 1.5; }
.signal-meta strong { flex: none; font: 400 22px/1 Georgia, serif; color: var(--accent-deep); }
.signal-track { height: 8px; margin-top: 8px; background: var(--line); border-radius: 8px; overflow: hidden; }
.signal-track i { display: block; height: 100%; width: 0; border-radius: 8px; background: linear-gradient(90deg, var(--accent-mid), var(--accent)); transition: width .8s ease; }

.chapter { border-radius: 18px; }
.chapter-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 14px; }
.chapter-head > div { min-width: 0; }
.num { flex: none; font: 400 28px/1 Georgia, serif; color: var(--gold); padding-top: 2px; }
.chapter h2 { font-size: 20px; line-height: 1.45; overflow-wrap: anywhere; }
.chapter-body p:last-child { margin-bottom: 0; }
.strengths { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.strengths li { padding: 6px 14px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-deep); font-size: 14px; }
.strengths li::before { content: "✓ "; }
.moment { position: relative; padding: 2px 0 14px 20px; border-left: 2px solid var(--accent-mid); }
.moment::before { content: ""; position: absolute; left: -6px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.moment:last-child { padding-bottom: 0; }
.moment-label { font-size: 12px; color: var(--accent-deep); letter-spacing: .06em; }
.moment h3 { margin: 2px 0 4px; font-size: 17px; }
.moment p { margin: 0; }
.egg-wrap { text-align: center; padding: 8px 0; }
.egg-wrap h2 { font-size: 18px; margin-bottom: 14px; }
.egg {
  display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100%; max-width: 360px; min-height: 150px;
  margin: 0 auto; padding: 22px; border: 1px dashed var(--gold); border-radius: 20px;
  background: linear-gradient(135deg, var(--accent-soft), var(--purple)); color: var(--title);
}
.egg-front, .egg-back { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.egg-front > span { font-size: 34px; line-height: 1; color: var(--accent); animation: pulse 1.8s ease-in-out infinite; }
.egg small { font-size: 13px; color: var(--muted); }
.egg-back b { font-family: var(--serif); font-size: 22px; font-weight: 600; color: var(--accent-deep); }
.egg-back { font-family: var(--serif); font-size: 15px; line-height: 1.7; overflow-wrap: anywhere; }
.egg.open { border-style: solid; background: #fff; cursor: default; animation: flip .5s ease both; }
.report-note { text-align: center; }
.report-end { text-align: center; padding: 8px 0 12px; }
.report-end p { font-family: var(--serif); font-size: 17px; color: var(--title); }
.end-heart { display: block; font-size: 26px; color: var(--accent); }

@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes slide-in { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
@keyframes slide-in-left { from { opacity: 0; transform: translateX(-16px); } to { opacity: 1; transform: none; } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes flip { from { transform: perspective(600px) rotateY(90deg); } to { transform: perspective(600px) rotateY(0); } }

@media (max-width: 680px) {
  .hero { grid-template-columns: 1fr; gap: 12px; padding: 8px 0 28px; text-align: center; }
  .hero-art { max-width: 220px; }
  .hero h1 { font-size: 30px; }
  .actions { flex-direction: column; }
  .actions .primary, .actions .ghost { width: 100%; }
  .info { grid-template-columns: 1fr 1fr; }
  .qcard { padding: 22px 16px; }
  .quiz h2 { font-size: 19px; }
  .card, .chapter { padding: 20px 16px; }
  .cover { padding: 18px 16px 24px; }
  .cover h1 { font-size: 28px; }
  .score strong { font-size: 46px; }
}
@media (max-width: 360px) {
  body > header > span { display: none; }
  main { padding: 12px 14px 40px; }
  .hero h1 { font-size: 26px; }
  .info strong { font-size: 24px; }
  .summary { gap: 8px; }
  .sum-card { padding: 12px; }
  .cover-top { font-size: 10px; letter-spacing: .08em; }
  .cover h1 { font-size: 25px; }
  .radar .label { font-size: 12px; }
  .reveal-dims { gap: 6px; }
  .option { padding: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media print {
  body > header, footer, .quiz-nav, .report-end button { display: none !important; }
  .cover, .card, .chapter, .sum-card { box-shadow: none; break-inside: avoid; }
}
