/**
 * 顶部子栏目下拉：全宽浅色面板 + 卡片网格，数据来自 AppHeader.vue。
 * 下拉以 header container 为定位参照，margin 与内容区版心保持一致。
 */

/* 让面板参照 header container，而不是 70px 宽的菜单项 */
.site-menu .item-0.has-children {
  position: static;
}

/**
 * 只改几何与网格，不碰 visibility / opacity：
 * 基础 .site-menu .nav-1 负责隐藏、.has-children:hover .nav-1 负责显示，
 * 我们若在更高优先级里重写 hidden，会把 hover 规则一起压掉。
 */
.site-menu .has-children > .nav-1.mega-nav {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  width: auto;
  height: auto;
  /* 与内容区 .container 同版心：基础层级 15px / ≥1330px 70px / ≥1920px 10vw */
  margin: 0 15px;
  padding: 18px 24px 22px;
  transform: none;
  white-space: normal;
  text-align: left;
  list-style: none;
  border-bottom: 0;
  border-radius: 0 0 10px 10px;
  background: #f7f8fa;
  box-shadow: 0 16px 32px rgba(0, 0, 0, .06);
  display: grid;
  grid-template-columns: repeat(var(--mega-cols, 6), minmax(0, 1fr));
  gap: 12px;
}

/* 卡片单元格：清掉基础 .item-1{width:8em} 与 li 的默认缩进 */
.site-menu .nav-1.mega-nav .item-1.mega-cell {
  width: auto;
  float: none;
  margin: 0;
  padding: 0;
  list-style: none;
  display: block;
}

.site-menu .nav-1.mega-nav .mega-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 96px;
  padding: 16px 10px;
  box-sizing: border-box;
  text-align: center;
  text-decoration: none;
  color: #333;
  background: #fff;
  border: 1px solid #edf0f3;
  border-radius: 8px;
  -webkit-transition: box-shadow .2s, transform .2s, border-color .2s, background-color .2s;
  transition: box-shadow .2s, transform .2s, border-color .2s, background-color .2s;
}

.site-menu .nav-1.mega-nav .mega-card:hover,
.site-menu .nav-1.mega-nav .item-1.current-menu-item .mega-card {
  color: #333;
  background: linear-gradient(to right, #eff6ff, #eef2ff);
  border-color: var(--lsr-primary-soft);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgb(var(--lsr-primary-rgb) / .1);
}

.site-menu .nav-1.mega-nav .mega-ico {
  color: var(--lsr-primary);
  font-size: 24px;
  line-height: 1;
}

.site-menu .nav-1.mega-nav .mega-title {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  color: #2b2b2b;
}

.site-menu .nav-1.mega-nav .mega-desc {
  font-size: 12px;
  line-height: 1.4;
  color: #9a9a9a;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 版心层级与基础 .container 完全一致：≥1330px 左右 70px、≥1920px 左右 10vw，
   保证任何视口下二级菜单都与内容区域同宽。 */
@media (min-width: 1330px) {
  .site-menu .has-children > .nav-1.mega-nav {
    margin: 0 70px;
  }
}
@media (min-width: 1920px) {
  .site-menu .has-children > .nav-1.mega-nav {
    margin: 0 10vw;
  }
}

/* 窄屏走基础汉堡菜单，mega 面板不参与 */
@media (max-width: 767px) {
  .site-menu .has-children > .nav-1.mega-nav {
    display: none;
  }
}
