/* ==================== 滑块验证码遮罩层 ==================== */
.captcha-mask {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.25s ease;
}

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

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.captcha-modal {
  background: var(--paper);
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  width: 360px;
  max-width: 92vw;
  overflow: hidden;
  animation: slideUp 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.captcha-header {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(212, 160, 74, 0.15);
  background: linear-gradient(90deg, rgba(212, 160, 74, 0.05), transparent);
}

.captcha-title {
  font-family: var(--font-title);
  font-size: 16px;
  color: var(--ink-deep);
  font-weight: 500;
  margin: 0;
}

.captcha-close {
  width: 28px;
  height: 28px;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--ink-muted);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  padding: 0;
}

.captcha-close:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--ink-deep);
}

.captcha-body {
  padding: 20px;
}

.captcha-canvas-wrap {
  position: relative;
  width: 320px;
  height: 160px;
  margin: 0 auto 16px;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
  background: #fff;
}

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

.captcha-slider-block {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  filter: drop-shadow(0 0 3px rgba(0, 0, 0, 0.35));
  transition: left 0.05s linear;
}

.captcha-slider-block.dragging {
  transition: none;
}

.captcha-tip {
  font-size: 13px;
  color: var(--ink-muted);
  text-align: center;
  margin-bottom: 14px;
  min-height: 20px;
}

.captcha-tip.success {
  color: #52c41a;
}

.captcha-tip.error {
  color: #ff4d4f;
}

.captcha-slider-track {
  position: relative;
  height: 42px;
  background: #f7f4ed;
  border: 1px solid #e8e0d0;
  border-radius: 4px;
  margin-bottom: 12px;
  overflow: hidden;
}

.captcha-slider-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, rgba(212, 160, 74, 0.2), rgba(212, 160, 74, 0.35));
  transition: width 0.05s linear;
}

.captcha-slider-fill.dragging {
  transition: none;
}

.captcha-slider-fill.success {
  background: linear-gradient(90deg, rgba(82, 196, 26, 0.25), rgba(82, 196, 26, 0.4));
}

.captcha-slider-fill.error {
  background: linear-gradient(90deg, rgba(255, 77, 79, 0.2), rgba(255, 77, 79, 0.35));
}

.captcha-slider-text {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: var(--ink-muted);
  user-select: none;
  pointer-events: none;
  letter-spacing: 1px;
}

.captcha-slider-btn {
  position: absolute;
  left: 0;
  top: 0;
  width: 42px;
  height: 40px;
  background: #fff;
  border: 1px solid #e8e0d0;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  cursor: grab;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
  transition: background 0.2s;
  z-index: 2;
}

.captcha-slider-btn:hover {
  background: var(--gold);
  color: #fff;
}

.captcha-slider-btn:active {
  cursor: grabbing;
}

.captcha-slider-btn.success {
  background: #52c41a;
  border-color: #52c41a;
  color: #fff;
}

.captcha-slider-btn.error {
  background: #ff4d4f;
  border-color: #ff4d4f;
  color: #fff;
}

.captcha-refresh {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 8px;
  border: none;
  background: none;
  color: var(--ink-muted);
  font-size: 13px;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s;
}

.captcha-refresh:hover {
  background: rgba(212, 160, 74, 0.08);
  color: var(--gold-deep);
}

.captcha-refresh svg {
  width: 14px;
  height: 14px;
}

/* 青花瓷主题适配 */
body.theme-porcelain .captcha-modal {
  background: var(--paper);
}

body.theme-porcelain .captcha-header {
  border-bottom-color: rgba(58, 100, 145, 0.2);
  background: linear-gradient(90deg, rgba(58, 100, 145, 0.08), transparent);
}

body.theme-porcelain .captcha-title {
  color: var(--ink);
}

body.theme-porcelain .captcha-slider-track {
  background: #f5f8fb;
  border-color: rgba(58, 100, 145, 0.25);
}

body.theme-porcelain .captcha-slider-fill {
  background: linear-gradient(90deg, rgba(58, 100, 145, 0.15), rgba(58, 100, 145, 0.3));
}

body.theme-porcelain .captcha-slider-fill.success {
  background: linear-gradient(90deg, rgba(82, 196, 26, 0.25), rgba(82, 196, 26, 0.4));
}

body.theme-porcelain .captcha-slider-btn {
  border-color: rgba(58, 100, 145, 0.25);
  color: var(--accent);
}

body.theme-porcelain .captcha-slider-btn:hover {
  background: var(--accent);
  color: #fff;
}

body.theme-porcelain .captcha-refresh:hover {
  background: rgba(58, 100, 145, 0.08);
  color: var(--accent);
}
