/* AI 思考链路 —— 极简折叠态，无气泡/卡片 */

.ai-reasoning {
  font-size: 13px;
  line-height: 1.5;
  color: #667085;
  margin: 6px 0 8px;
}

/* 折叠态：一行小字 + 小圆点 */
.ai-reasoning.collapsed {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.ai-reasoning.expanded {
  display: block;
}

.reasoning-header {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.reasoning-header .dot {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  border-radius: 50%;
  background: #326de5;
  animation: ai-reasoning-pulse 1.4s infinite ease-in-out;
}

.ai-reasoning.completed .reasoning-header .dot {
  background: #17b26a;
  animation: none;
}

.reasoning-header .title {
  display: none;
}

.reasoning-header .summary {
  color: #667085;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 420px;
}

.reasoning-header .arrow {
  color: #98a2b3;
  font-size: 11px;
  transition: transform 0.2s ease;
}

.ai-reasoning.expanded .reasoning-header .arrow {
  transform: rotate(180deg);
}

/* 展开后的时间轴，也非常清淡 */
.reasoning-steps {
  display: none;
  margin: 6px 0 0 5px;
  padding: 0 0 0 10px;
  border-left: 1px solid #e4e7ec;
}

.ai-reasoning.expanded .reasoning-steps {
  display: block;
}

.reasoning-step {
  position: relative;
  padding-left: 10px;
  margin: 0 0 5px;
  font-size: 13px;
  color: #667085;
  word-break: break-word;
  overflow-wrap: anywhere;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  min-height: 0 !important;
  width: auto !important;
}

.reasoning-step:last-child {
  margin-bottom: 0;
}

.reasoning-step .icon,
.reasoning-step .text {
  display: none;
}

.reasoning-step .reasoning-step-text {
  display: block;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  min-height: 0 !important;
  width: auto !important;
}

.reasoning-step::before {
  content: '';
  position: absolute;
  left: -4.5px;
  top: 6px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #d0d5dd;
}

.reasoning-step.active {
  color: #344054;
  font-weight: 500;
}

.reasoning-step.active::before {
  background: #326de5;
}

.reasoning-step.completed::before {
  background: #17b26a;
}

/* 加载占位 */
.thinking-loader {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #667085;
  font-size: 13px;
}

.thinking-loader .dots {
  display: inline-flex;
  gap: 3px;
}

.thinking-loader .dots span {
  display: inline-block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #667085;
  animation: ai-reasoning-blink 1.4s infinite both;
}

.thinking-loader .dots span:nth-child(1) {
  animation-delay: 0s;
}
.thinking-loader .dots span:nth-child(2) {
  animation-delay: 0.2s;
}
.thinking-loader .dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes ai-reasoning-pulse {
  0%,
  100% {
    opacity: 0.4;
    transform: scale(0.8);
  }
  50% {
    opacity: 1;
    transform: scale(1.1);
  }
}

@keyframes ai-reasoning-blink {
  0%,
  80%,
  100% {
    opacity: 0.3;
    transform: scale(0.8);
  }
  40% {
    opacity: 1;
    transform: scale(1);
  }
}

/* 在对话气泡内的位置微调 */
.box .Content .Right .Dialogue li .content .ai-reasoning {
  margin-top: 4px;
  margin-bottom: 8px;
}
