/* 
  性倾向探索测试 - 完整样式表
  © 2026 菏泽明浩心理咨询服务有限公司
  风格继承自 lovebrain.css，主色调整为包容性光谱色系
*/

:root {
  /* 主题色：采用更中性、包容的紫粉色系 */
  --bg-primary: #fcf9ff;           /* 背景色：极浅薰衣草 */
  --bg-card: #ffffff;              /* 卡片背景 */
  --accent-pink: #d946ef;          /* 主强调色：活力紫粉 */
  --accent-light: #fae8ff;         /* 按钮悬停/选中浅色 */
  --text-primary: #7e22ce;         /* 主文字：深紫 */
  --text-secondary: #a21caf;       /* 次要文字：中紫 */
  --text-muted: #c084fc;           /* 辅助文字：浅紫 */
  --border-color: #e9d5ff;         /* 边框/分割线 */
  --shadow: 0 4px 12px rgba(217, 70, 239, 0.1); /* 柔和阴影 */

  /* 字体 */
  --font-main: 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

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

body {
  font-family: var(--font-main);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  padding: 20px;
  min-height: 100vh;
}

.container {
  max-width: 600px;
  margin: 0 auto;
}

.page {
  display: none;
  animation: fadeIn 0.5s ease-out;
}

.page.active {
  display: block;
}

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

/* —————— 首页 Hero —————— */
.hero {
  text-align: center;
  margin-bottom: 30px;
}

.logo {
  font-size: 3rem;
  margin-bottom: 12px;
}

.main-title {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
  line-height: 1.3;
}

.subtitle {
  font-size: 1rem;
  color: var(--text-muted);
}

/* —————— 介绍卡片 —————— */
.intro-card {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 30px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-color);
}

.intro-card h3 {
  font-size: 1.2rem;
  margin-bottom: 12px;
  color: var(--text-secondary);
}

.intro-card p {
  font-size: 0.95rem;
  color: var(--text-primary);
  margin-bottom: 15px;
}

.factors-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.factor-tag {
  background: var(--accent-light);
  color: var(--text-secondary);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
}

/* —————— 按钮 —————— */
.btn-start,
.restart-btn,
.btn-nav {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 12px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-main);
}

.btn-start,
.restart-btn {
  background: var(--accent-pink);
  color: white;
  margin-top: 10px;
  box-shadow: var(--shadow);
}

.btn-start:hover,
.restart-btn:hover {
  background: #be1fe0;
  transform: translateY(-2px);
}

.btn-nav {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  font-size: 1rem;
}

.btn-nav:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* —————— 答题页 —————— */
.quiz-container {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-color);
}

.progress-bar {
  height: 6px;
  background: #f3e8ff;
  border-radius: 3px;
  margin-bottom: 20px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--accent-pink);
  border-radius: 3px;
  transition: width 0.4s ease;
}

.question-meta {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  text-align: right;
}

.question-text {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 24px;
  color: var(--text-primary);
  line-height: 1.5;
}

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

.option-btn {
  padding: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  text-align: left;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--text-primary);
}

.option-btn:hover {
  background: #f5f3ff;
  border-color: #ddd6fe;
}

.option-btn.selected {
  background: var(--accent-light);
  border-color: var(--accent-pink);
  color: var(--text-secondary);
  font-weight: 600;
}

.nav-buttons {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

/* —————— 结果页 —————— */
.result-container {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-color);
  margin-bottom: 30px;
}

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

.score-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}

.score-box {
  text-align: center;
}

.score-label {
  display: block;
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.score-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent-pink);
}

.score-max {
  font-size: 1.2rem;
  color: var(--text-muted);
}

.level-badge {
  background: #8b5cf6;
  color: white;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.95rem;
  font-weight: 600;
}

.chart-wrapper {
  height: 280px;
  margin: 20px 0;
}

.core-pain-point {
  background: #f5f3ff;
  border-left: 4px solid #8b5cf6;
  padding: 12px 16px;
  margin: 20px 0;
  border-radius: 0 8px 8px 0;
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.interpretation {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text-primary);
  margin-top: 15px;
}

.interpretation h4 {
  margin: 16px 0 8px;
  color: var(--text-secondary);
}

.interpretation ul {
  padding-left: 20px;
  margin: 10px 0;
}

.interpretation li {
  margin-bottom: 6px;
  color: var(--text-secondary);
}

/* —————— 公众号二维码区 —————— */
.qrcode-section {
  text-align: center;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
}

.qrcode-img {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 10px;
  border: 1px solid var(--border-color);
}

.qrcode-text {
  font-size: 0.95rem;
  color: var(--text-secondary);
}

/* —————— Toast 提示 —————— */
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 0.95rem;
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 1000;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* —————— 响应式优化 —————— */
@media (max-width: 480px) {
  .main-title {
    font-size: 1.5rem;
  }

  .question-text {
    font-size: 1.1rem;
  }

  .score-value {
    font-size: 1.6rem;
  }

  .chart-wrapper {
    height: 240px;
  }
}