/* 技术文章列表页样式 */
body {
  background-color: #f2f3f5;
}

/* 隐藏侧边栏切换按钮（列表页已有分类导航，不需要抽屉） */
header nav.ddkk-navbar .sidebar-toggler {
  display: none !important;
}

.tech-article-container {
  display: grid;
  grid-template-columns: 200px 1fr 300px;
  gap: 24px;
  max-width: 1200px; /* 默认最大宽度（适用于屏幕宽度小于 1366px） */
  margin: 15px auto 0; /* 导航栏高度 */
  padding: 24px;
  /* 确保容器有足够的最小高度，让 sticky 定位正常工作 */
  min-height: calc(100vh - 15px); /* 至少占满视口高度减去顶部边距 */
}

/* 左侧导航 - 白色卡片容器 */
.tech-sidebar {
  position: sticky;
  top: 65px; /* 导航栏50px + 15px间距，确保滚动时距离导航栏底部15px */
  height: fit-content;
  background: #ffffff !important; /* 白色背景 */
  border-radius: 4px; /* 小圆角 */
  overflow: hidden; /* 确保内容不超出圆角 */
}

.tech-sidebar .sidebar-card {
  padding: 10px;
  background: #ffffff !important;
  border-radius: 0; /* 移除内部圆角，让外层圆角生效 */
  box-shadow: none; /* 移除阴影，使用外层边框 */
  border: none; /* 移除内部边框 */
}

.tech-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tech-nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 4px;
  color: #333;
  text-decoration: none;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.tech-nav-item:hover {
  background: #f5f5f5;
  color: #1890ff;
}

.tech-nav-item.active {
  background: #e6f7ff;
  color: #1890ff;
  font-weight: 500;
}

.nav-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-icon svg {
  width: 100%;
  height: 100%;
}

/* 中间内容区 */
.tech-main {
  min-height: 600px;
  background: #ffffff !important; /* 白色背景 */
  border-radius: 4px; /* 小圆角 */
  overflow: hidden; /* 确保内容不超出圆角 */
}

/* 大卡片容器 */
.tech-content-card {
  background: #ffffff !important;
  border-radius: 0; /* 移除内部圆角，让外层圆角生效 */
  box-shadow: none; /* 移除阴影，使用外层边框 */
  border: none; /* 移除内部边框 */
  overflow: hidden;
  display: flex;
  /* 列表区改为上下布局，更接近推荐流的结构 */
  flex-direction: column;
}


/* 卡片头部 - 面板样式标题栏（横向） */
.tech-card-header {
  padding: 0 20px;
  min-height: 48px;
  border-bottom: 1px solid #f0f0f0;
  background: #FFFFFF;
  display: flex;
  align-items: center;
}

.tech-title {
  font-size: 16px;
  font-weight: 500;
  margin: 0;
  color: #1d2129;
  line-height: 1;
  /* 强制水平方向显示标题文字，避免被其他样式影响成竖排 */
  writing-mode: horizontal-tb;
  text-orientation: mixed;
  letter-spacing: normal;
}

/* 文章列表 - 紧凑样式 */
.article-list {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.article-item {
  padding: 12px 16px;
  border-bottom: 1px solid #f0f0f0;
  transition: background-color 0.2s ease;
  background-color: #ffffff; /* 默认白色背景，与 body 的 #f2f3f5 区分 */
  cursor: pointer; /* 整个块可点击 */
}

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

.article-item:hover {
  background-color: #f7f8fa; /* 悬浮时浅灰色背景，与 body 的 #f2f3f5 区分开 */
}

.article-title {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 6px 0;
  line-height: 1.5;
}

.article-title a {
  color: #000;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

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

.article-description {
  color: #666;
  line-height: 1.6;
  margin: 0 0 6px 0;
  font-size: 14px;
}

/* 元信息行 - 第3行（模仿截图的轻量括号样式） */
.article-meta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
  font-size: 12px;
  color: #86909c;
}

.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-right: 12px;
}

/* 标签容器靠右显示 */
.meta-item:has(.article-tags-inline),
.meta-item:last-child:has(.article-tags-inline) {
  margin-left: auto;
  margin-right: 0;
}

.meta-label {
  color: #c9ccd3;
  font-size: 12px;
}

.busuanzi-value {
  display: inline-block;
  min-width: 1.5em;
}

.article-tags-inline {
  display: inline-flex;
  gap: 4px;
  flex-wrap: wrap;
}

.tag {
  padding: 2px 8px;
  background: #f7f8fa;
  border-radius: 0;
  border: 1px solid #e5e6eb;
  font-size: 11px;
  color: #4e5969;
  cursor: default;
  transition: color 0.2s ease;
}

.tag:hover {
  color: #1890ff;
}

/* 加载更多 */
.load-more {
  text-align: center;
  margin: 24px 0;
}

.load-more-btn {
  padding: 8px 24px;
  background: #1890ff;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s;
}

.load-more-btn:hover {
  background: #40a9ff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(24, 144, 255, 0.3);
}

.load-more-btn:disabled {
  background: #d9d9d9;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* 分页 */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin: 24px 0;
}

.pagination.pagination--lazy-hidden {
  display: none;
}

.page-numbers {
  display: flex;
  align-items: center;
  gap: 4px;
}

.page-ellipsis {
  padding: 0 4px;
  color: #bfbfbf;
  user-select: none;
  cursor: default;
}

.page-link {
  padding: 0 8px;
  height: 32px;
  line-height: 32px;
  background: transparent;
  border: none;
  color: #595959;
  text-decoration: none;
  transition: all 0.3s;
  -webkit-tap-highlight-color: transparent;
}

.page-link:hover {
  color: #1890ff;
  background-color: #f0f0f0;
  border-radius: 2px;
}

.page-link-prev,
.page-link-next {
  font-size: 13px;
  color: #bfbfbf; /* 更淡的灰色，与当前页形成明显对比 */
}

.page-link-prev:hover,
.page-link-next:hover {
  color: #1890ff;
  background-color: #f0f0f0;
  border-radius: 2px;
}

.page-number {
  min-width: 32px;
  text-align: center;
  border-radius: 16px;
  color: #595959;
  transition: all 0.3s;
}

.page-number:hover {
  color: #1890ff;
  background-color: #f0f0f0;
}

/* 使用更具体的选择器，确保优先级足够高 */
.page-link.page-number.page-number--active,
.page-number--active {
  color: #1890ff !important; /* 蓝色文字，与普通页码区分 */
  font-weight: 600 !important; /* 加粗，更明显 */
  background-color: transparent !important; /* 无背景色 */
}

/* 当前页悬停时保持蓝色文字 */
.page-number--active:hover {
  color: #40a9ff !important; /* 悬停时稍微亮一点的蓝色 */
  background-color: transparent !important;
}

.page-info {
  color: #8c8c8c;
  font-size: 13px;
  margin-left: 8px;
  white-space: nowrap;
}

/* 右侧边栏 */
.tech-right-sidebar {
  position: sticky;
  top: 65px; /* 导航栏50px + 15px间距，确保滚动时距离导航栏底部15px */
  align-self: flex-start; /* 确保 sticky 定位正确工作 */
  height: auto; /* 根据内容自然撑开高度，不再跟随视口高度压缩 */
  max-height: none; /* 移除对视口高度的限制，避免窗口变矮时强行压缩侧边栏 */
  scrollbar-width: none; /* Firefox: 隐藏滚动条 */
  -ms-overflow-style: none; /* IE/Edge: 隐藏滚动条 */
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: transparent !important; /* 透明背景 */
  border-radius: 0; /* 无圆角 */
  overflow: visible; /* 允许内容正常显示 */
}

/* 右侧边栏内部滚动容器 */
.tech-right-sidebar > * {
  overflow-y: visible; /* 让内容按照自身高度展示，由整页滚动，而不是在卡片内部滚动 */
  scrollbar-width: none; /* Firefox: 隐藏滚动条 */
  -ms-overflow-style: none; /* IE/Edge: 隐藏滚动条 */
}

.tech-right-sidebar > *::-webkit-scrollbar {
  display: none; /* Chrome/Safari: 隐藏滚动条 */
}

/* Chrome/Safari: 隐藏滚动条但保持滚动功能 */
.tech-right-sidebar::-webkit-scrollbar {
  display: none;
}

.sidebar-card {
  padding: 12px;
  background: #ffffff !important;
  border-radius: 4px; /* 恢复圆角，让每个卡片独立 */
  box-shadow: 0 2px 8px rgba(0,0,0,0.06); /* 恢复阴影，区分卡片 */
  border: 1px solid #f0f0f0; /* 恢复边框，区分卡片 */
  margin-bottom: 0;
}

.sidebar-title {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 12px 0;
  color: #000;
}

/* 置顶推荐标题下的分隔线 */
.sidebar-card:has(.top-articles) .sidebar-title {
  border-bottom: 1px solid #f0f0f0;
  padding-bottom: 12px;
  margin-bottom: 12px;
}

.top-articles {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.top-article-item {
  color: #333;
  text-decoration: none;
  font-size: 14px;
  line-height: 1.6;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid #f0f0f0;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}

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

.top-article-item:hover {
  color: #1890ff;
}

.top-article-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  font-size: 16px;
  font-weight: 700;
  flex-shrink: 0;
  color: #ff4757;
}

/* 彩色编号 - 显眼颜色 */
.top-article-item[data-index="1"] .top-article-number {
  color: #ff4757; /* 鲜艳红色 */
}

.top-article-item[data-index="2"] .top-article-number {
  color: #3742fa; /* 鲜艳蓝色 */
}

.top-article-item[data-index="3"] .top-article-number {
  color: #2ed573; /* 鲜艳绿色 */
}

.top-article-item[data-index="4"] .top-article-number {
  color: #ffa502; /* 鲜艳橙色 */
}

.top-article-item[data-index="5"] .top-article-number {
  color: #a55eea; /* 鲜艳紫色 */
}

.top-article-item[data-index="6"] .top-article-number {
  color: #00d2d3; /* 鲜艳青色 */
}

.top-article-item[data-index="7"] .top-article-number {
  color: #ff6b9d; /* 鲜艳粉色 */
}

.top-article-item[data-index="8"] .top-article-number {
  color: #feca57; /* 鲜艳黄色 */
}

.top-article-item[data-index="9"] .top-article-number {
  color: #ff6348; /* 珊瑚红 */
}

.top-article-item[data-index="10"] .top-article-number {
  color: #5352ed; /* 深蓝紫色 */
}

/* 精选推荐独立卡片 */
.featured-card {
  padding: 0; /* 移除内边距，让图片和标题直接显示 */
  border-radius: 4px; /* 恢复圆角，让每个卡片独立 */
  box-shadow: 0 2px 8px rgba(0,0,0,0.06); /* 恢复阴影，区分卡片 */
  border: 1px solid #f0f0f0; /* 恢复边框，区分卡片 */
  background: #ffffff !important; /* 确保白色背景 */
}

.featured-card .sidebar-title {
  padding: 12px 12px 8px 12px; /* 标题内边距 */
  margin: 0;
}

.featured-item {
  display: block;
  border-radius: 0; /* 移除圆角 */
  overflow: hidden;
  transition: box-shadow 0.3s ease;
  position: relative;
  will-change: box-shadow;
  -webkit-tap-highlight-color: transparent;
}

.featured-item:hover {
  box-shadow: none; /* 移除悬浮阴影 */
}

.featured-image {
  width: 100%;
  height: auto;
  display: block;
  border: none; /* 移除边框 */
  outline: none; /* 移除轮廓 */
}

/* ==================== 响应式设计 ==================== */
/* 移动端（≤767.98px） */
@media (max-width: 767.98px) {
  body {
    overflow-x: hidden; /* 防止横向滚动 */
  }
  
  .tech-article-container {
    display: flex;
    flex-direction: column;
    grid-template-columns: 1fr;
    width: 100%;
    max-width: 100%;
    padding: 10px;
    padding-top: 53px; /* 增加顶部间距，避免内容太靠近导航栏 */
    margin-top: 0;
    box-sizing: border-box;
  }
  
  .tech-content-card {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  
  .article-item {
    width: 100%;
    box-sizing: border-box;
  }
  
  .tech-sidebar {
    position: static;
    order: 1;
    margin-top: 16px; /* 增加左侧导航与导航栏的间距 */
  }
  
  /* 移动端：缩小侧边栏卡片内边距 */
  .tech-sidebar .sidebar-card {
    padding: 8px;
  }
  
  .tech-nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px;
  }
  
  /* 移动端：点击分类只改变文字颜色，不改变背景 */
  .tech-nav-item {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    font-size: 13px; /* 缩小字体 */
    padding: 6px 10px; /* 缩小内边距 */
    gap: 6px; /* 缩小图标和文字间距 */
  }
  
  /* 移动端：缩小图标 */
  .nav-icon {
    width: 16px;
    height: 16px;
  }
  
  .tech-nav-item:hover,
  .tech-nav-item.active,
  .tech-nav-item:active,
  .tech-nav-item:focus {
    background: transparent !important;
    color: #1890ff;
    outline: none;
    -webkit-tap-highlight-color: transparent;
  }
  
  .tech-main {
    order: 2;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin-top: 0; /* 移动端不显示 margin-top */
  }
  
  .tech-right-sidebar {
    position: static;
    order: 3;
    max-height: none;
    overflow-y: visible;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  
  .tech-content-card {
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  
  .tech-card-header {
    padding: 12px 16px;
    border-right: none;
    border-bottom: 1px solid #f0f0f0;
    width: 100%;
    box-sizing: border-box;
  }
  
  .tech-title {
    writing-mode: horizontal-tb;
    text-orientation: mixed;
    letter-spacing: normal;
  }
  
  .article-item {
    padding: 10px 16px;
    width: 100%;
    box-sizing: border-box;
  }
  
  .article-title,
  .article-description,
  .article-meta-row {
    width: 100%;
    box-sizing: border-box;
  }
  
  /* 移动端：标题不换行，显示省略号 */
  .article-title {
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  /* 移动端：描述显示1行，超出显示省略号 */
  .article-description {
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.5;
  }
  
  /* 移动端：元信息和标签字体缩小 */
  .article-meta-row {
    flex-wrap: wrap;
    gap: 8px;
    font-size: 11px;
  }
  
  .tag {
    font-size: 10px;
    padding: 1px 6px;
  }
}

/* 平板端（768px-1199.98px） */
@media (min-width: 768px) and (max-width: 1199.98px) {
  .tech-article-container {
    display: flex;
    flex-direction: column;
    grid-template-columns: 1fr;
    padding: 16px;
  }
  
  .tech-sidebar {
    position: static;
    order: 1;
  }
  
  .tech-nav {
    flex-direction: row;
    flex-wrap: wrap;
  }
  
  .tech-main {
    order: 2;
    margin-top: 0; /* 平板端不显示 margin-top */
  }
  
  .tech-right-sidebar {
    position: static;
    order: 3;
  }
}

/* 桌面端（≥1200px） */
@media (min-width: 1200px) {
  .tech-main {
    margin-top: 26px; /* 只在桌面端生效 */
  }
}

/* ============= 技术文章列表页主容器宽度响应式适配（PC端） ============= */
/* <1366px：使用默认最大宽度 1200px */

/* 1366px–1499px：最大宽度 1300px */
@media (min-width: 1366px) and (max-width: 1499.98px) {
  .tech-article-container {
    max-width: 1300px;
  }
}

/* 1500px–1599px：最大宽度 1500px */
@media (min-width: 1500px) and (max-width: 1599.98px) {
  .tech-article-container {
    max-width: 1500px;
  }
}

/* 1600px–1699px：最大宽度 1600px */
@media (min-width: 1600px) and (max-width: 1699.98px) {
  .tech-article-container {
    max-width: 1600px;
  }
}

/* 1700px–1919px：最大宽度 1700px */
@media (min-width: 1700px) and (max-width: 1919.98px) {
  .tech-article-container {
    max-width: 1700px;
  }
}

/* 1920px–2559px：最大宽度 1700px */
@media (min-width: 1920px) and (max-width: 2559.98px) {
  .tech-article-container {
    max-width: 1700px;
  }
}

/* ≥2560px：最大宽度 1900px */
@media (min-width: 2560px) {
  .tech-article-container {
    max-width: 1900px;
  }
}

