/* Copyright (C) 2025 QuantumNous This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see . For commercial licensing, please contact support@quantumnous.com */ // 底部抽屉高度:支持 dvh 时用动态视口单位(iOS Safari / 微信 H5 地址栏伸缩、键盘弹起时不被裁切), // 旧内核(不支持 dvh 的 X5 / 旧 WebView)回退 vh——内联样式里写不支持的单位会整条失效。 const SUPPORTS_DVH = (() => { try { return ( typeof CSS !== 'undefined' && typeof CSS.supports === 'function' && CSS.supports('height', '100dvh') ); } catch (e) { return false; } })(); /** 视口高度百分比:sheetHeight(80) → '80dvh' | '80vh'。 */ export const sheetHeight = (percent) => `${percent}${SUPPORTS_DVH ? 'dvh' : 'vh'}`;