/* 验证码模态框样式 */
.captcha-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.captcha-modal.show {
    opacity: 1;
    visibility: visible;
}

.captcha-modal-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    padding: 0;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    transform: scale(0.7) translateY(-50px);
    transition: all 0.3s ease;
    color: white;
    overflow: hidden;
}

.captcha-modal-content.show {
    transform: scale(1) translateY(0);
}

.captcha-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.captcha-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.close-captcha {
    cursor: pointer;
    font-size: 28px;
    line-height: 1;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.close-captcha:hover {
    opacity: 1;
}

.captcha-body {
    padding: 25px;
    background: rgba(255, 255, 255, 0.95);
    color: #333;
}

.captcha-instruction {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    font-weight: 500;
    color: #555;
}

.captcha-canvas-container {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    overflow: auto;
    padding: 3px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

#captcha-canvas {
    border: none;
    border-radius: 12px;
    cursor: crosshair;
    transition: all 0.2s;
    display: block;
    background: white;
}

.captcha-canvas-container:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.captcha-progress {
    text-align: center;
}

.progress-dots {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 15px;
}

.progress-dots .dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ddd;
    transition: all 0.3s ease;
}

.progress-dots .dot.active {
    background: linear-gradient(45deg, #667eea, #764ba2);
    transform: scale(1.3);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

.progress-text {
    margin: 0;
    color: #666;
    font-size: 14px;
}

.progress-text span {
    color: #667eea;
    font-weight: 600;
}

/* 用户协议模态框样式 */
.agreement-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.agreement-modal.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: white;
    border-radius: 15px;
    padding: 0;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    transform: scale(0.7) translateY(-50px);
    transition: all 0.3s ease;
    overflow: hidden;
}

.modal-content.show {
    transform: scale(1) translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #eee;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.close-modal {
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.close-modal:hover {
    opacity: 1;
}

.modal-body {
    padding: 25px;
    max-height: 60vh;
    overflow-y: auto;
    color: #333;
    line-height: 1.6;
}

.modal-body p {
    margin-bottom: 15px;
}

/* 移动端响应式 */
@media (max-width: 480px) {
    .captcha-modal-content {
        width: 95%;
        margin: 20px;
    }

    .captcha-body {
        padding: 20px;
    }

    .captcha-canvas-container {
        overflow-x: auto;
        padding: 2px;
        margin-bottom: 15px;
    }

    #captcha-canvas {
        min-width: 280px;
    }

    .captcha-instruction {
        flex-direction: column;
        gap: 10px;
        text-align: center;
        margin-bottom: 15px;
    }

    .captcha-instruction img {
        margin-left: 0 !important;
    }

    .captcha-header {
        padding: 15px 20px;
    }

    .captcha-header h3 {
        font-size: 18px;
    }

    .close-captcha {
        font-size: 24px;
    }

    .progress-dots {
        gap: 10px;
    }

    .progress-dots .dot {
        width: 10px;
        height: 10px;
    }

    .progress-text {
        font-size: 13px;
    }
}

/* 超小屏幕适配 */
@media (max-width: 360px) {
    .captcha-modal-content {
        width: 98%;
        margin: 10px;
    }

    .captcha-body {
        padding: 15px;
    }

    .captcha-header {
        padding: 12px 15px;
    }

    .captcha-instruction {
        margin-bottom: 12px;
        font-size: 14px;
    }

    .captcha-canvas-container {
        margin-bottom: 12px;
    }
}

/* 横屏模式适配 */
@media (max-height: 600px) and (orientation: landscape) {
    .captcha-modal-content {
        max-height: 90vh;
        overflow-y: auto;
    }

    .captcha-body {
        padding: 15px 25px;
    }

    .captcha-instruction {
        margin-bottom: 15px;
    }

    .captcha-canvas-container {
        margin-bottom: 15px;
    }
}

/* Toast 通知样式 */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 20000;
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.3s ease;
    max-width: 300px;
    border-left: 4px solid #ddd;
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast.success {
    border-left-color: #4CAF50;
    color: #2E7D32;
}

.toast.error {
    border-left-color: #f44336;
    color: #C62828;
}

.toast.info {
    border-left-color: #2196F3;
    color: #1565C0;
}

/* 高分辨率屏幕优化 */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    #captcha-canvas {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}