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

: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: 76px; height: 76px;
  display: grid; place-items: center;
  background: linear-gradient(150deg, var(--seal), #8c2f22);
  border-radius: 14px;
  transform: rotate(-6deg);
  box-shadow: 0 14px 34px rgba(168, 58, 44, 0.45), inset 0 0 0 3px rgba(245, 238, 218, 0.22);
  margin-bottom: 6px;
}
.home-seal span {
  font-family: var(--font-calli);
  font-size: 40px;
  color: var(--paper);
  line-height: 1;
  transform: rotate(6deg);
}

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

.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;
}

/* ---------- 答题页 ---------- */
.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: 600;
}

.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);
}

/* ---------- 响应式 ---------- */
@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;
  }
}
