/* ═══════════ 基底 ═══════════ */
:root {
  --paper: #f6f2ea;
  --paper-2: #efe9de;
  --ink: #1a1714;
  --ink-2: #5a5148;
  --ink-3: #8d8377;
  --rule: #ddd4c6;
  --accent: #b8422e;
  --accent-soft: rgba(184, 66, 46, 0.1);
  --serif: "Noto Serif SC", Songti SC, serif;
  --sans: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --maxw: 720px;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, .serif { font-family: var(--serif); }

button { font: inherit; cursor: pointer; }

.eyebrow {
  font-size: 12px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 20px;
  font-weight: 500;
}

.req { color: var(--accent); }

/* ═══════════ HERO ═══════════ */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 28px;
  overflow: hidden;
}

.hero-canvas { position: absolute; inset: 0; z-index: 0; }

.glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: .5;
}
.glow-a {
  width: 620px; height: 620px;
  background: radial-gradient(circle, rgba(214,138,110,.55), transparent 70%);
  top: -180px; right: -140px;
  animation: drift 22s ease-in-out infinite alternate;
}
.glow-b {
  width: 520px; height: 520px;
  background: radial-gradient(circle, rgba(150,160,190,.45), transparent 70%);
  bottom: -160px; left: -120px;
  animation: drift 27s ease-in-out infinite alternate-reverse;
}
@keyframes drift {
  to { transform: translate3d(60px, -40px, 0) scale(1.12); }
}

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

.hero-lines { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-lines path {
  stroke: rgba(26,23,20,.13);
  stroke-width: 1.2;
  stroke-dasharray: 2400;
  stroke-dashoffset: 2400;
  animation: draw 3s cubic-bezier(.16,1,.3,1) forwards;
}
.hero-lines path:nth-child(2) { animation-delay: .25s; }
.hero-lines path:nth-child(3) { animation-delay: .5s; }
@keyframes draw { to { stroke-dashoffset: 0; } }

.topbar {
  position: absolute; top: 0; left: 0; right: 0;
  z-index: 3;
  display: flex; align-items: center; justify-content: space-between;
  padding: 26px 30px;
}
.brand {
  font-family: var(--serif);
  font-weight: 900;
  font-size: 17px;
  letter-spacing: .04em;
}
.topbar-meta { font-size: 12px; color: var(--ink-3); letter-spacing: .06em; }

.hero-inner {
  position: relative; z-index: 2;
  max-width: var(--maxw);
  width: 100%;
  margin: 0 auto;
}

.hero-title {
  font-size: clamp(38px, 7.4vw, 76px);
  line-height: 1.14;
  font-weight: 900;
  margin: 0 0 26px;
  letter-spacing: -.02em;
}
.hero-title span { display: block; }
.hero-title .accent { color: var(--accent); }

.hero-sub {
  font-size: clamp(15px, 1.7vw, 17.5px);
  line-height: 1.75;
  color: var(--ink-2);
  max-width: 33em;
  margin: 0 0 38px;
}

.hero-actions { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.hero-note { font-size: 13px; color: var(--ink-3); }

.btn-primary {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--ink); color: var(--paper);
  border: none; border-radius: 999px;
  padding: 15px 30px;
  font-size: 15px; font-weight: 600;
  transition: transform .3s cubic-bezier(.16,1,.3,1), background .3s, box-shadow .3s;
  box-shadow: 0 1px 2px rgba(0,0,0,.1);
}
.btn-primary:hover { background: var(--accent); transform: translateY(-2px); box-shadow: 0 10px 26px rgba(184,66,46,.28); }
.btn-primary:disabled { opacity: .45; pointer-events: none; }
.btn-primary .arr { transition: transform .3s cubic-bezier(.16,1,.3,1); }
.btn-primary:hover .arr { transform: translateX(4px); }
.btn-lg { padding: 18px 40px; font-size: 16.5px; }

.reveal { opacity: 0; transform: translateY(20px); animation: rise .9s cubic-bezier(.16,1,.3,1) forwards; animation-delay: var(--d, 0ms); }
@keyframes rise { to { opacity: 1; transform: none; } }

.scroll-hint {
  position: absolute; bottom: 34px; left: 50%; transform: translateX(-50%);
  z-index: 2; width: 1px; height: 46px; background: var(--rule); overflow: hidden;
}
.scroll-hint span { position: absolute; inset: 0; background: var(--accent); animation: sweep 2.1s ease-in-out infinite; }
@keyframes sweep { 0% { transform: translateY(-100%);} 60%,100% { transform: translateY(100%);} }

/* ═══════════ 问卷 ═══════════ */
.progress-rail { position: fixed; top: 0; left: 0; right: 0; height: 2px; background: var(--rule); z-index: 50; }
.progress-fill { height: 100%; width: 0; background: var(--accent); transition: width .45s cubic-bezier(.16,1,.3,1); }

.sheet { padding: 90px 28px 40px; }
.sheet-inner { max-width: var(--maxw); margin: 0 auto; }

.letter-head { margin-bottom: 58px; padding-bottom: 34px; border-bottom: 1px solid var(--rule); }
.letter-head h2 { font-size: 30px; margin: 0 0 14px; font-weight: 600; }
.letter-head p { font-size: 15px; line-height: 1.85; color: var(--ink-2); margin: 0; }

.q { padding: 34px 0; border-bottom: 1px solid var(--rule); opacity: 0; transform: translateY(22px); }
.q.in { animation: rise .8s cubic-bezier(.16,1,.3,1) forwards; }

.q-head { display: flex; gap: 14px; align-items: baseline; margin-bottom: 20px; }
.q-num { font-family: var(--serif); font-size: 13px; color: var(--ink-3); min-width: 26px; font-variant-numeric: tabular-nums; }
.q-title { font-size: 18px; line-height: 1.6; font-weight: 600; margin: 0; flex: 1; }
.q-hint { display: inline-block; font-size: 11.5px; color: var(--ink-3); border: 1px solid var(--rule); border-radius: 999px; padding: 2px 9px; margin-left: 8px; vertical-align: middle; font-weight: 400; }

.opts { display: flex; flex-direction: column; gap: 2px; padding-left: 40px; }
.opt { display: flex; align-items: center; gap: 13px; padding: 12px 14px; margin-left: -14px; border-radius: 10px; cursor: pointer; transition: background .22s; }
.opt:hover { background: var(--paper-2); }
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.mark { width: 18px; height: 18px; border: 1.5px solid var(--ink-3); flex: 0 0 18px; transition: all .22s cubic-bezier(.16,1,.3,1); position: relative; }
.opt[data-type="radio"] .mark { border-radius: 50%; }
.opt[data-type="checkbox"] .mark { border-radius: 5px; }
.opt input:checked + .mark { border-color: var(--accent); background: var(--accent); }
.opt input:checked + .mark::after {
  content: ""; position: absolute; left: 5px; top: 1.5px;
  width: 5px; height: 10px; border: solid var(--paper); border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.opt-label { font-size: 15.5px; color: var(--ink-2); transition: color .22s; }
.opt input:checked ~ .opt-label { color: var(--ink); font-weight: 500; }

.field { padding-left: 40px; }
.field input, .field textarea {
  width: 100%; background: transparent;
  border: none; border-bottom: 1.5px solid var(--rule);
  padding: 12px 2px; font: inherit; font-size: 15.5px; color: var(--ink);
  transition: border-color .25s; resize: vertical; font-family: var(--sans);
}
.field textarea { min-height: 92px; line-height: 1.7; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); }
.field input::placeholder, .field textarea::placeholder { color: var(--ink-3); }

.q.missing .q-title { color: var(--accent); }
.q.missing .field input, .q.missing .field textarea { border-color: var(--accent); }

.submit-zone { padding: 50px 0 10px; text-align: center; }
.submit-hint { font-size: 13.5px; color: var(--accent); min-height: 20px; margin: 0 0 18px; }

/* ═══════════ 分析中 ═══════════ */
.analyzing { min-height: 100svh; display: flex; align-items: center; justify-content: center; padding: 60px 28px; }
.analyzing-inner { max-width: var(--maxw); width: 100%; }
.analyzing-title { font-size: clamp(28px, 4.4vw, 44px); line-height: 1.32; font-weight: 900; margin: 0 0 52px; letter-spacing: -.015em; }

.readers { display: flex; flex-direction: column; gap: 0; }
.reader-row { padding: 26px 0; border-top: 1px solid var(--rule); display: flex; align-items: center; gap: 20px; }
.reader-row:last-child { border-bottom: 1px solid var(--rule); }
.reader-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ink-3); flex: 0 0 9px; transition: background .3s; }
.reader-row[data-state="running"] .reader-dot { background: var(--accent); animation: pulse 1.5s ease-in-out infinite; }
.reader-row[data-state="done"] .reader-dot { background: #3f7d4e; }
.reader-row[data-state="error"] .reader-dot { background: #b8422e; }
@keyframes pulse { 50% { opacity: .25; transform: scale(.7); } }

.reader-meta { flex: 1; min-width: 0; }
.reader-name { font-size: 16px; font-weight: 600; font-family: var(--serif); }
.reader-desc { font-size: 12.5px; color: var(--ink-3); margin-top: 3px; }
.reader-stat { font-size: 12.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }

.analyzing-foot { font-size: 13px; color: var(--ink-3); margin-top: 34px; line-height: 1.7; }

/* ═══════════ 结果 ═══════════ */
.result { padding: 80px 28px 40px; }
.rs { max-width: var(--maxw); margin: 0 auto 78px; }
.rs-label { font-size: 11.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 22px; font-weight: 500; }

/* 人格卡片 */
.archetypes { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.arch { padding: 40px 30px; text-align: center; }
.arch + .arch { border-left: 1px solid var(--rule); }
.arch-by { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 18px; }
.arch-emoji { font-size: 46px; line-height: 1; margin-bottom: 16px; }
.arch-title { font-family: var(--serif); font-size: 25px; font-weight: 900; margin: 0 0 10px; letter-spacing: -.01em; }
.arch-tag { font-size: 14px; color: var(--ink-2); line-height: 1.6; margin: 0; }

/* 雷达 */
.radar-wrap { display: flex; gap: 34px; align-items: center; flex-wrap: wrap; }
.radar { flex: 0 0 300px; max-width: 100%; }
.radar-legend { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 15px; }
.leg-row { display: flex; align-items: center; gap: 12px; font-size: 13.5px; }
.leg-name { flex: 0 0 66px; color: var(--ink-2); }
.leg-bars { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.leg-bar { height: 5px; background: var(--paper-2); border-radius: 3px; overflow: hidden; }
.leg-bar i { display: block; height: 100%; width: 0; border-radius: 3px; transition: width 1.1s cubic-bezier(.16,1,.3,1); }
.leg-bar.sol i { background: var(--accent); }
.leg-bar.opus i { background: #4a6fa5; }
.leg-delta { flex: 0 0 40px; text-align: right; font-size: 11.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }

.swatch { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--ink-3); }
.swatch i { width: 10px; height: 10px; border-radius: 2px; }
.swatches { display: flex; gap: 20px; margin-bottom: 22px; }

/* 共识 */
.consensus-top { display: flex; align-items: baseline; gap: 16px; margin-bottom: 26px; }
.agree-num { font-family: var(--serif); font-size: 62px; font-weight: 900; line-height: 1; color: var(--accent); font-variant-numeric: tabular-nums; }
.agree-cap { font-size: 14px; color: var(--ink-2); line-height: 1.6; }
.verdicts { border-top: 1px solid var(--rule); }
.verdict { display: flex; align-items: center; gap: 16px; padding: 17px 0; border-bottom: 1px solid var(--rule); font-size: 14.5px; flex-wrap: wrap; }
.verdict-k { flex: 0 0 100px; color: var(--ink-3); font-size: 13px; }
.verdict-v { flex: 1; min-width: 160px; }
.tag { display: inline-block; padding: 3px 11px; border-radius: 999px; font-size: 13px; border: 1px solid var(--rule); margin-right: 7px; }
.tag.sol { border-color: rgba(184,66,46,.4); color: var(--accent); }
.tag.opus { border-color: rgba(74,111,165,.45); color: #4a6fa5; }
.badge { font-size: 11.5px; padding: 3px 10px; border-radius: 999px; font-weight: 500; }
.badge.same { background: rgba(63,125,78,.13); color: #35683f; }
.badge.diff { background: var(--accent-soft); color: var(--accent); }

/* 旗 */
.flags { display: grid; grid-template-columns: 1fr 1fr; gap: 0 40px; }
.flag-col h4 { font-size: 14px; margin: 0 0 6px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.flag-col + .flag-col { border-left: 1px solid var(--rule); padding-left: 40px; }
.flag { padding: 20px 0; border-bottom: 1px solid var(--rule); }
.flag-t { font-size: 15px; font-weight: 600; margin: 0 0 7px; }
.flag-d { font-size: 13.5px; line-height: 1.7; color: var(--ink-2); margin: 0 0 9px; }
.flag-q { font-size: 12.5px; color: var(--ink-3); border-left: 2px solid var(--rule); padding-left: 11px; line-height: 1.6; font-style: italic; }

/* 需求 / 行动 */
.needs { display: flex; flex-wrap: wrap; gap: 10px; }
.need { border: 1px solid var(--rule); border-radius: 999px; padding: 9px 18px; font-size: 14px; background: var(--paper-2); }
.acts { border-top: 1px solid var(--rule); }
.act { padding: 22px 0; border-bottom: 1px solid var(--rule); display: flex; gap: 18px; align-items: baseline; }
.act-n { font-family: var(--serif); font-size: 13px; color: var(--accent); flex: 0 0 22px; font-variant-numeric: tabular-nums; }
.act-b { flex: 1; }
.act-t { font-size: 15.5px; font-weight: 600; margin: 0 0 6px; }
.act-w { font-size: 13.5px; color: var(--ink-2); line-height: 1.7; margin: 0; }

/* 未说出口 */
.unspoken { border-left: 2px solid var(--accent); padding: 6px 0 6px 26px; }
.unspoken p { font-family: var(--serif); font-size: clamp(19px, 2.6vw, 25px); line-height: 1.62; margin: 0 0 12px; font-weight: 400; }
.unspoken .src { font-size: 12px; color: var(--ink-3); }

/* 信 */
.letters { display: flex; flex-direction: column; gap: 0; border-top: 1px solid var(--rule); }
.lt { padding: 34px 0; border-bottom: 1px solid var(--rule); }
.lt-by { font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 15px; }
.lt p { font-family: var(--serif); font-size: 16px; line-height: 2; margin: 0; color: var(--ink); }

.rs-h { font-family: var(--serif); font-size: clamp(24px,3.4vw,34px); font-weight: 900; margin: 0 0 26px; letter-spacing: -.015em; }

.err-note { background: var(--accent-soft); border-radius: 10px; padding: 16px 20px; font-size: 13.5px; color: var(--accent); line-height: 1.7; }

.result-actions { max-width: var(--maxw); margin: 0 auto; text-align: center; padding-top: 20px; }

.foot {
  border-top: 1px solid var(--rule);
  padding: 30px 28px; text-align: center;
  font-size: 12px; color: var(--ink-3);
  display: flex; gap: 10px; justify-content: center; flex-wrap: wrap;
}
.foot-sep { opacity: .5; }

.fade-in { animation: rise .85s cubic-bezier(.16,1,.3,1) both; }

@media (max-width: 680px) {
  .archetypes, .flags { grid-template-columns: 1fr; }
  .arch + .arch { border-left: none; border-top: 1px solid var(--rule); }
  .flag-col + .flag-col { border-left: none; padding-left: 0; margin-top: 18px; }
  .opts, .field { padding-left: 0; }
  .hero { padding: 0 22px; }
  .sheet, .result { padding-left: 22px; padding-right: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .reveal, .q { opacity: 1; transform: none; }
}
