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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  line-height: 1.5;
  color: #333;
  background-color: #f8f9fa;
}

/* 头部样式 */
.header {
  background: #CD0000;
  color: white;
  padding: 1rem 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 2rem;
  font-weight: bold;
  text-decoration: none;
  color: #FFD700;
}

.nav {
  display: flex;
  gap: 2rem;
}

.nav-link {
  color: white;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
  position: relative;
}

.nav-link:hover {
  color: #FFD700;
  opacity: 0.9;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: white;
  transition: width 0.3s ease;
}

.nav-link:hover::after {
  width: 100%;
}

/* 主内容区域 */
.container {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 20px;
}

/* 首页样式 */
.hero-section {
  text-align: center;
  padding: 2rem;
  background: white;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  margin-bottom: 1.5rem;
}

.hero-title {
  font-size: 2rem;
  margin-bottom: 0.75rem;
  color: #CD0000;
  font-weight: 700;
}

.hero-description {
  font-size: 1rem;
  color: #6c757d;
  max-width: 800px;
  margin: 0 auto;
}

/* 卡片网格 */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.card {
  background: white;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(205, 0, 0, 0.1);
}

.card-content {
  padding: 1rem;
}

.card-title {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: #333;
}

.card-excerpt {
  font-size: 0.9rem;
  color: #666;
  margin-bottom: 1rem;
  line-height: 1.5;
}

.category-links {
  margin-top: 0.5rem;
}

.category-links .sidebar-link {
  display: block;
  padding: 0.3rem 0;
  font-size: 0.85rem;
  color: #666;
  text-decoration: none;
  line-height: 1.4;
  transition: color 0.2s;
}

.category-links .sidebar-link:hover {
  color: #CD0000;
  text-decoration: none;
}

.section-title {
  font-size: 1.2rem;
  color: #CD0000;
  margin: 1.2rem 0 0.8rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid #CD0000;
  font-weight: 600;
}

.category-section {
  margin-bottom: 1.5rem;
}

/* 优化卡片布局，使其更加紧凑 */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 0.8rem;
  margin-bottom: 1rem;
}

.card {
  background-color: #fff;
  border: 1px solid #E60012;
  border-radius: 4px;
  padding: 0.8rem;
  transition: transform 0.2s, box-shadow 0.2s;
}

.card-content {
  padding: 0;
}

.content {
  font-size: 0.9rem;
  color: #666;
  line-height: 1.6;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid #E60012;
}

.card-link {
  display: inline-block;
  color: #CD0000;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

.card-link:hover {
  color: #E60012;
}

/* 分类页面样式 */
.category-header {
  background: white;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  margin-bottom: 2rem;
}

.category-title {
  font-size: 2rem;
  color: #333;
  margin-bottom: 1rem;
}

/* 文章列表样式 */
.article-list {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.article-item {
  padding: 1.5rem 2rem;
  border-bottom: 1px solid #f0f0f0;
  transition: background-color 0.3s ease;
}

.article-item:hover {
  background-color: #f9f9f9;
}

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

.article-title {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.article-title a {
  color: #333;
  text-decoration: none;
  transition: color 0.3s ease;
}

.article-title a:hover {
  color: #CD0000;
}

.article-meta {
  font-size: 0.875rem;
  color: #999;
  margin-bottom: 0.5rem;
}

.article-excerpt {
  color: #666;
}

/* 热门文章和热门栏目样式 */
.popular-section {
  margin-top: 2rem;
  margin-bottom: 1.5rem;
}

.popular-container {
  display: flex;
  gap: 1.5rem;
  background: white;
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  border: 1px solid #f0f0f0;
}

.popular-articles, .popular-categories {
  flex: 1;
}

.popular-title {
  font-size: 1.2rem;
  margin-bottom: 1rem;
  padding-bottom: 0.6rem;
  border-bottom: 2px solid #CD0000;
  color: #333;
}

.popular-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.popular-item {
  margin-bottom: 0.6rem;
  position: relative;
}

.popular-link {
  color: #333;
  text-decoration: none;
  transition: all 0.3s ease;
  display: block;
  padding: 0.4rem 0;
  font-size: 0.95rem;
  line-height: 1.4;
  padding-left: 1rem;
}

.popular-link::before {
  content: "▶";
  position: absolute;
  left: 0;
  color: #CD0000;
  font-size: 0.7rem;
  top: 0.6rem;
  opacity: 0;
  transition: all 0.3s ease;
}

.popular-link:hover {
  color: #CD0000;
  padding-left: 1.3rem;
}

.popular-link:hover::before {
  opacity: 1;
  left: 0.2rem;
}

/* 侧边栏样式（保留兼容性）*/
.sidebar {
  background: white;
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  margin-bottom: 1.5rem;
  border: 1px solid #f0f0f0;
}

.sidebar-title {
    font-size: 1.1rem;
    margin-bottom: 0.8rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #CD0000;
    color: #333;
  }

  .sidebar-list {
    list-style: none;
    padding: 0;
    margin: 0;
  }

  .sidebar-item {
    margin-bottom: 0.5rem;
  }

  .sidebar-link {
    color: #333;
    text-decoration: none;
    transition: all 0.3s ease;
    display: block;
    padding: 0.3rem 0;
  }

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

.sidebar-item {
  margin-bottom: 0.75rem;
}

.sidebar-link {
  color: #666;
  text-decoration: none;
  transition: color 0.3s ease;
  display: block;
  padding: 0.5rem 0;
}

.sidebar-link:hover {
  color: #CD0000;
  transform: translateX(5px);
}

/* 内容页面样式 */
.content-page {
  background: white;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.content-title {
  font-size: 2rem;
  color: #333;
  margin-bottom: 1.5rem;
  text-align: center;
}

.content-meta {
  text-align: center;
  color: #999;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #f0f0f0;
}

.content-body {
  line-height: 1.8;
  color: #333;
}

.content-body p {
  margin-bottom: 1rem;
}

.content-footer {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid #f0f0f0;
  display: flex;
  justify-content: space-between;
}

.prev-next a {
  color: #CD0000;
  text-decoration: none;
}

.prev-next a:hover {
  text-decoration: underline;
  color: #E60012;
}

/* 页脚样式 */
.footer {
  background: #CD0000;
  color: white;
  padding: 2rem 0;
  margin-top: 2rem;
  text-align: center;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.footer-column h3 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
}

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

.footer-links li {
  margin-bottom: 0.5rem;
}

.footer-links a {
  color: #ccc;
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-links a:hover {
  color: white;
}

.footer-bottom {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid #444;
  text-align: center;
  color: #ccc;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .header-container {
    flex-direction: column;
    gap: 1rem;
  }
  
  /* 侧边栏响应式 */
  /* 响应式热门内容布局 */
  .popular-container {
    flex-direction: column;
    gap: 1.2rem;
    padding: 1.2rem;
  }
  
  .popular-articles, .popular-categories {
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 0.8rem;
  }
  
  .popular-categories {
    border-bottom: none;
    padding-bottom: 0;
  }
  
  .nav {
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
  }
  
  .hero-title {
    font-size: 2rem;
  }
  
  .card-grid {
    grid-template-columns: 1fr;
  }
  
  .content-title {
    font-size: 1.75rem;
  }
  
  .footer-content {
    grid-template-columns: 1fr;
  }
}

/* 动画效果 */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.6s ease-out;
}