/* ========== 土撕登记台 · 发卡网蓝白主题（紧凑版） ========== */
:root {
  --blue: #2f7cff;
  --blue-soft: #6aa6ff;
  --ink: #1f2329;
  --sub: #8a919f;
  --line: #e9ecf1;
  --bg: #f3f5f8;
  --card: #fff;
  --red: #f5483b;
  --green: #16a34a;
  --green-bg: #e8f8ee;
  --orange: #d97706;
  --orange-bg: #fff7e8;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

body.store {
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, "PingFang SC", "HarmonyOS Sans SC", "MiSans",
    "Noto Sans SC", system-ui, sans-serif;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}

/* ========== 入场动画 ========== */
.fade-up {
  opacity: 0;
  animation: fadeUp 0.5s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}
.d1 { animation-delay: 0.04s; }
.d2 { animation-delay: 0.1s; }
.d3 { animation-delay: 0.16s; }
.d4 { animation-delay: 0.22s; }

/* ========== 店头 ========== */
.shop-header {
  position: relative;
  overflow: hidden;
  background: linear-gradient(130deg, #2468f0 0%, #3a7dff 55%, #6aa6ff 100%);
  box-shadow: 0 4px 14px rgba(47, 124, 255, 0.22);
}
.shop-header::before,
.shop-header::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  pointer-events: none;
}
.shop-header::before { width: 150px; height: 150px; right: -46px; top: -88px; }
.shop-header::after { width: 96px; height: 96px; left: -40px; bottom: -56px; }
.hdr-inner {
  position: relative;
  z-index: 1;
  max-width: 640px;
  margin: 0 auto;
  padding: 15px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.shop-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.shop-logo {
  width: 40px;
  height: 42px;
  flex: none;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
}
.shop-meta { min-width: 0; color: #fff; }
.shop-meta h1 {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.5px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.shop-meta p {
  font-size: 11.5px;
  opacity: 0.9;
  margin-top: 3px;
  white-space: nowrap;
}
.query-pill {
  flex: none;
  background: #fff;
  color: var(--blue);
  font-size: 12px;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 999px;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(10, 50, 140, 0.16);
  transition: transform 0.15s;
}
.query-pill:active { transform: scale(0.95); }

/* ========== 主体 ========== */
.main {
  max-width: 640px;
  margin: 0 auto;
  padding: 8px 10px 100px;
}
.block {
  background: var(--card);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 8px;
  box-shadow: 0 1px 3px rgba(20, 40, 80, 0.04);
}
.stitle {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 10px;
}
.stitle::before {
  content: "";
  width: 3px;
  height: 14px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--blue), var(--blue-soft));
}

/* ========== 商品：手机一行两个 ========== */
.product-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.product-card {
  position: relative;
  border: 1px solid #e9ecf1;
  border-radius: 10px;
  padding: 10px;
  background: #fff;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s, background 0.18s;
}
.product-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.45;
  min-height: 38px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.product-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 7px;
  flex-wrap: wrap;
}
.product-price { font-size: 14.5px; font-weight: 800; color: var(--blue); }
.stock-tag {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--green-bg);
  color: var(--green);
  white-space: nowrap;
}
.product-card.on {
  border-color: var(--blue);
  background: #f8fbff;
  box-shadow: 0 0 0 1px var(--blue) inset;
}
.product-card.on::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 0 24px 24px;
  border-color: transparent transparent var(--blue) transparent;
}
.product-card.on::before {
  content: "✓";
  position: absolute;
  right: 2px;
  bottom: 2px;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  z-index: 1;
}
@media (hover: hover) {
  .product-card:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(20, 40, 80, 0.08); }
}
.empty {
  text-align: center;
  color: #a6aebb;
  font-size: 12px;
  padding: 22px 0;
}

/* ========== 商品说明 ========== */
.note-img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 8px;
  display: block;
  margin-bottom: 8px;
  background: #f2f4f8;
}
.note-desc {
  font-size: 12.5px;
  color: #5b6472;
  line-height: 1.75;
  white-space: pre-line;
}

/* ========== 表单 ========== */
.frow {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid #f5f6f8;
}
.frow:last-of-type { border-bottom: none; }
.flabel {
  flex: none;
  font-size: 13.5px;
  font-weight: 500;
  color: #232830;
  white-space: nowrap;
}
.flabel.req::before {
  content: "*";
  color: var(--red);
  margin-right: 3px;
  font-weight: 700;
}
.finput {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  text-align: right;
  font-size: 13.5px;
  color: var(--ink);
  font-family: inherit;
  padding: 4px 0;
}
.finput::placeholder { color: #b0b7c3; font-size: 12.5px; }
.finput:focus::placeholder { opacity: 0.5; }
.fhelp {
  font-size: 11.5px;
  color: #9aa2af;
  line-height: 1.6;
  padding: 0 0 8px;
}

/* 数量加减器 */
.stepper {
  margin-left: auto;
  display: flex;
  align-items: center;
  height: 30px;
  border: 1px solid #e3e7ee;
  border-radius: 7px;
  overflow: hidden;
  background: #fff;
  flex: none;
}
.stepper button {
  width: 30px;
  height: 100%;
  border: none;
  background: #f7f8fa;
  color: #333;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
}
.stepper button:active { background: #eef1f6; }
.stepper .num {
  width: 42px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  border-left: 1px solid #eef0f4;
  border-right: 1px solid #eef0f4;
}

/* 开关 */
.switch {
  margin-left: auto;
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: #e6e9ee;
  position: relative;
  cursor: pointer;
  flex: none;
}
.switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* ========== 付款方式 ========== */
.pay-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 2px solid var(--blue);
  background: #f2f7ff;
  border-radius: 9px;
  padding: 11px 12px;
  cursor: pointer;
  overflow: hidden;
}
.wechat-ico {
  width: 24px;
  height: 24px;
  flex: none;
  border-radius: 50%;
  background: #07c160;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pay-name { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.pay-card::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 0 24px 24px;
  border-color: transparent transparent var(--blue) transparent;
}
.pay-card::before {
  content: "✓";
  position: absolute;
  right: 2px;
  bottom: 2px;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  z-index: 1;
}

/* ========== 版权 ========== */
.copyright {
  text-align: center;
  font-size: 10.5px;
  color: #98a0ad;
  line-height: 1.85;
  padding: 10px 16px 2px;
}

/* ========== 底部固定付款栏 ========== */
.paybar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  background: linear-gradient(130deg, #2468f0 0%, #3a7dff 60%, #5b9dff 100%);
  color: #fff;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 -4px 16px rgba(47, 124, 255, 0.22);
  padding: 8px 14px calc(8px + env(safe-area-inset-bottom));
  transition: filter 0.15s;
}
.paybar:active { filter: brightness(0.95); }
.paybar-inner { max-width: 640px; margin: 0 auto; }
.paybar b {
  display: block;
  font-size: 15.5px;
  font-weight: 800;
  letter-spacing: 0.5px;
}
.paybar .bar-sub {
  display: block;
  font-size: 10.5px;
  opacity: 0.92;
  margin-top: 2px;
}

/* ========== 右侧悬浮 ========== */
.side-fixed {
  position: fixed;
  right: 0;
  top: 40%;
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.side-btn {
  display: block;
  width: 64px;
  padding: 8px 0;
  border-radius: 7px 0 0 7px;
  color: #fff;
  font-size: 11.5px;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  box-shadow: -2px 3px 10px rgba(0, 0, 0, 0.12);
}
.side-btn:active { transform: translateX(-2px); }
.side-btn.purple { background: linear-gradient(135deg, #a855f7, #7c3aed); }
.side-btn.blue { background: linear-gradient(135deg, #3b82f6, #2563eb); }

/* ========== 弹窗 ========== */
.mask {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: maskIn 0.2s ease;
}
@keyframes maskIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  position: relative;
  width: 100%;
  max-width: 380px;
  max-height: 88vh;
  overflow-y: auto;
  background: #fff;
  border-radius: 14px;
  padding: 18px 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3);
  animation: popIn 0.25s cubic-bezier(0.22, 0.61, 0.36, 1);
}
@keyframes popIn {
  from { opacity: 0; transform: scale(0.94) translateY(10px); }
  to   { opacity: 1; transform: none; }
}
.modal h3 { font-size: 15px; font-weight: 700; text-align: center; color: var(--ink); }
.amount {
  font-size: 22px;
  font-weight: 800;
  color: var(--red);
  text-align: center;
  margin: 6px 0 2px;
}
.qr-box {
  width: 196px;
  height: 196px;
  margin: 12px auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.qr-box img { width: 100%; height: 100%; object-fit: contain; }
.tip {
  font-size: 12.5px;
  color: #5b6472;
  text-align: center;
  line-height: 1.7;
}
.btn-primary {
  width: 100%;
  height: 44px;
  margin-top: 12px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #2b6cff, #5b9dff);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 5px 14px rgba(47, 124, 255, 0.28);
  transition: transform 0.12s, filter 0.2s;
}
.btn-primary:active { transform: scale(0.97); }
.btn-primary:disabled { opacity: 0.5; pointer-events: none; }
.btn-link { display: block; text-align: center; line-height: 44px; text-decoration: none; }
.close-x {
  position: absolute;
  right: 8px;
  top: 6px;
  width: 28px;
  height: 28px;
  border: none;
  background: none;
  color: #9aa2af;
  font-size: 17px;
  cursor: pointer;
}
.receipt-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f2f7ff;
  border: 1px solid #cfe2ff;
  border-radius: 9px;
  padding: 9px 11px;
  margin: 12px 0;
  font-size: 11.5px;
  color: #5b6472;
}
.receipt-chip b {
  flex: 1;
  min-width: 0;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 12px;
  color: var(--ink);
  letter-spacing: 0.5px;
  word-break: break-all;
}
.mini-btn {
  flex: none;
  border: 1px solid #cfe2ff;
  background: #fff;
  color: var(--blue);
  font-size: 11.5px;
  padding: 4px 9px;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
}
.upload-box {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 118px;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  background: #fafbfc;
  color: #94a3b8;
  font-size: 12.5px;
  cursor: pointer;
  overflow: hidden;
}
.upload-box img { width: 100%; height: 100%; object-fit: cover; }
.done-ico { text-align: center; font-size: 38px; line-height: 1; margin-bottom: 6px; }

/* ========== 状态标签 ========== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.badge::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}
.badge-orange {
  color: var(--orange);
  background: var(--orange-bg);
  border: 1px solid #fcd48a;
}
.badge-green {
  color: #15803d;
  background: var(--green-bg);
  border: 1px solid #a7e8bd;
}

/* ========== Toast ========== */
.toast-wrap {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  width: max-content;
  max-width: 92vw;
}
.toast {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 15px;
  border-radius: 10px;
  background: rgba(30, 41, 59, 0.95);
  color: #fff;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  font-size: 13px;
  line-height: 1.5;
  animation: toastIn 0.3s cubic-bezier(0.22, 0.61, 0.36, 1);
}
@keyframes toastIn {
  from { opacity: 0; transform: translateY(-12px) scale(0.95); }
  to   { opacity: 1; transform: none; }
}
.toast.out { animation: toastOut 0.28s ease forwards; }
@keyframes toastOut {
  to { opacity: 0; transform: translateY(-12px) scale(0.95); }
}
.toast-ok .toast-ico { color: #4ade80; }
.toast-err .toast-ico { color: #f87171; }
.toast-info .toast-ico { color: #7dd3fc; }
.toast-ico { font-weight: 700; }

/* ========== 查单页 ========== */
.page-header {
  position: relative;
  overflow: hidden;
  background: linear-gradient(130deg, #2468f0 0%, #3a7dff 55%, #6aa6ff 100%);
  box-shadow: 0 4px 14px rgba(47, 124, 255, 0.22);
}
.page-header::before {
  content: "";
  position: absolute;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  right: -44px;
  top: -84px;
  background: rgba(255, 255, 255, 0.08);
}
.page-header .hdr-inner { padding: 13px 14px; }
.back {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  font-size: 19px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  flex: none;
}
.page-title {
  flex: 1;
  text-align: center;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 1px;
}
.hd-space { width: 32px; flex: none; }

.qform .frow { border-bottom: none; padding: 5px 0; }
.qform .flabel { width: 80px; font-size: 13px; }
.qform .finput {
  border: 1px solid #e3e7ee;
  border-radius: 8px;
  height: 38px;
  padding: 0 11px;
  text-align: left;
  background: #fff;
  font-size: 13px;
}
.qform .finput:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(47, 124, 255, 0.12);
}
.btn-search {
  width: 100%;
  height: 42px;
  margin-top: 8px;
  border: none;
  border-radius: 9px;
  background: linear-gradient(135deg, #2b6cff, #5b9dff);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 5px 14px rgba(47, 124, 255, 0.25);
  transition: transform 0.12s, filter 0.2s;
}
.btn-search:active { transform: scale(0.98); }
.btn-search:disabled { opacity: 0.6; }

.result-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.result-no {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 12.5px;
  letter-spacing: 0.5px;
  word-break: break-all;
  color: var(--ink);
}
.result-time { font-size: 11.5px; color: var(--sub); margin-top: 5px; }
.result-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--sub);
  padding: 10px 0;
  border-bottom: 1px solid #f3f4f6;
}
.result-row b { color: var(--blue); font-size: 15px; }
.pending-box {
  margin-top: 12px;
  background: var(--orange-bg);
  border: 1px solid #fbd38d;
  border-radius: 10px;
  padding: 12px;
  text-align: center;
}
.pending-box p {
  font-size: 11.5px;
  color: #92610e;
  margin-top: 8px;
  line-height: 1.7;
}
.secret-box {
  margin-top: 12px;
  background: #f3fbf6;
  border: 1px solid #b7e4c7;
  border-radius: 10px;
  padding: 12px;
}
.secret-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  font-weight: 600;
  color: #14532d;
}
.secret-content {
  margin-top: 8px;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: break-all;
  color: #166534;
}

@media (min-width: 641px) {
  .main { padding-top: 12px; }
}
