/* css/home-categories.css - 首页分类导航主体（按一级分类分区块） */

.home-categories {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 16px;
}

.home-categories-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.home-categories-title::before {
  content: '';
  width: 4px;
  height: 22px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--primary), var(--secondary));
}

.hc-section {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 20px;
  margin-bottom: 20px;
  transition: all 0.3s;
}

.hc-section:hover {
  box-shadow: var(--shadow-md);
}

.hc-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.hc-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hc-section-icon {
  font-size: 24px;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(255,107,53,0.08), rgba(124,58,237,0.08));
  display: flex;
  align-items: center;
  justify-content: center;
}

.hc-section-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--dark);
}

.hc-section-count {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  background: rgba(0,0,0,0.04);
  padding: 3px 10px;
  border-radius: 999px;
}

.hc-section-more {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  white-space: nowrap;
}

.hc-section-more:hover { text-decoration: underline; }

.hc-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.hc-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  background: #f8f7fb;
  border: 1px solid transparent;
  color: #475569;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.hc-tab:hover {
  background: rgba(255,107,53,0.06);
  color: var(--primary);
}

.hc-tab.active {
  background: linear-gradient(135deg, var(--primary), #E85A2A);
  color: #fff;
  box-shadow: 0 4px 12px rgba(255,107,53,0.25);
}

.hc-tab-icon { font-size: 15px; }
.hc-tab-count {
  font-size: 11px;
  font-weight: 500;
  color: #94a3b8;
  background: rgba(0,0,0,0.04);
  padding: 1px 7px;
  border-radius: 999px;
}

.hc-tab.active .hc-tab-count {
  color: rgba(255,255,255,0.85);
  background: rgba(255,255,255,0.2);
}

.hc-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

@media (min-width: 640px) {
  .hc-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1024px) {
  .hc-grid { grid-template-columns: repeat(4, 1fr); }
}

.hc-tool-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid #f0eff4;
  text-decoration: none;
  transition: all 0.2s;
  /* grid item 默认 min-width:auto，长工具名会把 1fr 轨道撑破导致移动端横向溢出 */
  min-width: 0;
}

.hc-tool-card:hover {
  border-color: rgba(255,107,53,0.25);
  box-shadow: 0 8px 20px rgba(16,24,40,0.06);
  transform: translateY(-2px);
}

.hc-tool-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.hc-tool-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hc-tool-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hc-tool-desc {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-width: 0;
  overflow-wrap: anywhere;
}

.hc-empty {
  padding: 40px 0;
  text-align: center;
  color: #94a3b8;
  font-size: 14px;
}

@media (min-width: 768px) {
  .home-categories { padding: 64px 32px; }
  .hc-section { padding: 28px; }
  .home-categories-title { font-size: 24px; }
  .hc-section-name { font-size: 20px; }
}

/* 暗色模式 */
body.dark .home-categories-title { color: var(--text); }
body.dark .hc-section { background: var(--card); border-color: #2a2a42; }
body.dark .hc-section-icon { background: linear-gradient(135deg, rgba(255,107,53,0.12), rgba(124,58,237,0.1)); }
body.dark .hc-section-name { color: var(--text); }
body.dark .hc-section-count { color: #94a3b8; background: rgba(255,255,255,0.06); }
body.dark .hc-tab { background: #252540; color: #94a3b8; }
body.dark .hc-tab:hover { background: rgba(255,107,53,0.1); color: #ff9a6c; }
body.dark .hc-tab.active { background: linear-gradient(135deg, var(--primary), #E85A2A); color: #fff; }
body.dark .hc-tab.active .hc-tab-count { color: rgba(255,255,255,0.85); background: rgba(255,255,255,0.15); }
body.dark .hc-tool-card { background: var(--card); border-color: #2a2a42; }
body.dark .hc-tool-card:hover { border-color: rgba(255,107,53,0.3); }
body.dark .hc-tool-name { color: var(--text); }
body.dark .hc-tool-desc { color: #94a3b8; }
