/* DDKK 文章侧边栏卡片样式 - 基于 Ant Design 5.x 设计规范 */
/* 扁平化卡片列表模板，用于工具破解等场景 */

.ddkk-sidebar-article-card {
  background: #ffffff;
  border: none;
  padding: 0;
  position: relative;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

/* 头部区域：固定在侧边栏滚动容器顶部 */
.ddkk-sidebar-article-card-header {
  padding: 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  position: sticky;
  top: 0;
  z-index: 2;
  background: #ffffff;
  flex-shrink: 0;
}

.ddkk-sidebar-article-card-nav {
  flex: 1 1 auto;
  overflow-y: auto; /* 只在需要时显示滚动条 */
  overflow-x: hidden;
  min-height: 0;
  height: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.2) transparent; /* Firefox 滚动条颜色：滑块、轨道（透明） */
  /* 确保滚动容器正确捕获滚动事件，防止滚动穿透 */
  position: relative;
  z-index: 1;
  touch-action: pan-y; /* 允许垂直滚动，防止滚动穿透 */
}

/* 滚动条样式 - Webkit 浏览器 */
.ddkk-sidebar-article-card-nav::-webkit-scrollbar {
  width: 8px;
}

.ddkk-sidebar-article-card-nav::-webkit-scrollbar-track {
  background: transparent; /* 轨道背景透明，不显示背景 */
  border-radius: 4px;
}

.ddkk-sidebar-article-card-nav::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
  min-height: 40px;
}

.ddkk-sidebar-article-card-nav::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.3);
}

.ddkk-sidebar-article-card-list {
  list-style: none;
  padding: 4px;
  margin: 0;
}

/* 分组标题 */
.ddkk-sidebar-article-card-group-title {
  padding: 10px 10px;
  margin: 5px 0 5px 0;
  font-size: 20px;
  font-weight: 700;
  color: #ffffff;
  background: #000000;
  border-radius: 4px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  position: relative;
  display: flex;
  align-items: center;
  transition: all 0.2s ease;
}

.ddkk-sidebar-article-card-group-title:first-child {
  margin-top: 0;
}

.ddkk-sidebar-article-card-group-title:hover {
  background: #000000;
}

.ddkk-sidebar-article-card-group-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  color: #ffffff;
  margin-right: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ddkk-sidebar-article-card-group-title span {
  display: block;
  line-height: 1.4;
  letter-spacing: -0.01em;
}

/* 标题样式 */
.ddkk-sidebar-article-card-title {
  display: block;
  font-size: 20px;
  font-weight: 700;
  color: rgba(0, 0, 0, 0.88);
  text-decoration: none;
  margin-bottom: 8px;
  transition: color 0.2s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: keep-all;
  word-wrap: normal;
}

.ddkk-sidebar-article-card-title:hover {
  color: #1677ff;
}

.ddkk-sidebar-article-card-title-active {
  color: #1677ff !important;
  font-weight: 600;
}

.ddkk-sidebar-article-card-subtitle {
  display: block;
  font-size: 14px;
  color: rgba(0, 0, 0, 0.88);
  text-decoration: none;
  transition: color 0.2s;
}

.ddkk-sidebar-article-card-subtitle:hover {
  color: #1677ff;
}

.ddkk-sidebar-article-card-subtitle-active {
  color: #1677ff !important;
  font-weight: 600;
}

/* 卡片项容器 */
.ddkk-sidebar-article-card-item {
  margin: 0 0 4px 0;
  border-radius: 6px;
  overflow: hidden;
  transition: transform 0.2s;
}

.ddkk-sidebar-article-card-item:hover {
  background: #e6f4ff;
}

.ddkk-sidebar-article-card-item:hover .ddkk-sidebar-article-card-link {
  background: #e6f4ff;
}

.ddkk-sidebar-article-card-item:last-child {
  margin-bottom: 0;
}

/* 卡片链接 */
.ddkk-sidebar-article-card-link {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  background: #fafafa;
  border: none;
  border-radius: 6px;
  text-decoration: none;
  color: rgba(0, 0, 0, 0.88);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  gap: 12px;
}

.ddkk-sidebar-article-card-link:hover {
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(22, 119, 255, 0.15);
  transform: translateX(2px);
}

.ddkk-sidebar-article-card-link:hover .ddkk-sidebar-article-card-icon {
  color: #1677ff;
}

.ddkk-sidebar-article-card-link:hover .ddkk-sidebar-article-card-arrow {
  color: #1677ff;
  transform: translateX(2px);
}

/* 激活状态 */
.ddkk-sidebar-article-card-link-active {
  background: #e6f4ff;
  box-shadow: 0 2px 8px rgba(22, 119, 255, 0.15);
}

.ddkk-sidebar-article-card-link-active .ddkk-sidebar-article-card-icon {
  color: #1677ff;
}

.ddkk-sidebar-article-card-link-active .ddkk-sidebar-article-card-text {
  color: #1677ff;
  font-weight: 600;
}

.ddkk-sidebar-article-card-link-active .ddkk-sidebar-article-card-arrow {
  color: #1677ff;
}

/* 左侧图标 */
.ddkk-sidebar-article-card-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  color: rgba(0, 0, 0, 0.45);
  transition: color 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ddkk-sidebar-article-card-icon svg {
  width: 100%;
  height: 100%;
}

/* 中间标题文字 */
.ddkk-sidebar-article-card-text {
  flex: 1;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.4;
  color: rgba(0, 0, 0, 0.88);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 0.3s;
}

/* 右侧箭头 */
.ddkk-sidebar-article-card-arrow {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  color: rgba(0, 0, 0, 0.25);
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ddkk-sidebar-article-card-arrow svg {
  width: 100%;
  height: 100%;
}

/* 响应式设计 - 移动端适配 */
@media (max-width: 767.98px) {
  .ddkk-sidebar-article-card-header {
    padding: 8px 8px 8px 3px;
  }

  .ddkk-sidebar-article-card-list {
    padding: 4px 3px;
  }

  .ddkk-sidebar-article-card-link {
    padding: 6px 10px;
    gap: 10px;
  }

  .ddkk-sidebar-article-card-text {
    font-size: 13px;
  }
}


