/* ========================================
   民俗文化游 - 样式表
   www.minsuweizhi.cn
   ======================================== */

/* CSS 变量 */
:root {
  --accent-color: #c41e3a;
  --accent-light: #e8d5d8;
  --text-primary: #333;
  --text-secondary: #666;
  --text-muted: #999;
  --bg-primary: #fff;
  --bg-secondary: #f8f6f3;
  --bg-dark: #2c2c2c;
  --border-color: #e5e5e5;
  --font-heading: "Noto Serif SC", Georgia, serif;
  --font-body: "Noto Sans SC", -apple-system, BlinkMacSystemFont, sans-serif;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-hover: 0 4px 16px rgba(0,0,0,0.12);
  --radius: 4px;
}

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

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-primary);
  background: var(--bg-primary);
}

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

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

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

ul {
  list-style: none;
}

/* 容器 */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ========================================
   头部
   ======================================== */
.header {
  background: var(--bg-primary);
  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: 70px;
}

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

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

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

.nav a {
  font-size: 0.95rem;
  font-weight: 500;
  position: relative;
}

.nav a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent-color);
  transition: width 0.2s;
}

.nav a:hover::after,
.nav a.active::after {
  width: 100%;
}

/* ========================================
   面包屑
   ======================================== */
.breadcrumb {
  background: var(--bg-secondary);
  padding: 12px 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

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

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

.breadcrumb span {
  margin: 0 8px;
  color: var(--text-muted);
}

/* ========================================
   首页布局
   ======================================== */
.hero-section {
  padding: 40px 0;
}

.hero-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}

.headline-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  height: 420px;
}

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

.headline-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 40px;
  background: linear-gradient(transparent, rgba(0,0,0,0.8));
  color: #fff;
}

.headline-content .tag {
  display: inline-block;
  background: var(--accent-color);
  color: #fff;
  padding: 4px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: 2px;
  margin-bottom: 12px;
}

.headline-content h2 {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 12px;
}

.headline-content p {
  font-size: 0.95rem;
  opacity: 0.9;
  line-height: 1.6;
}

/* 侧边栏小部件 */
.sidebar-widgets {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.widget {
  background: var(--bg-secondary);
  border-radius: var(--radius);
  padding: 20px;
}

.widget-title {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--accent-color);
}

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

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

.widget-list a {
  font-size: 0.9rem;
  display: block;
  line-height: 1.5;
}

.widget-list .meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ========================================
   文章网格
   ======================================== */
.articles-section {
  padding: 40px 0;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.section-title {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 700;
  position: relative;
  padding-left: 16px;
}

.section-title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 4px;
  background: var(--accent-color);
}

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

/* 特色文章网格 */
.featured-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: 300px 300px;
  gap: 20px;
  margin-bottom: 40px;
}

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

.article-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-secondary);
}

.article-card img {
  width: 100%;
  height: 60%;
  object-fit: cover;
}

.article-card.featured-large img {
  height: 70%;
}

.article-card .card-content {
  padding: 16px;
}

.article-card .tag {
  font-size: 0.75rem;
  color: var(--accent-color);
  font-weight: 600;
  text-transform: uppercase;
}

.article-card h3 {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  margin-top: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-card.featured-large h3 {
  font-size: 1.25rem;
}

.article-card .meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 8px;
}

/* ========================================
   三栏列表
   ======================================== */
.three-col-section {
  background: var(--bg-secondary);
  padding: 40px 0;
}

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

.col-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border-color);
}

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

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

.col-list a {
  font-size: 0.95rem;
  display: block;
  line-height: 1.5;
}

.col-list .date {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ========================================
   分类页
   ======================================== */
.category-hero {
  padding: 40px 0;
}

.category-hero-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}

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

.category-info h1 {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 16px;
}

.category-info p {
  color: var(--text-secondary);
  line-height: 1.8;
}

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

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

.stat-number {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--accent-color);
}

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

/* 分类文章网格 */
.category-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  padding: 40px 0;
}

.category-card {
  background: var(--bg-secondary);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow 0.2s;
}

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

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

.category-card .card-body {
  padding: 16px;
}

.category-card h3 {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 8px;
}

.category-card p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

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

.recommended-tags {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.tag-item {
  background: var(--bg-primary);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.9rem;
  border: 1px solid var(--border-color);
  transition: all 0.2s;
}

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

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

/* ========================================
   文章页
   ======================================== */
.article-header {
  padding: 40px 0 24px;
}

.article-header-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 32px;
}

.article-title-wrap {
  max-width: 700px;
}

.article-tag {
  display: inline-block;
  background: var(--accent-color);
  color: #fff;
  padding: 4px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  border-radius: 2px;
  margin-bottom: 16px;
}

.article-title {
  font-family: var(--font-heading);
  font-size: 2.25rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 20px;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 20px;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.article-meta .author {
  font-weight: 500;
  color: var(--text-primary);
}

.article-hero-img {
  width: 100%;
  height: 280px;
  object-fit: cover;
  border-radius: var(--radius);
}

/* 文章内容 */
.article-content-wrap {
  padding: 32px 0 60px;
}

.article-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 48px;
}

.article-body {
  font-size: 1.05rem;
  line-height: 1.9;
}

.article-body h2 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  margin: 40px 0 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.article-body h3 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 600;
  margin: 32px 0 16px;
}

.article-body p {
  margin-bottom: 20px;
  color: var(--text-secondary);
}

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

.article-body blockquote {
  border-left: 4px solid var(--accent-color);
  padding: 16px 24px;
  margin: 24px 0;
  background: var(--bg-secondary);
  font-style: italic;
  color: var(--text-secondary);
}

/* 侧边栏 */
.sidebar-card {
  background: var(--bg-secondary);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
}

.author-card {
  text-align: center;
}

.author-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin: 0 auto 16px;
  object-fit: cover;
}

.author-name {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.author-bio {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

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

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

.related-list a {
  font-size: 0.95rem;
  line-height: 1.5;
}

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

.tag-cloud-item {
  background: var(--bg-primary);
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 0.85rem;
  border: 1px solid var(--border-color);
}

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

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

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

.error-title {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 600;
  margin-bottom: 16px;
}

.error-desc {
  color: var(--text-secondary);
  margin-bottom: 32px;
  line-height: 1.8;
}

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

.btn {
  display: inline-block;
  padding: 12px 28px;
  font-size: 0.95rem;
  font-weight: 500;
  border-radius: var(--radius);
  transition: all 0.2s;
}

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

.btn-primary:hover {
  background: #a31830;
  color: #fff;
}

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

.btn-secondary:hover {
  background: var(--border-color);
  color: var(--text-primary);
}

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

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

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

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

.footer-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 20px;
}

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

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

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

.footer-bottom {
  border-top: 1px solid #444;
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: #888;
}

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

  .featured-grid {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto;
  }

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

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

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

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

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

@media (max-width: 768px) {
  .header-inner {
    height: 60px;
  }

  .nav {
    display: none;
  }

  .headline-card {
    height: 300px;
  }

  .headline-content {
    padding: 24px;
  }

  .headline-content h2 {
    font-size: 1.4rem;
  }

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

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

  .article-title {
    font-size: 1.6rem;
  }

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

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

  .footer-bottom {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .category-grid {
    grid-template-columns: 1fr;
  }

  .error-actions {
    flex-direction: column;
  }
}
