/* 不用 Google Fonts @import，避免卡首屏；滚动卡顿多来自 backdrop-filter */
body.store-page {
  --font: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --display: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-family: var(--font);
  background: #eef6fc;
}

html:has(body.store-page) {
  background: #eef6fc;
}

body.store-page .topbar {
  background: #eef6fc;
  border-bottom: none;
  position: absolute; left: 0; right: 0; top: 0;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
body.store-page .topbar-inner {
  max-width: 1080px;
  padding-top: 18px;
}
body.store-page .brand {
  font-family: var(--display);
  font-size: 18px;
}
body.store-page .brand .logo {
  width: 36px; height: 36px; border-radius: 12px;
  background: #fff;
  color: var(--brand-hi);
  border: none;
  box-shadow: 0 8px 20px rgba(47, 127, 196, .18);
}
body.store-page .nav a {
  border: none; background: transparent; color: #3d5f7d; padding: 8px 10px;
}
body.store-page .nav a:hover { background: rgba(255,255,255,.55); color: var(--brand-hi); }
body.store-page .nav .btn {
  background: #fff; border: none; color: var(--brand-hi);
  box-shadow: 0 6px 16px rgba(47,127,196,.12);
}

.store-hero {
  max-width: 1080px; margin: 0 auto; padding: 20px 22px 12px;
  position: relative;
}
.store-hero-stage {
  position: relative;
  width: 100%;
  min-height: 180px;
}
.hero-abs-nav {
  overflow: visible;
  z-index: 5;
  display: flex;
  align-items: center;
}
.store-canvas-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  width: 100%;
}
.store-canvas-nav .btn,
.store-canvas-nav a {
  border: none;
  background: #fff;
  color: var(--brand-hi);
  box-shadow: 0 6px 16px rgba(47,127,196,.12);
  padding: 8px 12px;
  border-radius: 10px;
  white-space: nowrap;
}
.store-canvas-nav a:not(.btn) {
  background: transparent;
  box-shadow: none;
  color: #3d5f7d;
}
.hero-abs {
  position: absolute;
  box-sizing: border-box;
  overflow: hidden;
  word-break: break-word;
}
.hero-abs-brand {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 700;
  color: #123454;
  display: flex; align-items: center;
}
.hero-abs-title {
  font-family: var(--display);
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 700;
  letter-spacing: -.03em;
  line-height: 1.15;
  color: #123454;
}
.hero-abs-desc {
  white-space: pre-wrap;
  color: #5b7690;
  font-size: 15px;
  line-height: 1.5;
}
.hero-abs-img img {
  width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 12px;
}
.store-hero .chips {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px;
}
.store-hero .chip {
  font-size: 12px; padding: 7px 12px; border-radius: 999px;
  background: rgba(255,255,255,.72); color: #3d6486;
  border: 1px solid rgba(158,196,232,.55);
}

.store-page-wrap {
  max-width: 1080px; margin: 0 auto; padding: 0 22px 40px;
  display: grid; gap: 16px;
}
.store-hero-compact { padding-bottom: 12px; }
.level1-panel .panel-label {
  font-size: 12px; letter-spacing: .08em; text-transform: uppercase;
  color: #6b849c; margin-bottom: 10px; font-weight: 600;
}
.level1-row {
  margin-bottom: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-start;
  overflow: visible;
}
.level1-row .cat-pill {
  flex: 0 0 auto;
  width: 160px;
  min-width: 120px;
  min-height: 72px;
  box-sizing: border-box;
  border-radius: 16px;
  padding: 18px 16px;
  font-size: 18px;
  font-family: var(--display);
  font-weight: 650;
  text-align: center;
  background: #fff;
  border: 1px solid #d7e6f4;
  color: #244868;
  box-shadow: none;
}
.level1-row .cat-pill.active {
  background: #3a8fd6;
  border-color: #2f7fc4;
  color: #fff;
  box-shadow: none;
}
.level1-row .cat-pill:hover:not(.active) {
  background: #f7fbff;
  border-color: #9ec4e8;
}
.store-bottom {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
  align-items: stretch;
}
.bottom-box {
  display: flex;
  flex-direction: column;
  min-height: 460px;
  padding: 16px !important;
}
.box-title {
  font-family: var(--display);
  font-size: 17px;
  font-weight: 700;
  color: #17324d;
  margin: 0 0 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e4eef7;
}
.box-body {
  flex: 1;
  display: flex;
  flex-direction: column;
}
/* display:flex 会盖掉 HTML hidden，必须强制隐藏，否则各支付流程会叠在一起 */
.box-body[hidden],
#orderInfoEmpty[hidden],
#orderInfoOnline[hidden],
#orderInfoBalance[hidden],
#payEmpty[hidden],
#payReady[hidden],
#rechargePanel[hidden],
#cardDeliver[hidden],
#btnPayNow[hidden],
#btnConfirmChain[hidden],
#btnPaidConfirm[hidden],
#walletLine[hidden],
#payMask[hidden] {
  display: none !important;
}
.box-placeholder {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  border: 1px dashed #c9dced;
  border-radius: 14px;
  background: #f7fbff;
  color: #6b849c;
  padding: 20px;
}
.box-placeholder p {
  margin: 0 0 6px;
  font-family: var(--display);
  font-size: 15px;
  color: #3d5f7d;
}
.box-placeholder span { font-size: 12px; }

.amount-card {
  margin: 12px 0 14px;
  padding: 16px 12px;
  border: 1px solid #d7e6f4;
  border-radius: 14px;
  background: #fff;
  text-align: center;
}
.amount-card .amount {
  font-family: var(--display);
  font-size: 26px;
  font-weight: 700;
  color: #17324d;
}
.usdt-badge {
  width: 36px; height: 36px; margin: 8px auto 0; border-radius: 50%;
  background: #26a17b; color: #fff;
  display: grid; place-items: center; font-size: 10px; font-weight: 700;
}
.compact-kv th, .compact-kv td { padding: 8px 0; font-size: 13px; }
.compact-kv th { width: 64px; }

/* 右栏：二维码 + 地址，顶部对齐、紧凑 */
.pay-ready {
  gap: 10px;
  align-items: stretch;
}
.qr-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px;
  border: 1px solid #d7e6f4;
  border-radius: 14px;
  background: #fff;
}
.qr-mock {
  width: 148px;
  height: 148px;
  border-radius: 10px;
  background:
    linear-gradient(90deg, #111 2px, transparent 2px) 0 0 / 10px 10px,
    linear-gradient(#111 2px, transparent 2px) 0 0 / 10px 10px,
    #fff;
  border: 1px solid #e5e7eb;
  position: relative;
}
.qr-mock::after {
  content: "USDT";
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 36px; height: 36px; border-radius: 50%;
  background: #26a17b; color: #fff;
  display: grid; place-items: center;
  font-size: 10px; font-weight: 700;
  box-shadow: 0 0 0 4px #fff;
}
.qr-amount {
  font-family: var(--display);
  font-size: 15px;
  font-weight: 700;
  color: #17324d;
}
.addr-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 2px;
}
.btn-copy {
  padding: 5px 10px !important;
  font-size: 12px !important;
  border-radius: 8px !important;
}
.bottom-right .addr {
  margin-top: 0;
  font-size: 12px;
  line-height: 1.45;
  padding: 10px 12px;
}
.pay-tip {
  margin: 0;
  font-size: 12px;
  color: #6b849c;
  line-height: 1.45;
}
/* 覆盖全局 .qr::after，避免双徽章 */
.store-page .qr::after { content: none; display: none; }

.store-shell {
  max-width: 1080px; margin: 0 auto; padding: 0 22px 40px;
  display: grid; grid-template-columns: 1.35fr .9fr; gap: 18px; align-items: start;
}

.store-panel {
  background: #fff;
  border: 1px solid #d7e6f4;
  border-radius: 22px;
  padding: 18px;
  box-shadow: 0 4px 12px rgba(55,110,160,.06);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.store-toolbar {
  display: flex; gap: 10px; align-items: center; margin-bottom: 14px;
}
.store-toolbar input {
  flex: 1; border: 1px solid var(--line); background: #fff;
  border-radius: 14px; padding: 12px 14px; font: inherit; color: var(--text);
}
.store-toolbar input:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(58,143,214,.12);
}

.cat-row {
  display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 16px;
}
.cat-row.level1-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  overflow: visible;
  margin-bottom: 6px;
}
.cat-pill {
  flex: 0 0 auto; border: 1px solid transparent; background: #eaf3fb;
  color: #446987; border-radius: 999px; padding: 9px 14px; cursor: pointer; font-size: 13px;
}
.cat-pill.active {
  background: #17324d; color: #fff;
}
.cat-pill:hover:not(.active) { background: #ddeefb; }

/* 与后台编辑器一致：flex + 固定宽高，不用 1fr 网格拉散 */
.product-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-start;
}
.level1-row.cat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-start;
}
.level1-row .cat-pill {
  width: 160px;
  min-width: 120px;
  box-sizing: border-box;
}
.product-item {
  display: flex; flex-direction: column; justify-content: space-between; gap: 10px;
  width: 180px;
  min-height: 128px;
  box-sizing: border-box;
  padding: 14px; border-radius: 16px; background: #fff;
  border: 1px solid #e4eef7; cursor: pointer;
  flex: 0 0 auto;
}
.product-item:hover { border-color: #b7d6ef; }
.product-item.active {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(58,143,214,.12);
}
.product-item h3 {
  margin: 0; font-family: var(--display); font-size: 15px; font-weight: 600; line-height: 1.3;
}
.product-item .meta { margin-top: 6px; color: var(--muted); font-size: 12px; }
.product-item .price {
  font-family: var(--display); font-size: 20px; font-weight: 700; color: var(--brand-hi);
  white-space: nowrap;
}
.product-item .price small {
  display: block; text-align: left; font-size: 11px; color: var(--muted); font-weight: 500; margin-top: 2px;
}

.checkout .picked {
  margin: 0 0 12px; color: var(--muted); font-size: 13px;
}
.pay-mode {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 0 12px;
}
.pay-mode-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #d7e6f4;
  border-radius: 12px;
  background: #f7fbff;
  cursor: pointer;
  font-size: 14px;
  color: #244868;
  user-select: none;
}
.pay-mode-item:has(input:checked) {
  border-color: var(--brand);
  background: #eef6fc;
  box-shadow: 0 0 0 2px rgba(58,143,214,.12);
}
.pay-mode-item input {
  width: 16px;
  height: 16px;
  accent-color: var(--brand);
  margin: 0;
}
.wallet-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 0 12px;
  font-size: 13px;
  color: #4d6d88;
}
.wallet-line strong {
  font-family: var(--display);
  color: #123454;
  font-size: 15px;
}
.wallet-line a {
  color: var(--brand-hi);
  text-decoration: none;
  font-size: 12px;
}
.topbar-wallet {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #eef6fc;
  border: 1px solid #d7e6f4;
  font-size: 13px;
  color: #244868;
}
.topbar-wallet[hidden],
.topbar-user[hidden],
#btnTopRecharge[hidden] {
  display: none !important;
}
.topbar-wallet strong {
  font-family: var(--display);
  color: #123454;
}
.recharge-box .field { margin-bottom: 10px; }
.recharge-box .quick-amt {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 10px;
}
.recharge-box .quick-amt button {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid #d7e6f4;
  background: #fff;
  cursor: pointer;
  font-size: 12px;
  color: #244868;
}
.recharge-box .quick-amt button:hover {
  border-color: var(--brand);
  color: var(--brand-hi);
}
.balance-ok {
  text-align: center;
  padding: 24px 12px;
}
.balance-ok .ok-title {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 650;
  color: #123454;
  margin: 0 0 8px;
}
.balance-ok .ok-sub {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}
.code-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.code-row input { flex: 1; min-width: 0; }
.code-row .btn { flex: 0 0 auto; white-space: nowrap; padding: 8px 12px; }
.topbar-user {
  font-size: 13px;
  color: #4d6d88;
}

/* 登录/注册弹窗 —— 必须尊重 hidden，否则 display:flex 会盖掉属性导致一进页就弹窗 */
.auth-mask {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(18, 40, 64, .45);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.auth-mask[hidden] {
  display: none !important;
}
.deliver-ok {
  margin: 0 0 8px;
  font-family: var(--display);
  font-size: 16px;
  font-weight: 650;
  color: #1a7a4c;
}
.ord-copy-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #d7e6f4;
  border-radius: 12px;
  background: #f7fbff;
  font-size: 14px;
  color: #244868;
}
.ord-copy-row strong {
  font-family: ui-monospace, Consolas, monospace;
  color: #123454;
  word-break: break-all;
}
.order-list-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  margin-bottom: 8px;
  border: 1px solid #d7e6f4;
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  color: #244868;
}
.order-list-item:hover { border-color: var(--brand); background: #f3f9ff; }
#deliverCards, #resultCards {
  width: 100%;
  min-height: 140px;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre;
}
.auth-modal {
  width: min(420px, 100%);
  background: #fff;
  border-radius: 18px;
  border: 1px solid #d7e6f4;
  box-shadow: 0 24px 48px rgba(30, 70, 110, .18);
  overflow: hidden;
}
.auth-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; border-bottom: 1px solid #e4eef7;
  background: #f7fbff;
}
.auth-tabs { display: flex; gap: 6px; }
.auth-tab {
  border: 0; background: transparent; padding: 8px 14px;
  border-radius: 10px; cursor: pointer; color: #4d6d88; font-weight: 600;
}
.auth-tab.active { background: #fff; color: #123454; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.auth-close {
  border: 0; background: transparent; font-size: 22px; line-height: 1;
  cursor: pointer; color: #6b849c; padding: 4px 8px;
}
.auth-body { padding: 16px; }
.auth-hint { margin: 0 0 10px; font-size: 12px; color: #6b849c; }

/* 用户账本小工具 */
.tool-main { max-width: 1200px; }
.user-tool {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 14px;
  margin-top: 14px;
  min-height: 560px;
}
.tool-left, .tool-right { padding: 14px; }
.tool-tabs {
  display: flex; gap: 8px; margin: 10px 0 12px; flex-wrap: wrap;
}
.tool-tab {
  border: 1px solid #d7e6f4; background: #fff; color: #244868;
  padding: 8px 14px; border-radius: 10px; cursor: pointer; font-weight: 600;
}
.tool-tab.active {
  background: linear-gradient(180deg, #4ea0df, #3a8fd6);
  border-color: #2f7fc4; color: #fff;
}
.user-list {
  display: flex; flex-direction: column; gap: 8px;
  max-height: 520px; overflow: auto;
}
.user-item {
  display: flex; justify-content: space-between; align-items: center;
  width: 100%; text-align: left; padding: 12px 12px;
  border: 1px solid #d7e6f4; border-radius: 12px; background: #f7fbff;
  cursor: pointer; color: #244868;
}
.user-item.active, .user-item:hover {
  border-color: var(--brand); background: #eef6fc;
}
.user-item .u-name { font-weight: 650; }
.user-item .u-bal { font-size: 12px; color: #4d6d88; }
.tool-tip { font-size: 12px; color: #6b849c; margin: 0 0 10px; }
.tool-sub { font-size: 14px; margin: 16px 0 8px; color: #123454; }
.tool-table-wrap { overflow: auto; }
.tool-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
}
.tool-table th, .tool-table td {
  border-bottom: 1px solid #e4eef7; padding: 10px 8px; text-align: left;
}
.tool-table th { color: #6b849c; font-weight: 600; }
.order-row { cursor: pointer; }
.order-row:hover { background: #f3f9ff; }
.reg-card {
  padding: 14px; border-radius: 14px; background: #f7fbff;
  border: 1px solid #d7e6f4; margin-bottom: 8px;
}
.reg-row {
  display: flex; gap: 8px; padding: 6px 0; font-size: 14px; color: #4d6d88;
}
.reg-row strong { color: #123454; word-break: break-all; }
@media (max-width: 900px) {
  .user-tool { grid-template-columns: 1fr; }
}
.checkout .sum {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 12px 0; border-top: 1px dashed #d5e5f3; border-bottom: 1px dashed #d5e5f3;
  margin: 4px 0 12px;
}
.checkout .sum strong {
  font-family: var(--display); font-size: 22px; color: #123454;
}
.checkout .field { margin-bottom: 10px; }
.checkout .field input { padding: 10px 12px; }
.notice {
  margin-top: 12px; padding: 12px 14px; border-radius: 14px;
  background: #eef6fc; color: #4d6d88; font-size: 12px; line-height: 1.5;
}

@media (max-width: 900px) {
  .store-shell, .store-bottom { grid-template-columns: 1fr; }
  .checkout { position: static; }
  body.store-page .topbar { position: relative; }
  .store-hero { padding-top: 24px; }
}
