/* 人机验证弹窗 */
.verify-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom));
  background: rgba(4, 15, 10, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-sizing: border-box;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.verify-overlay[hidden] {
  display: none !important;
}

.verify-modal {
  width: min(100%, 420px);
  max-width: 100%;
  max-height: min(92dvh, calc(100vh - 24px));
  overflow: auto;
  border-radius: 22px;
  background: linear-gradient(165deg, #123528 0%, #0a2118 100%);
  border: 1px solid rgba(141, 255, 122, 0.22);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  animation: verifyPop 0.35s ease;
  box-sizing: border-box;
}

@keyframes verifyPop {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.verify-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 20px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.verify-head h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

.verify-head p {
  margin: 6px 0 0;
  color: rgba(242, 247, 243, 0.62);
  font-size: 13px;
}

.verify-close {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(242, 247, 243, 0.8);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}

.verify-body {
  padding: 16px 20px 20px;
}

.verify-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  font-size: 12px;
  color: rgba(242, 247, 243, 0.65);
}

.verify-progress-bar {
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.verify-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #3fbf55, #8dff7a);
  border-radius: 999px;
  transition: width 0.35s ease;
}

.verify-prompt {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(141, 255, 122, 0.08);
  border: 1px solid rgba(141, 255, 122, 0.18);
  font-size: 14px;
  line-height: 1.5;
}

.verify-prompt strong {
  color: #8dff7a;
}

.verify-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.verify-tile {
  position: relative;
  aspect-ratio: 1;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.04);
  transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s;
}

.verify-tile:hover {
  transform: scale(1.02);
}

.verify-tile.selected {
  border-color: #8dff7a;
  box-shadow: 0 0 0 1px rgba(141, 255, 122, 0.35);
}

.verify-tile.selected::after {
  content: "✓";
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #8dff7a;
  color: #062012;
  font-size: 13px;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.verify-tile img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 14px;
  pointer-events: none;
}

.verify-tile.is-photo img {
  object-fit: cover;
  padding: 0;
}

.verify-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 14px 0 12px;
  font-size: 12px;
  color: rgba(242, 247, 243, 0.55);
}

.verify-error {
  min-height: 20px;
  margin-bottom: 10px;
  color: #ff8a8a;
  font-size: 13px;
}

.verify-actions {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 10px;
}

.verify-btn {
  min-height: 46px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: #f2f7f3;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.verify-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.verify-btn-primary {
  background: #8dff7a;
  color: #062012;
  border-color: transparent;
}

.verify-success {
  text-align: center;
  padding: 36px 24px 28px;
}

.verify-success-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: rgba(141, 255, 122, 0.15);
  color: #8dff7a;
  font-size: 32px;
  line-height: 64px;
}

.verify-success h3 {
  margin: 0 0 8px;
  font-size: 20px;
}

.verify-success p {
  margin: 0;
  color: rgba(242, 247, 243, 0.65);
  font-size: 14px;
}

.verify-loading {
  display: inline-block;
  width: 18px;
  height: 18px;
  margin-left: 8px;
  border: 2px solid rgba(6, 32, 18, 0.2);
  border-top-color: #062012;
  border-radius: 50%;
  animation: verifySpin 0.8s linear infinite;
  vertical-align: middle;
}

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

@media (max-width: 768px) {
  .verify-overlay {
    align-items: flex-end;
    padding: 0;
  }

  .verify-modal {
    width: 100%;
    max-width: 100%;
    max-height: min(94dvh, 100%);
    border-radius: 20px 20px 0 0;
    border-left: none;
    border-right: none;
    border-bottom: none;
  }

  .verify-head {
    padding: 16px 16px 10px;
    position: sticky;
    top: 0;
    z-index: 2;
    background: linear-gradient(165deg, #123528 0%, #0f2c20 100%);
  }

  .verify-head h3 {
    font-size: 17px;
  }

  .verify-head p {
    font-size: 12px;
  }

  .verify-body {
    padding: 12px 16px calc(16px + env(safe-area-inset-bottom));
  }

  .verify-prompt {
    font-size: 13px;
    padding: 10px 12px;
    margin-bottom: 12px;
  }

  .verify-grid {
    gap: 6px;
  }

  .verify-tile {
    border-radius: 12px;
  }

  .verify-tile img {
    padding: 10px;
  }

  .verify-tile.selected::after {
    width: 18px;
    height: 18px;
    font-size: 11px;
    top: 4px;
    right: 4px;
  }

  .verify-actions {
    grid-template-columns: 1fr 1.5fr;
    gap: 8px;
    position: sticky;
    bottom: 0;
    padding-top: 8px;
    background: linear-gradient(180deg, transparent, #0a2118 28%);
  }

  .verify-btn {
    min-height: 44px;
    font-size: 14px;
  }

  .verify-success {
    padding: 28px 20px calc(24px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 380px) {
  .verify-grid {
    gap: 5px;
  }

  .verify-tile img {
    padding: 8px;
  }

  .verify-meta {
    flex-wrap: wrap;
    gap: 4px;
  }
}

@media (max-height: 700px) and (max-width: 768px) {
  .verify-tile img {
    padding: 6px;
  }

  .verify-prompt {
    margin-bottom: 8px;
  }

  .verify-meta {
    margin: 10px 0 8px;
  }
}
