:root {
  --bg-0: #0c0f1f;
  --bg-1: #151a30;
  --gold: #d9b25b;
  --gold-soft: #f0d99a;
  --wine: #6e1f2e;
  --ink: #e9e4d6;
  --muted: #9aa0b5;
  --card: rgba(255, 255, 255, 0.04);
  --line: rgba(217, 178, 91, 0.25);
}

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

html, body {
  height: 100%;
  font-family: "Songti SC", "Noto Serif SC", "Georgia", serif;
  color: var(--ink);
  background: radial-gradient(1200px 800px at 70% -10%, #1d2547 0%, var(--bg-0) 55%, #070912 100%);
  overflow-x: hidden;
}

.bg-orbs { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.orb { position: absolute; border-radius: 50%; filter: blur(70px); opacity: 0.5; }
.orb-1 { width: 360px; height: 360px; background: #2b3c7a; top: -80px; left: -60px; }
.orb-2 { width: 300px; height: 300px; background: var(--wine); bottom: -90px; right: -40px; }
.orb-3 { width: 260px; height: 260px; background: #4a3a12; top: 40%; right: 18%; opacity: 0.35; }

.app {
  position: relative;
  z-index: 1;
  max-width: 680px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
}

.screen { display: none; width: 100%; animation: fade 0.45s ease; }
.screen.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* 开始页 */
.crest {
  font-size: 64px; color: var(--gold);
  text-align: center; text-shadow: 0 0 24px rgba(217,178,91,0.4);
  margin-bottom: 8px;
}
.title {
  text-align: center; font-size: 34px; letter-spacing: 2px;
  background: linear-gradient(180deg, var(--gold-soft), var(--gold));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.subtitle { text-align: center; color: var(--muted); margin: 10px 0 22px; font-size: 15px; }

.intro-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 20px 22px; line-height: 1.8; font-size: 14.5px; color: #cfd3e0;
}
.axis-legend { list-style: none; margin: 12px 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 18px; }
.axis-legend li { font-size: 14px; color: #c8cde0; }
.axis-legend b { color: var(--gold); margin-right: 6px; letter-spacing: 1px; }
.hint { color: var(--muted); font-size: 13px; margin-top: 6px; }
.footnote { text-align: center; color: #5e6480; font-size: 12px; margin-top: 16px; }

/* 开篇图鉴 */
.gallery { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin: 18px 0 4px; }
.gallery-item { margin: 0; text-align: center; }
.gallery-item img {
  width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px;
  border: 1px solid rgba(217,178,91,0.25); filter: saturate(0.92); transition: transform .15s, border-color .15s;
}
.gallery-item:hover img { transform: translateY(-2px); border-color: var(--gold); }
.gallery-item figcaption { font-size: 11px; color: var(--muted); margin-top: 4px; line-height: 1.2; }


/* 按钮 */
.btn-primary {
  display: block; width: 100%; margin-top: 22px; padding: 15px;
  font-family: inherit; font-size: 17px; letter-spacing: 1px; cursor: pointer;
  color: #1a1206; border: none; border-radius: 12px;
  background: linear-gradient(180deg, var(--gold-soft), var(--gold));
  box-shadow: 0 8px 24px rgba(217,178,91,0.25); transition: transform .15s, box-shadow .15s;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(217,178,91,0.4); }
.btn-primary:active { transform: translateY(0); }

.btn-ghost {
  padding: 13px 18px; font-family: inherit; font-size: 15px; cursor: pointer;
  color: var(--gold-soft); background: transparent; border: 1px solid var(--line); border-radius: 12px;
  transition: background .15s;
}
.btn-ghost:hover { background: rgba(217,178,91,0.08); }

/* 进度 */
.progress-wrap { margin-bottom: 26px; }
.progress-top { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.live-code { color: var(--gold); letter-spacing: 2px; font-weight: bold; }
.progress-bar { height: 6px; background: rgba(255,255,255,0.07); border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--gold), var(--gold-soft)); transition: width .35s ease; }

/* 题目 */
.question { font-size: 22px; line-height: 1.5; margin-bottom: 22px; min-height: 64px; }
.options { display: grid; gap: 12px; }
.option {
  text-align: left; padding: 16px 18px; font-family: inherit; font-size: 15.5px; cursor: pointer;
  color: var(--ink); background: var(--card); border: 1px solid rgba(255,255,255,0.08); border-radius: 12px;
  transition: border-color .15s, background .15s, transform .1s; display: flex; gap: 12px; align-items: center;
}
.option:hover { border-color: var(--gold); background: rgba(217,178,91,0.06); }
.option:active { transform: scale(0.99); }
.option .opt-key {
  flex: 0 0 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line);
  display: grid; place-items: center; font-size: 13px; color: var(--gold);
}

/* 结果页 */
.result-portrait { position: relative; width: 150px; height: 150px; margin: 0 auto 6px; }
.result-img {
  width: 150px; height: 150px; border-radius: 50%; object-fit: cover;
  border: 3px solid var(--gold); box-shadow: 0 0 30px rgba(217,178,91,0.35); background: #1a1f38;
}
.result-crest {
  position: absolute; right: 6px; bottom: 6px; width: 34px; height: 34px; border-radius: 50%;
  background: var(--bg-1); border: 1px solid var(--line); display: grid; place-items: center;
  font-size: 18px; color: var(--gold);
}
.result-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
  border: 1px solid var(--line); border-radius: 20px; padding: 30px 26px; text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}
.result-crest { font-size: 56px; color: var(--gold); text-shadow: 0 0 24px rgba(217,178,91,0.4); }
.result-code {
  display: inline-block; margin-top: 6px; font-size: 30px; letter-spacing: 6px; font-weight: bold;
  color: var(--gold-soft);
}
.result-name { font-size: 27px; margin-top: 10px; }
.result-title { color: var(--muted); font-size: 14px; margin-top: 4px; }
.result-type {
  display: inline-block; margin: 14px 0 6px; padding: 6px 14px; font-size: 14px;
  border: 1px solid var(--line); border-radius: 999px; color: var(--gold-soft);
}
.result-tier { font-size: 13px; letter-spacing: 1px; margin-bottom: 6px; font-weight: bold; }
.tier-good { color: #7ed6a5; }
.tier-medium { color: #e8c46a; }
.tier-bad { color: #e0796f; }
.result-desc { text-align: left; line-height: 1.85; font-size: 14.5px; color: #d3d7e6; margin: 14px 0; }
.result-traits { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 18px; }
.result-traits span {
  font-size: 12.5px; padding: 5px 12px; border-radius: 999px;
  background: rgba(217,178,91,0.1); border: 1px solid var(--line); color: var(--gold-soft);
}
.result-axes { text-align: left; font-size: 13px; color: var(--muted); line-height: 1.7; margin-bottom: 22px; border-top: 1px dashed var(--line); padding-top: 14px; }
.result-axes b { color: var(--gold); }
.result-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.result-actions .btn-primary,
.result-actions .btn-ghost { margin-top: 0; flex: 1 1 auto; width: auto; }



/* 提示 */
.toast {
  position: fixed; left: 50%; bottom: 36px; transform: translateX(-50%) translateY(20px);
  background: var(--gold); color: #1a1206; padding: 11px 20px; border-radius: 10px; font-size: 14px;
  opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; z-index: 10;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 480px) {
  .title { font-size: 28px; }
  .question { font-size: 19px; }
  .axis-legend { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: repeat(3, 1fr); }
  .result-portrait, .result-img { width: 124px; height: 124px; }
}
