/**
 * 全站统一底部导航 — 与「中国AI芯片认购」静态稿底栏一致
 * 由 Template/Mobile/footer.html 引入；$fm / $footer_active 逻辑不变。
 */

/**
 * 底栏贴紧屏幕下沿，安全区用 padding 顶起内容，避免与 iOS Home 指示条 /
 * Android 手势条重叠；需配合 viewport 含 viewport-fit=cover 才能拿到 env 值。
 */
.bottom-nav-wrap {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2000;
  pointer-events: none;
  box-sizing: border-box;
  /* 旧 iOS */
  padding-bottom: calc(6px + constant(safe-area-inset-bottom));
  padding-bottom: calc(6px + env(safe-area-inset-bottom, 0px));
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}

.bottom-nav {
  position: relative;
  z-index: 1;
  width: calc(100% - 24px);
  max-width: 406px;
  height: 52px;
  margin: 0 auto;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid #bfe2ff;
  box-shadow: 0 8px 22px rgba(30, 126, 255, 0.12), inset 0 0 12px rgba(230, 246, 255, 0.9);
  display: grid;
  grid-template-columns: 1fr 1fr 1.25fr 1fr 1fr;
  align-items: center;
  box-sizing: border-box;
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.bottom-nav::before {
  content: "";
  position: absolute;
  z-index: 0;
  left: 50%;
  top: -8px;
  width: 56px;
  height: 18px;
  transform: translateX(-50%);
  border-radius: 20px 20px 0 0;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid #bfe2ff;
  border-bottom: 0;
  box-shadow: 0 -3px 8px rgba(30, 126, 255, 0.06);
  box-sizing: border-box;
}

.nav-item,
a.nav-item {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 11px;
  font-weight: 700;
  color: #8a96a8;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  min-width: 0;
}

.nav-item.active {
  color: #1677ff;
}

.nav-item.active .nav-icon {
  color: #1677ff;
}

/* H9 入口：图标右上角「火爆」角标（活动提示） */
.nav-icon-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 21px;
  height: 21px;
}

.nav-hot-badge {
  position: absolute;
  top: -8px;
  right: -14px;
  z-index: 3;
  padding: 2px 5px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.02em;
  color: #fff;
  white-space: nowrap;
  pointer-events: none;
  background: linear-gradient(135deg, #f97316 0%, #ef4444 55%, #dc2626 100%);
  box-shadow: 0 2px 6px rgba(220, 38, 38, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.65);
}

.nav-item.nav-item--h9.active .nav-hot-badge {
  border-color: rgba(255, 255, 255, 0.85);
}

.nav-icon {
  width: 21px;
  height: 21px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #8a96a8;
}

.nav-svg {
  width: 21px;
  height: 21px;
  stroke: currentColor;
  stroke-width: 2.3;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-chip,
a.nav-chip {
  position: relative;
  z-index: 3;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transform: translateY(-3px);
  text-decoration: none;
  color: #1677ff;
  font-size: 10px;
  font-weight: 800;
  -webkit-tap-highlight-color: transparent;
}

.chip-button {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(180deg, #f3fbff, #ffffff);
  border: 1px solid #b9e2ff;
  box-shadow: 0 4px 10px rgba(22, 119, 255, 0.12), inset 0 0 8px rgba(22, 119, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
}

.chip-inner {
  position: relative;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: linear-gradient(145deg, #1677ff, #5ec2ff);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 900;
  box-shadow: inset 0 0 8px rgba(255, 255, 255, 0.35);
  overflow: visible;
}

.chip-inner::before,
.chip-inner::after {
  content: "";
  position: absolute;
  left: -5px;
  right: -5px;
  top: 7px;
  height: 18px;
  background: repeating-linear-gradient(
    90deg,
    transparent 0 5px,
    rgba(113, 205, 255, 0.85) 5px 6px,
    transparent 6px 10px
  );
  z-index: -1;
}

.chip-inner::after {
  transform: rotate(90deg);
}

.chip-text {
  margin-top: 1px;
  line-height: 1;
  color: #1677ff;
}

.chip-line {
  width: 22px;
  height: 3px;
  border-radius: 999px;
  margin-top: 3px;
  background: #1677ff;
}

.nav-chip.nav-chip--active .chip-text {
  color: #0958d9;
}

.nav-chip.nav-chip--active .chip-line {
  box-shadow: 0 0 6px rgba(22, 119, 255, 0.35);
}

.nav-item--placeholder {
  visibility: hidden;
  pointer-events: none;
}

.nav-chip--placeholder {
  visibility: hidden;
  pointer-events: none;
}
