body {
  margin: 0;
  padding: 0;
  font-family:Tahoma,Verdana,STHeiTi,simsun,sans-serif;
}
div.debug {
  position: fixed;
  left: 0;
  bottom: 0;
  width: 100%;
  max-height: 65%;
  border-radius: 12px 12px 0 0;
  background-color: rgba(0, 0, 0, 0.88);
  padding: 8px 10px;
  color: #eee;
  font-size: 12px;
  word-break: break-all;
  z-index: 9999;
  overflow-y: auto;
  box-sizing: border-box;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.dbg-status {
  text-align: center;
  padding: 4px 0;
  font-size: 13px;
  font-weight: bold;
  border-radius: 6px;
  margin-bottom: 6px;
}
.dbg-status.ok { background: #1a6b1a; color: #6f6; }
.dbg-status.detecting { background: #6b5b1a; color: #fd6; }
.dbg-status.fail { background: #6b1a1a; color: #f66; }
.dbg-status.idle { background: #333; color: #999; }
.dbg-main {
  display: flex;
  gap: 8px;
  margin-bottom: 6px;
}
.dbg-preview {
  flex-shrink: 0;
  text-align: center;
}
.dbg-preview canvas {
  width: 120px;
  height: auto;
  border: 1px solid rgba(100, 255, 100, 0.5);
  border-radius: 4px;
  display: block;
  margin-bottom: 2px;
}
.dbg-preview-label {
  font-size: 10px;
  color: #888;
  margin-top: 2px;
}
.dbg-info {
  flex: 1;
  min-width: 0;
}
.dbg-info table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}
.dbg-info td {
  padding: 1px 4px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  vertical-align: top;
}
.dbg-info td:first-child {
  color: #888;
  width: 52px;
  white-space: nowrap;
}
.dbg-info td:last-child {
  color: #ddd;
  word-break: break-all;
}
.dbg-mono { font-family: monospace; font-size: 10px; }
.dbg-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 6px;
}
.dbg-buttons button {
  flex: 1;
  min-width: 48px;
  height: 28px;
  border: 1px solid #555;
  border-radius: 6px;
  background: #222;
  color: #ccc;
  font-size: 11px;
  cursor: pointer;
}
.dbg-buttons button:active { background: #444; }
.dbg-raw-section {
  margin-top: 4px;
}
.dbg-raw-title {
  font-size: 10px;
  color: #666;
  text-transform: uppercase;
  margin-bottom: 2px;
}
.dbg-raw-content {
  background: rgba(255,255,255,0.04);
  border-radius: 4px;
  padding: 4px 6px;
  font-family: monospace;
  font-size: 9px;
  color: #999;
  max-height: 100px;
  overflow-y: auto;
  word-break: break-all;
}
.hidden {
  display: none !important;
}
.viewport {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}
video.preview {
  object-fit: cover;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1000;
}
div.debug canvas.hidden {
  display: none;
}
div.bottomfixed {
  position: absolute;
  width: 100%;
  bottom: 0;
  height: 90px;
  background-color: #171616;
  text-align: center;
  border-top: 1px solid #ef4823;
}

.play.button {
  display: inline-block;
  padding: 0.1rem 1.2rem 0.1rem 1.4rem;
  margin-right: 0.2rem;
  border-radius: 6px;
  background-color: #707070;
  color: #444;
}

div.bottomfixed .action.highlight .play.button {
  background-color: #ccc;
}

div.bottomfixed .action img {
  height: 14px;
  width: 36px;
}

div.bottomfixed .action {
  margin-top: 20px;
  font-size: 1rem;
  color: #707070;
  width: 49%;
  display: inline-block;
}

div.bottomfixed .action.highlight {
  color: #ccc;
}

div.camoverlay {
  position: absolute;
  top: 18vw;
  left: 0;
  font-size: 0;
  width: 100%;
  aspect-ratio: 1;
}
div.camoverlay img.qrmarkers {
  position: absolute;
  left: 0;
  margin: 0;
  width: 100%;
  height: 100%;
}

div.lower.text {
  top: 4%;
  text-align: center;
}

div.progress {
  width: 70%;
  margin: 0.2rem 0 0 0;
  height: 20px;
  border-radius: 10px;
  background-color: #eee;
  font-size: 18px;
  color: black;
  display: inline-block;
  position: relative;
  overflow: hidden;
}
div.progress-text {
  color: #333;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
div.progress-bar {
  border-radius: 10px;
  background-color: #ef4823;
  width: 0%;
  height: 100%;
  top: 0;
}
div.upper.overlay {
  position: relative;
  height: 100vmin;
  text-align: center;
}

div.lower.overlay {
  position: relative;
  width: 100%;
  text-align: center;
}
/* legacy debug button styles removed - using .dbg-buttons now */

div#loading {
  width: 100%;
  height: 100%;
  position: absolute;
  background-color: white;
  z-index: 10000;
  text-align: center;
  padding-top: 30%;
}

canvas#output_img {
  position: absolute;
  right: 5px;
  top: 5px;
}

div.bordered {
  padding: 0.2rem;
  border: 1px dashed yellow;
  border-radius: 4px;
  margin: 0.2rem 0;
}

div.output {
  position: relative;
}

.tooltip {
  position: absolute;
  width: 100vmin;
  display: block;
  margin: 0 auto;
  animation: bounce 1s ease-in-out infinite; /* Adjust the duration as needed */
  top: -60px;
}

.tooltip .tooltiptext {
  display: block;
  margin: 0 auto;
  width: 110px;
  background-color: #ef4823;
  color: #fff;
  padding: 12px 0;
  border-radius: 10px;
  z-index: 1;
  opacity: 0.75;
}

.tooltip:hover .tooltiptext {
}
.tooltip .tooltiptext::after {
  content: " ";
  position: absolute;
  top: 100%; /* At the bottom of the tooltip */
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: #ef4823 transparent transparent transparent;
}

@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(10px); /* Adjust the bounce height as needed */
  }
}

.modal {
  display: block;
  width: 100%;
  height: 100%;
  position: fixed;
  background-color: rgba(0, 0, 0, 0.9);
  z-index: 100;
}

.modal .panel {
  position: relative;
  width: 80vmin;
  height: 80%;
  margin: 10vmin auto;
  background-image: linear-gradient(0deg, #8b8986 0%, #414141 36%, #414141 92%, #515151 100%);
  border-radius: 20px;
}

.modal .actions {
  position: absolute;
  display: block;
  width: 100%;
  height: 100px;
  bottom: 0;
  text-align: center;
}

.actions button {
  display: inline-block;
  width: 35%;
  border-radius: 10px;
  box-sizing: border-box;
  font-size: 0.8rem;
  border-radius: 20rpx;
  padding: 0.4rem 1.5rem;
}

button.service {
  margin-right: 0.5rem;
  border: 1px solid #676767;
  background-color: #858585;
  color: #a7a7a7;
}

button.back {
  border: 1px solid rgba(239, 72, 35, 0.7);
  color: rgba(239, 72, 35, 0.7);
  margin-left: 0.5rem;
}

button.back img.return {
  width: 10px;
  height: 10px;
}

.serviceqr {
  position: relative;
  width: 100%;
  padding-top: 80px;
}

.serviceqr .imgbox {
  display: block;
  margin: auto;
  width: 60vmin;
  height: 60vmin;
  padding: 3vmin;
  background-color: #eee;
  border-radius: 10px;
}

.serviceqr .title {
  position: absolute;
  display: inline-block;
  width: 100%;
  color: #eee;
  margin: 30px auto;
  text-align: center;
  padding: 0;
}

.serviceqr img {
  width: 100%;
  height: 100%;
}

.verifyfailed {
  text-align: center;
  color: #eee;
}

.verifyfailed .title {
  font-size: 1.1rem;
}

.verifyfailed .hints {
  margin-top: 80px;
  color: #ccc;
}

.verifyfailed .hints div {
  margin-bottom: 0.3rem;
}

.verifyfailed .circle {
  height: 20vmin;
  width: 20vmin;
  color: #666;
  font-size: 15vmin;
  margin: 10vmin auto 1rem;;
  background-color: #ddd;
  border-radius: 50%;
  display: inline-block;
}

.verifyspin {
  position: absolute;
  overflow: hidden;
  z-index: 101;
  width: 100vmin;
  height: 100vmax;
  background-color: rgba(0, 0, 0, 0.9);
}

.verifyspin .spinner {
  position: absolute; /* Position the image absolutely */
  width: 100vmin;
  height: 100vmin;
  margin: 0 auto;
  text-align: center;
  display: block;
}

.verifyspin img {
  display: block;
  width: 100%;
  height: 100%;
}

.spin-and-shrink {
    animation: spin-and-shrink 3s linear forwards;
}

@keyframes spin-and-shrink {
  0% {
    transform: rotate(-90deg) scale(5.5)
  }
  10% {
    transform: rotate(0deg) scale(2.0)
  }
  33% {
    transform: rotate(90deg) scale(1.0);
  }
  66% {
    transform: rotate(2000deg) scale(0.5);
  }
  99% {
    transform: rotate(3600deg) scale(0.2);
  }
  100% {
    transform: rotate(3600deg) scale(0.2);
  }
}

.spin-only {
    animation: spin-only 0.3s linear infinite;
}

@keyframes spin-only {
  0% {
    transform: rotate(0deg) scale(0.2);
  }
  100% {
    transform: rotate(360deg) scale(0.2);
  }
}

.verifyspin .loading {
  color: #ccc;
  font-size: 1.4rem;
  display: block;
  width: 100%;
  margin: 110vmin auto;
  text-align: center;
}

div.scanguide {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

#hint {
  display: inline-block;
  margin: 10px auto;
  padding: 12px 40px;
  border-radius: 10px;
  background-color: rgba(0, 0, 0, 0.7);
  color: #eee;
  font-size: 20px;
}

div.qrarc {
  position: absolute;
  box-sizing: border-box;
  width: 46vw;
  height: 46vw;
  margin: 35vw 27vw;
  animation: qrarc-anime 1.2s ease-in-out infinite;
}

div.qrarc img.arc {
  position: absolute;
  width: 15%;
  height: 15%;
  opacity: 0.9;
  display: block;
}

div.qrarc img.arc.topright {
  right: 0;
  transform: rotate(90deg);
}

div.qrarc img.arc.bottomleft {
  bottom: 0;
  transform: rotate(-90deg);
}

div.qrarc img.arc.bottomright {
  bottom: 0;
  right: 0;
  transform: rotate(180deg);
}


@keyframes qrarc-anime {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}
