:root {
  --bg: #0e0d14; --card: #1a1822; --card2: #24212e; --line: #2e2a3a;
  --text: #f3eef7; --muted: #9a93a8; --gold: #ffcf5a; --red: #ff4d4f; --red2: #e8282f;
  --radius: 14px; --tab: 58px; --safe: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; color: inherit; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }

/* 头部 */
.hero { padding: 22px 16px 12px;
  background: radial-gradient(120% 90% at 85% 0%, rgba(255,77,79,.35), transparent 60%),
              radial-gradient(90% 80% at 0% 10%, rgba(255,207,90,.22), transparent 60%); }
.hero h1 { margin: 0; font-size: 24px; letter-spacing: 1px; }
.hero p { margin: 2px 0 12px; color: var(--muted); font-size: 13px; }
.notice { background: rgba(255,207,90,.12); color: var(--gold); border-radius: 10px; padding: 8px 12px; font-size: 13px; margin-bottom: 12px; }
.search { display: flex; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--line);
  border-radius: 999px; padding: 0 14px; height: 42px; color: var(--muted); }
.search svg { width: 18px; height: 18px; flex: none; }
.search input { flex: 1; min-width: 0; border: 0; background: none; outline: none; height: 100%; font-size: 16px; color: var(--text); }

/* 分类 */
.chips { position: sticky; top: 0; z-index: 5; display: flex; gap: 8px; overflow-x: auto; padding: 10px 16px;
  background: rgba(14,13,20,.92); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips button { flex: none; border: 1px solid var(--line); background: var(--card); border-radius: 999px;
  padding: 6px 14px; font-size: 14px; color: var(--muted); }
.chips button.on { background: var(--gold); border-color: var(--gold); color: #1a1300; font-weight: 600; }

/* 商品网格 */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 4px 12px; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 980px; margin: 0 auto; } }
@media (min-width: 960px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.card { background: var(--card); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.thumb { position: relative; display: block; aspect-ratio: 3 / 4; background: #000 linear-gradient(160deg, #2a1f35, #120f18); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 42px; height: 42px; border-radius: 50%;
  background: rgba(0,0,0,.45); display: grid; place-items: center; border: 1px solid rgba(255,255,255,.35); }
.play svg { width: 18px; height: 18px; fill: #fff; stroke: none; margin-left: 2px; }
.tag { position: absolute; left: 8px; bottom: 8px; background: rgba(0,0,0,.6); color: var(--gold); font-size: 12px;
  font-weight: 600; padding: 1px 8px; border-radius: 6px; }
.hot { position: absolute; right: 8px; top: 8px; background: var(--red2); font-size: 11px; padding: 1px 6px; border-radius: 6px; }
.info { padding: 8px 10px 10px; display: flex; flex-direction: column; flex: 1; }
.name { font-weight: 600; font-size: 15px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.row { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 6px; }
.price { color: var(--red); font-weight: 700; font-size: 17px; }
.price.ask { color: var(--gold); font-size: 14px; font-weight: 600; }
.add { width: 32px; height: 32px; border-radius: 50%; border: 0; background: var(--red2); color: #fff; display: grid; place-items: center; transition: transform .15s; }
.add svg { width: 18px; height: 18px; stroke-width: 2.6; }
.add.pop { transform: scale(1.25); }
.empty { text-align: center; color: var(--muted); padding: 40px 0; }

/* 底部导航 */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; height: calc(var(--tab) + var(--safe));
  padding-bottom: var(--safe); background: rgba(20,18,28,.96); border-top: 1px solid var(--line);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 11px; color: var(--muted); position: relative; }
.tabbar a.on { color: var(--gold); }
.badge { position: absolute; top: 6px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--red2); color: #fff; font-size: 11px; line-height: 18px; text-align: center; font-weight: 600; }
.foot-space { height: calc(var(--tab) + var(--safe) + 24px); }
.foot-space.tall { height: calc(var(--tab) + var(--safe) + 90px); }

/* 详情 */
.back { position: fixed; top: calc(10px + env(safe-area-inset-top, 0px)); left: 10px; z-index: 10; width: 38px; height: 38px;
  border-radius: 50%; background: rgba(0,0,0,.5); display: grid; place-items: center; }
.player { background: #000; display: flex; justify-content: center; }
.player video { width: 100%; max-width: 560px; max-height: 72vh; display: block; background: #000; }
.novideo { height: 240px; display: grid; place-items: center; color: var(--muted); }
.detail { padding: 14px 16px 4px; max-width: 760px; margin: 0 auto; }
.detail h1 { margin: 0; font-size: 21px; line-height: 1.35; }
.shots { display: inline-block; background: var(--gold); color: #1a1300; font-size: 13px; font-weight: 700;
  border-radius: 6px; padding: 1px 7px; margin-right: 8px; vertical-align: 3px; }
.price-line { margin: 8px 0 12px; }
.price.big { font-size: 26px; }
.price.big.ask { font-size: 18px; }
.unit { color: var(--muted); font-size: 13px; }
.specs { margin: 0; background: var(--card); border-radius: var(--radius); padding: 4px 14px; }
.specs div { display: flex; padding: 9px 0; border-bottom: 1px solid var(--line); }
.specs div:last-child { border-bottom: 0; }
.specs dt { width: 56px; color: var(--muted); flex: none; }
.specs dd { margin: 0; }
.intro { white-space: pre-wrap; color: #d7d0df; }
.sub { font-size: 16px; margin: 20px 16px 10px; }
.hscroll { display: flex; gap: 10px; overflow-x: auto; padding: 0 16px 4px; scrollbar-width: none; }
.hscroll::-webkit-scrollbar { display: none; }
.mini { flex: none; width: 120px; display: flex; flex-direction: column; gap: 4px; }
.mthumb { display: block; aspect-ratio: 3 / 4; border-radius: 10px; overflow: hidden; background: var(--card2); }
.mthumb img { width: 100%; height: 100%; object-fit: cover; }
.mname { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini .price { font-size: 14px; }
.has-buybar .tabbar { display: none; }
.buybar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; gap: 8px; align-items: center;
  padding: 10px 12px calc(10px + var(--safe)); background: rgba(20,18,28,.97); border-top: 1px solid var(--line); }
.buybar .btn { flex: 1; padding: 0 8px; }

/* 通用 */
.btn { display: inline-flex; align-items: center; justify-content: center; height: 46px; padding: 0 22px; border: 0; border-radius: 999px;
  background: linear-gradient(135deg, #ff5a4f, #e8282f); color: #fff; font-weight: 600; font-size: 16px; white-space: nowrap; }
.btn.ghost { background: transparent; border: 1px solid var(--gold); color: var(--gold); }
.btn.block { width: 100%; margin-top: 6px; }
.btn:disabled { opacity: .6; }
.stepper { display: flex; align-items: center; background: var(--card2); border-radius: 999px; height: 40px; flex: none; }
.stepper button { width: 36px; height: 100%; border: 0; background: none; font-size: 20px; color: var(--text); }
.stepper span { min-width: 22px; text-align: center; font-weight: 600; }
.stepper.sm { height: 32px; }
.stepper.sm button { width: 30px; font-size: 18px; }
.pagehead { padding: 18px 16px 6px; }
.pagehead h1 { margin: 0; font-size: 22px; }
.panel { margin: 12px; background: var(--card); border-radius: var(--radius); padding: 16px; max-width: 640px; }
@media (min-width: 680px) { .panel { margin: 12px auto; } }
.panel h2 { margin: 0 0 4px; font-size: 17px; }
.panel label { display: block; margin-top: 12px; font-size: 14px; color: var(--muted); }
.panel input, .panel textarea { display: block; width: 100%; margin-top: 6px; padding: 11px 12px; font-size: 16px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px; color: var(--text); outline: none; resize: vertical; }
.panel input:focus, .panel textarea:focus { border-color: var(--gold); }
.req { color: var(--red); margin-left: 2px; }
.hint { color: var(--muted); font-size: 13px; margin: 4px 0 0; }
.cartlist { list-style: none; margin: 0; padding: 0 12px; max-width: 664px; }
@media (min-width: 680px) { .cartlist, .sum { margin-left: auto !important; margin-right: auto !important; } }
.cartlist li { display: flex; gap: 12px; background: var(--card); border-radius: var(--radius); padding: 10px; margin-top: 10px; }
.cthumb { width: 76px; height: 96px; flex: none; border-radius: 10px; overflow: hidden; background: var(--card2); }
.cthumb img { width: 100%; height: 100%; object-fit: cover; }
.cinfo { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cname { font-weight: 600; }
.sub2 { color: var(--muted); font-size: 12px; margin-top: 2px; }
.price small { font-size: 11px; color: var(--muted); font-weight: 400; margin-left: 1px; }
.qtybox { display: flex; align-items: center; }
.qtybox .stepper.sm { height: 32px; background: var(--card2); }
.qtybox .stepper.sm button { width: 28px; }
.qtybox .stepper.sm span { min-width: 18px; color: var(--gold); }
.gallery { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; background: #000; scrollbar-width: none; }
.gallery::-webkit-scrollbar { display: none; }
.gallery img { flex: none; width: 100%; max-height: 72vh; object-fit: contain; scroll-snap-align: center; }
.gallery.below { margin-top: 2px; }
.gallery.below img { max-height: 46vh; }
.dots { display: flex; justify-content: center; gap: 6px; padding: 8px 0 0; }
.dots i { width: 6px; height: 6px; border-radius: 3px; background: var(--line); transition: .2s; }
.dots i.on { width: 16px; background: var(--gold); }
.sum { margin: 12px 16px 0; text-align: right; max-width: 632px; }
.sum b { color: var(--red); font-size: 20px; }
.emptybox { text-align: center; padding: 60px 20px; }
.emptybox p { margin: 6px 0; }
.emptybox .btn { margin-top: 16px; }
.okmark { width: 64px; height: 64px; margin: 0 auto 12px; border-radius: 50%; background: rgba(82,196,26,.15); color: #52c41a;
  font-size: 34px; line-height: 64px; }
.toast { position: fixed; left: 50%; bottom: calc(var(--tab) + var(--safe) + 24px); transform: translateX(-50%) translateY(10px);
  background: rgba(0,0,0,.85); color: #fff; padding: 10px 18px; border-radius: 999px; font-size: 14px; opacity: 0;
  pointer-events: none; transition: .2s; z-index: 50; max-width: 86vw; text-align: center; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.more { font-size: 12px; color: var(--muted); white-space: nowrap; }
.disclaimer { text-align: center; color: var(--muted); font-size: 12px; padding: 18px 16px 0; opacity: .8; }
.price small { font-size: 11px; }
.foot-space { height: 4px; }
.foot-space.tall { height: 80px; }
.has-buybar .disclaimer { padding-bottom: calc(76px + var(--safe)); }
.disclaimer { padding-bottom: calc(var(--tab) + var(--safe) + 20px); }
.thumb { overflow: hidden; }
.thumb img { position: absolute; inset: 0; }
