/* ============================================================
   jigsaw.css - 滑块拼图验证码弹窗样式（组件 DOM 由 js/jigsaw.js 自动创建）
   ============================================================ */
.jigsaw-mask {
  position: fixed;
  inset: 0;
  z-index: 200; /* 高于注册弹窗(100) */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  background: rgba(15, 32, 60, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, visibility 0.25s;
}
.jigsaw-mask.open {
  opacity: 1;
  visibility: visible;
}
.jigsaw-box {
  width: 342px; /* 310 图宽 + 16*2 内边距，实际宽度由 js 按图片尺寸设置 */
  max-width: 100%;
  padding: 16px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 24px 64px rgba(10, 30, 60, 0.28);
  transform: translateY(10px) scale(0.98);
  transition: transform 0.25s;
}
.jigsaw-mask.open .jigsaw-box {
  transform: none;
}

/* 头部：标题 + 刷新/关闭 */
.jigsaw-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.jigsaw-title {
  font-size: 15px;
  font-weight: 600;
  color: #333;
}
.jigsaw-tools {
  display: flex;
  align-items: center;
  gap: 2px;
}
.jigsaw-tool {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #999;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.jigsaw-tool:hover {
  background: rgba(0, 0, 0, 0.06);
  color: #333;
}
.jigsaw-tool img {
  width: 16px;
  height: 16px;
  display: block;
}

/* 图片区：大图 + 拼图块 */
.jigsaw-img-wrap {
  position: relative;
  width: 310px;
  max-width: 100%;
  height: 155px;
  border-radius: 6px;
  overflow: hidden;
  background: #f5f7fa;
}
.jigsaw-img-wrap img {
  position: absolute;
  left: 0;
  top: 0;
  display: block;
}
.jigsaw-big {
  width: 100%;
  height: auto;
}
.jigsaw-piece {
  z-index: 2;
  width: 55px;
  height: auto;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.25));
}
.jigsaw-loading {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(245, 247, 250, 0.88);
  color: #999;
  font-size: 13px;
}
.jigsaw-img-wrap.loading .jigsaw-loading {
  display: flex;
}

/* 滑动条 */
.jigsaw-track {
  position: relative;
  height: 40px;
  margin-top: 12px;
  border-radius: 20px;
  background: #f5f7fa;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}
.jigsaw-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 40px;
  background: rgba(64, 128, 255, 0.15);
}
.jigsaw-tip {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: #999;
  letter-spacing: 1px;
  pointer-events: none;
  transition: opacity 0.2s;
}
.jigsaw-handle {
  position: absolute;
  left: 0;
  top: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 2px 6px rgba(30, 90, 160, 0.25);
  cursor: grab;
  touch-action: none;
}
.jigsaw-handle:active {
  cursor: grabbing;
}
.jigsaw-handle img {
  width: 18px;
  height: 18px;
  display: block;
  pointer-events: none;
}
.jigsaw-handle.loading {
  opacity: 0.7;
  cursor: wait;
}

/* 手机端 */
@media (max-width: 480px) {
  .jigsaw-box {
    width: 100%;
  }
}
