/* ============================================================
   XINY 小助手增强 · agent-panel-20261013
   ------------------------------------------------------------
   必须在 canvas.html 的最后加载（放在 composer-final.css 之后），
   靠「后加载覆盖同优先级」压过 canvas-app-20261010-genericapi.css 里的
   .xc-agent / .xc-agent-input 定义，避免去改那几个大文件。
   现有基线（genericapi.css）：
     .xc-agent            width 384px, max-height min(560px, 100% - 150px)
     .xc-agent-body       min-height 150px
     .xc-agent-input textarea  min-height 38px, max-height 140px
   本文件做「放大 + 新部件 + 输入区版式重排」。
   ⚠️ 2026-10-13 起本文件也动配色（仅限小助手面板内部）：
      · 输入区改成整宽卡片，底色比面板亮一档（#3a3a3a），不再是 --inset 黑底
      · 结果卡片（生成面板）整宽贴边，与面板框同宽
      · 发送键改成白色圆形，与画布生成面板的发送键统一
     这几处写死的灰阶都配了 html[data-theme='light'] 翻面规则（见第 9 节）。
   ============================================================ */

/* ---------- 1. 面板与输入框放大 ---------- */
.xc-agent {
  width: 600px;
  max-width: calc(100% - 32px);
  max-height: min(800px, calc(100% - 110px));
  border-radius: 20px;
}

/* 内容区左右只留 8px —— 结果卡片「离边线稍微有点距离」，但基本占满宽度；
   文字类内容再各自加 6px，维持原本 14px 的阅读留白。 */
.xc-agent-body {
  min-height: 260px;
  padding: 10px 8px 12px;
  gap: 10px;
}
.xc-agent-body > *:not(.xa-card) {
  margin-left: 6px;
  margin-right: 6px;
}

.xc-agent-foot {
  padding: 10px 12px 12px;
}

/* ---------- 1.1 消息不要「微信气泡」—— 照 codex 那样纯文字排版（第 8 版） ----------
   用户原话：「上面的生成文字不要带框，就和 codex 一样的文字排版就行了，
   不需要像微信一样一段话带个框」。
   基线（genericapi.css）里 .is-user / .is-assistant 各有一块底色 + 12px 圆角 + 88%/96% 宽度，
   这里全部拆掉：等宽整行、无底无框、行高放松，靠左边一个「›」区分是谁说的。
   ⚠️ 只认 .xc-agent-body 里的消息 —— 决策卡片（.xa-card）是卡片，不受影响。 */
.xc-agent-body .xc-agent-msg {
  max-width: 100%;
  align-self: stretch;
  padding: 0;
  border-radius: 0;
  background: transparent;
  font-size: 13px;
  line-height: 1.9;
}
/* 用户自己那句话：照参考图是**右侧的浅色圆角块**（助手那边才是纯文字）。
   2026-10-13 第 9 版按 TapNow 模板改成这个样子。 */
.xc-agent-body .xc-agent-msg.is-user {
  align-self: flex-end;
  max-width: 82%;
  margin-right: 26px;        /* 给右边的复制钮留个位（照参考图一） */
  padding: 9px 13px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .09);
  color: var(--fg);
  font-weight: 400;
}
html[data-theme='light'] .xc-agent-body .xc-agent-msg.is-user { background: rgba(0, 0, 0, .06); }
.xc-agent-body .xc-agent-msg.is-assistant {
  background: transparent;
  color: var(--fg);
}
/* 两条消息之间留点气，不然纯文字会连成一片 */
.xc-agent-body .xc-agent-msg + .xc-agent-msg { margin-top: 4px; }

/* 每条消息的「复制」小钮（第 12 版）。
   平时隐藏、悬停才出现 —— 落在角落里不挤占正文。 */
.xa-act {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted2);
  opacity: 0;
  cursor: pointer;
  transition: opacity .14s, color .14s, background .14s;
}
.xa-act svg { width: 13px; height: 13px; }
/* 助手那条：按钮在正文下面预留的一小条里（悬停才显形，不压字） */
/* 照参考图：这一行在正文**左下**，依次是 复制 / 赞 / 踩 / 本次共消耗 N 算力 */
.xa-msg-ops {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  height: 20px;
  margin-top: 3px;
}
.xa-spend { margin-left: 6px; color: var(--muted2); font-size: 11px; white-space: nowrap; }
.xc-agent-body .xc-agent-msg:hover .xa-act,
.xa-act:focus-visible { opacity: 1; }
.xa-act:hover { color: var(--fg); background: rgba(255, 255, 255, .1); }
/* 点赞 / 点踩选中态 */
.xa-msg-ops.is-up .xa-like { color: #5ec26a; }
.xa-msg-ops.is-down .xa-dislike { color: #e06a6a; }
.xa-act svg {
  width: 13px; height: 13px; fill: none; stroke: currentColor;
  stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
}
/* 用户那条是右对齐的气泡：复制钮放气泡**右侧**（照参考图一），
   平时 opacity:0 藏着，鼠标移到这条消息上才显形，移开就隐藏。 */
.xc-agent-body .xc-agent-msg.is-user { position: relative; }
.xc-agent-body .xc-agent-msg.is-user .xa-act {
  position: absolute;
  left: 100%;
  bottom: 1px;
  margin-left: 4px;
}
html[data-theme='light'] .xa-act:hover { background: rgba(0, 0, 0, .07); }
.xa-copybuf { position: fixed; left: -9999px; top: 0; opacity: 0; }

/* ---------- 1.2 「正在让模型理解」这件事本身不要长得像一张卡（第 9 版） ----------
   用户原话：「下面这些文字，比如正在理解你的需求，还有下面的文字都不要，
   而且这些文字都在一个框内，把这个框…取消掉」。
   所以等待模型的那段时间：**没有卡片、没有一句说明** —— 面板上只有你自己那句话。
   只在句子末尾点一个呼吸的小点，免得变成「发了完全没反应」。 */
.xc-agent-body .xc-agent-msg.is-user.is-planning::after {
  content: '';
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-left: 9px;
  border-radius: 50%;
  background: currentColor;
  opacity: .5;
  animation: xa-plan-pulse 1s ease-in-out infinite;
  vertical-align: middle;
}

/* ---------- 2. 关掉旧的「助手设置」入口 ----------   用户要求：通用 API 的入口只能留在画布总设置里，
   小助手下面不能再出现。JS 侧会把它 remove，这里再兜一层。 */
.xc-agent-foot .xc-agent-link {
  display: none !important;
}

/* ---------- 3. 底部工具条（上传 / 技能 / 设置） ---------- */
.xa-tools {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}
.xa-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 9px;
  border: 1px solid var(--line2);
  border-radius: 9px;
  background: var(--inset);
  color: var(--muted);
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  transition: color .16s, border-color .16s, background .16s;
}
.xa-btn:hover {
  color: var(--fg);
  border-color: var(--line3, var(--line2));
}
.xa-btn.is-on {
  color: var(--fg);
  border-color: var(--acc, #7f77dd);
}
.xa-btn svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.xa-btn-spacer { flex: 1; }
.xa-count {
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--acc, #7f77dd);
  color: #fff;
  font-size: 10px;
  line-height: 16px;
  text-align: center;
}

/* ---------- 4. 引用条（画布素材拖/选进来） ---------- */
.xa-refs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.xa-refs:empty { display: none; }
.xa-ref {
  position: relative;
  width: 46px;
  height: 46px;
  border: 1px solid var(--line2);
  border-radius: 9px;
  overflow: hidden;
  background: var(--inset);
}
.xa-ref img,
.xa-ref video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.xa-ref .xa-ref-x {
  position: absolute;
  top: 1px;
  right: 1px;
  width: 15px;
  height: 15px;
  border: 0;
  border-radius: 50%;
  background: #000000b3;
  color: #fff;
  font-size: 11px;
  line-height: 15px;
  padding: 0;
  cursor: pointer;
}

/* ---------- 5. 技能面板（输入框按 / 唤出） ---------- */
.xa-palette {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: calc(100% + 8px);
  max-height: 320px;
  overflow: auto;
  padding: 6px;
  border: 1px solid var(--line2);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: 0 20px 44px -18px #000000cc;
  z-index: 5;
}
.xa-palette-head {
  padding: 6px 8px 4px;
  color: var(--muted2);
  font-size: 11px;
}
.xa-skill {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px 9px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--fg);
  text-align: left;
  cursor: pointer;
}
.xa-skill:hover { background: var(--inset); }
.xa-skill.is-on { background: var(--inset); }
.xa-skill-ico {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--inset);
  display: grid;
  place-items: center;
  color: var(--muted);
}
.xa-skill-ico svg {
  width: 15px; height: 15px; fill: none; stroke: currentColor;
  stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
}
.xa-skill-main { min-width: 0; flex: 1; }
.xa-skill-main b { display: block; font-size: 12.5px; font-weight: 500; }
.xa-skill-main small {
  display: block;
  margin-top: 2px;
  color: var(--muted2);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.xa-skill-act {
  flex: none;
  height: 24px;
  padding: 0 9px;
  border: 1px solid var(--line2);
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
}
.xa-skill-act:hover { color: var(--fg); }
.xa-tag {
  flex: none;
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--inset);
  color: var(--muted2);
  font-size: 10px;
}

/* ---------- 6. 决策卡片：摆在**上面的生成窗口**里，不占输入框 ----------
   第 6 版用户明确纠正：
     · 「选择模型和比例应该是放在上面的生成窗口，而不是输入窗口」
       —— 上一版塞进 .xc-agent-input 是把「上面的生成框」理解错了
     · 「点发送 → 大语言模型先理解、先搞提示词形容词 → 然后下面再让我选择，
        而不是一输入就立马跳出来选择模型和比例，这样压根没经过大语言模型的思考」
   所以卡片只有三种形态，选项**只在模型回来后才出现**：
     A 理解中：只有「正在理解你的需求…」+ 原话，一个选项都不给
     B 就绪  ：提示词（可编辑）+ 模型/比例 chip（共用一个抽屉）+ 开始生成
     C 兜底  ：模型没回来时，才用本地规则摆选项，并如实说明
   卡片本身就是一张 .xa-card，跟结果卡片同观感。 */
/* 照 TapNow 的确认模板复刻：标题行（图标 + 文字）→ 提示词框 → 参数 chips → 取消/确认。
   一句话说明都没有 —— 用户明确要求不要那些废话。 */
.xa-plan-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 12px 11px;
}
.xa-plan-head {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--fg);
  font-size: 13px;
  font-weight: 600;
}
.xa-plan-ico { flex: none; display: grid; place-items: center; width: 16px; height: 16px; color: var(--fg); }
.xa-plan-ico svg {
  width: 15px; height: 15px; fill: none; stroke: currentColor;
  stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
}
/* 提示词：深色内嵌框，直接在里面改 */
.xa-plan-prompt {
  width: 100%;
  box-sizing: border-box;
  min-height: 84px;
  max-height: 190px;
  padding: 10px 11px;
  border: 1px solid var(--line2);
  border-radius: 11px;
  background: var(--inset);
  color: var(--fg);
  font: inherit;
  font-size: 12.5px;
  line-height: 1.75;
  resize: vertical;
  outline: none;
  transition: border-color .16s;
}
.xa-plan-prompt:focus { border-color: var(--fg); }

.xa-plan-card .xa-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.xa-plan-card .xa-chip {
  height: 30px;
  max-width: 100%;
  padding: 0 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .06);
  color: var(--fg);
  font-size: 12px;
}
.xa-plan-card .xa-chip:hover { background: rgba(255, 255, 255, .13); border-color: var(--fg); }

.xa-plan-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
/* 取消：描边胶囊（次要动作） */
.xa-ghost {
  height: 30px;
  padding: 0 15px;
  border: 1px solid var(--line2);
  border-radius: 999px;
  background: transparent;
  color: var(--fg);
  font-size: 12px;
  cursor: pointer;
  transition: background .16s, border-color .16s;
}
.xa-ghost:hover { background: rgba(255, 255, 255, .08); border-color: var(--fg); }
html[data-theme='light'] .xa-ghost:hover { background: rgba(0, 0, 0, .06); }
/* 确认：实心胶囊 */
.xa-go {
  height: 30px;
  padding: 0 15px;
  border: 0;
  border-radius: 999px;
  background: var(--fg);
  color: var(--panel);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .16s;
}
.xa-go:hover { opacity: .88; }
html[data-theme='light'] .xa-plan-card .xa-chip { background: rgba(0, 0, 0, .05); }
html[data-theme='light'] .xa-plan-card .xa-chip:hover { background: rgba(0, 0, 0, .1); }
html[data-theme='light'] .xa-plan-prompt { background: #f2f2f2; }

/* 下面的 .xa-hint-note / .xa-link 保留给卡片里的说明与文字动作 */
.xa-hint-note {
  min-width: 0;
  overflow: hidden;
  color: var(--muted2);
  text-overflow: ellipsis;
}

/* 卡片里的文字动作（当聊天发送 / 以后不用问 / 先用本地规则） */
.xa-link {
  flex: none;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 11.5px;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.xa-link:hover { color: var(--fg); }
.xa-caret { flex: none; color: var(--muted2); font-size: 10px; }

/* 「正在理解…」的呼吸圆点 */
.xa-plan-dot {
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent, #f7f7f7);
  animation: xa-plan-pulse 1s ease-in-out infinite;
}
@keyframes xa-plan-pulse {
  0%, 100% { opacity: .3; }
  50%      { opacity: 1; }
}

/* 二级选择用的选项 chip（抽屉里、以及将来别处都用它） */
.xa-opt {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 11px;
  border: 1px solid var(--line2);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  transition: color .16s, border-color .16s, background .16s;
}
.xa-opt:hover { color: var(--fg); border-color: var(--fg); }
/* 选中态沿用站内「亮块」的做法：底色用前景色、字用面板色，随主题翻转 */
.xa-opt.is-on {
  background: var(--fg);
  border-color: var(--fg);
  color: var(--panel);
  font-weight: 500;
}

/* chip 上的文字：太长就省略，别把卡片撑破 */
.xa-chip-t {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- 6.1 共用的那个抽屉：一级分类 → 二级选值 ---------- */
.xa-drawer { padding: 6px; }
.xa-drawer-head {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px 7px;
  color: var(--muted2);
  font-size: 11px;
}
.xa-drawer-head b { color: var(--fg); font-size: 12.5px; font-weight: 600; }
.xa-back {
  flex: none;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}
.xa-back:hover { background: var(--inset); color: var(--fg); }
.xa-drawer-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--fg);
  font-size: 12.5px;
  text-align: left;
  cursor: pointer;
}
.xa-drawer-row:hover,
.xa-drawer-row.is-focus { background: var(--inset); }
.xa-drawer-name { flex: none; color: var(--muted); }
.xa-drawer-val {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: var(--fg);
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- 7. 生成结果卡片 ----------
   四角都倒角（14px），四周留一点缝 —— 不要那种顶到面板边线的生硬感。
   媒体靠在卡片里，靠 overflow:hidden 跟着一起倒角。
   底色从近黑的 --inset 抬到 --card2，不再是一块黑底。 */
.xa-card {
  margin-top: 0;
  border: 1px solid var(--line2);
  border-radius: 14px;
  overflow: hidden;
  background: var(--card2, var(--inset));
}
.xa-card-media {
  display: block;
  width: 100%;
  max-height: min(48vh, 340px);
  object-fit: contain;
  background: #000;
}
.xa-card-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  font-size: 11px;
  color: var(--muted2);
}
.xa-card-bar .xa-btn { height: 24px; font-size: 11px; }

/* ---------- 7.1 生成结果：照参考图二**不套卡片框** ----------
   参考图里出图之后是「图片直接铺在对话里 + 一行小动作」，
   没有边框、没有底色。这里把 .xa-card 的框整个拆掉，
   只保留图片自身的圆角；横图按容器宽、竖图按自身比例居中。 */
.xa-card.xa-result {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  overflow: visible;
}
.xa-card.xa-result img.xa-card-media {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: min(48vh, 340px);
  border-radius: 12px;
  background: transparent;
}
.xa-card.xa-result video.xa-card-media {
  display: block;
  width: 100%;
  max-height: min(48vh, 340px);
  border-radius: 12px;
  background: #000;
}
.xa-card.xa-result .xa-card-bar { padding: 0; gap: 8px; }

/* 还在跑的时候，这张卡是参考图里那种「执行步骤」列表：一行一步、没有任何框。
   出结果后 finish() 会把 is-run 摘掉，卡片自动变回带框的结果卡。 */
.xa-card.is-run {
  border: 0;
  border-radius: 0;
  background: transparent;
  overflow: visible;
}
.xa-steps { display: flex; flex-direction: column; gap: 7px; }
.xa-generation-preview {
  position: relative;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  margin-top: 14px;
  overflow: hidden;
  border: 1px solid var(--line2);
  border-radius: 18px;
  background: var(--card2, var(--inset));
  isolation: isolate;
}
.xa-generation-preview::before {
  content: '';
  position: absolute;
  inset: -100%;
  background: linear-gradient(110deg, transparent 34%, rgba(255,255,255,.08) 43%, rgba(255,255,255,.38) 50%, rgba(255,255,255,.08) 57%, transparent 66%);
  animation: xa-generation-sweep 1.8s linear infinite;
  pointer-events: none;
  z-index: 0;
}
.xa-generation-label { position: relative; z-index: 1; padding: 18px; color: var(--muted); font-size: 13px; text-align: center; overflow-wrap: anywhere; }
.xa-generation-preview.is-failed::before { display: none; }
.xa-generation-preview.is-failed .xa-generation-label { color: #ff8a8a; }
.xa-skill-ico[data-skill='imagegen'] { color: #56d6a0; background: rgba(86,214,160,.12); }
.xa-skill-ico[data-skill='videogen'] { color: #68a9ff; background: rgba(104,169,255,.12); }
.xa-skill-ico[data-skill='prompt_polish'] { color: #bc91ff; background: rgba(188,145,255,.12); }
.xa-skill-ico[data-skill='storyboard'] { color: #ffba68; background: rgba(255,186,104,.12); }
.xa-skill-ico[data-skill='translate'] { color: #62d9eb; background: rgba(98,217,235,.12); }
.xa-plan-response { white-space: pre-wrap; }
@keyframes xa-generation-sweep {
  from { transform: translateX(-45%); }
  to { transform: translateX(45%); }
}
@media (prefers-reduced-motion: reduce) {
  .xa-generation-preview::before { animation: none; }
}
.xa-step {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.55;
}
.xa-step-ico { flex: none; display: grid; place-items: center; width: 15px; height: 15px; color: var(--muted2); }
.xa-step-ico svg {
  width: 14px; height: 14px; fill: none; stroke: currentColor;
  stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round;
}
.xa-step.is-done .xa-step-ico { color: var(--muted); }
.xa-step.is-run .xa-step-ico { color: var(--fg); animation: xa-spin 1.1s linear infinite; }
.xa-step.is-run .xa-step-t { color: var(--fg); }
.xa-step.is-err .xa-step-ico,
.xa-step.is-err .xa-step-t { color: #ff8a8a; }
html[data-theme='light'] .xa-step.is-err .xa-step-ico,
html[data-theme='light'] .xa-step.is-err .xa-step-t { color: #c0392b; }
@keyframes xa-spin { to { transform: rotate(360deg); } }

/* 发送之后、确认卡之前的那一小段「模型在思考」的步骤（第 10 版）。
   跟生成过程的步骤同一套观感：一行一步、无框。 */
.xa-trace { display: flex; flex-direction: column; gap: 7px; }
.xa-trace.is-thinking .xa-step-t { color: var(--fg); }
.xa-step.is-warn .xa-step-ico { color: #e0a33a; }
html[data-theme='light'] .xa-step.is-warn .xa-step-ico { color: #b07818; }
.xa-drag {
  cursor: grab;
  border-style: dashed;
}
.xa-drag:active { cursor: grabbing; }

/* 拖到画布时的落点高亮 */
.xc-agent.xa-drop-hot {
  outline: 2px dashed var(--acc, #7f77dd);
  outline-offset: -6px;
}

/* ---------- 8. 设置弹层 ---------- */
/* ⚠️ 类名是 .xa-setmask，**不要**改回 .xa-mask。
   asset-dock-20261010.js 会注入 `.xa-mask{opacity:0;visibility:hidden;
   pointer-events:none}`（靠 .on 打开它自己的大弹窗）。同名的话我们的弹层会被
   那三条规则穿透：DOM 建出来了、z-index 也对，但完全透明且不可点，
   用户看到的就是「点助手设置没反应」。2026-10-14 真实站点实测确认。
   这里另外把 opacity / visibility / pointer-events 显式写成可见态，
   即便以后有别的样式再碰 .xa-setmask，也不会静默变成隐形弹层。 */
.xa-setmask {
  position: fixed;
  inset: 0;
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: #000000a8;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.xa-setmask .xa-dialog {
  width: min(520px, 100%);
  max-height: 100%;
}
/* 弹框本体。宽高由上面的 .xa-setmask 上下文决定，这里只管外观与滚动。 */
.xa-dialog {
  overflow: auto;
  padding: 14px;
  border: 1px solid var(--line2);
  border-radius: 16px;
  background: var(--panel);
}

.xa-dialog h4 {
  margin: 0 0 10px;
  font-size: 13.5px;
  font-weight: 500;
}
.xa-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 9px;
}
.xa-row > label {
  flex: none;
  width: 66px;
  color: var(--muted2);
  font-size: 12px;
}
.xa-row select,
.xa-row input {
  flex: 1;
  min-width: 0;
  height: 30px;
  padding: 0 8px;
  border: 1px solid var(--line2);
  border-radius: 8px;
  background: var(--inset);
  color: var(--fg);
  font-size: 12px;
}
.xa-seg {
  display: flex;
  flex: 1;
  gap: 4px;
}
.xa-seg button {
  flex: 1;
  height: 30px;
  border: 1px solid var(--line2);
  border-radius: 8px;
  background: var(--inset);
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}
.xa-seg button.is-on {
  color: var(--fg);
  border-color: var(--acc, #7f77dd);
}
.xa-dialog-sep {
  margin: 12px 0 10px;
  border-top: 1px solid var(--line);
}
.xa-dialog-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}
.xa-btn-primary {
  background: var(--acc, #7f77dd);
  border-color: var(--acc, #7f77dd);
  color: #fff;
}
.xa-btn-primary:hover { color: #fff; }

/* ---------- 8. 参考版式重排：+ 在左 / 麦克风在右 / 模型与模式一行 ---------- */

/* 模型 chip 与「模式 chip」「技能 chip」排成一行 */
.xc-agent-model {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.xc-agent-model .xc-agent-chip {
  flex: none;
}

/* ---------- 8.1 输入区：整宽卡片（参考图二版式） ----------
   版式：一张贴满底栏宽度的圆角卡片，里面分两行 ——
     上行  textarea（无边框、透明底，直接落在卡片上）
     下行  左「＋」 ······ 右「🎙」「发送（白色圆形）」
   为什么改：原来的输入框自带 --inset(#1d1d1d) 底色 + 描边，在 #313131 的
   面板上就是「一块黑底小框」，而且和两侧按钮挤在同一行、高度只有 76px。
   卡片底色比面板亮一档（#3a3a3a），与站内「按钮比面板亮」的既有观感一致。
   回滚：把 8.1 整段删掉，即回到「黑底小框 + 单行」原状。 */
.xc-agent-input {
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 9px 10px 8px;
  border: 1px solid #4d4d4d;
  border-radius: 18px;
  background: #3a3a3a;
  transition: border-color .16s, background .16s;
}
.xc-agent-input:focus-within {
  border-color: #909090;
}
.xc-agent-input textarea {
  order: -1;                 /* 文字行永远排在工具行上面 */
  flex: 0 0 100%;
  min-height: 58px;
  max-height: 220px;
  padding: 2px 4px 0;
  border: 0;
  border-radius: 0;
  background: transparent;    /* 不再是黑底：底色由外面那张卡片提供 */
  color: #f2f2f2;
  font-size: 15px;
  line-height: 1.6;
}
.xc-agent-input textarea::placeholder { color: #8a8a8a; }
.xc-agent-input textarea:focus { border-color: transparent; }

/* 引用是正文中的原子标签，不再占据输入框外的单独一行。 */
.xc-agent-input textarea.xa-input-bridge { display: none !important; }
.xc-agent-input .xa-inline-editor {
  order: -1;
  flex: 0 0 100%;
  min-width: 0;
  min-height: 58px;
  max-height: 220px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 2px 4px 0;
  color: #f2f2f2;
  font: inherit;
  font-size: 15px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  outline: none;
  cursor: text;
  user-select: text;
  -webkit-user-select: text;
}
.xa-inline-editor:empty::before {content: attr(data-placeholder); color: #8a8a8a; pointer-events: none;}
.xa-inline-editor .xa-inline-ref {
  display: inline-flex;
  position: relative;
  vertical-align: middle;
  align-items: center;
  gap: 5px;
  width: auto;
  max-width: min(210px, 100%);
  height: 28px;
  margin: 0 2px;
  padding: 2px 5px;
  border-radius: 7px;
  background: #242424;
  white-space: nowrap;
  user-select: none;
}
.xa-inline-editor .xa-inline-ref img,
.xa-inline-editor .xa-inline-ref video {width: 22px; height: 22px; flex: none; object-fit: cover; border-radius: 4px;}
.xa-inline-editor .xa-inline-ref .xa-ref-x {position: static; flex: none; width: 16px; height: 18px; padding: 0;}
.xc-agent-list {overscroll-behavior: contain; scrollbar-width: thin;}
html[data-theme='light'] .xa-inline-editor {color: #1a1a1a;}
html[data-theme='light'] .xa-inline-editor .xa-inline-ref {background: #e6e6e6;}

/* 工具行（参考图 1/3）：左边 [＋][✋] 凑一组，右边 [✦][🎤][⬆] 凑一组。
   ✦ 用 margin-left:auto 把自己和后面两个一起顶到最右。 */
.xc-agent-input > [data-xa='plus'] { margin-right: 2px; }
.xc-agent-input > [data-xa='mode'] { margin-right: auto; }
.xc-agent-input > [data-xa='tools'] { margin-left: auto; }

/* 输入行两侧的圆形按钮（+ / 麦克风） */
.xa-round {
  flex: none;
  width: 32px;
  height: 32px;
  margin-bottom: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #b4b4b4;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: color .16s, border-color .16s, background .16s;
}
.xa-round:hover { color: #fff; background: rgba(255, 255, 255, .12); }
/* 自动生成时把模式钮点亮，一眼能看出现在是不问直接跑 */
.xa-round.is-auto { color: #fff; background: rgba(255, 255, 255, .14); }
.xa-round svg {
  width: 16px; height: 16px; fill: none; stroke: currentColor;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}

/* 发送键：白色圆形 —— 与画布生成面板的发送键同一套观感 */
.xc-agent-input .xc-agent-send {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #f7f7f7;
  color: #1a1a1a;
}
.xc-agent-input .xc-agent-send svg { stroke-width: 2.2; }
.xc-agent-input .xc-agent-send:disabled { background: #6b6b6b; color: #d6d6d6; }
.xc-agent-input .xc-agent-send.is-stop { background: #f87171; color: #fff; }

/* 录音中：红点呼吸 */
.xa-mic.is-rec {
  color: #ff5a5a;
  background: rgba(255, 90, 90, .18);
  box-shadow: inset 0 0 0 1px #ff5a5a;
  animation: xa-rec 1.1s ease-in-out infinite;
}
@keyframes xa-rec {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 90, 90, .45); }
  50%      { box-shadow: 0 0 0 6px rgba(255, 90, 90, 0); }
}

/* 「+」菜单 / 模式菜单 */
.xa-menu {
  z-index: 60;
  padding: 6px;
  border: 1px solid var(--line2);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: 0 22px 48px -18px #000000cc;
  max-height: 340px;
  overflow: auto;
}
.xa-menu-search {
  width: 100%;
  height: 30px;
  margin-bottom: 5px;
  padding: 0 10px;
  border: 1px solid var(--line2);
  border-radius: 9px;
  background: var(--inset);
  color: var(--fg);
  font-size: 12.5px;
}
.xa-menu-list { display: flex; flex-direction: column; }
.xa-menu-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px 9px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--fg);
  text-align: left;
  cursor: pointer;
}
.xa-menu-item:hover { background: var(--inset); }
.xa-menu-item.is-on { background: var(--inset); }

/* 分组标题 / 「更多模型」那一行（参考图 2） */
.xa-menu-head {
  padding: 9px 10px 4px;
  color: var(--muted2);
  font-size: 11px;
}
.xa-menu-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-top: 4px;
  padding: 9px 10px 5px;
  border: 0;
  border-top: 1px solid var(--line2);
  border-radius: 0 0 10px 10px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}
.xa-menu-foot:hover { color: var(--fg); }
.xa-caret.is-up { transform: rotate(180deg); }

/* ---------- 9. 模型 chip（输入框上面那行） ----------
   参考图里「选模型」的入口就在输入框上方那行，跟这边一致。
   React 自己那颗 chip 与它的下拉一律藏起来（我们只是借它的项来真正切模型），
   显示的是我们这一颗：图标 + 名字 + 徽章 + ⌄。 */
.xc-agent-model {
  display: flex;
  align-items: center;
  gap: 6px;
}
.xc-agent-model > .xc-agent-chip { display: none !important; }
.xc-agent-model > .xc-agent-models { display: none !important; }

.xa-modelchip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  height: 26px;
  padding: 0 10px;
  border: 1px solid var(--line2);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 11.5px;
  cursor: pointer;
  transition: color .16s, border-color .16s;
}
.xa-modelchip:hover { color: var(--fg); border-color: var(--accent); }
/* Text model is fixed server-side; omit its label from the assistant composer. */
.xc-agent .xa-modelchip { display: none !important; }
.xc-agent .xc-agent-model:not(:has(.xa-skillchip)) { display: none !important; }
.xa-modelchip-ico { flex: none; display: grid; place-items: center; width: 13px; height: 13px; color: var(--muted2); }
.xa-modelchip-ico svg {
  width: 13px; height: 13px; fill: none; stroke: currentColor;
  stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
}
.xa-model-img { width: 13px; height: 13px; object-fit: contain; }
.xa-modelchip-t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 9.1 生成方式菜单（参考图 1：图标 + 标题 + 一行说明 + 当前打勾） ---------- */
.xa-pick {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  padding: 10px 10px 11px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--fg);
  text-align: left;
  cursor: pointer;
}
.xa-pick:hover { background: var(--inset); }
.xa-pick-ico { flex: none; display: grid; place-items: center; width: 20px; height: 20px; margin-top: 1px; color: var(--fg); }
.xa-pick-ico svg {
  width: 18px; height: 18px; fill: none; stroke: currentColor;
  stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
}
.xa-pick-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.xa-pick-main b { font-size: 13px; font-weight: 600; }
.xa-pick-main small { color: var(--muted2); font-size: 11.5px; line-height: 1.5; }
.xa-pick-ok { flex: none; display: grid; place-items: center; width: 16px; height: 16px; margin-top: 2px; color: var(--fg); }
.xa-pick-ok svg {
  width: 15px; height: 15px; fill: none; stroke: currentColor;
  stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round;
}

/* ---------- 9.2 模型菜单（参考图 2：Auto 卡 + 精选推荐 + 徽章 + 更多模型） ---------- */
.xa-auto {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 11px;
  border: 0;
  border-radius: 12px;
  background: var(--card2);
  color: var(--fg);
  text-align: left;
  cursor: pointer;
}
.xa-auto:hover { box-shadow: inset 0 0 0 1px var(--line2); }
.xa-auto-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.xa-auto-main b { font-size: 13px; font-weight: 600; }
.xa-auto-main small { color: var(--muted2); font-size: 11.5px; }

.xa-model-row {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 9px 11px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--fg);
  text-align: left;
  cursor: pointer;
}
.xa-model-row:hover { background: var(--inset); }
.xa-model-ico { flex: none; display: grid; place-items: center; width: 16px; height: 16px; color: var(--muted); }
.xa-model-ico svg {
  width: 15px; height: 15px; fill: none; stroke: currentColor;
  stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
}
.xa-model-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; }
/* 参考图里名字右边那个灰底小标签（顶配 / 快 / 新…），值来自 ai_channels.badge */
.xa-model-badge {
  flex: none;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .09);
  color: var(--muted2);
  font-size: 10.5px;
  line-height: 1.7;
}
html[data-theme='light'] .xa-model-badge { background: rgba(0, 0, 0, .07); }
html[data-theme='light'] .xa-auto { background: #f2f2f2; }

/* ---------- 10. 自带提示条（画布没暴露 toast 时兜底） ----------
   为什么必须自备：原来插件只 console.log，用户看到的现象就是「点了没反应」。
   挂在 body 上而不是面板里 —— .xc-agent 是 overflow:hidden，挂里面会被裁掉。
   位置由 JS 按面板矩形算，浮在面板正上方。 */
.xa-toast {
  position: fixed;
  z-index: 2147483000;
  max-width: min(420px, calc(100vw - 24px));
  padding: 9px 13px;
  border: 1px solid var(--line2);
  border-radius: 13px;
  background: rgba(20, 20, 20, .95);
  color: #f2f2f2;
  font-size: 12.5px;
  line-height: 1.6;
  box-shadow: 0 18px 40px -16px #000;
  pointer-events: none;
  animation: xa-toast-in .18s var(--e-out, ease) both;
}
html[data-theme='light'] .xa-toast {
  background: rgba(255, 255, 255, .97);
  color: #1a1a1a;
  border-color: rgba(0, 0, 0, .14);
  box-shadow: 0 18px 40px -18px rgba(0, 0, 0, .35);
}
@keyframes xa-toast-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- 11. 内容区滚动：隐藏原生滚动条 + 自带可拖滑块 ----------
   为什么自建：Chrome 现在是悬浮式滚动条，不悬停根本不画出来
   （线上实测 .xc-agent-body 的 offsetWidth - clientWidth = 0），
   用户抓不到任何东西。自建一根始终可见的，行为完全可控。
   原生那条一律隐藏，免得两套并存。
   可见条 4px 贴在面板右边缘，滑块本体 10px 宽 —— 多出来的 6px 是透明抓取区，
   靠 background-clip:content-box 只画中间那段。 */
.xc-agent-body {
  scrollbar-width: none;          /* Firefox */
  -ms-overflow-style: none;       /* 旧 Edge */
}
.xc-agent-body::-webkit-scrollbar { width: 0; height: 0; display: none; }

.xa-scroll {
  position: absolute;
  right: 0;
  width: 10px;
  pointer-events: none;           /* 只有轨道和滑块自己收事件 */
  z-index: 6;
}
.xa-scroll.is-off { display: none; }

.xa-scroll-rail {
  position: absolute;
  right: 2px;
  top: 0;
  bottom: 0;
  width: 4px;
  border-radius: 99px;
  background: rgba(255, 255, 255, .10);
  pointer-events: auto;
}
.xa-scroll-thumb {
  position: absolute;
  right: 0;
  width: 10px;
  box-sizing: border-box;
  padding-left: 4px;
  padding-right: 2px;
  min-height: 30px;
  border-radius: 99px;
  background: rgba(255, 255, 255, .34);
  background-clip: content-box;
  pointer-events: auto;
  cursor: grab;
  transition: background .15s;
}
.xa-scroll-thumb:hover { background: rgba(255, 255, 255, .55); background-clip: content-box; }
.xa-scroll-thumb.is-drag { background: rgba(255, 255, 255, .72); background-clip: content-box; cursor: grabbing; }

html[data-theme='light'] .xa-scroll-rail { background: rgba(0, 0, 0, .10); }
html[data-theme='light'] .xa-scroll-thumb { background: rgba(0, 0, 0, .30); background-clip: content-box; }
html[data-theme='light'] .xa-scroll-thumb:hover { background: rgba(0, 0, 0, .48); background-clip: content-box; }
html[data-theme='light'] .xa-scroll-thumb.is-drag { background: rgba(0, 0, 0, .62); background-clip: content-box; }

/* ---------- 12. 亮色态 ----------
   8.1 里写死的灰阶要跟着主题翻面，否则亮色下输入区会是一块深灰。 */
html[data-theme='light'] .xc-agent-input {
  background: #ededed;
  border-color: rgba(0, 0, 0, .18);
}
html[data-theme='light'] .xc-agent-input:focus-within {
  border-color: rgba(0, 0, 0, .44);
}
html[data-theme='light'] .xc-agent-input textarea { color: #1a1a1a; }
html[data-theme='light'] .xc-agent-input textarea::placeholder { color: #8a8a8a; }
html[data-theme='light'] .xa-round { color: #5a5a5a; }
html[data-theme='light'] .xa-round:hover { color: #111; background: rgba(0, 0, 0, .08); }
html[data-theme='light'] .xc-agent-input .xc-agent-send { background: #1a1a1a; color: #fff; }
html[data-theme='light'] .xc-agent-input .xc-agent-send:disabled { background: #c4c4c4; color: #8a8a8a; }

/* ---------- 13. 窄屏 ---------- */
@media (max-width: 640px) {
  .xc-agent { width: auto; }
  .xc-agent-body { min-height: 200px; }
  .xc-agent-body > *:not(.xa-card) { margin-left: 6px; margin-right: 6px; }
  .xc-agent-input { padding: 8px 8px 7px; border-radius: 16px; }
  .xc-agent-input textarea { min-height: 54px; font-size: 14.5px; }
  .xa-round { width: 30px; height: 30px; }
  .xc-agent-input .xc-agent-send { width: 32px; height: 32px; }
}


/* ---------- 14. 面板可拖拽伸缩（第 13 版） ----------
   在面板内边缘贴 8 个透明把手：鼠标停上去光标变双向箭头，横拉 / 竖拉都行。
   放在内边缘（不是外边缘）是因为 .xc-agent 是 overflow:hidden，
   外面的把手会被裁掉。悬停时给一条很淡的亮边，让「这里能拖」看得出来。 */
.xa-resize { position: absolute; z-index: 12; }
.xa-resize::after { content: ''; position: absolute; inset: 0; opacity: 0; transition: opacity .14s; }
.xa-resize:hover::after { opacity: 1; background: rgba(255, 255, 255, .16); }
.xa-resize[data-dir='n'] { top: 0; left: 14px; right: 14px; height: 6px; cursor: ns-resize; }
.xa-resize[data-dir='s'] { bottom: 0; left: 14px; right: 14px; height: 6px; cursor: ns-resize; }
.xa-resize[data-dir='w'] { left: 0; top: 14px; bottom: 14px; width: 6px; cursor: ew-resize; }
.xa-resize[data-dir='e'] { right: 0; top: 14px; bottom: 14px; width: 6px; cursor: ew-resize; }
.xa-resize[data-dir='nw'] { left: 0; top: 0; width: 14px; height: 14px; cursor: nwse-resize; border-radius: 18px 0 0 0; }
.xa-resize[data-dir='ne'] { right: 0; top: 0; width: 14px; height: 14px; cursor: nesw-resize; border-radius: 0 18px 0 0; }
.xa-resize[data-dir='sw'] { left: 0; bottom: 0; width: 14px; height: 14px; cursor: nesw-resize; border-radius: 0 0 0 18px; }
.xa-resize[data-dir='se'] { right: 0; bottom: 0; width: 14px; height: 14px; cursor: nwse-resize; border-radius: 0 0 18px 0; }
.xc-agent.xa-resizing { user-select: none; }
.xc-agent.xa-resizing .xa-resize::after { opacity: 0; }
html[data-theme='light'] .xa-resize:hover::after { background: rgba(0, 0, 0, .12); }

/* 右侧整高模式：只占图二所示的右侧栏，不覆盖其余画布。 */
.xc-agent.xa-expanded {
  border-radius: 0;
  box-shadow: -18px 0 44px -28px #000;
}
.xc-agent.xa-expanded .xa-resize { display: block; }
.xa-expand.is-on { color: var(--fg); background: rgba(255, 255, 255, .12); }
html[data-theme='light'] .xa-expand.is-on { background: rgba(0, 0, 0, .08); }

/* 展开钮视觉上位于 React 头部，DOM 实际挂在 body，避免与 React 争抢节点。 */
.xc-agent-head.xa-has-expand > .xc-agent-ico:first-of-type { margin-left: 32px; }
.xa-expand-float {
  position: fixed;
  z-index: 2147482000;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  pointer-events: auto;
}
.xa-expand-float:hover { background: color-mix(in srgb, var(--fg) 10%, transparent); }

/* Status-only toast can sit over a docked header; never let it eat pointer input. */
.xc-toast { pointer-events: none; }
.xa-resize { touch-action: none; }

/* 画布外壳及面板控件不参与浏览器整页文字选择；正文和编辑区域仍可复制。 */
.xc-app,
.xc-agent,
.xa-expand-float {
  -webkit-user-select: none;
  user-select: none;
}
.xc-app input,
.xc-app textarea,
.xc-app [contenteditable='true'],
.xc-agent input,
.xc-agent textarea,
.xc-agent [contenteditable='true'],
.xc-agent .xc-agent-msg {
  -webkit-user-select: text;
  user-select: text;
}
.xc-agent button,
.xc-agent [role='button'],
.xc-agent .xa-msg-ops {
  -webkit-user-select: none;
  user-select: none;
}

/* 标题栏分隔线提供 10px 拖动命中区，方便准确按住；无需添加 DOM 节点。 */
.xc-agent .xc-agent-head {
  position: relative;
  cursor: grab;
  touch-action: none;
}
.xc-agent .xc-agent-head::after {
  content: '';
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: -5px;
  height: 10px;
  z-index: 13;
  cursor: grab;
}
.xc-agent .xc-agent-head button { cursor: pointer; }
.xc-agent.xa-moving,
.xc-agent.xa-moving .xc-agent-head,
.xc-agent.xa-moving .xc-agent-head::after { cursor: grabbing; }
.xc-agent.xa-moving * { -webkit-user-select: none; user-select: none; }

/* 小视口下只压缩消息滚动区，头部、模型和发送区不能被挤出面板。 */
.xc-agent.xa-sized .xc-agent-body { min-height: 0; flex: 1 1 auto; }
.xc-agent .xc-agent-head,
.xc-agent .xc-agent-foot { flex-shrink: 0; }

/* 空白画布静止时用箭头；React Flow 进入实际拖动状态后才显示抓手。 */
body:not(.xc-picking) .xc-app .react-flow__pane:not(.dragging) {
  cursor: default;
}
.xc-app .react-flow__node.selectable:not(.dragging),
.xc-app button:not(:disabled),
.xc-app a[href],
.xc-app [role='button']:not([aria-disabled='true']) {
  cursor: pointer;
}
.xc-app .react-flow__pane.dragging,
.xc-app .react-flow__node.dragging,
.xc-app .react-flow__nodesselection-rect:active {
  cursor: grabbing;
}

/* 点击画布素材后，输入区显示带缩略图和名称的引用标签。 */
.xa-refs .xa-ref {
  display: flex;
  align-items: center;
  gap: 6px;
  width: auto;
  max-width: 210px;
  height: 34px;
  padding: 4px 24px 4px 4px;
}
.xa-refs .xa-ref img,
.xa-refs .xa-ref video { flex: none; width: 24px; height: 24px; border-radius: 5px; }
.xa-ref-name { min-width: 0; font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xa-refs .xa-ref .xa-ref-x { top: 8px; right: 4px; }

/* 结果预览右上角定位：悬停时出现，不挤占图片或视频的布局。 */
.xa-result-media {
  position: relative;
  display: inline-flex;
  max-width: 100%;
  line-height: 0;
}
.xa-result-media.is-video { width: 100%; }
.xa-result-locate {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 3px;
  border: 0;
  border-radius: 6px;
  background: #1b1b1bcc;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity .13s ease, background .13s ease;
}
.xa-result-media:hover .xa-result-locate,
.xa-result-media:focus-within .xa-result-locate { opacity: 1; pointer-events: auto; }
.xa-result-locate:hover { background: #000; }
.xa-result-locate svg { display: block; flex: none; pointer-events: none; }
.xa-result-locate:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
