html {
  scroll-behavior: smooth;
}
[id]:not(body) {
  scroll-margin-top: 40px; /* height of your sticky nav */
}
.nav::after {
  transition: all 0.3s;
  width: 0;
}
.nav .nav-link {
  color: var(--inactive-color);
  font-size: var(--desktop-text-size);
  text-decoration: initial;
}
.nav .nav-link:hover {
  text-decoration: initial;
}

@media screen and (max-width: 768px) {
  .nav-wrapper::-webkit-scrollbar {
    width: 4px;
    height: 4px;
  }

  .nav-wrapper::-webkit-scrollbar-thumb {
    background: var(--mobile-scrollbar-bg);
    border-radius: 4px;
  }

  .nav .nav-link {
    font-size: var(--mobile-text-size);
  }
}

.nav:hover::after,
.nav.active::after {
  width: 100%;
}
.nav .nav-link:hover,
.nav .nav-link.active {
  color: var(--active-color);
}
.nav.active,
.nav:hover {
  background-color: var(--active-bg);
}
.nav:hover::after,
.nav.active::after {
  background-color: var(--active-color);
}

/* Sticky + controls */
/* on_scroll 模式:滚动阈值前隐藏整条导航栏,触发吸顶后再显示 */
.quick-nav__hidden {
  display: none;
}

.quick-nav__sticky {
  position: fixed;
  top: var(--quick-nav-top, 0);
  left: 0;
  right: 0;
  z-index: var(--z-index-sticky);
  box-shadow: 0px 3px 8px 0px rgba(80, 56, 32, 0.12);
}

.nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.06);
  color: rgba(var(--inactive-color-rgb, 33, 37, 41));
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  background-color: #fff;
}

.nav-arrow:disabled {
  background-color: unset;
  cursor: not-allowed;
}
.nav-arrow-left {
  left: 8px;
}
.nav-arrow-right {
  right: 8px;
}

.nav-dropdown-toggle {
  position: absolute;
  right: 0px;
  top: 50%;
  transform: translateY(-50%);
  display: none;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.1);
  border: none;
}
@media screen and (max-width: 768px) {
  .quick-nav__sticky .nav-dropdown-toggle {
    display: flex;
  }
}

.nav-dropdown-menu {
  position: absolute;
  right: 8px;
  top: calc(100% + 8px);
  min-width: 180px;
  background: var(--background-color);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
  border-radius: 6px;
  overflow: hidden;
  z-index: 10000;
}
.nav-dropdown-item {
  display: block;
  width: 100%;
  padding: 8px 12px;
  text-align: left;
  background: transparent;
  border: none;
  border-left: 3px solid transparent;
  cursor: pointer;
  transition:
    background 0.2s,
    color 0.2s;
}
.nav-dropdown-item:hover {
  background: rgba(0, 0, 0, 0.03);
}
.nav-dropdown-item.active {
  font-weight: 600;
  background-color: var(--active-bg);
  color: var(--active-color);
}
