/* ============================================================
   final-fix.css  上线前最后一批定位/对齐修复（最后加载，权威覆盖）
   1) 大模型「对话历史」面板：停靠推开（不覆盖聊天）、不透明、竖条把手方向修正
   2) 生成中「停止」按钮：可靠 flex、右缘对齐气泡、紧贴气泡上方
   3) AI漫剧S2 项目态顶部空白色带：顶栏悬浮透明，内容上移
   ============================================================ */

/* ---------- 1. 对话历史：停靠推开 ---------- */
.ws-main{ transition:margin-left .22s ease; }
@media (min-width:992px){
  body:has(#historyPanel:not(.hidden)) .ws-main{
    margin-left:294px !important;
  }
}
/* 面板不透明（参考站为实心侧栏，非半透明浮层） */
#historyPanel.history-panel{
  background:rgba(13,16,25,.98) !important;
  backdrop-filter:none !important;
  -webkit-backdrop-filter:none !important;
}
/* 竖条把手：位于侧栏右缘、伸入聊天区，圆角在右、阴影在右 */
.ws-v2 .sb-history-rail{
  border-radius:0 14px 14px 0 !important;
  border-left:0 !important;
  border-right:1px solid rgba(255,255,255,.08) !important;
  box-shadow:8px 0 26px rgba(0,0,0,.35) !important;
}
/* 面板打开时把手隐藏（面板本身即占住侧栏右缘） */
body:has(#historyPanel:not(.hidden)) .ws-v2 .sb-history-rail{
  display:none !important;
}
/* 移动端保持浮层，不推开 */
@media (max-width:991px){
  body:has(#historyPanel:not(.hidden)) .ws-main{ margin-left:0 !important; }
}

/* ---------- 2. 停止按钮：紧贴气泡上方、右缘对齐 ---------- */
/* 强制 flex（此前规则被后层样式覆盖为 block，导致按钮错位悬空） */
.chat-bubble.assistant .cb-top-row{
  display:none !important;
  width:100%;
  flex:0 0 auto;
  flex-direction:row;
  align-items:center;
  justify-content:flex-end;
  margin-bottom:6px;
}
.chat-bubble.assistant.is-generating .cb-top-row{
  display:flex !important;
}
/* 模型名排到最上，停止行紧随其后（紧贴气泡） */
.chat-bubble.assistant .cb-col{ display:flex; flex-direction:column; }
.chat-bubble.assistant .cb-name{ order:-1; }
.chat-bubble.assistant .cb-top-row{ order:0; }
.chat-bubble.assistant .cb-col > p{ order:1; }
.chat-bubble.assistant .cb-col .cb-bottom{ order:2; }
.chat-bubble.assistant .cb-stop-btn{
  flex:0 0 auto;
}

/* ---------- 3. AI漫剧S2 项目态：顶部空白色带改为悬浮透明 ---------- */
.ws-main.s2proj-state-open > .ws-topbar{
  position:absolute !important;
  left:0; right:0; top:0;
  height:auto !important;
  background:transparent !important;
  border-bottom:0 !important;
  pointer-events:none;
  z-index:60;
}
.ws-main.s2proj-state-open > .ws-topbar > *{ pointer-events:auto; }
