/* Tools hub / category pages (v3.0: 品牌色对齐、柔和阴影、焦点环) */
.tools-cat-hero {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--gray-200, #e5e7eb);
}

.tools-cat-hero-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.35rem;
  flex-shrink: 0;
  box-shadow: var(--shadow-md, 0 8px 20px rgba(15, 23, 42, 0.12));
}

.tools-module-pill.is-active {
  border-color: var(--brand-indigo, #1d4ed8);
  color: var(--brand-indigo, #1d4ed8);
  background: rgba(29, 78, 216, 0.08);
}

.tools-group .letter-space {
  letter-spacing: 0.06em;
}

.tools-category-card {
  display: block;
  height: 100%;
  padding: 1.75rem 1.5rem;
  border-radius: 16px;
  border: 1px solid var(--gray-200, #e5e7eb);
  background: #fff;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  position: relative;
  overflow: hidden;
}

.tools-category-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md, 0 16px 36px rgba(15, 23, 42, 0.1));
  border-color: rgba(29, 78, 216, 0.35);
  color: inherit;
}

.tools-category-card.is-soon {
  opacity: 0.85;
}

.tools-category-card .cat-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.4rem;
  margin-bottom: 1.1rem;
  box-shadow: var(--shadow-sm, 0 1px 2px rgba(16, 24, 40, 0.05));
}

.tools-category-card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.tools-category-card p {
  color: #64748b;
  font-size: 0.95rem;
  margin-bottom: 1rem;
  line-height: 1.55;
}

.tools-category-card .cat-cta {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--brand-indigo, #1d4ed8);
}

.tools-category-card .cat-badge-soon {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: #e2e8f0;
  color: #475569;
}

/* ---- Mega menu (hover) ---- */
.nav-mega {
  position: static;
}

.app-navbar .container-fluid {
  position: relative;
}

.nav-mega-caret {
  font-size: 0.65rem;
  opacity: 0.7;
  transition: transform 0.2s;
}

.mega-menu {
  position: absolute;
  top: calc(100% + 2px);
  left: 1rem;
  right: 1rem;
  background: #fff;
  border: 1px solid var(--gray-200, #e5e7eb);
  border-radius: 16px;
  box-shadow: var(--shadow-xl, 0 24px 60px rgba(15, 23, 42, 0.16));
  padding: 1.25rem 1.5rem 0.75rem;
  max-height: calc(100vh - 5.5rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
  pointer-events: none;
  z-index: 1040;
}

/* The panel is a DOM descendant, so :hover survives once the cursor is inside it.
   The JS close delay covers the navbar-padding gap in between. */
.nav-mega:hover .mega-menu,
.nav-mega:focus-within .mega-menu,
.nav-mega.is-hover .mega-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.nav-mega:hover .nav-mega-caret,
.nav-mega:focus-within .nav-mega-caret,
.nav-mega.is-hover .nav-mega-caret {
  transform: rotate(180deg);
}

.mega-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1.15rem;
}

.mega-col {
  min-width: 0;
}

.mega-col-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  color: #0f172a;
  text-decoration: none;
  margin-bottom: 0.75rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--gray-200, #e5e7eb);
}

.mega-col-title:hover {
  color: var(--brand-indigo, #1d4ed8);
}

.mega-col-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.mega-soon-tag {
  font-style: normal;
  font-size: 0.65rem;
  font-weight: 700;
  background: #e2e8f0;
  color: #64748b;
  border-radius: 999px;
  padding: 0.1rem 0.5rem;
  margin-left: 0.35rem;
  vertical-align: middle;
}

.mega-soon-col .mega-col-title {
  color: #64748b;
}

.mega-links {
  list-style: none;
  margin: 0;
  padding: 0;
}

.mega-links li {
  margin-bottom: 0.15rem;
}

.mega-links a {
  display: block;
  padding: 0.35rem 0.5rem;
  border-radius: 8px;
  font-size: 0.875rem;
  color: #475569;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.mega-links a:hover {
  background: var(--gray-100, #f3f4f6);
  color: var(--gray-900, #111827);
}

.mega-link-disabled {
  display: block;
  padding: 0.35rem 0.5rem;
  font-size: 0.875rem;
  color: #94a3b8;
}

.mega-link-disabled em {
  font-style: normal;
  font-size: 0.7rem;
  margin-left: 0.3rem;
  color: #b0b9c6;
}

.mega-col-more {
  display: inline-block;
  margin-top: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--brand-indigo, #1d4ed8);
  text-decoration: none;
}

.mega-col-more:hover {
  text-decoration: underline;
}

.mega-footer {
  margin-top: 1rem;
  padding: 0.75rem 0 0.5rem;
  border-top: 1px solid var(--gray-200, #e5e7eb);
  text-align: center;
}

.mega-footer a {
  font-size: 0.875rem;
  font-weight: 600;
  color: #0f172a;
  text-decoration: none;
}

.mega-footer a:hover {
  color: var(--brand-indigo, #1d4ed8);
}

/* ---- Tools hub filter bar ---- */
.tools-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--gray-200, #e5e7eb);
  border-radius: 999px;
  backdrop-filter: blur(8px);
  margin-bottom: 0.5rem;
}

.sticky-filter {
  position: sticky;
  top: 4.5rem;
  z-index: 30;
}

.tools-filter-pill {
  border: 1px solid var(--gray-200, #e5e7eb);
  background: #fff;
  color: #334155;
  border-radius: 999px;
  padding: 0.45rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  transition: all 0.15s;
}

.tools-filter-pill:hover {
  border-color: rgba(29, 78, 216, 0.45);
  color: var(--brand-indigo, #1d4ed8);
}

.tools-filter-pill:focus-visible {
  outline: none;
  box-shadow: var(--ring, 0 0 0 4px rgba(29, 78, 216, 0.15));
}

.tools-filter-pill.is-active {
  background: var(--brand-indigo, #1d4ed8);
  border-color: var(--brand-indigo, #1d4ed8);
  color: #fff;
}

.tools-hub-cat {
  scroll-margin-top: 8.5rem;
}

/* Mobile: mega menu becomes static list inside collapsed navbar */
@media (max-width: 991.98px) {
  .mega-menu {
    position: static;
    display: none;
    opacity: 1;
    visibility: visible;
    transform: none;
    pointer-events: auto;
    box-shadow: none;
    border: none;
    border-radius: 0;
    padding: 0.5rem 0.25rem 0.25rem;
    border-top: 1px solid var(--gray-200, #e5e7eb);
    margin-top: 0.25rem;
    max-height: none;
    overflow-y: visible;
  }

  .nav-mega:hover .mega-menu,
  .nav-mega.is-hover .mega-menu {
    display: none;
  }

  .nav-mega.is-open .mega-menu {
    display: block;
  }

  .mega-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .sticky-filter {
    top: 3.5rem;
    border-radius: 14px;
  }
}
