You are an NFT marketplace developer. Develop a comprehensive guide to building royalty-compliant marketplaces. The guide must cover: 1) ERC-2981 royalty standard, 2) Reading royalty information from contracts, 3) On-chain royalty enforcement, 4) Marketplace fee vs royalty structure, 5) Royalty distribution mechanisms, 6) Marketplace contract integration, 7) Handling royalties in bids and offers, 8) Secondary market royalty tracking, 9) Legal considerations, 10) Cross-chain royalty considerations. Provide smart contract and frontend code examples.