/* ===== 基础重置 ===== */
*, *::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", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #fafafa;
}

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

ul, ol {
  list-style: none;
}

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

/* ===== CSS 变量 ===== */
:root {
  --primary: #8b4513;
  --primary-light: #a0522d;
  --secondary: #d2691e;
  --accent: #cd853f;
  --text: #333;
  --text-light: #666;
  --text-muted: #999;
  --bg: #fafafa;
  --bg-white: #fff;
  --bg-gray: #f5f5f5;
  --border: #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;
}

/* ===== 布局容器 ===== */
.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;
  color: var(--text);
  margin-bottom: 32px;
  text-align: center;
}

.section-title::after {
  content: '';
  display: block;
  width: 48px;
  height: 3px;
  background: var(--primary);
  margin: 12px auto 0;
  border-radius: 2px;
}

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

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

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

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

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

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

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

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

.search-box input {
  border: none;
  background: none;
  outline: none;
  font-size: 0.875rem;
  width: 160px;
}

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

/* ===== Hero 区域 ===== */
.hero {
  background: linear-gradient(135deg, #8b4513 0%, #a0522d 50%, #cd853f 100%);
  color: #fff;
  padding: 100px 0;
  text-align: center;
}

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

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

.hero-keywords {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.hero-keywords span {
  background: rgba(255,255,255,0.15);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.875rem;
}

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

.category-card {
  background: var(--bg-white);
  border-radius: var(--radius);
  padding: 32px 24px;
  text-align: center;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}

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

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

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

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

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

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

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

.card-image {
  width: 100%;
  height: 180px;
  background: var(--bg-gray);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.card-body {
  padding: 20px;
}

.card-category {
  font-size: 0.75rem;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
  line-height: 1.4;
}

.card-meta {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* ===== 列表样式 ===== */
.list-section {
  background: var(--bg-white);
  padding: 40px 0;
}

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

.list-block h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border);
}

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

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

.list-block a {
  font-size: 0.9375rem;
  color: var(--text);
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: color 0.2s;
}

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

.list-block .num {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--bg-gray);
  padding: 2px 8px;
  border-radius: 10px;
}

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

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

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

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

.breadcrumb li:last-child {
  color: var(--text);
  font-weight: 500;
}

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

/* ===== 页面头部 ===== */
.page-header {
  background: var(--bg-white);
  padding: 40px 0;
  border-bottom: 1px solid var(--border);
}

.page-header h1 {
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

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

/* ===== 文章页 ===== */
.article-container {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 40px;
  padding: 40px 0;
}

.article-main {
  background: var(--bg-white);
  border-radius: var(--radius);
  padding: 40px;
  box-shadow: var(--shadow);
}

.article-header {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

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

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

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

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

.article-body h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 32px 0 16px;
  color: var(--text);
}

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

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

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

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

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

.article-sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.sidebar-block {
  background: var(--bg-white);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.sidebar-block h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

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

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

.sidebar-block a {
  font-size: 0.9375rem;
  color: var(--text);
  display: block;
  transition: color 0.2s;
}

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

/* ===== 分类页列表 ===== */
.category-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.category-item {
  background: var(--bg-white);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  display: flex;
  gap: 20px;
  transition: transform 0.2s, box-shadow 0.2s;
}

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

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

.item-content {
  flex: 1;
}

.item-content h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}

.item-content p {
  font-size: 0.9375rem;
  color: var(--text-light);
  margin-bottom: 12px;
  line-height: 1.5;
}

.item-meta {
  display: flex;
  gap: 16px;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* ===== 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);
  line-height: 1;
  margin-bottom: 16px;
}

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

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

.btn {
  display: inline-block;
  padding: 12px 32px;
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius);
  font-size: 0.9375rem;
  transition: background 0.2s;
}

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

/* ===== 页脚 ===== */
.footer {
  background: #2c2c2c;
  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: 1.25rem;
  margin-bottom: 16px;
}

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

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

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

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

.footer-links a:hover {
  color: #fff;
}

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

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

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

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

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

  .article-sidebar {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .sidebar-block {
    flex: 1;
    min-width: 280px;
  }

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

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

  .nav {
    order: 3;
    width: 100%;
    justify-content: center;
    margin-top: 12px;
    gap: 20px;
  }

  .search-box {
    display: none;
  }

  .hero {
    padding: 60px 0;
  }

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

  .section {
    padding: 40px 0;
  }

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

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

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

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

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

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

  .article-main {
    padding: 24px;
  }
}
