/**
 * 热门文章区块样式 
 * 自动横向滚动展示
 */

.hot-article-container {
  width: 100%;
  height: 330px;
  margin: 20px auto;
  position: relative;
  overflow: hidden;
  background-color: #f5f5f5;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.hot-article-title {
  font-size: 24px;
  font-weight: bold;
  color: #333;
  margin: 20px 0;
  margin: 10px 0px -30px 0px;
}

.hot-article-wrapper {
  display: flex;
  position: absolute;
  animation: scroll-left 30s linear infinite;
  white-space: nowrap;
  /* 调整初始位置，确保一开始就能看到内容 */
  left: 0;
}

.hot-article-item {
  min-width: 140px;
  margin: 10px;
  padding: 10px;
  text-align: center;
  background-color: white;
  border-radius: 6px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  display: inline-block;
  position: relative; /* 添加相对定位用于海报上的评分 */
}

.hot-article-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.article-poster {
  width: 190px;
  height: 280px;
  object-fit: cover;
  border-radius: 4px;
}

.article-rating {
  width: 32px;
  height: 32px;
  background-color: #032541;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 12px;
  font-weight: bold;
  position: absolute;
  top: 15px;
  right: 15px;
  z-index: 2;
}

.article-rating[data-score="high"] {
  background: conic-gradient(#21d07a 0% var(--rating-percent, 0), #081c22 var(--rating-percent, 0) 100%);
}

.article-rating[data-score="medium"] {
  background: conic-gradient(#d2d531 0% var(--rating-percent, 0), #081c22 var(--rating-percent, 0) 100%);  
}

.article-rating[data-score="low"] {
  background: conic-gradient(#db2360 0% var(--rating-percent, 0), #081c22 var(--rating-percent, 0) 100%);
}

.article-rating::after {
  content: '';
  position: absolute;
  top: 4px;
  left: 4px;
  width: calc(100% - 8px);
  height: calc(100% - 8px);
  background-color: #081c22;
  border-radius: 50%;
  z-index: 0;
}

.article-rating span {
  position: relative;
  z-index: 1;
}

@keyframes scroll-left {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%); /* 调整为只滚动一半的内容，然后循环 */
  }
}

/* 响应式布局 */
@media screen and (max-width: 1024px) {
  .hot-article-container {
    width: 90%;
  }
}

@media screen and (max-width: 768px) {
  .hot-article-container {
    height: 180px;
  }
  
  .article-poster {
    width: 100px;
    height: 100px;
  }
}

@media screen and (max-width: 480px) {
  .hot-article-container {
    height: 160px;
  }
  
  .hot-article-item {
    min-width: 120px;
  }
  
  .article-poster {
    width: 80px;
    height: 80px;
  }
  
  .article-rating {
    width: 28px;
    height: 28px;
    font-size: 10px;
    top: 15px;
    right: 15px;
  }
}

/* 如果用户暂停滚动的交互效果 */
.hot-article-container:hover .hot-article-wrapper {
  animation-play-state: paused;
}