:root {
  --bg1: #eef1fb;
  --bg2: #f7f4ff;
  --card: #ffffff;
  --primary: #6d5efc;
  --primary-d: #4c3ee0;
  --accent: #ff7eb3;
  --accent2: #ffb86c;
  --text: #22263a;
  --muted: #7a8194;
  --line: #e9ecf5;
  --shadow-sm: 0 4px 14px rgba(70, 80, 140, .07);
  --shadow-md: 0 14px 34px rgba(70, 80, 140, .14);
  --radius: 18px;
  --grad: linear-gradient(135deg, #6d5efc 0%, #9b5cff 55%, #c46bff 100%);
  --grad-warm: linear-gradient(135deg, #ff7eb3 0%, #ff9d6c 100%);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
/* 文本类输入框统一 16px：避免 iOS Safari 聚焦时自动放大整个页面 */
input[type="password"], input[type="text"], input[type="search"], input[type="email"], input[type="number"] { font-size: 16px; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: linear-gradient(160deg, var(--bg1), var(--bg2)) fixed;
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* ---------- \u5934\u90E8 ---------- */
.site-header {
  position: relative;
  overflow: hidden;
  text-align: center;
  padding: 70px 16px 46px;
  background: var(--grad);
  color: #fff;
}
.site-header::before,
.site-header::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(8px);
  opacity: .55;
  pointer-events: none;
}
.site-header::before {
  width: 280px; height: 280px;
  top: -90px; right: -60px;
  background: radial-gradient(circle, rgba(255, 158, 184, .9), transparent 70%);
}
.site-header::after {
  width: 240px; height: 240px;
  bottom: -110px; left: -50px;
  background: radial-gradient(circle, rgba(255, 200, 130, .8), transparent 70%);
}
.site-header.slim {
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
}
.site-header.slim h1 {
  flex: 1;
  font-size: 18px;
  font-weight: 600;
  text-align: center;
  margin-right: 56px;
}
.site-header h1 { font-size: 30px; font-weight: 800; letter-spacing: .5px; }
.subtitle { opacity: .92; margin-top: 8px; font-size: 15px; }
.back {
  position: relative;
  z-index: 1;
  color: #fff;
  text-decoration: none;
  font-size: 14px;
  opacity: .92;
  background: rgba(255, 255, 255, .18);
  padding: 7px 14px;
  border-radius: 999px;
  backdrop-filter: blur(4px);
  transition: background .15s;
}
.back:hover { background: rgba(255, 255, 255, .3); }
.logout {
  position: relative; z-index: 1;
  font-size: 14px; color: #fff; text-decoration: none;
  background: rgba(255, 255, 255, .18);
  padding: 7px 14px; border-radius: 999px;
  backdrop-filter: blur(4px);
}
.logout:hover { background: rgba(255, 255, 255, .3); }

.container { max-width: 760px; margin: 0 auto; padding: 28px 16px 48px; }

/* ---------- \u9996\u9875\u5361\u7247 ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  position: relative;
  z-index: 1;
}
.test-card {
  display: block;
  position: relative;
  background: var(--card);
  border-radius: var(--radius);
  padding: 22px;
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--line);
  transition: transform .18s ease, box-shadow .18s ease;
  position: relative;
  overflow: hidden;
}
.test-card::after {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: var(--grad);
  opacity: 0;
  transition: opacity .18s ease;
}
.test-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
}
.test-card:hover::after { opacity: 1; }
.card-icon {
  width: 52px; height: 52px;
  border-radius: 15px;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
  background: var(--grad);
  box-shadow: 0 8px 18px rgba(109, 94, 252, .35);
  margin-bottom: 14px;
}
.test-card .tag {
  display: inline-block;
  font-size: 12px;
  color: var(--primary-d);
  background: #eef0ff;
  padding: 3px 11px;
  border-radius: 999px;
  margin-bottom: 10px;
}
.test-card h2 { font-size: 18px; margin-bottom: 8px; }
.test-card p { color: var(--muted); font-size: 14px; min-height: 42px; }
.card-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  color: var(--primary-d);
  font-weight: 600;
  font-size: 14px;
  transition: gap .15s ease;
}
.test-card:hover .card-btn { gap: 11px; }

.disclaimer {
  position: relative;
  z-index: 1;
  margin-top: 26px;
  font-size: 13px;
  color: var(--muted);
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 14px;
  padding: 14px 16px;
}
.disclaimer strong { color: #c2410c; }

/* ---------- \u7B54\u9898 ---------- */
.quiz-container { max-width: 620px; }
.progress-wrap { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.progress-bar {
  flex: 1; height: 9px;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
}
.progress-bar span {
  display: block; height: 100%; width: 0;
  background: var(--grad);
  border-radius: 999px;
  transition: width .3s ease;
}
.progress-text { font-size: 13px; color: var(--muted); white-space: nowrap; }
.step-dots { display: flex; gap: 6px; justify-content: center; margin-bottom: 18px; flex-wrap: wrap; }
.step-dots i {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--line);
  transition: background .2s ease, transform .2s ease;
}
.step-dots i.on { background: var(--primary); transform: scale(1.25); }
.step-dots i.done { background: var(--primary-d); }

.question {
  background: var(--card);
  border-radius: var(--radius);
  padding: 24px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  animation: fadeUp .35s ease both;
}
.q-index {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px;
  border-radius: 9px;
  background: #eef0ff; color: var(--primary-d);
  font-size: 14px; font-weight: 700;
  margin-bottom: 12px;
}
.q-title { font-size: 18px; margin-bottom: 18px; line-height: 1.6; }
.options { display: flex; flex-direction: column; gap: 11px; }
.opt {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  padding: 15px 46px 15px 16px;
  border: 1.5px solid var(--line);
  border-radius: 13px;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, transform .1s ease;
}
.opt:hover { border-color: var(--primary); background: #fafaff; }
.opt:active { transform: scale(.995); }
.opt input { accent-color: var(--primary); width: 18px; height: 18px; flex: none; }
.opt::after {
  content: "\u2713";
  position: absolute; right: 15px;
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  border: 2px solid var(--line);
  color: #fff; font-size: 13px; font-weight: 700;
  opacity: 0; transform: scale(.6);
  transition: opacity .15s ease, transform .15s ease, background .15s ease;
}
.opt:has(input:checked) {
  border-color: var(--primary);
  background: #eef0ff;
}
.opt:has(input:checked)::after {
  opacity: 1; transform: scale(1);
  background: var(--primary);
  border-color: var(--primary);
}
.nav-btns { display: flex; gap: 12px; margin-top: 22px; }
.nav-btns button {
  flex: 1; padding: 14px; border: none; border-radius: 13px;
  font-size: 15px; font-weight: 600; cursor: pointer;
  background: var(--grad); color: #fff;
  box-shadow: 0 8px 18px rgba(109, 94, 252, .3);
  transition: opacity .15s ease, transform .1s ease;
}
.nav-btns button:hover { opacity: .94; }
.nav-btns button:active { transform: translateY(1px); }
.nav-btns button:disabled { background: #cbd2e0; box-shadow: none; cursor: not-allowed; }
.nav-btns #prevBtn {
  background: #fff; color: var(--text);
  border: 1.5px solid var(--line);
  flex: 0 0 104px; box-shadow: none;
}

/* ---------- \u7ED3\u679C ---------- */
.result-container { max-width: 560px; }
.result-card {
  position: relative;
  background: var(--card);
  border-radius: 22px;
  padding: 30px 26px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
  text-align: center;
  overflow: hidden;
  animation: fadeUp .45s ease both;
}
.result-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 6px;
  background: var(--grad);
}
.type-badge {
  width: 120px; height: 120px;
  margin: 6px auto 16px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: conic-gradient(from 220deg, #6d5efc, #c46bff, #ff7eb3, #6d5efc);
  padding: 5px;
  box-shadow: 0 12px 28px rgba(109, 94, 252, .35);
  animation: spinIn .6s ease both;
}
.type-badge .inner {
  width: 100%; height: 100%;
  border-radius: 50%;
  background: #fff;
  display: flex; align-items: center; justify-content: center;
}
.big-type { font-size: 46px; font-weight: 800; letter-spacing: 5px; color: var(--primary-d); }
.result-card h2 { font-size: 22px; margin: 4px 0 12px; }
.result-text { color: var(--muted); font-size: 15px; max-width: 440px; margin: 0 auto; }

.dim-list { list-style: none; margin: 24px auto 0; max-width: 380px; text-align: left; }
.dim-list li {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 12px; font-size: 14px;
}
.dim-list li > span { width: 72px; color: var(--muted); flex: none; font-size: 13px; }
.mini-bar { flex: 1; height: 9px; background: var(--line); border-radius: 999px; overflow: hidden; }
.mini-bar i {
  display: block; height: 100%; width: 0;
  background: var(--grad);
  border-radius: 999px;
  transition: width 1s cubic-bezier(.2, .7, .2, 1);
}
.dim-list em { font-style: normal; color: var(--muted); width: 48px; text-align: right; flex: none; font-size: 13px; }

#radar { max-width: 100%; height: auto; margin: 10px auto 6px; display: block; }
.dim-tags { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; text-align: left; }
.dim-tag {
  background: #f8f9ff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 13px 15px;
  transition: transform .15s ease, box-shadow .15s ease;
}
.dim-tag:hover { transform: translateY(-3px); box-shadow: var(--shadow-sm); }
.dim-tag strong { color: var(--primary-d); font-size: 14px; }
.dim-tag p { font-size: 13px; color: var(--muted); margin-top: 5px; }

.highlight-box.type-headline {
  background: linear-gradient(135deg, #fff0f6, #f0f4ff);
  border-color: #ffd6e7;
  text-align: center;
}
.highlight-box.type-headline .eyebrow {
  display: inline-block;
  font-size: 12px; letter-spacing: 1px;
  color: var(--primary-d); background: #fff;
  border: 1px solid var(--line); border-radius: 999px;
  padding: 3px 12px; margin-bottom: 8px;
}
.highlight-box.type-headline h3 { font-size: 24px; margin: 4px 0; }

.highlight-box {
  margin-top: 20px;
  background: linear-gradient(135deg, #eef0ff, #fbeeff);
  border: 1px solid #e3dcff;
  border-radius: 16px;
  padding: 18px;
}
.highlight-box h3 { color: var(--primary-d); font-size: 18px; }
.highlight-box p { color: var(--muted); font-size: 14px; margin-top: 6px; }
.highlight-box .tip { color: var(--text); }

.result-actions { display: flex; gap: 12px; margin-top: 22px; justify-content: center; flex-wrap: wrap; }
.card-btn.share-btn {
  background: linear-gradient(135deg, #f472b6, #8b5cf6);
  color: #fff; border: none; cursor: pointer;
  box-shadow: 0 8px 24px rgba(139,92,246,0.35);
  font-weight: 700;
}
.card-btn.share-btn:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(139,92,246,0.45); }
.card-btn.copy-btn { cursor: pointer; }
.card-btn.copy-btn:hover { transform: translateY(-2px); }
.share-tip { width: 100%; text-align: center; font-size: 12px; color: var(--muted); margin-top: 4px; }
.result-actions .card-btn {
  margin: 0; padding: 13px 24px; border-radius: 13px;
  background: var(--grad); color: #fff;
  box-shadow: 0 8px 18px rgba(109, 94, 252, .3);
  transition: opacity .15s ease, gap .15s ease;
}
.result-actions .card-btn:hover { opacity: .94; gap: 11px; }
.result-actions .card-btn.ghost {
  background: #fff; color: var(--text);
  border: 1.5px solid var(--line);
  box-shadow: none;
}

/* SCL-90 \u7B5B\u67E5\u6458\u8981 */
.scl-summary { margin: 6px 0 18px; text-align: left; }
.scl-stats { display: flex; gap: 12px; margin-bottom: 14px; }
.scl-stats > div { flex: 1; background: #f8f9ff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.scl-stats b { display: block; font-size: 24px; color: var(--primary-d); }
.scl-stats span { font-size: 12px; color: var(--muted); }
.scl-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.scl-table th, .scl-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; }
.scl-table th { color: var(--muted); font-weight: 600; }
.scl-table td.warn { color: #e74c3c; font-weight: 600; }
.scl-table td.ok { color: #16a34a; }
.scl-verdict { margin-top: 14px; padding: 12px 14px; border-radius: 12px; font-size: 14px; font-weight: 600; }
.scl-verdict.warn { background: #fff1f0; color: #c0392b; border: 1px solid #ffd0cc; }
.scl-verdict.ok { background: #ecfdf3; color: #15803d; border: 1px solid #c7f0d2; }

/* \u9996\u9875\u70ED\u95E8/\u7F6E\u9876\u5361\u7247 */
.test-card.featured { border-color: #ffd0e0; box-shadow: 0 16px 38px rgba(255, 126, 179, .22); }
.test-card.featured::after { opacity: 1; }
.test-card .hot {
  display: inline-block; font-size: 12px; color: #fff;
  background: var(--grad-warm); padding: 3px 11px; border-radius: 999px; margin-bottom: 10px;
}
/* 开放测试（大五）徽标：右上角，不占用正文流 */
.test-card .hot.corner {
  position: absolute; top: 14px; right: 14px; margin-bottom: 0; z-index: 2;
}
.test-card .hot.alt {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
}

/* ---------- \u540E\u53F0 ---------- */
.login-wrap {
  max-width: 360px; margin: 80px auto;
  background: #fff; padding: 28px; border-radius: 14px;
  box-shadow: var(--shadow-md);
}
.login-wrap h2 { margin: 0 0 14px; }
.login-wrap input {
  width: 100%; padding: 11px; border: 1px solid #ddd;
  border-radius: 9px; margin-bottom: 12px; box-sizing: border-box;
}
.login-wrap button {
  width: 100%; padding: 11px; border: 0; border-radius: 9px;
  background: var(--primary); color: #fff; cursor: pointer;
}
.login-wrap .err { color: #e74c3c; margin-bottom: 10px; font-size: 14px; }

.site-footer { text-align: center; color: var(--muted); font-size: 12px; padding: 22px; }

/* ---------- \u52A8\u753B ---------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes spinIn { from { opacity: 0; transform: rotate(-40deg) scale(.8); } to { opacity: 1; transform: none; } }
.fade-up { animation: fadeUp .5s ease both; }

@media (max-width: 520px) {
  .site-header { padding: 46px 16px 30px; }
  .site-header h1 { font-size: 25px; }
  .test-card { padding: 18px; }
  .test-card p { min-height: 0; }
  .question { padding: 20px 16px; }
  .opt { padding: 13px 42px 13px 14px; }
  .dim-tags { grid-template-columns: 1fr; }
  .type-badge { width: 104px; height: 104px; }
  .big-type { font-size: 40px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
