/* 前台商城：手机优先，桌面居中为 480px 画册宽度 */
body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
main { max-width: 480px; margin: 0 auto; min-height: 70vh; outline: none; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: center;
  height: 52px; background: rgba(244, 239, 231, 0.94); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand { text-decoration: none; display: flex; flex-direction: column; align-items: center; line-height: 1.1; }
.brand-cn { font-family: var(--serif); font-size: 18px; letter-spacing: 0.32em; color: var(--ink); padding-left: 0.32em; }
.brand-en { font-size: 9px; letter-spacing: 0.4em; color: var(--stone-ink); padding-left: 0.4em; }
.icon-btn { position: absolute; left: max(8px, calc(50% - 232px)); min-height: 40px; width: 40px; padding: 0; font-size: 26px; background: none; border: 0; color: var(--ink); }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; justify-content: center;
  background: var(--paper); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar a { flex: 1; max-width: 96px; text-align: center; text-decoration: none; padding: 12px 0; font-size: 14px; color: var(--stone-ink); letter-spacing: 0.1em; }
.tabbar a.on { color: var(--ink); font-weight: 600; box-shadow: inset 0 2px 0 var(--ochre); }
.badge { display: inline-block; min-width: 16px; margin-left: 2px; padding: 0 4px; font-size: 11px; line-height: 16px; border-radius: 8px; background: var(--ochre); color: var(--paper); }

.pad { padding: 20px 16px; }
.section { padding: 28px 16px; }
.section + .section { border-top: 1px solid var(--line); }
.section-title { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 16px; }
.section-title h2 { margin: 0; }
.section-title a { font-size: 13px; color: var(--stone-ink); text-decoration: none; }

/* 首页 */
.hero { position: relative; }
.hero img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: 32% 50%; }
.hero .cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 48px 20px 20px; color: var(--paper); background: linear-gradient(transparent, rgba(30, 22, 15, 0.7)); }
.hero .cap h1 { color: var(--paper); font-size: 26px; margin: 0; letter-spacing: 0.3em; }
.hero .cap p { margin: 4px 0 0; font-size: 13px; letter-spacing: 0.12em; opacity: 0.9; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 16px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 6px 14px; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; font-size: 14px; color: var(--stone-ink); background: transparent; min-height: 36px; }
.chip.on { border-color: var(--ink); color: var(--ink); }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px 12px; padding: 0 16px 24px; }
.card { text-decoration: none; display: block; }
.card .img { position: relative; background: var(--linen); aspect-ratio: 4 / 5; overflow: hidden; }
.card img { width: 100%; height: 100%; object-fit: cover; }
.card .title { margin-top: 10px; font-size: 14px; line-height: 1.5; }
.card .sub { font-size: 12px; color: var(--stone-ink); }
.card .price { margin-top: 2px; font-size: 15px; }
.card .flag { position: absolute; top: 8px; left: 8px; }

.visit { display: grid; grid-template-columns: 112px 1fr; gap: 16px; align-items: center; }
.visit img { width: 112px; height: 140px; object-fit: cover; }
.visit p { margin: 4px 0; }
.wide-img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; margin-bottom: 12px; }

.footer { padding: 32px 16px 24px; text-align: center; font-size: 12px; color: var(--stone-ink); line-height: 2; }

/* 商品详情 */
.gallery { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; background: var(--linen); }
.gallery::-webkit-scrollbar { display: none; }
.gallery img { flex: none; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; scroll-snap-align: start; }
.p-head { padding: 20px 16px 8px; }
.p-head h1 { font-size: 21px; margin-bottom: 2px; }
.p-head .price { font-size: 22px; margin-top: 8px; }
.opt-group { padding: 8px 16px; }
.opt-group > div { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.opt { min-height: 38px; padding: 0 16px; background: transparent; color: var(--ink); border: 1px solid var(--line); letter-spacing: 0.04em; }
.opt.on { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.opt.out { color: var(--stone); text-decoration: line-through; }
.stock-hint { padding: 4px 16px; font-size: 13px; color: var(--ochre); min-height: 22px; }
.actions { display: flex; gap: 10px; padding: 12px 16px; }
.actions > * { flex: 1; }
.links-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 0 16px 8px; }
.links-row button { min-height: 40px; padding: 0 8px; font-size: 13px; }
.note { font-family: var(--serif); font-size: 15px; line-height: 1.9; color: var(--walnut); border-left: 2px solid var(--ochre); padding-left: 12px; margin: 0; }
dl.kv { display: grid; grid-template-columns: 88px 1fr; margin: 0; }
dl.kv dt, dl.kv dd { padding: 8px 0; border-bottom: 1px solid var(--line); margin: 0; font-size: 14px; }
dl.kv dt { color: var(--stone-ink); }
.table-scroll { overflow-x: auto; }

/* 列表与表单 */
.list-item { display: flex; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.list-item img { width: 72px; height: 90px; object-fit: cover; background: var(--linen); flex: none; }
.list-item .grow { flex: 1; min-width: 0; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); }
.stepper button { min-height: 32px; width: 32px; padding: 0; background: transparent; color: var(--ink); border: 0; }
.stepper span { min-width: 28px; text-align: center; font-size: 14px; }
.sumbar { position: sticky; bottom: calc(56px + env(safe-area-inset-bottom)); display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; background: var(--paper); border-top: 1px solid var(--line); }
.box { background: var(--linen); padding: 16px; margin: 12px 16px; border-radius: var(--radius); }
.seg { display: flex; border: 1px solid var(--ink); margin-bottom: 12px; }
.seg button { flex: 1; background: transparent; color: var(--ink); border: 0; min-height: 40px; }
.seg button.on { background: var(--ink); color: var(--paper); }
.code-big { font-family: var(--serif); font-size: 34px; letter-spacing: 0.3em; text-align: center; color: var(--ink); padding: 8px 0; }

/* 会员卡 */
.member-card { margin: 16px; padding: 22px 20px; background: var(--ink); color: var(--paper); border-radius: var(--radius); }
.member-card .lv { font-family: var(--serif); font-size: 40px; line-height: 1; color: var(--lamp); }
.member-card .row { display: flex; justify-content: space-between; align-items: flex-end; }
.member-card .bar { height: 2px; background: rgba(244, 239, 231, 0.2); margin-top: 16px; }
.member-card .bar i { display: block; height: 2px; background: var(--lamp); }
.member-card p { margin: 6px 0 0; font-size: 13px; opacity: 0.85; }
.menu a, .menu button { display: flex; justify-content: space-between; width: 100%; padding: 16px; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--ink); text-decoration: none; min-height: 0; letter-spacing: 0; }

/* 预约 */
.day-label { padding: 16px 16px 4px; font-family: var(--serif); color: var(--walnut); }
.slot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.slot button { min-height: 36px; padding: 0 14px; }

/* 试穿 */
.tryon-stage { position: relative; margin: 0 16px; background: var(--linen); aspect-ratio: 3 / 4; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.tryon-stage img { width: 100%; height: 100%; object-fit: cover; }
.photos { display: flex; gap: 8px; padding: 12px 16px; overflow-x: auto; }
.photos button { flex: none; padding: 0; width: 64px; height: 84px; min-height: 0; background: var(--linen); border: 1px solid var(--line); overflow: hidden; }
.photos button.on { box-shadow: 0 0 0 2px var(--ochre); }
.photos img { width: 100%; height: 100%; object-fit: cover; }
.consent { font-size: 14px; line-height: 1.9; }
.consent li { margin-bottom: 6px; }
.loading-ink { width: 48px; height: 48px; border-radius: 50%; background: radial-gradient(var(--ink), transparent 70%); opacity: 0.5; }
@media (prefers-reduced-motion: no-preference) {
  .loading-ink { animation: ink 1.6s ease-in-out infinite; }
  @keyframes ink { 50% { transform: scale(1.6); opacity: 0.15; } }
}

/* 试衣间呼叫 */
.fit-btns { display: grid; gap: 12px; padding: 16px; }
.fit-btns button { min-height: 64px; font-size: 17px; }

dialog { border: 0; padding: 0; width: min(440px, calc(100vw - 32px)); background: var(--paper); color: var(--ink); border-radius: var(--radius); }
dialog::backdrop { background: rgba(30, 22, 15, 0.5); }
dialog .pad { max-height: 80vh; overflow-y: auto; }

/* 收款码 */
.qr-row { display: flex; gap: 12px; justify-content: center; margin: 12px 0; }
.qr-row figure { margin: 0; flex: 1; max-width: 180px; text-align: center; }
.qr-row img { width: 100%; background: #fff; border: 1px solid var(--line); }
.qr-row figcaption { font-size: 13px; color: var(--stone-ink); margin-top: 4px; }
