/* Prevent layout shift when switching tab pages (scrollbar / width) */
html {
  scrollbar-gutter: stable;
}

/* 首页：底栏 + 中置上浮头像，主内容底部留白 */
body.xw-tab-home-page main {
  padding-bottom: calc(env(safe-area-inset-bottom, 12px) + 6.75rem);
}

body.xw-tab-home-page .safe-area-bottom {
  padding-bottom: 0;
}

#xw-tab-bar {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 100%;
  max-width: 28rem;
  z-index: 50;
  box-sizing: border-box;
  overflow: visible;
  padding: 6px 6px max(env(safe-area-inset-bottom, 10px), 10px);
  background: rgba(251, 249, 246, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid rgba(209, 196, 189, 0.5);
  box-shadow: 0 -4px 16px rgba(44, 40, 37, 0.06);
}

#xw-tab-bar .xw-tab-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: end;
  width: 100%;
  max-width: 420px;
  height: 52px;
  margin: 0 auto;
  overflow: visible;
}

#xw-tab-bar .xw-tab-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 48px;
  min-width: 0;
  padding: 0 2px 2px;
  color: #605e5b;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  box-sizing: border-box;
}

#xw-tab-bar .xw-tab-item.is-active {
  color: #52463d;
}

#xw-tab-bar .xw-tab-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  flex-shrink: 0;
}

#xw-tab-bar .xw-tab-icon-wrap svg {
  width: 22px;
  height: 22px;
  display: block;
}

#xw-tab-bar .xw-tab-label {
  display: block;
  font-size: 10px;
  line-height: 14px;
  height: 14px;
  margin-top: 2px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-align: center;
}

#xw-tab-bar .xw-tab-item.is-active .xw-tab-label {
  font-weight: 600;
}

#xw-tab-bar .xw-tab-center {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  height: 52px;
  margin-top: -34px;
  text-decoration: none;
  box-sizing: border-box;
  overflow: visible;
}

#xw-tab-bar .xw-tab-center img {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  box-sizing: border-box;
  border: none;
  outline: none;
  background: #fff;
  /* 非首页：缩小并贴栏，彩色不变 */
  transform: translateY(2px) scale(0.82);
  box-shadow: 0 2px 8px rgba(44, 40, 37, 0.12);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

#xw-tab-bar .xw-tab-center:active img {
  transition-duration: 0.08s;
}

#xw-tab-bar .xw-tab-center:not(.is-active):active img {
  transform: translateY(4px) scale(0.8);
}

#xw-tab-bar .xw-tab-center.is-active img {
  /* 首页：放大上浮，强阴影 */
  transform: translateY(-10px) scale(1);
  box-shadow: 0 12px 28px rgba(82, 70, 61, 0.32);
}

#xw-tab-bar .xw-tab-center.is-active:active img {
  transform: translateY(-8px) scale(0.97);
}

/* 首页选中：头像下方小圆点（与左右 Tab 字重变粗同级提示） */
#xw-tab-bar .xw-tab-center.is-active::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 5px;
  height: 5px;
  margin-left: -2.5px;
  border-radius: 50%;
  background: #e5c281;
  box-shadow: 0 0 0 2px rgba(251, 249, 246, 0.9);
}