/*!
 * Juzi 随机二次元滑动拼图验证 jz.slider.css v1.0
 * 100% 移植 Zibll 子比主题 slidercaptcha 组件样式（main.css 5300-5393）
 * 含：拼图画布 / 滑动条 / 验证弹窗 / 触发按钮 / 深色模式
 */

/* ==================== 拼图加载占位（子比 .placeholder 同款流光） ==================== */
.jzsc-modal .placeholder {
    background: linear-gradient(118deg, rgba(121, 121, 121, 0.10) 25%, rgba(121, 121, 121, 0.22) 37%, rgba(121, 121, 121, 0.10) 63%);
    opacity: 1;
    border-radius: 4px;
    background-size: 400% 100%;
    -webkit-animation: jzscPlaceholder 1.5s ease infinite;
    animation: jzscPlaceholder 1.5s ease infinite;
}

@keyframes jzscPlaceholder {
    0%   { background-position: 100% 50%; }
    100% { background-position: 0 50%; }
}

.jzsc-loading {
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-right: 6px;
    vertical-align: -2px;
    border: 2px solid rgba(0, 0, 0, 0.15);
    border-top-color: #2563eb;
    border-radius: 50%;
    -webkit-animation: jzscSpin 0.7s linear infinite;
    animation: jzscSpin 0.7s linear infinite;
}

@keyframes jzscSpin {
    to { transform: rotate(360deg); }
}

/* ==================== 拼图组件（子比同款） ==================== */
.slidercaptcha {
    min-height: 205px;
}

.slidercaptcha .captcha-body-bg {
    display: block;
    width: 278px;
    height: 170px;
    border-radius: 4px;
    border: 1px solid #e5e7eb;
    background: #f3f4f6;
}

.slidercaptcha .captcha-body-bar {
    position: absolute;
    top: 0;
    left: 0;
}

.slidercaptcha .sliderContainer {
    text-align: center;
    background: #f3f4f6;
    color: #747d8c;
    border-radius: 4px;
    margin-top: 0.5rem;
    position: relative;
    line-height: 40px;
    height: 40px;
    font-size: 13px;
    -webkit-user-select: none;
    user-select: none;
}

.slidercaptcha .refreshIcon {
    position: absolute;
    right: 0;
    opacity: 0.75;
    top: 0;
    padding: 9px;
    color: #fff;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.65);
    line-height: 1;
    background: none;
    border: 0;
    cursor: pointer;
    z-index: 2;
}

.slidercaptcha .refreshIcon:hover {
    opacity: 1;
}

.slidercaptcha .sliderMask {
    position: absolute;
    border-radius: 4px;
    height: 40px;
    transition: 0.3s;
    top: 0;
    left: 0;
}

.slidercaptcha .sliderContainer_active .sliderMask {
    background: rgba(5, 224, 96, 0.10);
    border: 1px solid rgba(94, 182, 89, 0.60);
    transition: none;
}

.slidercaptcha .sliderContainer_success .sliderMask {
    background: rgba(0, 153, 255, 0.20);
    border: 1px solid #43b5fc;
}

.slidercaptcha .sliderContainer_fail .sliderMask {
    background: rgba(255, 0, 0, 0.20);
    border: 1px solid #ff4842;
}

.slidercaptcha .captcha-slider {
    position: absolute;
    top: 0;
    left: 0;
    width: 40px;
    height: 40px;
    background: #fff;
    color: #333;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.18);
    cursor: pointer;
    border-radius: 4px;
    transition: 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slidercaptcha .captcha-slider svg {
    pointer-events: none;
}

.slidercaptcha .sliderContainer_active .captcha-slider {
    transition: none;
}

.slidercaptcha .sliderContainer_success .captcha-slider {
    background: #3ca4f9;
    color: #fff;
}

.slidercaptcha .sliderContainer_fail .captcha-slider {
    background: #f7564a;
    color: #fff;
}

.slidercaptcha .jzsc-text-danger {
    color: #f7564a !important;
}

/* ==================== 触发按钮（登录弹窗 / 评论区通用） ==================== */
.jzsc-field {
    position: relative;
    margin: 0 0 14px;
}

.jzsc-field .jzsc-pass {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.jzsc-trigger {
    width: 100%;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 0 14px;
    background: #fff;
    border: 1px solid #dfe4ec;
    border-radius: 10px;
    color: #5b6573;
    font-size: 13.5px;
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.jzsc-trigger:hover {
    border-color: #2563eb;
    color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.10);
}

.jzsc-trigger:active {
    transform: translateY(1px);
}

.jzsc-trigger .jzsc-trigger-ico {
    color: #f59e0b;
    flex: 0 0 auto;
}

.jzsc-trigger .jzsc-trigger-text {
    flex: 1 1 auto;
    text-align: center;
    line-height: 1;
}

.jzsc-trigger .jzsc-trigger-arrow {
    color: #b3bcc9;
    flex: 0 0 auto;
}

.jzsc-field.jzsc-done .jzsc-trigger {
    background: #ecfdf5;
    border-color: #34d399;
    color: #059669;
    cursor: default;
    box-shadow: none;
}

.jzsc-field.jzsc-done .jzsc-trigger .jzsc-trigger-ico,
.jzsc-field.jzsc-done .jzsc-trigger .jzsc-trigger-arrow {
    display: none;
}

.jzsc-field.jzsc-done .jzsc-trigger .jzsc-trigger-text::before {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-right: 6px;
    vertical-align: -2px;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Cpath d='M173.9 439.4l-166.4-166.4c-10-10-10-26.2 0-36.2l36.2-36.2c10-10 26.2-10 36.2 0L192 312.7 432.1 72.6c10-10 26.2-10 36.2 0l36.2 36.2c10 10 10 26.2 0 36.2l-294.4 294.4c-10 10-26.2 10-36.2 0z'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Cpath d='M173.9 439.4l-166.4-166.4c-10-10-10-26.2 0-36.2l36.2-36.2c10-10 26.2-10 36.2 0L192 312.7 432.1 72.6c10-10 26.2-10 36.2 0l36.2 36.2c10 10 10 26.2 0 36.2l-294.4 294.4c-10 10-26.2 10-36.2 0z'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* 评论区窄位适配 */
.comt-verify .jzsc-field,
.jz-comment-modal-code .jzsc-field {
    margin: 8px 0 0;
}

/* 评论主表单工具栏（flex-wrap）：滑块独占一行 */
#commentform-wrap .comt-tips-left > .jzsc-field {
    flex: 0 0 100%;
    margin: 8px 0 2px;
}

#commentform-wrap .jzsc-trigger {
    height: 40px;
    border-radius: 8px;
}

/* ==================== 验证弹窗（100% 复刻子比 SliderCaptchaModal） ==================== */
.jzsc-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100000000;
    background: rgba(0, 0, 0, 0.50);
    opacity: 0;
    transition: opacity 0.22s ease;
    -webkit-user-select: none;
    user-select: none;
}

.jzsc-modal.jzsc-in {
    opacity: 1;
}

.jzsc-dialog {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 340px;
    max-width: calc(100vw - 32px);
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.28);
    transform: translate(-50%, -46%) scale(0.96);
    transition: transform 0.22s ease;
}

.jzsc-in .jzsc-dialog {
    transform: translate(-50%, -50%) scale(1);
}

.jzsc-close {
    position: absolute;
    right: 10px;
    top: 8px;
    z-index: 3;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
    cursor: pointer;
    line-height: 1;
    transition: background 0.2s ease;
}

.jzsc-close:hover {
    background: rgba(255, 255, 255, 0.42);
}

.jzsc-close svg {
    width: 13px;
    height: 13px;
}

.jzsc-header {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 110px;
    background: linear-gradient(135deg, #ffc531 0%, #ff9d2e 55%, #ff6f06 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* 子比 colorful-make 同款装饰圆 */
.jzsc-header::before,
.jzsc-header::after {
    content: '';
    position: absolute;
    border-radius: 100%;
    background: rgba(255, 255, 255, 0.18);
    pointer-events: none;
}

.jzsc-header::before {
    width: 220px;
    height: 220px;
    right: -120px;
    top: -90px;
    transform: rotate(25deg);
}

.jzsc-header::after {
    width: 150px;
    height: 150px;
    left: -80px;
    bottom: -95px;
    transform: rotate(-30deg);
    background: rgba(255, 255, 255, 0.14);
}

.jzsc-header-icon {
    position: relative;
    z-index: 1;
    font-size: 30px;
    line-height: 1;
    margin-bottom: 8px;
    text-shadow: 0 2px 8px rgba(200, 80, 0, 0.35);
}

.jzsc-header-title {
    position: relative;
    z-index: 1;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.jzsc-header-sub {
    position: relative;
    z-index: 1;
    font-size: 11px;
    opacity: 0.85;
    margin-top: 3px;
}

.jzsc-body {
    position: relative;
    padding: 10px 20px 16px;
    margin-top: 110px;
}

/* ==================== 深色模式（Juzi：html[data-night='night']） ==================== */
html[data-night='night'] .jzsc-dialog {
    background: #1e2230;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
}

html[data-night='night'] .jzsc-trigger {
    background: #262b3a;
    border-color: #394056;
    color: #aeb8cc;
}

html[data-night='night'] .jzsc-trigger:hover {
    border-color: #4f8cff;
    color: #6ea1ff;
    box-shadow: 0 0 0 3px rgba(79, 140, 255, 0.16);
}

html[data-night='night'] .jzsc-field.jzsc-done .jzsc-trigger {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(52, 211, 153, 0.55);
    color: #34d399;
}

html[data-night='night'] .slidercaptcha .sliderContainer {
    background: #2a3042;
    color: #98a2b8;
}

html[data-night='night'] .slidercaptcha .captcha-body-bg {
    border-color: #394056;
    background: #2a3042;
}

html[data-night='night'] .slidercaptcha .captcha-slider {
    background: #3a4258;
    color: #e5e9f2;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.4);
}

html[data-night='night'] .jzsc-loading {
    border-color: rgba(255, 255, 255, 0.18);
    border-top-color: #4f8cff;
}

/* ==================== 移动端 ==================== */
@media (max-width: 380px) {
    .jzsc-dialog {
        width: 316px;
    }
    .jzsc-body {
        padding-left: 12px;
        padding-right: 12px;
    }
}
