/* ==========================================================================
   秋秋手作烘焙 · 社区团购 —— 前台样式（烘焙简约风）
   设计基准宽度 480px，移动优先；全部原生 CSS，无任何外链资源。
   ========================================================================== */

:root {
  --cream: #fffbf5;
  --card: #ffffff;
  --caramel: #b5723f;
  --caramel-dark: #9a5d2f;
  --butter: #f0c070;
  --text: #3d2c1e;
  --text-2: #8a7566;
  --border: #efe3d6;
  --ok: #4e9a6b;
  --warn: #c4553b;
  --shadow: 0 2px 12px rgba(181, 114, 63, 0.1);
  --shadow-lg: 0 6px 24px rgba(181, 114, 63, 0.16);
  --radius: 18px;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--cream);
  color: var(--text);
  font-family: system-ui, -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
}

a {
  color: var(--caramel);
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

.app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--cream);
  padding-bottom: 28px;
  position: relative;
}

/* ------------------------------ 顶部 Banner ------------------------------ */

/* 顶部店铺栏：店名（大字）与介绍语（小字）一行并列 */
.shop-bar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 16px 12px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}

.shop-bar h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: #5a3a1e;
  white-space: nowrap;
  flex-shrink: 0;
}

.shop-bar p {
  margin: 0;
  font-size: 12px;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: right;
  min-width: 0;
}

.banner {
  background: linear-gradient(135deg, #f6e3cc 0%, #f0c070 55%, #e5a95f 100%);
  padding: 14px 14px 16px;
  border-bottom-left-radius: 26px;
  border-bottom-right-radius: 26px;
  position: relative;
  overflow: hidden;
}

.banner-photo {
  width: 100%;
  height: 170px;
  object-fit: cover;
  border-radius: 12px;
  display: block;
  background: #f7efe4;
}

.banner::after {
  content: '';
  position: absolute;
  right: -40px;
  top: -30px;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.28);
}

/* 店铺横幅照片：通栏宽幅大图（后台「设置-店铺横幅照片」上传，未上传则整块隐藏，仅显示店名） */
/* .banner h1 / .banner p 已迁移至 .shop-bar（顶部店铺栏） */

/* ------------------------------ 通用容器 ------------------------------ */

.section {
  padding: 14px 16px 0;
}

.section-title {
  font-size: 16px;
  font-weight: 700;
  margin: 6px 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title::before {
  content: '';
  width: 4px;
  height: 16px;
  border-radius: 2px;
  background: var(--caramel);
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

/* ------------------------------ 商品卡片 ------------------------------ */

.product-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.product-card {
  background: var(--card);
  border-radius: 4px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.product-card:active {
  transform: scale(0.99);
}

/* 封面按宽度完整显示：店主素材是 2.79:1 的超宽横幅，
   固定高+cover 会左右裁掉约 55px（商品名字被切）。
   改 height:auto 等比缩放，任何比例的图都完整可见、不留白；
   min-height 仅供图片加载前占位。不用 object-fit（微信 X5 有渲染坑） */
.product-card .cover {
  width: 100%;
  height: auto;
  min-height: 120px;
  background: #f7efe4;
}

.product-card .body {
  padding: 12px 14px 14px;
}

.product-card .head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.product-card .name {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 6px;
}

.tag {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 600;
  white-space: nowrap;
}

.tag.preorder {
  background: #fdeccd;
  color: #a5701d;
}

.tag.instock {
  background: #dfeee3;
  color: var(--ok);
}

.price-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 6px;
}

.price {
  color: var(--caramel);
  font-weight: 800;
  font-size: 20px;
}

.price small {
  font-size: 12px;
  font-weight: 600;
}

.origin {
  color: var(--text-2);
  font-size: 13px;
  text-decoration: line-through;
}

.meta {
  color: var(--text-2);
  font-size: 12.5px;
  margin-top: 4px;
}

.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
}

/* 等待开团紧凑卡：第 1 行 名称+价格+规格同排，第 2 行「等待开团」替代按钮；无开团状态行 */
.product-card.compact .head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.product-card.compact .head .name {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  font-size: 15px;
}
.product-card.compact .head .price {
  font-size: 15px;
}
.product-card.compact .head .origin {
  font-size: 12px;
  color: var(--text-2);
  text-decoration: line-through;
  margin-left: -4px;
}
.product-card.compact .wait-spec {
  margin-left: auto;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.product-card.compact .wait-cta {
  margin-top: 8px;
  text-align: center;
  color: #a9744f;
  font-size: 13px;
  font-weight: 600;
  background: #faf2e8;
  border: 1px dashed #e4c9a8;
  border-radius: 8px;
  padding: 6px 0;
}

/* ------------------------------ 按钮 ------------------------------ */

.btn {
  border: none;
  border-radius: 12px;
  padding: 10px 18px;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  background: var(--caramel);
  color: #fff;
  cursor: pointer;
  transition: background 0.15s ease, opacity 0.15s ease;
}

.btn:active {
  background: var(--caramel-dark);
}

.btn.full {
  width: 100%;
  padding: 14px;
  border-radius: 14px;
  font-size: 16px;
}

.btn.ghost {
  background: #fff;
  color: var(--caramel);
  border: 1px solid var(--caramel);
}

.btn.butter {
  background: var(--butter);
  color: #6b4318;
}

.btn:disabled,
.btn.disabled {
  background: #e6dccf;
  color: #a99a89;
  cursor: not-allowed;
}

.btn.sm {
  padding: 6px 12px;
  font-size: 13px;
  border-radius: 10px;
}

/* ------------------------------ 自提说明 ------------------------------ */

.pickup {
  margin: 16px 16px 0;
  padding: 14px 16px;
  background: #fff7ec;
  border: 1px dashed var(--butter);
  border-radius: var(--radius);
  color: #7a552f;
  font-size: 13px;
  line-height: 1.7;
}

.pickup b {
  color: #5a3a1e;
}

/* ------------------------------ 详情页 ------------------------------ */

.carousel {
  position: relative;
  background: #f7efe4;
  /* 与首页商品卡同款观感：两侧留白、小圆角、细边框、浅阴影 */
  margin: 14px 16px 0;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

/* 详情页主图：用背景图渲染（微信 X5 下 img+object-fit 会整幅缩小居中留白，
   background-* 在全部内核可靠）。
   contain = 图片完整显示不裁剪，比例不一致时用底色补边；
   高度 128px 按 2.79:1 素材在 356px 宽下的自然高度取值，常见图基本无留白 */
.carousel-img {
  width: 100%;
  height: 128px;
  background-color: #f7efe4;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  display: block;
}

.carousel .dots {
  position: absolute;
  bottom: 10px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 6px;
}

.carousel .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
}

.carousel .dot.active {
  background: var(--caramel);
}

.carousel .nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.82);
  border: none;
  font-size: 18px;
  color: var(--caramel);
  cursor: pointer;
  line-height: 1;
}

.carousel .nav.prev {
  left: 10px;
}

.carousel .nav.next {
  right: 10px;
}

.back-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: rgba(255, 251, 245, 0.94);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
}

.back-bar a {
  font-size: 18px;
  color: var(--caramel);
  font-weight: 700;
}

.back-bar .t {
  font-size: 15px;
  font-weight: 700;
}

.detail-body {
  padding: 16px;
}

.detail-body h2 {
  margin: 0 0 8px;
  font-size: 20px;
}

.detail-body .sub {
  color: var(--text-2);
  font-size: 13px;
}

.block {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 16px;
  margin: 14px 16px 0;
}

.block > h3 {
  margin: 0 0 10px;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.block > h3::before {
  content: '';
  width: 4px;
  height: 14px;
  border-radius: 2px;
  background: var(--butter);
}

.spec-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.spec {
  border: 1.5px solid var(--border);
  background: #fff;
  border-radius: 12px;
  padding: 8px 14px;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  transition: all 0.15s ease;
}

.spec.active {
  border-color: var(--caramel);
  background: #fdf3e8;
  color: var(--caramel-dark);
  font-weight: 700;
}

.spec.disabled {
  opacity: 0.45;
  cursor: not-allowed;
  text-decoration: line-through;
}

.spec .sp-stock {
  display: block;
  font-size: 11px;
  color: var(--text-2);
  font-weight: 400;
}

/* ------------------------------ 详情页：多选规格（每行数量步进） ------------------------------ */

.spec-list.spec-multi {
  flex-direction: column;
  gap: 10px;
}

.spec-row {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1.5px solid var(--border);
  background: #fff;
  border-radius: 12px;
  padding: 10px 12px;
  transition: all 0.15s ease;
}

.spec-row.active {
  border-color: var(--caramel);
  background: #fdf3e8;
}

.spec-row.disabled {
  opacity: 0.55;
}

.sp-info {
  flex: 1;
  min-width: 0;
}

.sp-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.spec-row.active .sp-name {
  color: var(--caramel-dark);
}

.sp-meta {
  font-size: 12px;
  color: var(--text-2);
  margin-top: 2px;
}

.sp-stepper {
  display: inline-flex;
  align-items: center;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
}

.sp-btn {
  width: 34px;
  height: 34px;
  border: none;
  background: #fff;
  font-size: 18px;
  color: var(--caramel);
  cursor: pointer;
  font-family: inherit;
}

.sp-btn:disabled {
  color: #ccc;
  cursor: not-allowed;
}

.sp-qty {
  min-width: 30px;
  text-align: center;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  border-left: 1.5px solid var(--border);
  border-right: 1.5px solid var(--border);
  padding: 0 4px;
  font-variant-numeric: tabular-nums;
}

.sp-soldout {
  font-size: 12px;
  color: var(--warn);
  flex-shrink: 0;
}

.qty {
  display: inline-flex;
  align-items: center;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.qty button {
  width: 40px;
  height: 40px;
  border: none;
  background: #fff;
  font-size: 20px;
  color: var(--caramel);
  cursor: pointer;
  font-family: inherit;
}

.qty button:disabled {
  color: #ccc;
  cursor: not-allowed;
}

.qty input {
  width: 52px;
  height: 40px;
  border: none;
  border-left: 1.5px solid var(--border);
  border-right: 1.5px solid var(--border);
  text-align: center;
  font-size: 16px;
  font-family: inherit;
  color: var(--text);
  background: #fff;
}

.field {
  margin-bottom: 12px;
}

.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 5px;
  color: var(--text);
}

.field label .req {
  color: var(--warn);
  margin-left: 2px;
}

.field input,
.field textarea {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 11px 13px;
  font-size: 15px;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  outline: none;
  transition: border-color 0.15s ease;
}

.field input:focus,
.field textarea:focus {
  border-color: var(--butter);
}

.field textarea {
  min-height: 70px;
  resize: vertical;
}

.field .hint {
  font-size: 12px;
  color: var(--text-2);
  margin-top: 4px;
}

.detail-html {
  color: var(--text);
  font-size: 14px;
  line-height: 1.75;
  word-break: break-word;
}

.detail-html img {
  border-radius: 10px;
  margin: 6px 0;
}

.detail-html p {
  margin: 0 0 8px;
}

.detail-html h3,
.detail-html h4 {
  margin: 10px 0 6px;
  font-size: 15px;
}

.detail-html ul,
.detail-html ol {
  margin: 0 0 8px;
  padding-left: 20px;
}

/* 底部提交条 */
.submit-bar {
  position: sticky;
  bottom: 0;
  margin-top: 16px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: rgba(255, 251, 245, 0.96);
  backdrop-filter: blur(6px);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}

.submit-bar .total {
  flex: 1;
  font-size: 13px;
  color: var(--text-2);
}

.submit-bar .total b {
  display: block;
  color: var(--caramel);
  font-size: 21px;
}

/* ------------------------------ 订单页 ------------------------------ */

.status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}

.status-badge.unpaid {
  background: #fdeccd;
  color: #a5701d;
}

.status-badge.paid {
  background: #dfeee3;
  color: var(--ok);
}

/* 已付款待确认：客户已报付款、秋秋尚未确认收款（橙底，介于待付款黄与已确认绿之间） */
.status-badge.reported {
  background: #ffe9d6;
  color: #b0611c;
}

.status-badge.picked {
  background: #e2e9f7;
  color: #4a6fa5;
}

.status-badge.cancelled {
  background: #f4e0dc;
  color: var(--warn);
}

/* 已退款：红底红字，与已取消区分（已取消=流程终止，已退款=款项已退回） */
.status-badge.refunded {
  background: #fde3de;
  color: #b3372a;
}

.kv {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 14px;
}

.kv:last-child {
  border-bottom: none;
}

.kv .k {
  color: var(--text-2);
  flex: 0 0 auto;
}

.kv .v {
  text-align: right;
  font-weight: 600;
  word-break: break-all;
}

.qr-box {
  text-align: center;
  padding: 8px 0;
}

.qr-box img {
  width: 200px;
  height: 200px;
  object-fit: contain;
  margin: 0 auto 10px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #fff;
}

.qr-box .placeholder {
  width: 200px;
  height: 200px;
  margin: 0 auto 10px;
  border-radius: 14px;
  border: 1px dashed var(--butter);
  background: #fff7ec;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-2);
  font-size: 13px;
  padding: 16px;
  text-align: center;
}

.pay-tip {
  background: #fff7ec;
  border: 1px solid var(--butter);
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 14px;
  color: #7a552f;
  text-align: center;
  font-weight: 600;
}

.pay-tip b {
  color: var(--warn);
  font-size: 17px;
}

/* 下单成功页：红色大字支付金额提示（金额取自订单实际金额，仅待付款时展示） */
.pay-amount-notice {
  margin-top: 10px;
  font-size: 15px;
  font-weight: 700;
  color: #c0392b;
}

.pay-amount-big {
  margin-top: 4px;
  font-size: 38px;
  line-height: 1.15;
  font-weight: 800;
  color: #d93025;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.5px;
}

.pay-amount-big small {
  font-size: 22px;
  font-weight: 800;
}

.hint-shot {
  text-align: center;
  color: var(--text-2);
  font-size: 12.5px;
  margin-top: 10px;
}

/* 「我已支付」报付款按钮：显眼大绿按钮（诚实客户点一下，团长核查范围从全量缩到单笔） */
.btn-paid {
  display: block;
  width: 100%;
  margin-top: 14px;
  padding: 15px 18px;
  font-size: 17px;
  font-weight: 800;
  font-family: inherit;
  color: #fff;
  background: linear-gradient(135deg, #2e9e5b 0%, #1f7a44 100%);
  border: 0;
  border-radius: 14px;
  box-shadow: 0 4px 14px rgba(31, 122, 68, 0.35);
  cursor: pointer;
}

.btn-paid:active {
  transform: translateY(1px);
}

.btn-paid:disabled {
  opacity: 0.6;
  cursor: default;
}

/* 已报付款状态提示（替代按钮，幂等展示） */
.pay-reported {
  margin-top: 14px;
  padding: 13px 15px;
  font-size: 15px;
  font-weight: 700;
  color: #1f7a44;
  background: #eaf7ef;
  border: 1px solid #bfe5cd;
  border-radius: 14px;
  text-align: center;
}

/* 报付款感谢弹窗 */
.pay-thanks-mask {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(20, 12, 4, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.pay-thanks {
  background: var(--card);
  border-radius: 18px;
  padding: 26px 22px 20px;
  max-width: 320px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow);
}

.pay-thanks h3 {
  font-size: 19px;
}

.pay-thanks p {
  color: var(--text-2);
  font-size: 14.5px;
  line-height: 1.6;
}

.pay-thanks-sub {
  font-size: 12.5px;
  margin-top: 2px;
}

.pay-thanks .btn {
  margin-top: 16px;
}

/* ------------------------------ 加载 / 空态 / 提示 ------------------------------ */

.loading,
.empty {
  text-align: center;
  color: var(--text-2);
  padding: 48px 20px;
  font-size: 14px;
}

.spinner {
  width: 26px;
  height: 26px;
  border: 3px solid var(--border);
  border-top-color: var(--caramel);
  border-radius: 50%;
  margin: 0 auto 12px;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 88px;
  transform: translateX(-50%) translateY(20px);
  background: rgba(61, 44, 30, 0.94);
  color: #fff;
  padding: 11px 20px;
  border-radius: 12px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s ease;
  max-width: 80vw;
  text-align: center;
  z-index: 999;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.footer-note {
  text-align: center;
  color: var(--text-2);
  font-size: 12px;
  padding: 24px 16px 8px;
}

/* ------------------------------ 下单合计（实时金额） ------------------------------ */

/* 「¥58.00 × 2 份 = ¥116.00」比原来的单个金额长，缩小字号以免在窄屏换行 */
.submit-bar .total b.total-amount {
  font-size: 17px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ------------------------------ 会员账户：账号条 ------------------------------ */

.account-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}

.account-bar .acct-phone {
  font-size: 17px;
  font-weight: 800;
  color: var(--text);
  margin-right: auto;
}

/* 账号条主操作（登录/注册、我的订单）：大号胶囊按钮，手机上好点、显眼 */
.acct-link {
  display: inline-block;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.25;
  color: #fff;
  background: linear-gradient(135deg, var(--caramel) 0%, var(--caramel-dark) 100%);
  border: 0;
  padding: 13px 24px;
  border-radius: 999px;
  box-shadow: var(--shadow);
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  white-space: nowrap;
}

/* 次要操作（退出）：描边幽灵样式，弱于主按钮 */
.acct-link.acct-ghost {
  font-size: 15.5px;
  font-weight: 700;
  padding: 11px 18px;
  color: var(--caramel-dark);
  background: transparent;
  border: 1.5px solid var(--caramel);
  box-shadow: none;
}

.acct-link:active {
  opacity: 0.75;
  transform: scale(0.98);
}

/* ------------------------------ 会员账户：登录 / 注册 ------------------------------ */

.auth-card {
  padding-top: 6px;
}

.auth-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.auth-tab {
  flex: 1;
  padding: 9px 0;
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 10px;
  font-size: 14px;
  color: var(--text-2);
  cursor: pointer;
  font-family: inherit;
}

.auth-tab.active {
  background: var(--butter);
  border-color: var(--butter);
  color: var(--text);
  font-weight: 600;
}

.auth-notice {
  background: #fff6e5;
  border: 1px solid #f3d9a4;
  color: #8a5b12;
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 13px;
  margin-bottom: 12px;
}

/* 登录态下锁定的手机号输入框 */
.field input.locked {
  background: #f6f1e8;
  color: var(--text-2);
  cursor: not-allowed;
}

.phone-lock-tip {
  margin-top: 6px;
  color: var(--caramel-dark) !important;
}

/* ------------------------------ 会员账户：我的订单 ------------------------------ */

.my-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.order-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.order-row {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  cursor: pointer;
}

.order-row:active {
  background: #fffdf8;
}

.order-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.order-no {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.order-time {
  font-size: 12px;
  color: var(--text-2);
  margin-top: 2px;
}

.order-tags {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.order-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-size: 14px;
}

.order-name {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-spec {
  font-size: 12px;
  color: var(--text-2);
  background: #f6f1e8;
  border-radius: 6px;
  padding: 2px 6px;
  flex-shrink: 0;
}

.order-qty {
  margin-left: auto;
  color: var(--text-2);
  flex-shrink: 0;
}

.order-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
}

.order-amount {
  font-size: 16px;
  font-weight: 700;
  color: var(--caramel);
}

.order-detail {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}

.btn.sm.danger {
  background: #fff1f0;
  border: 1px solid #ffccc7;
  color: #c0392b;
}

/* 「待自提」徽标（订单列表用；下单结果页原本无此状态） */
.status-badge.pending {
  background: #eaf3ec;
  color: #3f7a55;
}

/* ------------------------------ 登录拦截弹窗 ------------------------------ */

.login-required-mask {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(20, 12, 4, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.login-required-box {
  background: var(--card);
  border-radius: 18px;
  padding: 28px 22px 22px;
  max-width: 320px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.25s ease;
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.login-required-box h3 {
  font-size: 19px;
  color: var(--text);
  margin: 10px 0 6px;
}

/* ==========================================================================
   会员下单页：底部 4 Tab 单页（今日团购 / 等待开团 / 我的订单 / 个人中心）
   ========================================================================== */

/* 首页需为固定底部 Tab 栏预留空间（商品 / 订单页无 Tab 栏，不受影响） */
body[data-page="home"] .app { padding-bottom: 92px; }

.tab-page { display: none; }
.tab-page.active { display: block; }

/* 底部 Tab 栏 */
.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  background: var(--card);
  border-top: 1px solid var(--border);
  box-shadow: 0 -2px 12px rgba(181, 114, 63, 0.08);
  padding-bottom: env(safe-area-inset-bottom);
}
.tab-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 8px 0 7px;
  border: 0;
  background: none;
  color: var(--text-2);
  font-size: 11px;
  cursor: pointer;
}
.tab-btn .tab-icon { font-size: 20px; line-height: 1; }
.tab-btn.active { color: var(--caramel); font-weight: 600; }

/* 回到顶部按钮 */
.back-top {
  position: fixed;
  right: 16px;
  bottom: 88px;
  z-index: 45;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--caramel);
  font-size: 18px;
  line-height: 1;
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: 0.2s;
  cursor: pointer;
}
.back-top.show { opacity: 1; visibility: visible; transform: none; }

/* 今日团购 / 等待开团 标签 */
.tag.today { background: #dfeee3; color: var(--ok); }
.tag.waiting { background: #fdeccd; color: #a5701d; }
.btn.disabled.waiting-tag { background: #f6efe4; color: #a88c6a; }

/* 等待开团卡片视觉弱化（封面略淡，传达「暂不可下单」） */
.product-card.is-waiting .cover { opacity: 0.92; }

/* 我的订单：归类 Tab */
.order-tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.order-tab {
  flex: 1;
  padding: 8px 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  color: var(--text-2);
  font-size: 13px;
  cursor: pointer;
}
.order-tab.active { background: var(--caramel); color: #fff; border-color: var(--caramel); }

/* 订单行封面缩略图 */
.order-thumb {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  object-fit: cover;
  flex: none;
  background: var(--butter);
}
.order-thumb.fallback { background: var(--butter); }
.order-line { display: flex; align-items: center; gap: 10px; }

/* 个人中心 */
.profile-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 16px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 14px;
}
.profile-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--butter);
  flex: none;
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-info { flex: 1; min-width: 0; }
.profile-name { font-size: 18px; font-weight: 700; }
.profile-phone { font-size: 14px; color: var(--text-2); margin-top: 2px; }
.profile-sub { font-size: 12px; color: var(--text-2); margin-top: 2px; }

.menu-list {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.menu-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 15px 16px;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: none;
  font-size: 15px;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.menu-row:last-child { border-bottom: 0; }
.menu-row:active { background: var(--cream); }
.menu-ico { font-size: 17px; }
.menu-arrow { margin-left: auto; color: var(--text-2); font-size: 18px; }

/* 通用底部弹窗（个人信息 / 修改密码） */
.app-modal-mask {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(61, 44, 30, 0.45);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.app-modal {
  width: 100%;
  max-width: 480px;
  max-height: 88vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--card);
  border-radius: 20px 20px 0 0;
  padding: 22px 18px calc(22px + env(safe-area-inset-bottom));
}
.modal-title { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.modal-sub { font-size: 13px; color: var(--text-2); margin-bottom: 14px; }
.modal-actions { margin-top: 16px; }

/* 等待开团页顶部说明 */
.waiting-head { padding: 0 2px; }

/* 个人中心：头像可编辑 + 彩色图标 */
.profile-avatar.clickable {
  position: relative;
  cursor: pointer;
  border: 0;
  padding: 0;
}
.profile-avatar.clickable img { display: block; }
.avatar-edit-badge {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #b5723f;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
}
.menu-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: #fdf1e2;
  flex: none;
}
.menu-ico svg { display: block; }
.avatar-preview {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  margin: 0 auto 12px;
  overflow: hidden;
  background: #f5c34c;
}
.avatar-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-hint { font-size: 12px; color: var(--text-2); margin-top: 8px; }


/* 个人中心：昵称旁修改笔按钮 */
.profile-name { display: inline-flex; align-items: center; gap: 6px; }
.name-edit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 2px;
  border-radius: 6px;
}
.name-edit svg { display: block; }
/* 个人信息弹窗：分组样式 */
.pi-group { margin: 16px 0 0; padding-top: 14px; border-top: 1px dashed var(--border); }
.pi-group-title { font-size: 14px; font-weight: 700; margin-bottom: 10px; }
.pi-tip { font-size: 12px; color: var(--text-2); margin-top: 8px; line-height: 1.5; }
.pi-group .field textarea { resize: vertical; }
