 import { Device } from '@capacitor/device';
 


// 获取刘海高度（改进版）
export const  getNotchHeight = async () => {
  // 方法1：通过CSS变量获取
  const rootStyles = getComputedStyle(document.documentElement);
  const cssHeight = rootStyles.getPropertyValue('--status-bar-height');
  
  if (cssHeight && cssHeight !== '0px') {
    return parseInt(cssHeight);
  }
  
  // 方法2：创建测试元素检测
  const testEl = document.createElement('div');
  testEl.style.position = 'fixed';
  testEl.style.top = '0';
  testEl.style.height = '0';
  testEl.style.paddingTop = 'env(safe-area-inset-top)';
  testEl.style.visibility = 'hidden';
  document.body.appendChild(testEl);
  
  const computedHeight = window.getComputedStyle(testEl).paddingTop;
  document.body.removeChild(testEl);
  
  if (computedHeight && computedHeight !== '0px') {
    return parseInt(computedHeight);
  }
  
  // 方法3：根据平台返回默认值
  const info = await Device.getInfo();
  return info.platform === 'ios' ? 44 : info.platform === 'android' ? 24 : 0;
};
 


// 获取底部安全区域高度
export const getSafeAreaInsets = async () => {
 
}