/* =============================================
   Agent 深度演示 - 5大模块样式
   ============================================= */

/* ---------- Agent Pipeline Nav ---------- */
.agent-pipeline {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 1100px;
}
.agent-pipeline .pipeline-nav-btn.active {
  background: rgba(168, 85, 247, 0.08);
  color: var(--neon-purple);
}
.agent-pipeline .pipeline-nav-btn.active .step-num {
  background: var(--neon-purple);
  color: var(--bg-dark);
  border-color: var(--neon-purple);
  box-shadow: 0 0 12px rgba(168,85,247,0.4);
}

/* ---------- 1. Agent Architecture ---------- */
.arch-canvas-wrap {
  position: relative;
  width: 100%;
  height: 440px;
  background: rgba(0,0,0,0.2);
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.05);
  overflow: hidden;
}
#archCanvas { width: 100%; height: 100%; }

.arch-desc-panel {
  padding: 16px 20px;
  background: rgba(168,85,247,0.04);
  border-radius: 10px;
  border: 1px solid rgba(168,85,247,0.1);
  font-size: 0.85rem;
  color: var(--text-dim);
  line-height: 1.8;
  margin-top: 16px;
  min-height: 50px;
  transition: all 0.3s;
}
.arch-desc-panel .hl { color: var(--neon-purple); font-weight: 700; }

/* ---------- 2. Chain of Thought ---------- */
.cot-demo {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.cot-task-box {
  padding: 18px 22px;
  background: rgba(0,212,255,0.05);
  border-radius: 12px;
  border: 1px solid rgba(0,212,255,0.1);
  font-size: 0.95rem;
}
.cot-task-box strong { color: var(--neon-blue); }

.cot-thinking-area {
  min-height: 300px;
  max-height: 500px;
  overflow-y: auto;
  padding: 20px;
  background: rgba(0,0,0,0.2);
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.05);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cot-bubble {
  padding: 14px 18px;
  border-radius: 14px;
  font-size: 0.88rem;
  line-height: 1.7;
  max-width: 90%;
  animation: msg-in 0.4s ease;
  position: relative;
}
.cot-bubble.thought {
  align-self: flex-start;
  background: rgba(168,85,247,0.08);
  border: 1px solid rgba(168,85,247,0.12);
  border-bottom-left-radius: 4px;
}
.cot-bubble.thought::before {
  content: '💭';
  position: absolute;
  top: -10px;
  left: -8px;
  font-size: 1.1rem;
}
.cot-bubble.action {
  align-self: flex-end;
  background: rgba(244,114,182,0.08);
  border: 1px solid rgba(244,114,182,0.12);
  border-bottom-right-radius: 4px;
}
.cot-bubble.action::before {
  content: '⚡';
  position: absolute;
  top: -10px;
  right: -8px;
  font-size: 1.1rem;
}
.cot-bubble.result {
  align-self: flex-start;
  background: rgba(34,211,238,0.06);
  border: 1px solid rgba(34,211,238,0.1);
  border-bottom-left-radius: 4px;
}
.cot-bubble.result::before {
  content: '📋';
  position: absolute;
  top: -10px;
  left: -8px;
  font-size: 1.1rem;
}
.cot-bubble .cot-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 6px;
  display: block;
}
.cot-bubble.thought .cot-label { color: var(--neon-purple); }
.cot-bubble.action .cot-label { color: var(--neon-pink); }
.cot-bubble.result .cot-label { color: var(--neon-green); }

.cot-typing-indicator {
  display: flex;
  gap: 5px;
  padding: 12px 18px;
  align-self: flex-start;
}
.cot-typing-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--neon-purple);
  animation: cot-bounce 1.4s infinite ease-in-out;
}
.cot-typing-dot:nth-child(2) { animation-delay: 0.16s; }
.cot-typing-dot:nth-child(3) { animation-delay: 0.32s; }
@keyframes cot-bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.3; }
  40% { transform: translateY(-8px); opacity: 1; }
}

/* ---------- 3. Tool Call Terminal ---------- */
.terminal-wrap {
  background: #0c0c0c;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.08);
  font-family: 'Courier New', 'Consolas', monospace;
}
.terminal-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  background: rgba(255,255,255,0.04);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.terminal-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
}
.terminal-dot.red { background: #ff5f57; }
.terminal-dot.yellow { background: #febc2e; }
.terminal-dot.green { background: #28c840; }
.terminal-title {
  margin-left: 12px;
  font-size: 0.75rem;
  color: var(--text-dim);
  font-family: inherit;
}
.terminal-body {
  padding: 20px;
  min-height: 280px;
  max-height: 420px;
  overflow-y: auto;
  font-size: 0.82rem;
  line-height: 1.9;
}
.term-line {
  margin-bottom: 4px;
  animation: msg-in 0.3s ease;
}
.term-prompt { color: #28c840; }
.term-cmd { color: #e2e8f0; }
.term-comment { color: #666; }
.term-info { color: var(--neon-blue); }
.term-warn { color: #febc2e; }
.term-success { color: #28c840; }
.term-error { color: #ff5f57; }
.term-data { color: var(--neon-purple); }
.term-highlight { color: var(--neon-pink); font-weight: 700; }
.term-arrow { color: var(--neon-blue); }
.term-json {
  display: block;
  padding: 8px 14px;
  margin: 4px 0 4px 16px;
  background: rgba(255,255,255,0.03);
  border-radius: 6px;
  border-left: 2px solid var(--neon-purple);
  color: var(--text-dim);
}
.term-spinner {
  display: inline-block;
  animation: term-spin 1s steps(8) infinite;
}
@keyframes term-spin {
  0% { content: '⠋'; } 12.5% { content: '⠙'; } 25% { content: '⠹'; }
  37.5% { content: '⠸'; } 50% { content: '⠼'; } 62.5% { content: '⠴'; }
  75% { content: '⠦'; } 87.5% { content: '⠧'; }
}

/* ---------- 4. Decision Tree ---------- */
.dtree-container {
  padding: 20px;
  background: rgba(0,0,0,0.2);
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.05);
  overflow-x: auto;
}
.dtree-root {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}
.dtree-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}
.dtree-card {
  padding: 14px 22px;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  text-align: center;
  min-width: 160px;
  position: relative;
  border: 2px solid transparent;
}
.dtree-card:hover { transform: translateY(-2px); }
.dtree-card.root {
  background: rgba(168,85,247,0.12);
  border-color: rgba(168,85,247,0.3);
  color: var(--neon-purple);
}
.dtree-card.decision {
  background: rgba(0,212,255,0.08);
  border-color: rgba(0,212,255,0.2);
  color: var(--neon-blue);
}
.dtree-card.leaf {
  background: rgba(244,114,182,0.08);
  border-color: rgba(244,114,182,0.2);
  color: var(--neon-pink);
}
.dtree-card.selected {
  box-shadow: 0 0 20px rgba(168,85,247,0.3);
  transform: scale(1.03);
}
.dtree-card .dtree-icon { font-size: 1.2rem; margin-bottom: 4px; display: block; }
.dtree-card .dtree-label { font-size: 0.78rem; opacity: 0.6; display: block; margin-top: 2px; }

.dtree-connector {
  width: 2px;
  height: 24px;
  background: rgba(255,255,255,0.1);
}
.dtree-connector.active { background: var(--neon-purple); box-shadow: 0 0 8px rgba(168,85,247,0.3); }

.dtree-branches {
  display: flex;
  gap: 24px;
  justify-content: center;
  flex-wrap: wrap;
  position: relative;
  padding-top: 8px;
}
.dtree-branches::before {
  content: '';
  position: absolute;
  top: 0;
  left: 20%;
  right: 20%;
  height: 2px;
  background: rgba(255,255,255,0.06);
}
.dtree-branch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  opacity: 0;
  transform: translateY(15px);
  transition: all 0.5s;
}
.dtree-branch.visible {
  opacity: 1;
  transform: translateY(0);
}
.dtree-sub-branches {
  display: flex;
  gap: 16px;
  padding-top: 8px;
}
.dtree-reasoning {
  margin-top: 16px;
  padding: 16px 20px;
  background: rgba(168,85,247,0.04);
  border-radius: 10px;
  border: 1px solid rgba(168,85,247,0.1);
  font-size: 0.85rem;
  color: var(--text-dim);
  line-height: 1.8;
  min-height: 50px;
}

/* ---------- 5. Comparison ---------- */
.compare-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.compare-panel {
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.compare-header {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  gap: 10px;
}
.compare-header .badge {
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 700;
}
.badge-without { background: rgba(255,255,255,0.06); color: var(--text-dim); }
.badge-with { background: rgba(168,85,247,0.12); color: var(--neon-purple); }
.compare-header .title { font-weight: 700; font-size: 0.92rem; }

.compare-body {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 280px;
  max-height: 400px;
  overflow-y: auto;
}
.compare-line {
  font-size: 0.82rem;
  line-height: 1.7;
  padding: 10px 14px;
  border-radius: 8px;
  animation: msg-in 0.4s ease;
}
.compare-line.user-line {
  background: rgba(0,212,255,0.06);
  border: 1px solid rgba(0,212,255,0.08);
}
.compare-line.model-line {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.04);
}
.compare-line.agent-line {
  background: rgba(168,85,247,0.05);
  border: 1px solid rgba(168,85,247,0.08);
}
.compare-line.result-line {
  border: 1px solid rgba(34,211,238,0.12);
  background: rgba(34,211,238,0.04);
}
.compare-line.fail-line {
  border: 1px solid rgba(255,95,87,0.15);
  background: rgba(255,95,87,0.04);
  color: #ff8a80;
}

.compare-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.06);
  text-align: center;
  font-size: 0.85rem;
  font-weight: 600;
}
.footer-fail { color: #ff8a80; }
.footer-success { color: var(--neon-green); }

.compare-vs {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 900;
  color: var(--neon-purple);
  align-self: center;
  display: none;
}

@media (max-width: 768px) {
  .compare-container { grid-template-columns: 1fr; }
  .arch-canvas-wrap { height: 340px; }
  .dtree-branches { gap: 12px; }
  .dtree-card { min-width: 120px; padding: 10px 14px; font-size: 0.78rem; }
}
