/* ===========================================================
   蒸汽选品商城 · 前台样式
   =========================================================== */

:root {
  --bg: #08080f;
  --bg-2: #0e0e18;
  --glow-1: rgba(124, 92, 255, .22);
  --glow-2: rgba(41, 224, 255, .14);
  --header-bg: rgba(8, 8, 15, .78);
  --card: #14141f;
  --card-2: #11111b;
  --surface-2: rgba(255, 255, 255, .04);
  --surface-3: rgba(255, 255, 255, .07);
  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .14);
  --txt: #eceaf5;
  --muted: #9b98b0;
  --bubble-admin: rgba(255, 255, 255, .07);
  --input-bg: rgba(255, 255, 255, .04);
  --chat-bg-1: #16161f;
  --chat-bg-2: #0f0f18;
  --toast-bg: rgba(24, 24, 36, .96);
  --footer-bg: rgba(255, 255, 255, .015);
  --price: var(--price);
  --hero-grad: linear-gradient(100deg, #fff 18%, #c9b8ff 62%, #8ef0ff 100%);
  --brand: #7c5cff;
  --brand-2: #29e0ff;
  --pink: #ff5ea8;
  --ok: #35d07f;
  --warn: #ffb020;
  --bad: #ff5b6e;
  --radius: 16px;
  --shadow: 0 18px 40px -18px rgba(0, 0, 0, .9);
  --wrap: 1200px;
}

/* ============ 主题 ============ */
body[data-theme="light"] {
  --bg: #f4f5fa;
  --bg-2: #ffffff;
  --glow-1: rgba(124, 92, 255, .10);
  --glow-2: rgba(41, 224, 255, .10);
  --header-bg: rgba(255, 255, 255, .86);
  --card: #ffffff;
  --card-2: #f5f6fb;
  --surface-2: rgba(18, 18, 40, .05);
  --surface-3: rgba(18, 18, 40, .09);
  --line: rgba(18, 18, 40, .10);
  --line-2: rgba(18, 18, 40, .18);
  --txt: #171722;
  --muted: #5f5d72;
  --bubble-admin: #eef0f8;
  --input-bg: #ffffff;
  --chat-bg-1: #ffffff;
  --chat-bg-2: #f3f4fa;
  --toast-bg: rgba(255, 255, 255, .98);
  --footer-bg: rgba(18, 18, 40, .03);
  --price: #d6336c;
  --hero-grad: linear-gradient(100deg, #1b1a2c 12%, #5b3fd6 62%, #0d8fb0 100%);
}

body[data-theme="blue"] {
  --bg: #071120;
  --bg-2: #0a1a2e;
  --glow-1: rgba(41, 128, 255, .26);
  --glow-2: rgba(41, 224, 255, .16);
  --header-bg: rgba(7, 17, 32, .8);
  --card: #0e2138;
  --card-2: #0a1a2c;
  --surface-2: rgba(120, 200, 255, .07);
  --surface-3: rgba(120, 200, 255, .12);
  --line: rgba(120, 200, 255, .14);
  --line-2: rgba(120, 200, 255, .24);
  --txt: #e6f2ff;
  --muted: #8aa4c2;
  --bubble-admin: rgba(120, 200, 255, .12);
  --input-bg: rgba(120, 200, 255, .07);
  --chat-bg-1: #0d2037;
  --chat-bg-2: #081627;
  --toast-bg: rgba(10, 26, 46, .97);
  --footer-bg: rgba(120, 200, 255, .04);
  --price: #6fd2ff;
  --hero-grad: linear-gradient(100deg, #ffffff 10%, #9fd4ff 55%, #4fe6ff 100%);
}

body[data-theme="green"] {
  --bg: #07130f;
  --bg-2: #0a1b16;
  --glow-1: rgba(53, 208, 127, .20);
  --glow-2: rgba(120, 255, 190, .12);
  --header-bg: rgba(7, 19, 15, .8);
  --card: #0e211b;
  --card-2: #0a1a15;
  --surface-2: rgba(120, 255, 190, .06);
  --surface-3: rgba(120, 255, 190, .1);
  --line: rgba(120, 255, 190, .12);
  --line-2: rgba(120, 255, 190, .2);
  --txt: #e8fff5;
  --muted: #86a89a;
  --bubble-admin: rgba(120, 255, 190, .1);
  --input-bg: rgba(120, 255, 190, .06);
  --chat-bg-1: #0d211a;
  --chat-bg-2: #081713;
  --toast-bg: rgba(9, 26, 21, .97);
  --footer-bg: rgba(120, 255, 190, .03);
  --price: #5ef2a8;
  --hero-grad: linear-gradient(100deg, #ffffff 10%, #a8ffd2 55%, #4ff0c2 100%);
}

body[data-theme="rose"] {
  --bg: #fdf6f8;
  --bg-2: #ffffff;
  --glow-1: rgba(255, 94, 168, .12);
  --glow-2: rgba(255, 176, 120, .10);
  --header-bg: rgba(255, 255, 255, .88);
  --card: #ffffff;
  --card-2: #fdf1f5;
  --surface-2: rgba(120, 30, 70, .05);
  --surface-3: rgba(120, 30, 70, .09);
  --line: rgba(120, 30, 70, .10);
  --line-2: rgba(120, 30, 70, .18);
  --txt: #2a1620;
  --muted: #7d5b68;
  --bubble-admin: #fbe9f0;
  --input-bg: #ffffff;
  --chat-bg-1: #ffffff;
  --chat-bg-2: #fdf2f6;
  --toast-bg: rgba(255, 255, 255, .98);
  --footer-bg: rgba(120, 30, 70, .03);
  --price: #d6336c;
  --hero-grad: linear-gradient(100deg, #3a1a2a 10%, #c2185b 62%, #e8722a 100%);
}

body[data-theme="sepia"] {
  --bg: #f6f1e7;
  --bg-2: #fffdf8;
  --glow-1: rgba(180, 140, 80, .14);
  --glow-2: rgba(120, 160, 120, .10);
  --header-bg: rgba(255, 253, 248, .9);
  --card: #fffdf8;
  --card-2: #f4ecdd;
  --surface-2: rgba(90, 70, 40, .06);
  --surface-3: rgba(90, 70, 40, .1);
  --line: rgba(90, 70, 40, .14);
  --line-2: rgba(90, 70, 40, .24);
  --txt: #2c2519;
  --muted: #7a6b52;
  --bubble-admin: #f0e8d8;
  --input-bg: #fffdf8;
  --chat-bg-1: #fffdf8;
  --chat-bg-2: #f6f0e3;
  --toast-bg: rgba(255, 253, 248, .98);
  --footer-bg: rgba(90, 70, 40, .04);
  --price: #b5541f;
  --hero-grad: linear-gradient(100deg, #2c2519 10%, #8a5a24 60%, #3f7d5a 100%);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", system-ui, -apple-system, sans-serif;
  background:
    radial-gradient(900px 500px at 12% -10%, var(--glow-1), transparent 60%),
    radial-gradient(800px 460px at 92% 0%, var(--glow-2), transparent 62%),
    var(--bg);
  color: var(--txt);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.main { padding: 26px 20px 90px; min-height: 50vh; }

/* ---------------- 顶部导航 ---------------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  backdrop-filter: blur(14px);
  background: var(--header-bg);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex; align-items: center; gap: 22px;
  height: 68px;
}
.brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 11px;
  display: grid; place-items: center;
  font-weight: 800; font-size: 18px; color: #fff;
  background: linear-gradient(140deg, var(--brand), var(--pink));
  box-shadow: 0 8px 20px -8px var(--brand);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 15.5px; letter-spacing: .3px; }
.brand-text small { font-size: 11px; color: var(--muted); }

.top-nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.top-nav::-webkit-scrollbar { display: none; }
.top-nav a {
  padding: 8px 12px; border-radius: 10px; font-size: 13.5px;
  color: var(--muted); white-space: nowrap; transition: .18s;
}
.top-nav a:hover { color: var(--txt); background: var(--surface-2); }
.top-nav a.on { color: #fff; background: rgba(124, 92, 255, .22); box-shadow: inset 0 0 0 1px rgba(124, 92, 255, .45); }

.header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.hello { font-size: 12.5px; color: var(--muted); }

.ghost-btn, .solid-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: 11px; font-size: 13.5px; padding: 9px 14px;
  border: 1px solid var(--line-2); background: var(--surface-2);
  color: var(--txt); transition: .18s; white-space: nowrap;
}
.ghost-btn:hover { background: var(--surface-3); }
.solid-btn {
  border: none; color: #fff;
  background: linear-gradient(135deg, var(--brand), #a855f7 55%, var(--pink));
  box-shadow: 0 12px 26px -14px var(--brand);
}
.solid-btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.solid-btn:disabled { opacity: .6; cursor: default; transform: none; }
.big-btn { padding: 12px 22px; font-size: 14.5px; border-radius: 13px; }
.block { width: 100%; }
.cart-link { position: relative; }
.cart-badge {
  min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px;
  background: var(--pink); color: #fff; font-size: 11.5px; font-weight: 700;
  display: inline-grid; place-items: center;
}

/* ---------------- Hero ---------------- */
.hero { padding: 46px 0 12px; }
.hero-inner { display: grid; grid-template-columns: 1.35fr .8fr; gap: 34px; align-items: center; }
.pill {
  display: inline-block; font-size: 12.5px; padding: 6px 12px; border-radius: 999px;
  color: #d9d2ff; background: rgba(124, 92, 255, .16);
  border: 1px solid rgba(124, 92, 255, .38);
}
.hero h1 {
  font-size: clamp(26px, 4vw, 42px); line-height: 1.18; margin: 16px 0 12px;
  letter-spacing: -.5px;
  background: var(--hero-grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p { color: var(--muted); font-size: 15px; margin: 0 0 16px; max-width: 46ch; }
.hero-pts { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.hero-pts span {
  font-size: 12.5px; color: #cfcaf0; padding: 7px 12px; border-radius: 10px;
  background: rgba(255, 255, 255, .045); border: 1px solid var(--line);
}
.notice {
  font-size: 13px; color: #ffe6a8; background: rgba(255, 176, 32, .1);
  border: 1px solid rgba(255, 176, 32, .3); border-radius: 12px; padding: 10px 14px;
  display: inline-block;
}
.hero-stats {
  display: grid; gap: 12px; padding: 22px;
  border-radius: 20px; border: 1px solid var(--line);
  background: linear-gradient(160deg, rgba(124, 92, 255, .16), rgba(255, 255, 255, .03));
  box-shadow: var(--shadow);
}
.hero-stats div { display: flex; align-items: baseline; gap: 10px; }
.hero-stats strong { font-size: 26px; letter-spacing: -.5px; }
.hero-stats span { color: var(--muted); font-size: 13px; }

.cat-hero { padding: 30px 0 6px; }
.cat-hero h1 { margin: 8px 0 4px; font-size: 30px; }
.crumb { font-size: 12.5px; color: var(--muted); }
.crumb a:hover { color: var(--brand-2); }
.crumb span { color: #cfcaf0; }

/* ---------------- 栏目 chips ---------------- */
.cat-chips { display: flex; gap: 8px; flex-wrap: wrap; padding: 18px 20px 4px; }
.chip {
  font-size: 13px; padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--line-2); color: var(--muted); background: rgba(255, 255, 255, .03);
  transition: .18s;
}
.chip:hover { color: var(--txt); border-color: rgba(124, 92, 255, .5); }
.chip.on {
  color: #fff; background: linear-gradient(120deg, rgba(124, 92, 255, .9), rgba(255, 94, 168, .8));
  border-color: transparent;
}

/* ---------------- 商品货架 ---------------- */
.shelf { margin: 34px 0 8px; }
.shelf-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.shelf-head h2 { font-size: 19px; margin: 0; display: flex; align-items: center; gap: 9px; }
.shelf-ico {
  width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center;
  background: rgba(124, 92, 255, .18); font-size: 14px;
}
.link-btn { background: none; border: none; color: var(--brand-2); font-size: 12.5px; padding: 4px 0; }
.link-btn:hover { text-decoration: underline; }

.grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
}

.card {
  position: relative; display: flex; flex-direction: column;
  background: linear-gradient(180deg, var(--card), var(--card-2));
  border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; transition: .2s;
}
.card:hover { border-color: rgba(124, 92, 255, .5); transform: translateY(-3px); box-shadow: var(--shadow); }
.card.picked { border-color: var(--brand-2); box-shadow: 0 0 0 1px var(--brand-2), 0 16px 34px -22px var(--brand-2); }

.pick {
  position: absolute; top: 10px; left: 10px; z-index: 3;
  width: 26px; height: 26px; display: grid; place-items: center;
  border-radius: 8px; background: rgba(8, 8, 15, .72); border: 1px solid var(--line-2);
  cursor: pointer; backdrop-filter: blur(4px);
}
.pick input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.pick-ui {
  width: 13px; height: 13px; border-radius: 4px; border: 1.6px solid #7c7a90; transition: .15s;
}
.pick input:checked + .pick-ui {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  border-color: transparent; box-shadow: 0 0 12px rgba(41, 224, 255, .6);
}

.badge-hot, .badge-off {
  position: absolute; z-index: 3; font-size: 11px; font-weight: 700;
  padding: 3px 8px; border-radius: 7px; letter-spacing: .3px;
}
.badge-hot { top: 10px; right: 10px; background: linear-gradient(120deg, #ff5ea8, #ff7a45); color: #fff; }
.badge-off { top: 40px; right: 10px; background: rgba(53, 208, 127, .16); color: #6ef0ab; border: 1px solid rgba(53, 208, 127, .4); }

.card-thumb { display: block; aspect-ratio: 1 / 1; overflow: hidden; background: #0c0c14; }
.thumb, .big-thumb, .mini-thumb .thumb { width: 100%; height: 100%; object-fit: cover; }
.thumb-ph {
  display: grid; place-items: center;
  background:
    radial-gradient(120% 100% at 20% 0%, hsla(var(--h, 260), 85%, 62%, .55), transparent 60%),
    linear-gradient(160deg, hsla(var(--h, 260), 70%, 30%, .9), #0b0b13);
}
.thumb-ph span {
  font-size: 42px; font-weight: 800; color: rgba(255, 255, 255, .86);
  text-shadow: 0 8px 30px rgba(0, 0, 0, .5);
}
.big-thumb { aspect-ratio: 1/1; border-radius: 20px; }

.card-body { padding: 13px 14px 15px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-body h3 { margin: 0; font-size: 14.5px; line-height: 1.4; font-weight: 600; }
.card-body h3 a:hover { color: var(--brand-2); }
.card-sub { margin: 0; font-size: 12.5px; color: var(--muted); }

.price-row { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.price { color: var(--price); font-weight: 800; font-size: 19px; letter-spacing: -.3px; }
.price-row.big .price { font-size: 30px; }
.price-row .old { color: #6f6c85; font-size: 12.5px; }
.sales { font-size: 11.5px; color: var(--muted); margin-left: auto; }
.specs {
  margin: 0; font-size: 11.5px; color: var(--muted);
  background: var(--surface-2); border: 1px dashed var(--line-2);
  padding: 5px 9px; border-radius: 8px; width: fit-content;
}

.card-actions { display: flex; gap: 8px; margin-top: auto; padding-top: 4px; }
.qty {
  display: inline-flex; align-items: center; border: 1px solid var(--line-2);
  border-radius: 10px; overflow: hidden; background: var(--surface-2);
}
.qty button {
  width: 28px; height: 34px; border: none; background: transparent; color: var(--muted);
  font-size: 16px; line-height: 1; transition: .15s;
}
.qty button:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.qty input {
  width: 38px; height: 34px; border: none; background: transparent; color: var(--txt);
  text-align: center; font-size: 13.5px; -moz-appearance: textfield;
}
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.add-btn {
  flex: 1; border: 1px solid rgba(124, 92, 255, .5); border-radius: 10px;
  background: rgba(124, 92, 255, .16); color: #d7ccff; font-size: 13px; padding: 0 10px;
  height: 34px; transition: .18s;
}
.add-btn:hover { background: rgba(124, 92, 255, .32); color: #fff; }

/* ---------------- 批量条 ---------------- */
.bulk-bar {
  position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%);
  z-index: 45; width: min(860px, calc(100% - 32px));
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 12px 16px; border-radius: 16px;
  background: var(--toast-bg); border: 1px solid rgba(124, 92, 255, .45);
  box-shadow: 0 22px 50px -20px #000; backdrop-filter: blur(12px);
  animation: rise .22s ease-out;
}
@keyframes rise { from { opacity: 0; transform: translate(-50%, 14px); } to { opacity: 1; transform: translate(-50%, 0); } }
.bulk-info { display: flex; align-items: center; gap: 12px; font-size: 13.5px; }
.bulk-info b { color: var(--price); }
.bulk-actions { display: flex; gap: 8px; }

/* ---------------- 详情页 ---------------- */
.detail { display: grid; grid-template-columns: 1fr 1.1fr; gap: 30px; margin: 18px 0 10px; }
.detail-media {
  border-radius: 22px; overflow: hidden; border: 1px solid var(--line);
  background: var(--card); align-self: start; max-width: 520px;
}
.detail-info h1 { font-size: 26px; margin: 6px 0 8px; line-height: 1.3; }
.detail-sub { color: var(--muted); margin: 0 0 14px; font-size: 14px; }
.detail-spec {
  display: flex; gap: 12px; font-size: 13.5px; padding: 10px 14px; margin-bottom: 12px;
  background: var(--surface-2); border-radius: 12px; border: 1px solid var(--line);
}
.detail-spec span { color: var(--muted); }
.detail-desc { font-size: 13.5px; color: #c4c0d8; line-height: 1.8; margin-bottom: 18px; }
.detail-info .card-actions { gap: 10px; }
.usp { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 7px; font-size: 13px; color: var(--muted); }

/* ---------------- 购物车 ---------------- */
.page-head { margin: 8px 0 20px; }
.page-head h1 { font-size: 25px; margin: 0 0 6px; }
.steps { display: flex; gap: 8px; list-style: none; padding: 0; margin: 10px 0 0; font-size: 12.5px; flex-wrap: wrap; }
.steps li {
  padding: 5px 12px; border-radius: 999px; color: var(--muted);
  border: 1px solid var(--line); background: var(--surface-2);
}
.steps li.done { color: #9df5c8; border-color: rgba(53, 208, 127, .35); }
.steps li.on { color: #fff; background: rgba(124, 92, 255, .28); border-color: rgba(124, 92, 255, .6); }

.cart-list {
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  background: var(--card);
}
.cart-row {
  display: grid; grid-template-columns: 62px 1fr 100px 116px 110px 44px;
  align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line);
}
.cart-row:last-child { border-bottom: none; }
.cart-head-row { font-size: 12.5px; color: var(--muted); background: var(--surface-2); }
.cbx { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); cursor: pointer; }
.cbx input { accent-color: var(--brand); width: 15px; height: 15px; }
.cart-prod { display: flex; align-items: center; gap: 12px; min-width: 0; }
.mini-thumb { width: 54px; height: 54px; border-radius: 11px; overflow: hidden; flex-shrink: 0; }
.cart-title { font-size: 14px; font-weight: 600; display: block; margin-bottom: 3px; }
.cart-title:hover { color: var(--brand-2); }
.cart-price { font-size: 14px; color: #cfcaf0; }
.cart-sub { font-size: 15px; font-weight: 700; color: var(--price); }
.del-btn {
  width: 30px; height: 30px; border-radius: 9px; border: 1px solid var(--line);
  background: transparent; color: var(--muted); font-size: 13px;
}
.del-btn:hover { color: var(--bad); border-color: rgba(255, 91, 110, .5); }

.cart-foot {
  display: flex; align-items: center; justify-content: flex-end; gap: 16px;
  margin-top: 16px; padding: 16px 18px; border-radius: var(--radius);
  background: linear-gradient(120deg, rgba(124, 92, 255, .14), rgba(255, 255, 255, .03));
  border: 1px solid var(--line); flex-wrap: wrap;
}
.cart-total { font-size: 13.5px; color: var(--muted); display: flex; align-items: center; gap: 10px; }
.cart-total strong { font-size: 24px; color: var(--price); letter-spacing: -.5px; }

/* ---------------- 结算 ---------------- */
.checkout-grid { display: grid; grid-template-columns: 1.25fr .85fr; gap: 20px; align-items: start; }
.panel {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 22px;
  background: var(--card);
}
.panel-title { font-size: 16px; margin: 0 0 16px; }
.narrow { max-width: 460px; }
.auth-panel h1 { font-size: 24px; margin: 0 0 6px; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.field label i { color: var(--pink); font-style: normal; }
.field input, .field textarea, .field select,
.query-box input, .chat-form input {
  width: 100%; padding: 11px 13px; border-radius: 11px;
  border: 1px solid var(--line-2); background: var(--input-bg);
  color: var(--txt); font-size: 14px; transition: .18s; outline: none;
}
.field input:focus, .field textarea:focus, .query-box input:focus {
  border-color: rgba(124, 92, 255, .7); box-shadow: 0 0 0 3px rgba(124, 92, 255, .18);
}
.field textarea { resize: vertical; }

.summary-list { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 12px; }
.summary-list li { display: flex; align-items: center; gap: 10px; }
.sum-thumb { width: 46px; height: 46px; border-radius: 10px; overflow: hidden; flex-shrink: 0; }
.sum-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.sum-info b { font-size: 13px; font-weight: 600; }
.sum-price { font-size: 13.5px; color: var(--price); font-weight: 700; }
.sum-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13.5px; color: var(--muted); padding: 9px 0; border-top: 1px dashed var(--line);
}
.sum-row.total { border-top: 1px solid var(--line-2); margin-top: 6px; padding-top: 14px; color: var(--txt); }
.sum-row.total strong { font-size: 24px; color: var(--price); }
.row-btns { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }

/* ---------------- 订单列表 ---------------- */
.order-list { display: grid; gap: 12px; }
.order-card {
  border: 1px solid var(--line); border-radius: 14px; background: var(--card); padding: 16px 18px;
}
.order-top { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: 13px; }
.order-no b { color: #cfcaf0; letter-spacing: .5px; }
.order-amount { margin-left: auto; font-weight: 800; color: var(--price); font-size: 16px; }
.order-body { margin: 10px 0; display: grid; gap: 4px; }
.order-foot { border-top: 1px dashed var(--line); padding-top: 10px; }
.tag { font-size: 11.5px; padding: 3px 9px; border-radius: 7px; border: 1px solid var(--line-2); }
.tag.ok { color: #8ef0bc; border-color: rgba(53, 208, 127, .4); background: rgba(53, 208, 127, .12); }
.tag.warn { color: #ffd98a; border-color: rgba(255, 176, 32, .4); background: rgba(255, 176, 32, .12); }
.tag.bad { color: #ff9aa6; border-color: rgba(255, 91, 110, .4); background: rgba(255, 91, 110, .12); }

.query-box { display: flex; gap: 10px; max-width: 520px; margin-bottom: 20px; }
.query-box input { flex: 1; }

.kv { display: grid; grid-template-columns: 76px 1fr; gap: 10px 14px; font-size: 13.5px; margin: 0 0 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }

/* ---------------- 提示 ---------------- */
.flash-wrap { margin-top: 14px; }
.flash {
  padding: 11px 15px; border-radius: 12px; font-size: 13.5px; margin-bottom: 8px;
  background: rgba(53, 208, 127, .14); border: 1px solid rgba(53, 208, 127, .38); color: #9df5c8;
}
.flash.warn { background: rgba(255, 176, 32, .13); border-color: rgba(255, 176, 32, .4); color: #ffd98a; }
.flash.bad { background: rgba(255, 91, 110, .13); border-color: rgba(255, 91, 110, .4); color: #ff9aa6; }
.alert {
  padding: 14px 18px; border-radius: 13px; margin-bottom: 18px; font-size: 13.5px; line-height: 1.8;
  background: rgba(255, 91, 110, .12); border: 1px solid rgba(255, 91, 110, .38); color: #ffb3bc;
}
.empty {
  padding: 46px 20px; text-align: center; color: var(--muted); font-size: 14px;
  border: 1px dashed var(--line-2); border-radius: var(--radius); background: var(--surface-2);
}
.empty.big { padding: 70px 20px; }
.empty .solid-btn { margin-top: 16px; }

.toast {
  position: fixed; left: 50%; top: 22px; transform: translate(-50%, -16px);
  z-index: 90; padding: 11px 18px; border-radius: 12px; font-size: 13.5px;
  background: var(--toast-bg); border: 1px solid rgba(124, 92, 255, .5);
  color: var(--txt); box-shadow: 0 20px 40px -18px #000; opacity: 0; transition: .22s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { border-color: rgba(255, 91, 110, .6); color: #ffb3bc; }

/* ---------------- 页脚 ---------------- */
.site-footer {
  border-top: 1px solid var(--line); margin-top: 40px; padding: 26px 0 40px;
  background: var(--footer-bg);
}
.footer-inner { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; font-size: 13px; }
.footer-inner p { margin: 6px 0 0; font-size: 12.5px; max-width: 60ch; }
.footer-links { display: flex; gap: 16px; flex-wrap: wrap; color: var(--muted); }
.footer-links a:hover { color: var(--brand-2); }

/* ---------------- 客服浮窗 ---------------- */
.chat-widget { position: fixed; right: 22px; bottom: 22px; z-index: 60; }
.chat-fab {
  position: relative; width: 56px; height: 56px; border-radius: 50%;
  border: none; color: #fff; font-size: 23px;
  background: linear-gradient(140deg, var(--brand), var(--pink));
  box-shadow: 0 16px 34px -12px rgba(124, 92, 255, .9), 0 0 0 1px rgba(255, 255, 255, .12) inset;
  display: grid; place-items: center; transition: .2s;
}
.chat-fab:hover { transform: translateY(-2px) scale(1.04); }
.chat-dot {
  position: absolute; top: 2px; right: 2px; width: 13px; height: 13px; border-radius: 50%;
  background: var(--bad); border: 2px solid #0b0b14;
}
.chat-dot.ping { animation: ping 1.1s infinite; }
@keyframes ping {
  0% { box-shadow: 0 0 0 0 rgba(255, 91, 110, .7); }
  70% { box-shadow: 0 0 0 12px rgba(255, 91, 110, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 91, 110, 0); }
}

.chat-panel {
  position: absolute; right: 0; bottom: 70px; width: min(368px, calc(100vw - 32px));
  height: min(540px, calc(100vh - 130px));
  display: flex; flex-direction: column; overflow: hidden;
  border-radius: 20px; border: 1px solid var(--line-2);
  background: linear-gradient(180deg, var(--chat-bg-1), var(--chat-bg-2));
  box-shadow: 0 30px 70px -24px #000;
  animation: rise2 .2s ease-out;
}
@keyframes rise2 { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
.chat-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 13px 15px; border-bottom: 1px solid var(--line);
  background: linear-gradient(120deg, rgba(124, 92, 255, .28), rgba(255, 94, 168, .16));
}
.chat-head strong { font-size: 14.5px; display: block; }
.chat-head small { font-size: 11.5px; color: #cfc7ee; }
.chat-close {
  width: 28px; height: 28px; border-radius: 9px; border: 1px solid var(--line-2);
  background: rgba(0, 0, 0, .2); color: #ddd; font-size: 17px; line-height: 1;
}
.chat-close:hover { background: rgba(0, 0, 0, .4); }

.chat-body { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.chat-msg { display: flex; flex-direction: column; max-width: 86%; }
.chat-msg .bubble {
  padding: 9px 13px; border-radius: 14px; font-size: 13.5px; line-height: 1.6;
  word-break: break-word; white-space: pre-wrap;
}
.chat-msg.admin { align-self: flex-start; align-items: flex-start; }
.chat-msg.admin .bubble { background: var(--bubble-admin); border: 1px solid var(--line); border-bottom-left-radius: 5px; }
.chat-msg.me { align-self: flex-end; align-items: flex-end; }
.chat-msg.me .bubble {
  background: linear-gradient(135deg, rgba(124, 92, 255, .95), rgba(255, 94, 168, .85));
  color: #fff; border-bottom-right-radius: 5px;
}
.chat-time { font-size: 10.5px; color: var(--muted); margin-top: 3px; padding: 0 4px; }

.chat-form { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); }
.chat-form input { flex: 1; padding: 9px 12px; font-size: 13.5px; }
.chat-form .solid-btn { padding: 0 16px; border-radius: 11px; }
.chat-tip { font-size: 10.5px; color: var(--muted); padding: 0 14px 11px; line-height: 1.5; }

/* ============ 图片消息 ============ */
.chat-pic {
  flex: 0 0 auto; width: 38px; height: 38px; border-radius: 10px;
  border: 1px solid var(--line-2); background: var(--surface-2);
  color: var(--txt); font-size: 17px; display: grid; place-items: center;
  cursor: pointer; transition: .16s;
}
.chat-pic:hover { background: var(--surface-3); }
.chat-img-link { display: block; }
.chat-img {
  max-width: 200px; max-height: 200px; border-radius: 12px; display: block;
  border: 1px solid var(--line); background: var(--surface-2);
}

/* ============ 运费 / 禁区提示 ============ */
.ship-alert {
  display: flex; flex-direction: column; gap: 7px;
  padding: 14px 16px; margin-bottom: 18px; border-radius: 14px;
  background: linear-gradient(120deg, rgba(255, 176, 32, .16), rgba(255, 91, 110, .10));
  border: 1px solid rgba(255, 176, 32, .45);
  border-left: 4px solid #ffb020;
  font-size: 14px; line-height: 1.6;
}
.ship-alert-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ship-alert-line b { color: #ffc94d; font-size: 15.5px; letter-spacing: .3px; }
.ship-alert .ship-ico { font-size: 18px; line-height: 1; }
.ship-alert-tip { font-size: 12px; color: var(--muted); }

body:is([data-theme="light"], [data-theme="rose"], [data-theme="sepia"]) .ship-alert {
  background: linear-gradient(120deg, #fff7e6, #fff0ee);
  border-color: #ffd08a;
  border-left-color: #f0a020;
}
body:is([data-theme="light"], [data-theme="rose"], [data-theme="sepia"]) .ship-alert-line b { color: #b25c00; }

/* ============ 快递查询二维码 ============ */
.ship-qr {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 16px; margin-bottom: 18px; border-radius: 14px;
  background: var(--card); border: 1px solid var(--line);
}
.ship-qr img {
  max-width: 100%; max-height: 240px; width: auto; height: auto;
  border-radius: 10px; background: #fff; flex: 0 0 auto;
  border: 1px solid var(--line); padding: 4px;
}
.ship-qr-info strong { display: block; font-size: 15px; margin-bottom: 4px; }
.ship-qr-info p { margin: 0; font-size: 12.5px; }

@media (max-width: 560px) {
  .ship-qr { padding: 12px; gap: 12px; align-items: flex-start; }
  .ship-qr img { max-height: 170px; }
  .ship-alert { padding: 12px 14px; }
  .ship-alert-line b { font-size: 14.5px; }
}

/* ============ 主题切换 ============ */
.theme-switch { position: relative; }
.theme-btn { padding: 8px 10px; font-size: 15px; line-height: 1; }
.theme-menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 50;
  width: 170px; padding: 8px; border-radius: 12px;
  background: var(--toast-bg); border: 1px solid var(--line-2);
  box-shadow: 0 18px 40px -18px #000;
  display: grid; gap: 4px;
}
.theme-menu[hidden] { display: none !important; }
.theme-menu button {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: 8px; border: 0; background: transparent;
  color: var(--txt); font-size: 13px; cursor: pointer; text-align: left;
}
.theme-menu button:hover { background: var(--surface-2); }
.theme-menu button.on { background: rgba(124, 92, 255, .22); }
.theme-dot {
  width: 14px; height: 14px; border-radius: 50%;
  border: 1px solid var(--line-2); flex: 0 0 auto;
}

/* 浅色系主题的细节修正 */
body[data-theme="light"] .card:hover,
body[data-theme="rose"] .card:hover,
body[data-theme="sepia"] .card:hover {
  box-shadow: 0 18px 38px -24px rgba(20, 20, 40, .45);
}
body[data-theme="light"] .notice,
body[data-theme="rose"] .notice,
body[data-theme="sepia"] .notice {
  color: #8a5a00; background: rgba(255, 176, 32, .16); border-color: rgba(190, 130, 0, .35);
}
body[data-theme="light"] .badge-off,
body[data-theme="rose"] .badge-off,
body[data-theme="sepia"] .badge-off {
  color: #0d7a45; background: rgba(53, 208, 127, .16); border-color: rgba(20, 150, 90, .4);
}
body[data-theme="light"] .tag.ok,
body[data-theme="rose"] .tag.ok,
body[data-theme="sepia"] .tag.ok { color: #0d7a45; }
body[data-theme="light"] .chat-head small,
body[data-theme="rose"] .chat-head small,
body[data-theme="sepia"] .chat-head small { color: rgba(255, 255, 255, .82); }
body[data-theme="light"] .hero-stats,
body[data-theme="rose"] .hero-stats,
body[data-theme="sepia"] .hero-stats {
  background: linear-gradient(160deg, rgba(124, 92, 255, .12), rgba(255, 255, 255, .6));
}
body[data-theme="light"] .brand-text small,
body[data-theme="rose"] .brand-text small,
body[data-theme="sepia"] .brand-text small { color: var(--muted); }

/* 浅色下按钮/导航/chip 的对比度 */
body:is([data-theme="light"], [data-theme="rose"], [data-theme="sepia"]) .top-nav a.on {
  background: rgba(124, 92, 255, .16);
  color: #4b2fd6;
  box-shadow: inset 0 0 0 1px rgba(124, 92, 255, .4);
}
body:is([data-theme="light"], [data-theme="rose"], [data-theme="sepia"]) .add-btn {
  background: rgba(124, 92, 255, .12);
  border-color: rgba(124, 92, 255, .42);
  color: #4b2fd6;
}
body:is([data-theme="light"], [data-theme="rose"], [data-theme="sepia"]) .add-btn:hover {
  background: rgba(124, 92, 255, .24);
  color: #3a1fa8;
}
body:is([data-theme="light"], [data-theme="rose"], [data-theme="sepia"]) .pill {
  color: #4b2fd6;
  background: rgba(124, 92, 255, .12);
  border-color: rgba(124, 92, 255, .32);
}
body:is([data-theme="light"], [data-theme="rose"], [data-theme="sepia"]) .hero-pts span {
  color: #3f3b55;
  background: rgba(18, 18, 40, .04);
}
body:is([data-theme="light"], [data-theme="rose"], [data-theme="sepia"]) .link-btn { color: #0b7fa0; }
body:is([data-theme="light"], [data-theme="rose"], [data-theme="sepia"]) .chip { color: #5f5d72; }
body:is([data-theme="light"], [data-theme="rose"], [data-theme="sepia"]) .chip.on { color: #fff; }
body:is([data-theme="light"], [data-theme="rose"], [data-theme="sepia"]) .specs { color: #5f5d72; }
body:is([data-theme="light"], [data-theme="rose"], [data-theme="sepia"]) .qty button { color: #5f5d72; }
body:is([data-theme="light"], [data-theme="rose"], [data-theme="sepia"]) .qty button:hover { color: #171722; background: rgba(18, 18, 40, .06); }
body:is([data-theme="light"], [data-theme="rose"], [data-theme="sepia"]) .detail-desc { color: #3f3b55; }
body:is([data-theme="light"], [data-theme="rose"], [data-theme="sepia"]) .cart-total strong,
body:is([data-theme="light"], [data-theme="rose"], [data-theme="sepia"]) .order-amount { color: var(--price); }

/* ===========================================================
   响应式
   =========================================================== */
@media (max-width: 1100px) {
  .hero-inner { gap: 26px; }
}

@media (max-width: 980px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hero-stats div { flex-direction: column; gap: 2px; }
  .hero-stats strong { font-size: 20px; }
  .detail { grid-template-columns: 1fr; }
  .detail-media { max-width: 100%; }
  .checkout-grid { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .wrap { padding: 0 16px; }
  .main { padding: 22px 16px 104px; }
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
}

@media (max-width: 720px) {
  .site-header .header-inner { height: auto; padding: 9px 16px; flex-wrap: wrap; gap: 8px; }
  .brand { gap: 8px; }
  .brand-mark { width: 32px; height: 32px; font-size: 16px; border-radius: 10px; }
  .brand-text strong { font-size: 13.5px; }
  .brand-text small { display: none; }

  .top-nav { order: 3; width: 100%; flex: 0 0 100%; gap: 2px; }
  .top-nav a { padding: 7px 10px; font-size: 12.5px; }

  .header-actions { gap: 6px; margin-left: auto; }
  .header-actions .ghost-btn, .header-actions .solid-btn { padding: 7px 10px; font-size: 12.5px; border-radius: 9px; }
  .hello { display: none; }

  .hero { padding: 20px 0 6px; }
  .hero h1 { font-size: clamp(22px, 6.2vw, 30px); margin: 12px 0 10px; line-height: 1.25; }
  .hero p { font-size: 13.5px; margin-bottom: 12px; }
  .hero-pts { gap: 6px; margin-bottom: 10px; }
  .hero-pts span { font-size: 11.5px; padding: 6px 9px; }
  .notice { font-size: 12px; padding: 8px 11px; }
  .hero-stats { padding: 14px; gap: 8px; border-radius: 16px; }
  .hero-stats strong { font-size: 18px; }
  .hero-stats span { font-size: 11px; }

  .cat-hero h1 { font-size: 23px; }
  .cat-chips {
    padding: 12px 16px 4px;
    flex-wrap: wrap;
    overflow: visible;
    gap: 8px;
  }
  .chip { flex: 0 0 auto; padding: 7px 12px; font-size: 12.5px; }

  .shelf { margin: 22px 0 4px; }
  .shelf-head { margin-bottom: 10px; }
  .shelf-head h2 { font-size: 16px; gap: 7px; }
  .shelf-ico { width: 24px; height: 24px; font-size: 12px; border-radius: 7px; }

  /* 两列固定，minmax(0,1fr) 防止内容把栅格撑破 */
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .card-body { padding: 10px 10px 12px; gap: 6px; }
  .card-body h3 { font-size: 13px; line-height: 1.35; }
  .card-sub { font-size: 11px; }
  .price { font-size: 17px; }
  .price-row { gap: 6px; }
  .price-row .old { font-size: 11px; }
  .sales { font-size: 10.5px; }
  .specs { font-size: 10.5px; padding: 4px 7px; }
  .badge-hot, .badge-off { font-size: 10px; padding: 2px 6px; }
  .pick { width: 24px; height: 24px; top: 8px; left: 8px; border-radius: 7px; }

  /* 手机端：数量占一行、按钮占一行，不再挤在一起 */
  .card-actions { flex-direction: column; gap: 6px; padding-top: 2px; }
  .card-actions .qty { width: 100%; justify-content: space-between; }
  .card-actions .qty button { width: 34px; height: 36px; font-size: 18px; }
  .card-actions .qty input { flex: 1; width: auto; height: 36px; font-size: 14px; }
  .card-actions .add-btn { width: 100%; height: 36px; font-size: 12.5px; }

  .detail-media { border-radius: 16px; }
  .detail-info h1 { font-size: 20px; }
  .detail-sub { font-size: 13px; }
  .price-row.big .price { font-size: 26px; }
  .detail-info .card-actions { flex-direction: row; flex-wrap: wrap; gap: 8px; }
  .detail-info .card-actions .qty { flex: 1 1 100%; }
  .detail-info .card-actions .ghost-btn,
  .detail-info .card-actions .solid-btn { flex: 1 1 calc(50% - 4px); }
  .detail-info .card-actions .big-btn { padding: 11px 12px; font-size: 13.5px; }
  .big-thumb { max-height: 340px; object-fit: cover; }
  .usp { font-size: 12.5px; margin-top: 16px; }

  /* 购物车改卡片式：第一行商品、第二行数量与小计 */
  .cart-row {
    grid-template-columns: 26px minmax(0, 1fr) auto;
    grid-template-areas:
      "pick prod sub"
      "pick qty  del";
    row-gap: 8px;
    padding: 12px;
    gap: 10px;
  }
  .cart-head-row { display: none; }
  .cart-price { display: none; }
  .cart-row .cbx { grid-area: pick; align-self: start; padding-top: 4px; }
  .cart-prod { grid-area: prod; }
  .cart-row .qty { grid-area: qty; justify-self: start; }
  .cart-sub { grid-area: sub; text-align: right; font-size: 14px; }
  .del-btn { grid-area: del; justify-self: end; }
  .cart-title { font-size: 13px; }
  .mini-thumb { width: 48px; height: 48px; }
  .cart-foot { padding: 12px; gap: 10px; justify-content: space-between; }
  .cart-total { font-size: 12.5px; }
  .cart-total strong { font-size: 20px; }
  .big-btn { padding: 11px 16px; font-size: 14px; }

  .page-head h1 { font-size: 21px; }
  .panel { padding: 16px; border-radius: 13px; }
  .panel-title { font-size: 15px; margin-bottom: 12px; }
  .checkout-grid { gap: 14px; }
  .summary-list li { gap: 8px; }
  .sum-thumb { width: 42px; height: 42px; }

  .order-top { gap: 8px; font-size: 12.5px; }
  .order-amount { font-size: 15px; }
  .kv { grid-template-columns: 68px 1fr; font-size: 13px; }

  .bulk-bar { bottom: 80px; flex-direction: column; align-items: stretch; gap: 8px; padding: 10px 12px; }
  .bulk-info { justify-content: space-between; }
  .bulk-actions { gap: 8px; }
  .bulk-actions .ghost-btn, .bulk-actions .solid-btn { flex: 1; }

  .chat-widget { right: 14px; bottom: 14px; }
  .chat-fab { width: 52px; height: 52px; font-size: 21px; }
  .chat-panel { width: calc(100vw - 28px); height: min(72vh, 520px); bottom: 64px; }

  .footer-inner { gap: 12px; }
  .footer-links { gap: 12px; font-size: 12.5px; }
  .site-footer { padding: 20px 0 110px; }
}

/* 手机端客服：直接全屏，不用手动调窗口 */
@media (max-width: 560px) {
  .chat-widget { right: 12px; bottom: 12px; }
  .chat-panel {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    max-height: none;
    border-radius: 0;
    border: 0;
  }
  .chat-head { padding: 14px 16px; padding-top: calc(14px + env(safe-area-inset-top)); }
  .chat-head strong { font-size: 15px; }
  .chat-head small { font-size: 11.5px; }
  .chat-close { width: 32px; height: 32px; font-size: 20px; }
  .chat-body { padding: 14px 16px; gap: 10px; }
  .chat-msg { max-width: 84%; }
  .chat-msg .bubble { font-size: 14px; }
  .chat-form { padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); }
  .chat-form input { font-size: 15px; }
  .chat-tip { padding: 0 16px calc(10px + env(safe-area-inset-bottom)); font-size: 10.5px; }
}

@media (max-width: 420px) {
  .wrap { padding: 0 12px; }
  .site-header .header-inner { padding: 8px 12px; }
  .main { padding: 16px 12px 100px; }
  .brand-text strong { font-size: 13px; }
  .header-actions .ghost-btn, .header-actions .solid-btn { padding: 6px 9px; font-size: 12px; }
  .hero h1 { font-size: 22px; }
  .hero-stats { padding: 12px; }
  .hero-stats strong { font-size: 16px; }
  .hero-stats span { font-size: 10.5px; }
  .grid { gap: 8px; }
  .card-body { padding: 9px 9px 10px; }
  .card-body h3 { font-size: 12.5px; }
  .price { font-size: 16px; }
  .cat-chips { padding-left: 12px; }
  .cart-row { padding: 10px; gap: 8px; }
  .query-box { flex-direction: column; }
  .query-box input { width: 100%; }
  .chat-panel { width: calc(100vw - 20px); }
  .steps li { font-size: 11.5px; padding: 4px 9px; }
  .del-btn { width: 28px; height: 28px; }
}

@media print {
  .site-header, .site-footer, .chat-widget, .bulk-bar, .flash, .row-btns, .steps { display: none !important; }
  body { background: #fff; color: #111; }
  .panel, .order-card { border-color: #ddd; background: #fff; }
  .price, .sum-price, .order-amount, .sum-row.total strong { color: #c2185b; }
}
