/* Kimi CLI 对话面板 - 智达系统风格 */
.kimi-chat-wrap {
  display: flex;
  flex-direction: column;
  border: 1px solid #e8e8e8;
  border-radius: 0.75rem;
  background: #fff;
  overflow: hidden;
  font-family: "Microsoft YaHei","PingFang SC",sans-serif;
  transition: all 0.3s ease;
}

.kimi-chat-wrap.fullscreen {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  border-radius: 0;
  max-height: 100vh;
}

.kimi-chat-wrap.fullscreen .kimi-chat-messages {
  max-height: none;
  flex: 1;
}

.kimi-chat-messages {
  flex: 1;
  min-height: 320px;
  max-height: 520px;
  overflow-y: auto;
  padding: 1rem;
  background: #fafafa;
}

.kimi-msg {
  margin-bottom: 0.75rem;
  display: flex;
  flex-direction: column;
}

.kimi-msg-user {
  align-self: flex-end;
  max-width: 80%;
  background: #3b82f6;
  color: #fff;
  padding: 0.625rem 0.875rem;
  border-radius: 0.75rem 0.75rem 0.125rem 0.75rem;
  font-size: 0.9375rem;
  line-height: 1.5;
  word-break: break-word;
}

.kimi-msg-ai {
  align-self: flex-start;
  max-width: 90%;
  width: 100%;
}

.kimi-msg-ai .kimi-msg-content {
  background: #fff;
  border: 1px solid #e8e8e8;
  padding: 0.75rem 1rem;
  border-radius: 0.125rem 0.75rem 0.75rem 0.75rem;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: #333;
  word-break: break-word;
}

.kimi-msg-ai .kimi-msg-content p {
  margin: 0 0 0.5rem;
}

.kimi-msg-ai .kimi-msg-content p:last-child {
  margin-bottom: 0;
}

.kimi-msg-ai .kimi-msg-content pre {
  background: #1e1e2e;
  color: #cdd6f4;
  padding: 0.75rem;
  border-radius: 0.5rem;
  overflow-x: auto;
  font-size: 0.875rem;
  line-height: 1.5;
  margin: 0.5rem 0;
}

.kimi-msg-ai .kimi-msg-content code {
  background: #f0f0f0;
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  font-size: 0.875rem;
  color: #c7254e;
}

.kimi-msg-ai .kimi-msg-content pre code {
  background: transparent;
  padding: 0;
  color: inherit;
}

.kimi-msg-ai .kimi-msg-content ul,
.kimi-msg-ai .kimi-msg-content ol {
  margin: 0.5rem 0;
  padding-left: 1.25rem;
}

.kimi-msg-ai .kimi-msg-content li {
  margin-bottom: 0.25rem;
}

.kimi-msg-ai .kimi-msg-content blockquote {
  margin: 0.5rem 0;
  padding-left: 0.75rem;
  border-left: 3px solid #ddd;
  color: #666;
}

.kimi-msg-ai .kimi-msg-content h1,
.kimi-msg-ai .kimi-msg-content h2,
.kimi-msg-ai .kimi-msg-content h3,
.kimi-msg-ai .kimi-msg-content h4 {
  margin: 0.75rem 0 0.5rem;
  font-weight: 600;
}

.kimi-think {
  background: #f5f5f7;
  border: 1px solid #e8e8e8;
  border-radius: 0.5rem;
  margin-bottom: 0.5rem;
  overflow: hidden;
}

.kimi-think-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  font-size: 0.875rem;
  color: #666;
  user-select: none;
}

.kimi-think-hd:hover {
  background: #eee;
}

.kimi-think-bd {
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  color: #888;
  line-height: 1.6;
  border-top: 1px solid #e8e8e8;
}

.kimi-divider {
  height: 1px;
  background: #e8e8e8;
  margin: 0.5rem 0;
}

.kimi-input-area {
  padding: 0.875rem 1rem;
  border-top: 1px solid #e8e8e8;
  background: #f8f9fa;
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
}

.kimi-input-area textarea {
  flex: 1;
  border: 1px solid #d0d7de;
  border-radius: 0.625rem;
  padding: 0.75rem 1rem;
  font-size: 0.9375rem;
  resize: none;
  outline: none;
  min-height: 2.75rem;
  max-height: 7.5rem;
  font-family: inherit;
  line-height: 1.5;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.kimi-input-area textarea:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59,130,246,0.12);
}

.kimi-input-area textarea::placeholder {
  color: #aaa;
}

.kimi-btn-icon {
  background: #fff;
  color: #666;
  border: 1px solid #d0d7de;
  border-radius: 0.625rem;
  width: 2.75rem;
  height: 2.75rem;
  cursor: pointer;
  font-size: 0.9375rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.kimi-btn-icon:hover {
  background: #f0f0f0;
  border-color: #bbb;
  color: #333;
}

.kimi-btn-send {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff;
  border: none;
  border-radius: 0.625rem;
  width: 2.75rem;
  height: 2.75rem;
  cursor: pointer;
  font-size: 1rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(59,130,246,0.3);
  transition: all 0.2s;
}

.kimi-btn-send:hover:not(:disabled) {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  box-shadow: 0 4px 10px rgba(59,130,246,0.4);
  transform: translateY(-1px);
}

.kimi-btn-send:disabled {
  background: #ccc;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.kimi-loading {
  display: flex;
  gap: 0.25rem;
  padding: 0.5rem 0;
}

.kimi-loading-dot {
  width: 0.5rem;
  height: 0.5rem;
  background: #ccc;
  border-radius: 50%;
  animation: kimi-bounce 1.4s infinite ease-in-out both;
}

.kimi-loading-dot:nth-child(1) { animation-delay: -0.32s; }
.kimi-loading-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes kimi-bounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

.kimi-toast {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  padding: 0.625rem 1rem;
  border-radius: 0.5rem;
  color: #fff;
  font-size: 0.875rem;
  z-index: 10000;
  animation: kimi-slide 0.3s;
}

@keyframes kimi-slide {
  from { transform: translateX(100px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.kimi-toast-info { background: #3b82f6; }
.kimi-toast-success { background: #10b981; }
.kimi-toast-error { background: #ef4444; }
