/*---------- 云盘 · 新建任务（AI 会话） ---------- */
/* 本文件只在 templates/disk.html 引入；matools 站点走的是 matools-main.css，不会受影响 */

/* 左侧栏容器：纵向 flex，让 #myFileMenu 高度自适应（原先在 main.css，会让 matools 也生效，故挪到这里） */
.member-left{
	display:flex;
	flex-direction:column;
	/*注意：这里不能用 overflow:hidden，否则「创建」下拉菜单(宽333px)会被裁掉*/
}
.member-left>.form-group{flex:0 0 auto;}/*上面的 logo/创建/导入按自身高度固定*/
/*菜单区高度自适应：能放下就撑满剩余空间，放不下就出纵向滚动条（否则窗口不够高时底部菜单项会被视口裁掉）*/
.member-left>#myFileMenu{
	flex:1 1 auto;
	min-height:0;/*flex 项默认 min-height:auto，不写这行它就不会收缩，滚动条也不会出现*/
	overflow-y:auto;
	overflow-x:hidden;
	overscroll-behavior:contain;/*滚到底后不再带动整页滚动*/
	scrollbar-width:thin;
	scrollbar-color:rgba(0,0,0,.2) transparent;
}
.member-left>#myFileMenu::-webkit-scrollbar{width:6px;}
.member-left>#myFileMenu::-webkit-scrollbar-track{background:transparent;}
.member-left>#myFileMenu::-webkit-scrollbar-thumb{background:rgba(0,0,0,.16);border-radius:3px;}
.member-left>#myFileMenu::-webkit-scrollbar-thumb:hover{background:rgba(0,0,0,.32);}

/* 左侧菜单 */
#aiTaskMenu{position:relative;white-space:nowrap;}
/* 「我的文件」处于收缩状态时，把下面各文件类型的菜单项收起来（进入 AI 视图也会把它置为收缩，见 aiTaskCollapseProductMenu） */
#myFileMenu.ai-task-file-collapsed>.list-group-item.product{display:none;}
#aiTaskHistory{margin:2px 0 0 0;max-height:45vh;overflow-y:auto;overflow-x:hidden;}
#aiTaskHistory .ai-task-his{
	display:block;
	position:relative;
	margin:0;
	padding:7px 26px 7px 39px;/*左 padding 与「新建任务」的文字起点对齐（15px 内边距 + 24px 图标 = 39px）*/
	font-size:14px;/*与左侧一级菜单一致，比原来的 13px 大一号*/
	line-height:20px;/*原来的行高只有字体默认值(约1.43)，这里放宽，整项更高更好点*/
	font-weight:400;
	color:rgba(0,0,0,.65);
	background:#fafbfc;
	border:0;
	white-space:nowrap;
	overflow:hidden;
	text-overflow:ellipsis;
	cursor:pointer;
}
#aiTaskHistory .ai-task-his:hover{background:#f5f5f5;color:#222;}
#aiTaskHistory .ai-task-his.active{background:#edf0f3;color:#222;}
#aiTaskHistory .ai-task-his i{
	display:inline-block;
	width:auto;
	height:auto;
	padding:0;
	margin-right:5px;
	font-size:12px;/*跟随整项字号一起放大（原来是 11px）*/
	color:#9aa0a6;
	vertical-align:middle;
}
#aiTaskHistory .ai-task-his .ai-task-his-name{
	display:inline-block;
	max-width:132px;
	overflow:hidden;
	text-overflow:ellipsis;
	vertical-align:middle;
	transition:max-width .12s ease;
}
#aiTaskHistory .ai-task-his:hover .ai-task-his-name{max-width:78px;}/* 悬停时收窄，给 3 个图标让位 */
#aiTaskHistory .ai-task-his.ai-task-his-topped .ai-task-his-name{max-width:108px;}/* 图钉常显，预留一个图标的位置 */
#aiTaskHistory .ai-task-his.ai-task-his-topped:hover .ai-task-his-name{max-width:78px;}
/* 行内重命名输入框：绝对定位覆盖名称区域，不参与行盒
   （若用 width:100% 的块级 input，会把 inline 的会话图标挤到上一行，整项布局就散了）
   垂直居中用 transform 而不是负 margin：字号/行高调整后不用再重算偏移量 */
#aiTaskHistory .ai-task-his .ai-task-his-input{
	display:block;
	position:absolute;
	left:39px;/* 与名称文字的起始位置对齐 */
	right:26px;
	top:50%;
	transform:translateY(-50%);
	height:24px;
	margin:0;
	padding:0 6px;
	font-size:14px;
	line-height:22px;
	color:#222;
	background:#fff;
	border:1px solid #1296db;
	border-radius:3px;
	outline:none;
	box-sizing:border-box;
}
/* 右侧操作图标：置顶 / 重命名 / 删除 —— 默认隐藏，悬停整项时出现；显示时统一灰色
   垂直居中用 transform，字号/行高变化时不用重算偏移量 */
#aiTaskHistory .ai-task-his .ai-task-his-top,
#aiTaskHistory .ai-task-his .ai-task-his-rename,
#aiTaskHistory .ai-task-his .ai-task-his-del{
	display:none;
	position:absolute;
	top:50%;
	transform:translateY(-50%);
	color:#9aa0a6;
}
#aiTaskHistory .ai-task-his .ai-task-his-del{right:8px;}
#aiTaskHistory .ai-task-his .ai-task-his-rename{right:26px;}
#aiTaskHistory .ai-task-his .ai-task-his-top{right:44px;}
#aiTaskHistory .ai-task-his:hover .ai-task-his-top,
#aiTaskHistory .ai-task-his:hover .ai-task-his-rename,
#aiTaskHistory .ai-task-his:hover .ai-task-his-del{display:inline-block;}
/* 已置顶：图钉常显（同样是灰色） */
#aiTaskHistory .ai-task-his.ai-task-his-topped .ai-task-his-top{display:inline-block;}
/* 鼠标移到某个图标上时只加深一档作可点击反馈（仍然是灰阶，不出现蓝/红） */
#aiTaskHistory .ai-task-his .ai-task-his-top:hover,
#aiTaskHistory .ai-task-his .ai-task-his-rename:hover,
#aiTaskHistory .ai-task-his .ai-task-his-del:hover{color:#555;}
/* 重命名编辑态：隐藏三个操作图标，避免与输入框叠在一起 */
#aiTaskHistory .ai-task-his.ai-task-his-editing .ai-task-his-top,
#aiTaskHistory .ai-task-his.ai-task-his-editing .ai-task-his-rename,
#aiTaskHistory .ai-task-his.ai-task-his-editing .ai-task-his-del{display:none;}
#aiTaskHistory .ai-task-his-empty{padding:6px 27px 6px 39px;font-size:12px;color:#9aa0a6;}/*左 padding 与任务名对齐*/
/* 「查看更多」：任务超过 AI_TASK_HIS_MAX 条时出现在列表底部
   sticky 让它在列表内滚动时始终贴住可见区底部，不会被滚走
   悬停只换背景色，文字保持灰色（不变成蓝色）；不加分隔线 */
#aiTaskHistory .ai-task-his-more{
	position:sticky;
	bottom:0;
	display:block;
	margin:0;
	padding:6px 26px 7px 26px;
	font-size:13px;
	line-height:20px;
	color:#6b7280;
	background:#fafbfc;
	text-align:center;
	cursor:pointer;
}
#aiTaskHistory .ai-task-his-more:hover{background:#edf0f3;}
#aiTaskHistory .ai-task-his-more i{margin-left:2px;font-size:11px;}

/* ---------- 右侧会话框 ---------- */
#aiTaskPanel{
	display:none;
	flex-direction:column;
	height:calc(100vh - 120px);
	min-height:420px;
	overflow:hidden;/*顶栏与输入区固定，只有消息区滚动*/
}
/* 注意：显示态必须显式声明 flex，jQuery 的 show() 只会还原成 block，会破坏纵向布局 */
#aiTaskPanel.ai-task-show{display:flex;}
#aiTaskPanel *{box-sizing:border-box;}

/* 顶部（固定，不随消息区滚动） */
.ai-task-head{
	flex:0 0 auto;
	display:flex;
	align-items:center;
	justify-content:space-between;
	min-height:34px;
	padding-bottom:12px;
	background:#fff;
}
/* 标题用 h4：字号/字重/颜色沿用 Bootstrap 的 h4 默认值，与文件列表页 #tableHeader 下的 h4 标题一致；
   但 h4 默认行高只有 1.1，配合下面的 overflow:hidden（为了省略号）会把行盒压得比字形还矮，
   g / y / p 这类带下伸部的字母底部就被裁掉了，所以这里必须显式放大行高；
   内容 = 本地任务名称（没有名称时整块隐藏），超长用省略号，避免把右侧按钮挤出去 */
.ai-task-head .ai-task-title{
	flex:0 1 auto;
	min-width:0;
	margin:0;
	line-height:1.5;/*给下伸部留出空间，避免 overflow:hidden 裁掉 g / y 的下半部分*/
	overflow:hidden;
	white-space:nowrap;
	text-overflow:ellipsis;
}
/* 标题隐藏时（新任务还没输入）右侧按钮仍贴右，所以用 margin-left:auto 而不是靠 space-between */
.ai-task-head .ai-task-tools{flex:none;margin-left:auto;}
.ai-task-head .ai-task-btn{
	display:inline-block;
	margin-left:8px;
	padding:5px 13px;
	font-size:13px;
	color:rgba(0,0,0,.6);
	background:#f5f6f8;
	border-radius:15px;
	cursor:pointer;
}
.ai-task-head .ai-task-btn:hover{background:#eaeef2;}
/* 本地一条历史任务都没有时，顶栏的「历史任务」按钮不显示（没有列表可看） */
.ai-task-head .ai-task-btn.ai-task-btn-hide{display:none;}

/* 消息区 */
#aiTaskLog{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;padding:10px 10px 4px 2px;}
#aiTaskLog::-webkit-scrollbar{width:6px;}
#aiTaskLog::-webkit-scrollbar-thumb{background:#dfe3e8;border-radius:3px;}
#aiTaskLog::-webkit-scrollbar-track{background:transparent;}

/* 欢迎页 */
.ai-task-welcome{
	display:flex;
	flex-direction:column;
	align-items:center;
	justify-content:center;
	height:100%;
	min-height:200px;
	padding:0 12px 24px 12px;
	text-align:center;
}
.ai-task-mascot{width:96px;height:96px;animation:aiTaskFloat 3s ease-in-out infinite;}
.ai-task-mascot svg{display:block;width:100%;height:100%;}
@keyframes aiTaskFloat{0%,100%{transform:translateY(0)}50%{transform:translateY(-6px)}}
.ai-task-hi{margin:16px 0 0 0;font-size:28px;font-weight:700;color:#1f2329;letter-spacing:.5px;}
@media (max-width:900px){
	.ai-task-mascot{width:72px;height:72px;}
	.ai-task-hi{margin-top:12px;font-size:22px;}
}

/* 「全部任务」列表（点击左侧「查看更多」后显示在 #aiTaskLog 里）
   滚动交给外层 #aiTaskLog，这里不再自建滚动容器，避免双层滚动条 */
.ai-task-histlist{display:block;}
/* 列表标题：样式与文件列表的 #fileListCaption（caption 默认样式）保持一致 */
.ai-task-histlist-head{
	display:flex;
	align-items:center;
	padding:8px 0;
	font-size:14px;
	font-weight:400;
	color:#777;
	text-align:left;
}
.ai-task-histlist-count{
	margin-left:8px;
	padding:0 8px;
	font-size:12px;
	font-weight:400;
	line-height:18px;
	color:#6b7280;
	background:#f0f2f5;
	border-radius:9px;
}
/* 每行：与文件列表的表行一致——无卡片边框/圆角，靠底部 1px 分隔线区分，悬停整行浅灰
   行高比文件列表更大一些，整行更好点选 */
.ai-task-histitem{
	display:flex;
	align-items:center;
	padding:13px 0;
	background:transparent;
	border-bottom:1px solid #f2f6fd;
	cursor:pointer;
}
.ai-task-histitem:hover{background:#f5f5f5;}
.ai-task-histitem.active{background:#eef5fd;}
.ai-task-histitem-ico{flex:0 0 auto;margin-right:10px;font-size:16px;color:#9aa0a6;}
/* 名称与时间同一行：名称占满剩余宽度（超长省略号），时间固定贴右（相当于文件列表的时间列） */
.ai-task-histitem-main{flex:1;min-width:0;display:flex;align-items:center;}
.ai-task-histitem-name{
	flex:1 1 auto;
	min-width:0;
	font-size:14px;
	line-height:22px;
	color:rgba(0,0,0,.88);
	white-space:nowrap;
	overflow:hidden;
	text-overflow:ellipsis;
}
.ai-task-histitem-sub{
	flex:0 0 auto;
	margin-left:12px;
	font-size:14px;
	line-height:22px;
	color:rgba(0,0,0,.64);
	white-space:nowrap;
}
/* 右侧操作图标：置顶 / 重命名 / 删除 —— 与左侧一致，默认隐藏、悬停整项时出现、显示时统一灰色 */
.ai-task-histitem .ai-task-histitem-top,
.ai-task-histitem .ai-task-histitem-rename,
.ai-task-histitem .ai-task-histitem-del{
	display:none;
	flex:0 0 auto;
	margin-left:12px;
	font-size:14px;
	color:#9aa0a6;
	cursor:pointer;
}
.ai-task-histitem:hover .ai-task-histitem-top,
.ai-task-histitem:hover .ai-task-histitem-rename,
.ai-task-histitem:hover .ai-task-histitem-del{display:inline-block;}
/* 已置顶：图钉常显 */
.ai-task-histitem.ai-task-histitem-topped .ai-task-histitem-top{display:inline-block;}
.ai-task-histitem .ai-task-histitem-top:hover,
.ai-task-histitem .ai-task-histitem-rename:hover,
.ai-task-histitem .ai-task-histitem-del:hover{color:#555;}
/* 重命名编辑态：隐藏三个操作图标 + 输入框对齐名称行（高度与名称行一致，避免列表项跳动） */
.ai-task-histitem.ai-task-histitem-editing .ai-task-histitem-top,
.ai-task-histitem.ai-task-histitem-editing .ai-task-histitem-rename,
.ai-task-histitem.ai-task-histitem-editing .ai-task-histitem-del{display:none;}
.ai-task-histitem .ai-task-his-input{
	display:block;
	flex:1 1 auto;
	min-width:0;
	height:22px;
	margin:0;
	padding:0 6px;
	font-size:14px;
	line-height:20px;
	color:#222;
	background:#fff;
	border:1px solid #1296db;
	border-radius:3px;
	outline:none;
	box-sizing:border-box;
}
.ai-task-histlist-empty{padding:8px 0;font-size:13px;color:#9aa0a6;}

/* 消息气泡 */
.ai-task-msg{display:flex;margin:0 0 16px 0;}
/* 用户消息纵向排：气泡在上，复制按钮在气泡外的右下角（跟随气泡右缘），用 margin-top 拉开间隔 */
.ai-task-msg-user{flex-direction:column;align-items:flex-end;}
/* 气泡下方的操作行：用户消息右下（复制），AI 消息左下（复制 + 下载图片 + 重新生成；
   下载只给渲染成 svg 的图表类型，重新生成只留在最后一条回复）；
   行在气泡外面，margin-top 拉开间隔；默认隐藏，悬停整条消息时出现（触摸屏没有悬停，常显） */
.ai-task-msg-tools{display:flex;gap:6px;margin-top:4px;}
.ai-task-copy,.ai-task-dl,.ai-task-regen{
	display:inline-block;
	width:24px;
	height:24px;
	padding:2px;
	color:#7c8794;
	border-radius:5px;
	opacity:0;
	cursor:pointer;
	transition:opacity .12s ease;
}
.ai-task-copy svg,.ai-task-dl svg,.ai-task-regen svg{display:block;width:100%;height:100%;}
.ai-task-msg:hover .ai-task-copy,
.ai-task-msg:hover .ai-task-dl,
.ai-task-msg:hover .ai-task-regen{opacity:1;}
.ai-task-copy:hover,.ai-task-dl:hover,.ai-task-regen:hover{color:#1296db;}
.ai-task-copy.ai-task-copied{color:#3bbf67;opacity:1;}
@media (hover:none){
	.ai-task-copy,.ai-task-dl,.ai-task-regen{opacity:1;}
}
/* AI 消息纵向排：气泡在上，复制按钮在气泡外的左下角（跟随气泡左缘），与用户消息镜像 */
.ai-task-msg-ai{flex-direction:column;align-items:flex-start;}
.ai-task-bubble{
	max-width:82%;
	padding:10px 14px;
	font-size:14px;
	line-height:1.7;
	border-radius:14px;
	word-break:break-word;
}
.ai-task-msg-user .ai-task-bubble{
	color:#1f2329;
	background:#e8f1fb;
	border-radius:14px 14px 4px 14px;
}
.ai-task-msg-ai .ai-task-bubble{
	color:rgba(0,0,0,.85);
	background:#fff;
	border:1px solid #eef1f5;
	border-radius:14px 14px 14px 4px;
	overflow-x:auto;
}
/* AI 返回 type=text 时按 markdown 解析（见 ai-task.js 的 aiTaskRenderText），
   下面这些规则只管 AI 气泡里的正文标签，把浏览器默认的间距/字号收进气泡观感里；
   用户气泡的内容仍然是纯文本，不受影响 */
.ai-task-msg-ai .ai-task-bubble>*:first-child{margin-top:0;}
.ai-task-msg-ai .ai-task-bubble>*:last-child{margin-bottom:0;}
.ai-task-msg-ai .ai-task-bubble p{margin:0 0 8px 0;}
.ai-task-msg-ai .ai-task-bubble h1,
.ai-task-msg-ai .ai-task-bubble h2,
.ai-task-msg-ai .ai-task-bubble h3,
.ai-task-msg-ai .ai-task-bubble h4,
.ai-task-msg-ai .ai-task-bubble h5,
.ai-task-msg-ai .ai-task-bubble h6{margin:14px 0 8px 0;font-weight:600;line-height:1.4;}
.ai-task-msg-ai .ai-task-bubble h1{font-size:20px;}
.ai-task-msg-ai .ai-task-bubble h2{font-size:18px;}
.ai-task-msg-ai .ai-task-bubble h3{font-size:16px;}
.ai-task-msg-ai .ai-task-bubble h4,
.ai-task-msg-ai .ai-task-bubble h5,
.ai-task-msg-ai .ai-task-bubble h6{font-size:14px;}
.ai-task-msg-ai .ai-task-bubble ul,
.ai-task-msg-ai .ai-task-bubble ol{margin:0 0 8px 0;padding-left:22px;}
.ai-task-msg-ai .ai-task-bubble li{margin:2px 0;}
.ai-task-msg-ai .ai-task-bubble li>p{margin:0;}
.ai-task-msg-ai .ai-task-bubble code{
	padding:1px 5px;
	font-size:12.5px;
	color:#c7254e;
	background:#f6f7f9;
	border-radius:4px;
}
.ai-task-msg-ai .ai-task-bubble pre{
	margin:0 0 8px 0;
	padding:8px 10px;
	overflow-x:auto;
	background:#f7f8fa;
	border-radius:8px;
}
.ai-task-msg-ai .ai-task-bubble pre code{
	padding:0;
	font-size:12px;
	line-height:1.5;
	color:rgba(0,0,0,.75);
	background:transparent;
}
.ai-task-msg-ai .ai-task-bubble blockquote{
	margin:0 0 8px 0;
	padding:2px 0 2px 10px;
	color:rgba(0,0,0,.6);
	border-left:3px solid #e3e6ea;
}
.ai-task-msg-ai .ai-task-bubble table{margin:0 0 8px 0;border-collapse:collapse;font-size:13px;}
.ai-task-msg-ai .ai-task-bubble th,
.ai-task-msg-ai .ai-task-bubble td{padding:5px 10px;border:1px solid #e6e9ee;}
.ai-task-msg-ai .ai-task-bubble th{background:#f7f8fa;font-weight:600;}
.ai-task-msg-ai .ai-task-bubble hr{margin:12px 0;border:0;border-top:1px solid #eceff3;}
.ai-task-msg-ai .ai-task-bubble img{max-width:100%;}
.ai-task-msg-ai .ai-task-bubble a{color:#1296db;text-decoration:none;}
.ai-task-msg-ai .ai-task-bubble a:hover{text-decoration:underline;}
.ai-task-msg-attach{
	display:flex;
	align-items:center;
	max-width:240px;
	margin-top:6px;
	padding:4px 8px;
	font-size:12px;
	color:#4b5563;
	background:rgba(255,255,255,.7);
	border-radius:8px;
}
.ai-task-msg-attach svg{flex:none;width:14px;height:14px;margin-right:5px;}
.ai-task-msg-attach span{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;}

/* 消息操作 */
.ai-task-actions{margin-top:10px;}
/* 「打开编辑器」链接。类名不能写成 .ai-task-open —— 那是 #aiTaskMenu 展开态的状态类，
   两者撞名会把「新建任务」菜单项渲染成这个小药丸按钮（inline-block 收缩、13px 字号） */
.ai-task-open-editor{
	display:inline-block;
	padding:4px 12px;
	font-size:13px;
	color:#0f86c4;
	background:#eaf5fe;
	border-radius:14px;
	cursor:pointer;
}
.ai-task-open-editor:hover{background:#d8ecfc;}
.ai-task-code{
	margin:0;
	padding:8px 10px;
	font-size:12px;
	line-height:1.5;
	color:rgba(0,0,0,.75);
	background:#f7f8fa;
	border-radius:8px;
	white-space:pre-wrap;
	word-break:break-all;
}
/* 除 text 外，图表类内容的显示高度统一限高 380px：超出的部分由内容区自己滚动
   （mermaid 图会随宽度等比放大，很容易超过 380px，所以它必须能纵向滚动；
     在线图表/思维导图是固定 340px 高，本来就在限高之内，这里只是把上限写明确） */
.ai-task-mermaid{width:100%;max-height:380px;overflow-x:auto;overflow-y:auto;text-align:center;}
.ai-task-chart{width:100%;height:340px;max-height:380px;}
.ai-task-mind-box{width:100%;height:340px;max-height:380px;}
/* 思维导图预览用 iframe 隔离（mind.min.css 是编辑器整页样式，直接引入会污染左侧菜单布局） */
.ai-task-mind-frame{display:block;width:100%;height:100%;border:0;background:#fff;border-radius:8px;}
/* iframe、图表容器、mermaid 图没有固有宽度：气泡只靠 max-width:82% 会缩成默认的 300px
   或只剩内边距的宽度，所以给这几种类型一个确定的宽度撑满「可用宽度」；
   最大宽度不再单独放宽，统一由 .ai-task-bubble 的 82% 兜住，与 text 等类型保持一致 */
.ai-task-msg-ai .ai-task-bubble[data-resp-type="mind"],
.ai-task-msg-ai .ai-task-bubble[data-resp-type="chart"],
.ai-task-msg-ai .ai-task-bubble[data-resp-type="diagram"],
.ai-task-msg-ai .ai-task-bubble[data-resp-type="codechart"]{width:100%;padding:10px 12px;overflow:hidden;}

/* 甘特图预览：json -> 任务列表表格（列头与 gantt.js 的 gantt_th_* 一致）
   最大宽度同样统一用 82%，这里只管内边距和裁掉溢出的部分 */
.ai-task-msg-ai .ai-task-bubble[data-resp-type="gantt"]{padding:10px 12px;overflow:hidden;}
.ai-task-gantt{
	max-height:380px;/*与其它图表类型一致：最高 380px，超出在框内滚动*/
	overflow:auto;
	border:1px solid #eef1f5;
	border-radius:8px;
	scrollbar-width:thin;
	scrollbar-color:#ccc transparent;
}
.ai-task-gantt-table{
	width:100%;
	min-width:640px;
	border-collapse:collapse;
	font-size:12.5px;
	text-align:left;
}
.ai-task-gantt-table th{
	position:sticky;
	top:0;
	z-index:1;
	padding:8px 10px;
	font-weight:600;
	color:#374151;
	background:#f3f4f6;
	border-bottom:1px solid #e5e7eb;
	white-space:nowrap;
}
.ai-task-gantt-table td{
	padding:7px 10px;
	color:#1f2430;
	border-bottom:1px solid #f0f1f3;
	white-space:nowrap;
}
.ai-task-gantt-table tr:last-child td{border-bottom:0;}
.ai-task-gantt-table tr.ai-task-gantt-root td{font-weight:700;background:#f9fafb;}
/* td 上的 max-width 在自动表格布局里会被忽略，用内联块裁剪文字 */
.ai-task-gantt-clip{
	display:inline-block;
	max-width:100%;
	overflow:hidden;
	text-overflow:ellipsis;
	white-space:nowrap;
	vertical-align:bottom;
}
.ai-task-gantt-table .ai-task-gantt-name .ai-task-gantt-clip{max-width:240px;}
.ai-task-gantt-table .ai-task-gantt-people .ai-task-gantt-clip{max-width:130px;}
.ai-task-gantt-table .ai-task-gantt-desc .ai-task-gantt-clip{max-width:340px;}
.ai-task-gantt-table th.ai-task-gantt-st,.ai-task-gantt-table td.ai-task-gantt-st{width:28px;padding-right:6px;}
/* 状态圆点：颜色取自 components/gantt/gantt.min.css 的 .taskStatus */
.ai-task-gantt-status{
	display:inline-block;
	width:12px;
	height:12px;
	border-radius:50%;
	background:#dededf;
	vertical-align:-1px;
}
.ai-task-gantt-status[status="STATUS_WAITING"]{background:#f9c154;}
.ai-task-gantt-status[status="STATUS_ACTIVE"]{background:#3bbf67;}
.ai-task-gantt-status[status="STATUS_DONE"]{background:#6ebef4;}
.ai-task-gantt-status[status="STATUS_SUSPENDED"]{background:#f00;}
.ai-task-gantt-status[status="STATUS_FAILED"]{background:#763a96;}

/* 生成中 */
.ai-task-loading{display:inline-flex;align-items:center;font-size:13px;color:#9aa0a6;}
.ai-task-loading i{
	display:inline-block;
	width:6px;
	height:6px;
	margin-right:4px;
	background:#c8ced6;
	border-radius:50%;
	animation:aiTaskDot 1.2s infinite ease-in-out;
}
.ai-task-loading i:nth-child(2){animation-delay:.15s;}
.ai-task-loading i:nth-child(3){animation-delay:.3s;}
.ai-task-loading span{margin-left:4px;}
@keyframes aiTaskDot{0%,80%,100%{opacity:.35;transform:scale(.8)}40%{opacity:1;transform:scale(1)}}
/* 流式输出中：正文末尾跟一个闪烁光标，表示还在继续生成 */
.ai-task-stream-cursor{
	display:inline-block;
	width:2px;
	height:1em;
	margin-left:2px;
	background:#1296db;
	vertical-align:-2px;
	animation:aiTaskCursor 1s steps(1,end) infinite;
}
@keyframes aiTaskCursor{0%,50%{opacity:1}51%,100%{opacity:0}}

/* 底部输入区（固定，不随消息区滚动） */
.ai-task-bottom{flex:0 0 auto;padding-top:8px;background:#fff;}
/* 「全部任务」列表视图：#aiTaskLog 里是任务列表，不再需要底部输入区 */
#aiTaskPanel.ai-task-hist-show .ai-task-bottom{display:none;}
.ai-task-inputbox{
	padding:10px 12px 8px 12px;
	background:#fff;
	border:1px solid #e3e6ea;
	border-radius:22px;
	box-shadow:0 2px 12px rgba(15,35,60,.04);
	transition:border-color .2s,box-shadow .2s;
}
.ai-task-inputbox:focus-within{border-color:#9fd0f2;box-shadow:0 4px 16px rgba(18,150,219,.10);}
#aiTaskInput{
	display:block;
	width:100%;
	min-height:44px;
	max-height:180px;
	padding:6px 6px 0 6px;
	font-size:15px;
	line-height:1.6;
	font-family:inherit;
	color:#1f2329;
	background:transparent;
	border:0;
	outline:0;
	resize:none;
	overflow-y:auto;
}
#aiTaskInput::placeholder{color:#a8aeb8;}
.ai-task-toolbar{display:flex;align-items:center;justify-content:space-between;}
.ai-task-toolbar-left,.ai-task-toolbar-right{display:flex;align-items:center;}
.ai-task-toolbar-left{min-width:0;}

/* 已选类型标签：显示在「+」右侧，右侧 × 可清除 */
#aiTaskPickTag{
	display:none;
	align-items:center;
	height:34px;
	margin-left:2px;
	padding:0 2px;
	font-size:14px;
	line-height:1;
	color:#1296db;
	white-space:nowrap;
	user-select:none;
}
#aiTaskPickTag.ai-task-pick-show{display:flex;}
/* 图标沿用 chips 里的 file-icon（i1/i2/i3/i5/i7），class 由 aiTaskRefreshPick() 动态切换 */
#aiTaskPickTag .ai-task-pick-ico{
	flex:none;
	display:inline-block;
	width:18px;
	height:18px;
	margin-right:6px;
	background-size:18px 18px;
	background-repeat:no-repeat;
	background-position:center;
}
#aiTaskPickTag .ai-task-pick-name{max-width:132px;overflow:hidden;text-overflow:ellipsis;}
#aiTaskPickTag .ai-task-pick-del{
	flex:none;
	display:flex;
	align-items:center;
	justify-content:center;
	width:20px;
	height:20px;
	margin-left:2px;
	color:#1296db;
	border-radius:50%;
	cursor:pointer;
}
#aiTaskPickTag .ai-task-pick-del:hover{background:#eaf5fe;}
#aiTaskPickTag .ai-task-pick-del svg{display:block;width:13px;height:13px;}
.ai-task-icon-btn{
	display:flex;
	align-items:center;
	justify-content:center;
	width:34px;
	height:34px;
	padding:0;
	color:#4b5563;
	background:transparent;
	border:0;
	border-radius:50%;
	cursor:pointer;
}
.ai-task-icon-btn:hover{background:#f2f4f7;}
.ai-task-icon-btn svg{display:block;width:20px;height:20px;}
/* 右侧这一组统一用 gap 排间距：模型选择框 → 语音按钮 → 停止/发送按钮，
语音按钮两侧间距相等，正好落在模型选择框和发送按钮的正中间 */
.ai-task-toolbar-right{gap:6px;}
#aiTaskVoiceBtn{margin-right:0;}

/* 语音识别中 */
#aiTaskVoiceBtn.ai-task-recing{color:#e15b64;background:#fdecee;animation:aiTaskPulse 1.2s ease-in-out infinite;}
@keyframes aiTaskPulse{
	0%,100%{box-shadow:0 0 0 0 rgba(225,91,100,.35);}
	50%{box-shadow:0 0 0 7px rgba(225,91,100,0);}
}

/* 发送/停止按钮 */
.ai-task-send,.ai-task-stop{
	display:flex;
	align-items:center;
	justify-content:center;
	width:36px;
	height:36px;
	padding:0;
	color:#fff;
	border:0;
	border-radius:50%;
}
.ai-task-send{background:#d8dde3;cursor:default;}
.ai-task-send.ai-task-send-active{background:#1296db;cursor:pointer;}
.ai-task-send.ai-task-send-active:hover{background:#0f86c4;}
.ai-task-stop{background:#e15b64;cursor:pointer;}
.ai-task-stop:hover{background:#cf4c55;}
.ai-task-send svg,.ai-task-stop svg{display:block;width:20px;height:20px;}

/* 类型快捷按钮（未选择类型时显示） */
.ai-task-chips{display:flex;flex-wrap:wrap;justify-content:center;padding:12px 0 0 0;}
.ai-task-chip{
	display:inline-flex;
	align-items:center;
	height:34px;
	margin:0 6px 8px 6px;
	padding:0 14px;
	font-size:13px;
	color:#374151;
	background:#fff;
	border:1px solid #e3e6ea;
	border-radius:17px;
	cursor:pointer;
	transition:all .15s;
}
.ai-task-chip:hover{color:#1296db;border-color:#1296db;box-shadow:0 2px 8px rgba(18,150,219,.12);}
.ai-task-chip.ai-task-chip-sel{color:#0f86c4;background:#eaf5fe;border-color:#1296db;}
.ai-task-chip .file-icon{
	width:16px;
	height:16px;
	margin-right:6px;
	background-size:16px 16px;
	background-repeat:no-repeat;
	background-position:center;
}

/* 快捷指令（选择了类型后替换类型按钮显示，点击填充到输入框） */
.ai-task-quick{
	display:inline-flex;
	align-items:center;
	height:36px;
	margin:0 5px 8px 5px;
	padding:0 12px 0 16px;
	font-size:14px;
	color:#1f2329;
	background:#f2f3f5;
	border-radius:18px;
	cursor:pointer;
	transition:background .15s,color .15s;
}
.ai-task-quick:hover{color:#1296db;background:#e9edf2;}
.ai-task-quick span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.ai-task-quick svg{flex:none;width:13px;height:13px;margin-left:6px;color:#4b5563;}
.ai-task-quick:hover svg{color:#1296db;}

/* 附件卡片 */
#aiTaskAttachShow{display:none;margin:2px 0 8px 0;}
.ai-task-attach{
	position:relative;
	display:flex;
	align-items:center;
	width:300px;
	max-width:100%;
	height:58px;
	background:#f5f7fa;
	border-radius:12px;
	overflow:hidden;
}
.ai-task-attach-icon{
	flex:none;
	display:flex;
	align-items:center;
	justify-content:center;
	width:58px;
	height:58px;
	font-size:30px;
	color:#8a8f99;
}
.ai-task-attach-icon svg{width:30px;height:30px;}
.ai-task-attach-icon img{width:58px;height:58px;object-fit:cover;}
.ai-task-attach-info{flex:1;min-width:0;padding-right:10px;}
.ai-task-attach-name{font-size:13px;color:rgba(0,0,0,.8);overflow:hidden;white-space:nowrap;text-overflow:ellipsis;}
.ai-task-attach-atr{margin-top:4px;font-size:12px;color:#8a8f99;}
.ai-task-attach-atr span{margin-right:8px;}
.ai-task-attach-err{display:flex;align-items:center;margin-top:4px;font-size:12px;color:#f94d4d;}
.ai-task-attach-err svg{flex:none;width:14px;height:14px;margin-right:4px;}
.ai-task-attach-close{
	display:none;
	position:absolute;
	top:4px;
	right:4px;
	width:20px;
	height:20px;
	color:#8a8f99;
	cursor:pointer;
}
.ai-task-attach-close svg{display:block;width:20px;height:20px;}
.ai-task-attach:hover .ai-task-attach-close{display:block;}

/* ---------- 模型选择框（工具栏右侧，语音按钮左边） ---------- */
.ai-task-model-wrap{position:relative;display:flex;align-items:center;}
.ai-task-model-btn{
	display:flex;
	align-items:center;
	height:34px;
	max-width:190px;
	margin-right:0;/* 间距由 .ai-task-toolbar-right 的 gap 统一给，保证语音按钮两侧等距 */
	padding:0 8px;
	color:#1f2329;
	font-size:13px;
	line-height:1;
	font-family:inherit;
	background:#f4f6f8;
	border:0;
	border-radius:17px;
	cursor:pointer;
	transition:background .15s;
}
.ai-task-model-btn:hover{background:#eaeef2;}
.ai-task-model-btn .ai-task-model-ico{flex:none;display:inline-block;width:18px;height:18px;margin-right:5px;}
.ai-task-model-btn .ai-task-model-ico svg{display:block;width:18px;height:18px;}
.ai-task-model-btn .ai-task-model-img{display:block;width:18px;height:18px;border-radius:4px;object-fit:contain;}
.ai-task-model-btn .ai-task-model-name{max-width:140px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;}
.ai-task-model-btn .ai-task-model-arrow{flex:none;width:13px;height:13px;margin-left:2px;color:#8a9099;}
.ai-task-model-btn .ai-task-model-arrow svg{display:block;width:13px;height:13px;}

/* 下拉：从按钮上方弹出 */
.ai-task-model-pop{
	position:absolute;
	right:0;
	bottom:calc(100% + 12px);
	z-index:30;
	width:300px;
	max-height:340px;
	padding:6px;
	overflow-y:auto;
	background:#fff;
	border:1px solid #e3e6ea;
	border-radius:14px;
	box-shadow:0 10px 34px rgba(15,35,60,.16);
}
.ai-task-model-item{display:flex;align-items:center;padding:9px 10px;color:#1f2329 !important;font-size:14px;border-radius:10px;cursor:pointer;}
.ai-task-model-item:hover{background:#f4f7fa;}
.ai-task-model-item.ai-task-model-on{background:#eaf4fd;}
.ai-task-model-item .ai-task-model-ico{flex:none;width:20px;height:20px;margin-right:8px;color:#4b5563;}
.ai-task-model-item .ai-task-model-ico svg{display:block;width:20px;height:20px;}
.ai-task-model-item .ai-task-model-img{display:block;width:20px;height:20px;border-radius:4px;object-fit:contain;}
.ai-task-model-item .ai-task-model-name{flex:1;min-width:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;}
.ai-task-model-del{flex:none;display:none;width:16px;height:16px;margin-left:6px;color:#a8aeb8;cursor: pointer;}
.ai-task-model-del svg{display:block;width:16px;height:16px;}
.ai-task-model-del:hover{color:#e15b64;}
.ai-task-model-item:hover .ai-task-model-del{display:block;}
/* 后台已下线的自定义模型：灰显不可选（× 仍可删） */
.ai-task-model-item.ai-task-model-off{color:#b6bcc4;cursor:not-allowed;}
.ai-task-model-item.ai-task-model-off:hover{background:transparent;}
.ai-task-model-item.ai-task-model-off .ai-task-model-ico{opacity:.5;}
.ai-task-model-tag{flex:none;margin-left:6px;padding:1px 6px;color:#b6bcc4;font-size:11px;border:1px solid #e3e6ea;border-radius:8px;}
.ai-task-model-line{height:1px;margin:4px 2px;background:#eceff3;}
.ai-task-model-sub{display:flex;align-items:center;padding:6px 10px 4px 10px;color:#98a2ad;font-size:12px;}
.ai-task-model-sub svg{width:13px;height:13px;margin-left:4px;}
.ai-task-model-sub .ai-task-model-tip{display:flex;cursor:help;}
.ai-task-model-empty{padding:8px 10px 10px 10px;color:#b6bcc4;font-size:13px;}
.ai-task-model-foot{margin-top:2px;padding-top:6px;border-top:1px solid #eceff3;}
.ai-task-model-add{display:block;padding:9px 10px;font-size:14px;text-align:center;border-radius:10px;cursor:pointer;}
.ai-task-model-add:hover{background:#f4f7fa;color: #333;}

/* ---------- 「添加模型」弹框 ---------- */
.ai-task-modal-mask{
	position:fixed;
	left:0;
	top:0;
	right:0;
	bottom:0;
	z-index:9990;
	display:flex;
	align-items:center;
	justify-content:center;
	background:rgba(15,23,42,.35);
}
.ai-task-modal{
	width:520px;
	max-width:calc(100% - 32px);
	background:#fff;
	border-radius:18px;
	box-shadow:0 20px 60px rgba(15,35,60,.24);
}
/* 弹框浮层挂在 body 下，拿不到面板里的 border-box，这里统一一下，避免 100%+padding 溢出 */
.ai-task-modal,.ai-task-modal *{box-sizing:border-box;}
.ai-task-modal-head{display:flex;align-items:center;justify-content:space-between;padding:18px 20px 4px 20px;color:#1f2329;font-size:18px;font-weight:600;}
.ai-task-modal-close{width:22px;height:22px;color:#98a2ad;cursor:pointer;}
.ai-task-modal-close svg{display:block;width:22px;height:22px;}
.ai-task-modal-close:hover{color:#4b5563;}
.ai-task-modal-body{padding:10px 20px 0 20px;}
.ai-task-form-row{display:block;margin-bottom:14px;}
.ai-task-form-row>label{display:block;margin-bottom:6px;color:#4b5462;font-size:14px;font-weight:400;}
/* 标题行右边带链接（如 API Key 右侧的「获取 API Key」） */
.ai-task-form-label{display:flex;align-items:center;justify-content:space-between;margin-bottom:6px;}
.ai-task-form-label>label{color:#4b5462;font-size:14px;font-weight:400;}
.ai-task-key-link{flex:none;margin-left:10px;color:#6b7280;font-size:13px;text-decoration:none;cursor:pointer;}
.ai-task-key-link:hover{color:#4b5462;}
.ai-task-form-row>select{display:block;min-width:0;width:100%;height:40px;padding:0 10px;color:#1f2329;font-size:14px;font-family:inherit;background:#fff;border:1px solid #dfe3e8;border-radius:10px;outline:0;}
.ai-task-form-row>select:focus{border-color:#9fd0f2;}
/* 同一行并排的控件（如 API Key 输入框 + 测试连接按钮） */
.ai-task-form-inline{display:flex;align-items:center;}
.ai-task-form-inline>.ai-task-key-wrap{flex:1;min-width:0;}
/* 供应商下拉（带图标，替代原生 select） */
.ai-task-model-sel{position:relative;width:100%;min-width:0;}
.ai-task-sel-btn{display:flex;align-items:center;width:100%;height:40px;padding:0 10px;color:#1f2329;font-size:14px;font-family:inherit;background:#fff;border:1px solid #dfe3e8;border-radius:10px;cursor:pointer;}
.ai-task-sel-btn:hover{border-color:#9fd0f2;}
.ai-task-sel-ico{flex:none;display:flex;align-items:center;justify-content:center;width:18px;height:18px;margin-right:8px;color:#4b5563;}
.ai-task-sel-ico svg{display:block;width:18px;height:18px;}
.ai-task-sel-ico .ai-task-model-img{display:block;width:18px;height:18px;border-radius:4px;object-fit:contain;}
.ai-task-sel-name{flex:1;min-width:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;text-align:left;}
.ai-task-sel-arrow{flex:none;width:14px;height:14px;color:#8a9099;}
.ai-task-sel-arrow svg{display:block;width:14px;height:14px;}
.ai-task-model-sel-pop{display:none;position:absolute;left:0;right:0;top:calc(100% + 4px);z-index:40;max-height:220px;padding:4px;overflow-y:auto;background:#fff;border:1px solid #e3e6ea;border-radius:10px;box-shadow:0 10px 30px rgba(15,35,60,.16);}
.ai-task-sel-item{display:flex;align-items:center;padding:8px;border-radius:8px;color:#1f2329;font-size:14px;cursor:pointer;}
.ai-task-sel-item:hover{background:#f4f7fa;color: #1f2329;}
.ai-task-sel-item.ai-task-sel-on{background:#eaf4fd;}
.ai-task-sel-empty{padding:8px;color:#b6bcc4;font-size:13px;}
.ai-task-key-wrap{flex:1;min-width:0;display:flex;align-items:center;height:40px;padding:0 10px;border:1px solid #dfe3e8;border-radius:10px;}
.ai-task-key-wrap:focus-within{border-color:#9fd0f2;}
.ai-task-key-wrap input{flex:1;min-width:0;color:#1f2329;font-size:14px;font-family:inherit;background:transparent;border:0;outline:0;}
.ai-task-key-eye{flex:none;width:18px;height:18px;color:#98a2ad;cursor:pointer;}
.ai-task-key-eye svg{display:block;width:18px;height:18px;}
.ai-task-key-eye:hover{color:#4b5563;}
/* 浏览器自带的「显示密码」眼睛/清除按钮（聚焦或输入时才出现在输入框内右侧）：藏掉，只留我们自己那个 */
#aiTaskModelKey::-ms-reveal,#aiTaskModelKey::-ms-clear,#aiTaskModelKey::-webkit-reveal,#aiTaskModelKey::-webkit-credentials-auto-fill-button{display:none !important;}
.ai-task-btn-test{flex:none;height:40px;margin-left:10px;padding:0 14px;color:#1f2329;font-size:14px;font-family:inherit;background:#fff;border:1px solid #dfe3e8;border-radius:10px;cursor:pointer;}
.ai-task-btn-test:hover{color:#1296db;border-color:#9fd0f2;}
.ai-task-form-tip{min-height:20px;margin:0 0 6px 0;font-size:13px;}
.ai-task-msg-ok{color:#18a058;}
.ai-task-msg-fail{color:#e5484d;}
.ai-task-modal-foot{display:flex;align-items:center;justify-content:flex-end;padding:10px 20px 18px 20px;}
.ai-task-modal-btn{display:inline-block;height:38px;line-height:38px;margin-left:10px;padding:0 20px;color:#4b5462 !important;font-size:14px;background:#f2f4f7;border-radius:10px;cursor:pointer;}
.ai-task-modal-btn:hover{background:#e9edf2;}
.ai-task-modal-btn-main{color:#fff !important;background:#1f2329;}
.ai-task-modal-btn-main:hover{color:#fff;background:#000;}
