﻿.aside-menu .helper{background-color: #1575db;}
.aside-menu li.helper .helperIcon{color: white; background-color: #1575db; padding: 0; height: 60px; }
.aside-menu li.helper .helperIcon:hover{color: white; background-color: #1575db;}

.aside-menu li.helper .helperIcon img{height: 70px; position: relative; left: 50%; transform: translateX(-50%); transition: all 0.3s;}
.aside-menu li.helper:hover .helperIcon img{transform: translateX(-50%); margin-left: -10px;}

.aside-menu li.helper ul{height: 60px; background-color: #1575db; color: white; margin-right: -1px;}
.aside-menu li.helper ul li{padding: 10px 15px; display: flex; align-items: center; height: 60px;}
.aside-menu li.helper ul li a{color: white; text-decoration: none; font-weight: bold; display: block; font-size: 16px;}


.chat-container{position: fixed; height: 100vh; width: 640px; top: 0; right: -640px; transition: all 0.3s; z-index: 101; background-color: #fff; box-shadow: -6px 0 16px -8px rgba(0, 0, 0, .08), -9px 0 28px 0 rgba(0, 0, 0, .05), -12px 0 48px 16px rgba(0, 0, 0, .03);  overflow: hidden;}
.chat-container.active{right: 0;}

.chat-body{display: flex; flex-direction: column; flex-wrap: nowrap;  height: 100%; width: 100%;}

.chat-header{background: linear-gradient(90deg, #4e54c8, rgb(21, 117, 219, 1)); padding:18px 15px 18px 60px; position: relative; overflow: hidden;}
.chat-header::before{ position: absolute; content: ""; left: -5px; top:5px; width: 70px; height: 70px; background-size: contain; background-image: url(../../aihelper/image/helper_stant.png); background-repeat: no-repeat; background-position: center center;}
.chat-header h3{font-size: 18px; font-weight: bold; color: white; margin: 0; height: 26px; line-height: 26px; font-weight: 500; font-style: italic;}
.chat-header p { opacity: 0.9; font-size: 14px;}

.chat-header .closeDrawer{ position: absolute; right: 15px; top: 17px; opacity: 0.5; transition: opacity .5s ease; font-size: 20px; color: #fff; line-height: 20px; padding: 2px 5px; display: inline-block; cursor: pointer; background-color: rgba(255, 255, 255, 0); border-radius: 3px;}
.chat-header .closeDrawer:hover{ opacity: 1; background-color: rgba(255, 255, 255, .1);}

.new-session-btn {
  position: absolute;
  right: 60px;
  top: 11px;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s;
  gap: 5px;
}

.new-session-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

.status-indicator {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.2);
  padding: 5px 15px;
  border-radius: 20px;
  font-size: 14px;
}

.status-dot {
  width: 10px;
  height: 10px;
  background-color: #4ade80;
  border-radius: 50%;
  margin-right: 8px;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }

  100% {
    opacity: 1;
  }
}

.scroll-container{
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  background-color: #f0f0f0;
}

.messages-container {
  display: flex;
  flex-direction: column;
  gap: 15px;
}


/* 消息布局样式 */
.message {
  display: flex;
  margin-bottom: 20px;
}

.message.user-message {
  flex-direction: row-reverse;
}

.message-header {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: #e0e0e0;
  margin-top: 20px;
}

.message-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.message-nickname {
  font-size: 12px;
  color: #999;
  margin-bottom: 5px;
  text-align: left;
}

.message-body {
  flex: 1;
  max-width: calc(100% - 150px);
  padding:0 15px 15px;
  border-radius: 18px;
  position: relative;
  line-height: 1.5;
  animation: fadeIn 0.3s ease-out;
}

.message-content {
  background: #fff;
  padding: 12px 15px;
  border-radius: 12px;
  margin-bottom: 5px;
  word-break: break-word;
}

.user-message .message-content {
  background: #007bff;
  color: white;
}

.message-time {
  font-size: 12px;
  color: #999;
}

/* 相关问题样式 */
.related-questions {
  margin-top: 15px;
  border-top: 1px solid #e0e0e0;
  padding-top: 10px;
}

.related-questions-title {
  font-weight: bold;
  margin-bottom: 8px;
  color: #666;
  font-size: 14px;
}

.related-questions-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.related-question-item {
  padding: 8px 12px;
  background: #e3f2fd;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.2s;
  font-size: 14px;
  color: #1976d2;
}

.related-question-item:hover {
  background: #bbdefb;
}

/* 错误消息样式 */
.error-message .message-header {
  background: transparent;
}

.error-message .message-time {
  text-align: left;
}

.error-message .message-content {
  background: #ffebee;
  color: #c62828;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.user-message .message-body {
  align-self: flex-end;
  flex: inherit;
}
.user-message .message-content{
  background: linear-gradient(135deg, #4e54c8, rgb(21, 117, 219, 1));
  color: white;
  border-bottom-right-radius: 5px;
}

.user-message .message-header{
  background: linear-gradient(135deg, rgb(21, 117, 219, 1), rgb(21, 117, 219, 0.7));
}

.user-message .message-nickname {
  text-align: right;
}


.ai-message .message-body{
  align-self: flex-start;
}
.ai-message .message-content {
  color: #333;
  border-bottom-left-radius: 5px;
}

.message-time {
  font-size: 12px;
  opacity: 0.7;
  margin-top: 5px;
  text-align: right;
}

.ai-message .message-time, .error-message .message-time{
  text-align: left;
}


.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #999;
  text-align: center;
  padding: 20px;
}

.empty-state svg {
  margin-bottom: 15px;
  opacity: 0.5;
}

.input-container {
  padding: 20px;
  border-top: 1px solid #e0e0e0;
  display: flex;
  background-color: white;
}

.message-input {
  flex: 1;
  padding: 15px 20px;
  border: 1px solid #e0e0e0;
  border-radius: 30px;
  outline: none;
  font-size: 16px;
  transition: all 0.3s;
}

.message-input:focus {
  border-color: rgb(21, 117, 219, 1);
  box-shadow: 0 0 0 2px rgba(143, 148, 251, 0.2);
}
.message-input:disabled{
  background-color: #eee;
}


.send-button {
  margin-left: 10px;
  background: linear-gradient(135deg, rgb(21, 117, 219, 1), rgb(21, 117, 219, 0.7));
  color: white;
  border: none;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: all 0.3s;
}

.send-button:hover {
  transform: scale(1.05);
  box-shadow: 0 5px 15px rgba(78, 84, 200, 0.4);
}

.send-button:active {
  transform: scale(0.98);
}

.typing-indicator {
  display: none;
  align-self: flex-start;
  padding: 25px 20px;
  width: 100%;
}

.typing-dots {
  display: flex;
}

.typing-dots span {
  height: 8px;
  width: 8px;
  background-color: #bbb;
  border-radius: 50%;
  display: block;
  margin: 0 2px;
  animation: typing 1.4s infinite ease-in-out;
}

.typing-dots span:nth-child(1) {
  animation-delay: 0s;
}

.typing-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing {

  0%,
  60%,
  100% {
    transform: translateY(0);
  }

  30% {
    transform: translateY(-5px);
  }
}

/* 富文本消息样式 */
.message-content {
  word-wrap: break-word;
}

.message-content h1,
.message-content h2,
.message-content h3 {
  margin-top: 10px;
  margin-bottom: 5px;
  color: #4e54c8;
}

.message-content p {
  margin-bottom: 10px;
}

.message-content ul,
.message-content ol {
  margin-left: 20px;
  margin-bottom: 10px;
  padding: 0;
}

.message-content ul {
  list-style-type: disc;
}

.message-content li {
  margin-bottom: 5px;
}

.message-content code {
  background-color: #f1f3f4;
  padding: 3px 10px;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 0.9em;
  display: block;
  white-space: pre-wrap;
}

.message-content pre {
  background-color: #f8f9fa;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 12px;
  overflow-x: auto;
  margin: 10px 0;
}

.message-content pre code {
  background: none;
  padding: 0;
}

.message-content blockquote {
  border-left: 4px solid #8f94fb;
  padding-left: 15px;
  margin: 15px 0;
  color: #666;
  font-style: italic;
}

.message-content table {
  border-collapse: collapse;
  width: 100%;
  margin: 10px 0;
}

.message-content th,
.message-content td {
  border: 1px solid #ddd;
  padding: 8px;
  text-align: left;
}

.message-content th {
  background-color: #f2f2f2;
  font-weight: bold;
}

.message-content a {
  color: #4e54c8;
  text-decoration: none;
}

.message-content a:hover {
  text-decoration: underline;
}

.message-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 10px 0;
}

/* 打字机光标效果 */
.typing-cursor {
  display: inline-block;
  width: 2px;
  height: 1.2em;
  background-color: #4e54c8;
  margin-left: 2px;
  animation: blink 1s infinite;
  vertical-align: middle;
}

@keyframes blink {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0;
  }
}

/* 响应式设计 */
@media (max-width: 640px) {
  .chat-container {
    width: 100%;
    border-radius: 10px;
  }

  .message {
    max-width: 90%;
  }

  .chat-header h1 {
    font-size: 20px;
  }
}