:root {
  --shop-bg: #fbf7f1;
  --shop-paper: #fffdf9;
  --shop-ink: #3d2a22;
  --shop-text: #5a4338;
  --shop-muted: #8a7468;
  --shop-line: #eadfd3;
  --shop-green: #6b8f71;
  --shop-green-soft: #eef4ee;
  --shop-cta: #5c3a28;
  --shop-paid: #3f7a4d;
  --shop-unpaid: #c47a16;
  --shop-pending: #2457a6;
  --shop-banner: url("https://images.unsplash.com/photo-1555507036-ab1f4038808a?auto=format&fit=crop&w=1400&q=80");
  font-family: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--shop-bg);
  color: var(--shop-ink);
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
  background: none;
  cursor: pointer;
  color: inherit;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

img {
  max-width: 100%;
}

.hidden {
  display: none !important;
}

.shop-body {
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
}

.shop-shell {
  width: min(100%, 1024px);
  min-height: 100vh;
  margin: 0 auto;
  background: var(--shop-paper);
  box-shadow: 0 0 0 1px rgba(92, 58, 40, 0.04);
}

.shop-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  padding: 8px 16px;
  background: rgba(255, 253, 249, 0.94);
  border-bottom: 1px solid var(--shop-line);
  backdrop-filter: blur(10px);
}

.shop-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.shop-brand-mark {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border-radius: 10px;
  background: #fffdf9;
  box-shadow: 0 1px 4px rgba(92, 58, 40, 0.12);
}

.shop-topbar-name {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0.02em;
}

.shop-topbar-tag {
  color: var(--shop-muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
}

.shop-link-btn {
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--shop-line);
  border-radius: 18px;
  color: var(--shop-text);
  font-size: 13px;
  font-weight: 600;
  background: #fff;
}

.shop-banner-image {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  height: 213px;
  background: #eadfd3 var(--shop-banner) center / cover no-repeat;
}

.shop-banner-mask {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(92, 58, 40, 0.05) 20%, rgba(61, 42, 34, 0.45));
}

.shop-banner-avatar {
  position: relative;
  z-index: 1;
  width: 92px;
  height: 92px;
  transform: translateY(22px);
  object-fit: contain;
  border: 3px solid #fffdf9;
  border-radius: 18px;
  background: #fffdf9;
  box-shadow: 0 6px 18px rgba(61, 42, 34, 0.18);
}

.shop-store-title {
  margin: 28px 16px 0;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.02em;
}

.shop-store-sub {
  margin: 8px 16px 0;
  color: var(--shop-muted);
  font-size: 14px;
}

.shop-info {
  padding: 16px 16px 8px;
  border-bottom: 6px solid #f5f5f5;
}

.shop-status-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 15px;
  font-weight: 600;
}

.shop-intro {
  margin: 12px 0 0;
  color: var(--shop-text);
  font-size: 14px;
  line-height: 1.6;
}

.shop-muted {
  color: var(--shop-muted);
  font-size: 13px;
  line-height: 1.5;
}

.status-pill,
.pay-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: #f3f4f6;
  color: var(--shop-text);
}

.status-pill.open {
  background: var(--shop-green-soft);
  color: var(--shop-green);
}

.status-pill.closed,
.pay-pill.unpaid {
  background: #fff4e5;
  color: var(--shop-unpaid);
}

.pay-pill.paid {
  background: var(--shop-green-soft);
  color: var(--shop-paid);
}

.pay-pill.pending {
  background: #e8f0ff;
  color: var(--shop-pending);
}

.shop-section {
  padding: 24px 16px 120px;
}

.shop-section-title {
  margin: 0 0 16px;
  font-size: 18px;
  font-weight: 700;
}

.shop-cat-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 12px;
  margin: 0 0 4px;
  scrollbar-width: none;
}

.shop-cat-chips::-webkit-scrollbar {
  display: none;
}

.shop-cat-chip {
  flex: none;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--shop-line);
  border-radius: 999px;
  background: #fff;
  color: var(--shop-ink);
  font-size: 14px;
  font-weight: 600;
}

.shop-cat-chip.active {
  border-color: var(--shop-cta);
  background: var(--shop-cta);
  color: #fffaf4;
}

.shop-cat-group-title {
  margin: 4px 0 12px;
  font-size: 16px;
  font-weight: 700;
}

.shop-products {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.shop-card {
  padding: 12px;
  border: 1px solid var(--shop-line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 4px 14px rgba(92, 58, 40, 0.04);
}

.shop-card-main {
  display: grid;
  grid-template-columns: 98px 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.shop-card-img {
  width: 98px;
  height: 98px;
  object-fit: cover;
  border-radius: 8px;
  background: #ececec;
}

.shop-card-info {
  min-width: 0;
}

.shop-card-name {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.3;
}

.shop-card-price {
  margin-top: 8px;
  color: var(--shop-text);
  font-size: 16px;
  font-weight: 600;
}

.shop-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.shop-card-meta {
  color: var(--shop-muted);
  font-size: 14px;
}

.shop-stepper {
  display: flex;
  align-items: center;
  gap: 4px;
}

.shop-stepper button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--shop-green-soft);
  color: var(--shop-green);
  font-size: 22px;
  line-height: 1;
}

.shop-stepper span {
  min-width: 28px;
  text-align: center;
  font-size: 16px;
  font-weight: 600;
}

.shop-cartbar {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: min(100%, 1024px);
  transform: translateX(-50%);
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: #fff;
  box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.08);
}

.shop-cartbar-copy {
  min-width: 0;
  font-size: 14px;
  color: var(--shop-text);
}

.shop-cartbar-copy b {
  display: block;
  margin-top: 2px;
  color: var(--shop-ink);
  font-size: 20px;
  font-weight: 700;
}

.shop-cta {
  min-width: 120px;
  min-height: 48px;
  padding: 0 24px;
  border-radius: 24px;
  background: var(--shop-cta);
  color: #fffaf4;
  font-size: 16px;
  font-weight: 600;
  box-shadow: 0 8px 18px rgba(92, 58, 40, 0.18);
}

.shop-cta-block {
  width: 100%;
}

.shop-secondary {
  min-height: 48px;
  padding: 0 24px;
  border-radius: 24px;
  background: #f3f4f6;
  color: var(--shop-ink);
  font-size: 16px;
  font-weight: 600;
}

.shop-page {
  padding: 8px 16px 32px;
}

.shop-page-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.shop-back {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 4px 20px 4px rgba(0, 49, 107, 0.12);
  font-size: 18px;
}

.shop-page-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
}

.shop-center {
  text-align: center;
}

.shop-edit-banner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fff3e6;
  color: var(--shop-cta);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
}

.shop-edit-banner button {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font-size: 13px;
  font-weight: 700;
  text-decoration: underline;
}

.shop-summary .shop-stepper {
  flex: none;
}

.shop-summary li.shop-confirm-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 12px;
  align-items: center;
}

.shop-confirm-item-main {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  grid-column: 1 / -1;
}

.shop-confirm-remove {
  justify-self: start;
  padding: 0;
  border: 0;
  background: none;
  color: #b42318;
  font-size: 13px;
  font-weight: 600;
}

.shop-summary {
  margin: 0;
  padding: 0;
  list-style: none;
}

.shop-summary li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--shop-line);
  font-size: 15px;
}

.shop-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 16px 0 20px;
  font-size: 16px;
  font-weight: 700;
}

.shop-form {
  display: grid;
  gap: 14px;
}

.shop-form-gap {
  margin-top: 18px;
}

.shop-field {
  display: grid;
  gap: 6px;
}

.shop-field span {
  color: var(--shop-muted);
  font-size: 13px;
  font-weight: 600;
}

.shop-field input,
.shop-field textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--shop-line);
  border-radius: 12px;
  background: #fffaf4;
  color: var(--shop-ink);
  font-size: 16px;
}

.shop-page-bar {
  position: sticky;
  bottom: 0;
  z-index: 15;
  padding: 12px 0 calc(12px + env(safe-area-inset-bottom));
  background: #fff;
}

.shop-success-mark {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin: 24px auto 12px;
  border-radius: 50%;
  background: var(--shop-green-soft);
  color: var(--shop-paid);
  font-size: 32px;
  font-weight: 800;
}

.shop-order {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
  padding: 14px;
  border: 1px solid var(--shop-line);
  border-radius: 12px;
}

.shop-order .shop-secondary {
  min-height: 36px;
  min-width: auto;
  padding: 0 14px;
  font-size: 14px;
}

.shop-page .shop-summary {
  margin-bottom: 8px;
}

.shop-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.shop-pay {
  display: grid;
  gap: 12px;
  justify-items: center;
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--shop-line);
  border-radius: 12px;
  text-align: center;
}

.shop-pay .due {
  color: var(--shop-ink);
  font-size: 32px;
  font-weight: 700;
}

.shop-pay .qr {
  width: min(220px, 70vw);
  height: min(220px, 70vw);
  object-fit: contain;
  border: 1px solid var(--shop-line);
  border-radius: 12px;
  background: #fff;
}

.pay-methods {
  display: grid;
  gap: 10px;
  width: 100%;
}

.pay-method {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--shop-line);
  border-radius: 12px;
  background: #fffaf4;
  text-align: left;
}

.pay-method.selected {
  border-color: var(--shop-cta);
  box-shadow: inset 0 0 0 1px var(--shop-cta);
}

.pay-method-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pay-method-head small {
  margin-left: auto;
  color: var(--shop-muted);
}

.pay-account {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff;
  white-space: pre-wrap;
  word-break: break-word;
  text-align: left;
  font-size: 14px;
  line-height: 1.5;
}

.shop-pay .proof-preview {
  width: min(100%, 280px);
  max-height: 220px;
  object-fit: contain;
  border: 1px solid var(--shop-line);
  border-radius: 12px;
  background: #fff;
}

.empty {
  padding: 32px 12px;
  text-align: center;
  color: var(--shop-muted);
}

.shop-toast {
  position: fixed;
  left: 50%;
  bottom: calc(96px + env(safe-area-inset-bottom));
  z-index: 99;
  max-width: min(88vw, 420px);
  padding: 10px 14px;
  transform: translateX(-50%);
  border-radius: 12px;
  background: var(--shop-cta);
  color: #fffaf4;
  box-shadow: 0 10px 30px rgba(61, 42, 34, 0.22);
}

@media (min-width: 768px) {
  .shop-topbar {
    min-height: 64px;
    padding: 12px 24px;
  }

  .shop-brand-mark {
    width: 52px;
    height: 52px;
  }

  .shop-banner-image {
    height: 300px;
    border-radius: 0 0 24px 24px;
    overflow: hidden;
  }

  .shop-banner-avatar {
    width: 118px;
    height: 118px;
    transform: translateY(24px);
  }

  .shop-store-title {
    padding-top: 18px;
    font-size: 32px;
  }

  .shop-info,
  .shop-store-title,
  .shop-store-sub,
  .shop-section,
  .shop-page {
    padding-left: 24px;
    padding-right: 24px;
  }

  .shop-section-title {
    font-size: 28px;
  }

  .shop-products {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 24px;
  }

  .shop-card {
    width: calc(50% - 12px);
  }

  .shop-cartbar {
    padding-left: 24px;
    padding-right: 24px;
  }
}

@media (max-width: 380px) {
  .shop-card-main {
    grid-template-columns: 76px 1fr;
  }

  .shop-card-img {
    width: 76px;
    height: 76px;
  }

  .shop-cta {
    min-width: 96px;
    padding: 0 16px;
  }
}
