:root {
  --shell-max: 428px;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  background: #fff;
  color: #2f2f2f;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  display: flex;
  justify-content: center;
}

.non-wechat body {
  overflow: hidden;
}

button {
  font: inherit;
}

.phone {
  position: relative;
  width: min(100vw, var(--shell-max));
  height: 100dvh;
  min-height: 650px;
  display: grid;
  grid-template-rows: 58px minmax(0, 1fr) 61px;
  overflow: hidden;
  background: #ededed;
}

.image-page-phone {
  grid-template-rows: minmax(0, 1fr);
  background: #fff;
}

.image-page-screen {
  position: relative;
  overflow-y: auto;
  background: #fff;
  scrollbar-width: none;
}

.image-page-screen::-webkit-scrollbar {
  display: none;
}

.full-page-art {
  display: block;
  width: 100%;
  height: auto;
}

.scan-page {
  overflow-y: auto;
}

.scan-art-wrap {
  position: relative;
}

.scan-action-hotspot {
  position: absolute;
  left: 4.7%;
  right: 4.7%;
  bottom: 2.6%;
  height: 6.9%;
  z-index: 2;
  display: block;
  border: 0;
  padding: 0;
  border-radius: 18px;
  background: transparent;
  cursor: pointer;
  outline: 0;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.scan-file-input {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.camera-scan-layer {
  position: fixed;
  inset: 0;
  left: 50%;
  z-index: 50;
  width: min(100vw, var(--shell-max));
  height: 100dvh;
  overflow: hidden;
  background: #000;
  transform: translateX(-50%);
}

.camera-scan-layer[hidden] {
  display: none;
}

.camera-scan-layer video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.camera-scan-frame {
  position: absolute;
  left: 50%;
  top: 46%;
  width: 72%;
  height: 42%;
  max-height: 360px;
  border: 0;
  border-radius: 0;
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.camera-scan-frame::before {
  content: none;
}

.camera-scan-frame::after {
  content: "";
  position: absolute;
  left: 5%;
  right: 5%;
  top: 0;
  height: 74px;
  border-top: 2px solid rgba(41, 240, 134, .95);
  background: linear-gradient(
    to bottom,
    rgba(41, 240, 134, .42),
    rgba(41, 240, 134, .18) 42%,
    rgba(41, 240, 134, 0)
  );
  filter: drop-shadow(0 0 12px rgba(41, 240, 134, .85));
  animation: cameraScanLine 1.9s linear infinite;
}

.camera-scan-back {
  position: absolute;
  top: max(18px, env(safe-area-inset-top));
  left: 12px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #fff;
  outline: 0;
  -webkit-tap-highlight-color: transparent;
}

.camera-scan-back svg {
  width: 30px;
  height: 30px;
  display: block;
  fill: currentColor;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, .42));
}

.camera-scan-tool {
  position: absolute;
  z-index: 2;
  display: grid;
  justify-items: center;
  gap: 7px;
  border: 0;
  padding: 0;
  background: transparent;
  color: rgba(255, 255, 255, .92);
  font-size: 13px;
  line-height: 1;
  outline: 0;
  -webkit-tap-highlight-color: transparent;
}

.camera-scan-tool[hidden] {
  display: none;
}

.camera-tool-icon {
  width: 45px;
  height: 45px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(0, 0, 0, .42);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16);
}

.camera-tool-icon svg {
  width: 24px;
  height: 24px;
  display: block;
  fill: currentColor;
}

.camera-tool-text {
  text-shadow: 0 1px 4px rgba(0, 0, 0, .65);
}

.camera-scan-torch {
  left: 50%;
  bottom: max(36px, calc(env(safe-area-inset-bottom) + 24px));
  transform: translateX(-50%);
}

.camera-scan-torch.is-suggested .camera-tool-icon {
  animation: cameraToolPulse 1.2s ease-in-out infinite;
}

.camera-scan-torch.is-on .camera-tool-icon {
  background: #16d77d;
  color: #111;
}

.camera-scan-album {
  right: 24px;
  bottom: max(36px, calc(env(safe-area-inset-bottom) + 24px));
}

@keyframes cameraScanLine {
  from {
    top: 0;
  }

  to {
    top: calc(100% - 74px);
  }
}

@keyframes cameraToolPulse {
  0%,
  100% {
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .2), 0 0 0 rgba(22, 215, 125, 0);
  }

  50% {
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .28), 0 0 22px rgba(22, 215, 125, .72);
  }
}

.wechat-titlebar {
  position: relative;
  overflow: hidden;
  background: #ededed;
}

.wechat-titlebar-img,
.wechat-menu-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: fill;
  pointer-events: none;
  user-select: none;
}

.wechat-hotspot,
.popover-hotspot {
  position: absolute;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  outline: 0;
  -webkit-tap-highlight-color: transparent;
  -webkit-appearance: none;
  appearance: none;
  touch-action: manipulation;
  user-select: none;
}

.wechat-hotspot:active,
.wechat-hotspot:focus,
.wechat-hotspot:focus-visible,
.popover-hotspot:active,
.popover-hotspot:focus,
.popover-hotspot:focus-visible {
  outline: 0;
  background: transparent;
  box-shadow: none;
}

.title-back-hotspot {
  inset: 0 auto 0 0;
  width: 23%;
}

.title-profile-hotspot {
  inset: 0 0 0 auto;
  width: 23%;
}

.wechat-chat-area {
  overflow: hidden;
  padding: 20px 12px 22px;
  background: #ededed;
}

.chat-time {
  display: block;
  margin-bottom: 18px;
  color: #aaa;
  font-size: 13px;
  line-height: 1;
  text-align: center;
}

.chat-message {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 10px;
  align-items: flex-start;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .18s ease, transform .18s ease;
}

.chat-message.visible {
  opacity: 1;
  transform: translateY(0);
}

.chat-avatar {
  width: 40px;
  height: 40px;
  display: block;
  border-radius: 4px;
  object-fit: cover;
}

.chat-bubble {
  position: relative;
  width: fit-content;
  max-width: 100%;
  padding: 10px 12px 11px;
  border-radius: 4px;
  background: #fff;
  color: #171717;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.4;
}

.chat-bubble::before {
  content: "";
  position: absolute;
  top: 14px;
  left: -9px;
  border: 5px solid transparent;
  border-right-color: #fff;
}

.wechat-menu {
  position: relative;
  border-top: 1px solid #e4e4e4;
  background: #fbfbfb;
}

.menu-keyboard-hotspot {
  inset: 0 auto 0 0;
  width: 11.25%;
}

.menu-scan-hotspot {
  inset: 0 auto 0 11.25%;
  width: 29.6%;
}

.menu-brand-hotspot {
  inset: 0 auto 0 40.85%;
  width: 29.6%;
  pointer-events: auto;
}

.menu-notice-hotspot {
  inset: 0 0 0 auto;
  width: 29.55%;
}

.menu-group {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.brand-popover {
  position: absolute;
  left: 40.85%;
  bottom: calc(100% + 11px);
  z-index: 4;
  width: 24%;
  min-width: 100px;
  transform: translateX(10%);
  pointer-events: auto;
}

.brand-popover[hidden] {
  display: none;
}

.brand-popover img {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
  user-select: none;
}

.popover-hotspot {
  left: 0;
  width: 100%;
  height: 50%;
  display: block;
}

.popover-product {
  top: 0;
}

.popover-anti-fake {
  bottom: 0;
}

.wechat-warning {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: stretch;
  justify-content: center;
  background: #fff;
}

.wechat-warning img {
  width: 100%;
  max-width: 428px;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

@media (min-width: 720px) {
  body {
    min-height: 100dvh;
    align-items: center;
    padding: 24px;
    background: #e9e9e9;
  }

  .phone {
    --shell-max: 520px;
    height: min(100dvh - 48px, 940px);
    grid-template-rows: 70px minmax(0, 1fr) 74px;
    border-radius: 20px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, .14);
  }
}
