/* 北京语言大学AI助手样式 - 匹配eblcu.com风格 */

/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* 主色调 - 蓝色系 */
  --primary-blue: #3B82F6;
  --primary-blue-dark: #2563EB;
  --primary-blue-light: #60A5FA;
  
  /* 辅助色 */
  --red-accent: #EF4444;
  --red-accent-light: #F87171;
  
  /* 背景色 */
  --bg-white: #ffffff;
  --bg-blue-50: #EFF6FF;
  --bg-blue-100: #DBEAFE;
  --bg-blue-200: #BFDBFE;
  --bg-gray-50: #F9FAFB;
  
  /* 文字色 */
  --text-blue-900: #1E3A8A;
  --text-gray-600: #4B5563;
  --text-gray-800: #1F2937;
  --text-gray-400: #9CA3AF;
  
  /* 边框色 */
  --border-blue-100: #DBEAFE;
  --border-blue-200: #BFDBFE;
  
  /* 字体 */
  --font-family: 'PingFang SC', 'Microsoft YaHei', 'Hiragino Sans GB', 
                 -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  
  /* 圆角 */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  
  /* 阴影 */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

body {
  font-family: var(--font-family);
  background: linear-gradient(135deg, var(--bg-blue-50) 0%, var(--bg-white) 50%, var(--bg-blue-50) 100%);
  color: var(--text-gray-800);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* App Container */
.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.header {
  background: var(--bg-white);
  border-bottom: 1px solid var(--border-blue-100);
  box-shadow: var(--shadow-sm);
}

.header-content {
  max-width: 896px;
  margin: 0 auto;
  padding: 24px;
}

.header-top {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

/* Assistant Icon */
.assistant-icon {
  flex-shrink: 0;
  width: 200px;
  height: 64px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #03469f 0%, #03469f 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.assistant-icon::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 0%, rgba(255,255,255,0.2) 50%, rgba(255,255,255,0.3) 100%);
}

.assistant-icon svg {
  width: 40px;
  height: 40px;
  color: white;
  position: relative;
  z-index: 1;
}

.icon-decoration {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 24px;
  height: 24px;
  background: #FCD34D;
  border-radius: 50%;
  opacity: 0.8;
}

/* Header Text */
.header-text {
  flex: 1;
}

.title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-blue-900);
}

/* AI Badge */
.ai-badge {
  flex-shrink: 0;
  padding: 6px 16px;
  background: linear-gradient(90deg, var(--bg-blue-100) 0%, var(--bg-blue-200) 100%);
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-sm);
}

.ai-icon {
  width: 24px;
  height: 24px;
  background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-dark) 100%);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 12px;
  box-shadow: inset 0 1px 2px rgba(255,255,255,0.3);
}

.description {
  color: var(--text-gray-600);
  font-size: 14px;
  line-height: 1.6;
}

/* Chat Area */
.chat-area {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.chat-content {
  max-width: 896px;
  width: 100%;
  margin: 0 auto;
  padding: 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Empty State */
.empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 0;
  text-align: center;
}

.empty-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-gray-800);
  margin-bottom: 8px;
}

.empty-hint {
  font-size: 14px;
  color: var(--text-gray-400);
}

/* Messages */
.messages {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.message {
  display: flex;
  max-width: 80%;
}

.message.user {
  align-self: flex-end;
}

.message.assistant {
  align-self: flex-start;
}

.message-content {
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  word-wrap: break-word;
  white-space: pre-wrap;
}

.message.user .message-content {
  background: var(--primary-blue);
  color: white;
}

.message.assistant .message-content {
  background: var(--bg-white);
  border: 1px solid var(--border-blue-100);
  color: var(--text-gray-800);
  box-shadow: var(--shadow-sm);
}

/* Loading */
.loading {
  display: flex;
  justify-content: flex-start;
  margin-top: 16px;
}

.loading.hidden {
  display: none;
}

.loading-dots {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  background: var(--bg-white);
  border: 1px solid var(--border-blue-100);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.dot {
  width: 8px;
  height: 8px;
  background: var(--primary-blue-light);
  border-radius: 50%;
  animation: bounce 1.4s infinite ease-in-out;
}

.dot:nth-child(1) {
  animation-delay: 0s;
}

.dot:nth-child(2) {
  animation-delay: 0.1s;
}

.dot:nth-child(3) {
  animation-delay: 0.2s;
}

@keyframes bounce {
  0%, 80%, 100% {
    transform: scale(1);
    opacity: 0.7;
  }
  40% {
    transform: scale(1.2);
    opacity: 1;
  }
}

/* Input Area */
.input-area {
  background: var(--bg-white);
  border-top: 1px solid var(--border-blue-100);
  box-shadow: 0 -4px 6px -1px rgba(0, 0, 0, 0.05);
}

.input-content {
  max-width: 896px;
  margin: 0 auto;
  padding: 16px 24px;
}

.input-tips {
  text-align: center;
  font-size: 12px;
  color: var(--text-gray-400);
  margin-bottom: 12px;
}

.input-box {
  display: flex;
  align-items: flex-end;
  gap: 12px;
}

/* Clear Button */
.clear-btn {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--bg-gray-50);
  border: none;
  border-radius: var(--radius-md);
  color: var(--text-gray-600);
  cursor: pointer;
  transition: background-color 0.2s;
  font-family: var(--font-family);
  font-size: 14px;
  font-weight: 500;
}

.clear-btn:hover {
  background: var(--bg-blue-100);
}

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

/* Input Wrapper */
.input-wrapper {
  flex: 1;
}

#message-input {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-gray-50);
  border: 1px solid var(--border-blue-200);
  border-radius: var(--radius-md);
  font-family: var(--font-family);
  font-size: 14px;
  color: var(--text-gray-800);
  resize: none;
  min-height: 48px;
  max-height: 120px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

#message-input:focus {
  outline: none;
  border-color: var(--primary-blue-light);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

#message-input::placeholder {
  color: var(--text-gray-400);
}

#message-input:disabled {
  background: var(--bg-blue-50);
  cursor: not-allowed;
}

/* Send Button */
.send-btn {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: var(--primary-blue);
  border: none;
  border-radius: var(--radius-md);
  color: white;
  cursor: pointer;
  transition: background-color 0.2s, opacity 0.2s;
  font-family: var(--font-family);
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-md);
}

.send-btn:hover:not(:disabled) {
  background: var(--primary-blue-dark);
}

.send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

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

/* Responsive */
@media (max-width: 768px) {
  .header-content {
    padding: 16px;
  }
  
  .title {
    font-size: 20px;
  }
  
  .description {
    font-size: 13px;
  }
  
  .chat-content {
    padding: 16px;
  }
  
  .input-content {
    padding: 12px 16px;
  }
  
  .input-box {
    flex-wrap: wrap;
  }
  
  .clear-btn span,
  .send-btn span {
    display: none;
  }
  
  .clear-btn {
    padding: 12px;
  }
  
  .send-btn {
    padding: 12px;
  }
}

.chat-container {
  margin: 0 auto;
  margin-top: 2rem;
  width: 80rem;
  display: flex;
  flex-direction: column;
  z-index: 1;
  flex-grow: 0;
  flex-shrink: 0;
  height: 100%;
}

/** 发送 **/
.chat-fixed-container {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .75rem;
  padding-top: 2rem;
}

.chat-clear-msg {
  display: flex;
  width: 100%;
  align-items: center;
  gap: .5rem;
}

.clear-msg {
  border-radius: .25rem;
  background-color: hsla(0, 0%, 100%, .9);
  box-shadow: 0 .25rem .625rem 0 rgba(48, 61, 105, .1);
  font-size: .875rem;
  font-weight: 400;
  color: #909aaa;
  align-items: center;
  padding: .5rem .75rem;
  display: flex;
  gap: .375rem;
  cursor: pointer;
}

.disclaimer {
  font-size: .75rem;
  font-weight: 400;
  text-align: right;
  color: #909aaa;
  flex: 1;
  display: flex;
  justify-content: flex-end;
  align-items: flex-end;
  align-self: flex-end;
}

.send-msg-container {
  border-radius: .75rem;
  opacity: 1;
  background-color: #f6fafd;
  box-sizing: border-box;
  border: .0625rem solid #e0e6ea;
  padding: .625rem;
  width: 100%;
  height: 4rem;
  display: flex;
  gap: .5rem;
  transition: all .3s ease-in-out;
  position: relative;
}

.inputkey {
  flex: 1;
  outline: none;
  border: none;
  background-color: transparent;
  padding-left: .9375rem;
  position: relative;
}

.send {
  display: flex;
  gap: .375rem;
  align-items: center;
  font-size: .875rem;
  font-weight: 400;
  letter-spacing: 0;
  color: #000;
  cursor: pointer;
  transition: all .5s ease-in-out;
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
}

.send img {
  transition: all .3s ease-in-out;
}


/** 对话内容 **/
.chat-scroll-container {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding-top: 2.25rem;
  position: relative;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
  scrollbar-width: auto;
}

.session-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-bottom: 3.4375rem;
  justify-content: flex-start;
}

.session-list-item {
  font-size: .875rem;
  overflow: hidden;
  max-width: 100%;
  border: .0625rem solid #f0f2f5;
  padding: 1.25rem;
  border-radius: 8px;


}

.session-list-item.questioner {
  background: #f6fafd;
  font-size: .875rem;
  color: #012b83;
  padding: .75rem;
  border-radius: .75rem;
  border: .0625rem solid #f0f2f5;
  align-self: flex-end;
}

.session-list-item.replier {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-self: flex-start;

  /* white-space: pre-wrap; */
  /* 保留换行和空格，同时自动换行 */
}
