/**
 * 拼图滑动验证组件样式
 */
.puzzle-captcha-container {
    width: 300px;
    margin: 10px 0;
    font-family: Arial, sans-serif;
}

.puzzle-captcha-panel {
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.puzzle-canvas-container {
    position: relative;
    width: 300px;
    height: 150px;
    overflow: hidden;
    background: #f5f5f5;
}

.puzzle-canvas-bg,
.puzzle-canvas-piece {
    position: absolute;
    top: 0;
    left: 0;
    border-radius: 4px 4px 0 0;
    cursor: pointer;
}

.puzzle-canvas-piece {
    z-index: 2;
}

.puzzle-refresh-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    z-index: 3;
    transition: background 0.3s;
}

.puzzle-refresh-btn:hover {
    background: rgba(0, 0, 0, 0.7);
}

.puzzle-slider-container {
    padding: 15px;
    background: #fafafa;
    border-radius: 0 0 4px 4px;
}

.puzzle-slider-track {
    position: relative;
    width: 100%;
    height: 40px;
    background: #f0f0f0;
    border-radius: 20px;
    border: 1px solid #ddd;
    overflow: hidden;
    user-select: none;
}

.puzzle-slider-track.success {
    background: linear-gradient(to right, #4CAF50 0%, #4CAF50 100%);
    border-color: #4CAF50;
}

.puzzle-slider-track.error {
    background: linear-gradient(to right, #f44336 0%, #f44336 50%, #f0f0f0 50%, #f0f0f0 100%);
    border-color: #f44336;
    animation: shake 0.5s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.puzzle-slider-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #666;
    font-size: 14px;
    pointer-events: none;
    z-index: 1;
}

.puzzle-slider-track.success .puzzle-slider-text {
    color: white;
}

.puzzle-slider-track.error .puzzle-slider-text {
    color: white;
}

.puzzle-slider-btn {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 18px;
    cursor: grab;
    z-index: 2;
    transition: all 0.3s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.puzzle-slider-btn:active {
    cursor: grabbing;
    transform: scale(1.05);
}

.puzzle-slider-btn.success {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
}

.puzzle-slider-btn.error {
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
}

.puzzle-slider-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0;
    height: 0;
    border-left: 8px solid white;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
}

.puzzle-slider-btn.success::before {
    content: '✓';
    border: none;
    width: auto;
    height: auto;
    color: white;
    font-size: 16px;
    font-weight: bold;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.puzzle-slider-btn.error::before {
    content: '✗';
    border: none;
    width: auto;
    height: auto;
    color: white;
    font-size: 16px;
    font-weight: bold;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 响应式设计 */
@media (max-width: 480px) {
    .puzzle-captcha-container {
        width: 100%;
        max-width: 300px;
    }
    
    .puzzle-canvas-container {
        width: 100%;
    }
    
    .puzzle-canvas-bg,
    .puzzle-canvas-piece {
        width: 100%;
    }
}

/* 禁用状态 */
.puzzle-captcha-container.disabled {
    opacity: 0.6;
    pointer-events: none;
}

/* 加载状态 */
.puzzle-captcha-container.loading .puzzle-canvas-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.puzzle-captcha-container.loading .puzzle-canvas-container::before {
    content: '加载中...';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 11;
    color: #666;
    font-size: 14px;
} 