/* 人机验证滑动拼图弹窗 */
.captcha-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: captcha-fade-in 0.18s ease;
}

@keyframes captcha-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.captcha-modal {
  background: #ffffff;
  border-radius: 12px;
  width: 340px;
  max-width: 92vw;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.22);
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", sans-serif;
  animation: captcha-pop-in 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes captcha-pop-in {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.captcha-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid #f0f0f0;
}

.captcha-modal-title {
  font-size: 15px;
  font-weight: 600;
  color: #1f2329;
}

.captcha-modal-close {
  background: none;
  border: none;
  font-size: 22px;
  color: #8a8f99;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  border-radius: 4px;
}

.captcha-modal-close:hover {
  color: #1f2329;
  background: #f2f3f5;
}

.captcha-modal-body {
  padding: 16px 18px 8px;
}

.captcha-hint {
  font-size: 13px;
  color: #646a73;
  margin-bottom: 10px;
  transition: color 0.2s;
}

.captcha-hint.success {
  color: #00b42d;
}

.captcha-hint.error {
  color: #f53f3f;
}

.captcha-canvas-wrap {
  position: relative;
  width: 300px;
  height: 160px;
  border-radius: 6px;
  overflow: hidden;
  background: #f5f5f5;
  margin: 0 auto;
}

.captcha-bg {
  display: block;
  width: 300px;
  height: 160px;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

.captcha-slider-img {
  position: absolute;
  /* top 由 JS 根据 sliderY 设置，确保与缺口 y 方向对齐 */
  top: 0;
  left: 0;
  width: 44px;
  height: 44px;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.35));
  will-change: transform, left;
}

.captcha-success-mask {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.86);
  display: none;
  align-items: center;
  justify-content: center;
}

.captcha-success-mask.show {
  display: flex;
}

.captcha-success-mask svg {
  width: 52px;
  height: 52px;
}

.captcha-success-mask circle {
  stroke: #00b42d;
  stroke-width: 2;
  fill: none;
  stroke-dasharray: 157;
  animation: captcha-circle 0.4s ease forwards;
}

.captcha-success-mask path {
  stroke: #00b42d;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  stroke-dasharray: 40;
  stroke-dashoffset: 40;
  animation: captcha-check 0.3s 0.25s ease forwards;
}

@keyframes captcha-circle {
  from { stroke-dashoffset: 157; }
  to { stroke-dashoffset: 0; }
}

@keyframes captcha-check {
  to { stroke-dashoffset: 0; }
}

.captcha-slider-track {
  position: relative;
  width: 300px;
  height: 40px;
  margin: 12px auto 0;
  background: #f2f3f5;
  border-radius: 20px;
  overflow: hidden;
}

.captcha-slider-progress {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 36px;
  background: linear-gradient(90deg, #d1ebff, #bedaff);
  border-radius: 20px;
  transition: background 0.2s;
}

.captcha-slider-handle {
  position: absolute;
  top: 2px;
  left: 0;
  width: 36px;
  height: 36px;
  background: #ffffff;
  border: 1px solid #e5e6eb;
  border-radius: 50%;
  cursor: grab;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  z-index: 2;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

.captcha-slider-handle:active {
  cursor: grabbing;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

.captcha-slider-handle svg {
  width: 18px;
  height: 18px;
  color: #4e5969;
}

.captcha-slider-placeholder {
  position: absolute;
  left: 0;
  right: 0;
  text-align: center;
  line-height: 40px;
  font-size: 12px;
  color: #86909c;
  pointer-events: none;
  z-index: 1;
  transition: opacity 0.15s;
}

.captcha-error {
  font-size: 12px;
  color: #f53f3f;
  margin-top: 8px;
  min-height: 16px;
  text-align: center;
}

.captcha-modal-footer {
  padding: 4px 18px 14px;
  text-align: right;
}

.captcha-btn-refresh {
  background: none;
  border: none;
  color: #4e5969;
  font-size: 13px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
}

.captcha-btn-refresh:hover {
  color: #1f2329;
  background: #f2f3f5;
}
