/* ============================================================
   滑动验证（拼图滑块）
   —— 注入到父主题登录/注册弹窗表单，替代图形验证码
   ============================================================ */

/* 被滑块替代的图形验证码行 */
.pz-slide-hidden {
    display: none !important;
}

.pz-slide-host {
    margin-bottom: 15px;
}

.pz-slide {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* ---------- 画布舞台 ---------- */
.pz-slide-stage {
    position: relative;
    width: 100%;
    border-radius: 6px;
    overflow: hidden;
    background: #f2f3f5;
    line-height: 0;
    /* 触屏拖动时不要带着页面一起滚 */
    touch-action: none;
}

.pz-slide-canvas {
    display: block;
    width: 100%;
    height: auto;
}

/* 窄屏：舞台整体等比缩，逻辑坐标不变（绘制与判定都在后端逻辑坐标上完成） */
@media (max-width: 400px) {
    .pz-slide-stage {
        border-radius: 4px;
    }

    .pz-slide-bar {
        height: 36px;
        margin-top: 6px;
    }

    .pz-slide-btn {
        width: 40px;
    }

    .pz-slide-tip {
        font-size: 12px;
    }
}

.pz-slide-mask {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, .28);
    color: #fff;
    font-size: 13px;
    line-height: 1.6;
    text-align: center;
    padding: 0 12px;
}

.pz-slide-loading {
    opacity: .95;
}

.pz-slide-fail {
    color: #ffd7d7;
}

.pz-slide-pass {
    color: #b9ffd8;
    font-size: 14px;
}

.pz-slide-refresh {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 24px;
    height: 24px;
    line-height: 24px;
    text-align: center;
    border-radius: 4px;
    background: rgba(255, 255, 255, .85);
    color: #555;
    font-size: 12px;
    text-decoration: none !important;
    z-index: 2;
}

.pz-slide-refresh:hover {
    background: #fff;
    color: #111;
}

/* ---------- 拖动条 ---------- */
.pz-slide-bar {
    position: relative;
    height: 40px;
    margin-top: 8px;
    border-radius: 20px;
    background: #f2f3f5;
    border: 1px solid #e3e5e8;
    overflow: hidden;
    /* 触屏：pointer/touch 拖动不触发页面滚动（JS 里同时用 passive:false 兜底） */
    touch-action: none;
}

.pz-slide-track {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0;
    background: rgba(79, 70, 229, .18);
}

.pz-slide-tip {
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    text-align: center;
    font-size: 13px;
    color: #8a8f99;
    pointer-events: none;
}

.pz-slide-btn {
    position: absolute;
    left: 0;
    top: 0;
    width: 44px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid #dcdfe6;
    border-radius: 20px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .12);
    color: #6b7280;
    cursor: pointer;
    z-index: 3;
    touch-action: none;
    transition: background .18s, color .18s;
}

/* 键盘可访问的焦点态（tabindex=0 + 方向键操作） */
.pz-slide-btn:focus-visible {
    outline: 2px solid #4f46e5;
    outline-offset: 2px;
}

.pz-slide-bar:focus-within {
    border-color: #a5b4fc;
}

.pz-slide.is-drag .pz-slide-btn {
    background: #4f46e5;
    border-color: #4f46e5;
    color: #fff;
}

.pz-slide.is-pass .pz-slide-btn {
    background: #22c55e;
    border-color: #22c55e;
    color: #fff;
    cursor: default;
}

.pz-slide.is-pass .pz-slide-bar {
    background: rgba(34, 197, 94, .12);
    border-color: rgba(34, 197, 94, .4);
}

.pz-slide.is-pass .pz-slide-tip {
    color: #22c55e;
}

/* 拖拽时禁止选中文本 */
.pz-slide.is-drag .pz-slide-tip,
.pz-slide.is-drag .pz-slide-canvas {
    -webkit-user-select: none;
    user-select: none;
}

/* 失败态：轻微抖动 + 进度条回落动画 */
.pz-slide.is-fail .pz-slide-bar {
    background: rgba(239, 68, 68, .1);
    border-color: rgba(239, 68, 68, .38);
    animation: pz-slide-shake .32s ease-in-out;
}

.pz-slide.is-fail .pz-slide-tip {
    color: #ef4444;
}

.pz-slide-track,
.pz-slide-btn {
    transition: left .18s ease-out, width .18s ease-out;
}

.pz-slide.is-drag .pz-slide-track,
.pz-slide.is-drag .pz-slide-btn {
    transition: none; /* 拖动过程中不要有补间延迟 */
}

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

@media (prefers-reduced-motion: reduce) {
    .pz-slide.is-fail .pz-slide-bar {
        animation: none;
    }

    .pz-slide-track,
    .pz-slide-btn {
        transition: none;
    }
}

/* ---------- 兜底提示 ---------- */
.pz-slide-toast {
    position: fixed;
    left: 50%;
    top: 20%;
    transform: translateX(-50%);
    z-index: 99999;
    padding: 8px 16px;
    border-radius: 6px;
    background: rgba(0, 0, 0, .8);
    color: #fff;
    font-size: 13px;
}

/* ============================================================
   邮箱验证提示
   ============================================================ */
.pz-ev-notice {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    margin: 0 0 16px;
    border-radius: 8px;
    background: #fff8e6;
    border: 1px solid #ffe0a3;
    color: #8a5a00;
    font-size: 13px;
    line-height: 1.7;
}

.pz-ev-notice .pz-ev-ico {
    flex: 0 0 auto;
    margin-top: 2px;
}

.pz-ev-notice b {
    color: #7a4d00;
}

.pz-ev-notice .pz-ev-actions {
    margin-top: 8px;
}

.pz-ev-notice .pz-btn {
    margin-right: 8px;
}

/* 绑定邮箱表单（第三方快捷登录占位邮箱场景） */
.pz-ev-bind-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}

.pz-ev-input {
    flex: 1 1 220px;
    min-width: 0;
    height: 34px;
    padding: 0 10px;
    border: 1px solid #e0c98a;
    border-radius: 6px;
    background: #fff;
    color: #4a3a12;
    font-size: 13px;
    line-height: 32px;
}

.pz-ev-input:focus {
    outline: none;
    border-color: #d19a1e;
    box-shadow: 0 0 0 3px rgba(209, 154, 30, .16);
}

.pz-ev-hint {
    display: inline-block;
    color: #8a5a00;
    font-size: 13px;
}

.pz-ev-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 7px;
    border-radius: 10px;
    background: #fff1d6;
    border: 1px solid #ffdc9e;
    color: #a35c00;
    font-size: 12px;
    line-height: 18px;
    vertical-align: middle;
}

html[data-bs-theme="dark"] .pz-ev-notice,
body.puock-dark .pz-ev-notice {
    background: rgba(255, 196, 0, .1);
    border-color: rgba(255, 196, 0, .28);
    color: #ffd479;
}

html[data-bs-theme="dark"] .pz-ev-notice b,
body.puock-dark .pz-ev-notice b {
    color: #ffe1a3;
}

html[data-bs-theme="dark"] .pz-ev-input,
body.puock-dark .pz-ev-input {
    background: rgba(255, 255, 255, .06);
    border-color: rgba(255, 196, 0, .32);
    color: #ffd479;
}

html[data-bs-theme="dark"] .pz-ev-hint,
body.puock-dark .pz-ev-hint {
    color: #ffd479;
}

/* 深色模式下的滑块 */
html[data-bs-theme="dark"] .pz-slide-bar,
body.puock-dark .pz-slide-bar {
    background: rgba(255, 255, 255, .07);
    border-color: rgba(255, 255, 255, .12);
}

html[data-bs-theme="dark"] .pz-slide-btn,
body.puock-dark .pz-slide-btn {
    background: #2a2d34;
    border-color: rgba(255, 255, 255, .16);
    color: #c9ced6;
}

html[data-bs-theme="dark"] .pz-slide-stage,
body.puock-dark .pz-slide-stage {
    background: rgba(255, 255, 255, .05);
}
