/* ============================================================
   嗨培商城 · 客户端 H5 样式（移动优先）
   ============================================================ */

body {
  background: var(--c-bg);
  padding-bottom: env(safe-area-inset-bottom);
}

.app-main {
  min-height: 100vh;
  padding-bottom: 78px;
}

/* ---------------- 顶栏 ---------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #fff;
  border-bottom: 1px solid transparent;
}
.topbar .bar {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 50px;
  padding: 0 14px;
}
.topbar .bar .back {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--c-text);
  margin-left: -6px;
}
.topbar .bar .title {
  font-size: var(--fz-lg);
  font-weight: 700;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.topbar .bar .act { font-size: 20px; width: 30px; text-align: center; position: relative; }
.topbar .bar .dot {
  position: absolute; top: 0; right: 2px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--c-red);
}
.topbar.home {
  background: linear-gradient(160deg, #F5D321 0%, #E4B815 55%, #A0700A 100%);
  color: #fff;
  border-bottom: none;
  padding-bottom: 12px;
}
.topbar.home .bar { height: 54px; }
.topbar.home .bar .title { font-size: 19px; letter-spacing: .5px; }
.topbar.home .back-host {
  flex: 0 0 auto;
  height: 28px;
  line-height: 26px;
  padding: 0 10px;
  margin-left: 4px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, .55);
  background: rgba(255, 255, 255, .18);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.topbar.home .back-host:active { background: rgba(255, 255, 255, .34); }

/* 首页搜索 */
.search-box {
  margin: 0 14px;
  height: 38px;
  background: rgba(255, 255, 255, .95);
  border-radius: 19px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  gap: 8px;
  box-shadow: 0 2px 8px rgba(180, 60, 0, .12);
}
.search-box input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: var(--fz-md);
  min-width: 0;
}
.search-box .ico { color: var(--c-text-3); font-size: 15px; }

/* ---------------- 底部 Tab ---------------- */
.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: 58px;
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(255, 255, 255, .97);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--c-border);
  display: flex;
  z-index: 200;
}
.tabbar a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 11px;
  color: var(--c-text-3);
  position: relative;
}
.tabbar a .ico { font-size: 20px; line-height: 1; filter: grayscale(1); opacity: .55; }
.tabbar a.active { color: var(--c-primary); font-weight: 700; }
.tabbar a.active .ico { filter: none; opacity: 1; transform: translateY(-1px); }
.tabbar a .tab-dot {
  position: absolute;
  top: 8px;
  left: 50%;
  margin-left: 4px;
  min-width: 15px;
  height: 15px;
  padding: 0 3px;
  border-radius: 8px;
  background: var(--c-red);
  color: #fff;
  font-size: 10px;
  line-height: 15px;
  text-align: center;
  font-weight: 700;
  display: none;
}
.tabbar a .tab-dot.show { display: block; }

/* ---------------- 通用区块 ---------------- */
.sec {
  margin: 12px 12px 0;
}
.sec-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 4px 2px 10px;
}
.sec-head h3 {
  font-size: var(--fz-lg);
  font-weight: 800;
  letter-spacing: .3px;
}
.sec-head .more { font-size: var(--fz-xs); color: var(--c-text-3); }
.sec-head .more::after { content: ' ›'; }

/* 类目宫格 */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px 0;
  background: #fff;
  border-radius: var(--r-3);
  padding: 14px 6px;
  box-shadow: var(--sh-1);
}
.cat-grid a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px 0;
  font-size: var(--fz-xs);
  color: var(--c-text-2);
}
.cat-grid .ci {
  width: 42px; height: 42px;
  border-radius: 14px;
  background: linear-gradient(145deg, #fff2ea, #ffe3d2);
  display: flex; align-items: center; justify-content: center;
  font-size: 21px;
}
.cat-grid a:active .ci { transform: scale(.93); }
.cat-grid a:nth-child(4n+2) .ci { background: linear-gradient(145deg, #eaf1ff, #d8e6ff); }
.cat-grid a:nth-child(4n+3) .ci { background: linear-gradient(145deg, #eafaf0, #d5f3e3); }
.cat-grid a:nth-child(4n+4) .ci { background: linear-gradient(145deg, #f8f0ff, #eddcff); }

/* 公告条 */
.notice-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 12px 0;
  padding: 9px 12px;
  background: #fff8f3;
  border-radius: 10px;
  font-size: var(--fz-xs);
  color: #a8562a;
  border: 1px solid #ffe4d3;
}
.notice-bar .ico { font-size: 14px; }

/* 横滑 */
.hscroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 2px 12px 4px;
  margin: 0 -12px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.hscroll::-webkit-scrollbar { display: none; }
.pcard {
  flex: 0 0 118px;
  background: #fff;
  border-radius: var(--r-2);
  overflow: hidden;
  box-shadow: var(--sh-1);
}
.pcard .cover { height: 96px; font-size: 34px; }
.pcard .pc-body { padding: 7px 8px 9px; }
.pcard .pc-title {
  font-size: var(--fz-xs);
  line-height: 1.35;
  height: 2.7em;
  overflow: hidden;
  color: var(--c-text);
}
.pcard .pc-price { margin-top: 4px; font-size: var(--fz-sm); }

/* 商品网格 */
.goods-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.gcard {
  background: #fff;
  border-radius: var(--r-2);
  overflow: hidden;
  box-shadow: var(--sh-1);
  display: block;
}
.gcard .cover { height: 0; padding-bottom: 100%; position: relative; font-size: 46px; }
.gcard .cover > * { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.gcard .cover img { width: 100%; height: 100%; object-fit: cover; }
.gcard .g-body { padding: 8px 10px 11px; }
.gcard .g-title {
  font-size: var(--fz-sm);
  line-height: 1.4;
  height: 2.8em;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  color: var(--c-text);
}
.gcard .g-sub {
  font-size: 11px;
  color: var(--c-text-3);
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gcard .g-foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-top: 7px;
}
.gcard .g-sales { font-size: 11px; color: var(--c-text-3); }
.gcard .badge { position: absolute; left: 6px; top: 6px; z-index: 2; }
.gcard .cover-wrap { position: relative; }

/* ---------------- 筛选条 ---------------- */
.filter-bar {
  position: sticky;
  top: 50px;
  z-index: 90;
  display: flex;
  gap: 6px;
  padding: 8px 12px;
  background: #fff;
  border-bottom: 1px solid var(--c-border);
  overflow-x: auto;
  scrollbar-width: none;
}
.filter-bar::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto;
  height: 30px;
  padding: 0 13px;
  border-radius: 15px;
  background: var(--c-gray-l);
  color: var(--c-text-2);
  font-size: var(--fz-sm);
  display: inline-flex;
  align-items: center;
}
.chip.active { background: var(--c-primary-l); color: var(--c-primary-d); font-weight: 700; }

/* ---------------- 商品详情 ---------------- */
.detail-cover {
  height: 0;
  padding-bottom: 78%;
  position: relative;
  font-size: 86px;
  background: linear-gradient(150deg, #FFF9EC, #F6DFAA);
  display: flex;
  align-items: center;
  justify-content: center;
}
.detail-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.detail-cover .ph { font-size: 86px; }
.detail-price {
  background: linear-gradient(180deg, #FFF9EC, #fff);
  padding: 14px 14px 16px;
}
.detail-price .p-row { display: flex; align-items: baseline; gap: 8px; }
.detail-price .p-row .price { font-size: 28px; }
.detail-price .tagline { font-size: var(--fz-xs); color: #b45309; margin-top: 6px; }
.detail-title {
  background: #fff;
  padding: 14px;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.45;
}
.detail-sub { padding: 0 14px 14px; background: #fff; color: var(--c-text-3); font-size: var(--fz-sm); }
.detail-block {
  background: #fff;
  margin-top: 10px;
  padding: 14px;
}
.detail-block .blk-title { font-size: var(--fz-sm); color: var(--c-text-3); margin-bottom: 8px; }
.kv-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  padding: 7px 0;
  font-size: var(--fz-sm);
}
.kv-row .k { color: var(--c-text-3); flex: 0 0 auto; }
.kv-row .v { color: var(--c-text-2); text-align: right; }
.detail-desc { font-size: var(--fz-md); line-height: 1.85; color: var(--c-text-2); white-space: pre-wrap; word-break: break-word; }
.merchant-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.merchant-logo {
  width: 42px; height: 42px; border-radius: 12px;
  background: linear-gradient(145deg, #FFF8E8, #F6DFAA);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex: 0 0 auto;
}
.merchant-name { font-weight: 700; font-size: var(--fz-md); }
.merchant-desc { font-size: var(--fz-xs); color: var(--c-text-3); margin-top: 2px; }

/* 底部操作栏 */
.action-bar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, .98);
  border-top: 1px solid var(--c-border);
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 200;
}
.action-bar .ab-price { flex: 0 0 auto; }
.action-bar .ab-price .lbl { font-size: 11px; color: var(--c-text-3); }
.action-bar .btn { flex: 1; height: 46px; font-size: var(--fz-lg); }

/* ---------------- 表单页 ---------------- */
.page-pad { padding: 12px; }
.form-card { background: #fff; border-radius: var(--r-3); padding: 16px; margin-bottom: 12px; }
.form-card h4 { font-size: var(--fz-md); font-weight: 700; margin-bottom: 14px; }

/* 选择卡片 */
.opt-list { display: flex; flex-direction: column; gap: 10px; }
.opt {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-2);
  background: #fff;
  transition: border-color .15s, background .15s;
}
.opt.active { border-color: var(--c-primary); background: var(--c-primary-l); }
.opt.disabled { opacity: .5; }
.opt .oi { font-size: 22px; flex: 0 0 auto; }
.opt .ot { flex: 1; min-width: 0; }
.opt .ot .n { font-weight: 700; font-size: var(--fz-md); }
.opt .ot .d { font-size: var(--fz-xs); color: var(--c-text-3); margin-top: 2px; line-height: 1.45; }
.opt .radio {
  width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid var(--c-border);
  flex: 0 0 auto;
  position: relative;
}
.opt.active .radio { border-color: var(--c-primary); }
.opt.active .radio::after {
  content: '';
  position: absolute; inset: 3px;
  border-radius: 50%;
  background: var(--c-primary);
}

/* 地址卡 */
.addr-card {
  padding: 14px;
  border-radius: var(--r-2);
  background: #fff;
  border: 1.5px dashed var(--c-border);
  display: flex;
  align-items: center;
  gap: 12px;
}
.addr-card.filled { border-style: solid; }
.addr-card .ai { font-size: 20px; }
.addr-card .at { flex: 1; min-width: 0; }
.addr-card .at .l1 { font-weight: 700; font-size: var(--fz-md); }
.addr-card .at .l2 { font-size: var(--fz-sm); color: var(--c-text-3); margin-top: 3px; line-height: 1.45; word-break: break-all; }

/* 金额汇总 */
.sum-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: var(--fz-sm); color: var(--c-text-2); }
.sum-row.total { font-size: var(--fz-md); font-weight: 700; color: var(--c-text); padding-top: 10px; margin-top: 6px; border-top: 1px solid var(--c-border); }
.sum-row.total .price { font-size: 20px; }

/* 学生信息小卡片 */
.stu-tip {
  background: #f0f7ff;
  border: 1px solid #d6e8ff;
  color: #1c4e8f;
  font-size: var(--fz-xs);
  line-height: 1.6;
  padding: 9px 11px;
  border-radius: 9px;
  margin-bottom: 12px;
}
.verify-ok { color: var(--c-green); font-size: var(--fz-sm); font-weight: 600; }
.verify-bad { color: var(--c-red); font-size: var(--fz-sm); font-weight: 600; }

/* ---------------- 订单 ---------------- */
.order-card {
  background: #fff;
  border-radius: var(--r-3);
  margin-bottom: 10px;
  overflow: hidden;
  box-shadow: var(--sh-1);
}
.order-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid #f5f6f8;
}
.order-head .mname { font-size: var(--fz-sm); font-weight: 700; display: flex; align-items: center; gap: 6px; }
.order-body { padding: 12px 14px; display: flex; gap: 11px; }
.order-body .cover { width: 74px; height: 74px; border-radius: 10px; flex: 0 0 auto; font-size: 26px; }
.order-body .ob-info { flex: 1; min-width: 0; }
.order-body .ob-title {
  font-size: var(--fz-sm);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.order-body .ob-meta { font-size: var(--fz-xs); color: var(--c-text-3); margin-top: 5px; }
.order-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px 14px 13px;
  border-top: 1px solid #f5f6f8;
}
.order-foot .total { margin-right: auto; font-size: var(--fz-xs); color: var(--c-text-3); }
.order-foot .total b { color: var(--c-red); font-size: var(--fz-md); }

/* 状态条 */
.status-hero {
  background: linear-gradient(150deg, #F5D321, #E4B815);
  color: #fff;
  padding: 20px 16px 24px;
}
.status-hero .st { font-size: 20px; font-weight: 800; }
.status-hero .sd { font-size: var(--fz-xs); opacity: .9; margin-top: 6px; line-height: 1.5; }
.status-hero.gray { background: linear-gradient(150deg, #9aa4b2, #7c8794); }
.status-hero.green { background: linear-gradient(150deg, #34d399, #12b76a); }
.status-hero.blue { background: linear-gradient(150deg, #6c96ff, #2b5cff); }

/* 时间轴 */
.steps { display: flex; flex-direction: column; gap: 0; }
.step { display: flex; gap: 11px; }
.step .dotcol { display: flex; flex-direction: column; align-items: center; width: 14px; flex: 0 0 auto; }
.step .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c-border); margin-top: 5px; flex: 0 0 auto; }
.step.on .dot { background: var(--c-primary); box-shadow: 0 0 0 3px rgba(198, 152, 8,.15); }
.step .line { width: 2px; flex: 1; background: var(--c-border); margin: 3px 0; min-height: 18px; }
.step:last-child .line { display: none; }
.step .sc { padding-bottom: 14px; }
.step .st1 { font-size: var(--fz-sm); font-weight: 600; }
.step .st2 { font-size: var(--fz-xs); color: var(--c-text-3); margin-top: 3px; }
.step:not(.on) .st1 { color: var(--c-text-3); font-weight: 400; }

/* ---------------- 我的 ---------------- */
.mine-head {
  background: linear-gradient(160deg, #F5D321 0%, #E4B815 60%, #C1970A 100%);
  padding: 22px 18px 46px;
  color: #fff;
}
.mine-user { display: flex; align-items: center; gap: 13px; }
.mine-avatar {
  width: 56px; height: 56px; border-radius: 50%;
  background: rgba(255,255,255,.25);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
  border: 2px solid rgba(255,255,255,.5);
}
.mine-name { font-size: 19px; font-weight: 800; }
.mine-phone { font-size: var(--fz-xs); opacity: .85; margin-top: 3px; }

.mine-cards {
  margin: -34px 12px 0;
  display: flex;
  background: #fff;
  border-radius: var(--r-3);
  box-shadow: var(--sh-2);
  overflow: hidden;
}
.mine-cards a {
  flex: 1;
  padding: 15px 0 14px;
  text-align: center;
  position: relative;
}
.mine-cards a + a::before {
  content: '';
  position: absolute; left: 0; top: 22%; height: 56%;
  width: 1px; background: var(--c-border);
}
.mine-cards .cn { font-size: 19px; font-weight: 800; }
.mine-cards .cl { font-size: 11px; color: var(--c-text-3); margin-top: 2px; }

.menu-group {
  background: #fff;
  border-radius: var(--r-3);
  margin: 12px;
  overflow: hidden;
}
.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 16px;
  font-size: var(--fz-md);
}
.menu-item + .menu-item { border-top: 1px solid #f5f6f8; }
.menu-item .mi { font-size: 19px; width: 24px; text-align: center; }
.menu-item .mt2 { flex: 1; }
.menu-item .mx { color: var(--c-text-3); font-size: var(--fz-sm); }
.menu-item .mx::after { content: ' ›'; }

/* 嗨培豆卡 */
.coin-card {
  margin: 0 12px 12px;
  padding: 16px 18px;
  border-radius: var(--r-3);
  background: linear-gradient(135deg, #ffd76e, #ffb020);
  color: #6b4400;
  box-shadow: 0 6px 18px rgba(255, 176, 32, .3);
}
.coin-card .cc-lbl { font-size: var(--fz-xs); opacity: .8; }
.coin-card .cc-num { font-size: 30px; font-weight: 800; letter-spacing: .5px; }
.coin-card .cc-note { font-size: var(--fz-xs); opacity: .8; margin-top: 2px; }
.coin-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.coin-item {
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(255,255,255,.45);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: var(--fz-sm);
}
.coin-item .n { font-weight: 700; }
.coin-item .b { font-weight: 800; font-size: var(--fz-lg); }

/* ---------------- 登录页 ---------------- */
.login-wrap {
  min-height: 100vh;
  background: linear-gradient(170deg, #F5D321 0%, #E4B815 42%, #FFFAE6 42%, #FFFAE6 100%);
  padding: 0 22px;
}
.login-brand { padding: 64px 0 34px; color: #fff; }
.login-brand .lb-logo { font-size: 40px; }
.login-brand .lb-name { font-size: 27px; font-weight: 800; letter-spacing: 1px; margin-top: 6px; }
.login-brand .lb-slogan { font-size: var(--fz-sm); opacity: .9; margin-top: 6px; }
.login-card {
  background: #fff;
  border-radius: 18px;
  padding: 24px 20px 22px;
  box-shadow: 0 12px 32px rgba(16, 24, 40, .12);
}
.login-tabs { display: flex; gap: 22px; margin-bottom: 20px; }
.login-tabs button {
  font-size: 17px;
  font-weight: 700;
  color: var(--c-text-3);
  padding-bottom: 6px;
  position: relative;
}
.login-tabs button.active { color: var(--c-text); }
.login-tabs button.active::after {
  content: '';
  position: absolute; left: 50%; bottom: 0;
  transform: translateX(-50%);
  width: 22px; height: 3px; border-radius: 2px;
  background: var(--c-primary);
}
.login-foot { text-align: center; font-size: var(--fz-xs); color: var(--c-text-3); margin-top: 22px; line-height: 1.7; }

/* ---------------- 消息 ---------------- */
.msg-item {
  background: #fff;
  padding: 14px 16px;
  border-bottom: 1px solid #f5f6f8;
  display: flex;
  gap: 12px;
}
.msg-item.unread { background: #fffdfa; }
.msg-item .mi {
  width: 36px; height: 36px; border-radius: 11px;
  background: var(--c-primary-l);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex: 0 0 auto;
}
.msg-item .mc { flex: 1; min-width: 0; }
.msg-item .mt3 { font-size: var(--fz-sm); font-weight: 700; display: flex; align-items: center; gap: 6px; }
.msg-item .mcon { font-size: var(--fz-xs); color: var(--c-text-2); margin-top: 4px; line-height: 1.55; }
.msg-item .mtime { font-size: 11px; color: var(--c-text-3); margin-top: 5px; }

/* ---------------- 支付凭证上传 ---------------- */
.uploader {
  width: 100px; height: 100px;
  border: 1.5px dashed var(--c-border);
  border-radius: 10px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px;
  color: var(--c-text-3);
  font-size: var(--fz-xs);
  background: #fcfcfd;
  overflow: hidden;
}
.uploader img { width: 100%; height: 100%; object-fit: cover; }
.uploader .plus { font-size: 22px; }

/* 二维码框 */
.qr-box {
  width: 180px; height: 180px;
  margin: 0 auto;
  border-radius: 12px;
  background: #fafafa;
  border: 1px solid var(--c-border);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  color: var(--c-text-3);
  font-size: var(--fz-sm);
  text-align: center;
  padding: 10px;
}
.qr-box img { width: 100%; height: 100%; object-fit: contain; }

/* 提示条 */
.tip-bar {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  background: #fff8e6;
  border-radius: 10px;
  font-size: var(--fz-xs);
  line-height: 1.55;
  color: #8a6100;
  border: 1px solid #ffeab0;
}

/* 分隔标题 */
.group-title {
  font-size: var(--fz-xs);
  color: var(--c-text-3);
  padding: 16px 16px 8px;
  font-weight: 600;
}

/* 安全区 */
.safe-bottom { height: calc(20px + env(safe-area-inset-bottom)); }
