@charset "UTF-8";
/* ==========================================================================
   批处理大师 Pro —— AI 使用助手气泡 + 在线反馈「带图上传」
   文件：assets/ai-assistant.20260912.css
   --------------------------------------------------------------------------
   为什么是独立文件（而不是并进 assets/style.20260914.css）：
     1) 站点约定「改公共 CSS/JS 必须物理改名再刷 CDN（?query 不参与缓存键）」。
        style.20260914.css 被 155 个页面引用，动它等于全站换版本。
        本文件带版本号、独立引入，改版只需换文件名，不影响其它页面。
     2) 线上 CSP 为 `style-src 'self' 'unsafe-inline'`：同源 CSS 文件可直接加载。
   命名前缀：`.jwai-`（AI 助手） / `.fbimg-`（反馈图片），与公共样式零冲突（已 grep 校验）。
   设计令牌：直接复用 style 里既有的 --pri / --acc / --radius / --shadow 等变量。
   ========================================================================== */

/* ---------------------------------------------------------------- 悬浮按钮 */
.jwai-fab {
  position: fixed;
  right: 28px;
  bottom: 88px; /* 让开公共样式的「回到顶部」按钮（right:28px / bottom:28px / z-index:400） */
  z-index: 1200;
  width: 56px;
  height: 56px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(135deg, var(--pri-dark, #4C1D95) 0%, var(--pri, #6E45E2) 55%, var(--pri-2, #8B5CF6) 100%);
  box-shadow: 0 10px 26px rgba(110, 69, 226, .38);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform .18s ease, box-shadow .18s ease;
  -webkit-tap-highlight-color: transparent;
}
.jwai-fab:hover { transform: translateY(-2px) scale(1.03); box-shadow: 0 14px 32px rgba(110, 69, 226, .48); }
.jwai-fab:active { transform: translateY(0) scale(.96); }
.jwai-fab svg { display: block; }

/* ------------------------------------------------------------------ 面板 */
.jwai-panel {
  position: fixed;
  right: 28px;
  bottom: 156px;
  z-index: 1201;
  width: 384px;
  max-width: calc(100vw - 24px);
  height: min(560px, calc(100vh - 190px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--card, #fff);
  border: 1px solid var(--line, #E5E7EB);
  border-radius: 16px;
  box-shadow: var(--shadow-lg, 0 12px 40px rgba(110, 69, 226, .14)), 0 2px 8px rgba(17, 24, 39, .06);
  font-family: inherit;
  color: var(--text, #1F2937);
  animation: jwai-in .18s ease-out;
}
.jwai-panel[hidden] { display: none; }
@keyframes jwai-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .jwai-panel { animation: none; } }

/* 头部 */
.jwai-head {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  background: linear-gradient(135deg, var(--pri-dark, #4C1D95) 0%, var(--pri, #6E45E2) 100%);
  color: #fff;
}
.jwai-ava {
  flex: 0 0 auto; width: 32px; height: 32px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, .2); font-size: 12px; font-weight: 800; letter-spacing: .5px;
}
.jwai-head-txt { flex: 1 1 auto; min-width: 0; }
.jwai-head-txt b { display: block; font-size: 14.5px; line-height: 1.3; }
.jwai-sub { display: block; font-size: 12px; opacity: .88; line-height: 1.5; }
.jwai-sub.jwai-sub-warn { color: #FFE0B2; opacity: 1; }
.jwai-x {
  flex: 0 0 auto; width: 30px; height: 30px; border: 0; border-radius: 8px;
  background: rgba(255, 255, 255, .16); color: #fff; font-size: 18px; line-height: 1;
  cursor: pointer; font-family: inherit;
}
.jwai-x:hover { background: rgba(255, 255, 255, .3); }

/* 消息区 */
.jwai-body {
  flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain;
  padding: 14px; display: flex; flex-direction: column; gap: 10px;
  background: var(--bg, #FAFAFC);
  -webkit-overflow-scrolling: touch;
}
.jwai-msg { max-width: 86%; padding: 9px 12px; border-radius: 12px; font-size: 13.5px; line-height: 1.65; white-space: pre-wrap; word-break: break-word; }
.jwai-msg.jwai-user { align-self: flex-end; background: var(--pri, #6E45E2); color: #fff; border-bottom-right-radius: 4px; }
.jwai-msg.jwai-asst { align-self: flex-start; background: #fff; border: 1px solid var(--line, #E5E7EB); border-bottom-left-radius: 4px; }
.jwai-msg.jwai-err { align-self: flex-start; background: #FFF7ED; border: 1px solid #FED7AA; color: #9A3412; font-size: 13px; max-width: 96%; }
.jwai-msg.jwai-hello { align-self: flex-start; background: #fff; border: 1px dashed var(--line, #E5E7EB); color: var(--muted, #6B7280); font-size: 13px; max-width: 96%; }
.jwai-typing { align-self: flex-start; display: inline-flex; gap: 4px; padding: 11px 14px; background: #fff; border: 1px solid var(--line, #E5E7EB); border-radius: 12px; }
.jwai-typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--pri-2, #8B5CF6); animation: jwai-blink 1.1s infinite ease-in-out; }
.jwai-typing i:nth-child(2) { animation-delay: .16s; }
.jwai-typing i:nth-child(3) { animation-delay: .32s; }
@keyframes jwai-blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

/* 提示条 */
.jwai-note { display: none; padding: 9px 14px; font-size: 12.5px; line-height: 1.6; background: #FFF7ED; border-top: 1px solid #FED7AA; color: #9A3412; }
.jwai-note.jwai-note-show { display: block; }
.jwai-note.jwai-note-ok { background: #ECFDF5; border-top-color: #A7F3D0; color: #065F46; }
.jwai-note.jwai-note-info { background: #EFF6FF; border-top-color: #BFDBFE; color: #1E40AF; }

/* 联系方式（仅在「AI 帮我反馈」时出现） */
.jwai-contact { display: none; padding: 9px 14px 0; }
.jwai-contact.jwai-contact-show { display: block; }
.jwai-contact input {
  width: 100%; padding: 8px 11px; font-size: 13px; font-family: inherit;
  border: 1px solid var(--line, #E5E7EB); border-radius: 10px; background: #fff; color: var(--text, #1F2937);
}
.jwai-contact input:focus { outline: none; border-color: var(--pri, #6E45E2); box-shadow: 0 0 0 3px rgba(110, 69, 226, .12); }

/* 输入区 */
.jwai-foot { display: flex; align-items: flex-end; gap: 8px; padding: 10px 14px 6px; border-top: 1px solid var(--line, #E5E7EB); background: #fff; }
.jwai-foot textarea {
  flex: 1 1 auto; min-height: 40px; max-height: 108px; resize: none;
  padding: 10px 12px; font-size: 13.5px; line-height: 1.55; font-family: inherit;
  border: 1px solid var(--line, #E5E7EB); border-radius: 10px; background: #fff; color: var(--text, #1F2937);
}
.jwai-foot textarea:focus { outline: none; border-color: var(--pri, #6E45E2); box-shadow: 0 0 0 3px rgba(110, 69, 226, .12); }
.jwai-foot textarea:disabled { background: #F3F4F6; color: #9CA3AF; cursor: not-allowed; }
.jwai-send {
  flex: 0 0 auto; height: 40px; padding: 0 16px; border: 0; border-radius: 10px;
  background: linear-gradient(135deg, var(--pri-dark, #4C1D95) 0%, var(--pri, #6E45E2) 100%);
  color: #fff; font-size: 13.5px; font-weight: 600; cursor: pointer; font-family: inherit;
}
.jwai-send:hover:not(:disabled) { filter: brightness(1.08); }
.jwai-send:disabled { background: #D1D5DB; color: #F9FAFB; cursor: not-allowed; }

/* 工具行 */
.jwai-tools { display: flex; align-items: center; gap: 8px; padding: 6px 14px 12px; background: #fff; }
.jwai-tool-btn {
  padding: 6px 11px; font-size: 12.5px; font-family: inherit; cursor: pointer;
  border: 1px solid var(--line, #E5E7EB); border-radius: 999px; background: #fff; color: var(--text, #1F2937);
}
.jwai-tool-btn:hover:not(:disabled) { border-color: var(--pri, #6E45E2); color: var(--pri, #6E45E2); }
.jwai-tool-btn.jwai-primary { border-color: transparent; background: rgba(110, 69, 226, .1); color: var(--pri-dark, #4C1D95); font-weight: 600; }
.jwai-tool-btn:disabled { opacity: .55; cursor: not-allowed; }
.jwai-count { margin-left: auto; font-size: 11.5px; color: var(--muted, #6B7280); font-variant-numeric: tabular-nums; }
.jwai-count.jwai-count-over { color: #B91C1C; font-weight: 700; }

/* 焦点可达（与公共样式同口径） */
.jwai-fab:focus-visible, .jwai-x:focus-visible, .jwai-send:focus-visible,
.jwai-tool-btn:focus-visible, .jwai-panel input:focus-visible, .jwai-panel textarea:focus-visible {
  outline: 3px solid #fff; outline-offset: 2px; box-shadow: 0 0 0 5px var(--pri, #6E45E2);
}

/* ------------------------------------------------- 移动端：面板不超屏宽 */
@media (max-width: 560px) {
  .jwai-fab { right: 16px; bottom: 74px; width: 52px; height: 52px; }
  .jwai-panel {
    left: 0; right: 0; bottom: 0; width: auto; max-width: 100vw;
    height: min(78vh, 620px);
    border-left: 0; border-right: 0; border-bottom: 0;
    border-radius: 16px 16px 0 0;
  }
  .jwai-body { padding: 12px; }
  .jwai-msg { max-width: 92%; }
}

/* ==========================================================================
   二、反馈表单「带图上传」（仅 help.html 使用）
   运行时插入到 #fbForm 的 .fb-actions 之前，复用站点的 .field / .field-hint 视觉。
   ========================================================================== */
.fbimg-drop {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  padding: 12px 14px; border: 1px dashed #D8D2F0; border-radius: var(--radius, 14px);
  background: #FBFAFF;
}
.fbimg-input { display: none; }
.fbimg-hint { flex: 1 1 180px; min-width: 0; font-size: 12.5px; line-height: 1.6; color: var(--muted, #6B7280); }
.fbimg-pick {
  flex: 0 0 auto; padding: 8px 14px; font-size: 13px; font-family: inherit; font-weight: 600;
  border: 1px solid var(--pri, #6E45E2); border-radius: 10px; background: #fff; color: var(--pri, #6E45E2); cursor: pointer;
}
.fbimg-pick:hover:not(:disabled) { background: rgba(110, 69, 226, .08); }
.fbimg-pick:disabled { opacity: .5; cursor: not-allowed; }
.fbimg-list { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; margin: 0; padding: 0; }
.fbimg-list:empty { display: none; }
.fbimg-item {
  position: relative; width: 104px; padding: 6px; border: 1px solid var(--line, #E5E7EB);
  border-radius: 12px; background: #fff; text-align: center;
}
.fbimg-item img { display: block; width: 100%; height: 66px; object-fit: cover; border-radius: 8px; background: #F3F4F6; }
.fbimg-meta { display: block; margin-top: 5px; font-size: 11px; line-height: 1.45; color: var(--muted, #6B7280); word-break: break-all; }
.fbimg-meta b { color: var(--text, #1F2937); font-weight: 600; }
.fbimg-del {
  position: absolute; top: -7px; right: -7px; width: 22px; height: 22px; padding: 0;
  border: 2px solid #fff; border-radius: 50%; background: #EF4444; color: #fff;
  font-size: 13px; line-height: 1; cursor: pointer; font-family: inherit;
}
.fbimg-del:hover { background: #DC2626; }
.fbimg-msg { font-size: 12.5px; line-height: 1.6; color: var(--muted, #6B7280); }
.fbimg-msg.jwai-bad { color: #B91C1C; font-weight: 600; }
.fbimg-msg.jwai-good { color: #047857; }
.fbimg-pick:focus-visible, .fbimg-del:focus-visible { outline: 3px solid var(--pri, #6E45E2); outline-offset: 2px; }
