/* ============================================================
 * 国风视觉样式 — 墨色 × 鎏金 × 朱砂 × 宣纸
 * ============================================================ */

:root {
  --ink: #221b15;
  --ink-2: #2c241c;
  --ink-3: #3a2f25;
  --paper: #f5eeda;
  --paper-2: #ede2c6;
  --cream: #f0e6cf;
  --cream-soft: rgba(240, 230, 207, 0.72);
  --cream-faint: rgba(240, 230, 207, 0.38);
  --gold: #c9a45c;
  --gold-bright: #e0bd77;
  --gold-dim: rgba(201, 164, 92, 0.35);
  --cinnabar: #c4553b;
  --cinnabar-bright: #d9714f;
  --seal: #a83a2c;
  --radius: 18px;
  --font-serif: "Noto Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --font-sans: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-calli: "Ma Shan Zheng", "Noto Serif SC", "Songti SC", cursive;
  --shadow-soft: 0 18px 50px rgba(0, 0, 0, 0.35);
  --shadow-card: 0 24px 70px rgba(0, 0, 0, 0.42);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; background-color: var(--ink); }

body {
  min-height: 100vh;
  font-family: var(--font-serif);
  color: var(--cream);
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(201, 164, 92, 0.12), transparent 60%),
    radial-gradient(900px 500px at 8% 110%, rgba(196, 85, 59, 0.10), transparent 55%),
    linear-gradient(165deg, var(--ink) 0%, var(--ink-2) 48%, #241c15 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
em { font-style: normal; }

/* ---------- 背景装饰 ---------- */
.bg-decor {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.bg-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.55;
}
.bg-glow-1 {
  width: 420px; height: 420px;
  top: -120px; right: -80px;
  background: radial-gradient(circle, rgba(201, 164, 92, 0.28), transparent 70%);
}
.bg-glow-2 {
  width: 520px; height: 520px;
  bottom: -220px; left: -140px;
  background: radial-gradient(circle, rgba(196, 85, 59, 0.20), transparent 70%);
}
.bg-mountains {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  width: 100%;
  height: 200px;
  color: rgba(201, 164, 92, 0.14);
}

/* ---------- 布局 ---------- */
#app {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: 0 auto;
  padding: 28px 20px 40px;
  min-height: calc(100vh - 70px);
}

.screen { display: none; animation: screenIn 0.5s var(--ease-out); }
.screen.is-active { display: block; }

@keyframes screenIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* 通用揭示动画 */
.reveal { opacity: 0; animation: revealUp 0.7s var(--ease-out) forwards; }
.d1 { animation-delay: 0.05s; }
.d2 { animation-delay: 0.15s; }
.d3 { animation-delay: 0.28s; }
.d4 { animation-delay: 0.40s; }
.d5 { animation-delay: 0.52s; }
.d6 { animation-delay: 0.64s; }

@keyframes revealUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 15px 34px;
  border-radius: 999px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.12em;
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s, background 0.25s, color 0.25s, border-color 0.25s;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.96); }

.btn-primary {
  background: linear-gradient(135deg, var(--gold-bright), var(--gold) 55%, #a8853f);
  color: #2a2012;
  box-shadow: 0 12px 32px rgba(201, 164, 92, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 42px rgba(201, 164, 92, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
.btn-arrow { font-family: var(--font-sans); transition: transform 0.25s var(--ease-out); }
.btn-primary:hover .btn-arrow { transform: translateX(5px); }

.btn-ghost {
  border: 1px solid rgba(201, 164, 92, 0.5);
  color: rgba(240, 230, 207, 0.88);
  background: rgba(240, 230, 207, 0.07);
}
.btn-ghost:hover {
  border-color: var(--gold);
  color: var(--gold-bright);
  background: rgba(201, 164, 92, 0.14);
}

/* ---------- 首页 ---------- */
.screen-home { padding-top: 4vh; }
.home-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 18px;
  padding: 30px 8px 20px;
}

.home-seal {
  width: 78px; height: 78px;
  display: block;
  transform: rotate(-6deg);
  border-radius: 15px;
  filter: drop-shadow(0 14px 28px rgba(168, 58, 44, 0.42));
  margin-bottom: 6px;
}

.home-eyebrow {
  font-size: 13px;
  letter-spacing: 0.55em;
  text-indent: 0.55em;
  color: var(--gold);
  font-weight: 700;
}

.home-brand-latin {
  font-family: var(--font-sans);
  font-size: 10px;
  letter-spacing: 0.42em;
  text-indent: 0.42em;
  color: var(--cream-faint);
  margin-top: -10px;
}

.home-title {
  font-size: clamp(27px, 6.6vw, 52px);
  font-weight: 900;
  line-height: 1.32;
  letter-spacing: 0.04em;
  color: var(--paper);
  max-width: 100%;
  overflow-wrap: break-word;
  word-break: break-word;
}
.home-title-line { display: block; }
.home-title em {
  color: var(--gold-bright);
  position: relative;
}
.home-title em::after {
  content: "";
  position: absolute;
  left: 2%; right: 2%; bottom: 4px;
  height: 8px;
  background: linear-gradient(90deg, transparent, rgba(196, 85, 59, 0.55), transparent);
  border-radius: 4px;
}

.home-sub {
  font-size: clamp(14px, 3.4vw, 17px);
  color: var(--cream-soft);
  letter-spacing: 0.28em;
  text-indent: 0.28em;
}

.home-quote {
  margin: 8px 0 6px;
  padding: 14px 22px;
  border-top: 1px solid var(--gold-dim);
  border-bottom: 1px solid var(--gold-dim);
  color: var(--cream-faint);
  font-size: 15px;
  letter-spacing: 0.12em;
}
.home-quote-mark { color: var(--gold); font-family: var(--font-calli); font-size: 1.25em; }

.home-start { margin-top: 14px; padding: 17px 46px; font-size: 18px; }

.home-meta {
  display: flex;
  gap: 10px;
  list-style: none;
  margin-top: 10px;
  flex-wrap: wrap;
  justify-content: center;
}
.home-meta li {
  font-family: var(--font-sans);
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--gold);
  border: 1px solid var(--gold-dim);
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(201, 164, 92, 0.08);
}

.home-note {
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--cream-faint);
  margin-top: 8px;
}

.home-index-link {
  font-family: var(--font-sans);
  font-size: 12px;
  letter-spacing: 0.14em;
  color: rgba(201, 164, 92, 0.78);
  text-decoration: none;
  border-bottom: 1px solid rgba(201, 164, 92, 0.28);
  padding-bottom: 3px;
  transition: color 0.3s var(--ease-out), border-color 0.3s var(--ease-out);
}
.home-index-link:hover,
.home-index-link:focus-visible {
  color: var(--gold-bright);
  border-color: var(--gold-bright);
}

.result-persona-link {
  display: block;
  width: fit-content;
  margin: 2px auto 4px;
  font-family: var(--font-sans);
  font-size: 12.5px;
  letter-spacing: 0.12em;
  color: var(--seal);
  text-decoration: none;
  border-bottom: 1px solid rgba(168, 58, 44, 0.28);
  padding-bottom: 3px;
  transition: color 0.3s var(--ease-out), border-color 0.3s var(--ease-out);
}
.result-persona-link:hover,
.result-persona-link:focus-visible { color: #7f2a1f; border-color: #7f2a1f; }


/* ---------- 答题页 ---------- */
.quiz-header {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 6px 2px 18px;
  position: sticky;
  top: 0;
  z-index: 5;
  background: linear-gradient(180deg, rgba(34, 27, 21, 0.96) 70%, rgba(34, 27, 21, 0));
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.quiz-back {
  align-self: flex-start;
  font-family: var(--font-sans);
  font-size: 13px;
  letter-spacing: 0.14em;
  color: var(--cream-faint);
  padding: 6px 2px;
  transition: color 0.2s;
}
.quiz-back:hover { color: var(--gold-bright); }

.quiz-progress-text {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: var(--font-sans);
  margin-bottom: 8px;
}
.quiz-category {
  font-size: 12px;
  letter-spacing: 0.32em;
  color: var(--gold);
}
.quiz-count {
  font-size: 13px;
  color: var(--cream-faint);
  letter-spacing: 0.1em;
}
.quiz-count b { color: var(--gold-bright); font-size: 17px; font-weight: 700; }

.quiz-progress-bar {
  height: 4px;
  border-radius: 999px;
  background: rgba(240, 230, 207, 0.10);
  overflow: hidden;
}
.quiz-progress-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cinnabar), var(--gold-bright));
  box-shadow: 0 0 12px rgba(201, 164, 92, 0.55);
  transition: width 0.45s var(--ease-out);
}

.quiz-body { padding-bottom: 20px; }

.quiz-card {
  background: linear-gradient(170deg, rgba(58, 47, 37, 0.55), rgba(44, 36, 28, 0.65));
  border: 1px solid var(--gold-dim);
  border-radius: var(--radius);
  padding: clamp(22px, 5vw, 38px);
  box-shadow: var(--shadow-soft);
  animation: cardIn 0.45s var(--ease-out);
}
.quiz-card.is-leaving { animation: cardOut 0.22s ease-in forwards; }
.quiz-card.is-back { animation: cardInBack 0.45s var(--ease-out); }

@keyframes cardIn {
  from { opacity: 0; transform: translateX(28px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes cardInBack {
  from { opacity: 0; transform: translateX(-28px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes cardOut {
  to { opacity: 0; transform: translateX(-22px); }
}

.quiz-index {
  font-family: var(--font-calli);
  font-size: 17px;
  color: var(--cinnabar-bright);
  letter-spacing: 0.22em;
  margin-bottom: 12px;
}

.quiz-question {
  font-size: clamp(19px, 4.8vw, 25px);
  font-weight: 700;
  line-height: 1.65;
  color: var(--paper);
  letter-spacing: 0.04em;
  margin-bottom: clamp(20px, 4vw, 28px);
  overflow-wrap: break-word;
  word-break: break-word;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.option {
  display: flex;
  align-items: center;
  gap: 15px;
  width: 100%;
  text-align: left;
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid rgba(240, 230, 207, 0.13);
  background: rgba(240, 230, 207, 0.045);
  color: var(--cream);
  font-size: clamp(15px, 3.9vw, 16.5px);
  line-height: 1.65;
  letter-spacing: 0.03em;
  transition: border-color 0.22s, background 0.22s, transform 0.22s var(--ease-out), box-shadow 0.22s;
  -webkit-tap-highlight-color: transparent;
}
.option:hover {
  border-color: var(--gold);
  background: rgba(201, 164, 92, 0.12);
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.25);
}
.option.is-selected {
  border-color: var(--gold-bright);
  background: linear-gradient(120deg, rgba(201, 164, 92, 0.26), rgba(196, 85, 59, 0.16));
  box-shadow: 0 12px 30px rgba(201, 164, 92, 0.28);
  transform: translateY(-2px);
}
.option.is-disabled { pointer-events: none; }

.option-key {
  flex: 0 0 auto;
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 10px;
  font-family: var(--font-calli);
  font-size: 19px;
  color: var(--gold-bright);
  background: rgba(201, 164, 92, 0.12);
  border: 1px solid var(--gold-dim);
  transition: background 0.22s, color 0.22s, border-color 0.22s;
}
.option-text { flex: 1 1 0; min-width: 0; overflow-wrap: break-word; word-break: break-word; }
.option.is-selected .option-key {
  background: linear-gradient(140deg, var(--gold-bright), var(--gold));
  color: #2a2012;
  border-color: transparent;
}

.quiz-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 20px;
  flex-wrap: wrap;
}
.quiz-hint {
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--cream-faint);
}

/* ---------- 结果页 ---------- */
.result-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  padding-top: 4px;
}

.result-eyebrow {
  font-size: 13px;
  letter-spacing: 0.55em;
  text-indent: 0.55em;
  color: var(--gold);
  font-weight: 700;
}

.result-card {
  position: relative;
  width: 100%;
  background:
    radial-gradient(900px 300px at 85% -10%, rgba(201, 164, 92, 0.16), transparent 55%),
    linear-gradient(168deg, var(--paper) 0%, var(--paper-2) 100%);
  color: var(--ink);
  border-radius: 22px;
  padding: clamp(26px, 6vw, 46px);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.result-card::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(168, 58, 44, 0.22);
  border-radius: 15px;
  pointer-events: none;
}

.result-card-ornament .corner {
  position: absolute;
  width: 26px; height: 26px;
  color: rgba(168, 58, 44, 0.5);
}
.corner-tl { top: 18px; left: 18px; }
.corner-tr { top: 18px; right: 18px; }
.corner-bl { bottom: 18px; left: 18px; }
.corner-br { bottom: 18px; right: 18px; }

.result-top {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.result-seal {
  flex: 0 0 auto;
  width: 64px; height: 64px;
  display: grid; place-items: center;
  background: linear-gradient(150deg, var(--seal), #8c2f22);
  border-radius: 12px;
  transform: rotate(-5deg);
  box-shadow: 0 10px 24px rgba(168, 58, 44, 0.35), inset 0 0 0 2px rgba(245, 238, 218, 0.25);
}
.result-seal span {
  font-family: var(--font-calli);
  font-size: 32px;
  color: var(--paper);
  transform: rotate(5deg);
}

.result-id { flex: 1 1 160px; min-width: 0; }

.result-label {
  font-family: var(--font-sans);
  font-size: 12px;
  letter-spacing: 0.34em;
  color: var(--seal);
  font-weight: 700;
  margin-bottom: 4px;
}
.result-label-dot { margin: 0 8px; font-style: normal; opacity: 0.55; letter-spacing: 0; }

.result-name {
  font-family: var(--font-calli);
  font-size: clamp(38px, 9vw, 56px);
  line-height: 1.15;
  color: var(--ink);
  letter-spacing: 0.08em;
  overflow-wrap: break-word;
}

.result-traits {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.result-traits .trait {
  font-family: var(--font-sans);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--seal);
  border: 1px solid rgba(168, 58, 44, 0.35);
  background: rgba(168, 58, 44, 0.08);
  padding: 5px 12px;
  border-radius: 999px;
}

.result-ring {
  position: relative;
  flex: 0 0 auto;
  width: 116px; height: 116px;
}
.result-ring svg {
  width: 100%; height: 100%;
  transform: rotate(-90deg);
}
.ring-bg, .ring-fill {
  fill: none;
  stroke-width: 9;
  stroke-linecap: round;
}
.ring-bg { stroke: rgba(168, 58, 44, 0.15); }
.ring-fill {
  stroke: var(--seal);
  stroke-dasharray: 326.7;
  stroke-dashoffset: 326.7;
  transition: stroke-dashoffset 1.2s var(--ease-out);
}
.ring-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.1;
}
.ring-text b {
  font-family: var(--font-sans);
  font-size: 28px;
  font-weight: 700;
  color: var(--ink);
}
.ring-text span { font-family: var(--font-sans); font-size: 12px; color: var(--seal); margin-top: -2px; }
.ring-text em {
  font-family: var(--font-sans);
  font-size: 10px;
  letter-spacing: 0.28em;
  text-indent: 0.28em;
  color: rgba(34, 27, 21, 0.55);
  margin-top: 3px;
}

.result-tagline {
  margin: 26px 0 6px;
  padding: 20px 18px;
  text-align: center;
  font-family: var(--font-calli);
  font-size: clamp(19px, 5vw, 25px);
  line-height: 1.75;
  color: var(--seal);
  background: linear-gradient(180deg, rgba(168, 58, 44, 0.07), rgba(168, 58, 44, 0.03));
  border-top: 1px solid rgba(168, 58, 44, 0.2);
  border-bottom: 1px solid rgba(168, 58, 44, 0.2);
  border-radius: 6px;
}
.tagline-quote { opacity: 0.55; margin: 0 4px; }

.result-section { margin-top: 26px; }

.result-h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: var(--ink);
  margin-bottom: 10px;
}
.result-h3 i {
  font-style: normal;
  font-family: var(--font-calli);
  font-size: 15px;
  width: 26px; height: 26px;
  display: grid; place-items: center;
  color: var(--paper);
  background: var(--seal);
  border-radius: 50%;
  letter-spacing: 0;
  flex: 0 0 auto;
}

.result-text {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 2.05;
  color: rgba(34, 27, 21, 0.86);
  letter-spacing: 0.03em;
  text-align: justify;
  overflow-wrap: break-word;
  word-break: break-word;
}

.result-dims {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}
.dim-chip {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(34, 27, 21, 0.05);
  border: 1px solid rgba(34, 27, 21, 0.12);
  min-width: 104px;
}
.dim-chip b {
  font-family: var(--font-sans);
  font-size: 13px;
  letter-spacing: 0.12em;
  color: var(--seal);
}
.dim-chip span {
  font-family: var(--font-sans);
  font-size: 11px;
  color: rgba(34, 27, 21, 0.55);
  letter-spacing: 0.04em;
}

.result-highlight .result-text {
  background: rgba(201, 164, 92, 0.16);
  border-left: 3px solid var(--gold);
  padding: 14px 16px;
  border-radius: 0 12px 12px 0;
}

.result-easter .result-text {
  background: rgba(168, 58, 44, 0.07);
  border: 1px dashed rgba(168, 58, 44, 0.35);
  padding: 14px 16px;
  border-radius: 12px;
}

.result-footer {
  margin-top: 32px;
  padding-top: 18px;
  border-top: 1px solid rgba(34, 27, 21, 0.14);
  text-align: center;
}
.result-footer-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: rgba(34, 27, 21, 0.75);
}
.result-footer-sub {
  margin-top: 5px;
  font-family: var(--font-sans);
  font-size: 10px;
  letter-spacing: 0.16em;
  color: rgba(34, 27, 21, 0.45);
}

.result-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
}

.result-hint {
  font-family: var(--font-sans);
  font-size: 11.5px;
  letter-spacing: 0.12em;
  color: var(--cream-faint);
}

/* ---------- 页脚 ---------- */
.site-footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 18px 16px 30px;
  font-size: 11px;
  letter-spacing: 0.22em;
  color: rgba(240, 230, 207, 0.28);
}
.site-footer p { line-height: 1.9; }
.footer-brand {
  font-family: var(--font-serif);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.4em;
  text-indent: 0.4em;
  color: rgba(201, 164, 92, 0.62);
}
.footer-quote { font-size: 11px; }
.footer-copy {
  font-family: var(--font-sans);
  font-size: 10px;
  letter-spacing: 0.16em;
  color: rgba(240, 230, 207, 0.22);
}

/* ---------- 响应式 ---------- */
@media (max-width: 560px) {
  #app { padding: 18px 14px 30px; }
  .result-top { gap: 14px; }
  .result-seal { width: 52px; height: 52px; }
  .result-seal span { font-size: 26px; }
  .result-ring { width: 96px; height: 96px; margin-left: auto; }
  .ring-text b { font-size: 23px; }
  .quiz-nav { flex-direction: column; align-items: stretch; }
  .quiz-hint { text-align: center; }
  .quiz-nav .btn { width: 100%; }
  .option { padding: 14px 13px; gap: 12px; }
  .option-key { width: 34px; height: 34px; font-size: 17px; }
  .home-quote { font-size: 13px; padding: 12px 14px; }
  .result-actions .btn { flex: 1 1 140px; padding: 14px 18px; font-size: 15px; }
}

@media (min-width: 900px) {
  .screen-home { padding-top: 7vh; }
  .quiz-card { padding: 44px 48px; }
}

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

/* ============================================================
   结果卷首 · 立绘主视觉（编辑海报式，遵循 impeccable 原则）
   强焦点 / 清晰层级 / 统一节奏 4-8-12-16-24-32 / 高对比
   ============================================================ */
.result-top.portrait-layout {
  display: grid !important;
  grid-template-columns: minmax(0, 268px) minmax(0, 1fr);
  gap: 24px;
  align-items: center;
  flex-wrap: nowrap;
}

/* --- 立绘主视觉：利落海报边缘 + 钤印压角 --- */
.portrait-frame {
  position: relative;
  margin: 0;
  border-radius: 4px;
  overflow: hidden;
  background: var(--ink);
  box-shadow: 0 16px 40px rgba(34, 27, 21, 0.38);
}
.portrait-frame img {
  /* 按原始 9:16 比例完整显示，不裁切；加载完成前透明，避免闪现上一张/alt 文字 */
  display: block;
  width: 100%;
  height: auto;
  opacity: 0;
  transition: opacity 0.35s ease;
}
.portrait-frame img.is-loaded { opacity: 1; }
.portrait-frame .result-seal {
  position: absolute;
  z-index: 2;
  top: 12px;
  left: 12px;
  width: 48px;
  height: 48px;
  border-radius: 6px;
  transform: rotate(-8deg);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45), inset 0 0 0 2px rgba(245, 238, 218, 0.28);
}
.portrait-frame .result-seal span { font-size: 26px; transform: rotate(8deg); }
.portrait-frame figcaption {
  padding: 12px 2px 0;
  text-align: center;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3em;
  color: var(--gold);
}

/* --- 右侧信息柱：eyebrow → 人名 → 分隔 → 契合度 → 特质 --- */
.result-identity {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 16px;
  min-width: 0;
  padding: 4px 0 8px;
}
.identity-eyebrow {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.24em;
  color: var(--seal);
  margin: 0;
}
.identity-eyebrow .eyebrow-rule {
  display: inline-block;
  width: 20px;
  height: 1px;
  background: var(--gold);
  opacity: 0.7;
}
.identity-eyebrow .eyebrow-zi { color: var(--gold); font-weight: 400; }
.result-identity .result-name {
  font-family: var(--font-calli);
  font-size: clamp(46px, 8vw, 66px);
  line-height: 1.08;
  letter-spacing: 0.06em;
  color: var(--ink);
  white-space: nowrap;
  margin: -4px 0 -8px;
}
.identity-rule {
  height: 1px;
  background: linear-gradient(90deg, var(--seal) 0%, var(--gold-dim) 45%, transparent 100%);
  margin: 4px 0;
}
.identity-metric { display: flex; align-items: center; gap: 16px; }
.result-identity .result-ring { flex: 0 0 auto; width: 104px; height: 104px; }
.result-identity .ring-text b { font-size: 28px; }
.result-identity .ring-text span { font-size: 12px; }
.metric-note {
  font-family: var(--font-sans);
  font-size: 12px;
  line-height: 1.9;
  letter-spacing: 0.12em;
  color: rgba(34, 27, 21, 0.66);
  margin: 0;
}
.metric-note strong {
  display: block;
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--seal);
}
.result-identity .result-traits { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.result-identity .trait { font-size: 11px; padding: 6px 12px; }

@media (max-width: 760px) {
  .result-top.portrait-layout { grid-template-columns: minmax(0, 200px) minmax(0, 1fr); gap: 16px; }
  .result-identity .result-name { font-size: clamp(38px, 6vw, 48px); }
  .result-identity .result-ring { width: 88px; height: 88px; }
}
@media (max-width: 600px) {
  .result-top.portrait-layout { grid-template-columns: 1fr; gap: 14px; justify-items: center; }
  .portrait-frame { width: min(100%, 280px); }
  .portrait-frame figcaption { padding-top: 10px; font-size: 10px; }
  .result-identity { width: 100%; align-items: center; text-align: center; gap: 12px; padding: 0; }
  .identity-eyebrow { justify-content: center; }
  .identity-rule { width: 100%; }
  .result-identity .result-name { font-size: clamp(42px, 12vw, 56px); white-space: normal; margin: 0; }
  .identity-metric { justify-content: center; }
  .result-identity .result-ring { width: 92px; height: 92px; }
  .result-identity .ring-text b { font-size: 24px; }
  .metric-note { text-align: left; }
  .result-identity .result-traits { justify-content: center; }
}
@media (max-width: 380px) {
  .portrait-frame { width: min(100%, 232px); }
  .result-identity .result-name { font-size: 38px; }
  .metric-note { font-size: 11px; }
}

/* ---------- Top3 最像的人物 ---------- */
.result-top3 {
  margin: 2px 0 0;
  font-family: var(--font-sans);
  font-size: 12px;
  letter-spacing: 0.06em;
  line-height: 1.7;
  color: rgba(34, 27, 21, 0.55);
}
.result-top3:not(:empty) {
  padding-top: 8px;
  border-top: 1px dashed var(--gold-dim);
}

/* ---------- 退出确认弹窗 ---------- */
.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(20, 15, 10, 0.62);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.modal-mask[hidden] { display: none; }
.modal-card {
  width: min(100%, 340px);
  background: linear-gradient(165deg, var(--paper), var(--paper-2));
  border-radius: 22px;
  padding: 28px 26px 24px;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--gold-dim);
  text-align: center;
}
.modal-title {
  margin: 0 0 10px;
  font-family: var(--font-serif);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--ink);
}
.modal-text {
  margin: 0 0 22px;
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.8;
  color: rgba(34, 27, 21, 0.68);
}
.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}
.modal-actions .btn {
  flex: 1 1 0;
  padding: 12px 10px;
  font-size: 15px;
  letter-spacing: 0.08em;
}
.modal-actions .btn-ghost {
  border-color: rgba(168, 58, 44, 0.45);
  color: var(--seal);
  background: transparent;
}
.modal-actions .btn-ghost:hover {
  border-color: var(--seal);
  color: var(--seal);
  background: rgba(168, 58, 44, 0.08);
}
@media (max-width: 560px) {
  .modal-actions { flex-direction: column; }
}

/* ---------- 结果页分享入口 ---------- */
body.no-scroll { overflow: hidden; }
.result-actions { flex-direction: column; gap: 12px; }
.btn-share-main { width: 100%; padding: 16px 20px; font-size: 16px; }
.result-actions-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  width: 100%;
}
.result-actions-row .btn { flex: 1 1 130px; padding: 12px 14px; font-size: 14px; }

/* ---------- 分享弹层 ---------- */
.share-mask {
  align-items: flex-start;
  overflow-y: auto;
  padding: 20px 14px;
  -webkit-overflow-scrolling: touch;
}
.share-card {
  position: relative;
  width: min(100%, 440px);
  max-height: none;
  margin: auto 0;
  padding: 22px 22px 20px;
}
.share-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-right: 26px;
  margin-bottom: 14px;
}
.share-eyebrow {
  font-size: 10.5px;
  letter-spacing: 0.28em;
  color: var(--seal);
  margin-bottom: 5px;
}
.share-title {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: 0.03em;
  color: var(--ink);
}
.share-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid rgba(168, 58, 44, 0.35);
  color: var(--seal);
  font-size: 20px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border-color 0.2s;
}
.share-close:hover { background: rgba(168, 58, 44, 0.1); border-color: var(--seal); }

.share-poster-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 240px;
  border: 1px solid var(--gold-dim);
  border-radius: 14px;
  background: linear-gradient(160deg, #2a2119, #1d1712);
  overflow: hidden;
}
.share-poster-frame img {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 52vh;
  min-height: 240px;
  object-fit: contain;
}
.share-poster-frame img[hidden] { display: none; }
.share-poster-loading {
  font-family: var(--font-sans);
  font-size: 13px;
  letter-spacing: 0.1em;
  color: var(--gold-bright);
  text-align: center;
  padding: 20px;
}
.share-poster-loading[hidden] { display: none; }

.share-tip {
  margin: 10px 0 14px;
  font-family: var(--font-sans);
  font-size: 12px;
  line-height: 1.7;
  text-align: center;
  color: rgba(34, 27, 21, 0.68);
}
.share-tip[hidden] { display: none; }

.share-text-box { margin-bottom: 12px; }
.share-text-label {
  display: block;
  margin-bottom: 6px;
  font-family: var(--font-sans);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  color: rgba(34, 27, 21, 0.55);
}
.share-text {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--gold-dim);
  border-radius: 10px;
  resize: none;
  background: rgba(34, 27, 21, 0.035);
  font-family: var(--font-sans);
  font-size: 12.5px;
  line-height: 1.75;
  color: var(--ink);
  -webkit-user-select: text;
  user-select: text;
}
.share-text:focus { outline: none; border-color: var(--gold); }

.share-card .share-actions { gap: 10px; margin-bottom: 10px; }
.share-card .share-actions .btn {
  flex: 1 1 0;
  min-width: 0;
  padding: 11px 8px;
  font-size: 13.5px;
  letter-spacing: 0.04em;
}
.share-card .btn-ghost {
  border-color: rgba(168, 58, 44, 0.45);
  color: var(--seal);
  background: transparent;
}
.share-card .btn-ghost:hover {
  border-color: var(--seal);
  background: rgba(168, 58, 44, 0.08);
}
.share-actions-sub .btn { font-family: var(--font-sans); font-weight: 400; }
.share-feedback {
  min-height: 18px;
  margin-top: 6px;
  font-family: var(--font-sans);
  font-size: 12px;
  text-align: center;
  color: var(--seal);
}
