:root {
  --bg: #f5f5f5; --card: #fff; --text: #222; --muted: #888;
  --orange: #ff5000; --red: #ff2d4b; --line: #eee; --green: #1b7f37;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { background: var(--bg); color: var(--text); font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif; }
a { color: var(--orange); text-decoration: none; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 16px 40px; }
.topbar { background: var(--orange); color: #fff; font-size: 12px; padding: 6px 0; }
.topbar .wrap { display: flex; justify-content: space-between; padding: 0 16px; }
header.shop { background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.06); position: sticky; top: 0; z-index: 20; }
header.shop .wrap { display: flex; align-items: center; gap: 24px; padding: 14px 16px; }
.logo { font-size: 24px; font-weight: 900; color: var(--orange); white-space: nowrap; }
.logo small { font-size: 12px; color: var(--muted); font-weight: 400; margin-left: 6px; }
.logo a { color: var(--orange); }
.search { flex: 1; display: flex; border: 2px solid var(--orange); border-radius: 20px; overflow: hidden; max-width: 420px; }
.search input { flex: 1; border: none; padding: 8px 16px; font-size: 13px; outline: none; }
.search button { background: var(--orange); color: #fff; border: none; padding: 0 22px; font-size: 13px; cursor: pointer; }
.nav { display: flex; gap: 18px; font-size: 14px; }
.nav a { color: var(--text); }
.nav a:hover, .nav a.on { color: var(--orange); font-weight: 700; }
.banner { margin: 16px 0; border-radius: 14px; background: linear-gradient(120deg, #ff7a3d, #ff2d4b); color: #fff; padding: 34px 36px; position: relative; overflow: hidden; }
.banner::after { content: "🎁"; position: absolute; right: 40px; top: 50%; transform: translateY(-50%); font-size: 90px; opacity: .9; }
.banner h1 { font-size: 30px; font-weight: 900; margin-bottom: 8px; }
.banner p { font-size: 14px; opacity: .95; max-width: 520px; }
.banner .coupon { display: inline-block; margin-top: 16px; background: #fff; color: var(--red); font-weight: 800; padding: 7px 18px; border-radius: 20px; font-size: 13px; }
.sec-title { font-size: 18px; font-weight: 800; margin: 22px 0 14px; display: flex; align-items: center; gap: 8px; }
.sec-title::before { content: ""; width: 4px; height: 18px; background: var(--orange); border-radius: 2px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.card { background: var(--card); border-radius: 12px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,.06); transition: .2s; position: relative; display: flex; flex-direction: column; }
.card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,.12); }
.card .thumb { height: 160px; display: flex; align-items: center; justify-content: center; font-size: 60px; background: linear-gradient(135deg, #fff3ec, #ffe9e0); object-fit: cover; width: 100%; }
.card img.thumb { padding: 0; }
.card .ribbon { position: absolute; top: 10px; left: 0; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 0 12px 12px 0; z-index: 2; }
.card .body { padding: 12px 14px 16px; display: flex; flex-direction: column; flex: 1; }
.card h3 { font-size: 15px; font-weight: 700; margin-bottom: 5px; }
.card .desc { font-size: 12px; color: var(--muted); min-height: 32px; line-height: 1.4; flex: 1; white-space: pre-wrap; }
.card .price-row { display: flex; align-items: baseline; gap: 6px; margin: 10px 0 4px; }
.price { color: var(--red); font-size: 22px; font-weight: 900; }
.price small { font-size: 13px; }
.card .sold { font-size: 11px; color: var(--muted); }
.buy, .btn { background: linear-gradient(90deg, #ff7a3d, #ff2d4b); color: #fff; border: none; border-radius: 20px; padding: 9px 18px; font-size: 14px; font-weight: 700; cursor: pointer; transition: .2s; }
.card .buy { width: 100%; margin-top: 10px; }
.buy:active, .btn:active { transform: scale(.97); }
.btn:disabled, .buy:disabled { background: #ccc; cursor: not-allowed; }
.btn.ghost { background: #fff; color: var(--muted); border: 1px solid #ddd; }
.btn.sm { padding: 6px 14px; font-size: 13px; }
.trust { display: flex; justify-content: center; gap: 36px; margin: 30px 0 10px; color: var(--muted); font-size: 13px; flex-wrap: wrap; }
.mask, .modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: none; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.mask.show, .modal-mask.show { display: flex; }
.modal { background: #fff; border-radius: 16px; width: 100%; max-width: 420px; padding: 24px; max-height: 90vh; overflow: auto; animation: pop .25s; }
@keyframes pop { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.modal h3 { font-size: 18px; margin-bottom: 16px; }
.field, label.field { display: block; margin-bottom: 14px; }
.field .lbl, label.field .lbl { font-size: 13px; color: var(--muted); margin-bottom: 6px; display: block; }
input, textarea, select { width: 100%; border: 1px solid #ddd; border-radius: 8px; padding: 10px 12px; font-size: 14px; outline: none; font-family: inherit; background: #fff; color: var(--text); }
input:focus, textarea:focus { border-color: var(--orange); }
.qty { display: flex; align-items: center; border: 1px solid #ddd; border-radius: 8px; width: fit-content; overflow: hidden; }
.qty button { width: 36px; height: 36px; border: none; background: #f5f5f5; font-size: 18px; cursor: pointer; }
.qty input { width: 50px; text-align: center; border: none; border-left: 1px solid #ddd; border-right: 1px solid #ddd; height: 36px; font-size: 14px; }
.pays, .radio-row { display: flex; gap: 10px; }
.pays label, .radio-row label { flex: 1; border: 1.5px solid #ddd; border-radius: 8px; padding: 10px; text-align: center; cursor: pointer; font-size: 13px; color: var(--muted); }
.pays label.on, .radio-row label.sel { border-color: var(--orange); color: var(--orange); background: #fff5f0; font-weight: 700; }
.pays input, .radio-row input { display: none; }
.modal .total, .mrow { display: flex; justify-content: space-between; align-items: center; margin: 16px 0; }
.modal .total .p { color: var(--red); font-size: 24px; font-weight: 900; }
.modal .go { width: 100%; background: linear-gradient(90deg, #ff7a3d, #ff2d4b); color: #fff; border: none; border-radius: 24px; padding: 13px; font-size: 16px; font-weight: 800; cursor: pointer; }
.modal .cancel { width: 100%; background: none; border: none; color: var(--muted); margin-top: 10px; cursor: pointer; font-size: 13px; }
.view { display: none; } .view.on { display: block; }
.panel, .pay-panel { background: #fff; border-radius: 16px; max-width: 480px; margin: 20px auto; padding: 30px; box-shadow: 0 2px 12px rgba(0,0,0,.06); }
.pay-panel.center, .center { text-align: center; }
.qr-box, .qr { width: 230px; height: 230px; margin: 16px auto; border: 1px solid #eee; border-radius: 12px; padding: 10px; background: #fff; }
.qr-box img, .qr svg { width: 100%; height: 100%; }
.badge, .status-badge { display: inline-block; padding: 3px 12px; border-radius: 12px; font-size: 12px; font-weight: 700; }
.st-pending_pay { background: #fff3ec; color: var(--orange); }
.st-paid, .st-delivered { background: #e6f4ea; color: var(--green); }
.st-delivery_failed { background: #fde8e8; color: #c92a2a; }
.st-closed, .st-create_failed { background: #eee; color: #888; }
.st-refunded { background: #e8f0fe; color: #1a56db; }
.kv { display: grid; grid-template-columns: 90px 1fr; gap: 8px 12px; font-size: 13px; text-align: left; margin: 14px 0; }
.kv .k { color: var(--muted); }
.muted { color: var(--muted); } .small { font-size: 13px; }
.mt { margin-top: 16px; } .mb { margin-bottom: 16px; }
.flex { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.mono { font-family: Consolas, monospace; font-size: 12px; word-break: break-all; }
#toast { position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%); background: #222; color: #fff; padding: 11px 22px; border-radius: 20px; font-size: 14px; display: none; z-index: 99; max-width: 90vw; }
footer.site { text-align: center; color: #aaa; font-size: 12px; padding: 24px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 8px 10px; border-bottom: 1px solid #eee; text-align: left; vertical-align: top; }
th { color: var(--muted); font-weight: 400; }
@media (max-width: 640px) {
  .banner { padding: 24px; } .banner h1 { font-size: 22px; } .banner::after { font-size: 60px; right: 16px; }
  .search { display: none; } .wrap { padding: 0 12px 30px; }
  header.shop .wrap { gap: 12px; } .logo { font-size: 20px; }
}