:root {
  --ink: #111827;
  --muted: #6b7280;
  --line: #e8eaee;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --brand: #1f5eff;
  --brand-ink: #143fb5;
  --brand-soft: #eef3ff;
  --ok: #0f9d58;
  --danger: #d92d20;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(17, 24, 39, .06);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.65 system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
h1, h2, h3 { margin: 0; letter-spacing: -.01em; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }

/* 顶部 */
.hdr {
  position: sticky; top: 0; z-index: 30;
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.hdr-in {
  max-width: 1080px; margin: 0 auto; padding: 12px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.brand { display: flex; align-items: center; gap: 9px; color: var(--ink); }
.logo {
  width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(135deg, #2d6bff, #7aa2ff); color: #fff; font-weight: 700; font-size: 15px;
}
.brand-txt { display: flex; flex-direction: column; font-weight: 700; font-size: 15px; line-height: 1.15; }
.brand-txt small { color: var(--muted); font-weight: 400; font-size: 11px; }
.hdr-nav { display: flex; align-items: center; gap: 4px; }
.hdr-nav a {
  color: #374151; padding: 7px 11px; border-radius: 9px; font-size: 14px; position: relative;
}
.hdr-nav a:hover { background: #f1f3f7; }
.hdr-nav a.on { color: var(--brand); background: var(--brand-soft); font-weight: 600; }
.badge {
  position: absolute; top: 0; right: 0; transform: translate(35%, -30%);
  background: var(--brand); color: #fff; font-size: 10.5px; font-style: normal;
  min-width: 16px; height: 16px; line-height: 16px; text-align: center; border-radius: 999px; padding: 0 4px;
}

.notice-bar {
  max-width: 1080px; margin: 10px auto 0; padding: 0 16px;
  display: flex; gap: 8px; align-items: baseline; color: var(--muted); font-size: 13px;
}
.notice-bar span { color: var(--brand); font-weight: 600; flex: none; }
.notice-bar p { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 16px 16px 48px; }
.ftr { border-top: 1px solid var(--line); padding: 22px 16px 30px; text-align: center; color: var(--muted); font-size: 12.5px; }
.ftr p { margin: 2px 0; }
.ftr-sub { color: #9aa1ac; }

/* 首页 hero */
.hero {
  position: relative; overflow: hidden;
  background: linear-gradient(120deg, #12203c 0%, #1c3567 55%, #2a4a86 100%);
  color: #fff; border-radius: 18px; padding: 28px 22px; margin-bottom: 18px;
}
.hero h1 { font-size: 26px; margin-bottom: 8px; }
.hero p { margin: 0; color: #c8d5ea; font-size: 14px; }
.hero-tags { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.hero-tags span {
  background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .18);
  padding: 4px 10px; border-radius: 999px; font-size: 12px; color: #dce6f6;
}
.hero-art { position: absolute; right: -40px; top: -60px; width: 220px; height: 220px; }
.orb {
  width: 100%; height: 100%; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(122, 162, 255, .85), rgba(122, 162, 255, .05) 60%);
  filter: blur(2px);
}

.notices { display: grid; gap: 8px; margin-bottom: 16px; }
.notice { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.notice summary { cursor: pointer; font-weight: 600; font-size: 14px; }
.notice p { margin: 8px 0 0; color: var(--muted); font-size: 13.5px; white-space: pre-wrap; }

.cats { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 12px; scrollbar-width: none; }
.cats::-webkit-scrollbar { display: none; }
.chip {
  flex: none; border: 1px solid var(--line); background: #fff; color: #374151;
  padding: 7px 14px; border-radius: 999px; font-size: 13.5px; display: inline-flex; gap: 6px; align-items: center;
}
.chip i { color: #9aa1ac; font-style: normal; font-size: 12px; }
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip.on i { color: #d5e0ff; }

/* 商品网格 */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.pcard {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; color: var(--ink); display: flex; flex-direction: column;
  transition: transform .16s ease, box-shadow .16s ease;
}
.pcard:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.pcover { position: relative; aspect-ratio: 16 / 10; background: #eef1f6; display: grid; place-items: center; }
.pcover img { width: 100%; height: 100%; object-fit: cover; }
.pcover-ph { font-size: 30px; color: #b3bdcc; font-weight: 700; }
.psold {
  position: absolute; inset: auto 0 0 auto; background: rgba(17, 24, 39, .78); color: #fff;
  font-size: 11px; padding: 3px 8px; border-radius: 8px 0 0 0;
}
.pbody { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; }
.pbody h3 { font-size: 14.5px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pmeta { margin: 0; color: var(--muted); font-size: 12px; }
.prow { display: flex; align-items: baseline; justify-content: space-between; margin-top: 4px; }
.price { color: var(--danger); font-weight: 700; font-size: 16px; }
.price.big { font-size: 28px; }
.pstock { color: var(--muted); font-size: 12px; }

/* 详情 */
.crumb { display: flex; gap: 6px; align-items: center; color: var(--muted); font-size: 12.5px; margin-bottom: 12px; flex-wrap: wrap; }
.crumb b { color: var(--ink); font-weight: 600; }
.detail { display: grid; gap: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.detail-media { border-radius: 12px; overflow: hidden; background: #eef1f6; aspect-ratio: 16 / 10; display: grid; place-items: center; }
.detail-media img { width: 100%; height: 100%; object-fit: cover; }
.detail-ph { font-size: 52px; color: #b3bdcc; font-weight: 700; }
.detail-main h1 { font-size: 20px; margin-bottom: 6px; }
.detail-meta { display: flex; gap: 12px; color: var(--muted); font-size: 12.5px; margin: 0 0 12px; flex-wrap: wrap; }
.price-box { background: var(--brand-soft); border-radius: 12px; padding: 12px 14px; }
.price-box .price { color: var(--brand-ink); }
.ladder { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; align-items: center; }
.ladder-t { font-size: 12px; color: var(--muted); }
.ladder-i { background: #fff; border: 1px solid #dce5ff; color: var(--brand-ink); font-size: 12px; padding: 2px 8px; border-radius: 999px; }
.qty-row { display: flex; align-items: center; gap: 10px; margin: 14px 0; flex-wrap: wrap; font-size: 13.5px; color: var(--muted); }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.stepper button { width: 34px; height: 34px; border: 0; background: #fff; font-size: 17px; color: #374151; cursor: pointer; }
.stepper button:hover { background: #f3f5f9; }
.stepper input { width: 52px; height: 34px; border: 0; text-align: center; font-size: 14px; -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty-hint { font-size: 12px; }
.buy-row { display: flex; gap: 10px; }
.buy-row .btn { flex: 1; }
.trust { margin: 16px 0 0; padding: 12px 0 0; border-top: 1px dashed var(--line); list-style: none; color: var(--muted); font-size: 12.5px; display: grid; gap: 4px; }
.trust li::before { content: "✓"; color: var(--ok); margin-right: 6px; }

/* 通用组件 */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
.panel h2 { font-size: 15px; margin-bottom: 10px; }
.panel h3 { font-size: 13.5px; margin: 14px 0 8px; color: #374151; }
.panel p { color: #3f4753; font-size: 14px; }
.page-title { font-size: 19px; margin: 6px 0 14px; }
.empty { color: var(--muted); font-size: 13.5px; }
.empty-state { text-align: center; padding: 60px 16px; color: var(--muted); }
.empty-state .big { font-size: 44px; font-weight: 700; color: #c3cbd8; margin: 0 0 6px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  padding: 10px 16px; border-radius: 11px; font-size: 14.5px; cursor: pointer; font-weight: 600;
  transition: filter .15s ease, background .15s ease;
}
.btn:hover { background: #f7f8fa; }
.btn.solid { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.solid:hover { filter: brightness(1.06); }
.btn.ghost { background: var(--brand-soft); border-color: #d8e2ff; color: var(--brand-ink); }
.btn.ghost:hover { background: #e3ebff; }
.btn.block { width: 100%; }
.btn.sm { padding: 7px 11px; font-size: 13px; }
.btn.xs { padding: 4px 9px; font-size: 12px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

.form { display: grid; gap: 12px; }
.form label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.form input, .form textarea, input, textarea {
  font: inherit; color: var(--ink); background: #fff;
  border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; outline: none;
}
.form input:focus { border-color: #9db7ff; box-shadow: 0 0 0 3px rgba(31, 94, 255, .12); }
.form-tip { color: var(--muted); font-size: 12px; margin: 0; text-align: center; }
.captcha-row { display: flex; gap: 10px; align-items: center; }
.captcha-row input { flex: 1; }
.captcha-row img { height: 42px; width: 120px; border-radius: 9px; border: 1px solid var(--line); cursor: pointer; background: #f4f6f9; }

/* 购物车 */
.cart-lines { display: grid; gap: 10px; }
.cart-line, .co-line {
  display: flex; align-items: center; gap: 10px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px;
}
.cart-line { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "main del" "qty price"; gap: 8px 10px; }
.cl-main { grid-area: main; }
.cl-main h3 { font-size: 14.5px; }
.cl-meta { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.cl-qty { grid-area: qty; display: inline-flex; align-items: center; gap: 8px; }
.cl-qty button { width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-size: 15px; }
.cl-qty span { min-width: 24px; text-align: center; font-size: 14px; }
.cl-price { grid-area: price; justify-self: end; font-weight: 700; color: var(--danger); }
.cl-del { grid-area: del; justify-self: end; border: 0; background: transparent; color: #b3bac6; font-size: 20px; cursor: pointer; line-height: 1; }
.cart-foot { margin-top: 14px; display: grid; gap: 12px; }
.cart-sum { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: grid; gap: 4px; }
.cart-sum p { margin: 0; display: flex; justify-content: space-between; font-size: 13.5px; color: var(--muted); }
.cart-sum b { color: var(--ink); }
.cart-sum .total { margin-top: 6px; padding-top: 8px; border-top: 1px dashed var(--line); font-size: 15px; }
.cart-sum .total b { color: var(--danger); font-size: 20px; }

/* 结算 */
.checkout { display: grid; gap: 14px; }
.co-lines { display: grid; gap: 8px; }
.co-line { justify-content: space-between; }
.co-line span { flex: 1; font-size: 14px; }
.co-line i { color: var(--muted); font-style: normal; font-size: 12.5px; }
.co-line b { color: var(--danger); }
.co-sum { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); display: grid; gap: 4px; }
.co-sum p { margin: 0; display: flex; justify-content: space-between; font-size: 13.5px; color: var(--muted); }
.co-sum .total b { color: var(--danger); font-size: 20px; }

/* 支付 */
.pay-card { text-align: center; padding: 22px 16px; }
.pay-state { margin: 0; color: var(--muted); font-size: 13px; }
.pay-amount { margin: 6px 0 4px; font-size: 40px; font-weight: 700; color: var(--ink); letter-spacing: -.02em; }
.pay-amount i { font-size: 20px; font-style: normal; margin-right: 2px; color: var(--muted); }
.pay-no { margin: 0 0 16px; color: var(--muted); font-size: 12.5px; }
.countdown { background: #fff7e8; color: #9a5b00; border: 1px solid #ffe2b8; border-radius: 10px; padding: 8px 12px; font-size: 13px; display: inline-block; margin-bottom: 12px; }
.pay-placeholder { background: #f7f8fa; border: 1px dashed var(--line); border-radius: 12px; padding: 16px; color: var(--muted); font-size: 13px; margin-bottom: 14px; }
.pay-placeholder p { margin: 2px 0; }
.pay-done-tip { color: var(--ok); font-size: 13.5px; }

/* 查询结果 */
.r-line { display: flex; justify-content: space-between; gap: 12px; margin: 6px 0; font-size: 13.5px; color: var(--muted); }
.r-line b { color: var(--ink); font-weight: 600; word-break: break-all; text-align: right; }
.cards-list { display: grid; gap: 8px; margin-bottom: 10px; }
.card-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: #f7f9fc; border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; }
.card-line .mono { word-break: break-all; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 32px; transform: translate(-50%, 10px);
  background: rgba(17, 24, 39, .92); color: #fff; padding: 10px 16px; border-radius: 10px;
  font-size: 13.5px; z-index: 90; opacity: 0; transition: opacity .2s ease, transform .2s ease;
  pointer-events: none; max-width: 80vw; text-align: center;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

@media (min-width: 720px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
  .detail { grid-template-columns: 380px 1fr; align-items: start; }
  .hero { padding: 40px 36px; }
  .hero h1 { font-size: 34px; }
  .cart-line { grid-template-columns: 1fr 120px 100px auto; grid-template-areas: "main qty price del"; }
  .checkout { grid-template-columns: 1.2fr .9fr; align-items: start; }
}
@media (min-width: 1024px) {
  .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* 收银台支付方式 */
.pay-tabs { display: flex; gap: 6px; background: #f2f4f8; padding: 4px; border-radius: 11px; margin-bottom: 14px; }
.pay-tab { flex: 1; border: 0; background: transparent; padding: 9px 10px; border-radius: 8px; font-size: 13.5px; color: var(--muted); cursor: pointer; font-weight: 600; }
.pay-tab.on { background: #fff; color: var(--ink); box-shadow: 0 2px 8px rgba(17, 24, 39, .08); }
.pay-pane { margin-bottom: 14px; }
.qr-img { width: 200px; height: 200px; object-fit: contain; border: 1px solid var(--line); border-radius: 12px; background: #fff; padding: 6px; }
.qr-tip { margin: 10px 0 6px; color: var(--muted); font-size: 13px; }
.qr-amount { display: inline-flex; align-items: center; gap: 10px; background: #fff7e8; border: 1px solid #ffe2b8; border-radius: 10px; padding: 7px 12px; }
.qr-amount span { font-size: 20px; font-weight: 700; color: #9a5b00; }
.qr-note { margin: 8px 0 0; color: var(--muted); font-size: 12px; }
.qr-remark { margin: 8px 0 0; color: var(--muted); font-size: 12.5px; }
.gateway-list { display: grid; gap: 8px; }
.gateway-btn { display: flex; align-items: center; justify-content: space-between; border: 1px solid var(--line); border-radius: 11px; padding: 12px 14px; background: #fff; color: var(--ink); }
.gateway-btn:hover { border-color: #9db7ff; background: #f7f9ff; }
.gateway-btn b { font-size: 14px; }
.gateway-btn span { color: var(--muted); font-size: 12.5px; }

/* 首页轮播 */
.banners { display: flex; gap: 10px; overflow-x: auto; padding: 2px 0 6px; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; }
.banners::-webkit-scrollbar { display: none; }
.banner { flex: 0 0 100%; scroll-snap-align: center; border-radius: 14px; overflow: hidden; display: block; background: #eef2ff; }
.banner img { display: block; width: 100%; aspect-ratio: 5 / 2; object-fit: cover; }
@media (min-width: 720px) {
  .banner { flex-basis: calc(50% - 5px); }
  .banner img { aspect-ratio: 16 / 7; }
}
