/* 拼图验证码样式 */
.puzzle-verify-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
}

.puzzle-verify-mask {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2px);
}

.puzzle-verify-dialog {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 380px;
    width: 90%;
    animation: puzzleSlideIn 0.3s ease-out;
}

@keyframes puzzleSlideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -60%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

.puzzle-verify-title {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    margin-bottom: 15px;
    text-align: center;
}

.puzzle-verify-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-size: 24px;
    color: #999;
    line-height: 30px;
    text-align: center;
    transition: color 0.2s;
}

.puzzle-verify-close:hover {
    color: #333;
}

.puzzle-bg {
    position: relative;
    width: 320px;
    height: 180px;
    margin: 0 auto 15px;
    border: 2px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    background: #f5f5f5;
}

.puzzle-bg-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    user-select: none;
    pointer-events: none;
}

.puzzle-hole {
    position: absolute;
    width: 42px;
    height: 42px;
    background: rgba(0, 0, 0, 0.6);
    border: 2px dashed #ffffff;
    border-radius: 4px;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.4);
    pointer-events: none;
}

.puzzle-piece {
    position: absolute;
    width: 42px;
    height: 42px;
    background-size: 320px 180px;
    border: none;
    border-radius: 0;
    cursor: grab;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: box-shadow 0.2s;
    z-index: 10;
}

.puzzle-piece:hover {
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}

.puzzle-piece:active {
    cursor: grabbing;
}

.puzzle-piece-success {
    position: absolute;
    width: 42px;
    height: 42px;
    background-size: 320px 180px;
    border: 2px solid #52c41a;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), 0 0 15px rgba(82, 196, 26, 0.5);
    z-index: 10;
    animation: successGlow 0.6s ease-out;
}

@keyframes successGlow {
    from {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), 0 0 0px rgba(82, 196, 26, 0.8);
    }
    to {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), 0 0 15px rgba(82, 196, 26, 0.5);
    }
}

.puzzle-slider-track {
    position: relative;
    width: 100%;
    height: 40px;
    background: #f7f9fa;
    border: 1px solid #e4e7eb;
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 12px;
    margin-top: 8px;
}

.puzzle-slider-fill {
    position: absolute;
    height: 100%;
    background: linear-gradient(90deg, #1991eb 0%, #2ed573 100%);
    border-radius: 20px;
    transition: width 0.1s;
}

.puzzle-slider-button {
    position: absolute;
    top: 0;
    left: 0;
    width: 40px;
    height: 40px;
    background: white;
    border: none;
    border-radius: 20px;
    cursor: grab;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    user-select: none;
    z-index: 20;
    font-size: 18px;
    color: #1991eb;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.puzzle-slider-button:hover {
    box-shadow: 0 3px 10px rgba(25, 145, 235, 0.4);
}

.puzzle-slider-button:active {
    cursor: grabbing;
}

.puzzle-slider-button.failed {
    background: #f5222d;
    border-color: #f5222d;
    cursor: default;
    color: white;
}

.puzzle-slider-button.failed:hover {
    box-shadow: none;
}

.puzzle-slider-text {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #a0a0a0;
    font-size: 13px;
    pointer-events: none;
    user-select: none;
}

.puzzle-result {
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    text-align: center;
    width: calc(100% - 4px);
    max-width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.puzzle-result.success {
    background: linear-gradient(135deg, #f6ffed 0%, #e6f7ff 100%);
    border: 1px solid #52c41a;
    color: #52c41a;
}

.puzzle-result.error {
    background: linear-gradient(135deg, #fff1f0 0%, #ffe7e6 100%);
    border: 1px solid #f5222d;
    color: #f5222d;
}

.puzzle-result-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    color: white;
}

.puzzle-result.success .puzzle-result-icon {
    background: #52c41a;
    animation: scaleIn 0.4s ease-out;
}

.puzzle-result.error .puzzle-result-icon {
    background: #f5222d;
    animation: shake 0.4s ease-out;
}

@keyframes scaleIn {
    from {
        transform: scale(0);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-5px);
    }
    75% {
        transform: translateX(5px);
    }
}

.puzzle-retry-btn {
    margin-top: 2px;
    padding: 5px 18px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
    transition: transform 0.2s, box-shadow 0.2s;
}

.puzzle-retry-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.puzzle-retry-btn:active {
    transform: translateY(0);
}

.puzzle-tips {
    text-align: center;
    color: #999;
    font-size: 12px;
    margin-top: 10px;
}

/* 响应式适配 */
@media (max-width: 500px) {
    .puzzle-verify-dialog {
        width: 95%;
        padding: 20px;
    }
    
    .puzzle-bg {
        width: 100%;
        height: auto;
        aspect-ratio: 4/3;
    }
}
