/* ==========================================================================
   Agents / 小轩问问 —— 聊天页样式（P0 骨架）
   复用 style.css 的设计令牌（--brand / --bg-* / --text-* / --r-* / --shadow-*），
   不引入新的设计语言；仅补 .card / .btn 未覆盖的聊天专属结构。
   ========================================================================== */

.agent-chat-card {
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--header-h) - 88px);
  min-height: 420px;
  padding: 0;
  overflow: hidden;
}

/* ---------- Header ---------- */
.agent-chat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
  flex-shrink: 0;
}

.agent-chat-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-1);
}

.agent-chat-state {
  font-size: 12px;
  color: var(--text-3);
  padding: 2px 8px;
  border-radius: var(--r-sm);
  background: var(--bg-base);
}

/* ---------- Message list ---------- */
.agent-chat-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 18px;
  background: var(--bg-base);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.agent-msg {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  max-width: 100%;
}

.agent-msg-user {
  flex-direction: row-reverse;
}

.agent-avatar {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  background: var(--brand);
}

.agent-msg-user .agent-avatar {
  background: var(--blue);
}

.agent-bubble {
  max-width: 76%;
  padding: 10px 14px;
  border-radius: var(--r-lg);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
}

.agent-msg-user .agent-bubble {
  background: var(--brand-light);
  border-color: var(--brand-soft);
}

.agent-bubble-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
  margin-bottom: 4px;
}

.agent-bubble-text {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-1);
  white-space: pre-wrap;
  word-break: break-word;
}

/* ---------- Empty / not-configured state ---------- */
.agent-empty {
  margin: auto;
  text-align: center;
  padding: 28px 16px;
}

.agent-empty-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 12px;
  color: var(--text-3);
}

.agent-empty-icon svg {
  width: 100%;
  height: 100%;
}

.agent-empty-icon.is-error {
  color: var(--red);
}

.agent-empty-text {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.6;
}

/* ---------- Input area ---------- */
.agent-chat-input {
  flex-shrink: 0;
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  background: var(--bg-surface);
}

.agent-chat-textarea {
  width: 100%;
  min-height: 62px;
  max-height: 180px;
  resize: none;
  line-height: 1.6;
  font-family: var(--font-sans);
  overflow-y: auto;
}

.agent-chat-textarea:disabled {
  background: var(--bg-hover);
  color: var(--text-3);
  cursor: not-allowed;
}

.agent-chat-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}

.agent-chat-counter {
  margin-right: auto;
  font-size: 12px;
  color: var(--text-3);
  font-family: var(--font-mono);
}

/* ---------- Footer disclaimer ---------- */
.agent-chat-footer {
  flex-shrink: 0;
  padding: 8px 18px 12px;
  text-align: center;
  font-size: 12px;
  color: var(--text-3);
  background: var(--bg-surface);
  border-top: 1px solid var(--border-light);
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .agent-chat-card {
    height: calc(100vh - var(--header-h) - 56px);
  }
  .agent-bubble {
    max-width: 86%;
  }
  .agent-chat-body {
    padding: 14px;
  }
}
