/* MBTI 性格测试 · 主题样式（纯静态，无外部字体与图片） */
:root {
  --accent: #4f46e5;
  --accent-strong: #4338ca;
  --accent-soft: #eef2ff;
  --accent-2: #0ea5e9;
  --bg: #f5f6fb;
  --bg-glow-1: rgba(79, 70, 229, 0.18);
  --bg-glow-2: rgba(14, 165, 233, 0.16);
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e6eaf3;
  --success: #10b981;
  --warn: #f59e0b;
  --radius-lg: 22px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
  --shadow-soft: 0 6px 18px rgba(15, 23, 42, 0.06);
  --maxw: 720px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --accent: #8b8cf9;
    --accent-strong: #a5a6ff;
    --accent-soft: #1e1b4b;
    --bg: #0b1020;
    --bg-glow-1: rgba(99, 102, 241, 0.28);
    --bg-glow-2: rgba(14, 165, 233, 0.18);
    --surface: #151b2e;
    --surface-soft: #1b2237;
    --text: #e8ecf8;
    --muted: #9aa6c0;
    --border: #26304a;
    --shadow: 0 18px 45px rgba(0, 0, 0, 0.45);
    --shadow-soft: 0 6px 18px rgba(0, 0, 0, 0.35);
  }
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(1000px 520px at 12% -8%, var(--bg-glow-1), transparent 60%),
    radial-gradient(900px 480px at 92% 4%, var(--bg-glow-2), transparent 62%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.noscript {
  margin: 0;
  padding: 14px 18px;
  background: #fee2e2;
  color: #991b1b;
  font-size: 14px;
  text-align: center;
}

.shell {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 20px 16px 40px;
}

/* ------------------------------- 顶栏 ------------------------------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: var(--shadow-soft);
}

.brand__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}

.brand__text b { font-size: 15px; letter-spacing: 0.02em; }
.brand__text i { font-style: normal; font-size: 12px; color: var(--muted); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 52%;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-strong);
  background: var(--accent-soft);
  border: 1px solid var(--border);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chip--solid { color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); border-color: transparent; }
.chip--ghost { color: var(--muted); background: var(--surface-soft); }

/* ------------------------------- 卡片与视图 ------------------------------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 26px 22px;
}

.view[hidden] { display: none !important; }

.view__title { margin: 0 0 8px; font-size: 20px; line-height: 1.4; }
.view__text { margin: 0; color: var(--muted); font-size: 14.5px; }
.view__hint { margin: 14px 0 0; color: var(--muted); font-size: 12.5px; line-height: 1.7; }

.eyebrow {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-strong);
}

.hero__title {
  margin: 0 0 12px;
  font-size: 27px;
  line-height: 1.3;
  letter-spacing: -0.01em;
  background: linear-gradient(120deg, var(--accent-strong), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__desc { margin: 0 0 20px; color: var(--muted); font-size: 15px; }

.emoji { font-size: 30px; line-height: 1; margin-bottom: 10px; }

.muted { color: var(--muted); font-size: 12.5px; }

/* ------------------------------- 信息块 ------------------------------- */

.facts {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin: 0 0 18px;
  padding: 0;
}

.facts li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  border: 1px solid var(--border);
}

.facts__icon { font-size: 18px; }
.facts b { font-size: 14.5px; }
.facts i { margin-left: auto; font-style: normal; font-size: 12.5px; color: var(--muted); }

.notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 16px 0;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  color: var(--accent-strong);
  background: var(--accent-soft);
  border: 1px solid var(--border);
}

.notice b { font-weight: 700; }

/* ------------------------------- 按钮 ------------------------------- */

.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  padding: 13px 18px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.18s ease, background-color 0.18s ease, opacity 0.18s ease;
}

.btn:active { transform: translateY(1px); }

.btn--primary {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 12px 26px rgba(79, 70, 229, 0.28);
}

.btn--primary:hover { box-shadow: 0 16px 32px rgba(79, 70, 229, 0.34); }

.btn--ghost {
  color: var(--text);
  background: var(--surface-soft);
  border-color: var(--border);
}

.btn--ghost:hover { background: var(--accent-soft); }

.btn--block { display: block; width: 100%; margin-top: 4px; }

.btn[disabled] { opacity: 0.55; cursor: not-allowed; }

/* ------------------------------- 进度与题目 ------------------------------- */

.quiz__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.progress {
  height: 8px;
  border-radius: 999px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  overflow: hidden;
  margin-bottom: 22px;
}

.progress__bar {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.28s ease;
}

.quiz__q {
  margin: 0 0 18px;
  font-size: 19px;
  line-height: 1.55;
  min-height: 58px;
}

.options { display: grid; gap: 12px; }

.option {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 15px 16px;
  text-align: left;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--surface-soft);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.12s ease;
}

.option:hover:not([disabled]) {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-1px);
}

.option[disabled] { cursor: default; opacity: 0.75; }

.option__badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-strong);
  background: var(--accent-soft);
  border: 1px solid var(--border);
}

.option__text { flex: 1 1 auto; }

.quiz__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
}

.quiz__foot .btn { padding: 9px 14px; font-size: 13.5px; }

/* ------------------------------- 结果页 ------------------------------- */

.result__type {
  font-size: 44px;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1.1;
  margin: 2px 0 10px;
  background: linear-gradient(120deg, var(--accent-strong), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.result__title { margin: 0 0 10px; font-size: 19px; }

.result__desc {
  margin: 0 0 22px;
  font-size: 15px;
  line-height: 1.85;
  color: var(--text);
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
}

.section__title {
  margin: 0 0 14px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-transform: uppercase;
}

.dims { display: grid; gap: 16px; }

.dim__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 6px;
}

.dim__side { white-space: nowrap; }
.dim__side--left { text-align: left; }
.dim__side--right { text-align: right; }
.dim__side.is-strong { color: var(--text); font-weight: 700; }
.dim__caption { font-size: 11.5px; letter-spacing: 0.06em; color: var(--muted); }

.dim__track {
  height: 10px;
  border-radius: 999px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  overflow: hidden;
}

.dim__fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.6s ease;
}

/* ------------------------------- 加载动画 ------------------------------- */

.loader {
  width: 34px;
  height: 34px;
  margin-bottom: 16px;
  border-radius: 50%;
  border: 3px solid var(--accent-soft);
  border-top-color: var(--accent);
  animation: spin 0.9s linear infinite;
}

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

@media (prefers-reduced-motion: reduce) {
  .loader { animation-duration: 2s; }
  .btn, .option, .progress__bar, .dim__fill { transition: none; }
}

/* ------------------------------- 页脚与响应式 ------------------------------- */

.foot {
  margin-top: 22px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
}

.foot p { margin: 0 0 4px; }

@media (min-width: 560px) {
  .shell { padding: 28px 22px 52px; }
  .card { padding: 34px 30px; }
  .hero__title { font-size: 32px; }
  .facts { grid-template-columns: repeat(3, 1fr); }
  .facts li { flex-direction: column; align-items: flex-start; gap: 4px; }
  .facts i { margin-left: 0; }
  .result__type { font-size: 56px; }
}

@media (min-width: 900px) {
  body { font-size: 16.5px; }
  .card { padding: 40px 38px; }
}
