/**
 * MBTI 测试网站 - 主样式表
 * 设计理念：移动端优先、专业、可信赖
 * 品牌主色：#F8364F（红心结红）
 * 品牌辅色：#6900DA（紫）
 */

/* ========== CSS 变量 ========== */
:root {
  /* 品牌色 */
  --color-primary: #F8364F;
  --color-primary-light: #FF5A70;
  --color-primary-dark: #D42A40;
  --color-secondary: #6900DA;

  /* 中性色 */
  --color-text-primary: #1a1a1a;
  --color-text-secondary: #5a5a5a;
  --color-text-tertiary: #8a8a8a;
  --color-border: #e5e5e5;
  --color-background: #FFFFFF;
  --color-surface: #FAFAFA;
  --color-hover: #F5F5F5;

  /* 功能色 */
  --color-success: #27AE60;
  --color-warning: #F39C12;
  --color-error: #E74C3C;

  /* 尺寸 */
  --max-width: 720px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  /* 阴影 */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.1);

  /* 动画 */
  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
  --transition-slow: 400ms ease;

  /* 字体 */
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono: "SF Mono", "Consolas", "Monaco", monospace;

  /* 安全区域（适配刘海屏/底部横条） */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ========== 基础重置 ========== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* 防止iOS弹性滚动过度 */
  overscroll-behavior-y: contain;
  /* 文字大小调整禁止（防止手机横屏时自动缩放） */
  -webkit-text-size-adjust: 100%;
  touch-action: manipulation;
}

body {
  font-family: var(--font-body);
  color: var(--color-text-primary);
  background-color: var(--color-background);
  line-height: 1.7;
  min-height: 100vh;
  /* iOS Safari 底部安全区域 */
  padding-bottom: var(--safe-bottom);
  /* 禁止长按选中文字影响操作体验 */
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}

/* 允许特定区域选中文字 */
.allow-select,
.detail-card,
.share-modal-text {
  -webkit-user-select: text;
  user-select: text;
}

/* ========== 排版 ========== */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }

p {
  color: var(--color-text-secondary);
  line-height: 1.8;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: opacity var(--transition-fast);
}
a:hover { opacity: 0.75; }

/* ========== 布局容器 ========== */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 20px 18px;
}

.page {
  display: none;
  animation: fadeIn 0.3s ease forwards;
}
.page.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ========== 导航栏 / Header ========== */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 28px;
  /* 安全区域顶部适配 */
  padding-top: calc(14px + var(--safe-top));
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--color-text-primary);
}

.header-logo img {
  height: 28px;
  width: auto;
  min-width: 28px; /* 防止logo被压缩 */
}

.header-logo span {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.header-subtitle {
  font-size: 10px;
  color: var(--color-text-tertiary);
  letter-spacing: 0.06em;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}

/* ========== 首页 ========== */
.hero {
  text-align: center;
  padding: 44px 0 36px;
}

.hero-badge {
  display: inline-block;
  padding: 5px 14px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  font-size: 12px;
  color: var(--color-text-secondary);
  margin-bottom: 22px;
  letter-spacing: 0.03em;
}

.hero-title {
  font-size: 1.85rem;
  font-weight: 700;
  margin-bottom: 14px;
  letter-spacing: -0.03em;
  line-height: 1.25;
}

.hero-title .accent {
  color: var(--color-primary);
}

.hero-description {
  font-size: 0.95rem;
  color: var(--color-text-secondary);
  max-width: 420px;
  margin: 0 auto 32px;
  line-height: 1.75;
}

/* 首页信息卡片区域 */
.info-section {
  margin-top: 36px;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 36px;
}

.info-card {
  text-align: center;
  padding: 20px 10px;
  background: var(--color-surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
}

.info-card-number {
  font-size: 24px;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 6px;
}

.info-card-label {
  font-size: 11.5px;
  color: var(--color-text-secondary);
  line-height: 1.45;
}

/* 探索十六型人格 */
.types-preview {
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid var(--color-border);
}

.types-header {
  text-align: center;
  margin-bottom: 24px;
}

.types-header h3 {
  font-size: 1.05rem;
  color: var(--color-text-primary);
  font-weight: 600;
  margin-bottom: 4px;
}

.types-subtitle {
  font-size: 12px;
  color: var(--color-text-tertiary);
}

.types-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
}

.type-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 12px 6px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-normal);
  background: var(--color-background);
  /* 触摸目标最小尺寸 44px */
  min-height: 64px;
}

.type-chip:hover {
  border-color: var(--color-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* 移动端触摸反馈 */
.type-chip:active {
  transform: scale(0.96);
  background: rgba(248, 54, 79, 0.04);
  border-color: var(--color-primary);
}

.type-chip-code {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text-primary);
  font-family: var(--font-mono);
  letter-spacing: 0.03em;
}

.type-chip-name {
  font-size: 10px;
  color: var(--color-text-tertiary);
  white-space: nowrap;
}

/* ========== 按钮系统（移动端友好） ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 32px;
  font-size: 15px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-normal);
  font-family: var(--font-body);
  letter-spacing: 0.01em;
  /* 触摸目标最小高度 */
  min-height: 48px;
  /* 禁止按钮上的默认高亮 */
  -webkit-tap-highlight-color: transparent;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--color-primary);
  color: white;
}
.btn-primary:hover {
  background: var(--color-primary-dark);
  box-shadow: 0 4px 14px rgba(248, 54, 79, 0.3);
}

.btn-secondary {
  background: transparent;
  color: var(--color-text-primary);
  border: 1px solid var(--color-border);
}
.btn-secondary:hover {
  background: var(--color-hover);
  border-color: var(--color-text-tertiary);
}

.btn-large {
  padding: 15px 44px;
  font-size: 16px;
  border-radius: var(--radius-lg);
  min-height: 52px;
  width: 100%;
  max-width: 320px;
}

.btn-group {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* ========== 测试页面（移动端核心体验） ========== */
.test-header {
  position: sticky;
  top: 0;
  background: rgba(255,255,255,0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
  padding: 12px 0;
  z-index: 100;
  margin: 0 -18px;
  padding-left: 18px;
  padding-right: 18px;
  /* 安全区顶部适配 */
  top: env(safe-area-inset-top, 0px);
}

.progress-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 18px;
}

.progress-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.progress-label {
  font-size: 13px;
  color: var(--color-text-secondary);
  font-weight: 500;
}

.progress-count {
  font-size: 13px;
  color: var(--color-text-tertiary);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.progress-bar-bg {
  height: 5px;
  background: var(--color-border);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary-light), var(--color-primary));
  border-radius: var(--radius-full);
  transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 问题区域 */
.question-area {
  padding: 28px 0;
  min-height: calc(100vh - 110px);
  display: flex;
  flex-direction: column;
}

.question-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 26px 20px 22px;
  position: relative;
  flex: 1;
}

.question-number {
  font-size: 11.5px;
  color: var(--color-primary);
  font-weight: 600;
  letter-spacing: 0.06em;
  margin-bottom: 14px;
  font-family: var(--font-mono);
}

.question-text {
  font-size: 17px;
  font-weight: 500;
  color: var(--color-text-primary);
  line-height: 1.6;
  margin-bottom: 28px;
  word-break: break-word;
}

/* 七级量表 - 核心交互组件，必须触控友好 */
.scale-options {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
  margin-bottom: 18px;
}

.scale-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 10px 2px 7px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-background);
  cursor: pointer;
  transition: all var(--transition-normal);
  font-family: var(--font-body);
  /* 触摸目标足够大 */
  min-height: 58px;
  -webkit-tap-highlight-color: transparent;
}

.scale-option:hover {
  border-color: var(--color-text-tertiary);
}

.scale-option.selected {
  border-color: var(--color-primary);
  background: rgba(248, 54, 79, 0.05);
  box-shadow: 0 0 0 3px rgba(248, 54, 79, 0.08);
}

/* 触摸反馈 */
.scale-option:active:not(.selected) {
  transform: scale(0.95);
  background: var(--color-surface);
}

.scale-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-border);
  transition: all var(--transition-normal);
  flex-shrink: 0;
}

.scale-option.selected .scale-dot {
  background: var(--color-primary);
  width: 12px;
  height: 12px;
  box-shadow: 0 0 6px rgba(248, 54, 79, 0.35);
}

.scale-label {
  font-size: 9.5px;
  color: var(--color-text-tertiary);
  text-align: center;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.scale-option.selected .scale-label {
  color: var(--color-primary);
  font-weight: 600;
  font-size: 9px;
}

.scale-hints {
  display: flex;
  justify-content: space-between;
  padding: 0 2px;
  margin-top: 6px;
}

.scale-hint {
  font-size: 10px;
  color: var(--color-text-tertiary);
}

/* 导航按钮 */
.test-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--color-border);
  gap: 12px;
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 20px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-background);
  cursor: pointer;
  font-size: 14px;
  color: var(--color-text-secondary);
  font-weight: 500;
  transition: all var(--transition-fast);
  font-family: var(--font-body);
  min-height: 46px;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  flex: 1;
  max-width: 140px;
}

.nav-btn:hover:not(:disabled) {
  border-color: var(--color-text-tertiary);
  color: var(--color-text-primary);
}

.nav-btn:active:not(:disabled) {
  transform: scale(0.97);
}

.nav-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.nav-btn-next {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
  max-width: none;
  flex: 1.5;
  order: 2;
}
.nav-btn-next:hover:not(:disabled) {
  background: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
}

.nav-btn-submit {
  background: var(--color-success);
  color: white;
  border-color: var(--color-success);
  max-width: none;
  flex: 1.5;
  order: 2;
  font-size: 15px;
}

/* 上一题按钮靠左 */
#btn-prev { order: 1; }

/* ========== 结果页面 ========== */
.result-page {
  padding-bottom: 48px;
}

.result-header {
  text-align: center;
  padding: 32px 0 24px;
}

.result-badge {
  display: inline-block;
  padding: 5px 16px;
  background: rgba(248, 54, 79, 0.06);
  border: 1px solid rgba(248, 54, 79, 0.15);
  border-radius: var(--radius-full);
  font-size: 13px;
  color: var(--color-primary);
  font-weight: 600;
  letter-spacing: 0.07em;
  font-family: var(--font-mono);
  margin-bottom: 16px;
}

.result-type-name {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 6px;
  letter-spacing: -0.03em;
}

.result-type-code {
  font-size: 0.88rem;
  color: var(--color-text-tertiary);
  font-family: var(--font-mono);
  letter-spacing: 0.12em;
  margin-bottom: 12px;
}

.result-slogan {
  font-size: 1rem;
  color: var(--color-text-secondary);
  font-style: italic;
  margin-bottom: 28px;
}

/* 结果图片 */
.result-image-wrapper {
  display: flex;
  justify-content: center;
  margin-bottom: 32px;
}

.result-image {
  width: 160px;
  height: 160px;
  object-fit: contain;
}

/* 维度分析面板 */
.dimension-panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  margin-bottom: 24px;
}

.panel-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-secondary);
  margin-bottom: 20px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.dimension-row {
  margin-bottom: 20px;
}
.dimension-row:last-child {
  margin-bottom: 0;
}

.dimension-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 7px;
}

.dimension-labels {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dimension-letter-left {
  font-size: 12px;
  font-weight: 700;
  color: var(--color-text-tertiary);
  font-family: var(--font-mono);
  min-width: 20px;
}

.dimension-letter-active {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-primary);
  font-family: var(--font-mono);
  min-width: 20px;
}

.dimension-name {
  font-size: 12px;
  color: var(--color-text-secondary);
}

.dimension-percent {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--color-text-primary);
  font-family: var(--font-mono);
}

.dimension-bar-track {
  height: 8px;
  background: var(--color-border);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}

.dimension-bar-center {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--color-text-tertiary);
  transform: translateX(-50%);
}

.dimension-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  position: absolute;
  top: 0;
}

.dimension-bar-fill.left {
  left: 0;
  background: var(--color-text-tertiary);
  border-radius: var(--radius-full) 0 0 var(--radius-full);
}

.dimension-bar-fill.right {
  right: 0;
  background: var(--color-primary);
  border-radius: 0 var(--radius-full) var(--radius-full) 0;
}

/* 详细描述区域 */
.detail-section {
  margin-bottom: 24px;
}

.detail-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 22px 18px;
  margin-bottom: 16px;
}

.detail-card:last-child {
  margin-bottom: 0;
}

.detail-card-title {
  font-size: 14.5px;
  font-weight: 600;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.detail-list {
  list-style: none;
  padding: 0;
}

.detail-list li {
  padding: 7px 0;
  padding-left: 17px;
  position: relative;
  font-size: 13.5px;
  color: var(--color-text-secondary);
  line-height: 1.55;
  border-bottom: 1px solid rgba(0,0,0,0.04);
}
.detail-list li:last-child {
  border-bottom: none;
}
.detail-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 13px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--color-primary);
  opacity: 0.6;
}

.career-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.career-tag {
  padding: 5px 12px;
  background: var(--color-background);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  font-size: 12.5px;
  color: var(--color-text-secondary);
  line-height: 1.4;
}

/* 操作按钮区 */
.result-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 32px;
  flex-wrap: wrap;
}

.result-actions .btn {
  flex: 1;
  min-width: 120px;
  max-width: 160px;
  padding: 12px 16px;
  font-size: 14px;
  min-height: 46px;
}

/* ========== 页脚 ========== */
.footer {
  margin-top: 52px;
  padding: 20px 0;
  border-top: 1px solid var(--color-border);
  text-align: center;
}

.footer-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-bottom: 6px;
}

.footer-brand img {
  height: 18px;
}

.footer-text {
  font-size: 11.5px;
  color: var(--color-text-tertiary);
  line-height: 1.65;
}

/* ========== 分享弹窗 ========== */
.share-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.share-modal-overlay.show {
  display: flex;
}

.share-modal {
  background: white;
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  max-width: 380px;
  width: 90vw;
  box-shadow: var(--shadow-lg);
  max-height: 80vh;
  overflow-y: auto;
}

.share-modal-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 14px;
}

.share-modal-text {
  font-size: 12.5px;
  color: var(--color-text-secondary);
  background: var(--color-surface);
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  white-space: pre-line;
  line-height: 1.65;
  margin-bottom: 16px;
  font-family: var(--font-mono);
  user-select: all;
}

.share-modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* ========== 人格详情页面 ========== */
.type-detail-page {
  padding-bottom: 36px;
}

.type-detail-hero {
  text-align: center;
  padding: 26px 0 22px;
}

.type-detail-badge {
  display: inline-block;
  padding: 4px 14px;
  background: rgba(248, 54, 79, 0.06);
  border: 1px solid rgba(248, 54, 79, 0.15);
  border-radius: var(--radius-full);
  font-size: 12px;
  color: var(--color-primary);
  font-weight: 600;
  letter-spacing: 0.08em;
  font-family: var(--font-mono);
  margin-bottom: 12px;
}

.type-detail-name {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 4px;
  letter-spacing: -0.03em;
}

.type-detail-code {
  font-size: 0.85rem;
  color: var(--color-text-tertiary);
  font-family: var(--font-mono);
  letter-spacing: 0.12em;
}

.type-detail-slogan {
  font-size: 0.95rem;
  color: var(--color-text-secondary);
  font-style: italic;
  margin-top: 8px;
}

.type-detail-image-wrapper {
  display: flex;
  justify-content: center;
  margin-bottom: 26px;
}

.type-detail-image {
  width: 150px;
  height: 150px;
  object-fit: contain;
}

/* 维度标签行 */
.dimension-tags-row {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-bottom: 26px;
  flex-wrap: wrap;
}

.dimension-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 11.5px;
  font-weight: 500;
  font-family: var(--font-mono);
  letter-spacing: 0.03em;
}

.dimension-tag.active {
  background: rgba(248, 54, 79, 0.08);
  color: var(--color-primary);
  border: 1px solid rgba(248, 54, 79, 0.2);
}

.dimension-tag.inactive {
  background: var(--color-surface);
  color: var(--color-text-tertiary);
  border: 1px solid var(--color-border);
}

/* 占比信息 */
.type-meta {
  display: flex;
  justify-content: center;
  margin-bottom: 28px;
}

.type-meta-item {
  text-align: center;
  padding: 0 16px;
  position: relative;
}
.type-meta-item:not(:last-child)::after {
  content: "";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 20px;
  background: var(--color-border);
}
.type-meta-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-primary);
}
.type-meta-label {
  font-size: 10.5px;
  color: var(--color-text-tertiary);
  margin-top: 2px;
}

/* 相邻类型导航 */
.adjacent-types {
  margin-top: 36px;
  padding-top: 22px;
  border-top: 1px solid var(--color-border);
}

.adjacent-types h3 {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  margin-bottom: 14px;
  font-weight: 500;
}

.adjacent-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
}

/* ========== 加载动画 ========== */
.loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 40px auto;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ========== 工具类 ========== */
.text-center { text-align: center; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }

.hidden { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
}


/*
 * ========================================
 *   响应式断点 - 从小到大
 *   Mobile First: 默认样式 = 手机端
 * ========================================
 */

/* ---- 平板竖屏 (>= 600px) ---- */
@media (min-width: 600px) {
  html { font-size: 16px; }
  
  .container { padding: 24px 24px; }

  /* Header */
  .header { padding: 16px 0; margin-bottom: 32px; }
  .header-logo img { height: 32px; }
  .header-logo span { font-size: 15px; }
  .header-subtitle { font-size: 11px; max-width: none; }

  /* Hero */
  .hero { padding: 56px 0 48px; }
  .hero-badge { font-size: 13px; margin-bottom: 28px; }
  .hero-title { font-size: 2.2rem; margin-bottom: 16px; }
  .hero-description { font-size: 1.05rem; margin-bottom: 40px; }

  /* Info cards */
  .info-section { margin-top: 48px; }
  .info-grid { gap: 16px; margin-bottom: 48px; }
  .info-card { padding: 28px 16px; }
  .info-card-number { font-size: 28px; }
  .info-card-label { font-size: 13px; }

  /* Types grid */
  .types-preview { margin-top: 56px; padding-top: 40px; }
  .types-header { margin-bottom: 32px; }
  .types-header h3 { font-size: 1.15rem; }
  .types-subtitle { font-size: 13px; }
  .types-grid { gap: 10px; }
  .type-chip { padding: 14px 8px; min-height: 72px; }
  .type-chip-code { font-size: 15px; }
  .type-chip-name { font-size: 11px; }

  /* Test page */
  .test-header { margin: 0 -24px; padding-left: 24px; padding-right: 24px; padding: 14px 0; }
  .progress-container { padding: 0 24px; }
  .question-area { padding: 40px 0; }
  .question-card { padding: 34px 28px 26px; }
  .question-number { font-size: 12px; margin-bottom: 16px; }
  .question-text { font-size: 18px; margin-bottom: 32px; }
  
  .scale-options { gap: 6px; margin-bottom: 24px; }
  .scale-option { padding: 12px 4px 8px; min-height: 64px; }
  .scale-dot { width: 10px; height: 10px; }
  .scale-option.selected .scale-dot { width: 10px; height: 10px; }
  .scale-label { font-size: 11px; }
  .scale-option.selected .scale-label { font-size: 11px; }
  .scale-hint { font-size: 11px; }
  .scale-hints { margin-top: 4px; }
  
  .test-nav { margin-top: 32px; padding-top: 20px; gap: 16px; }
  .nav-btn { padding: 10px 22px; font-size: 14px; min-height: 44px; max-width: 140px; flex: 1; }
  .nav-btn-next, .nav-btn-submit { flex: 1.5; max-width: none; }

  /* Result page */
  .result-page { padding-bottom: 60px; }
  .result-header { padding: 40px 0 32px; }
  .result-badge { font-size: 13px; margin-bottom: 20px; }
  .result-type-name { font-size: 2.4rem; }
  .result-type-code { font-size: 1rem; margin-bottom: 16px; }
  .result-slogan { font-size: 1.1rem; margin-bottom: 32px; }
  .result-image-wrapper { margin-bottom: 40px; }
  .result-image { width: 200px; height: 200px; }
  
  .dimension-panel { padding: 30px 26px; margin-bottom: 32px; }
  .panel-title { font-size: 14px; margin-bottom: 24px; }
  .dimension-row { margin-bottom: 24px; }
  .dimension-header { margin-bottom: 8px; }
  .dimension-letter-left { font-size: 13px; min-width: 22px; }
  .dimension-letter-active { font-size: 14px; min-width: 22px; }
  .dimension-name { font-size: 13px; }
  .dimension-percent { font-size: 13px; }
  .dimension-bar-track { height: 8px; }
  
  .detail-section { margin-bottom: 32px; }
  .detail-card { padding: 26px 24px; margin-bottom: 20px; }
  .detail-card-title { font-size: 15px; margin-bottom: 14px; }
  .detail-list li { font-size: 14px; padding: 8px 0; padding-left: 20px; }
  .detail-list li::before { width: 6px; height: 6px; top: 15px; }
  .career-tags { gap: 8px; }
  .career-tag { font-size: 13px; padding: 6px 14px; }
  
  .result-actions { margin-top: 40px; gap: 12px; }
  .result-actions .btn { padding: 13px 24px; font-size: 15px; min-height: 50px; }

  /* Footer */
  .footer { margin-top: 64px; padding: 24px 0; }
  .footer-brand img { height: 20px; }
  .footer-text { font-size: 12px; }

  /* Type detail */
  .type-detail-page { padding-bottom: 40px; }
  .type-detail-hero { padding: 32px 0 28px; }
  .type-detail-badge { font-size: 13px; margin-bottom: 14px; }
  .type-detail-name { font-size: 2rem; }
  .type-detail-code { font-size: 0.9rem; }
  .type-detail-slogan { font-size: 1rem; margin-top: 10px; }
  .type-detail-image-wrapper { margin-bottom: 32px; }
  .type-detail-image { width: 180px; height: 180px; }
  .dimension-tags-row { gap: 8px; margin-bottom: 32px; }
  .dimension-tag { font-size: 12px; padding: 5px 12px; }
  .type-meta { margin-bottom: 36px; }
  .type-meta-value { font-size: 22px; }
  .type-meta-label { font-size: 11px; }
  .adjacent-types { margin-top: 48px; padding-top: 28px; }
  .adjacent-types h3 { font-size: 0.95rem; margin-bottom: 18px; }
  .adjacent-grid { gap: 8px; }

  .share-modal { padding: 32px; max-width: 420px; }
  .share-modal-title { font-size: 17px; margin-bottom: 16px; }
  .share-modal-text { font-size: 13px; padding: 14px; }
}

/* ---- 平板横屏 / 小桌面 (>= 900px) ---- */
@media (min-width: 900px) {
  .container { padding: 28px 28px; }
  
  .btn-large { width: auto; max-width: none; }

  .nav-btn { max-width: 130px; }
}

/* ---- 大桌面 (>= 1024px) ---- */
@media (min-width: 1024px) {
  .container { padding: 28px 32px; }
  
  /* 桌面端按钮不需要全宽 */
  .result-actions .btn {
    flex: 0 1 auto;
    min-width: 110px;
    max-width: none;
    padding: 13px 28px;
  }
}
