/* ============================================================
 * 测评系统样式 —— 卡通暖色调（奶油底 + 波点 + 橙粉渐变）
 * 主题色变量集中在 :root，想换配色改这里即可。
 * ============================================================ */

:root {
  --bg: #fff6ec;
  --ink: #6b4632;
  --ink-dim: rgba(107, 70, 50, 0.68);
  --ink-faint: rgba(107, 70, 50, 0.42);
  --card: #fffdf8;
  --card-border: #ffdcb0;
  --card-border-soft: #ffe6c6;
  --accent: #ff9e4f;
  --accent-deep: #f97316;
  --accent2: #ff7eb3;
  --accent3: #ffd166;
  --grad: linear-gradient(120deg, #ffb25e, #ff7eb3);
  --radius: 22px;
  --shadow: 0 8px 24px rgba(235, 160, 100, 0.2);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  min-height: 100vh;
  color: var(--ink);
  font-family: "Yuanti SC", "YouYuan", "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  line-height: 1.7;
  background-color: var(--bg);
  background-image:
    radial-gradient(820px 460px at 10% -8%, rgba(255, 193, 130, 0.5), transparent 55%),
    radial-gradient(760px 440px at 96% 2%, rgba(255, 168, 186, 0.42), transparent 52%),
    radial-gradient(720px 560px at 50% 112%, rgba(255, 216, 138, 0.45), transparent 55%),
    radial-gradient(rgba(255, 173, 118, 0.16) 1.7px, transparent 1.8px);
  background-size: auto, auto, auto, 26px 26px;
}

.stage {
  max-width: 780px;
  margin: 0 auto;
  padding: 28px 18px 40px;
}

/* ---------------- 头部 ---------------- */
.brand { text-align: center; margin-bottom: 26px; }

.brand-title {
  max-width: 640px;
  margin: 0 auto;
  font-size: clamp(19px, 4.6vw, 26px);
  font-weight: 800;
  line-height: 1.55;
  letter-spacing: 1px;
  background: linear-gradient(120deg, #f97316, #ec4899 60%, #f59e0b);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.foot {
  margin-top: 34px;
  text-align: center;
  font-size: 12px;
  color: var(--ink-faint);
  letter-spacing: 1px;
}

/* ---------------- 通用 ---------------- */
.view { display: none; }
.view.active { display: block; animation: fadeUp 0.35s ease both; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.panel {
  background: var(--card);
  border: 2px solid var(--card-border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}

.panel-title {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 2px;
  margin-bottom: 14px;
  color: var(--ink);
}
.panel-title::before { content: "✦ "; color: var(--accent-deep); }

.section-title {
  font-size: 17px;
  letter-spacing: 3px;
  margin: 28px 4px 14px;
  color: var(--ink-dim);
}

.hidden { display: none !important; }

/* ---------------- 按钮 ---------------- */
.btn {
  border: 2px solid transparent;
  border-radius: 999px;
  padding: 10px 24px;
  font-size: 15px;
  font-family: inherit;
  font-weight: 700;
  letter-spacing: 2px;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.15s ease;
  user-select: none;
}
.btn:active { transform: translateY(2px); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.btn.primary {
  background: var(--grad);
  color: #fff;
  text-shadow: 0 1px 2px rgba(158, 56, 20, 0.35);
  box-shadow: 0 4px 0 rgba(224, 122, 82, 0.6), 0 10px 20px rgba(249, 115, 22, 0.3);
}
.btn.primary:not(:disabled):hover { filter: brightness(1.05); }
.btn.primary:not(:disabled):active { box-shadow: 0 1px 0 rgba(224, 122, 82, 0.6), 0 4px 12px rgba(249, 115, 22, 0.25); }

.btn.ghost {
  background: #fff;
  border-color: var(--card-border);
  color: var(--ink-dim);
  box-shadow: 0 3px 0 rgba(235, 170, 120, 0.35);
}
.btn.ghost:not(:disabled):hover { color: var(--ink); border-color: var(--accent); }
.btn.ghost:not(:disabled):active { box-shadow: 0 1px 0 rgba(235, 170, 120, 0.35); }

.btn.big { padding: 13px 36px; font-size: 16px; }
.btn.tiny { padding: 5px 14px; font-size: 12px; letter-spacing: 1px; }

/* 临时调试按钮 */
.btn.debug {
  margin-top: 16px;
  background: #fffdf6;
  border: 2px dashed #ffc9a0;
  color: #c07a3f;
  font-weight: 600;
}
.btn.debug:hover { border-color: var(--accent); color: #a35f24; }

/* ---------------- 开始页 ---------------- */
.intro-card { text-align: center; padding: 34px 26px; }

.intro-meta { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-bottom: 18px; }

.chip {
  font-size: 12.5px;
  color: #a3611f;
  border: 2px solid var(--card-border);
  border-radius: 999px;
  padding: 3px 14px;
  background: #fff7ec;
  letter-spacing: 1px;
  font-weight: 600;
}

.intro-text {
  max-width: 480px;
  margin: 0 auto 20px;
  font-size: 14.5px;
  color: var(--ink-dim);
}
.intro-text strong { color: var(--accent-deep); font-weight: 700; }

.intro-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

.intro-note { margin-top: 16px; font-size: 12px; color: var(--ink-faint); }

/* ---------------- 答题页 ---------------- */
.quiz-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.progress {
  flex: 1;
  height: 10px;
  border-radius: 999px;
  background: #ffe9d2;
  border: 1.5px solid #ffd9ae;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: var(--grad);
  transition: width 0.25s ease;
}

.q-count {
  font-size: 13px;
  color: var(--ink-dim);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  font-weight: 700;
}

.qcard { padding: 28px 24px; }

.q-text {
  font-size: 18px;
  font-weight: 800;
  line-height: 1.6;
  margin-bottom: 20px;
  letter-spacing: 0.5px;
}

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

.option {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
  padding: 13px 16px;
  border-radius: 18px;
  border: 2px solid var(--card-border-soft);
  background: #fffefb;
  color: var(--ink);
  font-size: 15px;
  font-family: inherit;
  line-height: 1.55;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
}
.option:hover { border-color: var(--accent); background: #fff4e6; }
.option:active { transform: translateY(1px); }
.option.selected {
  border-color: var(--accent);
  background: #fff1df;
  box-shadow: 0 4px 0 rgba(255, 158, 79, 0.35), 0 8px 18px rgba(249, 115, 22, 0.16);
}

.option-letter {
  flex: none;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 800;
  color: #c96a1e;
  border: 2px solid #ffd9ae;
  background: #fff7ec;
}
.option.selected .option-letter {
  color: #fff;
  background: var(--grad);
  border-color: transparent;
  text-shadow: 0 1px 2px rgba(158, 56, 20, 0.35);
}

.option-text { flex: 1; }

.quiz-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 18px;
}

/* ---- 答题概览浮层 ---- */
.dots-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 244, 230, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 50;
}

.dots-panel { width: 100%; max-width: 560px; }

.dots-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  font-size: 14px;
  color: var(--ink-dim);
  font-weight: 700;
}

.dots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
  gap: 8px;
  max-height: 55vh;
  overflow-y: auto;
  padding-right: 4px;
}

.dot {
  height: 36px;
  border-radius: 12px;
  border: 2px solid var(--card-border);
  background: #fff7ec;
  color: var(--ink-faint);
  font-size: 12.5px;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
  transition: transform 0.1s ease;
}
.dot:hover { transform: scale(1.08); }
.dot.done {
  color: #7a4a12;
  background: var(--accent3);
  border-color: transparent;
  box-shadow: 0 2px 0 rgba(214, 158, 46, 0.45);
}
.dot.cur { outline: 3px solid var(--accent); outline-offset: 1px; }

/* ---------------- 结果页 ---------------- */
#result-body > .panel { margin-bottom: 20px; animation: fadeUp 0.45s ease both; }

/* 最佳角色 */
.hero { text-align: center; padding: 34px 26px 28px; position: relative; overflow: hidden; }
.hero::before {
  content: "";
  position: absolute;
  inset: -40%;
  background: radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--char, #ff9e4f) 22%, transparent), transparent 55%);
  pointer-events: none;
}
.hero > * { position: relative; }

.hero-kicker {
  font-size: 12.5px;
  color: var(--ink-dim);
  letter-spacing: 4px;
  margin-bottom: 8px;
  font-weight: 700;
}

.hero-name {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: 3px;
  color: var(--char, var(--accent-deep));
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.6);
}
.hero-name small {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-dim);
  margin-left: 6px;
  letter-spacing: 2px;
}

.hero-match { margin: 14px auto 4px; display: flex; align-items: baseline; justify-content: center; gap: 8px; }
.hero-match b {
  font-size: 40px;
  font-weight: 800;
  background: linear-gradient(120deg, #ff8c42, #ff5c8a);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-variant-numeric: tabular-nums;
}
.hero-match span { font-size: 13px; color: var(--ink-dim); letter-spacing: 2px; font-weight: 700; }

.hero-quote {
  margin: 16px auto 0;
  max-width: 460px;
  font-size: 15px;
  color: #b04a74;
  font-style: italic;
  font-weight: 600;
  background: #fff2f6;
  border: 2px dashed #ffc3d8;
  border-radius: 16px;
  padding: 12px 18px;
}

.hero-info { margin-top: 20px; text-align: left; display: flex; flex-direction: column; gap: 12px; }
.hero-row { display: flex; gap: 14px; align-items: flex-start; }
.hero-row dt {
  flex: none;
  font-size: 12px;
  color: #a3611f;
  letter-spacing: 2px;
  font-weight: 700;
  border: 1.5px solid #ffd9ae;
  border-radius: 999px;
  padding: 2px 10px;
  margin-top: 3px;
  background: #fff7ec;
}
.hero-row dd { flex: 1; font-size: 14px; color: var(--ink); }

/* 雷达图 */
.radar-panel { text-align: center; }
.radar-wrap { max-width: 430px; margin: 0 auto; }
#result-radar { width: 100%; aspect-ratio: 1 / 1; display: block; }
.radar-summary {
  max-width: 520px;
  margin: 10px auto 0;
  font-size: 14px;
  color: var(--ink-dim);
}

/* 十二维卡片（单列） */
.dim-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.dim-card { padding: 18px; background: var(--card); }

.dim-head { display: flex; align-items: center; justify-content: space-between; }
.dim-name { font-size: 16px; font-weight: 800; letter-spacing: 2px; }
.dim-score {
  font-size: 20px;
  font-weight: 800;
  background: linear-gradient(120deg, #ff8c42, #ff5c8a);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-variant-numeric: tabular-nums;
}

.dim-poles {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--ink-faint);
  margin: 8px 0 6px;
  letter-spacing: 1px;
  font-weight: 600;
}

.dim-track {
  height: 10px;
  border-radius: 999px;
  background: #ffe9d2;
  position: relative;
  overflow: visible;
}
.dim-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--grad);
  position: relative;
  min-width: 12px;
  transition: width 0.6s ease;
}
.dim-fill i {
  position: absolute;
  right: -6px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #fffdf8;
  border: 3px solid var(--accent-deep);
  box-shadow: 0 2px 6px rgba(249, 115, 22, 0.4);
}

.dim-band {
  display: inline-block;
  margin-top: 12px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #c96a1e;
  background: rgba(255, 158, 79, 0.14);
  border: 1.5px solid rgba(255, 158, 79, 0.4);
  border-radius: 999px;
  padding: 3px 13px;
}

.dim-text { margin-top: 10px; font-size: 13.5px; color: var(--ink-dim); }

/* 结果操作 */
.result-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  margin-top: 26px;
}

/* ---------------- Toast ---------------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  transform: translateX(-50%);
  background: #fffdf8;
  border: 2px solid var(--accent);
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  padding: 10px 22px;
  border-radius: 999px;
  box-shadow: 0 6px 20px rgba(235, 160, 100, 0.35);
  z-index: 99;
  animation: fadeUp 0.25s ease both;
}

/* ---------------- 响应式 ---------------- */
@media (max-width: 640px) {
  .stage { padding: 18px 12px 30px; }
  .brand-title { font-size: 19px; }
  .q-text { font-size: 16.5px; }
  .qcard { padding: 20px 16px; }
  .hero-name { font-size: 26px; }
  .hero-match b { font-size: 32px; }
}
