:root {
  --bg: #f7f4f5;
  --card: rgba(255, 255, 255, 0.86);
  --text: #2b3340;
  --muted: #6c7280;
  --line: #eadfe4;
  --pink: #c45b77;
  --pink-2: #f5d7df;
  --pink-soft: #fff1f5;
  --blue: #526b98;
  --blue-2: #dde7f5;
  --blue-soft: #f2f6fc;
  --shadow: 0 24px 70px rgba(89, 70, 78, 0.13);
  --radius: 28px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100%; }
body {
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(circle at 12% 2%, rgba(255, 218, 229, 0.88), transparent 28%),
    radial-gradient(circle at 86% 10%, rgba(214, 228, 255, 0.9), transparent 26%),
    linear-gradient(180deg, #fbfafb 0%, var(--bg) 100%);
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.48; }

.app-shell {
  width: min(100%, 760px);
  margin: 0 auto;
  padding: 16px 14px 56px;
}

.top-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 58px;
  padding: 0 6px;
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 900;
  color: #59606d;
  letter-spacing: 0.02em;
}
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 11px;
  color: white;
  background: linear-gradient(135deg, #d66b86, #90a5d0);
  box-shadow: 0 10px 24px rgba(196, 91, 119, 0.25);
}

.ghost-icon {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 16px;
  color: #8b8f98;
  background: rgba(255,255,255,0.46);
  font-size: 22px;
}
.ghost-icon:hover { background: rgba(255,255,255,0.8); }

.screen { display: none; }
.screen.active { display: block; animation: screenIn 0.22s ease both; }
@keyframes screenIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.card {
  background: var(--card);
  border: 1px solid rgba(255,255,255,0.72);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hero-card, .quiz-card, .result-card { padding: clamp(20px, 5vw, 34px); }
.hero-card { margin-top: 16px; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--pink);
  background: var(--pink-soft);
  border: 1px solid var(--pink-2);
  font-size: 13px;
  font-weight: 800;
}
.eyebrow.small { margin: 0 0 10px; padding: 7px 10px; font-size: 12px; }

h1, h2, h3, p { margin: 0; }
.hero-card h1 {
  margin-top: 22px;
  max-width: 650px;
  font-size: clamp(34px, 8vw, 56px);
  line-height: 1.06;
  letter-spacing: -0.055em;
}
.subcopy {
  margin-top: 18px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.85;
}
.hero-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 26px;
}
.mini-panel {
  min-height: 120px;
  padding: 18px;
  border-radius: 22px;
  background: rgba(255,255,255,0.62);
  border: 1px solid var(--line);
}
.mini-panel strong { display: block; font-size: 15px; color: #3f4650; }
.mini-panel p { margin-top: 8px; color: var(--muted); line-height: 1.65; font-size: 14px; }
.hero-actions, .quiz-actions, .result-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 26px;
}
.btn {
  min-height: 48px;
  padding: 0 18px;
  border-radius: 16px;
  border: 1px solid transparent;
  font-weight: 900;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn.primary {
  color: white;
  background: linear-gradient(135deg, #c45b77, #8fa3cc);
  box-shadow: 0 16px 30px rgba(196, 91, 119, 0.24);
}
.btn.secondary {
  color: #59606d;
  background: rgba(255,255,255,0.76);
  border-color: var(--line);
}
.fine-print { margin-top: 18px; color: #969aa4; font-size: 13px; line-height: 1.7; }

.quiz-card { margin-top: 16px; }
.quiz-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.quiz-head h2 { font-size: clamp(22px, 5vw, 30px); line-height: 1.32; letter-spacing: -0.03em; }
.counter {
  flex: 0 0 auto;
  padding: 8px 12px;
  border-radius: 999px;
  color: #79808d;
  background: rgba(255,255,255,0.66);
  font-weight: 900;
}
.progress {
  height: 10px;
  background: #f1e9ed;
  border-radius: 999px;
  overflow: hidden;
  margin: 22px 0;
}
.progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #d56c87, #7d96c4);
  transition: width .22s ease;
}
.question-box { border: 0; padding: 0; margin: 0; }
.question-box legend {
  display: block;
  width: 100%;
  padding: 20px;
  border-radius: 22px;
  background: rgba(255,255,255,0.66);
  border: 1px solid var(--line);
  font-size: 19px;
  font-weight: 900;
  line-height: 1.55;
}
.options { display: grid; gap: 12px; margin-top: 16px; }
.option {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 12px;
  align-items: center;
  min-height: 58px;
  width: 100%;
  text-align: left;
  padding: 13px 15px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.68);
  color: #525967;
}
.option:hover { border-color: #d0a1b1; background: #fff; }
.option.selected {
  border-color: rgba(196, 91, 119, 0.5);
  background: linear-gradient(180deg, #fff6f9, #ffffff);
  box-shadow: 0 10px 24px rgba(196, 91, 119, 0.1);
}
.option .key {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  color: var(--pink);
  background: var(--pink-soft);
  font-weight: 900;
}
.quiz-actions { justify-content: space-between; }
.quiz-actions .btn { min-width: 112px; }

.result-card { margin-top: 16px; }
.result-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.result-heading h2 { font-size: clamp(22px, 5vw, 32px); letter-spacing: -0.03em; }
.page-pill {
  flex: 0 0 auto;
  padding: 8px 10px;
  border-radius: 12px;
  background: #f2f3f6;
  color: #9196a1;
  font-weight: 900;
}
.trait-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 24px;
}
.trait-tile {
  min-height: 122px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  border-radius: 22px;
  border: 1px solid;
}
.trait-tile span { font-size: 14px; font-weight: 900; opacity: 0.75; }
.trait-tile strong { font-size: clamp(28px, 8vw, 44px); line-height: 1; }
.trait-tile.good { color: var(--pink); background: #fff4f7; border-color: #f1d6de; }
.trait-tile.bad { color: var(--blue); background: #f4f7fc; border-color: #dce5f3; }
.summary-line { margin-top: 18px; color: #526072; line-height: 1.75; font-weight: 700; }
.score-pill {
  width: fit-content;
  margin: 20px auto 0;
  padding: 12px 22px;
  border-radius: 999px;
  color: var(--pink);
  background: #fff3f6;
  border: 1px solid #f2d4dd;
  font-weight: 900;
}
.divider { height: 1px; background: var(--line); margin: 26px 0; }
.section-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.section-title-row h3 { font-size: 24px; letter-spacing: -0.03em; }
.section-title-row p { color: var(--muted); margin-top: 8px; line-height: 1.6; }
.legend { display: grid; gap: 8px; font-size: 12px; color: #838995; font-weight: 800; }
.legend span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.legend i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.legend-good { background: var(--pink); }
.legend-bad { background: var(--blue); }
#radarCanvas { width: 100%; height: auto; display: block; margin-top: 10px; }

.profile-section {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 14px;
  margin-top: 12px;
}
.profile-card, .advice-card {
  padding: 18px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.66);
}
.profile-kicker { color: var(--pink); font-size: 13px; font-weight: 900; margin-bottom: 8px; }
.profile-card h3 { font-size: 24px; margin-bottom: 8px; }
.profile-card p, .advice-card p:last-child { color: #626977; line-height: 1.78; }
.dimension-list { display: grid; gap: 12px; margin-top: 18px; }
.dimension-item {
  display: grid;
  grid-template-columns: 88px 1fr 44px;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.6);
}
.dimension-name { font-weight: 900; }
.dimension-value { font-weight: 900; text-align: right; }
.bar {
  position: relative;
  height: 9px;
  background: #edf0f5;
  border-radius: 999px;
  overflow: hidden;
}
.bar span { display: block; height: 100%; border-radius: inherit; }
.dimension-item.positive .bar span { background: linear-gradient(90deg, #f5b1c1, var(--pink)); }
.dimension-item.negative .bar span { background: linear-gradient(90deg, #b9c8e2, var(--blue)); }
.dimension-item.positive .dimension-value, .dimension-item.positive .dimension-name { color: var(--pink); }
.dimension-item.negative .dimension-value, .dimension-item.negative .dimension-name { color: var(--blue); }

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%) translateY(20px);
  max-width: calc(100% - 36px);
  padding: 12px 16px;
  border-radius: 999px;
  color: #fff;
  background: rgba(43, 51, 64, 0.92);
  box-shadow: 0 18px 40px rgba(0,0,0,0.18);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
  font-weight: 800;
  font-size: 14px;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 620px) {
  .app-shell { padding-left: 10px; padding-right: 10px; }
  .hero-grid, .trait-pair, .profile-section { grid-template-columns: 1fr; }
  .section-title-row { display: block; }
  .legend { grid-template-columns: repeat(2, max-content); margin-top: 12px; }
  .dimension-item { grid-template-columns: 76px 1fr 40px; gap: 9px; padding: 12px; }
  .hero-actions .btn, .result-actions .btn { flex: 1 1 160px; }
}
