* { box-sizing: border-box; }

:root {
  --violet: #7c3aed;
  --cyan: #06b6d4;
  --rose: #fb7185;
  --gold: #facc15;
  --ink: #f8fafc;
  --muted: #cbd5e1;
  --deep: #070b1a;
  --card: rgba(15, 23, 42, .74);
  --line: rgba(255, 255, 255, .16);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  background:
    radial-gradient(circle at 18% 16%, rgba(124, 58, 237, .48) 0%, transparent 30%),
    radial-gradient(circle at 82% 18%, rgba(6, 182, 212, .38) 0%, transparent 31%),
    radial-gradient(circle at 50% 108%, rgba(251, 113, 133, .22) 0%, transparent 42%),
    linear-gradient(135deg, #050816 0%, #10172d 48%, #060914 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-x: hidden;
  color: var(--ink);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(circle at center, black 0%, transparent 78%);
  pointer-events: none;
}

.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(circle, rgba(255,255,255,.25) 1px, transparent 1.5px);
  background-size: 70px 70px;
  opacity: .18;
  animation: drift 18s linear infinite;
  pointer-events: none;
}

.bg-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(12px);
  opacity: .65;
  animation: float 9s ease-in-out infinite;
}

.orb-a { width: 280px; height: 280px; left: -80px; top: 80px; background: #7c3aed; }
.orb-b { width: 300px; height: 300px; right: -110px; top: 35px; background: #06b6d4; animation-delay: -2s; }
.orb-c { width: 220px; height: 220px; right: 20%; bottom: -80px; background: #fb7185; animation-delay: -4s; }

.page { width: 100%; padding: 30px; position: relative; z-index: 1; }

.quiz-card {
  position: relative;
  max-width: 920px;
  min-height: 590px;
  margin: auto;
  padding: 38px;
  border-radius: 34px;
  background: var(--card);
  box-shadow: 0 34px 100px rgba(0, 0, 0, .42);
  backdrop-filter: blur(24px);
  border: 1px solid var(--line);
  overflow: hidden;
}

.quiz-card::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 26px;
  pointer-events: none;
}

.quiz-card::after {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  right: -180px;
  bottom: -190px;
  background: conic-gradient(from 90deg, rgba(124,58,237,.2), rgba(6,182,212,.24), rgba(251,113,133,.18), rgba(124,58,237,.2));
  border-radius: 50%;
  filter: blur(4px);
  opacity: .7;
  pointer-events: none;
}

.ribbon {
  position: absolute;
  right: -48px;
  top: 30px;
  width: 220px;
  transform: rotate(36deg);
  text-align: center;
  padding: 8px 0;
  background: linear-gradient(90deg, var(--violet), var(--cyan));
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 1px;
  box-shadow: 0 10px 28px rgba(6, 182, 212, .22);
}

.top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.sub-title {
  margin: 0 0 8px;
  color: #67e8f9;
  font-weight: 900;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: 44px;
  line-height: 1.1;
  letter-spacing: 1px;
  background: linear-gradient(90deg, #fff, #a5f3fc, #fda4af);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.intro {
  margin: 12px 0 0;
  color: var(--muted);
  font-weight: 700;
}

.counter {
  padding: 13px 20px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--violet), var(--cyan));
  color: white;
  font-weight: 900;
  box-shadow: 0 14px 32px rgba(6, 182, 212, .22);
  white-space: nowrap;
}

.decor-line {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 13px;
  margin: 26px 0 18px;
  color: #a5f3fc;
  font-weight: 900;
}

.decor-line::before,
.decor-line::after {
  content: "";
  height: 1px;
  flex: 1;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.28), transparent);
}

.progress-wrap {
  position: relative;
  z-index: 1;
  height: 12px;
  padding: 3px;
  border-radius: 999px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.14);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--violet), var(--cyan), var(--rose));
  transition: width .35s ease;
}

.question-stage {
  position: relative;
  z-index: 1;
  min-height: 360px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loading-screen {
  text-align: center;
  color: var(--muted);
}

.loading-screen h2 {
  color: #fff;
  margin: 18px 0 8px;
}

.compass-loader {
  width: 92px;
  height: 92px;
  margin: auto;
  position: relative;
}

.compass-loader .ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,.22);
  border-top-color: #22d3ee;
  border-right-color: #a78bfa;
  animation: spin 1.1s linear infinite;
}

.compass-loader .needle {
  position: absolute;
  left: 43px;
  top: 16px;
  width: 6px;
  height: 60px;
  border-radius: 999px;
  background: linear-gradient(#fda4af 0 50%, #67e8f9 50% 100%);
  transform: rotate(32deg);
}

.compass-loader .core {
  position: absolute;
  inset: 28px;
  border-radius: 50%;
  background: rgba(15,23,42,.9);
  display: grid;
  place-items: center;
  color: #fda4af;
  font-weight: 900;
}

.question-box {
  width: 100%;
  animation: enter .42s ease both;
}

.question-box.leave {
  animation: leave .36s ease both;
}

.bank-tag {
  display: inline-flex;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.14);
  color: #a5f3fc;
  font-size: 13px;
  font-weight: 900;
}

.question-title {
  margin: 24px 0 22px;
  font-size: 27px;
  line-height: 1.45;
  color: #fff;
  font-weight: 900;
}

.options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.option {
  min-height: 72px;
  padding: 16px 18px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 19px;
  background: rgba(255,255,255,.08);
  color: #f8fafc;
  font-size: 16px;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
  transition: transform .18s ease, background .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.option:hover {
  transform: translateY(-3px);
  background: rgba(255,255,255,.14);
  border-color: rgba(103,232,249,.55);
  box-shadow: 0 16px 34px rgba(0,0,0,.24);
}

.result {
  width: 100%;
  text-align: center;
  animation: enter .42s ease both;
}

.result .label {
  display: inline-flex;
  padding: 8px 16px;
  border-radius: 999px;
  color: #a5f3fc;
  background: rgba(6, 182, 212, .14);
  border: 1px solid rgba(103,232,249,.24);
  font-weight: 900;
}

.result strong {
  display: block;
  margin: 16px 0 4px;
  font-size: 70px;
  line-height: 1;
  background: linear-gradient(90deg, #a78bfa, #67e8f9, #fda4af);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.result h2 {
  margin: 14px 0 12px;
  font-size: 32px;
  color: #fff;
}

.result p {
  max-width: 720px;
  margin: 12px auto;
  color: var(--muted);
  line-height: 1.85;
  font-weight: 700;
}

.score-pill {
  display: inline-flex;
  margin: 10px auto;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.15);
  color: #fff;
  font-weight: 900;
}

.actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.save-btn {
  border: 0;
  border-radius: 999px;
  padding: 13px 20px;
  background: linear-gradient(90deg, var(--violet), var(--cyan));
  color: white;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 16px 34px rgba(6, 182, 212, .18);
}

.restart-btn { background: linear-gradient(90deg, #334155, #64748b); }
.home-btn { background: linear-gradient(90deg, #fb7185, #facc15); color: #111827; }

@keyframes float {
  0%,100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-22px) scale(1.05); }
}

@keyframes drift {
  from { transform: translateY(0); }
  to { transform: translateY(70px); }
}

@keyframes spin { to { transform: rotate(360deg); } }

@keyframes enter {
  from { opacity: 0; transform: translateY(18px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes leave {
  to { opacity: 0; transform: translateY(-18px) scale(.98); }
}

@media (max-width: 720px) {
  body { align-items: flex-start; overflow-y: auto; }
  .page { padding: 16px; }
  .quiz-card { padding: 26px 18px; border-radius: 26px; min-height: 620px; }
  h1 { font-size: 34px; }
  .top { flex-direction: column; }
  .options { grid-template-columns: 1fr; }
  .question-title { font-size: 22px; }
  .result strong { font-size: 54px; }
}


/* 保存结果专用样式：纯净背景，不带页面大光条，保证导出图片清楚 */
.export-result-wrap {
  position: fixed;
  left: -99999px;
  top: 0;
  width: 860px;
  padding: 46px;
  background: linear-gradient(135deg, #070b1a 0%, #111827 55%, #0f172a 100%);
  color: #f8fafc;
  z-index: -1;
}

.export-result-card {
  width: 100%;
  padding: 42px 44px;
  border-radius: 30px;
  background: #111827;
  border: 1px solid rgba(255,255,255,.16);
  box-shadow: 0 24px 70px rgba(0,0,0,.45);
  text-align: center;
}

.export-title {
  margin-bottom: 20px;
  font-size: 34px;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: 2px;
}

.export-result-card .result {
  animation: none !important;
}

.export-result-card .label {
  color: #67e8f9;
  background: rgba(6, 182, 212, .14);
}

.export-result-card strong {
  color: #67e8f9 !important;
  background: none !important;
  -webkit-background-clip: initial !important;
  background-clip: initial !important;
  -webkit-text-fill-color: #67e8f9 !important;
}

.export-result-card h2 {
  color: #ffffff;
}

.export-result-card p,
.export-result-card small {
  color: #dbeafe;
}

.export-result-card .score-pill {
  color: #ffffff;
  background: rgba(255,255,255,.1);
}
