/* 依恋风格测试 · 视觉系统 */
:root {
  --cream: #FAF7F2;
  --cream-2: #F3EEE4;
  --ink: #2C3E50;
  --ink-soft: #5A5064;
  --ink-muted: #7A6D85;
  --lavender: #9B8AA8;
  --lavender-soft: #C9BFD0;
  --rose: #E8A1A1;
  --mint: #A8C9BA;
  --line: #E5DFD4;
  --card: #FFFFFF;
  --shadow: 0 4px 24px rgba(44, 62, 80, 0.06);
  --radius: 16px;
  --radius-s: 10px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", Helvetica, Arial, "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#app {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 20px 80px;
  min-height: 100vh;
}

/* ------- 通用 ------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px 24px;
  border-radius: 28px;
  border: none;
  font-size: 16px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;
  text-decoration: none;
}
.btn-primary {
  background: var(--ink);
  color: var(--cream);
}
.btn-primary:hover { background: #1F2E3E; transform: translateY(-1px); }
.btn-primary:disabled {
  background: var(--lavender-soft);
  color: #FFF;
  cursor: not-allowed;
  transform: none;
}
.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
  border: 1px solid var(--line);
}
.btn-ghost:hover { background: var(--cream-2); }
.btn-ghost:disabled { color: var(--lavender-soft); cursor: not-allowed; }

/* ------- intro ------- */
.intro-screen { padding-top: 60px; animation: fadein 0.5s ease; }
.intro-eyebrow {
  color: var(--lavender);
  font-size: 13px;
  letter-spacing: 2px;
  margin-bottom: 16px;
}
.intro-title {
  font-size: 44px;
  line-height: 1.25;
  font-weight: 700;
  margin: 0 0 24px;
  letter-spacing: -0.5px;
}
.intro-title em {
  font-style: normal;
  color: var(--rose);
  position: relative;
}
.intro-title em::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 4px;
  height: 8px;
  background: rgba(232, 161, 161, 0.3);
  z-index: -1;
}
.intro-lede {
  font-size: 17px;
  color: var(--ink-soft);
  margin-bottom: 28px;
}
.intro-theory {
  background: var(--cream-2);
  padding: 16px 20px;
  border-radius: var(--radius-s);
  font-size: 13px;
  color: var(--ink-muted);
  line-height: 1.7;
  margin-bottom: 32px;
  border-left: 3px solid var(--lavender);
}
.intro-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 36px;
}
.intro-stats > div {
  background: var(--card);
  padding: 18px 10px;
  border-radius: var(--radius-s);
  text-align: center;
  box-shadow: var(--shadow);
}
.intro-stats strong {
  display: block;
  font-size: 32px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -1px;
}
.intro-stats span {
  font-size: 12px;
  color: var(--ink-muted);
}

.intro-wrap .btn { width: 100%; margin-bottom: 12px; }

.intro-why {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
  margin-top: 24px;
}
.intro-why.show { max-height: 600px; }
.intro-why h3 {
  font-size: 18px;
  margin: 24px 0 12px;
}
.intro-why ul {
  padding-left: 20px;
  color: var(--ink-soft);
}
.intro-why li {
  margin-bottom: 10px;
  line-height: 1.7;
  font-size: 15px;
}

/* ------- quiz ------- */
.quiz-screen {
  padding-top: 24px;
  animation: fadein 0.3s ease;
  min-height: 90vh;
  display: flex;
  flex-direction: column;
}
.quiz-top { margin-bottom: 32px; }
.progress-wrap {
  height: 6px;
  background: var(--line);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 10px;
}
.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--lavender), var(--rose));
  transition: width 0.3s ease;
  border-radius: 3px;
}
.quiz-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--ink-muted);
}
.ctx-chip {
  background: var(--cream-2);
  padding: 4px 12px;
  border-radius: 12px;
  color: var(--lavender);
  font-weight: 500;
}

.quiz-body {
  flex: 1;
}
.q-stem {
  font-size: 22px;
  line-height: 1.55;
  font-weight: 500;
  margin: 0 0 28px;
  color: var(--ink);
}

.opts {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.opt {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 18px;
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  text-align: left;
  font-size: 16px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--ink);
  line-height: 1.55;
}
.opt:hover {
  border-color: var(--lavender-soft);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}
.opt.selected {
  border-color: var(--lavender);
  background: #F7F3F9;
}
.opt-mark {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 14px;
  background: var(--cream-2);
  color: var(--lavender);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  margin-top: 1px;
}
.opt.selected .opt-mark {
  background: var(--lavender);
  color: #FFF;
}
.opt-text { flex: 1; }

/* ------- Likert (科学模式) ------- */
.ctx-chip.sci {
  background: rgba(168, 201, 186, 0.28);
  color: #4A7868;
}
.q-stem.sci {
  font-size: 20px;
  line-height: 1.6;
}
.likert-instr {
  background: var(--cream-2);
  border-left: 3px solid var(--mint);
  padding: 12px 14px;
  border-radius: var(--radius-s);
  font-size: 13px;
  line-height: 1.7;
  color: var(--ink-soft);
  margin-bottom: 20px;
}
.likert-anchors {
  margin-top: 14px;
  padding: 14px 16px;
  background: var(--cream-2);
  border-radius: var(--radius-s);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.anchor-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-soft);
}
.anchor-num {
  flex: 0 0 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--card);
  border: 1.5px solid var(--line);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-muted);
}
.anchor-row:nth-child(1) .anchor-num { border-color: #D7E4DC; color: #4A7868; }
.anchor-row:nth-child(2) .anchor-num { border-color: var(--line); color: var(--ink-muted); }
.anchor-row:nth-child(3) .anchor-num { border-color: #E8CFCF; color: #B86B6B; }
.anchor-text { flex: 1; padding-top: 2px; }
.likert {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-top: 12px;
}
.likert-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 4px 8px;
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s ease;
  min-height: 64px;
}
.likert-btn:hover {
  border-color: var(--lavender-soft);
  transform: translateY(-1px);
}
.likert-btn.selected {
  border-color: var(--lavender);
  background: #F7F3F9;
}
.likert-num {
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
}
.likert-btn.selected .likert-num { color: var(--lavender); }
.likert-lbl {
  font-size: 10px;
  color: var(--ink-muted);
  text-align: center;
  line-height: 1.2;
  min-height: 12px;
}
.likert-axis {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--ink-muted);
  margin-top: 10px;
  padding: 0 2px;
}

.quiz-nav {
  display: flex;
  gap: 12px;
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.quiz-nav .btn { flex: 1; }

/* ------- result ------- */
.result-screen {
  padding-top: 32px;
  animation: fadein 0.5s ease;
}
.result-hero {
  text-align: center;
  padding: 32px 20px;
  margin-bottom: 20px;
  background: linear-gradient(135deg, #FAF7F2 0%, #EDE6F1 100%);
  border-radius: var(--radius);
}
.result-hero .eyebrow {
  color: var(--lavender);
  font-size: 13px;
  letter-spacing: 2px;
  margin-bottom: 12px;
}
.type-name {
  font-size: 42px;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.5px;
}
.type-en {
  color: var(--ink-muted);
  font-size: 14px;
  margin: 4px 0 12px;
  letter-spacing: 1px;
}
.tagline {
  color: var(--ink-soft);
  font-size: 17px;
  margin: 12px auto 0;
  max-width: 480px;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 24px 22px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.card h3 {
  margin: 0 0 16px;
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
}
.card p {
  margin: 0 0 14px;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.75;
}
.card p:last-child { margin-bottom: 0; }

.chart {
  display: block;
  width: 100%;
  margin: 0 auto;
}
.chart.quad { height: 360px; }
.chart.radar { height: 320px; }

.score-row {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}
.score-row > div {
  flex: 1;
  background: var(--cream-2);
  padding: 14px 16px;
  border-radius: var(--radius-s);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.score-row .label { color: var(--ink-muted); font-size: 14px; }
.score-row .val { font-weight: 600; font-size: 16px; color: var(--ink); }

.score-row.sci > div {
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}
.score-row.sci .label {
  font-size: 13px;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.score-row.sci .val {
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.5px;
}
.score-row.sci .pct {
  font-size: 12px;
  color: var(--lavender);
  font-weight: 500;
}

.norm-note {
  font-size: 12px;
  color: var(--ink-muted);
  margin-top: 12px;
  line-height: 1.7;
  padding: 8px 12px;
  background: var(--cream-2);
  border-radius: 8px;
}
.norm-note.muted { background: transparent; padding: 8px 0; }
.norm-note a { color: var(--lavender); font-weight: 500; text-decoration: underline; }

.radar-note {
  font-size: 13px;
  color: var(--ink-muted);
  text-align: center;
  margin-top: 8px;
}

.bullet-list, .script-list, .grow-list {
  margin: 0;
  padding-left: 20px;
  color: var(--ink-soft);
}
.bullet-list li, .script-list li, .grow-list li {
  margin-bottom: 10px;
  line-height: 1.7;
}
.script-list li {
  font-style: italic;
  color: var(--ink);
}

.grow-card { background: #F4FAF7; border: 1px solid #D5E8DF; }
.grow-card h3 { color: #4A7868; }
.grow-note {
  margin-top: 16px;
  padding: 14px 16px;
  background: rgba(168, 201, 186, 0.15);
  border-radius: var(--radius-s);
  font-size: 13px;
  color: #4A7868;
  line-height: 1.7;
}

.share-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: center;
}
.share-hint {
  color: var(--ink-muted);
  font-size: 13px;
  margin-top: 8px;
}

/* ------- gateway (每组开头) ------- */
.gateway-screen {
  padding-top: 40px;
  animation: fadein 0.5s ease;
}
.gateway-wrap {
  max-width: 520px;
  margin: 0 auto;
  text-align: center;
  padding: 0 8px;
}
.gateway-step {
  font-size: 13px;
  color: var(--lavender);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.gateway-title {
  font-size: 40px;
  font-weight: 700;
  margin: 0 0 16px;
  letter-spacing: -0.5px;
  color: var(--ink);
}
.gateway-lede {
  font-size: 17px;
  color: var(--ink-soft);
  margin: 0 0 12px;
  line-height: 1.7;
}
.gateway-lede strong { color: var(--ink); }
.gateway-note {
  font-size: 14px;
  color: var(--ink-muted);
  background: var(--cream-2);
  border-radius: var(--radius-s);
  padding: 12px 16px;
  margin: 0 0 28px;
  line-height: 1.7;
  text-align: left;
}
.gateway-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 36px;
}
.gateway-actions .btn { width: 100%; }
.gateway-roadmap {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
  padding: 16px 18px;
  background: var(--cream-2);
  border-radius: var(--radius-s);
}
.roadmap-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--ink-muted);
}
.roadmap-item .dot {
  width: 10px; height: 10px; border-radius: 50%;
  flex: 0 0 10px;
}
.roadmap-item.active { color: var(--ink); font-weight: 600; }
.roadmap-item.done { color: var(--ink-soft); }
.roadmap-item.done::after { content: '✓'; margin-left: auto; color: #4A7868; }
.roadmap-item.skipped { color: var(--ink-muted); opacity: 0.6; }

/* ------- 结果页: 图例 + 每段关系 breakdown ------- */
.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  justify-content: center;
  margin-top: 10px;
  font-size: 13px;
  color: var(--ink-soft);
}
.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.legend-dot {
  width: 10px; height: 10px; border-radius: 50%;
  display: inline-block;
}

.target-breakdown {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.target-row {
  padding: 14px 16px;
  background: var(--cream-2);
  border-radius: var(--radius-s);
}
.target-row.skipped { opacity: 0.55; }
.target-head {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 10px;
  font-size: 15px;
}
.target-row.skipped .target-head { margin-bottom: 0; }
.target-dot {
  width: 12px; height: 12px; border-radius: 50%;
  flex: 0 0 12px;
}
.target-skip {
  margin-left: auto;
  font-size: 12px;
  color: var(--ink-muted);
  font-weight: 400;
}
.target-bars {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tbar-row {
  display: grid;
  grid-template-columns: 44px 1fr 140px;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--ink-soft);
}
.tbar-lbl { color: var(--ink-muted); }
.tbar {
  background: #F0E9E0;
  height: 10px;
  border-radius: 5px;
  overflow: hidden;
}
.tbar-fill {
  height: 100%;
  border-radius: 5px;
  transition: width 0.4s ease;
}
.tbar-val { text-align: right; color: var(--ink); font-variant-numeric: tabular-nums; }

.result-foot {
  margin-top: 24px;
  padding: 20px;
  font-size: 12px;
  color: var(--ink-muted);
  line-height: 1.8;
  text-align: center;
}
.result-foot p { margin: 0 0 8px; }

/* ------- 动画 ------- */
@keyframes fadein {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ------- 移动端 ------- */
@media (max-width: 420px) {
  .intro-title { font-size: 36px; }
  .type-name { font-size: 36px; }
  .q-stem { font-size: 19px; }
  .q-stem.sci { font-size: 18px; }
  .card { padding: 20px 18px; }
  #app { padding: 0 16px 60px; }
  .likert { gap: 4px; }
  .likert-btn { padding: 8px 2px 6px; min-height: 58px; }
  .likert-num { font-size: 16px; }
  .likert-lbl { font-size: 9px; }
  .likert-anchors { padding: 12px 12px; gap: 8px; }
  .anchor-row { font-size: 13px; gap: 10px; }
  .anchor-num { flex-basis: 24px; height: 24px; font-size: 12px; }
  .gateway-title { font-size: 32px; }
  .gateway-actions .btn { font-size: 15px; }
  .tbar-row { grid-template-columns: 40px 1fr 110px; font-size: 12px; gap: 8px; }
  .score-row.sci { flex-direction: column; }
}
