Don't steal code, replicate functionality. Don't steal graphics, but be inspired by a website's theme. Dont's steal trademarked or copyrighted material.
So one line would be: if the idea isn't patented, or it is, but you don't think the patent is valid, and have the money to back up your claim, or just feel ornery, then go for it.
People replicate functionality all the time. Why should that be unethical? I wouldn't just replicate it for no good reason. A good reason, and one that the spirit of the law is supposed to support, is, does it provide new value to the customer? Coincidentally, that is the same question you should be asking yourself if you plan to take your work to market.