:root {
  color-scheme: light;
  --bg: #f5f7f8;
  --panel: #ffffff;
  --ink: #142326;
  --muted: #657579;
  --line: #dde5e7;
  --green: #0f7b63;
  --green-2: #e6f4ef;
  --blue: #1769aa;
  --blue-2: #e8f1fb;
  --gold: #ae6d18;
  --gold-2: #fff4df;
  --red: #b94035;
  --shadow: 0 12px 36px rgba(28, 43, 47, 0.09);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

.shell {
  width: min(100%, 460px);
  min-height: 100vh;
  margin: 0 auto;
  background: var(--bg);
  padding-bottom: calc(24px + env(safe-area-inset-bottom));
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
  padding: calc(10px + env(safe-area-inset-top)) 18px 10px;
  background: rgba(245, 247, 248, 0.92);
  border-bottom: 1px solid rgba(221, 229, 231, 0.76);
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  font-weight: 800;
  font-size: 17px;
}

.brand-mark {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: var(--green);
  box-shadow: 0 8px 18px rgba(15, 123, 99, 0.2);
}

.icon-button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 18px rgba(28, 43, 47, 0.05);
}

.hero {
  padding: 18px;
  background:
    radial-gradient(circle at 86% 18%, rgba(255, 255, 255, 0.2), transparent 25%),
    linear-gradient(135deg, #0f7b63 0%, #1769aa 100%);
  color: #fff;
}

.hero h1 {
  max-width: 320px;
  margin: 0;
  font-size: 28px;
  line-height: 1.18;
  letter-spacing: 0;
}

.hero p {
  margin: 10px 0 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 14px;
  line-height: 1.65;
}

.hero-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 112px;
  min-height: 40px;
  margin-top: 16px;
  padding: 0 16px;
  color: var(--green);
  background: #fff;
  border-radius: 8px;
  font-weight: 800;
  box-shadow: 0 10px 22px rgba(28, 43, 47, 0.16);
}

.hero-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 16px;
}

.metric {
  min-height: 72px;
  padding: 11px 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
}

.metric strong {
  display: block;
  font-size: 18px;
  line-height: 1.1;
}

.metric span {
  display: block;
  margin-top: 7px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  line-height: 1.25;
}

.notice-bar {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 0 14px;
  color: #7c4709;
  background: #fff7e8;
  border-bottom: 1px solid #f1dfbd;
  overflow: hidden;
}

.notice-bar svg {
  flex: 0 0 auto;
}

.notice-track {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}

.notice-track span {
  display: inline-block;
  min-width: 100%;
  padding-left: 100%;
  font-size: 13px;
  animation: notice-scroll 16s linear infinite;
}

@keyframes notice-scroll {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(-100%);
  }
}

.section {
  padding: 16px 14px 0;
}

.search-card {
  padding: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.search-line {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fbfb;
}

.search-line svg {
  flex: 0 0 auto;
  color: var(--muted);
}

.search-line input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 12px;
}

.chip {
  flex: 0 0 auto;
  height: 34px;
  padding: 0 12px;
  color: var(--muted);
  background: #f6f8f8;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.chip.active {
  color: var(--green);
  background: var(--green-2);
  border-color: rgba(15, 123, 99, 0.28);
  font-weight: 700;
}

.section-title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin: 18px 4px 10px;
}

.section-title h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
}

.section-title span {
  color: var(--muted);
  font-size: 12px;
}

.merchant-list {
  display: grid;
  gap: 10px;
}

.merchant-card {
  display: block;
  padding: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 26px rgba(28, 43, 47, 0.06);
}

.merchant-head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.merchant-logo {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  color: #fff;
  border-radius: 8px;
  font-weight: 900;
  font-size: 18px;
}

.merchant-main {
  flex: 1;
  min-width: 0;
}

.merchant-title {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.merchant-title h3 {
  overflow: hidden;
  margin: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 16px;
}

.badge {
  flex: 0 0 auto;
  padding: 3px 6px;
  color: var(--blue);
  background: var(--blue-2);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
}

.merchant-desc {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.commission {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 13px;
  padding: 10px 12px;
  background: var(--gold-2);
  border-radius: 8px;
}

.commission span {
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
}

.commission strong {
  color: #7c4709;
  font-size: 17px;
  white-space: nowrap;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.meta {
  padding: 5px 8px;
  color: var(--muted);
  background: #f6f8f8;
  border-radius: 6px;
  font-size: 12px;
}

.empty {
  padding: 28px 16px;
  color: var(--muted);
  text-align: center;
  background: var(--panel);
  border: 1px dashed var(--line);
  border-radius: 8px;
}

.detail-hero {
  padding: 18px;
  color: #fff;
  background: linear-gradient(135deg, #0f7b63, #1769aa);
}

.detail-name {
  display: flex;
  align-items: center;
  gap: 12px;
}

.detail-name h1 {
  margin: 0;
  font-size: 23px;
  line-height: 1.2;
}

.detail-name p {
  margin: 6px 0 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
  line-height: 1.45;
}

.detail-panel {
  margin: -2px 14px 0;
  padding: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.detail-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.stat {
  min-height: 72px;
  padding: 10px;
  background: #f7faf9;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.stat span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.stat strong {
  display: block;
  margin-top: 6px;
  font-size: 15px;
  line-height: 1.22;
}

.info-block {
  margin-top: 12px;
  padding: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.info-block h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  font-size: 16px;
}

.info-block h2 svg {
  color: var(--green);
}

.requirements {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.requirements li {
  display: flex;
  gap: 8px;
  color: #34464a;
  font-size: 14px;
  line-height: 1.45;
}

.requirements li::before {
  content: "";
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  margin-top: 7px;
  border-radius: 50%;
  background: var(--green);
}

.step-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.step {
  min-height: 84px;
  padding: 10px;
  background: #f7faf9;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.step span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  color: #fff;
  background: var(--green);
  border-radius: 50%;
  font-size: 12px;
  font-weight: 800;
}

.step strong {
  display: block;
  margin-top: 9px;
  font-size: 13px;
  line-height: 1.35;
}

.qr-wrap {
  display: grid;
  grid-template-columns: 118px 1fr;
  gap: 14px;
  align-items: center;
}

.qr {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-template-rows: repeat(7, 1fr);
  width: 118px;
  height: 118px;
  padding: 9px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 18px rgba(28, 43, 47, 0.06);
}

.qr i {
  display: block;
  margin: 2px;
  background: var(--ink);
  border-radius: 2px;
}

.qr-image {
  display: block;
  width: 118px;
  height: 118px;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 18px rgba(28, 43, 47, 0.06);
}

.qr-copy h3 {
  margin: 0;
  font-size: 16px;
}

.qr-copy p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.fixed-action {
  position: sticky;
  bottom: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
  background: rgba(245, 247, 248, 0.94);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 8px;
  font-weight: 800;
}

.btn.secondary {
  color: var(--green);
  background: var(--green-2);
}

.btn.primary {
  color: #fff;
  background: var(--green);
  box-shadow: 0 10px 22px rgba(15, 123, 99, 0.22);
}

.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(20, 35, 38, 0.46);
}

.cooperation-modal {
  position: relative;
  width: min(100%, 340px);
  padding: 22px 18px 18px;
  text-align: center;
  background: var(--panel);
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(20, 35, 38, 0.24);
}

.cooperation-modal h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.25;
}

.cooperation-modal p {
  margin: 9px auto 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.cooperation-modal img {
  display: block;
  width: min(100%, 260px);
  aspect-ratio: 1;
  margin: 0 auto;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.cooperation-modal strong {
  display: block;
  margin-top: 12px;
  color: var(--green);
  font-size: 14px;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: var(--muted);
  background: #f5f7f8;
  border-radius: 8px;
}

@media (max-width: 360px) {
  .hero h1 {
    font-size: 25px;
  }

  .commission {
    align-items: flex-start;
    flex-direction: column;
  }

  .qr-wrap {
    grid-template-columns: 1fr;
  }

  .step-list,
  .detail-stats {
    grid-template-columns: 1fr;
  }
}
