/* ---------- 扫一扫 ---------- */
#scan {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: none;
  flex-direction: column;
  background: #080b12;
  color: #fff;
}
#scan.show {
  display: flex;
  animation: fadeIn 0.18s ease;
}
.scan-hd {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(10px + var(--safe-t)) 14px 8px;
}
.scan-hd .scan-name {
  flex: 1;
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.6px;
}
.scan-hd button {
  flex: none;
  height: 34px;
  min-width: 34px;
  padding: 0 4px;
  border: none;
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 13px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.scan-hd .scan-album {
  padding: 0 13px;
}
.scan-stage {
  position: relative;
  flex: 1;
  overflow: hidden;
  background: #000;
}
#scan-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}
.scan-frame {
  position: absolute;
  left: 50%;
  top: 44%;
  width: 64vw;
  max-width: 268px;
  aspect-ratio: 1 / 1;
  transform: translate(-50%, -50%);
  border-radius: 16px;
  box-shadow:
    0 0 0 1.5px rgba(255, 255, 255, 0.35),
    0 0 0 9999px rgba(6, 9, 16, 0.58);
}
.scan-frame .cn {
  position: absolute;
  width: 26px;
  height: 26px;
  border: 3px solid var(--gold);
  border-radius: 4px;
}
.scan-frame .tl {
  left: -2px;
  top: -2px;
  border-right: 0;
  border-bottom: 0;
  border-radius: 8px 0 0 0;
}
.scan-frame .tr {
  right: -2px;
  top: -2px;
  border-left: 0;
  border-bottom: 0;
  border-radius: 0 8px 0 0;
}
.scan-frame .bl {
  left: -2px;
  bottom: -2px;
  border-right: 0;
  border-top: 0;
  border-radius: 0 0 0 8px;
}
.scan-frame .br {
  right: -2px;
  bottom: -2px;
  border-left: 0;
  border-top: 0;
  border-radius: 0 0 8px 0;
}
.scan-line {
  position: absolute;
  left: 10px;
  right: 10px;
  top: 8%;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  box-shadow: 0 0 10px rgba(243, 195, 91, 0.8);
  animation: scanMove 2.4s ease-in-out infinite;
}
@keyframes scanMove {
  0% {
    top: 8%;
    opacity: 0.25;
  }
  50% {
    top: 90%;
    opacity: 1;
  }
  100% {
    top: 8%;
    opacity: 0.25;
  }
}
.scan-tip {
  position: absolute;
  left: 24px;
  right: 24px;
  top: calc(44% + 34vw);
  text-align: center;
  font-size: 13px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.78);
}
.scan-tip.err {
  color: #ffd7a8;
}
.scan-foot {
  padding: 14px 24px calc(18px + var(--safe-b));
  text-align: center;
  background: linear-gradient(180deg, transparent, rgba(8, 11, 18, 0.9));
}
.scan-foot button {
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
  padding: 13px;
  border: none;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 14.5px;
  font-weight: 600;
}
.scan-note {
  margin-top: 9px;
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.45);
}
.scan-res {
  margin: 2px 16px 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #f5f6f9;
  font-size: 13.5px;
  line-height: 1.6;
  color: #2b3242;
  word-break: break-all;
  max-height: 30vh;
  overflow: auto;
}
.scan-warn {
  margin: 0 16px 12px;
  font-size: 12px;
  line-height: 1.55;
  color: #9a6b12;
  background: #fff8e8;
  border-radius: 10px;
  padding: 9px 12px;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
