/* 台账网页问答小窗口（2026-11-06）：src/assistant.js 生成的按钮和面板。颜色沿用 theme.css 的变量。 */
/* 按钮压在遮罩（70/80）、抽屉（100/101）、手机底部导航（100）下面：不能挡住「保存」「确认录入」这些按钮。
   面板是用户自己点开的，打开后放最上层（1000），有关闭按钮。 */
#fleet-assistant-btn {
  position: fixed; right: 20px; bottom: 20px; z-index: 60;
  width: 56px; height: 56px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--volt, #165DFF); color: #fff; font-size: 15px; font-weight: 600;
  box-shadow: 0 6px 18px rgba(15, 23, 42, .25);
}
#fleet-assistant-btn:hover { filter: brightness(1.08); }

#fleet-assistant-panel {
  position: fixed; right: 20px; bottom: 20px; z-index: 1000;
  width: 360px; height: 480px; max-height: calc(100vh - 40px);
  display: flex; flex-direction: column;
  background: var(--card, #fff); color: var(--ink, #1D2129);
  border: 1px solid var(--line, #E5E6EB); border-radius: 12px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, .22); overflow: hidden;
  font-size: 14px;
}
#fleet-assistant-panel[hidden], #fleet-assistant-btn[hidden] { display: none; }

#fleet-assistant-panel .fa-head {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px;
  background: var(--nav-bg, #0F2C66); color: var(--nav-fg, #E6ECF8);
}
#fleet-assistant-panel .fa-title { flex: 1; font-weight: 600; }
#fleet-assistant-panel .fa-link,
#fleet-assistant-panel .fa-close {
  border: none; background: transparent; color: inherit; cursor: pointer; font-size: 13px; padding: 2px 6px;
}
#fleet-assistant-panel .fa-close { font-size: 18px; line-height: 1; }

#fleet-assistant-panel .fa-log {
  flex: 1; overflow-y: auto; padding: 12px; background: var(--paper, #F3F5F9);
  display: flex; flex-direction: column; gap: 8px;
}
#fleet-assistant-panel .fa-msg {
  max-width: 88%; padding: 8px 10px; border-radius: 10px; line-height: 1.55;
  white-space: pre-wrap; word-break: break-word;
}
#fleet-assistant-panel .fa-user { align-self: flex-end; background: var(--volt, #165DFF); color: #fff; }
#fleet-assistant-panel .fa-bot { align-self: flex-start; background: var(--card, #fff); border: 1px solid var(--line, #E5E6EB); }
#fleet-assistant-panel .fa-waiting { color: var(--nav-muted, #8DA2C9); font-style: italic; }
#fleet-assistant-panel .fa-error { color: var(--clay-ink, #CB2634); background: var(--clay-soft, #FFECE8); }

#fleet-assistant-panel .fa-form {
  display: flex; gap: 8px; padding: 10px 12px 4px; border-top: 1px solid var(--line, #E5E6EB);
}
#fleet-assistant-panel textarea {
  flex: 1; resize: none; font: inherit; padding: 6px 8px;
  border: 1px solid var(--line-strong, #C9CDD4); border-radius: 8px;
}
#fleet-assistant-panel .fa-send {
  border: none; border-radius: 8px; padding: 0 14px; cursor: pointer;
  background: var(--volt, #165DFF); color: #fff; font-weight: 600;
}
#fleet-assistant-panel .fa-send:disabled, #fleet-assistant-panel textarea:disabled { opacity: .55; cursor: wait; }
#fleet-assistant-panel .fa-note {
  margin: 0; padding: 4px 12px 10px; font-size: 12px; color: var(--nav-muted, #8DA2C9);
}

/* 手机（≤768px，和 styles.css 的底部导航胶囊同一断点）：胶囊离底 10px、高 40px，按钮抬到它上面 */
@media (max-width: 768px) {
  #fleet-assistant-btn { right: 14px; bottom: calc(64px + env(safe-area-inset-bottom)); width: 48px; height: 48px; font-size: 14px; }
}

@media (max-width: 600px) {
  #fleet-assistant-panel { right: 0; bottom: 0; width: 100vw; height: 75vh; max-height: 100vh; border-radius: 12px 12px 0 0; }
}
