.site-nav {
  position: sticky;
  top: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 10px;
  background: rgba(12, 14, 18, 0.96);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-family: 'Noto Sans TC', 'PingFang TC', 'Microsoft JhengHei', sans-serif;
  isolation: isolate;
  touch-action: manipulation;
}

.site-nav__menu-btn {
  flex: 1;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: #e8eaed;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.site-nav__menu-btn:active {
  background: rgba(255, 255, 255, 0.1);
}

.site-nav__menu-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-nav__menu-caret {
  flex-shrink: 0;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid #9aa0a6;
}

.site-nav__logout {
  flex-shrink: 0;
  height: 32px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: transparent;
  color: #c4c7cc;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(239, 68, 68, 0.25);
}

.site-nav__logout:active {
  color: #fff;
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.35);
}

/* 页面切换菜单 */
.site-nav-menu {
  position: fixed;
  inset: 0;
  z-index: 800;
}

.site-nav-menu[hidden] {
  display: none !important;
}

.site-nav-menu__backdrop {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: rgba(0, 0, 0, 0.5);
}

.site-nav-menu__sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  background: #1a1d24;
  border-radius: 16px 16px 0 0;
  padding: 8px 12px calc(12px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.4);
}

.site-nav-menu__handle {
  width: 36px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  margin: 4px auto 10px;
}

.site-nav-menu__title {
  font-size: 13px;
  color: #9aa0a6;
  padding: 0 4px 8px;
}

.site-nav-menu__list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.site-nav-menu__item {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: none;
  border-radius: 10px;
  text-align: left;
  text-decoration: none;
  color: #e8eaed;
  font-size: 15px;
  font-family: inherit;
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  -webkit-tap-highlight-color: rgba(59, 130, 246, 0.25);
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

.site-nav-menu__item:active {
  background: rgba(255, 255, 255, 0.08);
}

.site-nav-menu__item.is-active {
  color: #fff;
  background: #3b82f6;
  font-weight: 600;
}

body.has-site-nav .app {
  height: calc(100vh - 44px);
}

body.mobile-mode.has-site-nav .app,
body.has-site-nav .app {
  height: auto;
  min-height: calc(100vh - 44px);
}

@media (min-width: 900px) {
  .site-nav-menu__sheet {
    left: 50%;
    right: auto;
    bottom: auto;
    top: 52px;
    transform: translateX(-50%);
    width: min(360px, calc(100vw - 32px));
    border-radius: 14px;
    padding-bottom: 12px;
  }

  .site-nav-menu__handle {
    display: none;
  }
}
