/* ============================================================
   知识干货列表页样式
   ============================================================ */

/* ---------- 页面标题栏 ---------- */
.page-title-bar {
  margin-top: 72px;
  padding: 28px 0 16px;
  background: var(--grad-soft);
}
.page-title-bar h1 {
  font-size: 26px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: 1px;
}

/* ---------- 分类 Tab 栏 ---------- */
.top-tabs-wrap {
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 72px;
  z-index: 90;
}
.top-tabs {
  display: flex;
  gap: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.top-tab {
  display: inline-block;
  padding: 16px 28px;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink-2);
  white-space: nowrap;
  position: relative;
  transition: color .25s;
  text-decoration: none;
}
.top-tab:hover {
  color: var(--primary);
}
.top-tab.active {
  color: var(--primary);
}
.top-tab.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--primary);
}

/* ---------- 列表主体 ---------- */
.know-list-wrap {
  padding: 24px 0 60px;
  background: var(--bg-soft);
  min-height: calc(100vh - 72px);
}
.know-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

/* ---------- 文章卡片 ---------- */
.know-item {
  display: flex;
  align-items: center;
  gap: 16px;
  background: #fff;
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  transition: all .3s ease;
  text-decoration: none;
  color: inherit;
}
.know-item:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.know-item-thumb {
  width: 110px;
  height: 110px;
  flex-shrink: 0;
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-soft);
}
.know-item-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s ease;
}
.know-item:hover .know-item-thumb img {
  transform: scale(1.06);
}

.know-item-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.know-item-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color .25s;
}
.know-item:hover .know-item-title {
  color: var(--primary);
}

.know-item-summary {
  font-size: 14px;
  color: var(--ink-3);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.know-item-date {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--primary-light);
}
.know-item-date svg {
  flex-shrink: 0;
}

.know-item-arrow {
  flex-shrink: 0;
  color: var(--ink-3);
  transition: all .25s;
}
.know-item:hover .know-item-arrow {
  color: var(--primary);
  transform: translateX(3px);
}

/* ---------- 状态层 ---------- */
.know-state {
  padding: 80px 0;
  text-align: center;
  color: var(--ink-3);
  font-size: 15px;
}

/* ---------- Loading ---------- */
.know-loading .spinner {
  width: 32px;
  height: 32px;
  margin: 0 auto 16px;
  border: 3px solid var(--line);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: know-spin .8s linear infinite;
}
@keyframes know-spin {
  to { transform: rotate(360deg); }
}

/* ---------- Empty ---------- */
.know-empty p {
  color: var(--ink-3);
}

/* ---------- Error ---------- */
.know-error p {
  margin-bottom: 16px;
  color: #e74c3c;
}
.btn-sm {
  padding: 8px 20px;
  font-size: 14px;
  border-radius: 20px;
}

/* ---------- 无图占位 ---------- */
.know-item-noimg {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #eaf2fb, #dff8fc);
  color: var(--primary-light);
}

/* ---------- 分页 ---------- */
.pagination-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 36px;
}
.page-total {
  font-size: 13px;
  color: var(--ink-3);
}
.pagination {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  padding: 0;
  margin: 0;
}
/* 注意：只给 <a> 加按钮样式，切勿选择内部 span（会造成嵌套叠框） */
.pagination .page-item a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 36px;
  height: 36px;
  padding: 0 12px;
  border-radius: 9px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 14px;
  text-decoration: none;
  transition: color .2s ease, border-color .2s ease, background .2s ease;
  user-select: none;
}
.pagination .page-item a:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: var(--accent);
}
.pagination .page-item.active a {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 600;
}
/* 禁用态：极简幽灵样式，无框无底色 */
.pagination .page-item.disabled a {
  background: transparent;
  border-color: transparent;
  color: var(--ink-3);
  opacity: .5;
  cursor: default;
  pointer-events: none;
}
.pagination .page-prev a,
.pagination .page-next a {
  padding: 0 14px;
  font-weight: 500;
}
.pagination .page-arrow {
  display: inline-flex;
}
.pagination .page-arrow svg {
  width: 14px;
  height: 14px;
  display: block;
}
.pagination .page-text {
  line-height: 1;
}
.pagination .page-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 36px;
  padding: 0;
  color: var(--ink-3);
  user-select: none;
}

/* ---------- 响应式 ---------- */
@media (max-width: 768px) {
  .know-list {
    grid-template-columns: 1fr;
  }
  .top-tab {
    padding: 14px 18px;
    font-size: 15px;
  }
  .know-item {
    padding: 12px;
    gap: 12px;
  }
  .know-item-thumb {
    width: 90px;
    height: 90px;
  }
  .know-item-title {
    font-size: 16px;
  }
  .know-item-summary {
    -webkit-line-clamp: 1;
  }
  .know-item-arrow {
    display: none;
  }
}