/* ============================================================
   组件库 —— 尺寸/颜色均取自参考稿实测
   ============================================================ */

/* ---------- 导航栏 ---------- */
.navbar {
  flex: none;
  height: var(--h-nav);
  display: flex;
  align-items: center;
  position: relative;
  padding: 0 var(--pad);
  background: var(--c-bg);
}
.navbar .back {
  width: 20px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  cursor: pointer;
  flex: none;
}
.navbar .back img { height: 20px; display: block; }
.navbar .title {
  position: absolute;
  left: 0;
  right: 0;
  text-align: center;
  font-size: var(--fs-17);
  font-weight: var(--fw-sb);
  color: var(--c-text-1);
  pointer-events: none;
}
.navbar .action {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  font-size: var(--fs-14);
  color: var(--c-text-1);
  cursor: pointer;
}
.navbar .action img { height: 22px; display: block; }

/* ---------- 底部 TabBar ---------- */
.tabbar {
  flex: none;
  height: var(--h-tab);
  display: flex;
  align-items: flex-start;
  padding-top: 7px;
  background: var(--c-bg);
  border-top: 1px solid var(--c-line);
}
.tabbar .tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  color: var(--c-text-2);
  font-size: var(--fs-12);
  text-decoration: none;
}
.tabbar .tab img {
  width: 24.6px;
  height: 24.6px;
  display: block;
}
.tabbar .tab.active { color: #191818; font-weight: var(--fw-m); }

/* ---------- 卡片 / 区块 ---------- */
.section-title {
  font-size: var(--fs-16);
  font-weight: var(--fw-sb);
  color: var(--c-text-1);
  padding: 14px var(--pad) 8px;
  display: flex;
  align-items: center;
}
.section-title .more {
  margin-left: auto;
  font-size: var(--fs-13);
  font-weight: var(--fw-r);
  color: var(--c-text-2);
  display: flex;
  align-items: center;
  gap: 2px;
}
.divider { height: 1px; background: var(--c-line); }
.divider.inset { margin: 0 var(--pad); }

/* ---------- 列表行 ---------- */
.cell {
  display: flex;
  align-items: center;
  min-height: var(--h-row);
  padding: 0 var(--pad);
  font-size: var(--fs-14);
  color: var(--c-text-1);
  cursor: pointer;
}
.cell .label { flex: none; }
.cell .value {
  margin-left: auto;
  color: var(--c-text);
  display: flex;
  align-items: center;
  gap: 4px;
}
.cell:active { background: #fafafa; }

/* ---------- 底部操作栏 ---------- */
.actionbar {
  flex: none;
  height: var(--h-actionbar);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 var(--pad);
  background: #fff;
  border-top: 1px solid var(--c-line);
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: var(--h-btn);
  padding: 0 22px;
  border-radius: var(--r-pill);
  border: 0;
  font-size: var(--fs-15);
  font-weight: var(--fw-m);
  background: var(--c-primary-2);
  color: #fff;
  cursor: pointer;
  white-space: nowrap;
}
.btn:active { filter: brightness(.94); }
.btn.outline {
  background: #fff;
  border: 1.5px solid #fe6a2a;
  color: var(--c-price);
}
.btn.ghost {
  background: #fff;
  border: 1.5px solid var(--c-border-2);
  color: var(--c-text-1);
}
.btn.sm { height: var(--h-btn-sm); padding: 0 14px; font-size: var(--fs-13); }
.btn.block { width: 100%; }

/* ---------- chip / 标签 ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: var(--h-chip);
  padding: 0 13px;
  border-radius: var(--r-8);
  background: var(--c-bg-gray);
  color: var(--c-text);
  font-size: var(--fs-13);
  cursor: pointer;
  white-space: nowrap;
}
.chip.round { border-radius: var(--r-pill); }
.chip.active { background: var(--c-primary-soft); color: var(--c-primary); }

.tag {
  display: inline-flex;
  align-items: center;
  height: 17px;
  padding: 0 5px;
  border-radius: var(--r-3);
  background: var(--c-primary-soft);
  color: var(--c-primary);
  font-size: var(--fs-11);
  white-space: nowrap;
}
.tag.gray { background: var(--c-bg-gray); color: var(--c-text-3); }

/* ---------- 价格 ---------- */
.price {
  color: var(--c-price);
  font-weight: var(--fw-sb);
  font-size: var(--fs-19);
  line-height: 1;
}
.price .sym { font-size: .68em; margin-right: 1px; }
.price.lg { font-size: var(--fs-25); }
.price.sm { font-size: var(--fs-15); }
.price-old {
  color: var(--c-text-3);
  font-size: var(--fs-13);
  text-decoration: line-through;
  margin-left: 6px;
}

/* ---------- 商品缩略图 ---------- */
.thumb {
  flex: none;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.thumb img { max-width: 100%; max-height: 100%; display: block; }

/* ---------- 勾选 ---------- */
.check {
  flex: none;
  width: 20.5px;
  height: 19.7px;
  border-radius: 50%;
  border: 1px solid var(--c-border-2);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.check.on { border-color: var(--c-primary); background: var(--c-primary); }
.check svg { width: 11px; height: 9px; display: none; }
.check.on svg { display: block; }

/* ---------- 数量步进器 ---------- */
.stepper { display: flex; align-items: center; gap: 2px; }
.stepper button {
  width: 24.6px;
  height: 24.6px;
  border: 0;
  border-radius: var(--r-6);
  background: var(--c-bg-gray-3);
  color: var(--c-text-1);
  font-size: var(--fs-15);
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.stepper button:disabled { color: var(--c-text-4); }
.stepper .num {
  min-width: 34px;
  height: 24.6px;
  border-radius: var(--r-6);
  background: var(--c-bg-gray-3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-13);
  color: var(--c-text-1);
}

/* ---------- 搜索框 ---------- */
.searchbar {
  flex: 1;
  height: var(--h-search);
  border-radius: var(--r-pill);
  background: var(--c-bg-gray-2);
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 7px;
  color: var(--c-text-3);
  font-size: var(--fs-14);
  cursor: pointer;
}
.searchbar img { width: 15px; height: 15px; display: block; }

/* ---------- 徽标 ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: var(--r-pill);
  background: var(--c-price);
  color: #fff;
  font-size: var(--fs-10);
  font-weight: var(--fw-m);
}
.badge.gray { background: rgba(0, 0, 0, .32); }

/* ---------- 时间轴 ---------- */
.timeline { position: relative; padding-left: 26px; }
.timeline::before {
  content: '';
  position: absolute;
  left: 3.5px;
  top: 6px;
  bottom: 6px;
  width: 1.5px;
  background: var(--c-line-2);
}
.timeline .node { position: relative; padding: 0 0 20px 12px; }
.timeline .node::before {
  content: '';
  position: absolute;
  left: -6.5px;
  top: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #dcdcdc;
}
.timeline .node.active::before { background: var(--c-primary); }

/* ---------- 空状态 ---------- */
.empty {
  padding: 60px 0;
  text-align: center;
  color: var(--c-text-3);
  font-size: var(--fs-14);
}
.empty img { width: 90px; opacity: .5; display: block; margin: 0 auto 12px; }

/* ---------- 工具类 ---------- */
.row { display: flex; align-items: center; }
.col { display: flex; flex-direction: column; }
.grow { flex: 1 1 auto; min-width: 0; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.center { display: flex; align-items: center; justify-content: center; }
