/* ==================== 基础变量 ==================== */
:root {
  --accent-color: #ff9800;
  --primary-color: #2c3e50;
  --secondary-color: #34495e;
  --text-color: #333;
  --text-light: #666;
  --text-muted: #999;
  --bg-color: #fff;
  --bg-light: #f8f9fa;
  --bg-gray: #f0f2f5;
  --border-color: #e0e0e0;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-hover: 0 4px 16px rgba(0,0,0,0.12);
  --radius: 8px;
  --radius-sm: 4px;
  --max-width: 1200px;
  --header-height: 70px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-color);
  background: var(--bg-color);
}

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

ul, ol {
  list-style: none;
}

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

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

/* ==================== 头部 ==================== */
.header {
  background: var(--bg-color);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
}

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

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

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

.nav a {
  font-size: 15px;
  color: var(--text-color);
  transition: color 0.2s;
}

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

.search-box {
  display: flex;
  align-items: center;
  background: var(--bg-light);
  border-radius: var(--radius);
  padding: 8px 16px;
  width: 280px;
}

.search-box input {
  border: none;
  background: none;
  outline: none;
  flex: 1;
  font-size: 14px;
}

.search-box button {
  border: none;
  background: none;
  cursor: pointer;
  color: var(--text-muted);
}

/* ==================== 面包屑 ==================== */
.breadcrumb {
  padding: 16px 0;
  font-size: 13px;
  color: var(--text-light);
}

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

.breadcrumb span {
  margin: 0 8px;
  color: var(--text-muted);
}

/* ==================== Hero区域 ==================== */
.hero {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  color: #fff;
  padding: 60px 0;
  text-align: center;
}

.hero h1 {
  font-size: 36px;
  font-weight: 700;
  margin-bottom: 16px;
}

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

.hero-search {
  max-width: 560px;
  margin: 0 auto;
  display: flex;
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-hover);
}

.hero-search input {
  flex: 1;
  border: none;
  padding: 16px 20px;
  font-size: 15px;
  outline: none;
}

.hero-search button {
  background: var(--accent-color);
  color: #fff;
  border: none;
  padding: 0 32px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.hero-search button:hover {
  background: #e68900;
}

/* ==================== 分类导航 ==================== */
.section {
  padding: 48px 0;
}

.section-title {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 24px;
  color: var(--primary-color);
}

.category-nav {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.category-item {
  padding: 12px 24px;
  background: var(--bg-light);
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--text-color);
  transition: all 0.2s;
  border: 1px solid transparent;
}

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

/* ==================== 产品卡片 ==================== */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.product-card {
  background: var(--bg-color);
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
}

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

.product-image {
  aspect-ratio: 4/3;
  background: var(--bg-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 14px;
}

.product-info {
  padding: 16px;
}

.product-name {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-color);
  margin-bottom: 8px;
  line-height: 1.4;
}

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

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

.product-price span {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-muted);
}

.product-rating {
  color: #ffc107;
  font-size: 13px;
}

.product-spec {
  font-size: 12px;
  color: var(--text-light);
  margin-bottom: 12px;
}

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

.btn {
  flex: 1;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.btn-primary {
  background: var(--accent-color);
  color: #fff;
}

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

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

.btn-outline:hover {
  background: var(--accent-color);
  color: #fff;
}

/* ==================== 筛选器 ==================== */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 24px;
}

.filter-item {
  padding: 8px 16px;
  background: var(--bg-light);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-color);
  cursor: pointer;
  transition: all 0.2s;
}

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

.filter-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-right: 8px;
}

/* ==================== 分页 ==================== */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 40px;
}

.page-item {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text-color);
  background: var(--bg-light);
  transition: all 0.2s;
}

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

/* ==================== 文章列表 ==================== */
.article-section {
  background: var(--bg-light);
}

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

.article-list h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--primary-color);
}

.article-list ul li {
  padding: 10px 0;
  border-bottom: 1px dashed var(--border-color);
}

.article-list ul li:last-child {
  border-bottom: none;
}

.article-list ul li a {
  font-size: 14px;
  color: var(--text-color);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: color 0.2s;
}

.article-list ul li a::before {
  content: "•";
  color: var(--accent-color);
}

.article-list ul li a:hover {
  color: var(--accent-color);
}

/* ==================== 文章详情页 ==================== */
.article-header {
  background: var(--bg-light);
  padding: 40px 0;
  border-bottom: 1px solid var(--border-color);
}

.article-header h1 {
  font-size: 28px;
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: 16px;
}

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

.article-content {
  padding: 40px 0;
  max-width: 800px;
}

.article-content h2 {
  font-size: 20px;
  font-weight: 600;
  margin: 32px 0 16px;
  color: var(--primary-color);
}

.article-content h3 {
  font-size: 17px;
  font-weight: 600;
  margin: 24px 0 12px;
  color: var(--secondary-color);
}

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

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

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

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

.article-content ol li {
  list-style: decimal;
}

.article-content strong {
  color: var(--primary-color);
}

/* ==================== 规格表格 ==================== */
.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(--bg-light);
  font-weight: 500;
  color: var(--text-light);
  width: 160px;
}

/* ==================== 供应商卡片 ==================== */
.supplier-card {
  background: var(--bg-light);
  border-radius: var(--radius);
  padding: 24px;
  margin: 24px 0;
}

.supplier-card h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--primary-color);
}

.supplier-info {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  font-size: 14px;
}

.supplier-info dt {
  color: var(--text-light);
}

.supplier-info dd {
  color: var(--text-color);
  font-weight: 500;
}

/* ==================== 页脚 ==================== */
.footer {
  background: var(--primary-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 h3 {
  font-size: 20px;
  margin-bottom: 16px;
}

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

.footer-links h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 16px;
  text-transform: uppercase;
}

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

.footer-links ul li a {
  font-size: 14px;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.footer-links ul li a:hover {
  opacity: 1;
}

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

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

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

.error-content h2 {
  font-size: 24px;
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: 16px;
}

.error-content p {
  font-size: 15px;
  color: var(--text-light);
  margin-bottom: 32px;
}

.error-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
}

.btn-lg {
  padding: 14px 32px;
  font-size: 15px;
}

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

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

@media (max-width: 768px) {
  .header-inner {
    flex-wrap: wrap;
    height: auto;
    padding: 12px 0;
    gap: 12px;
  }

  .nav {
    order: 3;
    width: 100%;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .search-box {
    width: auto;
    flex: 1;
  }

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

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

  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .category-nav {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 8px;
  }

  .category-item {
    white-space: nowrap;
  }

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

  .filter-bar {
    overflow-x: auto;
    flex-wrap: nowrap;
  }

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

  .article-content {
    padding: 24px 0;
  }

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

  .error-content h1 {
    font-size: 80px;
  }
}

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

  .product-actions {
    flex-direction: column;
  }

  .hero-search {
    flex-direction: column;
  }

  .hero-search button {
    padding: 12px;
  }

  .section {
    padding: 32px 0;
  }

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