/**
 * 滑动验证码样式
 * 适用于登录和注册页面
 */

/* ==================== 滑动验证码容器 ==================== */
.slider-captcha-wrapper {
    position: relative;
    margin-top: 10px;
}

.slider-captcha-container {
    width: 300px;
    height: 150px;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* ==================== 背景和拼图 ==================== */
.slider-background {
    width: 100%;
    height: 100%;
    position: relative;
}

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

.slider-puzzle {
    width: 50px;
    height: 50px;
    position: absolute;
    left: 0;
    top: 0;
    cursor: grab;
    z-index: 10;
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.slider-puzzle:active {
    cursor: grabbing;
}

/* ==================== 滑动控制器 ==================== */
.slider-control {
    margin-top: 12px;
    position: relative;
}

.slider-track {
    width: 300px;
    height: 44px;
    background: linear-gradient(90deg, #f5f7fa 0%, #e8ecf1 100%);
    border-radius: 22px;
    position: relative;
    border: 2px solid #e0e0e0;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
}

.slider-track-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
    border-radius: 20px;
    transition: width 0.1s ease;
}

.slider-button {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    position: absolute;
    left: 0;
    top: 0;
    cursor: grab;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
    z-index: 10;
}

.slider-button:active {
    cursor: grabbing;
}

.slider-button:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.5);
}

.slider-button svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* ==================== 验证状态 ==================== */
.slider-captcha-container.success .slider-track {
    border-color: #38a169;
    background: linear-gradient(90deg, rgba(56, 161, 105, 0.1) 0%, rgba(56, 161, 105, 0.2) 100%);
}

.slider-captcha-container.success .slider-track-fill {
    background: linear-gradient(90deg, rgba(56, 161, 105, 0.3) 0%, rgba(56, 161, 105, 0.4) 100%);
}

.slider-captcha-container.success .slider-button {
    background: linear-gradient(135deg, #38a169 0%, #48bb78 100%);
    cursor: default;
}

.slider-captcha-container.error .slider-track {
    border-color: #e53e3e;
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

/* ==================== 提示文字 ==================== */
.slider-text {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #718096;
    font-weight: 500;
    pointer-events: none;
    user-select: none;
}

.slider-captcha-container.success .slider-text {
    color: #38a169;
}

.slider-captcha-container.error .slider-text {
    color: #e53e3e;
}

/* ==================== 刷新按钮 ==================== */
.slider-refresh {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.slider-refresh:hover {
    background: white;
    transform: rotate(180deg);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.slider-refresh svg {
    width: 16px;
    height: 16px;
    fill: #667eea;
}

/* ==================== 响应式设计 ==================== */
@media (max-width: 480px) {
    .slider-captcha-container,
    .slider-track {
        width: 250px;
    }

    .slider-button {
        width: 40px;
        height: 40px;
    }
}
