/* ============================================
   Mira App 原生适配样式

   Safe Area 部分：无条件生效（env() 在 Web 端返回 0，不影响）
   去网页感部分：html.native-app 下才生效（由 app-init.js 添加 class）
   ============================================ */

/* ---- WebView 底色：防止页面切换白闪 ---- */
html {
    background-color: #0f0e17;
}

/* ---- Safe Area 适配（无条件，env() 在普通浏览器返回 0px）---- */

/* 顶部安全区：避开刘海/灵动岛（排除自行管理布局的聊天页） */
body:not(.lucid-chat-page) {
    padding-top: env(safe-area-inset-top, 0px) !important;
}

/* 底部安全区由 lucid-nav.js 统一处理（含底部导航栏高度） */

/* 固定定位的导航栏也要偏移 safe area */
.lucid-nav {
    padding-top: env(safe-area-inset-top, 0px) !important;
}

.global-nav {
    padding-top: env(safe-area-inset-top, 0px) !important;
}

/* ---- 去网页感（仅原生 App，html.native-app 由 app-init.js 添加）---- */

/* 禁用文本选择 */
html.native-app body {
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    overscroll-behavior: none;
    touch-action: manipulation;
}

/* 输入框和文本区域仍然允许选择和粘贴 */
html.native-app input,
html.native-app textarea,
html.native-app [contenteditable="true"] {
    -webkit-user-select: text;
    user-select: text;
    -webkit-touch-callout: default;
}

/* 禁用链接和图片的长按菜单 */
html.native-app a,
html.native-app img {
    -webkit-touch-callout: none;
}

/* 消除 WKWebView 300ms 点击延迟 */
html.native-app a,
html.native-app button,
html.native-app [role="button"],
html.native-app .btn {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    cursor: pointer;
}

/* 隐藏滚动条 */
html.native-app ::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

html.native-app * {
    scrollbar-width: none;
}

/* 点击高亮去除 */
html.native-app * {
    -webkit-tap-highlight-color: transparent;
}

/* 禁用弹性滚动（CSS 层面） */
html.native-app {
    overscroll-behavior: none;
}
