/* AjCaptcha 滑动拼图验证码样式（弹层模式）v1.1.0 */

/* ========== 触发按钮（默认显示） ========== */
.ajcaptcha-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 320px;
    height: 38px;
    padding: 0 12px;
    background: #f7f9fa;
    border: 1px solid #d2d6db;
    border-radius: 4px;
    color: #4a5568;
    font-size: 13px;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    box-sizing: border-box;
    transition: all 0.2s;
}
.ajcaptcha-trigger:hover {
    background: #eef4ff;
    border-color: #409eff;
    color: #1d4ed8;
}
.ajcaptcha-trigger-icon {
    margin-right: 6px;
    font-size: 16px;
    color: #1d4ed8;
}
.ajcaptcha-trigger-success {
    background: #ecfdf5 !important;
    border-color: #34d399 !important;
    color: #059669 !important;
    cursor: default;
}
.ajcaptcha-trigger-success:hover {
    background: #ecfdf5 !important;
    border-color: #34d399 !important;
    color: #059669 !important;
}
.ajcaptcha-trigger-success .ajcaptcha-trigger-icon {
    color: #059669;
}

/* ========== 弹层遮罩 ========== */
.ajcaptcha-mask {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
}
.ajcaptcha-mask.ajcaptcha-mask-show {
    opacity: 1;
}

/* ========== 弹层主体 ========== */
.ajcaptcha-modal {
    width: 350px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.18);
    overflow: hidden;
    box-sizing: border-box;
    transform: translateY(-20px);
    transition: transform 0.2s;
}
.ajcaptcha-mask-show .ajcaptcha-modal {
    transform: translateY(0);
}
.ajcaptcha-modal-header {
    height: 42px;
    padding: 0 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #f0f0f0;
}
.ajcaptcha-modal-title {
    font-size: 14px;
    color: #333;
    font-weight: 600;
}
.ajcaptcha-modal-close {
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
    color: #999;
    transition: color 0.2s;
}
.ajcaptcha-modal-close:hover {
    color: #333;
}
.ajcaptcha-modal-body {
    padding: 16px;
}

/* ========== 验证组件容器 ========== */
.ajcaptcha-wrap {
    width: 310px !important;
    margin: 0 auto;
    user-select: none;
    -webkit-user-select: none;
    box-sizing: border-box;
}
.ajcaptcha-wrap *,
.ajcaptcha-wrap *::before,
.ajcaptcha-wrap *::after {
    box-sizing: border-box;
}
.ajcaptcha-img-box {
    position: relative;
    width: 310px !important;
    height: 155px !important;
    overflow: hidden;
    border-radius: 4px;
    background: #f0f0f0;
    padding: 0 !important;
    margin: 0 !important;
}
.ajcaptcha-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 310px !important;
    height: 155px !important;
}
.ajcaptcha-bg-img {
    width: 310px !important;
    height: 155px !important;
    max-width: none !important;
    max-height: none !important;
    display: block;
    border: 0;
}
.ajcaptcha-slider-piece {
    position: absolute;
    top: 0;
    left: 0;
    display: none;
    z-index: 2;
    width: auto !important;
    height: auto !important;
}
.ajcaptcha-piece-img {
    display: block;
    height: 55px !important;
    width: auto !important;
    max-width: none !important;
    max-height: none !important;
    border: 0;
}
.ajcaptcha-loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.9);
    z-index: 5;
    font-size: 14px;
    color: #666;
}
.ajcaptcha-refresh {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 28px;
    height: 28px;
    line-height: 28px;
    text-align: center;
    background: rgba(0,0,0,0.4);
    border-radius: 50%;
    cursor: pointer;
    z-index: 3;
    color: #fff;
    font-size: 18px;
    transition: transform 0.3s;
}
.ajcaptcha-refresh:hover {
    transform: rotate(180deg);
    background: rgba(0,0,0,0.6);
}
.ajcaptcha-refresh i {
    font-style: normal;
}
.ajcaptcha-result {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 6px 0;
    text-align: center;
    font-size: 13px;
    color: #fff;
    z-index: 4;
    display: none;
}
.ajcaptcha-result-success {
    background: rgba(82, 196, 26, 0.85);
}
.ajcaptcha-result-fail {
    background: rgba(245, 34, 45, 0.85);
}

/* 滑块轨道 */
.ajcaptcha-slider-bar {
    position: relative;
    width: 310px;
    height: 40px;
    margin-top: 10px;
}
.ajcaptcha-slider-track {
    position: relative;
    width: 100%;
    height: 40px;
    background: #f7f9fa;
    border: 1px solid #e4e7eb;
    border-radius: 4px;
    overflow: hidden;
}
.ajcaptcha-slider-tip {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 40px;
    line-height: 40px;
    text-align: center;
    font-size: 13px;
    color: #999;
    transition: opacity 0.3s;
    pointer-events: none;
}
.ajcaptcha-slider-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0;
    background: #d1e9fe;
    border-radius: 4px 0 0 4px;
    transition: none;
}
.ajcaptcha-slider-fill-success {
    background: #d4edda !important;
}
.ajcaptcha-slider-btn {
    position: absolute;
    top: 0;
    left: 0;
    width: 44px;
    height: 40px;
    line-height: 40px;
    text-align: center;
    background: #fff;
    border: 1px solid #e4e7eb;
    border-radius: 4px;
    cursor: pointer;
    font-size: 18px;
    color: #666;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 2;
    transition: background 0.2s;
}
.ajcaptcha-slider-btn:hover {
    background: #409eff;
    color: #fff;
    border-color: #409eff;
}
.ajcaptcha-slider-btn-active {
    background: #409eff !important;
    color: #fff !important;
    border-color: #409eff !important;
}
.ajcaptcha-slider-btn-success {
    background: #52c41a !important;
    color: #fff !important;
    border-color: #52c41a !important;
    cursor: default;
}

/* 抖动动画 */
@keyframes ajcaptcha-shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
    20%, 40%, 60%, 80% { transform: translateX(4px); }
}
.ajcaptcha-shake {
    animation: ajcaptcha-shake 0.5s;
}

/* 移动端适配 */
@media screen and (max-width: 480px) {
    .ajcaptcha-trigger {
        max-width: 200px;
        font-size: 12px;
        height: 34px;
    }
    .ajcaptcha-modal {
        width: 92%;
        max-width: 350px;
    }
}
