/**
 * 定制家具 - 全局样式
 * 主题：现代简约家具定制
 * 关键词：全屋家具定制 北欧风格定制床 现代简约客厅家具
 */

/* ===== CSS 变量 ===== */
:root {
  --primary-color: #5d4037;
  --primary-light: #8d6e63;
  --primary-dark: #3e2723;
  --accent-color: #d4a574;
  --text-primary: #333;
  --text-secondary: #666;
  --text-light: #999;
  --bg-primary: #fff;
  --bg-secondary: #f8f6f3;
  --bg-dark: #2c2c2c;
  --border-color: #e8e4df;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-hover: 0 4px 16px rgba(0,0,0,0.12);
  --radius: 4px;
  --radius-lg: 8px;
  --max-width: 1200px;
  --header-height: 70px;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

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

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;
}

.section {
  padding: 60px 0;
}

.section-title {
  font-size: 1.75rem;
  font-weight: 600;
  text-align: center;
  margin-bottom: 40px;
  color: var(--primary-dark);
}

.section-title::after {
  content: '';
  display: block;
  width: 50px;
  height: 3px;
  background: var(--accent-color);
  margin: 12px auto 0;
}

/* ===== 按钮样式 ===== */
.btn {
  display: inline-block;
  padding: 12px 28px;
  font-size: 0.9375rem;
  font-weight: 500;
  text-align: center;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
}

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

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

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

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

/* ===== 头部样式 ===== */
.header {
  background: var(--bg-primary);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
}

.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-dark);
}

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

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

.nav a {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  transition: color 0.3s;
}

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

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

.search-box input {
  border: none;
  background: transparent;
  outline: none;
  width: 100%;
  font-size: 0.875rem;
}

.search-box input::placeholder {
  color: var(--text-light);
}

/* ===== Hero 区域 ===== */
.hero {
  background: linear-gradient(135deg, var(--bg-secondary) 0%, #ebe7e2 100%);
  padding: 80px 0;
}

.hero .container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.hero-content h1 {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary-dark);
  line-height: 1.3;
  margin-bottom: 20px;
}

.hero-content p {
  font-size: 1.125rem;
  color: var(--text-secondary);
  margin-bottom: 32px;
}

.hero-buttons {
  display: flex;
  gap: 16px;
}

.hero-image {
  background: var(--border-color);
  border-radius: var(--radius-lg);
  height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  font-size: 1rem;
}

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

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

.category-card:hover {
  box-shadow: var(--shadow-hover);
}

.category-card-image {
  height: 160px;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
}

.category-card-content {
  padding: 20px;
}

.category-card h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--primary-dark);
}

.category-card p {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

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

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

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

.product-card-image {
  height: 220px;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
}

.product-card-content {
  padding: 20px;
}

.product-card h3 {
  font-size: 1.0625rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--primary-dark);
}

.product-card p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.product-card .price {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--primary-color);
}

/* ===== 特色区域 ===== */
.features {
  background: var(--bg-secondary);
}

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

.feature-item {
  text-align: center;
}

.feature-icon {
  width: 64px;
  height: 64px;
  background: var(--bg-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 1.5rem;
  color: var(--primary-color);
}

.feature-item h3 {
  font-size: 1.0625rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.feature-item p {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* ===== 面包屑 ===== */
.breadcrumb {
  background: var(--bg-secondary);
  padding: 16px 0;
}

.breadcrumb ol {
  display: flex;
  align-items: center;
  gap: 8px;
}

.breadcrumb li {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.breadcrumb li:not(:last-child)::after {
  content: '>';
  margin-left: 8px;
  color: var(--text-light);
}

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

/* ===== 分类页布局 ===== */
.category-header {
  background: var(--bg-secondary);
  padding: 40px 0;
  text-align: center;
}

.category-header h1 {
  font-size: 2rem;
  font-weight: 600;
  color: var(--primary-dark);
  margin-bottom: 12px;
}

.category-header p {
  color: var(--text-secondary);
}

.filter-bar {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 24px;
}

.filter-btn {
  padding: 8px 20px;
  font-size: 0.875rem;
  border: 1px solid var(--border-color);
  background: var(--bg-primary);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.3s;
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--primary-color);
  color: #fff;
  border-color: var(--primary-color);
}

/* ===== 文章页布局 ===== */
.article-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 20px;
}

.article-header {
  margin-bottom: 32px;
}

.article-header h1 {
  font-size: 1.875rem;
  font-weight: 600;
  color: var(--primary-dark);
  line-height: 1.4;
  margin-bottom: 16px;
}

.article-meta {
  display: flex;
  gap: 20px;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.article-content {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text-primary);
}

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

.article-content h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--primary-dark);
  margin: 24px 0 12px;
}

.article-content p {
  margin-bottom: 16px;
}

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

.article-content ul li {
  list-style: disc;
  margin-bottom: 8px;
}

.article-content ol li {
  list-style: decimal;
  margin-bottom: 8px;
}

.article-image {
  width: 100%;
  height: 300px;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  margin: 24px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
}

/* ===== 侧边栏文章列表 ===== */
.sidebar-section {
  margin-top: 40px;
}

.sidebar-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--primary-dark);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--accent-color);
}

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

.article-list-item {
  display: flex;
  gap: 12px;
  padding: 12px;
  background: var(--bg-secondary);
  border-radius: var(--radius);
  transition: background 0.3s;
}

.article-list-item:hover {
  background: var(--border-color);
}

.article-list-thumb {
  width: 80px;
  height: 60px;
  background: var(--border-color);
  border-radius: var(--radius);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: var(--text-light);
}

.article-list-info h4 {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.article-list-info span {
  font-size: 0.8125rem;
  color: var(--text-light);
}

/* ===== 三栏底部 ===== */
.footer-content {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  margin-bottom: 40px;
}

.footer-column h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--primary-dark);
  margin-bottom: 16px;
}

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

.footer-column ul li a {
  font-size: 0.875rem;
  color: var(--text-secondary);
  transition: color 0.3s;
}

.footer-column ul li a:hover {
  color: var(--primary-color);
}

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

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

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

.footer-brand p {
  font-size: 0.875rem;
  color: #aaa;
  line-height: 1.7;
}

.footer-links h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 16px;
}

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

.footer-links a {
  font-size: 0.875rem;
  color: #aaa;
  transition: color 0.3s;
}

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

.footer-bottom {
  border-top: 1px solid #444;
  padding-top: 24px;
  text-align: center;
  font-size: 0.875rem;
  color: #888;
}

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

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

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

.error-content p {
  color: var(--text-secondary);
  margin-bottom: 32px;
}

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

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

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

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

@media (max-width: 768px) {
  :root {
    --header-height: 60px;
  }

  .nav {
    display: none;
  }

  .search-box {
    width: 140px;
  }

  .hero .container {
    grid-template-columns: 1fr;
    gap: 32px;
    text-align: center;
  }

  .hero-content h1 {
    font-size: 1.875rem;
  }

  .hero-buttons {
    justify-content: center;
  }

  .hero-image {
    height: 280px;
  }

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

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

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

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

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

  .section {
    padding: 40px 0;
  }

  .section-title {
    font-size: 1.5rem;
  }
}

@media (max-width: 480px) {
  .hero-content h1 {
    font-size: 1.5rem;
  }

  .btn {
    padding: 10px 20px;
    font-size: 0.875rem;
  }

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

  .article-header h1 {
    font-size: 1.5rem;
  }

  .error-content h1 {
    font-size: 4rem;
  }
}
