/* 滑块验证组件样式（可复用，箭头滑动式，纯色无图）
 * 配套：/static/home/js/site/slider-captcha/slider-captcha.js
 */

.slider-captcha-layer .layui-layer-content {
    padding: 0 !important;
    overflow: visible !important;
}

.slider-captcha {
    background: #fff;
    user-select: none;
    -webkit-user-select: none;
}

/* 标题栏（纯色背景 + 明显关闭按钮） */
.sc-header {
    position: relative;
    height: 44px;
    padding: 0 14px;
    background: #f5f7fa;
    border-bottom: 1px solid #ebeef5;
    border-radius: 4px 4px 0 0;
    box-sizing: border-box;
}

.sc-title {
    display: flex;
    align-items: center;
    height: 43px;
    font-size: 15px;
    font-weight: 600;
    color: #303133;
}

.sc-close {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: #e4e7ed;
    color: #606266;
    cursor: pointer;
    transition: background .2s, color .2s, transform .15s;
    line-height: 0;
}

.sc-close:hover {
    background: #f56c6c;
    color: #fff;
    transform: translateY(-50%) rotate(90deg);
}

.sc-body {
    position: relative;
    padding: 16px 15px 18px;
}

/* 文字提示 */
.sc-hint {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    font-size: 13px;
    color: #606266;
    line-height: 1.4;
}

.sc-hint-dot {
    flex: none;
    width: 6px;
    height: 6px;
    margin-right: 7px;
    border-radius: 50%;
    background: #409eff;
    box-shadow: 0 0 0 3px rgba(64, 158, 255, .15);
}

.sc-success .sc-hint-dot {
    background: #67c23a;
    box-shadow: 0 0 0 3px rgba(103, 194, 58, .15);
}

.sc-success .sc-hint-text {
    color: #67c23a;
}

.sc-fail .sc-hint-dot {
    background: #f56c6c;
    box-shadow: 0 0 0 3px rgba(245, 108, 108, .15);
}

.sc-fail .sc-hint-text {
    color: #f56c6c;
}

/* 滑轨 */
.sc-track {
    position: relative;
    width: 310px;
    height: 42px;
    background: #f2f3f5;
    border: 1px solid #e4e7ed;
    border-radius: 6px;
    box-sizing: border-box;
    overflow: hidden;
    touch-action: none;
}

/* 进度填充：拖动时跟随手柄，颜色随进度渐变（JS 内联设置） */
.sc-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0;
    background: #d9ecff;
    border-radius: 6px 0 0 6px;
    will-change: width, background-color;
}

.sc-fill-text {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 40px;
    line-height: 40px;
    text-align: center;
    font-size: 12px;
    color: #409eff;
    white-space: nowrap;
    opacity: 0;
    transition: opacity .2s;
    pointer-events: none;
}

.sc-fill-text.sc-visible {
    opacity: 1;
}

.sc-success .sc-fill {
    background: #d1f0dc !important;
}

/* 轨道内默认提示文字 */
.sc-track-tip {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 40px;
    line-height: 40px;
    text-align: center;
    color: #909399;
    font-size: 13px;
    pointer-events: none;
    transition: opacity .15s;
}

/* 拖动时隐藏轨道内提示 */
.sc-dragging .sc-track-tip,
.sc-success .sc-track-tip {
    opacity: 0;
}

/* 滑块手柄（箭头） */
.sc-handle {
    position: absolute;
    left: 0;
    top: 0;
    width: 44px;
    height: 40px;
    background: #fff;
    border: 1px solid #dcdfe6;
    border-radius: 6px;
    box-sizing: border-box;
    cursor: grab;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .08);
    touch-action: none;
    will-change: transform;
}

.sc-handle:active {
    cursor: grabbing;
}

.sc-handle .sc-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #909399;
    transition: color .2s;
    line-height: 0;
}

.sc-handle .sc-icon-check {
    display: none;
    color: #67c23a;
}

.sc-handle:hover .sc-icon,
.sc-handle.sc-active .sc-icon {
    color: #409eff;
}

.sc-handle.sc-active {
    border-color: #409eff;
    box-shadow: 0 2px 8px rgba(64, 158, 255, .25);
}

.sc-handle.sc-active .sc-icon-arrow {
    transform: translateX(2px);
}

/* 成功态：箭头切换为绿色对勾 */
.sc-success .sc-handle {
    border-color: #67c23a;
    background: #f0f9eb;
}

.sc-success .sc-handle .sc-icon-arrow {
    display: none;
}

.sc-success .sc-handle .sc-icon-check {
    display: flex;
}

/* 失败态 */
.sc-fail .sc-handle {
    border-color: #f56c6c;
}

.sc-fail .sc-handle .sc-icon-arrow {
    color: #f56c6c;
}

/* 抖动动画 */
.slider-captcha.sc-shake {
    animation: sc-shake .45s ease;
}

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