.bqr-backdrop[hidden],
.bqr-panel[hidden] {
  display: none;
}

.bqr-backdrop {
  position: fixed;
  z-index: 298;
  inset: 0;
  background: rgba(17, 24, 39, .34);
  opacity: 0;
  backdrop-filter: blur(3px);
  transition: opacity 180ms ease-out;
}

.bqr-backdrop.is-visible {
  opacity: 1;
}

.bqr-widget {
  position: fixed;
  z-index: 300;
  right: 24px;
  bottom: 28px;
  color: #111827;
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, sans-serif;
}

.bqr-trigger {
  position: relative;
  min-width: 126px;
  min-height: 56px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 13px 7px 8px;
  border: 1px solid #ddd8ed;
  border-radius: 14px;
  color: #111827;
  background: rgba(255, 255, 255, .97);
  box-shadow: 0 14px 40px rgba(47, 35, 89, .16);
  cursor: pointer;
  transition: border-color 180ms ease-out, box-shadow 180ms ease-out, transform 180ms ease-out;
}

.bqr-trigger:hover {
  border-color: #bba9ed;
  box-shadow: 0 18px 46px rgba(70, 47, 146, .22);
  transform: translateY(-2px);
}

.bqr-trigger:focus-visible,
.bqr-close:focus-visible,
.bqr-account button:focus-visible,
.bqr-panel-foot button:focus-visible {
  outline: 3px solid rgba(109, 69, 232, .28);
  outline-offset: 3px;
}

.bqr-trigger-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 11px;
  color: #fff;
  background: linear-gradient(145deg, #7953ef, #5b36d1);
  box-shadow: inset 0 1px rgba(255, 255, 255, .22);
}

.bqr-trigger-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.bqr-trigger-copy {
  min-width: 0;
  display: grid;
  text-align: left;
  line-height: 1.15;
}

.bqr-trigger-copy strong {
  font-size: 13px;
  font-weight: 850;
}

.bqr-trigger-copy small {
  margin-top: 5px;
  color: #7b8492;
  font-size: 9px;
}

.bqr-trigger > i {
  position: absolute;
  top: 7px;
  right: 8px;
  width: 8px;
  height: 8px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #1fc995;
  box-shadow: 0 0 0 2px rgba(31, 201, 149, .12);
}

.bqr-panel {
  position: absolute;
  right: 0;
  bottom: 68px;
  width: min(336px, calc(100vw - 32px));
  padding: 20px;
  border: 1px solid #e2deee;
  border-radius: 18px;
  background:
    radial-gradient(circle at 90% 0%, rgba(109, 69, 232, .11), transparent 32%),
    #fff;
  box-shadow: 0 28px 80px rgba(33, 23, 70, .25);
  opacity: 0;
  transform: translateY(10px) scale(.98);
  transform-origin: right bottom;
  transition: opacity 180ms ease-out, transform 180ms ease-out;
}

.bqr-widget.is-open .bqr-panel {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.bqr-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.bqr-panel-head > div {
  min-width: 0;
}

.bqr-panel-head span {
  display: block;
  color: #6d45e8;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .12em;
}

.bqr-panel-head h2 {
  margin: 5px 0 0;
  color: #111827;
  font-size: 20px;
  font-weight: 900;
  line-height: 1.25;
  letter-spacing: -.02em;
}

.bqr-close {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid #e4e1ec;
  border-radius: 11px;
  color: #687181;
  background: #fff;
  cursor: pointer;
}

.bqr-close:hover {
  color: #5432c7;
  border-color: #cfc5eb;
  background: #f7f4ff;
}

.bqr-close svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.8;
}

.bqr-code-wrap {
  position: relative;
  width: 226px;
  height: 226px;
  display: grid;
  place-items: center;
  margin: 18px auto 14px;
  padding: 11px;
  border-radius: 16px;
  background: #f7f5fc;
}

.bqr-code-wrap img {
  width: 204px;
  height: 204px;
  display: block;
  border-radius: 10px;
  object-fit: contain;
  background: #fff;
}

.bqr-corner {
  position: absolute;
  width: 20px;
  height: 20px;
  border-color: #6d45e8;
  border-style: solid;
  pointer-events: none;
}

.bqr-corner.is-top-left {
  top: 4px;
  left: 4px;
  border-width: 2px 0 0 2px;
  border-radius: 7px 0 0;
}

.bqr-corner.is-top-right {
  top: 4px;
  right: 4px;
  border-width: 2px 2px 0 0;
  border-radius: 0 7px 0 0;
}

.bqr-corner.is-bottom-left {
  bottom: 4px;
  left: 4px;
  border-width: 0 0 2px 2px;
  border-radius: 0 0 0 7px;
}

.bqr-corner.is-bottom-right {
  right: 4px;
  bottom: 4px;
  border-width: 0 2px 2px 0;
  border-radius: 0 0 7px;
}

.bqr-image-error {
  margin: 0;
  padding: 22px;
  color: #8a4350;
  font-size: 12px;
  line-height: 1.6;
  text-align: center;
}

.bqr-account {
  min-height: 54px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 10px;
  padding: 9px 10px 9px 13px;
  border: 1px solid #e5e1ef;
  border-radius: 11px;
  background: #faf9fd;
}

.bqr-account span {
  color: #7a8391;
  font-size: 9px;
}

.bqr-account strong {
  min-width: 0;
  overflow: hidden;
  color: #222a37;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bqr-account button {
  grid-column: 2;
  grid-row: 1 / span 2;
  min-width: 58px;
  min-height: 36px;
  border: 1px solid #d6ccf1;
  border-radius: 8px;
  color: #5d38d3;
  background: #f1edff;
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
}

.bqr-description {
  margin: 13px 2px 0;
  color: #687181;
  font-size: 11px;
  line-height: 1.65;
  text-align: center;
}

.bqr-panel-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #ece9f2;
}

.bqr-panel-foot > span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #707988;
  font-size: 9px;
}

.bqr-panel-foot > span i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #1fc995;
}

.bqr-panel-foot button {
  min-width: 76px;
  min-height: 40px;
  border: 0;
  border-radius: 9px;
  color: #fff;
  background: #6d45e8;
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
}

.bqr-panel-foot button:hover {
  background: #5432c7;
}

html.bqr-lock {
  overflow: hidden;
}

@media (max-width: 720px) {
  .bqr-widget {
    right: 12px;
    bottom: calc(82px + env(safe-area-inset-bottom));
  }

  .bqr-trigger {
    width: 52px;
    min-width: 52px;
    min-height: 52px;
    justify-content: center;
    padding: 6px;
    border-radius: 50%;
    box-shadow: 0 12px 34px rgba(47, 35, 89, .2);
  }

  .bqr-trigger-icon {
    width: 38px;
    height: 38px;
    border-radius: 50%;
  }

  .bqr-trigger-copy {
    display: none;
  }

  .bqr-trigger > i {
    top: 3px;
    right: 3px;
  }

  .bqr-panel {
    position: fixed;
    right: 12px;
    bottom: calc(144px + env(safe-area-inset-bottom));
    width: calc(100vw - 24px);
    max-height: calc(100dvh - 168px - env(safe-area-inset-bottom));
    overflow-y: auto;
    overscroll-behavior: contain;
    border-radius: 18px;
    transform-origin: right bottom;
  }
}

@media (max-width: 380px), (max-height: 700px) {
  .bqr-panel {
    padding: 16px;
  }

  .bqr-panel-head h2 {
    font-size: 18px;
  }

  .bqr-code-wrap {
    width: 194px;
    height: 194px;
    margin-block: 14px 10px;
  }

  .bqr-code-wrap img {
    width: 172px;
    height: 172px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bqr-backdrop,
  .bqr-trigger,
  .bqr-panel {
    transition-duration: .01ms !important;
  }
}