/* 公共基础样式文件 - 所有页面共用 */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@300;400;500;600;700&display=swap');

/* 自定义CSS变量 */
:root {
  --primary-color: #8B4513;
  --secondary-color: #D2691E;
  --accent-color: #CD853F;
  --text-dark: #2D1810;
  --text-light: #6B4423;
  --bg-light: #FFF8DC;
  --border-color: #DEB887;
}

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

body {
  font-family: 'Noto Sans SC', sans-serif;
  line-height: 1.6;
  color: var(--text-dark);
  background-color: #ffffff;
}

/* 响应式图片 */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* 链接样式 */
a {
  text-decoration: none;
  color: inherit;
  transition: color 0.3s ease;
}

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

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

/* 导航栏样式 */
.navbar {
  background: linear-gradient(135deg, #8B4513 0%, #D2691E 100%);
  padding: 1rem 0;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
}

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

.logo a {
  color: white;
  font-size: 1.5rem;
  font-weight: 700;
  text-decoration: none;
  display: flex;
  align-items: center;
}

.logo img {
  height: 40px;
  width: auto;
  margin-right: 0.5rem;
}

.nav-menu {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 2rem;
}

.nav-link {
  color: white;
  text-decoration: none;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  transition: all 0.3s ease;
  position: relative;
}

.nav-link:hover {
  background: rgba(255,255,255,0.1);
  transform: translateY(-2px);
}

.nav-link.active {
  background: rgba(255,255,255,0.2);
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
}

/* 简化版导航栏（用于条款和隐私页面） */
.navbar.simple-nav .nav-menu {
  gap: 1.5rem;
}

.navbar.simple-nav .nav-link {
  font-size: 0.95rem;
}

/* 通用Hero区域样式 - 可被各页面继承 */
.hero-section {
  background: linear-gradient(rgba(139,69,19,0.8), rgba(210,105,30,0.8));
  padding: 4rem 0;
  text-align: center;
  color: white;
}

.hero-section h1 {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 1rem;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.hero-section p {
  font-size: 1.2rem;
  max-width: 600px;
  margin: 0 auto;
  opacity: 0.9;
}

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

.fade-in-up {
  animation: fadeInUp 1s ease-out;
}

/* 通用内容区域样式 */
.content-section {
  padding: 4rem 0;
}

.section-title {
  font-size: 2.5rem;
  font-weight: 600;
  text-align: center;
  margin-bottom: 3rem;
  color: var(--primary-color);
}

.main-content {
  min-height: calc(100vh - 200px);
  padding: 2rem 0;
}

/* Footer样式 */
.footer {
  background: var(--primary-color);
  color: white;
  padding: 3rem 0 1rem;
  margin-top: 4rem;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-section h4 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.footer-section p,
.footer-section a {
  color: rgba(255,255,255,0.8);
  line-height: 1.6;
}

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

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.2);
  padding-top: 1rem;
  text-align: center;
  color: rgba(255,255,255,0.7);
}

/* 懒加载图片样式 */
.lazy-image {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.lazy-image.loaded {
  opacity: 1;
}

.rotate-90 {
  transform: rotate(90deg);
}

/* 产品网格样式 */
.products-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  margin-top: 2rem;
}

.product-item {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  transition: all 0.3s ease;
  height: 100%;
}

.product-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.product-link {
  display: block;
  text-decoration: none;
  color: inherit;
  height: 100%;
}

.product-item img {
  width: 100%;
  height: 280px;
  object-fit: cover;
}

.product-content {
  padding: 1rem;
}

.product-content h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
  color: var(--primary-color);
}

.product-content p {
  color: var(--text-light);
  line-height: 1.4;
  font-size: 0.85rem;
}

/* 书籍网格样式 */
.books-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  margin-top: 2rem;
}

.book-item {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  transition: all 0.3s ease;
  height: 100%;
}

.book-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.book-link {
  display: block;
  text-decoration: none;
  color: inherit;
  height: 100%;
}

.book-item img {
  width: 100%;
  height: 250px;
  object-fit: cover;
}

.book-content {
  padding: 1.5rem;
}

.book-content h4 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--primary-color);
}

.book-content p {
  color: var(--text-light);
  line-height: 1.6;
  font-size: 0.9rem;
}

/* 公众号二维码样式 */
.qr-code {
  text-align: center;
  margin: 1rem 0;
}

.qr-code img {
  width: 120px;
  height: 120px;
  border-radius: 8px;
  margin: 0 auto;
  display: block;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .products-grid,
  .books-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
  
  .product-content,
  .book-content {
    padding: 1rem;
  }
  
  .product-item img,
  .book-item img {
    height: 150px;
  }
  
  .mobile-menu-btn {
    display: block;
  }
  
  .nav-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--primary-color);
    flex-direction: column;
    padding: 1rem 0;
    gap: 0;
    z-index: 1001;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  }
  
  .nav-menu.active {
    display: flex;
  }
  
  .nav-link {
    padding: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
  }
  
  .hero-content h1 {
    font-size: 2rem;
  }
  
  .hero-content p {
    font-size: 1rem;
  }
  
  .intro-content {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .section-title {
    font-size: 2rem;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 15px;
  }
  
  .hero-banner {
    min-height: 80vh;
    padding: 1rem;
    background-attachment: scroll;
    background-size: contain;
  }
  
  .hero-content {
    padding: 2rem 1rem;
  }
  
  .hero-content h1 {
    font-size: clamp(2rem, 8vw, 3.5rem);
    margin-bottom: 1.5rem;
    padding: 0.8rem 1.5rem;
    border: 2px solid #ffffff;
  }
  
  .hero-content p {
    font-size: clamp(1rem, 4vw, 1.3rem);
    margin-bottom: 1rem;
    padding: 0.4rem 0.8rem;
  }
  
  .content-section {
    padding: 2rem 0;
  }
  
  .products-grid,
  .books-grid {
    grid-template-columns: 1fr;
  }
}