/* ===== CSS 变量 ===== */
:root {
  --accent-color: #c62828;
  --text-primary: #333;
  --text-secondary: #666;
  --text-muted: #999;
  --bg-primary: #fff;
  --bg-secondary: #f5f5f5;
  --bg-dark: #1a1a1a;
  --border-color: #e0e0e0;
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --max-width: 1200px;
  --gap: 24px;
  --radius: 4px;
}

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

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

body {
  font-family: var(--font-family);
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-primary);
}

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

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

/* ===== 头部 ===== */
.header {
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  padding: 16px 0;
}

.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

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

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

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

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

/* ===== 主要内容区 ===== */
.main {
  min-height: calc(100vh - 200px);
  padding: var(--gap) 0;
}

/* ===== Hero 区域 ===== */
.hero {
  margin-bottom: 40px;
}

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

.hero-item {
  position: relative;
  background: var(--bg-secondary);
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 280px;
  display: flex;
  flex-direction: column;
}

.hero-item:first-child {
  grid-column: span 2;
  grid-row: span 2;
  min-height: 400px;
}

.hero-item img {
  width: 100%;
  height: 60%;
  object-fit: cover;
}

.hero-content {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-content h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 8px;
  line-height: 1.4;
}

.hero-item:first-child .hero-content h2 {
  font-size: 1.75rem;
}

.hero-content p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ===== 三栏内容区 ===== */
.content-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
}

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

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

.article-item {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}

.article-item:last-child {
  border-bottom: none;
}

.article-item a {
  display: block;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.5;
  margin-bottom: 6px;
  transition: color 0.2s;
}

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

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

/* ===== 分类页样式 ===== */
.page-header {
  text-align: center;
  padding: 40px 0;
  margin-bottom: 32px;
  background: var(--bg-secondary);
  border-radius: var(--radius);
}

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

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

.category-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--gap);
  margin-bottom: 40px;
}

.category-item {
  background: var(--bg-secondary);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.category-item img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.category-content {
  padding: 20px;
  flex: 1;
}

.category-content h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.category-content p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 12px;
}

.read-more {
  font-size: 0.85rem;
  color: var(--accent-color);
  font-weight: 500;
}

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

.article-header h1 {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 16px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.article-info {
  display: flex;
  justify-content: center;
  gap: 24px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.article-body {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 0 40px;
}

.article-body img {
  width: 100%;
  border-radius: var(--radius);
  margin-bottom: 24px;
}

.article-body p {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text-primary);
  margin-bottom: 20px;
}

.article-body h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 32px 0 16px;
}

.article-body h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 24px 0 12px;
}

/* ===== 推荐文章区 ===== */
.recommended {
  background: var(--bg-secondary);
  padding: 32px 0;
  margin-top: 40px;
}

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

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

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.tag {
  padding: 6px 14px;
  background: var(--bg-primary);
  border-radius: 20px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  transition: all 0.2s;
}

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

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

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

.footer-brand h3 {
  font-size: 1.25rem;
  margin-bottom: 12px;
  color: #fff;
}

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

.footer h4 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 16px;
  color: #fff;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

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

.footer-bottom {
  padding-top: 24px;
  border-top: 1px solid #333;
  text-align: center;
  font-size: 0.85rem;
  color: #666;
}

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

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

.error-content h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 16px;
}

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

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

.btn:hover {
  opacity: 0.9;
}

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

  .hero-item:first-child {
    grid-column: span 2;
    grid-row: span 1;
    min-height: 280px;
  }

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

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

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

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

@media (max-width: 768px) {
  .header .container {
    flex-direction: column;
    align-items: flex-start;
  }

  .nav {
    gap: 20px;
  }

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

  .hero-item:first-child {
    grid-column: span 1;
  }

  .hero-item:first-child .hero-content h2 {
    font-size: 1.25rem;
  }

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

  .article-info {
    flex-direction: column;
    gap: 8px;
  }

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

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

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

  .hero-item,
  .hero-item:first-child {
    min-height: 240px;
  }

  .category-item img {
    height: 160px;
  }
}
