/* 自动化补充样式：独立文件，避免改动主样式表。 */

.automation-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  max-width: 760px;
  margin-top: 14px;
  padding: 13px 15px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 16px;
  background: rgba(17, 26, 44, 0.62);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(16px) saturate(135%);
  -webkit-backdrop-filter: blur(16px) saturate(135%);
}

.automation-strip p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.automation-strip strong {
  color: var(--text);
}

.automation-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex: 0 0 auto;
}

.check-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}

.check-chip input {
  accent-color: var(--amber);
}

.task-card.task-archived {
  opacity: 0.68;
  border-style: dashed;
}

.task-archived-badge {
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--dim);
  font-size: 10px;
  line-height: 1.5;
  white-space: nowrap;
}

.task-handoff {
  display: -webkit-box;
  overflow: hidden;
  margin: 6px 0 0;
  color: var(--dim);
  font-size: 11px;
  line-height: 1.55;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.quick-options-head .btn {
  margin-left: auto;
}

@media (max-width: 640px) {
  .automation-strip {
    align-items: flex-start;
    flex-direction: column;
  }

  .automation-actions {
    width: 100%;
  }

  .automation-actions .btn {
    flex: 1 1 auto;
  }
}

.task-session-btn {
  flex: 0 0 auto;
  border: 1px solid rgba(255, 206, 106, 0.34);
  background: rgba(255, 206, 106, 0.08);
  color: #ffce6a;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 10px;
  line-height: 1.35;
  white-space: nowrap;
  cursor: pointer;
  margin-left: auto;
  margin-right: 6px;
  transition:
    border-color 240ms var(--ease-out),
    background 240ms var(--ease-out),
    transform 300ms var(--spring);
}

@media (hover: hover) {
  .task-session-btn:hover {
    border-color: #ffce6a;
    background: rgba(255, 206, 106, 0.16);
  }
}

.task-session-btn:active {
  transform: scale(0.94);
  background: rgba(255, 206, 106, 0.2);
}

.task-session-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 4px;
  margin-left: auto;
  margin-right: 6px;
}

.task-session-btn {
  margin-left: 0;
  margin-right: 0;
}

.activity-modal {
  width: min(1000px, 95vw);
}

.activity-card {
  width: 100%;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.activity-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: -4px 0 12px;
}

.activity-chip {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(154, 167, 199, 0.24);
  border-radius: 999px;
  padding: 3px 9px;
  color: #9aa7c7;
  background: rgba(154, 167, 199, 0.06);
  font-size: 10px;
  line-height: 1.3;
}

.activity-chip.run { color: #84dc8a; border-color: rgba(132, 220, 138, 0.34); background: rgba(132, 220, 138, 0.08); }
.activity-chip.ok { color: #84dc8a; border-color: rgba(132, 220, 138, 0.34); background: rgba(132, 220, 138, 0.08); }
.activity-chip.bad { color: #ff7f92; border-color: rgba(255, 127, 146, 0.34); background: rgba(255, 127, 146, 0.08); }
.activity-chip.wait { color: #ffce6a; border-color: rgba(255, 206, 106, 0.34); background: rgba(255, 206, 106, 0.08); }

.activity-timeline {
  flex: 1;
  min-height: 300px;
  max-height: 60vh;
  overflow: auto;
  padding: 10px;
  border: 1px solid rgba(154, 167, 199, 0.16);
  border-radius: 14px;
  background: rgba(4, 9, 18, 0.52);
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.activity-item {
  margin: 0 0 10px;
  padding: 11px 13px;
  border: 1px solid rgba(154, 167, 199, 0.14);
  border-left: 3px solid #62709a;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.015);
  transition: border-color 240ms var(--ease-out), background 240ms var(--ease-out);
}

.activity-item:last-child { margin-bottom: 0; }
.activity-user { border-left-color: #8fb0ff; }
.activity-assistant { border-left-color: #ffce6a; }

.activity-item > header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-bottom: 8px;
  color: #7f8db3;
  font-size: 10px;
}

.activity-item > header strong { color: #c8d0e8; font-size: 11px; }

.activity-item pre,
.activity-tool pre {
  margin: 6px 0 0;
  padding: 10px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.26);
  color: #c8d0e8;
  font: 11px/1.55 "Cascadia Code", Consolas, monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 260px;
  overflow: auto;
  overscroll-behavior: contain;
}

.activity-text { max-height: 340px; }

.activity-reasoning > summary,
.activity-tool > summary,
.activity-user details > summary {
  cursor: pointer;
  color: #9aa7c7;
  font-size: 11px;
  line-height: 1.6;
  user-select: none;
}

.activity-reasoning > summary:hover,
.activity-tool > summary:hover,
.activity-user details > summary:hover { color: #ffce6a; }

.activity-tool {
  margin: 7px 0;
  padding: 8px 10px;
  border: 1px solid rgba(154, 167, 199, 0.14);
  border-radius: 10px;
  background: rgba(143, 176, 255, 0.035);
}

.activity-tool > summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.activity-tool > summary strong { color: #8fb0ff; font-size: 11px; }
.activity-tool > summary span:last-child { color: #62709a; font-size: 9px; }

.activity-tool-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #7f8db3;
  flex: 0 0 auto;
}

.activity-tool.ok .activity-tool-dot { background: #84dc8a; }
.activity-tool.run .activity-tool-dot { background: #ffce6a; }
.activity-tool.bad .activity-tool-dot { background: #ff7f92; }

.activity-tool-label {
  margin-top: 7px;
  color: #62709a;
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.activity-idle {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 8px 0;
  color: #62709a;
  font-size: 10px;
}

.activity-idle.ok { color: #84dc8a; }
.activity-idle.bad { color: #ff7f92; }
.activity-idle.ok .activity-tool-dot { background: #84dc8a; }
.activity-idle.bad .activity-tool-dot { background: #ff7f92; }

.activity-error {
  margin: 7px 0;
  padding: 9px 11px;
  border: 1px solid rgba(255, 127, 146, 0.3);
  border-radius: 10px;
  background: rgba(255, 127, 146, 0.07);
  color: #ff9fae;
  font-size: 11px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.activity-foot {
  margin-top: 7px;
  color: #62709a;
  font-size: 9px;
}

.activity-empty {
  padding: 28px 14px;
  color: #7f8db3;
  text-align: center;
  font-size: 12px;
}

.activity-empty.bad { color: #ff7f92; }

@media (max-width: 640px) {
  .activity-modal {
    width: 100vw;
    max-width: 100vw;
  }

  .activity-card {
    max-height: 92dvh;
    padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
  }

  .activity-timeline {
    min-height: 240px;
    max-height: 54vh;
  }

  .activity-item {
    padding: 9px;
  }
}
