:root { --brand:#5b4df0; --brand-soft:#efedff; --text:#1f2328; --muted:#6b7280; --line:#e9eaee; --soft:#f6f7f9; --red:#e5484d; }
* { box-sizing:border-box; }
html, body { margin:0; background:#fff; }
body { font:14px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",Roboto,Arial,sans-serif; color:var(--text); }
a { color:inherit; text-decoration:none; }
button, input, select, textarea { font:inherit; color:inherit; }
button { cursor:pointer; }
.wrap { max-width:1272px; margin:0 auto; padding:0 16px; }

/* 页头 */
header { border-bottom:1px solid var(--line); background:#fff; position:sticky; top:0; z-index:20; }
.bar { display:flex; align-items:center; gap:10px; height:56px; }
.logo { display:flex; align-items:center; gap:8px; font-size:13px; font-weight:500; margin-right:auto; min-width:0; }
.logo i { flex:0 0 22px; height:22px; border-radius:50%; background:var(--brand); display:grid; place-items:center; }
.logo i::after { content:""; width:9px; height:7px; border:2px solid #fff; border-radius:2px; }
.logo span { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.search { position:relative; width:280px; }
.search input { width:100%; height:34px; border:1px solid var(--line); border-radius:17px; padding:0 14px 0 34px; outline:none; }
.search input:focus { border-color:var(--brand); }
.search svg { position:absolute; left:12px; top:9px; }
.pill { height:34px; padding:0 12px; border:1px solid var(--line); border-radius:17px; background:#fff; font-size:13px; font-weight:600; display:inline-flex; align-items:center; gap:4px; position:relative; }
.pill select { position:absolute; inset:0; opacity:0; cursor:pointer; }
.cta { height:34px; padding:0 16px; border:0; border-radius:17px; background:var(--brand); color:#fff; font-weight:600; position:relative; white-space:nowrap; }
.cta b { position:absolute; top:-6px; right:-6px; min-width:18px; height:18px; line-height:18px; border-radius:9px; background:var(--red); color:#fff; font-size:11px; text-align:center; padding:0 4px; }
.notice { background:var(--soft); color:var(--muted); font-size:12px; text-align:center; padding:6px 16px; }

main { min-height:70vh; padding:20px 0 40px; }
h1 { font-size:18px; font-weight:700; margin:0 0 14px; color:#3a3f47; }
.chips { display:flex; gap:8px; flex-wrap:wrap; margin:-4px 0 16px; }
.chip { border:1px solid var(--line); background:#fff; border-radius:14px; padding:3px 12px; font-size:12px; }
.chip.on { border-color:var(--brand); color:var(--brand); background:var(--brand-soft); }

/* 商品网格 */
.grid { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:22px 12px; }
.card img { width:100%; aspect-ratio:4/3; object-fit:cover; background:var(--soft); display:block; }
.card .t { margin-top:10px; color:#4b5058; line-height:1.5; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.card .pr { margin-top:4px; font-weight:700; }
.cmp { color:#a1a6ae; text-decoration:line-through; font-size:11px; font-weight:400; margin-left:6px; }
.pager { display:flex; justify-content:center; align-items:center; gap:6px; margin-top:36px; }
.pager button { min-width:34px; height:34px; border:1px solid transparent; background:#fff; border-radius:6px; }
.pager button.on { border-color:#3a3f47; }
.pager button:disabled { color:#d0d3d8; cursor:default; }
.empty { text-align:center; color:var(--muted); padding:70px 0; }

/* 详情 */
.detail { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:40px; }
.gallery .main { width:100%; aspect-ratio:1/1; object-fit:cover; background:var(--soft); border-radius:6px; display:block; }
.thumbs { display:flex; gap:8px; margin-top:10px; flex-wrap:wrap; }
.thumbs img { width:64px; height:64px; object-fit:cover; border-radius:4px; border:2px solid transparent; cursor:pointer; }
.thumbs img.on { border-color:var(--brand); }
.price-big { font-size:26px; font-weight:700; }
.ptitle { font-size:18px; font-weight:600; margin:6px 0 4px; }
.free { color:#16a34a; font-size:13px; }
.lbl { font-weight:600; margin:16px 0 8px; }
.deliver { display:flex; align-items:center; gap:8px; color:var(--muted); font-size:13px; }
.deliver select { border:1px solid var(--line); border-radius:6px; height:30px; padding:0 6px; }
.opts { display:flex; flex-wrap:wrap; gap:8px; }
.opt { border:1px solid var(--line); background:#fff; border-radius:6px; padding:6px 12px; font-size:13px; text-align:left; }
.opt.on { border-color:var(--brand); color:var(--brand); background:var(--brand-soft); }
.qty { display:inline-flex; border:1px solid var(--line); border-radius:6px; overflow:hidden; }
.qty button { width:34px; border:0; background:#fff; font-size:16px; }
.qty input { width:56px; height:34px; border:0; border-left:1px solid var(--line); border-right:1px solid var(--line); text-align:center; outline:none; }
.buy { display:flex; gap:12px; margin:22px 0 16px; }
.btn { height:44px; padding:0 22px; border-radius:22px; border:1px solid var(--brand); background:var(--brand); color:#fff; font-weight:600; flex:1; }
.btn.ghost { background:#fff; color:var(--brand); }
.btn:disabled { opacity:.5; cursor:default; }
.btn.sm { height:36px; flex:none; }
.guard { border:1px solid var(--line); border-radius:8px; padding:12px 14px; font-size:13px; }
.guard .h { font-weight:600; margin-bottom:6px; }
.guard .r { color:var(--muted); display:flex; flex-wrap:wrap; gap:4px 14px; }
.desc-h { font-size:16px; font-weight:700; margin:28px 0 10px; padding-top:20px; border-top:1px solid var(--line); }
.desc { white-space:pre-wrap; color:#444; }
.stock-out { color:var(--red); font-size:13px; margin-top:8px; }

/* 购物车 / 结账 */
.cart-row .end { display:flex; gap:18px; align-items:center; }
.cart-row { display:grid; grid-template-columns:72px 1fr auto; gap:14px; align-items:center; padding:14px 0; border-bottom:1px solid var(--line); }
.cart-row img { width:72px; height:72px; object-fit:cover; border-radius:6px; background:var(--soft); }
.sub { color:var(--muted); font-size:12px; }
.link { color:var(--brand); background:none; border:0; padding:0; }
.two { display:grid; grid-template-columns:minmax(0,1.3fr) minmax(0,1fr); gap:32px; align-items:start; }
.form label { display:block; font-size:13px; color:var(--muted); margin:12px 0 4px; }
.form input, .form select, .form textarea { width:100%; height:40px; border:1px solid var(--line); border-radius:6px; padding:0 10px; outline:none; background:#fff; }
.form input:focus, .form select:focus, .form textarea:focus { border-color:var(--brand); }
.form textarea { height:76px; padding:8px 10px; resize:vertical; }
.row2 { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.box { border:1px solid var(--line); border-radius:8px; padding:16px; }
.sl { display:flex; justify-content:space-between; gap:12px; padding:4px 0; }
.sl.total { font-weight:700; font-size:16px; border-top:1px solid var(--line); margin-top:8px; padding-top:10px; }
.err { color:var(--red); font-size:13px; min-height:20px; margin-top:8px; }
.tag { display:inline-block; padding:2px 10px; border-radius:10px; font-size:12px; background:#fff4e5; color:#b45309; }
.tag.ok { background:#e8f8ee; color:#15803d; }
.tag.gray { background:#f1f2f4; color:#6b7280; }
.narrow { max-width:600px; margin:0 auto; }
.hint { background:var(--soft); border-radius:8px; padding:12px 14px; color:var(--muted); font-size:13px; margin-top:14px; }

footer { padding:24px 0 30px; text-align:center; font-size:12px; color:var(--muted); }
.divider { display:flex; align-items:center; gap:12px; max-width:1140px; margin:0 auto 14px; color:#c7cad0; }
.divider::before, .divider::after { content:""; flex:1; height:1px; background:linear-gradient(90deg,transparent,#dfe1e5,transparent); }
footer nav { display:flex; flex-wrap:wrap; justify-content:center; gap:6px 16px; margin-bottom:8px; }
footer nav a:hover { color:var(--brand); }

.wa { position:fixed; right:18px; bottom:90px; width:46px; height:46px; border-radius:50%; background:#25d366; display:grid; place-items:center; box-shadow:0 4px 12px rgba(0,0,0,.15); z-index:30; }
[hidden] { display:none !important; }
.toast { position:fixed; left:50%; top:76px; transform:translateX(-50%); background:rgba(17,17,17,.9); color:#fff; padding:10px 18px; border-radius:8px; z-index:99; }
.loading { text-align:center; color:var(--muted); padding:80px 0; }

@media (max-width:1100px) { .grid { grid-template-columns:repeat(4,minmax(0,1fr)); } }
@media (max-width:860px) { .grid { grid-template-columns:repeat(3,minmax(0,1fr)); } .search { width:180px; } }
@media (max-width:700px) {
  .grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px 10px; }
  .detail, .two { grid-template-columns:1fr; gap:20px; }
  .search { display:none; }
  .pill.cur { display:none; }
  .msearch { display:block !important; margin-bottom:14px; }
  .cart-row { grid-template-columns:60px 1fr; }
  .cart-row img { width:60px; height:60px; }
  .cart-row .end { grid-column:2; display:flex; justify-content:space-between; align-items:center; }
}
.msearch { display:none; }
.msearch input { width:100%; height:38px; border:1px solid var(--line); border-radius:19px; padding:0 14px; }
