/* ==========================================================================
   火猩食品 · Mars Food 全局样式
   源自 miniprogram/app.wxss 逐字转写：CSS 变量原值不变，rpx÷2→px
   1px = 2rpx（设计稿 375 宽 ←→ 750rpx）
   ========================================================================== */
:root {
  --red: #FF223F;
  --red-0: #FF2140;
  --red-2: #FF6B4A;
  --red-3: #FF5C45;
  --red-deep: #E01B36;
  --red-ink: #7A3B42;
  --blue: #76A1DE;
  --org: #FF9969;
  --pink: #FCEAED;
  --sand: #F8EBE5;
  --tip: #FFF0F1;
  --tip-ink: #E0455C;
  --ink: #22262B;
  --ink2: #6B7280;
  --ink3: #9AA0A6;
  --ph: #B3B8BE;
  --page: #F5F6F8;
  --page2: #F7F7FA;
  --line: #EEF0F3;
  --line2: #F4F5F7;
  --step: #F1F2F5;
}

/* page → html/body 浅色背景；#app 为 375px 固定宽居中白底容器 */
html, body {
  margin: 0;
  padding: 0;
  background: var(--page);
  color: var(--ink);
  font-family: "PingFang SC", "Source Han Sans CN", "Helvetica Neue", Helvetica, sans-serif;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}
#app {
  max-width: 375px;
  margin: 0 auto;
  min-height: 100vh;
  background: #FFFFFF;
  position: relative;
  color: var(--ink);
  font-family: "PingFang SC", "Source Han Sans CN", "Helvetica Neue", Helvetica, sans-serif;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

/* view, text, image, input, scroll-view, swiper, swiper-item { box-sizing: border-box; } */
*, *::before, *::after { box-sizing: border-box; }
input, textarea, button, select { font-family: inherit; }

/* 网页辅助：页面片段根元素基线 */
.page { position: relative; min-height: 100vh; }

/* ---------------- 顶部 ---------------- */
.hd {
  background: linear-gradient(158deg, #FF2140 0%, #FF5C45 62%, #FF6B4A 100%);
  flex: none;
}
.nav {
  height: 44px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px 0 12px;
  position: relative;
  color: #FFFFFF;
}
/* left / right 用 100% 跟随 .nav 实际高度：五个 tab 页的 nav 由几何工具
 * 下发内联 px，非 tab 页仍是 44px，写死 44px 会在 tab 页溢出或错位。 */
.nav .left {
  position: absolute;
  left: 12px;
  top: 0;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
}
.nav .right {
  position: absolute;
  right: 10px;
  top: 0;
  height: 100%;
  display: flex;
  align-items: center;
}
.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.brand .b {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 1px;
  line-height: 1;
  color: #FFFFFF;
}
.brand .i {
  font-size: 13px;
  letter-spacing: 1px;
  line-height: 1;
  margin-top: 4px;
  color: #FFFFFF;
}
/* detail 页白底导航：原来 #B3B8BE 在手机上几乎看不清，改用正文墨色 + 次级灰 */
.brand.mute .b { color: #22262B; }
.brand.mute .i { color: #6B7280; }

/* 页面标题（05/06 用） */
.ptitle {
  font-size: 19px;
  font-weight: 700;
  color: #FFFFFF;
  letter-spacing: 0.5px;
}
.back {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.back.dark { background: rgba(0, 0, 0, 0.06); }

/* 搜索框 */
.srow {
  height: 52px;
  display: flex;
  align-items: center;
  padding-bottom: 8px;
}
.search {
  height: 40px;
  border-radius: 20px;
  background: #FFFFFF;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 15px;
  margin: 0 14px;
  flex: 1;
  font-size: 15px;
  color: var(--ph);
}
.search .ph { color: var(--ph); font-size: 15px; line-height: 1; }
.search input {
  flex: 1;
  font-size: 15px;
  color: var(--ink);
  height: 40px;
  border: 0;
  outline: 0;
  background: transparent;
}

/* ---------------- 通用 ---------------- */
.hr { height: 1px; background: var(--line); }
.row2 {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* 主按钮：100deg 渐变 */
.btn-red {
  background: linear-gradient(100deg, #FF2140, #FF5C45);
  color: #FFFFFF;
  box-shadow: 0 10px 20px -12px rgba(255, 33, 64, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
}
.btn-red:active { transform: scale(0.985); }

/* 列表 / 卡片 */
.card {
  background: #FFFFFF;
  border-radius: 14px;
  margin: 0 12px;
}
.card-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.bar {
  width: 3px;
  height: 13px;
  border-radius: 2px;
  background: var(--red);
  flex: none;
}

/* 商品行（分类 / 收藏共用） */
.prow {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: #FFFFFF;
}
.prow:active { background: #FAFBFC; }
.prow .th {
  width: 68px;
  height: 68px;
  border-radius: 8px;
  background: #F7F8FA;
  flex: none;
  object-fit: cover;
}
/* 商品图缺失 / 链接失效：中性占位，禁止使用演示期小笼包等设计素材 */
.prow .th-none {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--ink3, #9AA0A6);
  background: #F2F4F7;
  border: 1px solid #EBEEF2;
}
.prow .meta { flex: 1; min-width: 0; }
.prow .nm {
  display: block;
  font-size: 15px;
  font-weight: 500;
  line-height: 18px;
  color: var(--ink);
}
.prow .sp {
  display: block;
  font-size: 12px;
  line-height: 16px;
  color: var(--ink3);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.prow .pz {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}
.prow .pa { font-size: 15px; font-weight: 500; color: var(--red-2); }
.prow .pb { font-size: 15px; font-weight: 500; color: var(--blue); }
/* 价格权限未开通：卡片价格位只显示一行引导，不出现任何金额 */
.prow .plock {
  font-size: 13px;
  font-weight: 500;
  color: var(--blue);
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.prow .line2 { height: 1px; background: var(--line2); margin-left: 12px; }

/* 加号圆钮 24×24 */
.add {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--red);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  border: 0;
}
.add:active { transform: scale(0.88); }

/* 勾选框 18×18 */
.chk {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 0 1px #D5D8DE;
  background: #FFFFFF;
  border: 0;
}
.chk.on {
  background: var(--red-0);
  box-shadow: none;
}

/* 数量步进器 */
/* 方形步进（采购单）
 * 32px 真机上比 22px 更容易点中，数字格同步放大 */
.stp {
  display: flex;
  align-items: center;
}
.stp .btn {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: var(--step);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  border: 0;
}
.stp .btn:active { transform: scale(0.9); background: var(--line); }
.stp .n {
  min-width: 28px;
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}

/* 圆形步进（详情页） */
.stp2 {
  display: flex;
  align-items: center;
  gap: 6px;
}
.stp2 .btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--red);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  border: 0;
}
.stp2 .btn:active { transform: scale(0.9); }
.stp2 .n {
  min-width: 14px;
  text-align: center;
  font-size: 20px;
  font-weight: 700;
  color: #22252B;
}

/* 空态 */
.empty {
  padding: 70px 20px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.empty .ei {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--pink);
  display: flex;
  align-items: center;
  justify-content: center;
}
.empty .et {
  margin-top: 14px;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
}
.empty .es {
  margin-top: 6px;
  font-size: 14px;
  color: var(--ink3);
  line-height: 1.8;
}
.empty .ebtn {
  width: 238px;
  height: 42px;
  border-radius: 21px;
  margin-top: 20px;
  font-size: 16px;
  font-weight: 600;
}

/* 底栏留白（48px tabbar + safe-area）。与 components/tab-bar.js 总高绑定。 */
.tabpad {
  height: calc(48px + env(safe-area-inset-bottom));
  flex: none;
}
