.mobile-bottom-nav-slot {
  display: contents;
}

.mobile-bottom-nav-root {
  display: contents;
  --mbn-active: #2488ff;
  --mbn-compose: #111827;
  --mbn-bg: rgba(255, 255, 255, 0.92);
  --mbn-border: rgba(15, 23, 42, 0.08);
  --mbn-shadow: rgba(15, 23, 42, 0.16);
  --mbn-bottom: 10px;
  --mbn-viewport-bottom: 0px;
}

.mobile-bottom-nav {
  box-sizing: border-box;
  position: fixed;
  left: max(12px, env(safe-area-inset-left));
  right: max(12px, env(safe-area-inset-right));
  bottom: calc(var(--mbn-bottom) + var(--mbn-viewport-bottom) + env(safe-area-inset-bottom));
  z-index: 60;
  display: none;
  pointer-events: none;
}

.mobile-bottom-nav[data-visible="true"] {
  display: block;
}

.mobile-bottom-nav__rail {
  box-sizing: border-box;
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--mbn-item-count, 5), minmax(0, 1fr));
  align-items: center;
  min-height: 54px;
  max-width: 38rem;
  margin: 0 auto;
  padding: 0;
  border: 1px solid var(--mbn-border);
  border-radius: 999px;
  background: var(--mbn-bg);
  box-shadow: 0 22px 46px -24px var(--mbn-shadow), 0 10px 24px -22px rgba(15, 23, 42, 0.45);
  pointer-events: auto;
}

.mobile-bottom-nav.is-blurred .mobile-bottom-nav__rail {
  -webkit-backdrop-filter: blur(18px) saturate(1.28);
  backdrop-filter: blur(18px) saturate(1.28);
}

.mobile-bottom-nav.is-attached {
  left: 0;
  right: 0;
  bottom: 0;
}

.mobile-bottom-nav.is-attached .mobile-bottom-nav__rail {
  max-width: none;
  min-height: calc(54px + env(safe-area-inset-bottom));
  padding-right: max(10px, env(safe-area-inset-right));
  padding-bottom: env(safe-area-inset-bottom);
  padding-left: max(10px, env(safe-area-inset-left));
  border-right: 0;
  border-bottom: 0;
  border-left: 0;
  border-radius: 22px 22px 0 0;
}

.mobile-bottom-nav__item {
  box-sizing: border-box;
  position: relative;
  display: inline-flex;
  min-width: 0;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  border-radius: 999px;
  color: rgba(72, 78, 88, 0.95);
  text-decoration: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.mobile-bottom-nav__item:hover,
.mobile-bottom-nav__item:focus-visible {
  color: var(--mbn-active);
  background: color-mix(in srgb, var(--mbn-active) 9%, transparent);
  outline: none;
}

.mobile-bottom-nav__item.is-active {
  color: var(--mbn-active);
}

.mobile-bottom-nav__item.is-compose {
  min-height: 50px;
  color: var(--mbn-compose);
}

.mobile-bottom-nav__item.is-compose .mobile-bottom-nav__icon {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  color: var(--mbn-compose);
  background: color-mix(in srgb, var(--mbn-compose) 9%, transparent);
}

.mobile-bottom-nav__item.is-compose:hover,
.mobile-bottom-nav__item.is-compose:focus-visible {
  color: var(--mbn-active);
}

.mobile-bottom-nav__item.is-compose:hover .mobile-bottom-nav__icon,
.mobile-bottom-nav__item.is-compose:focus-visible .mobile-bottom-nav__icon {
  color: var(--mbn-active);
  background: color-mix(in srgb, var(--mbn-active) 12%, transparent);
}

.mobile-bottom-nav__item.is-active::after {
  position: absolute;
  right: 50%;
  bottom: 2px;
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: currentColor;
  content: "";
  transform: translateX(50%);
}

.mobile-bottom-nav__icon {
  box-sizing: border-box;
  display: inline-flex;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
}

.mobile-bottom-nav__icon svg {
  width: 25px;
  height: 25px;
  stroke-width: 2;
}

.mobile-bottom-nav__label {
  display: none;
  max-width: 4.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
}

.mobile-bottom-nav.has-labels .mobile-bottom-nav__item {
  flex-direction: column;
  min-height: 50px;
}

.mobile-bottom-nav.has-labels .mobile-bottom-nav__icon {
  width: 26px;
  height: 26px;
}

.mobile-bottom-nav.has-labels .mobile-bottom-nav__icon svg {
  width: 22px;
  height: 22px;
}

.mobile-bottom-nav.has-labels .mobile-bottom-nav__label {
  display: block;
}

@media (max-width: 767px) {
  html[data-mobile-bottom-nav-visible] button[aria-label="回到顶部"],
  html[data-mobile-bottom-nav-visible] button[title="回到顶部"] {
    bottom: var(--mbn-back-to-top-bottom, calc(5rem + env(safe-area-inset-bottom))) !important;
  }
}

@media (prefers-color-scheme: dark) {
  .mobile-bottom-nav.is-auto-theme {
    --mbn-bg: rgba(17, 24, 39, 0.84);
    --mbn-border: rgba(255, 255, 255, 0.08);
    --mbn-shadow: rgba(0, 0, 0, 0.38);
  }

  .mobile-bottom-nav.is-auto-theme .mobile-bottom-nav__item {
    color: rgba(229, 231, 235, 0.76);
  }
}
