/* 全局样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
  background-color: #f8f9fa;
  color: #333;
  line-height: 1.6;
}

.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
}

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
}

.btn {
  display: inline-block;
  background: #4a6fa5;
  color: white;
  padding: 10px 20px;
  border-radius: 4px;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  font-size: 14px;
}

.btn:hover {
  background: #385d8a;
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  border: 1px solid #4a6fa5;
  color: #4a6fa5;
}

.btn-outline:hover {
  background: #4a6fa5;
  color: white;
}

/* 导航栏样式 */
header {
  background: white;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 0;
}

.logo {
  font-size: 24px;
  font-weight: bold;
  color: #4a6fa5;
}

nav ul {
  display: flex;
}

nav ul li {
  margin-left: 25px;
}

nav ul li a {
  font-weight: 500;
  transition: color 0.3s;
  padding: 5px 0;
  position: relative;
}

nav ul li a:after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: 0;
  left: 0;
  background-color: #4a6fa5;
  transition: width 0.3s;
}

nav ul li a:hover:after, nav ul li a.active:after {
  width: 100%;
}

nav ul li a:hover, nav ul li a.active {
  color: #4a6fa5;
}

.header-actions {
  display: flex;
  align-items: center;
}

.search-box {
  display: flex;
  margin-right: 15px;
}

.search-box input {
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px 0 0 4px;
  width: 200px;
}

.search-box button {
  background: #4a6fa5;
  color: white;
  border: none;
  padding: 0 15px;
  border-radius: 0 4px 4px 0;
  cursor: pointer;
}

.cart-icon {
  position: relative;
  font-size: 20px;
  cursor: pointer;
}

.cart-count {
  position: absolute;
  top: -8px;
  right: -8px;
  background: #e74c3c;
  color: white;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 主要内容区域 */
main {
  padding: 40px 0;
  min-height: calc(100vh - 160px);
}

/* 页面切换 */
.page-content {
  display: block;
}

.page-content.active {
  display: block;
}

/* 首页样式 */
.hero {
  background: linear-gradient(135deg, #4a6fa5 0%, #6e9fdb 100%);
  color: white;
  padding: 80px 0;
  text-align: center;
  border-radius: 8px;
  margin-bottom: 40px;
}

.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 20px;
}

.hero p {
  font-size: 1.2rem;
  max-width: 700px;
  margin: 0 auto 30px;
}

.featured-products {
  margin: 60px 0;
}

.section-title {
  text-align: center;
  margin-bottom: 40px;
  font-size: 1.8rem;
  color: #333;
}

/* 商品卡片样式调整 */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
}

.product-card {
  background: white;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 3px 10px rgba(0,0,0,0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}

.product-image {
  height: 160px;
  background-color: #f5f5f5;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: pointer;
}

.product-image img {
  max-width: 100%;
  max-height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.product-image:hover img {
  transform: scale(1.05);
}

.product-info {
  padding: 15px;
}

.product-title {
  font-weight: 600;
  margin-bottom: 8px;
  font-size: 14px;
  line-height: 1.3;
}

.product-price {
  color: #4a6fa5;
  font-weight: bold;
  font-size: 1rem;
  margin-bottom: 12px;
}

.product-actions {
  display: flex;
  justify-content: space-between;
}

.product-actions .btn {
  padding: 6px 12px;
  font-size: 12px;
}

.promo-banner {
  background: #f8f9fa;
  padding: 40px;
  border-radius: 8px;
  text-align: center;
  margin: 40px 0;
}

/* 商品页样式 */
.products-page {
  display: flex;
  gap: 30px;
}

.sidebar {
  flex: 0 0 250px;
  background: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.sidebar h3 {
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eee;
  color: #4a6fa5;
}

.categories-list {
  margin-bottom: 30px;
}

.category-item {
  margin-bottom: 10px;
}

.category-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  cursor: pointer;
  font-weight: 500;
  transition: color 0.3s;
}

.category-title:hover {
  color: #4a6fa5;
}

.subcategories {
  padding-left: 15px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.subcategories.active {
  max-height: 300px;
}

.subcategory-item {
  padding: 8px 0;
  cursor: pointer;
  transition: color 0.3s;
  font-size: 14px;
}

.subcategory-item:hover, .subcategory-item.active {
  color: #4a6fa5;
}

.price-filter {
  margin-bottom: 20px;
}

.price-range {
  width: 100%;
  margin: 10px 0;
}

.price-values {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: #666;
}

.products-container {
  flex: 1;
}

.filter-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  background: white;
  padding: 15px 20px;
  border-radius: 8px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.filter-options {
  display: flex;
  gap: 15px;
}

.sort-options select {
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
}

.view-options {
  display: flex;
  gap: 10px;
}

.view-options button {
  background: none;
  border: 1px solid #ddd;
  padding: 5px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s;
}

.view-options button.active {
  background: #4a6fa5;
  color: white;
  border-color: #4a6fa5;
}

/* 分页样式优化 */
.pagination {
  display: flex;
  justify-content: center;
  margin-top: 40px;
  list-style: none;
  flex-wrap: wrap;
  gap: 5px;
}

.pagination li {
  margin: 0;
}

.pagination a, .pagination span {
  display: inline-block;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  transition: all 0.3s;
  color: #333;
  text-decoration: none;
  min-width: 40px;
  text-align: center;
}

.pagination li.active span, .pagination a:hover {
  background: #4a6fa5;
  color: white;
  border-color: #4a6fa5;
}

/* 关于我们页样式 */
.about-hero {
  background: linear-gradient(135deg, #6e9fdb 0%, #4a6fa5 100%);
  color: white;
  padding: 60px 0;
  text-align: center;
  border-radius: 8px;
  margin-bottom: 40px;
}

.about-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.about-text h2 {
  margin-bottom: 20px;
  color: #4a6fa5;
}

.about-image {
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 10px 25px rgba(0,0,0,0.1);
  height: 300px;
}

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

.values-section {
  margin: 60px 0;
}

.values-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 30px;
}

.value-card {
  text-align: center;
  background: white;
  padding: 30px 20px;
  border-radius: 8px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.value-icon {
  font-size: 40px;
  margin-bottom: 15px;
  color: #4a6fa5;
}

.team-section {
  margin: 60px 0;
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 30px;
}

.team-member {
  text-align: center;
  background: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.member-photo {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  margin: 0 auto 15px;
  background-color: #f5f5f5;
  overflow: hidden;
}

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

/* 图片放大模态框 */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.8);
  animation: fadeIn 0.3s;
}

.modal-content {
  margin: auto;
  display: block;
  max-width: 90%;
  max-height: 90%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 8px;
  box-shadow: 0 0 20px rgba(0,0,0,0.5);
}

.close {
  position: absolute;
  top: 20px;
  right: 30px;
  color: white;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.3s;
}

.close:hover {
  color: #4a6fa5;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* 页脚样式 */
footer {
  background: #2c3e50;
  color: white;
  padding: 50px 0 20px;
}

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

.footer-column h3 {
  margin-bottom: 20px;
  font-size: 1.2rem;
}

.footer-column ul li {
  margin-bottom: 10px;
}

.footer-column ul li a:hover {
  color: #6e9fdb;
}

.social-links {
  display: flex;
  gap: 15px;
  margin-top: 15px;
}

.social-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: rgba(255,255,255,0.1);
  border-radius: 50%;
  transition: background 0.3s;
}

.social-links a:hover {
  background: #4a6fa5;
}

.copyright {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.1);
  font-size: 0.9rem;
  color: rgba(255,255,255,0.7);
}

/* 移动端响应式设计 */
@media (max-width: 768px) {
  .header-container {
    flex-direction: column;
    padding: 15px 0;
  }

  nav ul {
    margin: 15px 0;
  }

  .header-actions {
    width: 100%;
    justify-content: center;
  }

  .search-box input {
    width: 150px;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .products-page {
    flex-direction: column;
  }

  .sidebar {
    flex: none;
  }

  .about-content {
    grid-template-columns: 1fr;
  }

  .filter-bar {
    flex-direction: column;
    gap: 15px;
    align-items: flex-start;
  }

  /* 商品卡片移动端优化 */
  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
  }

  .product-image {
    height: 120px;
  }

  .product-info {
    padding: 10px;
  }

  .product-title {
    font-size: 13px;
  }

  .product-price {
    font-size: 0.9rem;
    margin-bottom: 8px;
  }

  .product-actions {
    flex-direction: column;
    gap: 5px;
  }

  .product-actions .btn {
    padding: 5px 8px;
    font-size: 11px;
    text-align: center;
  }

  .pagination {
    gap: 3px;
  }

  .pagination a, .pagination span {
    padding: 6px 8px;
    font-size: 14px;
    min-width: 36px;
  }
}

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

  .product-image {
    height: 100px;
  }

  .product-info {
    padding: 8px;
  }

  .product-title {
    font-size: 12px;
  }

  .product-price {
    font-size: 0.85rem;
  }

  .pagination {
    gap: 2px;
  }

  .pagination a, .pagination span {
    padding: 5px 6px;
    font-size: 13px;
    min-width: 32px;
  }

  /* 可选：隐藏中间页码，只显示首尾和前后箭头 */
  .pagination li:nth-child(n+4):nth-child(-n+5) {
    display: none;
  }
}

/* Tinymce 内容区域样式保护 */
.tinymce-content {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
  line-height: 1.6 !important;
}

.tinymce-content * {
  box-sizing: border-box !important;
  font-family: inherit !important;
  line-height: inherit !important;
}

.tinymce-content h1,
.tinymce-content h2,
.tinymce-content h3,
.tinymce-content h4,
.tinymce-content h5,
.tinymce-content h6 {
  margin: 1em 0 0.5em 0 !important;
  font-weight: bold !important;
  color: #4a6fa5 !important;
}

.tinymce-content h1 { font-size: 2rem !important; }
.tinymce-content h2 { font-size: 1.8rem !important; }
.tinymce-content h3 { font-size: 1.6rem !important; }
.tinymce-content h4 { font-size: 1.4rem !important; }
.tinymce-content h5 { font-size: 1.2rem !important; }
.tinymce-content h6 { font-size: 1.1rem !important; }

.tinymce-content p {
  margin: 0 0 1em 0 !important;
}

.tinymce-content ul,
.tinymce-content ol {
  margin: 0 0 1em 1em !important;
  padding-left: 2em !important;
}

.tinymce-content li {
  margin-bottom: 0.5em !important;
  list-style: inherit !important;
}

.tinymce-content ul li {
  list-style-type: disc !important;
}

.tinymce-content ol li {
  list-style-type: decimal !important;
}

.tinymce-content a {
  color: #4a6fa5 !important;
  text-decoration: underline !important;
}

.tinymce-content a:hover {
  color: #385d8a !important;
}

.tinymce-content blockquote {
  border-left: 4px solid #4a6fa5 !important;
  margin: 1em 0 !important;
  padding-left: 1em !important;
  font-style: italic !important;
  color: #666 !important;
}

.tinymce-content table {
  width: 100% !important;
  border-collapse: collapse !important;
  margin: 1em 0 !important;
}

.tinymce-content th,
.tinymce-content td {
  border: 1px solid #ddd !important;
  padding: 8px 12px !important;
  text-align: left !important;
}

.tinymce-content th {
  background-color: #f8f9fa !important;
  font-weight: bold !important;
}

.tinymce-content img {
  max-width: 100% !important;
  height: auto !important;
  margin: 0.5em 0 !important;
}

.tinymce-content .align-left {
  float: left !important;
  margin-right: 1em !important;
}

.tinymce-content .align-right {
  float: right !important;
  margin-left: 1em !important;
}

.tinymce-content .align-center {
  display: block !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

.social-links {
  position: relative;
}

.social-links a.wechat-hover {
  position: relative;
}

.wechat-qr {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: white;
  padding: 10px;
  border-radius: 8px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 10;
  /*width: 120px;*/
  text-align: center;
  margin-bottom: 10px;
}

.wechat-qr img {
  width: 200px;
  height: 200px;
  display: block;
  margin: 0 auto 5px;
}

.wechat-qr p {
  font-size: 12px;
  color: #666;
  margin: 0;
}

.social-links a.wechat-hover:hover .wechat-qr {
  opacity: 1;
  visibility: visible;
}