:root {
  --red: #ff2d55;
  --orange: #ff6a3d;
  --ink: #16181c;
  --sub: #8b909a;
  --line: #eceef2;
  --bg: #f4f5f7;
  --safe: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: #e9eaee; color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img { max-width: 100%; }
#app {
  max-width: 560px; margin: 0 auto; min-height: 100vh; background: var(--bg);
  padding-bottom: calc(62px + var(--safe));
  overflow-x: hidden;
  animation: fade .18s ease;
}
@keyframes fade { from { opacity: .4 } to { opacity: 1 } }
#app.nopad { padding-bottom: 0; }

/* ---------- 首页 ---------- */
.hero {
  position: relative; overflow: hidden; color: #fff;
  background: linear-gradient(140deg, #ff7a45 0%, #ff4d4f 48%, #ff2d55 100%);
  padding: calc(12px + env(safe-area-inset-top, 0px)) 16px 22px;
  border-radius: 0 0 24px 24px;
}
.hero::after {
  content: ""; position: absolute; width: 230px; height: 230px; border-radius: 50%;
  background: rgba(255,255,255,.14); right: -80px; top: -100px;
}
.hero-top { display: flex; align-items: center; justify-content: space-between; position: relative; z-index: 1; }
.brand { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 600; letter-spacing: .5px; }
.logo { width: 27px; height: 27px; border-radius: 9px; background: #fff; color: var(--red); display: grid; place-items: center; font-weight: 800; font-size: 15px; }
.brand small { font-weight: 400; font-size: 11px; opacity: .85; margin-left: 2px; letter-spacing: 0; }
.hbtn { color: #fff; text-decoration: none; font-size: 12.5px; background: rgba(255,255,255,.2); padding: 5px 12px; border-radius: 999px; }
.search {
  position: relative; z-index: 1; margin-top: 14px; display: flex; align-items: center;
  background: #fff; border-radius: 999px; padding: 4px 4px 4px 14px;
  box-shadow: 0 8px 20px rgba(170,20,45,.18);
}
.search .sicon { font-size: 14px; opacity: .55; }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 14px; padding: 8px 8px; color: var(--ink); }
.search button { border: 0; background: linear-gradient(135deg, #ff8a3d, #ff2d55); color: #fff; font-size: 13px; padding: 8px 17px; border-radius: 999px; font-weight: 500; }

.banners { display: flex; gap: 10px; overflow-x: auto; padding: 14px 16px 4px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.banners::-webkit-scrollbar { display: none; }
.banner { flex: 0 0 78%; scroll-snap-align: center; border-radius: 16px; padding: 15px 16px; color: #fff; min-height: 100px; position: relative; overflow: hidden; }
.banner::after { content: ""; position: absolute; width: 120px; height: 120px; border-radius: 50%; background: rgba(255,255,255,.16); right: -30px; bottom: -50px; }
.b1 { background: linear-gradient(120deg, #5865f2, #9b5de5); }
.b2 { background: linear-gradient(120deg, #00b8a9, #00d4a0); }
.b3 { background: linear-gradient(120deg, #ff9a3d, #ff5f6d); }
.bt1 { font-size: 18px; font-weight: 700; letter-spacing: .5px; }
.bt2 { font-size: 12.5px; opacity: .95; margin-top: 5px; }
.bt3 { font-size: 11px; opacity: .9; margin-top: 12px; background: rgba(255,255,255,.22); display: inline-block; padding: 3px 9px; border-radius: 999px; }

.cats { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px 2px; padding: 12px 8px 8px; }
.catit { display: flex; flex-direction: column; align-items: center; gap: 6px; text-decoration: none; }
.catcircle { width: 45px; height: 45px; border-radius: 15px; display: grid; place-items: center; font-size: 23px; background: #fff; box-shadow: 0 2px 8px rgba(20,20,40,.06); }
.catit span { font-size: 10.5px; color: #5b6068; }

.sec { padding: 6px 14px 0; }
.sechd { display: flex; align-items: center; justify-content: space-between; margin: 10px 2px 10px; }
.sechd h3 { margin: 0; font-size: 16.5px; letter-spacing: .5px; }
.sechd h3::before { content: ""; display: inline-block; width: 3px; height: 14px; border-radius: 2px; background: linear-gradient(180deg, #ff8a3d, #ff2d55); margin-right: 7px; vertical-align: -1px; }
.sechd .more { font-size: 12px; color: var(--sub); text-decoration: none; }
.timer { font-size: 11.5px; color: #fff; background: #16181c; padding: 3px 8px; border-radius: 6px; font-variant-numeric: tabular-nums; letter-spacing: .5px; }

.flash { display: flex; gap: 10px; overflow-x: auto; padding: 0 14px 8px; scrollbar-width: none; }
.flash::-webkit-scrollbar { display: none; }
.fcard { flex: 0 0 106px; background: #fff; border-radius: 13px; padding: 8px 8px 10px; text-decoration: none; box-shadow: 0 2px 10px rgba(20,20,40,.05); }
.fcard img { width: 100%; aspect-ratio: 1; border-radius: 9px; display: block; background: #f3f4f6; }
.fcard .fname { font-size: 12px; line-height: 1.35; margin-top: 7px; height: 2.7em; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.fcard .price { font-size: 14px; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 0 14px 20px; }
.pcard { display: block; background: #fff; border-radius: 14px; overflow: hidden; text-decoration: none; box-shadow: 0 2px 10px rgba(20,20,40,.05); }
.pcard .pimg { aspect-ratio: 1; background: #f3f4f6; }
.pcard .pimg img { width: 100%; height: 100%; display: block; object-fit: cover; }
.pbody { padding: 9px 10px 11px; }
.pname { font-size: 13.5px; line-height: 1.38; height: 2.76em; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.prow { display: flex; align-items: baseline; margin-top: 6px; }
.price { color: var(--red); font-weight: 700; font-size: 16px; letter-spacing: -.3px; }
.price i { font-style: normal; font-size: 11px; font-weight: 600; margin-right: 1px; }
.oprice { color: #b3b7bf; font-size: 11px; text-decoration: line-through; margin-left: 5px; }
.pmeta { display: flex; justify-content: space-between; font-size: 10.5px; color: #9aa0a8; margin-top: 6px; }
.pmeta .rate { color: #ff9500; }
.pill { display: inline-block; font-size: 10px; color: var(--red); background: #fff0f3; border-radius: 4px; padding: 1px 5px; margin-top: 6px; }

/* ---------- 通用 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 10px;
  padding: calc(9px + env(safe-area-inset-top, 0px)) 14px 9px;
  background: rgba(255,255,255,.96); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line);
}
.topbar h1 { font-size: 16px; margin: 0; flex: 1; font-weight: 600; }
.back { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: #f2f3f6; color: #222; text-decoration: none; font-size: 20px; line-height: 1; padding-bottom: 4px; border: 0; }
.tb-cart { text-decoration: none; font-size: 19px; width: 32px; height: 32px; display: grid; place-items: center; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 12px 14px 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; font-size: 13px; color: #5b6068; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; text-decoration: none; }
.chip.on { color: #fff; background: linear-gradient(135deg, #ff7a45, #ff2d55); border-color: transparent; font-weight: 500; }
.chipbar { display: flex; gap: 8px; padding: 12px 14px 0; overflow-x: auto; scrollbar-width: none; }
.chipbar::-webkit-scrollbar { display: none; }

.card { background: #fff; border-radius: 14px; margin: 0 14px 12px; padding: 14px; }
.card h4 { margin: 0 0 10px; font-size: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.field:last-child { margin-bottom: 0; }
.field label { font-size: 12.5px; color: var(--sub); }
.field input, .field select, .field textarea {
  width: 100%; border: 1px solid #e9ebf0; background: #fafbfc; border-radius: 10px;
  padding: 11px 12px; font-size: 14.5px; outline: 0; font-family: inherit; color: var(--ink);
  -webkit-appearance: none; appearance: none;
}
.field textarea { resize: vertical; min-height: 64px; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: #ffb3c0; background: #fff; }
.btn {
  display: block; width: 100%; text-align: center; text-decoration: none; border: 0; border-radius: 999px; padding: 13px 0;
  font-size: 15.5px; font-weight: 600; color: #fff; font-family: inherit;
  background: linear-gradient(135deg, #ff6a3d, #ff2d55); box-shadow: 0 8px 18px rgba(255,45,85,.24);
}
.btn:disabled { opacity: .55; box-shadow: none; }
.btn.ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); box-shadow: none; }
.btn-sm { display: inline-block; width: auto; padding: 7px 15px; font-size: 12.5px; border-radius: 999px; box-shadow: none; }
.linkbtn { background: none; border: 0; color: var(--red); font-size: 13px; padding: 4px 0; text-decoration: none; font-family: inherit; }
.empty { text-align: center; padding: 70px 24px; color: #9aa0a8; font-size: 13.5px; line-height: 1.8; }
.empty .big { font-size: 46px; margin-bottom: 10px; }
.muted { color: var(--sub); font-size: 12px; }
.hr { height: 1px; background: var(--line); margin: 12px 0; }

/* ---------- 商品详情 ---------- */
.dimg { background: #fff; }
.dimg img { width: 100%; aspect-ratio: 1; display: block; object-fit: cover; }
.dblock { background: #fff; padding: 14px 16px; margin-bottom: 10px; }
.dprice { display: flex; align-items: baseline; gap: 8px; }
.dprice .price { font-size: 28px; }
.dprice .price i { font-size: 15px; }
.dname { font-size: 17px; font-weight: 600; line-height: 1.42; margin: 8px 0 4px; }
.dsub { font-size: 12.5px; color: var(--sub); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tag { font-size: 11px; color: var(--red); background: #fff0f3; border-radius: 5px; padding: 2px 7px; }
.dmeta { display: flex; gap: 20px; font-size: 12px; color: var(--sub); margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.dmeta b { color: var(--ink); font-weight: 600; }
.qline { display: flex; align-items: center; justify-content: space-between; }
.qline .lbl { font-size: 13.5px; color: #5b6068; }
.stepper { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: #fff; }
.stepper button { width: 30px; height: 28px; border: 0; background: #f7f8fa; font-size: 16px; color: #333; line-height: 1; font-family: inherit; }
.stepper button:disabled { color: #c8ccd3; }
.stepper span { min-width: 34px; text-align: center; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.detailtext { font-size: 13.5px; color: #5b6068; line-height: 1.9; }
.actionbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; max-width: 560px; margin: 0 auto;
  background: #fff; border-top: 1px solid var(--line);
  padding: 8px 12px calc(8px + var(--safe)); display: flex; gap: 10px; align-items: center;
}
.actionbar .iconbtn { width: 42px; text-align: center; text-decoration: none; font-size: 11px; color: #5b6068; }
.actionbar .iconbtn b { display: block; font-size: 20px; font-weight: 400; line-height: 1.2; }
.abtn { flex: 1; border: 0; border-radius: 999px; padding: 12px 0; font-size: 15px; font-weight: 600; color: #fff; font-family: inherit; background: linear-gradient(135deg, #ffb03a, #ff7a18); }
.abtn.main { background: linear-gradient(135deg, #ff6a3d, #ff2d55); }
.abtn:disabled { opacity: .5; }
.spacer90 { height: 92px; }

/* ---------- 购物车 ---------- */
.cartrow { display: flex; gap: 10px; background: #fff; border-radius: 14px; padding: 10px; margin: 10px 14px 0; align-items: center; }
.cimg { width: 78px; height: 78px; border-radius: 10px; overflow: hidden; flex: none; background: #f3f4f6; }
.cimg img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cmain { flex: 1; min-width: 0; }
.cname { font-size: 13.5px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.crow2 { display: flex; align-items: center; justify-content: space-between; margin-top: 9px; }
.del { border: 0; background: none; color: #b3b7bf; font-size: 18px; padding: 4px 2px; line-height: 1; }
.paybar {
  position: fixed; left: 0; right: 0; z-index: 35; max-width: 560px; margin: 0 auto;
  background: #fff; border-top: 1px solid var(--line); padding: 10px 14px;
  padding-bottom: calc(10px + var(--safe)); display: flex; align-items: center; gap: 12px;
  bottom: calc(58px + var(--safe));
}
.paybar.solo { bottom: 0; }
.paybar .sum { flex: 1; font-size: 12.5px; color: var(--sub); }
.paybar .sum b { display: block; color: var(--red); font-size: 20px; font-weight: 700; }
.paybar .sum b i { font-style: normal; font-size: 13px; }
.paybar .btn { width: auto; padding: 11px 30px; font-size: 14.5px; }
.cartpad { height: 78px; }

/* ---------- 订单 ---------- */
.order { background: #fff; border-radius: 14px; margin: 10px 14px 0; padding: 12px 14px; }
.ohead { display: flex; justify-content: space-between; align-items: center; font-size: 11.5px; color: #9aa0a8; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.ostatus { font-size: 12.5px; font-weight: 600; color: var(--red); }
.ostatus.done, .ostatus.cancelled { color: #9aa0a8; }
.oitem { display: flex; gap: 10px; padding: 10px 0 0; align-items: center; }
.oitem img { width: 54px; height: 54px; border-radius: 9px; background: #f3f4f6; flex: none; }
.oitem .oname { font-size: 13px; flex: 1; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.oitem .oqty { font-size: 12px; color: var(--sub); }
.ofoot { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--line); margin-top: 10px; padding-top: 10px; font-size: 12.5px; }
.oacts { display: flex; gap: 8px; }
.obtn { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 14px; font-size: 12.5px; color: #333; font-family: inherit; }
.obtn.primary { border-color: transparent; color: #fff; background: linear-gradient(135deg, #ff6a3d, #ff2d55); }

/* ---------- 我的 ---------- */
.mehero { background: linear-gradient(140deg, #ff7a45 0%, #ff4d4f 48%, #ff2d55 100%); padding: calc(24px + env(safe-area-inset-top, 0px)) 20px 44px; color: #fff; border-radius: 0 0 24px 24px; }
.mehead { display: flex; align-items: center; gap: 14px; }
.avatar { width: 58px; height: 58px; border-radius: 50%; background: rgba(255,255,255,.22); border: 2px solid rgba(255,255,255,.5); display: grid; place-items: center; font-size: 24px; flex: none; }
.mename { font-size: 18px; font-weight: 600; }
.mephone { font-size: 12.5px; opacity: .85; margin-top: 3px; }
.mecard { margin: -28px 14px 12px; background: #fff; border-radius: 14px; padding: 14px; box-shadow: 0 4px 16px rgba(20,20,40,.06); position: relative; }
.mecard h4 { margin: 0 0 10px; font-size: 13.5px; display: flex; justify-content: space-between; align-items: center; }
.mecard h4 a { font-size: 11.5px; color: var(--sub); text-decoration: none; font-weight: 400; }
.mestats { display: grid; grid-template-columns: repeat(5, 1fr); text-align: center; }
.mestats a { text-decoration: none; color: var(--ink); font-size: 11.5px; }
.mestats b { display: block; font-size: 19px; font-weight: 600; margin-bottom: 2px; }
.cellgroup { background: #fff; border-radius: 14px; margin: 0 14px 12px; overflow: hidden; }
.cell { display: flex; align-items: center; gap: 10px; padding: 14px 15px; text-decoration: none; font-size: 14.5px; border-bottom: 1px solid #f6f7f9; }
.cell:last-child { border-bottom: 0; }
.cell .ic { width: 26px; text-align: center; font-size: 17px; }
.cell .chev { margin-left: auto; color: #c7cbd2; font-size: 17px; }

/* ---------- 登录 ---------- */
.logintop { padding: calc(40px + env(safe-area-inset-top, 0px)) 24px 10px; }
.logintop h2 { font-size: 26px; margin: 0 0 6px; letter-spacing: .5px; }
.logintop p { margin: 0; color: var(--sub); font-size: 13px; }
.logincard { margin: 20px 14px; background: #fff; border-radius: 18px; padding: 20px 16px; }
.seg { display: flex; background: #f4f5f7; border-radius: 999px; padding: 4px; margin-bottom: 18px; }
.seg button { flex: 1; border: 0; background: transparent; padding: 9px 0; border-radius: 999px; font-size: 14px; color: #5b6068; font-family: inherit; }
.seg button.on { background: #fff; color: var(--ink); font-weight: 600; box-shadow: 0 2px 8px rgba(20,20,40,.08); }

/* ---------- 后台 ---------- */
.admintop { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px 6px; }
.admintop h3 { margin: 0; font-size: 15px; }
.admintabs { display: flex; gap: 8px; padding: 8px 14px 4px; }
.arow { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid #f6f7f9; }
.arow:last-child { border-bottom: 0; }
.arow img { width: 46px; height: 46px; border-radius: 8px; background: #f3f4f6; }
.arow .amain { flex: 1; min-width: 0; font-size: 13px; }
.arow .asub { color: var(--sub); font-size: 11.5px; margin-top: 2px; }
.asplit { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ---------- 底部导航 ---------- */
#tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; max-width: 560px; margin: 0 auto;
  background: rgba(255,255,255,.97); backdrop-filter: blur(14px);
  border-top: 1px solid var(--line); display: flex; padding-bottom: var(--safe);
}
#tabbar.hide { display: none; }
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 0 5px; color: #9aa0a8; text-decoration: none; font-size: 10.5px; position: relative; }
.tab.on { color: var(--red); }
.tab svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; stroke-linecap: round; }
.badge { position: absolute; top: 2px; left: 50%; margin-left: 4px; min-width: 16px; height: 16px; border-radius: 8px; background: var(--red); color: #fff; font-size: 10px; display: none; align-items: center; justify-content: center; padding: 0 4px; font-style: normal; }

/* ---------- 杂项 ---------- */
#toast {
  position: fixed; left: 50%; bottom: 100px; transform: translateX(-50%) translateY(8px);
  background: rgba(20,22,28,.92); color: #fff; font-size: 13.5px; padding: 10px 18px;
  border-radius: 999px; opacity: 0; pointer-events: none; transition: .22s; z-index: 200; max-width: 82vw; text-align: center;
}
#toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }
.skel { background: linear-gradient(90deg, #eef0f4 25%, #f7f8fa 37%, #eef0f4 63%); background-size: 400% 100%; animation: sk 1.3s infinite; border-radius: 10px; }
@keyframes sk { 0% { background-position: 100% 0 } 100% { background-position: 0 0 } }
.skpage { padding: 14px; }
.skpage .a { height: 110px; border-radius: 16px; margin-bottom: 14px; }
.skpage .b { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.skpage .b div { height: 190px; }
.count { font-size: 12px; color: var(--sub); padding: 10px 15px 0; }
.notice { margin: 10px 14px; background: #fff8e6; color: #9a6a00; font-size: 12px; padding: 10px 12px; border-radius: 10px; line-height: 1.6; }
@media (min-width: 600px) {
  #app { box-shadow: 0 0 50px rgba(10,15,40,.1); }
  #tabbar, .actionbar, .paybar { box-shadow: 0 0 30px rgba(10,15,40,.06); }
}

/* ---------- 付款 ---------- */
.payline { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.acct { font-size: 17px; font-weight: 600; letter-spacing: .3px; margin-top: 3px; word-break: break-all; }
.steps { margin: 10px 0 0; padding-left: 20px; color: #5b6068; font-size: 13px; line-height: 1.95; }
.steps b { color: var(--red); }
.oacts a.obtn { display: inline-block; text-decoration: none; line-height: 1.25; }

.adminalert { margin: 4px 14px 8px; background: #fff1f0; border: 1px solid #ffd6d4; color: #c0392b; font-size: 12.5px; line-height: 1.7; padding: 10px 12px; border-radius: 10px; }
.adminalert b { font-size: 15px; }

/* ---------- 规格与图集 ---------- */
.skus { display: flex; flex-wrap: wrap; gap: 8px; }
.sku { border: 1px solid #e6e8ee; background: #fafbfc; color: #333; border-radius: 9px; padding: 8px 12px; font-size: 12.5px; font-family: inherit; line-height: 1.3; }
.sku.on { border-color: #ff2d55; background: #fff0f3; color: #ff2d55; font-weight: 600; }
.csku { font-size: 11px; color: #9aa0a8; margin-top: 2px; }
.gallery { display: flex; gap: 8px; overflow-x: auto; padding: 10px 16px 4px; background: #fff; scrollbar-width: none; }
.gallery::-webkit-scrollbar { display: none; }
.gthumb { width: 58px; height: 58px; border-radius: 9px; object-fit: cover; border: 2px solid transparent; flex: none; background: #f3f4f6; }
.gthumb.on { border-color: #ff2d55; }

/* ---------- 更新提示 ---------- */
.updatebar { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(74px + env(safe-area-inset-bottom, 0px)); z-index: 300; display: flex; align-items: center; gap: 12px; background: linear-gradient(135deg, #ff6a3d, #ff2d55); color: #fff; font-size: 12.5px; padding: 8px 14px; border-radius: 999px; box-shadow: 0 8px 20px rgba(255,45,85,.35); white-space: nowrap; }
.updatebar b { background: #fff; color: #ff2d55; border-radius: 999px; padding: 3px 10px; font-size: 12px; }
