/**
 * 定制滑块验证码样式
 * 现代化、精美的滑块验证码设计 - 优化版本
 */

/* 验证按钮样式 - 统一使用浅蓝色样式，无边框 */
.slider-captcha-simple {
    width: 100%;
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.slider-verify-button {
    width: 100%;
    height: 42px;
    background: #f0f9ff;
    border: none;
    border-radius: 4px;
    color: #409EFF;
    font-size: 14px;
    font-weight: 400;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
    transition: all 0.3s ease;
    box-shadow: none;
    position: relative;
    overflow: hidden;
}

.slider-verify-button::before {
    display: none;
}

.slider-verify-button:hover {
    background: #e6f7ff;
    transform: none;
    box-shadow: none;
}

.slider-verify-button:active {
    transform: none;
}

.slider-verify-button.success {
    background: #f0f9ff;
    border: none;
    color: #67C23A;
    position: relative;
}

.slider-verify-button.success::after {
    display: none;
}

.slider-verify-button.success .slider-verify-text,
.slider-verify-button.success .slider-verify-icon-container {
    position: relative;
    z-index: 2;
}

.slider-verify-button.success .slider-verify-icon {
    color: #67C23A;
}

.slider-verify-button.success::before {
    display: none;
}

.slider-verify-button.success:hover {
    background: #f0f9ff;
    box-shadow: none;
}

.slider-verify-icon {
    transition: all 0.3s ease;
}

.slider-verify-loading {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.slider-verify-text {
    font-weight: 400;
    user-select: none;
    flex: 1;
    text-align: center;
}

.slider-verify-icon-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    position: relative;
}

/* 弹窗样式 - 改为浅色系 */
.slider-captcha-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.slider-captcha-modal.show {
    opacity: 1;
    pointer-events: auto;
}

.slider-captcha-modal-content {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    width: 340px;
    overflow: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    pointer-events: auto;
    border: 1px solid #e8eaed;
    position: relative;
}

/* 状态条样式 */
.slider-captcha-status-bar {
    height: 4px;
    background: #409EFF;
    width: 100%;
    transition: background-color 0.3s ease;
}

.slider-captcha-status-bar.error {
    background: #FF5D39;
}

/* 新的头部样式 - 浅色 */
.slider-captcha-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e8eaed;
}

.slider-captcha-title {
    color: #333333;
    font-size: 16px;
    font-weight: 500;
    margin: 0;
}

.slider-captcha-actions {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 12px !important;
    flex-wrap: nowrap !important;
}

.slider-captcha-actions button {
    background: transparent !important;
    border: none !important;
    color: #666666 !important;
    cursor: pointer !important;
    padding: 6px !important;
    border-radius: 4px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.2s ease !important;
    width: 28px !important;
    height: 28px !important;
    flex-shrink: 0 !important;
    margin: 0 !important;
}

.slider-captcha-actions button:hover {
    background: rgba(0, 0, 0, 0.05) !important;
    color: #333333 !important;
}

.slider-captcha-refresh {
    order: 1;
}

.slider-captcha-close {
    order: 2;
    font-size: 20px;
    line-height: 1;
}

/* 错误提示样式 - 浅色系 */
.slider-captcha-error-message {
    background: #fef0f0;
    color: #f56c6c;
    border: 1px solid #fbc4c4;
    text-align: center;
    padding: 8px 16px;
    margin: 0 20px 10px 20px;
    border-radius: 4px;
    font-size: 14px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slider-captcha-modal.show .slider-captcha-modal-content {
    transform: translateY(0);
}

.slider-captcha-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e8eaed;
    background: #fafbfc;
}

.slider-captcha-modal-header span {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}


.slider-captcha-container {
    position: relative;
    width: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* 弹窗内的控制区域样式 - 浅色 */
.slider-captcha-modal-control {
    padding: 15px 20px 20px;
    background: #ffffff;
    border-top: 1px solid #e8eaed;
}

.slider-captcha-modal-control .slider-captcha-track {
    height: 40px;
    background: #f1f3f4;
    border: 1px solid #dadce0;
    border-radius: 20px;
    cursor: grab;
}

.slider-captcha-modal-control .slider-captcha-slider {
    width: 36px;
    height: 36px;
    top: 2px;
    left: 2px;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.slider-captcha-modal-control .slider-captcha-slider:active,
.slider-captcha-modal-control .slider-captcha-slider.sliding {
    cursor: grabbing;
    transform: scale(1.05);
}

.slider-captcha-modal-control .slider-captcha-text {
    margin-top: 10px;
    font-size: 13px;
    color: #5f6368;
    user-select: none;
    -webkit-user-select: none;
}

.slider-captcha-panel {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid #e8eaed;
}

.slider-captcha-panel.success {
    border-color: #4CAF50;
    box-shadow: 0 2px 12px rgba(76, 175, 80, 0.2);
}

.slider-captcha-panel.error {
    border-color: #f44336;
    box-shadow: 0 2px 12px rgba(244, 67, 54, 0.2);
    animation: shake 0.5s ease-in-out;
}

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

/* 验证码背景区域 */
.slider-captcha-bg {
    position: relative;
    width: 300px;
    height: 150px;
    background: linear-gradient(135deg, #f0f8ff 0%, #e6f3ff 50%, #ddeeff 100%);
    overflow: hidden;
    margin: 20px auto;
    border-radius: 4px;
}

.slider-captcha-canvas {
    display: block;
    width: 300px;
    height: 150px;
}

/* 滑块目标区域 */
.slider-captcha-block {
    position: absolute;
    background: transparent;
    border: none;
    border-radius: 0;
    transition: transform 0.1s ease-out;
    backdrop-filter: none;
    box-shadow: none;
    z-index: 10;
    outline: none;
    width: 50px;
    height: 50px;
}

/* 移除绿色圆点装饰 */

/* 响应式设计 */
@media (max-width: 400px) {
    .slider-captcha-bg {
        width: 100%;
        max-width: 300px;
        margin: 10px;
    }
    
    .slider-captcha-canvas {
        width: 300px;
        height: 150px;
    }
    
    .slider-captcha-modal-content {
        width: 90vw;
        max-width: 340px;
    }
}


/* 滑块控制区域 - 浅色 */
.slider-captcha-control {
    position: relative;
    padding: 20px;
    background: #ffffff;
}

.slider-captcha-track {
    position: relative;
    width: 100%;
    height: 40px;
    background: #f1f3f4;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid #e8eaed;
}

.slider-captcha-track-bg {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #409EFF, #66b1ff);
    border-radius: 20px;
    transition: width 0s; /* 移除宽度变化的动画，避免拖动延迟 */
}

.slider-captcha-track-bg.success {
    background: linear-gradient(90deg, #67C23A, #85ce61);
    animation: success-glow 0.6s ease;
}

.slider-captcha-track-bg.error {
    background: linear-gradient(90deg, #f56c6c, #f78989);
    animation: error-flash 0.6s ease;
}

@keyframes success-glow {
    0% { box-shadow: 0 0 0 rgba(103, 194, 58, 0.4); }
    50% { box-shadow: 0 0 20px rgba(103, 194, 58, 0.6); }
    100% { box-shadow: 0 0 0 rgba(103, 194, 58, 0.4); }
}

@keyframes error-flash {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* 滑块按钮 - 浅色系 */
.slider-captcha-slider {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 18px;
    cursor: grab;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    border: 1px solid #e8eaed;
    z-index: 2;
}

.slider-captcha-slider:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transform: scale(1.05);
}

.slider-captcha-slider.sliding {
    cursor: grabbing;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    transform: scale(1.1);
}

.slider-captcha-slider.success {
    background: linear-gradient(135deg, #67C23A 0%, #85ce61 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(103, 194, 58, 0.4);
}

.slider-captcha-slider.error {
    background: linear-gradient(135deg, #f56c6c 0%, #f78989 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(245, 108, 108, 0.4);
}

.slider-captcha-slider-icon {
    width: 16px;
    height: 16px;
    transition: all 0.3s ease;
}

.slider-captcha-slider.sliding .slider-captcha-slider-icon {
    transform: scale(1.2);
}

/* 提示文字 - 浅色系 */
.slider-captcha-text {
    text-align: center;
    margin-top: 12px;
    font-size: 14px;
    color: #666666;
    transition: all 0.3s ease;
    font-weight: 400;
}

.slider-captcha-panel.success .slider-captcha-text {
    color: #67C23A;
}

.slider-captcha-panel.error .slider-captcha-text {
    color: #f56c6c;
}

/* 加载状态 */
.slider-captcha-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    backdrop-filter: blur(2px);
}

.slider-captcha-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #f1f3f4;
    border-top: 3px solid #4CAF50;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 12px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.slider-captcha-loading span {
    font-size: 14px;
    color: #5f6368;
    font-weight: 500;
}

/* 响应式设计 */
@media (max-width: 480px) {
    .slider-captcha-modal-content {
        width: 300px;
    }
    
    .slider-captcha-container {
        max-width: 300px;
    }
    
    .slider-captcha-bg {
        height: 140px;
        width: 280px;
        margin: 10px auto;
    }
    
    .slider-captcha-canvas {
        width: 280px;
        height: 140px;
    }
    
    .slider-captcha-control {
        padding: 15px;
    }
    
    .slider-captcha-track {
        height: 36px;
    }
    
    .slider-captcha-slider {
        width: 32px;
        height: 32px;
    }
    
    .slider-captcha-text {
        font-size: 13px;
    }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    .slider-captcha-panel {
        background: #2d2d2d;
        border-color: #404040;
    }
    
    .slider-captcha-bg {
        background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 50%, #404040 100%);
    }
    
    .slider-captcha-control {
        background: #1a1a1a;
    }
    
    .slider-captcha-track {
        background: #404040;
        border-color: #555;
    }
    
    .slider-captcha-slider {
        background: linear-gradient(135deg, #404040 0%, #555 100%);
        border-color: #555;
        color: #fff;
    }
    
    .slider-captcha-text {
        color: #ccc;
    }
    
    
    .slider-captcha-loading {
        background: rgba(45, 45, 45, 0.95);
    }
    
    .slider-captcha-loading span {
        color: #ccc;
    }
}
