/* ============================================================================
 * 智力猫 · AI 工作台 —— 左侧滑动导航（抽屉）
 * ----------------------------------------------------------------------------
 * 设计（2026-09-21 用户拍板）：
 *   · 图标栏顶部一个常显的智力猫猫头 → 悬停(160ms延时)或点击 → 抽屉滑出
 *   · 抽屉**从最左边滑出**（left:0），展开时**盖住** LibreChat 图标栏
 *   · 抽屉底部 = 用户头像（账号入口只此一处）
 *   · LibreChat 图标栏左下角那个头像**隐藏**（避免两处头像重复）
 *   · 鼠标移出抽屉 → 220ms 后自动缩回；Esc 也可关
 * ⚠️ 与 zlm-app.js 配套：DOM 由该脚本注入，本文件只管样式。
 * ⚠️ 桌面优先：手机上图标栏本身是隐藏的，脚本会自动放弃注入（见 zlm-app.js）。
 * ==========================================================================*/

/* ---------- 1. 隐藏图标栏左下角的 LibreChat 头像（账号入口搬到抽屉） ---------- */
div.flex.h-full.flex-shrink-0.flex-col.gap-2.border-r.border-border-light [data-testid="nav-user"] {
  display: none !important;
}

/* ---------- 2. 触发器：图标栏顶部的智力猫猫头 ---------- */
#zlm-trigger {
  width: 36px !important; height: 36px !important; flex: 0 0 36px !important;
  border: none !important; background: transparent !important; cursor: pointer !important;
  display: flex !important; align-items: center !important; justify-content: center !important;
  border-radius: 10px !important; margin: 0 auto 2px !important; padding: 0 !important;
  transition: background .15s !important;
}
#zlm-trigger:hover { background: rgba(99, 102, 241, .12) !important; }
#zlm-trigger img { width: 26px !important; height: 26px !important; border-radius: 7px !important; }

/* ============================================================================
   手机端常显入口（宿主不渲染图标栏 + 手机没有 hover，所以必须常显）
   形态：贴左边框的一个小标签，点开同一个智力猫抽屉 → 里面有「灵感 = 首页」。
   ⛔ 别做成「悬停才出现」——手机端那等于没有入口（用户就是这么反馈的）。
   ========================================================================== */
#zlm-trigger.zlm-trigger-float {
  position: fixed !important;
  left: 0 !important; top: 50% !important;
  transform: translateY(-50%) !important;
  width: 34px !important; height: 46px !important;
  flex: 0 0 auto !important;
  display: flex !important; align-items: center !important; justify-content: center !important;
  margin: 0 !important; padding: 0 !important; border: none !important;
  background: linear-gradient(135deg, #6366f1, #8b5cf6) !important;
  border-radius: 0 13px 13px 0 !important;
  box-shadow: 2px 2px 12px rgba(99, 102, 241, .38) !important;
  z-index: 350 !important;
  cursor: pointer !important;
  -webkit-tap-highlight-color: transparent !important;
}
#zlm-trigger.zlm-trigger-float img { width: 22px !important; height: 22px !important; border-radius: 6px !important; }
#zlm-trigger.zlm-trigger-float:active { width: 40px !important; }

/* ---------- 3. 抽屉本体：从最左边滑出，覆盖图标栏 ---------- */
#zlm-drawer {
  position: fixed !important;
  left: 0 !important; top: 0 !important; bottom: 0 !important;
  width: 208px !important;
  background: #1a1a2e !important;               /* nice 侧边栏底色 */
  z-index: 300 !important;
  display: flex !important; flex-direction: column !important;
  padding: 16px 10px 12px !important; gap: 4px !important;
  border-radius: 0 14px 14px 0 !important;
  box-shadow: 10px 0 32px rgba(26, 26, 46, .3) !important;
  transform: translateX(-100%) !important;
  opacity: 0 !important; pointer-events: none !important;
  transition: transform .24s cubic-bezier(.22, .61, .36, 1), opacity .18s ease !important;
}
#zlm-drawer[data-open="true"] {
  transform: translateX(0) !important;
  opacity: 1 !important; pointer-events: auto !important;
}

/* 品牌区 */
#zlm-drawer .zlm-brand {
  display: flex !important; align-items: center !important; gap: 10px !important;
  padding: 2px 8px 14px !important;
  text-decoration: none !important;   /* 现在是个 <a>（点它回智力猫首页） */
}
#zlm-drawer .zlm-brand img { width: 30px !important; height: 30px !important; border-radius: 8px !important; }
#zlm-drawer .zlm-brand-txt {
  color: #fff !important; font-size: 16px !important; font-weight: 700 !important; letter-spacing: .4px !important;
}

/* 导航项 */
#zlm-drawer .zlm-group { display: flex !important; flex-direction: column !important; gap: 2px !important; }
#zlm-drawer .zlm-item {
  display: flex !important; align-items: center !important; gap: 10px !important;
  height: 42px !important; padding: 0 12px !important; border-radius: 10px !important;
  color: #a8a8c0 !important; font-size: 14px !important; text-decoration: none !important;
  transition: background .15s, color .15s !important;
}
#zlm-drawer .zlm-item:hover { background: rgba(255, 255, 255, .06) !important; color: #fff !important; }
#zlm-drawer .zlm-item.zlm-active {
  background: linear-gradient(135deg, rgba(99, 102, 241, .35), rgba(139, 92, 246, .25)) !important;
  color: #fff !important; font-weight: 600 !important;
}

/* ---------- 4. 抽屉底部：整块已删除（2026-09-22 用户两次要求后的终态） ----------
   一次删身份行（头像 + 我 + 智力猫账号 + 上箭头），一次删「退出登录」。
   现在抽屉 = 品牌头 + 8 个导航项，底部什么都没有。
   · .zlm-foot / .zlm-menu / .zlm-mi / .zlm-mi-danger / .zlm-ava-* / .zlm-name / .zlm-caret /
     .zlm-logout 这些规则随元素一起删了，别再把它们加回来。
   · **登出在哪**：主站 www.zhilimao.com PC 侧边栏头像菜单 →「退出登录」
     （`nice-sidebar.vue` 的 handleLogout，已核实存在）。工作台这颗只登出平台一侧、
     回主站再点「智能体」又被免登送回来，属于半假按钮。
   · 「头像显隐必须用类、别用内联 style」那条教训仍有效（现在头像在右上角胶囊里）。 */

/* ============================================================================
   内容面板：点抽屉里的「积分详情 / 充值 / 任务奖励 / 个人信息」弹出，
   内部 iframe 内嵌主站**新版**页面（不再把用户扔去旧版页面）。
   ⛔ 只由用户点击触发，绝不自动打开 —— 用户红线是「严禁跳转/自动带离本站」。
   ========================================================================== */
#zlm-panel {
  position: fixed !important; inset: 0 !important; z-index: 400 !important;
  display: none !important; align-items: center !important; justify-content: center !important;
  background: rgba(17, 17, 27, .45) !important;
  backdrop-filter: blur(2px) !important;
}
#zlm-panel[data-open="true"] { display: flex !important; }
#zlm-panel .zlm-panel-card {
  width: min(1080px, calc(100vw - 48px)) !important;
  height: min(760px, calc(100vh - 64px)) !important;
  background: #fff !important; border-radius: 16px !important; overflow: hidden !important;
  display: flex !important; flex-direction: column !important;
  box-shadow: 0 24px 64px rgba(17, 17, 27, .34) !important;
}
#zlm-panel .zlm-panel-bar {
  flex: 0 0 48px !important; display: flex !important; align-items: center !important; gap: 12px !important;
  padding: 0 12px 0 18px !important; border-bottom: 1px solid #eef0f5 !important; background: #fff !important;
}
#zlm-panel .zlm-panel-title { flex: 1 !important; color: #1a1a2e !important; font-size: 15px !important; font-weight: 600 !important; }
#zlm-panel .zlm-panel-ext {
  color: #6366f1 !important; font-size: 13px !important; text-decoration: none !important;
  padding: 6px 10px !important; border-radius: 8px !important; transition: background .15s !important;
}
#zlm-panel .zlm-panel-ext:hover { background: rgba(99, 102, 241, .1) !important; }
#zlm-panel .zlm-panel-x {
  flex: 0 0 32px !important; width: 32px !important; height: 32px !important;
  border: none !important; background: transparent !important; cursor: pointer !important;
  border-radius: 8px !important; color: #6b7280 !important;
  display: flex !important; align-items: center !important; justify-content: center !important;
  transition: background .15s, color .15s !important;
}
#zlm-panel .zlm-panel-x:hover { background: #f1f2f6 !important; color: #1a1a2e !important; }
#zlm-panel .zlm-panel-frame { flex: 1 !important; width: 100% !important; border: 0 !important; background: #fff !important; }
@media (max-width: 767px) {
  #zlm-panel .zlm-panel-card { width: 100vw !important; height: 100vh !important; border-radius: 0 !important; }
}

/* ============================================================================
 * 抽屉底部弹窗的「余额 + 智能体数量」数据区（对齐 PC 用户弹窗）
 * ========================================================================== */
#zlm-drawer .zlm-stats {
  display: flex !important;
  gap: 8px !important;
  padding: 10px 12px 8px !important;
  border-bottom: 1px solid rgba(255, 255, 255, .08) !important;
  margin-bottom: 4px !important;
}
#zlm-drawer .zlm-stat { flex: 1 1 0 !important; text-align: center !important; }
#zlm-drawer .zlm-stat b {
  display: block !important; color: #fff !important;
  font-size: 14px !important; font-weight: 600 !important; line-height: 1.2 !important;
}
#zlm-drawer .zlm-stat span {
  display: block !important; color: #a8a8c0 !important;
  font-size: 11px !important; margin-top: 2px !important;
}

/* ============================================================================
   工作台 PC：左侧栏「回首页」+ 右上角「头像/积分」胶囊 + 积分详情弹窗
   （2026-09-21 用户指定；样式对齐 nice 风格：白卡 / 紫渐变 / 14px 圆角）
   删掉本段即恢复原样
   ========================================================================== */

/* ---------- ① 左侧图标栏最下面：回首页 ---------- */
#zlm-rail-sep {
  height: 1px !important;
  margin: 6px 8px !important;
  background: var(--border-light, rgba(17, 24, 39, .08)) !important;
}
#zlm-rail-home { position: relative !important; }
#zlm-rail-home:hover { background: rgba(99, 102, 241, .10) !important; }
#zlm-rail-home:hover svg { color: #6366f1 !important; }

/* ---------- ② 右上角：头像 + 积分 胶囊 ----------
   ⛔ 尺寸/间距/字号一律对齐「画布」的 ZhilimaoUserBadge（h-8 / size-7 / gap-2 / pl-0.5 pr-3 /
   12px 600 / 「{余额} 积分」中间有空格）—— 用户明确要求两处要「像」。改这里请同步核 canvas-src
   web/src/components/layout/zhilimao-user-badge.tsx，别自己另发明一套。 */
#zlm-user-pill {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  height: 32px !important;
  padding: 2px 12px 2px 2px !important;
  margin-right: 8px !important;
  border: 1px solid #e7e5e4 !important;           /* 画布 light 变体 = border-stone-200 */
  border-radius: 999px !important;
  background: rgba(255, 255, 255, .6) !important; /* 画布 = bg-white/60 */
  cursor: pointer !important;
  flex: 0 0 auto !important;
  transition: background-color .15s ease !important;
}
#zlm-user-pill:hover { background: #fff !important; }
#zlm-user-pill img {
  width: 28px !important; height: 28px !important;
  border-radius: 50% !important; object-fit: cover !important; display: block !important;
}
#zlm-user-pill .zlm-pill-init {
  width: 28px !important; height: 28px !important; border-radius: 50% !important;
  background: linear-gradient(135deg, #6366f1, #8b5cf6) !important;
  color: #fff !important; font-size: 12px !important; font-weight: 600 !important;
  display: inline-flex !important; align-items: center !important; justify-content: center !important;
}
#zlm-user-pill .zlm-pill-txt {
  font-size: 12px !important; font-weight: 600 !important;
  color: #44403c !important; white-space: nowrap !important;   /* 画布 = text-stone-700 */
}

/* ---------- ②b 胶囊的自有宿主（对话页专用）----------
   ⛔ 宿主在「对话页 /c/<id>」不渲染「临时对话」按钮 ⇒ 胶囊不能靠兄弟节点挂，改挂在
   body 级的本宿主上（React 不会碰，所以不会再被连带移除）。right 由 JS 按
   「头部最右可见按钮」动态算；这里只兜一个默认值。
   ⚠️ ≤767px 直接不显示：宿主右侧那排按钮本身是 max-md:hidden，移动端保持原行为
   （手机端走 .zlm-trigger-float 那条常显入口）。 */
#zlm-pill-host {
  position: fixed !important;
  /* ⛔ top 同理不能带 !important：垂直位置由 placePillHost() 按「参照按钮中线」算内联值
     （写死 10px 会与 h=36 的「新建项目」差 6px，看着就是没对齐）。 */
  top: 10px;
  /* ⛔ 这里的 right 是**只给「JS 还没跑」时的兜底值**，绝不能加 !important：
     position 由 zlm-app.js 的 placePillHost() 按「顶部条最右按钮」动态算后写内联样式，
     !important 会压过内联值 ⇒ 位置永远停在 60px（2026-09-22 真踩：胶囊因此压住「新建项目」按钮）。 */
  right: 60px;
  z-index: 40 !important;
  display: flex !important;
  align-items: center !important;
}
#zlm-pill-host #zlm-user-pill { margin-right: 0 !important; }
@media (max-width: 767px) {
  #zlm-pill-host { display: none !important; }
}

/* ---------- ③ 积分详情弹窗 ----------
   ⛔ 全卡尺寸/内边距/字号对齐「画布」的 PointsDialog（它本身又是照 PC 主站 nice-sidebar 的
   .kn-points-* 复刻的）：440 宽 / 18px 圆角 / 头 18px·700 + 30px 圆形✕ / 剩余积分 13px 灰 +
   36px·800 数字 + 紫渐变「充值」/ 胶囊 tab 36 高·18 圆角（选中 #1a1a2e 白字）/ 行 12px 0 分隔线
   #f3f4f6 / 底注 12px 带顶边线。改这里要同步核 canvas-src .../layout/points-dialog.tsx。 */
#zlm-points { position: fixed !important; inset: 0 !important; z-index: 420 !important; display: none !important; }
#zlm-points[data-open="true"] { display: block !important; }
#zlm-points .zlm-pts-mask {
  position: absolute !important; inset: 0 !important; background: rgba(0, 0, 0, .5) !important;
}
#zlm-points .zlm-pts-card {
  position: absolute !important; left: 50% !important; top: 50% !important;
  transform: translate(-50%, -50%) !important;
  width: 440px !important; max-width: 92vw !important;
  max-height: 78vh !important;
  background: #fff !important; border-radius: 18px !important;
  display: flex !important; flex-direction: column !important;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .3) !important;
  overflow: hidden !important;
}
#zlm-points .zlm-pts-head {
  display: flex !important; align-items: center !important; justify-content: space-between !important;
  padding: 18px 22px 14px !important; flex: 0 0 auto !important;
}
#zlm-points .zlm-pts-title { font-size: 18px !important; font-weight: 700 !important; color: #1a1a2e !important; }
#zlm-points .zlm-pts-x {
  width: 30px !important; height: 30px !important; border: none !important;
  border-radius: 50% !important; background: #f3f4f6 !important; color: #6b7280 !important;
  display: inline-flex !important; align-items: center !important; justify-content: center !important;
  cursor: pointer !important; flex: 0 0 auto !important; font-size: 14px !important; line-height: 1 !important;
}
#zlm-points .zlm-pts-x:hover { background: #e5e7eb !important; color: #1a1a2e !important; }

#zlm-points .zlm-pts-bal {
  display: flex !important; flex-direction: column !important; align-items: center !important;
  padding: 6px 22px 18px !important; flex: 0 0 auto !important;
}
#zlm-points .zlm-pts-bal-label {
  font-size: 13px !important; color: #9ca3af !important; margin-bottom: 6px !important;
}
#zlm-points #zlm-pts-num {
  font-size: 36px !important; font-weight: 800 !important; color: #1a1a2e !important;
  line-height: 1 !important;
}
#zlm-points .zlm-pts-recharge {
  margin-top: 12px !important; padding: 6px 28px !important; border: none !important;
  border-radius: 16px !important;
  background: linear-gradient(90deg, #6366f1, #8b5cf6) !important;
  color: #fff !important; font-size: 13px !important; font-weight: 600 !important;
  cursor: pointer !important;
  box-shadow: 0 4px 12px rgba(99, 102, 241, .25) !important;
  transition: all .15s ease !important;
}
#zlm-points .zlm-pts-recharge:hover {
  background: linear-gradient(90deg, #4f6ef7, #7c3aed) !important;
}

#zlm-points .zlm-pts-tabs {
  display: flex !important; gap: 8px !important; padding: 0 22px 14px !important;
  flex: 0 0 auto !important;
}
#zlm-points .zlm-pts-tab {
  flex: 1 1 0 !important; height: 36px !important;
  border: none !important; cursor: pointer !important;
  border-radius: 18px !important;
  font-size: 13px !important; font-weight: 400 !important;
  background: #f3f4f6 !important; color: #6b7280 !important;
  transition: all .15s ease !important;
}
#zlm-points .zlm-pts-tab:hover { background: #eceef6 !important; }
#zlm-points .zlm-pts-tab.zlm-on {
  background: #1a1a2e !important; color: #fff !important; font-weight: 600 !important;
}

#zlm-points .zlm-pts-list {
  flex: 1 1 auto !important; overflow-y: auto !important;
  min-height: 120px !important; max-height: 46vh !important;
  padding: 0 22px !important;
}
#zlm-points .zlm-pts-list::-webkit-scrollbar { width: 5px !important; }
#zlm-points .zlm-pts-list::-webkit-scrollbar-thumb { background: #d1d5db !important; border-radius: 3px !important; }
#zlm-points .zlm-pts-list::-webkit-scrollbar-track { background: transparent !important; }
#zlm-points .zlm-pts-row {
  display: flex !important; align-items: center !important; justify-content: space-between !important;
  gap: 12px !important; padding: 12px 0 !important;
  border-bottom: 1px solid #f3f4f6 !important;
}
#zlm-points .zlm-pts-row:last-child { border-bottom: none !important; }
#zlm-points .zlm-pts-l { display: flex !important; flex-direction: column !important; gap: 3px !important; min-width: 0 !important; }
#zlm-points .zlm-pts-ct {
  font-size: 14px !important; color: #333 !important;
  white-space: nowrap !important; overflow: hidden !important; text-overflow: ellipsis !important;
}
#zlm-points .zlm-pts-time { font-size: 12px !important; color: #9ca3af !important; }
#zlm-points .zlm-pts-amt {
  font-size: 15px !important; font-weight: 700 !important; white-space: nowrap !important;
  margin-left: 12px !important; font-variant-numeric: tabular-nums !important;
}
#zlm-points .zlm-pts-amt.zlm-neg { color: #333 !important; }
#zlm-points .zlm-pts-amt.zlm-pos { color: #10b981 !important; }
#zlm-points .zlm-pts-hint {
  padding: 40px 0 !important; text-align: center !important;
  font-size: 14px !important; color: #9ca3af !important;
}
/* ---- 充值记录：订单式行（形态与画布 PointsDialog 一致，2026-09-22 用户要求） ---- */
#zlm-points .zlm-rc-name {
  display: flex !important; align-items: center !important; gap: 6px !important;
  font-weight: 600 !important;
}
#zlm-points .zlm-rc-tag {
  flex: 0 0 auto !important; font-style: normal !important;
  font-size: 11px !important; color: #6366f1 !important; background: #eef2ff !important;
  padding: 1px 6px !important; border-radius: 4px !important;
}
#zlm-points .zlm-pts-time {
  display: flex !important; align-items: center !important; flex-wrap: wrap !important; gap: 4px !important;
}
#zlm-points .zlm-rc-refund { color: #f59e0b !important; }
#zlm-points .zlm-rc-right {
  display: flex !important; flex-direction: column !important; align-items: flex-end !important;
  flex: 0 0 auto !important; text-align: right !important; margin-left: 12px !important;
}
#zlm-points .zlm-rc-right b { font-size: 15px !important; font-weight: 700 !important; color: #333 !important; }
#zlm-points .zlm-rc-right > span { font-size: 12px !important; color: #10b981 !important; margin-top: 2px !important; white-space: nowrap !important; }
#zlm-points .zlm-rc-give { font-style: normal !important; color: #9ca3af !important; }
#zlm-points .zlm-pts-foot {
  padding: 14px 22px !important; text-align: center !important;
  font-size: 12px !important; color: #9ca3af !important;
  border-top: 1px solid #f3f4f6 !important; flex: 0 0 auto !important;
}

/* 手机端：两处都不注入（rail 不存在；胶囊只在 PC 顶栏有意义），弹窗仍可用 */
@media (max-width: 767px) {
  #zlm-points .zlm-pts-card { width: calc(100vw - 24px) !important; max-height: calc(100vh - 48px) !important; }
}

/* ============================================================================
 * 全窗口拖拽上传 · 提示层（2026-09-22）
 * 宿主只在输入框那一块装了 drop 处理，拖到聊天区/侧栏毫无反应 ⇒ 由 zlm-app.js
 * 接管文件拖拽并转发给输入框，本层只负责「松手前的可见反馈」。
 * ⛔ pointer-events 必须是 none：否则本层会变成落点，遮住宿主自己的判断
 *    （连「拖到输入框」那条本来好用的路都会被它挡住）。
 * ⛔ z-index 取 345：在宿主内容之上、我们自己的抽屉(350)/面板(400)/积分(420)之下。
 * 删掉本段即恢复「拖到别处无反应」的原状。
 * ==========================================================================*/
#zlm-drop-veil {
  position: fixed !important; inset: 0 !important; z-index: 345 !important;
  display: none; align-items: center; justify-content: center;
  background: rgba(26, 26, 46, 0.30);
  pointer-events: none !important;
}
#zlm-drop-veil[data-open="true"] { display: flex; }
#zlm-drop-veil .zlm-dv-card {
  display: flex; flex-direction: column; align-items: center;
  padding: 26px 36px 22px; border-radius: 18px;
  background: #fff; border: 1.5px dashed #8b5cf6;
  box-shadow: 0 20px 60px rgba(99, 102, 241, 0.32);
}
#zlm-drop-veil .zlm-dv-ic {
  width: 46px; height: 46px; border-radius: 14px; margin-bottom: 12px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.35); color: #fff;
}
#zlm-drop-veil .zlm-dv-ic svg { stroke: #fff; }
#zlm-drop-veil .zlm-dv-t {
  font-size: 16px; font-weight: 700; color: #1a1a2e; line-height: 1.2;
}
#zlm-drop-veil .zlm-dv-s {
  margin-top: 6px; font-size: 12px; color: #9ca3af; line-height: 1.2;
}

/* ============================================================================
 * 文件下载卡片（2026-09-23 用户要求：不要一长串链接，要「文件 + 下载按钮」）
 * ----------------------------------------------------------------------------
 * 作用对象：回答里由办公文件工具/网关生成的下载地址
 *   <a href="https://agent.zhilimao.com/dl/<日期>/<随机码>/<文件名>.xlsx">https://…</a>
 * 做法：不删节点、不加节点 —— 只用 CSS 把这颗 <a> 重绘成卡片：
 *   · font-size:0        → 把那串 URL 原文藏掉（保留节点，不影响 Markdown 段落流）
 *   · ::before           → 左侧格式徽章（内容取 data-zlm-ext，颜色按格式分）
 *   · ::after            → 文件名（内容取 data-zlm-file）
 *   · 右侧下载图标        → 用 background-image 贴在卡片右侧（不占伪元素）
 * class / data-* 由 zlm-app.js 的 decorateDownloadLinks() 每 300ms 补挂。
 * ⛔ 改这里的 `?v=` 必须同步加 index.html 里的 zlm-app.css 版本号，否则用户看到旧样式。
 * 回滚：删掉本段即可（<a> 恢复成原来的纯链接文本）。
 * ==========================================================================*/
a.zlm-dl,
.markdown a.zlm-dl {
  display: inline-flex !important;
  align-items: center !important;
  gap: 12px !important;
  box-sizing: border-box !important;
  min-width: 268px !important;
  max-width: 100% !important;
  margin: 8px 0 !important;
  padding: 11px 48px 11px 12px !important;
  border: 1px solid #e9e8f7 !important;
  border-radius: 14px !important;
  background-color: #fff !important;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%236366f1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4'/%3E%3Cpolyline points='7 10 12 15 17 10'/%3E%3Cline x1='12' y1='15' x2='12' y2='3'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 16px center !important;
  background-size: 21px 21px !important;
  box-shadow: 0 3px 12px rgba(25, 25, 60, .06) !important;
  font-size: 0 !important;
  line-height: 1 !important;
  text-decoration: none !important;
  vertical-align: middle !important;
  transition: border-color .18s ease, box-shadow .18s ease !important;
  touch-action: manipulation;
}
a.zlm-dl:hover,
.markdown a.zlm-dl:hover {
  border-color: #c9c6f5 !important;
  box-shadow: 0 7px 20px rgba(99, 102, 241, .17) !important;
  text-decoration: none !important;
}
a.zlm-dl::before {
  content: attr(data-zlm-ext);
  flex: 0 0 auto;
  width: 42px; height: 42px;
  border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10.5px !important; font-weight: 800; letter-spacing: .3px;
  background: #eef2ff; color: #4f46e5;
}
a.zlm-dl::after {
  content: attr(data-zlm-file);
  min-width: 0; flex: 1 1 auto;
  font-size: 13.5px !important; font-weight: 600; color: #33334a;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* 按格式换徽章颜色（对用户来说「一眼看出是什么文件」） */
a.zlm-dl[data-zlm-ext="XLSX"]::before { background: #e6f7ed; color: #0f9d58; }
a.zlm-dl[data-zlm-ext="DOCX"]::before { background: #e8f1fd; color: #1a73e8; }
a.zlm-dl[data-zlm-ext="PPTX"]::before { background: #fdf0e6; color: #d2691e; }
a.zlm-dl[data-zlm-ext="PDF"]::before  { background: #fdeaea; color: #d93025; }
/* 手机：卡片占满一行，触摸目标够大 */
@media (max-width: 640px) {
  a.zlm-dl, .markdown a.zlm-dl {
    display: flex !important;
    min-width: 0 !important;
    width: 100% !important;
    padding: 12px 46px 12px 12px !important;
  }
}

/* ============================================================================
 * 空会话页：把输入框压到底部（2026-09-23 用户要求）
 * ----------------------------------------------------------------------------
 * 底座那一层的类是 `flex flex-col scrollbar-gutter-spacer flex-1 items-center
 * justify-end sm:justify-center` —— 手机(<640px)本来 justify-end 贴底，
 * **PC(≥640px) 被 sm:justify-center 顶到垂直居中**，上面没地方给技能面板升起。
 * 这里只覆盖 ≥640px，并且用 `.zlm-landing-host`（由 zlm-app.js 的 markLanding()
 * 只挂在「类名带 sm:justify-center 的那层空会话容器」上）当闸门 ⇒ 对话页绝不受影响。
 * 回滚：删掉本段 + zlm-app.js 里 markLanding 的调用。
 * ==========================================================================*/
@media (min-width: 640px) {
  /* zlm-landing-host 由 zlm-app.js 的 markLanding() 挂到「空会话页」那一层容器上
     （特征是类名里带 sm:justify-center；对话页那层没有它 ⇒ 不会误伤） */
  .zlm-landing-host {
    justify-content: flex-end !important;
  }
  /* 底座给输入框留了 sm:mb-28（112px）巨量下边距，贴底后显得悬空 —— 收窄到 30px。
     ⚠️ sm:mb-28 挂在输入框外面**另一层**容器上（不是带 view-transition-name 的那层），
     只改后者是没用的（2026-09-23 实测：改完还剩 138px 悬空）⇒ 两层都要覆盖。 */
  .zlm-landing-host [class*="sm:mb-28"],
  .zlm-landing-host [class*="view-transition-name:chat-form"] {
    margin-bottom: 30px !important;
  }
  /* 2026-09-24 用户要求：首页问候语「智力猫在此 · 想把什么变成现实？」**往上移一点**。
     用 translateY 位移，不去改那一层的对齐方式 —— 不管它当时是「居中」还是「贴底」，
     位移量都一样，底座以后改布局也不会跳位置（实测位移前 top=347，位移后 283）。 */
  .zlm-landing-host > [class*="transform-gpu"] { transform: translateY(-64px); }
}


/* ============================================================================
 * 「技能」按钮 + 技能面板（2026-09-23 新增，见 zlm-app.js 末尾同名区块注释）
 * 回滚：删掉本段 + zlm-app.js 末尾那个 IIFE
 * ==========================================================================*/
#zlm-skillbtn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 11px; border: 0; border-radius: 10px;
  background: #f6f5ff; color: #5b53d6; font-size: 12px; font-weight: 600;
  font-family: inherit; cursor: pointer; transition: background .15s ease, box-shadow .15s ease;
}
#zlm-skillbtn:hover { background: #eeecff; }
#zlm-skillbtn[data-on="true"] {
  background: linear-gradient(135deg, #6366f1, #8b5cf6); color: #fff;
  box-shadow: 0 5px 14px rgba(99, 102, 241, .3);
}
#zlm-skillbtn svg { width: 15px; height: 15px; }
.zlm-skb-cnt {
  min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: #fff; color: #6366f1;
  font-size: 10.5px; font-weight: 800; align-items: center; justify-content: center;
}
#zlm-skillpanel {
  position: fixed; z-index: 60; display: none;
  background: #fff; border: 1px solid #ecebf7; border-radius: 18px;
  box-shadow: 0 22px 60px rgba(40, 30, 110, .18); padding: 13px 13px 9px;
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif; color: #1c1c28;
  /* 高度由 place() 按可用空间封顶 → 必须裁掉溢出的子元素，否则底栏会漏到面板外面 */
  overflow: hidden;
}
#zlm-skillpanel[data-open="true"] { display: flex; flex-direction: column; }
.zlm-sp-head { display: flex; align-items: center; gap: 9px; margin-bottom: 9px; flex-wrap: wrap; }
.zlm-sp-head h3 { font-size: 14px; font-weight: 800; margin: 0; }
.zlm-sp-sub { font-size: 11.5px; color: #9a9aae; }
.zlm-sp-search {
  flex: 1 1 180px; min-width: 150px; height: 34px; border-radius: 11px; background: #f7f7fc;
  border: 1px solid #eeedf7; display: flex; align-items: center; gap: 7px; padding: 0 11px; color: #a8a8bc;
}
.zlm-sp-search input { flex: 1; border: 0; outline: 0; background: transparent; font-size: 12.5px;
  color: #33334a; font-family: inherit; }
.zlm-sp-manage {
  height: 34px; padding: 0 12px; border-radius: 11px; border: 1px solid #e6e6f0; background: #fff;
  color: #4a4a5e; font-size: 12px; display: flex; align-items: center; gap: 6px; text-decoration: none;
}
.zlm-sp-manage:hover { background: #f7f7fc; }
.zlm-sp-body { overflow-y: auto; max-height: min(52vh, 430px); padding-right: 2px;
  /* 视口矮时让 body 自己让位（配合 place() 的 maxHeight 封顶），标题栏/底部按钮永不被裁 */
  flex: 1 1 auto; min-height: 96px; }
.zlm-sp-cat { font-size: 11px; color: #a2a2b5; margin: 9px 2px 6px; }
.zlm-sp-cat em { font-style: normal; color: #c4c4d4; }
.zlm-sp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.zlm-sp-card {
  display: flex; gap: 9px; align-items: flex-start; padding: 9px 10px; border: 1px solid #eeeef6;
  border-radius: 13px; background: #fff; cursor: pointer; box-shadow: 0 2px 6px rgba(25, 25, 60, .04);
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.zlm-sp-card:hover { border-color: #ddd9fb; }
.zlm-sp-card.on { border-color: #c7c2f7; background: #faf9ff; box-shadow: 0 4px 14px rgba(99, 102, 241, .13); }
.zlm-sp-ico { flex: 0 0 30px; width: 30px; height: 30px; border-radius: 10px; display: flex;
  align-items: center; justify-content: center; background: #eef2ff; color: #4f46e5; }
.zlm-sp-ico svg { width: 17px; height: 17px; }
.zlm-c-常用 { background: #fff4e0; color: #c77700; }
.zlm-c-办公 { background: #e8f1fd; color: #1a73e8; }
.zlm-c-营销 { background: #fdeaea; color: #d93025; }
.zlm-c-写作 { background: #f2ecfe; color: #7c3aed; }
.zlm-c-视频 { background: #fdf0e6; color: #d2691e; }
.zlm-c-调研 { background: #e6f7ed; color: #0f9d58; }
.zlm-c-其他 { background: #eef2ff; color: #4f46e5; }
.zlm-sp-txt { min-width: 0; }
.zlm-sp-txt b { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; }
.zlm-sp-txt small { display: block; font-size: 11.5px; color: #8f8fa3; line-height: 1.42; margin-top: 3px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.zlm-sp-tick { width: 16px; height: 16px; border-radius: 50%; background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff; font-size: 10px; font-style: normal; display: inline-flex; align-items: center; justify-content: center; }
.zlm-sp-foot { display: flex; align-items: center; gap: 10px; padding: 9px 2px 1px; margin-top: 8px;
  border-top: 1px solid #f2f2f8; }
.zlm-sp-hint { font-size: 11.5px; color: #a2a2b5; flex: 1; }
.zlm-sp-done { height: 32px; padding: 0 16px; border: 0; border-radius: 10px; color: #fff; font-size: 12.5px;
  font-weight: 700; font-family: inherit; cursor: pointer;
  background: linear-gradient(135deg, #6366f1, #8b5cf6); box-shadow: 0 5px 14px rgba(99, 102, 241, .3); }
.zlm-sp-empty { padding: 18px 4px; font-size: 12.5px; color: #a2a2b5; }
.zlm-sp-toast { position: fixed; left: 50%; bottom: 130px; transform: translateX(-50%); z-index: 70;
  background: rgba(28, 24, 60, .9); color: #fff; font-size: 12.5px; padding: 9px 14px; border-radius: 11px;
  transition: opacity .4s ease; }
.zlm-sp-toast.out { opacity: 0; }
@media (max-width: 700px) {
  .zlm-sp-grid { grid-template-columns: 1fr; }
  .zlm-sp-body { max-height: 46vh; }
}

/* 技能管理弹窗（2026-09-23）：左=系统技能（不可删） 右=我的技能（可删） */
#zlm-skillpanel .zlm-sp-manage { cursor: pointer; font-family: inherit; }
.zlm-sp-dlg { position: fixed; inset: 0; z-index: 75; background: rgba(28, 24, 60, .38);
  display: none; align-items: center; justify-content: center; }
.zlm-sp-dlg[data-open="true"] { display: flex; }
.zlm-sp-dlg-box { width: 720px; max-width: 92vw; max-height: 78vh; background: #fff; border-radius: 20px;
  box-shadow: 0 26px 70px rgba(30, 24, 70, .28); display: flex; flex-direction: column; overflow: hidden; }
.zlm-sp-dlg-head { display: flex; align-items: center; gap: 10px; padding: 16px 18px 12px; }
.zlm-sp-dlg-head b { font-size: 15px; font-weight: 800; }
/* 2026-09-24：说明那段话用户不要了，删掉；关闭按钮自己推到最右（原来靠说明文字的 flex:1 顶过去） */
.zlm-sp-dlg-x { margin-left: auto; width: 30px; height: 30px; border: 0; border-radius: 9px; background: #f5f5fa; color: #6a6a80;
  font-size: 13px; cursor: pointer; font-family: inherit; }
.zlm-sp-dlg-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 0 18px; overflow: hidden; }
.zlm-sp-col { display: flex; flex-direction: column; min-height: 0; }
.zlm-sp-col-h { font-size: 11.5px; color: #8f8fa3; margin: 4px 2px 8px; font-weight: 600; }
.zlm-sp-col-h em { font-style: normal; color: #c4c4d4; font-weight: 400; }
.zlm-sp-col-body { overflow-y: auto; max-height: 42vh; border: 1px solid #f0f0f6; border-radius: 14px; padding: 8px; background: #fbfbfe; }
.zlm-sp-mrow { display: flex; align-items: flex-start; gap: 8px; background: #fff; border: 1px solid #eeeef6;
  border-radius: 12px; padding: 9px 10px; margin-bottom: 7px; }
.zlm-sp-mtxt { min-width: 0; flex: 1; }
.zlm-sp-mtxt b { display: block; font-size: 12.5px; font-weight: 700; }
.zlm-sp-mtxt small { display: block; font-size: 11px; color: #8f8fa3; line-height: 1.4; margin-top: 2px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.zlm-sp-del { flex: 0 0 auto; height: 26px; padding: 0 10px; border: 1px solid #f3d4d4; background: #fff;
  color: #d93025; border-radius: 8px; font-size: 11.5px; cursor: pointer; font-family: inherit; }
.zlm-sp-del:hover { background: #fdf1f1; }
.zlm-sp-lock { flex: 0 0 auto; font-size: 10.5px; color: #a2a2b5; background: #f5f5fa; border-radius: 7px; padding: 4px 8px; }
/* 「我的技能」行 +「分类」下拉（2026-09-24）：
   用户给自己上传的技能选分类 → 技能库里就归到那一栏（落库在底座 skill 文档的 category 字段，跨设备/跨端一致）。
   行结构：名称/描述一行 → 换行后右侧「分类 [下拉] [删除]」，避免把行撑高。 */
.zlm-my { flex-wrap: wrap; }
.zlm-my .zlm-sp-mact { flex: 0 0 100%; display: flex; align-items: center; justify-content: flex-end;
  gap: 6px; margin-top: 7px; }
.zlm-sp-clab { font-size: 11px; color: #a2a2b5; }
/* 用户自传技能的行标（2026-09-29）：一句话讲清「这是你自己的、别人看不到」——
   用户传自己的技能包时最不放心的就是「会不会被别人看到」。
   挂在名称同一行，不新增行高（名称过长省略号，标签不被挤掉）。 */
.zlm-sp-mline { display: flex; align-items: center; gap: 6px; min-width: 0; }
.zlm-sp-mline b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zlm-sp-only { flex: 0 0 auto; font-size: 10px; font-weight: 400; color: #8b8ba3;
  background: #f2f2f8; border-radius: 6px; padding: 2px 6px; line-height: 1.5; }
.zlm-sp-mcat {
  height: 26px; padding: 0 22px 0 9px; border: 1px solid #e6e6f0; border-radius: 8px; color: #4a4a5e;
  background: #fff url("data:image/svg+xml;utf8,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='%23a2a2b5'%20stroke-width='2.2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='m6%209%206%206%206-6'/%3E%3C/svg%3E") no-repeat right 7px center / 10px 10px;
  font-size: 11.5px; font-family: inherit; cursor: pointer; appearance: none; -webkit-appearance: none;
}
.zlm-sp-mcat:hover { border-color: #ddd9fb; }
.zlm-sp-mcat[data-set="1"] { border-color: #ddd9fb; background-color: #f7f6ff; color: #4f46e5; font-weight: 600; }
.zlm-sp-mcat:disabled { opacity: .55; cursor: default; }
.zlm-sp-dlg-foot { display: flex; align-items: center; gap: 10px; padding: 12px 18px 16px; }
.zlm-sp-upload { height: 34px; padding: 0 14px; border: 1px solid #ddd9fb; background: #f7f6ff; color: #4f46e5;
  border-radius: 10px; font-size: 12.5px; font-weight: 600; cursor: pointer; font-family: inherit; }
.zlm-sp-dlg-hint { font-size: 11.5px; color: #9a9aae; }
@media (max-width: 760px) {
  .zlm-sp-dlg-cols { grid-template-columns: 1fr; }
  .zlm-sp-col-body { max-height: 26vh; }
}
/* 「搜索」芯片做成和「技能」按钮同款（换蓝色系），并隐藏底座自带的重复「技能」 */
#zlm-skillpanel ~ * [data-zlm-hide="1"], [data-zlm-hide="1"] { display: none !important; }
button[data-zlm-chip="search"], [data-zlm-chip="search"] {
  display: inline-flex !important; align-items: center !important; gap: 6px !important;
  height: 34px !important; padding: 0 11px !important; border: 0 !important; border-radius: 10px !important;
  background: #eef6ff !important; color: #2563eb !important; font-size: 12px !important; font-weight: 600 !important;
  font-family: inherit !important; box-shadow: none !important; cursor: pointer !important;
}
button[data-zlm-chip="search"]:hover, [data-zlm-chip="search"]:hover { background: #e0edff !important; }
button[data-zlm-chip="search"] svg, [data-zlm-chip="search"] svg { width: 15px !important; height: 15px !important;
  stroke: #2563eb !important; fill: none !important; }
button[data-zlm-chip="search"] * , [data-zlm-chip="search"] * { color: #2563eb !important; font-size: 12px !important;
  font-weight: 600 !important; }
/* 隐藏「工具选项」（滑块图标）—— 它下面那套开关已被我们的技能面板取代 */
#tools-dropdown-button { display: none !important; }
