/* 顶部导航：滚动态 + 滑动选中胶囊 */

.nav-wrap {
  padding-top: 16px;
  pointer-events: none;
}

.nav-inner {
  --nav-scroll: 0;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  width: 100%;
  max-width: 1040px;
  min-height: 60px;
  pointer-events: auto;
  background: rgba(255, 255, 255, 0.82) !important;
  border: 1px solid rgba(255, 255, 255, 0.78);
  box-shadow:
    inset 0 1px 0 #fff,
    0 12px 28px -18px rgba(28, 48, 104, 0.22);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  transform: translateZ(0);
  transition:
    box-shadow 0.28s cubic-bezier(.22,1,.36,1),
    border-color 0.28s ease,
    background-color 0.28s ease,
    transform 0.28s cubic-bezier(.22,1,.36,1);
}

.nav-inner::before,
.nav-inner::after {
  display: none;
}

.nav-inner > * {
  position: relative;
  z-index: 1;
}

.nav-inner.scrolled {
  background: rgba(255, 255, 255, 0.94) !important;
  border-color: rgba(220, 230, 245, 0.95);
  box-shadow:
    inset 0 1px 0 #fff,
    0 16px 36px -18px rgba(28, 48, 104, 0.32);
  transform: translateZ(0) scale(0.995);
}

.nav-inner.returning {
  animation: navReturn .45s cubic-bezier(.22,1,.36,1);
}

@keyframes navReturn {
  from { transform: translateY(-4px); opacity: .92; }
  to { transform: translateY(0); opacity: 1; }
}

/* 滑动胶囊 */
.nav-links {
  position: relative;
}
.nav-links .nav-pill {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  height: 100%;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.16);
  box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.2);
  pointer-events: none;
  opacity: 0;
  transform: translate3d(0, 0, 0);
  transition:
    transform 0.38s cubic-bezier(.22,1,.36,1),
    width 0.38s cubic-bezier(.22,1,.36,1),
    opacity 0.22s ease;
}
.nav-links.has-pill .nav-pill.is-ready {
  opacity: 1;
}
.nav-links a {
  position: relative;
  z-index: 1;
  transition: color 0.2s ease !important;
}
.nav-links.has-pill a,
.nav-links.has-pill a:hover,
.nav-links.has-pill a.active {
  background: transparent !important;
  box-shadow: none !important;
}
.nav-links.has-pill a:hover { color: #1c2438 !important; }
.nav-links.has-pill a.active {
  color: #1d4ed8 !important;
  font-weight: 650 !important;
}

.nav-mobile {
  position: absolute;
  isolation: isolate;
  overflow: hidden;
  pointer-events: auto;
  background: rgba(255, 255, 255, 0.94) !important;
  border: 1px solid rgba(220, 230, 245, 0.95);
  box-shadow: 0 18px 40px -22px rgba(28, 48, 104, 0.3);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.nav-mobile::before,
.nav-mobile::after {
  display: none;
}

.nav-mobile > * {
  position: relative;
  z-index: 1;
}

.nav-mobile a.active {
  color: #1d4ed8 !important;
  background: rgba(59, 130, 246, 0.14) !important;
  font-weight: 650;
}

@media (max-width: 767px) {
  .nav-wrap {
    padding: 10px 10px 0;
  }
  .nav-inner {
    min-height: 58px;
  }
  .nav-inner.scrolled {
    transform: none;
  }
  .nav-mobile {
    top: 78px;
    left: 12px;
    right: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nav-inner,
  .nav-links a,
  .nav-links .nav-pill {
    transition: none !important;
    animation: none !important;
  }
}
