:root {
  --brand: #ff3b5c;          /* 主色：电商红 */
  --brand-2: #ff7a45;
  --ink: #1a1a1a;
  --muted: #8a8f99;
  --bg: #f4f5f7;
  --card: #ffffff;
  --line: #eceef2;
  --radius: 12px;
  --shadow: 0 2px 10px rgba(20, 20, 20, 0.05);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }

body.app {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  padding-bottom: 74px; /* 给底部 TabBar 留位 */
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.05);
}

a { text-decoration: none; color: inherit; }
img { display: block; max-width: 100%; }

/* ================= 顶部栏 ================= */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: 52px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.brand__mark {
  width: 26px; height: 26px; border-radius: 8px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #ff5b78, var(--brand));
  color: #fff; font-size: 14px; font-weight: 700;
}
.brand__name { font-size: 15px; font-weight: 800; letter-spacing: .5px; white-space: nowrap; }

.quicknav {
  display: flex;
  align-items: center;
  gap: 14px;
  overflow-x: auto;
  scrollbar-width: none;
  flex: 1 1 auto;
  min-width: 0;
  padding: 0 4px;
}
.quicknav::-webkit-scrollbar { display: none; }
.quicknav__item {
  font-size: 14px;
  color: #333;
  white-space: nowrap;
  padding: 4px 0;
  position: relative;
}
.quicknav__item.is-active { color: var(--brand); font-weight: 700; }
.quicknav__item.is-active::after {
  content: ""; position: absolute; left: 50%; bottom: -2px; transform: translateX(-50%);
  width: 16px; height: 3px; border-radius: 2px; background: var(--brand);
}

.topbar__tools { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.icon-btn { position: relative; font-size: 18px; line-height: 1; }
.badge {
  position: absolute; top: -4px; right: -8px;
  min-width: 15px; height: 15px; padding: 0 3px;
  border-radius: 999px; background: var(--brand); color: #fff;
  font-size: 10px; line-height: 15px; text-align: center; font-weight: 700;
}
.quota {
  display: flex; align-items: center; gap: 3px;
  font-size: 12px; color: #333;
  padding: 4px 8px; border: 1px solid var(--line); border-radius: 999px;
}

/* ================= 搜索 ================= */
.searchbar {
  position: sticky;
  top: 52px;
  z-index: 39;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  background: #fff;
}
.searchbar__box {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 12px;
  border: 1.5px solid var(--brand);
  border-radius: 999px;
  background: #fff;
}
.searchbar__icon { font-size: 14px; opacity: .6; }
.searchbar__box input {
  flex: 1; min-width: 0; border: none; outline: none; background: transparent;
  font-size: 14px; color: var(--ink);
}
.searchbar__btn {
  flex: 0 0 auto;
  height: 36px; padding: 0 18px;
  border: none; border-radius: 999px; cursor: pointer;
  background: linear-gradient(135deg, #ff5b78, var(--brand));
  color: #fff; font-size: 14px; font-weight: 700;
}

/* ================= 分类 Tab ================= */
.cattabs {
  position: sticky;
  top: 108px;
  z-index: 38;
  height: 44px;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 14px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}
.cattabs::-webkit-scrollbar { display: none; }
.cattabs__item {
  font-size: 14px; color: #444; white-space: nowrap;
  position: relative; padding: 4px 0;
}
.cattabs__item.is-active { color: var(--brand); font-weight: 700; }
.cattabs__item.is-active::after {
  content: ""; position: absolute; left: 50%; bottom: -1px; transform: translateX(-50%);
  width: 18px; height: 3px; border-radius: 2px; background: var(--brand);
}

/* ================= 内容区 ================= */
.feed { padding: 10px; }

.promo {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  margin-bottom: 10px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #ff6b81, #ff3b5c 55%, #ff8a3d);
  color: #fff;
  box-shadow: 0 6px 16px rgba(255, 59, 92, 0.25);
}
.promo__text { display: flex; flex-direction: column; }
.promo__text strong { font-size: 15px; font-weight: 800; }
.promo__text span { font-size: 12px; opacity: .9; margin-top: 2px; }
.promo__cta { font-size: 13px; font-weight: 700; white-space: nowrap; }

/* ================= 商品网格 ================= */
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.card {
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}

/* 商品图：真实产品图，1:1 铺满 */
.pimg {
  aspect-ratio: 1 / 1;
  background: #fff;
  overflow: hidden;
}
.pimg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card__body { padding: 9px 10px 12px; display: flex; flex-direction: column; gap: 5px; }
.card__title {
  font-size: 13px; line-height: 1.4; font-weight: 600;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; min-height: 36px;
}
.card__tags { display: flex; flex-wrap: wrap; gap: 4px; }
.tag {
  font-size: 10px; line-height: 1;
  padding: 3px 5px; border-radius: 4px;
  color: var(--brand); background: #fff0f3; border: 1px solid #ffd6de;
}
.tag--hot { color: #fff; background: var(--brand); border-color: var(--brand); }
.card__rate {
  font-size: 11px; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.price { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.price__now { color: var(--brand); font-size: 18px; font-weight: 800; letter-spacing: -.3px; }
.price__inst { font-size: 11px; color: var(--muted); }
.card__sold { font-size: 11px; color: var(--muted); }

.feed__end {
  text-align: center; font-size: 12px; color: #b7bcc5;
  padding: 20px 0 8px;
}

/* ================= 底部 TabBar ================= */
.tabbar {
  position: fixed;
  left: 50%; transform: translateX(-50%);
  bottom: 0;
  width: 100%; max-width: 480px;
  height: 58px;
  display: flex;
  background: #fff;
  border-top: 1px solid var(--line);
  z-index: 50;
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar__item {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px;
  font-size: 11px; color: #9aa0ab;
}
.tabbar__icon { font-size: 18px; line-height: 1; filter: grayscale(1); opacity: .7; }
.tabbar__item.is-active { color: var(--brand); font-weight: 700; }
.tabbar__item.is-active .tabbar__icon { filter: none; opacity: 1; }

/* =========================================================
 * 子页面通用头部
 * ========================================================= */
.pagehd {
  position: sticky;
  top: 0;
  z-index: 45;
  height: 52px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.pagehd--brand {
  background: linear-gradient(135deg, #4b86ff, #2b5cff);
  border-bottom: none;
  color: #fff;
}
.pagehd__back {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  font-size: 24px; line-height: 1;
  color: inherit;
}
.pagehd__title {
  flex: 1;
  text-align: center;
  font-size: 17px;
  font-weight: 700;
}
.pagehd__title--left { text-align: left; padding-left: 6px; }
.pagehd--plain { border-bottom: none; }
.pagehd__right {
  width: 32px;
  display: flex; align-items: center; justify-content: center;
  position: relative; color: inherit; font-size: 18px;
}
.pagehd--brand .badge { background: #fff; color: var(--brand); }

.card__link { display: block; color: inherit; }

/* =========================================================
 * 分类页
 * ========================================================= */
.cat-layout { display: flex; align-items: flex-start; }
.cat-rail {
  width: 88px;
  flex: 0 0 88px;
  background: #f7f8fa;
  border-right: 1px solid var(--line);
  min-height: calc(100vh - 126px);
}
.rail__item {
  display: block;
  padding: 16px 8px;
  font-size: 13px;
  color: #555;
  text-align: center;
  position: relative;
}
.rail__item.is-active {
  background: #fff;
  color: var(--brand);
  font-weight: 700;
}
.rail__item.is-active::before {
  content: "";
  position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 18px; border-radius: 2px; background: var(--brand);
}
.cat-main { flex: 1; min-width: 0; padding: 10px; }
.cat-main__title { font-size: 15px; font-weight: 700; margin: 2px 0 10px; }
.cat-main .grid { grid-template-columns: 1fr 1fr; }

/* =========================================================
 * 商品详情
 * ========================================================= */
.app--detail { padding-bottom: 92px; }
.pd__gallery { background: #fff; }
.pd__main img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; display: block; }
.pd__thumbs { display: flex; gap: 8px; padding: 10px 14px; overflow-x: auto; }
.pd__thumb {
  flex: 0 0 auto; width: 56px; height: 56px; padding: 0;
  border: 2px solid transparent; border-radius: 8px; overflow: hidden;
  background: #fff; cursor: pointer;
}
.pd__thumb img { width: 100%; height: 100%; object-fit: cover; }
.pd__thumb.is-active { border-color: var(--brand); }

.pd__info { padding: 6px 14px 14px; background: #fff; }
.pd__price { display: flex; align-items: baseline; gap: 8px; }
.pd__price .price__now { font-size: 26px; }
.pd__title { font-size: 17px; font-weight: 700; line-height: 1.45; margin: 8px 0 6px; }
.pd__desc { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.pd__specs {
  font-size: 13px; color: #444;
  background: #f7f8fa; border-radius: 10px;
  padding: 12px; margin-top: 12px;
}
.pd__qty { display: flex; align-items: center; gap: 10px; margin-top: 14px; font-size: 14px; }
.pd__qty > span { margin-right: 4px; color: #444; }
.qty-btn {
  width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 8px;
  background: #fff; font-size: 17px; line-height: 1; cursor: pointer; color: #333;
}
.qty-input {
  width: 46px; height: 30px; text-align: center; font-size: 15px;
  border: none; outline: none; background: transparent;
}
.pd__section { background: #fff; border-radius: 12px; margin: 10px; padding: 14px; }
.pd__section h2 { font-size: 15px; margin-bottom: 8px; }
.pd__section p { font-size: 13px; color: var(--muted); line-height: 1.8; margin-bottom: 6px; }

.pd__bar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 0;
  width: 100%; max-width: 480px;
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px calc(9px + env(safe-area-inset-bottom));
  background: #fff; border-top: 1px solid var(--line); z-index: 60;
}
.pd__bar-cart {
  flex: 0 0 auto; display: flex; flex-direction: column; align-items: center;
  font-size: 10px; color: #666; gap: 2px;
}
.pd__bar-cart::before { content: "🛒"; font-size: 18px; }
.pd__bar .btn--ghost { flex: 1; height: 46px; padding: 0; }
.pd__bar .btn--primary { flex: 1.2; height: 46px; padding: 0; font-size: 15px; }

/* =========================================================
 * 购物车
 * ========================================================= */
.cart-wrap { padding: 10px 10px 90px; }
.cart-item {
  display: flex; gap: 10px;
  background: #fff; border-radius: 12px; padding: 10px;
  margin-bottom: 10px; box-shadow: var(--shadow);
}
.cart-item__img { flex: 0 0 auto; }
.cart-item__img img { width: 84px; height: 84px; object-fit: cover; border-radius: 8px; display: block; }
.cart-item__info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cart-item__name {
  font-size: 13px; font-weight: 600; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.cart-item__inst { font-size: 11px; color: var(--muted); margin-top: 3px; }
.cart-item__bottom { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 6px; }
.cart-item__ops { display: flex; align-items: center; gap: 6px; }
.cart-item__ops .js-qty { font-size: 13px; min-width: 18px; text-align: center; }
.cart-item__del { border: none; background: none; color: var(--muted); font-size: 11px; cursor: pointer; padding: 4px; }
.cart-summary {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 0;
  width: 100%; max-width: 480px;
  background: #fff; border-top: 1px solid var(--line);
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  z-index: 50;
}
.cart-total { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; font-size: 14px; }
.cart-total .price__now { font-size: 22px; }
.empty-state { text-align: center; padding: 56px 0; color: var(--muted); font-size: 14px; }
.empty-state__icon { font-size: 48px; margin-bottom: 8px; }
.empty-state .btn { margin-top: 16px; }
.empty { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 40px 0; font-size: 14px; }

/* =========================================================
 * 借钱页
 * ========================================================= */
.loan { padding: 12px; }
.credit-card {
  background: radial-gradient(120% 90% at 100% 0%, #4b86ff, #2b5cff 55%, #1f47d6);
  border-radius: 16px; padding: 20px; color: #fff;
  box-shadow: 0 12px 28px rgba(43, 92, 255, 0.35);
}
.credit-card__label { font-size: 13px; opacity: .88; }
.credit-card__num { font-size: 38px; font-weight: 800; letter-spacing: 1px; margin: 6px 0; }
.credit-card__sub { font-size: 12px; opacity: .85; }
.loan-form { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.loan-block { background: #fff; border-radius: 14px; padding: 14px; box-shadow: var(--shadow); }
.loan-block__hd { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; font-size: 14px; }
#loanAmount { width: 100%; accent-color: var(--brand); }
.loan-scale { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 4px; }
.term-row { display: flex; gap: 8px; }
.term-chip {
  flex: 1; padding: 10px 0; border: 1px solid var(--line); border-radius: 10px;
  background: #fff; font-size: 13px; color: #333; cursor: pointer;
}
.term-chip.is-active { border-color: var(--brand); color: var(--brand); background: #fff5f7; font-weight: 700; }
.loan-result {
  display: flex; align-items: baseline; justify-content: space-between;
  background: #fff; border-radius: 14px; padding: 16px; box-shadow: var(--shadow); font-size: 14px;
}
.loan-result .price__now { font-size: 24px; }
.loan-tip { font-size: 12px; color: var(--muted); text-align: center; line-height: 1.6; }

/* =========================================================
 * 我的
 * ========================================================= */
.profile { padding: 10px; }
.user-card {
  display: flex; align-items: center; gap: 12px;
  background: linear-gradient(135deg, #4b86ff, #2b5cff);
  border-radius: 16px; padding: 18px; color: #fff;
  box-shadow: 0 12px 28px rgba(43, 92, 255, 0.3);
}
.user-card__avatar {
  width: 48px; height: 48px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  display: grid; place-items: center; font-size: 20px; font-weight: 700;
}
.user-card__info { flex: 1; }
.user-card__info h2 { font-size: 17px; }
.user-card__info p { font-size: 12px; opacity: .85; margin-top: 2px; }
.user-card__lv {
  font-size: 11px; padding: 3px 8px; border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.55);
}
.order-card { background: #fff; border-radius: 14px; padding: 14px; margin-top: 12px; box-shadow: var(--shadow); }
.order-card__hd { display: flex; align-items: center; justify-content: space-between; font-size: 14px; font-weight: 700; }
.order-card__hd a { font-size: 12px; color: var(--muted); font-weight: 400; }
.order-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 16px; text-align: center; font-size: 11px; color: #555; }
.order-grid a { display: flex; flex-direction: column; align-items: center; gap: 6px; position: relative; }
.order-grid__icon { font-size: 22px; }
.order-badge {
  position: absolute; top: -4px; right: 12px;
  background: var(--brand); color: #fff;
  font-size: 9px; font-style: normal; line-height: 14px;
  min-width: 14px; height: 14px; padding: 0 3px; border-radius: 999px;
}
.menu { background: #fff; border-radius: 14px; margin-top: 12px; overflow: hidden; box-shadow: var(--shadow); }
.menu a {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; font-size: 14px; border-bottom: 1px solid var(--line);
}
.menu a:last-child { border-bottom: none; }
.menu a span:last-child { color: #c3c8d1; }
.profile__tip { font-size: 12px; color: var(--muted); text-align: center; margin: 16px 0; }

/* =========================================================
 * 轻提示 & 促销位变体
 * ========================================================= */
.toast {
  position: fixed; left: 50%; bottom: 96px; transform: translate(-50%, 8px);
  background: rgba(20, 20, 20, 0.8); color: #fff;
  font-size: 13px; padding: 9px 18px; border-radius: 999px;
  opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease;
  z-index: 200; white-space: nowrap;
}
.toast.is-show { opacity: 1; transform: translate(-50%, 0); }
.promo--alt { background: linear-gradient(135deg, #6a5cff, #2b5cff 60%, #3b7bff); box-shadow: 0 6px 16px rgba(43, 92, 255, 0.25); }

/* =========================================================
 * 通用按钮（此前只写了修饰类、缺基础类，导致浏览器默认灰按钮）
 * ========================================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 46px; padding: 0 22px;
  border: 1px solid transparent; border-radius: 999px;
  font-family: inherit; font-size: 15px; font-weight: 700; line-height: 1;
  color: #333; background: #f1f3f6;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: transform .12s ease, box-shadow .12s ease, opacity .12s ease;
}
.btn:active { transform: scale(.985); }
.btn--primary {
  color: #fff;
  background: linear-gradient(135deg, #ff5b78, var(--brand) 58%, #ff7a45);
  box-shadow: 0 8px 18px rgba(255, 59, 92, .28);
}
.btn--block { display: flex; width: 100%; }
.btn--ghost { color: var(--brand); background: #fff5f7; border-color: #ffd0da; box-shadow: none; }
.btn--line { color: #333; background: #fff; border-color: var(--line); }
.btn--sm { height: 34px; padding: 0 14px; font-size: 13px; }
.btn[disabled] { opacity: .45; pointer-events: none; }

/* =========================================================
 * 通用卡片 / 列表单元
 * ========================================================= */
.sheet { background: #fff; border-radius: 14px; margin: 10px; box-shadow: var(--shadow); overflow: hidden; }
.sheet__hd {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px 6px; font-size: 14px; font-weight: 700;
}
.sheet__hd em { font-style: normal; font-size: 12px; font-weight: 400; color: var(--muted); }
.cell {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 14px 16px; font-size: 14px; border-bottom: 1px solid var(--line);
  background: #fff; width: 100%; text-align: left; font-family: inherit; color: inherit;
  border-left: none; border-right: none; border-top: none; cursor: pointer;
}
.cell:last-child { border-bottom: none; }
.cell__val { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.cell--link .cell__val::after { content: "›"; color: #c3c8d1; font-size: 17px; line-height: 1; }
.cell__val b { color: var(--brand); font-size: 15px; }

/* 分段 Tab（订单/优惠券） */
.seg {
  display: flex; gap: 20px; align-items: center;
  height: 46px; padding: 0 16px;
  background: #fff; border-bottom: 1px solid var(--line);
  overflow-x: auto; scrollbar-width: none;
  position: sticky; top: 52px; z-index: 30;
}
.seg::-webkit-scrollbar { display: none; }
.seg__item { font-size: 14px; color: #555; white-space: nowrap; position: relative; padding: 4px 0; }
.seg__item.is-active { color: var(--brand); font-weight: 700; }
.seg__item.is-active::after {
  content: ""; position: absolute; left: 50%; bottom: -1px; transform: translateX(-50%);
  width: 18px; height: 3px; border-radius: 2px; background: var(--brand);
}

/* 底部操作条 */
.bbar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 0;
  width: 100%; max-width: 480px;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  background: #fff; border-top: 1px solid var(--line); z-index: 60;
}
.bbar__sum { flex: 1; min-width: 0; font-size: 12px; color: var(--muted); }
.bbar__sum b { display: block; color: var(--brand); font-size: 20px; font-weight: 800; }
.bbar .btn { flex: 0 0 auto; min-width: 132px; }
.app--bar { padding-bottom: 92px; }

/* =========================================================
 * 收货地址
 * ========================================================= */
.addr-card {
  position: relative; background: #fff; border-radius: 14px;
  padding: 14px 16px; margin: 10px; box-shadow: var(--shadow);
}
.addr-card__hd { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; }
.addr-card__hd i { font-style: normal; font-size: 12px; font-weight: 400; color: #666; }
.addr-card__tag {
  font-size: 10px; font-weight: 400; padding: 2px 6px; border-radius: 4px;
  color: var(--brand); background: #fff0f3; border: 1px solid #ffd6de;
}
.addr-card__tag--def { color: #fff; background: var(--brand); border-color: var(--brand); }
.addr-card__body { font-size: 13px; color: #666; line-height: 1.65; margin-top: 6px; padding-right: 8px; }
.addr-card__ops {
  display: flex; align-items: center; justify-content: flex-end; gap: 8px;
  margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line);
}
.addr-card__ops .btn { height: 32px; padding: 0 12px; font-size: 12px; }

/* 表单 */
.form { padding: 2px 0 6px; }
.field {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 16px; border-bottom: 1px solid var(--line); font-size: 14px;
}
.field:last-child { border-bottom: none; }
.field > label { flex: 0 0 68px; color: #333; }
.field input, .field textarea, .field select {
  flex: 1; min-width: 0; border: none; outline: none; background: transparent;
  font-family: inherit; font-size: 14px; color: var(--ink);
}
.field input::placeholder, .field textarea::placeholder { color: #c3c8d1; }
.form__foot { padding: 14px; }
.form__foot .btn { width: 100%; }

/* =========================================================
 * 优惠券
 * ========================================================= */
.cpn {
  display: flex; align-items: stretch;
  background: #fff; border-radius: 12px; margin: 0 10px 10px;
  box-shadow: var(--shadow); overflow: hidden;
}
.cpn__amt {
  flex: 0 0 104px; width: 104px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; color: var(--brand);
  background: linear-gradient(135deg, #fff2f5, #ffe1e8);
  border-right: 1px dashed #ffd0da;
}
.cpn__amt b { font-size: 25px; font-weight: 800; letter-spacing: -.5px; }
.cpn__amt b small { font-size: 13px; font-weight: 700; margin-left: 1px; }
.cpn__amt span { font-size: 10px; color: #b9586c; }
.cpn__info { flex: 1; min-width: 0; padding: 12px; display: flex; flex-direction: column; gap: 4px; }
.cpn__name { font-size: 14px; font-weight: 700; }
.cpn__meta { font-size: 11px; color: var(--muted); }
.cpn__act { align-self: center; padding-right: 12px; }
.cpn__act .btn { height: 32px; padding: 0 14px; font-size: 12px; }
.cpn.is-off { filter: grayscale(1); opacity: .55; }
.cpn.is-off .cpn__act { display: none; }
.cpn__stamp {
  align-self: center; padding-right: 14px; font-size: 12px;
  color: #b7bcc5; transform: rotate(-8deg); border: 1px solid #dfe3ea;
  border-radius: 999px; padding: 3px 10px;
}

/* =========================================================
 * 订单
 * ========================================================= */
.order { background: #fff; border-radius: 14px; margin: 10px; padding: 12px 14px; box-shadow: var(--shadow); }
.order__hd { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--muted); }
.order__no { max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.order__status { font-size: 13px; font-weight: 700; color: var(--brand); }
.order__item { display: flex; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.order__hd + .order__item { border-top: none; margin-top: 8px; }
.order__item img { width: 64px; height: 64px; border-radius: 8px; object-fit: cover; flex: 0 0 auto; }
.order__item-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.order__item-name {
  font-size: 13px; line-height: 1.4; font-weight: 600;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.order__item-meta { font-size: 11px; color: var(--muted); }
.order__item-price { font-size: 13px; color: #333; }
.order__ft { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 10px; border-top: 1px solid var(--line); }
.order__total { font-size: 12px; color: #666; }
.order__total b { color: var(--brand); font-size: 17px; font-weight: 800; }
.order__ops { display: flex; gap: 8px; }
.order__ops .btn { height: 32px; padding: 0 14px; font-size: 12px; }

/* =========================================================
 * 结算
 * ========================================================= */
.ck-addr {
  display: flex; align-items: center; gap: 10px;
  margin: 10px; padding: 14px 16px;
  background: #fff; border-radius: 14px; box-shadow: var(--shadow);
}
.ck-addr__icon { font-size: 18px; }
.ck-addr__main { flex: 1; min-width: 0; }
.ck-addr__main b { font-size: 14px; }
.ck-addr__main p { font-size: 12px; color: #666; margin-top: 3px; line-height: 1.5; }
.ck-addr__main p.empty { color: var(--brand); }
.ck-addr::after { content: "›"; color: #c3c8d1; font-size: 18px; }
.ck-item { display: flex; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.ck-item:last-child { border-bottom: none; }
.ck-item img { width: 62px; height: 62px; border-radius: 8px; object-fit: cover; flex: 0 0 auto; }
.ck-item__info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.ck-item__name {
  font-size: 13px; font-weight: 600; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.ck-item__meta { font-size: 11px; color: var(--muted); }
.ck-item__price { font-size: 13px; font-weight: 700; color: var(--brand); }
.ck-note { padding: 12px 16px; font-size: 12px; color: var(--muted); line-height: 1.7; }
.term-row--sm .term-chip { padding: 7px 0; font-size: 12px; }

/* =========================================================
 * 客服
 * ========================================================= */
.chat { padding: 12px 12px 108px; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 80%; padding: 10px 13px; border-radius: 14px; font-size: 13.5px; line-height: 1.6; word-break: break-word; }
.msg--in { align-self: flex-start; background: #fff; border-top-left-radius: 4px; box-shadow: var(--shadow); }
.msg--out {
  align-self: flex-end; color: #fff; border-top-right-radius: 4px;
  background: linear-gradient(135deg, #ff5b78, var(--brand));
}
.msg--time { align-self: center; font-size: 11px; color: #b7bcc5; background: none; padding: 2px 0; }
.quick-q { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 12px 10px; }
.quick-q button {
  font-family: inherit; font-size: 12px; color: #444;
  padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line);
  background: #fff; cursor: pointer;
}
.chat-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  background: #fff;
}
.chat-foot {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 0;
  width: 100%; max-width: 480px;
  background: #fff; border-top: 1px solid var(--line); z-index: 60;
}
.chat-bar input {
  flex: 1; min-width: 0; height: 38px; padding: 0 14px;
  border: none; border-radius: 999px; outline: none; background: #f4f5f7;
  font-family: inherit; font-size: 14px;
}
.chat-bar .btn { height: 38px; padding: 0 18px; font-size: 14px; }

/* =========================================================
 * 开关 / 设置
 * ========================================================= */
.switch { position: relative; flex: 0 0 auto; width: 44px; height: 26px; }
.switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 2; }
.switch i { position: absolute; inset: 0; border-radius: 999px; background: #dfe3ea; transition: background .18s ease; }
.switch i::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
  transition: transform .18s ease;
}
.switch input:checked + i { background: #34c759; }
.switch input:checked + i::after { transform: translateX(18px); }

/* =========================================================
 * 活动页 / 频道页
 * ========================================================= */
.promo-hero {
  margin: 10px; padding: 22px 18px; border-radius: 16px; color: #fff;
  background: linear-gradient(135deg, #ff6b81, #ff3b5c 55%, #ff8a3d);
  box-shadow: 0 10px 24px rgba(255, 59, 92, .28);
}
.promo-hero--blue {
  background: linear-gradient(135deg, #6a5cff, #2b5cff 60%, #3b7bff);
  box-shadow: 0 10px 24px rgba(43, 92, 255, .28);
}
.promo-hero__tag {
  display: inline-block; font-size: 11px; padding: 3px 9px; border-radius: 999px;
  background: rgba(255, 255, 255, .22); margin-bottom: 10px;
}
.promo-hero__title { font-size: 24px; font-weight: 800; line-height: 1.25; }
.promo-hero__sub { font-size: 12px; opacity: .9; margin-top: 6px; }
.promo-hero__cd {
  display: flex; gap: 6px; margin-top: 14px; font-size: 11px; align-items: center;
}
.promo-hero__cd b {
  background: rgba(0, 0, 0, .22); border-radius: 5px; padding: 4px 7px;
  font-size: 13px; font-weight: 700;
}
.rule-list { padding: 4px 16px 14px; font-size: 12px; color: #666; line-height: 1.9; }
.rule-list li { margin-left: 16px; }
.ch-hero {
  position: relative; display: flex; align-items: center; gap: 12px;
  margin: 10px; padding: 18px 16px; border-radius: 16px; overflow: hidden;
  color: #fff;
  background: linear-gradient(135deg, #6a5cff, #2b5cff 60%, #3b7bff);
  box-shadow: 0 10px 24px rgba(43, 92, 255, .28);
}
.ch-hero--red { background: linear-gradient(135deg, #ff6b81, #ff3b5c 55%, #ff8a3d); box-shadow: 0 10px 24px rgba(255, 59, 92, .28); }
.ch-hero--orange { background: linear-gradient(135deg, #ff9a3d, #ff6b2c 60%, #ff4d4d); box-shadow: 0 10px 24px rgba(255, 107, 44, .28); }
.ch-hero__text { flex: 1; min-width: 0; position: relative; z-index: 1; }
.ch-hero__tag {
  display: inline-block; font-size: 11px; padding: 3px 9px; border-radius: 999px;
  background: rgba(255, 255, 255, .22); margin-bottom: 8px;
}
.ch-hero h2 { font-size: 22px; font-weight: 800; letter-spacing: .5px; }
.ch-hero p { font-size: 12px; opacity: .92; margin-top: 6px; line-height: 1.55; }
.ch-hero__pic {
  flex: 0 0 104px; width: 104px; height: 104px;
  border-radius: 14px; overflow: hidden; background: #fff;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .18);
}
.ch-hero__pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ch-filters { display: flex; gap: 8px; padding: 0 10px 4px; overflow-x: auto; scrollbar-width: none; }
.ch-filters::-webkit-scrollbar { display: none; }
.ch-filters .term-chip { flex: 0 0 auto; padding: 7px 14px; font-size: 13px; border-radius: 999px; }

/* =========================================================
 * 窄屏适配（390px 及以下）
 * ========================================================= */
@media (max-width: 420px) {
  .topbar { gap: 6px; padding: 0 10px; }
  .brand__name { font-size: 14px; letter-spacing: 0; }
  .quicknav { gap: 10px; padding: 0 2px; }
  .quicknav__item { font-size: 13.5px; }
  .quota { padding: 4px 6px; }
  .quota span:last-child { font-size: 11px; }
  .cattabs { gap: 16px; padding: 0 12px; }
  .cattabs__item { font-size: 13.5px; }
}
