/* ===== 对话消息底部：时间 + 操作按钮（首页/小功能页、生信绘图、文献综述） =====
   由页面 JS 在受支持的对话页给 body 加上 xiaolan-message-foot 类后生效。 */

body.xiaolan-message-foot .xiaolan-gpt-message-card {
  padding-bottom: 0;
}

body.xiaolan-message-foot .xiaolan-gpt-message-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-top: 3px;
  min-height: 24px;
}

body.xiaolan-message-foot .xiaolan-gpt-message.is-assistant .xiaolan-gpt-message-foot {
  justify-content: space-between;
}

body.xiaolan-message-foot .xiaolan-gpt-message.is-user .xiaolan-gpt-message-foot {
  justify-content: flex-end;
}

body.xiaolan-message-foot .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;
}

body.xiaolan-message-foot .xiaolan-gpt-message-actions {
  position: static;
  left: auto;
  right: auto;
  bottom: auto;
  margin-left: auto;
  justify-content: flex-end;
  width: auto;
}

body.xiaolan-message-foot .xlr-msg-actions {
  margin-top: 0;
  margin-left: auto;
}

body.xiaolan-message-foot .xiaolan-gpt-message.is-user .xiaolan-gpt-bubble p,
body.xiaolan-message-foot .xiaolan-gpt-message.is-user .xiaolan-gpt-bubble > p {
  line-height: 1.55;
}

/* ===== 小功能对话进度（阶段清单） ===== */
.xiaolan-progress-card {
  margin: 0 0 8px;
  padding: 10px 12px;
  border: 1px solid #e3ebf5;
  border-radius: 12px;
  background: #f8fbff;
}

details.xiaolan-progress-card {
  cursor: default;
}

.xiaolan-progress-card summary {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
  cursor: pointer;
}

.xiaolan-progress-card summary::-webkit-details-marker {
  display: none;
}

.xiaolan-progress-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.xiaolan-progress-head strong,
.xiaolan-progress-card summary strong {
  color: #1f3d5c;
  font-size: 0.82rem;
  font-weight: 700;
}

.xiaolan-progress-head em,
.xiaolan-progress-card summary em {
  margin-left: auto;
  color: #7d92aa;
  font-size: 0.7rem;
  font-style: normal;
  white-space: nowrap;
}

.xiaolan-progress-ico {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #e8f6e3;
  color: #2f9e1a;
  font-size: 0.62rem;
  font-weight: 700;
}

.xiaolan-progress-ico.is-failed {
  background: #fdeaea;
  color: #c0392b;
}

.xiaolan-progress-spin {
  display: inline-block;
  flex: none;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(47, 158, 26, 0.22);
  border-top-color: #2f9e1a;
  border-radius: 50%;
  animation: xiaolanProgressSpin 0.8s linear infinite;
}

.xiaolan-progress-spin.is-small {
  width: 10px;
  height: 10px;
  border-width: 1.5px;
}

@keyframes xiaolanProgressSpin {
  to {
    transform: rotate(360deg);
  }
}

.xiaolan-progress-steps {
  display: grid;
  gap: 6px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.xiaolan-progress-steps li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.78rem;
  color: #7d92aa;
}

.xiaolan-progress-dot {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 17px;
  height: 17px;
  margin-top: 1px;
  border: 1px solid #d9e4f1;
  border-radius: 50%;
  background: #ffffff;
  color: #9fb3c8;
  font-size: 0.66rem;
  font-weight: 700;
}

.xiaolan-progress-steps li.is-done .xiaolan-progress-dot {
  border-color: #bfe3b4;
  background: #eef9ea;
  color: #2f9e1a;
}

.xiaolan-progress-steps li.is-active .xiaolan-progress-dot {
  border-color: #cfe0f5;
  background: #f2f8ff;
}

.xiaolan-progress-steps li.is-failed .xiaolan-progress-dot {
  border-color: #f3c9c9;
  background: #fdf2f2;
  color: #c0392b;
}

.xiaolan-progress-step {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.xiaolan-progress-step b {
  color: #41607f;
  font-size: 0.78rem;
  font-weight: 600;
}

.xiaolan-progress-steps li.is-done .xiaolan-progress-step b {
  color: #1f3d5c;
}

.xiaolan-progress-step em {
  color: #8aa0b7;
  font-size: 0.7rem;
  font-style: normal;
}

/* ===== 生信绘图 / 分析任务进度条 ===== */
.xiaolan-job-progress {
  margin: 10px 0 4px;
  padding: 10px 12px;
  border: 1px solid #e3ebf5;
  border-radius: 12px;
  background: #f8fbff;
}

.xiaolan-job-progress-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.xiaolan-job-progress-head strong {
  color: #1f3d5c;
  font-size: 0.82rem;
  font-weight: 700;
}

.xiaolan-job-progress-head em {
  margin-left: auto;
  color: #7d92aa;
  font-size: 0.7rem;
  font-style: normal;
  white-space: nowrap;
}

.xiaolan-job-progress-track {
  height: 8px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e9f0f8;
}

.xiaolan-job-progress-track i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #a9d99a, #2f9e1a);
}

.xiaolan-job-progress-track.is-done i {
  background: linear-gradient(90deg, #7fc96a, #2f9e1a);
}

.xiaolan-job-progress-track.is-failed i {
  background: linear-gradient(90deg, #e8a0a0, #c0392b);
}

.xiaolan-job-progress-track.is-running i {
  width: 45% !important;
  animation: xiaolanJobSlide 1.5s ease-in-out infinite;
}

@keyframes xiaolanJobSlide {
  0% {
    transform: translateX(-110%);
  }
  60%,
  100% {
    transform: translateX(120%);
  }
}

.xiaolan-job-progress-note {
  margin: 6px 0 0;
  color: #8aa0b7;
  font-size: 0.7rem;
  line-height: 1.5;
}

.xiaolan-job-progress-track.is-progress i {
  animation: none;
  transition: width 0.4s ease;
}

.xiaolan-job-progress .xiaolan-progress-steps {
  margin-top: 8px;
}
