/*!
 * deco-tb2.css —— 装修「底部导航 · 样式类型：悬浮胶囊」
 * ZHC-DECO-TB2-20261201
 *
 * 适用范围：web-client/dist/deco/ 装修渲染页（.dz-tb2 只在 styleType=capsule 时输出）
 * 基准宽 390px；配色锁定：墨蓝 #0B2A4A / 主青蓝 #14B8A6 / 亮青 #2DD4BF / 薄荷 #8FF0E4 / 暖金 #D4AF37
 * 约束：
 *   1) 素材全部内联 SVG，不引外链、不发额外请求（图标与精灵头像都在 JS 里内联）
 *   2) 不改全局主题变量，皮肤色只在本组件作用域内声明，删掉本文件即完全还原
 *   3) 不出现会员等级、返佣、价格、收益类文案（文案全部来自商家配置的菜单名称）
 */

.dz-tb2 {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 8000;
  padding: 0 16px calc(16px + env(safe-area-inset-bottom, 0px));
  pointer-events: none;
  /* 皮肤色：只在本组件内生效 */
  --tb2-navy: #0B2A4A;
  --tb2-main: #14B8A6;
  --tb2-bright: #2DD4BF;
  --tb2-mint: #8FF0E4;
  --tb2-gold: #D4AF37;
  --tb2-off: #8AA3AD;
}

/* 白色圆角胶囊：高 62、圆角 30、投影 0 12 30 rgba(11,42,74,.16) */
.dz-tb2__bar {
  position: relative;
  display: flex;
  align-items: center;
  height: 62px;
  max-width: 430px;
  margin: 0 auto;
  background: #fff;
  border-radius: 30px;
  box-shadow: 0 12px 30px rgba(11, 42, 74, .16);
  pointer-events: auto;
  animation: dzTb2In .55s cubic-bezier(.22, 1, .36, 1) both;
}

/* 五个槽位均分（左右各两项 + 中间按钮占位） */
.dz-tb2__i,
.dz-tb2__slot {
  flex: 1 1 0;
  min-width: 0;
  height: 100%;
}

.dz-tb2__i {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform .18s ease;
}

.dz-tb2__ico {
  display: block;
  width: 22px;
  height: 22px;
  color: var(--tb2-off);
  transition: transform .28s cubic-bezier(.34, 1.56, .64, 1), color .2s ease;
}

.dz-tb2__ico svg {
  display: block;
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dz-tb2__ico img {
  display: block;
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.dz-tb2__t {
  margin-top: 4px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: .2px;
  color: var(--tb2-off);
  transition: color .2s ease;
  white-space: nowrap;
}

/* 激活：青蓝 */
.dz-tb2__i.is-on .dz-tb2__ico { color: var(--tb2-main); }
.dz-tb2__i.is-on .dz-tb2__t { color: var(--tb2-main); }

/* 按压：图标缩到 .92 再回弹 */
.dz-tb2__i:active .dz-tb2__ico { transform: scale(.92); }
.dz-tb2__i:active .dz-tb2__t { opacity: .82; }

/* 中间主按钮：58 圆 / 3px 白边 / 青蓝渐变 / 向上凸出 */
.dz-tb2__main {
  position: absolute;
  left: 50%;
  top: -20px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  margin-left: -29px;
  border: 3px solid #fff;
  border-radius: 50%;
  box-sizing: border-box;
  background: linear-gradient(160deg, #2DD4BF, #14B8A6);
  box-shadow: 0 10px 22px rgba(20, 184, 166, .40), 0 2px 8px rgba(11, 42, 74, .14),
              inset 0 2px 6px rgba(255, 255, 255, .55);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  animation: dzTb2Pop .62s .1s cubic-bezier(.34, 1.56, .64, 1) both,
             dzTb2Breath 2.4s .72s ease-in-out infinite;
}

.dz-tb2__main:active { transform: translateY(-1px) scale(.92); }

/* 内嵌 38px 圆形精灵头像 */
.dz-tb2__ava {
  display: block;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  overflow: hidden;
  background: radial-gradient(circle at 32% 26%, var(--tb2-mint), var(--tb2-bright) 62%, var(--tb2-main));
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, .7);
}

.dz-tb2__ava svg {
  display: block;
  width: 100%;
  height: 100%;
}

.dz-tb2__ava img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 入场：从底部上浮淡入 */
@keyframes dzTb2In {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes dzTb2Pop {
  from { opacity: 0; transform: translateY(10px) scale(.82); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* 主按钮 2.4s 呼吸光晕（用扩散光环做，不遮挡按钮本体） */
@keyframes dzTb2Breath {
  0%, 100% {
    box-shadow: 0 10px 22px rgba(20, 184, 166, .38), 0 0 0 0 rgba(45, 212, 191, .42),
                inset 0 2px 6px rgba(255, 255, 255, .55);
  }
  55% {
    box-shadow: 0 12px 26px rgba(20, 184, 166, .48), 0 0 0 9px rgba(45, 212, 191, 0),
                inset 0 2px 6px rgba(255, 255, 255, .55);
  }
}

/* 页面底部预留 96px，最后一块内容不被胶囊挡住 */
body.has-dz-tb2 #deco-root { padding-bottom: 96px; }

/* 低端机 / 截图 / ?motion=off：关动效但保留静态阴影 */
#deco-root[data-motion="off"] .dz-tb2__bar,
#deco-root[data-motion="off"] .dz-tb2__main {
  animation: none;
}
#deco-root[data-motion="off"] .dz-tb2__main {
  box-shadow: 0 10px 22px rgba(20, 184, 166, .40), 0 2px 8px rgba(11, 42, 74, .14),
              inset 0 2px 6px rgba(255, 255, 255, .55);
}

@media (prefers-reduced-motion: reduce) {
  .dz-tb2__bar,
  .dz-tb2__main { animation: none; }
  .dz-tb2__main {
    box-shadow: 0 10px 22px rgba(20, 184, 166, .40), 0 2px 8px rgba(11, 42, 74, .14),
                inset 0 2px 6px rgba(255, 255, 255, .55);
  }
  .dz-tb2__ico { transition: color .2s ease; }
}

/* 极窄屏（320）：只微缩字号与图标，左右仍保持 16px 距边（规格要求） */
@media (max-width: 340px) {
  .dz-tb2__t { font-size: 10.5px; }
  .dz-tb2__ico, .dz-tb2__ico svg { width: 20px; height: 20px; }
}

/* 大屏（平板/桌面）：胶囊限宽居中，不铺满 */
@media (min-width: 768px) {
  .dz-tb2__bar { max-width: 420px; }
}

/* ================================================================
 * 以下为 styleType=text / bulge 的补齐样式
 * 说明：这两种样式在编辑器里早就有选项，但 C 端渲染器此前完全忽略 styleType，
 *      选了等于没选。本次一并接上，避免「下拉里四个、实际上一个都不生效」。
 * ================================================================ */

/* 纯文字：去掉图标位，字号提上来，垂直居中 */
.dz-tabbar--text .dz-tabbar__i {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .2px;
}

.dz-tabbar--text .dz-tabbar__i span {
  font-size: 13px;
}

/* 中间凸起：中间那一项做成 46px 圆形抬起，当前项颜色填充 */
.dz-tabbar--bulge .dz-tabbar__i--bulge {
  position: relative;
  justify-content: flex-end;
  padding-bottom: 5px;
}

.dz-tabbar--bulge .dz-tabbar__i--bulge .dz-tabbar__ico {
  width: 46px;
  height: 46px;
  margin-top: -26px;
  border-radius: 50%;
  opacity: 1;
  background: currentColor;
  box-shadow: 0 6px 14px rgba(11, 42, 74, .18);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.dz-tabbar--bulge .dz-tabbar__i--bulge .dz-tabbar__ico::after {
  content: '';
  width: 18px;
  height: 18px;
  border-radius: 6px;
  background: #fff;
  opacity: .92;
}

.dz-tabbar--bulge .dz-tabbar__i--bulge img {
  width: 24px;
  height: 24px;
  margin-top: -26px;
  border-radius: 50%;
  background: currentColor;
  padding: 10px;
  box-sizing: border-box;
  box-shadow: 0 6px 14px rgba(11, 42, 74, .18);
  position: relative;
  z-index: 1;
}

/* 主按钮点击反馈：头像轻晃（没配链接时也不至于「点了没反应」） */
.dz-tb2__main[data-tap] .dz-tb2__ava {
  animation: dzTb2Nod .6s cubic-bezier(.34, 1.56, .64, 1);
}

@keyframes dzTb2Nod {
  0%   { transform: scale(1) rotate(0); }
  32%  { transform: scale(.86) rotate(-7deg); }
  68%  { transform: scale(1.04) rotate(4deg); }
  100% { transform: scale(1) rotate(0); }
}
