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

:root {
  --primary: #7C3AED;
  --primary-light: #8B5CF6;
  --primary-dark: #6D28D9;
  --secondary: #F0B90B;
  --bg-light: #F8F7FC;
  --bg-white: #FFFFFF;
  --bg-card: #FFFFFF;
  --text-primary: #1F2937;
  --text-secondary: #6B7280;
  --text-muted: #9CA3AF;
  --border-color: #E5E7EB;
  --success: #10B981;
  --gradient: linear-gradient(135deg, #7C3AED 0%, #A855F7 100%);
}

body {
  font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-light);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
}

.container {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
}

.page {
  display: none;
}

.page.active {
  display: block;
  animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ========== 首页样式 ========== */

/* 顶部标题区 */
.hero-section {
  text-align: center;
  padding: 60px 20px 40px;
  background: var(--gradient);
  border-radius: 24px;
  margin-bottom: 40px;
  color: white;
}

.main-title {
  font-size: 42px;
  font-weight: 900;
  margin-bottom: 16px;
  text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.main-subtitle {
  font-size: 18px;
  opacity: 0.9;
}

/* 步骤说明 */
.steps-section {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 40px;
}

.step-item {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  background: var(--bg-white);
  padding: 24px;
  border-radius: 16px;
  border: 1px solid var(--border-color);
  transition: all 0.3s;
}

.step-item:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 20px rgba(124, 58, 237, 0.1);
}

.step-icon {
  font-size: 32px;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-light);
  border-radius: 12px;
  flex-shrink: 0;
}

.step-content {
  flex: 1;
}

.step-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.step-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.step-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* 开始按钮区 */
.start-section {
  text-align: center;
  margin-bottom: 50px;
}

.btn-start {
  background: var(--gradient);
  color: white;
  border: none;
  padding: 18px 60px;
  font-size: 20px;
  font-weight: 700;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 4px 20px rgba(124, 58, 237, 0.4);
}

.btn-start:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(124, 58, 237, 0.5);
}

.test-info {
  margin-top: 16px;
  font-size: 14px;
  color: var(--text-muted);
}

/* 人格类型预览 */
.types-preview {
  background: var(--bg-white);
  padding: 32px;
  border-radius: 20px;
  border: 1px solid var(--border-color);
  margin-bottom: 30px;
}

.preview-title {
  text-align: center;
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 24px;
  color: var(--text-primary);
}

.types-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.type-badge {
  background: var(--bg-light);
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  text-align: center;
  color: var(--text-secondary);
  transition: all 0.2s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.type-badge:hover {
  background: var(--primary);
  color: white;
  transform: scale(1.05);
}

/* 底部信息 */
.footer-info {
  text-align: center;
  padding: 20px;
  color: var(--text-muted);
  font-size: 13px;
}

/* ========== 问题页面样式 ========== */

#question-page {
  padding: 20px 0;
}

.question-container {
  background: var(--bg-white);
  border-radius: 20px;
  padding: 40px 30px;
  border: 1px solid var(--border-color);
  box-shadow: 0 2px 20px rgba(0,0,0,0.05);
}

.progress-section {
  margin-bottom: 30px;
}

.progress-text {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 10px;
  text-align: center;
}

.progress-bar {
  height: 8px;
  background: var(--bg-light);
  border-radius: 4px;
  overflow: hidden;
}

.progress {
  height: 100%;
  background: var(--gradient);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.question-text {
  font-size: 22px;
  font-weight: 600;
  line-height: 1.6;
  margin-bottom: 30px;
  text-align: center;
  color: var(--text-primary);
  min-height: 66px;
}

.options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.option {
  background: var(--bg-light);
  border: 2px solid transparent;
  padding: 18px 24px;
  border-radius: 12px;
  font-size: 16px;
  line-height: 1.5;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
  color: var(--text-primary);
}

.option:hover {
  border-color: var(--primary);
  background: white;
  transform: translateX(5px);
}

.option:active {
  transform: scale(0.98);
}

.option.selected {
  border-color: var(--primary);
  background: rgba(124, 58, 237, 0.1);
  color: var(--primary);
  font-weight: 600;
}

.option.selected::before {
  content: "✓ ";
  color: var(--primary);
}

.btn-next {
  background: var(--gradient);
  color: white;
  border: none;
  padding: 16px 24px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s;
  width: 100%;
  margin-top: 16px;
}

.btn-next:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(124, 58, 237, 0.4);
}

.question-footer {
  margin-top: 30px;
  min-height: 50px;
}

.btn-back {
  background: transparent;
  border: 2px solid var(--border-color);
  color: var(--text-secondary);
  padding: 12px 24px;
  font-size: 15px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
}

.btn-back:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(124, 58, 237, 0.05);
}

/* ========== 结果页面样式 ========== */

#result-page {
  padding: 20px 0;
}

.result-card {
  background: linear-gradient(145deg, #FFFFFF 0%, #F8F7FC 100%);
  border-radius: 24px;
  padding: 40px 30px;
  text-align: center;
  border: 1px solid var(--border-color);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.card-header {
  margin-bottom: 20px;
}

.card-badge {
  background: var(--gradient);
  color: white;
  padding: 8px 20px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
}

.card-type {
  font-size: 52px;
  font-weight: 900;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
  letter-spacing: 4px;
}

.card-name {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--text-primary);
}

.card-desc {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 24px;
  padding: 0 10px;
}

.card-traits {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 24px;
}

.trait {
  background: rgba(124, 58, 237, 0.1);
  color: var(--primary);
  padding: 8px 18px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
}

.card-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 24px;
}

.stat-item {
  background: var(--bg-light);
  padding: 14px 10px;
  border-radius: 12px;
}

.stat-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.stat-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
}

.stat-value.highlight {
  color: var(--primary);
}

.card-footer {
  font-size: 12px;
  color: var(--text-muted);
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
}

/* 分享按钮 */
.share-section {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.btn-share {
  background: #000;
  color: #fff;
  border: none;
  padding: 16px 24px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.btn-share:hover {
  background: #1a1a1a;
  transform: translateY(-2px);
}

.btn-back-result {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
  padding: 14px 24px;
  font-size: 15px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-back-result:hover {
  background: rgba(124, 58, 237, 0.1);
}

.btn-retry {
  background: transparent;
  color: var(--text-secondary);
  border: 2px solid var(--border-color);
  padding: 14px 24px;
  font-size: 15px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-retry:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* ========== 响应式 ========== */

@media (max-width: 768px) {
  .main-title {
    font-size: 32px;
  }
  
  .hero-section {
    padding: 40px 20px 30px;
    border-radius: 20px;
  }
  
  .step-item {
    padding: 20px;
  }
  
  .step-icon {
    width: 50px;
    height: 50px;
    font-size: 24px;
  }
  
  .types-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .question-container {
    padding: 30px 20px;
  }
  
  .question-text {
    font-size: 18px;
  }
  
  .card-type {
    font-size: 40px;
  }
  
  .card-name {
    font-size: 22px;
  }
  
  .card-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .container {
    padding: 15px;
  }
  
  .main-title {
    font-size: 26px;
  }
  
  .main-subtitle {
    font-size: 15px;
  }
  
  .btn-start {
    padding: 16px 40px;
    font-size: 18px;
  }
  
  .types-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  
  .type-badge {
    font-size: 12px;
    padding: 8px 10px;
  }
}
