/* ========== 入口样式 ========== */
* {
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}
body {
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Segoe UI', 'PingFang SC', Roboto, sans-serif;
    padding: 20px;
    margin: 0;
}
.captcha {
    position: relative;
    width: 280px;
    margin: 16px;
    padding: 24px;
    outline: 0.666667px solid rgb(211, 211, 211);
    box-shadow: 0px 0px 4px 1px rgba(0, 0, 0, 0.08);
    background: rgb(249, 249, 249);
    border-radius: 3px;
    transition: all 0.25s ease;
    color: #000;
}
.captcha:hover {
    transform: translateY(-2px);
    box-shadow: 0px 4px 12px 1px rgba(0, 0, 0, 0.12);
}
.captcha-clickable {
    cursor: pointer;
    display: flex;
    align-items: center;
    position: relative;
}
.captcha-checkbox {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    outline: 2px solid rgb(193, 193, 193);
    border-radius: 2px;
    transition: all 0.2s ease;
    overflow: hidden;
    position: relative;
}
.captcha-checkbox svg {
    width: 20px;
    height: 20px;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.2s cubic-bezier(0.34, 1.2, 0.64, 1);
}
.captcha-checkbox.checked svg {
    opacity: 1;
    transform: scale(1);
}
.captcha-checkbox.loading {
    background: transparent;
    outline: none;
    border-radius: 50%;
}
.captcha-checkbox.loading svg {
    display: none;
}
.captcha-checkbox.loading::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(102, 126, 234, 0.3);
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    box-sizing: border-box;
}
.captcha-dark .captcha-checkbox.loading::before {
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #8ab4f8;
    box-shadow: 0 0 4px rgba(138, 180, 248, 0.6);
}
.captcha-clickable:hover .captcha-checkbox:not(.loading) {
    outline: 2px solid rgb(178, 178, 178);
    box-shadow: rgba(0, 0, 0, 0.1) 0px 1px 1px 0px inset;
}
.captcha-clickable:active .captcha-checkbox:not(.loading) {
    transform: scale(0.95);
}
.captcha-text {
    margin-left: 16px;
    font-size: 15px;
    font-family: sans-serif !important;
    transition: 0.2s;
}
.captcha-brand {
    position: absolute;
    left: 8px;
    bottom: 6px;
    font-size: 8px;
    opacity: 0.55;
    font-family: sans-serif !important;
    color: #000;
    pointer-events: none;
    white-space: nowrap;
}
.captcha-time {
    position: absolute;
    right: 8px;
    bottom: 6px;
    font-size: 8px;
    opacity: 0.55;
    font-family: monospace !important;
    color: #000;
    pointer-events: none;
    white-space: nowrap;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
.captcha-text.verified {
    color: #28a745;
}
.captcha-dark {
    outline: 0.666667px solid rgb(92, 92, 92);
    box-shadow: 0px 0px 4px 1px rgba(255, 255, 255, 0.08);
    background: rgb(54, 54, 54);
    color: #fff;
}
.captcha-dark .captcha-checkbox:not(.loading) {
    background: rgb(48, 48, 48);
    outline: 2px solid rgb(110, 110, 110);
}
.captcha-dark .captcha-clickable:hover .captcha-checkbox:not(.loading) {
    outline: 2px solid rgb(125, 125, 125);
    box-shadow: rgba(255, 255, 255, 0.1) 0px 1px 1px 0px inset;
}
.captcha-dark .captcha-brand,
.captcha-dark .captcha-time {
    color: #fff;
}
.toast-token {
    display: none;
}

/* ========== 滑块弹窗样式 ========== */
.captcha-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    animation: modalFadeIn 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    margin: 0;
    padding: 0;
}
@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.96);
        backdrop-filter: blur(0);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
        backdrop-filter: blur(4px);
    }
}
@keyframes modalFadeOut {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
        backdrop-filter: blur(4px);
    }
    to {
        opacity: 0;
        transform: translateY(-20px) scale(0.96);
        backdrop-filter: blur(0);
    }
}
.captcha-panel {
    width: 380px;
    max-width: 90vw;
    background: rgba(255, 255, 255, 0.96);
    border-radius: 24px;
    box-shadow: 0 20px 35px -12px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.5) inset;
    overflow: hidden;
    transition: all 0.2s ease;
}
.captcha-header {
    padding: 14px 20px;
    background: #f8fafd;
    font-size: 15px;
    font-weight: 500;
    color: #1f2f3a;
    border-bottom: 1px solid #e9edf2;
    display: flex;
    align-items: center;
    gap: 12px;
}
.captcha-header .captcha-id {
    font-size: 11px;
    color: #6c7a8e;
    background: #eef2f7;
    padding: 2px 8px;
    border-radius: 30px;
    letter-spacing: 0.3px;
}
.refresh-icon {
    cursor: pointer;
    margin-left: auto;
    font-size: 18px;
    font-weight: 600;
    color: #8f9bb2;
    transition: 0.2s;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #f0f3f8;
}
.refresh-icon:hover {
    background: #e6eaf0;
    color: #4c6a9e;
    transform: rotate(90deg);
}
.captcha-body {
    padding: 20px 20px 18px;
}
.bg-img-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: 14px;
    background: #f0f2f5;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    min-height: 160px;
}
.bg-img {
    width: 100%;
    display: block;
    pointer-events: none;
    user-select: none;
}
.slide-img {
    position: absolute;
    left: 0;
    display: block;
    border-radius: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(200, 200, 200, 0.6);
    pointer-events: none;
    z-index: 12;
}
.captcha-success-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(2px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 20;
    border-radius: 14px;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}
.captcha-success-overlay.show {
    opacity: 1;
}
.captcha-modal.dark .captcha-success-overlay {
    background: rgba(30, 30, 40, 0.85);
}
.success-icon {
    font-size: 64px;
    color: #28a745;
    background: rgba(40, 167, 69, 0.15);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    animation: successPop 0.5s cubic-bezier(0.34, 1.2, 0.64, 1);
}
.success-text {
    font-size: 18px;
    font-weight: 600;
    color: #28a745;
    letter-spacing: 1px;
}
@keyframes successPop {
    0% { transform: scale(0); opacity: 0; }
    80% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1); }
}
.slider-container {
    position: relative;
    margin-top: 22px;
    background: #edf2f7;
    border-radius: 60px;
    height: 48px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
    cursor: default;
}
.slider-track {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: linear-gradient(90deg, #8cc0ff, #3b82f6);
    width: 0;
    border-radius: 60px;
    transition: none;
    pointer-events: none;
}
.slider-btn {
    position: absolute;
    left: 0;
    top: 0;
    width: 48px;
    height: 48px;
    background: white;
    border: none;
    border-radius: 60px;
    cursor: grab;
    text-align: center;
    line-height: 48px;
    font-size: 20px;
    color: #3b82f6;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(59,130,246,0.3);
    transition: none;
    user-select: none;
    touch-action: none;
    z-index: 5;
}
.slider-btn:active {
    cursor: grabbing;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}
.slider-text {
    position: absolute;
    width: 100%;
    text-align: center;
    line-height: 48px;
    font-size: 13px;
    color: #8096b3;
    font-weight: 500;
    letter-spacing: 0.5px;
    pointer-events: none;
    z-index: 1;
}
.tips {
    margin-top: 16px;
    font-size: 12px;
    text-align: center;
    padding: 4px 8px;
    border-radius: 30px;
    font-weight: 500;
    transition: 0.15s;
}
.tips.error {
    color: #e5484d;
    background: #fff0f0;
}
.tips.success {
    color: #1f8b4c;
    background: #e4f5ec;
}
.captcha-footer {
    padding: 12px 20px;
    background: #fbfdff;
    border-top: 1px solid #edf2f8;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
}
.footer-copyright {
    color: #9aa9bf;
    font-size: 11px;
    user-select: none;
    letter-spacing: 0.3px;
}
.button-group {
    display: flex;
    gap: 12px;
}
.captcha-footer button {
    padding: 6px 18px;
    border-radius: 40px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}
.btn-refresh {
    background: #f0f4fa;
    color: #2c5f9a;
}
.btn-refresh:hover {
    background: #e3e9f2;
    color: #1f4a7a;
}
.btn-cancel {
    background: #ffffff;
    border: 1px solid #dce3ec !important;
    color: #7e8c9e;
}
.btn-cancel:hover {
    background: #fafcff;
    border-color: #bdc7d6;
    color: #5f6c82;
}
.captcha-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(3px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 20;
    border-radius: 14px;
    transition: all 0.2s ease;
}
.captcha-modal.dark .captcha-loading-overlay {
    background: rgba(30, 30, 40, 0.85);
}
.loading-spinner-center {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(102, 126, 234, 0.3);
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 12px;
}
.captcha-modal.dark .loading-spinner-center {
    border: 4px solid rgba(138, 180, 248, 0.3);
    border-top-color: #8ab4f8;
}
.loading-text-center {
    font-size: 13px;
    color: #666;
    font-weight: 500;
}
.captcha-modal.dark .loading-text-center {
    color: #ccc;
}

/* 暗色主题 */
.captcha-modal.dark {
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
}
.captcha-modal.dark .captcha-panel {
    background: rgba(30, 30, 40, 0.95);
    box-shadow: 0 20px 35px -12px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.1) inset;
}
.captcha-modal.dark .captcha-header {
    background: #2a2a3a;
    border-bottom-color: #3a3a4a;
    color: #e0e0e0;
}
.captcha-modal.dark .captcha-header .captcha-id {
    background: #3a3a4a;
    color: #a0a0b0;
}
.captcha-modal.dark .refresh-icon {
    background: #3a3a4a;
    color: #a0a0b0;
}
.captcha-modal.dark .refresh-icon:hover {
    background: #4a4a5a;
    color: #e0e0e0;
}
.captcha-modal.dark .bg-img-wrapper {
    background: #2a2a3a;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
}
.captcha-modal.dark .slider-container {
    background: #2a2a3a;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
}
.captcha-modal.dark .slider-track {
    background: linear-gradient(90deg, #4a7bb5, #2c5f9a);
}
.captcha-modal.dark .slider-btn {
    background: #3a3a4a;
    color: #8ab4f8;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(138, 180, 248, 0.3);
}
.captcha-modal.dark .slider-text {
    color: #a0a0b0;
}
.captcha-modal.dark .tips.error {
    background: rgba(229, 72, 77, 0.2);
    color: #f5a3a6;
}
.captcha-modal.dark .tips.success {
    background: rgba(31, 139, 76, 0.2);
    color: #7bc28a;
}
.captcha-modal.dark .captcha-footer {
    background: #2a2a3a;
    border-top-color: #3a3a4a;
}
.captcha-modal.dark .footer-copyright {
    color: #a0a0b0;
}
.captcha-modal.dark .btn-refresh {
    background: #3a3a4a;
    color: #8ab4f8;
}
.captcha-modal.dark .btn-refresh:hover {
    background: #4a4a5a;
}
.captcha-modal.dark .btn-cancel {
    background: #3a3a4a;
    border-color: #5a5a6a !important;
    color: #d0d0d0;
}
.captcha-modal.dark .btn-cancel:hover {
    background: #4a4a5a;
    border-color: #7a7a8a !important;
}

@media (max-width: 480px) {
    .captcha-body { padding: 16px; }
    .slider-container { height: 44px; }
    .slider-btn { width: 44px; height: 44px; line-height: 44px; }
    .slider-text { line-height: 44px; font-size: 12px; }
    .captcha-footer { padding: 10px 16px; }
    .success-icon { font-size: 48px; width: 64px; height: 64px; }
    .success-text { font-size: 16px; }
}