/* ===== CSS 变量 ===== */
:root {
  --accent-color: #8B4513;
  --accent-light: #D2691E;
  --text-primary: #2C1810;
  --text-secondary: #6B5B4F;
  --text-muted: #9B8B7F;
  --bg-primary: #FDF8F3;
  --bg-secondary: #FFF5EB;
  --border-color: #E8DDD4;
  --shadow: 0 2px 8px rgba(44, 24, 16, 0.08);
  --shadow-hover: 0 4px 16px rgba(44, 24, 16, 0.12);
  --radius: 8px;
  --radius-lg: 12px;
  --max-width: 1200px;
  --header-height: 64px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-primary);
}

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

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

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

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

/* ===== 页头 ===== */
.header {
  background: #fff;
  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: 24px;
  font-weight: 700;
  color: var(--accent-color);
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo::before {
  content: "☕";
  font-size: 28px;
}

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

.nav a {
  color: var(--text-primary);
  font-weight: 500;
  font-size: 15px;
}

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

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

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

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

.breadcrumb span {
  margin: 0 8px;
}

/* ===== 主内容区 ===== */
.main {
  padding: 24px 0 48px;
}

/* ===== 首页布局 ===== */
.hero-section {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  margin-bottom: 40px;
}

.headline {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-secondary);
  min-height: 400px;
}

.headline-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.headline-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 32px;
  background: linear-gradient(transparent, rgba(44, 24, 16, 0.9));
  color: #fff;
}

.headline-tag {
  display: inline-block;
  background: var(--accent-color);
  color: #fff;
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 12px;
}

.headline-title {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 8px;
}

.headline-excerpt {
  font-size: 15px;
  opacity: 0.9;
  line-height: 1.5;
}

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

.widget {
  background: #fff;
  border-radius: var(--radius);
  padding: 20px;
  border: 1px solid var(--border-color);
}

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

.widget-list {
  list-style: none;
}

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

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

.widget-list a {
  color: var(--text-primary);
  font-size: 14px;
  display: block;
}

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

/* ===== 特色内容区 ===== */
.features-section {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 24px;
  margin-bottom: 40px;
}

.feature-large {
  grid-row: span 2;
}

.feature-card {
  background: #fff;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-color);
  transition: box-shadow 0.2s;
}

.feature-card:hover {
  box-shadow: var(--shadow-hover);
}

.feature-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.feature-large .feature-image {
  height: 320px;
}

.feature-content {
  padding: 20px;
}

.feature-tag {
  display: inline-block;
  color: var(--accent-color);
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 8px;
}

.feature-title {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.feature-large .feature-title {
  font-size: 22px;
}

.feature-excerpt {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ===== 三栏文章列表 ===== */
.articles-section {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 32px;
  border: 1px solid var(--border-color);
}

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

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

.article-list {
  list-style: none;
}

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

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

.article-list a {
  color: var(--text-primary);
  font-size: 14px;
  display: block;
  line-height: 1.5;
}

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

/* ===== 分类页布局 ===== */
.category-hero {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  margin-bottom: 32px;
}

.category-info {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.category-name {
  font-size: 32px;
  font-weight: 700;
  color: var(--accent-color);
  margin-bottom: 12px;
}

.category-desc {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.category-stats {
  display: flex;
  gap: 24px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
}

.stat-item {
  text-align: center;
}

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

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

.category-sidebar {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 24px;
  border: 1px solid var(--border-color);
}

/* ===== 文章网格 ===== */
.content-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-bottom: 40px;
}

.content-lead {
  grid-column: span 1;
  grid-row: span 2;
}

.content-card {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border-color);
  transition: box-shadow 0.2s;
}

.content-card:hover {
  box-shadow: var(--shadow-hover);
}

.content-image {
  width: 100%;
  height: 160px;
  object-fit: cover;
}

.content-lead .content-image {
  height: 280px;
}

.content-body {
  padding: 16px;
}

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

.content-title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.content-lead .content-title {
  font-size: 18px;
}

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

/* ===== 文章详情页 ===== */
.article-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 32px;
}

.article-main {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 40px;
  border: 1px solid var(--border-color);
}

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

.article-category {
  display: inline-block;
  background: var(--bg-secondary);
  color: var(--accent-color);
  padding: 6px 14px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 16px;
}

.article-title {
  font-size: 32px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 16px;
  color: var(--text-primary);
}

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

.article-cover {
  width: 100%;
  height: 400px;
  object-fit: cover;
  border-radius: var(--radius);
  margin-bottom: 32px;
}

.article-content {
  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;
  color: var(--text-primary);
}

.article-content h3 {
  font-size: 20px;
  font-weight: 600;
  margin: 24px 0 12px;
  color: var(--text-primary);
}

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

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

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

/* ===== 侧边栏组件 ===== */
.article-sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.author-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 24px;
  border: 1px solid var(--border-color);
  text-align: center;
}

.author-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin: 0 auto 16px;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
}

.author-name {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 4px;
}

.author-role {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.author-bio {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.tags-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  display: inline-block;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 13px;
  transition: all 0.2s;
}

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

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

.section-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 20px;
  text-align: center;
}

.related-links {
  display: flex;
  justify-content: center;
  gap: 32px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.related-links a {
  color: var(--text-primary);
  font-size: 15px;
}

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

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

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

.footer-brand .logo {
  color: #fff;
  margin-bottom: 16px;
}

.footer-desc {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
}

.footer-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.footer-links {
  list-style: none;
}

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

.footer-links a {
  color: var(--text-muted);
  font-size: 14px;
}

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

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

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

.error-content {
  max-width: 480px;
}

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

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

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

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

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

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

  .features-section {
    grid-template-columns: 1fr 1fr;
  }

  .feature-large {
    grid-row: span 1;
  }

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

  .content-lead {
    grid-column: span 1;
    grid-row: span 1;
  }

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

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

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

@media (max-width: 768px) {
  .nav {
    display: none;
  }

  .headline {
    min-height: 300px;
  }

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

  .features-section {
    grid-template-columns: 1fr;
  }

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

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

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

  .article-main {
    padding: 24px;
  }

  .article-title {
    font-size: 24px;
  }

  .article-cover {
    height: 240px;
  }

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

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

  .related-links {
    flex-direction: column;
    gap: 12px;
  }
}

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

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

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