/* 序列号查询 — 扫一扫（WeChat 风格镜头 zoom，无 CSS 放大 video） */

body.lookup-scan-open {
  overflow: hidden;
}

.lookup-scan-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 3100;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.55);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  opacity: 0;
  transition: opacity 0.28s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.lookup-scan-overlay.show {
  display: flex;
  opacity: 1;
}

.lookup-scan-dialog {
  width: 100%;
  max-width: 360px;
  background: #1c1c1e;
  border-radius: 18px;
  overflow: hidden;
  box-shadow:
    0 0 0 0.5px rgba(255, 255, 255, 0.08),
    0 20px 56px rgba(0, 0, 0, 0.45);
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity 0.28s cubic-bezier(0.25, 0.1, 0.25, 1),
    transform 0.28s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.lookup-scan-overlay.show .lookup-scan-dialog {
  opacity: 1;
  transform: translateY(0);
}

.lookup-scan-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.lookup-scan-header h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.022em;
  color: #f5f5f7;
}

.lookup-scan-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lookup-scan-album,
.lookup-scan-close {
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #a1a1a6;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.lookup-scan-album svg {
  display: block;
  width: 18px;
  height: 18px;
  margin: 0 auto;
}

.lookup-scan-close {
  font-size: 20px;
}

.lookup-scan-album:hover,
.lookup-scan-close:hover {
  background: rgba(255, 255, 255, 0.16);
}

.lookup-scan-viewport {
  position: relative;
  aspect-ratio: 1;
  max-height: 56vh;
  background: #000;
  overflow: hidden;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.lookup-scan-viewport.is-pinching {
  cursor: grabbing;
}

/* 禁止对 video 做 transform 缩放 */
.lookup-scan-viewport video,
.lookup-scan-viewport .lookup-scan-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: none !important;
  transition: none !important;
}

.lookup-scan-viewport .lookup-scan-preview[hidden] {
  display: none !important;
}

.lookup-scan-viewport.is-album-loading .lookup-scan-frame {
  opacity: 0;
}

.lookup-scan-album-loading {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.52);
  pointer-events: none;
}

.lookup-scan-album-loading[hidden] {
  display: none !important;
}

.lookup-scan-album-loading-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 18px 22px;
  border-radius: 16px;
  background: rgba(28, 28, 30, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

.lookup-scan-album-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(255, 255, 255, 0.18);
  border-top-color: #fff;
  border-radius: 50%;
  animation: lookup-scan-spin 0.75s linear infinite;
}

.lookup-scan-album-loading-text {
  font-size: 13px;
  font-weight: 500;
  color: #f5f5f7;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

@keyframes lookup-scan-spin {
  to {
    transform: rotate(360deg);
  }
}

.lookup-scan-album:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.lookup-scan-frame {
  position: absolute;
  inset: 16%;
  border: 2px solid rgba(255, 255, 255, 0.92);
  border-radius: 14px;
  pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.42);
}

.lookup-scan-frame::after {
  content: "";
  position: absolute;
  left: 12%;
  right: 12%;
  top: 50%;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.35) 20%,
    rgba(255, 255, 255, 0.35) 80%,
    transparent
  );
  opacity: 0.6;
  pointer-events: none;
}

.lookup-scan-zoom-badge {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
  font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, 0.95);
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.12);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.lookup-scan-zoom-badge.show {
  opacity: 1;
}

.lookup-scan-hint {
  margin: 0;
  padding: 14px 18px 18px;
  font-size: 13px;
  line-height: 1.5;
  color: #98989d;
  text-align: center;
}

.lookup-scan-error {
  display: none;
  margin: 0 18px 12px;
  padding: 10px 12px;
  font-size: 13px;
  color: #ff9f0a;
  background: rgba(255, 159, 10, 0.12);
  border-radius: 10px;
  text-align: center;
}

.lookup-scan-error.show {
  display: block;
}

@media (prefers-reduced-motion: reduce) {
  .lookup-scan-overlay,
  .lookup-scan-dialog {
    transition: none;
  }
  .lookup-scan-overlay.show .lookup-scan-dialog {
    transform: none;
  }
  .lookup-scan-album-spinner {
    animation: none;
    border-top-color: rgba(255, 255, 255, 0.55);
  }
}
