/*!
 * zhc-tb3.css —— 装修「底部导航 · 中间凸起」样式
 * ZHC-DECO-TB3-20261201
 *
 * 适用范围：styleType=bulge 时输出的 .dz-tb3（C 端装修渲染页 + 编辑器画布预览）
 * 基准宽 390px；配色只读组件内变量与系统主题变量，不写死品牌色。
 * 约束：
 *   1) 只在 .dz-tb3 作用域内生效，删掉本文件即恢复原样
 *   2) 不出现价格 / 会员等级 / 收益类文案，文字全部来自商家配置
 *   3) 凸起圆靠负 margin 上移，父级必须 overflow:visible 才不被裁
 */

.dz-tb3 {
  /* 高度交给内容撑：凸起圆上移多少都不会把下面的名称挤出被裁 */
  height: auto;
  min-height: 52px;
  overflow: visible;
  align-items: flex-end;
  padding-bottom: calc(env(safe-area-inset-bottom, 0px));
}

.dz-tb3 .dz-tb3__i {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  align-self: flex-end;
  flex: 1 1 0;
  min-width: 0;
  height: auto;
  gap: 2px;
  padding-bottom: 8px;
  box-sizing: border-box;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.dz-tb3 .dz-tb3__ic {
  display: block;
  width: 22px;
  height: 22px;
  color: inherit;
  opacity: .92;
  transition: transform .22s cubic-bezier(.34, 1.56, .64, 1), opacity .2s ease;
}

.dz-tb3 .dz-tb3__ic svg,
.dz-tb3 .dz-tb3__bi svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dz-tb3 .dz-tb3__img {
  display: block;
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.dz-tb3 .dz-tb3__ch {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
}

.dz-tb3 .dz-tb3__font {
  font-family: iconfont, "Iconfont", sans-serif;
  font-style: normal;
  font-size: 22px;
  line-height: 1;
}

.dz-tb3 .dz-tb3__tx {
  font-size: 10px;
  line-height: 1.1;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  opacity: .96;
}

.dz-tb3 .dz-tb3__i.is-on .dz-tb3__ic { opacity: 1; transform: translateY(-1px); }
.dz-tb3 .dz-tb3__i:active .dz-tb3__ic { transform: scale(.9); }

/* ---- 默认款底栏的系统图标：原来只画一个灰方块，现在换成真图标 ----
   结构仍沿用 .dz-tabbar__ico（20×20），只把灰底换成内联 SVG，布局与字号不变。 */
.dz-tabbar__ico--svg {
  background: none;
  opacity: 1;
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.dz-tabbar__ico--svg svg {
  display: block;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.dz-tabbar--text .dz-tabbar__ico--svg { display: none; }

/* ---- 凸起主按钮：圆底上移，白环隔断，图标可换（图片 / 系统图标 / 文字） ---- */
.dz-tb3 .dz-tb3__i--b {
  justify-content: flex-end;
  padding-bottom: 8px;
  gap: 2px;
}

.dz-tb3 .dz-tb3__bb {
  display: block;
  width: var(--tb3-s, 52px);
  height: var(--tb3-s, 52px);
  margin-top: calc(var(--tb3-s, 52px) * -0.34);
  margin-bottom: 2px;
  flex: 0 0 auto;
}

.dz-tb3 .dz-tb3__bc {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  background: var(--tb3-c, #ff6b00);
  color: #fff;
  /* 白环用 box-shadow 外扩，避免占位影响居中 */
  box-shadow: 0 0 0 4px var(--dz-card, #ffffff), 0 8px 18px rgba(9, 20, 36, .18);
  transition: transform .22s cubic-bezier(.34, 1.56, .64, 1), box-shadow .2s ease;
}

.dz-tb3 .dz-tb3__bi {
  display: block;
  width: calc(var(--tb3-s, 52px) * 0.46);
  height: calc(var(--tb3-s, 52px) * 0.46);
  color: #fff;
}

.dz-tb3 .dz-tb3__bi .dz-tb3__img {
  /* 自定义图片铺满圆底，靠父级圆角裁成同形状（圆 / 圆角方块 / 胶囊都自动跟随） */
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.dz-tb3 .dz-tb3__bi .dz-tb3__ch { font-size: calc(var(--tb3-s, 52px) * 0.34); color: #fff; }
.dz-tb3 .dz-tb3__bi .dz-tb3__font { font-size: calc(var(--tb3-s, 52px) * 0.46); color: #fff; }

.dz-tb3 .dz-tb3__i--b:active .dz-tb3__bc { transform: scale(.93); }
.dz-tb3 .dz-tb3__i--b.is-on .dz-tb3__bc { box-shadow: 0 0 0 4px var(--dz-card, #ffffff), 0 10px 22px rgba(9, 20, 36, .24); }

/* 形状 */
.dz-tb3--squircle .dz-tb3__bc { border-radius: 32%; }
.dz-tb3--pill .dz-tb3__bb { width: calc(var(--tb3-s, 52px) * 1.16); }
.dz-tb3--pill .dz-tb3__bc { border-radius: 999px; }

/* 凸起项文字：紧贴圆底，不额外抬高 */
.dz-tb3 .dz-tb3__i--b .dz-tb3__tx { margin-top: 0; }

/* ---- 深色主题：白环换成深色卡底，避免刺眼白圈 ---- */
html[data-deco-dark="1"] .dz-tb3 .dz-tb3__bc {
  box-shadow: 0 0 0 4px var(--dz-card, #141a22), 0 8px 18px rgba(0, 0, 0, .5);
}
html[data-deco-dark="1"] .dz-tb3 .dz-tb3__i--b.is-on .dz-tb3__bc {
  box-shadow: 0 0 0 4px var(--dz-card, #141a22), 0 10px 22px rgba(0, 0, 0, .58);
}

/* ---- 入场与降级 ---- */
@keyframes dzTb3In {
  from { transform: translateY(14px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.dz-tb3 { animation: dzTb3In .34s cubic-bezier(.22, 1, .36, 1) both; }

@media (prefers-reduced-motion: reduce) {
  .dz-tb3 { animation: none; }
  .dz-tb3 .dz-tb3__ic,
  .dz-tb3 .dz-tb3__bc { transition: none; }
}

/* 编辑器画布预览：绝对定位在模拟手机底部，等比缩小，纯预览不拦点击 */
.canvas-tb3-host {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 7;
  pointer-events: none;
}
.canvas-tb3-host .dz-tb3 {
  position: relative;
  left: auto;
  right: auto;
  bottom: auto;
  animation: none;
  border-radius: 0;
}
.canvas-tb3-host .dz-tb3__i,
.canvas-tb3-host .dz-tb3__bc { pointer-events: none; }
