/* ---------------------------
   基础设置与排版 (Typography & Reset)
--------------------------- */
:root {
  --primary-color: #2A9D8F;      /* 柔和薄荷绿：健康与平静 */
  --secondary-color: #FF7F50;    /* 温暖珊瑚橙：活力与亲和 */
  --bg-color: #FDFBF7;           /* 暖米色背景：温润舒适 */
  --text-primary: #4A4A4A;       /* 深暖灰：柔和阅读体验 */
  --text-secondary: #7A7A7A;     /* 浅暖灰 */
  --border-color: #E8E0D5;       /* 暖色调分割线 */
  --card-bg: #FFFFFF;            /* 卡片背景 */
  --radius-lg: 24px;             /* 大圆角：亲和力 */
  --radius-md: 16px;             /* 中圆角 */
  --shadow-sm: 0 4px 16px rgba(42, 157, 143, 0.08);
  --shadow-hover: 0 12px 32px rgba(255, 127, 80, 0.15);
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-color);
  color: var(--text-primary);
  font-family: 'Nunito', 'Rounded Mplus 1c', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
}

/* ---------------------------
   布局容器 (Layout)
--------------------------- */
.container {
  max-width: 1080px; /* 略微加宽以容纳更丰富的内容 */
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------------------------
   导航栏 (Header)
--------------------------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 72px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  z-index: 1000;
  transition: all 0.3s ease;
}

.header-inner {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  font-size: 16px;
  font-weight: 600;
  color: var(--primary-color);
  letter-spacing: 0.5px;
}

.nav a {
  display: inline-block;
  margin-left: 32px;
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s ease;
}

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

/* ---------------------------
   通用区块 (Sections)
--------------------------- */
.section {
  padding: 120px 0;
  border-top: 1px solid var(--border-color);
}

.section:first-of-type {
  border-top: none;
}

section {
  scroll-margin-top: 80px;
}

h2 {
  font-size: 32px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 48px;
  position: relative;
}

h2::after {
  content: "";
  display: block;
  width: 40px;
  height: 4px;
  background: var(--primary-color);
  margin-top: 16px;
  border-radius: 2px;
}

/* ---------------------------
   Hero 区域 (Hero)
--------------------------- */
.hero {
  padding-top: 220px;
  padding-bottom: 160px;
  background: linear-gradient(135deg, #F5F7FA 0%, #E6F0F7 100%);
}

.hero-name {
  font-size: 56px;
  letter-spacing: -1px;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.hero-subtitle {
  font-size: 20px;
  color: var(--primary-color);
  font-weight: 500;
  margin-bottom: 12px;
}

.hero-value {
  font-size: 18px;
  color: var(--text-secondary);
  margin-bottom: 40px;
  max-width: 600px;
}

.button {
  display: inline-block;
  padding: 14px 28px;
  background: var(--primary-color);
  color: #FFFFFF;
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  border-radius: 4px;
  transition: background 0.3s ease, transform 0.2s ease;
}

.button:hover {
  background: #005A9C;
  transform: translateY(-2px);
}

/* ---------------------------
   关于我 (About)
--------------------------- */
.text-block p {
  font-size: 18px;
  line-height: 1.8;
  color: var(--text-primary);
  max-width: 800px;
  margin-bottom: 24px;
}

.capabilities {
  margin-top: 48px;
}

.cap-list-title {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.cap-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.cap-list li {
  padding: 12px 16px;
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 14px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
}

.cap-list li::before {
  content: "\f058"; /* Font Awesome check-circle */
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  color: var(--secondary-color);
  margin-right: 10px;
}

/* ---------------------------
   项目卡片 (Projects) - 核心交互重构
--------------------------- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 32px;
  padding: 16px 0;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 32px;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  will-change: transform, box-shadow; /* 优化动画性能 */
  transform: translateZ(0); /* 开启硬件加速 */
}

.card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: var(--shadow-hover);
  border-color: var(--secondary-color);
}

/* 卡片头部：图标与标题 */
.card-header {
  display: flex;
  align-items: flex-start;
  margin-bottom: 16px;
}

.card-icon {
  width: 56px;
  height: 56px;
  background: rgba(42, 157, 143, 0.1);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 20px;
  color: var(--primary-color);
  font-size: 24px;
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.card:hover .card-icon {
  background: var(--primary-color);
  color: #fff;
  transform: rotate(15deg);
}

.card-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.4;
}

/* 卡片摘要（默认显示） */
.card-summary {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 24px;
}

/* 卡片详细内容（默认隐藏） */
.card-details {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.5s ease-out, opacity 0.4s ease;
  will-change: max-height, opacity; /* 优化动画性能 */
  transform: translateZ(0); /* 开启硬件加速 */
}

.card.expanded .card-details {
  max-height: 10000px; /* 大幅增加高度限制，防止内容截断 */
  opacity: 1;
  margin-top: 16px;
  padding-top: 24px;
  border-top: 1px solid var(--border-color);
  transition: max-height 0.8s ease-in, opacity 0.4s ease 0.2s;
}

/* 详情内的排版 */
.card-details h3, .card-details h4 {
  font-size: 16px;
  font-weight: 600;
  margin: 24px 0 12px 0;
  color: var(--text-primary);
}

.card-details p {
  font-size: 14px;
  color: #444;
  line-height: 1.8;
  margin-bottom: 16px;
}

.card-details ul {
  padding-left: 20px;
  margin-bottom: 16px;
}

.card-details li {
  font-size: 14px;
  color: #555;
  margin-bottom: 8px;
}

/* ---------------------------
   Markdown 内容排版优化 (MyFit Style)
--------------------------- */
.card-details {
  font-size: 16px;
  line-height: 1.8;
  color: var(--text-primary);
}

.card-details h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary-color);
  margin-top: 40px;
  margin-bottom: 24px;
  padding-left: 16px;
  border-left: 6px solid var(--secondary-color); /* 珊瑚橙色块点缀 */
  border-bottom: none;
  background: linear-gradient(to right, rgba(255, 127, 80, 0.05), transparent);
  padding-top: 8px;
  padding-bottom: 8px;
  border-radius: 0 8px 8px 0;
}

.card-details h2::after {
  display: none;
}

.card-details h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 32px;
  margin-bottom: 16px;
  padding-left: 8px;
  border-left: 4px solid var(--primary-color);
}

.card-details ul, .card-details ol {
  padding: 24px 24px 24px 40px;
  margin-bottom: 24px;
  background: #FAFAFA;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.card-details li {
  margin-bottom: 12px;
  color: var(--text-secondary);
  position: relative;
}

.card-details p {
  margin-bottom: 20px;
  color: var(--text-secondary);
}

.card-details strong {
  color: var(--secondary-color); /* 强调色使用珊瑚橙 */
  font-weight: 600;
}

/* 引用块样式 (Blockquote) */
.card-details blockquote {
  margin: 24px 0;
  padding: 20px 32px;
  background-color: rgba(42, 157, 143, 0.05); /* 薄荷绿背景 */
  border-left: 4px solid var(--primary-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-style: italic;
  box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}

.card-details blockquote p {
  margin: 0;
  font-size: 15px;
  color: var(--text-primary);
}

/* 展开/收起按钮 */
.card-toggle {
  margin-top: auto;
  align-self: flex-start;
  background: rgba(42, 157, 143, 0.1);
  border: none;
  color: var(--primary-color);
  padding: 10px 24px;
  border-radius: 24px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
}

.card-toggle:hover {
  background: var(--primary-color);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(42, 157, 143, 0.2);
}

.card-toggle i {
  margin-left: 8px;
  transition: transform 0.3s ease;
}

.card.expanded .card-toggle i {
  transform: rotate(180deg);
}

/* ---------------------------
   方法论 (Methodology)
--------------------------- */
.method-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.method-list li {
  padding: 24px 0;
  border-top: 1px solid var(--border-color);
  font-size: 16px;
  line-height: 1.8;
  display: flex;
  align-items: flex-start;
}

.method-list li span {
  font-weight: 600;
  color: var(--primary-color);
  min-width: 140px;
  display: block;
}

/* ---------------------------
   产品展示区域 (Project Gallery)
--------------------------- */
.project-gallery {
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* 桌面端默认4列 */
  gap: 20px;
  margin: 32px 0;
  width: 100%;
}

.gallery-item {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
}

.gallery-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.gallery-item img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  border-bottom: 1px solid var(--border-color);
}

/* TCM项目画廊专用样式 */
.tcm-gallery .gallery-item img {
  height: 220px; /* 固定高度确保整齐 */
}

.gallery-item.contain-image img {
  object-fit: contain; /* 证书等需要完整显示的图片 */
  background-color: #fafafa; /* 填充背景色 */
}

.gallery-caption {
  padding: 12px;
  text-align: center;
  font-size: 14px;
  color: var(--text-secondary);
  background: #fafafa;
  font-weight: 500;
}

/* 响应式调整 */
@media (max-width: 1024px) {
  .project-gallery {
    grid-template-columns: repeat(3, 1fr); /* 平板/小屏桌面 3列 */
  }
}

@media (max-width: 768px) {
  .project-gallery {
    grid-template-columns: repeat(2, 1fr); /* 平板竖屏 2列 */
  }
}

@media (max-width: 480px) {
  .project-gallery {
    grid-template-columns: 1fr; /* 手机端单列 */
  }

  /* 手机端取消 TCM 画廊的固定高度，让图片自然展示，避免被压缩太小或裁剪 */
  .tcm-gallery .gallery-item img {
    height: auto;
    max-height: 400px; /* 限制最大高度，防止竖图过长 */
    object-fit: contain; /* 手机端尽量完整显示内容 */
    background-color: #fafafa;
  }
}

/* ---------------------------
   中医自发热护理产品展示 (TCM Heat Care Style)
   "学术深度、人文温度、中医智慧与现代简洁"
--------------------------- */
.tcm-content {
  --tcm-bg: #FCF8F0;          /* 米白背景 */
  --tcm-primary: #C97C5D;     /* 陶土橙：主色 */
  --tcm-secondary: #8B5A2B;   /* 当归棕：辅色 */
  --tcm-accent: #9CAF88;      /* 草药绿：点缀 */
  --tcm-text: #4A4A4A;        /* 深灰文本 */
  --tcm-border: #F0EAE1;      /* 浅木色边框 */
  
  font-family: 'Inter', 'Noto Sans SC', sans-serif;
  color: var(--tcm-text);
  padding: 16px;
  background-color: rgba(252, 248, 240, 0.3); /* 极淡的米色背景 */
  border-radius: 16px;
}

/* 标题样式 */
.tcm-content h2 {
  font-family: 'Noto Serif SC', 'Songti SC', serif;
  font-size: 22px; /* 调整为与 MyFit 一致 */
  font-weight: 700;
  color: var(--tcm-primary);
  margin-top: 48px;
  margin-bottom: 32px;
  padding-left: 0;
  border-left: none;
  border-bottom: 2px solid var(--tcm-primary);
  background: none;
  padding-bottom: 12px;
  letter-spacing: 1px;
}

.tcm-content h3 {
  font-family: 'Noto Serif SC', 'Songti SC', serif;
  font-size: 18px; /* 调整为与 MyFit 一致 */
  font-weight: 600;
  color: var(--tcm-secondary);
  margin-top: 32px;
  margin-bottom: 20px;
  padding-left: 12px;
  border-left: 4px solid var(--tcm-accent);
}

/* 列表样式 */
.tcm-content ul {
  list-style: none;
  padding: 0;
  background: transparent;
  border: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}

.tcm-content li {
  background: #FFFFFF;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.03);
  border: 1px solid var(--tcm-border);
  display: flex;
  align-items: flex-start;
  font-size: 15px;
  line-height: 1.6;
  margin-bottom: 0;
  will-change: transform;
}

.tcm-content li strong {
  color: var(--tcm-primary);
  margin-right: 8px;
  font-weight: 600;
  min-width: 80px;
}

/* 引用块样式 */
.tcm-content blockquote {
  font-family: 'Noto Serif SC', serif;
  font-size: 1.2rem;
  line-height: 1.8;
  color: var(--tcm-secondary);
  background-color: #FDFBF7;
  border-left: 4px solid var(--tcm-primary);
  border-radius: 8px;
  padding: 32px;
  margin: 40px 0;
  box-shadow: 0 8px 24px rgba(201, 124, 93, 0.08);
  font-style: italic;
}

.tcm-content blockquote p {
  color: var(--tcm-secondary);
  font-size: 1.2rem;
}

/* 图片展示区域 */
.tcm-content .project-gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr); /* 桌面端 2列 */
  gap: 24px;
  margin: 40px 0;
}

.tcm-content .gallery-item {
  background: #FCF8F0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(0,0,0,0.05);
  transition: all 0.4s ease;
  border: none;
  will-change: transform;
}

.tcm-content .gallery-item:hover {
  transform: scale(1.02);
  box-shadow: 0 16px 32px rgba(0,0,0,0.1);
}

.tcm-content .gallery-item img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-bottom: none;
}

.tcm-content .gallery-caption {
  background: transparent;
  color: var(--tcm-primary);
  font-family: 'Noto Serif SC', serif;
  font-size: 14px;
  font-weight: 500;
  padding: 16px;
  letter-spacing: 1px;
}

/* 正文段落 */
.tcm-content p {
  font-size: 16px;
  line-height: 1.8;
  color: var(--tcm-text);
  margin-bottom: 24px;
}

/* 响应式 */
@media (max-width: 600px) {
  .tcm-content .project-gallery {
    grid-template-columns: 1fr;
  }
  
  .tcm-content ul {
    grid-template-columns: 1fr;
  }
}