/* v2.32.70m: 滑动拼图验证码弹窗 (美化版 - 椭圆滑道 + T形拼图 + 苹果风格) */

/* 触发按钮 (Login 表单里) - 复用 .form-input 尺寸/字体, 仅覆盖底色和 cursor */
.captcha-trigger-btn {
    background: #f5f5f7;
    color: #1d1d1f;
    cursor: pointer;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.15s ease;
}
.captcha-trigger-btn:hover { background: #ececef; }
.captcha-trigger-btn:active { background: #e3e3e6; }
.captcha-trigger-btn.is-verified {
    background: rgba(52, 199, 89, 0.08);
    border-color: rgba(52, 199, 89, 0.5);
    color: #1f8a3c;
}
.captcha-trigger-btn.is-verified::before { content: '✓'; font-weight: bold; margin-right: 4px; }

/* 弹窗遮罩 */
.captcha-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: captchaFadeIn 0.2s ease;
}
.captcha-modal.is-open { display: flex; }
@keyframes captchaFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 弹窗内容 */
.captcha-modal-content {
    background: #fff;
    border-radius: 20px;
    padding: 22px 24px 20px;
    width: 360px;
    max-width: 92vw;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.25);
    animation: captchaSlideUp 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes captchaSlideUp {
    from { transform: translateY(20px) scale(0.95); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

.captcha-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.captcha-modal-title {
    font-size: 16px;
    font-weight: 600;
    color: #1d1d1f;
    margin: 0;
    letter-spacing: -0.2px;
}
.captcha-modal-close {
    background: #f5f5f7;
    border: none;
    width: 26px;
    height: 26px;
    border-radius: 13px;
    color: #86868b;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.captcha-modal-close:hover { background: #e8e8ed; color: #1d1d1f; }

/* 拼图区域 */
.captcha-puzzle-wrap {
    position: relative;
    margin-bottom: 14px;
    border-radius: 12px;
    overflow: hidden;
    background: #f5f5f7;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.04);
}
.captcha-puzzle-bg {
    display: block;
    width: 100%;
    height: auto;
    user-select: none;
    -webkit-user-drag: none;
}

/* v2.32.70m: 刷新按钮 - 在图片右上角, 圆形图标按钮 (取代文字按钮) */
.captcha-puzzle-refresh {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    border-radius: 16px;
    border: none;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
    color: #0071e3;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    z-index: 3;
}
.captcha-puzzle-refresh:hover {
    background: #fff;
    transform: scale(1.05);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.18);
}
.captcha-puzzle-refresh:active {
    transform: scale(0.95);
}
.captcha-puzzle-refresh svg {
    display: block;
}

/* 浮动滑块 (异形拼图块本体, 跟随拖动) - v2.32.70m fix-9: 大小 = puzzleSize + 2*tabSize = 50+28 = 78px */
.captcha-puzzle-slider {
    position: absolute;
    top: 0;
    left: 0;
    width: 78px;
    height: 78px;
    cursor: grab;
    z-index: 2;
    will-change: transform;
    pointer-events: none;
}
.captcha-puzzle-slider img {
    width: 100%;
    height: 100%;
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.3));  /* 3D 阴影 */
}

/* 拖动轨道 - 椭圆滑道 (网易风格) */
.captcha-track {
    position: relative;
    height: 40px;
    background: linear-gradient(180deg, #f8f8fb 0%, #ececf1 100%);
    border-radius: 20px;
    overflow: hidden;
    user-select: none;
    margin-bottom: 10px;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.06), inset 0 -1px 0 rgba(255, 255, 255, 0.5);
}
.captcha-track-bar { display: none; }

/* 滑块 (拇指) - 椭圆 + 渐变 + 阴影 */
.captcha-track-thumb {
    position: absolute;
    top: 4px;
    left: 4px;
    width: 56px;
    height: 32px;
    border-radius: 16px;
    background: linear-gradient(180deg, #ffffff 0%, #f0f0f3 100%);
    border: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.04);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    color: #0071e3;
    font-size: 16px;
    font-weight: bold;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
    z-index: 2;
}
.captcha-track-thumb:hover { box-shadow: 0 4px 10px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(0, 0, 0, 0.05); }
.captcha-track-thumb.is-dragging { cursor: grabbing; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18); }
.captcha-track-thumb.is-success {
    background: linear-gradient(180deg, #34c759 0%, #28a745 100%);
    color: #fff;
    box-shadow: 0 2px 6px rgba(52, 199, 89, 0.4);
}
.captcha-track-thumb.is-error {
    background: linear-gradient(180deg, #ff3b30 0%, #d70015 100%);
    color: #fff;
    box-shadow: 0 2px 6px rgba(255, 59, 48, 0.4);
}

/* 提示文字居中 */
.captcha-track-hint {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    color: #b8b8bf;
    font-size: 13px;
    pointer-events: none;
    text-align: center;
    z-index: 1;
    letter-spacing: 0.3px;
}

/* 操作按钮 (主色 + 居中) */
.captcha-actions {
    display: flex;
    gap: 8px;
}
.captcha-actions button {
    padding: 9px 14px;
    border-radius: 10px;
    border: none;
    background: #f5f5f7;
    color: #1d1d1f;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    flex: 1;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.04);
}
.captcha-actions button:hover { background: #ececef; }
.captcha-actions button:active { background: #e3e3e6; }
.captcha-actions button:disabled { opacity: 0.5; cursor: not-allowed; }

.captcha-status {
    text-align: center;
    margin-top: 8px;
    font-size: 13px;
    min-height: 18px;
    color: #86868b;
    letter-spacing: 0.2px;
}
.captcha-status.is-success { color: #1f8a3c; }
.captcha-status.is-error { color: #d70015; }
.captcha-status.is-loading { color: #0071e3; }