/* ===== BlueSeek 首页右侧科研小工具栏 + 内嵌对话 ===== */

/* 三列布局：左导航(224) | 主区 | 右工具栏（折叠 72px / 展开 224px，与左侧导航展开宽度一致）。
   选择器需要覆盖 styles.css 里带 :not() 的 224px 两列规则，故保持同等/更高优先级。 */
.dashboard-page-xiaolan-agent .xiaolan-gpt-layout:not(.is-sidebar-collapsed):not(.is-artifact-open) {
  grid-template-columns: 224px minmax(0, 1fr) 72px;
}

.dashboard-page-xiaolan-agent .xiaolan-gpt-layout.is-sidebar-collapsed:not(.is-artifact-open) {
  grid-template-columns: 72px minmax(0, 1fr) 72px;
}

.dashboard-page-xiaolan-agent .xiaolan-gpt-layout.is-right-expanded:not(.is-sidebar-collapsed):not(.is-artifact-open) {
  grid-template-columns: 224px minmax(0, 1fr) 224px;
}

.dashboard-page-xiaolan-agent .xiaolan-gpt-layout.is-sidebar-collapsed.is-right-expanded:not(.is-artifact-open) {
  grid-template-columns: 72px minmax(0, 1fr) 224px;
}

.xiaolan-toolrail {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  min-width: 0;
  min-height: 0;
  height: 100%;
  padding: 14px 10px 12px;
  /* 只展示小工具列表：不再有整列白色底板与分隔线，列表下方留空即页面背景 */
  background: transparent;
  box-sizing: border-box;
  overflow: hidden;
}

.xiaolan-toolrail-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.xiaolan-toolrail-toggle {
  display: grid;
  place-items: center;
  flex: none;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid #e7edf4;
  border-radius: 11px;
  background: #ffffff;
  color: #4b6a8c;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}

.xiaolan-toolrail-toggle:hover {
  border-color: rgba(47, 158, 26, .3);
  background: #f4faf1;
  color: #237a12;
}

.xiaolan-toolrail-toggle svg {
  width: 19px;
  height: 19px;
  transition: transform .18s ease;
}

.xiaolan-gpt-layout.is-right-expanded .xiaolan-toolrail-toggle svg {
  transform: scaleX(-1);
}

.xiaolan-toolrail-title {
  color: #15355b;
  font-size: .92rem;
  font-weight: 700;
  white-space: nowrap;
}

.xiaolan-toolrail-body {
  display: grid;
  /* 工具面板已不再展示，列表占满整列高度（内容不足时自然留白为页面背景） */
  grid-template-rows: minmax(0, 1fr);
  gap: 10px;
  min-height: 0;
  overflow: hidden;
}

.xiaolan-toolrail-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  overflow: auto;
  padding-right: 2px;
}

.xiaolan-toolrail-group-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2px;
}

.xiaolan-toolrail-group h4 {
  margin: 0 0 5px;
  padding: 0 4px;
  color: #7d92aa;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .08em;
}

.xiaolan-toolrail-tool {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 9px;
  width: 100%;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #35506f;
  font-size: .78rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: left;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}

.xiaolan-toolrail-tool svg {
  width: 16px;
  height: 16px;
  flex: none;
}

.xiaolan-toolrail-tool:hover {
  background: #f4f9ff;
  border-color: transparent;
  color: #1d4f91;
}

.xiaolan-toolrail-tool.is-active {
  background: #eef8ea;
  border-color: transparent;
  color: #1c6310;
}

.xiaolan-toolrail-panel {
  min-height: 0;
  overflow: auto;
  padding: 10px 2px 12px;
  border-top: 1px solid #eef2f7;
  overscroll-behavior: contain;
}

.xiaolan-toolrail-body.is-panel-empty {
  grid-template-rows: minmax(0, 1fr) 0;
  gap: 0;
}

/* 未打开工具面板时：15 个功能均分整栏高度，最后一项底部贴住侧边栏底部 */
.xiaolan-toolrail-body.is-panel-empty .xiaolan-toolrail-grid {
  display: flex;
  flex-direction: column;
  height: 100%;
  gap: 0;
  overflow: hidden;
}

.xiaolan-toolrail-body.is-panel-empty .xiaolan-toolrail-group {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-height: 0;
}

.xiaolan-toolrail-body.is-panel-empty .xiaolan-toolrail-group h4 {
  flex: none;
}

.xiaolan-toolrail-body.is-panel-empty .xiaolan-toolrail-group-grid {
  flex: 1 1 0;
  min-height: 0;
  grid-auto-rows: minmax(0, 1fr);
}

.xiaolan-toolrail-body.is-panel-empty .xiaolan-toolrail-tool {
  min-height: 0;
  height: auto;
}

.xiaolan-toolrail-body.is-panel-empty .xiaolan-toolrail-panel {
  display: none;
}

.xiaolan-toolrail-empty {
  margin: 0;
  padding: 10px 6px;
  color: #8aa0b7;
  font-size: .78rem;
  line-height: 1.6;
  text-align: center;
}

/* 折叠态：只留图标 */
.dashboard-page-xiaolan-agent .xiaolan-gpt-layout:not(.is-right-expanded) .xiaolan-toolrail-title,
.dashboard-page-xiaolan-agent .xiaolan-gpt-layout:not(.is-right-expanded) .xiaolan-toolrail-group h4,
.dashboard-page-xiaolan-agent .xiaolan-gpt-layout:not(.is-right-expanded) .xiaolan-toolrail-tool span,
.dashboard-page-xiaolan-agent .xiaolan-gpt-layout:not(.is-right-expanded) .xiaolan-toolrail-panel {
  display: none;
}

.dashboard-page-xiaolan-agent .xiaolan-gpt-layout:not(.is-right-expanded) .xiaolan-toolrail {
  padding: 14px 8px 12px;
}

.dashboard-page-xiaolan-agent .xiaolan-gpt-layout:not(.is-right-expanded) .xiaolan-toolrail-head {
  flex-direction: column;
  align-items: center;
}

.dashboard-page-xiaolan-agent .xiaolan-gpt-layout:not(.is-right-expanded) .xiaolan-toolrail-body {
  display: block;
  overflow: auto;
}

.dashboard-page-xiaolan-agent .xiaolan-gpt-layout:not(.is-right-expanded) .xiaolan-toolrail-group {
  margin-bottom: 8px;
}

.dashboard-page-xiaolan-agent .xiaolan-gpt-layout:not(.is-right-expanded) .xiaolan-toolrail-tool {
  justify-content: center;
  min-height: 40px;
  padding: 6px;
}

/* ===== 看板内容（检索 / 下载） ===== */
.xlt-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.xlt-panel-head h3 {
  margin: 0;
  color: #15355b;
  font-size: .92rem;
  font-weight: 700;
}

.xlt-panel-head p {
  margin: 4px 0 0;
  color: #7d92aa;
  font-size: .72rem;
  line-height: 1.5;
}

.xlt-form {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.xlt-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.xlt-field {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.xlt-field > span {
  color: #52698a;
  font-size: .7rem;
  font-weight: 600;
}

.xlt-field input,
.xlt-field select,
.xlt-field textarea {
  width: 100%;
  box-sizing: border-box;
  min-height: 34px;
  padding: 6px 9px;
  border: 1px solid #dfe7f1;
  border-radius: 9px;
  background: #fff;
  color: #15355b;
  font-size: .78rem;
  font-family: inherit;
}

.xlt-field textarea {
  min-height: 72px;
  resize: vertical;
  line-height: 1.55;
}

.xlt-field input:focus,
.xlt-field select:focus,
.xlt-field textarea:focus {
  outline: none;
  border-color: #7fb3ea;
  box-shadow: 0 0 0 3px rgba(39, 116, 208, .1);
}

.xlt-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 9px;
  background: #1d4f91;
  color: #fff;
  font-size: .8rem;
  font-weight: 700;
  cursor: pointer;
}

.xlt-submit:hover { background: #17427a; }
.xlt-submit:disabled { opacity: .55; cursor: default; }

.xlt-hint {
  margin: 0;
  color: #8aa0b7;
  font-size: .7rem;
  line-height: 1.5;
}

.xlt-status {
  margin: 0 0 10px;
  padding: 7px 9px;
  border-radius: 8px;
  background: #f3f7fd;
  color: #35506f;
  font-size: .72rem;
  line-height: 1.5;
}

.xlt-status.is-error { background: #fdf3f2; color: #b42318; }
.xlt-status.is-success { background: #f2fbf0; color: #237a12; }

.xlt-summary {
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid #e3edf9;
  border-radius: 12px;
  background: linear-gradient(180deg, #f7fbff, #ffffff);
}

.xlt-summary h4 {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 6px;
  color: #1d4f91;
  font-size: .78rem;
  font-weight: 700;
}

.xlt-summary h4::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #2f9e1a;
}

.xlt-summary-body {
  color: #35506f;
  font-size: .74rem;
  line-height: 1.65;
  white-space: pre-wrap;
}

.xlt-summary-body.is-loading { color: #8aa0b7; }

.xlt-results {
  display: grid;
  gap: 10px;
}

.xlt-card {
  display: grid;
  gap: 6px;
  padding: 11px 12px;
  border: 1px solid #e7edf4;
  border-radius: 12px;
  background: #fff;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.xlt-card:hover {
  border-color: #cfe0f3;
  box-shadow: 0 10px 22px rgba(19, 51, 90, .07);
}

.xlt-card-title {
  margin: 0;
  color: #144f96;
  font-size: .8rem;
  font-weight: 700;
  line-height: 1.45;
}

.xlt-card-title a { color: inherit; text-decoration: none; }
.xlt-card-title a:hover { text-decoration: underline; }

.xlt-card-meta {
  margin: 0;
  color: #7d92aa;
  font-size: .7rem;
  line-height: 1.5;
}

.xlt-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.xlt-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 999px;
  background: #eef6ff;
  color: #1d5aa6;
  font-size: .66rem;
  font-weight: 700;
  line-height: 1.7;
}

.xlt-badge.is-if { background: #eaf7e6; color: #237a12; }
.xlt-badge.is-quartile { background: #fff4e5; color: #a15c00; }

.xlt-abstract {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
  color: #52698a;
  font-size: .71rem;
  line-height: 1.6;
}

.xlt-abstract.is-open {
  display: block;
  -webkit-line-clamp: unset;
}

.xlt-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.xlt-btn {
  min-height: 27px;
  padding: 0 10px;
  border: 1px solid #dfe7f1;
  border-radius: 7px;
  background: #fff;
  color: #35506f;
  font-size: .7rem;
  font-weight: 600;
  cursor: pointer;
}

.xlt-btn:hover { border-color: #a9c8ea; color: #1d4f91; background: #f6faff; }
.xlt-btn.is-primary { border-color: #1d4f91; background: #1d4f91; color: #fff; }
.xlt-btn.is-primary:hover { background: #17427a; color: #fff; }
.xlt-btn:disabled { opacity: .5; cursor: default; }

.xlt-empty {
  padding: 16px 8px;
  color: #8aa0b7;
  font-size: .76rem;
  line-height: 1.6;
  text-align: center;
}

.xlt-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 4px;
  color: #52698a;
  font-size: .74rem;
}

.xlt-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid #dbe8f7;
  border-top-color: #1d4f91;
  border-radius: 50%;
  animation: xlt-spin .8s linear infinite;
}

@keyframes xlt-spin { to { transform: rotate(360deg); } }

.xlt-download-card {
  display: grid;
  gap: 5px;
  padding: 11px 12px;
  border: 1px solid #d9ebd3;
  border-radius: 12px;
  background: linear-gradient(180deg, #f7fdf5, #ffffff);
}

.xlt-download-card.is-failed {
  border-color: #f3d9d6;
  background: linear-gradient(180deg, #fdf7f6, #ffffff);
}

.xlt-download-file {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #237a12;
  font-size: .74rem;
  font-weight: 700;
  word-break: break-all;
}

.xlt-download-card.is-failed .xlt-download-file { color: #b42318; }

.xlt-kv {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  gap: 3px 8px;
  margin: 0;
  color: #52698a;
  font-size: .71rem;
  line-height: 1.55;
}

.xlt-kv dt { color: #8aa0b7; }
.xlt-kv dd { margin: 0; color: #35506f; word-break: break-word; }

/* ===== 首页内嵌对话 ===== */
.xiaolan-landing-main.is-chatting {
  display: block;
  padding: 0;
  overflow: hidden;
}

.xiaolan-landing-main.is-chatting .xiaolan-landing {
  display: none;
}

.xiaolan-embed-chat {
  display: none;
  height: 100%;
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
}

.xiaolan-embed-chat[hidden] {
  display: none;
}

.xiaolan-landing-main.is-chatting .xiaolan-embed-chat {
  display: grid;
}

.xiaolan-embed-chat-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 18px;
  border-bottom: 1px solid #eef2f7;
  background: rgba(255, 255, 255, .92);
}

.xiaolan-embed-chat-head strong {
  max-width: 60%;
  overflow: hidden;
  color: #15355b;
  font-size: .86rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.xiaolan-embed-back {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  min-height: 28px;
  padding: 0 8px 0 4px;
  border: 1px solid #e7edf4;
  border-radius: 8px;
  background: #fff;
  color: #4b6a8c;
  font-size: .74rem;
  cursor: pointer;
}

.xiaolan-embed-back:hover { border-color: #b6d3f2; color: #1d4f91; background: #f6faff; }
.xiaolan-embed-back svg { width: 15px; height: 15px; }

.xiaolan-embed-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #c7d6e7;
}

.xiaolan-embed-model {
  color: #8aa0b7;
  font-size: .72rem;
}

.xiaolan-landing-main.is-chatting .xiaolan-gpt-thread {
  min-height: 0;
}

.xiaolan-landing-main.is-chatting .xiaolan-gpt-composer {
  background: rgba(255, 255, 255, .96);
}

.xiaolan-landing-main.is-chatting .xiaolan-gpt-composer-card textarea {
  min-height: 58px;
  resize: none;
}

/* ===== 窄屏：工具栏浮在右侧，主区留出图标宽度 ===== */
@media (max-width: 1100px) {
  .dashboard-page-xiaolan-agent .xiaolan-gpt-layout:not(.is-sidebar-collapsed):not(.is-artifact-open),
  .dashboard-page-xiaolan-agent .xiaolan-gpt-layout.is-sidebar-collapsed:not(.is-artifact-open),
  .dashboard-page-xiaolan-agent .xiaolan-gpt-layout.is-right-expanded:not(.is-sidebar-collapsed):not(.is-artifact-open),
  .dashboard-page-xiaolan-agent .xiaolan-gpt-layout.is-sidebar-collapsed.is-right-expanded:not(.is-artifact-open) {
    grid-template-columns: 140px minmax(0, 1fr);
  }

  .xiaolan-toolrail {
    position: fixed;
    top: 64px;
    right: 0;
    bottom: auto;
    height: calc(100vh - 64px);
    max-height: calc(100vh - 64px);
    width: 60px;
    z-index: 50;
    border-radius: 14px 0 0 14px;
    box-shadow: -10px 0 26px rgba(19, 51, 90, .14);
  }

  .xiaolan-gpt-layout.is-right-expanded .xiaolan-toolrail {
    width: min(90vw, 224px);
  }

  .xiaolan-landing-main {
    padding-right: 74px;
  }

  .xiaolan-landing-main.is-chatting {
    padding-right: 60px;
  }
}

@media (max-width: 900px) {
  .dashboard-page-xiaolan-agent .xiaolan-gpt-layout:not(.is-sidebar-collapsed):not(.is-artifact-open),
  .dashboard-page-xiaolan-agent .xiaolan-gpt-layout.is-sidebar-collapsed:not(.is-artifact-open),
  .dashboard-page-xiaolan-agent .xiaolan-gpt-layout.is-right-expanded:not(.is-sidebar-collapsed):not(.is-artifact-open),
  .dashboard-page-xiaolan-agent .xiaolan-gpt-layout.is-sidebar-collapsed.is-right-expanded:not(.is-artifact-open) {
    grid-template-columns: minmax(0, 1fr);
  }

  .xiaolan-toolrail { top: 56px; height: calc(100vh - 56px); max-height: calc(100vh - 56px); }
}

/* ===== 文献检索消息：结果卡片 + 可点击原文链接 ===== */
.xiaolan-gpt-message.is-lit-search .xiaolan-gpt-markdown-heading {
  margin: 2px 0 10px;
  color: #15355b;
}

.xiaolan-gpt-message.is-lit-search ol.xiaolan-gpt-markdown-list {
  display: grid;
  gap: 8px;
  margin: 4px 0 0;
  padding-left: 0;
  list-style: none;
  counter-reset: litcard;
}

.xiaolan-gpt-message.is-lit-search ol.xiaolan-gpt-markdown-list li {
  position: relative;
  padding: 10px 12px 10px 40px;
  border: 1px solid #e7edf4;
  border-radius: 10px;
  background: #fbfdff;
  color: #52698a;
  font-size: .84rem;
  line-height: 1.6;
}

.xiaolan-gpt-message.is-lit-search ol.xiaolan-gpt-markdown-list li::before {
  counter-increment: litcard;
  content: counter(litcard);
  position: absolute;
  left: 10px;
  top: 11px;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #eef5fd;
  color: #1d4f91;
  font-size: .68rem;
  font-weight: 700;
}

.xiaolan-gpt-message.is-lit-search ol.xiaolan-gpt-markdown-list a {
  color: #1d4f91;
  font-weight: 650;
  text-decoration: none;
}

.xiaolan-gpt-message.is-lit-search ol.xiaolan-gpt-markdown-list a:hover {
  color: #0b3c7a;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ===== 文献阅读面板 ===== */
.xlt-examples {
  display: grid;
  gap: 4px;
  margin-bottom: 10px;
}

.xlt-example {
  padding: 7px 9px;
  border: 1px solid #e7edf4;
  border-radius: 8px;
  background: #fbfdff;
  color: #35506f;
  font-size: .73rem;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
}

.xlt-example:hover {
  border-color: #b6d3f2;
  color: #1d4f91;
  background: #f4f9ff;
}

.xlt-example.is-active {
  border-color: rgba(47, 158, 26, .4);
  background: #eef8ea;
  color: #1c6310;
  font-weight: 600;
}

.xlt-read-file {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.xlt-read-file-name {
  color: #8aa0b7;
  font-size: .68rem;
  line-height: 1.4;
  word-break: break-all;
}

/* 文献阅读结果：比普通对话更紧凑，接近报告式阅读 */
.xiaolan-gpt-message.is-lit-read .xiaolan-gpt-bubble > p,
.xiaolan-gpt-message.is-lit-read .xiaolan-gpt-bubble p,
.xiaolan-gpt-message.is-topic .xiaolan-gpt-bubble > p,
.xiaolan-gpt-message.is-topic .xiaolan-gpt-bubble p {
  line-height: 1.9;
  margin: 8px 0;
}

.xiaolan-gpt-message.is-lit-read .xiaolan-gpt-bubble li,
.xiaolan-gpt-message.is-topic .xiaolan-gpt-bubble li {
  line-height: 1.75;
}

.xiaolan-gpt-message.is-lit-read .xiaolan-gpt-bubble h3,
.xiaolan-gpt-message.is-lit-read .xiaolan-gpt-bubble h4,
.xiaolan-gpt-message.is-topic .xiaolan-gpt-bubble h3,
.xiaolan-gpt-message.is-topic .xiaolan-gpt-bubble h4 {
  margin: 18px 0 8px;
}

.xiaolan-gpt-message.is-lit-read .xiaolan-gpt-markdown-table,
.xiaolan-gpt-message.is-topic .xiaolan-gpt-markdown-table {
  font-size: .82rem;
}

/* 检索结果「加载更多」 */
.xlt-more {
  display: flex;
  justify-content: center;
  padding: 4px 0 2px;
}
.xlt-more-btn {
  min-width: 200px;
  padding: 8px 18px;
  border: 1px solid rgba(39, 116, 208, 0.28);
  border-radius: 999px;
  background: #f5f9ff;
  color: #1b5fb0;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.xlt-more-btn:hover:not(:disabled) {
  background: #e8f2ff;
  border-color: rgba(39, 116, 208, 0.45);
}
.xlt-more-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

/* 笔记整理 / 知识网络：报告式排版 + 树形代码块 */
.xiaolan-gpt-message.is-notes .xiaolan-gpt-bubble p {
  line-height: 1.9;
  margin: 8px 0;
}

.xiaolan-gpt-message.is-notes .xiaolan-gpt-bubble li {
  line-height: 1.75;
}

.xiaolan-gpt-message.is-notes .xiaolan-gpt-bubble h3,
.xiaolan-gpt-message.is-notes .xiaolan-gpt-bubble h4 {
  margin: 18px 0 8px;
}

.xiaolan-gpt-message.is-notes .xiaolan-gpt-bubble pre {
  margin: 10px 0;
  padding: 12px 14px;
  border: 1px solid #e6edf5;
  border-radius: 10px;
  background: #f7fafd;
  overflow: auto;
  font-size: .78rem;
  line-height: 1.65;
}

.xiaolan-gpt-message.is-notes .xiaolan-gpt-bubble code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

/* 出提纲：报告式排版 */
.xiaolan-gpt-message.is-outline .xiaolan-gpt-bubble p {
  line-height: 1.9;
  margin: 8px 0;
}

.xiaolan-gpt-message.is-outline .xiaolan-gpt-bubble li {
  line-height: 1.75;
}

.xiaolan-gpt-message.is-outline .xiaolan-gpt-bubble h3,
.xiaolan-gpt-message.is-outline .xiaolan-gpt-bubble h4 {
  margin: 18px 0 8px;
}

/* 润色：报告式排版 + 修改前/后彩色代码块 */
.xiaolan-gpt-message.is-polish .xiaolan-gpt-bubble p {
  line-height: 1.9;
  margin: 8px 0;
}

.xiaolan-gpt-message.is-polish .xiaolan-gpt-bubble li {
  line-height: 1.75;
}

.xiaolan-gpt-message.is-polish .xiaolan-gpt-bubble h3,
.xiaolan-gpt-message.is-polish .xiaolan-gpt-bubble h4 {
  margin: 18px 0 8px;
}

.xiaolan-gpt-message.is-polish .xiaolan-gpt-bubble pre {
  margin: 10px 0;
  padding: 12px 14px;
  border: 1px solid #e6edf5;
  border-left-width: 4px;
  border-radius: 10px;
  overflow: auto;
  font-size: .8rem;
  line-height: 1.7;
}

.xiaolan-gpt-message.is-polish .xiaolan-gpt-bubble pre:has(code.language-diff-before) {
  background: #fff1f0;
  border-color: #ffccc7;
  border-left-color: #ff4d4f;
}

.xiaolan-gpt-message.is-polish .xiaolan-gpt-bubble code.language-diff-before {
  color: #a8071a;
}

.xiaolan-gpt-message.is-polish .xiaolan-gpt-bubble pre:has(code.language-diff-after) {
  background: #f6ffed;
  border-color: #b7eb8f;
  border-left-color: #52c41a;
}

.xiaolan-gpt-message.is-polish .xiaolan-gpt-bubble code.language-diff-after {
  color: #237804;
}

/* 翻译：学术译文 + 术语对照表 */
.xiaolan-gpt-message.is-translate .xiaolan-gpt-bubble p {
  line-height: 1.9;
  margin: 8px 0;
}

.xiaolan-gpt-message.is-translate .xiaolan-gpt-bubble li {
  line-height: 1.75;
}

.xiaolan-gpt-message.is-translate .xiaolan-gpt-bubble h3,
.xiaolan-gpt-message.is-translate .xiaolan-gpt-bubble h4 {
  margin: 18px 0 8px;
}

.xiaolan-gpt-message.is-translate .xiaolan-gpt-markdown-table {
  font-size: .82rem;
}

/* 调研报告 / 重点数据 */
.xl-data-highlight {
  padding: 0 2px;
  border-radius: 3px;
  background: #fff3e0;
  color: #c2410c;
  font-weight: 700;
}

/* 调研报告：正文、图表与文件链接 */
.xiaolan-gpt-message.is-report .xiaolan-gpt-bubble p {
  line-height: 1.9;
  margin: 8px 0;
}

.xiaolan-gpt-message.is-report .xiaolan-gpt-bubble li {
  line-height: 1.8;
}

.xiaolan-gpt-message.is-report .xiaolan-gpt-bubble h2,
.xiaolan-gpt-message.is-report .xiaolan-gpt-bubble h3,
.xiaolan-gpt-message.is-report .xiaolan-gpt-bubble h4 {
  margin: 20px 0 8px;
}

.xiaolan-gpt-message.is-report .xiaolan-gpt-bubble img {
  display: block;
  max-width: 100%;
  margin: 12px auto;
  border: 1px solid #e6edf5;
  border-radius: 10px;
  background: #fff;
}

.xiaolan-gpt-message.is-report .xiaolan-gpt-markdown-table {
  font-size: .82rem;
}

/* 脑图梳理 */
.xiaolan-gpt-message.is-mindmap .xiaolan-gpt-bubble p {
  line-height: 1.9;
  margin: 8px 0;
}

.xiaolan-gpt-message.is-mindmap .xiaolan-gpt-bubble img {
  display: block;
  max-width: 100%;
  margin: 12px auto;
  border: 1px solid #e6edf5;
  border-radius: 10px;
  background: #fff;
}

.xiaolan-gpt-message.is-mindmap .xiaolan-gpt-bubble h2,
.xiaolan-gpt-message.is-mindmap .xiaolan-gpt-bubble h3 {
  margin: 20px 0 8px;
}

/* 研究设计 */
.xiaolan-gpt-message.is-design .xiaolan-gpt-bubble p {
  line-height: 1.9;
  margin: 8px 0;
}

.xiaolan-gpt-message.is-design .xiaolan-gpt-bubble li {
  line-height: 1.8;
}

.xiaolan-gpt-message.is-design .xiaolan-gpt-bubble h3,
.xiaolan-gpt-message.is-design .xiaolan-gpt-bubble h4 {
  margin: 18px 0 8px;
}

/* 对话/文档里的可点击链接统一使用超链接蓝色，与正文区分 */
.xiaolan-gpt-message .xiaolan-gpt-bubble a,
.xiaolan-gpt-message .xiaolan-gpt-bubble a:visited,
.xiaolan-doc-body a,
.xiaolan-doc-body a:visited {
  color: #1d4f91;
  font-weight: 600;
  text-decoration: none;
}

.xiaolan-gpt-message .xiaolan-gpt-bubble a:hover,
.xiaolan-doc-body a:hover {
  color: #1d67b2;
  text-decoration: underline;
}

/* 调研问卷 */
.xiaolan-gpt-message.is-survey .xiaolan-gpt-bubble p {
  line-height: 1.9;
  margin: 8px 0;
}

.xiaolan-gpt-message.is-survey .xiaolan-gpt-bubble li {
  line-height: 1.8;
}

.xiaolan-gpt-message.is-survey .xiaolan-gpt-bubble h3,
.xiaolan-gpt-message.is-survey .xiaolan-gpt-bubble h4 {
  margin: 18px 0 8px;
}

.xiaolan-gpt-message.is-survey .xiaolan-gpt-markdown-table {
  font-size: .8rem;
}

/* 最终覆盖：对话内所有可点击链接统一为超链接蓝（避免被全局 a{color:inherit} 覆盖） */
.dashboard-page-xiaolan-agent .xiaolan-gpt-message .xiaolan-gpt-bubble a[href],
.dashboard-page-xiaolan-agent .xiaolan-gpt-message .xiaolan-gpt-bubble a[href]:visited,
.dashboard-page-xiaolan-agent .xiaolan-doc-body a[href],
.dashboard-page-xiaolan-agent .xiaolan-doc-body a[href]:visited {
  color: #1d4f91 !important;
  font-weight: 600 !important;
  text-decoration: none !important;
}

.dashboard-page-xiaolan-agent .xiaolan-gpt-message .xiaolan-gpt-bubble a[href]:hover,
.dashboard-page-xiaolan-agent .xiaolan-doc-body a[href]:hover {
  color: #1d67b2 !important;
  text-decoration: underline !important;
}

/* 对话输入区：保留左下角上传按钮（回形针，打开“引用知识库 / 上传文件”菜单），
   只隐藏旧的“未选择图片 / 移除”提示（已由附件卡片列表取代） */
.dashboard-page-xiaolan-agent .xiaolan-gpt-toolbar #xiaolanChatImageName,
.dashboard-page-xiaolan-agent .xiaolan-gpt-toolbar #xiaolanChatClearImage {
  display: none !important;
}

.dashboard-page-xiaolan-agent .xiaolan-gpt-toolbar .xiaolan-gpt-upload.xiaolan-unified-upload {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  min-height: 38px;
  padding: 0;
  border-radius: 12px;
  color: #35506f;
}

.dashboard-page-xiaolan-agent .xiaolan-gpt-toolbar .xiaolan-gpt-upload.xiaolan-unified-upload > span:not(.xiaolan-upload-icon) {
  display: none;
}

/* ===== 首页小功能入口改为链接：跳转到各功能独立对话页 ===== */
.dashboard-page-xiaolan-agent a.xiaolan-landing-start-item {
  color: #415d7d;
  text-decoration: none;
}

.dashboard-page-xiaolan-agent a.xiaolan-landing-start-item:hover,
.dashboard-page-xiaolan-agent a.xiaolan-landing-start-item:focus-visible {
  color: #1d4f91;
  text-decoration: none;
}

/* ===== 内嵌对话铺满主区（首页 / 小功能页）：不再按内容收缩成窄列 ===== */
.dashboard-page-xiaolan-agent .xiaolan-landing-main.is-chatting .xiaolan-embed-chat,
.dashboard-page-xiaolan-agent .xiaolan-landing-main.is-chatting .xiaolan-gpt-thread {
  width: 100%;
}

/* 对话列不再固定 920px 居中，用户/助手消息都铺满可用宽度 */
.dashboard-page-xiaolan-agent .xiaolan-landing-main.is-chatting .xiaolan-gpt-message,
.dashboard-page-xiaolan-agent .xiaolan-landing-main.is-chatting .xiaolan-gpt-message.is-user,
.dashboard-page-xiaolan-agent .xiaolan-landing-main.is-chatting .xiaolan-gpt-message.is-assistant {
  width: 100%;
  max-width: none;
  margin-left: 0;
  margin-right: 0;
  justify-self: stretch;
}

.dashboard-page-xiaolan-agent .xiaolan-landing-main.is-chatting .xiaolan-gpt-message.is-assistant .xiaolan-gpt-message-card {
  width: 100%;
  max-width: 100%;
}

/* ===== 内嵌对话不显示开场问候（首页 / 小功能页）：主视觉与功能气泡已说明身份 ===== */
.dashboard-page-xiaolan-agent .xiaolan-landing-main.is-chatting .xiaolan-gpt-message.is-greeting {
  display: none !important;
}


/* ===== 首页 / 小功能页对话：气泡下方显示时间，操作按钮靠右下 ===== */
.dashboard-page-xiaolan-agent .xiaolan-landing-main.is-chatting .xiaolan-gpt-message-card,
.dashboard-page-xiaolan-agent .xiaolan-landing-main.is-chatting .xiaolan-gpt-message.is-assistant .xiaolan-gpt-message-card {
  padding-bottom: 0;
}

.dashboard-page-xiaolan-agent .xiaolan-landing-main.is-chatting .xiaolan-gpt-message-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-top: 3px;
  min-height: 24px;
}

.dashboard-page-xiaolan-agent .xiaolan-landing-main.is-chatting .xiaolan-gpt-message.is-assistant .xiaolan-gpt-message-foot {
  justify-content: space-between;
}

.dashboard-page-xiaolan-agent .xiaolan-landing-main.is-chatting .xiaolan-gpt-message.is-user .xiaolan-gpt-message-foot {
  justify-content: flex-end;
}

.dashboard-page-xiaolan-agent .xiaolan-landing-main.is-chatting .xiaolan-gpt-time {
  color: rgba(21, 53, 91, 0.45);
  font-size: 0.7rem;
  line-height: 1.2;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.dashboard-page-xiaolan-agent .xiaolan-landing-main.is-chatting .xiaolan-gpt-message-actions {
  position: static;
  left: auto;
  right: auto;
  bottom: auto;
  margin-left: auto;
  justify-content: flex-end;
  width: auto;
}

/* 用户发送的气泡：行距收紧（原来全局 2.94 倍行距太空） */
.dashboard-page-xiaolan-agent .xiaolan-landing-main.is-chatting .xiaolan-gpt-message.is-user .xiaolan-gpt-bubble p,
.dashboard-page-xiaolan-agent .xiaolan-landing-main.is-chatting .xiaolan-gpt-message.is-user .xiaolan-gpt-bubble > p {
  line-height: 1.55;
}
