/* 婚配市场结构研究 · 上嫁圣体测评
   纸色报告。标题用 Noto Serif SC（OFL，见 fonts/OFL.txt）。
   正文用系统黑体，保证手机上的长句仍然好读。 */

@font-face {
  font-family: "Noto Serif SC";
  src: url("fonts/NotoSerifSC-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Noto Serif SC";
  src: url("fonts/NotoSerifSC-900.woff2") format("woff2");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #f7f2ec;
  --ink: #2a221e;
  --ink-2: #6f645c;
  --ink-3: #a3968c;
  --burgundy: #b5485a;
  --burgundy-deep: #8e3646;
  --gold: #c6a36a;
  --line: #eadfd4;
  --card: #ffffff;
  --shadow: 0 10px 28px rgba(90, 52, 40, 0.06);
  --serif: "Noto Serif SC", "Songti SC", "STSong", "Source Han Serif SC", "Noto Serif CJK SC", "PMingLiU", serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif;
  --radius: 18px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
html { overflow-x: hidden; }

body {
  color-scheme: light;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body.booting .screen { display: none !important; }

.app {
  max-width: 440px;
  margin: 0 auto;
  padding: 26px 16px calc(28px + env(safe-area-inset-bottom));
  min-height: 100vh;
}

.screen { display: none; animation: fade .32s ease; }
.screen.active { display: block; }
@keyframes fade {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

button, a { touch-action: manipulation; }
button { font-family: inherit; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ===== 报告头 / 印章 ===== */
.masthead { position: relative; padding-top: 2px; }

.doc-kicker {
  margin: 0;
  text-align: center;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.14em;
  color: #b3a69d;
}

.doc-no {
  margin: 7px 0 0;
  text-align: center;
  font-size: 10px;
  letter-spacing: 0.16em;
  color: #b7aaa2;
}

.doc-rule {
  width: 52px;
  height: 1px;
  margin: 11px auto 0;
  background: var(--gold);
}

.stamp {
  position: absolute;
  top: 0;
  right: -2px;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 1.5px solid rgba(181, 72, 90, 0.92);
  box-shadow: inset 0 0 0 3px var(--bg), inset 0 0 0 4.2px rgba(181, 72, 90, 0.72);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--burgundy);
  transform: rotate(8deg);
  background: transparent;
  pointer-events: none;
}
.stamp-mark {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 26px;
  line-height: 1;
}
.stamp-label {
  margin-top: 1px;
  font-size: 9px;
  letter-spacing: 0.12em;
  line-height: 1.2;
}
.stamp-grade .stamp-mark { font-size: 28px; font-weight: 900; }

/* ===== 落地页 ===== */
.time-line {
  margin: 18px 0 0;
  text-align: center;
  font-size: 13px;
  letter-spacing: 0.08em;
  color: #8d8178;
}

.hero-title {
  margin: 14px 0 0;
  text-align: center;
  font-family: var(--serif);
  font-weight: 900;
  font-size: clamp(30px, 8.4vw, 36px);
  line-height: 1.28;
  letter-spacing: 0.02em;
  color: var(--ink);
}
.hero-line { display: block; }
.hero-title em {
  font-style: normal;
  color: var(--burgundy);
}
.hero-q {
  color: var(--gold);
  font-weight: 900;
}

.hero-sub {
  margin: 12px 0 0;
  text-align: center;
  font-size: 14.5px;
  color: #6f645c;
  letter-spacing: 0.02em;
}
.hero-sub em {
  font-style: normal;
  color: var(--burgundy);
  font-weight: 600;
}

.struct-card {
  margin-top: 22px;
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid rgba(214, 196, 180, 0.55);
  box-shadow: var(--shadow);
  padding: 16px 16px 8px;
}
.struct-title {
  margin: 0 0 8px;
  text-align: center;
  font-size: 12.5px;
  letter-spacing: 0.14em;
  color: #a8988e;
}
.struct-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 2px;
}
.struct-name {
  flex: none;
  font-size: 13.5px;
  color: #3c332e;
}
.struct-lead {
  flex: 1;
  height: 0;
  border-bottom: 1px dotted #d9cdc2;
  min-width: 12px;
}
.struct-count {
  flex: none;
  color: var(--ink);
}
.struct-count b {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.04em;
}
.struct-unit {
  margin-left: 3px;
  font-size: 12px;
  color: var(--ink-2);
  font-weight: 500;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
  margin-top: 16px;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 5px 7px 5px 6px;
  background: #fff;
  border-radius: 999px;
  border: 1px solid #f0e4da;
  box-shadow: 0 2px 8px rgba(80, 48, 36, 0.04);
  font-size: 10px;
  line-height: 1.3;
  color: #5c514a;
  white-space: nowrap;
}
.pill svg { flex: none; }

.landing-actions { margin-top: 6px; }

.btn-primary {
  display: block;
  width: 100%;
  margin-top: 18px;
  padding: 14px 18px;
  border: 0;
  border-radius: 999px;
  background: var(--burgundy);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.06em;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(181, 72, 90, 0.22);
  transition: transform .15s ease, opacity .15s ease;
}
.btn-primary:active { transform: scale(0.985); }
.btn-primary:disabled {
  opacity: 0.42;
  box-shadow: none;
  cursor: default;
  transform: none;
}

.buy-link {
  display: block;
  margin-top: 14px;
  text-align: center;
  color: var(--burgundy);
  font-size: 13.5px;
  text-decoration: none;
}
.buy-link:hover { text-decoration: underline; text-underline-offset: 3px; }

.foot-note {
  margin: 18px 0 0;
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.02em;
  color: #b0a399;
  line-height: 1.7;
}

/* ===== 兑换码 ===== */
#screen-gate { position: relative; padding-top: 8px; }
.gate-kicker {
  margin: 36px 0 0;
  text-align: center;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.16em;
  color: var(--gold);
}
.gate-title {
  margin: 10px 0 0;
  text-align: center;
  font-family: var(--serif);
  font-weight: 900;
  font-size: 26px;
  letter-spacing: 0.02em;
}
.gate-sub {
  margin: 12px 0 0;
  text-align: center;
  font-size: 13.5px;
  color: var(--ink-2);
  line-height: 1.75;
}
.code-box {
  margin-top: 26px;
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid rgba(214, 196, 180, 0.55);
  box-shadow: var(--shadow);
  padding: 18px 16px 16px;
}
.code-input {
  display: block;
  width: 100%;
  padding: 14px 12px;
  border-radius: 12px;
  border: 1.5px solid var(--line);
  background: #fbf8f5;
  font-size: 17px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-align: center;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  outline: none;
}
.code-input:focus { border-color: var(--burgundy); background: #fff; }
.code-input::placeholder { letter-spacing: 0.08em; font-size: 14px; color: #c3b6ad; }
.code-box .btn-primary { margin-top: 12px; }
.code-error {
  min-height: 18px;
  margin-top: 10px;
  text-align: center;
  font-size: 12.5px;
  color: var(--burgundy-deep);
}

.btn-back {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: var(--ink);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(80, 48, 36, 0.08);
}
#screen-gate > .btn-back { position: absolute; top: 0; left: 0; }

/* ===== 答题 ===== */
#screen-quiz.active {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 60px - env(safe-area-inset-bottom));
}
.quiz-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.quiz-part {
  flex: 1;
  text-align: center;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--burgundy-deep);
}
.progress-text {
  flex: none;
  min-width: 42px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
}
.progress-bar {
  height: 4px;
  margin: 12px 0 0;
  border-radius: 999px;
  background: rgba(181, 72, 90, 0.16);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--gold), var(--burgundy));
  transition: width .3s ease;
}
.q-kicker {
  margin: 18px 0 0;
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--gold);
}
.q-title {
  margin: 8px 0 0;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 22px;
  line-height: 1.45;
  letter-spacing: 0.01em;
}
.quiz-body { flex: 1 0 auto; margin-bottom: 18px; }
.q-options { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.q-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  padding: 14px 14px;
  border-radius: 14px;
  border: 1.5px solid transparent;
  background: #fff;
  box-shadow: var(--shadow);
  text-align: left;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--ink);
  cursor: pointer;
}
.q-option .dot {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  border-radius: 50%;
  border: 1.5px solid #d9cdc3;
  position: relative;
}
.q-option .label { flex: 1; }
.q-option.selected {
  border-color: var(--burgundy);
  background: #fdf7f6;
}
.q-option.selected .dot { border-color: var(--burgundy); }
.q-option.selected .dot::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--burgundy);
}
.btn-next { margin-top: auto; }

/* ===== 生成中 ===== */
#screen-loading.active {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 80px);
  text-align: center;
}
.loading-ring {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 1.5px solid rgba(181, 72, 90, 0.2);
  border-top-color: var(--burgundy);
  box-shadow: inset 0 0 0 4px transparent, inset 0 0 0 5px rgba(181, 72, 90, 0.18);
  animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text {
  margin: 22px 0 0;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 16px;
  color: var(--ink-2);
}
.loading-steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 28px;
  align-items: flex-start;
}
.loading-step {
  display: flex;
  align-items: center;
  font-size: 13px;
  color: var(--ink-3);
  opacity: 0.45;
  transition: opacity .3s ease, color .3s ease;
}
.loading-step.done { opacity: 1; color: var(--ink-2); }
.loading-mark {
  width: 7px;
  height: 7px;
  margin-right: 8px;
  border-radius: 50%;
  border: 1px solid var(--burgundy);
  opacity: 0.4;
}
.loading-step.done .loading-mark { background: var(--burgundy); opacity: 1; }

/* ===== 报告 ===== */
.prob-kicker {
  margin: 20px 0 0;
  text-align: center;
  font-size: 12px;
  letter-spacing: 0.18em;
  color: #a8988e;
}
.prob-num {
  margin: 4px 0 0;
  text-align: center;
  font-family: var(--serif);
  font-weight: 900;
  font-size: 92px;
  line-height: 0.92;
  letter-spacing: -0.03em;
  color: var(--burgundy);
}
.prob-unit {
  font-size: 0.36em;
  margin-left: 2px;
  color: var(--gold);
  letter-spacing: 0;
}
.prob-tier {
  margin: 8px 0 0;
  text-align: center;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 0.06em;
}
.prob-summary {
  margin: 12px 0 0;
  font-size: 13.5px;
  line-height: 1.8;
  color: var(--ink-2);
}
.prob-note {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.7;
  color: var(--ink-3);
}

.card {
  margin-top: 16px;
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid rgba(214, 196, 180, 0.55);
  box-shadow: var(--shadow);
  padding: 16px 16px 14px;
}
.card-title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.06em;
}
.card-lead {
  margin: 6px 0 0;
  font-size: 12.5px;
  color: var(--ink-3);
  line-height: 1.65;
}

.dim { padding: 13px 0; border-bottom: 1px solid var(--line); }
.dim:last-child { border-bottom: 0; padding-bottom: 2px; }
.dim-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.dim-name { font-size: 13.5px; font-weight: 600; }
.dim-val {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}
.dim-track {
  display: block;
  height: 5px;
  margin-top: 8px;
  border-radius: 999px;
  background: #f3ebe4;
  overflow: hidden;
}
.dim-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  transition: width .9s cubic-bezier(.4, 0, .2, 1);
}
.dim-fill.lv-high { background: var(--burgundy-deep); }
.dim-fill.lv-mid { background: var(--burgundy); }
.dim-fill.lv-low { background: var(--gold); }
.dim-fill.lv-weak { background: #d9c3b6; }
.dim-text { margin: 7px 0 0; font-size: 12.5px; line-height: 1.7; color: var(--ink-2); }

.pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}
.pair-card {
  background: #fff;
  border-radius: 16px;
  border: 1px solid rgba(214, 196, 180, 0.55);
  box-shadow: var(--shadow);
  padding: 14px 12px 12px;
}
.pair-card-weak { background: #fdf8f6; }
.pair-kicker {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--ink-3);
}
.pair-name {
  margin: 8px 0 0;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 16px;
  line-height: 1.35;
}
.pair-score {
  margin: 2px 0 0;
  font-family: var(--serif);
  font-weight: 700;
  color: var(--burgundy);
  font-size: 14px;
}
.pair-text {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.65;
  color: var(--ink-2);
}

.strategy {
  display: flex;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.strategy:last-child { border-bottom: 0; padding-bottom: 0; }
.strategy-no {
  flex: none;
  width: 28px;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 16px;
  color: var(--gold);
  line-height: 1.4;
}
.strategy-body { flex: 1; min-width: 0; }
.strategy-name {
  margin: 0;
  font-weight: 700;
  font-size: 14.5px;
}
.strategy-meta {
  margin: 2px 0 0;
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: var(--ink-3);
}
.strategy-text {
  margin: 6px 0 0;
  font-size: 13px;
  line-height: 1.75;
  color: var(--ink-2);
}

.disclaimer {
  margin: 22px 0 0;
  text-align: center;
  font-size: 12px;
  line-height: 1.7;
  color: var(--ink-2);
}
.local-note {
  margin: 6px 0 0;
  text-align: center;
  font-size: 11px;
  color: var(--ink-3);
}
.btn-ghost {
  display: block;
  width: 100%;
  margin-top: 14px;
  padding: 12px;
  border-radius: 999px;
  border: 1px solid rgba(181, 72, 90, 0.35);
  background: transparent;
  color: var(--burgundy);
  font-size: 14px;
  letter-spacing: 0.08em;
  cursor: pointer;
}
.btn-ghost:active { background: rgba(181, 72, 90, 0.06); }

@media (max-width: 340px) {
  .pair { grid-template-columns: 1fr; }
  .pill { font-size: 10px; }
}

@media (min-width: 840px) {
  body { background: #efe6dc; }
  .app {
    background: var(--bg);
    box-shadow: 0 0 0 1px rgba(80, 50, 40, 0.05), 0 24px 60px rgba(80, 50, 40, 0.08);
  }
}

@media (prefers-reduced-motion: reduce) {
  .screen { animation: none; }
  .loading-ring { animation: none; }
  .dim-fill, .progress-fill, .btn-primary { transition: none; }
}
