export function resolveH5ApiBase() {
  const configured = import.meta.env.VITE_H5_API_ORIGIN;
  if (configured) return String(configured).replace(/\/$/, '');
  if (import.meta.env.DEV) return 'http://127.0.0.1:8081';
  if (typeof window !== 'undefined') return window.location.origin;
  return '';
}
