/* 电竞椅 - 人体工学座椅评测平台样式 */
/* 基于电子书阅读风格，主色调: #795548 */

/* ===== CSS 变量 ===== */
:root {
  --accent-color: #795548;
  --accent-light: #8d6e63;
  --accent-dark: #5d4037;
  --text-primary: #333;
  --text-secondary: #666;
  --text-muted: #999;
  --bg-primary: #fff;
  --bg-secondary: #faf8f5;
  --bg-card: #fff;
  --border-color: #e8e4df;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --max-width: 1200px;
  --header-height: 60px;
}

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

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

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

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

ul, ol {
  list-style: none;
}

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

/* ===== 页头 ===== */
.header {
  background: var(--bg-primary);
  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: 1.5rem;
  font-weight: 700;
  color: var(--accent-color);
}

.logo span {
  color: var(--text-secondary);
  font-weight: 400;
}

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

.nav a {
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 500;
}

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

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

.search-box input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 0.9rem;
  width: 180px;
}

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

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

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

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

/* ===== 内容区块 ===== */
.section {
  padding: 60px 0;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 30px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--accent-color);
  display: inline-block;
}

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

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

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

.card-image {
  aspect-ratio: 16/10;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 3rem;
}

.card-body {
  padding: 20px;
}

.card-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.card-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.card-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.card-rating {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.stars {
  color: #ffc107;
}

.rating-score {
  font-weight: 600;
  color: var(--accent-color);
}

/* ===== 分类标签 ===== */
.category-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.category-tag {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 24px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s;
}

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

.category-tag-icon {
  width: 40px;
  height: 40px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.category-tag-name {
  font-weight: 500;
  color: var(--text-primary);
}

.category-tag-count {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ===== 列表样式 ===== */
.list-item {
  display: flex;
  gap: 20px;
  padding: 20px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.list-item-image {
  width: 120px;
  height: 80px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 2rem;
}

.list-item-content {
  flex: 1;
}

.list-item-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.list-item-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.list-item-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* ===== 三栏布局 ===== */
.three-col {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}

.col-section h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent-color);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
}

.col-list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--border-color);
}

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

.col-list a {
  color: var(--text-secondary);
  font-size: 0.95rem;
  display: block;
}

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

/* ===== 面包屑 ===== */
.breadcrumb {
  padding: 20px 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

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

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

.breadcrumb span {
  margin: 0 8px;
}

/* ===== 页面标题区 ===== */
.page-header {
  background: var(--bg-primary);
  padding: 40px 0;
  border-bottom: 1px solid var(--border-color);
}

.page-header h1 {
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: 8px;
}

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

/* ===== 筛选排序 ===== */
.filter-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  margin-bottom: 24px;
}

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

.filter-options a {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.filter-options a.active {
  color: var(--accent-color);
  font-weight: 500;
}

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

.pagination a,
.pagination span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
}

.pagination a {
  background: var(--bg-card);
  color: var(--text-secondary);
}

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

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

/* ===== 文章详情页两栏布局 ===== */
.article-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 40px;
  padding: 40px 0;
}

.article-main {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 40px;
}

.article-sidebar {
  position: sticky;
  top: 80px;
  height: fit-content;
}

/* ===== 文章标题区 ===== */
.article-header {
  margin-bottom: 30px;
  padding-bottom: 30px;
  border-bottom: 1px solid var(--border-color);
}

.article-title {
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 16px;
}

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

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

/* ===== 文章内容 ===== */
.article-content {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text-primary);
}

.article-content h2 {
  font-size: 1.4rem;
  font-weight: 600;
  margin: 40px 0 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border-color);
}

.article-content h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 30px 0 15px;
}

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

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

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

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

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

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

/* ===== 产品信息卡片 ===== */
.product-info {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 24px;
  margin: 24px 0;
}

.product-info h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--accent-color);
}

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

.spec-item {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  padding: 8px 0;
  border-bottom: 1px dashed var(--border-color);
}

.spec-label {
  color: var(--text-muted);
}

.spec-value {
  color: var(--text-primary);
  font-weight: 500;
}

/* ===== 目录组件 ===== */
.toc {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.toc h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--accent-color);
}

.toc-list li {
  padding: 8px 0;
  border-bottom: 1px solid var(--border-color);
}

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

.toc-list a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.toc-list .num {
  color: var(--accent-color);
  font-weight: 500;
  min-width: 24px;
}

/* ===== 侧边栏区块 ===== */
.sidebar-section {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.sidebar-section h4 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.sidebar-list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--border-color);
}

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

.sidebar-list a {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* ===== 推荐文章横向 ===== */
.related-articles {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  padding-bottom: 10px;
}

.related-item {
  min-width: 200px;
  flex-shrink: 0;
}

.related-item-image {
  width: 100%;
  height: 120px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.related-item-title {
  font-size: 0.9rem;
  color: var(--text-primary);
  line-height: 1.4;
}

/* ===== 404 页面 ===== */
.error-page {
  text-align: center;
  padding: 100px 20px;
}

.error-code {
  font-size: 8rem;
  font-weight: 700;
  color: var(--accent-color);
  opacity: 0.3;
  line-height: 1;
}

.error-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 20px 0 10px;
}

.error-desc {
  color: var(--text-secondary);
  margin-bottom: 30px;
}

.btn {
  display: inline-block;
  padding: 12px 32px;
  background: var(--accent-color);
  color: #fff;
  border-radius: var(--radius-md);
  font-weight: 500;
  transition: background 0.2s;
}

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

/* ===== 页脚 ===== */
.footer {
  background: var(--bg-primary);
  border-top: 1px solid var(--border-color);
  padding: 40px 0;
  margin-top: 60px;
}

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

.footer-logo {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--accent-color);
}

.footer-links {
  display: flex;
  gap: 30px;
}

.footer-links a {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.footer-copy {
  font-size: 0.85rem;
  color: var(--text-muted);
}

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

  .article-sidebar {
    position: static;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .toc {
    grid-column: 1 / -1;
  }

  .three-col {
    grid-template-columns: 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 {
    flex: 1;
    max-width: 200px;
  }

  .search-box input {
    width: 100%;
  }

  .hero {
    padding: 50px 0;
  }

  .hero h1 {
    font-size: 1.8rem;
  }

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

  .list-item {
    flex-direction: column;
  }

  .list-item-image {
    width: 100%;
    height: 160px;
  }

  .article-main {
    padding: 24px;
  }

  .article-title {
    font-size: 1.4rem;
  }

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

  .footer-inner {
    flex-direction: column;
    gap: 20px;
    text-align: center;
  }

  .error-code {
    font-size: 5rem;
  }
}

@media (max-width: 480px) {
  .filter-bar {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }

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

  .pagination a,
  .pagination span {
    width: 36px;
    height: 36px;
  }
}
