/* ============================================================
   MBTI 人格测试站 - 全局样式
   ============================================================ */
:root {
  --primary: #6c5ce7;
  --primary-dark: #4b3bb5;
  --primary-light: #a29bfe;
  --accent: #00cec9;
  --gradient: linear-gradient(135deg, #6c5ce7 0%, #a29bfe 50%, #74b9ff 100%);
  --bg: #f6f7fb;
  --card: #ffffff;
  --text: #2d3436;
  --text-light: #636e72;
  --border: #e8eaf2;
  --radius: 16px;
  --shadow: 0 4px 20px rgba(108, 92, 231, 0.08);
  --shadow-hover: 0 8px 30px rgba(108, 92, 231, 0.18);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; }

.container { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

/* ---------------- 顶部导航 ---------------- */
.site-header {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 20px;
  color: var(--primary-dark);
}
.logo-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 17px;
  font-weight: 900;
}
.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a { font-size: 15px; color: var(--text-light); transition: color .2s; }
.nav-links a:hover { color: var(--primary); }
.nav-cta {
  background: var(--gradient);
  color: #fff !important;
  padding: 8px 20px;
  border-radius: 999px;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(108, 92, 231, 0.35);
  transition: transform .2s, box-shadow .2s;
}
.nav-cta:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(108, 92, 231, 0.45); }

/* ---------------- Hero 区 ---------------- */
.hero {
  background: var(--gradient);
  color: #fff;
  padding: 90px 0 110px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before, .hero::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
}
.hero::before { width: 420px; height: 420px; top: -180px; right: -120px; }
.hero::after { width: 300px; height: 300px; bottom: -140px; left: -80px; }
.hero .container { position: relative; z-index: 1; }
.hero-badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.35);
  padding: 6px 18px;
  border-radius: 999px;
  font-size: 13px;
  margin-bottom: 24px;
  letter-spacing: 1px;
}
.hero h1 { font-size: 46px; font-weight: 800; margin-bottom: 18px; letter-spacing: 1px; }
.hero p { font-size: 18px; max-width: 640px; margin: 0 auto 36px; opacity: 0.95; }
.hero-btn {
  display: inline-block;
  background: #fff;
  color: var(--primary-dark);
  font-size: 17px;
  font-weight: 700;
  padding: 14px 44px;
  border-radius: 999px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18);
  transition: transform .2s, box-shadow .2s;
}
.hero-btn:hover { transform: translateY(-3px) scale(1.02); }
.hero-note { margin-top: 16px; font-size: 13px; opacity: 0.8; }

/* ---------------- 通用区块 ---------------- */
.section { padding: 70px 0; }
.section-alt { background: #fff; }
.section-title {
  text-align: center;
  font-size: 30px;
  font-weight: 800;
  margin-bottom: 12px;
  color: var(--text);
}
.section-sub {
  text-align: center;
  color: var(--text-light);
  max-width: 620px;
  margin: 0 auto 44px;
  font-size: 15px;
}

/* ---------------- 特性卡片 ---------------- */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.feature-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 32px 28px;
  box-shadow: var(--shadow);
  transition: transform .25s, box-shadow .25s;
  border-top: 4px solid var(--primary);
}
.feature-card:nth-child(2) { border-top-color: var(--accent); }
.feature-card:nth-child(3) { border-top-color: #fd79a8; }
.feature-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-hover); }
.feature-icon {
  width: 54px; height: 54px;
  border-radius: 14px;
  background: var(--gradient);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; margin-bottom: 18px;
}
.feature-card h3 { font-size: 18px; margin-bottom: 10px; }
.feature-card p { color: var(--text-light); font-size: 14px; }

/* ---------------- 16 类型网格 ---------------- */
.type-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.type-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 26px 22px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform .25s, box-shadow .25s;
  position: relative;
  overflow: hidden;
  display: block;
}
.type-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 5px;
  background: var(--tcolor, var(--primary));
}
.type-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-hover); }
.type-code {
  font-size: 26px;
  font-weight: 900;
  letter-spacing: 2px;
  color: var(--tcolor, var(--primary));
}
.type-name { font-size: 15px; font-weight: 700; margin-top: 6px; }
.type-tag {
  font-size: 12px;
  color: var(--text-light);
  background: var(--bg);
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  margin-top: 8px;
}
.type-desc {
  font-size: 13px;
  color: var(--text-light);
  margin-top: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------------- 页脚 ---------------- */
.site-footer {
  background: #2d3436;
  color: #b2bec3;
  padding: 40px 0;
  margin-top: 40px;
}
.footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; }
.footer-brand { font-weight: 700; color: #fff; font-size: 16px; }
.footer-links { display: flex; gap: 20px; font-size: 13px; }
.footer-links a:hover { color: #fff; }
.footer-copy { width: 100%; text-align: center; font-size: 12px; margin-top: 20px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,0.1); }

/* ============================================================
   测试页
   ============================================================ */
.test-wrap { max-width: 760px; margin: 0 auto; padding: 40px 20px 80px; }

.progress-area { margin-bottom: 36px; }
.progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: 14px;
  color: var(--text-light);
}
.progress-meta .dim-tag {
  background: rgba(108, 92, 231, 0.12);
  color: var(--primary-dark);
  font-weight: 700;
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 12px;
}
.progress-bar {
  height: 8px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--gradient);
  border-radius: 999px;
  transition: width .4s ease;
}

.question-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 40px 36px;
  box-shadow: var(--shadow);
  animation: fadeUp .35s ease;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
.q-number {
  font-size: 13px;
  color: var(--primary);
  font-weight: 700;
  letter-spacing: 1px;
  margin-bottom: 10px;
}
.question-text { font-size: 20px; font-weight: 700; line-height: 1.6; margin-bottom: 28px; }

.options { display: flex; flex-direction: column; gap: 14px; }
.option-btn {
  text-align: left;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 18px 22px;
  font-size: 15px;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  transition: all .2s;
  line-height: 1.6;
}
.option-btn:hover { border-color: var(--primary-light); background: rgba(108, 92, 231, 0.06); transform: translateX(4px); }
.option-btn.selected { border-color: var(--primary); background: rgba(108, 92, 231, 0.1); font-weight: 600; }
.option-btn .opt-letter {
  display: inline-block;
  width: 28px; height: 28px;
  border-radius: 8px;
  background: var(--gradient);
  color: #fff;
  font-weight: 800;
  text-align: center;
  line-height: 28px;
  font-size: 13px;
  margin-right: 12px;
  vertical-align: middle;
}

.test-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 28px;
  gap: 14px;
}
.btn {
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  padding: 12px 30px;
  border-radius: 999px;
  transition: all .2s;
  background: var(--bg);
  color: var(--text-light);
}
.btn:hover { background: var(--border); }
.btn-primary {
  background: var(--gradient);
  color: #fff;
  box-shadow: 0 4px 14px rgba(108, 92, 231, 0.35);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(108, 92, 231, 0.45); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none !important; }

/* ============================================================
   结果页
   ============================================================ */
.result-wrap { max-width: 800px; margin: 0 auto; padding: 50px 20px 80px; }
.result-hero {
  background: var(--gradient);
  border-radius: 20px;
  color: #fff;
  text-align: center;
  padding: 50px 30px;
  margin-bottom: 30px;
}
.result-type {
  font-size: 64px;
  font-weight: 900;
  letter-spacing: 6px;
  line-height: 1;
  text-shadow: 0 4px 20px rgba(0,0,0,0.2);
}
.result-name { font-size: 22px; font-weight: 700; margin-top: 12px; }
.result-en { font-size: 14px; opacity: 0.85; margin-top: 4px; }

.dim-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 24px 28px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}
.dim-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.dim-head .dim-label { font-weight: 700; font-size: 15px; }
.dim-head .dim-pct { font-size: 14px; color: var(--primary-dark); font-weight: 700; }
.dim-bar {
  display: flex;
  height: 14px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--border);
}
.dim-bar .side-a { background: var(--primary); height: 100%; transition: width .8s ease; }
.dim-bar .side-b { background: var(--accent); height: 100%; transition: width .8s ease; }
.dim-legend { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-light); margin-top: 8px; }

.result-desc-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 30px 28px;
  box-shadow: var(--shadow);
  margin-top: 24px;
}
.result-desc-card h3 { margin-bottom: 12px; color: var(--primary-dark); }
.result-desc-card p { color: var(--text-light); font-size: 15px; }
.result-actions {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: 30px;
  flex-wrap: wrap;
}

/* ============================================================
   类型详情页
   ============================================================ */
.type-hero {
  background: var(--gradient);
  color: #fff;
  padding: 70px 0;
  text-align: center;
}
.type-hero .type-code-big {
  font-size: 72px;
  font-weight: 900;
  letter-spacing: 8px;
  line-height: 1;
}
.type-hero .type-name-big { font-size: 26px; font-weight: 700; margin-top: 14px; }
.type-hero .type-en-big { font-size: 15px; opacity: 0.85; margin-top: 6px; }

.type-body { max-width: 860px; margin: 0 auto; padding: 50px 20px; }

.info-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 30px; }
.info-item {
  background: var(--card);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  box-shadow: var(--shadow);
}
.info-item .info-k { font-size: 12px; color: var(--text-light); }
.info-item .info-v { font-size: 15px; font-weight: 800; margin-top: 4px; color: var(--primary-dark); }

.article {
  background: var(--card);
  border-radius: var(--radius);
  padding: 30px 32px;
  box-shadow: var(--shadow);
  margin-bottom: 22px;
}
.article h2 {
  font-size: 19px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--bg);
  display: flex;
  align-items: center;
  gap: 10px;
}
.article h2 .icon { font-size: 22px; }
.article p { color: var(--text-light); font-size: 15px; }
.article ul { list-style: none; }
.article ul li {
  position: relative;
  padding: 8px 0 8px 26px;
  color: var(--text-light);
  font-size: 15px;
}
.article ul li::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 17px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary-light);
}
.article ul li::after { display: none; }
.career-tags { display: flex; flex-wrap: wrap; gap: 10px; }
.career-tag {
  background: rgba(108, 92, 231, 0.1);
  color: var(--primary-dark);
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
}

.type-nav-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.type-nav-item {
  background: var(--card);
  border-radius: 12px;
  padding: 14px 10px;
  text-align: center;
  box-shadow: var(--shadow);
  font-size: 13px;
  transition: transform .2s, box-shadow .2s;
  cursor: pointer;
}
.type-nav-item:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.type-nav-item .nav-code { font-weight: 900; font-size: 15px; letter-spacing: 1px; }
.type-nav-item .nav-name { color: var(--text-light); font-size: 12px; }
.type-nav-item.active { outline: 3px solid var(--primary-light); }

/* ---------------- 响应式 ---------------- */
@media (max-width: 960px) {
  .type-grid { grid-template-columns: repeat(3, 1fr); }
  .info-grid { grid-template-columns: repeat(2, 1fr); }
  .type-nav-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
  .hero { padding: 60px 0 80px; }
  .hero h1 { font-size: 32px; }
  .hero p { font-size: 16px; }
  .features { grid-template-columns: 1fr; }
  .type-grid { grid-template-columns: repeat(2, 1fr); }
  .type-nav-grid { grid-template-columns: repeat(2, 1fr); }
  .nav-links a:not(.nav-cta) { display: none; }
  .question-card { padding: 28px 22px; }
  .question-text { font-size: 17px; }
  .result-type { font-size: 48px; }
  .footer-inner { flex-direction: column; text-align: center; }
}
@media (max-width: 480px) {
  .type-grid { grid-template-columns: 1fr; }
  .info-grid { grid-template-columns: 1fr 1fr; }
}
