/* MAQSU Mobile — 注入到 Odoo 页面的移动端优化样式 */

html[data-maqsu-mobile] body {
  -webkit-text-size-adjust: 100%;
  overscroll-behavior-y: none;
}

/* 顶部加载条 */
#maqsu-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  background: linear-gradient(90deg, #714b67, #875a7b);
  z-index: 20000;
  transition: width .25s ease, opacity .3s ease;
  box-shadow: 0 0 8px rgba(113, 75, 103, .45);
}
#maqsu-progress.on {
  width: 75%;
  transition: width 1.2s ease;
}
#maqsu-progress.done {
  width: 100%;
  opacity: 0;
}

/* 移动端返回/主页悬浮按钮 */
#maqsu-fab {
  position: fixed;
  right: 14px;
  bottom: calc(14px + env(safe-area-inset-bottom));
  width: 46px;
  height: 46px;
  border-radius: 23px;
  background: #714b67;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .28);
  z-index: 19999;
  text-decoration: none;
  border: 0;
  cursor: pointer;
}

/* 触摸目标放大 */
html[data-maqsu-mobile] .o_form_button,
html[data-maqsu-mobile] .o_cp_button,
html[data-maqsu-mobile] button {
  min-height: 40px;
}

/* 表格横向滚动 */
html[data-maqsu-mobile] .o_table_view {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

html[data-maqsu-mobile] .o_menu_sections,
html[data-maqsu-mobile] .o_navigation {
  scroll-behavior: smooth;
}

/* 隐藏 Odoo 移动端不友好的桌面提示条 */
html[data-maqsu-mobile] .o_web_client > .o_main_navbar > .o_menu_brand_sheet {
  padding-left: 10px;
}

/* 打印/下载中提示 */
#maqsu-toast {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(78px + env(safe-area-inset-bottom));
  background: rgba(30, 25, 30, .92);
  color: #fff;
  font: 14px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif;
  padding: 10px 16px;
  border-radius: 20px;
  z-index: 20001;
  max-width: 80vw;
  text-align: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .3);
}
