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

:root {
  --primary-color: #8B4513;
  --accent-color: #D2691E;
  --text-color: #333;
  --text-muted: #666;
  --bg-color: #FDF5E6;
  --card-bg: #fff;
  --border-color: #DEB887;
  --shadow: 0 2px 8px rgba(0,0,0,0.1);
  --radius: 8px;
  --max-width: 1200px;
  --header-height: 70px;
}

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

a {
  text-decoration: none;
  color: var(--primary-color);
  transition: color 0.3s;
}

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

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

ul {
  list-style: none;
}

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

/* ===== 页头 ===== */
.header {
  background: linear-gradient(135deg, var(--primary-color) 0%, #A0522D 100%);
  box-shadow: var(--shadow);
  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: bold;
  color: #fff;
}

.logo span {
  color: #FFD700;
}

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

.nav a {
  color: rgba(255,255,255,0.9);
  font-weight: 500;
}

.nav a:hover {
  color: #FFD700;
}

.search-box {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.2);
  border-radius: 20px;
  padding: 5px 15px;
}

.search-box input {
  background: transparent;
  border: none;
  color: #fff;
  outline: none;
  width: 150px;
}

.search-box input::placeholder {
  color: rgba(255,255,255,0.7);
}

.search-box button {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
}

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

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

.breadcrumb span {
  margin: 0 8px;
}

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

.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 15px;
}

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

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

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

.hero-search button {
  padding: 15px 30px;
  background: var(--accent-color);
  color: #fff;
  border: none;
  cursor: pointer;
  font-weight: bold;
}

/* ===== 分类导航 ===== */
.category-nav {
  padding: 40px 0;
}

.section-title {
  text-align: center;
  font-size: 1.5rem;
  margin-bottom: 30px;
  color: var(--primary-color);
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 20px;
}

.category-item {
  background: var(--card-bg);
  padding: 20px;
  border-radius: var(--radius);
  text-align: center;
  box-shadow: var(--shadow);
  transition: transform 0.3s, box-shadow 0.3s;
  border: 2px solid transparent;
}

.category-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 20px rgba(0,0,0,0.15);
  border-color: var(--accent-color);
}

.category-icon {
  font-size: 2.5rem;
  margin-bottom: 10px;
}

.category-name {
  font-weight: bold;
  color: var(--text-color);
}

/* ===== 内容卡片 ===== */
.content-section {
  padding: 40px 0;
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 25px;
}

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

.content-card:hover {
  transform: translateY(-5px);
}

.card-image {
  height: 180px;
  background: linear-gradient(135deg, var(--border-color) 0%, #F5DEB3 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
}

.card-body {
  padding: 20px;
}

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

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

.card-meta span {
  margin-right: 15px;
}

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

.column {
  background: var(--card-bg);
  padding: 25px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.column h3 {
  color: var(--primary-color);
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border-color);
}

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

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

.column ul li a {
  display: flex;
  justify-content: space-between;
  color: var(--text-color);
}

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

/* ===== 列表页 ===== */
.page-header {
  background: var(--card-bg);
  padding: 30px;
  border-radius: var(--radius);
  margin-bottom: 30px;
  box-shadow: var(--shadow);
}

.page-header h1 {
  color: var(--primary-color);
  margin-bottom: 10px;
}

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

.sort-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding: 15px;
  background: var(--card-bg);
  border-radius: var(--radius);
}

.sort-options a {
  margin-left: 15px;
  color: var(--text-muted);
}

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

/* ===== 列表项 ===== */
.list-item {
  background: var(--card-bg);
  padding: 25px;
  margin-bottom: 20px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  gap: 20px;
  transition: box-shadow 0.3s;
}

.list-item:hover {
  box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.list-item-image {
  width: 120px;
  height: 120px;
  background: linear-gradient(135deg, var(--border-color) 0%, #F5DEB3 100%);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  flex-shrink: 0;
}

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

.list-item-title {
  font-size: 1.2rem;
  margin-bottom: 10px;
}

.list-item-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 10px;
  line-height: 1.5;
}

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

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

.pagination a,
.pagination span {
  padding: 10px 15px;
  background: var(--card-bg);
  border-radius: var(--radius);
  color: var(--text-color);
  box-shadow: var(--shadow);
}

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

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

.article-header {
  text-align: center;
  margin-bottom: 40px;
}

.article-image {
  width: 200px;
  height: 200px;
  background: linear-gradient(135deg, var(--border-color) 0%, #F5DEB3 100%);
  border-radius: 50%;
  margin: 0 auto 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 5rem;
  box-shadow: var(--shadow);
}

.article-title {
  font-size: 2rem;
  color: var(--primary-color);
  margin-bottom: 15px;
}

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

.article-meta span {
  margin: 0 10px;
}

.article-info {
  background: var(--card-bg);
  padding: 25px;
  border-radius: var(--radius);
  margin-bottom: 30px;
  box-shadow: var(--shadow);
}

.article-info h3 {
  color: var(--primary-color);
  margin-bottom: 15px;
}

.article-info ul li {
  padding: 8px 0;
  color: var(--text-muted);
}

.article-info ul li strong {
  color: var(--text-color);
  display: inline-block;
  width: 80px;
}

.article-content {
  background: var(--card-bg);
  padding: 40px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  line-height: 1.8;
}

.article-content h2 {
  color: var(--primary-color);
  margin: 30px 0 15px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border-color);
}

.article-content p {
  margin-bottom: 15px;
  color: var(--text-color);
}

/* ===== 推荐区域 ===== */
.recommend-section {
  padding: 40px 0;
}

.recommend-title {
  text-align: center;
  margin-bottom: 30px;
  color: var(--primary-color);
}

.recommend-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 15px;
  margin-bottom: 40px;
}

.recommend-tags a {
  padding: 10px 20px;
  background: var(--card-bg);
  border-radius: 20px;
  box-shadow: var(--shadow);
}

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

.two-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
}

/* ===== 页脚 ===== */
.footer {
  background: var(--primary-color);
  color: rgba(255,255,255,0.8);
  padding: 40px 0 20px;
  margin-top: 60px;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 40px;
  margin-bottom: 30px;
}

.footer-section h4 {
  color: #fff;
  margin-bottom: 15px;
}

.footer-section ul li {
  padding: 5px 0;
}

.footer-section a {
  color: rgba(255,255,255,0.7);
}

.footer-section a:hover {
  color: #FFD700;
}

.footer-bottom {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.2);
  font-size: 0.9rem;
}

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

.error-code {
  font-size: 8rem;
  font-weight: bold;
  color: var(--primary-color);
  line-height: 1;
  margin-bottom: 20px;
}

.error-title {
  font-size: 1.5rem;
  color: var(--text-color);
  margin-bottom: 15px;
}

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

.btn {
  display: inline-block;
  padding: 12px 30px;
  background: var(--accent-color);
  color: #fff;
  border-radius: 25px;
  font-weight: bold;
  transition: background 0.3s;
}

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

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

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

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

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

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

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

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

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

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

  .article-content {
    padding: 25px;
  }

  .article-image {
    width: 150px;
    height: 150px;
    font-size: 3.5rem;
  }
}

@media (max-width: 480px) {
  .hero {
    padding: 40px 0;
  }

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

  .hero-search {
    flex-direction: column;
    border-radius: var(--radius);
  }

  .hero-search button {
    border-radius: 0 0 var(--radius) var(--radius);
  }

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

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