/* ============================================================
   客户端共享样式（微信小程序风格）
   ============================================================ */
:root {
  --primary: #B9813B;
  --primary-dark: #9A6A2E;
  --primary-soft: rgba(185,129,59,0.12);
  --accent: #D9A65A;
  --bg: #FAF7F1;
  --card: #FFFFFF;
  --ink: #2E2A24;
  --ink-2: #6B6052;
  --muted: #9A8F80;
  --rule: #EFE7DA;
  --danger: #D9534F;
  --success: #3F9C6D;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(90,70,40,0.04), 0 4px 14px rgba(90,70,40,0.06);
}

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

html, body { height: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.6;
}

.page {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  padding-bottom: 76px;
}
.page.has-tabbar { padding-bottom: 84px; }
.page.fullscreen { padding-bottom: 0; }

a { color: var(--primary); text-decoration: none; }
img { max-width: 100%; display: block; }

/* ---------- 顶部导航 ---------- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
  padding: 0.9rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.navbar .title { font-size: 1.05rem; font-weight: 700; flex: 1; text-align: center; }
.navbar .back { font-size: 1.3rem; color: var(--ink); width: 2rem; }
.navbar .spacer { width: 2rem; }

/* ---------- 底部 TabBar ---------- */
.tabbar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--rule);
  display: flex;
  z-index: 50;
  padding-bottom: env(safe-area-inset-bottom);
}
.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 0.5rem 0 0.45rem;
  color: var(--muted);
  font-size: 0.68rem;
  letter-spacing: 0.02em;
  transition: color 0.15s;
  position: relative;
}
.tab-item .tab-icon { width: 23px; height: 23px; line-height: 0; }
.tab-item .tab-icon svg { width: 100%; height: 100%; display: block; }
.tab-item.active { color: var(--primary); font-weight: 600; }
.tab-item.active::after {
  content: '';
  position: absolute;
  top: 0;
  width: 18px;
  height: 2.5px;
  border-radius: 0 0 3px 3px;
  background: var(--primary);
}

/* ---------- 卡片 ---------- */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin: 0.75rem 1rem;
  overflow: hidden;
}
.card-pad { padding: 1rem 1.1rem; }
.card-title {
  font-size: 1rem;
  font-weight: 700;
  padding: 1rem 1.1rem 0.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-title .more { font-size: 0.8rem; color: var(--muted); font-weight: 400; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 999px;
  padding: 0.65rem 1.4rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
  font-family: inherit;
}
.btn:active { transform: scale(0.97); }
.btn.primary { background: var(--primary); color: #fff; }
.btn.primary:hover { opacity: 0.9; }
.btn.ghost { background: transparent; color: var(--primary); border: 1px solid var(--primary); }
.btn.gray { background: #F2EDE5; color: var(--ink); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.block { width: 100%; }
.btn.sm { padding: 0.4rem 0.9rem; font-size: 0.82rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- 首页 Banner（编辑部风格：暖米底 + 大字排版，不再用渐变色块） ---------- */
.hero {
  position: relative;
  margin: 0.9rem 1rem 0.25rem;
  border-radius: 16px;
  overflow: hidden;
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(185,129,59,0.10) 0%, rgba(185,129,59,0) 55%),
    #F4EDE0;
  border: 1px solid #EFE6D4;
  color: var(--ink);
  padding: 1.5rem 1.4rem 1.35rem;
}
.hero .hero-kicker {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.28em;
  color: var(--primary);
  margin-bottom: 0.55rem;
}
.hero .hero-kicker::before {
  content: '';
  width: 16px;
  height: 1.5px;
  background: var(--primary);
}
.hero h2 {
  font-size: 1.52rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.25;
  margin-bottom: 0.45rem;
  color: #3A3126;
}
.hero p { font-size: 0.83rem; color: var(--ink-2); margin-bottom: 1.05rem; letter-spacing: 0.02em; }
.hero .btn {
  background: #3A3126;
  color: #F6EFE3;
  border-radius: 10px;
  padding: 0.6rem 1.3rem;
  font-size: 0.88rem;
  letter-spacing: 0.12em;
}
.hero .hero-mark {
  position: absolute;
  right: 1.1rem;
  top: 1.25rem;
  width: 64px;
  height: 64px;
  color: rgba(185,129,59,0.5);
}
.hero .hero-mark svg { width: 100%; height: 100%; }

/* ---------- 服务入口（单卡分组 + 细分隔线 + 线性图标，去掉同款小卡阵列） ---------- */
.quick-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin: 0.75rem 1rem;
  padding: 0.35rem 0;
  overflow: hidden;
}
.quick-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.85rem 0.95rem;
  cursor: pointer;
  transition: background 0.12s;
}
.quick-item:active { background: #FBF6EC; }
.quick-item:nth-child(odd) { border-right: 1px solid var(--rule); }
.quick-item:nth-child(n+3) { border-top: 1px solid var(--rule); }
.quick-item .qi-icon {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--primary-soft);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
}
.quick-item .qi-icon svg { width: 22px; height: 22px; }
.quick-item .qi-label { font-size: 0.85rem; font-weight: 600; color: var(--ink); }
.quick-item .qi-desc { font-size: 0.68rem; color: var(--muted); margin-top: 0.12rem; }

/* ---------- 商品网格 ---------- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  padding: 0.75rem 1rem;
}
.product-card {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(90,70,40,0.03);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.1s;
}
.product-card:active { transform: scale(0.97); }
.product-card .pc-img {
  background: #F7F2E9;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 130px;
  padding: 0.6rem;
}
.product-card .pc-img img { max-height: 100%; object-fit: contain; }
.product-card .pc-body { padding: 0.6rem 0.75rem 0.75rem; }
.product-card .pc-name { font-size: 0.88rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.product-card .pc-brand { font-size: 0.7rem; color: var(--muted); margin: 0.12rem 0 0.3rem; }
.product-card .pc-spec { font-size: 0.66rem; color: var(--muted); letter-spacing: 0.04em; margin-bottom: 0.4rem; font-feature-settings: 'tnum'; }
.product-card .pc-price { color: var(--primary-dark); font-weight: 700; font-size: 1.02rem; font-feature-settings: 'tnum'; }
.product-card .pc-price small { font-size: 0.72rem; font-weight: 600; margin-right: 1px; }
.product-card .pc-tag {
  display: inline-block;
  font-size: 0.62rem;
  color: var(--primary);
  border: 1px solid rgba(185,129,59,0.35);
  background: transparent;
  border-radius: 4px;
  padding: 0.02rem 0.3rem;
  margin-left: 0.3rem;
  vertical-align: 0.1em;
}

/* ---------- 列表 ---------- */
.list-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid var(--rule);
  cursor: pointer;
}
.list-item:last-child { border-bottom: none; }
.list-item .li-icon { font-size: 1.4rem; width: 2rem; text-align: center; color: var(--primary); }
.list-item .li-icon svg { width: 22px; height: 22px; vertical-align: -5px; }
.list-item .li-main { flex: 1; }
.list-item .li-title { font-size: 0.95rem; font-weight: 500; }
.list-item .li-sub { font-size: 0.78rem; color: var(--muted); margin-top: 0.1rem; }
.list-item .li-arrow { color: #C9BEB0; }

/* ---------- 标签 ---------- */
.chip-row { display: flex; gap: 0.5rem; padding: 0.5rem 1rem; overflow-x: auto; }
.chip {
  flex-shrink: 0;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  font-size: 0.82rem;
  color: var(--ink);
  cursor: pointer;
}
.chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ---------- 状态标签 ---------- */
.status-tag {
  display: inline-block;
  font-size: 0.72rem;
  border-radius: 6px;
  padding: 0.12rem 0.5rem;
  font-weight: 600;
}
.status-tag.pending { background: #FFF4E5; color: #B7791F; }
.status-tag.paid { background: #F7EEE0; color: var(--primary); }
.status-tag.shipped { background: #E6F7F0; color: var(--success); }
.status-tag.completed { background: #F0EAE1; color: var(--muted); }
.status-tag.cancelled { background: #FDEBEC; color: var(--danger); }

/* ---------- Toast ---------- */
.gs-toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  background: rgba(46,42,36,0.88);
  color: #fff;
  padding: 0.7rem 1.3rem;
  border-radius: 10px;
  font-size: 0.9rem;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  max-width: 80%;
  text-align: center;
}
.gs-toast.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.gs-toast.success { background: rgba(48,164,108,0.92); }
.gs-toast.error { background: rgba(229,72,77,0.92); }

/* ---------- Modal ---------- */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
}
.modal-mask.show { display: flex; }
.modal-mask.show { display: flex; }
.modal, .modal-box {
  background: #fff;
  border-radius: 16px;
  width: 82%;
  max-width: 340px;
  padding: 1.4rem 1.3rem 1rem;
  animation: pop 0.18s ease-out;
}
.modal-box h3 { margin: 0 0 0.8rem; font-size: 1.05rem; text-align: center; }
.modal-box .modal-actions { margin-top: 1rem; }
@keyframes pop { from { transform: scale(0.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-title { font-size: 1.05rem; font-weight: 700; text-align: center; }
.modal-text { font-size: 0.9rem; color: var(--muted); text-align: center; margin: 0.6rem 0 1.1rem; }
.modal-actions { display: flex; gap: 0.6rem; }
.modal-actions .btn { flex: 1; }

/* ---------- 表单 ---------- */
.field { margin-bottom: 0.9rem; }
.field label { display: block; font-size: 0.85rem; color: var(--muted); margin-bottom: 0.35rem; }
.field input, .field select, .field textarea {
  width: 100%;
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 0.65rem 0.85rem;
  font-size: 0.95rem;
  font-family: inherit;
  background: #FCF9F4;
  outline: none;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--primary); background: #fff; }

/* ---------- 空状态 ---------- */
.empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--muted);
}
.empty .empty-icon { font-size: 3rem; margin-bottom: 0.6rem; opacity: 0.6; }
.empty .empty-text { font-size: 0.9rem; }

/* ---------- 分段标题（眉标 + 延伸细线，去掉左侧色块装饰） ---------- */
.section-title {
  font-size: 1.02rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: #3A3126;
  padding: 1.15rem 1rem 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.7rem;
}
.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--rule);
}

/* ---------- 试戴页 ---------- */
.tryon-stage {
  position: relative;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  background: #241E18;
  overflow: hidden;
}
.tryon-stage canvas { width: 100%; height: 100%; display: block; }
.tryon-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 0.8rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #fff;
  z-index: 5;
}
.tryon-overlay .to-btn {
  background: rgba(0,0,0,0.4);
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  font-size: 0.85rem;
  cursor: pointer;
}
.tryon-hint {
  position: absolute;
  bottom: 92px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-size: 0.8rem;
  padding: 0.4rem 1rem;
  border-radius: 999px;
  z-index: 5;
  white-space: nowrap;
}
.glasses-strip {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: rgba(255,255,255,0.97);
  border-top: 1px solid var(--rule);
  z-index: 30;
  padding: 0.6rem 0 0.7rem;
}
.glasses-strip .strip-title { font-size: 0.75rem; color: var(--muted); padding: 0 1rem 0.4rem; }
.strip-scroll { display: flex; gap: 0.6rem; overflow-x: auto; padding: 0 1rem; }
.glass-thumb {
  flex-shrink: 0;
  width: 74px;
  background: #F8F3EB;
  border: 2px solid transparent;
  border-radius: 12px;
  padding: 0.4rem;
  cursor: pointer;
  text-align: center;
}
.glass-thumb.active { border-color: var(--primary); background: var(--primary-soft); }
.glass-thumb img { width: 100%; height: 40px; object-fit: contain; }
.glass-thumb .gt-name { font-size: 0.62rem; color: var(--muted); margin-top: 0.2rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tryon-actions {
  position: fixed;
  bottom: 150px;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  display: flex;
  justify-content: center;
  gap: 1rem;
  z-index: 25;
  padding: 0 1rem;
}
.tryon-actions .btn { box-shadow: 0 4px 16px rgba(0,0,0,0.25); }

/* ---------- 上传/抠图页 ---------- */
.matting-stage {
  position: relative;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  background: #241E18;
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.matting-stage canvas { width: 100%; display: block; }
.matting-tools { display: flex; gap: 0.5rem; padding: 0.7rem 1rem; overflow-x: auto; }
.matting-tools .btn { flex-shrink: 0; }
.tool-slider { padding: 0.2rem 1rem 0.6rem; }
.tool-slider label { font-size: 0.78rem; color: var(--muted); }
.tool-slider input[type=range] { width: 100%; margin-top: 0.3rem; }

/* ---------- 海报页 ---------- */
.poster-stage {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  background: #241E18;
  display: flex;
  justify-content: center;
  padding: 1rem;
}
.poster-stage canvas { max-width: 100%; border-radius: 12px; box-shadow: 0 8px 30px rgba(0,0,0,0.4); }
.template-row { display: flex; gap: 0.6rem; overflow-x: auto; padding: 0.7rem 1rem; }
.template-item {
  flex-shrink: 0;
  width: 84px;
  height: 120px;
  border-radius: 10px;
  border: 2px solid transparent;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.template-item.active { border-color: var(--primary); }
.template-item .tpl-name {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0,0,0,0.45);
  color: #fff;
  font-size: 0.68rem;
  text-align: center;
  padding: 0.2rem;
}

/* ---------- 订单 ---------- */
.order-card { margin-bottom: 0.75rem; }
.order-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.7rem 1.1rem;
  border-bottom: 1px solid var(--rule);
  font-size: 0.82rem;
  color: var(--muted);
}
.order-body { padding: 0.7rem 1.1rem; }
.order-item-row { display: flex; gap: 0.7rem; align-items: center; padding: 0.3rem 0; }
.order-item-row img { width: 46px; height: 46px; object-fit: contain; background: #F8F3EB; border-radius: 8px; padding: 0.2rem; }
.order-item-row .oi-name { font-size: 0.88rem; flex: 1; }
.order-item-row .oi-price { font-size: 0.85rem; font-weight: 600; }
.order-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.7rem 1.1rem;
  border-top: 1px solid var(--rule);
  font-size: 0.85rem;
}
.order-foot .of-total { color: var(--danger); font-weight: 700; }

/* ---------- 商品详情 ---------- */
.detail-img {
  background: linear-gradient(180deg, #FAF6EF, #F2EADF);
  display: flex;
  justify-content: center;
  padding: 1.5rem;
}
.detail-img img { max-height: 220px; object-fit: contain; }
.detail-info { padding: 1rem 1.1rem; }
.detail-info .di-price { font-size: 1.4rem; color: var(--danger); font-weight: 700; }
.detail-info .di-name { font-size: 1.15rem; font-weight: 700; margin: 0.3rem 0; }
.detail-info .di-brand { font-size: 0.85rem; color: var(--muted); }
.param-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; padding: 0.5rem 1.1rem 1rem; }
.param-item { background: #FAF6EF; border-radius: 10px; text-align: center; padding: 0.6rem 0.3rem; }
.param-item .pi-label { font-size: 0.7rem; color: var(--muted); }
.param-item .pi-value { font-size: 0.9rem; font-weight: 700; margin-top: 0.1rem; }
.buy-bar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: #fff;
  border-top: 1px solid var(--rule);
  display: flex;
  gap: 0.6rem;
  padding: 0.7rem 1rem;
  z-index: 30;
}
.buy-bar .btn { flex: 1; }

/* ---------- 会员/我的 ---------- */
.profile-head {
  background: linear-gradient(135deg, #4A3826, #B9813B);
  color: #fff;
  padding: 1.6rem 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.9rem;
}
.profile-head .ph-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
}
.profile-head .ph-name { font-size: 1.1rem; font-weight: 700; }
.profile-head .ph-level { font-size: 0.78rem; opacity: 0.85; margin-top: 0.15rem; }
.profile-stats { display: flex; margin: -1.2rem 1rem 0.8rem; position: relative; z-index: 2; }
.profile-stats .ps-item {
  flex: 1;
  background: var(--card);
  border-radius: 12px;
  box-shadow: var(--shadow);
  text-align: center;
  padding: 0.8rem 0.3rem;
  margin: 0 0.3rem;
}
.profile-stats .ps-num { font-size: 1.2rem; font-weight: 700; color: var(--primary); }
.profile-stats .ps-label { font-size: 0.72rem; color: var(--muted); margin-top: 0.1rem; }

/* ---------- 工具类 ---------- */
.row { display: flex; align-items: center; gap: 0.5rem; }
.between { display: flex; justify-content: space-between; align-items: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.5rem; }
.muted { color: var(--muted); }
.small { font-size: 0.82rem; }
.bold { font-weight: 700; }
.danger { color: var(--danger); }
.primary { color: var(--primary); }
.text-center { text-align: center; }
.hide { display: none !important; }
.store-actions { display: flex; gap: 0.5rem; margin-top: 0.8rem; flex-wrap: wrap; }
.store-actions .btn { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.coupon-card { display: flex; align-items: center; border: 1px solid #F0EAE1; border-radius: 12px; overflow: hidden; margin-bottom: 10px; }
.coupon-card .cc-left { background: linear-gradient(135deg, #ff6b6b, #ff9a5a); color: #fff; padding: 14px 16px; text-align: center; min-width: 84px; }
.coupon-card .cc-amount { font-size: 20px; font-weight: 800; }
.coupon-card .cc-min { font-size: 10px; opacity: 0.9; }
.coupon-card .cc-right { flex: 1; padding: 10px 14px; }
.coupon-card .cc-name { font-size: 14px; font-weight: 600; }
.coupon-card .cc-expire { font-size: 11px; color: #9A8F80; margin-top: 4px; }
