/* Hermes Web UI — 手机端增强 (hermes.aiwzd.vip)
   通过 nginx sub_filter 注入, 不改 npm 包本体, web-ui 升级不影响 */

/* ── PWA 基础 ─────────────────────────────── */
:root { --safe-b: env(safe-area-inset-bottom, 0px); }

/* iOS Safari 顶栏安全区: 汉堡键/头部不刘海遮挡 */
.hamburger-btn { top: calc(10px + env(safe-area-inset-top, 0px)) !important; }
@media (max-width: 768px) {
  .app-layout { padding-top: env(safe-area-inset-top, 0px); }
  .sidebar { padding-top: env(safe-area-inset-top, 0px) !important; }
  .sidebar-logo { padding-top: 16px !important; }
}

/* 禁用双击缩放 / 长按呼出菜单 (类原生手感), 保留输入框选择能力 */
html { touch-action: manipulation; }
.input-textarea, textarea, input, [contenteditable="true"] {
  -webkit-user-select: text; user-select: text; touch-action: auto;
}
body { -webkit-tap-highlight-color: transparent; }

/* 输入区底部安全区 (iPhone 小黑条), 键盘弹出时输入框可见 */
.chat-input-area { padding-bottom: calc(12px + var(--safe-b)) !important; }
.approval-bar { margin-bottom: 4px !important; }

/* ── 触控目标加大 ─────────────────────────── */
@media (max-width: 768px) {
  .input-actions button,
  .header-actions button,
  .header-actions .btn,
  .drawer-button { min-width: 40px !important; min-height: 40px !important; }
  .session-list { max-width: 86vw !important; }
  /* 会话列表条目高度 */
  .session-item { min-height: 48px !important; }
  /* 消息区左右留白收紧 */
  .messages-container, .chat-messages { padding-left: 10px !important; padding-right: 10px !important; }
}

/* ── 滚动条隐藏 (原生感) ─────────────────── */
@media (max-width: 768px) {
  ::-webkit-scrollbar { width: 0 !important; height: 0 !important; }
  * { scrollbar-width: none; }
}

/* ── 键盘弹出时避免整体顶起 (visualViewport 补偿由 sw 注册脚本处理) ── */
@supports (height: 100dvh) {
  html.keyboard-open .app-layout { height: 100dvh; }
}
