/* ============================================================
   xy-captcha 滑块验证码（三站共用样式）
   品牌色由各站 style.css 覆盖 --xy-brand 变量
   ============================================================ */
.xy-captcha {
  --xy-brand: #2563eb;             /* 兜底品牌色（各站覆盖） */
  --xy-line: #e2e8f0;
  --xy-track: #f1f5f9;
  --xy-ink: #64748b;
  margin: 4px 0 2px;
  user-select: none;
  -webkit-user-select: none;
}
[data-theme="dark"] .xy-captcha {
  --xy-line: #3b4657;
  --xy-track: #232b38;
  --xy-ink: #94a3b8;
}

/* 背景画布：320x150 设计比例，自适应卡片宽度 */
.xy-canvas {
  position: relative;
  width: 100%;
  aspect-ratio: 320 / 150;
  border-radius: 10px;
  overflow: hidden;
  background: #0a1730;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08);
}
.xy-canvas img { pointer-events: none; }
.xy-canvas img.xy-bg { position: absolute; inset: 0; width: 100%; height: 100%; }
.xy-canvas img.xy-piece {
  position: absolute; left: 0; top: 0;
  cursor: grab;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, .45));
  pointer-events: auto;             /* 拼图块可直拖 */
}

/* 换一张 */
.xy-refresh {
  position: absolute; top: 7px; right: 7px; z-index: 3;
  width: 28px; height: 28px; border-radius: 50%;
  border: none; cursor: pointer; padding: 0;
  background: rgba(10, 23, 48, .55); color: #fff;
  font-size: 15px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: transform .4s ease, background .2s;
}
.xy-refresh:hover { background: rgba(10, 23, 48, .8); }
.xy-refresh.busy { transform: rotate(360deg); }

/* 滑轨 + 手柄 */
.xy-slider {
  position: relative;
  margin-top: 10px; height: 44px;
  border-radius: 10px;
  background: var(--xy-track);
  box-shadow: inset 0 0 0 1px var(--xy-line);
  overflow: hidden;
  touch-action: none;
}
.xy-slider-hint {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; letter-spacing: 1px; color: var(--xy-ink);
  opacity: 1; transition: opacity .15s;
  pointer-events: none;
}
.xy-slider.moved .xy-slider-hint { opacity: 0; }
.xy-handle {
  position: absolute; top: 3px; left: 3px;
  width: 52px; height: 38px; border-radius: 7px;
  background: var(--xy-brand); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; letter-spacing: 2px;
  cursor: grab; touch-action: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .25);
}
.xy-handle:active { cursor: grabbing; }
.xy-handle:focus-visible { outline: 2px solid var(--xy-brand); outline-offset: 2px; }

/* ============================================================
   弹窗模式：验证码承载于 <dialog>（居中/卡片底色由各站 style.css 提供）
   ============================================================ */
.xy-dialog { padding: 18px 16px 14px; }
.xy-dialog-head {
  display: flex; align-items: center; justify-content: space-between;
  margin: 0 0 12px; font-size: 15px; font-weight: 600; color: var(--xy-ink);
}
.xy-dialog-close {
  border: none; background: none; cursor: pointer; padding: 2px 6px;
  font-size: 15px; line-height: 1; color: var(--xy-ink);
}
.xy-dialog-close:hover { color: var(--xy-brand); }
.xy-dialog .xy-captcha { margin: 0; }
