body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 10px;
    box-sizing: border-box;
    overflow-x: hidden;
}

.login-container {
    background-color: rgba(255, 255, 255, 0.95);
    padding: 30px 20px;
    border-radius: 16px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 380px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.login-container:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.25);
}

.login-container h2 {
    text-align: center;
    margin-bottom: 25px;
    color: #333;
    font-weight: 600;
    font-size: 24px;
    margin-top: 0;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 500;
    font-size: 14px;
}

.form-group input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e1e1e1;
    border-radius: 8px;
    box-sizing: border-box;
    font-size: 16px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    -webkit-appearance: none;
    -moz-appearance: textfield;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.captcha-group {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-direction: row;
}

.captcha-group input {
    width: 120px;
    flex: none;
}

.captcha-img {
    height: 50px;
    width: 140px;
    object-fit: contain;
    border: 2px solid #e1e1e1;
    border-radius: 8px;
    cursor: pointer;
    padding: 2px;
    transition: border-color 0.3s ease, transform 0.2s ease;
    align-self: center;
}

.captcha-img:hover {
    border-color: #667eea;
    transform: scale(1.03);
}

.btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-top: 10px;
}

.btn:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

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

.error-message {
    color: #e74c3c;
    font-size: 14px;
    margin-top: 15px;
    text-align: center;
    padding: 12px;
    border-radius: 4px;
    background-color: #fdf2f2;
    border: 1px solid #f1d1d1;
    display: none;
    word-wrap: break-word;
}

.error-message.show {
    display: block;
}

.login-title {
    text-align: center;
    margin-bottom: 25px;
    color: #333;
    font-weight: 600;
    font-size: 24px;
}

.login-icon {
    text-align: center;
    margin-bottom: 10px;
}

.login-icon i {
    font-size: 40px;
    color: #667eea;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* 移动设备特定样式 */
@media (max-width: 480px) {
    .login-container {
        padding: 25px 15px;
        margin: 10px;
    }
    
    .login-container h2 {
        font-size: 22px;
    }
    
    .form-group {
        margin-bottom: 16px;
    }
    
    .captcha-group {
        flex-direction: column;
        gap: 12px;
    }
    
    .captcha-group input {
        width: 100%;
    }
    
    .captcha-img {
        height: 55px;
        width: 100%;
    }
    
    .btn {
        padding: 16px;
        font-size: 17px;
    }
    
    .login-icon i {
        font-size: 36px;
    }
    
    body {
        padding: 5px;
    }
}

/* 针对触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    .captcha-img {
        height: 60px; /* 增大触摸区域 */
    }
    
    .btn {
        padding: 18px;
    }
    
    .form-group input {
        padding: 16px;
    }
}

/* 密码输入组样式 */
.password-input-group {
    position: relative;
    width: 100%;
}

.password-input-group input {
    width: 100%;
    padding-right: 55px; /* 为按钮留出空间 */
}

/* 密码显示/隐藏按钮样式 */
.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    color: #666;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.toggle-password:hover {
    background-color: rgba(0, 0, 0, 0.05);
    color: #333;
}

.toggle-password:focus {
    outline: none;
    background-color: rgba(0, 0, 0, 0.1);
}

/* 登录按钮加载状态 */
.btn .loading {
    display: inline-block;
    font-size: 14px;
    opacity: 0.9;
}

.btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn:disabled:hover {
    transform: none;
    box-shadow: none;
}