:root {
  --coupon: #ff7a45;
  --coupon-dark: #ff5a1f;
  --coupon-light: rgba(255, 122, 69, 0.12);
  --coupon-border: rgba(255, 122, 69, 0.28);
  --cashback: #ffb020;
  --cashback-dark: #f59e0b;
  --cashback-accent: #e67e22;
  --cashback-light: rgba(255, 176, 32, 0.12);
  --cashback-border: rgba(255, 176, 32, 0.28);
  --urgent: #ff4d6d;
  --urgent-bg: rgba(255, 77, 109, 0.12);
  --text: rgba(20, 24, 36, 0.92);
  --text-secondary: rgba(40, 48, 68, 0.68);
  --text-muted: rgba(55, 65, 85, 0.52);
  --text-inverse: #ffffff;
  --bg: #eef2ff;
  --card: rgba(255, 255, 255, 0.52);
  --border: rgba(255, 255, 255, 0.55);
  --border-light: rgba(255, 255, 255, 0.28);
  --glass-shadow: 0 10px 40px rgba(31, 38, 135, 0.12), 0 2px 10px rgba(15, 23, 42, 0.06);
  --glass-inset: inset 0 1px 0 rgba(255, 255, 255, 0.72), inset 0 -1px 0 rgba(255, 255, 255, 0.18);
  --shadow-sm: 0 4px 14px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 12px 32px rgba(15, 23, 42, 0.1);
  --shadow-lg: 0 20px 50px rgba(15, 23, 42, 0.14);
  --radius: 24px;
  --radius-sm: 16px;
  --radius-lg: 28px;
  --blur: 24px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--text);
  min-height: 100vh;
  padding: 22px 14px 40px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow-x: hidden;
  background:
    radial-gradient(1200px 700px at 10% -10%, rgba(255, 170, 120, 0.55), transparent 55%),
    radial-gradient(900px 600px at 95% 5%, rgba(120, 170, 255, 0.45), transparent 50%),
    radial-gradient(800px 500px at 50% 100%, rgba(255, 210, 120, 0.35), transparent 55%),
    linear-gradient(165deg, #f7f3ff 0%, #eef5ff 40%, #f8f1ea 100%);
}

body::before,
body::after {
  content: "";
  position: fixed;
  z-index: -2;
  border-radius: 50%;
  filter: blur(40px);
  pointer-events: none;
  animation: floatBlob 16s ease-in-out infinite;
}
body::before {
  width: 320px; height: 320px; left: -80px; top: 12%;
  background: radial-gradient(circle, rgba(255, 130, 80, 0.55), rgba(255, 130, 80, 0));
}
body::after {
  width: 360px; height: 360px; right: -100px; top: 42%;
  background: radial-gradient(circle, rgba(100, 150, 255, 0.45), rgba(100, 150, 255, 0));
  animation-delay: -6s;
}

.bg-orbs { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.bg-orbs span {
  position: absolute; border-radius: 50%; filter: blur(28px); opacity: 0.7;
  animation: floatBlob 18s ease-in-out infinite;
}
.bg-orbs span:nth-child(1) {
  width: 220px; height: 220px; left: 18%; bottom: 8%;
  background: radial-gradient(circle, rgba(255, 196, 90, 0.55), transparent 70%);
  animation-delay: -3s;
}
.bg-orbs span:nth-child(2) {
  width: 180px; height: 180px; right: 18%; top: 18%;
  background: radial-gradient(circle, rgba(180, 140, 255, 0.42), transparent 70%);
  animation-delay: -9s;
}
.bg-orbs span:nth-child(3) {
  width: 140px; height: 140px; left: 55%; top: 58%;
  background: radial-gradient(circle, rgba(120, 220, 200, 0.35), transparent 70%);
  animation-delay: -12s;
}
@keyframes floatBlob {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  33% { transform: translate3d(18px, -22px, 0) scale(1.05); }
  66% { transform: translate3d(-14px, 16px, 0) scale(0.96); }
}

.container { max-width: 680px; margin: 0 auto; position: relative; }

.header { text-align: center; margin-bottom: 22px; padding: 8px 8px 0; }
.brand-pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; margin-bottom: 14px;
  border-radius: 999px; background: rgba(255,255,255,0.42); border: 1px solid rgba(255,255,255,0.55);
  box-shadow: var(--glass-shadow); backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%); color: var(--text-secondary);
  font-size: 12px; font-weight: 600; letter-spacing: 0.02em;
}
.brand-pill-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: linear-gradient(135deg, #ff7a45, #ffb020);
  box-shadow: 0 0 0 4px rgba(255, 122, 69, 0.15);
}
.header h1 {
  font-size: 28px; font-weight: 760; letter-spacing: -0.03em; line-height: 1.15;
  background: linear-gradient(120deg, rgba(20,24,36,0.95), rgba(70,50,30,0.9));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.header p {
  margin: 8px auto 0; font-size: 14px; color: var(--text-secondary); max-width: 28em;
}

.card {
  position: relative;
  background: linear-gradient(165deg, rgba(255,255,255,0.62), rgba(255,255,255,0.34));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: var(--glass-shadow), var(--glass-inset);
  backdrop-filter: blur(var(--blur)) saturate(165%);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(165%);
  overflow: hidden;
  transition: transform 0.28s var(--ease-out), box-shadow 0.28s var(--ease-out);
}
.card::before {
  content: "";
  position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background:
    radial-gradient(120% 80% at 10% 0%, rgba(255,255,255,0.55), transparent 45%),
    radial-gradient(90% 60% at 90% 100%, rgba(255,170,110,0.08), transparent 50%);
}
.card > * { position: relative; z-index: 1; }
.card:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 44px rgba(31, 38, 135, 0.14), var(--glass-inset);
}

.form-group { margin-bottom: 14px; }
.form-group label {
  display: block; font-size: 13px; font-weight: 600; color: var(--text-secondary);
  margin-bottom: 8px; letter-spacing: 0.01em;
}
.form-group textarea {
  width: 100%; padding: 14px 16px; border: 1px solid rgba(255,255,255,0.55);
  border-radius: 18px; font-size: 14px; font-family: inherit;
  background: rgba(255,255,255,0.42); color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  resize: vertical; min-height: 104px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.65);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.form-group textarea::placeholder { color: rgba(80, 90, 110, 0.48); }
.form-group textarea:focus {
  outline: none; border-color: rgba(255,122,69,0.5);
  box-shadow: 0 0 0 4px rgba(255,122,69,0.12), inset 0 1px 0 rgba(255,255,255,0.75);
  background: rgba(255,255,255,0.66);
}

.parsed-info {
  background: rgba(99,140,255,0.12); border: 1px solid rgba(99,140,255,0.18);
  border-radius: 14px; padding: 10px 14px; margin-top: 8px; font-size: 13px;
  color: #2f4fb8; font-weight: 600; word-break: break-all;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 13px 28px; border: none; border-radius: 999px; font-size: 15px;
  font-weight: 700; cursor: pointer; transition: all 0.22s var(--ease-out);
  font-family: inherit; letter-spacing: 0.01em;
}
.btn-primary {
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, #ff8a4c 0%, #ff6a2b 45%, #ff9f1c 100%);
  color: white;
  box-shadow: 0 10px 28px rgba(255,106,43,0.32), inset 0 1px 0 rgba(255,255,255,0.45);
}
.btn-primary::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,0.28), transparent 48%);
}
.btn-block { width: 100%; }
.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 14px 34px rgba(255,106,43,0.4), inset 0 1px 0 rgba(255,255,255,0.5);
}
.btn-primary:active:not(:disabled) { transform: translateY(0) scale(0.99); }
.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; }

.result-section { padding: 2px 0; }
.merchant-empty { text-align: center; color: var(--text-muted); padding: 28px 0; font-size: 14px; }

.shop-header {
  display: flex; align-items: center; gap: 14px; padding: 12px; margin-bottom: 16px;
  border-radius: 20px; background: rgba(255,255,255,0.36); border: 1px solid rgba(255,255,255,0.5);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.55);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.shop-logo {
  width: 58px; height: 58px; border-radius: 16px; object-fit: cover; flex-shrink: 0;
  background: rgba(255,255,255,0.45); border: 1px solid rgba(255,255,255,0.55);
  box-shadow: 0 8px 20px rgba(15,23,42,0.08);
}
.shop-logo-placeholder {
  width: 58px; height: 58px; border-radius: 16px;
  background: linear-gradient(145deg, rgba(255,237,213,0.9), rgba(254,215,170,0.85));
  display: flex; align-items: center; justify-content: center; font-size: 24px; flex-shrink: 0;
  border: 1px solid rgba(255,255,255,0.55); box-shadow: 0 8px 20px rgba(15,23,42,0.08);
}
.shop-info { flex: 1; min-width: 0; }
.shop-name {
  font-size: 17px; font-weight: 750; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -0.02em;
}
.shop-meta { font-size: 12px; color: var(--text-muted); word-break: break-all; }

.offer-dual { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.offer-single { display: block; }
.offer-card {
  position: relative; border-radius: 22px; padding: 16px; display: flex; flex-direction: column;
  gap: 10px; overflow: hidden; transition: transform 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out);
  backdrop-filter: blur(18px) saturate(150%); -webkit-backdrop-filter: blur(18px) saturate(150%);
  box-shadow: 0 10px 28px rgba(15,23,42,0.08), inset 0 1px 0 rgba(255,255,255,0.55);
}
.offer-card::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(120% 90% at 0% 0%, rgba(255,255,255,0.55), transparent 50%);
}
.offer-card > * { position: relative; z-index: 1; }
.offer-card:hover { transform: translateY(-2px); }

.offer-card--coupon {
  background: linear-gradient(160deg, rgba(255,245,237,0.72), rgba(255,232,214,0.45));
  border: 1px solid var(--coupon-border);
}
.offer-card--coupon.has-offer {
  background: linear-gradient(160deg, rgba(255,248,242,0.82), rgba(255,220,190,0.55));
  border: 1px solid rgba(255,106,43,0.42);
  box-shadow: 0 14px 34px rgba(255,107,53,0.16), inset 0 1px 0 rgba(255,255,255,0.65);
}
.offer-card--cashback {
  background: linear-gradient(160deg, rgba(255,251,235,0.72), rgba(254,243,199,0.42));
  border: 1px solid var(--cashback-border);
}
.offer-card--cashback.has-offer {
  background: linear-gradient(160deg, rgba(255,252,240,0.84), rgba(255,230,160,0.5));
  border: 1px solid rgba(245,158,11,0.42);
  box-shadow: 0 14px 34px rgba(245,158,11,0.16), inset 0 1px 0 rgba(255,255,255,0.65);
}

.offer-card__label {
  font-size: 12px; font-weight: 700; color: var(--text-secondary); text-transform: uppercase;
  letter-spacing: 0.06em; display: flex; align-items: center; gap: 4px;
}
.offer-card.has-offer .offer-card__label { color: var(--text); }
.offer-card__body { flex: 1; }
.offer-card__headline {
  font-size: 21px; font-weight: 820; color: var(--text); line-height: 1.2; margin-bottom: 6px;
  display: flex; align-items: center; gap: 6px; letter-spacing: -0.02em;
}
.offer-card.has-offer .offer-card__headline { color: var(--coupon-dark); }
.offer-card--cashback.has-offer .offer-card__headline { color: var(--cashback-dark); }
.hl-accent { font-weight: 900; color: var(--cashback-accent); font-size: 1.2em; }
.offer-card--coupon .hl-accent { color: var(--coupon-dark); }
.offer-card--cashback .hl-accent { color: var(--cashback-accent); }
.offer-card__sub { font-size: 13px; color: var(--text-secondary); line-height: 1.55; word-break: break-word; }
.coupon-list { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.coupon-item {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 7px 10px; border-radius: 12px;
  background: rgba(255,255,255,0.55); border: 1px solid rgba(255,106,43,0.16);
}
.coupon-item__name { font-size: 12px; font-weight: 700; color: var(--text-secondary); flex-shrink: 0; }
.coupon-item__desc { font-size: 13px; font-weight: 700; color: var(--coupon-dark); text-align: right; }
.muted { color: var(--text-muted); font-size: 12px; }

.global-tooltip {
  position: fixed; z-index: 9999; background: rgba(22,24,32,0.82); color: #fff;
  font-size: 12px; font-weight: 500; padding: 10px 12px; border-radius: 14px; white-space: pre-line;
  pointer-events: none; opacity: 0; transition: opacity 0.15s; line-height: 1.5;
  box-shadow: 0 10px 30px rgba(0,0,0,0.22); transform: translateX(-50%) translateY(-100%);
  border: 1px solid rgba(255,255,255,0.12); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.global-tooltip::after {
  content: ""; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  border: 6px solid transparent; border-top-color: rgba(22,24,32,0.82);
}

.urgency-tag {
  display: inline-flex; align-items: center; gap: 4px; margin-top: 6px; padding: 4px 10px;
  background: var(--urgent-bg); color: var(--urgent); font-size: 11px; font-weight: 700;
  border-radius: 999px; border: 1px solid rgba(255,77,109,0.16); animation: pulse 1.5s ease-in-out infinite;
}
.sold-out-tag {
  display: inline-flex; align-items: center; gap: 4px; margin-top: 6px; padding: 4px 10px;
  background: rgba(148,163,184,0.14); color: #94a3b8; font-size: 11px; font-weight: 600; border-radius: 999px;
}

.loading-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 56px 20px; gap: 18px;
}
.loader {
  display: flex; gap: 10px; padding: 14px 18px; border-radius: 999px;
  background: rgba(255,255,255,0.4); border: 1px solid rgba(255,255,255,0.5);
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255,255,255,0.6);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.loader-dot {
  width: 11px; height: 11px; border-radius: 50%;
  background: linear-gradient(135deg, #ff8a4c, #ffb020);
  animation: loaderBounce 1.2s infinite ease-in-out both;
  box-shadow: 0 0 12px rgba(255,138,76,0.35);
}
.loader-dot:nth-child(1) { animation-delay: -0.32s; }
.loader-dot:nth-child(2) { animation-delay: -0.16s; }
.loader-dot:nth-child(3) { animation-delay: 0s; }
@keyframes loaderBounce {
  0%, 80%, 100% { transform: scale(0.5); opacity: 0.45; }
  40% { transform: scale(1); opacity: 1; }
}
.loading-text { font-size: 14px; color: var(--text-secondary); font-weight: 600; letter-spacing: 0.02em; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.7; } }

.offer-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.offer-tag {
  padding: 5px 10px; border-radius: 999px; font-size: 12px; font-weight: 650;
  background: rgba(255,255,255,0.55); color: var(--text); border: 1px solid rgba(255,255,255,0.45);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.offer-card--coupon .offer-tag { color: var(--coupon-dark); border-color: rgba(255,122,69,0.18); }
.offer-card--cashback .offer-tag { color: var(--cashback-dark); border-color: rgba(245,158,11,0.18); }

.offer-cta {
  display: inline-flex; align-items: center; justify-content: center; width: 100%;
  padding: 12px 16px; border-radius: 999px; font-size: 14px; font-weight: 750; cursor: pointer;
  border: none; font-family: inherit; transition: all 0.22s var(--ease-out); text-align: center;
  background: none; outline: none; position: relative; overflow: hidden;
}
.offer-cta--claim {
  background: linear-gradient(135deg, #ff8a4c, #ff6a2b 55%, #ff9f1c);
  color: #fff; box-shadow: 0 10px 22px rgba(255,107,53,0.28), inset 0 1px 0 rgba(255,255,255,0.4);
}
.offer-card--coupon.has-offer .offer-cta--claim { animation: ctaGlow 2.2s ease-in-out infinite; }
@keyframes ctaGlow {
  0%, 100% { box-shadow: 0 10px 22px rgba(255,107,53,0.28), inset 0 1px 0 rgba(255,255,255,0.4); }
  50% { box-shadow: 0 12px 30px rgba(255,107,53,0.48), inset 0 1px 0 rgba(255,255,255,0.5); }
}
.offer-cta--claim:hover:not(.is-disabled) {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(255,107,53,0.42), inset 0 1px 0 rgba(255,255,255,0.45);
}
.offer-cta--sign {
  background: linear-gradient(135deg, #ffc14d, #f59e0b 60%, #fbbf24);
  color: #fff; box-shadow: 0 10px 22px rgba(245,158,11,0.28), inset 0 1px 0 rgba(255,255,255,0.4);
}
.offer-card--cashback.has-offer .offer-cta--sign { animation: ctaGlowGold 2.2s ease-in-out infinite; }
@keyframes ctaGlowGold {
  0%, 100% { box-shadow: 0 10px 22px rgba(245,158,11,0.28), inset 0 1px 0 rgba(255,255,255,0.4); }
  50% { box-shadow: 0 12px 30px rgba(245,158,11,0.45), inset 0 1px 0 rgba(255,255,255,0.5); }
}
.offer-cta--sign:hover:not(.is-disabled) {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(245,158,11,0.4), inset 0 1px 0 rgba(255,255,255,0.45);
}
.offer-cta.is-disabled { opacity: 0.72; cursor: pointer; pointer-events: auto; }

.info-row { display: flex; align-items: center; gap: 5px; line-height: 1.4; }
.info-icon {
  display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px;
  border-radius: 50%; background: rgba(255,255,255,0.55); color: var(--text-secondary);
  font-size: 10px; font-weight: 700; cursor: help; position: relative; flex-shrink: 0;
  transition: all 0.15s; border: 1px solid rgba(255,255,255,0.45); padding: 0; font-family: inherit;
  z-index: 10; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.info-icon:hover, .info-icon:focus { background: rgba(40,48,68,0.78); color: #fff; outline: none; }

.retry-btn {
  margin-top: 14px; padding: 10px 16px; border-radius: 999px; border: 1px solid rgba(255,255,255,0.5);
  background: rgba(255,255,255,0.42); color: var(--text-secondary); cursor: pointer; font-size: 13px;
  font-weight: 600; font-family: inherit; transition: all 0.2s var(--ease-out); width: 100%;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.55);
}
.retry-btn:hover { border-color: rgba(255,122,69,0.4); color: var(--coupon-dark); transform: translateY(-1px); }

.modal-overlay {
  position: fixed; inset: 0; background: rgba(18,22,34,0.28); display: flex; align-items: center;
  justify-content: center; z-index: 9999; animation: fadeIn 0.18s ease;
  backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%);
}
.modal {
  background: linear-gradient(165deg, rgba(255,255,255,0.78), rgba(255,255,255,0.52));
  border-radius: 28px; padding: 28px 24px 22px; max-width: 320px; width: calc(100% - 48px);
  text-align: center; animation: slideUp 0.28s var(--ease-out);
  border: 1px solid rgba(255,255,255,0.58);
  box-shadow: 0 24px 60px rgba(15,23,42,0.18), inset 0 1px 0 rgba(255,255,255,0.7);
  backdrop-filter: blur(28px) saturate(170%); -webkit-backdrop-filter: blur(28px) saturate(170%);
}
.modal-icon {
  width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 50%;
  background: linear-gradient(145deg, rgba(255,236,236,0.9), rgba(255,214,214,0.7));
  display: flex; align-items: center; justify-content: center; font-size: 26px;
  border: 1px solid rgba(255,255,255,0.55); box-shadow: 0 10px 24px rgba(255,77,109,0.12);
}
.modal-title { font-size: 18px; font-weight: 760; color: var(--text); margin-bottom: 8px; letter-spacing: -0.02em; }
.modal-msg { font-size: 14px; color: var(--text-secondary); margin-bottom: 20px; line-height: 1.55; }
.modal-actions { display: flex; gap: 10px; justify-content: center; }
.modal-btn {
  padding: 11px 22px; border-radius: 999px; border: none; font-size: 14px; font-weight: 700;
  cursor: pointer; font-family: inherit; transition: all 0.18s var(--ease-out);
}
.modal-btn--primary {
  background: linear-gradient(135deg, #ff8a4c, #ff6a2b 55%, #ff9f1c); color: white;
  box-shadow: 0 10px 24px rgba(255,107,53,0.28), inset 0 1px 0 rgba(255,255,255,0.4);
}
.modal-btn--primary:hover { transform: translateY(-1px); }
.modal-btn--ghost {
  background: rgba(255,255,255,0.42); color: var(--text-secondary); border: 1px solid rgba(255,255,255,0.5);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.modal-btn--ghost:hover { background: rgba(255,255,255,0.62); }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp {
  from { opacity: 0; transform: translateY(18px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}



/* ===== Promo entry buttons ===== */
.promo-card {
  margin-bottom: 14px;
}
.promo-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.promo-title {
  font-size: 15px;
  font-weight: 750;
  color: var(--text);
  letter-spacing: -0.01em;
}
.promo-sub {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}
.promo-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

button.promo-btn {
  width: 100%;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  appearance: none;
  -webkit-appearance: none;
}
.promo-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 12px 12px 12px;
  border-radius: 18px;
  text-decoration: none;
  color: inherit;
  border: 1px solid rgba(255,255,255,0.5);
  background: rgba(255,255,255,0.36);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.55), 0 8px 20px rgba(15,23,42,0.06);
  backdrop-filter: blur(14px) saturate(150%);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  transition: transform 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out), background 0.2s var(--ease-out);
  overflow: hidden;
}
.promo-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(120% 90% at 0% 0%, rgba(255,255,255,0.5), transparent 55%);
}
.promo-btn > * { position: relative; z-index: 1; }
.promo-btn:hover {
  transform: translateY(-2px);
  background: rgba(255,255,255,0.5);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.65), 0 12px 28px rgba(15,23,42,0.1);
}
.promo-btn:active { transform: translateY(0); }
.promo-btn__icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 8px 16px rgba(15,23,42,0.12), inset 0 1px 0 rgba(255,255,255,0.35);
}
.promo-btn--daily .promo-btn__icon {
  background: linear-gradient(135deg, #ff8a4c, #ff5a1f 60%, #ff9f1c);
}
.promo-btn--select .promo-btn__icon {
  background: linear-gradient(135deg, #ffc14d, #f59e0b 60%, #fbbf24);
}
.promo-btn__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.promo-btn__text strong {
  font-size: 14px;
  font-weight: 750;
  color: var(--text);
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.promo-btn__text small {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
}
.promo-btn__arrow {
  color: var(--text-muted);
  font-size: 20px;
  line-height: 1;
  flex-shrink: 0;
}
.promo-btn--daily {
  border-color: rgba(255, 122, 69, 0.22);
}
.promo-btn--select {
  border-color: rgba(245, 158, 11, 0.22);
}

@media (max-width: 480px) {
  .promo-actions { grid-template-columns: 1fr; }
  .promo-head { margin-bottom: 10px; }
  .promo-btn { padding: 12px; }
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .promo-btn { background: rgba(255, 255, 255, 0.9); }
}

.tutorial-wrap {
  margin-top: 8px; border-radius: var(--radius);
  background: linear-gradient(165deg, rgba(255,255,255,0.48), rgba(255,255,255,0.28));
  border: 1px solid rgba(255,255,255,0.5); box-shadow: var(--glass-shadow), var(--glass-inset);
  backdrop-filter: blur(var(--blur)) saturate(160%); -webkit-backdrop-filter: blur(var(--blur)) saturate(160%);
  overflow: hidden;
}
.tutorial-toggle {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 15px 18px; border: none; background: transparent; color: var(--text);
  font-size: 14px; font-weight: 700; font-family: inherit; cursor: pointer;
}
.tutorial-arrow { transition: transform 0.25s var(--ease-out); color: var(--text-muted); font-size: 12px; }
.tutorial-toggle.open .tutorial-arrow { transform: rotate(180deg); }
.tutorial-content { max-height: 0; overflow: hidden; transition: max-height 0.35s var(--ease-out); }
.tutorial-inner { padding: 0 18px 18px; }
.tutorial-steps { margin: 0 0 14px 18px; color: var(--text-secondary); font-size: 13px; line-height: 1.7; }
.tutorial-steps li { margin-bottom: 4px; }
.tutorial-guide {
  border-radius: 18px; overflow: hidden; border: 1px solid rgba(255,255,255,0.5);
  background: rgba(255,255,255,0.35); box-shadow: inset 0 1px 0 rgba(255,255,255,0.55);
}
.tutorial-guide img { display: block; width: 100%; height: auto; }

/* 微信专属提示横幅：仅在检测到微信内置浏览器时由 ui.js 注入，其它环境不产生 DOM */
/* ===== 通用说明条 =====
   两种用途：跳转横幅（--jump，微信专属）与剪贴板提示（.paste-hint）。
   抽成中性类名，避免再出现「类名暗示了它只在微信出现」这种误导。 */
.notice-bar {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(255, 176, 32, 0.18);
  border: 1px solid rgba(255, 145, 0, 0.34);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.55;
}
.notice-bar__icon {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  margin-top: 1px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff9f1c, #ff7a45);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 16px;
  text-align: center;
}
.notice-bar__text { min-width: 0; }
.notice-bar__text strong {
  display: block;
  color: var(--text);
  font-weight: 700;
  margin-bottom: 1px;
}
.notice-bar__text b {
  color: var(--coupon-dark);
  font-weight: 700;
}

/* 剪贴板提示条：接在输入框下方，讲的是「怎么做」而不是警告，所以换冷色调、淡一档 */
.paste-hint {
  margin-top: 8px;
  margin-bottom: 0;
  background: rgba(99, 140, 255, 0.12);
  border-color: rgba(99, 140, 255, 0.24);
}
.paste-hint .notice-bar__icon {
  background: linear-gradient(135deg, #7b9bff, #4a6cf7);
}

.jump-mode-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  margin: 0;
  border-radius: 18px;
  background: rgba(255,255,255,0.34);
  border: 1px solid rgba(255,255,255,0.48);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.jump-mode-main {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}
.jump-mode-label {
  font-size: 12px;
  font-weight: 650;
  color: var(--text-secondary);
  white-space: nowrap;
  flex-shrink: 0;
}
.jump-mode-seg {
  display: flex;
  gap: 6px;
  min-width: 0;
  flex: 1;
}
.jump-mode-btn {
  border: 1px solid rgba(255,255,255,0.45);
  background: rgba(255,255,255,0.28);
  color: var(--text-secondary);
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 650;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.18s var(--ease-out);
  white-space: nowrap;
  flex: 1 1 0;
  text-align: center;
  line-height: 1.2;
}
.jump-mode-btn.active {
  background: linear-gradient(135deg, rgba(255,138,76,0.95), rgba(255,159,28,0.95));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 8px 18px rgba(255,122,69,0.24);
}
/* 微信内禁用两个唤端按钮（ui.js applyWeChatMode 加 is-disabled + disabled） */
.jump-mode-btn.is-disabled,
.jump-mode-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
}
.qr-toggle-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  white-space: nowrap;
}
.qr-toggle-label {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 600;
  white-space: nowrap;
}
.qr-switch { position: relative; display: inline-block; width: 36px; height: 22px; }
.qr-switch input { opacity: 0; width: 0; height: 0; }
.qr-switch-slider {
  position: absolute; cursor: pointer; inset: 0; background: rgba(148,163,184,0.35);
  transition: 0.2s; border-radius: 999px; border: 1px solid rgba(255,255,255,0.4);
  box-shadow: inset 0 1px 2px rgba(15,23,42,0.08);
}
.qr-switch-slider::before {
  position: absolute; content: ""; height: 16px; width: 16px; left: 2px; top: 2px;
  background: white; transition: 0.2s; border-radius: 50%; box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.qr-switch input:checked + .qr-switch-slider { background: linear-gradient(135deg, #ff8a4c, #ff6a2b); }
.qr-switch input:checked + .qr-switch-slider::before { transform: translateX(14px); }

.modal--actionsheet { max-width: 380px; width: calc(100% - 40px); padding: 20px; text-align: left; }
.action-list { display: flex; flex-direction: column; gap: 8px; margin: 14px 0 12px; }
.action-item {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  background: rgba(255,255,255,0.42); border: 1px solid rgba(255,255,255,0.5);
  border-radius: 18px; cursor: pointer; transition: all 0.18s var(--ease-out);
  font-family: inherit; text-align: left; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.55);
}
.action-item:hover {
  background: rgba(255,255,255,0.62); border-color: rgba(255,122,69,0.35); transform: translateY(-1px);
}
.action-item__icon {
  width: 38px; height: 38px; display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700; color: var(--coupon); background: rgba(255,107,53,0.12);
  border-radius: 12px; flex-shrink: 0; border: 1px solid rgba(255,255,255,0.45);
}
.action-item__body { flex: 1; min-width: 0; }
.action-item__title { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 2px; }
.action-item__desc { font-size: 12px; color: var(--text-muted); }
.action-item__arrow { color: var(--text-muted); font-size: 18px; flex-shrink: 0; }
.action-cancel { width: 100%; margin-top: 4px; }

.modal--qrcode { max-width: 330px; width: calc(100% - 40px); padding: 24px 20px 18px; text-align: center; }
.qrcode-box {
  display: flex; justify-content: center; align-items: center; margin: 16px auto 8px; padding: 14px;
  background: rgba(255,255,255,0.78); border-radius: 18px;
  box-shadow: 0 10px 28px rgba(0,0,0,0.08), inset 0 1px 0 rgba(255,255,255,0.8);
  width: max-content; border: 1px solid rgba(255,255,255,0.6);
}
.qrcode-box canvas, .qrcode-box img { display: block; }
.qrcode-tip { font-size: 13px; color: var(--text-secondary); margin: 8px 0 16px; }
.qrcode-actions { display: flex; justify-content: center; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media (max-width: 480px) {
  body { padding: 14px 10px 28px; }
  .container { max-width: 100%; }
  .card { padding: 16px; border-radius: 22px; }
  .header { margin-bottom: 16px; }
  .header h1 { font-size: 24px; }
  .header p { font-size: 13px; }
  .offer-dual { grid-template-columns: 1fr; gap: 10px; }
  .offer-card { border-radius: 20px; }
  .offer-card__headline { font-size: 19px; }
  .offer-card__sub { font-size: 12px; }
  .btn { padding: 12px 22px; font-size: 14px; width: 100%; }
  .shop-header { gap: 10px; padding: 10px; margin-bottom: 12px; }
  .shop-logo, .shop-logo-placeholder { width: 50px; height: 50px; border-radius: 14px; }
  .shop-name { font-size: 15px; }
  .offer-cta { padding: 11px 14px; font-size: 14px; }
  .modal { padding: 24px 18px 18px; border-radius: 24px; }
  .modal-icon { width: 48px; height: 48px; font-size: 22px; }
}

@media (max-width: 480px) {
  .jump-mode-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 10px;
  }
  .jump-mode-main {
    width: 100%;
    gap: 8px;
  }
  .jump-mode-label {
    font-size: 12px;
  }
  .jump-mode-seg {
    width: 100%;
  }
  .jump-mode-btn {
    font-size: 12px;
    padding: 8px 6px;
    white-space: nowrap;
  }
  .qr-toggle-wrap {
    width: 100%;
    justify-content: space-between;
    padding: 2px 2px 0;
  }
  .qr-toggle-label { font-size: 12px; }
}

@media (max-width: 360px) {
  .jump-mode-bar { gap: 8px; padding: 8px; }
  .jump-mode-btn { font-size: 11px; padding: 7px 4px; }
  .qr-toggle-label { font-size: 11px; }
  .qr-switch { width: 32px; height: 20px; }
  .qr-switch-slider::before { height: 14px; width: 14px; top: 2px; left: 2px; }
  .qr-switch input:checked + .qr-switch-slider::before { transform: translateX(12px); }
  .action-item { padding: 12px; }
  .action-item__icon { width: 34px; height: 34px; font-size: 16px; }
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .card, .tutorial-wrap, .offer-card, .modal, .shop-header, .jump-mode-bar,
  .form-group textarea, .loader, .retry-btn, .action-item {
    background: rgba(255, 255, 255, 0.9);
  }
}

/* compact action cards (query fallback) */
.offer-card--compact {
  justify-content: space-between;
  min-height: 120px;
}
.offer-card--compact .offer-card__label {
  margin-bottom: 4px;
}
.offer-card--compact .offer-cta {
  margin-top: auto;
}

/* ===== 输入框：标题行 + 粘贴/清空 ===== */
.form-group__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.form-group__head label { margin-bottom: 0; }
.input-tools { display: inline-flex; gap: 8px; flex-shrink: 0; }
.tool-btn {
  border: 1px solid rgba(255,255,255,0.55);
  background: rgba(255,255,255,0.38);
  color: var(--text-secondary);
  border-radius: 999px;
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 650;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.6);
  transition: all 0.18s var(--ease-out);
}
.tool-btn:hover {
  background: rgba(255,255,255,0.68);
  color: var(--coupon-dark);
  border-color: var(--coupon-border);
}
.tool-btn:active { transform: scale(0.96); }
.tool-btn:disabled { opacity: 0.55; cursor: default; transform: none; }

/* ===== 跳转方式栏（常显） ===== */
.jump-bar-wrap { margin-bottom: 14px; }

/* ===== 结果卡：收藏星标 ===== */
.fav-toggle {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.5);
  background: rgba(255,255,255,0.34);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.6);
  color: var(--text-muted);
  font-size: 20px;
  line-height: 1;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.18s var(--ease-out);
}
.fav-toggle:hover { background: rgba(255,255,255,0.58); transform: translateY(-1px); }
.fav-toggle:active { transform: scale(0.94); }
.fav-toggle.is-on {
  color: #ff9a1f;
  border-color: rgba(255,154,31,0.45);
  background: rgba(255,176,32,0.18);
  box-shadow: 0 6px 16px rgba(255,154,31,0.2), inset 0 1px 0 rgba(255,255,255,0.6);
}

/* ===== 收藏店铺（可折叠） ===== */
.fav-wrap {
  margin-bottom: 14px;
  border-radius: var(--radius);
  background: linear-gradient(165deg, rgba(255,255,255,0.52), rgba(255,255,255,0.32));
  border: 1px solid var(--border);
  box-shadow: var(--glass-shadow), var(--glass-inset);
  backdrop-filter: blur(var(--blur)) saturate(160%);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(160%);
  overflow: hidden;
}
.fav-toggle-head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px;
  border: none;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
  text-align: left;
}
.fav-head-right {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.fav-title {
  font-size: 15px;
  font-weight: 750;
  color: var(--text);
  letter-spacing: -0.01em;
}
.fav-count {
  font-size: 12px;
  font-weight: 650;
  color: var(--coupon-dark);
  background: var(--coupon-light);
  border: 1px solid var(--coupon-border);
  border-radius: 999px;
  padding: 2px 9px;
  line-height: 1.5;
}
.fav-arrow {
  transition: transform 0.25s var(--ease-out);
  color: var(--text-muted);
  font-size: 12px;
}
.fav-toggle-head.open .fav-arrow { transform: rotate(180deg); }
.fav-content { max-height: 0; overflow: hidden; transition: max-height 0.35s var(--ease-out); }
.fav-inner { padding: 0 18px 18px; }
.fav-list { display: flex; flex-direction: column; gap: 8px; }

/* 防狂点：查询进行中，收藏列表整体置灰并屏蔽点击 */
.fav-list.is-busy { opacity: 0.55; pointer-events: none; }
.fav-list.is-busy .fav-item { cursor: progress; }

/* 正在查询中的收藏项高亮 */
.fav-item.is-active {
  border-color: var(--coupon-border);
  background: var(--coupon-light);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.55), 0 0 0 1px var(--coupon-border);
}
.fav-item.is-active::after {
  content: '';
  width: 14px;
  height: 14px;
  margin-left: 4px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 2px solid var(--coupon-border);
  border-top-color: var(--coupon);
  animation: fav-spin 0.7s linear infinite;
}
@keyframes fav-spin { to { transform: rotate(360deg); } }

.fav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(255,255,255,0.32);
  border: 1px solid rgba(255,255,255,0.48);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.55);
  cursor: pointer;
  transition: all 0.2s var(--ease-out);
}
.fav-item:hover {
  background: rgba(255,255,255,0.6);
  border-color: var(--coupon-border);
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(15,23,42,0.07), inset 0 1px 0 rgba(255,255,255,0.65);
}
.fav-item:active { transform: scale(0.99); }
.fav-item:focus-visible { outline: 2px solid var(--coupon-border); outline-offset: 2px; }
.fav-logo {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
  background: rgba(255,255,255,0.45);
  border: 1px solid rgba(255,255,255,0.55);
}
.fav-logo--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  font-weight: 750;
  color: var(--coupon-dark);
  background: linear-gradient(135deg, rgba(255,138,76,0.18), rgba(255,159,28,0.14));
}
.fav-info { flex: 1; min-width: 0; }
.fav-name {
  font-size: 15px;
  font-weight: 650;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fav-remove {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text-muted);
  font-size: 18px;
  line-height: 1;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.18s var(--ease-out);
}
.fav-remove:hover { background: var(--urgent-bg); color: var(--urgent); }

@media (max-width: 420px) {
  .tool-btn { padding: 5px 11px; font-size: 11.5px; }
  .fav-name { font-size: 14px; }
}
