/*
 * 桃方研官网样式 - 风格化升级版
 *
 * 设计概念："科技感的实验室 + 温暖的自然感"
 * 我们不是网红品牌，也不是传统保健品品牌。
 * 我们是一个"用互联网思维做营养的科研品牌，但又像朋友一样真实"。
 *
 * 更新内容：
 * 1. 配色升级 - 深苔绿 + 鼠尾草绿 + 暖米色
 * 2. 实验室网格背景
 * 3. 拍立得照片卡片效果
 * 4. 荧光笔标注效果
 * 5. 更有呼吸感的排版
 */

/* ==========================
   CSS变量 - 完整配色系统
   ========================== */

:root {
  /* 主色 - 深苔绿，高级、自然、专业 */
  --primary-color: #3A5F4D;
  --primary-light: #4A7C59;
  --primary-dark: #2D4A3D;

  /* 辅助色 - 鼠尾草绿，温暖、活力 */
  --accent-color: #A3B968;
  --accent-light: #BCCB8D;
  --accent-transparent: rgba(163, 185, 104, 0.3);

  /* 暖色背景 - 米色，温暖、干净 */
  --bg-white: #FFFFFF;
  --bg-warm: #FAF8F5;
  --bg-warm-dark: #F5F2EB;
  --bg-light: #F7F8F3;

  /* 中性色 - 柔和灰系列，不刺眼 */
  --text-primary: #2C2C2C;      /* 深灰，代替纯黑 */
  --text-secondary: #6B6B6B;   /* 中灰 */
  --text-light: #999999;       /* 浅灰 */
  --border-color: #E8E6DF;     /* 米灰色边框，比纯白更柔和 */

  /* 阴影 - 多层次、柔和阴影 */
  --shadow-sm: 0 2px 12px rgba(58, 95, 77, 0.06);
  --shadow-md: 0 4px 24px rgba(58, 95, 77, 0.08);
  --shadow-lg: 0 8px 40px rgba(58, 95, 77, 0.1);
  --shadow-hover: 0 12px 48px rgba(58, 95, 77, 0.12);
}

/* ==========================
   基础样式重置
   ========================== */

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  line-height: 1.8;
  color: var(--text-primary);
  background-color: var(--bg-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.01em; /* 微收字距，更精致 */
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
  transition: all 0.3s ease;
}

ul {
  list-style: none;
}

/* ==========================
   实验室网格背景
   像实验室笔记本的感觉，传递科研感
   ========================== */

.bg-grid {
  background-image:
    linear-gradient(rgba(58, 95, 77, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(58, 95, 77, 0.03) 1px, transparent 1px);
  background-size: 20px 20px;
}

/* 局部网格容器 */
.grid-background {
  position: relative;
}

.grid-background::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image:
    linear-gradient(rgba(58, 95, 77, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(58, 95, 77, 0.02) 1px, transparent 1px);
  background-size: 24px 24px;
  z-index: 0;
  pointer-events: none;
}

/* ==========================
   排版系统 - 更有呼吸感
   ========================== */

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.25;
  color: var(--text-primary);
  letter-spacing: -0.02em; /* 标题收紧字距，更精致 */
}

h1 {
  font-size: 3.5rem;
  font-weight: 700;
}

h2 {
  font-size: 2.25rem;
  font-weight: 700;
}

h3 {
  font-size: 1.25rem;
  font-weight: 600;
}

p {
  margin-bottom: 1.5rem;
  color: var(--text-secondary);
}

/* 重点标注 - 荧光笔效果 */
.highlight {
  background: linear-gradient(180deg, transparent 60%, var(--accent-transparent) 60%);
  padding: 0 4px;
  font-weight: 500;
}

/* 创始人签名效果 */
.signature {
  font-family: 'Caveat', cursive;
  font-size: 1.25rem;
  color: var(--primary-color);
  font-weight: 500;
}

/* 引用文本样式 */
.quote {
  font-style: italic;
  color: var(--text-secondary);
  padding-left: 1rem;
  border-left: 3px solid var(--accent-color);
  margin: 1.5rem 0;
}

/* ==========================
   通用容器
   ========================== */

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.container-narrow {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ==========================
   导航栏
   ========================== */

.navbar {
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  z-index: 1000;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 72px;
}

.nav-logo a {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
  letter-spacing: -0.02em;
}

.nav-menu {
  display: flex;
  gap: 2px;
}

.nav-link {
  padding: 8px 16px;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: 6px;
  transition: all 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--primary-color);
  background-color: var(--bg-light);
}

/* 下拉菜单 */
.dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 200px;
  background: white;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 8px 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.3s ease;
  border: 1px solid var(--border-color);
}

.dropdown:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-menu li a {
  display: block;
  padding: 10px 20px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  transition: all 0.15s ease;
}

.dropdown-menu li a:hover {
  background-color: var(--bg-light);
  color: var(--primary-color);
}

/* 移动端菜单按钮 */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
}

.hamburger span {
  width: 24px;
  height: 2px;
  background-color: var(--text-primary);
  transition: all 0.2s ease;
}

/* ==========================
   Hero 区域
   ========================== */

.hero {
  background: linear-gradient(180deg, var(--bg-light) 0%, var(--bg-warm) 100%);
  padding: 120px 0;
  position: relative;
  overflow: hidden;
}

.hero.grid-background::before {
  opacity: 0.5;
}

.hero-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 24px;
  text-align: center;
  position: relative;
  z-index: 1;
}

.hero-title {
  font-size: 3.75rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 24px;
  line-height: 1.1;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--text-secondary);
  margin-bottom: 48px;
  font-weight: 400;
}

.hero-tagline {
  font-size: 1rem;
  color: var(--text-light);
  margin-bottom: 16px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

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

.hero-signature {
  margin-top: 48px;
  text-align: right;
  opacity: 0.7;
}

/* ==========================
   按钮样式
   ========================== */

.btn {
  display: inline-block;
  padding: 16px 36px;
  font-size: 1rem;
  font-weight: 500;
  border-radius: 12px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  border: none;
  text-decoration: none;
}

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

.btn-primary:hover {
  background-color: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

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

.btn-secondary:hover {
  background-color: var(--primary-color);
  color: white;
  transform: translateY(-2px);
}

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

.btn-outline:hover {
  background-color: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
  transform: translateY(-2px);
}

/* ==========================
   通用区块
   ========================== */

.section {
  padding: 96px 0;
  position: relative;
}

.section-title {
  text-align: center;
  margin-bottom: 64px;
  color: var(--text-primary);
}

.section-subtitle {
  text-align: center;
  color: var(--text-secondary);
  margin-top: -48px;
  margin-bottom: 64px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* 暖色调背景区块 */
.section-bg {
  background-color: var(--bg-warm);
}

/* ==========================
   核心价值卡片 - 新设计
   ========================== */

.values-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.value-card {
  text-align: center;
  padding: 40px 28px;
  border-radius: 20px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  background: white;
  border: 1px solid var(--border-color);
  position: relative;
  overflow: hidden;
}

.value-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
  transform: scaleX(0);
  transition: transform 0.4s ease;
}

.value-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent-color);
}

.value-card:hover::before {
  transform: scaleX(1);
}

.value-icon {
  font-size: 2.5rem;
  margin-bottom: 16px;
}

.value-title {
  font-size: 1.125rem;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.value-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ==========================
   产品卡片 - 新设计
   ========================== */

.products-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.product-card {
  background: white;
  border-radius: 20px;
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: block;
  border: 1px solid var(--border-color);
  position: relative;
  overflow: hidden;
}

.product-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border: 2px solid var(--accent-color);
  border-radius: 20px;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

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

.product-card:hover::after {
  opacity: 1;
}

.product-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 20px;
  background-color: var(--bg-warm);
}

.product-image-placeholder {
  width: 100%;
  height: 200px;
  background: linear-gradient(135deg, var(--bg-light) 0%, var(--bg-warm-dark) 100%);
  border-radius: 12px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
}

.product-title {
  font-size: 1.1rem;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.product-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ==========================
   文章卡片 - 新设计
   ========================== */

.articles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.article-card {
  background: white;
  border-radius: 20px;
  padding: 32px 28px;
  box-shadow: var(--shadow-sm);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: block;
  border: 1px solid var(--border-color);
}

.article-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-8px);
  border-color: var(--accent-color);
}

.article-category {
  font-size: 0.75rem;
  color: var(--accent-color);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 16px;
}

.article-title {
  font-size: 1.125rem;
  margin-bottom: 12px;
  color: var(--text-primary);
  line-height: 1.4;
}

.article-excerpt {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ==========================
   拍立得照片卡片效果 - 活动页专用
   ========================== */

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  margin: 48px 0;
}

.polaroid-card {
  background: white;
  padding: 12px 12px 44px 12px; /* 底部留白多，像拍立得 */
  border-radius: 4px;
  box-shadow: var(--shadow-md);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  transform: rotate(-1deg); /* 每张照片略微不同的倾斜角度 */
  position: relative;
}

.polaroid-card:nth-child(2n) {
  transform: rotate(1deg);
}

.polaroid-card:nth-child(3n) {
  transform: rotate(-0.5deg);
}

.polaroid-card:nth-child(4n) {
  transform: rotate(0.8deg);
}

.polaroid-card:hover {
  transform: rotate(0deg) scale(1.02);
  box-shadow: var(--shadow-hover);
  z-index: 10;
}

.polaroid-image {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 2px;
  margin-bottom: 12px;
}

.polaroid-caption {
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.4;
  font-style: italic;
}

/* 大号照片横跨 */
.polaroid-card.large {
  grid-column: span 2;
}

.polaroid-card.large .polaroid-image {
  aspect-ratio: 2 / 1;
}

/* ==========================
   文章详情页
   ========================== */

.article-header {
  background: linear-gradient(180deg, var(--bg-light) 0%, var(--bg-warm) 100%);
  padding: 80px 0;
  text-align: center;
  position: relative;
}

.article-header h1 {
  color: var(--primary-color);
  margin-bottom: 16px;
}

.article-meta {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.article-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 64px 24px;
}

.article-content h2 {
  font-size: 1.75rem;
  margin-top: 3rem;
  margin-bottom: 1.5rem;
  color: var(--primary-color);
}

.article-content h3 {
  font-size: 1.25rem;
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.article-content p {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
}

.article-content ul,
.article-content ol {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
}

.article-content li {
  margin-bottom: 0.5rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

.article-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
}

.article-content th,
.article-content td {
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  text-align: left;
}

.article-content th {
  background-color: var(--bg-warm);
  font-weight: 600;
}

.article-content blockquote {
  border-left: 4px solid var(--accent-color);
  padding-left: 20px;
  margin: 2rem 0;
  font-style: italic;
  color: var(--text-secondary);
  background-color: var(--bg-warm);
  padding: 24px;
  border-radius: 0 12px 12px 0;
}

.article-content a {
  color: var(--primary-color);
  text-decoration: underline;
}

.article-content strong {
  font-weight: 600;
  color: var(--text-primary);
}

/* ==========================
   列表页样式
   ========================== */

.list-header {
  background: linear-gradient(180deg, var(--bg-light) 0%, var(--bg-warm) 100%);
  padding: 80px 0;
  text-align: center;
  position: relative;
}

.list-header h1 {
  color: var(--primary-color);
  margin-bottom: 16px;
}

.list-header p {
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
}

.list-content {
  padding: 64px 0;
}

/* 分类标签 */
.category-tabs {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 48px;
  flex-wrap: wrap;
}

.category-tab {
  padding: 8px 20px;
  border-radius: 20px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  background: white;
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all 0.2s ease;
}

.category-tab.active,
.category-tab:hover {
  background-color: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

/* ==========================
   页脚
   ========================== */

.footer {
  background-color: var(--text-primary);
  color: white;
  padding: 80px 0 40px;
}

.footer-content {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 48px;
}

.footer-brand h3 {
  color: white;
  font-size: 1.5rem;
  margin-bottom: 12px;
}

.footer-brand p {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.95rem;
}

.footer-links h4 {
  color: white;
  font-size: 1rem;
  margin-bottom: 20px;
}

.footer-links ul {
  list-style: none;
}

.footer-links li {
  margin-bottom: 12px;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: white;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 32px;
  text-align: center;
}

.footer-bottom p {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.85rem;
  margin-bottom: 8px;
}

/* 二维码区域 */
.qr-codes {
  display: flex;
  gap: 24px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.qr-item {
  text-align: center;
}

.qr-item img {
  width: 100px;
  height: 100px;
  background: white;
  border-radius: 8px;
  margin-bottom: 8px;
}

.qr-item p {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 0;
}

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

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

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

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

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

@media (max-width: 768px) {
  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.75rem;
  }

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

  .nav-menu {
    display: none;
  }

  .hamburger {
    display: flex;
  }

  .section {
    padding: 64px 0;
  }

  .values-grid {
    grid-template-columns: 1fr;
  }

  .products-grid {
    grid-template-columns: 1fr;
  }

  .articles-grid {
    grid-template-columns: 1fr;
  }

  .photo-grid {
    grid-template-columns: 1fr;
  }

  .polaroid-card.large {
    grid-column: span 1;
  }

  .footer-content {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .hero-buttons {
    flex-direction: column;
    align-items: center;
  }

  .hero-buttons .btn {
    width: 100%;
    max-width: 280px;
  }
}

/* 移动端菜单激活状态 */
@media (max-width: 768px) {
  .nav-menu.active {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    background: white;
    padding: 16px;
    box-shadow: var(--shadow-md);
  }

  .dropdown-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    padding-left: 16px;
    border: none;
  }
}
