/* =========================================================================
   slider-skin.css — SliderCaptcha 外观皮肤
   仅覆盖视觉与触摸行为，不改变组件 DOM 结构与定位骨架。
   关键约束（来自 vendor/longbow.slidercaptcha.js 的硬编码）：
     - .slider        宽高固定 40px（拖拽算法按 40 计算）
     - .sliderbg/.sliderMask/.sliderContainer 高度固定 40px
     - #captcha 容器宽度由 JS 设为 options.width，canvas 为 width-2，禁止 CSS 缩放
   ========================================================================= */

#captcha {
  position: relative;
  /* 库会在 JS 里写死 style.width = options.width + 'px'，此处不覆盖 */
}

#captcha > canvas {
  display: block;
  border-radius: 12px;
  /* 严禁设置 width/height：canvas 位图必须 1:1 显示，否则拼图块与缺口错位 */
}

#captcha .block {
  position: absolute;
  left: 0;
  top: 0;
  filter: brightness(1.14) saturate(1.08) drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
  will-change: left;
}

/* ---------- 提示条 / 容器 ---------- */
.sliderContainer {
  position: relative;
  margin-top: 10px;
  height: 40px;
  line-height: 40px;
  text-align: center;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  overflow: hidden;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  transition: box-shadow 0.25s ease;
}

.sliderbg {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 40px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  box-sizing: border-box;
}

.sliderText {
  position: relative;
  z-index: 2;
  font-size: 13px;
  letter-spacing: 0.02em;
  color: rgba(226, 236, 255, 0.58);
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.sliderMask {
  position: absolute;
  left: 0;
  top: 0;
  height: 40px;
  width: 0;
  border: 0 solid transparent;
  border-radius: 10px 0 0 10px;
  background: linear-gradient(90deg, rgba(79, 140, 255, 0.30), rgba(34, 211, 238, 0.16));
  box-sizing: border-box;
}

/* ---------- 滑块把手 ---------- */
.slider {
  position: absolute;
  top: 0;
  left: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: linear-gradient(180deg, #f2f7ff, #cfdcf5);
  box-shadow:
    0 2px 6px rgba(3, 8, 20, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  cursor: grab;
  touch-action: none;
  z-index: 3;
  transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.12s ease;
}

.slider:active {
  cursor: grabbing;
  transform: scale(0.96);
}

.sliderIcon {
  display: block;
  width: 18px;
  height: 18px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 18px 18px;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%231b2b4d" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"><path d="M4 12h13"/><path d="M12 6l6 6-6 6"/></svg>');
}

/* ---------- 状态：拖动中 ---------- */
.sliderContainer_active .slider {
  background: linear-gradient(180deg, #fff, #dbe8ff);
  box-shadow:
    0 2px 10px rgba(79, 140, 255, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.sliderContainer_active .sliderMask {
  border-width: 1px 0 1px 1px;
  border-color: rgba(79, 140, 255, 0.85);
}

.sliderContainer_active .sliderText,
.sliderContainer_success .sliderText,
.sliderContainer_fail .sliderText {
  opacity: 0;
}

/* ---------- 状态：成功 ---------- */
.sliderContainer_success .slider {
  background: linear-gradient(180deg, #5ee7c3, #2bb894);
  box-shadow:
    0 2px 12px rgba(52, 211, 153, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.sliderContainer_success .sliderIcon {
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%23082a22" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"><path d="M5 13l4.5 4.5L19 7"/></svg>');
}

.sliderContainer_success .sliderMask {
  border-width: 1px 0 1px 1px;
  border-color: rgba(52, 211, 153, 0.8);
  background: rgba(52, 211, 153, 0.18);
}

/* ---------- 状态：失败 ---------- */
.sliderContainer_fail .slider {
  background: linear-gradient(180deg, #ff9b9b, #e5484d);
  box-shadow:
    0 2px 12px rgba(229, 72, 77, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.sliderContainer_fail .sliderIcon {
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%233b0709" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"><path d="M7 7l10 10"/><path d="M17 7L7 17"/></svg>');
}

.sliderContainer_fail .sliderMask {
  border-width: 1px 0 1px 1px;
  border-color: rgba(229, 72, 77, 0.75);
  background: rgba(229, 72, 77, 0.16);
}

.sliderContainer_fail {
  animation: sc-shake 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

@keyframes sc-shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(3px); }
  30%, 50%, 70% { transform: translateX(-5px); }
  40%, 60% { transform: translateX(5px); }
}

/* ---------- 刷新按钮（库内为 <i class="refreshIcon">） ---------- */
.refreshIcon {
  position: absolute;
  right: 8px;
  top: 8px;
  width: 28px;
  height: 28px;
  margin: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 8px;
  background: rgba(6, 12, 28, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(6px);
  transition: background 0.2s ease, transform 0.25s ease;
}

.refreshIcon::before {
  content: "";
  display: block;
  width: 14px;
  height: 14px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 14px 14px;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%23dbe7ff" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 12a9 9 0 1 1-3.2-6.9"/><path d="M21 4v5h-5"/></svg>');
}

.refreshIcon:hover {
  background: rgba(30, 48, 86, 0.85);
}

.refreshIcon:active {
  transform: rotate(-90deg);
}

/* 组件内的 text-danger（加载失败提示） */
.sliderContainer .text-danger {
  color: #ff8080;
}
