/* ============================================================
   梦境人格测试 · 视觉层
   深空底色 + 极光 + 玻璃卡片；一种主色随结果类型切换
   ============================================================ */

:root {
  --bg: #06060c;
  --ink: #ece7f4;
  --ink-soft: #c9c1d8;
  --muted: #9a92ad;
  --dim: #6d6684;
  --line: rgba(255, 255, 255, 0.085);
  --line-strong: rgba(255, 255, 255, 0.16);
  --surface: rgba(255, 255, 255, 0.042);
  --surface-2: rgba(255, 255, 255, 0.028);
  --accent: #c0b0ff;
  --accent-2: #7ce0d3;
  --accent-ink: #150f28;
  --serif: "Songti SC", "Source Han Serif SC", "Noto Serif SC", "STSong", "SimSun", "Georgia", serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Segoe UI", system-ui, sans-serif;
  --mono: "SF Mono", "JetBrains Mono", "Cascadia Mono", Consolas, monospace;
  --shell: 720px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.75;
  letter-spacing: 0.01em;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ---------- 背景：极光 + 星点 + 暗角 ---------- */
.aurora { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.aurora i {
  position: absolute; display: block; border-radius: 50%;
  filter: blur(46px); opacity: 0.5;
}
.aurora i:nth-child(1) { width: 56vw; height: 56vw; left: -14vw; top: -18vw; background: radial-gradient(circle, #4b2f8f 0%, rgba(75,47,143,0) 68%); }
.aurora i:nth-child(2) { width: 48vw; height: 48vw; right: -12vw; top: 8vh; background: radial-gradient(circle, #125b63 0%, rgba(18,91,99,0) 68%); animation-delay: -8s; }
.aurora i:nth-child(3) { width: 60vw; height: 60vw; left: 12vw; bottom: -30vw; background: radial-gradient(circle, #3a1245 0%, rgba(58,18,69,0) 70%); animation-delay: -16s; }
@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(3vw, 4vh, 0) scale(1.12); }
}
@media (prefers-reduced-motion: no-preference) and (min-width: 900px) {
  .aurora i { animation: drift 26s ease-in-out infinite alternate; }
}

.stars { position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: 0.5;
  background-image:
    radial-gradient(1px 1px at 12% 22%, rgba(255,255,255,.7), transparent),
    radial-gradient(1px 1px at 78% 12%, rgba(255,255,255,.55), transparent),
    radial-gradient(1px 1px at 34% 64%, rgba(255,255,255,.45), transparent),
    radial-gradient(1.5px 1.5px at 62% 78%, rgba(255,255,255,.5), transparent),
    radial-gradient(1px 1px at 88% 56%, rgba(255,255,255,.4), transparent),
    radial-gradient(1px 1px at 46% 36%, rgba(255,255,255,.35), transparent);
}
@keyframes twinkle { from { opacity: .28 } to { opacity: .6 } }

.vignette { position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(120% 90% at 50% 0%, transparent 40%, rgba(3,3,8,.72) 100%); }

/* ---------- 布局 ---------- */
#app { position: relative; z-index: 1; }
.shell { width: 100%; max-width: var(--shell); margin: 0 auto; padding: 40px 22px 120px; }
.view { animation: enter 0.55s cubic-bezier(.2,.7,.2,1) both; }
.view.hidden { display: none; }
@keyframes enter { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.hidden { display: none !important; }

/* ---------- 排版 ---------- */
.kicker {
  font-family: var(--mono); font-size: 11px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--dim);
}
.display {
  font-family: var(--serif); font-weight: 600; letter-spacing: .02em;
  line-height: 1.32; margin: 0;
}
h1.display { font-size: clamp(34px, 7.2vw, 52px); }
h2.display { font-size: clamp(24px, 4.6vw, 32px); }
h3.display { font-size: 20px; }
.lede { color: var(--ink-soft); font-size: 16.5px; line-height: 1.9; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.tiny { font-size: 13px; }
.gold { color: #e9c887; }

/* ---------- 按钮 ---------- */
.btn {
  appearance: none; border: 1px solid var(--line-strong); background: var(--surface);
  color: var(--ink); font-family: var(--sans); font-size: 15px; letter-spacing: .04em;
  padding: 14px 26px; border-radius: 999px; cursor: pointer; transition: .25s ease;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
}
.btn:hover { border-color: rgba(255,255,255,.3); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 140%);
  color: var(--accent-ink); border: none; font-weight: 600;
  box-shadow: 0 10px 40px -14px var(--accent);
}
.btn-primary:hover { box-shadow: 0 16px 50px -14px var(--accent); filter: brightness(1.05); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--muted); }
.btn-ghost:hover { color: var(--ink); }
.btn-block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

/* ---------- 封面 ---------- */
.hero { padding-top: 8vh; text-align: left; }
.hero .seal {
  display: inline-flex; align-items: center; gap: 10px; margin-bottom: 26px;
  font-family: var(--mono); font-size: 11px; letter-spacing: .2em; color: var(--dim);
}
.hero .seal::before {
  content: ""; width: 26px; height: 1px; background: linear-gradient(90deg, var(--accent), transparent);
}
.hero h1 { margin-bottom: 22px; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero .lede { max-width: 30em; }
.hero-actions { margin-top: 40px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.hero-facts { margin-top: 54px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px;
  background: var(--line); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.hero-facts div { background: linear-gradient(180deg, rgba(255,255,255,.035), transparent); padding: 18px 16px; }
.hero-facts b { display: block; font-family: var(--serif); font-size: 22px; font-weight: 600; color: var(--ink); }
.hero-facts span { font-size: 12.5px; color: var(--muted); letter-spacing: .02em; }
.hero-note { margin-top: 26px; font-size: 13px; color: var(--dim); line-height: 1.8; }

/* ---------- 答题 ---------- */
.quiz-top { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.quiz-count { font-family: var(--mono); font-size: 12px; letter-spacing: .16em; color: var(--muted); }
.quiz-count b { color: var(--ink); font-weight: 600; }
.progress { height: 2px; background: rgba(255,255,255,.08); border-radius: 2px; overflow: hidden; }
.progress i { display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .45s cubic-bezier(.2,.7,.2,1); }

.q-block { padding-top: 46px; }
.q-text { font-family: var(--serif); font-size: clamp(23px, 4.4vw, 30px); font-weight: 600; line-height: 1.55; letter-spacing: .015em; margin: 0 0 30px; }
.q-options { display: flex; flex-direction: column; gap: 12px; }

.opt {
  display: flex; align-items: flex-start; gap: 15px; width: 100%; text-align: left;
  padding: 16px 18px; border-radius: 16px; cursor: pointer;
  border: 1px solid var(--line); background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.012));
  color: var(--ink-soft); font-family: var(--sans); font-size: 15.5px; line-height: 1.7;
  transition: transform .2s ease, border-color .2s ease, background .2s ease, box-shadow .25s ease;
}
.opt:hover { transform: translateY(-1px); border-color: rgba(192,176,255,.42); background: rgba(192,176,255,.07); color: var(--ink); box-shadow: 0 12px 34px -22px #000; }
.opt:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.opt .k {
  flex: 0 0 26px; height: 26px; border-radius: 9px; display: grid; place-items: center;
  font-family: var(--mono); font-size: 12px; color: var(--muted);
  border: 1px solid var(--line-strong); background: rgba(255,255,255,.03); margin-top: 2px;
  transition: .2s ease;
}
.opt:hover .k { color: var(--ink); border-color: rgba(192,176,255,.5); }
.opt.is-picked { border-color: var(--accent); background: rgba(192,176,255,.14); color: #fff; }
.opt.is-picked .k { background: var(--accent); color: var(--accent-ink); border-color: transparent; font-weight: 700; }
.opt.is-skip { color: var(--muted); font-size: 14px; border-style: dashed; padding: 13px 18px; background: transparent; }
.opt.is-skip:hover { border-color: rgba(255,255,255,.24); background: rgba(255,255,255,.03); }
.opt.is-skip .k { font-size: 11px; }

.quiz-foot { margin-top: 34px; display: flex; justify-content: space-between; align-items: center; }
.quiz-hint { font-size: 12.5px; color: var(--dim); }
kbd { font-family: var(--mono); font-size: 11px; border: 1px solid var(--line-strong); border-bottom-width: 2px;
  border-radius: 5px; padding: 1px 6px; color: var(--muted); background: rgba(255,255,255,.04); }

/* ---------- 免费结果 ---------- */
.result-head { text-align: center; padding-top: 22px; }
.badge {
  --ring: var(--accent);
  position: relative; width: 176px; height: 176px; margin: 0 auto 30px; border-radius: 50%;
  display: grid; place-items: center; isolation: isolate;
}
.badge::before {
  content: ""; position: absolute; inset: -1px; border-radius: 50%; z-index: -1;
  background: conic-gradient(from 0deg, transparent 0 18%, var(--ring) 32%, var(--accent-2) 52%, transparent 68% 100%);
  filter: blur(6px); opacity: .9; animation: spin 14s linear infinite;
}
.badge::after {
  content: ""; position: absolute; inset: 6px; border-radius: 50%; z-index: -1;
  background: radial-gradient(circle at 50% 34%, rgba(255,255,255,.14), rgba(6,6,12,.92) 62%), var(--bg);
  border: 1px solid var(--line-strong);
}
@keyframes spin { to { transform: rotate(360deg); } }
.badge .letter {
  font-family: var(--serif); font-size: 74px; line-height: 1; font-weight: 600;
  background: linear-gradient(160deg, #fff, var(--ring));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.badge.enter { animation: badgeIn .9s cubic-bezier(.2,.8,.2,1) both; }
@keyframes badgeIn { from { opacity: 0; transform: scale(.86) translateY(10px); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }

.result-type { font-family: var(--serif); font-size: clamp(30px, 6vw, 42px); font-weight: 600; margin: 0 0 8px; letter-spacing: .03em; }
.result-en { font-family: var(--mono); font-size: 11px; letter-spacing: .26em; text-transform: uppercase; color: var(--dim); }
.result-tag { margin: 20px auto 0; font-size: 17px; color: var(--ink-soft); font-family: var(--serif); line-height: 1.7; max-width: 26em; }
.meta-row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 20px; }
.pill {
  font-size: 12px; letter-spacing: .06em; color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px; padding: 5px 13px; background: var(--surface-2);
}
.pill.accent { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); background: color-mix(in srgb, var(--accent) 10%, transparent); }

/* 前三强条 */
.bars { margin: 44px 0 0; display: flex; flex-direction: column; gap: 14px; }
.bar-row { display: grid; grid-template-columns: 92px 1fr 52px; align-items: center; gap: 14px; }
.bar-name { font-size: 13.5px; color: var(--ink-soft); text-align: right; white-space: nowrap; }
.bar-track { height: 6px; border-radius: 4px; background: rgba(255,255,255,.07); overflow: hidden; }
.bar-track i { display: block; height: 100%; width: 0; border-radius: 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width 1.1s cubic-bezier(.2,.8,.2,1) .18s; }
.bar-row.is-first .bar-name { color: var(--ink); font-weight: 600; }
.bar-val { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.bars-note { margin-top: 12px; font-size: 12.5px; color: var(--dim); text-align: center; }

/* 卡片区 */
.panel {
  margin-top: 46px; border: 1px solid var(--line); border-radius: 22px; padding: 30px 28px;
  background: linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.012));
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.panel-head h3 { font-family: var(--serif); font-size: 18px; margin: 0; font-weight: 600; }
.panel-head .kicker { color: var(--dim); }
.locked { position: relative; overflow: hidden; }
.locked .fade { position: absolute; inset: auto 0 0 0; height: 150px;
  background: linear-gradient(180deg, transparent, rgba(6,6,12,.96) 70%); }
.locked-cta { text-align: center; margin-top: 8px; position: relative; }
#free-card { max-height: none; overflow: visible; }

.upsell { margin-top: 40px; border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line)); border-radius: 22px;
  padding: 30px 28px; background:
    radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 60%),
    linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.012)); }
.upsell h3 { font-family: var(--serif); font-size: 21px; margin: 0 0 10px; }
.upsell ul { margin: 16px 0 24px; padding-left: 0; list-style: none; display: grid; gap: 9px; }
.upsell li { font-size: 14.5px; color: var(--ink-soft); display: flex; gap: 10px; align-items: flex-start; }
.upsell li::before { content: "◍"; color: var(--accent); font-size: 11px; margin-top: 6px; }

/* ---------- 报告 ---------- */
.report-hero { padding-top: 10px; }
.compare { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 14px;
  border: 1px solid var(--line); border-radius: 18px; padding: 20px 22px; background: var(--surface-2); }
.compare .cell { text-align: center; }
.compare .k { font-family: var(--mono); font-size: 10.5px; letter-spacing: .18em; color: var(--dim); display: block; margin-bottom: 6px; }
.compare .v { font-family: var(--serif); font-size: 19px; color: var(--ink); }
.compare .arrow { color: var(--dim); font-size: 13px; }
.compare .same { color: var(--accent-2); }

.radar-wrap { display: grid; justify-items: center; margin: 34px 0 6px; }
.radar { width: min(360px, 86vw); height: auto; overflow: visible; }
.radar .ring { fill: none; stroke: rgba(255,255,255,.09); stroke-width: 1; }
.radar .spoke { stroke: rgba(255,255,255,.08); stroke-width: 1; }
.radar .area { fill: url(#radarFill); stroke: var(--accent); stroke-width: 1.6; }
.radar .dot { fill: var(--accent); }
.radar .lbl { fill: var(--muted); font-size: 11px; font-family: var(--sans); letter-spacing: .04em; }
.radar .val { fill: var(--dim); font-size: 10px; font-family: var(--mono); }
.radar .g1 { stop-color: var(--accent); stop-opacity: .40; }
.radar .g2 { stop-color: var(--accent); stop-opacity: .04; }

.report-sec { margin-top: 54px; }
.report-sec > .kicker { display: block; margin-bottom: 14px; }
.md { color: var(--ink-soft); font-size: 15.5px; line-height: 1.95; }
.md .md-h { font-family: var(--serif); color: var(--ink); font-weight: 600; letter-spacing: .02em; }
.md h3.md-h { font-size: 21px; margin: 38px 0 12px; }
.md h4.md-h { font-size: 17px; margin: 30px 0 10px; color: var(--ink); }
.md h5.md-h { font-size: 15px; margin: 24px 0 8px; color: var(--accent); letter-spacing: .08em; }
.md p { margin: 0 0 15px; }
.md strong { color: var(--ink); font-weight: 600; }
.md ul, .md ol { margin: 0 0 18px; padding-left: 20px; }
.md li { margin: 7px 0; }
.md li::marker { color: var(--accent); }
.md blockquote.md-quote { margin: 0 0 18px; padding: 16px 20px; border-left: 2px solid var(--accent);
  background: rgba(255,255,255,.03); border-radius: 0 12px 12px 0; color: var(--ink-soft); }
.md blockquote.md-quote p:last-child { margin-bottom: 0; }
.md hr.rule { border: none; height: 1px; background: var(--line); margin: 30px 0; }
.md .table-wrap { overflow-x: auto; margin: 0 0 20px; border: 1px solid var(--line); border-radius: 14px; }
.md table { border-collapse: collapse; width: 100%; font-size: 14px; }
.md th, .md td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); }
.md th { color: var(--muted); font-weight: 500; letter-spacing: .06em; font-size: 12.5px; background: rgba(255,255,255,.03); }
.md tr:last-child td { border-bottom: none; }

.dim-grid { display: grid; gap: 26px; }
.dim-card { border-top: 1px solid var(--line); padding-top: 22px; }
.dim-card h4 { font-family: var(--serif); font-size: 17px; margin: 0 0 12px; display: flex; align-items: baseline; gap: 10px; }
.dim-card h4 .lv { font-family: var(--mono); font-size: 11px; color: var(--accent); letter-spacing: .14em; }

.share { margin-top: 54px; border-top: 1px solid var(--line); padding-top: 30px; text-align: center; }
.share p { color: var(--muted); font-size: 14px; margin: 0 0 18px; }
.share-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ---------- 第 49 题 ---------- */
.openq { padding-top: 40px; }
textarea.editor {
  width: 100%; min-height: 140px; resize: vertical; padding: 18px; border-radius: 16px;
  border: 1px solid var(--line); background: rgba(255,255,255,.03); color: var(--ink);
  font-family: var(--sans); font-size: 15.5px; line-height: 1.8;
}
textarea.editor:focus { outline: none; border-color: rgba(192,176,255,.5); box-shadow: 0 0 0 3px rgba(192,176,255,.1); }
textarea.editor::placeholder { color: var(--dim); }
.counter { text-align: right; font-family: var(--mono); font-size: 11.5px; color: var(--dim); margin-top: 8px; }

/* ---------- 弹层 / toast ---------- */
.sheet-mask { position: fixed; inset: 0; z-index: 40; background: rgba(3,3,8,.78); backdrop-filter: blur(8px);
  display: grid; place-items: end center; animation: fade .3s ease both; }
.sheet { width: min(560px, 100%); border-radius: 26px 26px 0 0; padding: 30px 26px 34px; color: var(--ink);
  background: linear-gradient(180deg, #1b1530, #0d0a18); border: 1px solid rgba(255,255,255,.14); border-bottom: none;
  box-shadow: 0 -30px 80px rgba(0,0,0,.6); animation: slideUp .4s cubic-bezier(.2,.8,.2,1) both; }
.sheet h3 { font-family: var(--serif); font-size: 23px; margin: 0 0 8px; color: #f4f1ff; }
.sheet .price { font-family: var(--mono); font-size: 13px; color: var(--accent); letter-spacing: .1em; }
.sheet ul { list-style: none; padding: 0; margin: 18px 0 24px; display: grid; gap: 8px; }
.sheet li { font-size: 14.5px; color: #cfc9e2; }
.sheet li::before { content: "— "; color: var(--accent); }
@keyframes slideUp { from { transform: translateY(30px); opacity: .5 } to { transform: none; opacity: 1 } }
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }

#toast { position: fixed; left: 50%; bottom: 40px; transform: translate(-50%, 20px); z-index: 60;
  padding: 11px 20px; border-radius: 999px; font-size: 13.5px; color: var(--ink);
  background: rgba(20,16,30,.92); border: 1px solid var(--line-strong);
  opacity: 0; pointer-events: none; transition: .35s ease; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 类型配色 ---------- */
body[data-type="A"] { --accent: #b9a7ff; --accent-2: #8ad8ff; }
body[data-type="B"] { --accent: #e9c887; --accent-2: #ff9d6e; }
body[data-type="C"] { --accent: #f2a0bd; --accent-2: #ffc9a3; }
body[data-type="D"] { --accent: #9db4d8; --accent-2: #7ce0d3; }
body[data-type="E"] { --accent: #ff9d6e; --accent-2: #ff6f7d; }
body[data-type="F"] { --accent: #6fd6ff; --accent-2: #9ee6c4; }
body[data-type="G"] { --accent: #c9b6ff; --accent-2: #7ce0d3; }

/* ---------- 页脚 ---------- */
.foot { margin-top: 72px; padding-top: 22px; border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-size: 12px; color: var(--dim); letter-spacing: .04em; }

/* ---------- 响应式 ---------- */
@media (max-width: 560px) {
  .shell { padding: 28px 16px 100px; }
  .hero { padding-top: 4vh; }
  .hero-facts { grid-template-columns: 1fr; }
  .panel { padding: 24px 18px; border-radius: 18px; }
  .bar-row { grid-template-columns: 74px 1fr 44px; gap: 10px; }
  .compare { grid-template-columns: 1fr; gap: 8px; text-align: center; }
  .compare .arrow { display: none; }
  .badge { width: 150px; height: 150px; }
  .badge .letter { font-size: 62px; }
  .md { font-size: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
