.post-cover {
  position: relative;
  width: 100%;
  height: 400px;
  overflow: hidden;
  margin-bottom: 20px;
}

.post-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transition: all 0.3s ease-in-out;
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
}

.post-bg:hover {
  transform: scale(1.05);
}

/* 修复首页布局5和7的封面图显示问题 */
.recent-post-item .post_cover {
  position: relative;
  overflow: hidden;
}

/* 确保图片能正确加载 */
img.post-bg {
  z-index: 1 !important;
}

/* 针对布局5优化 */
.recent-post-item .recent-post-info:not(.no-cover) {
  z-index: 10;
}

/* 增加封面图加载错误时的样式 */
img.post-bg[src$="404.jpg"] {
  object-fit: contain;
  background-color: #f7f7f7;
  padding: 20px;
} 