:root {
  --cream: #fbf7f1;
  --cream-2: #f5eee4;
  --card: #ffffff;
  --ink: #2b2724;
  --ink-2: #57504a;
  --muted: #8e857a;
  --line: #ece2d5;
  --primary: #ef783c;
  --primary-deep: #d95f22;
  --primary-soft: #fff0e6;
  --green: #4c9a7c;
  --green-soft: #e9f5ef;
  --blue: #4a7fb5;
  --blue-soft: #eaf1f8;
  --red: #d9534f;
  --red-soft: #fdeceb;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(64, 48, 32, 0.07);
  --shadow-sm: 0 4px 14px rgba(64, 48, 32, 0.06);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Segoe UI", sans-serif;
  background: #efe7db;
  background-image: radial-gradient(circle at 12% 8%, rgba(239, 120, 60, 0.12), transparent 42%),
    radial-gradient(circle at 88% 92%, rgba(76, 154, 124, 0.12), transparent 40%);
  background-attachment: fixed;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}

button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }

.app {
  position: relative;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--cream);
  padding-bottom: 88px;
  overflow-x: hidden;
}

@media (min-width: 560px) {
  body { padding: 22px 0; }
  .app {
    min-height: calc(100vh - 44px);
    border-radius: 28px;
    box-shadow: 0 24px 70px rgba(70, 52, 34, 0.18);
    overflow: hidden;
  }
}

/* ---------------- 顶栏 ---------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px 12px;
  background: rgba(251, 247, 241, 0.9);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid rgba(236, 226, 213, 0.7);
}
.topbar .brand { display: flex; align-items: center; gap: 9px; flex: 1; min-width: 0; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 11px; flex: none;
  background: linear-gradient(140deg, #ffb27a, var(--primary));
  display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 15px;
  box-shadow: 0 6px 14px rgba(239, 120, 60, 0.3);
}
.brand-text { min-width: 0; overflow: hidden; }
.brand-text strong { display: block; font-size: 15px; letter-spacing: .2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-text span { display: block; font-size: 11px; color: var(--muted); margin-top: -3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .phone-link {
  font-size: 12px; color: var(--primary-deep); background: var(--primary-soft);
  padding: 6px 11px; border-radius: 999px; white-space: nowrap; text-decoration: none;
}
.back-btn {
  width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center;
  background: #fff; border: 1px solid var(--line); color: var(--ink-2); flex: none;
}

/* ---------------- 通用 ---------------- */
main { padding: 16px 16px 4px; }
.view-enter { animation: fadeUp .32s cubic-bezier(.22,.8,.3,1) both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.card {
  background: var(--card); border-radius: var(--radius); padding: 16px;
  box-shadow: var(--shadow-sm); border: 1px solid rgba(236, 226, 213, 0.75);
}
.card + .card { margin-top: 12px; }
.card-tight { padding: 14px; }

.section { margin-top: 20px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 0 4px 10px; }
.section-head h2 { margin: 0; font-size: 15px; font-weight: 650; letter-spacing: .2px; }
.section-head .more { font-size: 12px; color: var(--muted); }

.muted { color: var(--muted); }
.small { font-size: 12px; }
.tiny { font-size: 11px; }
.center { text-align: center; }
.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.price { color: var(--primary-deep); font-weight: 700; font-variant-numeric: tabular-nums; }
.price small { font-size: .72em; font-weight: 600; }
.price .del { color: var(--muted); font-weight: 400; font-size: 12px; text-decoration: line-through; margin-left: 6px; }

/* ---------------- Hero ---------------- */
.hero {
  position: relative; overflow: hidden; border-radius: 22px; padding: 20px 18px 18px;
  background: linear-gradient(135deg, #ffb680 0%, #f4823f 55%, #e96a2c 100%);
  color: #fff; box-shadow: 0 16px 34px rgba(233, 106, 44, 0.28);
}
.hero::after {
  content: ""; position: absolute; right: -46px; top: -56px; width: 168px; height: 168px;
  border-radius: 50%; background: rgba(255, 255, 255, 0.16);
}
.hero::before {
  content: ""; position: absolute; right: 34px; bottom: -70px; width: 120px; height: 120px;
  border-radius: 50%; background: rgba(255, 255, 255, 0.1);
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 6px; font-size: 11px; padding: 4px 10px;
  border-radius: 999px; background: rgba(255, 255, 255, 0.22); backdrop-filter: blur(4px);
}
.hero h1 { margin: 12px 0 4px; font-size: 21px; line-height: 1.35; letter-spacing: .3px; }
.hero p { margin: 0; font-size: 12.5px; opacity: .92; max-width: 260px; }
.hero-stats { display: flex; gap: 18px; margin-top: 16px; position: relative; z-index: 1; }
.hero-stats div span { display: block; font-size: 11px; opacity: .85; }
.hero-stats div strong { font-size: 16px; font-variant-numeric: tabular-nums; }

/* ---------------- 功能入口 ---------------- */
.quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.quick {
  display: block; width: 100%; text-align: left; background: var(--card); border-radius: 16px;
  padding: 14px; border: 1px solid rgba(236, 226, 213, 0.85); box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease;
}
.quick:active { transform: scale(.975); }
.quick .qi {
  width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; margin-bottom: 9px;
}
.quick .qi svg { width: 19px; height: 19px; }
.quick strong { display: block; font-size: 14px; font-weight: 620; }
.quick span { display: block; font-size: 11px; color: var(--muted); margin-top: 1px; }
.qi-orange { background: var(--primary-soft); color: var(--primary-deep); }
.qi-green { background: var(--green-soft); color: var(--green); }
.qi-blue { background: var(--blue-soft); color: var(--blue); }
.qi-pink { background: #fdeef4; color: #c2557e; }

/* ---------------- 承诺条 ---------------- */
.promise { display: flex; gap: 8px; margin-top: 12px; }
.promise div {
  flex: 1; text-align: center; font-size: 11px; color: var(--ink-2); background: #fff;
  border-radius: 12px; padding: 9px 4px; border: 1px solid rgba(236, 226, 213, .8);
}
.promise div b { display: block; color: var(--primary-deep); font-size: 12px; }

/* ---------------- 表单 ---------------- */
.field { margin-bottom: 12px; }
.field:last-child { margin-bottom: 0; }
.field > label { display: block; font-size: 12.5px; color: var(--ink-2); margin-bottom: 6px; font-weight: 550; }
.field .hint { font-size: 11px; color: var(--muted); margin-top: 4px; }
.input, .select {
  width: 100%; padding: 11px 13px; border-radius: 12px; border: 1px solid var(--line);
  background: #fdfbf8; font-size: 14px; outline: none; transition: border-color .18s, box-shadow .18s;
}
.input:focus, .select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(239, 120, 60, .12); background: #fff; }
.input::placeholder { color: #b9b0a4; }
.input-group { display: flex; align-items: center; gap: 10px; }
.input-suffix { font-size: 13px; color: var(--muted); flex: none; }

.slider { -webkit-appearance: none; width: 100%; height: 6px; border-radius: 99px; background: var(--cream-2); outline: none; margin: 12px 0 2px; }
.slider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%; background: #fff;
  border: 3px solid var(--primary); box-shadow: 0 2px 8px rgba(239, 120, 60, .35); cursor: pointer;
}
.slider-labels { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--muted); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 12px 18px; border-radius: 13px; font-size: 14px; font-weight: 600;
  transition: transform .16s ease, opacity .16s, background .16s;
}
.btn:active { transform: scale(.98); }
.btn-block { width: 100%; }
.btn-primary {
  background: linear-gradient(135deg, #f98d4d, var(--primary)); color: #fff;
  box-shadow: 0 10px 22px rgba(239, 120, 60, .28);
}
.btn-primary:disabled { background: #e6ddd2; color: #a89e92; box-shadow: none; }
.btn-ghost { background: #fff; border: 1px solid var(--line); color: var(--ink-2); }
.btn-soft { background: var(--primary-soft); color: var(--primary-deep); }
.btn-green { background: #07c160; color: #fff; box-shadow: 0 10px 22px rgba(7, 193, 96, .25); }
.btn-sm { padding: 8px 13px; font-size: 12.5px; border-radius: 10px; }
.btn-xs { padding: 5px 10px; font-size: 11.5px; border-radius: 9px; }
.btn[disabled] { opacity: .6; pointer-events: none; }

/* ---------------- 尺码结果 ---------------- */
.size-hero {
  position: relative; overflow: hidden; border-radius: 18px; padding: 18px;
  background: linear-gradient(150deg, #f2fbf6, #e6f4ec); border: 1px solid #d5ebe0;
}
.size-hero .lbl { font-size: 12px; color: #3d7f66; }
.size-hero .num { font-size: 46px; line-height: 1.05; font-weight: 750; color: #2f6b55; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.size-hero .num small { font-size: 15px; font-weight: 600; margin-left: 2px; }
.size-hero .conf { font-size: 11px; background: #fff; color: #3d7f66; border-radius: 999px; padding: 4px 10px; border: 1px solid #d5ebe0; }
.size-meta { display: flex; gap: 8px; margin-top: 12px; }
.size-meta div { background: rgba(255,255,255,.75); border-radius: 10px; padding: 7px 10px; font-size: 11.5px; color: #3d7f66; }

.reason-list { list-style: none; margin: 12px 0 0; padding: 0; }
.reason-list li { position: relative; padding-left: 20px; font-size: 12.5px; color: var(--ink-2); margin-bottom: 7px; line-height: 1.55; }
.reason-list li::before {
  content: ""; position: absolute; left: 4px; top: 7px; width: 6px; height: 6px; border-radius: 50%;
  background: var(--green); box-shadow: 0 0 0 3px var(--green-soft);
}
.warn-box {
  margin-top: 10px; background: #fff8e8; border: 1px solid #f2e2bd; color: #8a6a22;
  border-radius: 12px; padding: 10px 12px; font-size: 12px;
}
.warn-box div + div { margin-top: 4px; }

.size-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.size-table th, .size-table td { padding: 8px 6px; text-align: center; border-bottom: 1px solid #f3ece2; }
.size-table th { color: var(--muted); font-weight: 500; font-size: 11.5px; }
.size-table tr.active td { background: var(--green-soft); color: #2f6b55; font-weight: 650; }
.size-table tr:last-child td { border-bottom: 0; }

/* ---------------- 商品 ---------------- */
.cat-tabs { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 6px; scrollbar-width: none; }
.cat-tabs::-webkit-scrollbar { display: none; }
.chip {
  flex: none; padding: 7px 14px; border-radius: 999px; font-size: 12.5px; color: var(--ink-2);
  background: #fff; border: 1px solid var(--line); white-space: nowrap;
}
.chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip.tiny-chip { padding: 4px 10px; font-size: 11px; }

.goods { display: flex; gap: 12px; align-items: center; }
.art-tile {
  width: 88px; height: 88px; border-radius: 15px; flex: none; display: grid; place-items: center;
  background: linear-gradient(150deg, #fff6ee, #fdecdd); border: 1px solid #f6e6d5; overflow: hidden;
}
.art-tile svg { width: 62px; height: 62px; }
.goods-name { font-size: 14px; font-weight: 620; }
.goods-sub { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.tag-row { display: flex; gap: 5px; margin-top: 5px; flex-wrap: wrap; }
.tag { font-size: 10px; padding: 2px 7px; border-radius: 6px; background: var(--cream-2); color: var(--ink-2); }
.tag.hot { background: var(--primary-soft); color: var(--primary-deep); }
.tag.ok { background: var(--green-soft); color: var(--green); }

/* ---------------- 底部弹层 ---------------- */
.sheet-mask {
  position: fixed; inset: 0; background: rgba(34, 26, 20, .42); z-index: 60;
  display: flex; align-items: flex-end; justify-content: center;
  animation: fadeIn .2s ease both;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.sheet {
  width: 100%; max-width: 480px; background: var(--cream); border-radius: 22px 22px 0 0;
  padding: 18px 18px 24px; max-height: 82vh; overflow-y: auto;
  animation: slideUp .3s cubic-bezier(.22,.9,.3,1) both;
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: none; } }
.sheet-handle { width: 38px; height: 4px; border-radius: 99px; background: #ddd2c4; margin: -6px auto 14px; }
.sheet h3 { margin: 0 0 4px; font-size: 16px; }

.size-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; }
.size-opt {
  padding: 10px 4px; border-radius: 12px; background: #fff; border: 1px solid var(--line);
  font-size: 13px; text-align: center; position: relative;
}
.size-opt small { display: block; font-size: 10px; color: var(--muted); margin-top: 1px; }
.size-opt.active { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-deep); font-weight: 650; }
.size-opt.active small { color: var(--primary-deep); opacity: .8; }
.size-opt.disabled { opacity: .42; text-decoration: line-through; pointer-events: none; }

.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.stepper button { width: 34px; height: 32px; font-size: 17px; color: var(--ink-2); }
.stepper span { min-width: 34px; text-align: center; font-size: 13.5px; font-variant-numeric: tabular-nums; }

/* ---------------- 购物车条 ---------------- */
.cart-bar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 78px; z-index: 40;
  width: calc(100% - 32px); max-width: 448px;
  background: #2b2724; color: #fff; border-radius: 16px; padding: 11px 12px 11px 16px;
  display: flex; align-items: center; gap: 10px; box-shadow: 0 14px 30px rgba(43, 39, 36, .3);
  animation: fadeUp .25s ease both;
}
.cart-bar .btn { padding: 9px 16px; border-radius: 11px; font-size: 13px; }

/* ---------------- 订单 ---------------- */
.status-badge {
  display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; padding: 3px 9px;
  border-radius: 999px; font-weight: 600;
}
.st-pending { background: #fff4e0; color: #a8730f; }
.st-paid { background: var(--primary-soft); color: var(--primary-deep); }
.st-shipped { background: var(--blue-soft); color: var(--blue); }
.st-completed { background: var(--green-soft); color: var(--green); }
.st-closed { background: #f1eeea; color: #98908a; }
.st-applied { background: #fff4e0; color: #a8730f; }
.st-approved { background: var(--blue-soft); color: var(--blue); }
.st-shipped_back { background: #eef0fb; color: #5a63b5; }
.st-done { background: var(--green-soft); color: var(--green); }
.st-rejected, .st-cancelled { background: #f1eeea; color: #98908a; }

.order-card { display: block; width: 100%; text-align: left; }
.order-card .ono { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

.timeline { list-style: none; margin: 6px 0 0; padding: 0 0 0 18px; position: relative; }
.timeline::before { content: ""; position: absolute; left: 4px; top: 6px; bottom: 10px; width: 2px; background: var(--line); }
.timeline li { position: relative; padding-bottom: 16px; font-size: 12.5px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before {
  content: ""; position: absolute; left: -18px; top: 5px; width: 10px; height: 10px; border-radius: 50%;
  background: #fff; border: 2px solid var(--line);
}
.timeline li.done::before { background: var(--green); border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.timeline li strong { font-weight: 600; font-size: 12.5px; }
.timeline li .t { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.timeline li .note { color: var(--ink-2); font-size: 11.5px; }

.empty { text-align: center; padding: 34px 16px; color: var(--muted); font-size: 13px; }
.empty .em-ico { font-size: 30px; display: block; margin-bottom: 8px; opacity: .55; }

.loading { text-align: center; padding: 30px; color: var(--muted); font-size: 12.5px; }
.spinner {
  width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line);
  border-top-color: var(--primary); animation: spin .8s linear infinite; margin: 0 auto 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------- 进度 ---------------- */
.steps { display: flex; margin: 4px 0 2px; }
.step { flex: 1; text-align: center; position: relative; font-size: 10.5px; color: var(--muted); }
.step .dot {
  width: 10px; height: 10px; border-radius: 50%; background: #e2d8cb; margin: 0 auto 6px; position: relative; z-index: 1;
}
.step.done .dot { background: var(--primary); }
.step.done { color: var(--primary-deep); }
.step::after {
  content: ""; position: absolute; top: 4px; left: 50%; width: 100%; height: 2px; background: #e8dfd2;
}
.step:last-child::after { display: none; }
.step.done::after { background: var(--primary); }

/* ---------------- 支付 ---------------- */
.pay-amount { text-align: center; padding: 6px 0 2px; }
.pay-amount .cur { font-size: 18px; font-weight: 600; margin-right: 2px; }
.pay-amount .val { font-size: 40px; font-weight: 700; letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.qr-wrap {
  width: 176px; height: 176px; margin: 14px auto 8px; background: #fff; border-radius: 16px;
  border: 1px solid var(--line); padding: 10px; display: grid; place-items: center;
}
.qr-grid { display: grid; grid-template-columns: repeat(21, 1fr); gap: 1px; width: 100%; height: 100%; }
.qr-grid i { background: transparent; border-radius: 1px; }
.qr-grid i.on { background: #1f2328; }
.pay-brand { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: #07a552; background: #e9f9f0; padding: 4px 10px; border-radius: 999px; }
.countdown { font-variant-numeric: tabular-nums; }

.notice-bar {
  display: flex; gap: 8px; align-items: flex-start; background: #fff8ec; border: 1px solid #f4e5c8;
  color: #8a6a22; border-radius: 12px; padding: 10px 12px; font-size: 11.5px; line-height: 1.55;
}

.kv { display: flex; justify-content: space-between; font-size: 12.5px; padding: 5px 0; color: var(--ink-2); }
.kv span:first-child { color: var(--muted); }
.kv.total { border-top: 1px dashed var(--line); margin-top: 6px; padding-top: 10px; font-weight: 650; color: var(--ink); }

/* ---------------- 底部导航 ---------------- */
.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); z-index: 50;
  width: 100%; max-width: 480px; display: flex; padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, .94); backdrop-filter: blur(14px);
  border-top: 1px solid rgba(236, 226, 213, .9);
}
@media (min-width: 560px) { .tabbar { border-radius: 0 0 28px 28px; } }
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: 10.5px; color: #a09789; padding: 3px 0; text-decoration: none;
}
.tab svg { width: 21px; height: 21px; }
.tab.active { color: var(--primary-deep); }
.tab.active svg { stroke-width: 2.2; }

.foot-note { text-align: center; font-size: 10.5px; color: #b5aa9c; padding: 18px 0 4px; }
.toast {
  position: fixed; left: 50%; bottom: 130px; transform: translateX(-50%); z-index: 99;
  background: rgba(43, 39, 36, .92); color: #fff; font-size: 12.5px; padding: 10px 18px;
  border-radius: 999px; max-width: 80%; text-align: center; animation: fadeUp .22s ease both;
}
