/* ============================================
   古董 - 古董钟表、书籍与工艺品收藏
   产品目录风格样式
   ============================================ */

/* CSS 变量 */
:root {
  --accent-color: #8B4513;
  --accent-light: #A0522D;
  --accent-dark: #654321;
  --text-primary: #333;
  --text-secondary: #666;
  --text-muted: #999;
  --bg-primary: #fff;
  --bg-secondary: #f8f5f0;
  --bg-card: #fff;
  --border-color: #e0d5c8;
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --transition: all 0.3s ease;
}

/* 重置样式 */
* {
  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-primary);
  background-color: var(--bg-secondary);
}

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

ul {
  list-style: none;
}

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

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

.section {
  padding: 40px 0;
}

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

/* ============================================
   页头 Header
   ============================================ */
.header {
  background: var(--bg-primary);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

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

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

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

.nav a {
  font-size: 14px;
  color: var(--text-secondary);
  transition: var(--transition);
}

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

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

.search-box {
  position: relative;
}

.search-box input {
  width: 240px;
  padding: 8px 36px 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 13px;
  outline: none;
  transition: var(--transition);
}

.search-box input:focus {
  border-color: var(--accent-color);
}

.search-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
}

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

.hero-title {
  font-size: 36px;
  font-weight: 700;
  margin-bottom: 12px;
}

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

/* ============================================
   分类导航
   ============================================ */
.categories {
  background: var(--bg-primary);
  padding: 24px 0;
  border-bottom: 1px solid var(--border-color);
}

.category-list {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.category-item {
  padding: 10px 24px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  font-size: 14px;
  color: var(--text-secondary);
  transition: var(--transition);
  cursor: pointer;
}

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

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

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

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

.product-image {
  aspect-ratio: 1;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 13px;
}

.product-info {
  padding: 16px;
}

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

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

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

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

.product-rating {
  font-size: 12px;
  color: #f5a623;
}

.product-btn {
  display: block;
  width: 100%;
  padding: 10px;
  margin-top: 12px;
  background: var(--accent-color);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition);
}

.product-btn:hover {
  background: var(--accent-dark);
}

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

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

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

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

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

/* ============================================
   筛选器
   ============================================ */
.filter-bar {
  background: var(--bg-primary);
  padding: 16px 0;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 24px;
}

.filter-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

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

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

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

.filter-option {
  padding: 6px 12px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}

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

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

.page-item {
  min-width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}

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

/* ============================================
   文章列表
   ============================================ */
.article-section {
  background: var(--bg-primary);
  padding: 32px 0;
  margin-top: 40px;
}

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

.article-list {
  background: var(--bg-secondary);
  padding: 20px;
  border-radius: var(--radius-md);
}

.article-list-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.article-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--border-color);
  font-size: 14px;
}

.article-item:last-child {
  border-bottom: none;
}

.article-item a {
  color: var(--text-secondary);
  transition: var(--transition);
}

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

/* ============================================
   详情页样式
   ============================================ */
.detail-header {
  background: var(--bg-primary);
  padding: 16px 0;
  border-bottom: 1px solid var(--border-color);
}

.detail-header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.detail-actions {
  display: flex;
  gap: 12px;
}

.action-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.action-btn:hover {
  background: var(--border-color);
}

.detail-main {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  padding: 40px 0;
}

.detail-gallery {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.detail-info {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.detail-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
}

.detail-rating {
  display: flex;
  align-items: center;
  gap: 12px;
}

.detail-stars {
  color: #f5a623;
}

.detail-reviews {
  font-size: 13px;
  color: var(--text-secondary);
}

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

.detail-stock {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #28a745;
}

.detail-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.8;
}

.detail-buttons {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.btn {
  padding: 14px 32px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: none;
}

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

.btn-primary:hover {
  background: var(--accent-dark);
}

.btn-secondary {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: var(--border-color);
}

.detail-section {
  background: var(--bg-primary);
  padding: 32px 0;
  border-top: 1px solid var(--border-color);
}

.detail-section-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 20px;
}

.spec-list {
  display: grid;
  gap: 12px;
}

.spec-item {
  display: flex;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-color);
}

.spec-label {
  width: 120px;
  color: var(--text-secondary);
  font-size: 14px;
}

.spec-value {
  flex: 1;
  color: var(--text-primary);
  font-size: 14px;
}

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

.error-content {
  max-width: 480px;
}

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

.error-title {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 12px;
}

.error-desc {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 32px;
}

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

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

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

.footer-brand {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 12px;
}

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

.footer-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

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

.footer-links a {
  font-size: 14px;
  opacity: 0.8;
  transition: var(--transition);
}

.footer-links 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.7;
}

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

  .footer-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%;
    justify-content: center;
    gap: 20px;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
  }

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

  .hero {
    padding: 40px 0;
  }

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

  .category-list {
    overflow-x: auto;
    flex-wrap: nowrap;
    justify-content: flex-start;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
  }

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

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

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

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

  .filter-inner {
    gap: 16px;
  }

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

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

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

  .detail-buttons {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }

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