/* 生肖缘配 - PHP版本样式表 */

:root {
  --gold: #D4AF37;
  --brown: #8B4513;
  --red: #C84C31;
  --cream: #FFFEF9;
  --text-dark: #5D4037;
  --text-light: #8B7355;
  --shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

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

html {
  overflow-x: hidden;
  max-width: 100%;
}

body {
  font-family: 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: linear-gradient(135deg, #F5F5F0, #E8F4F8, #F0EBE3);
  color: var(--text-dark);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
  max-width: 100%;
}

/* Header */
.header {
  background: rgba(255, 254, 249, 0.95);
  border-bottom: 2px solid var(--gold);
  padding: 16px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.logo-text h1 {
  font-size: 24px;
  color: var(--brown);
  font-weight: 700;
}

.logo-text p {
  font-size: 12px;
  color: var(--text-light);
}

.nav {
  display: flex;
  gap: 24px;
}

.nav a {
  color: var(--text-dark);
  text-decoration: none;
  font-size: 14px;
  transition: opacity 0.3s;
}

.nav a:hover {
  opacity: 0.7;
}

/* Banner */
.banner {
  position: relative;
  background-image: url('images/banner.jpeg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  overflow: hidden;
  /* 默认情况下给个底色，避免图片加载前闪白 */
  background-color: rgba(139, 69, 19, 0.2);
  padding: 48px 16px;
  text-align: center;
  border-bottom: 3px solid var(--gold);
}

.banner-overlay {
  position: absolute;
  inset: 0;
  z-index: 0;
  /* 保留原先的金棕渐变遮罩，让文字在图片上依旧清晰 */
  background: linear-gradient(
    135deg,
    rgba(139, 69, 19, 0.75),
    rgba(160, 82, 45, 0.65),
    rgba(139, 69, 19, 0.75)
  );
  pointer-events: none;
}

.banner-content {
  position: relative;
  z-index: 1;
}

.banner h2 {
  font-size: 36px;
  color: var(--cream);
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
  margin-bottom: 8px;
}

.banner p {
  font-size: 18px;
  color: #FFE4C4;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

.banner-tags {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.banner-tags span {
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  border: 1px solid rgba(212, 175, 55, 0.5);
  background: rgba(212, 175, 55, 0.25);
  color: var(--cream);
  backdrop-filter: blur(4px);
}

/* Main Content */
.main-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px;
}

@media (max-width: 768px) {
  .main-content {
    padding: 16px;
  }
}

/* Selector Card */
.selector-card {
  background: var(--cream);
  border: 2px solid var(--gold);
  border-radius: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 32px;
  overflow: hidden;
}

.selector-header {
  text-align: center;
  padding: 24px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.2);
}

.selector-header h2 {
  font-size: 24px;
  color: var(--brown);
}

/* Zodiac Section */
.zodiac-section {
  padding: 12px;
  margin: 8px;
  border-radius: 12px;
}

.male-section {
  background: rgba(212, 175, 55, 0.08);
}

.female-section {
  background: rgba(200, 76, 49, 0.08);
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 16px;
  color: var(--brown);
}

.gender-icon {
  width: 20px;
  height: 20px;
}

.selected-tag {
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 12px;
  color: var(--cream);
}

.male-section .selected-tag {
  background: #C9A86C;
}

.female-section .selected-tag {
  background: var(--red);
}

.zodiac-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}

@media (max-width: 768px) {
  .zodiac-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 480px) {
  .zodiac-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }
}

.zodiac-item {
  padding: 8px;
  border: 2px solid #D4C4B0;
  border-radius: 8px;
  background: #FFFEFC;
  cursor: pointer;
  text-align: center;
  transition: all 0.3s;
  position: relative;
  min-width: 0;
  overflow: hidden;
}

.zodiac-item:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.zodiac-item.selected {
  border-color: var(--gold);
  background: #FFF8E7;
  transform: scale(1.05);
  box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
}

.zodiac-item.selected-female {
  border-color: var(--red);
  background: #FFF0E6;
}

.zodiac-item .check-icon {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--gold);
  display: none;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 12px;
}

.zodiac-item.selected .check-icon,
.zodiac-item.selected-female .check-icon {
  display: flex;
}

.zodiac-item.selected-female .check-icon {
  background: var(--red);
}

.zodiac-item img {
  width: 48px;
  height: 48px;
  max-width: 100%;
  object-fit: cover;
  border-radius: 8px;
  background: rgba(212, 175, 55, 0.1);
}

.zodiac-item span {
  display: block;
  margin-top: 4px;
  font-size: 14px;
  color: var(--text-dark);
}

@media (max-width: 480px) {
  .zodiac-section {
    padding: 8px;
    margin: 6px;
  }

  .zodiac-item {
    padding: 6px;
  }

  .zodiac-item img {
    width: 40px;
    height: 40px;
  }

  .zodiac-item span {
    font-size: 12px;
  }
}

/* Match Button */
.match-btn {
  width: calc(100% - 32px);
  margin: 16px;
  padding: 16px;
  font-size: 18px;
  font-weight: 600;
  color: var(--cream);
  background: linear-gradient(135deg, var(--red), #D97757);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s;
}

.match-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(200, 76, 49, 0.4);
}

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

.match-btn .spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-right: 8px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Error Message */
.error-msg {
  color: var(--red);
  text-align: center;
  padding: 8px;
  font-weight: 500;
}

/* Result Section */
.result-section {
  animation: fadeIn 0.5s ease;
}

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

/* Result Header */
.result-header {
  display: flex;
  border: 2px solid var(--gold);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 24px;
  background: var(--cream);
  box-shadow: var(--shadow);
}

.couple-display {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 24px;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.1), rgba(212, 175, 55, 0.05));
}

.person {
  text-align: center;
}

.zodiac-img {
  width: 64px;
  height: 64px;
  margin: 0 auto;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(212, 175, 55, 0.15);
}

.zodiac-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.person-name {
  margin-top: 8px;
  font-weight: 600;
  color: var(--brown);
}

.match-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.match-icon img {
  width: 40px;
  height: 40px;
}

.match-icon span {
  font-size: 12px;
  color: var(--text-light);
}

.score-display {
  width: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--red), #D97757);
  padding: 24px;
}

.score-number {
  font-size: 48px;
  font-weight: 700;
  color: white;
}

.score-unit {
  font-size: 18px;
  color: rgba(255, 255, 255, 0.9);
}

.score-tag {
  margin-top: 12px;
  padding: 6px 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  font-size: 14px;
}

@media (max-width: 768px) {
  .result-header {
    flex-direction: column;
  }
  
  .score-display {
    width: 100%;
  }
}

/* Comment Card */
.comment-card {
  background: var(--cream);
  border: 2px solid var(--gold);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}

.card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 18px;
  font-weight: 600;
  color: var(--brown);
}

.card-icon {
  font-size: 20px;
}

/* Score Cards */
.score-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

@media (max-width: 1024px) {
  .score-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .score-cards {
    grid-template-columns: 1fr;
  }
}

.score-card {
  background: var(--cream);
  border: 1px solid var(--gold);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--brown);
}

.card-score {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
}

.work-score { color: #C9A86C; }
.love-score { color: var(--red); }
.money-score { color: #6B8E23; }
.health-score { color: #5F9EA0; }

.card-desc {
  font-size: 12px;
  color: var(--text-dark);
  line-height: 1.5;
}

/* Enriched Section */
.enriched-section {
  margin-top: 24px;
}

.enriched-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px;
}

.star-icon {
  font-size: 24px;
}

.enriched-header h3 {
  font-size: 24px;
  color: var(--text-dark);
}

.ai-tag {
  padding: 4px 12px;
  border: 1px solid var(--gold);
  border-radius: 12px;
  font-size: 12px;
  color: var(--brown);
}

.enriched-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-top: 16px;
}

@media (max-width: 768px) {
  .enriched-grid {
    grid-template-columns: 1fr;
  }
}

.enriched-card {
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: all 0.3s;
}

.enriched-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.enriched-card.amber {
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
  border: 2px solid #fcd34d;
}

.enriched-card.rose {
  background: linear-gradient(135deg, #fff1f2, #ffe4e6);
  border: 2px solid #fda4af;
}

.enriched-card.purple {
  background: linear-gradient(135deg, #faf5ff, #f3e8ff);
  border: 2px solid #d8b4fe;
}

.enriched-card.indigo {
  background: linear-gradient(135deg, #eef2ff, #e0e7ff);
  border: 2px solid #a5b4fc;
}

.enriched-card.emerald {
  background: linear-gradient(135deg, #ecfdf5, #d1fae5);
  border: 2px solid #6ee7b7;
}

.enriched-card.sky {
  background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
  border: 2px solid #7dd3fc;
}

.enriched-card.orange {
  background: linear-gradient(135deg, #fff7ed, #ffedd5);
  border: 2px solid #fdba74;
}

.enriched-card.fuchsia {
  background: linear-gradient(135deg, #fdf4ff, #fae8ff);
  border: 2px solid #e879f9;
}

.enriched-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.enriched-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.enriched-card.amber .enriched-card-icon { background: #fde68a; }
.enriched-card.rose .enriched-card-icon { background: #fecdd3; }
.enriched-card.purple .enriched-card-icon { background: #e9d5ff; }
.enriched-card.indigo .enriched-card-icon { background: #c7d2fe; }
.enriched-card.emerald .enriched-card-icon { background: #a7f3d0; }
.enriched-card.sky .enriched-card-icon { background: #bae6fd; }
.enriched-card.orange .enriched-card-icon { background: #fed7aa; }
.enriched-card.fuchsia .enriched-card-icon { background: #f0abfc; }

.enriched-card-title {
  font-size: 18px;
  font-weight: 600;
}

.enriched-card.amber .enriched-card-title { color: #b45309; }
.enriched-card.rose .enriched-card-title { color: #be123c; }
.enriched-card.purple .enriched-card-title { color: #7e22ce; }
.enriched-card.indigo .enriched-card-title { color: #4338ca; }
.enriched-card.emerald .enriched-card-title { color: #047857; }
.enriched-card.sky .enriched-card-title { color: #0369a1; }
.enriched-card.orange .enriched-card-title { color: #c2410c; }
.enriched-card.fuchsia .enriched-card-title { color: #a21caf; }

.enriched-card-content {
  font-size: 14px;
  line-height: 1.8;
  color: var(--text-dark);
}

/* 子标题样式 - 加粗 */
.enriched-card-content .content-subtitle {
  font-size: 15px;
  font-weight: 600;
  color: var(--brown);
  margin-top: 16px;
  margin-bottom: 8px;
  padding-left: 12px;
  border-left: 3px solid var(--gold);
}

.enriched-card-content .content-subtitle:first-child {
  margin-top: 0;
}

/* 描述段落样式 */
.enriched-card-content .content-desc {
  margin: 0 0 12px 0;
  text-align: justify;
  line-height: 1.8;
}

.enriched-card-content .content-desc:last-child {
  margin-bottom: 0;
}

/* Notice */
.notice {
  text-align: center;
  color: var(--text-light);
  font-style: italic;
  font-size: 14px;
  margin-top: 16px;
}

/* Knowledge Section */
.knowledge-section {
  background: rgba(255, 254, 249, 0.95);
  padding: 35px 16px 48px 16px;
}

.knowledge-content {
  max-width: 1200px;
  margin: 0 auto;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 18px;
  color: var(--brown);
}

.section-header h2 {
  font-size: 28px;
}

.section-header .book-icon img {
  width: 36px;
  height: 36px;
  vertical-align: middle;
}

.book-icon {
  font-size: 28px;
}

.book-icon img {
  width: 28px;
  height: 28px;
  vertical-align: middle;
}

.section-desc {
  text-align: center;
  color: var(--text-dark);
  margin-top: 8px;
}

.zodiac-knowledge-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
  margin-top: 32px;
}

@media (max-width: 1024px) {
  .zodiac-knowledge-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 480px) {
  .zodiac-knowledge-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.knowledge-card {
  background: var(--cream);
  border: 2px solid var(--gold);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  transition: all 0.3s;
}

.knowledge-card:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow);
}

.knowledge-card .zodiac-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 8px;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(212, 175, 55, 0.1);
}

.knowledge-card .zodiac-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
}

.knowledge-card h3 {
  font-size: 18px;
  color: var(--brown);
  margin-bottom: 4px;
}

.knowledge-card .trait {
  font-size: 14px;
  color: var(--red);
  margin-bottom: 4px;
}

.knowledge-card .desc {
  font-size: 12px;
  color: var(--text-dark);
}

.culture-intro {
  margin-top: 32px;
  padding: 24px;
  background: #FFF8E7;
  border: 2px solid var(--gold);
  border-radius: 12px;
}

.culture-intro h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  color: var(--brown);
  margin-bottom: 12px;
}

.culture-intro p {
  font-size: 14px;
  line-height: 1.8;
  color: var(--text-dark);
  margin-bottom: 12px;
}

.culture-intro p:last-child {
  margin-bottom: 0;
}

/* Footer */
.footer {
  background: rgba(255, 254, 249, 0.95);
  border-top: 2px solid var(--gold);
  padding: 32px 16px;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
  margin-bottom: 24px;
}

@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

.footer-about h3,
.footer-tips h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  color: var(--brown);
  margin-bottom: 12px;
}

.footer-icon img {
  width: 20px;
  height: 20px;
  vertical-align: middle;
}

.footer-about p,
.footer-tips p {
  font-size: 14px;
  line-height: 1.8;
  color: var(--text-dark);
}

.footer-bottom {
  border-top: 1px solid #E8DCD0;
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-small {
  width: 32px;
  height: 32px;
}

.site-name {
  font-weight: 600;
  color: var(--brown);
}

.footer-logo small {
  display: block;
  font-size: 12px;
  color: var(--text-light);
}

.footer-copyright {
  text-align: right;
  font-size: 12px;
  color: var(--text-light);
}

@media (max-width: 768px) {
  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }
  
  .footer-copyright {
    text-align: center;
  }
}

/* 回到顶部按钮 */
.back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), #C9A86C);
  border: 2px solid rgba(255, 255, 255, 0.3);
  color: var(--cream);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(139, 69, 19, 0.3);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s, transform 0.2s;
  z-index: 999;
}

.back-to-top:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(139, 69, 19, 0.4);
}

.back-to-top.show {
  opacity: 1;
  visibility: visible;
}

.back-to-top svg {
  width: 24px;
  height: 24px;
}

@media (max-width: 768px) {
  .back-to-top {
    width: 44px;
    height: 44px;
    bottom: 20px;
    right: 20px;
  }

  .back-to-top svg {
    width: 20px;
    height: 20px;
  }
}


/* ============================================
   AI Chat Section - 定制问题解读
   ============================================ */

.ai-chat-section {
  background: var(--cream);
  border: 2px solid var(--gold);
  border-radius: 20px;
  overflow: hidden;
  margin-top: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.1), rgba(139, 69, 19, 0.05));
  border-bottom: 1px solid rgba(212, 175, 55, 0.3);
}

.chat-header-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--gold), #C5A028);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  flex-shrink: 0;
}

.chat-header-icon svg {
  width: 26px;
  height: 26px;
}

.chat-header-info {
  flex: 1;
}

.chat-header-info h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--brown);
  margin-bottom: 4px;
}

.chat-header-info p {
  font-size: 13px;
  color: var(--text-light);
}

.ai-badge {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 12px;
  letter-spacing: 0.5px;
}

.chat-container {
  height: 400px;
  display: flex;
  flex-direction: column;
  position: relative;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scroll-behavior: smooth;
}

.chat-messages::-webkit-scrollbar {
  width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
  background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: rgba(212, 175, 55, 0.3);
  border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
  background: rgba(212, 175, 55, 0.5);
}

/* Message Styles */
.message {
  display: flex;
  gap: 12px;
  max-width: 85%;
  animation: messageIn 0.3s ease-out;
}

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

.message.user-message {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.message.ai-message {
  align-self: flex-start;
}

.message-avatar {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ai-message .message-avatar {
  background: linear-gradient(135deg, var(--gold), #C5A028);
  color: white;
}

.user-message .message-avatar {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;
}

.message-avatar svg {
  width: 20px;
  height: 20px;
}

.message-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.message-text {
  padding: 14px 18px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.6;
  word-break: break-word;
}

.ai-message .message-text {
  background: #f7f7f5;
  color: var(--text-dark);
  border-bottom-left-radius: 6px;
}

/* Markdown 内容样式 */
.ai-message .message-text h1,
.ai-message .message-text h2,
.ai-message .message-text h3 {
  margin: 12px 0 8px 0;
  color: var(--brown);
  font-weight: 600;
}

.ai-message .message-text h1:first-child,
.ai-message .message-text h2:first-child,
.ai-message .message-text h3:first-child {
  margin-top: 0;
}

.ai-message .message-text h1 { font-size: 18px; }
.ai-message .message-text h2 { font-size: 16px; }
.ai-message .message-text h3 { font-size: 15px; }

.ai-message .message-text p {
  margin: 8px 0;
}

.ai-message .message-text p:first-child {
  margin-top: 0;
}

.ai-message .message-text p:last-child {
  margin-bottom: 0;
}

.ai-message .message-text ul,
.ai-message .message-text ol {
  margin: 8px 0;
  padding-left: 20px;
}

.ai-message .message-text li {
  margin: 4px 0;
}

.ai-message .message-text strong {
  font-weight: 600;
  color: var(--brown);
}

.ai-message .message-text em {
  font-style: italic;
  color: var(--text-light);
}

.ai-message .message-text code {
  background: rgba(212, 175, 55, 0.15);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 13px;
  color: #c7254e;
}

.ai-message .message-text pre {
  background: #2d2d2d;
  color: #f8f8f2;
  padding: 12px 16px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 10px 0;
}

.ai-message .message-text pre code {
  background: transparent;
  color: inherit;
  padding: 0;
}

.ai-message .message-text blockquote {
  border-left: 3px solid var(--gold);
  margin: 10px 0;
  padding-left: 12px;
  color: var(--text-light);
  font-style: italic;
}

.ai-message .message-text a {
  color: #6366f1;
  text-decoration: none;
}

.ai-message .message-text a:hover {
  text-decoration: underline;
}

.ai-message .message-text hr {
  border: none;
  border-top: 1px solid rgba(212, 175, 55, 0.3);
  margin: 12px 0;
}

.user-message .message-text {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;
  border-bottom-right-radius: 6px;
}

/* Typing indicator */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 14px 18px;
}

.typing-indicator span {
  width: 8px;
  height: 8px;
  background: var(--text-light);
  border-radius: 50%;
  animation: typing 1.4s infinite ease-in-out both;
}

.typing-indicator span:nth-child(1) {
  animation-delay: -0.32s;
}

.typing-indicator span:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes typing {
  0%, 80%, 100% {
    transform: scale(0.6);
    opacity: 0.4;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Quick Questions */
.quick-questions {
  padding: 16px 20px;
  background: rgba(212, 175, 55, 0.05);
  border-top: 1px solid rgba(212, 175, 55, 0.15);
}

.quick-questions-title {
  font-size: 12px;
  color: var(--text-light);
  margin-bottom: 10px;
}

.quick-questions-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quick-question-btn {
  background: white;
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 20px;
  padding: 8px 16px;
  font-size: 13px;
  color: var(--text-dark);
  cursor: pointer;
  transition: all 0.2s ease;
}

.quick-question-btn:hover {
  background: linear-gradient(135deg, var(--gold), #C5A028);
  color: white;
  border-color: transparent;
  transform: translateY(-1px);
}

.quick-question-btn:active {
  transform: translateY(0);
}

/* Chat Input Area */
.chat-input-area {
  padding: 16px 20px;
  background: white;
  border-top: 1px solid rgba(212, 175, 55, 0.2);
}

.chat-input-wrapper {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  background: #f7f7f5;
  border: 2px solid rgba(212, 175, 55, 0.2);
  border-radius: 24px;
  padding: 8px 8px 8px 20px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.chat-input-wrapper:focus-within {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15);
}

.chat-input-wrapper textarea {
  flex: 1;
  border: none;
  background: transparent;
  resize: none;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-dark);
  font-family: inherit;
  max-height: 120px;
  padding: 8px 0;
}

.chat-input-wrapper textarea:focus {
  outline: none;
}

.chat-input-wrapper textarea::placeholder {
  color: var(--text-light);
}

.send-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #d1d1d1, #b0b0b0);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.send-btn:not(:disabled) {
  background: linear-gradient(135deg, var(--gold), #C5A028);
}

.send-btn:not(:disabled):hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.4);
}

.send-btn:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.send-btn svg {
  width: 18px;
  height: 18px;
  margin-left: 2px;
}

.input-hint {
  font-size: 11px;
  color: var(--text-light);
  margin-top: 8px;
  text-align: right;
}

/* Loading state for message */
.message-text.streaming {
  position: relative;
}

.message-text.streaming::after {
  content: '▋';
  animation: blink 1s infinite;
  margin-left: 2px;
}

@keyframes blink {
  0%, 50% {
    opacity: 1;
  }
  51%, 100% {
    opacity: 0;
  }
}

/* Hide quick questions when chat has messages */
.chat-has-messages .quick-questions {
  display: none;
}

/* Responsive */
@media (max-width: 768px) {
  .ai-chat-section {
    border-radius: 16px;
  }
  
  .chat-header {
    padding: 16px;
  }
  
  .chat-header-icon {
    width: 40px;
    height: 40px;
  }
  
  .chat-header-info h3 {
    font-size: 16px;
  }
  
  .chat-container {
    height: 350px;
  }
  
  .chat-messages {
    padding: 16px;
  }
  
  .message {
    max-width: 90%;
  }
  
  .quick-question-btn {
    font-size: 12px;
    padding: 6px 12px;
  }
  
  .chat-input-area {
    padding: 12px 16px;
  }
  
  .input-hint {
    display: none;
  }
}

@media (max-width: 480px) {
  .ai-badge {
    display: none;
  }
  
  .chat-container {
    height: 300px;
  }
  
  .quick-questions-list {
    flex-direction: column;
  }
  
  .quick-question-btn {
    width: 100%;
    text-align: left;
  }
}
