:root {
  --bg: #fff6ee;
  --paper: #fffdfa;
  --ink: #2b2320;
  --muted: #8a7b72;
  --accent: #d8674e;
  --accent-soft: #fbe3d9;
  --line: #f0e2d6;
  --radius: 22px;
  --shadow: 0 10px 30px rgba(120, 72, 44, 0.08);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  min-height: 100vh;
  font-family: 'PingFang SC', 'Microsoft YaHei', 'Noto Sans CJK SC', system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(900px 500px at 10% -10%, #ffe2cf 0%, transparent 60%),
    radial-gradient(700px 500px at 110% 10%, #fde9c9 0%, transparent 60%),
    var(--bg);
  line-height: 1.7;
}

[hidden] { display: none !important; }

.app {
  max-width: 520px;
  margin: 0 auto;
  padding: 20px 16px 48px;
  display: grid;
  gap: 14px;
}

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 20px;
  box-shadow: var(--shadow);
}

.center { text-align: center; }

.emoji { font-size: 56px; line-height: 1; margin: 8px 0 14px; }

.eyebrow {
  margin: 0 0 6px;
  font-size: 12px;
  letter-spacing: 0.28em;
  color: var(--muted);
  text-transform: uppercase;
}

h1 {
  margin: 0 0 10px;
  font-size: 28px;
  line-height: 1.3;
}

h1 em { font-style: normal; color: var(--accent); }

.lead, .sub, .micro, .hint {
  color: var(--muted);
  font-size: 14px;
}

.lead { margin: 0 0 14px; }

.pills {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.pills li {
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13px;
}

.note {
  text-align: left;
  background: #fff3e8;
  border-left: 4px solid var(--accent);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14px;
}

.note b { display: block; margin-bottom: 4px; }
.note p { margin: 0; color: #5b4d46; }

.how {
  margin: 14px 0 0;
  text-align: left;
  color: #5b4d46;
  font-size: 14px;
  background: #fbf7f3;
  border-radius: 12px;
  padding: 12px 14px;
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 18px;
}

.btn {
  appearance: none;
  border: 2px solid transparent;
  border-radius: 999px;
  padding: 13px 18px;
  font: inherit;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn:hover { transform: translateY(-1px); }

.btn.primary {
  color: #fff;
  background: linear-gradient(135deg, #e8805f, #d8674e);
  box-shadow: 0 8px 20px rgba(216, 103, 78, 0.28);
}

.btn.ghost {
  color: var(--accent);
  background: #fff;
  border-color: #f2cfc2;
}

.btn.small { padding: 9px 16px; font-size: 14px; }

.btn:focus-visible, .option:focus-visible {
  outline: 3px solid rgba(216, 103, 78, 0.35);
  outline-offset: 2px;
}

.error {
  margin: 0;
  min-height: 22px;
  color: #d8364e;
  font-size: 13px;
}

/* 题目页 */
.progress-card { padding: 16px 18px; }

.progress-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 10px;
}

.progress-top span:first-child { color: var(--accent); font-weight: 600; }

.bar {
  height: 8px;
  border-radius: 999px;
  background: #f5e6dc;
  overflow: hidden;
}

.bar i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #f2b872, #d8674e);
  transition: width 0.35s ease;
}

.question {
  margin: 0 0 16px;
  font-size: 20px;
  line-height: 1.5;
}

.options { display: grid; gap: 10px; }

.option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.option:hover { border-color: #f2b9a8; transform: translateX(2px); }

.option.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.option .key {
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  background: #fff;
  border: 1.5px solid #f2cfc2;
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 4px;
}

/* 结果页 */
.result-hero { padding-top: 26px; }

.percent {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 4px;
  color: var(--accent);
}

.percent span { font-size: 40px; font-weight: 800; line-height: 1; }
.percent small { font-size: 13px; color: var(--muted); }

.result-hero h1 { font-size: 34px; margin: 6px 0 4px; }

.r-title { margin: 0 0 12px; color: #5b4d46; }

.quote {
  margin-top: 6px;
  padding: 14px 16px;
  border-radius: 14px;
  background: #fff3e8;
  color: #6c4a3d;
  font-size: 16px;
  font-weight: 600;
}

.section-title { margin: 0 0 6px; font-size: 17px; }

.bars { display: grid; gap: 12px; margin-top: 14px; }

.bar-row {
  display: grid;
  grid-template-columns: 84px 1fr 44px;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}

.bar-row .track {
  height: 10px;
  border-radius: 999px;
  background: #f5e6dc;
  overflow: hidden;
}

.bar-row .fill {
  height: 100%;
  border-radius: inherit;
  width: 0;
  transition: width 0.6s ease;
}

.bar-row .val { text-align: right; color: var(--muted); }

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.two-col h4 { margin: 0 0 6px; font-size: 15px; color: var(--accent); }
.two-col p { margin: 0; font-size: 14px; color: #5b4d46; }

#r-portrait, #r-partner { margin: 0; color: #5b4d46; }

.micro { margin: 4px 0 0; text-align: center; font-size: 12px; }

/* 海报弹层 */
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(43, 35, 32, 0.55);
  overflow: auto;
  padding: 18px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.modal-panel {
  width: min(420px, 100%);
  margin: auto;
  background: var(--paper);
  border-radius: 22px;
  padding: 16px;
  display: grid;
  gap: 12px;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-head h2 { margin: 0; font-size: 18px; }

.icon-btn {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: var(--accent-soft);
  font-size: 22px;
  color: var(--accent);
  cursor: pointer;
}

.tip { margin: 0; font-size: 13px; color: var(--muted); }

#poster-img {
  width: 100%;
  height: auto;
  border-radius: 14px;
  border: 1px solid var(--line);
}

@media (max-width: 480px) {
  h1 { font-size: 24px; }
  .result-hero h1 { font-size: 30px; }
  .two-col { grid-template-columns: 1fr; }
}
