/* 公众号文章卡片组件样式 */
.wechat-articles {
  margin: 0; /* 修改：移除原来的垂直偏移，交由 body 布局控制 */
  padding: 20px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center; /* 水平居中卡片容器 */
  gap: 12px; /* 卡片区内部与其它元素的小间距 */
}

.section-title {
  font-size: 24px;
  font-weight: 600;
  color: #333;
  margin-bottom: 25px;
  text-align: center;
  position: relative;
}

.section-title::after {
  content: '';
  display: block;
  width: 50px;
  height: 3px;
  background: #07c160;
  margin: 10px auto 0;
  border-radius: 2px;
}

.articles-container {
  display: flex; /* 修改为flex布局，自动横向排列 */
  flex-direction: row;
  gap: 25px;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  justify-content: center;
  flex-wrap: nowrap; /* 不自动换行，超出部分会溢出或滚动 */
}

/* 仅有一个卡片时，容器宽度收缩到卡片宽度并居中 */
.articles-container:only-child,
.articles-container:has(.article-card:only-child) {
  max-width: 340px; /* 卡片宽度+内边距 */
}

/* ...existing code... */
.article-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  cursor: pointer;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.article-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.card-image-container {
  position: relative;
  width: 100%;
  height: 180px;
  overflow: hidden;
}

.card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.article-card:hover .card-image {
  transform: scale(1.05);
}

.card-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, rgba(0,0,0,0) 70%, rgba(0,0,0,0.1) 100%);
}

.card-content {
  padding: 18px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.card-title {
  font-size: 18px;
  font-weight: 600;
  color: #333;
  line-height: 1.4;
  margin-bottom: 12px;
  display: -webkit-box;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  color: #999;
  font-size: 14px;
}

.card-author {
  display: flex;
  align-items: center;
}

.author-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  margin-right: 8px;
  object-fit: cover;
}

.card-date {
  font-size: 13px;
}

.card-footer {
  padding: 15px 18px;
  background-color: #f9f9f9;
  border-top: 1px solid #f0f0f0;
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: #888;
}

.wechat-source {
  display: flex;
  align-items: center;
}

.wechat-icon {
  margin-right: 5px;
}

.read-more {
  color: #07c160;
  font-weight: 500;
  transition: transform 0.2s ease;
}

.article-card:hover .read-more {
  transform: translateX(3px);
}

/* 响应式设计 */
@media (max-width: 768px) {
  .articles-container {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
  }
  
  .section-title {
    font-size: 22px;
  }
}

@media (max-width: 480px) {
  .articles-container {
    grid-template-columns: 1fr;
  }
  
  .wechat-articles {
    padding: 10px;
  }
}