:root {
  --rpx: min(0.133333333vw, 1px);
  --page-width: 750px;
  --orange: #ff7536;
  --text: #1c1c1c;
  --muted: #afb4bc;
}

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

html {
  background: #f5f8fa;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--text);
  background: #f5f8fa;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei",
    "Helvetica Neue", Arial, sans-serif;
}

button,
input {
  font: inherit;
}

.app {
  width: 100%;
  max-width: var(--page-width);
  min-height: 100vh;
  margin: 0 auto;
  padding-bottom: calc(132 * var(--rpx) + env(safe-area-inset-bottom));
  background: #f5f8fa;
}

.search-header {
  position: sticky;
  z-index: 20;
  top: 0;
  width: 100%;
  height: calc(116 * var(--rpx));
  padding-top: calc(24 * var(--rpx));
  background: linear-gradient(90deg, #f7485f 0%, #f58b4e 57.333%, #f58b4e 100%);
}

.search-box {
  position: relative;
  display: flex;
  width: calc(702 * var(--rpx));
  height: calc(72 * var(--rpx));
  margin: 0 auto;
  padding: 0 calc(32 * var(--rpx));
  align-items: center;
  overflow: hidden;
  border-radius: calc(72 * var(--rpx));
  background: #fff;
}

.search-icon {
  width: calc(30 * var(--rpx));
  height: calc(30 * var(--rpx));
  margin-right: calc(6 * var(--rpx));
  flex: 0 0 auto;
  object-fit: contain;
}

.search-box input {
  width: 100%;
  height: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #333;
  font-size: calc(26 * var(--rpx));
  font-weight: 500;
  line-height: calc(30 * var(--rpx));
  text-align: center;
}

.search-box input::placeholder {
  color: var(--muted);
  opacity: 1;
}

.search-box:focus-within input {
  text-align: left;
}

.product-list {
  display: flex;
  padding-top: calc(24 * var(--rpx));
  flex-direction: column;
  align-items: center;
}

.product-card {
  display: flex;
  width: calc(702 * var(--rpx));
  height: calc(232 * var(--rpx));
  margin-bottom: calc(24 * var(--rpx));
  padding: calc(20 * var(--rpx));
  overflow: hidden;
  border-radius: calc(24 * var(--rpx));
  background: #fff;
  box-shadow: 0 calc(7 * var(--rpx)) calc(24 * var(--rpx)) rgba(62, 106, 138, .08);
}

.product-link {
  color: inherit;
  text-decoration: none;
}

.promo-cover {
  background: #ff7b2e;
  object-position: left center;
}

.promo-price {
  position: absolute;
  bottom: calc(9 * var(--rpx));
  left: 0;
  max-width: calc(330 * var(--rpx));
  overflow: hidden;
  color: #f23f2c;
  font-size: calc(26 * var(--rpx));
  font-weight: 700;
  line-height: calc(44 * var(--rpx));
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-cover {
  width: calc(192 * var(--rpx));
  height: calc(192 * var(--rpx));
  flex: 0 0 auto;
  border-radius: calc(20 * var(--rpx));
  background: #f4f4f4;
  object-fit: cover;
}

.product-content {
  position: relative;
  width: calc(454 * var(--rpx));
  height: calc(192 * var(--rpx));
  margin-left: calc(16 * var(--rpx));
  overflow: hidden;
}

.product-title {
  display: -webkit-box;
  width: 100%;
  height: calc(80 * var(--rpx));
  margin: 0;
  overflow: hidden;
  color: var(--text);
  font-size: calc(28 * var(--rpx));
  font-weight: 500;
  line-height: calc(40 * var(--rpx));
  word-break: break-all;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.product-type {
  color: var(--orange);
}

.label-row {
  display: flex;
  width: 100%;
  height: calc(40 * var(--rpx));
  margin-top: calc(8 * var(--rpx));
  overflow: hidden;
  align-items: flex-start;
}

.label {
  display: inline-flex;
  height: calc(40 * var(--rpx));
  padding: 0 calc(16 * var(--rpx));
  align-items: center;
  border-radius: calc(8 * var(--rpx));
  background: rgba(255, 77, 79, .12);
  color: #ff4d4f;
  font-size: calc(20 * var(--rpx));
  line-height: calc(40 * var(--rpx));
  white-space: nowrap;
}

.price-row {
  position: absolute;
  bottom: 0;
  left: 0;
  display: flex;
  max-width: calc(340 * var(--rpx));
  height: calc(54 * var(--rpx));
  align-items: flex-end;
  overflow: hidden;
  white-space: nowrap;
}

.currency {
  padding-bottom: calc(4 * var(--rpx));
  color: #f23f2c;
  font-size: calc(28 * var(--rpx));
  font-weight: 700;
  line-height: calc(52 * var(--rpx));
}

.sale-price {
  color: #f23f2c;
  font-size: calc(36 * var(--rpx));
  font-weight: 700;
  line-height: calc(52 * var(--rpx));
}

.guide-label {
  margin-left: calc(8 * var(--rpx));
  padding-bottom: calc(7 * var(--rpx));
  color: var(--muted);
  font-size: calc(22 * var(--rpx));
  line-height: calc(32 * var(--rpx));
}

.guide-price {
  margin-left: calc(4 * var(--rpx));
  padding-bottom: calc(7 * var(--rpx));
  color: #f0be4a;
  font-size: calc(22 * var(--rpx));
  line-height: calc(32 * var(--rpx));
}

.buy-button {
  position: absolute;
  right: calc(4 * var(--rpx));
  bottom: 0;
  display: flex;
  width: calc(104 * var(--rpx));
  height: calc(56 * var(--rpx));
  padding: 0;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: calc(101 * var(--rpx));
  background: linear-gradient(90deg, #ffa74d, #ff4a21);
  color: #fff;
  font-size: calc(24 * var(--rpx));
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.empty-state {
  margin: calc(120 * var(--rpx)) 0 0;
  color: var(--muted);
  font-size: calc(28 * var(--rpx));
  text-align: center;
}

.tabbar {
  position: fixed;
  z-index: 30;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  width: 100%;
  max-width: var(--page-width);
  height: calc(116 * var(--rpx) + env(safe-area-inset-bottom));
  margin: 0 auto;
  padding-bottom: env(safe-area-inset-bottom);
  align-items: stretch;
  border-top: 1px solid rgba(0, 0, 0, .04);
  background: #fff;
  box-shadow: 0 calc(-4 * var(--rpx)) calc(18 * var(--rpx)) rgba(50, 70, 90, .05);
}

.tabbar-item {
  display: flex;
  width: 50%;
  padding: calc(10 * var(--rpx)) 0 calc(8 * var(--rpx));
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: calc(3 * var(--rpx));
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: calc(22 * var(--rpx));
  line-height: calc(28 * var(--rpx));
  cursor: pointer;
}

.tabbar-item img {
  width: calc(50 * var(--rpx));
  height: calc(50 * var(--rpx));
  object-fit: contain;
}

.tabbar-item.is-active {
  color: var(--text);
}

.toast {
  position: fixed;
  z-index: 50;
  bottom: calc(150 * var(--rpx) + env(safe-area-inset-bottom));
  left: 50%;
  padding: calc(18 * var(--rpx)) calc(28 * var(--rpx));
  border-radius: calc(12 * var(--rpx));
  background: rgba(0, 0, 0, .72);
  color: #fff;
  font-size: calc(24 * var(--rpx));
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, calc(16 * var(--rpx)));
  transition: .2s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (min-width: 751px) {
  body {
    background: #eef1f4;
  }

  .app,
  .tabbar {
    box-shadow: 0 0 28px rgba(35, 55, 70, .08);
  }
}
