/* 沙漠穿越 - 产品目录风格样式 */

/* CSS 变量定义 */
:root {
  --accent-color: #ff9800;
  --primary-color: #d4a373;
  --secondary-color: #faedcd;
  --dark-color: #3d2b1f;
  --text-color: #333;
  --text-light: #666;
  --bg-color: #fefae0;
  --card-bg: #fff;
  --border-color: #e0e0e0;
  --shadow: 0 2px 8px rgba(0,0,0,0.1);
  --shadow-hover: 0 4px 16px rgba(0,0,0,0.15);
  --radius: 8px;
  --max-width: 1200px;
  --gap: 24px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--bg-color);
}

a {
  text-decoration: none;
  color: var(--text-color);
  transition: color 0.3s;
}

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

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

ul {
  list-style: none;
}

/* 容器 */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* 头部样式 */
.header {
  background: linear-gradient(135deg, var(--dark-color) 0%, #5c4033 100%);
  color: #fff;
  padding: 16px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}

.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.logo {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary-color);
}

.logo span {
  color: var(--accent-color);
}

.nav {
  display: flex;
  gap: 32px;
}

.nav a {
  color: #fff;
  font-size: 15px;
  font-weight: 500;
}

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

.search-box {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.15);
  border-radius: 24px;
  padding: 8px 16px;
  min-width: 240px;
}

.search-box input {
  background: transparent;
  border: none;
  color: #fff;
  outline: none;
  width: 100%;
  font-size: 14px;
}

.search-box input::placeholder {
  color: rgba(255,255,255,0.6);
}

.search-btn {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  font-size: 16px;
}

/* Hero 区域 */
.hero {
  background: linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.4)), url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 400"><rect fill="%23d4a373" width="1200" height="400"/><path fill="%23faedcd" d="M0 300 Q300 200 600 280 T1200 250 L1200 400 L0 400 Z"/></svg>');
  background-size: cover;
  background-position: center;
  padding: 80px 0;
  text-align: center;
  color: #fff;
}

.hero h1 {
  font-size: 42px;
  margin-bottom: 16px;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

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

/* 面包屑导航 */
.breadcrumb {
  padding: 16px 0;
  background: var(--secondary-color);
  border-bottom: 1px solid var(--border-color);
}

.breadcrumb .container {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-light);
}

.breadcrumb a {
  color: var(--text-light);
}

.breadcrumb a:hover {
  color: var(--accent-color);
}

.breadcrumb .current {
  color: var(--text-color);
}

/* 分类导航 */
.categories {
  padding: 40px 0;
}

.section-title {
  font-size: 24px;
  margin-bottom: 24px;
  color: var(--dark-color);
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-title::before {
  content: '';
  width: 4px;
  height: 24px;
  background: var(--accent-color);
  border-radius: 2px;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
}

.category-item {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 24px 16px;
  text-align: center;
  box-shadow: var(--shadow);
  transition: all 0.3s;
  border: 2px solid transparent;
}

.category-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: var(--accent-color);
}

.category-icon {
  font-size: 36px;
  margin-bottom: 12px;
}

.category-name {
  font-size: 15px;
  font-weight: 600;
}

.category-count {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 4px;
}

/* 产品卡片网格 */
.products {
  padding: 40px 0;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--gap);
}

.product-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: all 0.3s;
}

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

.product-image {
  position: relative;
  padding-top: 60%;
  background: var(--secondary-color);
  overflow: hidden;
}

.product-image img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--accent-color);
  color: #fff;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.product-info {
  padding: 16px;
}

.product-category {
  font-size: 12px;
  color: var(--accent-color);
  margin-bottom: 8px;
}

.product-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
}

.product-price {
  font-size: 18px;
  font-weight: 700;
  color: var(--accent-color);
}

.product-price .unit {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-light);
}

.product-rating {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--text-light);
}

.stars {
  color: #ffc107;
}

.product-btn {
  display: block;
  width: 100%;
  padding: 12px;
  background: var(--accent-color);
  color: #fff;
  border: none;
  border-radius: 0 0 var(--radius) var(--radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s;
}

.product-btn:hover {
  background: #e68900;
}

/* 筛选器 */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 20px;
  background: var(--card-bg);
  border-radius: var(--radius);
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-label {
  font-size: 13px;
  color: var(--text-light);
}

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

.filter-option {
  padding: 6px 14px;
  background: var(--secondary-color);
  border-radius: 16px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.3s;
}

.filter-option:hover,
.filter-option.active {
  background: var(--accent-color);
  color: #fff;
}

/* 分页 */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 40px 0;
}

.pagination a,
.pagination span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 12px;
  background: var(--card-bg);
  border-radius: var(--radius);
  font-size: 14px;
  box-shadow: var(--shadow);
  transition: all 0.3s;
}

.pagination a:hover,
.pagination .current {
  background: var(--accent-color);
  color: #fff;
}

/* 文章列表 */
.article-section {
  padding: 40px 0;
  background: var(--secondary-color);
}

.article-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
}

.article-list {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.article-list h3 {
  font-size: 16px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--accent-color);
  color: var(--dark-color);
}

.article-list ul {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.article-list li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.article-list li::before {
  content: '•';
  color: var(--accent-color);
  font-weight: bold;
}

.article-list a {
  font-size: 14px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 文章详情页 */
.article-detail {
  padding: 40px 0;
}

.article-header {
  max-width: 800px;
  margin: 0 auto 40px;
  text-align: center;
}

.article-header h1 {
  font-size: 32px;
  margin-bottom: 16px;
  color: var(--dark-color);
  line-height: 1.4;
}

.article-meta {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 24px;
  color: var(--text-light);
  font-size: 13px;
}

.article-meta span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.article-content {
  max-width: 800px;
  margin: 0 auto;
  background: var(--card-bg);
  padding: 40px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.article-content h2 {
  font-size: 24px;
  margin: 32px 0 16px;
  color: var(--dark-color);
}

.article-content h3 {
  font-size: 18px;
  margin: 24px 0 12px;
  color: var(--text-color);
}

.article-content p {
  margin-bottom: 16px;
  line-height: 1.8;
  color: var(--text-color);
}

.article-content ul,
.article-content ol {
  margin-bottom: 16px;
  padding-left: 24px;
}

.article-content li {
  margin-bottom: 8px;
  line-height: 1.6;
}

.article-content ul {
  list-style: disc;
}

.article-content img {
  border-radius: var(--radius);
  margin: 24px 0;
}

/* 规格信息表格 */
.spec-table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
}

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

.spec-table th {
  background: var(--secondary-color);
  font-weight: 600;
  width: 30%;
}

/* 相关产品/推荐 */
.related-section {
  padding: 40px 0;
  background: var(--secondary-color);
}

/* 404 页面 */
.error-page {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 20px;
}

.error-code {
  font-size: 120px;
  font-weight: 700;
  color: var(--accent-color);
  line-height: 1;
  margin-bottom: 16px;
}

.error-title {
  font-size: 28px;
  color: var(--dark-color);
  margin-bottom: 16px;
}

.error-desc {
  font-size: 16px;
  color: var(--text-light);
  margin-bottom: 32px;
  max-width: 400px;
}

.error-btn {
  display: inline-block;
  padding: 14px 32px;
  background: var(--accent-color);
  color: #fff;
  border-radius: 24px;
  font-size: 15px;
  font-weight: 600;
  transition: all 0.3s;
}

.error-btn:hover {
  background: #e68900;
  color: #fff;
  transform: translateY(-2px);
}

/* 页脚 */
.footer {
  background: var(--dark-color);
  color: #fff;
  padding: 48px 0 24px;
}

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

.footer-brand .logo {
  margin-bottom: 16px;
}

.footer-brand p {
  font-size: 14px;
  line-height: 1.8;
  opacity: 0.8;
}

.footer-column h4 {
  font-size: 15px;
  margin-bottom: 16px;
  color: var(--primary-color);
}

.footer-column ul {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-column a {
  color: rgba(255,255,255,0.7);
  font-size: 14px;
}

.footer-column a:hover {
  color: var(--accent-color);
}

.footer-bottom {
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.1);
  text-align: center;
  font-size: 13px;
  color: rgba(255,255,255,0.5);
}

/* 响应式设计 */
@media (max-width: 1024px) {
  .article-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

@media (max-width: 768px) {
  .header .container {
    flex-direction: column;
  }

  .nav {
    gap: 20px;
    overflow-x: auto;
    width: 100%;
    padding-bottom: 8px;
  }

  .search-box {
    width: 100%;
    min-width: auto;
  }

  .hero h1 {
    font-size: 28px;
  }

  .hero p {
    font-size: 15px;
  }

  .category-grid {
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 12px;
  }

  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
  }

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

  .article-content {
    padding: 24px;
  }

  .article-header h1 {
    font-size: 24px;
  }

  .filter-bar {
    flex-direction: column;
  }

  .filter-options {
    flex-wrap: wrap;
  }

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

  .error-code {
    font-size: 80px;
  }

  .error-title {
    font-size: 22px;
  }
}

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

  .section-title {
    font-size: 20px;
  }

  .pagination a,
  .pagination span {
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    font-size: 13px;
  }
}
