/* AI 写作页：回答区滚动，发送框紧凑并始终位于底部导航上方。 */
body.ai-writing-scroll uni-page-body{
  min-height:100vh!important;
  height:var(--ai-visual-height,100vh)!important;
  min-height:100dvh!important;
  height:var(--ai-visual-height,100dvh)!important;
  overflow:hidden!important;
  padding-bottom:0!important;
  background:#f5f5f5!important;
}
body.ai-writing-scroll uni-page-body>uni-view:first-child{
  display:block!important;
  height:calc(var(--ai-visual-height,100vh) - var(--window-bottom) - 138px)!important;
  min-height:0!important;
  overflow-x:hidden!important;
  overflow-y:auto!important;
  -webkit-overflow-scrolling:touch!important;
  box-sizing:border-box!important;
  padding-bottom:16px!important;
}
/* This class is added after locating the real “请输入您的问题” input. */
body.ai-writing-scroll .ai-writing-composer{
  position:fixed!important;
  right:0!important;
  left:0!important;
  /* Do not use --window-bottom here: this project defines it with a negative
     offset on some mobile browsers, which pulls the composer into the nav. */
  bottom:80px!important;
  bottom:calc(80px + env(safe-area-inset-bottom))!important;
  z-index:980!important;
  width:100%!important;
  height:54px!important;
  min-height:54px!important;
  max-height:54px!important;
  margin:0!important;
  padding:6px 10px!important;
  box-sizing:border-box!important;
  overflow:hidden!important;
  box-shadow:0 -2px 10px rgba(10,35,57,.10)!important;
}
body.ai-writing-scroll .ai-writing-composer uni-input,
body.ai-writing-scroll .ai-writing-composer .base-btn{
  height:40px!important;
  min-height:40px!important;
  max-height:40px!important;
  line-height:40px!important;
}
/* The AI preview page has a more specific original bottom rule. Override only
   this composer so it remains 8px above the fixed 72px navigation bar. */
body.ai-writing-scroll.ai-question-preview .ub.ub-h.ub-box.uinn.ai-writing-composer{
  bottom:80px!important;
}

/* Fallback when the generated Uni input wrapper is not found by script. */
body.ai-writing-scroll uni-page-body > uni-view[style*="bottom"]{
  position:fixed!important;
  right:0!important;
  bottom:72px!important;
  left:0!important;
  z-index:12000!important;
  min-height:64px!important;
  height:64px!important;
  margin:0!important;
  padding:8px 10px!important;
  background:#fff!important;
  box-sizing:border-box!important;
  box-shadow:0 -2px 10px rgba(10,35,57,.12)!important;
}
body.ai-writing-scroll uni-page-body > uni-view[style*="bottom"] uni-input,
body.ai-writing-scroll uni-page-body > uni-view[style*="bottom"] .base-btn{
  min-height:44px!important;
  height:44px!important;
  line-height:44px!important;
}
body.ai-writing-scroll uni-page-body > uni-view:first-child{
  padding-bottom:148px!important;
}
