* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: #121212;
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #cfcfcf;
  overflow: hidden;
}

.pager {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 5;
  min-width: 66px;
  padding: 8px 12px 6px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .94);
  text-align: center;
  pointer-events: none;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .35);
  visibility: hidden;
}

.pager.show {
  visibility: visible;
}

.pager .no {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.1;
  color: #0f766e;
}

.pager .frac {
  margin-top: 2px;
  font-size: 12px;
  color: #64748b;
}

.track {
  height: 100dvh;
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
  scrollbar-width: none;
}

.track::-webkit-scrollbar { display: none; }

.page {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 16px;
}

.frame {
  position: relative;
  width: min(calc(100vw - 36px), calc((100dvh - 96px) * 1067 / 1643));
  aspect-ratio: 1067 / 1643;
}

.poster {
  position: absolute;
  inset: 0;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 22px 60px rgba(0, 0, 0, .55);
  visibility: hidden;
  opacity: 0;
  transition: opacity .25s ease;
}

.page.ready .poster {
  visibility: visible;
  opacity: 1;
}

.loader {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #9aa0a6;
  font-size: 13px;
  letter-spacing: .5px;
}

.page.ready .loader {
  display: none;
}

.spinner {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .18);
  border-top-color: #4ade80;
  animation: spin .8s linear infinite;
}

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

.poster .bg {
  display: block;
  width: 100%;
  height: 100%;
}

.qr {
  position: absolute;
  left: 33.927%;
  top: 39.684%;
  width: 33.365%;
  height: 21.668%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qr svg {
  display: block;
  width: 100%;
  height: 100%;
}

.note {
  font-size: clamp(12px, 3.2vw, 18px);
  color: #8a8a8a;
  text-align: center;
  line-height: 1.5;
  padding: 0 8%;
}

.validity {
  position: absolute;
  left: 35.595%;
  top: 89.81%;
  color: #6b6b6b;
  line-height: 1;
  white-space: nowrap;
}

.status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  letter-spacing: .5px;
  color: #8b8b8b;
  min-height: 20px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 8px #4ade80;
}

.dot.wait { background: #facc15; box-shadow: 0 0 8px #facc15; }
.dot.err { background: #f87171; box-shadow: 0 0 8px #f87171; }
