/* ==================== 基础变量与重置 ==================== */
:root {
  /* 中国风配色 */
  --primary-color: #8b0000; /* 暗红 - 主色 */
  --secondary-color: #d4a574; /* 金色 - 辅色 */
  --bg-color: #fdf5e6; /* 米白 - 背景 */
  --text-color: #2c1810; /* 深棕 - 文字 */
  --text-light: #6b4423; /* 浅棕 - 次要文字 */
  --border-color: #c19a6b; /* 边框色 */
  --shadow-color: rgba(139, 0, 0, 0.15);
  --card-bg: #fffaf0; /* 卡片背景 */

  /* 字体 */
  --font-title: "Ma Shan Zheng", "STKaiti", "KaiTi", "Songti SC", "STSong", serif;
  --font-body: "Noto Sans SC", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;

  /* 间距 */
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3rem;

  /* 圆角 */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
}

/* 重置样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* 水墨风格背景纹理 */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(
      ellipse at 20% 30%,
      rgba(139, 0, 0, 0.03) 0%,
      transparent 50%
    ),
    radial-gradient(
      ellipse at 80% 70%,
      rgba(212, 165, 116, 0.04) 0%,
      transparent 50%
    ),
    radial-gradient(
      ellipse at 50% 50%,
      rgba(44, 24, 16, 0.02) 0%,
      transparent 70%
    );
}

/* ==================== 页面容器与动画 ==================== */
.page-container {
  min-height: 100vh;
  width: 100%;
  padding: var(--spacing-md);
  animation: fadeIn 0.5s ease-out;
}

.hidden,
.page-container.hidden,
#page-home.hidden,
#page-quiz.hidden,
#page-result.hidden,
#page-gallery.hidden,
#page-stats.hidden {
  display: none !important;
}

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

/* ==================== 通用按钮样式 ==================== */
.btn-primary,
.btn-secondary {
  font-family: var(--font-body);
  font-size: 1.1rem;
  padding: 0.875rem 2.5rem;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-color) 0%, #a52a2a 100%);
  color: #fff;
  box-shadow: 0 4px 15px var(--shadow-color);
}

.btn-primary::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left 0.5s ease;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(139, 0, 0, 0.25);
}

.btn-primary:hover::before {
  left: 100%;
}

.btn-secondary {
  background: transparent;
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
  background: var(--primary-color);
  color: #fff;
}

.btn-secondary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* 返回按钮 */
.btn-back {
  display: inline-flex;
  align-items: center;
  color: var(--text-light);
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.3s ease;
}

.btn-back::before {
  content: "←";
  margin-right: 0.5rem;
  font-size: 1.2rem;
}

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

/* ==================== 首页样式 ==================== */
#page-home {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.home-content {
  max-width: 600px;
  padding: var(--spacing-xl);
}

.main-title {
  font-family: var(--font-title);
  font-size: 3rem;
  color: var(--primary-color);
  margin-bottom: var(--spacing-sm);
  text-shadow: 2px 2px 4px rgba(139, 0, 0, 0.1);
  letter-spacing: 0.1em;
}

/* 古典装饰线条 */
.decorative-line {
  width: 200px;
  height: 3px;
  margin: var(--spacing-md) auto;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--secondary-color) 20%,
    var(--primary-color) 50%,
    var(--secondary-color) 80%,
    transparent 100%
  );
  position: relative;
}

.decorative-line::before,
.decorative-line::after {
  content: "◆";
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: var(--secondary-color);
  font-size: 0.8rem;
}

.decorative-line::before {
  left: 25%;
}

.decorative-line::after {
  right: 25%;
}

.subtitle {
  font-size: 1.2rem;
  color: var(--text-light);
  margin-bottom: var(--spacing-xl);
  font-weight: 300;
}

#btn-start {
  margin-bottom: var(--spacing-xl);
  font-size: 1.25rem;
  padding: 1rem 3rem;
}

.home-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-md);
}

.nav-link {
  color: var(--text-light);
  text-decoration: none;
  font-size: 1rem;
  transition: color 0.3s ease;
  position: relative;
}

.nav-link::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary-color);
  transition: width 0.3s ease;
}

.nav-link:hover {
  color: var(--primary-color);
}

.nav-link:hover::after {
  width: 100%;
}

.nav-separator {
  color: var(--secondary-color);
}

/* ==================== 页面头部 ==================== */
.quiz-header,
.result-header,
.gallery-header,
.stats-header {
  padding-bottom: var(--spacing-md);
  margin-bottom: var(--spacing-lg);
  border-bottom: 1px solid rgba(193, 154, 107, 0.3);
}

.page-title {
  font-family: var(--font-title);
  font-size: 2rem;
  color: var(--primary-color);
  margin-top: var(--spacing-sm);
  text-align: center;
}

/* ==================== 测试页样式 ==================== */
.quiz-content {
  max-width: 700px;
  margin: 0 auto;
}

/* 进度条 */
.progress-section {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-lg);
}

.progress-bar {
  flex: 1;
  height: 8px;
  background: rgba(193, 154, 107, 0.3);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(
    90deg,
    var(--secondary-color),
    var(--primary-color)
  );
  border-radius: 4px;
  transition: width 0.4s ease;
  width: 5%;
}

.progress-text {
  font-size: 0.9rem;
  color: var(--text-light);
  min-width: 60px;
  text-align: right;
}

/* 题目区域 */
.question-section {
  margin-bottom: var(--spacing-lg);
}

.question-text {
  font-family: var(--font-body);
  font-size: 1.4rem;
  font-weight: 500;
  color: var(--text-color);
  line-height: 1.8;
}

/* 选项区域 */
.options-section {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-lg);
}

.option-card {
  background: var(--card-bg);
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.option-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--secondary-color);
  border-radius: var(--radius-md) 0 0 var(--radius-md);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.option-card:hover {
  border-color: var(--secondary-color);
  transform: translateX(5px);
  box-shadow: 0 4px 12px rgba(139, 0, 0, 0.1);
}

.option-card:hover::before {
  opacity: 1;
}

.option-card.selected {
  border-color: var(--primary-color);
  background: rgba(139, 0, 0, 0.05);
}

.option-card.selected::before {
  opacity: 1;
  background: var(--primary-color);
}

.option-text {
  font-size: 1.1rem;
  color: var(--text-color);
}

/* 测试导航 */
.quiz-nav {
  display: flex;
  justify-content: flex-start;
}

/* ==================== 结果页样式 ==================== */
.result-content {
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
}

/* 人物头像 */
.character-avatar-section {
  margin-bottom: var(--spacing-lg);
}

.avatar-frame {
  width: 180px;
  height: 180px;
  margin: 0 auto;
  border-radius: 50%;
  padding: 8px;
  background: linear-gradient(
    135deg,
    var(--secondary-color),
    var(--primary-color)
  );
  box-shadow: 0 8px 30px rgba(139, 0, 0, 0.2);
}

.character-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--card-bg);
}

/* 人物信息 */
.character-info-section {
  margin-bottom: var(--spacing-lg);
}

.character-name {
  font-family: var(--font-title);
  font-size: 2.5rem;
  color: var(--primary-color);
  margin-bottom: var(--spacing-xs);
}

.character-dynasty {
  font-size: 1.1rem;
  color: var(--secondary-color);
  margin-bottom: var(--spacing-md);
  font-weight: 500;
}

.character-description {
  font-size: 1rem;
  color: var(--text-light);
  line-height: 1.8;
  padding: 0 var(--spacing-md);
}

/* 雷达图 */
.radar-section {
  margin-bottom: var(--spacing-lg);
  display: flex;
  justify-content: center;
}

#radar-chart {
  max-width: 100%;
  height: auto;
}

/* 结果页按钮 */
.result-actions {
  display: flex;
  gap: var(--spacing-md);
  justify-content: center;
  flex-wrap: wrap;
}

/* 相似度标签 */
.similarity-badge {
  display: inline-block;
  background: linear-gradient(135deg, var(--primary-color), #a52a2a);
  color: #fff;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
}

/* 名言引用样式 */
.character-quote {
  margin: 1.5rem 0 0;
  padding: 1rem 1.5rem;
  background: rgba(139, 0, 0, 0.05);
  border-left: 3px solid var(--primary-color);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-style: italic;
  color: var(--text-color);
  position: relative;
}

.quote-mark {
  color: var(--primary-color);
  font-size: 1.5rem;
  font-family: var(--font-title);
  line-height: 1;
}

/* 其他可能匹配区域 */
.other-matches-section {
  margin: var(--spacing-lg) 0;
  padding: var(--spacing-md);
  background: rgba(255, 250, 240, 0.8);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(193, 154, 107, 0.3);
}

.other-matches-title {
  font-family: var(--font-title);
  font-size: 1.3rem;
  color: var(--primary-color);
  margin-bottom: var(--spacing-md);
  text-align: center;
}

.other-matches-list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.other-match-card {
  display: flex;
  align-items: center;
  padding: var(--spacing-sm);
  background: var(--card-bg);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.3s ease;
  border: 1px solid transparent;
}

.other-match-card:hover {
  border-color: var(--secondary-color);
  transform: translateX(5px);
  box-shadow: 0 4px 12px rgba(139, 0, 0, 0.1);
}

.other-match-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: var(--spacing-sm);
  flex-shrink: 0;
}

.other-match-avatar span {
  font-size: 1.5rem;
  color: rgba(255, 255, 255, 0.9);
  font-family: var(--font-title);
}

.other-match-info {
  flex: 1;
  text-align: left;
}

.other-match-name {
  font-weight: 500;
  color: var(--text-color);
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.other-match-dynasty {
  font-size: 0.85rem;
  color: var(--text-light);
}

.other-match-similarity {
  font-size: 0.9rem;
  color: var(--primary-color);
  font-weight: 500;
}

/* 分享弹窗样式 */
.share-modal-content {
  max-width: 500px;
}

.share-modal-body {
  padding: var(--spacing-lg);
}

.share-modal-title {
  font-family: var(--font-title);
  font-size: 1.5rem;
  color: var(--primary-color);
  text-align: center;
  margin-bottom: var(--spacing-md);
}

.share-preview {
  display: flex;
  justify-content: center;
  margin-bottom: var(--spacing-md);
  padding: var(--spacing-sm);
  background: rgba(0, 0, 0, 0.05);
  border-radius: var(--radius-md);
}

.share-actions {
  display: flex;
  gap: var(--spacing-sm);
  justify-content: center;
  flex-wrap: wrap;
}

.share-actions .btn-primary,
.share-actions .btn-secondary {
  flex: 1;
  min-width: 140px;
}

/* ==================== 图鉴页样式 ==================== */
.gallery-content {
  max-width: 1200px;
  margin: 0 auto;
}

/* 朝代筛选栏 */
.dynasty-filter {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-sm);
  justify-content: center;
  margin-bottom: var(--spacing-lg);
  padding: var(--spacing-md);
  background: rgba(255, 250, 240, 0.8);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(193, 154, 107, 0.3);
}

.filter-btn {
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 0.5rem 1.25rem;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-light);
  cursor: pointer;
  transition: all 0.3s ease;
}

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

.filter-btn.active {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: #fff;
}

/* 人物卡片网格 */
.character-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: var(--spacing-md);
}

.character-card {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  cursor: pointer;
  border: 1px solid rgba(193, 154, 107, 0.2);
}

.character-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(139, 0, 0, 0.15);
  border-color: var(--secondary-color);
}

.card-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: linear-gradient(135deg, #f5f5f5, #e0e0e0);
}

.card-content {
  padding: var(--spacing-md);
}

.card-name {
  font-family: var(--font-title);
  font-size: 1.5rem;
  color: var(--primary-color);
  margin-bottom: var(--spacing-xs);
}

.card-dynasty {
  font-size: 0.9rem;
  color: var(--secondary-color);
  margin-bottom: var(--spacing-xs);
}

.card-brief {
  font-size: 0.9rem;
  color: var(--text-light);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 弹窗样式 */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(44, 24, 16, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: var(--spacing-md);
  animation: fadeIn 0.3s ease;
}

.modal-overlay.hidden {
  display: none;
}

.modal-content {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  max-width: 600px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  border: 1px solid var(--secondary-color);
}

.modal-close {
  position: absolute;
  top: var(--spacing-sm);
  right: var(--spacing-sm);
  width: 36px;
  height: 36px;
  background: transparent;
  border: none;
  font-size: 1.8rem;
  color: var(--text-light);
  cursor: pointer;
  transition: color 0.3s ease;
  z-index: 10;
}

.modal-close:hover {
  color: var(--primary-color);
}

.modal-body {
  padding: var(--spacing-xl);
}

/* ==================== 排行榜页样式 ==================== */
.stats-content {
  max-width: 800px;
  margin: 0 auto;
}

.stats-chart-section {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  margin-bottom: var(--spacing-lg);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(193, 154, 107, 0.2);
}

#stats-chart {
  max-width: 100%;
  height: auto;
}

.ranking-section {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(193, 154, 107, 0.2);
}

.section-title {
  font-family: var(--font-title);
  font-size: 1.5rem;
  color: var(--primary-color);
  margin-bottom: var(--spacing-md);
  text-align: center;
}

.ranking-list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.ranking-item {
  display: flex;
  align-items: center;
  padding: var(--spacing-md);
  background: rgba(255, 250, 240, 0.8);
  border-radius: var(--radius-md);
  transition: all 0.3s ease;
  border: 1px solid transparent;
}

.ranking-item:hover {
  border-color: var(--secondary-color);
  transform: translateX(5px);
}

.ranking-number {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-title);
  font-size: 1.25rem;
  color: var(--secondary-color);
  background: rgba(139, 0, 0, 0.05);
  border-radius: 50%;
  margin-right: var(--spacing-md);
}

.ranking-item:nth-child(1) .ranking-number {
  background: linear-gradient(135deg, #ffd700, #ffa500);
  color: #fff;
}

.ranking-item:nth-child(2) .ranking-number {
  background: linear-gradient(135deg, #c0c0c0, #a0a0a0);
  color: #fff;
}

.ranking-item:nth-child(3) .ranking-number {
  background: linear-gradient(135deg, #cd7f32, #b87333);
  color: #fff;
}

.ranking-info {
  flex: 1;
}

.ranking-name {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text-color);
  margin-bottom: 0.25rem;
}

.ranking-count {
  font-size: 0.85rem;
  color: var(--text-light);
}

.ranking-bar {
  width: 100px;
  height: 6px;
  background: rgba(193, 154, 107, 0.3);
  border-radius: 3px;
  overflow: hidden;
}

.ranking-bar-fill {
  height: 100%;
  background: linear-gradient(
    90deg,
    var(--secondary-color),
    var(--primary-color)
  );
  border-radius: 3px;
  transition: width 0.5s ease;
}

/* ==================== 响应式设计 ==================== */

/* 平板断点：768px */
@media screen and (min-width: 768px) {
  :root {
    --spacing-md: 2rem;
    --spacing-lg: 2.5rem;
    --spacing-xl: 4rem;
  }

  .main-title {
    font-size: 4rem;
  }

  .subtitle {
    font-size: 1.4rem;
  }

  .page-title {
    font-size: 2.5rem;
  }

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

  .character-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .character-name {
    font-size: 3rem;
  }

  .avatar-frame {
    width: 220px;
    height: 220px;
  }
}

/* 桌面断点：1024px */
@media screen and (min-width: 1024px) {
  .main-title {
    font-size: 4.5rem;
  }

  .character-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .quiz-content,
  .result-content {
    max-width: 800px;
  }
}

/* 大屏幕：1200px+ */
@media screen and (min-width: 1200px) {
  .character-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* 手机断点：480px以下 */
@media screen and (max-width: 480px) {
  html {
    font-size: 14px;
  }

  .main-title {
    font-size: 2.2rem;
  }

  .page-container {
    padding: var(--spacing-sm);
  }

  .btn-primary,
  .btn-secondary {
    padding: 0.75rem 2rem;
    font-size: 1rem;
  }

  .dynasty-filter {
    gap: var(--spacing-xs);
  }

  .filter-btn {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
  }

  .avatar-frame {
    width: 150px;
    height: 150px;
  }

  .result-actions {
    flex-direction: column;
    align-items: center;
  }

  .result-actions .btn-primary,
  .result-actions .btn-secondary {
    width: 100%;
    max-width: 280px;
  }
}

/* ==================== 中国风装饰元素 ==================== */

/* 云纹装饰 */
.cloud-pattern {
  position: relative;
}

.cloud-pattern::after {
  content: "☁";
  position: absolute;
  opacity: 0.1;
  font-size: 3rem;
  color: var(--primary-color);
}

/* 边框装饰 */
.chinese-border {
  border: 2px solid var(--border-color);
  position: relative;
}

.chinese-border::before {
  content: "";
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  bottom: -4px;
  border: 1px solid var(--secondary-color);
  pointer-events: none;
}

/* 印章效果 */
.seal {
  display: inline-block;
  padding: 0.5rem 1rem;
  border: 3px solid var(--primary-color);
  color: var(--primary-color);
  font-family: var(--font-title);
  font-size: 1.2rem;
  transform: rotate(-5deg);
  opacity: 0.8;
}

/* ==================== 长文分析区域样式 ==================== */

/* 分析区域整体容器 */
.analysis-section {
  margin: var(--spacing-lg) 0;
  padding: var(--spacing-lg);
  background: linear-gradient(
    135deg,
    rgba(255, 250, 240, 0.95) 0%,
    rgba(253, 245, 230, 0.95) 100%
  );
  border: 2px solid var(--border-color);
  border-radius: var(--radius-lg);
  position: relative;
  box-shadow: 0 4px 20px rgba(139, 0, 0, 0.08);
}

/* 古典边框装饰 */
.analysis-section::before {
  content: "";
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  bottom: 8px;
  border: 1px solid rgba(193, 154, 107, 0.4);
  border-radius: calc(var(--radius-lg) - 4px);
  pointer-events: none;
}

/* 四角装饰 */
.analysis-section::after {
  content: "❧";
  position: absolute;
  top: 12px;
  right: 16px;
  color: var(--secondary-color);
  font-size: 1.2rem;
  opacity: 0.6;
}

/* 分析区域头部 */
.analysis-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-lg);
  padding-bottom: var(--spacing-md);
  border-bottom: 1px solid rgba(193, 154, 107, 0.3);
}

.analysis-icon {
  font-size: 1.5rem;
  opacity: 0.7;
}

.analysis-title {
  font-family: var(--font-title);
  font-size: 1.6rem;
  color: var(--primary-color);
  margin: 0;
  letter-spacing: 0.15em;
}

/* 分析内容区域 */
.analysis-content {
  text-align: left;
}

/* 各小节 */
.analysis-part {
  margin-bottom: var(--spacing-lg);
}

.analysis-part:last-child {
  margin-bottom: 0;
}

/* 小节标题 - 仿古样式 */
.part-title {
  font-family: var(--font-title);
  font-size: 1.25rem;
  color: var(--primary-color);
  margin-bottom: var(--spacing-sm);
  padding-left: var(--spacing-sm);
  border-left: 3px solid var(--secondary-color);
  position: relative;
}

.part-title::before {
  content: "◆";
  position: absolute;
  left: -12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--secondary-color);
  font-size: 0.6rem;
}

/* 正文段落 */
.part-text {
  font-size: 1rem;
  color: var(--text-color);
  line-height: 1.9;
  margin-bottom: var(--spacing-sm);
  text-align: justify;
  text-indent: 2em;
}

.part-text:last-child {
  margin-bottom: 0;
}

/* 高亮样式 */
.highlight-name {
  color: var(--primary-color);
  font-weight: 600;
  font-size: 1.05em;
}

.highlight-score {
  color: var(--primary-color);
  font-weight: 700;
  font-size: 1.1em;
}

.highlight-dim {
  color: #b8860b;
  font-weight: 600;
}

.highlight-trait {
  color: var(--primary-color);
  font-weight: 600;
  border-bottom: 1px dashed var(--secondary-color);
  padding-bottom: 1px;
}

/* 性格类型标签 */
.personality-type {
  text-align: center;
  margin: var(--spacing-md) 0;
}

.type-label {
  display: inline-block;
  padding: 0.5rem 1.5rem;
  background: linear-gradient(135deg, var(--primary-color) 0%, #a52a2a 100%);
  color: #fff;
  font-family: var(--font-title);
  font-size: 1.3rem;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 12px rgba(139, 0, 0, 0.2);
}

/* 维度分析列表 */
.dim-analysis {
  margin-top: var(--spacing-md);
}

.dim-item {
  margin-bottom: var(--spacing-sm);
  padding: var(--spacing-sm);
  background: rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--secondary-color);
  line-height: 1.8;
}

.dim-name {
  display: inline-block;
  color: var(--primary-color);
  font-weight: 600;
  margin-right: 0.5rem;
  min-width: 100px;
}

/* 建议内容 */
.advice-content {
  margin-top: var(--spacing-sm);
}

.advice-item {
  margin-bottom: var(--spacing-sm);
  padding: var(--spacing-sm) var(--spacing-md);
  background: rgba(139, 0, 0, 0.03);
  border-radius: var(--radius-sm);
  line-height: 1.8;
  text-align: justify;
}

.advice-mark {
  color: var(--secondary-color);
  margin-right: 0.5rem;
  font-size: 0.8rem;
}

/* 装饰性分隔线 */
.analysis-divider {
  height: 1px;
  margin: var(--spacing-lg) 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(193, 154, 107, 0.4) 20%,
    rgba(139, 0, 0, 0.3) 50%,
    rgba(193, 154, 107, 0.4) 80%,
    transparent 100%
  );
  position: relative;
}

.analysis-divider::before {
  content: "✦";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  color: var(--secondary-color);
  font-size: 0.8rem;
  background: var(--card-bg);
  padding: 0 0.5rem;
}

/* 结语部分特殊样式 */
.conclusion-part {
  text-align: center;
  background: rgba(139, 0, 0, 0.03);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
}

.conclusion-text {
  font-size: 1.05rem;
  color: var(--text-color);
  line-height: 2;
  text-align: center;
  font-style: italic;
  margin-bottom: var(--spacing-md);
}

.conclusion-seal {
  display: inline-block;
  margin-top: var(--spacing-sm);
}

.seal-text {
  display: inline-block;
  padding: 0.4rem 1rem;
  border: 2px solid var(--primary-color);
  color: var(--primary-color);
  font-family: var(--font-title);
  font-size: 1.1rem;
  transform: rotate(-3deg);
  opacity: 0.85;
  background: rgba(255, 255, 255, 0.5);
}

/* ==================== 响应式适配 ==================== */

@media screen and (max-width: 768px) {
  .analysis-section {
    padding: var(--spacing-md);
    margin: var(--spacing-md) 0;
  }

  .analysis-title {
    font-size: 1.4rem;
  }

  .part-title {
    font-size: 1.15rem;
  }

  .part-text {
    font-size: 0.95rem;
    line-height: 1.8;
  }

  .type-label {
    font-size: 1.1rem;
    padding: 0.4rem 1.2rem;
  }

  .dim-name {
    display: block;
    margin-bottom: 0.25rem;
    min-width: auto;
  }

  .dim-item {
    padding: var(--spacing-sm);
  }

  .advice-item {
    padding: var(--spacing-sm);
  }

  .conclusion-text {
    font-size: 0.95rem;
  }
}

@media screen and (max-width: 480px) {
  .analysis-section {
    padding: var(--spacing-sm);
    border-width: 1px;
  }

  .analysis-section::before {
    top: 4px;
    left: 4px;
    right: 4px;
    bottom: 4px;
  }

  .analysis-header {
    gap: var(--spacing-xs);
  }

  .analysis-title {
    font-size: 1.25rem;
    letter-spacing: 0.1em;
  }

  .analysis-icon {
    font-size: 1.2rem;
  }

  .part-title {
    font-size: 1.1rem;
    padding-left: 0.75rem;
  }

  .part-text {
    font-size: 0.9rem;
    text-indent: 1.5em;
  }

  .type-label {
    font-size: 1rem;
    padding: 0.35rem 1rem;
  }

  .dim-item {
    font-size: 0.9rem;
  }

  .advice-item {
    font-size: 0.9rem;
  }

  .conclusion-text {
    font-size: 0.9rem;
    line-height: 1.8;
  }

  .seal-text {
    font-size: 1rem;
    padding: 0.3rem 0.8rem;
  }
}
