/* ==========================================================================
   Shared site header / navigation
   ========================================================================== */

:root {
  --white-15: rgba(255, 255, 255, 0.15);
}

/* --------------------------------------------------------------------------
   表头按钮基础重置
   共享 header 内含多个 <button>（下拉触发器 / 语言切换 / 汉堡按钮 / 手风琴）。
   各页面样式表通常已有全局 button 重置，但个别页面缺失（如 contact），
   按钮会回落浏览器默认外观（灰白底 + 2px 3D 边框 + 非继承字体）。
   此处显式声明，使表头外观不依赖页面样式表。
   注意：本规则置于文件靠前位置——后续各控件自身规则（颜色、内边距等）
   在同等特异性下会覆盖此处，故不会影响既有页面的渲染。
   -------------------------------------------------------------------------- */
.navbar__link,
.navbar__lang,
.navbar__burger,
.mobile-nav__link {
  padding: 0;
  background: none;
  border: 0;
  font-family: inherit;
  color: inherit;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 80px;
  z-index: 100;
}

/* Full-width frosted background while the 1440px navbar stays centred */
.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(10, 71, 237, 0.4);
  border-bottom: 1px solid var(--white-15);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.site-header.is-scrolled::before {
  background: rgba(10, 71, 237, 0.7);
}

.navbar {
  position: relative;
  z-index: 1;
  max-width: 1440px;
  margin: 0 auto;
  height: 80px;
  padding: 0 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 50px;
}

.navbar__brand img {
  width: 99px;
  height: 36px;
}

/* 中文版：中文 logo 画稿为 79×32，按设计稿尺寸展示以避免被拉伸 */
html[lang="zh-cn"] .navbar__brand img {
  width: 80px;
  height: 32px;
}

.navbar__menu {
  display: flex;
  align-items: center;
  gap: 60px;
  padding: 8px 90px;
  border-radius: 60px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow:
    inset 0 0 8px rgba(255, 255, 255, 0.12),
    0 0 20px rgba(10, 71, 237, 0.2);
}

.navbar__item {
  position: relative;
}

.navbar__link {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 18px;
  line-height: 30px;
  color: var(--white);
  white-space: nowrap;
  transition: opacity 0.2s ease;
}

.navbar__link:hover {
  opacity: 0.8;
}

.navbar__caret {
  width: 14px;
  height: 14px;
  opacity: 0.6;
}

.navbar__actions {
  display: flex;
  align-items: center;
  gap: 50px;
}

.navbar__product img {
  width: 100px;
  height: 36px;
}

/* 中文版：中文 logo 画稿为 79×32，按设计稿尺寸展示以避免被拉伸 */
html[lang="zh-cn"] .navbar__product img {
  width: 79px;
  height: 32px;
}

.navbar__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 140px;
  height: 30px;
  font-size: 14px;
  line-height: 22px;
  color: var(--white);
  background: var(--blue);
  border: 1px solid var(--white-15);
  border-radius: 8px;
  box-shadow: inset 0 0 6px 3px rgba(255, 255, 255, 0.25);
  transition: filter 0.2s ease;
}

.navbar__cta:hover {
  filter: brightness(1.15);
}

.navbar__lang img {
  width: 24px;
  height: 24px;
}

.dropdown {
  position: absolute;
  top: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%);
  min-width: 220px;
  padding: 10px;
  background: #071a66;
  border: 1px solid var(--white-15);
  border-radius: 12px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
}

.navbar__item.has-dropdown:hover .dropdown,
.navbar__item.has-dropdown:focus-within .dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.dropdown a {
  display: block;
  padding: 8px 14px;
  font-size: 16px;
  line-height: 24px;
  color: var(--white);
  border-radius: 8px;
  transition: background 0.2s ease;
}

.dropdown a:hover {
  background: rgba(255, 255, 255, 0.08);
}

/* ==========================================================================
   About Us 下拉：浅色面板 + 顶部蓝色光带（基于设计稿 9874:70032 收窄宽度）
   ========================================================================== */

.dropdown--about {
  width: 340px;
  min-width: 0;
  padding: 40px 0 30px;
  background: #f5f7ff;
  border: none;
  border-radius: 20px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.12);
  overflow: hidden;
}

/* 顶部 20px 深蓝光带（随面板宽度自适应） */
.dropdown--about::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 20px;
  background: url("/static/common/assets/dropdown-top.svg") center / 100% 100% no-repeat;
}

/* 条目：15px 上下内边距 + 60px 左内边距，圆点与文字间距 10px */
.dropdown--about a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 15px 0 15px 60px;
  font-size: 20px;
  line-height: 30px;
  color: #3e3e3e;
  border-radius: 0;
}

.dropdown--about li + li {
  margin-top: 20px;
}

/* 列表项圆点（设计稿 10×10 #D9D9D9） */
.dropdown--about a::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #d9d9d9;
  flex-shrink: 0;
}

.dropdown--about a:hover {
  background: none;
  color: var(--blue);
}

/* ==========================================================================
   AI Solution mega menu（设计稿 1280×600：标题栏 70 + 左侧类目 480×530 + 右侧内容 800×530）
   ========================================================================== */

.mega {
  position: absolute;
  top: calc(100% + 12px);
  left: 50%;
  width: 1280px;
  transform: translateX(-50%) scale(var(--mega-scale, 1));
  transform-origin: top center;
  background: #fff;
  border-radius: 40px;
  box-shadow: 0 24px 60px rgba(0, 15, 96, 0.28);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.navbar__item.has-dropdown:hover .mega,
.navbar__item.has-dropdown:focus-within .mega,
.navbar__item.has-dropdown > .navbar__link[aria-expanded="true"] + .mega {
  opacity: 1;
  visibility: visible;
}

/* 桥接按钮与面板间的 12px 间隙，避免鼠标下移时菜单闪退 */
.mega::before {
  content: "";
  position: absolute;
  top: -12px;
  left: 0;
  right: 0;
  height: 12px;
}

/* 顶部标题栏（1280×70 #041884） */
.mega__bar {
  position: relative;
  height: 70px;
  background: #041884;
  border-radius: 40px 40px 0 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 蓝色光晕（493×464 椭圆 blur 112px，水平居中） */
.mega__bar-glow {
  position: absolute;
  left: 50%;
  top: -197px;
  width: 493px;
  height: 464px;
  margin-left: -246.5px;
  background: #0a47ed;
  border-radius: 50%;
  filter: blur(112px);
  pointer-events: none;
}

/* 右侧 cube 插画（508×295，贴右边缘，上下溢出裁切） */
.mega__bar-cube {
  position: absolute;
  right: 0;
  top: -137px;
  width: 508px;
  height: 295px;
  pointer-events: none;
}

.mega__bar-title {
  position: relative;
  font-size: 24px;
  line-height: 30px;
  font-weight: 700;
  color: #fff;
}

.mega__body {
  display: flex;
  height: 530px;
  border-radius: 0 0 40px 40px;
  overflow: hidden;
}

/* 左侧：类目列表（480×530 #F5F7FF，垂直居中 55px） */
.mega__cats {
  width: 480px;
  flex-shrink: 0;
  background: #f5f7ff;
  border-radius: 0 0 0 40px;
  padding: 55px 0;
  display: flex;
  flex-direction: column;
}

.mega__cat {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 70px;
  padding: 15px 0 15px 60px;
  font-size: 20px;
  line-height: 40px;
  color: #3e3e3e;
  transition: background 0.2s ease;
}

/* 圆点（10×10，默认 #D9D9D9） */
.mega__cat::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #d9d9d9;
  flex-shrink: 0;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

/* 激活：白色渐变底 + 蓝点发光 + 加粗 */
.mega__cat.is-active {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, #ffffff 80%);
  font-weight: 700;
}

.mega__cat.is-active::before {
  background: var(--blue);
  box-shadow: 0 4px 4px 0 rgba(10, 71, 237, 0.25);
}

/* 右侧：三级内容容器（800×530） */
.mega__main {
  position: relative;
  flex: 1;
  min-width: 0;
  background: #fff;
  border-radius: 0 0 40px 0;
  overflow: hidden;
}

.mega__panel {
  position: absolute;
  inset: 0;
  display: none;
}

.mega__panel.is-active {
  display: block;
}

/* 产品列表（700 宽 2 列网格，起点 52,56） */
.mega__products {
  position: absolute;
  top: 56px;
  left: 52px;
  width: 700px;
  display: grid;
  grid-template-columns: 350px 350px;
  row-gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.mega__products a {
  display: block;
  min-height: 70px;
  padding: 0 0 10px;
  font-size: 20px;
  line-height: 30px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #3e3e3e;
  overflow-wrap: anywhere;
  transition: color 0.2s ease;
}

.mega__products a:hover {
  color: var(--blue);
}

/* 中英文产品数不同（中文 8 项 / 英文 4 项）：按 html[lang] 差异化显示 */
html[lang="zh-cn"] .menu-item--en {
  display: none;
}

html[lang="en-us"] .menu-item--zh {
  display: none;
}

/* 英文版不展示 eCommercial 分类：菜单入口（.menu-item--zh）+ 右侧面板一并隐藏 */
html[lang="en-us"] .mega__panel[data-panel="commercial"] {
  display: none;
}

/* 英文页数智营销面板 4 项按英文设计稿排序：SFE、Event / SCRM、Boundless
   （nth-child 依赖上方 DOM 顺序，调整产品列表时需同步） */
html[lang="en-us"] .mega__panel[data-panel="commercial"] .mega__products > li:nth-child(1) { order: 3; }
html[lang="en-us"] .mega__panel[data-panel="commercial"] .mega__products > li:nth-child(3) { order: 1; }
html[lang="en-us"] .mega__panel[data-panel="commercial"] .mega__products > li:nth-child(5) { order: 2; }
html[lang="en-us"] .mega__panel[data-panel="commercial"] .mega__products > li:nth-child(9) { order: 4; }

/* 展示面板背景：径向渐变 + 抽象图 + 波浪（设计稿 800×530） */
.mega__panel--showcase {
  background:
    url("/static/common/assets/menu-abstract.png") center top / 1422px 800px no-repeat,
    radial-gradient(circle at 50% 100%, #ffffff 11%, #0093d5 35%, #000f60 89%);
}

.mega__panel--showcase::before {
  content: "";
  position: absolute;
  left: 225px;
  top: -101px;
  width: 622px;
  height: 394px;
  background: url("/static/common/assets/menu-wave.svg") center / contain no-repeat;
  opacity: 0.2;
  pointer-events: none;
}

.mega__showcase-text {
  position: absolute;
  left: 50px;
  top: 50px;
  width: 640px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-decoration: none;
}

.mega__showcase-title {
  font-size: 48px;
  line-height: 60px;
  font-weight: 700;
  color: #fff;
}

.mega__showcase-title--sm {
  font-size: 36px;
  line-height: 40px;
}

.mega__showcase-desc {
  font-size: 18px;
  line-height: 30px;
  color: #fff;
}

/* 展示面板 banner（720×360，底部白色渐隐融入面板） */
.mega__showcase-banner {
  position: absolute;
  left: 40px;
  top: 190px;
  width: 720px;
  height: 360px;
  border-radius: 10px;
  background-size: cover;
  background-position: center;
  display: block;
}

.mega__showcase-banner::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 255px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0) 33%, #ffffff 70%);
}

.mega__sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* 窄屏：JS 保证水平居中；此处切换为纵向堆叠布局，宽度跟随视口 */
@media (max-width: 979px) {
  .mega {
    top: calc(100% + 12px);
    left: 50%;
    width: calc(100vw - 24px);
    transform: none;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    border-radius: 20px;
  }

  .mega__bar {
    height: 48px;
    border-radius: 20px 20px 0 0;
  }

  .mega__bar-glow {
    top: -130px;
    width: 300px;
    height: 280px;
    margin-left: -150px;
    filter: blur(70px);
  }

  .mega__bar-cube {
    width: 220px;
    height: 128px;
    top: -40px;
  }

  .mega__bar-title {
    font-size: 18px;
    line-height: 24px;
  }

  .mega__body {
    flex-direction: column;
    height: auto;
    border-radius: 0 0 20px 20px;
  }

  .mega__cats {
    width: 100%;
    padding: 6px 0;
    border-radius: 0;
  }

  .mega__cat {
    height: 44px;
    padding-left: 24px;
    font-size: 16px;
    line-height: 24px;
  }

  .mega__main {
    border-radius: 0;
    min-height: 0;
  }

  .mega__panel {
    position: relative;
    inset: auto;
  }

  .mega__products {
    position: static;
    width: 100%;
    grid-template-columns: 1fr;
    row-gap: 0;
    padding: 4px 12px 12px 24px;
  }

  .mega__products a {
    min-height: 40px;
    padding: 9px 0;
    font-size: 15px;
    line-height: 22px;
  }

  .mega__panel--showcase {
    background:
      url("/static/common/assets/menu-abstract.png") center / cover no-repeat,
      radial-gradient(circle at 50% 100%, #ffffff 11%, #0093d5 35%, #000f60 89%);
  }

  .mega__panel--showcase::before {
    display: none;
  }

  .mega__showcase-text {
    position: static;
    width: auto;
    padding: 18px 24px 0;
    gap: 8px;
  }

  .mega__showcase-title {
    font-size: 24px;
    line-height: 32px;
  }

  .mega__showcase-title--sm {
    font-size: 20px;
    line-height: 28px;
  }

  .mega__showcase-desc {
    font-size: 14px;
    line-height: 22px;
  }

  .mega__showcase-banner {
    position: relative;
    left: auto;
    top: auto;
    width: calc(100% - 48px);
    height: 0;
    padding-bottom: 45%;
    margin: 14px 24px 20px;
  }
}

/* ==========================================================================
   移动端汉堡菜单（全站共享，≤979px 生效）
   PC（≥980px）下按钮与面板均 display:none，不参与布局，渲染零变化。
   ========================================================================= */

/* 默认隐藏：PC 端不显示 */
.navbar__burger {
  display: none;
}

.mobile-nav {
  display: none;
}

body.is-nav-open {
  overflow: hidden;
}

@media (max-width: 979px) {
  .site-header {
    height: 64px;
  }

  .navbar {
    height: 64px;
    padding: 0 16px;
    justify-content: space-between;
    gap: 12px;
  }

  /* 桌面菜单 / 产品 logo / 登录按钮让位给汉堡菜单 */
  .navbar__menu,
  .navbar__product,
  .navbar__cta {
    display: none;
  }

  .navbar__actions {
    gap: 14px;
  }

  .navbar__brand img {
    width: 88px;
    height: 32px;
  }

  html[lang="zh-cn"] .navbar__brand img {
    width: 72px;
    height: 29px;
  }

  .navbar__lang img {
    width: 22px;
    height: 22px;
  }

  .navbar__burger {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
  }

  .navbar__burger span {
    width: 22px;
    height: 2px;
    border-radius: 2px;
    background: #ffffff;
    transition: transform 0.3s ease, opacity 0.3s ease;
  }

  .navbar__burger[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .navbar__burger[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
  }

  .navbar__burger[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  /* ---------- 移动端导航面板 ---------- */

  .mobile-nav {
    display: block;
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    height: calc(100vh - 64px);
    height: calc(100dvh - 64px);
    background: #041884;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
    z-index: 0;
  }

  .mobile-nav.is-open {
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .mobile-nav__scroll {
    padding: 4px 0 32px;
  }

  .mobile-nav__item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  }

  .mobile-nav__link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    padding: 16px 20px;
    font-size: 16px;
    line-height: 24px;
    color: #ffffff;
    text-align: left;
  }

  .mobile-nav__caret {
    width: 14px;
    height: 14px;
    opacity: 0.7;
    transition: transform 0.25s ease;
  }

  .mobile-nav__link--toggle[aria-expanded="true"] .mobile-nav__caret {
    transform: rotate(180deg);
  }

  .mobile-nav__sub {
    display: none;
    padding: 0 20px 12px;
  }

  .mobile-nav__sub.is-open {
    display: block;
  }

  .mobile-nav__sub a {
    display: block;
    padding: 10px 0;
    font-size: 14px;
    line-height: 22px;
    color: rgba(255, 255, 255, 0.72);
  }

  .mobile-nav__cta {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 48px;
    margin: 24px 20px 0;
    font-size: 15px;
    line-height: 22px;
    color: #ffffff;
    background: #0a47ed;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
  }
}
