/* AI池子六频道共享框架：频道只替换内容，几何规格由本文件唯一控制。 */
:root {
  --aichizi-channel-width: 1216px;
  --aichizi-channel-sidebar: 240px;
  --aichizi-channel-gap: 20px;
  --aichizi-channel-pill-height: 30px;
  --aichizi-channel-page-size: 34px;
}

.aichizi-channel-ticker {
  box-sizing: border-box !important;
  min-height: 36px !important;
  height: 36px !important;
}

.aichizi-channel-layout {
  box-sizing: border-box !important;
  display: flex !important;
  align-items: flex-start !important;
  gap: var(--aichizi-channel-gap) !important;
  width: min(var(--aichizi-channel-width), calc(100% - 64px)) !important;
  max-width: none !important;
  margin: 24px auto 0 !important;
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}

/* 静态频道的布局节点已经在 1216px 容器内，不再二次扣减边距。 */
.aichizi-channel-layout--nested {
  width: 100% !important;
  margin: 0 !important;
}

.aichizi-channel-sidebar {
  box-sizing: border-box !important;
  width: var(--aichizi-channel-sidebar) !important;
  min-width: var(--aichizi-channel-sidebar) !important;
  max-width: var(--aichizi-channel-sidebar) !important;
  flex: 0 0 var(--aichizi-channel-sidebar) !important;
}

.aichizi-channel-content {
  box-sizing: border-box !important;
  min-width: 0 !important;
  width: auto !important;
  flex: 1 1 0% !important;
}

.aichizi-channel-sidebar-heading {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  min-height: 28px;
  font-size: 18px !important;
  font-weight: 700 !important;
  line-height: 28px !important;
}

.aichizi-channel-sidebar-heading h1,
.aichizi-channel-sidebar-heading h2,
.aichizi-channel-sidebar-heading strong {
  margin: 0 !important;
  font-size: 18px !important;
  font-weight: 700 !important;
  line-height: 28px !important;
}

.aichizi-channel-sidebar-icon {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 28px !important;
  height: 28px !important;
  min-width: 28px !important;
  flex: 0 0 28px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 8px !important;
  font-size: 20px !important;
  line-height: 28px !important;
  transform: none !important;
}

.aichizi-channel-sidebar-icon > span {
  transform: none !important;
}

.aichizi-channel-sidebar-icon svg {
  display: block;
  width: 21px;
  height: 21px;
}

.aichizi-channel-sidebar-icon--boxed {
  color: #fff;
}

.aichizi-channel-sidebar-icon--ai { background: #2875dd; }
.aichizi-channel-sidebar-icon--skill { background: #7b55cc; }

.aichizi-channel-result-pill {
  box-sizing: border-box !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  min-height: var(--aichizi-channel-pill-height) !important;
  height: var(--aichizi-channel-pill-height) !important;
  padding: 6px 12px !important;
  border-radius: 9999px !important;
  font-size: 12px !important;
  line-height: 16px !important;
  white-space: nowrap;
}

.aichizi-channel-result-pill svg {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
}

.aichizi-channel-results-head {
  display: flex !important;
  align-items: center !important;
  gap: 13px !important;
  min-height: 30px;
}

.aichizi-channel-results-head > :last-child { margin-left: auto; }

/* 两套数据渲染器共用同一组分页几何参数。 */
.aichizi-pagination,
.channel-pager {
  gap: 6px !important;
}

.aichizi-page-button,
.channel-page-button {
  box-sizing: border-box !important;
  min-width: var(--aichizi-channel-page-size) !important;
  width: auto;
  height: var(--aichizi-channel-page-size) !important;
  padding: 0 9px !important;
  border-radius: 9px !important;
  font-size: 12px !important;
  line-height: 1 !important;
}

.aichizi-pagination--bottom,
.channel-pager:not(.channel-pager-top) {
  min-height: 0 !important;
  margin: 28px 0 8px !important;
}

.aichizi-page-summary,
.channel-page-summary {
  margin-top: 3px !important;
  font-size: 11px !important;
  line-height: 16px !important;
}

.aichizi-page-ellipsis,
.channel-page-ellipsis {
  width: 22px !important;
}

.aichizi-pagination--top,
.channel-pager-top {
  min-height: var(--aichizi-channel-page-size) !important;
  height: var(--aichizi-channel-page-size) !important;
  margin: 0 !important;
  flex-wrap: nowrap !important;
  justify-self: end !important;
  width: max-content !important;
}

@media (min-width: 1024px) {
  .aichizi-channel-results-head {
    min-height: 30px !important;
    height: 30px !important;
    margin: 0 0 20px !important;
  }

  .channel-sidebar.aichizi-channel-sidebar,
  .sidebar.aichizi-channel-sidebar {
    padding: 19px !important;
  }
}

.channel-pager-top .channel-page-button {
  min-width: var(--aichizi-channel-page-size) !important;
  height: var(--aichizi-channel-page-size) !important;
}

@media (max-width: 1023px) {
  .aichizi-channel-layout {
    width: calc(100% - 32px) !important;
    margin-top: 20px !important;
  }

  .aichizi-channel-layout--nested {
    width: calc(100vw - 32px) !important;
  }

  .aichizi-channel-sidebar { display: none !important; }

  .aichizi-channel-results-head {
    margin: 0 0 20px !important;
  }
}

@media (max-width: 700px) {
  /* 手机卡片统一：标题固定一行省略，描述最多两行，防止内容撑高卡片。 */
  article.resource-card h3 {
    display: block !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    -webkit-box-orient: initial !important;
    -webkit-line-clamp: unset !important;
  }

  article.resource-card p {
    display: -webkit-box !important;
    overflow: hidden !important;
    -webkit-box-orient: vertical !important;
    -webkit-line-clamp: 2 !important;
  }

  .aichizi-pagination--top,
  .channel-pager-top {
    min-height: 30px !important;
    height: 30px !important;
    gap: 4px !important;
  }

  .aichizi-pagination--top .aichizi-page-button,
  .channel-pager-top .channel-page-button {
    min-width: 30px !important;
    width: 30px !important;
    height: 30px !important;
    padding: 0 !important;
  }

  .channel-pager-top .channel-page-button:not(:first-child):not(:last-of-type),
  .channel-pager-top .channel-page-ellipsis {
    display: none !important;
  }

  .channel-pager-top .channel-page-fraction {
    display: inline-grid !important;
    place-items: center;
  }
}
