.sort-controls {
  position: fixed;
  top: 100px;
  height: 28px;
  right: 5%;
  display: flex;
  justify-content: flex-end;
  gap: 16px;
  width: auto;
  padding: 0;
  background: rgba(255,255,255,0);
  z-index: 100;
}
/*
====================================================================
File: homepage.css
Purpose: 首页文章列表/卡片与横向滚动布局样式
Notes:
- 本文件覆盖/补充 core.css 中的通用样式（例如图片宽高）。
- 不调整原有选择器顺序和属性值，避免视觉回归。
Last Updated: 2025-08-30
====================================================================
*/
/* ========== 排序控件 ========== */
.sort-btn {
  width: 60px;
  height: 28px;
  border-radius: 6px;
  font-family: 'HYQiHei', sans-serif;
  font-size: 14px;
  line-height: 1.2;
  letter-spacing: 0.5px;
  border: none;
  cursor: pointer;
  transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

.sort-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.sort-btn.active {
  background-color: #FF5722;
  box-shadow: inset 0 4px 8px rgba(0, 0, 0, 0.15);
}

#newBtn.active {
  background: #fcfeff;
  box-shadow: inset 0 4px 8px rgba(0, 0, 0, 0.15);
}



#newBtn:not(.active) {
  background: #747D8C;
  color: white;
}

#newBtn.active {
  background: #a8010f ;
  color: white ;
}

.sort-btn.active {
  background-color: #747D8C ;
}

#hotBtn.active,
#newBtn.active {
  background: #a8010f;
  color: white;
}

#hotBtn,
#newBtn {
  background: #747D8C;
  color: white;
}



/* ========== 文章列表网格容器（首页） ========== */
#articleContainer.article-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1.5rem;
  padding: 4rem 5% 2rem;
  margin-top: 60px;
  padding-top: 128px;
  overflow: visible; /* 新增 */
}

/* ========== 横向滚动卡片（多处定义按原顺序保留） ========== */
/* 卡片（首页横向滑动）基础尺寸 */
.hp-article-card {
  flex: 0 0 280px !important;
  width: 280px !important;
  min-height: 320px;
  position: relative;
  overflow: hidden;
  margin: 0 10px;
}

@media (max-width: 768px) {
  #articleContainer.article-grid {
    grid-template-columns: 1fr;
    padding: 3rem 1rem 1rem;
    margin-top: 40px;
    padding-top: 110px;
  }
}

#homeArticles .article-item-wrapper {
  display: flex ;
  flex-wrap: nowrap ;
  grid-template-columns: none ;
  gap: 0 ;
}

@media (max-width: 768px) {
  #homeArticles {
    padding: 20px ;
    scrollbar-width: none;
  }
  #homeArticles::-webkit-scrollbar {
    display: none;
  }
  .hp-article-card {
    flex: 0 0 90vw;
    margin: 0 10px;
    min-height: 420px;
  }
  .hp-cover-image {
    height: 100%;
}
  .hp-content-wrapper {
    padding: 15px;
    position: relative ;
  }
  .home-article-card {
    min-height: 420px;
  }
}
  
  .hp-cover-image {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
    top: 0;
    left: 0;
}


.home-articles {
  display: flex ;
  flex-wrap: nowrap ;
  overflow-x: auto ;
}

/* 去重：统一在上方定义基础尺寸，此块冗余删除（保持更小的最小宽度行为在媒体查询里控制） */

.hp-cover-image {
  width: 100% ;
  height: 100% ;
  object-fit: cover ;
}

/* 覆盖 core.css 全局图片样式，确保卡片内图像铺满 */
.hp-article-card img {
  width: 100% !important;
  max-width: 100% !important;
}

.hp-content-wrapper {
  padding: 16px;
}

.hp-article-title {
  font-family: 'HYQiHei', sans-serif;
  font-size: 18px;
  color: #FFFAF0 !important;
  margin-bottom: 8px;
  text-decoration: none !important;
  text-shadow: 0 1px 3px rgba(0,0,0,0.7);
}

.hp-article-excerpt {
  font-size: 14px;
  color: #FFFAF0 !important;
  line-height: 1.6;
  margin-bottom: 12px;
  text-decoration: none !important;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

@media (max-width: 768px) {
  .hp-article-title {
    font-size: 16px;
    color: #FFFAF0 !important;
    text-decoration: none !important;
  }
  .hp-article-excerpt {
    font-size: 13px;
    color: #FFFAF0 !important;
    text-decoration: none !important;
  }
}

.hp-meta-info {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: #999;
}

/* 响应式调整：小屏单列与滚动优化 */
/* 卡片交互与动效 */
.hp-article-card {
  border-radius: 12px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

@media (max-width: 768px) {
  /* 移动端：占用视口宽度，保证可滑动体验 */
  .hp-article-card { flex: 0 0 85vw; min-height: 270px; margin: 0 10px; }
}

.home-article-card {
  flex: 0 0 220px;
  width: 220px;
  min-height: 320px;
  margin-right: 10px;
}

@media (max-width: 768px) {
  .home-article-card {
    flex: 0 0 80vw;
    min-height: 420px;
    margin: 0 5px;
  }
}

#articleContainer.article-grid {
  gap: 1rem;
}
  
  .hp-cover-image {
    height: 100%;
}

.hp-content-wrapper {
  position: relative;
  background: linear-gradient(180deg, rgba(0,0,0,0.6) 0%, transparent 100%);
  padding: 20px;
  /* 合并后的样式属性 */
}

/* 移动端优化 */
@media (max-width: 768px) {
  .hp-content-wrapper {
    padding: 15px;
  }
  .hp-article-title {
    font-size: 16px;
  }
}

/* 去重：下方移动端尺寸已调整，此块删除避免冲突 */

.hp-content-wrapper {
  position: relative;
  z-index: 2;
  background: linear-gradient(180deg, rgba(0,0,0,0.6) 0%, transparent 100%);
  color: white;
  padding: 20px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  text-decoration: none !important;
}

.hp-content-wrapper a {
  text-decoration: none !important;
}

@media (max-width: 1200px) {
  #homeArticles .article-grid-container {
    grid-template-columns: none ;
    justify-content: flex-start;
  }
}

@media (max-width: 768px) {
  #homeArticles.article-grid-container {
    flex-direction: row ;
    padding: 20px ;
    overflow-x: auto ;
    display: flex ;
  }
  #homeArticles .home-card {
    width: 280px ;
    margin: 0 15px ;
    min-height: 420px ;
  }
}

.home-articles {
  display: flex ;
  flex-wrap: nowrap ;
  overflow-x: auto ;
  padding: 20px 5% ;
}

.home-article-card {
  flex: 0 0 220px !important;
  width: 220px !important;
  min-height: 320px ;
  margin-right: 20px ;
}

@media (max-width: 768px) {
  #homeArticles .home-articles {
    padding: 20px ;
    overflow-x: auto ;
  }
  .home-article-card {
    min-height: 420px ;
  }
}



#homeArticles .article-item-wrapper {
  display: flex ;
  flex-wrap: nowrap ;
  grid-template-columns: none ;
}

@media (max-width: 768px) {
  #homeArticles {
    grid-template-columns: none ;
    display: flex ;
    flex-wrap: nowrap ;
  }
  
  .hp-article-card img {
    width: 100%;
    height: inherit;
    min-height: 100%;
    position: static;
    object-fit: cover;
  }
}

/* 图片容器全局样式 */
.hp-article-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  top: 0;
  left: 0;
}

/* 去重：上方已定义过 transition */

.hp-article-card:hover {
  transform: translateY(-5px) scale(1.03);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
}

/* 去重：大屏 transition 与基础一致 */

/* 列表页样式（.articles-modern）与辅助组件已拆分至 static/css/articles.css，避免重复 */
