/* 全局样式重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
  background-color: #f8f9fa;
  color: #333;
  overflow: hidden;
}

#app {
  display: flex;
  height: 100vh;
  width: 100vw;
}

/* 左侧边栏样式 */
.sidebar {
  width: 280px;
  background-color: #f1f3f4;
  border-right: 1px solid #e0e0e0;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.new-chat-btn {
  background: white;
  border: 1px solid #dadce0;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 500;
  color: #333;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.new-chat-btn:hover {
  background-color: #f8f9fa;
  border-color: #c4c7c5;
}

.plus-icon {
  font-size: 18px;
  font-weight: bold;
}

.chat-history {
  flex: 1;
}

/* 聊天历史项样式 */
.chat-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 15px;
  margin: 5px 0;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s;
  position: relative;
}

.chat-item:hover {
  background-color: rgba(0, 123, 255, 0.1);
}

.chat-item.active {
  background-color: rgba(0, 123, 255, 0.2);
}

.chat-title {
  flex: 1;
  font-size: 14px;
  color: #333;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 删除按钮样式 */
.delete-chat-btn {
  background: none;
  border: none;
  color: #070707;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  opacity: 0;
  transition: opacity 0.2s, background-color 0.2s;
}

.chat-item:hover .delete-chat-btn {
  opacity: 1;
}

.delete-chat-btn:hover {
  background-color: rgba(220, 53, 69, 0.1);
}

/* 主内容区域样式 */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  background-color: white;
}

/* 顶部标题栏样式 */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid #e0e0e0;
  background-color: white;
}

.ai-info {
  display: flex;
  align-items: center;
}



.ai-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ai-name {
  font-size: 20px;
  font-weight: 600;
  color: #333;
  display: flex;
  align-items: center;
  gap: 8px;
}

.beta-badge {
  background-color: #4285f4;
  color: white;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
}

.ai-status {
  font-size: 13px;
  color: #5f6368;
}

.reset-chat-btn {
  background: white;
  border: 1px solid #dadce0;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 14px;
  color: #333;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.reset-chat-btn:hover {
  background-color: #f8f9fa;
  border-color: #c4c7c5;
}

.reset-icon {
  font-size: 16px;
}

/* 聊天内容区域样式 */
.chat-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 20px;
  overflow-y: auto;
  background-color: white;
}

/* 当有聊天消息时，移除居中对齐 */
.chat-content:not(:only-child) {
  align-items: stretch;
  justify-content: flex-start;
}

/* 消息样式 - 根据图片重新设计 */
.message {
  margin: 20px 0;
  display: flex;
  align-items: flex-start;
}

.user-message {
  justify-content: flex-end;
}

.ai-message {
  justify-content: flex-start;
}

.message-content {
  display: flex;
  flex-direction: column;
  max-width: 70%;
  position: relative;
}

.user-message .message-content {
  align-items: flex-end;
}

.ai-message .message-content {
  align-items: flex-start;
}

.message-text {
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.5;
  word-wrap: break-word;
  position: relative;
  max-width: 100%;
}

.user-message .message-text {
  background-color: #1a73e8; /* 深蓝色，如图片所示 */
  color: white;
  border-bottom-right-radius: 4px;
}

.ai-message .message-text {
  background-color: #f1f3f4; /* 浅灰色，如图片所示 */
  color: #333;
  border-bottom-left-radius: 4px;
}

.message-timestamp {
  font-size: 12px;
  color: #9aa0a6;
  margin-top: 4px;
  margin-bottom: 8px;
}

.message-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 4px;
}

.action-icon {
  width: 20px;
  height: 20px;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s ease, color 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9aa0a6;
}

.action-icon:hover {
  opacity: 1;
}

.action-icon svg {
  width: 16px;
  height: 16px;
}

.user-message .message-actions {
  justify-content: flex-end;
}

.ai-message .message-actions {
  justify-content: flex-start;
}

/* 欢迎消息样式 */
.welcome-message {
  text-align: center;
  padding: 40px 20px;
  color: #666;
}

.welcome-avatar {
  margin-bottom: 20px;
  position: relative;
}

.large-ai-avatar {
  width: 60px;
  height: 60px;
  background-color: #28a745;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  color: white;
  margin: 0 auto;
}

.welcome-speech-bubble {
  position: absolute;
  top: -10px;
  right: -10px;
  font-size: 20px;
}

.welcome-text {
  font-size: 16px;
  line-height: 1.5;
  margin: 0;
}

/* 聊天内容容器 */
.chat-content {
  overflow-y: auto;
  padding: 20px;
  flex: 1;
}

.chat-content::-webkit-scrollbar {
  width: 6px;
}

.chat-content::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.chat-content::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

.chat-content::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* 加载状态样式 */
.loading-spinner {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* 打字指示器 */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
}

.typing-indicator span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #6c757d;
  animation: typing 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing {
  0%, 80%, 100% {
    transform: scale(0.8);
    opacity: 0.5;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* 底部输入栏样式 */
.input-bar {
  padding: 20px 24px;
  border-top: 1px solid #e0e0e0;
  background-color: white;
  display: flex;
  align-items: center;
  gap: 16px;
}

.input-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-input {
  width: 100%;
  padding: 16px;
  border: 1px solid #dadce0;
  border-radius: 8px;
  font-size: 16px;
  outline: none;
  transition: border-color 0.2s ease;
}

.chat-input:focus {
  border-color: #4285f4;
}

.response-length-section {
  display: flex;
  align-items: center;
  gap: 8px;
}

.response-length-section label {
  font-size: 14px;
  color: #5f6368;
  white-space: nowrap;
}

.length-selector {
  padding: 8px 12px;
  border: 1px solid #dadce0;
  border-radius: 6px;
  font-size: 14px;
  background-color: white;
  outline: none;
  cursor: pointer;
}

.length-selector:focus {
  border-color: #4285f4;
}

/* 操作按钮样式 */
.action-buttons {
  display: flex;
  gap: 12px;
  align-items: center;
}

.action-btn {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background-color: transparent;
  color: #5f6368;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.action-btn:hover {
  background-color: #f1f3f4;
}

.action-btn svg {
  width: 20px;
  height: 20px;
}

.camera-btn {
  color: #5f6368;
}

.gallery-btn {
  color: #5f6368;
}

.send-btn {
  background-color: #000;
  color: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.send-btn:hover {
  background-color: #333;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.send-btn svg {
  color: white;
}

/* 右侧浮动按钮样式 */
.floating-btn {
  position: fixed;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  background-color: #4285f4;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 18px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 1000;
}

.floating-btn:hover {
  background-color: #3367d6;
  transform: translateY(-50%) scale(1.05);
}

/* 删除确认弹窗样式 */
.delete-confirm-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.2s ease-out;
}

.modal-content {
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  max-width: 400px;
  width: 90%;
  animation: slideIn 0.3s ease-out;
}

.modal-header {
  padding: 20px 20px 0 20px;
  border-bottom: 1px solid #eee;
}

.modal-header h3 {
  margin: 0;
  color: #333;
  font-size: 18px;
}

.modal-body {
  padding: 20px;
}

.modal-body p {
  margin: 0 0 10px 0;
  color: #666;
  line-height: 1.5;
}

.modal-body .warning {
  color: #dc3545;
  font-weight: 500;
  font-size: 14px;
}

.modal-footer {
  padding: 0 20px 20px 20px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.btn-cancel, .btn-delete {
  padding: 8px 20px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.2s;
}

.btn-cancel {
  background-color: #6c757d;
  color: white;
}

.btn-cancel:hover {
  background-color: #5a6268;
}

.btn-delete {
  background-color: #dc3545;
  color: white;
}

.btn-delete:hover {
  background-color: #c82333;
}

/* 动画效果 */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* 响应式设计 */
@media (max-width: 768px) {
  .sidebar {
    width: 240px;
    padding: 16px;
  }
  
  .header {
    padding: 16px 20px;
  }
  
  .ai-name {
    font-size: 18px;
  }
  
  .input-bar {
    padding: 16px 20px;
  }
  
  .floating-btn {
    right: 16px;
    width: 40px;
    height: 40px;
    font-size: 16px;
  }

  .modal-content {
    width: 95%;
    margin: 20px;
  }
  
  .modal-footer {
    flex-direction: column;
  }
  
  .btn-cancel, .btn-delete {
    width: 100%;
    margin: 5px 0;
  }

  .message-content {
    max-width: 85%;
  }
  
  .message-text {
    font-size: 13px;
    padding: 10px 14px;
  }
  
  .message-actions {
    gap: 8px;
  }
  
  .action-icon {
    width: 18px;
    height: 18px;
  }
  
  .action-icon svg {
    width: 14px;
    height: 14px;
  }
}

@media (max-width: 480px) {
  .sidebar {
    display: none;
  }
  
  .header {
    padding: 12px 16px;
  }
  
  .chat-content {
    padding: 20px;
  }
  
  .input-bar {
    padding: 12px 16px;
  }
  
  .action-buttons {
    gap: 4px;
  }
  
  .action-btn {
    width: 40px;
    height: 40px;
    font-size: 18px;
  }
} 