/* /tools 功能列表 — v5 侧栏加宽 + 搜索通栏 */

.tools-page {
  background:
    radial-gradient(ellipse 70% 40% at 10% 0%, rgba(37, 99, 235, 0.1), transparent 55%),
    radial-gradient(ellipse 50% 35% at 90% 5%, rgba(96, 165, 250, 0.1), transparent 50%),
    var(--hf-surface, #f4f7fb);
  min-height: calc(100vh - var(--hf-header-h, 64px));
}

.tools-page-main {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 20px 24px 56px;
}

/* —— 顶栏 —— */
.tools-topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding: 4px 2px 14px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.tools-topbar-title {
  margin: 0;
  font-family: var(--hf-font);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--hf-ink);
  line-height: 1.2;
}

.tools-topbar-desc {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--hf-muted);
}

.tools-topbar-home {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  color: var(--hf-accent-ink);
  background: #fff;
  border: 1px solid rgba(37, 99, 235, 0.22);
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}

.tools-topbar-home:hover {
  color: #fff;
  background: var(--hf-accent);
  border-color: var(--hf-accent);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.22);
}

.tools-hero { display: none; }

/* —— 布局：搜索通栏 + 侧栏/主区 —— */
.tools-catalog.home-index {
  background: transparent;
  min-height: 0;
  padding-top: 0;
}

.tools-catalog-layout {
  display: grid !important;
  grid-template-columns: 220px minmax(0, 1fr);
  grid-template-areas:
    "search search"
    "rail main";
  gap: 20px 28px;
  align-items: start;
  max-width: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

.tools-search {
  grid-area: search;
  margin: 0 !important;
  position: sticky;
  top: calc(var(--hf-header-h) + 8px);
  z-index: 5;
}

.tools-rail {
  grid-area: rail;
}

.tools-main {
  grid-area: main;
  min-width: 0;
}

/* —— 搜索 —— */
.tools-search-field.home-search-field {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
  min-height: 48px;
}

.tools-search .home-search-field:focus-within {
  border-color: var(--hf-accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.tools-search .home-search-input {
  font-size: 14px;
}

.tools-search-tags {
  margin-top: 10px;
  gap: 8px;
}

.tools-search .home-search-tags-label {
  font-size: 12px;
}

.tools-search .home-search-tag {
  border-radius: 999px;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: var(--hf-ink-soft);
  font-size: 12px;
  padding: 5px 12px;
}

.tools-search .home-search-tag.is-active,
.tools-search .home-search-tag:hover {
  background: var(--hf-accent);
  border-color: var(--hf-accent);
  color: #fff;
}

/* —— 左侧分类：纯文字导航 —— */
.tools-rail {
  position: sticky;
  top: calc(var(--hf-header-h) + 72px);
  align-self: start;
  max-height: calc(100vh - var(--hf-header-h) - 88px);
  overflow-y: auto;
  width: auto !important;
  padding: 18px 12px;
  background: #fff;
  border: 1px solid #e8eef5;
  border-radius: 16px;
  box-shadow: none;
}

.tools-rail-label {
  margin: 0 10px 10px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: #94a3b8;
}

.tools-rail-group-title {
  display: none;
}

.tools-rail-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tools-page .tools-rail-item.sidebar-item,
.tools-page .tools-rail-item.menu {
  position: relative;
  display: block;
  align-items: stretch;
  gap: 0;
  padding: 12px 14px;
  margin: 0;
  min-height: 0;
  border-radius: 12px;
  border: none !important;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
  transition: background 0.18s ease;
}

.tools-page .tools-rail-item.sidebar-item::before,
.tools-page .tools-rail-item.menu::before {
  display: none !important;
  content: none !important;
}

.tools-page .tools-rail-item.sidebar-item:hover,
.tools-page .tools-rail-item.menu:hover {
  background: #f8fafc;
  border: none !important;
}

.tools-page .tools-rail-item.sidebar-item.active,
.tools-page .tools-rail-item.menu.active {
  background: #eff6ff;
  border: none !important;
  box-shadow: none;
}

.tools-page .tools-rail-item .sidebar-item-icon-wrap {
  display: none !important;
}

.tools-page .tools-rail-item .sidebar-item-text,
.tools-page .tools-rail-item .content {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.tools-page .tools-rail-item .sidebar-item-title,
.tools-page .tools-rail-item .title {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #334155;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tools-page .tools-rail-item .sidebar-item-desc,
.tools-page .tools-rail-item .sub-title {
  display: block !important;
  font-size: 12px;
  line-height: 1.4;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tools-page .tools-rail-item.active .sidebar-item-title,
.tools-page .tools-rail-item.active .title {
  color: #2563eb !important;
  font-weight: 700;
}

.tools-page .tools-rail-item.active .sidebar-item-desc,
.tools-page .tools-rail-item.active .sub-title {
  color: #64748b !important;
}

/* —— 移动分类芯片 —— */
.tools-chip-row {
  display: none;
  gap: 8px;
  overflow-x: auto;
  padding: 0 0 12px;
  -webkit-overflow-scrolling: touch;
}

.tools-chip {
  flex: 0 0 auto;
  appearance: none;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: var(--hf-ink-soft);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.tools-chip.active {
  background: var(--hf-accent);
  border-color: var(--hf-accent);
  color: #fff;
}

/* —— 分区与卡片 —— */
.tools-section {
  margin-bottom: 24px;
}

.tools-section-head {
  margin-bottom: 12px;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.tools-section-title {
  margin: 0;
}

.tools-section-title .title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.tools-section-title .title img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.tools-section-title .title i {
  font-style: normal;
  font-family: var(--hf-font);
  font-size: 15px;
  font-weight: 700;
  color: var(--hf-ink);
  letter-spacing: -0.01em;
}

.tools-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.tools-page .tools-card {
  display: flex !important;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  padding: 0;
  overflow: hidden;
  background: #fff;
  border: 1px solid #e6edf5;
  border-radius: 16px;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.04);
  transition: border-color 0.2s var(--hf-ease), transform 0.2s var(--hf-ease), box-shadow 0.2s var(--hf-ease);
}

.tools-page .tools-card:hover {
  border-color: rgba(37, 99, 235, 0.35);
  transform: translateY(-3px);
  box-shadow: 0 16px 36px rgba(37, 99, 235, 0.12);
  color: inherit;
}

.tools-page .tools-card-icon {
  flex: none;
  width: 100%;
  height: auto;
  margin: 0;
  aspect-ratio: 16 / 9;
  display: block;
  border-radius: 0;
  outline: none;
  background: #e8f0fb;
  overflow: hidden;
  line-height: 0;
}

.tools-page .tools-card-icon img {
  width: 100%;
  height: 100%;
  max-width: none;
  display: block;
  object-fit: cover;
  border-radius: 0;
  transition: transform 0.35s var(--hf-ease);
}

.tools-page .tools-card:hover .tools-card-icon img {
  transform: scale(1.04);
}

.tools-card-body {
  flex: none;
  min-width: 0;
  padding: 12px 14px 14px;
}

.tools-card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--hf-ink);
  line-height: 1.35;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tools-card-desc {
  font-size: 13px;
  color: var(--hf-muted);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 38px;
}

.tools-card-go {
  display: none;
}

.tools-card .tool-card-badge {
  display: none;
}

.tools-page .homeheader {
  display: none;
}

@media (max-width: 1100px) {
  .tools-catalog-layout {
    grid-template-columns: 200px minmax(0, 1fr);
    gap: 16px 20px;
  }

  .tools-page-main {
    padding: 16px 16px 48px;
  }
}

@media (max-width: 992px) {
  .tools-page-main {
    padding: 14px 14px 48px;
  }

  .tools-topbar {
    align-items: center;
    margin-bottom: 12px;
  }

  .tools-topbar-title {
    font-size: 18px;
  }

  .tools-catalog-layout {
    display: flex !important;
    flex-direction: column;
    gap: 14px;
  }

  .tools-rail {
    display: none !important;
  }

  .tools-chip-row {
    display: flex;
  }

  .tools-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
  }

  .tools-search {
    position: static;
  }
}
