.status-panel {
  width: 320px;
  flex-shrink: 0;
  border-left: 1px solid var(--border-color, #e5e7eb);
  background: var(--bg-container, #fff);
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.status-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.status-panel-header h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: #111827;
}

/* Section styling - rounded bordered boxes */
.status-section {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 12px;
}

/* Token section - collapsible */
.token-section {
  padding: 8px 12px;
}

.status-section-header.collapsible {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  margin-bottom: 0;
}

.status-section-header.collapsible .status-section-title {
  margin-bottom: 0;
}

.status-section-header.collapsible:hover {
  opacity: 0.8;
}

.collapse-icon {
  font-size: 10px;
  color: #6b7280;
  transition: transform 0.2s ease;
}

.collapse-icon.expanded {
  transform: rotate(90deg);
}

.status-section-title {
  font-size: 11px;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-section-title .anticon {
  font-size: 12px;
}

/* Thread ID + 消息统计 合并区块 */
.thread-info-section {
  padding: 10px 12px;
}

.thread-id-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.thread-id-row .thread-id-label {
  font-size: 10px;
  color: #6b7280;
}

.thread-id-row .thread-id-value {
  font-size: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color: #374151;
}

.thread-id-row .thread-id-copy {
  padding: 2px 6px;
  font-size: 10px;
  color: #6b7280;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.2s;
}

.thread-id-row .thread-id-copy:hover {
  background: #e5e7eb;
}

/* 消息统计紧凑版 */
.message-grid.compact {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}

.message-grid.compact .message-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4px;
  border-radius: 4px;
  background: #fff;
}

.message-grid.compact .message-count {
  font-size: 13px;
  font-weight: 600;
  color: #111827;
  font-variant-numeric: tabular-nums;
}

.message-grid.compact .message-count.running {
  color: #3b82f6;
}

.message-grid.compact .message-count.completed {
  color: #22c55e;
}

.message-grid.compact .message-count.failed {
  color: #ef4444;
}

.message-grid.compact .message-label {
  font-size: 9px;
  color: #6b7280;
  margin-top: 1px;
}

/* Thread ID */
.thread-id-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: #f3f4f6;
  border-radius: 6px;
  margin-bottom: 4px;
}

.thread-id-label {
  font-size: 11px;
  color: #6b7280;
}

.thread-id-value {
  font-size: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color: #374151;
}

.thread-id-copy {
  padding: 2px 6px;
  font-size: 10px;
  color: #6b7280;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.2s;
}

.thread-id-copy:hover {
  background: #e5e7eb;
}

/* Idle status */
.idle-status {
  color: #9ca3af;
  text-align: center;
  padding: 12px 0;
  font-size: 12px;
}

/* Agent list */
.agent-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.agent-item {
  padding: 8px;
  border-radius: 6px;
  background: #fff;
  border: 1px solid #e5e7eb;
}

.agent-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.agent-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.agent-dot.running {
  background: #3b82f6;
  animation: pulse-blue 1.5s infinite;
}

.agent-dot.streaming {
  background: #22c55e;
  animation: pulse-green 1s infinite;
}

.agent-dot.completed {
  background: #22c55e;
}

.agent-dot.failed {
  background: #ef4444;
}

.agent-dot.cancelled {
  background: #f59e0b;
}

.agent-dot.interrupted {
  background: #f59e0b;
}

.agent-dot.pending {
  background: #d1d5db;
}

@keyframes pulse-blue {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes pulse-green {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.1); }
}

.agent-name {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #111827;
}

.agent-status-badge {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  background: #e5e7eb;
  color: #6b7280;
}

.agent-status-badge.running {
  background: #dbeafe;
  color: #1d4ed8;
}

.agent-status-badge.streaming {
  background: #dcfce7;
  color: #16a34a;
}

.agent-status-badge.completed {
  background: #dcfce7;
  color: #16a34a;
}

.agent-status-badge.failed {
  background: #fee2e2;
  color: #dc2626;
}

.agent-status-badge.cancelled {
  background: #fef3c7;
  color: #b45309;
}

.agent-status-badge.interrupted {
  background: #fef3c7;
  color: #b45309;
}

/* Agent cancel button */
.agent-cancel-btn {
  cursor: pointer;
  padding: 2px 4px;
  margin-left: 4px;
  color: #6b7280;
  font-size: 12px;
  border-radius: 4px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
}

.agent-cancel-btn:hover {
  color: #ef4444;
  background: #fee2e2;
}

.agent-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
  padding-left: 16px;
}

.agent-duration {
  font-size: 11px;
  color: #3b82f6;
  font-weight: 500;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.agent-usage {
  display: flex;
  gap: 8px;
  font-size: 10px;
  color: #6b7280;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.agent-usage span {
  display: flex;
  align-items: center;
  gap: 2px;
}

/* Token stats grid */
.token-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.token-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.token-label {
  font-size: 10px;
  color: #6b7280;
  font-weight: 500;
}

.token-value {
  font-size: 14px;
  font-weight: 600;
  color: #111827;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-variant-numeric: tabular-nums;
}

.token-value.input {
  color: #3b82f6;
}

.token-value.output {
  color: #22c55e;
}

.token-value.cost {
  color: #f59e0b;
}

/* Raw memory markdown */
.memory-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.memory-section .status-section-title {
  margin-bottom: 0;
}

.memory-total-tag,
.memory-count-tag {
  margin-left: 4px;
  margin-right: 0;
  font-size: 10px;
  line-height: 16px;
}

.memory-refresh {
  margin-left: auto;
  padding: 2px 4px;
  border-radius: 4px;
  color: var(--text-secondary, #6b7280);
  cursor: pointer;
}

.memory-refresh:hover {
  color: var(--color-primary, #3b82f6);
  background: var(--color-primary-opacity-10, #eff6ff);
}

.memory-group {
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: 6px;
  background: var(--bg-base, #fff);
  overflow: hidden;
}

.memory-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.memory-group-header {
  padding: 8px 10px;
  background: var(--bg-elevated, #f9fafb);
}

.memory-group-title {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 6px;
  color: var(--text-primary, #111827);
  font-size: 12px;
  font-weight: 600;
}

.memory-group-title span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.memory-scope {
  flex: 1;
  min-width: 0;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: right;
  color: var(--text-secondary, #6b7280);
  font-size: 11px;
}

.memory-group-body {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.memory-index-path {
  color: var(--text-secondary, #6b7280);
  font-size: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.memory-index-toolbar {
  display: flex;
  gap: 6px;
}

.memory-index-toolbar .ant-btn {
  font-size: 11px;
  height: 24px;
  padding: 0 7px;
}

.memory-index-content {
  margin: 0;
  padding: 10px;
  max-height: 180px;
  overflow: auto;
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: 6px;
  background: var(--bg-elevated, #f9fafb);
  color: var(--text-primary, #111827);
  font-size: 12px;
  line-height: 1.6;
  word-break: break-word;
}

.memory-index-content h1,
.memory-index-content h2,
.memory-index-content h3,
.memory-index-content h4,
.memory-modal-markdown h1,
.memory-modal-markdown h2,
.memory-modal-markdown h3,
.memory-modal-markdown h4 {
  margin: 0.8em 0 0.45em;
  color: var(--text-primary, #111827);
  font-weight: 600;
  line-height: 1.35;
}

.memory-index-content h1,
.memory-modal-markdown h1 {
  font-size: 18px;
}

.memory-index-content h2,
.memory-modal-markdown h2 {
  font-size: 16px;
}

.memory-index-content h3,
.memory-modal-markdown h3 {
  font-size: 14px;
}

.memory-index-content p,
.memory-modal-markdown p {
  margin: 0.45em 0;
}

.memory-index-content ul,
.memory-index-content ol,
.memory-modal-markdown ul,
.memory-modal-markdown ol {
  margin: 0.45em 0;
  padding-left: 20px;
}

.memory-index-content li,
.memory-modal-markdown li {
  margin: 0.2em 0;
}

.memory-index-content blockquote,
.memory-modal-markdown blockquote {
  margin: 0.65em 0;
  padding: 2px 0 2px 10px;
  border-left: 3px solid var(--border-color, #e5e7eb);
  color: var(--text-secondary, #6b7280);
}

.memory-index-content code,
.memory-modal-markdown code {
  padding: 1px 4px;
  border-radius: 4px;
  background: var(--bg-base, #fff);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.92em;
}

.memory-markdown-link {
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--color-primary, #3b82f6);
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.memory-markdown-link:hover {
  text-decoration: underline;
}

.memory-index-content pre,
.memory-modal-markdown pre {
  margin: 0.65em 0;
  padding: 10px;
  overflow: auto;
  border-radius: 6px;
  background: var(--bg-base, #fff);
  border: 1px solid var(--border-color, #e5e7eb);
}

.memory-index-content pre code,
.memory-modal-markdown pre code {
  padding: 0;
  background: transparent;
}

.memory-index-content table,
.memory-modal-markdown table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.65em 0;
  font-size: 12px;
}

.memory-index-content th,
.memory-index-content td,
.memory-modal-markdown th,
.memory-modal-markdown td {
  padding: 6px 8px;
  border: 1px solid var(--border-color, #e5e7eb);
}

.memory-index-content th,
.memory-modal-markdown th {
  background: var(--bg-base, #fff);
  font-weight: 600;
}

.memory-index-content > :first-child,
.memory-modal-markdown > :first-child {
  margin-top: 0;
}

.memory-index-content > :last-child,
.memory-modal-markdown > :last-child {
  margin-bottom: 0;
}

.memory-expand-icon {
  font-size: 10px;
  color: var(--text-secondary, #6b7280);
  transition: transform 0.2s ease;
}

.memory-expand-icon.expanded {
  transform: rotate(90deg);
}

.memory-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary, #6b7280);
  font-size: 12px;
}

.memory-modal .ant-modal-body {
  padding-top: 8px;
}

.memory-modal-layout {
  display: flex;
  height: 68vh;
  min-height: 480px;
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-container, #fff);
}

.memory-modal-sidebar {
  width: 240px;
  flex-shrink: 0;
  padding: 8px;
  overflow-y: auto;
  border-right: 1px solid var(--border-color, #e5e7eb);
  background: var(--bg-elevated, #f9fafb);
}

.memory-modal-file {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--text-primary, #111827);
  cursor: pointer;
  font-size: 12px;
}

.memory-modal-file:hover {
  background: var(--bg-base, #fff);
  border-color: var(--border-color, #e5e7eb);
}

.memory-modal-file.active {
  background: var(--color-primary-opacity-10, #eff6ff);
  border-color: var(--color-primary, #3b82f6);
}

.memory-modal-file span {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.memory-modal-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.memory-modal-content-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px 8px;
}

.memory-modal-file-title {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary, #111827);
}

.memory-modal-file-title span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.memory-modal-actions {
  display: flex;
  flex-shrink: 0;
  gap: 8px;
}

.memory-modal-path {
  padding: 0 14px 8px;
  color: var(--text-secondary, #6b7280);
  font-size: 11px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.memory-modal-markdown {
  flex: 1;
  margin: 0;
  padding: 14px;
  overflow: auto;
  border-top: 1px solid var(--border-color, #e5e7eb);
  background: var(--bg-container, #fff);
  color: var(--text-primary, #111827);
  font-size: 13px;
  line-height: 1.65;
  word-break: break-word;
}

/* Token animation */
.token-animate {
  transition: all 0.3s ease;
}

.token-updated {
  animation: token-pulse 0.5s ease;
}

@keyframes token-pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.08); color: #3b82f6; }
  100% { transform: scale(1); }
}

/* Cache rate */
.cache-rate {
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px solid #e5e7eb;
}

.cache-rate-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.cache-rate-label {
  font-size: 10px;
  color: #6b7280;
}

.cache-rate-value {
  font-size: 11px;
  font-weight: 600;
  color: #22c55e;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* Message stats grid */
.message-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}

.message-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px;
  border-radius: 4px;
  background: #fff;
}

.message-count {
  font-size: 14px;
  font-weight: 600;
  color: #111827;
  font-variant-numeric: tabular-nums;
}

.message-label {
  font-size: 10px;
  color: #6b7280;
  margin-top: 2px;
}

/* History list */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.history-item {
  padding: 6px 8px;
  border-radius: 4px;
  background: #fff;
  border-left: 3px solid;
}

.history-item.completed {
  border-left-color: #22c55e;
}

.history-item.failed {
  border-left-color: #ef4444;
}

.history-header {
  display: flex;
  align-items: center;
  gap: 6px;
}

.history-name {
  flex: 1;
  font-size: 12px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #111827;
}

.history-usage {
  display: flex;
  gap: 8px;
  margin-top: 4px;
  margin-left: 22px;
  font-size: 10px;
  color: #6b7280;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.history-time {
  margin-top: 2px;
  margin-left: 22px;
  font-size: 10px;
  color: #9ca3af;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* Task progress */
.task-group {
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e5e7eb;
}

.task-group:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.task-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 500;
  color: #374151;
}

.task-count {
  color: #6b7280;
  font-size: 11px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.task-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.task-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #374151;
}

.task-item .anticon {
  font-size: 12px;
}

.task-title {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Chain timeline */
.chain-timeline {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chain-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chain-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.chain-dot.running {
  background: #3b82f6;
  animation: pulse-blue 1.5s infinite;
}

.chain-dot.completed {
  background: #22c55e;
}

.chain-dot.failed {
  background: #ef4444;
}

.chain-dot.pending {
  background: #d1d5db;
}

.chain-content {
  flex: 1;
  min-width: 0;
}

.chain-name {
  font-size: 12px;
  font-weight: 500;
  color: #111827;
}

.chain-status {
  font-size: 10px;
  padding: 1px 4px;
  border-radius: 3px;
  background: #e5e7eb;
  color: #6b7280;
}

.chain-status.running {
  background: #dbeafe;
  color: #1d4ed8;
}

.chain-status.completed {
  background: #dcfce7;
  color: #16a34a;
}

.chain-status.failed {
  background: #fee2e2;
  color: #dc2626;
}

/* Runtime logs button */
.runtime-logs-btn {
  font-size: 10px;
  padding: 2px 6px;
  color: #6b7280;
}

.runtime-logs {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
}

.log-line {
  margin: 0;
  padding: 6px 8px;
  background: #f3f4f6;
  border-radius: 4px;
  margin-bottom: 4px;
}

.log-line pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-all;
  font-size: 11px;
}

/* Collapse override */
.status-section .ant-collapse {
  background: transparent;
  border: none;
}

.status-section .ant-collapse-header {
  padding: 4px 0 !important;
  font-size: 11px;
}

.status-section .ant-collapse-content {
  padding: 0 !important;
  background: transparent;
}

.status-section .ant-collapse-content-box {
  padding: 0 !important;
}

/* Progress bar override */
.status-section .ant-progress {
  margin: 4px 0;
}

.status-section .ant-progress-text {
  font-size: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* Section expand/collapse */
.section-collapse {
  padding: 4px 0;
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 8px;
}

.section-collapse:last-child {
  border-bottom: none;
}

.section-collapse-header {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  font-size: 11px;
  color: #6b7280;
  user-select: none;
}

.section-collapse-header:hover {
  color: #374151;
}

.section-collapse-icon {
  font-size: 10px;
  transition: transform 0.2s;
}

.section-collapse-icon.expanded {
  transform: rotate(90deg);
}

.section-collapse-count {
  font-size: 10px;
  background: #e5e7eb;
  padding: 1px 4px;
  border-radius: 3px;
}

/* ========== 深色主题适配 ========== */

[data-theme='dark'] .status-panel {
  background: var(--bg-container);
  border-color: var(--border-color);
}

[data-theme='dark'] .status-panel-header h3 {
  color: var(--text-primary);
}

[data-theme='dark'] .status-section {
  background: var(--bg-elevated);
  border-color: var(--border-color);
}

[data-theme='dark'] .status-section-title {
  color: var(--text-secondary);
}

[data-theme='dark'] .status-section-header.collapsible:hover {
  opacity: 0.8;
}

[data-theme='dark'] .collapse-icon {
  color: var(--text-secondary);
}

[data-theme='dark'] .thread-id-section {
  background: var(--bg-base);
}

[data-theme='dark'] .thread-id-label {
  color: var(--text-secondary);
}

[data-theme='dark'] .thread-id-value {
  color: var(--text-primary);
}

[data-theme='dark'] .thread-id-copy:hover {
  background: var(--bg-elevated);
}

/* Thread ID + 消息统计 合并区块深色模式 */
[data-theme='dark'] .thread-info-section .thread-id-row .thread-id-label {
  color: var(--text-secondary);
}

[data-theme='dark'] .thread-info-section .thread-id-row .thread-id-value {
  color: var(--text-primary);
}

[data-theme='dark'] .thread-info-section .thread-id-row .thread-id-copy:hover {
  background: var(--bg-elevated);
}

[data-theme='dark'] .message-grid.compact .message-item {
  background: var(--bg-base);
}

[data-theme='dark'] .message-grid.compact .message-count {
  color: var(--text-primary);
}

[data-theme='dark'] .message-grid.compact .message-label {
  color: var(--text-secondary);
}

[data-theme='dark'] .idle-status {
  color: var(--text-secondary);
}

[data-theme='dark'] .agent-item {
  background: var(--bg-base);
  border-color: var(--border-color);
}

[data-theme='dark'] .agent-name {
  color: var(--text-primary);
}

[data-theme='dark'] .agent-status-badge {
  background: var(--bg-elevated);
  color: var(--text-secondary);
}

[data-theme='dark'] .agent-cancel-btn {
  color: var(--text-secondary);
}

[data-theme='dark'] .agent-cancel-btn:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.2);
}

[data-theme='dark'] .agent-meta {
  color: var(--text-secondary);
}

[data-theme='dark'] .token-label {
  color: var(--text-secondary);
}

[data-theme='dark'] .token-value {
  color: var(--text-primary);
}

[data-theme='dark'] .cache-rate {
  border-top-color: var(--border-color);
}

[data-theme='dark'] .cache-rate-label {
  color: var(--text-secondary);
}

[data-theme='dark'] .message-item {
  background: var(--bg-base);
}

[data-theme='dark'] .message-count {
  color: var(--text-primary);
}

[data-theme='dark'] .message-label {
  color: var(--text-secondary);
}

[data-theme='dark'] .history-item {
  background: var(--bg-base);
}

[data-theme='dark'] .history-name {
  color: var(--text-primary);
}

[data-theme='dark'] .history-usage {
  color: var(--text-secondary);
}

[data-theme='dark'] .history-time {
  color: var(--text-secondary);
}

[data-theme='dark'] .task-group {
  border-bottom-color: var(--border-color);
}

[data-theme='dark'] .task-header {
  color: var(--text-primary);
}

[data-theme='dark'] .task-count {
  color: var(--text-secondary);
}

[data-theme='dark'] .task-item {
  color: var(--text-primary);
}

[data-theme='dark'] .chain-name {
  color: var(--text-primary);
}

[data-theme='dark'] .chain-status {
  background: var(--bg-elevated);
  color: var(--text-secondary);
}

[data-theme='dark'] .runtime-logs-btn {
  color: var(--text-secondary);
}

[data-theme='dark'] .log-line {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

[data-theme='dark'] .log-line pre {
  color: var(--text-primary);
}

[data-theme='dark'] .section-collapse {
  border-bottom-color: var(--border-color);
}

[data-theme='dark'] .section-collapse-header {
  color: var(--text-secondary);
}

[data-theme='dark'] .section-collapse-header:hover {
  color: var(--text-primary);
}

[data-theme='dark'] .section-collapse-count {
  background: var(--bg-elevated);
}

/* ========== Agent Invocation Log Panel 深色模式 ========== */

[data-theme='dark'] .log-panel-trigger {
  background: var(--bg-elevated);
  border-color: var(--border-color);
  color: var(--text-primary);
}

[data-theme='dark'] .log-panel-trigger:hover {
  background: var(--bg-base);
  border-color: var(--color-primary);
}

[data-theme='dark'] .log-panel-trigger .anticon {
  color: var(--text-secondary);
}

[data-theme='dark'] .log-panel-content .section-collapse-header {
  color: var(--text-secondary);
}

[data-theme='dark'] .log-panel-content .section-collapse-header:hover {
  color: var(--text-primary);
}

[data-theme='dark'] .agent-log-item {
  background: var(--bg-base);
  border-color: var(--border-color);
}

[data-theme='dark'] .agent-log-item:hover {
  background: var(--bg-elevated);
  border-color: var(--color-primary-opacity-30);
}

[data-theme='dark'] .agent-log-item .agent-name {
  color: var(--text-primary);
}

[data-theme='dark'] .agent-log-item--selected {
  background: var(--color-primary-opacity-10);
  border-color: var(--color-primary);
}

[data-theme='dark'] .detail-header {
  color: var(--text-primary);
}

[data-theme='dark'] .detail-header:hover {
  color: var(--text-primary);
}

[data-theme='dark'] .invocation-count {
  color: var(--text-secondary);
}

[data-theme='dark'] .invocation-record {
  background: var(--bg-base);
  border-color: var(--border-color);
}

[data-theme='dark'] .invocation-meta .time-display {
  color: var(--text-secondary);
}

[data-theme='dark'] .invocation-input {
  background: var(--color-primary-opacity-10);
  border-color: var(--color-primary-opacity-30);
}

[data-theme='dark'] .invocation-input pre {
  color: var(--color-primary);
}

[data-theme='dark'] .invocation-input-label {
  color: var(--color-primary);
}

[data-theme='dark'] .invocation-input-expand:hover {
  background: var(--color-primary-opacity-20);
}

[data-theme='dark'] .invocation-input-copy:hover {
  background: var(--color-primary-opacity-20);
}

/* 响应式布局: StatusPanel remains visible at all sizes */

/* ========== Timeline List 样式 ========== */

/* 时间线列表容器 */
.timeline-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 400px;
  overflow-y: auto;
  margin-top: 8px;
}

/* 单条时间线记录 */
.timeline-item {
  padding: 10px 12px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}

.timeline-item:hover {
  background: #f9fafb;
  border-color: #d1d5db;
}

/* 主信息行 */
.timeline-main-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.timeline-agent-name {
  font-size: 13px;
  font-weight: 500;
  color: #111827;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 120px;
  flex-shrink: 1;
  min-width: 60px;
}

.timeline-main-row .time-display {
  margin-left: 16px;
  flex-shrink: 0;
}

.timeline-main-row .duration-display {
  margin-left: auto;
  flex-shrink: 0;
}

/* 操作按钮区域（内联） */
.timeline-actions-inline {
  display: flex;
  gap: 4px;
  margin-left: auto;
}

.expand-btn {
  cursor: pointer;
  padding: 4px;
  color: #9ca3af;
  font-size: 10px;
  border-radius: 4px;
  transition: all 0.2s;
}

.expand-btn:hover {
  color: #374151;
  background: #f3f4f6;
}

.expand-btn.expanded {
  color: #374151;
  transform: rotate(90deg);
}

.copy-btn {
  cursor: pointer;
  padding: 4px;
  color: #9ca3af;
  font-size: 12px;
  border-radius: 4px;
  transition: all 0.2s;
}

.copy-btn:hover {
  color: #22c55e;
  background: #f0fdf4;
}

.copy-btn.copied {
  color: #22c55e;
}

/* Token 使用 */
.timeline-usage {
  display: flex;
  gap: 8px;
  margin-top: 6px;
  padding-left: 24px;
  font-size: 10px;
  color: #6b7280;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* 提示词展开区域 */
.timeline-prompt-expanded {
  margin-top: 8px;
  background: #f3f4f6;
  border-radius: 4px;
  padding: 8px;
}

.prompt-content {
  margin: 0;
  font-size: 11px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color: #374151;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.5;
  max-height: 200px;
  overflow-y: auto;
}

/* 活跃数量标记 */
.active-dot {
  color: #22c55e;
  font-weight: 600;
}

/* 标题栏样式 */
.section-collapse-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
}

.section-collapse-header .collapse-icon {
  font-size: 10px;
  color: #6b7280;
  transition: transform 0.2s ease;
}

.section-collapse-header .collapse-icon.expanded {
  transform: rotate(90deg);
}

/* ========== 深色模式适配 ========== */

[data-theme='dark'] .timeline-item {
  background: var(--bg-base);
  border-color: var(--border-color);
}

[data-theme='dark'] .timeline-item:hover {
  background: var(--bg-elevated);
  border-color: var(--color-primary-opacity-30);
}

[data-theme='dark'] .timeline-agent-name {
  color: var(--text-primary);
}

[data-theme='dark'] .timeline-usage {
  color: var(--text-secondary);
}

[data-theme='dark'] .expand-btn:hover {
  color: var(--text-primary);
  background: var(--bg-elevated);
}

[data-theme='dark'] .copy-btn:hover {
  color: var(--color-primary);
  background: var(--color-primary-opacity-10);
}

[data-theme='dark'] .timeline-prompt-expanded {
  background: var(--bg-elevated);
}

[data-theme='dark'] .prompt-content {
  color: var(--text-primary);
}

[data-theme='dark'] .active-dot {
  color: #4ade80;
}

[data-theme='dark'] .section-collapse-header .collapse-icon {
  color: var(--text-secondary);
}

/* ========== Agent Invocation Log Panel ========== */

/* 入口按钮（未展开时） */
.log-panel-trigger {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  color: #374151;
  transition: all 0.2s;
  user-select: none;
}

.log-panel-trigger:hover {
  background: #f3f4f6;
  border-color: #d1d5db;
}

.log-panel-trigger .anticon {
  font-size: 14px;
  color: #6b7280;
}

.log-panel-title {
  flex: 1;
}

.log-panel-trigger .expand-arrow {
  font-size: 10px;
  color: #9ca3af;
  padding: 4px;
  margin-left: 8px;
}

.log-panel-trigger:hover .expand-arrow {
  color: #374151;
}

.log-panel-count {
  font-size: 10px;
  background: #dbeafe;
  color: #1d4ed8;
  padding: 1px 6px;
  border-radius: 10px;
}

/* 展开后的面板 */
.log-panel-content {
  margin-top: 8px;
}

.log-panel-content .section-collapse-header {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.log-panel-content .section-collapse-header:hover {
  color: #374151;
}

/* Agent 列表 */
.agent-log-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 300px;
  overflow-y: auto;
}

.agent-log-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}

.agent-log-item:hover {
  background: #f9fafb;
  border-color: #d1d5db;
}

.agent-log-item .agent-name {
  flex: 1;
  font-size: 12px;
  font-weight: 500;
  color: #111827;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-log-item .anticon:last-child {
  flex-shrink: 0;
}

/* Agent 选中状态 */
.agent-log-item--selected {
  background: #eff6ff;
  border-color: #3b82f6;
}

/* 调用详情 */
.invocation-detail {
  margin-top: 8px;
}

.detail-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 0;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  color: #374151;
}

.detail-header:hover {
  color: #111827;
}

.invocation-count {
  font-size: 10px;
  color: #6b7280;
  font-weight: 400;
}

.invocation-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
  max-height: 400px;
  overflow-y: auto;
}

/* 单条调用记录 */
.invocation-record {
  padding: 10px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  border-left: 3px solid #3b82f6;
}

.invocation-record:last-child {
  border-left-color: #22c55e;
}

.invocation-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.invocation-meta .time-display {
  font-size: 11px;
  color: #6b7280;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* 输入内容区域 */
.invocation-input {
  background: #f0fdf4;
  border-radius: 4px;
  padding: 8px;
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid #bbf7d0;
}

.invocation-input pre {
  margin: 0;
  font-size: 11px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color: #166534;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.5;
}

/* 输入内容区域 - 展开/收起控制 */
.invocation-input-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.invocation-input-label {
  font-size: 10px;
  color: #15803d;
  font-weight: 500;
}

.invocation-input-expand {
  cursor: pointer;
  padding: 2px 4px;
  color: #22c55e;
  font-size: 12px;
  border-radius: 3px;
  transition: all 0.2s;
}

.invocation-input-expand:hover {
  color: #16a34a;
  background: #dcfce7;
}

.invocation-input-copy {
  cursor: pointer;
  padding: 2px 6px;
  color: #22c55e;
  font-size: 11px;
  border-radius: 3px;
  transition: all 0.2s;
  margin-left: 4px;
}

.invocation-input-copy:hover {
  color: #16a34a;
  background: #dcfce7;
}

.invocation-input-copy.copied {
  color: #16a34a;
}

/* 展开状态的 pre */
.invocation-input pre.expanded {
  max-height: 400px;
  overflow-y: auto;
}

/* ========== 全屏 Modal 样式 ========== */
.invocation-log-modal .modal-log-list {
  max-height: 70vh;
  overflow-y: auto;
}

.invocation-log-modal .modal-agent-section {
  margin-bottom: 16px;
}

.invocation-log-modal .modal-agent-header {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary, #111827);
  margin-bottom: 8px;
  padding-left: 8px;
  border-left: 3px solid var(--color-primary, #3b82f6);
}

.invocation-log-modal .modal-invocation-item {
  padding: 12px;
  background: var(--bg-base, #fff);
  border-radius: 6px;
  margin-bottom: 8px;
}

.invocation-log-modal .modal-invocation-meta {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

/* 折叠区块样式 */
.collapsed-content {
  margin: 0;
  font-size: 13px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.6;
  color: var(--text-primary, #111827);
}

/* Layer 分块内容 - 白色字体 */
.layer-context-block .collapsed-content {
  color: #ffffff;
}

/* 空内容显示 */
.empty-content {
  color: var(--text-secondary, #6b7280);
  font-size: 12px;
}

/* 放大按钮 */
.fullscreen-btn {
  cursor: pointer;
  padding: 4px;
  color: var(--text-secondary, #6b7280);
  border-radius: 4px;
  transition: all 0.2s;
  margin-left: auto;
}

.fullscreen-btn:hover {
  color: var(--color-primary, #3b82f6);
  background: var(--color-primary-opacity-10, #eff6ff);
}

/* 详情按钮 */
.invocation-record-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.detail-btn {
  cursor: pointer;
  padding: 4px;
  color: var(--text-secondary, #6b7280);
  border-radius: 4px;
  transition: all 0.2s;
}

.detail-btn:hover {
  color: var(--color-primary, #3b82f6);
  background: var(--color-primary-opacity-10, #eff6ff);
}

/* 深色模式适配 */
[data-theme='dark'] .invocation-log-modal .modal-agent-header {
  color: var(--text-primary);
  border-left-color: var(--color-primary);
}

[data-theme='dark'] .invocation-log-modal .modal-invocation-item {
  background: var(--bg-elevated);
}

[data-theme='dark'] .collapsed-content {
  color: var(--text-primary);
}

[data-theme='dark'] .empty-content {
  color: var(--text-secondary);
}

[data-theme='dark'] .fullscreen-btn:hover,
[data-theme='dark'] .detail-btn:hover {
  color: var(--color-primary);
  background: var(--color-primary-opacity-20);
}

/* A2A Handoff 交接信息卡片 */
.handoff-card {
  background: var(--color-primary-opacity-10, #eff6ff);
  border: 1px solid var(--color-primary-opacity-30, #bfdbfe);
  border-radius: 8px;
  margin: 8px 0;
  padding: 12px;
}

.handoff-card-header {
  display: flex;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-primary, #3b82f6);
  margin-bottom: 10px;
}

.handoff-card-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.handoff-part {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.handoff-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary, #6b7280);
}

.handoff-value {
  font-size: 12px;
  color: var(--text-primary, #111827);
  line-height: 1.5;
  white-space: pre-wrap;
}

[data-theme='dark'] .handoff-card {
  background: var(--color-primary-opacity-20, rgba(59, 130, 246, 0.2));
  border-color: var(--color-primary-opacity-40, rgba(59, 130, 246, 0.4));
}

[data-theme='dark'] .handoff-card-header {
  color: var(--color-primary);
}

[data-theme='dark'] .handoff-label {
  color: var(--text-secondary);
}

[data-theme='dark'] .handoff-value {
  color: var(--text-primary);
}

/* ========== Layer Context 分块样式 ========== */

.layer-context-block {
  margin: 8px 0;
}

.layer-context-block .ant-collapse {
  background: transparent;
  border: none;
}

.layer-context-block .ant-collapse-item {
  margin-bottom: 4px;
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: 6px;
  background: var(--bg-base, #fff);
}

.layer-context-block .ant-collapse-header {
  padding: 8px 12px !important;
  font-size: 12px;
  font-weight: 500;
  background: var(--bg-elevated, #f9fafb);
  border-radius: 6px 6px 0 0;
}

.layer-context-block .ant-collapse-content {
  padding: 0 !important;
  background: transparent;
}

.layer-context-block .ant-collapse-content-box {
  padding: 8px 12px !important;
  background: #1e293b; /* 深色背景，让白色字体可见 */
}

.layer-panel-label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-primary, #111827);
}

.layer-panel-label .anticon {
  font-size: 14px;
}

.layer-panel-size {
  font-size: 10px;
  color: var(--text-secondary, #6b7280);
  margin-left: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* 各 Layer 颜色区分 */
.layer-context-block .ant-collapse-item.layer-system {
  border-left: 3px solid #8b5cf6; /* 紫色 - System Prompt */
}

.layer-context-block .ant-collapse-item.layer-system .ant-collapse-header {
  background: #f3e8ff;
}

.layer-context-block .ant-collapse-item.layer-conversation {
  border-left: 3px solid #3b82f6; /* 蓝色 - Conversation */
}

.layer-context-block .ant-collapse-item.layer-conversation .ant-collapse-header {
  background: #eff6ff;
}

.layer-context-block .ant-collapse-item.layer-artifacts {
  border-left: 3px solid #f59e0b; /* 橙色 - Artifacts */
}

.layer-context-block .ant-collapse-item.layer-artifacts .ant-collapse-header {
  background: #fef3c7;
}

.layer-context-block .ant-collapse-item.layer-environment {
  border-left: 3px solid #22c55e; /* 绿色 - Environment */
}

.layer-context-block .ant-collapse-item.layer-environment .ant-collapse-header {
  background: #f0fdf4;
}

.layer-context-block .ant-collapse-item.layer-remaining {
  border-left: 3px solid #6b7280; /* 灰色 - 其他 */
}

.layer-context-block .ant-collapse-item.layer-remaining .ant-collapse-header {
  background: #f3f4f6;
}

/* Layer 分块深色模式 */
[data-theme='dark'] .layer-context-block .ant-collapse-item {
  border-color: var(--border-color);
  background: var(--bg-elevated);
}

[data-theme='dark'] .layer-context-block .ant-collapse-header {
  background: var(--bg-base);
  color: var(--text-primary);
}

[data-theme='dark'] .layer-panel-label {
  color: var(--text-primary);
}

[data-theme='dark'] .layer-panel-size {
  color: var(--text-secondary);
}

[data-theme='dark'] .layer-context-block .ant-collapse-item.layer-system {
  border-left-color: #a78bfa;
}

[data-theme='dark'] .layer-context-block .ant-collapse-item.layer-system .ant-collapse-header {
  background: rgba(139, 92, 246, 0.15);
}

[data-theme='dark'] .layer-context-block .ant-collapse-item.layer-conversation {
  border-left-color: #60a5fa;
}

[data-theme='dark'] .layer-context-block .ant-collapse-item.layer-conversation .ant-collapse-header {
  background: rgba(59, 130, 246, 0.15);
}

[data-theme='dark'] .layer-context-block .ant-collapse-item.layer-artifacts {
  border-left-color: #fbbf24;
}

[data-theme='dark'] .layer-context-block .ant-collapse-item.layer-artifacts .ant-collapse-header {
  background: rgba(245, 158, 11, 0.15);
}

[data-theme='dark'] .layer-context-block .ant-collapse-item.layer-environment {
  border-left-color: #4ade80;
}

[data-theme='dark'] .layer-context-block .ant-collapse-item.layer-environment .ant-collapse-header {
  background: rgba(34, 197, 94, 0.15);
}

[data-theme='dark'] .layer-context-block .ant-collapse-item.layer-remaining {
  border-left-color: #9ca3af;
}

/* ========== 全屏 Modal V2 样式（Master-Detail 布局） ========== */

.invocation-log-modal-v2 .ant-modal-content {
  padding: 0;
  max-height: 90vh;
}

.invocation-log-modal-v2 .ant-modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color, #e5e7eb);
  margin-bottom: 0;
}

.invocation-log-modal-v2 .ant-modal-body {
  padding: 0;
  height: 70vh;
  overflow: hidden;
}

/* 双栏布局 */
.log-modal-layout {
  display: flex;
  height: 100%;
  background: var(--bg-container, #fff);
}

/* 左侧列表栏 */
.log-modal-sidebar {
  width: 280px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border-color, #e5e7eb);
  background: var(--bg-elevated, #f9fafb);
  position: relative;
  z-index: 1;
}

.sidebar-header {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-bottom: 1px solid var(--border-color, #e5e7eb);
}

.sidebar-search {
  width: 100%;
  /* 确保 Input 可交互 */
}

/* 修复：.sidebar-search 和 .ant-input-affix-wrapper 是同一元素 */
.sidebar-search.ant-input-affix-wrapper {
  font-size: 12px;
  background: var(--bg-container, #fff);
}

.sidebar-search.ant-input-affix-wrapper input.ant-input {
  font-size: 12px !important;
  background: transparent !important;
}

.sidebar-search .ant-input-clear-icon {
  cursor: pointer;
}

.sidebar-search .ant-input-prefix {
  color: var(--text-secondary, #9ca3af);
}

.sidebar-filter {
  width: 100%;
  font-size: 11px;
}

.sidebar-filter .ant-segmented-item {
  padding: 4px 8px;
}

/* 列表区域 */
.sidebar-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
  margin-bottom: 4px;
}

.sidebar-item:hover {
  background: var(--bg-base, #fff);
  border-color: var(--border-color, #e5e7eb);
}

.sidebar-item.selected {
  background: var(--color-primary-opacity-10, #eff6ff);
  border-color: var(--color-primary, #3b82f6);
}

.sidebar-item-status {
  flex-shrink: 0;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.status-dot.running {
  background: #3b82f6;
  animation: pulse-blue 1.5s infinite;
}

.status-dot.streaming {
  background: #22c55e;
  animation: pulse-green 1s infinite;
}

.status-dot.completed {
  background: #22c55e;
}

.status-dot.failed {
  background: #ef4444;
}

.status-dot.cancelled,
.status-dot.interrupted {
  background: #f59e0b;
}

.status-dot.pending {
  background: #d1d5db;
}

.sidebar-item-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-item-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary, #111827);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-item-meta {
  font-size: 10px;
  color: var(--text-secondary, #6b7280);
  display: flex;
  gap: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.sidebar-item-tokens {
  font-size: 10px;
  color: var(--text-secondary, #6b7280);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.sidebar-footer {
  padding: 8px 12px;
  border-top: 1px solid var(--border-color, #e5e7eb);
  font-size: 11px;
  color: var(--text-secondary, #6b7280);
  text-align: center;
}

/* 右侧详情面板 */
.detail-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 16px;
  gap: 16px;
}

.detail-panel-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary, #6b7280);
}

/* 元信息区 */
.detail-meta-section {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color, #e5e7eb);
}

.detail-meta-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.detail-agent-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary, #111827);
}

.detail-token-row {
  display: flex;
  gap: 12px;
  margin-top: 8px;
  font-size: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.token-in {
  color: #3b82f6;
}

.token-out {
  color: #22c55e;
}

.token-cost {
  color: #f59e0b;
}

/* 内容区域 */
.detail-content-section {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.detail-actions-bar {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.action-btn {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 4px;
  border: 1px solid var(--border-color, #e5e7eb);
  background: var(--bg-base, #fff);
  color: var(--text-secondary, #6b7280);
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 4px;
}

.action-btn:hover {
  background: var(--bg-elevated, #f9fafb);
  color: var(--text-primary, #111827);
}

.action-btn.copied {
  color: #22c55e;
}

/* Layer 卡片容器 */
.layer-cards-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Layer 卡片 */
.layer-card {
  border-radius: 6px;
  border: 1px solid var(--border-color, #e5e7eb);
  overflow: hidden;
}

.layer-card.layer-purple {
  border-left: 3px solid #8b5cf6;
}

.layer-card.layer-blue {
  border-left: 3px solid #3b82f6;
}

.layer-card.layer-orange {
  border-left: 3px solid #f59e0b;
}

.layer-card.layer-green {
  border-left: 3px solid #22c55e;
}

.layer-card.layer-gray {
  border-left: 3px solid #6b7280;
}

.layer-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--bg-elevated, #f9fafb);
  cursor: pointer;
  transition: background 0.15s ease;
}

.layer-card-header:hover {
  background: var(--bg-base, #fff);
}

.layer-card.layer-purple .layer-card-header {
  background: #f3e8ff;
}

.layer-card.layer-blue .layer-card-header {
  background: #eff6ff;
}

.layer-card.layer-orange .layer-card-header {
  background: #fef3c7;
}

.layer-card.layer-green .layer-card-header {
  background: #f0fdf4;
}

.layer-card.layer-gray .layer-card-header {
  background: #f3f4f6;
}

.layer-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary, #111827);
}

.layer-card-title .anticon {
  font-size: 14px;
}

.layer-card-size {
  font-size: 10px;
  color: var(--text-secondary, #6b7280);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.layer-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.layer-copy-btn {
  padding: 4px;
  cursor: pointer;
  color: var(--text-secondary, #6b7280);
  border-radius: 4px;
  transition: all 0.15s ease;
}

.layer-copy-btn:hover {
  color: #22c55e;
  background: #f0fdf4;
}

.layer-copy-btn.copied {
  color: #22c55e;
}

.layer-expand-icon {
  font-size: 10px;
  color: var(--text-secondary, #6b7280);
  transition: transform 0.2s ease;
}

.layer-expand-icon.expanded {
  transform: rotate(90deg);
}

/* Layer 内容区 */
.layer-card-content {
  padding: 12px;
  background: #1e293b;
  max-height: 300px;
  overflow-y: auto;
}

.layer-card-content pre {
  margin: 0;
  font-size: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color: #e2e8f0;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.6;
}

/* 简单内容块 */
.simple-content-block {
  border-radius: 6px;
  border: 1px solid var(--border-color, #e5e7eb);
  background: #1e293b;
  max-height: 500px;
  overflow-y: auto;
}

.simple-content-block .content-pre {
  padding: 12px;
  margin: 0;
  font-size: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color: #e2e8f0;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.6;
}

.empty-content {
  color: var(--text-secondary, #6b7280);
  font-size: 12px;
  text-align: center;
  padding: 24px;
}

/* ========== 深色模式适配 ========== */

[data-theme='dark'] .invocation-log-modal-v2 .ant-modal-header {
  border-bottom-color: var(--border-color);
  background: var(--bg-container);
}

[data-theme='dark'] .invocation-log-modal-v2 .ant-modal-body {
  background: var(--bg-container);
}

[data-theme='dark'] .log-modal-sidebar {
  background: var(--bg-elevated);
  border-right-color: var(--border-color);
}

[data-theme='dark'] .sidebar-header {
  border-bottom-color: var(--border-color);
}

[data-theme='dark'] .sidebar-item:hover {
  background: var(--bg-base);
  border-color: var(--border-color);
}

[data-theme='dark'] .sidebar-item.selected {
  background: var(--color-primary-opacity-20);
  border-color: var(--color-primary);
}

[data-theme='dark'] .sidebar-item-name {
  color: var(--text-primary);
}

[data-theme='dark'] .sidebar-item-meta,
[data-theme='dark'] .sidebar-item-tokens,
[data-theme='dark'] .sidebar-footer {
  color: var(--text-secondary);
}

[data-theme='dark'] .detail-meta-section {
  border-bottom-color: var(--border-color);
}

[data-theme='dark'] .detail-agent-name {
  color: var(--text-primary);
}

[data-theme='dark'] .detail-actions-bar .action-btn {
  background: var(--bg-elevated);
  border-color: var(--border-color);
  color: var(--text-secondary);
}

[data-theme='dark'] .detail-actions-bar .action-btn:hover {
  background: var(--bg-base);
  color: var(--text-primary);
}

[data-theme='dark'] .layer-card {
  border-color: var(--border-color);
  background: var(--bg-elevated);
}

[data-theme='dark'] .layer-card-header {
  background: var(--bg-base);
}

[data-theme='dark'] .layer-card.layer-purple .layer-card-header {
  background: rgba(139, 92, 246, 0.15);
}

[data-theme='dark'] .layer-card.layer-blue .layer-card-header {
  background: rgba(59, 130, 246, 0.15);
}

[data-theme='dark'] .layer-card.layer-orange .layer-card-header {
  background: rgba(245, 158, 11, 0.15);
}

[data-theme='dark'] .layer-card.layer-green .layer-card-header {
  background: rgba(34, 197, 94, 0.15);
}

[data-theme='dark'] .layer-card.layer-gray .layer-card-header {
  background: var(--bg-base);
}

[data-theme='dark'] .layer-card.layer-purple {
  border-left-color: #a78bfa;
}

[data-theme='dark'] .layer-card.layer-blue {
  border-left-color: #60a5fa;
}

[data-theme='dark'] .layer-card.layer-orange {
  border-left-color: #fbbf24;
}

[data-theme='dark'] .layer-card.layer-green {
  border-left-color: #4ade80;
}

[data-theme='dark'] .layer-card.layer-gray {
  border-left-color: #9ca3af;
}

[data-theme='dark'] .layer-card-title,
[data-theme='dark'] .layer-card-size {
  color: var(--text-primary);
}

[data-theme='dark'] .layer-copy-btn:hover {
  background: rgba(34, 197, 94, 0.2);
}

[data-theme='dark'] .simple-content-block {
  border-color: var(--border-color);
}

[data-theme='dark'] .sidebar-footer {
  border-top-color: var(--border-color);
}

[data-theme='dark'] .timeline-item.selected {
  background: var(--color-primary-opacity-20);
  border-color: var(--color-primary);
}
