/* 滑块拼图行为验证码组件样式（品牌色点缀 + 玻璃拟态轻阴影 + 微动效） */
:root {
  --sc-accent: #c73e1d;
  --sc-accent-dark: #a33014;
  --sc-success: #67c23a;
  --sc-fail: #f56c6c;
}
.sc-wrap {
  width: 100%;
}

.sc-card {
  border: 1px solid #e6e8eb;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.08);
  padding: 12px;
  overflow: hidden;
}

.sc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.sc-title {
  font-size: 13px;
  font-weight: 600;
  color: #333;
}

.sc-refresh {
  border: none;
  background: #f3f4f6;
  color: var(--sc-accent);
  width: 28px;
  height: 28px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  transition: background 0.2s ease, transform 0.3s ease;
}
.sc-refresh:hover {
  background: #eceef0;
  transform: rotate(90deg);
}

.sc-imgwrap {
  position: relative;
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
  background: #f0f0f0;
  user-select: none;
}

.sc-bg {
  display: block;
  width: 100%;
  height: auto;
}

.sc-piece {
  position: absolute;
  top: 0;
  left: 0;
  cursor: grab;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.35));
  transition: filter 0.2s ease;
}
.sc-piece:active {
  cursor: grabbing;
}

.sc-loading {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.86);
  color: #666;
  font-size: 13px;
}

.sc-track {
  position: relative;
  height: 40px;
  margin-top: 10px;
  background: #f0f0f0;
  border: 1px solid #e2e4e8;
  border-radius: 8px;
  overflow: hidden;
  touch-action: none;
}

.sc-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 0;
  background: color-mix(in srgb, var(--sc-accent) 16%, transparent);
  border-right: 1px solid color-mix(in srgb, var(--sc-accent) 42%, transparent);
  transition: width 0s;
}

.sc-handle {
  position: absolute;
  left: 0;
  top: 0;
  width: 40px;
  height: 38px;
  background: #fff;
  border: 1px solid var(--sc-accent);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--sc-accent);
  font-size: 18px;
  cursor: grab;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
  user-select: none;
}
.sc-handle:active {
  cursor: grabbing;
}

.sc-arrow {
  pointer-events: none;
}

.sc-tip {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #909399;
  pointer-events: none;
}

/* 成功态 */
.sc-card.sc-success .sc-fill {
  background: rgba(103, 194, 58, 0.22);
  border-right-color: var(--sc-success);
}
.sc-card.sc-success .sc-handle {
  border-color: var(--sc-success);
  color: #fff;
  background: var(--sc-success);
}
.sc-card.sc-success .sc-arrow::before {
  content: '\2713';
}
.sc-card.sc-success .sc-tip,
.sc-card.sc-success .sc-arrow {
  color: #fff;
}
.sc-card.sc-success .sc-tip {
  background: rgba(103, 194, 58, 0.85);
  color: #fff;
  content: '验证通过';
}
.sc-card.sc-success .sc-tip::after {
  content: '验证通过';
}

/* 失败态 */
.sc-card.sc-fail .sc-fill {
  background: rgba(245, 108, 108, 0.22);
  border-right-color: var(--sc-fail);
}
.sc-card.sc-fail .sc-handle {
  border-color: var(--sc-fail);
  color: var(--sc-fail);
}
.sc-card.sc-fail .sc-tip {
  color: var(--sc-fail);
}
.sc-card.sc-fail {
  animation: sc-shake 0.4s ease;
}

@keyframes sc-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

.sc-handle.sc-loading-spin {
  pointer-events: none;
  opacity: 0.8;
}
.sc-handle.sc-loading-spin .sc-arrow {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid var(--sc-accent);
  border-top-color: transparent;
  border-radius: 50%;
  animation: sc-spin 0.7s linear infinite;
}
.sc-handle.sc-loading-spin .sc-arrow::before {
  content: '';
}

@keyframes sc-spin {
  to { transform: rotate(360deg); }
}

/* ===== 滑块验证弹层（延迟校验）===== */
.sc-modal-mask {
  --sc-accent: #c73e1d;
  --sc-accent-dark: #a33014;
  --sc-success: #67c23a;
  --sc-fail: #f56c6c;
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.sc-modal-mask.sc-show {
  display: flex;
  opacity: 1;
}

.sc-modal {
  width: min(360px, 92vw);
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 14px;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.28);
  padding: 18px 18px 20px;
  transform: translateY(12px) scale(0.98);
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}
.sc-modal-mask.sc-show .sc-modal {
  transform: translateY(0) scale(1);
}

.sc-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.sc-modal-title {
  position: relative;
  padding-left: 12px;
  font-size: 15px;
  font-weight: 600;
  color: #333;
}
.sc-modal-title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 14px;
  border-radius: 2px;
  background: var(--sc-accent);
}
.sc-modal-close {
  border: none;
  background: #f1f2f4;
  color: #888;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}
.sc-modal-close:hover {
  background: #e6e8eb;
  color: #555;
}
.sc-modal-body {
  width: 100%;
}
