/* =========================
   Xboard 移动端底部菜单 - 暗色主题增强版
   ========================= */

.xb-mobile-menu-enabled {
  padding-bottom: 88px !important;
}

.xb-mobile-bottom-menu {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 99990;
  padding: 0 10px calc(env(safe-area-inset-bottom) + 8px);
  pointer-events: none;
}

.xb-mobile-bottom-menu.is-visible {
  pointer-events: auto;
}

.xb-mobile-bottom-menu__inner {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: stretch;
  gap: 8px;
  min-height: 68px;
  padding: 8px 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(7, 12, 26, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.35);
  border-radius: 18px 18px 0 0;
}

.xb-mobile-bottom-menu__item {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.82);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 52px;
  text-decoration: none;
  border-radius: 14px;
  padding: 6px 4px;
  font-size: 12px;
  line-height: 1.1;
  transition: all 0.18s ease;
}

.xb-mobile-bottom-menu__item:active {
  transform: scale(0.96);
}

.xb-mobile-bottom-menu__item:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
}

.xb-mobile-bottom-menu__item.is-active {
  color: #7ef0c9;
  background: rgba(28, 201, 167, 0.14);
  box-shadow: inset 0 0 0 1px rgba(126, 240, 201, 0.15);
}

.xb-mobile-bottom-menu__icon {
  display: block;
  font-size: 22px;
  line-height: 1;
}

.xb-mobile-bottom-menu__label {
  display: block;
  font-size: 12px;
  line-height: 1.1;
  font-weight: 600;
  letter-spacing: 0.2px;
}

/* 菜单按钮单独强化 */
.xb-mobile-bottom-menu__item[data-xb-menu-open="1"] {
  background: linear-gradient(180deg, #2f3444 0%, #232838 100%);
  color: #eef3ff;
  box-shadow:
    0 6px 18px rgba(0, 0, 0, 0.28),
    inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.xb-mobile-bottom-menu__item[data-xb-menu-open="1"] .xb-mobile-bottom-menu__icon,
.xb-mobile-bottom-menu__item[data-xb-menu-open="1"] .xb-mobile-bottom-menu__label {
  color: #eef3ff;
}

.xb-mobile-bottom-menu__item[data-xb-menu-open="1"]:hover {
  background: linear-gradient(180deg, #3a4156 0%, #2a3041 100%);
  color: #ffffff;
}

.xb-mobile-menu-open .xb-mobile-bottom-menu__item[data-xb-menu-open="1"] {
  background: linear-gradient(180deg, #4b556d 0%, #384057 100%);
  color: #ffffff;
  box-shadow:
    0 8px 22px rgba(0, 0, 0, 0.3),
    inset 0 0 0 1px rgba(126, 240, 201, 0.22);
}

/* =========================
   菜单弹层
   ========================= */

.xb-mobile-menu-sheet {
  position: fixed;
  inset: 0;
  z-index: 99991;
  pointer-events: none;
}

.xb-mobile-menu-sheet.is-open {
  pointer-events: auto;
}

.xb-mobile-menu-sheet__overlay {
  position: absolute;
  inset: 0;
  background: rgba(3, 7, 18, 0.48);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.xb-mobile-menu-sheet.is-open .xb-mobile-menu-sheet__overlay {
  opacity: 1;
}

.xb-mobile-menu-sheet__panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 84px;
  margin: 0 10px;
  background: #f7f8fc;
  color: #222a3a;
  border-radius: 24px 24px 18px 18px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
  transform: translateY(24px);
  opacity: 0;
  transition: all 0.22s ease;
  overflow: hidden;
}

.xb-mobile-menu-sheet.is-open .xb-mobile-menu-sheet__panel {
  transform: translateY(0);
  opacity: 1;
}

.xb-mobile-menu-sheet__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px 12px;
  border-bottom: 1px solid rgba(20, 28, 45, 0.08);
}

.xb-mobile-menu-sheet__title {
  font-size: 16px;
  font-weight: 700;
  color: #182033;
}

.xb-mobile-menu-sheet__close {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  background: rgba(27, 35, 55, 0.06);
  color: #1a2233;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  font-size: 22px;
  line-height: 1;
}

.xb-mobile-menu-sheet__list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 14px 14px 18px;
}

.xb-mobile-menu-sheet__link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 82px;
  padding: 12px 8px;
  border-radius: 16px;
  background: #ffffff;
  text-decoration: none;
  color: #1d2434;
  box-shadow: inset 0 0 0 1px rgba(24, 32, 51, 0.06);
  transition: all 0.18s ease;
}

.xb-mobile-menu-sheet__link:hover,
.xb-mobile-menu-sheet__link:active {
  background: #eef7f5;
  color: #0f7f66;
  box-shadow: inset 0 0 0 1px rgba(15, 127, 102, 0.14);
}

.xb-mobile-menu-sheet__link-icon {
  font-size: 24px;
  line-height: 1;
}

.xb-mobile-menu-sheet__link-label {
  font-size: 13px;
  line-height: 1.2;
  font-weight: 600;
  text-align: center;
  color: inherit;
}

/* 避让 Crisp 气泡 */
.crisp-client,
#crisp-chatbox {
  bottom: 132px !important;
  right: 10px !important;
}

/* 平板优化 */
@media (min-width: 768px) and (max-width: 1024px) {
  .xb-mobile-bottom-menu {
    left: 50%;
    right: auto;
    width: min(760px, calc(100vw - 20px));
    transform: translateX(-50%);
    padding-left: 0;
    padding-right: 0;
  }

  .xb-mobile-menu-sheet__panel {
    left: 50%;
    right: auto;
    width: min(760px, calc(100vw - 20px));
    transform: translate(-50%, 24px);
    margin: 0;
  }

  .xb-mobile-menu-sheet.is-open .xb-mobile-menu-sheet__panel {
    transform: translate(-50%, 0);
  }
}
.xb-mobile-bottom-menu__inner {
  padding-right: 18px;
}

.xb-mobile-bottom-menu__item[data-xb-menu-open="1"] {
  margin-right: 6px;
}