/* 公共导航：桌面选中标识与移动端展开菜单。 */
.menu-toggle-new {
  display: inline-flex;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid #e1dce4;
  color: #302936;
  background: rgba(255, 255, 255, .86);
  box-shadow: 0 5px 18px rgba(41, 29, 47, .05);
  touch-action: manipulation;
  transition:
    color 180ms ease,
    border-color 180ms ease,
    background-color 180ms ease,
    box-shadow 220ms ease,
    transform 160ms ease;
}

.menu-toggle-icon {
  position: relative;
  display: flex;
  width: 18px;
  height: 14px;
  flex-direction: column;
  justify-content: space-between;
}

.menu-toggle-icon span {
  display: block;
  width: 100%;
  height: 1.5px;
  border-radius: 2px;
  background: currentColor;
  transform-origin: center;
  transition:
    opacity 140ms ease,
    transform 240ms cubic-bezier(.22, 1, .36, 1);
}

.menu-toggle-new[aria-expanded="true"] {
  border-color: #edb0ad;
  color: #d84843;
  background: #fff6f5;
  box-shadow: 0 6px 18px rgba(229, 82, 76, .1);
}

.menu-toggle-new[aria-expanded="true"] .menu-toggle-icon span:first-child {
  transform: translateY(6.25px) rotate(45deg);
}

.menu-toggle-new[aria-expanded="true"] .menu-toggle-icon span:nth-child(2) {
  opacity: 0;
  transform: scaleX(.35);
}

.menu-toggle-new[aria-expanded="true"] .menu-toggle-icon span:last-child {
  transform: translateY(-6.25px) rotate(-45deg);
}

@media (max-width: 1023px) {
  html.menu-open body::before {
    position: fixed;
    z-index: 35;
    inset: 0;
    background: rgba(31, 24, 35, .28);
    backdrop-filter: blur(3px);
    content: "";
    touch-action: none;
  }

  .site-navigation-new,
  .js-menu .site-navigation-new:not(.is-open) {
    position: absolute;
    z-index: 45;
    top: calc(100% + 12px);
    right: 0;
    left: 0;
    display: flex !important;
    max-height: calc(100dvh - 96px);
    padding: 14px;
    overflow-y: auto;
    overscroll-behavior: contain;
    border: 1px solid rgba(221, 214, 224, .96);
    border-radius: 8px;
    background: rgba(255, 255, 255, .98);
    box-shadow: 0 24px 64px rgba(35, 25, 42, .18);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-10px) scale(.985);
    transform-origin: top right;
    visibility: hidden;
    transition:
      opacity 160ms ease,
      transform 220ms cubic-bezier(.22, 1, .36, 1),
      visibility 0s linear 220ms;
  }

  .site-navigation-new.is-open {
    opacity: 1;
    pointer-events: auto;
    transform: none;
    visibility: visible;
    transition-delay: 0s;
  }

  .site-navigation-new.is-open .mobile-nav-heading,
  .site-navigation-new.is-open .mobile-nav-link,
  .site-navigation-new.is-open .mobile-nav-actions {
    animation: mobile-nav-reveal 240ms cubic-bezier(.22, 1, .36, 1) both;
  }

  .site-navigation-new.is-open .mobile-nav-heading {
    animation-delay: 20ms;
  }

  .site-navigation-new.is-open .mobile-nav-link:nth-child(1) {
    animation-delay: 40ms;
  }

  .site-navigation-new.is-open .mobile-nav-link:nth-child(2) {
    animation-delay: 60ms;
  }

  .site-navigation-new.is-open .mobile-nav-link:nth-child(3) {
    animation-delay: 80ms;
  }

  .site-navigation-new.is-open .mobile-nav-link:nth-child(4) {
    animation-delay: 100ms;
  }

  .site-navigation-new.is-open .mobile-nav-link:nth-child(5) {
    animation-delay: 120ms;
  }

  .site-navigation-new.is-open .mobile-nav-actions {
    animation-delay: 140ms;
  }

  .mobile-nav-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding: 8px 10px 12px;
    border-bottom: 1px solid #ece8ee;
  }

  .mobile-nav-heading span {
    color: #29232e;
    font-size: 14px;
    font-weight: 700;
  }

  .mobile-nav-heading small {
    color: #9a909f;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .12em;
  }

  .mobile-nav-links {
    display: grid !important;
    gap: 4px;
    padding-block: 10px;
  }

  .mobile-nav-link {
    position: relative;
    min-height: 52px;
    justify-content: space-between;
    padding: 0 14px;
    border-radius: 6px;
    color: #45404a;
    font-size: 16px;
    font-weight: 600;
    touch-action: manipulation;
    transition:
      color 160ms ease,
      background-color 160ms ease,
      transform 120ms ease;
  }

  .mobile-nav-link::before {
    position: absolute;
    top: 50%;
    left: 0;
    width: 3px;
    height: 18px;
    border-radius: 0 3px 3px 0;
    background: #e5524c;
    content: "";
    opacity: 0;
    transform: translateY(-50%) scaleY(.35);
    transition:
      opacity 160ms ease,
      transform 200ms cubic-bezier(.22, 1, .36, 1);
  }

  .mobile-nav-link[aria-current="page"] {
    color: #c9433e;
    font-weight: 700;
    background: #fff1f0;
  }

  .mobile-nav-link[aria-current="page"]::before {
    opacity: 1;
    transform: translateY(-50%) scaleY(1);
  }

  .mobile-nav-arrow {
    width: 18px;
    height: 18px;
    color: #afa6b2;
    transition:
      color 160ms ease,
      transform 180ms cubic-bezier(.22, 1, .36, 1);
  }

  .mobile-nav-link[aria-current="page"] .mobile-nav-arrow {
    color: #e5524c;
  }

  .mobile-nav-link:focus-visible .mobile-nav-arrow,
  .mobile-nav-link:active .mobile-nav-arrow {
    color: #e5524c;
    transform: translateX(3px);
  }

  .mobile-nav-link:active {
    background: #f5f2f6;
    transform: scale(.985);
  }

  .mobile-nav-actions {
    display: grid;
    grid-template-columns: minmax(0, .8fr) minmax(0, 1.25fr);
    gap: 10px;
    padding: 14px 0 0;
    border-top: 1px solid #ece8ee;
  }

  .mobile-nav-actions a {
    min-height: 50px;
    touch-action: manipulation;
  }
}

@keyframes mobile-nav-reveal {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 359px) {
  .site-navigation-new,
  .js-menu .site-navigation-new:not(.is-open) {
    right: -10px;
    left: -10px;
  }

  .mobile-nav-actions {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 1024px) {
  .site-navigation-new .mobile-nav-link { position: relative; }

  .site-navigation-new .mobile-nav-link[aria-current="page"] {
    color: #c9433e;
    font-weight: 700;
  }

  .site-navigation-new .mobile-nav-link[aria-current="page"]::after {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    width: 24px;
    height: 3px;
    margin-inline: auto;
    border-radius: 999px;
    background: #e5524c;
    content: '';
  }

  .mobile-nav-heading,
  .mobile-nav-arrow {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .menu-toggle-new,
  .menu-toggle-icon span,
  .site-navigation-new,
  .mobile-nav-link,
  .mobile-nav-link::before,
  .mobile-nav-arrow {
    transition: none !important;
  }

  .site-navigation-new.is-open .mobile-nav-heading,
  .site-navigation-new.is-open .mobile-nav-link,
  .site-navigation-new.is-open .mobile-nav-actions {
    animation: none !important;
  }
}
