:root {
  --accent: #6c5ce7;
  --bg: #0b0d12;
  --panel: #14171e;
  --card: #171b23;
  --line: #242a35;
  --txt: #e8ecf4;
  --muted: #8b95a7;
  --ok: #46d68a;
  --hot: #ff6b8a;
  --radius: 12px;
}
body.light {
  --bg: #f4f6fa;
  --panel: #ffffff;
  --card: #ffffff;
  --line: #e3e8f0;
  --txt: #1b2230;
  --muted: #6b7688;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--txt);
  font: 15px/1.55 -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}
h3 { margin: 0 0 12px; font-size: 16px; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
code { font-family: ui-monospace, monospace; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.tb-in {
  max-width: 1200px; margin: 0 auto; padding: 12px 20px;
  display: flex; align-items: center; gap: 14px;
}
.brand { font-size: 17px; letter-spacing: .3px; }
.notice { border: 0; background: none; color: var(--muted); font-size: 14px; cursor: pointer; padding: 4px 0; }
.notice:hover { color: var(--txt); }
.sp { flex: 1; }
.icon {
  position: relative; display: grid; place-items: center;
  width: 34px; height: 34px; border-radius: 10px;
  border: 1px solid transparent; background: none; color: var(--muted); cursor: pointer;
}
.icon:hover { color: var(--txt); border-color: var(--line); background: var(--panel); }
.badge {
  position: absolute; top: 1px; right: 0; min-width: 16px; padding: 0 4px;
  background: var(--accent); color: #fff; border-radius: 8px;
  font-size: 11px; font-weight: 600; text-align: center; line-height: 16px;
}
.btn-login {
  padding: 8px 18px; border: 0; border-radius: 9px;
  background: var(--accent); color: #fff; font-size: 14px; font-weight: 600; cursor: pointer;
}
.btn-login:hover { filter: brightness(1.08); }

/* ---------- 布局 ---------- */
.wrap {
  max-width: 1200px; margin: 0 auto; padding: 20px;
  display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 18px;
  align-items: start;
}

/* ---------- 侧栏分类 ---------- */
.side {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px 10px; position: sticky; top: 74px;
}
.side-head {
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 600; padding: 4px 8px 10px;
}
.side-head::before { content: ""; width: 3px; height: 14px; border-radius: 2px; background: var(--accent); }
.cats { display: grid; gap: 2px; }
.cats button {
  position: relative; text-align: left; padding: 9px 12px;
  border: 0; border-radius: 8px; background: none; color: var(--muted);
  font-size: 13.5px; cursor: pointer; line-height: 1.4;
}
.cats button:hover { color: var(--txt); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.cats button.on { color: var(--txt); background: color-mix(in srgb, var(--accent) 15%, transparent); font-weight: 600; }
.cats button.on::before {
  content: ""; position: absolute; left: 0; top: 8px; bottom: 8px;
  width: 2px; border-radius: 2px; background: var(--accent);
}
.side-foot {
  display: block; margin-top: 10px; padding: 9px 12px;
  border-top: 1px solid var(--line); color: var(--muted); font-size: 13px;
}
.side-foot:hover { color: var(--accent); }

/* ---------- 搜索 & 标题 ---------- */
.content { min-width: 0; }
.search {
  width: 100%; height: 40px; padding: 0 14px;
  border-radius: 10px; border: 1px solid var(--line);
  background: var(--panel); color: var(--txt); font-size: 14px; outline: none;
}
.search::placeholder { color: var(--muted); }
.search:focus { border-color: var(--accent); }
.sec {
  display: flex; align-items: center; gap: 8px;
  margin: 18px 0 10px; font-size: 15px; font-weight: 600;
}
.sec::before { content: ""; width: 3px; height: 15px; border-radius: 2px; background: var(--accent); }
.sec span { color: var(--muted); font-weight: 400; font-size: 13px; }
.list .sec { margin: 14px 0 2px; font-size: 14px; }
.list .sec:first-child { margin-top: 2px; }

/* ---------- 商品列表 ---------- */
.list { display: grid; gap: 10px; }
.item {
  display: grid; grid-template-columns: 56px minmax(0, 1fr) auto 36px 14px;
  align-items: center; gap: 12px;
  padding: 10px 12px; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius);
  cursor: pointer; transition: .15s;
}
.item:hover { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
.thumb {
  width: 56px; height: 56px; border-radius: 10px; overflow: hidden;
  display: grid; place-items: center; position: relative;
  background: linear-gradient(135deg, #2a3040, #1d2230);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; position: relative; z-index: 1; }
.thumb .ph { font-size: 20px; font-weight: 700; color: rgba(255, 255, 255, .3); }
.t { font-size: 14px; line-height: 1.4; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.pill { font-size: 11.5px; line-height: 17px; padding: 0 7px; border-radius: 5px; }
.pill.hot { color: var(--hot); background: color-mix(in srgb, var(--hot) 15%, transparent); }
.pill.ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, transparent); }
.pill.out { color: var(--muted); background: color-mix(in srgb, var(--muted) 14%, transparent); }
.price { font-size: 15px; white-space: nowrap; }
.price small { color: var(--muted); font-size: 11.5px; margin-left: 3px; }
.addIcon {
  width: 34px; height: 34px; border-radius: 50%; border: 0;
  background: var(--accent); color: #fff; display: grid; place-items: center; cursor: pointer;
}
.addIcon:hover { filter: brightness(1.1); }
.addIcon[disabled] { background: var(--line); color: var(--muted); cursor: not-allowed; }
.chev { color: var(--muted); font-size: 15px; }
.empty { color: var(--muted); text-align: center; padding: 40px 0; }
.soldout { color: #ff8a5c; font-size: 13px; margin: 10px 0 0; }

/* ---------- 进站弹窗 ---------- */
.modal.center { align-items: center; }
.modal.entry { background: rgba(6, 8, 12, .72); backdrop-filter: blur(5px); }
.dialog {
  position: relative; width: 100%; max-width: 470px; margin: 0 16px;
  background: var(--panel); border: 0;
  border-radius: 26px; overflow: hidden;
  box-shadow: 0 26px 70px rgba(0, 0, 0, .55), 0 0 0 1px rgba(255, 255, 255, .06);
}
.dialog .close { top: 14px; right: 14px; background: none; border: 1px solid var(--line); }
.entry .head { display: flex; align-items: center; gap: 10px; padding: 18px 18px 8px; }
.entry .info {
  width: 30px; height: 30px; border-radius: 50%; flex: 0 0 auto;
  border: 1px solid #2ea88c; color: #3ec9a7;
  display: grid; place-items: center; font: 700 14px/1 Georgia, serif;
}
.entry h3 { margin: 0; font-size: 15px; font-weight: 600; }
.entry .lead { padding: 6px 18px 12px; font-size: 21px; font-weight: 700; line-height: 1.5; }
.entry .lead em.warn { color: #ff4d4f; font-style: normal; }
.entry .lines, .entry .contacts { padding: 0 18px; }
.lwarn { color: #ff4d4f; font-size: 13.5px; font-weight: 600; margin: 6px 0; }
.lmuted { color: var(--muted); font-size: 13.5px; margin: 6px 0; }
.ct { font-size: 13.5px; margin: 8px 0; }
.ct span { color: var(--muted); }
.ct a { border-bottom: 1px solid currentColor; }
.entry .foot {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin-top: 14px; padding: 12px 18px; border-top: 1px solid var(--line);
}
.ck { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 12.5px; cursor: pointer; }
.ck input { accent-color: var(--accent); margin: 0; }
.entry .foot .btn { margin-left: auto; padding: 7px 20px; }
@media (max-width: 640px) { .entry .lead { font-size: 18px; } }

/* ---------- 弹层 ---------- */
.modal {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(0, 0, 0, .62);
  display: flex; align-items: flex-end; justify-content: center;
}
.sheet {
  position: relative; width: 100%; max-width: 460px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 22px 22px 0 0; padding: 20px 16px 24px;
  max-height: 86vh; overflow-y: auto;
}
@media (min-width: 640px) {
  .modal { align-items: center; }
  .sheet { border-radius: 22px; }
}
.close {
  position: absolute; top: 10px; right: 12px; width: 30px; height: 30px;
  border: 0; border-radius: 50%; background: var(--card); color: var(--muted);
  font-size: 18px; line-height: 1; cursor: pointer;
}
.close:hover { color: var(--txt); }
.muted { color: var(--muted); font-size: 13px; margin: 6px 0; }
.small { font-size: 12px; }
.pre { white-space: pre-line; line-height: 1.8; }
.btn {
  border: 1px solid var(--line); background: var(--card); color: var(--txt);
  padding: 9px 14px; border-radius: 9px; font-size: 14px; cursor: pointer;
}
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn.sm { padding: 6px 10px; font-size: 13px; }
.btn.block { width: 100%; margin-top: 14px; display: block; text-align: center; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.total { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; font-size: 14px; }
.total b { color: var(--accent); font-size: 18px; }

/* 购物车行 */
.ci { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.ci-n { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 9px; }
.qty button { width: 28px; height: 28px; border: 0; background: none; color: var(--txt); font-size: 15px; cursor: pointer; }
.qty span { min-width: 24px; text-align: center; font-size: 13px; }

/* 收款 */
.qr { text-align: center; margin: 12px 0; }
.qr img { margin: 0 auto; width: 190px; height: 190px; object-fit: contain; background: #fff; padding: 8px; border-radius: 10px; }
.payrow {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px; margin: 10px 0;
}
.payrow code { flex: 1 1 100%; word-break: break-all; color: var(--accent); font-size: 13px; }

/* ---------- 移动端 ---------- */
@media (max-width: 820px) {
  .tb-in { padding: 10px 14px; gap: 8px; }
  .brand { font-size: 16px; }
  .wrap { grid-template-columns: 1fr; padding: 14px; gap: 12px; }
  .side { position: static; padding: 10px; }
  .side-head, .side-foot { display: none; }
  .cats { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
  .cats::-webkit-scrollbar { display: none; }
  .cats button { flex: 0 0 auto; background: var(--card); border-radius: 999px; padding: 7px 12px; font-size: 13px; }
  .cats button.on { background: var(--accent); color: #fff; }
  .cats button.on::before { display: none; }
  .item { grid-template-columns: 48px minmax(0, 1fr) auto 34px; gap: 10px; padding: 10px; }
  .thumb { width: 48px; height: 48px; }
  .chev { display: none; }
  .price { font-size: 14px; }
  .t { font-size: 13px; -webkit-line-clamp: 1; }
  .tags { margin-top: 4px; }
}

/* ---------- 轻提示 ---------- */
.toast {
  position: fixed; left: 50%; bottom: 88px; z-index: 70;
  transform: translateX(-50%);
  padding: 9px 18px; border-radius: 10px;
  background: rgba(30, 34, 44, .96); border: 1px solid var(--line);
  color: var(--txt); font-size: 13.5px; white-space: nowrap;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
  animation: toastIn .18s ease-out;
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 10px); } }
/* ---------- 商品详情页 ---------- */
.detail { max-width: 1200px; margin: 0 auto; padding: 18px 20px 70px; }
.crumb { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; font-size: 12.5px; color: var(--muted); }
.crumb a { color: var(--muted); }
.crumb a:hover { color: var(--accent); }
.crumb i { font-style: normal; opacity: .5; }
.dtop { display: grid; grid-template-columns: 420px minmax(0, 1fr); gap: 34px; align-items: start; }
.dgallery {
  aspect-ratio: 1 / 1; border-radius: 16px; overflow: hidden;
  display: grid; place-items: center; color: rgba(255, 255, 255, .92);
  background: linear-gradient(135deg, #6c5ce7, #8d7bff);
}
.dgallery img { width: 100%; height: 100%; object-fit: contain; background: var(--card); }
.dsub { color: var(--muted); font-size: 13px; margin-bottom: 6px; }
.dinfo h1 { font-size: 26px; margin: 0 0 10px; }
.dinfo .tags { margin-top: 12px; }
.dlabel { color: var(--muted); font-size: 13px; margin: 18px 0 8px; }
.dprice { font-size: 30px; font-weight: 600; color: #a99bff; }
.dprice small { color: var(--muted); font-size: 14px; margin-left: 6px; }
.skus { display: flex; gap: 10px; flex-wrap: wrap; }
.sku {
  display: grid; gap: 3px; min-width: 110px; padding: 8px 12px; text-align: left;
  border: 1px solid var(--line); border-radius: 10px; background: var(--card);
  color: var(--muted); font-size: 12.5px; cursor: pointer;
}
.sku b { color: var(--txt); font-size: 13.5px; font-weight: 600; }
.sku.on { border-color: var(--accent); color: #b9aefc; }
.sku[disabled] { opacity: .45; cursor: not-allowed; }
.dact { display: flex; gap: 12px; margin-top: 20px; flex-wrap: wrap; }
.dact .btn { flex: 1 1 160px; padding: 11px 18px; border-radius: 10px; }
.dnote {
  margin-top: 16px; padding: 10px 14px; border-radius: 10px; font-size: 13px;
  color: #46d68a; background: rgba(70, 214, 138, .1); border: 1px solid rgba(70, 214, 138, .25);
}
.ddetail { margin-top: 40px; border-top: 1px solid var(--line); padding-top: 22px; }
.ddetail h2 { font-size: 16px; margin: 0 0 14px; }
.prose { font-size: 13.5px; line-height: 1.9; word-break: break-word; }
.prose * { color: inherit !important; }
.prose a { color: var(--accent) !important; text-decoration: underline; }
.prose img { margin: 10px 0; border-radius: 8px; max-width: 100%; height: auto; }
.prose p { margin: 8px 0; }
.prose strong { font-weight: 600; }
.prose h2, .prose h3, .prose h4 { font-size: 15px; margin: 16px 0 8px; }
.prose ul, .prose ol { padding-left: 20px; margin: 8px 0; }
@media (max-width: 820px) {
  .detail { padding: 14px 14px 60px; }
  .dtop { grid-template-columns: 1fr; gap: 18px; }
  .dgallery { max-width: 240px; margin: 0 auto; border-radius: 12px; }
  .dinfo h1 { font-size: 20px; }
  .dprice { font-size: 24px; }
}
/* ---------- 快速购买 ---------- */
.quick .dialog { max-width: 400px; }
.qhead { display: flex; align-items: center; justify-content: space-between; padding: 15px 16px 8px; }
.qhead h3 { margin: 0; font-size: 15px; }
.qtop { display: flex; gap: 12px; padding: 0 16px 14px; }
.qtop img, .qtop .phb {
  width: 76px; height: 76px; flex: 0 0 auto; border-radius: 12px; object-fit: cover;
  display: grid; place-items: center; background: linear-gradient(135deg, #2a3040, #1d2230);
  color: rgba(255, 255, 255, .35); font-size: 26px; font-weight: 700;
}
.qname { font-size: 15px; font-weight: 600; line-height: 1.35; }
.qbadges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.qbadge { font-size: 11.5px; line-height: 17px; padding: 0 7px; border-radius: 5px; border: 1px solid var(--line); color: var(--muted); }
.qbadge.orange { color: #ff9a5c; border-color: rgba(255, 154, 92, .45); }
.qprice { margin-top: 10px; font-size: 22px; font-weight: 600; color: #a99bff; }
.qprice small { color: var(--muted); font-size: 12px; margin-left: 4px; }
.qdesc { padding: 12px 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12.5px; }
.qrow { display: flex; align-items: center; gap: 14px; padding: 9px 16px; font-size: 13px; color: var(--muted); }
.qstock { color: #46d68a; background: rgba(70, 214, 138, .12); border: 1px solid rgba(70, 214, 138, .3); padding: 1px 8px; border-radius: 6px; font-size: 12.5px; }
.qfoot { display: flex; gap: 12px; padding: 12px 16px 16px; border-top: 1px solid var(--line); margin-top: 6px; }
.qfoot .btn { flex: 1; padding: 10px; text-align: center; }
/* ---------- 订单结算页 ---------- */
.checkout { max-width: 1200px; margin: 0 auto; padding: 18px 20px 70px; }
.ck-h1 { font-size: 26px; margin: 0 0 4px; }
.ck-sub { color: var(--muted); font-size: 13px; margin: 0 0 18px; }
.steps { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin-bottom: 22px; }
.steps b { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 600; background: var(--card); border: 1px solid var(--line); }
.steps b.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.steps span.on { color: var(--txt); }
.steps i { width: 34px; height: 1px; background: var(--line); }
.ck-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.ck-left { display: grid; gap: 16px; }
.ck-right { position: sticky; top: 78px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.card h3 { margin: 0 0 14px; font-size: 15px; }
.ck-goods { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 0; }
.ck-goods + .ck-goods { border-top: 1px solid var(--line); }
.ck-goods img, .ck-goods .phb { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; display: grid; place-items: center; background: linear-gradient(135deg, #2a3040, #1d2230); color: rgba(255,255,255,.35); font-size: 22px; font-weight: 700; }
.ck-name { font-size: 14px; line-height: 1.4; }
.ck-meta { color: var(--muted); font-size: 12.5px; margin-top: 6px; }
.ck-price { font-size: 15px; white-space: nowrap; }
.ck-price small { color: var(--muted); font-size: 11.5px; margin-left: 3px; }
.input {
  width: 100%; height: 38px; padding: 0 12px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--card); color: var(--txt);
  font-size: 13.5px; outline: none;
}
.input:focus { border-color: var(--accent); }
.input::placeholder { color: var(--muted); }
.tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.tab { padding: 6px 16px; border-radius: 8px; font-size: 13px; background: var(--card); border: 1px solid var(--line); color: var(--muted); }
.tab.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.notice-box {
  margin-top: 14px; padding: 12px 14px; border-radius: 10px; font-size: 12.5px;
  color: #46d68a; background: rgba(70, 214, 138, .09); border: 1px solid rgba(70, 214, 138, .28);
}
.notice-box ul { margin: 6px 0 0; padding-left: 18px; }
.notice-box li { margin: 4px 0; line-height: 1.7; }
.ck-row { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--muted); padding: 6px 0; }
.ck-row span:last-child { color: var(--txt); }
.ck-total { display: flex; justify-content: space-between; align-items: center; margin: 12px 0 4px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 14px; }
.ck-total b { color: #a99bff; font-size: 20px; }
.pay-card { display: grid; gap: 4px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); margin-bottom: 14px; }
.pay-card.on { border-color: var(--accent); }
.pay-card b { font-size: 13.5px; }
.pay-card span { color: var(--muted); font-size: 12px; }
.pay-card code { color: var(--accent); font-size: 12px; word-break: break-all; }
.ck-amt { color: #a99bff; }
.ckpay { max-width: 520px; }
@media (max-width: 900px) {
  .ck-wrap { grid-template-columns: 1fr; }
  .ck-right { position: static; }
  .grid2 { grid-template-columns: 1fr; }
  .ck-h1 { font-size: 21px; }
  .checkout { padding: 14px 14px 60px; }
}
/* ---------- 核实中动画 ---------- */
.verify { text-align: center; padding: 18px 0 6px; }
.ring {
  width: 92px; height: 92px; border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, .13);
  border-top-color: var(--accent);
  animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.vtxt { color: var(--muted); font-size: 13px; margin: 12px 0 0; }
/* ---------- 支付确认遮罩 ---------- */
.paying {
  position: fixed; inset: 0; z-index: 80;
  display: grid; place-content: center; justify-items: center; gap: 18px;
  background: rgba(6, 8, 12, .82); backdrop-filter: blur(4px);
}
.paying p { margin: 0; color: var(--txt); font-size: 15px; }
.ring.ring-lg { width: 96px; height: 96px; }
.ring.ring-lg::before { inset: 8px; }