:root {
  --red: #a12b32;
  --red-dark: #752026;
  --red-faint: #f6e7e5;
  --paper: #f5f0e8;
  --card: #fffdf9;
  --ink: #26211d;
  --muted: #756c64;
  --soft: #a79c92;
  --line: #ded5c9;
  --green: #416553;
  --serif: "Songti SC", STSong, SimSun, serif;
  --sans: "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --shadow: 0 22px 70px rgba(64, 42, 28, .1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 6%, rgba(161, 43, 50, .07), transparent 28%),
    linear-gradient(180deg, #f8f4ed 0, var(--paper) 66%);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.site-header {
  width: min(1180px, calc(100% - 48px));
  min-height: 84px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(117, 96, 81, .16);
}
.wordmark { display: flex; align-items: center; gap: 11px; padding: 0; border: 0; color: var(--ink); background: transparent; text-align: left; }
.seal { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; color: #fff9f0; background: var(--red); font-family: var(--serif); font-size: 20px; }
.wordmark strong, .wordmark small { display: block; }
.wordmark strong { font-family: var(--serif); font-size: 19px; letter-spacing: .12em; }
.wordmark small { margin-top: 2px; color: var(--muted); font-size: 9px; letter-spacing: .15em; }
nav { display: flex; gap: 28px; }
.nav-link { position: relative; padding: 31px 2px 28px; border: 0; color: var(--muted); background: transparent; font-size: 13px; }
.nav-link::after { content: ""; position: absolute; right: 0; bottom: -1px; left: 0; height: 2px; background: transparent; }
.nav-link.active { color: var(--red); font-weight: 700; }
.nav-link.active::after { background: var(--red); }

main { width: min(1180px, calc(100% - 48px)); min-height: calc(100vh - 170px); margin: 0 auto; }
.view { padding: 72px 0 88px; animation: enter .35s ease-out; }
@keyframes enter { from { opacity: 0; transform: translateY(7px); } }
.hero-grid { display: grid; grid-template-columns: minmax(0, .95fr) minmax(440px, .82fr); gap: clamp(50px, 8vw, 110px); align-items: center; }
.quiet-label { color: var(--red); font-size: 10px; font-weight: 700; letter-spacing: .22em; }
.quiet-label.light { color: #f0c9c3; }
.hero-copy h1 { margin: 20px 0 26px; font-family: var(--serif); font-size: clamp(43px, 5.4vw, 68px); font-weight: 500; letter-spacing: -.035em; line-height: 1.22; }
.hero-copy > p { max-width: 540px; margin: 0; color: var(--muted); font-size: 16px; line-height: 1.9; }
.trust-row { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 34px; }
.trust-row span { padding: 8px 13px; border: 1px solid var(--line); border-radius: 99px; color: #655b53; background: rgba(255,255,255,.36); font-size: 11px; }

.match-panel { position: relative; padding: 30px; border: 1px solid rgba(184, 168, 152, .65); border-radius: 24px; background: rgba(255, 253, 249, .94); box-shadow: var(--shadow); }
.panel-heading { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 28px; }
.panel-heading span { font-family: var(--serif); font-size: 25px; font-weight: 600; }
.panel-heading small { color: var(--soft); font-size: 11px; }
.saved-profile { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: -10px 0 20px; padding: 12px 14px; border-radius: 10px; color: var(--green); background: #edf2ed; font-size: 12px; }
.saved-profile button { border: 0; color: var(--green); background: transparent; font-weight: 700; }
.uid-field label { display: flex; justify-content: space-between; align-items: center; margin-bottom: 9px; color: #574e47; font-size: 12px; font-weight: 700; }
.uid-field label small { color: var(--soft); font-size: 9px; letter-spacing: .14em; font-weight: 500; }
.uid-input-row { display: grid; grid-template-columns: 1fr auto; padding: 5px; border: 1px solid var(--line); border-radius: 12px; background: #fff; transition: .2s; }
.uid-input-row:focus-within { border-color: var(--red); box-shadow: 0 0 0 4px rgba(161,43,50,.08); }
.uid-input-row input { min-width: 0; height: 44px; padding: 0 10px; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 16px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.uid-input-row input::placeholder { color: #bbb1a8; font-size: 12px; font-weight: 450; letter-spacing: 0; }
.lookup-button { min-width: 60px; border: 0; border-radius: 8px; color: var(--red); background: var(--red-faint); font-size: 12px; font-weight: 700; }
.person-preview { display: flex; align-items: center; gap: 12px; margin-top: 10px; padding: 11px 13px; border-radius: 10px; background: #f3f0e9; }
.person-avatar { width: 34px; height: 34px; display: grid; flex: 0 0 auto; place-items: center; border-radius: 50%; color: #fff; background: var(--green); font-family: var(--serif); }
.person-preview strong, .person-preview small { display: block; }
.person-preview strong { margin-bottom: 2px; font-size: 13px; }
.person-preview small { color: var(--muted); font-size: 10px; }
.preview-ok { margin-left: auto; color: var(--green); font-size: 11px; }
.pair-divider { height: 48px; display: flex; align-items: center; gap: 12px; color: var(--soft); font-size: 9px; letter-spacing: .12em; }
.pair-divider::before, .pair-divider::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.primary-button, .secondary-button { min-height: 50px; padding: 0 20px; border-radius: 10px; font-weight: 700; transition: transform .18s, background .18s, opacity .18s; }
.primary-button { border: 1px solid var(--red); color: white; background: var(--red); }
.primary-button:hover { background: var(--red-dark); transform: translateY(-1px); }
.primary-button:disabled { opacity: .55; cursor: wait; transform: none; }
#match-button { width: 100%; margin-top: 24px; }
.secondary-button { border: 1px solid var(--line); color: var(--ink); background: transparent; }
.create-link { width: 100%; margin-top: 18px; padding: 4px; border: 0; color: var(--red); background: transparent; font-size: 12px; }

.how-it-works { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin-top: 74px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.how-it-works > div { display: flex; align-items: center; gap: 17px; padding: 27px 20px; }
.how-it-works > div + div { border-left: 1px solid var(--line); }
.how-it-works b { color: #c9bdb1; font-family: Georgia, serif; font-size: 22px; font-weight: 400; }
.how-it-works strong, .how-it-works small { display: block; }
.how-it-works strong { margin-bottom: 4px; font-size: 13px; }
.how-it-works small { color: var(--muted); font-size: 11px; }

.page-intro { max-width: 780px; margin: 0 auto 34px; }
.back-link { display: block; margin-bottom: 32px; padding: 0; border: 0; color: var(--red); background: transparent; font-size: 12px; }
.page-intro h2, .success-card h2 { margin: 14px 0 12px; font-family: var(--serif); font-size: clamp(32px, 4vw, 46px); font-weight: 500; }
.page-intro > p { margin: 0; color: var(--muted); line-height: 1.75; }
.profile-shell { max-width: 780px; margin: 0 auto; border: 1px solid var(--line); border-radius: 20px; background: var(--card); box-shadow: var(--shadow); overflow: hidden; }
.stepper { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--line); background: #faf7f1; }
.step-tab { position: relative; padding: 19px 16px; border: 0; color: var(--soft); background: transparent; text-align: left; font-size: 11px; }
.step-tab b { margin-right: 7px; font-family: Georgia, serif; font-weight: 400; }
.step-tab.active { color: var(--red); font-weight: 700; }
.step-tab.active::after { content: ""; position: absolute; right: 16px; bottom: -1px; left: 16px; height: 2px; background: var(--red); }
.profile-step { padding: 34px; }
.profile-step-heading { margin-bottom: 26px; }
.profile-step-heading h3 { margin: 0 0 7px; font-family: var(--serif); font-size: 24px; }
.profile-step-heading p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.field.wide { grid-column: 1 / -1; }
label.field > span, .field-label { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; color: #5c534c; font-size: 12px; font-weight: 650; }
.optional { color: var(--soft); font-size: 10px; font-style: normal; font-weight: 400; }
input[type="text"], input[type="tel"], input[type="number"], select, textarea {
  width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; outline: 0; color: var(--ink); background: #fff; transition: .18s;
}
textarea { min-height: 82px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--red); box-shadow: 0 0 0 4px rgba(161,43,50,.07); }
input::placeholder, textarea::placeholder { color: #bbb1a8; }
.subsection-title { grid-column: 1 / -1; margin: 12px 0 -4px; padding-top: 20px; border-top: 1px solid #ede6dc; font-family: var(--serif); font-size: 18px; }
.checkbox-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; }
.checkbox-item, .switch-row { min-height: 42px; display: flex; align-items: center; gap: 9px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 9px; color: #5b524b; background: white; font-size: 11px; }
input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--red); }
.weights { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 24px; }
.weight-row { display: grid; grid-template-columns: 76px 1fr 26px; gap: 10px; align-items: center; padding: 8px 0; }
.weight-row label { color: #5b524b; font-size: 12px; }
.weight-value { color: var(--red); text-align: right; font-weight: 800; }
input[type="range"] { width: 100%; accent-color: var(--red); }
.form-actions { display: flex; justify-content: space-between; gap: 12px; padding: 20px 34px; border-top: 1px solid var(--line); background: #faf7f1; }
.form-actions .primary-button, .form-actions .secondary-button { min-width: 120px; }
.action-spacer { flex: 1; }

.success-card { max-width: 650px; margin: 45px auto; padding: 54px; border: 1px solid var(--line); border-radius: 24px; background: var(--card); box-shadow: var(--shadow); text-align: center; }
.success-kicker { color: var(--green); font-size: 11px; font-weight: 800; letter-spacing: .16em; }
.success-card > p { max-width: 460px; margin: 0 auto; color: var(--muted); line-height: 1.75; }
.uid-ticket { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 32px 0; padding: 19px 21px; border: 1px dashed #c7b8a8; border-radius: 12px; background: #f7f1e8; }
.uid-ticket span { color: var(--red); font-family: Georgia, serif; font-size: clamp(25px, 5vw, 36px); font-weight: 700; letter-spacing: .08em; }
.uid-ticket button { border: 0; color: var(--red); background: transparent; font-size: 12px; font-weight: 700; white-space: nowrap; }
.success-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.report-cover { display: grid; grid-template-columns: 1fr auto; gap: 28px 60px; padding: 38px 42px; border-radius: 20px; color: #fff9f2; background: var(--red-dark); box-shadow: var(--shadow); }
.report-copy h2 { margin: 12px 0 8px; font-family: var(--serif); font-size: clamp(28px, 4vw, 44px); font-weight: 500; }
.report-copy p { margin: 0; color: #d8b9b7; font-size: 11px; }
.score-block { text-align: right; }
.score-block span, .score-block small { display: block; }
.score-block span { font-family: Georgia, serif; font-size: clamp(58px, 7vw, 82px); line-height: .9; }
.score-block small { margin-top: 10px; color: #d8b9b7; font-size: 9px; letter-spacing: .12em; }
.report-tags { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; padding-top: 22px; border-top: 1px solid rgba(255,255,255,.2); }
.report-tags span { padding: 7px 10px; border: 1px solid rgba(255,255,255,.28); border-radius: 99px; font-size: 10px; }
.direction-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 18px; }
.direction-card { overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: var(--card); box-shadow: 0 12px 40px rgba(64,42,28,.06); }
.direction-title { display: flex; align-items: end; justify-content: space-between; gap: 12px; padding: 22px 24px; border-bottom: 1px solid var(--line); }
.direction-title p { margin: 0 0 5px; color: var(--muted); font-size: 9px; letter-spacing: .08em; }
.direction-title h3 { margin: 0; font-family: var(--serif); font-size: 19px; font-weight: 600; }
.direction-total { color: var(--red); font-family: Georgia, serif; font-size: 32px; }
.direction-total small { color: var(--muted); font-family: var(--sans); font-size: 9px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 11px; }
th { padding: 11px 14px; color: var(--muted); background: #f7f2eb; text-align: right; font-weight: 600; }
th:first-child, td:first-child { text-align: left; }
td { padding: 11px 14px; border-top: 1px solid #eee7dd; text-align: right; font-variant-numeric: tabular-nums; }
td:last-child { color: var(--red); font-weight: 700; }
.failed-box { margin: 20px 24px; padding: 16px; border-radius: 10px; background: var(--red-faint); }
.failed-box strong { display: block; margin-bottom: 8px; color: var(--red-dark); font-size: 13px; }
.failed-box ul { margin: 0; padding-left: 18px; color: #694e49; font-size: 12px; line-height: 1.8; }
.method-note { margin-top: 18px; padding: 20px 24px; border: 1px solid var(--line); border-radius: 12px; color: var(--muted); font-size: 11px; line-height: 1.7; }
.method-note strong { color: var(--ink); }
.method-note p { margin: 4px 0 0; }

.toast { position: fixed; left: 50%; bottom: 26px; z-index: 50; width: min(460px, calc(100% - 32px)); transform: translateX(-50%); padding: 14px 17px; border-radius: 10px; color: white; background: #332b26; box-shadow: 0 14px 40px rgba(0,0,0,.2); font-size: 12px; line-height: 1.5; }
footer { width: min(1180px, calc(100% - 48px)); margin: 0 auto; padding: 28px 0 32px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; color: var(--soft); font-size: 10px; }
footer span { color: var(--red); font-family: var(--serif); letter-spacing: .12em; }
footer p { margin: 0; }

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 42px; }
  .hero-copy { max-width: 680px; }
  .match-panel { max-width: 620px; width: 100%; }
  .direction-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .site-header, main, footer { width: min(100% - 28px, 1180px); }
  .site-header { min-height: 70px; }
  .wordmark small { display: none; }
  nav { gap: 15px; }
  .nav-link { padding: 25px 1px 23px; font-size: 12px; }
  .view { padding: 40px 0 62px; }
  .hero-copy h1 { margin: 15px 0 18px; font-size: 40px; }
  .hero-copy > p { font-size: 14px; line-height: 1.75; }
  .trust-row { margin-top: 23px; }
  .match-panel { padding: 22px 18px; border-radius: 18px; }
  .panel-heading { margin-bottom: 22px; }
  .how-it-works { grid-template-columns: 1fr; margin-top: 45px; }
  .how-it-works > div { padding: 18px 4px; }
  .how-it-works > div + div { border-top: 1px solid var(--line); border-left: 0; }
  .page-intro { margin-bottom: 24px; }
  .back-link { margin-bottom: 24px; }
  .profile-shell { margin: 0 -2px; border-radius: 16px; }
  .step-tab { padding: 15px 9px; text-align: center; }
  .step-tab b { display: block; margin: 0 0 4px; }
  .step-tab.active::after { right: 8px; left: 8px; }
  .profile-step { padding: 25px 18px; }
  .fields, .weights { grid-template-columns: 1fr; }
  .field.wide, .subsection-title { grid-column: auto; }
  .checkbox-grid { grid-template-columns: 1fr; }
  .form-actions { padding: 16px 18px; }
  .form-actions .primary-button, .form-actions .secondary-button { min-width: 0; flex: 1; }
  .success-card { margin: 12px 0; padding: 36px 20px; border-radius: 18px; }
  .uid-ticket { display: block; padding: 18px 12px; }
  .uid-ticket button { display: block; margin: 12px auto 0; }
  .success-actions { grid-template-columns: 1fr; }
  .report-cover { grid-template-columns: 1fr; gap: 24px; padding: 28px 22px; }
  .score-block { text-align: left; }
  .report-tags { padding-top: 17px; }
  footer { display: block; text-align: center; }
  footer p { margin-top: 5px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
