﻿/* ============================================
   Mega Menu - 超级菜单（AI 工具等）
   ============================================ */
.nav-item-wrap {
  position: relative;
}

/* 悬停连通区域：避免鼠标在 nav-item 与菜单间移动时关闭 */
.nav-item-wrap.has-mega::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 18px;
  z-index: 999;
  pointer-events: auto;
  display: none;
}

.nav-item-wrap.has-mega:hover::after,
.nav-item-wrap.has-mega:focus-within::after {
  display: block;
}

/* nav-item 悬停时小箭头翻转 */
.nav-item-wrap.has-mega:hover > .nav-item svg,
.nav-item-wrap.has-mega:focus-within > .nav-item svg {
  transform: rotate(180deg);
}
.nav-item-wrap.has-mega > .nav-item svg {
  transition: transform 0.25s ease;
}

/* ---------- 菜单容器 ---------- */
.mega-menu {
  position: absolute;
  top: calc(100% + 14px);
  left: 50%;
  transform: translateX(-50%) translateY(-6px) scale(0.985);
  width: max-content !important;
  max-width: calc(100vw - 32px);
  padding: 0;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-radius: 16px;
  box-shadow:
    0 0 0 1px rgba(15, 23, 42, 0.06),
    0 24px 60px -16px rgba(15, 23, 42, 0.22),
    0 8px 20px -8px rgba(15, 23, 42, 0.1);
  opacity: 0;
  visibility: hidden;
  transform-origin: top center;
  transition:
    opacity 0.22s ease,
    transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0s linear 0.22s;
  z-index: 1100;
  overflow: hidden;
}

.nav-item-wrap.has-mega:hover .mega-menu,
.nav-item-wrap.has-mega:focus-within .mega-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0) scale(1);
  transition:
    opacity 0.22s ease,
    transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0s linear 0s;
}

/* 悬停连通区域 */
.nav-item-wrap.has-mega::after {
  height: 16px;
}

/* 顶部彩色装饰条 */
.mega-menu::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, #096ddd, #49c9e9, #3b82f6);
  opacity: 0.85;
}

.mega-menu__inner {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 20px 20px 16px;
}

.mega-col {
  min-width: 130px;
}

.mega-col + .mega-col {
  padding-left: 8px;
  border-left: 1px solid rgba(15, 23, 42, 0.05);
}

/* ---------- 分类列 ---------- */
.mega-col__title {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px 10px;
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  margin-bottom: 8px;
}

.mega-col__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.6);
}

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

.mega-list li + li {
  margin-top: 2px;
}

.mega-list a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  transition: background 0.2s ease, transform 0.2s ease;
}

.mega-list a:hover {
  background: rgba(9, 109, 221, 0.06);
  transform: translateX(2px);
}

.mega-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  font-family: 'Noto Sans SC', sans-serif;
}

.mega-list a > div {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.mega-list b {
  font-size: 13.5px;
  font-weight: 600;
  color: #111827;
  line-height: 1.3;
}

.mega-list em {
  font-style: normal;
  font-size: 11.5px;
  color: #9ca3af;
  line-height: 1.4;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- 底栏 ---------- */
.mega-menu__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background: linear-gradient(90deg, rgba(9, 109, 221, 0.04), rgba(59, 130, 246, 0.04));
  border-top: 1px solid rgba(15, 23, 42, 0.05);
  font-size: 12.5px;
  color: #6b7280;
}

.mega-cta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #096ddd;
  font-weight: 600;
  text-decoration: none;
  transition: gap 0.2s ease, color 0.2s ease;
}

.mega-cta:hover {
  color: #0857b0;
  gap: 8px;
}

/* ---------- 响应式 ---------- */
@media (max-width: 1024px) {
  .mega-menu__inner { flex-wrap: wrap; max-width: 92vw; }
}

@media (max-width: 640px) {
  .mega-menu { max-width: 92vw; }
  .mega-menu__inner { flex-direction: column; padding: 16px; }
  .mega-col + .mega-col { padding-left: 0; border-left: none; border-top: 1px solid rgba(15,23,42,0.05); padding-top: 8px; margin-top: 4px; }
}
