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

/* 字体导入 */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@300;400;500;700&family=Noto+Serif+SC:wght@400;500;600;700&display=swap');

/* 全局变量 */
:root {
  --primary-color: #2d6a4f;
  --accent-color: #ffd966;
  --background-color: #f5f7fa;
  --text-color: #2c3e4f;
  --card-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  --card-shadow-hover: 0 8px 25px rgba(45, 106, 79, 0.15);
  --transition: all 0.3s ease;
}

/* 基础样式 */
body {
  font-family: 'Noto Sans SC', sans-serif;
  background-color: var(--background-color);
  color: var(--text-color);
  line-height: 1.6;
}

/* 标题样式 */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Noto Serif SC', serif;
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: 1rem;
}

h1 {
  font-size: 2.5rem;
  line-height: 1.2;
}

h2 {
  font-size: 2rem;
  line-height: 1.3;
}

h3 {
  font-size: 1.5rem;
  line-height: 1.4;
}

/* 卡片样式 */
.card {
  background: white;
  border-radius: 16px;
  box-shadow: var(--card-shadow);
  padding: 24px;
  transition: var(--transition);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--card-shadow-hover);
}

/* 按钮样式 */
.btn {
  display: inline-block;
  padding: 12px 24px;
  border: none;
  border-radius: 30px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  text-align: center;
}

.btn-primary {
  background-color: var(--primary-color);
  color: white;
}

.btn-primary:hover {
  background-color: #1b5e3a;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(45, 106, 79, 0.3);
}

.btn-accent {
  background-color: var(--accent-color);
  color: var(--text-color);
}

.btn-accent:hover {
  background-color: #e6c358;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 217, 102, 0.3);
}

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

.btn-outline:hover {
  background-color: var(--primary-color);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(45, 106, 79, 0.3);
}

/* 输入框样式 */
.input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e0e0e0;
  border-radius: 30px;
  font-size: 14px;
  transition: var(--transition);
}

.input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(45, 106, 79, 0.1);
}

/* 容器样式 */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* 网格布局 */
.grid {
  display: grid;
  gap: 24px;
}

/* 响应式网格 */
@media (max-width: 768px) {
  .grid {
    grid-template-columns: 1fr;
  }
}

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

@media (min-width: 1025px) {
  .grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* 四列网格 */
.grid-4 {
  display: grid;
  gap: 24px;
}

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

@media (min-width: 769px) and (max-width: 1024px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

/* 两列网格 */
.grid-2 {
  display: grid;
  gap: 24px;
}

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

@media (min-width: 769px) {
  .grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* 文本样式 */
.text-center {
  text-align: center;
}

.text-primary {
  color: var(--primary-color);
}

.text-accent {
  color: var(--accent-color);
}

/* 间距类 */
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mt-5 { margin-top: 3rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mb-5 { margin-bottom: 3rem; }

/* 弹性布局 */
.flex {
  display: flex;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* 响应式调整 */
@media (max-width: 768px) {
  .container {
    padding: 0 16px;
  }
  
  h1 {
    font-size: 2rem;
  }
  
  h2 {
    font-size: 1.5rem;
  }
  
  h3 {
    font-size: 1.25rem;
  }
  
  .card {
    padding: 16px;
  }
}

/* 动画效果 */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.6s ease-out;
}

/* 自定义滚动条 */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #a1a1a1;
}

/* 禁用选择 */
.no-select {
  user-select: none;
}

/* 加载动画 */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(45, 106, 79, 0.3);
  border-radius: 50%;
  border-top-color: var(--primary-color);
  animation: spin 1s ease-in-out infinite;
}

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

/* 标签样式 */
.tag {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 500;
  margin-right: 8px;
  margin-bottom: 8px;
}

.tag-primary {
  background-color: rgba(45, 106, 79, 0.1);
  color: var(--primary-color);
}

.tag-accent {
  background-color: rgba(255, 217, 102, 0.1);
  color: var(--accent-color);
}

/* 分割线 */
.divider {
  height: 1px;
  background-color: rgba(45, 106, 79, 0.1);
  margin: 24px 0;
}

/* 页面容器 */
.page-container {
  min-height: 100vh;
  padding-top: 80px;
  padding-bottom: 60px;
}

/* 卡片组 */
.card-group {
  display: grid;
  gap: 24px;
}

/* 响应式卡片组 */
@media (max-width: 768px) {
  .card-group {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .card-group {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1025px) {
  .card-group {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* 精准调理模块样式 */
.therapy-module {
  background: white;
  border-radius: 20px;
  box-shadow: var(--card-shadow);
  padding: 24px;
  transition: var(--transition);
  text-align: center;
}

.therapy-module:hover {
  transform: translateY(-4px);
  box-shadow: var(--card-shadow-hover);
}

.therapy-module .module-icon {
  font-size: 48px;
  margin-bottom: 16px;
  color: var(--primary-color);
}

.therapy-module h3 {
  font-size: 1.25rem;
  margin-bottom: 12px;
}

.therapy-module p {
  font-size: 14px;
  color: #666;
  line-height: 1.5;
}

/* 体质辨识页面样式 */
.constitution-step {
  background: white;
  border-radius: 20px;
  box-shadow: var(--card-shadow);
  padding: 32px;
  margin-bottom: 24px;
  transition: var(--transition);
}

.constitution-step:hover {
  transform: translateY(-4px);
  box-shadow: var(--card-shadow-hover);
}

.constitution-step h3 {
  font-size: 1.5rem;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.constitution-step .step-number {
  background: var(--primary-color);
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

/* AI健康食养页面样式 */
.recipe-card {
  background: white;
  border-radius: 20px;
  box-shadow: var(--card-shadow);
  overflow: hidden;
  transition: var(--transition);
}

.recipe-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--card-shadow-hover);
}

.recipe-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.recipe-card .recipe-content {
  padding: 20px;
}

.recipe-card h3 {
  font-size: 1.25rem;
  margin-bottom: 12px;
}

.recipe-card .recipe-meta {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
  font-size: 14px;
  color: #666;
}

/* 中医药百科页面样式 */
.herb-card {
  background: white;
  border-radius: 20px;
  box-shadow: var(--card-shadow);
  padding: 24px;
  transition: var(--transition);
  text-align: center;
}

.herb-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--card-shadow-hover);
}

.herb-card .herb-image {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 16px;
}

.herb-card h3 {
  font-size: 1.25rem;
  margin-bottom: 12px;
}

.herb-card p {
  font-size: 14px;
  color: #666;
  line-height: 1.5;
}

/* 首页样式 */
.hero-section {
  background: linear-gradient(135deg, #1a4d2a, #2d6a4f);
  color: white;
  padding: 80px 0;
  border-radius: 0 0 32px 32px;
  margin-bottom: 48px;
}

.hero-content {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

.hero-content h1 {
  font-size: 3rem;
  margin-bottom: 16px;
  color: white;
}

.hero-content p {
  font-size: 1.25rem;
  margin-bottom: 32px;
  opacity: 0.9;
}

.hero-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* 功能模块 */
.feature-section {
  margin-bottom: 64px;
}

.feature-grid {
  display: grid;
  gap: 24px;
}

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

@media (min-width: 769px) and (max-width: 1024px) {
  .feature-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1025px) {
  .feature-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.feature-card {
  background: white;
  border-radius: 20px;
  box-shadow: var(--card-shadow);
  padding: 32px;
  text-align: center;
  transition: var(--transition);
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--card-shadow-hover);
}

.feature-card .feature-icon {
  font-size: 48px;
  margin-bottom: 16px;
  color: var(--primary-color);
}

.feature-card h3 {
  font-size: 1.25rem;
  margin-bottom: 12px;
}

.feature-card p {
  font-size: 14px;
  color: #666;
  margin-bottom: 24px;
}

.feature-link {
  display: inline-block;
  color: var(--primary-color);
  font-weight: 500;
  text-decoration: none;
  transition: var(--transition);
}

.feature-link:hover {
  color: #1b5e3a;
  transform: translateX(4px);
}

/* 页脚样式 */
.footer {
  background: var(--primary-color);
  color: white;
  padding: 48px 0;
  margin-top: 64px;
  border-radius: 32px 32px 0 0;
}

.footer-content {
  display: grid;
  gap: 48px;
}

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

@media (min-width: 769px) {
  .footer-content {
    grid-template-columns: repeat(4, 1fr);
  }
}

.footer-section h3 {
  font-size: 1.25rem;
  margin-bottom: 24px;
  color: white;
}

.footer-section p {
  font-size: 14px;
  margin-bottom: 16px;
  opacity: 0.8;
}

.footer-section a {
  color: white;
  text-decoration: none;
  font-size: 14px;
  display: block;
  margin-bottom: 12px;
  transition: var(--transition);
}

.footer-section a:hover {
  color: var(--accent-color);
  transform: translateX(4px);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  padding-top: 24px;
  text-align: center;
  font-size: 14px;
  opacity: 0.8;
}

.dark-mode .bg-white,
.dark-mode .card {
    background-color: #16213e !important;
}

.dark-mode .text-gray-600,
.dark-mode .text-gray-700 {
    color: #ccc !important;
}
