:root {
  --bo-dropdown-duration: 240ms;
  --bo-dropdown-duration-out: 180ms;
  --bo-dropdown-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --bo-dropdown-ease-out: cubic-bezier(0.4, 0, 0.2, 1);
  --bo-dropdown-tab-duration: 180ms;
  --bo-dropdown-offset-y: -10px;
  --bo-dropdown-cat-duration: 180ms;
}

/* 开合：仅 opacity + translate，不与 backdrop-filter 同层 */
.jc_hd .hd_menu_dropdown {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  width: 100%;
  max-width: 100%;
  top: var(--jc-hd-height, 70px);
  opacity: 0;
  visibility: hidden;
  transform: translate3d(0, var(--bo-dropdown-offset-y), 0);
  transition:
    opacity var(--bo-dropdown-duration-out) var(--bo-dropdown-ease-out),
    transform var(--bo-dropdown-duration-out) var(--bo-dropdown-ease-out),
    visibility 0s linear var(--bo-dropdown-duration-out);
  pointer-events: none;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  contain: layout style;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

.jc_hd .hd_menu_dropdown.is-open {
  opacity: 1;
  visibility: visible;
  transform: translate3d(0, 0, 0);
  transition:
    opacity var(--bo-dropdown-duration) var(--bo-dropdown-ease),
    transform var(--bo-dropdown-duration) var(--bo-dropdown-ease),
    visibility 0s linear 0s;
  pointer-events: auto;
}

/* 毛玻璃遮罩：静态层只做 opacity，不跟面板一起 transform */
.jc_hd .hd_menu_dropdown:has(.portal-product-panel)::before,
.jc_hd .hd_menu_dropdown:has(.tencent-product-panel)::before,
.jc_hd .hd_menu_dropdown:has(.portal-nav-panel)::before {
  content: "";
  position: fixed;
  left: 0;
  right: 0;
  top: var(--jc-hd-height, 70px);
  bottom: 0;
  background: rgba(255, 255, 255, 0.42);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--bo-dropdown-duration) var(--bo-dropdown-ease);
  z-index: -1;
  will-change: opacity;
}

.jc_hd .hd_menu_dropdown.is-open:has(.portal-product-panel)::before,
.jc_hd .hd_menu_dropdown.is-open:has(.tencent-product-panel)::before,
.jc_hd .hd_menu_dropdown.is-open:has(.portal-nav-panel)::before {
  opacity: 1;
}

.jc_hd .hd_menu_dropdown:not(.is-open):has(.portal-product-panel)::before,
.jc_hd .hd_menu_dropdown:not(.is-open):has(.tencent-product-panel)::before,
.jc_hd .hd_menu_dropdown:not(.is-open):has(.portal-nav-panel)::before {
  content: none;
  display: none;
  opacity: 0;
  will-change: auto;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

/* 关闭态不保留合成层，避免整页滚动卡顿 */
.jc_hd .hd_menu_dropdown:not(.is-open) {
  will-change: auto !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  contain: layout style;
}

/* 面板本体轻量上浮 */
.jc_hd .hd_menu_dropdown .portal-product-panel,
.jc_hd .hd_menu_dropdown .tencent-product-panel {
  transform: translate3d(0, 6px, 0);
  opacity: 0.96;
  transition:
    transform var(--bo-dropdown-duration) var(--bo-dropdown-ease),
    opacity var(--bo-dropdown-duration) var(--bo-dropdown-ease),
    box-shadow var(--bo-dropdown-duration) var(--bo-dropdown-ease);
  will-change: transform, opacity;
  transform-origin: 50% 0;
}

.jc_hd .hd_menu_dropdown.is-open .portal-product-panel,
.jc_hd .hd_menu_dropdown.is-open .tencent-product-panel {
  transform: translate3d(0, 0, 0);
  opacity: 1;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.12);
}

.jc_hd .hd_menu_dropdown:not(.is-open) .portal-product-panel,
.jc_hd .hd_menu_dropdown:not(.is-open) .tencent-product-panel {
  will-change: auto;
}

.dropdown-product-wrap .dropdown-product-nav li a {
  transition: color calc(var(--bo-dropdown-tab-duration) * 0.7) var(--bo-dropdown-ease-out);
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --bo-dropdown-duration: 1ms;
    --bo-dropdown-duration-out: 1ms;
    --bo-dropdown-tab-duration: 1ms;
    --bo-dropdown-cat-duration: 1ms;
    --bo-dropdown-offset-y: 0;
  }

  .jc_hd .hd_menu_dropdown .portal-product-panel,
  .jc_hd .hd_menu_dropdown .tencent-product-panel,
  .jc_hd .hd_menu_dropdown:has(.portal-product-panel)::before,
  .jc_hd .hd_menu_dropdown:has(.tencent-product-panel)::before,
  .jc_hd .hd_menu_dropdown:has(.portal-nav-panel)::before {
    transform: none !important;
    opacity: 1 !important;
    transition: none !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
  }
}
