/* 分类头部 - 扁平简洁风格 */
.category-header {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  background: var(--card-bg, #fff);
  border-radius: var(--radius, 10px);
  border: 1px solid var(--border, #e8e8ec);
  margin-bottom: 16px;
  transition: all 0.3s;
}

@media (max-width: 768px) {
  .category-header {
    padding: 14px 16px;
  }
}

.category-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.category-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 15px;
  background: #6366f1;
  font-weight: 600;
  flex-shrink: 0;
}

.category-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary, #1a1a2e);
  margin-bottom: 1px;
  letter-spacing: -0.01em;
}

.category-desc {
  font-size: 12px;
  color: var(--text-secondary, #888);
  max-width: 45em;
  word-break: break-all;
  line-height: 1.5;
}

/* 深色模式 */
[data-theme="dark"] .category-icon {
  background: #818cf8;
}

[data-theme="dark"] .category-title {
  color: #e2e2f0;
}

[data-theme="dark"] .category-desc {
  color: #8888a0;
}

/* 筛选栏 */
.filter-bar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px 16px;
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 16px;
  transition: all 0.2s;
}

.filter-tabs,
.filter-tags {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-right: 4px;
}

.filter-tab {
  padding: 6px 14px;
  font-size: 13px;
  color: var(--text-secondary);
  background: var(--bg);
  border-radius: 16px;
  text-decoration: none;
  transition: all 0.2s;
}

.filter-tab:hover,
.filter-tab.active {
  color: #fff;
  background: var(--primary);
}

.filter-tag {
  padding: 4px 12px;
  font-size: 12px;
  color: var(--text-secondary);
  background: var(--bg);
  border-radius: 12px;
  text-decoration: none;
  transition: all 0.2s;
}

.filter-tag:hover,
.filter-tag.active {
  color: var(--primary);
  background: rgba(99,102,241,0.1);
}

/* 工具卡片列表 */
.category-tools {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 20px;
}

@media (max-width: 1200px) {
  .category-tools {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .category-tools {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .tool-card.product-card {
    padding: 12px;
  }
  .product-card-name {
    font-size: 13px;
  }
  .product-card-desc {
    font-size: 11px;
    -webkit-line-clamp: 2;
  }
  .category-filter-bar {
    flex-wrap: wrap;
    gap: 8px;
  }
  .category-header {
    padding: 20px;
  }
  .category-title {
    font-size: 14px;
  }
  .category-actions {
    flex-wrap: wrap;
    gap: 8px;
  }
  .pagination {
    gap: 4px;
  }
  .pagination a, .pagination span {
    padding: 6px 10px;
    font-size: 12px;
  }
}

/* ========== 产品卡片 - 品质升级 ========== */
.tool-card.product-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,0.06);
  text-decoration: none;
  padding: 14px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.02);
  position: relative;
  overflow: hidden;
}

/* 卡片顶部微光装饰线 */
.tool-card.product-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

.tool-card.product-card:hover::before {
  opacity: 1;
}

.tool-card.product-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(99,102,241,0.12), 0 4px 10px rgba(0,0,0,0.04);
  border-color: rgba(99,102,241,0.15);
}

[data-theme="dark"] .tool-card.product-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

[data-theme="dark"] .tool-card.product-card:hover {
  box-shadow: 0 8px 25px rgba(0,0,0,0.4);
  border-color: rgba(99,102,241,0.3);
}

/* 卡片顶部：logo+名称+评分 | 徽章 */
.product-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}

.product-card-info {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.product-card-logo {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.product-card-logo.placeholder-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  border-radius: 8px;
  box-shadow: none;
}

.product-card-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-top: 1px;
}

.product-card-name {
  font-size: 14px;
  font-weight: 600;
  color: #1a1a2e;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.4;
  letter-spacing: -0.01em;
}

[data-theme="dark"] .product-card-name {
  color: var(--text);
}

.tool-card.product-card:hover .product-card-name {
  color: var(--primary);
}

/* 评分行 */
.product-card-rating {
  display: flex;
  align-items: center;
  gap: 4px;
  line-height: 1;
}

.product-card-rating .stars {
  font-size: 11px;
  color: #d4d4d8;
  letter-spacing: 1px;
}

.product-card-rating .rating-num {
  font-size: 12px;
  color: #a1a1aa;
  font-weight: 500;
}

.product-card-rating .rating-count {
  font-size: 11px;
  color: #a1a1aa;
}

/* 右上角徽章 - 按类型配色 */
.product-card-badge {
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 500;
  border-radius: 20px;
  flex-shrink: 0;
  line-height: 1.5;
  background: #fef3c7;
  color: #92400e;
  letter-spacing: 0.02em;
}

[data-theme="dark"] .product-card-badge {
  background: rgba(251,191,36,0.15);
  color: #fbbf24;
}

/* 描述文字 */
.product-card-desc {
  font-size: 12px;
  color: #6b7280;
  line-height: 1.6;
  margin: 0 0 10px 0;
  letter-spacing: 0.01em;
  word-break: break-all;
}

[data-theme="dark"] .product-card-desc {
  color: rgba(255,255,255,0.55);
}

/* 标签栏 */
.product-card-tags {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.product-tag {
  padding: 2px 6px;
  font-size: 10px;
  color: #6366f1;
  background: rgba(99,102,241,0.08);
  border-radius: 3px;
  line-height: 1.6;
  font-weight: 500;
  letter-spacing: 0.01em;
}

[data-theme="dark"] .product-tag {
  color: #a5b4fc;
  background: rgba(99,102,241,0.15);
}

/* 底部按钮区 */
.product-card-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid #f3f4f6;
}

[data-theme="dark"] .product-card-bottom {
  border-top-color: var(--border);
}

.btn-detail {
  font-size: 12px;
  color: #6b7280;
  font-weight: 400;
  transition: color 0.2s;
}

.btn-detail:hover {
  color: var(--primary);
}

[data-theme="dark"] .btn-detail {
  color: var(--text-secondary);
}

.btn-visit {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 500;
  color: #fff;
  background: #1e1e2e;
  border: none;
  border-radius: 16px;
  line-height: 1.5;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.btn-visit:hover {
  background: var(--primary);
  transform: scale(1.02);
  box-shadow: 0 2px 8px rgba(99,102,241,0.3);
}

[data-theme="dark"] .btn-visit {
  color: #fff;
  background: var(--primary);
}

[data-theme="dark"] .btn-visit:hover {
  background: #818cf8;
  box-shadow: 0 2px 8px rgba(99,102,241,0.4);
}

/* 分页 */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
}

.page-btn {
  min-width: 36px;
  height: 36px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: var(--text-secondary);
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.2s;
}

.page-btn:hover:not(.disabled):not(.active) {
  color: var(--primary);
  border-color: var(--primary);
  background: rgba(99,102,241,0.05);
}

.page-btn.active {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
}

.page-btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.page-ellipsis {
  padding: 0 8px;
  font-size: 13px;
  color: var(--text-secondary);
}
/* 紧凑版分页 - 适配列表分页 [!--show.listpage--] */
.pagination-compact {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px; /* 原版6px，缩小更紧凑 */
  margin-top: 12px; /* 原版16px，减少上边距 */
}
.pagination-compact .page-btn {
  min-width: 30px; /* 原版36px缩小 */
  height: 30px;
  padding: 0 8px;
  font-size: 12px; /* 缩小字号 */
  border-radius: 6px; /* 更小圆角匹配紧凑感 */
}
.pagination-compact .page-ellipsis {
  padding: 0 6px;
  font-size: 12px;
}
/* 移动端适配紧凑分页 */
@media (max-width: 768px) {
  .pagination-compact {
    gap: 3px;
  }
  .pagination-compact .page-btn {
    min-width: 26px;
    height: 26px;
    padding: 0 6px;
    font-size: 11px;
  }
  .pagination-compact .page-ellipsis {
    padding: 0 4px;
  }
}
/* 紧凑分页 适配帝国原生无class分页输出 */
.pagination.pagination-compact {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin: 12px 0;
    font-size: 12px;
}
/* 总记录文字 */
.pagination.pagination-compact a[title="Total record"] {
    color: var(--text-secondary, #888);
    text-decoration: none;
}
/* 当前页码 <b> */
.pagination.pagination-compact > b {
    min-width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary, #6366f1);
    color: #fff;
    border-radius: 6px;
}
/* 普通页码/上一页/下一页/尾页 a标签 */
.pagination.pagination-compact > a:not([title="Total record"]) {
    min-width: 30px;
    height: 30px;
    padding: 0 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary, #888);
    border: 1px solid var(--border, #e8e8ec);
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.2s ease;
}
/* a hover 高亮 */
.pagination.pagination-compact > a:not([title="Total record"]):hover {
    color: var(--primary, #6366f1);
    border-color: var(--primary, #6366f1);
    background: rgba(99, 102, 241, 0.05);
}
/* 清除原生&nbsp;多余空白间距 */
.pagination.pagination-compact &nbsp {
    display: none;
}
/* 移动端缩小适配 */
@media (max-width: 768px) {
    .pagination.pagination-compact {
        gap: 4px;
    }
    .pagination.pagination-compact > b,
    .pagination.pagination-compact > a:not([title="Total record"]) {
        min-width: 26px;
        height: 26px;
        font-size: 11px;
        padding: 0 5px;
    }
}
.pagination.pagination-compact {
    margin: 14px 0 6px;
    flex-wrap: wrap;
}