/* 五栏 APP 通用：固定底栏 + 安全区 */
.app-body .app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  padding-bottom: calc(52px + env(safe-area-inset-bottom, 0px));
  background: #f2f4f8;
}

.app-body .app-main {
  flex: 1;
  width: 100%;
}

.app-tabbar {
  position: fixed;
  bottom: 0;
  left: 50%;
  z-index: 100;
  display: flex;
  width: 100%;
  max-width: 430px;
  padding: 5px 2px calc(5px + env(safe-area-inset-bottom, 0px));
  background: #fff;
  border-top: 1px solid #e4e8ef;
  transform: translateX(-50%);
  box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.06);
}

.app-tabbar:has(a:nth-child(5)) a {
  font-size: 9px;
}

.app-tabbar:has(a:nth-child(5)) .tab-icon svg {
  width: 20px;
  height: 20px;
}

.app-tabbar a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 44px;
  padding: 2px;
  color: #8c94a3;
  font-size: 10px;
  font-weight: 500;
  -webkit-tap-highlight-color: transparent;
}

.app-tabbar .tab-icon {
  display: flex;
  width: 24px;
  height: 24px;
  color: #8c94a3;
}

.app-tabbar .tab-icon svg {
  width: 22px;
  height: 22px;
}

.app-tabbar a.is-active {
  color: #c41e22;
}

.app-tabbar a.is-active .tab-icon {
  color: #c41e22;
}

.app-tabbar .tab-icon {
  position: relative;
}

.tab-badge {
  position: absolute;
  top: -5px;
  right: -12px;
  z-index: 2;
  min-width: 16px;
  padding: 1px 4px;
  border: 1.5px solid #fff;
  border-radius: 8px;
  background: linear-gradient(135deg, #ff6b35, #e8382a);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(232, 56, 42, 0.45);
  animation: mall-badge-pulse 2.4s ease-in-out infinite;
}

.app-tabbar a.tab-mall-flash .tab-badge {
  animation: mall-badge-flash 0.5s ease-in-out 3;
}

@keyframes mall-badge-flash {
  0%, 100% { transform: scale(1); box-shadow: 0 2px 6px rgba(232, 56, 42, 0.45); }
  50% { transform: scale(1.22); box-shadow: 0 0 0 4px rgba(255, 107, 53, 0.35), 0 4px 12px rgba(232, 56, 42, 0.55); }
}

@keyframes mall-badge-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

.toast {
  bottom: calc(64px + env(safe-area-inset-bottom, 0px));
}
