:root {
  --bg: #f5f9ff;
  --card: #ffffff;
  --text: #16203a;
  --muted: #6c7a92;
  --line: #e6edf8;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --accent-weak: #e8f1ff;
  --green: #067647;
  --green-bg: #ecfdf3;
  --orange: #b54708;
  --orange-bg: #fff4e5;
  --red: #b42318;
  --red-bg: #fef3f2;
  --radius: 14px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: linear-gradient(180deg, #eaf3fe 0, #f7fbff 560px, #f6f9fd 100%);
  background-color: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 400; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }

.wrap { max-width: 1060px; margin: 0 auto; padding: 0 20px; }
.main { padding-top: 26px; padding-bottom: 40px; flex: 1; }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, "Courier New", monospace; }
.tiny { font-size: 12px; color: var(--muted); margin-top: 12px; line-height: 1.7; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255, 255, 255, .86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner { height: 62px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 9px; font-size: 16px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; font-size: 15px; }
.brand-text small { font-size: 10.5px; color: var(--muted); letter-spacing: .1em; }
.brand-mark {
  width: 26px; height: 26px; border-radius: 8px; flex: none;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  color: #fff; font-size: 13px;
  display: inline-flex; align-items: center; justify-content: center;
}
.nav { display: flex; gap: 22px; font-size: 14px; color: var(--muted); }
.nav a { padding: 6px 0; border-bottom: 2px solid transparent; }
.nav a:hover { color: var(--text); }
.nav a.on { color: var(--text); border-bottom-color: var(--accent); }

.hero {
  position: relative; overflow: hidden;
  border-radius: 20px; padding: 44px 44px 40px;
  color: #fff; margin-bottom: 32px;
  background:
    radial-gradient(120% 160% at 100% 0%, rgba(129, 140, 248, .35), transparent 55%),
    radial-gradient(90% 140% at 0% 100%, rgba(236, 72, 153, .16), transparent 50%),
    linear-gradient(120deg, #161729, #26254a 60%, #2e2b57);
}
.hero::after {
  content: ""; position: absolute; right: -90px; top: -90px;
  width: 280px; height: 280px; border: 1px solid rgba(255, 255, 255, .08); border-radius: 50%;
}
.hero-kicker { font-size: 11px; letter-spacing: .3em; color: rgba(255, 255, 255, .5); margin-bottom: 14px; }
.hero h1 { font-size: 32px; letter-spacing: .01em; }
.hero-sub { margin-top: 10px; color: rgba(255, 255, 255, .72); font-size: 14px; }
.hero-chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.hero-chips span {
  padding: 5px 12px; border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 999px; font-size: 12px; color: rgba(255, 255, 255, .78);
}

.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px; }
.section-head h2 { font-size: 16px; }
.section-head .muted { font-size: 12.5px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.pcard {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; display: flex; flex-direction: column; gap: 10px;
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.pcard:hover { border-color: #c9cbe0; transform: translateY(-2px); box-shadow: 0 10px 26px rgba(28, 32, 48, .07); }
.pcard h3 { font-size: 16px; }
.pdesc {
  font-size: 13px; color: var(--muted); min-height: 42px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.pcard-bottom { margin-top: auto; display: flex; align-items: center; justify-content: space-between; padding-top: 8px; }
.price { font-size: 22px; letter-spacing: .01em; }
.price i { font-style: normal; font-size: 13px; margin-right: 2px; color: var(--muted); }
.buy-hint { font-size: 13px; color: var(--accent); }

.pill { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 999px; font-size: 12px; }
.pill.ok { background: var(--green-bg); color: var(--green); }
.pill.low { background: var(--orange-bg); color: var(--orange); }
.pill.off { background: #f2f3f5; color: var(--muted); }

.crumbs { display: flex; gap: 8px; color: var(--muted); font-size: 13px; margin-bottom: 18px; }
.crumbs a:hover { color: var(--text); }

.product { display: grid; grid-template-columns: 1fr 360px; gap: 20px; align-items: start; }
.product-main { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.product-main h1 { font-size: 24px; }
.product-meta { display: flex; align-items: center; gap: 10px; margin: 12px 0 24px; font-size: 13px; }
.prose { white-space: pre-wrap; color: #3d4250; font-size: 14px; line-height: 1.8; min-height: 80px; }

.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.panel h3 { font-size: 15px; margin-bottom: 14px; }
.panel-tips { margin-top: 24px; background: #fbfbfd; }
.panel-tips h3 { font-size: 14px; }
.tips { margin: 0; padding-left: 18px; color: var(--muted); font-size: 13px; }
.tips li + li { margin-top: 6px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.panel-head h3 { margin: 0; }

.buybox {
  position: sticky; top: 84px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px;
}
.buybox-price { font-size: 30px; margin-bottom: 6px; }
.buybox-price i { font-style: normal; font-size: 15px; color: var(--muted); margin-right: 3px; }
.buybox-price span { font-size: 13px; color: var(--muted); }

.label { display: block; font-size: 13px; color: var(--muted); margin: 16px 0 8px; }
.label .muted { font-size: 12px; }
.stepper { display: flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; width: fit-content; }
.stepper button { width: 40px; height: 40px; border: 0; background: #fafafc; cursor: pointer; font-size: 16px; color: var(--muted); }
.stepper button:hover { background: var(--accent-weak); color: var(--accent); }
.stepper input {
  width: 64px; height: 40px; border: 0; text-align: center; font-size: 14px; background: #fff;
  border-left: 1px solid var(--line); border-right: 1px solid var(--line);
  -moz-appearance: textfield; outline: none;
}
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.paytypes { display: flex; gap: 10px; flex-wrap: wrap; }
.paytype { position: relative; cursor: pointer; }
.paytype input { position: absolute; opacity: 0; pointer-events: none; }
.paytype span {
  display: inline-flex; padding: 8px 16px; border: 1px solid var(--line); border-radius: 10px;
  font-size: 13px; color: var(--muted); transition: all .12s;
}
.paytype input:checked + span { border-color: var(--accent); color: var(--accent); background: var(--accent-weak); }
.paytype input:focus-visible + span { box-shadow: 0 0 0 3px rgba(79, 70, 229, .15); }

.input {
  width: 100%; border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; background: #fff; outline: none;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79, 70, 229, .12); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid transparent; background: var(--accent); color: #fff;
  padding: 11px 20px; border-radius: 10px; cursor: pointer; white-space: nowrap;
  transition: background .12s;
}
.btn:hover { background: var(--accent-dark); }
.btn-block { width: 100%; margin-top: 18px; }
.btn.ghost { background: #fff; border-color: var(--line); color: var(--text); }
.btn.ghost:hover { border-color: #c9cbe0; background: #fafafc; }
.btn.quiet { background: transparent; color: var(--muted); margin-top: 10px; }
.btn.quiet:hover { color: var(--text); background: transparent; }
.btn[disabled] { background: #d7d9e2; cursor: not-allowed; }
.btn-sm { padding: 7px 14px; font-size: 13px; }

.alert {
  background: var(--red-bg); color: var(--red); border: 1px solid #fecdca;
  border-radius: 10px; padding: 10px 12px; font-size: 13px; margin-bottom: 14px;
}
.notice {
  background: #fffaeb; color: #b54708; border: 1px solid #fedf89;
  border-radius: 10px; padding: 10px 12px; font-size: 13px; margin-bottom: 14px;
}

.orderhead {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: var(--card); border: 1px solid var(--line); border-left: 3px solid var(--line);
  border-radius: var(--radius); padding: 22px 26px; margin-bottom: 18px;
}
.orderhead h1 { font-size: 20px; }
.orderhead p { margin-top: 6px; font-size: 13px; }
.orderhead.status-pending { border-left-color: #f79009; }
.orderhead.status-paid { border-left-color: #2e90fa; }
.orderhead.status-delivered { border-left-color: #12b76a; }
.orderhead.status-expired { border-left-color: #98a2b3; }

.status-badge { display: inline-flex; padding: 4px 14px; border-radius: 999px; font-size: 13px; white-space: nowrap; }
.sb-pending { background: var(--orange-bg); color: var(--orange); }
.sb-paid { background: #eff8ff; color: #175cd3; }
.sb-delivered { background: var(--green-bg); color: var(--green); }
.sb-expired { background: #f2f3f5; color: var(--muted); }

.order-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.kv { margin: 0; }
.kv > div { display: flex; justify-content: space-between; gap: 20px; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 13.5px; }
.kv > div:last-child { border-bottom: 0; }
.kv dt { color: var(--muted); flex: none; }
.kv dd { margin: 0; text-align: right; word-break: break-all; }
.kv dd.strong { color: var(--accent); }

.keys { display: flex; flex-direction: column; gap: 10px; }
.keybox {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: #f8f9fc; border: 1px dashed #d4d7e4; border-radius: 10px; padding: 10px 12px;
}
.keybox code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 13px; word-break: break-all; }
.copybtn {
  flex: none; border: 1px solid var(--line); background: #fff; border-radius: 8px;
  padding: 4px 12px; font-size: 12px; color: var(--muted); cursor: pointer;
}
.copybtn:hover { color: var(--accent); border-color: var(--accent); }
.copybtn.done { color: var(--green); border-color: var(--green); }

.combo-items { list-style: none; margin: 0; padding: 0; }
.combo-items li {
  display: flex; align-items: center; gap: 12px; padding: 9px 0;
  border-bottom: 1px dashed var(--line); font-size: 13.5px;
}
.combo-items li:last-child { border-bottom: 0; }
.combo-items li span { flex: 1; min-width: 0; word-break: break-all; }
.combo-items li small { color: var(--muted); flex: none; }
.combo-items li b { flex: none; font-weight: 400; }
.combo-items-compact { margin: 8px 0 12px; }
.combo-items-compact li { padding: 6px 0; font-size: 13px; }

.pay-wrap { max-width: 460px; margin: 0 auto; }
.pay-panel { text-align: center; padding: 34px 30px; }
.pay-panel h1 { font-size: 20px; }
.pay-amount { font-size: 40px; margin: 16px 0 4px; }
.pay-amount i { font-style: normal; font-size: 18px; color: var(--muted); margin-right: 4px; }
.pay-desc { color: var(--muted); font-size: 14px; margin-bottom: 6px; }
.pay-panel .notice, .pay-panel .alert { margin-top: 18px; text-align: left; }
.pay-panel form { margin-top: 6px; }
.pay-panel .btn { margin-top: 10px; }
.pay-panel .btn-block:first-of-type { margin-top: 18px; }

.query-form { margin-top: 18px; display: flex; flex-direction: column; gap: 12px; }
.query-form .btn-block { margin-top: 0; }

.empty {
  background: var(--card); border: 1px dashed var(--line); border-radius: var(--radius);
  padding: 64px 24px; text-align: center; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.empty-code { font-size: 44px; color: #d4d7e4; line-height: 1; }
.empty .btn { margin-top: 8px; }

.footer { border-top: 1px solid var(--line); padding: 26px 0 40px; margin-top: 30px; }
.footer-inner { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }

@media (max-width: 860px) {
  .product { grid-template-columns: 1fr; }
  .buybox { position: static; }
  .order-grid { grid-template-columns: 1fr; }
  .hero { padding: 32px 24px; }
  .hero h1 { font-size: 26px; }
  .main { padding-top: 20px; padding-bottom: 32px; }
  .orderhead { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 560px) {
  .wrap { padding: 0 16px; }
  .nav { gap: 14px; }
  .grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .pcard { padding: 14px; }
  .pdesc { display: none; }
  .price { font-size: 18px; }
  .buy-hint { font-size: 12px; }
}
@media (max-width: 420px) {
  .grid { grid-template-columns: 1fr; }
  .pdesc { display: -webkit-box; }
}
/* ===== 商品图片 ===== */
.pcard-img { display: block; width: 100%; height: 150px; object-fit: cover; border-radius: 10px; margin-bottom: 10px; background: var(--line); }
.product-photo { display: block; width: 100%; max-height: 360px; object-fit: cover; border-radius: 14px; margin-bottom: 18px; background: var(--line); }
.image-upload { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.image-preview { width: 96px; height: 96px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); background: #f3f4f6; }
.image-upload-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.image-pick { display: inline-flex; align-items: center; justify-content: center; height: 34px; padding: 0 14px; border-radius: 8px; font-size: 13px; cursor: pointer; }

/* ===== 订单支付（收银台） ===== */
.plain-page { background: #f5f5f7; }
.checkout { max-width: 560px; margin: 0 auto; padding: 0 0 132px; min-height: 100vh; }
.checkout-bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; height: 48px; padding: 0 10px; background: #fff; border-bottom: 1px solid #f0f0f0; }
.checkout-back { display: grid; place-items: center; width: 38px; height: 38px; font-size: 28px; line-height: 1; color: #333; text-decoration: none; }
.checkout-bar h1 { flex: 1; margin: 0; text-align: center; font-size: 17px; font-weight: 400; color: #222; }
.checkout-dots { width: 38px; text-align: center; color: #aaa; letter-spacing: 1px; }
.checkout-store { display: block; padding: 10px 16px 4px; text-align: center; font-size: 12px; color: #8a8a8a; text-decoration: none; }
.checkout-card { display: flex; align-items: center; gap: 12px; margin: 8px 12px 0; padding: 14px; background: #fff; border-radius: 12px; }
.checkout-thumb { display: grid; place-items: center; flex: none; width: 64px; height: 64px; border-radius: 8px; overflow: hidden; background: #f2f3f5; color: #bbb; font-size: 22px; }
.checkout-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.checkout-info { min-width: 0; }
.checkout-name { margin: 0 0 4px; font-size: 15px; color: #222; word-break: break-all; }
.checkout-sub { margin: 0 0 4px; font-size: 12px; color: #999; }
.checkout-price { margin: 0; font-size: 15px; color: #222; }
.checkout-lines { margin: 8px 12px 0; padding: 4px 14px; background: #fff; border-radius: 12px; }
.checkout-total { display: flex; align-items: center; justify-content: space-between; margin: 10px 12px 0; padding: 16px 14px; background: #fff; border-radius: 12px; font-size: 15px; color: #333; }
.checkout-total strong { font-weight: 400; font-size: 18px; color: #111; }
.checkout-meta { margin: 10px 16px 0; font-size: 12px; color: #9a9a9a; text-align: center; word-break: break-all; }
.checkout-note { margin: 10px 16px 0; font-size: 13px; color: #8a6d3b; text-align: center; }
.checkout-note:empty { display: none; }
.checkout-alert { margin: 12px; }
.checkout-qr { display: block; width: min(280px, 70vw); height: auto; margin: 14px auto 0; border-radius: 8px; }
.checkout-link { display: block; margin: 10px auto 0; padding: 4px 10px; border: 0; background: none; color: #1677ff; font-size: 13px; text-align: center; text-decoration: none; cursor: pointer; }
.checkout-paybar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; padding: 10px 16px calc(14px + env(safe-area-inset-bottom)); background: rgba(255, 255, 255, 0.97); border-top: 1px solid #f0f0f0; }
.checkout-paybar form { max-width: 528px; margin: 0 auto; }
.checkout-pay { display: block; width: 100%; max-width: 528px; height: 46px; margin: 0 auto; padding: 0; border: 0; border-radius: 10px; background: #1677ff; color: #fff; font-size: 16px; font-weight: 400; line-height: 46px; text-align: center; text-decoration: none; cursor: pointer; }
.checkout-pay[disabled] { background: #c7d7f2; cursor: not-allowed; }
.checkout-pay.ghost { background: #fff; color: #1677ff; border: 1px solid #1677ff; line-height: 44px; }
@media (min-width: 680px) {
  .checkout-paybar { left: 50%; right: auto; width: 560px; transform: translateX(-50%); border-radius: 16px 16px 0 0; border: 1px solid #f0f0f0; border-bottom: 0; }
}
