:root {
  --design-width: 853;
  --design-height: 1844;
  --canvas-width: min(100vw, 430px);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  background: #f8f6f1;
}

body {
  overflow-x: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}

.h5-shell {
  width: 100%;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  background: #f8f6f1;
}

.phone-canvas {
  position: relative;
  width: var(--canvas-width);
  min-height: calc(var(--canvas-width) * 1844 / 853);
  overflow: hidden;
  background: #fff8ef;
}

.screen-image {
  display: none;
  width: 100%;
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

.screen-image.is-active {
  display: block;
}

.hotspot {
  position: absolute;
  display: none;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
}

.phone-canvas[data-screen="home"] .home-upload,
.phone-canvas[data-screen="home"] [class*="home-size-"],
.phone-canvas[data-screen="home"] .home-redeem,
.phone-canvas[data-screen="home"] .home-generate,
.phone-canvas[data-screen="home"] .nav-home,
.phone-canvas[data-screen="home"] .nav-profile,
.phone-canvas[data-screen="profile"] .profile-redeem,
.phone-canvas[data-screen="profile"] .nav-home,
.phone-canvas[data-screen="profile"] .nav-profile,
.phone-canvas[data-screen="result"] .result-back,
.phone-canvas[data-screen="result"] .result-regenerate,
.phone-canvas[data-screen="result"] .result-save {
  display: block;
}

.home-upload {
  left: 6.5%;
  top: 34.2%;
  width: 87%;
  height: 22%;
}

.home-size-16,
.home-size-26,
.home-size-32,
.home-size-50,
.home-size-52,
.home-size-64,
.home-size-78,
.home-size-100,
.home-size-104,
.home-size-custom {
  top: 62.0%;
  width: 14.4%;
  height: 3.6%;
}

.home-size-16 { left: 6.7%; }
.home-size-26 { left: 24.4%; }
.home-size-32 { left: 42.1%; }
.home-size-50 { left: 59.7%; }
.home-size-52 { left: 77.4%; }

.home-size-64,
.home-size-78,
.home-size-100,
.home-size-104,
.home-size-custom {
  top: 66.5%;
}

.home-size-64 { left: 6.7%; }
.home-size-78 { left: 24.4%; }
.home-size-100 { left: 42.1%; }
.home-size-104 { left: 59.7%; }
.home-size-custom { left: 77.4%; }

.home-redeem {
  left: 6.5%;
  top: 78.9%;
  width: 87%;
  height: 3.9%;
}

.home-generate {
  left: 5.0%;
  top: 84.7%;
  width: 90%;
  height: 4.6%;
}

.nav-home,
.nav-profile {
  top: 93.1%;
  height: 5.2%;
}

.nav-home {
  left: 5.0%;
  width: 43.0%;
}

.nav-profile {
  left: 52.0%;
  width: 43.0%;
}

.profile-redeem {
  left: 5.0%;
  top: 58.5%;
  width: 90%;
  height: 12.2%;
}

.result-back {
  left: 2.0%;
  top: 3.0%;
  width: 14.0%;
  height: 6.0%;
}

.result-regenerate {
  left: 6.0%;
  top: 88.0%;
  width: 35.0%;
  height: 6.0%;
}

.result-save {
  left: 45.0%;
  top: 88.0%;
  width: 49.0%;
  height: 6.0%;
}

.modal-layer {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(64, 54, 45, 0.34);
}

.modal-layer.is-active {
  display: flex;
}

.modal-close-bg {
  position: absolute;
  inset: 0;
  border: 0;
  background: transparent;
}

.modal-image {
  position: relative;
  z-index: 11;
  width: 84%;
  height: auto;
  border-radius: 24px;
  pointer-events: none;
}

.redeem-input-hot {
  position: absolute;
  z-index: 12;
  left: 18%;
  top: 48.3%;
  width: 64%;
  height: 4.5%;
  border: 0;
  outline: 0;
  background: rgba(255, 255, 255, 0.04);
  color: transparent;
  caret-color: #79bf6e;
  font-size: 16px;
}

.modal-cancel,
.modal-confirm {
  z-index: 12;
  display: block;
  top: 57.8%;
  width: 28%;
  height: 4.8%;
}

.modal-cancel { left: 19%; }
.modal-confirm { left: 53%; }

.toast {
  position: fixed;
  left: 50%;
  bottom: max(28px, env(safe-area-inset-bottom));
  z-index: 30;
  max-width: min(82vw, 340px);
  padding: 12px 18px;
  border-radius: 999px;
  background: rgba(61, 54, 48, 0.88);
  color: #fff;
  font-size: 14px;
  line-height: 1.4;
  text-align: center;
  opacity: 0;
  transform: translateX(-50%) translateY(12px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  pointer-events: none;
}

.toast.is-active {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (min-width: 700px) {
  body {
    background: #e9edf5;
  }

  .h5-shell {
    padding: 24px 0;
    background: #e9edf5;
  }

  .phone-canvas {
    border-radius: 28px;
    box-shadow: 0 24px 80px rgba(58, 63, 76, 0.18);
  }
}

@media (max-width: 430px) {
  .h5-shell {
    display: block;
  }

  .phone-canvas {
    width: 100vw;
    min-height: calc(100vw * 1844 / 853);
  }
}

