/* assets/css/style.css */

/* 1. 变量定义 (提取自 body 和 .dark-theme) */
:root {
    --focus-color: #2997f7; /* 默认蓝色，你可以改成主题色 #f04494 */
    --main-bg-color: #fff;
    --muted-color: #777;
    --muted-2-color: #999;
    --muted-border-color: #eee;
    --main-shadow: rgba(116, 116, 116, 0.08);
    --main-radius: 8px;
}

/* 2. 模态框样式 (还原 .modal, .modal-mini 等) */
#SliderCaptcha {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99999;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}
#SliderCaptcha.in {
    opacity: 1;
    visibility: visible;
}

.modal-mini {
    width: 340px;
    max-width: 90%;
    background: var(--main-bg-color);
    border-radius: var(--main-radius);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    overflow: hidden;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s;
}
#SliderCaptcha.in .modal-mini {
    transform: scale(1);
}

/* 头部样式 */
.modal-colorful-header {
    height: 100px;
    position: relative;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #59c3fb 10%, #268df7 100%); /* 蓝色渐变 */
}
.modal-colorful-header .close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    opacity: 0.8;
}
.text-center { text-align: center; }
.em2x { font-size: 2em; }
.mt6 { margin-top: 6px; }
.em12 { font-size: 1.2em; }

/* 3. 滑块核心样式 (提取自 main.css 中的 .slidercaptcha 相关部分) */
.slidercaptcha {
    margin: 0 auto;
    width: 280px; /* 强制宽度 */
    height: auto;
}

.slidercaptcha canvas {
    display: block; /* 防止 canvas 底部留白 */
}

/* 滑块轨道容器 */
.sliderContainer {
    position: relative;
    text-align: center;
    line-height: 40px;
    background: #f7f9fa;
    color: #45494c;
    border-radius: 4px;
    border: 1px solid #e4e7eb;
    margin-top: 15px; /* 增加间距 */
    height: 40px;
    box-sizing: border-box; /* 关键：防止padding撑大 */
}

/* 进度条遮罩 */
.sliderMask {
    position: absolute;
    left: 0;
    top: 0;
    height: 38px; /* 减去边框高度 */
    border: 0 solid #1991fa;
    background: #d1e9fe;
    border-radius: 4px;
    z-index: 1; /* 确保在文字下方，但在滑块下方 */
}

/* 滑块按钮 */
.captcha-slider {
    position: absolute;
    top: -1px; /* 对齐边框 */
    left: 0;
    width: 40px;
    height: 40px;
    background: #fff;
    box-shadow: 0 0 3px rgba(0,0,0,0.3);
    cursor: pointer;
    transition: background .2s;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2; /* 最上层 */
    border: 1px solid #e4e7eb;
}

.captcha-slider:hover {
    background: #1991fa;
    color: #fff;
    border-color: #1991fa;
}

/* 刷新按钮 */
.refreshIcon {
    position: absolute;
    right: 5px;
    top: 5px;
    width: 30px;
    height: 30px;
    cursor: pointer;
    background: rgba(0,0,0,0.3);
    border-radius: 4px;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}
.refreshIcon:hover {
    background: var(--focus-color);
}

/* 状态样式 */
.sliderContainer_active .sliderMask {
    height: 38px;
    border-width: 1px;
}
.sliderContainer_active .captcha-slider {
    background: #1991fa;
    color: #fff;
    border-color: #1991fa;
}

.sliderContainer_success .sliderMask {
    border: 1px solid #52ccba;
    background-color: #d2f4ef;
}
.sliderContainer_success .captcha-slider {
    background-color: #52ccba !important;
    border-color: #52ccba;
    color: #fff;
}
/* 成功后的图标 */
.sliderContainer_success .dashicons-arrow-right-alt2:before {
    content: "\f147"; /* 变成对号 */
}

.sliderContainer_fail .sliderMask {
    border: 1px solid #f57a7a;
    background-color: #fce1e1;
}
.sliderContainer_fail .captcha-slider {
    background-color: #f57a7a !important;
    border-color: #f57a7a;
    color: #fff;
}

/* 文字样式 */
.sliderText {
    position: relative;
    z-index: 1; /* 确保可见 */
    display: block;
    width: 100%;
    height: 100%;
    font-size: 12px;
}

/* WP Dashicons 兼容性微调 */
.sliderIcon {
    font-family: "dashicons";
    font-weight: 400;
    font-style: normal;
    font-size: 20px;
    line-height: 1;
}
/* 默认箭头 */
.sliderIcon:before {
    content: "\f345"; 
}

/* 确保主画布与滑块画布正确叠放 */
.captcha-body-bg { display: block; width: 100%; height: auto; }
.captcha-body-bar {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 3;
    pointer-events: none; /* 允许把交互留给滑块按钮 */
}
/* 刷新按钮确保显示为 inline-flex/button */
.refreshIcon { display: inline-flex; align-items: center; justify-content: center; }

.refreshIcon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    background: rgba(0,0,0,0.35);
    border-radius: 4px;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    z-index: 10;
    line-height: 1;
}

/* 使用伪元素显示“刷新”符号，兼容性好 */
.refreshIcon::before {
    content: "\21bb"; /* ↻ Unicode 刷新箭头 */
    display: inline-block;
    font-style: normal;
    font-weight: 600;
    transform: translateY(1px);
}

/* 悬停高亮 */
.refreshIcon:hover {
    background: var(--focus-color);
    color: #fff;
}

/* 若原本使用 font icon 类导致字体不生效，强制使用系统字体显示 */
.refreshIcon, .refreshIcon::before {
    font-family: Arial, "Helvetica Neue", Helvetica, sans-serif !important;
}

/* 图片验证码样式 */
/* 图片验证码样式调整 */
.zcaptcha-image-box { 
    position: relative; 
    display: flex; 
    align-items: center; 
    margin-bottom: 15px; 
    justify-content: space-between;
}

.zcaptcha-input { 
    flex: 1; 
    margin-right: 10px !important; 
    height: 60px !important; /* 修改：输入框高度匹配图片高度 */
    min-height: 50px;
    font-size: 16px !important; /* 输入框文字也可以稍微大一点 */
}

.zcaptcha-img { 
    width: 160px;  /* 修改：宽度匹配 PHP 中的设置 */
    height: 60px !important;  /* 修改：高度匹配 PHP 中的设置 */
    cursor: pointer; 
    border-radius: 4px; 
    vertical-align: middle;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.05);
}

.zcaptcha-img:hover {
    opacity: 0.9;
}