:root {
  --bg1: #fffafd;
  --bg2: #fff1f6;
  --surface: rgba(255,255,255,.7);
  --text: #5d2d44;
  --text-soft: rgba(93,45,68,.74);
  --text-faint: rgba(93,45,68,.55);
  --pink: #e56f9f;
  --pink-soft: #f3aecb;
  --gold: #d8a064;
  --line: rgba(202,122,153,.16);
  --shadow: 0 22px 55px rgba(210,131,162,.16);
  --radius-xl: 28px;
  --radius-md: 18px;
  --max-width: 430px;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255,206,225,.78), transparent 28%),
    radial-gradient(circle at 82% 14%, rgba(244,214,160,.42), transparent 22%),
    linear-gradient(180deg, var(--bg1), var(--bg2) 54%, #fff9fb);
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  border-radius: 50%;
  filter: blur(22px);
  opacity: .5;
  z-index: 0;
  pointer-events: none;
  animation: aura 14s ease-in-out infinite;
}

body::before {
  width: 220px;
  height: 220px;
  top: -70px;
  left: -70px;
  background: rgba(245,157,196,.35);
}

body::after {
  width: 240px;
  height: 240px;
  right: -90px;
  bottom: 10vh;
  background: rgba(230,191,133,.26);
  animation-direction: reverse;
}

.access-gate {
  position: fixed;
  inset: 0;
  z-index: 99;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(255, 245, 249, 0.78);
  backdrop-filter: blur(12px);
}

.access-gate.active { display: flex; }

.gate-card {
  width: min(100%, 360px);
  padding: 26px 22px;
  border-radius: 26px;
  background: rgba(255,255,255,.92);
  border: 1px solid rgba(255,255,255,.8);
  box-shadow: var(--shadow);
  text-align: center;
}

.gate-title {
  font-size: 20px;
  font-weight: 700;
  color: #8f3557;
  margin-bottom: 12px;
}

.gate-text {
  margin: 0 0 16px;
  color: var(--text-soft);
  line-height: 1.8;
  font-size: 14px;
}

.app {
  position: relative;
  z-index: 1;
  width: min(100%, var(--max-width));
  min-height: 100vh;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top, 0px) + 16px) 16px calc(env(safe-area-inset-bottom, 0px) + 24px);
}

.page { display: none; animation: rise .45s ease; }
.page.active { display: flex; flex-direction: column; gap: 16px; }

.glass {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid rgba(255,255,255,.62);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.glass::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,.38), transparent 34%, transparent 68%, rgba(255,240,246,.35));
  pointer-events: none;
}

.cover {
  min-height: calc(100vh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 40px);
  padding: 24px 20px 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
}

.badge, .tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 12px;
  color: var(--text-soft);
  background: rgba(255,255,255,.58);
  border: 1px solid rgba(230,191,133,.42);
}

.badge::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(180deg, #edc182, var(--gold));
  box-shadow: 0 0 12px rgba(230,191,133,.6);
}

.hero { position: relative; padding-top: 6px; }

.title {
  margin: 18px 0 0;
  font-size: clamp(38px, 10vw, 52px);
  line-height: .95;
  letter-spacing: .03em;
  color: #8f3557;
  text-shadow: 0 10px 30px rgba(253,219,233,.8);
}

.title span {
  display: block;
  margin-top: 10px;
  font-size: clamp(22px, 6vw, 28px);
  line-height: 1.1;
  color: #b45d84;
  letter-spacing: .22em;
  text-transform: uppercase;
}

.subtitle, .helper {
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.8;
}

.subtitle { margin: 18px 0 0; }
.hearts { position: absolute; inset: 0; pointer-events: none; }

.heart {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 3px;
  background: rgba(246,153,192,.42);
  transform: rotate(45deg);
  animation: heart 7.5s ease-in-out infinite;
}

.heart::before,
.heart::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: inherit;
}

.heart::before { left: -7px; }
.heart::after { top: -7px; }
.h1 { top: 12px; right: 26px; }
.h2 { top: 90px; right: 94px; width: 10px; height: 10px; animation-delay: -2.5s; }
.h2::before, .h2::after { width: 10px; height: 10px; }
.h2::before { left: -5px; }
.h2::after { top: -5px; }
.h3 { top: 150px; right: 32px; animation-delay: -4s; }

.metrics, .entry-stack, .grid, .list { display: grid; gap: 12px; }
.metrics { grid-template-columns: repeat(3, 1fr); gap: 10px; }

.metric, .option, .block, .portrait, .dimension-row {
  border-radius: var(--radius-md);
  background: rgba(255,255,255,.62);
  border: 1px solid rgba(255,255,255,.55);
}

.metric { padding: 14px 8px 12px; text-align: center; }
.metric strong { display: block; margin-bottom: 4px; font-size: 20px; color: #ab4f77; }
.metric span { display: block; font-size: 12px; color: var(--text-faint); line-height: 1.55; }

.entry {
  width: 100%;
  border: 1px solid rgba(230,191,133,.28);
  border-radius: 24px;
  background: linear-gradient(140deg, rgba(255,255,255,.74), rgba(255,244,248,.86));
  padding: 18px 18px 18px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 16px 28px rgba(219,145,173,.12);
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}

.entry:hover, .entry:active {
  transform: translateY(-2px);
  box-shadow: 0 20px 38px rgba(219,145,173,.18);
  border-color: rgba(229,111,159,.3);
}

.orb {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: #fff;
  font-size: 24px;
  background: linear-gradient(180deg, #f7a2bf, #e2709f);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 14px 24px rgba(226,112,159,.3);
}

.entry.alt .orb {
  background: linear-gradient(180deg, #f0c486, #d59561);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 14px 24px rgba(213,149,97,.24);
}

.entry-copy strong { display: block; margin-bottom: 6px; font-size: 18px; color: #8f3557; }
.entry-copy span { display: block; font-size: 13px; line-height: 1.7; color: var(--text-soft); }

.arrow {
  margin-left: auto;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,.72);
  color: #af5a80;
  border: 1px solid var(--line);
  font-size: 20px;
}

.note { text-align: center; padding: 14px 16px; font-size: 12px; line-height: 1.8; color: var(--text-faint); }

.topbar, .progress-top, .section-head, .duo-names, .chips, .bar-label, .portrait-head, .score-wrap {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.topbar { padding: 6px 4px 0; }
.progress-top { align-items: flex-start; margin-bottom: 10px; }

.ghost, .cta { appearance: none; cursor: pointer; border-radius: 18px; border: 0; }
.ghost { padding: 9px 14px; background: rgba(255,255,255,.58); border: 1px solid var(--line); color: #a44c73; font-size: 12px; }
.panel, .result-panel, .chart-panel, .share-panel { padding: 18px; }
.name-title, .result-title { margin: 0 0 8px; color: #96395f; }
.name-title { font-size: 22px; }
.result-title { font-size: 28px; line-height: 1.22; }

.input {
  width: 100%;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(202,122,153,.22);
  background: rgba(255,255,255,.76);
  color: var(--text);
  font-size: 16px;
  outline: none;
}

.input:focus {
  border-color: rgba(229,111,159,.42);
  box-shadow: 0 0 0 4px rgba(243,174,203,.14);
}

.cta {
  width: 100%;
  padding: 16px 18px;
  background: linear-gradient(135deg, #ef8fb4, #df6b9e 58%, #d39364 100%);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  box-shadow: 0 18px 32px rgba(225,112,159,.28);
}

.cta.secondary {
  color: #a84b72;
  background: rgba(255,255,255,.8);
  border: 1px solid var(--line);
  box-shadow: 0 12px 20px rgba(214,154,177,.12);
}

.bar-track, .mini-track { width: 100%; overflow: hidden; border-radius: 999px; background: rgba(202,122,153,.09); }
.bar-track { height: 10px; }
.mini-track { height: 9px; }
.bar-fill, .fill { height: 100%; border-radius: inherit; }
.bar-fill {
  width: 0;
  background: linear-gradient(90deg, var(--pink-soft), var(--pink) 62%, #dfb26f);
  box-shadow: 0 0 18px rgba(229,111,159,.4);
  transition: width .25s ease;
}

.question-box { display: grid; gap: 14px; }
.kicker {
  width: fit-content;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255,247,250,.9);
  border: 1px solid rgba(202,122,153,.12);
  color: #be6289;
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.question-text { margin: 0; font-size: 24px; line-height: 1.42; color: #6b2948; }
.option { width: 100%; padding: 16px; text-align: left; cursor: pointer; transition: transform .2s ease, border-color .2s ease, background .2s ease; }
.option:hover, .option:active { transform: translateY(-2px); border-color: rgba(229,111,159,.3); background: rgba(255,247,250,.94); }
.code {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 28px;
  height: 28px;
  margin-right: 10px;
  border-radius: 50%;
  background: rgba(248,228,237,.85);
  color: #c15f88;
  font-size: 12px;
  font-weight: 700;
  vertical-align: middle;
}

.quote { display: grid; gap: 12px; }
.quote-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 22px;
  color: #dd7aa2;
  background: rgba(252,234,242,.92);
}
.quote-text { margin: 0; font-size: 15px; line-height: 1.9; }
.quote-author { font-size: 12px; color: var(--text-faint); letter-spacing: .08em; }

.match-wrap { justify-content: center; min-height: calc(100vh - 40px); }
.match-panel { padding: 28px 20px 24px; text-align: center; }
.orbit { position: relative; width: 210px; height: 210px; margin: 6px auto 20px; }

.ring, .pulse, .avatar, .core {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
}

.ring { width: 210px; height: 210px; border: 1px solid rgba(229,111,159,.18); animation: spin 16s linear infinite; }
.ring::before, .ring::after {
  content: "";
  position: absolute;
  left: 50%;
  width: 12px;
  height: 12px;
  transform: translateX(-50%);
  border-radius: 50%;
}
.ring::before { top: 16px; background: linear-gradient(180deg, var(--pink-soft), var(--pink)); box-shadow: 0 0 18px rgba(229,111,159,.6); }
.ring::after { bottom: 16px; background: linear-gradient(180deg, #f3d39e, var(--gold)); box-shadow: 0 0 18px rgba(216,160,100,.46); }
.pulse { width: 146px; height: 146px; background: radial-gradient(circle, rgba(255,206,226,.4), transparent 65%); animation: pulse 2.6s ease-in-out infinite; }
.core {
  width: 96px;
  height: 96px;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, rgba(255,255,255,.94), rgba(255,245,249,.76));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.7), 0 16px 30px rgba(227,138,173,.2);
  color: #c15d89;
  font-size: 34px;
}

.avatar {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 28px;
  font-weight: 700;
  box-shadow: 0 16px 24px rgba(225,112,159,.24);
}

.avatar.a { top: 24%; left: 24%; background: linear-gradient(180deg, #f499bb, #dd6d9d); animation: bob 4.8s ease-in-out infinite; }
.avatar.b { top: 76%; left: 76%; background: linear-gradient(180deg, #efcf9f, #d79a63); animation: bob 5.4s ease-in-out infinite reverse; }

.dots { display: inline-flex; gap: 8px; margin-top: 8px; }
.dots span { width: 8px; height: 8px; border-radius: 50%; background: #de7da4; animation: blink 1.2s ease-in-out infinite; }
.dots span:nth-child(2) { animation-delay: .2s; }
.dots span:nth-child(3) { animation-delay: .4s; }

.score-hero { padding: 20px 18px; display: grid; gap: 18px; background: linear-gradient(180deg, rgba(255,248,251,.92), rgba(255,241,246,.9)); }
.ringbox { position: relative; }
.score-ring { width: 138px; height: 138px; }
.score-ring circle { fill: none; stroke-width: 10; transform-origin: 50% 50%; transform: rotate(-90deg); }
.score-ring .bg { stroke: rgba(202,122,153,.12); }
.score-ring .fg { stroke: url(#scoreGradient); stroke-linecap: round; stroke-dasharray: 345.6; stroke-dashoffset: 345.6; transition: stroke-dashoffset .9s ease; filter: drop-shadow(0 8px 16px rgba(230,126,169,.32)); }

.score-center { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.score-value { font-size: 34px; font-weight: 800; color: #a2446d; line-height: 1; }
.score-label { margin-top: 6px; font-size: 12px; color: var(--text-faint); letter-spacing: .14em; }

.score-copy { flex: 1; }
.score-copy strong { display: block; margin-bottom: 8px; font-size: 22px; color: #96395f; }
.score-copy p { margin: 0; font-size: 14px; line-height: 1.85; color: var(--text-soft); }

.chip { padding: 9px 12px; border-radius: 999px; background: rgba(255,255,255,.76); border: 1px solid var(--line); font-size: 12px; color: #a54d73; }
.panel-grid { display: grid; gap: 16px; }
.chart-panel canvas { width: 100%; display: block; }
.section-title { margin: 0; font-size: 18px; color: #96385e; }
.section-sub { margin-top: 4px; font-size: 12px; color: var(--text-faint); line-height: 1.6; }

.dimension-row, .block { padding: 14px; border: 1px solid var(--line); }
.dimension-row { display: grid; gap: 10px; }
.dimension-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.dimension-name { margin: 0; font-size: 15px; color: #943e63; }
.dimension-copy, .block p, .portrait-copy { margin: 0; font-size: 13px; line-height: 1.8; color: var(--text-soft); }
.dimension-copy { margin-top: 4px; font-size: 12px; color: var(--text-faint); }
.dimension-score { font-size: 14px; font-weight: 700; color: #ba5b84; }
.bar-label { font-size: 12px; color: var(--text-faint); margin-bottom: 4px; }
.fill.a { background: linear-gradient(90deg, #f4a4c2, #e36e9f); }
.fill.b { background: linear-gradient(90deg, #f1d19c, #d79a64); }

.portrait {
  position: relative;
  padding: 18px;
  border: 1px solid rgba(230,191,133,.32);
  background: linear-gradient(180deg, rgba(255,255,255,.86), rgba(255,247,250,.74));
  overflow: hidden;
}

.portrait::before {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: 18px;
  border: 1px solid rgba(230,191,133,.28);
  pointer-events: none;
}

.portrait-head strong { font-size: 22px; color: #8b3153; }
.portrait-head span { font-size: 12px; color: var(--text-faint); letter-spacing: .12em; }
.portrait-score { display: flex; align-items: baseline; gap: 10px; margin: 14px 0; }
.portrait-score strong { font-size: 44px; line-height: 1; color: #b14974; }
.portrait-score span { font-size: 14px; color: var(--text-faint); }
.duo-chip { padding: 8px 14px; border-radius: 999px; background: rgba(255,255,255,.66); border: 1px solid var(--line); font-size: 14px; color: var(--text-soft); }

@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }
@keyframes aura { 0%,100% { transform: translate3d(0,0,0); } 50% { transform: translate3d(16px,18px,0); } }
@keyframes heart { 0%,100% { transform: rotate(45deg) translateY(0); opacity: .4; } 50% { transform: rotate(45deg) translateY(-12px); opacity: .9; } }
@keyframes pulse { 0%,100% { transform: translate(-50%,-50%) scale(.96); opacity: .6; } 50% { transform: translate(-50%,-50%) scale(1.08); opacity: 1; } }
@keyframes spin { from { transform: translate(-50%,-50%) rotate(0deg); } to { transform: translate(-50%,-50%) rotate(360deg); } }
@keyframes bob { 0%,100% { transform: translate(-50%,-50%) translateY(0); } 50% { transform: translate(-50%,-50%) translateY(-10px); } }
@keyframes blink { 0%,100% { opacity: .28; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-3px); } }

@media (min-width: 720px) {
  .cover { min-height: 860px; }
  .panel-grid.two { grid-template-columns: 1fr 1fr; }
}
