/* 前端网站样式 */

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

body {
  font-family: 'Arial', sans-serif;
  background-color: #f8f9fa;
  color: #333;
  line-height: 1.6;
}

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

/* 头部样式 */
.main-header {
  background-color: #fff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
}

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

.logo a {
  font-size: 24px;
  font-weight: bold;
  color: #2c3e50;
  text-decoration: none;
}

.header-search {
  flex: 1;
  max-width: 500px;
  margin: 0 30px;
  position: relative;
}

.header-search input {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid #ddd;
  border-radius: 25px;
  font-size: 16px;
}

.header-search button {
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  background-color: #3498db;
  color: #fff;
  border: none;
  padding: 8px 15px;
  border-radius: 20px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.header-search button:hover {
  background-color: #2980b9;
}

.header-actions {
  display: flex;
  gap: 20px;
}

.action-link {
  color: #2c3e50;
  text-decoration: none;
  font-size: 16px;
  transition: color 0.3s;
}

.action-link:hover {
  color: #3498db;
}

/* 导航菜单 */
.main-nav {
  border-top: 1px solid #eee;
  border-bottom: 1px solid #eee;
}

.main-nav ul {
  display: flex;
  list-style: none;
  padding: 0;
  margin: 0;
}

.main-nav ul li {
  position: relative;
}

.main-nav ul li a {
  display: block;
  padding: 15px 20px;
  color: #2c3e50;
  text-decoration: none;
  font-weight: bold;
  transition: background-color 0.3s, color 0.3s;
}

.main-nav ul li a:hover {
  background-color: #f5f5f5;
  color: #3498db;
}

/* 主要内容区 */
.main-content {
  padding: 20px 0;
}

/* 轮播图 */
.slider {
  margin-bottom: 40px;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.slider-container {
  display: flex;
  transition: transform 0.5s ease;
}

.slide {
  min-width: 100%;
  position: relative;
}

.slide img {
  width: 100%;
  height: 500px;
  object-fit: cover;
}

.slide-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: #fff;
  background-color: rgba(0, 0, 0, 0.5);
  padding: 30px;
  border-radius: 8px;
}

.slide-content h2 {
  font-size: 36px;
  margin-bottom: 10px;
}

.slide-content p {
  font-size: 24px;
  margin-bottom: 20px;
}

/* 区块标题 */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.section-header h2 {
  color: #2c3e50;
  font-size: 28px;
}

.view-all {
  color: #3498db;
  text-decoration: none;
  font-weight: bold;
  transition: color 0.3s;
}

.view-all:hover {
  color: #2980b9;
}

/* 商品网格 */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 30px;
  margin-bottom: 40px;
}

.product-card {
  background-color: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s, box-shadow 0.3s;
}

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

.product-image {
  height: 250px;
  overflow: hidden;
}

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

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

.product-info {
  padding: 20px;
}

.product-name {
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 5px;
  color: #2c3e50;
}

.product-type {
  font-size: 14px;
  color: #777;
  margin-bottom: 10px;
}

.product-price {
  font-size: 24px;
  font-weight: bold;
  color: #e74c3c;
  margin-bottom: 15px;
}

.product-actions {
  display: flex;
  gap: 10px;
}

/* 按钮样式 */
.btn {
  padding: 12px 25px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  font-weight: bold;
  transition: background-color 0.3s;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

.btn-primary {
  background-color: #3498db;
  color: #fff;
}

.btn-primary:hover {
  background-color: #2980b9;
}

.btn-secondary {
  background-color: #95a5a6;
  color: #fff;
}

.btn-secondary:hover {
  background-color: #7f8c8d;
}

.btn-lg {
  padding: 15px 30px;
  font-size: 18px;
}

/* 页脚样式 */
.main-footer {
  background-color: #2c3e50;
  color: #fff;
  padding: 40px 0;
  margin-top: 40px;
}

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

.footer-section h4 {
  font-size: 18px;
  margin-bottom: 20px;
}

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

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

.footer-section ul li a {
  color: #bdc3c7;
  text-decoration: none;
  transition: color 0.3s;
}

.footer-section ul li a:hover {
  color: #3498db;
}

.footer-bottom {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid #34495e;
  color: #bdc3c7;
}

/* 错误页面 */
.error-page {
  text-align: center;
  padding: 50px 0;
}

.error-page h1 {
  font-size: 48px;
  margin-bottom: 20px;
  color: #e74c3c;
}

.error-page p {
  font-size: 18px;
  margin-bottom: 30px;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .header-top {
    flex-direction: column;
    gap: 15px;
  }
  
  .header-search {
    margin: 0;
    max-width: 100%;
  }
  
  .main-nav ul {
    flex-wrap: wrap;
  }
  
  .main-nav ul li a {
    padding: 10px 15px;
    font-size: 14px;
  }
  
  .slide img {
    height: 300px;
  }
  
  .slide-content h2 {
    font-size: 24px;
  }
  
  .slide-content p {
    font-size: 18px;
  }
  
  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
  }
}

@media (max-width: 480px) {
  .slide-content {
    padding: 20px;
  }
  
  .slide-content h2 {
    font-size: 20px;
  }
  
  .slide-content p {
    font-size: 16px;
  }
  
  .products-grid {
    grid-template-columns: 1fr;
  }
}