/* === 聊天运行状态与输入区 === */
.chat-status-panel {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.assistant-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(26, 77, 84, 0.08);
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
}
.assistant-status::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.9;
}
.assistant-status.loading {
  color: #b7791f;
  background: rgba(194, 142, 92, 0.16);
}
.assistant-status.online {
  color: #17603a;
  background: rgba(23, 96, 58, 0.12);
}
.assistant-status.error {
  color: #b42318;
  background: rgba(180, 35, 24, 0.12);
}
.endpoint-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  color: var(--text-light);
  font-size: 12px;
  border: 1px solid rgba(26, 77, 84, 0.08);
}
.endpoint-pill.warning {
  color: #b7791f;
  border-color: rgba(194, 142, 92, 0.25);
  background: rgba(194, 142, 92, 0.12);
}
.endpoint-pill.error {
  color: #b42318;
  border-color: rgba(180, 35, 24, 0.25);
  background: rgba(180, 35, 24, 0.1);
}
.service-banner {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 32px;
  background: rgba(255, 249, 240, 0.86);
  border-bottom: 1px solid rgba(194, 142, 92, 0.16);
}
.service-banner.show {
  display: flex;
}
.service-banner.loading {
  background: rgba(194, 142, 92, 0.1);
  border-bottom-color: rgba(194, 142, 92, 0.22);
}
.service-banner.error {
  background: rgba(180, 35, 24, 0.08);
  border-bottom-color: rgba(180, 35, 24, 0.18);
}
.service-banner.success {
  background: rgba(23, 96, 58, 0.08);
  border-bottom-color: rgba(23, 96, 58, 0.16);
}
.service-banner-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.service-banner-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.75);
  color: inherit;
  flex-shrink: 0;
}
.service-banner-copy {
  min-width: 0;
}
.service-banner-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-serif);
}
.service-banner-text {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 2px;
}
.service-banner-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.service-action-btn {
  border: none;
  border-radius: 999px;
  padding: 9px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  color: #fff;
  background: var(--primary);
}
.service-action-btn.secondary {
  color: var(--primary);
  background: rgba(26, 77, 84, 0.08);
}
.service-banner-meta {
  font-size: 11px;
  color: var(--text-light);
}

.chat-input-wrapper {
  display: flex;
  align-items: flex-end;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(26, 77, 84, 0.1);
  border-radius: 16px;
  padding: 8px 8px 8px 16px;
  box-shadow: 0 12px 24px rgba(19, 52, 57, 0.06);
  transition: border 0.3s, box-shadow 0.3s, transform 0.3s;
}
.chat-input-wrapper:focus-within {
  border-color: var(--primary);
  box-shadow: 0 16px 28px rgba(26, 77, 84, 0.1);
  transform: translateY(-1px);
}
.chat-input {
  flex: 1;
  border: none;
  padding: 8px 8px 8px 0;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.45;
  min-height: 40px;
  resize: none;
  max-height: 120px;
  background: transparent;
}
.chat-input:focus {
  outline: none;
}
.send-btn {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #1b4c55, #275b65);
  color: var(--accent);
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 20px rgba(26, 77, 84, 0.16);
}
.send-btn.loading i {
  animation: sendSpin 0.9s linear infinite;
}
.send-btn:hover {
  background: var(--primary-light);
  color: #fff;
}
.send-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
}
.chat-input:disabled {
  cursor: not-allowed;
  color: #98a2b3;
}
.chat-input-wrapper.disabled {
  background: rgba(244, 244, 245, 0.94);
  border-color: rgba(152, 162, 179, 0.22);
}
.chat-meta {
  margin-top: 12px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--text-light);
  font-size: 12px;
}
.chat-meta strong {
  color: var(--primary);
  font-weight: 600;
}
@keyframes sendSpin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.typing-dots {
  display: flex;
  gap: 4px;
  padding: 0;
}
.dot {
  width: 6px;
  height: 6px;
  background: var(--primary);
  border-radius: 50%;
  opacity: 0.5;
  animation: bounce 1.4s infinite ease-in-out;
}
.dot:nth-child(1) {
  animation-delay: -0.32s;
}
.dot:nth-child(2) {
  animation-delay: -0.16s;
}
@keyframes bounce {
  0%,
  80%,
  100% {
    transform: scale(0);
  }
  40% {
    transform: scale(1);
  }
}
