/* ===== 基础变量 ===== */
:root {
  --accent-color: #4caf50;
  --accent-dark: #388e3c;
  --accent-light: #c8e6c9;
  --text-primary: #333;
  --text-secondary: #666;
  --text-muted: #999;
  --bg-primary: #fff;
  --bg-secondary: #f8f9fa;
  --bg-dark: #2c3e50;
  --border-color: #e0e0e0;
  --shadow: 0 2px 8px rgba(0,0,0,0.1);
  --shadow-hover: 0 4px 16px rgba(0,0,0,0.15);
  --radius: 8px;
  --max-width: 1200px;
  --gap: 24px;
}

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

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

a {
  color: var(--text-primary);
  text-decoration: none;
  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 var(--gap);
}

.section {
  padding: 48px 0;
}

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

/* ===== 页头 ===== */
.header {
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
}

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

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

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

.nav a {
  font-size: 15px;
  font-weight: 500;
}

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

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-box input {
  width: 200px;
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  font-size: 14px;
}

.search-box button {
  padding: 8px 16px;
  background: var(--accent-color);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 14px;
}

.search-box button:hover {
  background: var(--accent-dark);
}

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

.hero h1 {
  font-size: 40px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.hero p {
  font-size: 18px;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
}

/* ===== 热门主题 ===== */
.trending-topics {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 32px;
}

.topic-tag {
  padding: 10px 20px;
  background: var(--bg-primary);
  border-radius: 24px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow);
  transition: all 0.3s;
}

.topic-tag:hover {
  background: var(--accent-color);
  color: #fff;
  transform: translateY(-2px);
}

/* ===== 卡片网格 ===== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
}

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

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

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

.card-body {
  padding: 16px;
}

.card-category {
  font-size: 12px;
  color: var(--accent-color);
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

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

/* ===== 列表样式 ===== */
.list-section {
  background: var(--bg-secondary);
}

.list-item {
  display: flex;
  gap: 16px;
  padding: 16px;
  background: var(--bg-primary);
  border-radius: var(--radius);
  margin-bottom: 12px;
  transition: all 0.3s;
}

.list-item:hover {
  box-shadow: var(--shadow);
}

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

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

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

.list-item-desc {
  font-size: 14px;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ===== 三栏底部 ===== */
.three-col-section {
  background: var(--bg-secondary);
  padding: 48px 0;
}

.three-col {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
}

.col-box {
  background: var(--bg-primary);
  padding: 24px;
  border-radius: var(--radius);
}

.col-box h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--accent-color);
}

.col-box ul li {
  padding: 10px 0;
  border-bottom: 1px solid var(--border-color);
  font-size: 14px;
}

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

.col-box ul li a {
  display: flex;
  align-items: center;
  gap: 8px;
}

.col-box ul li a::before {
  content: "•";
  color: var(--accent-color);
}

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

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--gap);
  margin-bottom: 32px;
}

.footer-brand p {
  color: rgba(255,255,255,0.7);
  font-size: 14px;
  margin-top: 12px;
}

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

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

.footer-col ul li a {
  color: rgba(255,255,255,0.7);
  font-size: 14px;
}

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

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 24px;
  text-align: center;
  color: rgba(255,255,255,0.5);
  font-size: 14px;
}

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

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

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

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

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

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

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

.category-header h1 {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 8px;
}

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

/* ===== 加载更多 ===== */
.load-more {
  text-align: center;
  padding: 32px 0;
}

.load-more-btn {
  padding: 12px 32px;
  background: var(--bg-primary);
  border: 2px solid var(--accent-color);
  color: var(--accent-color);
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s;
}

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

/* ===== 文章页 ===== */
.article-header {
  text-align: center;
  padding: 48px 0 32px;
}

.article-header h1 {
  font-size: 32px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 16px;
}

.article-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  font-size: 14px;
  color: var(--text-secondary);
}

.article-meta .category {
  color: var(--accent-color);
  font-weight: 500;
}

.article-meta .tags {
  display: flex;
  gap: 8px;
}

.article-meta .tag {
  padding: 4px 10px;
  background: var(--bg-secondary);
  border-radius: 4px;
  font-size: 12px;
}

.article-featured-image {
  width: 100%;
  max-width: 800px;
  height: 400px;
  margin: 0 auto 32px;
  background: var(--bg-secondary);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.article-content {
  max-width: 800px;
  margin: 0 auto;
  font-size: 16px;
  line-height: 1.8;
  color: var(--text-primary);
}

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

.article-content h2 {
  font-size: 24px;
  font-weight: 600;
  margin: 32px 0 16px;
}

.article-content h3 {
  font-size: 20px;
  font-weight: 600;
  margin: 24px 0 12px;
}

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

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

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

/* ===== 相关推荐 ===== */
.related-section {
  padding: 48px 0;
}

.related-section h2 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 24px;
}

/* ===== 更多内容 ===== */
.more-section {
  background: var(--bg-secondary);
}

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

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

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

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

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

.btn {
  padding: 12px 28px;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s;
}

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

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

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

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

/* ===== 两栏布局 ===== */
.two-col-section {
  background: var(--bg-secondary);
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
}

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

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

  .nav {
    display: none;
  }
}

@media (max-width: 768px) {
  .hero h1 {
    font-size: 28px;
  }

  .hero p {
    font-size: 16px;
  }

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

  .three-col,
  .two-col,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .search-box {
    display: none;
  }

  .article-header h1 {
    font-size: 24px;
  }

  .article-featured-image {
    height: 240px;
  }

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

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

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

@media (max-width: 480px) {
  :root {
    --gap: 16px;
  }

  .section {
    padding: 32px 0;
  }

  .hero {
    padding: 48px 0;
  }

  .section-title {
    font-size: 20px;
  }
}
