/* 统一底部导航 — 出发 / 带路 / 宝藏 */

:root {
  --gwm-safe-top: env(safe-area-inset-top, 0px);
  --gwm-safe-bottom: env(safe-area-inset-bottom, 0px);
  --gwm-tab-content-h: 48px;
  --gwm-tab-bar-h: calc(var(--gwm-tab-content-h) + var(--gwm-safe-bottom));
  --gwm-tab-item-h: 44px;
  --gwm-tab-item-radius: 14px;
  --gwm-tab-active-gradient: linear-gradient(135deg, rgba(166, 77, 121, 0.88), rgba(216, 108, 160, 0.48));
  --gwm-tab-active-border: rgba(216, 108, 160, 0.75);
  --gwm-shell-bg: #1F2126;
  --gwm-tab-bar-bg: var(--gwm-shell-bg);
}

/* Consumer App Shell: safe top + flexible content + bottom navigation. */
@media (max-width: 767px), (hover: none) and (pointer: coarse) {
  html.pretrip-page,
  html:has(body.route-page),
  html:has(body.guide-page) {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    min-height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
    overscroll-behavior: none;
  }

  html:has(body.route-page),
  html:has(body.guide-page) {
    background: var(--gwm-shell-bg);
  }

  body.pretrip-page,
  body.route-page,
  body.guide-page:not([data-embed="1"]) {
    box-sizing: border-box;
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    max-height: 100dvh;
    padding-top: 0;
    padding-bottom: 0;
    overflow: hidden !important;
    overscroll-behavior: none;
  }

  body.pretrip-page {
    background-color: transparent;
  }

  body.route-page,
  body.guide-page:not([data-embed="1"]) {
    padding-top: var(--gwm-safe-top);
    background-color: var(--gwm-shell-bg);
  }

  body.pretrip-page .app-shell,
  body.route-page .page,
  body.guide-page:not([data-embed="1"]) .page,
  body.guide-page.node-guide-page:not([data-embed="1"]) .node-guide-shell {
    height: 100% !important;
    min-height: 0 !important;
    max-height: 100% !important;
  }

}

.tab-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--gwm-tab-bar-h);
  display: flex;
  gap: 0;
  padding: 4px 12px var(--gwm-safe-bottom);
  background-color: var(--gwm-tab-bar-bg);
  box-shadow: 0 -1px 0 rgba(255, 255, 255, 0.06);
  z-index: 2000;
  box-sizing: border-box;
}

@media (min-width: 768px) and (hover: hover) and (pointer: fine) {
  .tab-bar {
    max-width: 480px;
    left: 50%;
    transform: translateX(-50%);
    right: auto;
    width: 100%;
  }
}

.tab-btn,
.bottom-tab {
  flex: 1 1 0;
  height: var(--gwm-tab-item-h);
  min-height: 0;
  max-height: var(--gwm-tab-item-h);
  border: 1px solid transparent;
  border-radius: var(--gwm-tab-item-radius);
  background: transparent;
  color: rgba(255, 255, 255, 0.68);
  font-size: 14px;
  font-weight: 700;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 2px 4px;
  box-sizing: border-box;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  position: relative;
}

.tab-icon {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tab-icon svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tab-label {
  line-height: 1.1;
}

.tab-btn-primary,
.bottom-tab.active {
  color: #fff;
  background: var(--gwm-tab-active-gradient);
  border-color: var(--gwm-tab-active-border);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.10) inset,
    0 4px 14px rgba(166, 77, 121, 0.22);
}

.tab-btn-primary .tab-icon svg,
.bottom-tab.active .tab-icon svg {
  stroke: #fff;
}

.tab-btn-primary::after,
.bottom-tab.active::after {
  display: none;
}

.tab-btn:active,
.bottom-tab:active {
  opacity: 0.85;
}
