/* 主体内容区 */
.container {
  max-width: 1366px;
  margin: 0 auto;
  padding: 40px 0;
}

/* 左右布局：左侧分类导航 + 右侧应用列表 */
.cat-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.cat-side {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 14px;
  padding: 12px;
  position: sticky;
  top: 80px;
}

.cat-side-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cat-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.cat-item:hover {
  background-color: #f7f8fa;
}

.cat-item.active {
  background-color: #f1f5ff;
}

.cat-item.active .cat-item-name {
  color: #312e81;
  font-weight: 600;
}

.cat-item-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  color: #fff;
  font-size: 12px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cat-item-name {
  flex: 1;
  font-size: 14px;
  color: #333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cat-item-count {
  font-size: 12px;
  color: #999;
  white-space: nowrap;
}

.cat-main {
  min-width: 0;
}

/* 页面标题行：主标题 + 搜索（标题样式沿用公共 .hero） */
.hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.hero h1 {
  margin-bottom: 0;
}

/* 应用搜索框 */
.search-box {
  position: relative;
}

.search-box svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #999;
  pointer-events: none;
}

/* 搜索图标可点击 */
.search-box .search-icon {
  pointer-events: auto;
  cursor: pointer;
}

.search-box .search-icon:hover {
  color: #4f46e5;
}

.search-box input {
  width: 260px;
  height: 36px;
  padding: 0 16px 0 34px;
  border: 1px solid #e5e7eb;
  border-radius: 20px;
  background: #fff;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
}

.search-box input:focus {
  border-color: #000;
}

/* 空状态 */
.empty {
  background: #fff;
  border: 1px dashed #e5e7eb;
  border-radius: 12px;
  padding: 60px 20px;
  text-align: center;
  color: #999;
  font-size: 14px;
}

/* ================= 响应式适配 ================= */
@media (max-width: 1400px) {
  .container {
    padding: 30px 20px;
  }
}

@media (max-width: 1024px) {
  .cat-layout {
    grid-template-columns: 200px minmax(0, 1fr);
    gap: 20px;
  }

  .cat-item {
    padding: 9px 10px;
  }
}

/* 窄屏下分类侧栏转为横向滚动条，避免挤压列表 */
@media (max-width: 900px) {
  .cat-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }

  .cat-side {
    position: static;
    min-width: 0;
    max-width: 100%;
    padding: 10px;
  }

  .cat-side-list {
    width: 100%;
    flex-direction: row;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    padding-bottom: 4px;
  }

  .cat-item {
    flex-shrink: 0;
    padding: 8px 12px;
    border: 1px solid #eee;
  }

  .cat-item-count {
    display: none;
  }

  .cat-item-icon {
    width: 24px;
    height: 24px;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 20px 16px;
  }

  .hero {
    align-items: flex-start;
  }

  .search-box {
    width: 100%;
  }

  .search-box input {
    width: 100%;
  }
}

/* 游标分页：滚动加载提示 */
.load-more {
  text-align: center;
  padding: 24px 0;
}

.load-more-tip {
  font-size: 13px;
  color: #9ca3af;
}