* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.login-container {
    position: relative;
    width: 100%;
    max-width: 450px;
    margin: 0 auto;
    padding: 20px;
}

.login-wrapper {
    position: relative;
    background: #fff;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    z-index: 10;
}

.login-bg {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="60" height="60"><g fill="none" fill-rule="evenodd"><g fill="%23ffffff" fill-opacity="0.03"><path d="M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z"/></g></g></svg>');
    background-size: 60px 60px;
    z-index: 0;
}

.login-logo {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo i {
    font-size: 48px;
    color: #667eea;
    margin-bottom: 15px;
    display: block;
}

.login-logo h1 {
    font-size: 28px;
    color: #333;
    margin-bottom: 8px;
}

.login-logo p {
    font-size: 14px;
    color: #999;
}

.login-form {
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.input-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 16px;
}

.input-wrapper input {
    width: 100%;
    padding: 15px 15px 15px 45px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.input-wrapper input:focus {
    outline: none;
    border-color: #667eea;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.input-wrapper input::placeholder {
    color: #bbb;
}

.toggle-password {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 16px;
    outline: none;
}

.toggle-password:hover {
    color: #667eea;
}

.form-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.form-row-left {
    display: flex;
    align-items: center;
}

.checkbox-wrap {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.checkbox-wrap input {
    margin-right: 8px;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.checkbox-wrap span {
    font-size: 14px;
    color: #666;
}

.forgot-link {
    font-size: 14px;
    color: #667eea;
    text-decoration: none;
}

.forgot-link:hover {
    text-decoration: underline;
}

.login-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.login-btn:active {
    transform: translateY(0);
}

.login-btn i {
    margin-left: 10px;
    font-size: 18px;
}

.login-footer {
    text-align: center;
}

.login-footer p {
    font-size: 13px;
    color: #999;
}

.message-container {
    margin-bottom: 15px;
}

.message {
    padding: 12px 15px;
    border-radius: 8px;
    font-size: 14px;
    animation: shake 0.3s ease;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-5px);
    }
    75% {
        transform: translateX(5px);
    }
}

.captcha-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

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

.captcha-modal {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: white;
    border-radius: 16px;
    padding: 30px;
    width: calc(100% - 40px);
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
}

.captcha-modal-overlay.show .captcha-modal {
    transform: translate(-50%, -50%) scale(1);
}

.captcha-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 18px;
    transition: color 0.3s ease;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.captcha-modal-close:hover {
    color: #666;
}

.captcha-modal-header {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
    text-align: center;
}

.captcha-modal-body {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.captcha-refresh {
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 8px;
    color: #667eea;
    cursor: pointer;
    font-size: 14px;
    padding: 8px 20px;
    margin-top: 15px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.captcha-refresh:hover {
    background: #e8e8e8;
    border-color: #ccc;
}

.captcha-box {
    position: relative;
    width: 100%;
    height: 120px;
    background: #f5f5f5;
    border-radius: 8px;
    overflow: hidden;
    user-select: none;
}

.captcha-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #667eea 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.3);
    font-size: 24px;
    font-weight: bold;
}

.captcha-gap {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 80px;
    background: #ddd;
    border: 2px dashed #999;
    border-radius: 4px;
}

.captcha-slider {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: 5px;
    width: 40px;
    height: 80px;
    cursor: grab;
    z-index: 10;
    transition: transform 0.1s ease;
}

.slider-block {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    position: relative;
}

.slider-block::before,
.slider-block::after {
    content: '';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 10px;
    background: rgba(255,255,255,0.4);
    border-radius: 50%;
}

.slider-block::before {
    left: 8px;
}

.slider-block::after {
    right: 8px;
}

.slider-block::before {
    box-shadow: 0 0 0 3px rgba(255,255,255,0.2);
}

.captcha-slider:hover .slider-block {
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4);
}

.captcha-slider:active {
    cursor: grabbing;
}

.captcha-slider.dragging .slider-block {
    box-shadow: 0 4px 20px rgba(76, 175, 80, 0.5);
    transform: scale(1.02);
}

.captcha-slider.success .slider-block {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    box-shadow: 0 0 20px rgba(40, 167, 69, 0.5);
}

.captcha-slider.success {
    animation: successPulse 0.5s ease;
}

@keyframes successPulse {
    0%, 100% { transform: translateY(-50%) scale(1); }
    50% { transform: translateY(-50%) scale(1.05); }
}

.captcha-tip {
    text-align: center;
    font-size: 12px;
    color: #999;
    margin-top: 8px;
    min-height: 18px;
}

.captcha-tip.success {
    color: #4CAF50;
}

.captcha-tip.error {
    color: #dc3545;
}

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

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

@media (max-width: 500px) {
    .login-wrapper {
        padding: 30px 20px;
    }
    
    .login-logo h1 {
        font-size: 24px;
    }
    
    .captcha-modal-overlay {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .captcha-modal {
        width: calc(100% - 40px) !important;
        max-width: 360px !important;
        padding: 25px 20px !important;
        position: absolute !important;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) scale(0.9) !important;
        box-sizing: border-box !important;
    }
    
    .captcha-modal-overlay.show .captcha-modal {
        transform: translate(-50%, -50%) scale(1) !important;
    }
    
    .captcha-box {
        height: 100px;
    }
    
    .captcha-gap,
    .captcha-slider {
        height: 70px;
    }
}