/* 滑块验证码公共样式（静态文件，兼容严格 CSP：禁止 JS 动态注入 <style>）
   由 slider-captcha.js 渲染的 DOM 使用；所有使用页面在 <head> 引入本文件。
   容器必须纵向堆叠（大图、提示、轨道、消息），
   因此用更高优先级选择器覆盖 page.css .captcha-box / admin.css .login-captcha-box 的横向 flex 布局。 */
.slider-captcha,
.captcha-box.slider-captcha,
.login-captcha-box.slider-captcha {
    display: block;
    width: 100%;
    max-width: 340px;
    margin: 0 auto;
    user-select: none;
    -webkit-user-select: none;
    /* R104-3（P41 定版 2026-09-15）：组件级 touch-action 由 none 改 pan-y——none 使整个验证码区域成为
       滚动死区（手指在图面滑动时宿主弹窗不动），短屏反馈弹窗因此无法把被裁切在可见区外的手柄滚出来
       （站长图3/图4 现场）。pan-y 只放行纵向滚动；手柄拖动仍由 .captcha-btn 的 touch-action:none 与
       touchstart 的 preventDefault 独占 ⇒ 手感与坐标换算零变化（专项断言双向留证）。 */
    touch-action: pan-y;
    font-size: 14px;
    color: var(--text-secondary, #666);
}
.slider-captcha * {
    box-sizing: border-box;
}
.captcha-image-wrapper {
    position: relative;
    width: 100%;
    height: 150px;
    border-radius: var(--radius-md, 8px);
    overflow: hidden;
    background: var(--bg-base, #f5f5f5);
    border: 1px solid var(--border-light, #e5e5e5);
    margin-bottom: 12px;
}
.captcha-bg-image,
.captcha-slider-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 300px;
    height: 150px;
}
.captcha-bg-image {
    pointer-events: none;
}
.captcha-slider-image {
    z-index: 2;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.15));
    /* R105-1（P41 三修·站长 2026-09-15 复验）：拼图手柄图与 .captcha-btn 同为拖动把手（本图 z-index:2、
       按钮 z-index:3；按钮仅 40px 宽、手柄图宽 50px，手指常先按在图上）——本图缺 touch-action:none 时，
       浏览器可把该手势判为纵向滚动并派发 touchcancel，而旧实现 touchcancel 与 touchend 同路径收尾 ⇒
       静默提交一次未到位位移、消耗 /verify 次数（单 token 上限 2 次 ⇒ 一次错误放置即被推进新一轮，
       即站长复验「无提示、直接刷新」的次要通道）。与 .captcha-btn 对齐后拖动独占该手势；
       图面外空白区仍由容器 touch-action:pan-y 放行滚动（R104-3 短屏滚动能力零回归）。 */
    touch-action: none;
}
.captcha-hint {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-bottom: 10px;
    font-size: 13px;
    color: var(--text-secondary, #666);
}
.captcha-refresh {
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm, 4px);
    transition: background 0.2s;
    color: var(--primary, #10b981);
}
.captcha-refresh:hover {
    background: var(--bg-hover, rgba(16,185,129,0.08));
}
.captcha-refresh.disabled {
    cursor: not-allowed;
    opacity: 0.5;
    pointer-events: none;
}
.slider-captcha.cooldown .captcha-image-wrapper {
    opacity: 0.6;
}
.captcha-track {
    position: relative;
    height: 40px;
    overflow: hidden;
    border-radius: var(--radius-md, 8px);
    background: var(--bg-base, #f0f0f0);
    border: 1px solid var(--border-light, #e5e5e5);
}
.captcha-progress {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0;
    border-radius: var(--radius-md, 8px);
    background: linear-gradient(90deg, rgba(16,185,129,0.15), rgba(16,185,129,0.35));
    z-index: 1;
}
.captcha-btn {
    position: absolute;
    left: 0;
    top: 0;
    width: 40px;
    height: 38px;
    border-radius: var(--radius-md, 8px);
    background: var(--bg-card, #fff);
    border: 1px solid var(--border-light, #e5e5e5);
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 3;
    touch-action: none;
    transition: background 0.2s, border-color 0.2s;
}
.captcha-btn:hover {
    background: var(--bg-hover, #f9f9f9);
    border-color: var(--primary, #10b981);
}
.captcha-btn::before,
.captcha-btn::after {
    content: '';
    width: 0;
    height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
}
/* 双向拖动指示：左向 + 右向箭头（原单向右箭头随双向滑块改造移除） */
.captcha-btn::before {
    border-right: 8px solid var(--text-secondary, #666);
    margin-right: 2px;
}
.captcha-btn::after {
    border-left: 8px solid var(--text-secondary, #666);
    margin-left: 2px;
}
/* 提示文字行（拖动条下方、登录按钮上方独立居中展示）：
   默认/刷新态为灰色小字引导文案，成功/失败由 JS 切换为绿/红（同既有三态配色） */
.captcha-message {
    margin-top: 10px;
    font-size: 13px;
    min-height: 20px;
    text-align: center;
    color: var(--text-secondary, #666);
}
.captcha-message.success { color: var(--success, #22c55e); }
.captcha-message.error { color: var(--danger, #ef4444); }
.slider-captcha.loading .captcha-image-wrapper::after {
    content: '加载中...';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card, #fff);
    color: var(--text-secondary, #666);
    font-size: 14px;
    z-index: 5;
}
.slider-captcha.locked .captcha-track {
    opacity: 0.6;
    pointer-events: none;
}
