/* ========== 基础 ========== */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --primary: #6c5ce7;
  --primary-dark: #5a4bd1;
  --text: #2d3243;
  --text-light: #6b7280;
  --bg: #f6f7fb;
  --card: #ffffff;
  --border: #e6e9f0;
  --accent: var(--primary);
  --radius: 16px;
  --shadow: 0 4px 20px rgba(45, 50, 67, 0.07);
}
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { text-decoration: none; color: inherit; }
main { flex: 1; width: 100%; max-width: 960px; margin: 0 auto; padding: 32px 20px 64px; }

/* ========== 头部 ========== */
.site-header {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
}
.header-inner {
  max-width: 960px; margin: 0 auto; padding: 0 20px;
  height: 60px; display: flex; align-items: center; justify-content: space-between;
}
.logo { font-size: 18px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.main-nav { display: flex; gap: 4px; }
.main-nav a {
  padding: 7px 14px; border-radius: 10px; font-size: 15px;
  color: var(--text-light); transition: all 0.2s;
}
.main-nav a:hover { background: var(--bg); color: var(--text); }
.main-nav a.active { background: var(--primary); color: #fff; }

/* ========== 按钮 ========== */
.btn {
  display: inline-block; padding: 10px 22px; border-radius: 12px;
  font-size: 15px; font-weight: 600; cursor: pointer;
  border: none; transition: all 0.2s; font-family: inherit;
}
.btn-lg { padding: 14px 32px; font-size: 17px; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 4px 14px rgba(108, 92, 231, 0.35); }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-2px); }
.btn-ghost { background: transparent; color: var(--text-light); border: 1.5px solid var(--border); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }

/* ========== 首页 ========== */
.hero { text-align: center; padding: 56px 0 40px; }
.hero h1 {
  font-size: clamp(28px, 5vw, 42px); font-weight: 800; line-height: 1.35;
  background: linear-gradient(135deg, #6c5ce7, #a06ce7 60%, #e76cc0);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hero-sub { margin: 18px 0 30px; color: var(--text-light); font-size: 17px; }
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.hero-meta { margin-top: 18px; font-size: 13px; color: #9aa1af; }

.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 28px; }
.feature-card {
  background: var(--card); border-radius: var(--radius); padding: 26px 22px;
  box-shadow: var(--shadow); text-align: center;
}
.feature-icon { font-size: 34px; margin-bottom: 10px; }
.feature-card h3 { font-size: 17px; margin-bottom: 8px; }
.feature-card p { font-size: 14px; color: var(--text-light); }

.home-result {
  margin-top: 28px; background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 22px 26px;
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  border-left: 5px solid var(--accent);
}
.home-result-emoji { font-size: 40px; }
.home-result-label { font-size: 13px; color: var(--text-light); }
.home-result h3 { font-size: 20px; color: var(--accent); }
.home-result .btn { margin-left: auto; }

/* ========== 测试页 ========== */
.quiz { max-width: 720px; margin: 0 auto; }
.quiz-progress { margin-bottom: 26px; }
.quiz-progress-info {
  display: flex; justify-content: space-between;
  font-size: 13px; color: var(--text-light); margin-bottom: 8px;
}
.progress-track { height: 8px; background: #e6e9f0; border-radius: 99px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, #6c5ce7, #a06ce7); border-radius: 99px; transition: width 0.35s ease; }

.question {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 26px 28px; margin-bottom: 18px; transition: opacity 0.25s;
}
.question.answered { opacity: 0.65; }
.question.answered:hover { opacity: 1; }
.q-text { font-size: 17px; font-weight: 600; margin-bottom: 20px; display: flex; gap: 10px; }
.q-num {
  flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%;
  background: var(--bg); color: var(--text-light);
  font-size: 13px; font-weight: 700; display: inline-flex;
  align-items: center; justify-content: center; margin-top: 2px;
}
.likert { display: flex; align-items: center; justify-content: center; gap: 12px; }
.likert-label { font-size: 13px; font-weight: 600; white-space: nowrap; }
.likert-label.disagree { color: #b06ab3; }
.likert-label.agree { color: #33a474; }
.likert-dot {
  border-radius: 50%; cursor: pointer; background: #fff;
  border: 2.5px solid #d3d9e3; transition: all 0.15s; padding: 0; flex-shrink: 0;
}
.likert-dot.s3 { width: 40px; height: 40px; }
.likert-dot.s2 { width: 33px; height: 33px; }
.likert-dot.s1 { width: 27px; height: 27px; }
.likert-dot.s0 { width: 22px; height: 22px; }
.likert-dot.neg { border-color: #c9a3d8; }
.likert-dot.pos { border-color: #96cdb4; }
.likert-dot:hover { transform: scale(1.15); }
.likert-dot.neg:hover, .likert-dot.neg.selected { background: #b06ab3; border-color: #b06ab3; }
.likert-dot.pos:hover, .likert-dot.pos.selected { background: #33a474; border-color: #33a474; }
.likert-dot.mid:hover, .likert-dot.mid.selected { background: #9aa1af; border-color: #9aa1af; }
.likert-dot.selected { box-shadow: 0 0 0 4px rgba(45, 50, 67, 0.08); }

.quiz-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 28px; }
.shake { animation: shake 0.5s; box-shadow: 0 0 0 2px #e74c3c !important; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

/* ========== 结果页 ========== */
.result { text-align: center; max-width: 680px; margin: 0 auto; }
.result-label { color: var(--text-light); font-size: 15px; margin-top: 10px; }
.result-emoji { font-size: 64px; margin: 10px 0; }
.result-code { font-size: clamp(48px, 9vw, 72px); font-weight: 800; color: var(--accent); letter-spacing: 4px; line-height: 1.1; }
.result-name { font-size: 26px; margin: 6px 0 10px; }
.group-tag {
  display: inline-block; font-size: 13px; font-weight: 600; vertical-align: middle;
  background: var(--accent); color: #fff; padding: 3px 12px; border-radius: 99px; margin-left: 6px;
}
.result-tagline { color: var(--text-light); font-size: 16px; margin-bottom: 30px; }

.dim-list {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 30px 32px; text-align: left; display: flex; flex-direction: column; gap: 24px;
}
.dim-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.dim-name { font-size: 14px; color: var(--text-light); font-weight: 600; }
.dim-win { font-size: 17px; font-weight: 800; }
.dim-bar { height: 12px; background: #e6e9f0; border-radius: 99px; overflow: hidden; }
.dim-bar-left { height: 100%; border-radius: 99px 0 0 99px; transition: width 0.6s ease; }
.dim-scale { display: flex; justify-content: space-between; font-size: 12px; color: #9aa1af; margin-top: 6px; }
.dim-desc { font-size: 13px; color: var(--text-light); margin-top: 4px; }

.result-actions { margin-top: 32px; display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; align-items: center; }

/* ========== 16 型列表 ========== */
.types-page h1 { font-size: 32px; text-align: center; margin-bottom: 8px; }
.types-intro { text-align: center; color: var(--text-light); margin-bottom: 36px; }
.type-group { margin-bottom: 40px; }
.type-group-head { border-left: 5px solid var(--accent); padding-left: 14px; margin-bottom: 18px; }
.type-group-head h2 { font-size: 22px; color: var(--accent); }
.type-group-head p { font-size: 14px; color: var(--text-light); }
.type-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.type-card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 22px 18px; display: flex; flex-direction: column; gap: 4px;
  border-top: 4px solid var(--accent); transition: all 0.2s;
}
.type-card:hover { transform: translateY(-4px); box-shadow: 0 10px 28px rgba(45, 50, 67, 0.13); }
.type-card-emoji { font-size: 30px; }
.type-card-code { font-size: 20px; font-weight: 800; color: var(--accent); letter-spacing: 1px; }
.type-card-name { font-size: 15px; font-weight: 700; }
.type-card-tagline { font-size: 12.5px; color: var(--text-light); line-height: 1.55; margin-top: 4px; }

/* ========== 类型详情 ========== */
.detail { max-width: 760px; margin: 0 auto; }
.back-link { color: var(--text-light); font-size: 14px; display: inline-block; margin-bottom: 16px; }
.back-link:hover { color: var(--accent); }
.mine-banner {
  background: var(--accent); color: #fff; text-align: center;
  padding: 10px; border-radius: 12px; font-weight: 600; margin-bottom: 20px;
}
.detail-hero {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 36px 32px; text-align: center; border-top: 5px solid var(--accent); margin-bottom: 22px;
}
.detail-emoji { font-size: 54px; margin-bottom: 8px; }
.detail-hero h1 { font-size: clamp(24px, 4.5vw, 32px); color: var(--accent); }
.detail-tagline { color: var(--text-light); font-size: 16px; margin-top: 8px; }
.keyword-row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }
.keyword {
  font-size: 13px; font-weight: 600; padding: 4px 14px; border-radius: 99px;
  background: color-mix(in srgb, var(--accent) 12%, #fff); color: var(--accent);
}
.detail-body { display: flex; flex-direction: column; gap: 18px; }
.detail-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 26px 30px; }
.detail-card h2 { font-size: 19px; margin-bottom: 12px; }
.detail-card p { color: #454b5e; font-size: 15.5px; }
.detail-card.advice { border-left: 5px solid var(--accent); }
.detail-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.detail-list li { display: flex; gap: 10px; font-size: 15.5px; color: #454b5e; }
.detail-list li span { color: var(--accent); font-weight: 700; flex-shrink: 0; }
.detail-cta {
  text-align: center; margin-top: 30px; background: var(--card);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 30px;
}
.detail-cta p { margin-bottom: 14px; font-size: 16px; font-weight: 600; }

/* ========== 空状态 / 页脚 ========== */
.empty-state { text-align: center; padding: 80px 20px; }
.empty-icon { font-size: 56px; margin-bottom: 14px; }
.empty-state h2 { margin-bottom: 8px; }
.empty-state p { color: var(--text-light); margin-bottom: 24px; }
.site-footer {
  text-align: center; padding: 22px; font-size: 12.5px; color: #9aa1af;
  border-top: 1px solid var(--border); background: var(--card);
}

/* ========== 响应式 ========== */
@media (max-width: 720px) {
  .feature-grid { grid-template-columns: 1fr; }
  .type-grid { grid-template-columns: repeat(2, 1fr); }
  .likert { gap: 7px; }
  .likert-label { font-size: 11px; }
  .likert-dot.s3 { width: 34px; height: 34px; }
  .likert-dot.s2 { width: 28px; height: 28px; }
  .likert-dot.s1 { width: 23px; height: 23px; }
  .likert-dot.s0 { width: 19px; height: 19px; }
  .question { padding: 20px 16px; }
  .main-nav a { padding: 6px 9px; font-size: 13.5px; }
  .logo span { display: none; }
  .dim-list { padding: 22px 18px; }
  .home-result .btn { margin-left: 0; }
}
@media (max-width: 400px) {
  .type-grid { grid-template-columns: 1fr; }
}
