﻿/* 站内 AI 助手通用对话组件（配套 /static/js/ai-assistant.js）
   层级低于站点 Bootstrap 弹窗（backdrop 1040 / modal 1050）：解锁支付弹窗要浮在对话框之上 */

:root {
  /* 用户消息气泡配色 */
  --gha-msg-user-color: #0f1115;
  --gha-msg-user-bg: #edf3fe;
}

.gha-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1030;
}

.gha-modal {
  background: #fff;
  border-radius: 4px;
  width: 680px;
  max-width: calc(100vw - 32px);
  height: min(700px, calc(100vh - 80px));
  display: flex;
  flex-direction: column;
  font-size: 13px;
  color: #1f2329;
}

/* 内嵌停靠形态：填满宿主容器、无遮罩/圆角（富模块边栏用） */
.gha-modal--dock {
  width: 100%;
  max-width: none;
  height: 100%;
  border-radius: 0;
}
/* 停靠形态铺满左区：assistant 气泡占满宽度（窄弹窗才用 88% 的左右错位） */
.gha-modal--dock .gha-msg-assistant { width: 100%; max-width: 100%; }

/* 内嵌 dock 空状态：介绍语居中、输入沉底（勿用弹窗空态 padding-bottom:180，否则 dock 底部大片留白） */
.gha-modal--dock .gha-body.gha-empty {
  justify-content: flex-start;
  padding-bottom: 0;
}
.gha-modal--dock .gha-body.gha-empty .gha-hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.gha-modal--dock .gha-body.gha-empty .gha-foot {
  flex-shrink: 0;
  width: 100%;
  max-width: none;
  margin: 0;
}

.gha-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid #ebeef5;
}

.gha-title { font-size: 14px; color: #1A4FBE; }

/* composer 右侧/顶栏操作组（新对话/历史对话/模型设置）：无边框安静态，不抢发送按钮 */
.gha-composer-right .gha-btn,
.gha-fs-ops .gha-btn {
  border: none; background: none; color: #4e5969;
  height: 26px; padding: 0 8px; font-size: 12px; white-space: nowrap;
}
.gha-composer-right .gha-btn:hover,
.gha-fs-ops .gha-btn:hover { border: none; color: #1A4FBE; background: #f0f4fb; }
/* 初始/空状态即为新对话，无需再显示「新对话」入口（有对话后才出现） */
.gha-body.gha-empty #ghaNewBtn,
.gha-fullscreen:has(.gha-body.gha-empty) #ghaNewBtn { display: none; }

/* 模型选择器（Perplexity 同款）：触发按钮显「模型设置」，点击向上弹列表 */
.gha-model-wrap { position: relative; display: inline-flex; }
.gha-model-btn {
  display: inline-flex; align-items: center; gap: 4px;
  height: 26px; padding: 0 8px; border: none; background: none;
  font-size: 12px; color: #4e5969; cursor: pointer; border-radius: 4px;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.gha-model-btn:hover { background: #f0f4fb; color: #1A4FBE; }
.gha-model-btn .iconfont { font-size: 11px; transition: transform 0.15s ease; }
.gha-model-wrap.open .gha-model-btn { background: #f0f4fb; color: #1A4FBE; }
.gha-model-pop {
  display: none; position: absolute; right: 0; bottom: calc(100% + 6px); z-index: 10;
  min-width: 180px; max-height: 280px; overflow-y: auto;
  background: #fff; border: 1px solid #e5e6eb; border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08); padding: 4px;
}
.gha-model-wrap.open .gha-model-pop { display: block; }
.gha-model-item {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 7px 10px; font-size: 13px; color: #1f2329; cursor: pointer; border-radius: 4px;
  white-space: nowrap;
}
.gha-model-item:hover { background: #f2f3f5; }
.gha-model-item.active { color: #1A4FBE; background: #f0f4fb; }
.gha-model-item.locked { color: #a8abb2; }
.gha-model-item.locked:hover { background: #f7f8fa; }
.gha-model-vip { font-size: 11px; color: #a16207; background: #fdf3d7; border-radius: 3px; padding: 0 5px; line-height: 16px; }

.gha-btn {
  height: 30px;
  padding: 0 12px;
  border: none;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  font-size: 13px;
  color: #1f2329;
  transition: color 0.15s ease, background-color 0.15s ease;
}
.gha-btn:hover { color: #1A4FBE; background: #f0f4fb; }
.gha-btn:disabled { opacity: 0.6; cursor: default; }
/* 框架字体图标在按钮内统一尺寸/基线（设置/历史/解锁等） */
.gha-btn .iconfont { font-size: 13px; vertical-align: -1px; margin-right: 2px; }
.gha-btn-sm { padding: 0 10px; font-size: 12px; }
.gha-btn-primary { background: #1A4FBE; color: #fff; }
.gha-btn-primary:hover { background: #163F99; color: #fff; }
/* 忙时发送按钮切「停止」：红色，明确可中断 */
.gha-btn-stop { background: #BA2A20; color: #fff; }
.gha-btn-stop:hover { background: #9E2017; color: #fff; }
.gha-btn-unlock { color: #BA2A20; flex: none; height: 26px; padding: 0 10px; font-size: 12px; }
.gha-btn-unlock:hover { color: #BA2A20; background: #FDECEA; }
/* 一键解锁占原「N 条需解锁」提示位（底栏最左），与右侧添加/确认分列 */
.gha-btn-unlock-all { margin-right: auto; }
/* #1 确认卡底栏所有按钮等高（一键解锁/添加数据/确认出图统一 30px，行内解锁仍 26px） */
.gha-card-foot .gha-btn { height: 30px; }

/* 链接形态按钮（对比方案卡「打开对比页」） */
a.gha-btn { display: inline-flex; align-items: center; text-decoration: none !important; }

/* ==================== 分析结果卡（channel=analysis 的 analysis 块） ==================== */

.gha-an-taskno { margin-left: 8px; font-size: 11px; font-weight: 400; color: #86909C; }

.gha-an-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
  margin: 8px 0;
}
.gha-an-metric { border: 1px solid #ebeef5; border-radius: 4px; padding: 8px 10px; }
.gha-an-metric-v { font-size: 16px; font-weight: 600; color: #1f2329; font-variant-numeric: tabular-nums; }
.gha-an-metric-n { margin-top: 2px; font-size: 11px; color: #4E5969; }

.gha-an-chart { width: 100%; height: 260px; margin: 8px 0; }

.gha-an-table-title { margin: 8px 0 4px; font-size: 12px; font-weight: 600; color: #1f2329; }
.gha-an-table-scroll { overflow-x: auto; }
.gha-an-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.gha-an-table th, .gha-an-table td {
  border: 1px solid #ebeef5;
  padding: 4px 8px;
  text-align: center;
  white-space: nowrap;
}
.gha-an-table th { background: #F5F7FB; color: #4E5969; font-weight: 600; }
.gha-an-table td { color: #1f2329; font-variant-numeric: tabular-nums; }

.gha-an-narrative {
  margin-top: 8px;
  font-size: 12px;
  color: #4E5969;
  line-height: 1.6;
  background: #F0F4FB;
  border-radius: 0 4px 4px 0;
  padding: 7px 10px;
}

.gha-close {
  border: none;
  background: none;
  font-size: 14px;
  color: #4E5969;
  cursor: pointer;
  padding: 4px 6px;
}
.gha-close:hover { color: #1f2329; }

/* 主体：消息区 + 介绍语 + 输入，列向。默认(有消息)：消息撑满、输入沉底 */
.gha-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* 空状态(ChatGPT 同款)：介绍语 + 输入框整体居中、略偏上（padding-bottom 把中心上移） */
.gha-body.gha-empty { justify-content: center; padding-bottom: 180px; }
.gha-body.gha-empty .gha-list { display: none; }
.gha-body.gha-empty .gha-foot {
  border-top: none;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
}

/* 介绍语 hero：仅空状态显示，居中、限宽，位于输入框上方 */
.gha-hero { display: none; }
.gha-body.gha-empty .gha-hero {
  display: block;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 0 14px 104px;   /* 底部留白把标题+快捷问题整体上移，视觉中心偏上 */
  text-align: center;
}
.gha-hero-title { font-size: 20px; font-weight: 600; color: #1f2329; margin-bottom: 6px; }

/* dock 空状态的快捷问题：竖排、左对齐、宽度随内容（与小程序 .ag-sugs 同一形态） */
.gha-hero-chips {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  margin-top: 20px;
  padding: 0 20px;
}
.gha-hero-chips .gha-chip { text-align: left; }

.gha-list {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 20px;          /* 消息间距统一由父级 gap 发，子元素不要各自加 margin（会叠加、还要处理首尾特例） */
  background: #fff;   /* AI 对话区统一白底，勿引入其他底色 */
}

.gha-tip { color: #4E5969; line-height: 1.9; text-align: center; }

.gha-msg { max-width: 88%; line-height: 1.7; }
.gha-msg-user {
  align-self: flex-end;
  background: var(--gha-msg-user-bg);
  color: var(--gha-msg-user-color);
  border-radius: 4px;
  padding: 8px 12px;
  white-space: pre-wrap;
  word-break: break-word;
}
.gha-msg-assistant { align-self: flex-start; width: 88%; }

/* assistant 气泡底部操作（复制等）：默认低调，悬停气泡才显眼 */
.gha-msg-tools { margin-top: 10px; display: flex; align-items: center; gap: 6px; }
.gha-copy {
  border: 0; background: none; cursor: pointer;
  color: #C0C4CC; padding: 2px 5px; border-radius: 4px; line-height: 1;
}
.gha-msg-assistant:hover .gha-copy { color: #86909C; }
.gha-copy:hover { color: #1A4FBE !important; background: #F0F4FB; }
.gha-copy .iconfont { font-size: 14px; }
/* 本条回答消耗 token（复制按钮右侧，极弱） */
.gha-tok { font-size: 11px; color: #C0C4CC; }
/* 今日用量进度条 + VIP 徽标：靠右对齐，弱化不抢正文 */
.gha-quota { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: #C0C4CC; }
.gha-quota-bar { width: 56px; height: 4px; border-radius: 2px; background: #EBEEF5; overflow: hidden; }
.gha-quota-bar i { display: block; height: 100%; background: #1A4FBE; border-radius: 2px; }
.gha-quota.low .gha-quota-bar i { background: #BA2A20; }
.gha-quota-tx { font-variant-numeric: tabular-nums; white-space: nowrap; }
.gha-quota.low .gha-quota-tx { color: #BA2A20; }
.gha-quota-vip { display: inline-flex; align-items: center; gap: 2px; color: #a16207; }
.gha-quota-vip .iconfont { font-size: 12px; }

/* 委派透明提示：转交专用频道时的一行灰字 */
.gha-note { font-size: 12px; color: #86909C; margin: 2px 0 4px; }

/* 主流：文字片段与卡片按时序交替（最终结论自然落在结果卡下方） */
.gha-stream { display: flex; flex-direction: column; gap: 8px; }
.gha-stream > .gha-card { margin-top: 0; }

/* 过程区：工具步骤 + 转交提示 + 思考；done 后折叠为「已完成 N 步」可展开 */
.gha-proc { margin-bottom: 4px; }
.gha-proc-head { display: none; cursor: pointer; color: #86909C; font-size: 12px; padding: 3px 0; user-select: none; }
.gha-proc-head:hover { color: #1A4FBE; }
.gha-proc-head .iconfont { font-size: 12px; margin-left: 4px; }   /* #6 折叠图标在文字右侧 */
.gha-proc.done .gha-proc-head { display: inline-block; }
.gha-proc.collapsed .gha-proc-body { display: none; }
.gha-proc-body { display: flex; flex-direction: column; gap: 2px; }
/* 思考文字：比最终正文略弱，归在过程区 */
.gha-think { color: #4E5969; font-size: 13px; line-height: 1.7; margin: 2px 0 6px; }
.gha-think p { margin: 0 0 4px; }
.gha-think p:last-child { margin-bottom: 0; }

.gha-steps { font-size: 12px; color: #4E5969; }
.gha-step { padding: 2px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gha-step i { font-style: normal; display: inline-block; width: 14px; text-align: center; }
/* 进行中态：转圈 spinner（替代原文字省略号，避免文字图标）；完成时 JS 写入 ✓/✗ 并加 ok/fail 类覆盖 */
.gha-step:not(.ok):not(.fail) i { position: relative; height: 14px; vertical-align: -3px; }
.gha-step:not(.ok):not(.fail) i::before {
  content: ''; position: absolute; top: 2px; left: 2px; width: 9px; height: 9px;
  border: 1.5px solid #C9CDD4; border-top-color: #4E5969; border-radius: 50%;
  animation: gha-spin 0.7s linear infinite;
}
@keyframes gha-spin { to { transform: rotate(360deg); } }
.gha-step.ok i { color: #0A7C4E; }
.gha-step.fail i { color: #BA2A20; }
.gha-step em { font-style: normal; color: #9aa3ad; }

/* AI 正文：裸文字，不套盒子。
   原来是「白底 + 浅灰边框 + 圆角」，可对话区本来就是白底——白底套白底的框不区分任何东西，
   纯装饰（前台克制规范：不是消费级网站，无边框、禁装饰性元素）。角色靠左右对齐已经分开了，
   用户消息那侧的底色才是有意义的区分。
   连带去掉 padding：边框没了还留 12px 内缩，正文会比过程区、卡片外沿莫名右移一截。
   卡片 .gha-card 的边框保留——它是真·独立对象（确认卡/结果卡），不在此列。 */
.gha-text {
  margin-top: 6px;
  word-break: break-word;
}
.gha-failed { color: #BA2A20; }

.gha-md p { margin: 0 0 6px; }
.gha-md p:last-child { margin-bottom: 0; }
.gha-md ul, .gha-md ol { margin: 4px 0 6px; padding-left: 20px; }
.gha-md li { margin: 2px 0; }
.gha-md code { background: #f5f6f8; border-radius: 3px; padding: 1px 5px; font-size: 12px; }
/* 标题：克制分级（不要 marked 默认的超大粗体），首条不留上边距 */
.gha-md h1, .gha-md h2, .gha-md h3, .gha-md h4 {
  margin: 14px 0 6px; line-height: 1.4; font-weight: 600; color: #1f2329;
}
.gha-md h1 { font-size: 17px; padding-bottom: 5px; border-bottom: 1px solid #ebeef5; }
.gha-md h2 { font-size: 15px; }
.gha-md h3 { font-size: 14px; }
.gha-md h4 { font-size: 13px; color: #4e5969; }
.gha-md > :first-child { margin-top: 0; }
/* 分隔线：细灰线，不要默认的粗凹槽 */
.gha-md hr { border: none; border-top: 1px solid #ebeef5; margin: 12px 0; }
/* 引用块：浅底区分，不用左竖条（规范禁 border-left 竖条装饰） */
.gha-md blockquote {
  margin: 6px 0; padding: 6px 12px;
  background: #f7f9fc; color: #4e5969;
}
.gha-md blockquote p:last-child { margin-bottom: 0; }
.gha-md strong { font-weight: 600; color: #1f2329; }
.gha-md a { color: #1A4FBE; }
/* GFM 表格：复用全站统一基类 .data-table（common.css），此处只管聊天流里的间距与横向滚动 */
.gha-md .gha-table-wrap { overflow-x: auto; margin: 6px 0; }
.gha-md .gha-table-wrap .data-table th,
.gha-md .gha-table-wrap .data-table td { min-width: 0; padding: 6px 10px; white-space: nowrap; }

.gha-typing { display: flex; align-items: center; gap: 4px; padding: 8px 2px; }
.gha-typing span {
  width: 6px; height: 6px; border-radius: 50%;
  background: #1A4FBE; opacity: 0.4;
  animation: gha-bounce 1.2s infinite;
}
.gha-typing span:nth-child(2) { animation-delay: 0.15s; }
.gha-typing span:nth-child(3) { animation-delay: 0.3s; }
.gha-typing em { font-style: normal; font-size: 12px; color: #4E5969; margin-left: 4px; }
@keyframes gha-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-4px); opacity: 1; }
}

.gha-card {
  background: #fff;
  border: 1px solid #ebeef5;
  border-radius: 4px;
  padding: 10px 12px;
  margin-top: 8px;
}
.gha-card-title { font-weight: 600; margin-bottom: 6px; }
/* 交互卡完成后的灰字回显（已选择：X / 已确认 N 项数据 / 已确认 N 个方法） */
.gha-card-echo { margin-top: 8px; font-size: 12px; color: #86909C; }
.gha-card-chart { padding: 10px; }
.gha-chart { width: 100%; height: 300px; }
.gha-chart-loading { color: #4E5969; font-size: 12px; text-align: center; padding: 20px 0; }
/* 图表卡脚：预览提示 + 去工作台按钮（对话内图是预览，引导深加工） */
.gha-chart-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.gha-chart-foot-tip { font-size: 12px; color: #86909C; }
.gha-chart-more { font-size: 12px; height: 28px; line-height: 26px; padding: 0 12px; white-space: nowrap; }

.gha-result {
  display: block;
  padding: 6px 4px;
  border-top: 1px solid #ebeef5;
  text-decoration: none;
  color: #1f2329;
}
.gha-result:hover .gha-result-name { color: #1A4FBE; }
.gha-result-name { display: block; }
.gha-result-meta { display: block; font-size: 12px; color: #4E5969; margin-top: 2px; }

.gha-citem { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px solid #ebeef5; }
.gha-citem-info { flex: 1; min-width: 0; }
.gha-citem-name { display: block; color: #1f2329; text-decoration: none; }
a.gha-citem-name:hover { color: #1A4FBE; }
.gha-citem-meta { display: block; font-size: 12px; color: #4E5969; }
.gha-card-foot {
  display: flex; align-items: center; justify-content: flex-end; gap: 10px;
  padding-top: 8px;  margin-top: 2px;
}
.gha-card-hint { font-size: 12px; color: #BA2A20; margin-right: auto; }

/* 确认卡：移除按钮 + 添加数据内嵌搜索 */
.gha-citem-del {
  flex: none; width: 24px; height: 24px; margin-left: 4px;
  border: 0; background: none; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  color: #C0C4CC; border-radius: 4px;
}
.gha-citem-del .iconfont { font-size: 14px; line-height: 1; }
.gha-citem-del:hover { color: #BA2A20; background: #FDECEA; }
.gha-cadd { margin-top: 8px; }
.gha-cadd-toggle, .gha-madd-toggle { color: #1A4FBE; }
.gha-cadd-box { margin-top: 8px; }
/* 添加数据 tab：搜索平台数据 / 我的上传 */
.gha-cadd-tabs { display: flex; gap: 4px; margin-bottom: 8px; border-bottom: 1px solid #ebeef5; }
.gha-cadd-tab { border: none; background: none; padding: 6px 8px; font-size: 12px; color: #4E5969; cursor: pointer; border-bottom: 2px solid transparent; }
.gha-cadd-tab.active { color: #1A4FBE; border-bottom-color: #1A4FBE; }
/* 搜索输入框（左侧框架搜索图标 icon-sousuo8） */
.gha-cadd-inputwrap { position: relative; }
.gha-cadd-ico {
  position: absolute; left: 9px; top: 50%; transform: translateY(-50%);
  font-size: 14px; color: #86909C; pointer-events: none;
}
.gha-cadd-input {
  width: 100%; height: 32px; box-sizing: border-box;
  border: 1px solid #C9CDD4; border-radius: 4px; padding: 0 10px 0 30px;
  font-size: 13px; outline: none;
}
.gha-cadd-input:focus { border-color: #1A4FBE; }
.gha-cadd-results { margin-top: 6px; max-height: 260px; overflow-y: auto; }
.gha-cadd-empty { padding: 12px 8px; text-align: center; color: #86909C; font-size: 12px; }
.gha-cadd-item {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  width: 100%; border: 0; background: none; cursor: pointer;
  padding: 8px; border-radius: 4px; text-align: left;
}
.gha-cadd-item:hover { background: #F0F4FB; }
.gha-cadd-item:disabled { cursor: default; opacity: 0.6; }
.gha-cadd-item:disabled:hover { background: none; }
.gha-cadd-name { font-size: 13px; color: #1f2329; }
.gha-cadd-dis { font-style: normal; font-size: 11px; color: #BA2A20; margin-left: 4px; }
.gha-cadd-meta { font-size: 11px; color: #4E5969; line-height: 1.5; }

/* 方法确认卡（confirm_methods）：建议方法 chip（可删）+ 目录添加 */
.gha-card-sub { margin-left: 8px; font-size: 11px; font-weight: 400; color: #86909C; }
.gha-mitem { display: flex; align-items: flex-start; gap: 8px; padding: 7px 0; border-top: 1px solid #ebeef5; }
.gha-mitem-info { flex: 1; min-width: 0; }
.gha-mitem-name { display: block; font-size: 13px; color: #1f2329; }
.gha-mitem-reason { display: block; font-size: 12px; color: #4E5969; margin-top: 1px; line-height: 1.5; }
.gha-mitem-bad { display: block; font-size: 11px; color: #BA2A20; margin-top: 2px; }
.gha-mitem.is-bad .gha-mitem-name { color: #BA2A20; }

/* 预测设置卡（confirm_forecast）：方法多选 + 期数选择 */
.gha-fc-label { font-size: 12px; color: #4E5969; margin: 10px 0 6px; font-weight: 600; }
.gha-fc-label:first-of-type { margin-top: 4px; }
.gha-fc-sub { margin-left: 6px; font-size: 11px; font-weight: 400; color: #86909C; }
.gha-fc-opts { display: flex; flex-direction: column; gap: 6px; }
.gha-fc-opt {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  width: 100%; text-align: left; cursor: pointer;
  border: 1px solid #E4E6EB; border-radius: 4px; background: #fff; padding: 7px 10px;
}
.gha-fc-opt:hover { border-color: #1A4FBE; }
.gha-fc-opt.is-on { border-color: #1A4FBE; background: #F0F4FB; }
.gha-fc-opt:disabled { cursor: default; opacity: 0.7; }
.gha-fc-opt-name { font-size: 13px; color: #1f2329; }
.gha-fc-opt.is-on .gha-fc-opt-name { color: #1A4FBE; }
.gha-fc-opt-desc { font-size: 11px; color: #86909C; line-height: 1.5; }
.gha-fc-pds { display: flex; flex-wrap: wrap; gap: 6px; }
.gha-fc-pd {
  cursor: pointer; border: 1px solid #E4E6EB; border-radius: 4px; background: #fff;
  padding: 5px 12px; font-size: 12px; color: #4E5969;
}
.gha-fc-pd:hover { border-color: #1A4FBE; }
.gha-fc-pd.is-on { border-color: #1A4FBE; background: #F0F4FB; color: #1A4FBE; }
.gha-fc-pd:disabled { cursor: default; opacity: 0.7; }
/* 会员专享档位：虚线置灰但仍可点（点了走开通引导），不做成点不动的死按钮 */
.gha-fc-pd.is-vip { color: #8a94a6; border-style: dashed; }
.gha-fc-pd-vip { font-size: 11px; color: #a16207; background: #fdf3d7; border-radius: 3px; padding: 0 4px; margin-left: 4px; line-height: 16px; }

/* 紧凑结果提示（结果在宿主右栏渲染） */
.gha-an-summary .gha-an-sum-head { font-size: 13px; font-weight: 600; color: #0A7C4E; }

/* 自定义分析卡（AI 写代码→沙盒执行） */
.gha-ca-title { font-weight: 400; color: #1f2329; }
.gha-ca-toggle {
  margin-top: 6px; border: 0; background: none; cursor: pointer;
  padding: 0; font-size: 12px; color: #1A4FBE;
}
.gha-ca-code {
  margin: 6px 0 0; padding: 8px 10px; max-height: 240px; overflow: auto;
  background: #F5F6F8; border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px; line-height: 1.5; color: #1f2329; white-space: pre;
}

/* 历史对话弹窗（居中遮罩，与「生成报告」同款外壳） */
.gha-hist-overlay {
  position: fixed;
  inset: 0;
  /* 与 .gha-mask / .gha-fullscreen(1030) 同一套层级：仅高于 AI 面板本身，
     必须低于 Bootstrap 弹窗(backdrop 1050 / modal 1055)，
     否则本抽屉会把 showConfirm 删除确认框、统一支付弹窗整个盖住（点了像没反应）。 */
  z-index: 1035;
  background: rgba(31, 45, 61, 0.45);
  display: flex;
  align-items: stretch;
  justify-content: flex-end;   /* 侧边抽屉：面板贴右侧 */
}
.gha-hist-panel {
  position: relative;
  width: 380px;            /* 右侧抽屉宽度 */
  max-width: 100%;
  height: 100vh;
  max-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 0;
  overflow: hidden;
  box-shadow: -4px 0 16px rgba(31, 45, 61, 0.12);
  animation: gha-hist-slidein 0.22s ease;
}
@keyframes gha-hist-slidein { from { transform: translateX(100%); } to { transform: translateX(0); } }
.gha-hist-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 14px;
  border-bottom: 1px solid #ebeef5;
  flex: none;
}
/* 标题做成「生成报告/我的分析」同款的选中态标签（品牌色 + 2px 下划线压住头部边框） */
.gha-hist-title {
  padding: 12px 4px;
  font-size: 14px;
  color: #1A4FBE;
  border-bottom: 2px solid #1A4FBE;
  margin-bottom: -1px;
}
.gha-hist-close { border: none; background: none; font-size: 22px; line-height: 1; color: #86909C; cursor: pointer; padding: 4px 6px; }
/* body 高度/内边距与 ghsr-body 对齐（min-height 220 / padding 14） */
.gha-hist-body { padding: 14px; overflow-y: auto; min-height: 220px; }

.gha-menu-empty { padding: 48px 14px; text-align: center; color: #4E5969; font-size: 12px; }
.gha-hitem { display: flex; align-items: center; gap: 4px; padding: 2px 8px; border-bottom: 1px solid #ebeef5; }
.gha-hitem:last-child { border-bottom: none; }
.gha-hitem.active { background: #f5f8ff; }
.gha-hopen { flex: 1; min-width: 0; text-align: left; background: none; border: none; cursor: pointer; padding: 8px 6px; }
.gha-htitle { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gha-htime { display: block; font-size: 11px; color: #4E5969; margin-top: 2px; }
.gha-hdel { border: none; background: none; color: #BA2A20; cursor: pointer; padding: 4px 6px; }

@media (max-width: 600px) {
  .gha-hist-panel { width: 100%; }
}

/* ===== Composer（Perplexity 同款，全模式统一）：圆角框，输入在上，底部一行=模型左+圆形发送右 ===== */
.gha-foot { border-top: none; padding: 10px 14px; background: #fff; }
.gha-foot-box {
  display: flex; flex-direction: column; gap: 6px;
  border: 1px solid var(--border-color-dark, #d3d3d3); border-radius: var(--border-radius-lg, 8px);
  padding: 8px 10px; background: #fff;
}
.gha-foot-box:focus-within { border-color: #1A4FBE; }
.gha-input {
  width: 100%; border: none; background: transparent;
  height: 44px; padding: 0; font-size: 14px; outline: none;
}
.gha-input:focus { border: none; }
/* 底部一行整体靠右：新对话/历史/模型设置 + 发送按钮成组 */
.gha-composer-bar { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.gha-composer-right { display: flex; align-items: center; gap: 4px; }
/* 发送按钮与左侧操作组稍留间距 */
.gha-composer-right .gha-send { margin-left: 6px; }
/* 圆形发送按钮（主题色；圆形按钮属规范允许的圆形例外） */
.gha-send {
  flex: none; width: 30px; height: 30px; padding: 0; border: none; border-radius: 50%;
  background: #1A4FBE; color: #fff; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background-color 0.15s ease;
}
.gha-send:hover { background: #163F99; }
.gha-send .iconfont { font-size: 15px; }
/* 停止态：沿用主题色（不用红色），靠白方块图标与发送态区分 */
.gha-send-stop { background: #1A4FBE; }
.gha-send-stop:hover { background: #163F99; }
.gha-send-sq { width: 9px; height: 9px; background: #fff; border-radius: 2px; display: inline-block; }

/* ============ 排行榜方案卡：预览卡（channel=ranking） ============ */
.gha-rank-card .gha-rank-meta {
  font-size: 12px;
  color: #86909C;
  margin: 2px 0 8px;
}
.gha-rank-list {
  border-top: 1px solid #F0F1F3;
}
.gha-rank-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid #F0F1F3;
  font-size: 13px;
}
.gha-rank-no {
  flex: 0 0 20px;
  text-align: center;
  color: #86909C;
  font-variant-numeric: tabular-nums;
}
.gha-rank-name {
  flex: 1;
  min-width: 0;
  color: #1D2129;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gha-rank-val {
  color: #1D2129;
  font-variant-numeric: tabular-nums;
}
.gha-rank-trend {
  flex: 0 0 auto;
  font-size: 12px;
  color: #86909C;
  min-width: 52px;
  text-align: right;
}
.gha-rank-trend.up { color: #0E9F6E; }
.gha-rank-trend.down { color: #E02424; }
.gha-rank-more {
  display: inline-block;
  margin-top: 8px;
  font-size: 13px;
  color: #165DFF;
  text-decoration: none;
}
.gha-rank-more:hover { text-decoration: underline; }
.gha-rank-tip {
  margin-top: 6px;
  font-size: 12px;
  color: #C9CDD4;
}

/* ==================== 门面：首页全屏接管（shell:'fullscreen'，复用同一对话内核）
   对标 ChatGPT/Perplexity：居中单列对话 + 底部 composer；遵 UI-UX 规范——
   圆角≤8、仅 opacity 过渡(禁 transform)、禁彩色阴影、图标走 iconfont、用 var(--font-ui)。 */
/* 门面打开时同时锁 html 与 body，杜绝底层首页残留的窗口滚动条（只保留门面自身的内容滚动条） */
html.gha-fs-open, body.gha-fs-open { overflow: hidden; }

.gha-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 1030;          /* 与 .gha-mask 同级：低于 Bootstrap 弹窗(1040/1050)，解锁支付弹窗仍可浮其上 */
  background: #fff;
  display: block;          /* 文档流：整体随页面滚动（ChatGPT/Perplexity 同款），非内部滚动框 */
  overflow: hidden auto;   /* 唯一滚动条=本层，贯穿全高、贴视口右缘=页面级滚动条 */
  color: #1f2329;
  font-family: var(--font-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
  font-size: 14px;
  animation: gha-fs-fade 0.18s ease;   /* 只用 opacity，禁 transform（规范四） */
}
@keyframes gha-fs-fade { from { opacity: 0; } to { opacity: 1; } }

/* 顶栏：sticky 顶部、无下划线；左=返回首页 · 中=4大工具入口 · 右=新对话/历史 */
.gha-fullscreen .gha-head {
  position: sticky; top: 0; z-index: 3; background: #fff;
  height: 52px; padding: 0 16px; border-bottom: none;
  display: flex; align-items: center;
}
/* 返回首页按钮（门面专属）：无填充、灰字、hover 主色微底 */
.gha-fullscreen .gha-close {
  height: 30px; padding: 0 10px; border: none; background: none;
  color: var(--text-muted, #666); font-size: 13px; border-radius: 4px; line-height: 30px;
  cursor: pointer;
}
.gha-fullscreen .gha-close:hover { color: #1A4FBE; background: #f0f4fb; }
/* 左：返回首页（图标 + 文字） */
.gha-fullscreen .gha-close { display: inline-flex; align-items: center; gap: 6px; padding: 0 10px; flex: none; }
.gha-fullscreen .gha-close .iconfont { font-size: 16px; }
/* 中：4 大工具入口（文字链接，hover 主色）。绝对居中于整条顶栏，不受左侧返回按钮宽度牵动（原靠右侧菜单配平，菜单已移除） */
.gha-fullscreen .gha-fs-nav {
  position: absolute; left: 50%; transform: translateX(-50%);
  display: flex; justify-content: center; align-items: center; gap: 4px;
}
.gha-fs-navi {
  padding: 6px 14px; font-size: 14px; color: var(--text-dark, #333);
  text-decoration: none; border-radius: 4px; line-height: 1;
  transition: color 0.15s ease, background-color 0.15s ease;
}
.gha-fs-navi:hover { color: #1A4FBE; background: #f0f4fb; }
/* 右：新对话 / 历史对话 */
.gha-fs-ops {
  display: none;
}
.gha-fullscreen .gha-fs-ops {
  display: flex; align-items: center; gap: 4px;
  margin-left: auto; flex: none; z-index: 1;
}

/* 主体：文档流，不再内部滚动；消息居中单列(768)、assistant 填满列宽 */
.gha-fullscreen .gha-body { display: block; }
.gha-fullscreen .gha-list {
  overflow: visible; background: #fff;
  padding: 28px max(20px, calc((100% - 768px) / 2)) 160px;  /* 底部给固定 composer 让位，最后消息不被遮（输入框加高后 composer≈136px，留足余量） */
}
.gha-fullscreen .gha-msg-assistant { width: 100%; max-width: 100%; }

/* composer：固定视口底部、悬浮在内容之上（满宽底栏=不透明，居中放圆角输入框） */
.gha-fullscreen .gha-foot {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 3;
  background: #fff; border-top: none;
  display: flex; justify-content: center;
  padding: 10px 20px 20px;
}
/* 门面 composer 更大气：沿用统一两行结构(.gha-foot-box)，仅放大尺寸 */
.gha-fullscreen .gha-foot-box {
  width: 100%; max-width: 768px;
  padding: 10px 12px;
}
.gha-fullscreen .gha-send { width: 34px; height: 34px; }
.gha-fullscreen .gha-send .iconfont { font-size: 16px; }

/* 空状态：焦点区（品牌 + composer + chips）整体垂直居中，再上移 180px
   （规范禁 transform，用底部 padding 抬升视觉中心：底 padding 360 ≈ 上移 180） */
.gha-fullscreen .gha-body.gha-empty {
  box-sizing: border-box;   /* 关键：360 底 padding 计入 min-height 内，不撑出额外高度/滚动条 */
  min-height: calc(100vh - 53px);
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  padding: 0 20px 300px;
}
.gha-fullscreen .gha-body.gha-empty .gha-list { display: none; }   /* 空态不显示空列表占位 */
.gha-fullscreen .gha-body.gha-empty .gha-hero { width: 100%; max-width: 768px; }
.gha-fullscreen .gha-body.gha-empty .gha-foot {
  position: static; background: none; padding: 0;
  width: 100%; max-width: 768px; margin: 0 auto;
}
/* 建议提示词：仅门面空状态显示，位于 composer「下方」（标准布局） */
.gha-fs-chips { display: none; }
.gha-fullscreen .gha-body.gha-empty .gha-fs-chips {
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: center;
  width: 100%; max-width: 768px; margin-top: 16px;
}

/* 门面 hero：品牌大标题 + 副标题（无装饰符，Perplexity 式克制） */
.gha-fs-hero { text-align: center; padding: 0 16px; }
.gha-fs-htitle { font-size: 30px; font-weight: 600; color: #1D2129; margin: 0 0 10px; }
.gha-fs-hsub { font-size: 14px; color: var(--text-muted, #666); margin: 0 0 22px; }
.gha-chip {
  border: none; background: #f4f5f9;
  border-radius: var(--border-radius-md, 4px);
  padding: 7px 14px; font-size: 13px; color: #4A5568; cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease;
}
.gha-chip:hover { color: #1A4FBE; background: #F0F4FB; }

@media (max-width: 800px) {
  .gha-fullscreen .gha-fs-nav { display: none; }   /* 窄屏隐藏中部工具导航，避免拥挤 */
  .gha-fullscreen .gha-close .gha-close-tx { display: none; }   /* 窄屏返回只留图标 */
  .gha-fullscreen .gha-list { padding: 20px 16px 150px; }   /* 底部留足空间,内容不被固定 composer 遮挡 */
  .gha-fullscreen .gha-foot { padding: 8px 16px 16px; }
  .gha-fullscreen .gha-foot-box { max-width: none; }
  .gha-fs-htitle { font-size: 22px; }
}

/* ==================== 通用选项卡（ask_choice，所有频道可用） ==================== */
.gha-choice-q { font-weight: 600; color: #1f2329; margin-bottom: 8px; line-height: 1.6; }
.gha-choice-opts { display: flex; flex-direction: column; gap: 6px; }
.gha-choice-opt {
  width: 100%; text-align: left; cursor: pointer;
  border: 1px solid #d6d9e0; border-radius: 4px; background: #fff;
  padding: 8px 12px; font-size: 13px; color: #1f2329;
  transition: all 0.15s ease;
}
.gha-choice-opt:hover:not(:disabled) { border-color: #1A4FBE; color: #1A4FBE; background: #f5f8ff; }
.gha-choice-opt:disabled { cursor: default; color: #86909C; background: #f7f8fa; }
.gha-choice-custom { display: flex; gap: 8px; margin-top: 8px; }
.gha-choice-input {
  flex: 1; height: 32px; box-sizing: border-box;
  border: 1px solid #C9CDD4; border-radius: 4px; padding: 0 10px;
  font-size: 13px; outline: none;
}
.gha-choice-input:focus { border-color: #1A4FBE; }
.gha-choice-tip { margin-top: 8px; font-size: 12px; color: #86909C; }

/* 搜索条件确认卡（channel=search）：结果走宿主左栏列表，卡内只做条件回显 + 是否符合 */
.gha-sq-cond { font-size: 13px; color: #1f2329; }
.gha-sq-cond b { font-weight: 600; }
.gha-sq-count { color: #86909C; }
.gha-sq-ask { margin: 6px 0 0; font-size: 12px; color: #86909C; }
/* 🔴 按钮行与上方内容的间距挂在**按钮行自己**身上，别再挂到 .gha-sq-ask 上：
   那句问句只有搜索页确认卡才有，首页导流卡没有它 → 按钮直接贴到条件文字上（已实测踩到）。 */
.gha-sq-acts { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.gha-sq-btn {
  padding: 5px 12px; font-size: 12px; line-height: 1.4;
  border: 1px solid #C9CDD4; border-radius: 4px;
  background: #fff; color: #1f2329; cursor: pointer;
}
.gha-sq-btn:hover { background: #F0F4FB; }
.gha-sq-ok { border-color: #1A4FBE; color: #1A4FBE; }
.gha-sq-tip { font-size: 12px; color: #86909C; }

/* ==================== 移动端底部抽屉外壳（GhAiAssistant.mountSheet，全站唯一一份） ====================
   无遮罩：上半屏宿主主屏（搜索结果 / 图表 / 地图 / 分析结果 / 对比结果）保持可看可滚，
   AI 一有产出就在原地看见，不再「说一句 → 整屏切回去看 → 再切回来说」。
   两档高度：问答阶段 full（确认卡/方法卡好点），宿主产出后 JS 自动切 half 露出结果。 */
.gha-sheet {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 1030;               /* 高于页内 sticky / 底部操作栏，低于站点支付弹窗(1040/1050) */
    background: #fff;
    border-top: 1px solid #e2e6ee;
    border-radius: 4px 4px 0 0;  /* 圆角 ≤4px（UI 规范硬约束） */
    /* 无遮罩抽屉唯一的前后景分界就是阴影：近缘实 + 远缘散，与背后主屏明显区分 */
    box-shadow: 0 -1px 4px rgba(31, 35, 41, .10), 0 -8px 28px rgba(31, 35, 41, .22);
    padding-bottom: env(safe-area-inset-bottom);
    display: flex;
    flex-direction: column;
    transition: height .22s ease;
}
/* 动态视口 dvh：地址栏收放不跳（不支持 dvh 的浏览器落回上一行的 vh） */
.gha-sheet-full { height: 88vh; height: 88dvh; }
.gha-sheet-half { height: 60vh; height: 60dvh; }
.gha-sheet-dock { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.gha-sheet .gha-title { display: none; }   /* dock 自带标题占空间，抽屉形态隐去 */

/* 右上角收起：浮在把手行右端，不占布局（把手仍居中）；灰色图标按钮，克制不抢视觉 */
.gha-sheet-close {
    position: absolute;
    top: 4px; right: 6px;
    z-index: 2;
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    background: transparent;
    border: none;
    color: #86909c;
    cursor: pointer;
}
.gha-sheet-close .iconfont { font-size: 15px; }
.gha-sheet-close:active { color: #4e5969; }
