:root {
  --navy: #1c1e41;
  --blue: #0064f0;
  --paper: #f6f4ef;
  --card: #ffffff;
  --ink: #1f2430;
  --muted: #667085;
  --line: #e6e1d6;
  --red: #dd002a;
  --green: #0a8f7a;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--paper);
  color: var(--ink);
}
.topbar {
  background: var(--navy);
  color: #fff;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar h1 { font-size: 16px; margin: 0; font-weight: 650; }
.topbar .sub { opacity: .72; font-size: 12px; margin-top: 2px; }
.btn {
  border: 0;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 14px;
  cursor: pointer;
  background: var(--blue);
  color: #fff;
}
.btn.ghost { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.35); }
.btn.block { width: 100%; padding: 12px; font-size: 16px; }
.btn.secondary { background: #eef3fb; color: var(--navy); }
.wrap { max-width: 760px; margin: 0 auto; padding: 18px 16px 80px; }
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 16px;
}
label { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 6px; }
input, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 12px;
  font-size: 15px;
  background: #fff;
}
.hint { font-size: 12px; color: var(--muted); margin-top: 10px; line-height: 1.5; }
.error {
  background: #fde8dc;
  color: #9a3412;
  padding: 10px 12px;
  border-radius: 8px;
  margin: 12px 0;
  display: none;
}
.group-title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 8px 2px 10px;
}
.group-title strong { font-size: 15px; }
.group-title span { font-size: 12px; color: var(--muted); }
.coupon {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 14px 12px;
  margin-bottom: 10px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}
.coupon h3 { margin: 0 0 4px; font-size: 15px; }
.coupon .meta { font-size: 12px; color: var(--muted); }
.tag {
  display: inline-block;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #eef3fb;
  color: var(--navy);
  margin-right: 4px;
}
.tag.off { background: #fff4d6; color: #8a5a00; }
.tag.on { background: #e7f6ec; color: #1b6b3a; }
.empty { text-align: center; color: var(--muted); padding: 40px 10px; }
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(16,18,37,.55);
  display: none;
  align-items: flex-end;
  justify-content: center;
  z-index: 20;
}
.sheet {
  background: #fff;
  width: 100%;
  max-width: 760px;
  max-height: 92vh;
  overflow: auto;
  border-radius: 18px 18px 0 0;
  padding: 18px 18px 28px;
}
.sheet h2 { margin: 0 0 6px; font-size: 18px; }
.qr-box {
  background: #f7f5f0;
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  margin: 12px 0;
}
#qrMount img, #qrMount canvas, #qrMount table {
  width: 220px;
  height: 220px;
}
.qr-stage {
  position: relative;
  width: 220px;
  height: 220px;
  margin: 0 auto;
  background: #fff;
}
.qr-stage img#qrIcon {
  display: none;
  position: absolute;
  left: 50%;
  top: 50%;
  width: 44px;
  height: 44px;
  transform: translate(-50%, -50%);
  padding: 3px;
  background: #fff;
  border-radius: 6px;
}
.qr-payload { font-size: 11px; color: var(--muted); word-break: break-all; margin-top: 8px; }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 4px; }
.tabs button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
}
.tabs button.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.ttl { font-size: 13px; color: var(--green); margin: 8px 0; }
.hidden { display: none !important; }
