/**
 * 龙虾PRO · 拼图滑块验证 · 赛博朋克弹窗
 * 强制深色霓虹风格，不随登录页浅色主题变白。
 */

/* ========== 组件本体 ========== */
.lx-csl {
  --csl-w: 100%;
  --csl-max: 340px;
  --csl-radius: 4px;
  --cx-cyan: #00fff0;
  --cx-pink: #ff2bd6;
  --cx-purple: #8b5cff;
  --cx-ok: #39ff88;
  --cx-err: #ff4d6d;
  --cx-bg: #070b14;
  --cx-panel: rgba(8, 14, 28, 0.92);
  --cx-line: rgba(0, 255, 240, 0.35);
  --cx-text: #e8f7ff;
  --cx-muted: #7a93ad;
  width: var(--csl-w);
  max-width: var(--csl-max);
  margin: 0 auto;
  font-family: "Noto Sans SC", "Segoe UI", system-ui, sans-serif;
  font-size: 13px;
  color: var(--cx-text);
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}
.lx-csl *,
.lx-csl *::before,
.lx-csl *::after {
  box-sizing: border-box;
}

.lx-csl__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.lx-csl__head-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.lx-csl__head-kicker {
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--cx-cyan);
  opacity: 0.85;
  font-weight: 700;
}
.lx-csl__head strong {
  font-size: 14px;
  font-weight: 800;
  color: var(--cx-text);
  letter-spacing: 0.04em;
}
.lx-csl__refresh {
  flex-shrink: 0;
  border: 1px solid rgba(0, 255, 240, 0.35);
  background: rgba(0, 255, 240, 0.08);
  color: var(--cx-cyan);
  width: 40px;
  height: 40px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  box-shadow: 0 0 12px rgba(0, 255, 240, 0.15);
  transition: background 0.15s, box-shadow 0.15s, transform 0.15s;
}
.lx-csl__refresh:hover {
  background: rgba(0, 255, 240, 0.18);
  box-shadow: 0 0 18px rgba(0, 255, 240, 0.35);
  transform: rotate(-20deg);
}

/* 拼图舞台 */
.lx-csl__stage-wrap {
  position: relative;
  padding: 2px;
  border-radius: 6px;
  background: linear-gradient(135deg, rgba(0, 255, 240, 0.55), rgba(255, 43, 214, 0.35), rgba(139, 92, 255, 0.45));
  box-shadow:
    0 0 0 1px rgba(0, 255, 240, 0.2),
    0 0 28px rgba(0, 255, 240, 0.12),
    inset 0 0 20px rgba(0, 0, 0, 0.35);
}
.lx-csl__stage {
  position: relative;
  width: 100%;
  min-height: 160px;
  border-radius: 4px;
  overflow: hidden;
  background: #0a1020;
}
.lx-csl__stage::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(0, 255, 240, 0.04) 50%,
    transparent 100%
  );
  background-size: 100% 8px;
  opacity: 0.5;
  animation: lx-csl-scan 4s linear infinite;
  z-index: 2;
}
@keyframes lx-csl-scan {
  0% { background-position: 0 0; }
  100% { background-position: 0 80px; }
}
.lx-csl__bg {
  display: block;
  width: 100%;
  height: auto;
  min-height: 160px;
  object-fit: cover;
  vertical-align: top;
  pointer-events: none;
}
.lx-csl__piece {
  position: absolute;
  left: 0;
  top: 0;
  width: 52px;
  height: 52px;
  pointer-events: none;
  z-index: 3;
  filter:
    drop-shadow(0 0 6px rgba(0, 255, 240, 0.65))
    drop-shadow(0 4px 12px rgba(0, 0, 0, 0.55));
  transition: filter 0.15s ease;
}
.lx-csl__piece.is-ok {
  filter:
    drop-shadow(0 0 10px rgba(57, 255, 136, 0.9))
    drop-shadow(0 4px 12px rgba(0, 0, 0, 0.4));
}

/* —— 滑轨（核心拖动区，始终大而醒目） —— */
.lx-csl__track-label {
  margin: 14px 0 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cx-muted);
}
.lx-csl__track-label span {
  color: var(--cx-cyan);
  font-weight: 700;
}
.lx-csl__track {
  position: relative;
  height: 56px;
  border-radius: 6px;
  background:
    linear-gradient(90deg, rgba(0, 255, 240, 0.06), rgba(139, 92, 255, 0.08)),
    repeating-linear-gradient(
      90deg,
      rgba(0, 255, 240, 0.07) 0 1px,
      transparent 1px 12px
    ),
    #0a1220;
  border: 1px solid rgba(0, 255, 240, 0.45);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.5) inset,
    0 0 20px rgba(0, 255, 240, 0.12),
    0 8px 24px rgba(0, 0, 0, 0.35);
  overflow: visible;
}
.lx-csl__track[hidden] {
  display: none !important;
}
.lx-csl__track-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  border-radius: 5px 0 0 5px;
  background: linear-gradient(
    90deg,
    rgba(0, 255, 240, 0.15),
    rgba(255, 43, 214, 0.35),
    rgba(0, 255, 240, 0.45)
  );
  box-shadow: 0 0 16px rgba(0, 255, 240, 0.35);
  pointer-events: none;
  z-index: 1;
}
.lx-csl__track-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: rgba(232, 247, 255, 0.72);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  pointer-events: none;
  z-index: 2;
  text-shadow: 0 0 12px rgba(0, 255, 240, 0.35);
  transition: opacity 0.2s;
  padding-left: 48px;
  padding-right: 12px;
}
.lx-csl__track-text i {
  display: inline-block;
  color: var(--cx-cyan);
  animation: lx-csl-chevron 1.1s ease-in-out infinite;
}
@keyframes lx-csl-chevron {
  0%, 100% { transform: translateX(0); opacity: 0.5; }
  50% { transform: translateX(6px); opacity: 1; }
}
.lx-csl.is-dragging .lx-csl__track-text,
.lx-csl.is-ok .lx-csl__track-text {
  opacity: 0;
}

/* 手柄：超大、高对比、必见 */
.lx-csl__handle {
  position: absolute;
  left: 3px;
  top: 3px;
  width: 50px;
  height: 50px;
  border: 0;
  border-radius: 5px;
  cursor: grab;
  z-index: 5;
  display: grid;
  place-items: center;
  font-size: 22px;
  font-weight: 900;
  color: #041018;
  background: linear-gradient(145deg, #00fff0 0%, #38bdf8 45%, #8b5cff 100%);
  box-shadow:
    0 0 0 2px rgba(0, 255, 240, 0.5),
    0 0 22px rgba(0, 255, 240, 0.55),
    0 6px 18px rgba(0, 0, 0, 0.45);
  transition: box-shadow 0.15s, transform 0.1s, background 0.2s;
  touch-action: none;
}
.lx-csl__handle:hover {
  box-shadow:
    0 0 0 2px rgba(0, 255, 240, 0.8),
    0 0 28px rgba(0, 255, 240, 0.75),
    0 6px 18px rgba(0, 0, 0, 0.45);
}
.lx-csl__handle:active,
.lx-csl.is-dragging .lx-csl__handle {
  cursor: grabbing;
  transform: scale(1.04);
}
.lx-csl.is-ok .lx-csl__handle {
  background: linear-gradient(145deg, #39ff88, #00c853);
  box-shadow:
    0 0 0 2px rgba(57, 255, 136, 0.6),
    0 0 24px rgba(57, 255, 136, 0.55);
}
.lx-csl.is-ok .lx-csl__track-fill {
  background: linear-gradient(90deg, rgba(57, 255, 136, 0.25), rgba(57, 255, 136, 0.55));
}
.lx-csl.is-err .lx-csl__handle {
  background: linear-gradient(145deg, #ff4d6d, #c9184a);
  animation: lx-csl-shake 0.4s ease;
}
@keyframes lx-csl-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-5px); }
  40% { transform: translateX(5px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(3px); }
}

.lx-csl__status {
  min-height: 22px;
  margin: 12px 0 0;
  font-size: 12px;
  color: var(--cx-muted);
  text-align: center;
  letter-spacing: 0.04em;
}
.lx-csl__status.is-ok {
  color: var(--cx-ok);
  font-weight: 800;
  text-shadow: 0 0 12px rgba(57, 255, 136, 0.45);
}
.lx-csl__status.is-err {
  color: var(--cx-err);
  font-weight: 700;
}

.lx-csl__loading {
  display: grid;
  place-items: center;
  min-height: 160px;
  color: var(--cx-muted);
  font-size: 13px;
  gap: 12px;
  letter-spacing: 0.08em;
}
.lx-csl__spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(0, 255, 240, 0.18);
  border-top-color: var(--cx-cyan);
  border-radius: 50%;
  box-shadow: 0 0 16px rgba(0, 255, 240, 0.35);
  animation: lx-csl-spin 0.7s linear infinite;
}
@keyframes lx-csl-spin {
  to { transform: rotate(360deg); }
}

/* ========== 赛博朋克弹窗 ========== */
.lx-csl-modal {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}
.lx-csl-modal.is-show {
  opacity: 1;
  visibility: visible;
}
.lx-csl-modal__backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 40%, rgba(0, 255, 240, 0.08), transparent 55%),
    radial-gradient(ellipse 60% 50% at 80% 80%, rgba(255, 43, 214, 0.1), transparent 50%),
    rgba(2, 4, 12, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.lx-csl-modal__panel {
  position: relative;
  z-index: 1;
  width: min(400px, 100%);
  max-height: min(92vh, 640px);
  overflow: auto;
  border-radius: 8px;
  /* 强制深色，忽略页面浅色 */
  background:
    linear-gradient(165deg, rgba(12, 18, 36, 0.98) 0%, rgba(6, 10, 22, 0.99) 100%) !important;
  border: 1px solid rgba(0, 255, 240, 0.4) !important;
  box-shadow:
    0 0 0 1px rgba(255, 43, 214, 0.15),
    0 0 40px rgba(0, 255, 240, 0.18),
    0 24px 64px rgba(0, 0, 0, 0.65) !important;
  padding: 0;
  transform: translateY(14px) scale(0.96);
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
  color: #e8f7ff !important;
}
.lx-csl-modal.is-show .lx-csl-modal__panel {
  transform: translateY(0) scale(1);
}

/* 四角装饰 */
.lx-csl-modal__panel::before,
.lx-csl-modal__panel::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  pointer-events: none;
  z-index: 3;
}
.lx-csl-modal__panel::before {
  top: 6px;
  left: 6px;
  border-top: 2px solid #00fff0;
  border-left: 2px solid #00fff0;
  box-shadow: -2px -2px 12px rgba(0, 255, 240, 0.4);
}
.lx-csl-modal__panel::after {
  bottom: 6px;
  right: 6px;
  border-bottom: 2px solid #ff2bd6;
  border-right: 2px solid #ff2bd6;
  box-shadow: 2px 2px 12px rgba(255, 43, 214, 0.35);
}

.lx-csl-modal__bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 16px 12px;
  border-bottom: 1px solid rgba(0, 255, 240, 0.15);
  background: linear-gradient(180deg, rgba(0, 255, 240, 0.06), transparent);
}
.lx-csl-modal__titles {
  min-width: 0;
}
.lx-csl-modal__badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.28em;
  color: #00fff0;
  margin-bottom: 4px;
  text-shadow: 0 0 10px rgba(0, 255, 240, 0.5);
}
.lx-csl-modal__title {
  display: block;
  font-size: 17px;
  font-weight: 900;
  color: #f1f5f9 !important;
  letter-spacing: 0.06em;
  line-height: 1.3;
}
.lx-csl-modal__sub {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: #7a93ad !important;
  line-height: 1.45;
}
.lx-csl-modal__x {
  flex-shrink: 0;
  border: 1px solid rgba(255, 43, 214, 0.35);
  background: rgba(255, 43, 214, 0.1);
  color: #ff9ed8 !important;
  width: 36px;
  height: 36px;
  border-radius: 4px;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.15s, box-shadow 0.15s;
}
.lx-csl-modal__x:hover {
  background: rgba(255, 43, 214, 0.25);
  box-shadow: 0 0 16px rgba(255, 43, 214, 0.35);
  color: #fff !important;
}

.lx-csl-modal__body {
  padding: 16px 16px 8px;
  display: block;
}
.lx-csl-modal__body .lx-csl {
  margin: 0;
  width: 100%;
  max-width: none;
}

.lx-csl-modal__foot {
  padding: 8px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
}
.lx-csl-modal__tips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  justify-content: center;
  font-size: 11px;
  color: #7a93ad;
}
.lx-csl-modal__tips em {
  font-style: normal;
  color: #00fff0;
  font-weight: 700;
}
.lx-csl-modal__cancel {
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: transparent;
  color: #94a3b8;
  height: 40px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.lx-csl-modal__cancel:hover {
  border-color: rgba(255, 43, 214, 0.4);
  color: #ff9ed8;
  background: rgba(255, 43, 214, 0.06);
}

body.lx-csl-modal-open {
  overflow: hidden !important;
}

/* 覆盖「浅色登录页」旧规则：弹窗永远赛博深色 */
body:not(.lx-dark) .lx-csl-modal__panel,
.lx-client-form ~ .lx-csl-modal .lx-csl-modal__panel,
body:not(.lx-dark) .lx-csl-modal .lx-csl {
  --csl-panel: rgba(8, 14, 28, 0.92) !important;
  --csl-line: rgba(0, 255, 240, 0.35) !important;
  --csl-text: #e8f7ff !important;
  --csl-muted: #7a93ad !important;
}
body:not(.lx-dark) .lx-csl-modal__title {
  color: #f1f5f9 !important;
}
body:not(.lx-dark) .lx-csl-modal .lx-csl__stage {
  background: #0a1020 !important;
}

/* 移动端加大可点区域 */
@media (max-width: 480px) {
  .lx-csl__track {
    height: 60px;
  }
  .lx-csl__handle {
    width: 54px;
    height: 54px;
    font-size: 24px;
  }
  .lx-csl-modal__panel {
    width: 100%;
  }
}
