:root {
  --bg: #f8ede2;
  --bg-deep: #f2dcc8;
  --paper: #fffaf4;
  --paper-2: #fdf3e8;
  --ink: #382821;
  --ink-soft: #5d463b;
  --muted: #93796b;
  --line: #ecd8c6;
  --brand: #c0603d;
  --brand-deep: #a34a2c;
  --brand-soft: #f6e1d1;
  --brand-2: #e39a6d;
  --gold: #c99a3f;
  --shadow-lg: 0 30px 70px -30px rgba(112, 66, 40, .45);
  --shadow-sm: 0 10px 24px -14px rgba(112, 66, 40, .32);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --serif: "Songti SC", "STSong", "SimSun", "Noto Serif SC", serif;
  --sans: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Noto Sans SC", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: var(--sans);
  color: var(--ink);
  background:
    radial-gradient(1200px 700px at 10% -10%, #fff6ec 0%, rgba(255, 246, 236, 0) 60%),
    radial-gradient(900px 600px at 100% 0%, #f7dfc9 0%, rgba(247, 223, 201, 0) 55%),
    linear-gradient(160deg, #fbf1e6 0%, #f7e6d6 45%, #f2dccb 100%);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.ambient {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: .55;
}
.orb-a { width: 420px; height: 420px; left: -140px; top: -120px; background: #ffd9bd; }
.orb-b { width: 360px; height: 360px; right: -120px; top: 22%; background: #f3b98f; opacity: .35; }
.orb-c { width: 520px; height: 520px; left: 30%; bottom: -260px; background: #f6cfa9; opacity: .45; }

.grain {
  position: absolute;
  inset: 0;
  opacity: .35;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.18'/%3E%3C/svg%3E");
}

#app {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 34px 18px 56px;
}

.screen {
  display: none;
  width: 100%;
  max-width: 760px;
  margin: auto;
}
.screen.is-active {
  display: block;
  animation: screen-in .45s cubic-bezier(.22, .9, .3, 1) both;
}
@keyframes screen-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.screen-lock { max-width: 480px; }
.screen-gender .card, .screen-result .card { max-width: 760px; }

.card {
  background: linear-gradient(180deg, #fffdf9 0%, var(--paper) 100%);
  border: 1px solid rgba(255, 255, 255, .8);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: 38px 38px 34px;
}

.eyebrow {
  margin: 0 0 14px;
  font-size: 11px;
  letter-spacing: .32em;
  font-weight: 700;
  color: var(--brand);
  text-transform: uppercase;
}

h1, h2, h3, h4, p { margin: 0; }

.display {
  font-family: var(--serif);
  font-size: clamp(34px, 6vw, 46px);
  line-height: 1.22;
  letter-spacing: .02em;
  color: var(--ink);
  margin-bottom: 16px;
}

.h2 {
  font-family: var(--serif);
  font-size: clamp(26px, 4.4vw, 34px);
  line-height: 1.3;
  margin-bottom: 10px;
}

.lead {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.85;
}

.tiny { font-size: 12px; color: var(--muted); line-height: 1.7; }

/* ---------- 访问验证 ---------- */
.lock-card { text-align: center; padding-top: 42px; }

.seal {
  width: 82px;
  height: 82px;
  margin: 0 auto 22px;
  border-radius: 24px;
  display: grid;
  place-items: center;
  position: relative;
  background: linear-gradient(150deg, #d8794f 0%, #b9542f 100%);
  box-shadow: 0 18px 34px -14px rgba(160, 74, 40, .65), inset 0 1px 0 rgba(255, 255, 255, .45);
}
.seal-icon { font-size: 36px; filter: saturate(.9); }
.seal-ring {
  position: absolute;
  inset: -9px;
  border-radius: 30px;
  border: 1px solid rgba(192, 96, 61, .28);
}

.lock-title {
  font-family: var(--serif);
  font-size: 40px;
  letter-spacing: .06em;
  margin-bottom: 12px;
}
.lock-lead { font-size: 14.5px; margin-bottom: 26px; }

.code-wrap { margin-bottom: 8px; }
.code-input {
  width: 100%;
  height: 66px;
  border-radius: 18px;
  border: 1.5px solid var(--line);
  background: #fff;
  text-align: center;
  font-family: var(--sans);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: .34em;
  color: var(--ink);
  outline: none;
  text-transform: uppercase;
  transition: border-color .2s, box-shadow .2s;
  padding: 0 14px;
}
.code-input::placeholder {
  font-size: 15px;
  font-weight: 400;
  letter-spacing: .08em;
  color: #b9a698;
}
.code-input:focus {
  border-color: var(--brand-2);
  box-shadow: 0 0 0 4px rgba(227, 154, 109, .18);
}
.code-input.is-error { border-color: #c94f45; animation: shake .3s; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.form-msg {
  min-height: 20px;
  margin: 6px 0 10px;
  font-size: 13px;
  color: #b04a3e;
}

.lock-note { margin-top: 18px; }
.lock-foot {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px dashed var(--line);
  color: #ab9384;
}

/* ---------- 按钮 ---------- */
.btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 700;
  border-radius: 999px;
  padding: 14px 28px;
  transition: transform .15s, box-shadow .2s, background .2s, color .2s;
  letter-spacing: .02em;
}
.btn:disabled { cursor: not-allowed; opacity: .45; }
.btn-primary {
  color: #fff7f0;
  background: linear-gradient(135deg, #c96a45 0%, #b1502e 100%);
  box-shadow: 0 16px 30px -16px rgba(161, 74, 42, .85), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.btn-primary:not(:disabled):hover { transform: translateY(-1px); box-shadow: 0 20px 34px -16px rgba(161, 74, 42, .9); }
.btn-primary:not(:disabled):active { transform: translateY(0); }
.btn-ghost {
  background: rgba(255, 255, 255, .65);
  color: var(--brand-deep);
  border: 1.5px solid #e7c8b3;
}
.btn-ghost:not(:disabled):hover { background: #fff; }
.btn-block { width: 100%; height: 56px; font-size: 16px; }
.btn-wide { width: 100%; max-width: 420px; height: 58px; }

.btn-row {
  display: flex;
  gap: 12px;
  margin: 26px 0 0;
}
.btn-row .btn { flex: 1; height: 54px; }
.btn-row-between { justify-content: space-between; }
.btn-row-between .btn { flex: 0 0 auto; min-width: 132px; }

/* ---------- 首页 ---------- */
.intro-card { padding: 44px 42px 38px; }
.intro-lead { margin-bottom: 26px; }

.feature-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 22px;
}
.feature {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: linear-gradient(180deg, #fff 0%, #fdf6ee 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 16px 16px 15px;
  box-shadow: var(--shadow-sm);
}
.feature-icon {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--brand-soft);
  color: var(--brand-deep);
  font-family: var(--serif);
  font-weight: 700;
  font-size: 18px;
}
.feature h3 { font-size: 16px; margin-bottom: 3px; color: var(--ink); }
.feature p { font-size: 12.5px; color: var(--muted); }

.note-box {
  background: linear-gradient(135deg, #fbeadd 0%, #f7dfcd 100%);
  border: 1px solid #efd2bc;
  border-left: 4px solid var(--brand-2);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 16px 18px;
  margin-bottom: 26px;
}
.note-box h4 { font-size: 14px; margin-bottom: 6px; color: var(--brand-deep); }
.note-box p { font-size: 13px; color: var(--ink-soft); line-height: 1.75; }

.intro-foot { margin-top: 16px; text-align: center; }

/* ---------- 偏好选择 ---------- */
.gender-card { padding: 42px 40px 34px; }
.gender-card .lead { margin-bottom: 24px; }

.choice-list { display: flex; flex-direction: column; gap: 12px; }

.choice {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  text-align: left;
  background: #fdf4ea;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  cursor: pointer;
  transition: border-color .2s, background .2s, transform .15s, box-shadow .2s;
  font-family: var(--sans);
}
.choice:hover { background: #fff8f0; transform: translateY(-1px); }
.choice.is-selected {
  border-color: var(--brand);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(192, 96, 61, .1), var(--shadow-sm);
}
.choice-mark {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--brand);
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 700;
}
.choice.is-selected .choice-mark {
  background: linear-gradient(140deg, #cb6d47, #b1502e);
  border-color: transparent;
  color: #fff;
}
.choice-body { display: flex; flex-direction: column; gap: 4px; }
.choice-body strong { font-size: 16px; color: var(--ink); }
.choice-body em { font-style: normal; font-size: 13px; color: var(--muted); }

/* ---------- 答题 ---------- */
.quiz-wrap { width: 100%; max-width: 760px; }

.progress-card { padding: 18px 22px 16px; border-radius: 24px; margin-bottom: 14px; }
.progress-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.cat-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--brand-deep);
}
.cat-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--brand-2);
  box-shadow: 0 0 0 4px rgba(227, 154, 109, .16);
}
.progress-num { font-size: 14px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.progress-num b { font-size: 20px; color: var(--ink); }
.progress-num i { font-style: normal; color: var(--muted); margin-left: 8px; }

.progress-track {
  height: 9px;
  background: #f0ded0;
  border-radius: 999px;
  overflow: hidden;
}
.progress-track span {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #d98a5c 0%, #b9542f 100%);
  transition: width .35s ease;
}

.question-card { padding: 32px 34px 30px; }
.cat-inline {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--brand-deep);
  font-size: 13.5px;
  font-weight: 700;
  margin-bottom: 12px;
}
.question-text {
  font-family: var(--serif);
  font-size: clamp(21px, 3.3vw, 26px);
  line-height: 1.55;
  letter-spacing: .01em;
  margin-bottom: 22px;
}

.options { display: flex; flex-direction: column; gap: 10px; }
.option {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  width: 100%;
  text-align: left;
  padding: 15px 17px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--line);
  background: #fdf5ec;
  cursor: pointer;
  transition: border-color .18s, background .18s, transform .12s;
  font-family: var(--sans);
}
.option:hover { background: #fffaf3; border-color: #e3bfa6; }
.option.is-selected {
  border-color: var(--brand);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(192, 96, 61, .1);
}
.option-radio {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  margin-top: 3px;
  border-radius: 50%;
  border: 1.5px solid #cfae98;
  background: #fff;
  position: relative;
}
.option.is-selected .option-radio { border-color: var(--brand); }
.option.is-selected .option-radio::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--brand);
}
.option-body { display: flex; flex-direction: column; gap: 4px; }
.option-body strong { font-size: 15px; line-height: 1.55; color: var(--ink); font-weight: 700; }
.option-body em { font-style: normal; font-size: 12.5px; color: var(--muted); }
.option-key {
  flex: 0 0 auto;
  margin-left: auto;
  font-size: 11px;
  color: #b79b89;
  font-weight: 700;
  letter-spacing: .08em;
  padding-top: 3px;
}

.quiz-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 16px;
}
.quiz-actions .btn { min-width: 116px; height: 50px; }
.quiz-hint { font-size: 12.5px; color: var(--muted); text-align: center; flex: 1; }

/* ---------- 结果 ---------- */
.result-wrap { display: flex; flex-direction: column; gap: 14px; }

.hero-card { text-align: center; padding: 34px 30px 30px; }
.hero-icon {
  width: 54px;
  height: 54px;
  margin: 8px auto 6px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1.5px solid #e6c8b3;
  color: var(--brand);
  font-size: 24px;
  line-height: 1;
}
.screen-result { margin: 0 auto; }
.hero-percent {
  font-family: var(--serif);
  font-size: clamp(56px, 10vw, 74px);
  line-height: 1;
  color: var(--brand);
  font-weight: 700;
  letter-spacing: -.02em;
}
.hero-name {
  font-family: var(--serif);
  font-size: clamp(34px, 6vw, 44px);
  letter-spacing: .06em;
  margin: 6px 0 6px;
}
.hero-role { font-size: 13.5px; color: var(--muted); letter-spacing: .04em; }

.tag-row { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin: 14px 0 10px; }
.tag-row span {
  font-size: 12px;
  padding: 5px 13px;
  border-radius: 999px;
  background: #f7e6d8;
  color: var(--brand-deep);
  border: 1px solid #efd5c2;
}
.dominant { font-size: 12.5px; color: var(--muted); margin-bottom: 16px; }

.quote-box {
  text-align: left;
  background: linear-gradient(135deg, #fbe9db 0%, #f8e0cd 100%);
  border: 1px solid #efd1ba;
  border-radius: var(--radius-md);
  padding: 16px 18px;
}
.quote-label { font-size: 11px; letter-spacing: .18em; color: var(--brand); font-weight: 700; }
.quote-box p { font-family: var(--serif); font-size: 16.5px; line-height: 1.7; color: var(--ink-soft); margin-top: 6px; }

.section-card { padding: 26px 28px 24px; }
.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 14px;
}
.section-title span {
  font-family: var(--serif);
  font-size: 12px;
  color: var(--brand);
  background: #f8e6d7;
  border: 1px solid #eed3bf;
  border-radius: 8px;
  padding: 3px 7px;
  letter-spacing: .06em;
}
.section-text { font-size: 14.5px; line-height: 1.9; color: var(--ink-soft); }

.bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 13px; }
.bar-row { display: grid; grid-template-columns: 52px 1fr 38px; align-items: center; gap: 12px; }
.bar-name { font-size: 13px; color: var(--ink-soft); }
.bar-track { height: 10px; border-radius: 999px; background: #f1e0d2; overflow: hidden; }
.bar-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #e0a273 0%, #b95a34 100%);
  width: 0;
  transition: width .8s cubic-bezier(.2, .8, .2, 1);
}
.bar-val { font-size: 13px; font-weight: 700; color: var(--brand-deep); text-align: right; font-variant-numeric: tabular-nums; }

.trait-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.trait-card {
  background: #fdf3e9;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px 14px 15px;
}
.trait-card h4 { font-size: 13.5px; color: var(--brand-deep); margin-bottom: 6px; }
.trait-card p { font-size: 12.5px; line-height: 1.75; color: var(--muted); }

.reality-box {
  background: linear-gradient(135deg, #fff 0%, #fdf3e9 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  font-size: 14px;
  line-height: 1.85;
  color: var(--ink-soft);
}

.risk-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.risk-card {
  background: #fdf3e9;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px;
}
.risk-card h4 { font-size: 13px; color: var(--brand-deep); margin-bottom: 7px; }
.risk-card p { font-size: 12.5px; line-height: 1.75; color: var(--muted); }

.lines-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.line-card {
  border: 1px solid var(--line);
  background: #fdf3e9;
  border-radius: var(--radius-md);
  padding: 16px 15px;
  font-family: var(--serif);
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--ink-soft);
}

.download-row { text-align: center; padding: 14px 0 4px; display: flex; flex-direction: column; align-items: center; gap: 10px; }

/* ---------- 弹窗 ---------- */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; }
.modal[hidden] { display: none; }
.modal-mask { position: absolute; inset: 0; background: rgba(56, 34, 25, .45); backdrop-filter: blur(3px); }
.modal-card {
  position: relative;
  max-width: 480px;
  width: 100%;
  padding: 30px 28px 24px;
  animation: screen-in .3s ease both;
}
.modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  border: 0;
  background: transparent;
  font-size: 24px;
  color: var(--muted);
  cursor: pointer;
  line-height: 1;
}
.modal-card h3 { font-family: var(--serif); font-size: 22px; margin-bottom: 12px; }
.modal-body p { font-size: 13.5px; line-height: 1.85; color: var(--ink-soft); margin-bottom: 10px; }
.modal-card .btn { margin-top: 8px; height: 48px; }

/* ---------- toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  transform: translate(-50%, 20px);
  background: rgba(56, 34, 25, .92);
  color: #fff4e9;
  font-size: 13.5px;
  padding: 11px 20px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s;
  z-index: 60;
}
.toast.is-show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 响应式 ---------- */
@media (max-width: 720px) {
  #app { padding: 20px 14px 40px; }
  .card { padding: 28px 22px 24px; border-radius: 24px; }
  .intro-card { padding: 32px 22px 28px; }
  .lock-title { font-size: 34px; }
  .feature-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .feature { padding: 13px; gap: 9px; }
  .feature-icon { width: 32px; height: 32px; flex-basis: 32px; font-size: 16px; border-radius: 10px; }
  .feature h3 { font-size: 14.5px; }
  .feature p { font-size: 11.5px; }
  .choice { padding: 15px 16px; gap: 13px; }
  .choice-mark { width: 40px; height: 40px; flex-basis: 40px; font-size: 19px; }
  .question-card { padding: 24px 20px 22px; }
  .question-text { font-size: 20px; }
  .option { padding: 13px 14px; gap: 11px; }
  .option-body strong { font-size: 14px; }
  .option-key { display: none; }
  .quiz-actions .btn { min-width: 96px; height: 46px; font-size: 14px; padding: 12px 18px; }
  .quiz-hint { font-size: 11.5px; }
  .trait-grid, .risk-grid, .lines-grid { grid-template-columns: 1fr; }
  .bar-row { grid-template-columns: 44px 1fr 34px; gap: 9px; }
  .btn-row .btn { padding: 13px 16px; }
  .section-card { padding: 22px 20px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* 结果页内容较长，顶部对齐避免大块留白 */
#screen-result { margin: 0 auto; }
