/* 全局样式重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-color: #1a1a1a;
  --primary-hover: #000000;
  --primary-light: #666666;
  --background: #ffffff;
  --background-secondary: #f5f5f5;
  --background-tertiary: #e8e8e8;
  --border-color: #d0d0d0;
  --text-primary: #000000;
  --text-secondary: #333333;
  --text-muted: #666666;
  --sidebar-width: 300px;
  --header-height: 60px;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 10px 10px -5px rgb(0 0 0 / 0.04);
  --gradient-primary: linear-gradient(135deg, #1a1a1a 0%, #000000 100%);
  --gradient-secondary: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: var(--background);
  color: var(--text-primary);
  line-height: 1.6;
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* 侧边栏 */
.sidebar {
  width: var(--sidebar-width);
  background: var(--gradient-secondary);
  backdrop-filter: blur(10px);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0;
  top: 0;
  height: 100vh;
  z-index: 1000;
  transform: translateX(0);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-lg);
}

.sidebar-header {
  padding: 24px 20px;
  border-bottom: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
}

.logo {
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-text {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}

.btn-new-chat {
  width: 100%;
  background: var(--gradient-primary);
  color: white;
  border: none;
  padding: 14px 18px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.btn-new-chat::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  transition: left 0.5s;
}

.btn-new-chat:hover::before {
  left: 100%;
}

.btn-new-chat:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-new-chat:active {
  transform: translateY(0);
}

.conversation-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.conversation-item {
  padding: 12px 16px;
  margin-bottom: 4px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background-color 0.2s;
  border: 1px solid transparent;
}

.conversation-item:hover {
  background: var(--background);
  border-color: var(--border-color);
}

.conversation-item.active {
  background: var(--background);
  border-color: var(--text-primary);
}

.conversation-title {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 4px;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-time {
  font-size: 12px;
  color: var(--text-muted);
}

.sidebar-footer {
  padding: 20px;
  border-top: 1px solid var(--border-color);
}

.btn-clear-history {
  width: 100%;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  padding: 10px 16px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
}

.btn-clear-history:hover {
  background: var(--background-secondary);
  color: var(--text-primary);
}

/* 主内容区域 - 确保完全铺满可用空间 */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  margin-right: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: calc(100% - var(--sidebar-width));
  transition: all 0.3s ease;
  overflow: hidden;
}

.main-content.centered {
  margin-left: 0;
  margin-right: 0;
  width: 100%;
}

/* 移动端顶部栏 */
.mobile-header {
  display: none;
  height: var(--header-height);
  background: var(--background);
  border-bottom: 1px solid var(--border-color);
  padding: 0 20px;
  align-items: center;
  gap: 16px;
}

/* 聊天标题头部 */
.chat-header {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  padding: 16px 20px;
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}

.chat-title-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.chat-title-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.current-chat-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-title-text {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  max-width: 400px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  position: relative;
}

.chat-title-text.streaming::after {
  content: '|';
  color: var(--primary-color);
  animation: blink 1s infinite;
  font-weight: bold;
}

.title-generating {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--primary-color);
  font-weight: 500;
}

.title-generating-icon {
  animation: sparkle 1.5s ease-in-out infinite;
}

.btn-toggle-sidebar {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius);
  transition: background-color 0.2s;
}

.btn-toggle-sidebar:hover {
  background: var(--background-secondary);
}

.mobile-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

@keyframes sparkle {
  0%, 100% { 
    transform: rotate(0deg) scale(1);
    opacity: 0.7;
  }
  50% { 
    transform: rotate(180deg) scale(1.2);
    opacity: 1;
  }
}

/* 对话容器 - 确保内容铺满全屏 */
.chat-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 0 20px;
  height: 100%;
  max-width: none;
}

/* 消息容器 - 确保铺满全屏 */
.messages-container {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 40px 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-height: 0;
  width: 100%;
  max-width: none;
  margin: 0;
}

/* 欢迎消息 - 居中对齐 */
.messages-container:has(.welcome-message) {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

/* 非欢迎消息时的消息容器 - 移除居中 */
.messages-container:not(:has(.welcome-message)) {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  text-align: left;
}

.welcome-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  max-width: 600px;
  margin: 60px auto;
  padding: 0 20px;
  transform: scale(1) !important;
  transform-origin: center;
}

.welcome-icon {
  font-size: 48px;
  margin-bottom: 24px;
  transform: scale(1) !important;
  transform-origin: center;
  display: flex;
  justify-content: center;
}

.welcome-message h2 {
  font-size: 28px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
  line-height: 1.3;
  transform: scale(1) !important;
  transform-origin: center;
}

.welcome-message p {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.6;
  transform: scale(1) !important;
  transform-origin: center;
}

.ai-disclaimer {
  margin-top: 32px;
  padding: 12px 20px;
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  position: relative;
  transform: scale(1) !important;
  transform-origin: center;
}

.ai-disclaimer::before {
  content: '⚠️';
  margin-right: 6px;
  font-size: 12px;
}

/* 消息样式 - 确保在居中布局中正确显示 */
.message {
  display: flex;
  align-items: flex-start;
  margin-bottom: 16px;
  width: 100%;
  animation: fadeInUp 0.3s ease-out;
  position: relative;
}

.message.user {
  flex-direction: row-reverse;
  justify-content: flex-start;
}

.message.assistant {
  flex-direction: row;
  justify-content: flex-start;
}

/* 头像样式 - 只显示用户头像 */
.message-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
  margin-top: 4px;
}

.message.user .message-avatar {
  display: flex;
  background: var(--text-primary);
  color: white;
}

.message.assistant .message-avatar {
  display: none;
}

/* 消息内容容器 */
.message-content {
  max-width: 80%;
  display: inline-block;
}

.message.user .message-content {
  text-align: right;
  margin-left: 12px;
}

.message.assistant .message-content {
  text-align: left;
  margin-right: 12px;
}

/* 消息文本样式 - 确保水平排列 */
.message-text {
  background: var(--background-secondary);
  padding: 12px 16px;
  border-radius: 16px;
  line-height: 1.5;
  word-wrap: break-word;
  display: inline-block;
  text-align: left;
  white-space: normal;
  max-width: 100%;
}

.message.user .message-text {
  background: var(--text-primary);
  color: white;
  text-align: right;
}

/* 确保消息内容不会垂直排列 */
.message-text p {
  margin: 0;
  padding: 0;
  display: inline-block;
  white-space: normal;
  text-align: inherit;
}

/* 消息中的图片样式 */
.message-text img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 8px 0;
  display: block;
}

/* 消息时间样式 */
.message-time {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
  display: block;
  text-align: inherit;
}

/* AI生成内容展示区域 - 确保铺满宽度 */
.ai-generated-content {
  margin-top: -16px;
  margin-bottom: 16px;
  padding: 16px;
  background: var(--background-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  max-width: none;
  width: 100%;
  margin: 0 0 16px;
  transition: all 0.3s ease;
  opacity: 0;
  transform: translateY(10px);
}

.ai-generated-content.visible {
  opacity: 1;
  transform: translateY(0);
}

.ai-content-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.ai-content-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.ai-content-actions {
  display: flex;
  gap: 8px;
}

.ai-content-body {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-secondary);
  overflow-wrap: break-word;
}

.ai-content-body p {
  margin: 0 0 8px 0;
}

.ai-content-body p:last-child {
  margin-bottom: 0;
}

/* 警告提示样式 - 确保居中对齐 */
.warning-notice {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-lg);
  z-index: 1001;
  max-width: 400px;
  width: 90%;
  margin: 0 auto;
  text-align: center;
  animation: fadeInUp 0.3s ease-out;
}

.warning-icon {
  font-size: 24px;
  color: #f39c12;
  margin-bottom: 12px;
}

.warning-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.warning-message {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.5;
}

.warning-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
}

/* 输入区域 - 确保铺满宽度 */
.input-container {
  background: var(--background);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.input-wrapper {
  background: var(--background-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 16px;
  transition: all 0.2s;
  position: relative;
  box-shadow: var(--shadow);
  max-width: none;
  width: 100%;
  margin: 0;
}

.input-wrapper:focus-within {
  border-color: var(--text-primary);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

.input-wrapper.drag-over {
  border-color: var(--text-primary);
  background: rgba(0, 0, 0, 0.02);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

.input-wrapper.drag-over::after {
  content: '释放以上传图片';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 16px;
  color: var(--text-primary);
  font-weight: 600;
  pointer-events: none;
  z-index: 10;
}

/* 输入框顶部栏 */
.input-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.input-hint-text {
  font-size: 12px;
  color: var(--text-muted);
}

.input-top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.deep-think-badge {
  display: flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s;
  font-size: 11px;
  color: var(--text-muted);
  background: var(--background);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.deep-think-badge:hover {
  border-color: var(--text-muted);
  background: var(--background-tertiary);
}

.deep-think-badge input[type="checkbox"] {
  display: none;
}

.deep-think-badge input[type="checkbox"]:checked + .badge-text {
  color: var(--text-primary);
  font-weight: 500;
}

.badge-text {
  transition: all 0.2s;
}

/* 图片预览（在输入框上方）*/
.image-preview-container {
  padding: 8px 0 12px 0;
}

.image-preview-wrapper {
  position: relative;
  display: inline-block;
  max-width: 150px;
}

.image-preview-wrapper img {
  max-width: 100%;
  max-height: 120px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  display: block;
}

.btn-remove-image {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--text-primary);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  transition: all 0.2s;
  box-shadow: var(--shadow);
}

.btn-remove-image:hover {
  background: var(--text-secondary);
  transform: scale(1.1);
}

.input-content {
  display: flex;
  align-items: flex-end;
  gap: 12px;
}

#messageInput {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  resize: none;
  font-size: 16px;
  line-height: 1.5;
  max-height: 120px;
  font-family: inherit;
  color: var(--text-primary);
  min-height: 24px;
}

#messageInput::placeholder {
  color: var(--text-muted);
}

.input-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-send {
  background: var(--text-primary);
  color: white;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: var(--shadow);
}

.btn-send:hover:not(:disabled) {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

.btn-send:disabled {
  background: var(--text-muted);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* 底部免责声明（在输入框外） */
.input-bottom-disclaimer {
  text-align: center;
  padding: 12px 0;
  font-size: 11px;
  color: var(--text-muted);
}

.btn-action {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
}

.btn-action:hover {
  color: var(--text-primary);
  background: var(--background-tertiary);
}

/* 遮罩层 */
.overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
}

.overlay.show {
  display: block;
}

/* 动画 */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 消息容器滚动条样式 - 隐藏但保留功能 */
.messages-container {
  overflow-y: auto;
  /* Firefox */
  scrollbar-width: none;
  /* IE/Edge */
  -ms-overflow-style: none;
}

/* Chrome, Safari, Opera */
.messages-container::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

/* 会话列表滚动条样式 */
.conversation-list {
  /* Firefox */
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.conversation-list::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  
  .sidebar.open {
    transform: translateX(0);
  }
  
  .main-content {
    margin-left: 0 !important;
  }
  
  .mobile-header {
    display: flex;
  }

  .sidebar-toggle-float {
    height: 60px;
    top: 80px;
    transform: none;
  }

  .sidebar-trigger-area {
    width: 30px;
  }
  
  .chat-container {
    padding: 0 16px;
  }
  
  .messages-container {
    padding: 20px 0;
  }
  
  .welcome-message {
    padding: 40px 16px;
  }
  
  .welcome-message h2 {
    font-size: 24px;
  }
  
  .input-container {
    padding: 16px 0 20px;
  }
  
  .input-wrapper {
    width: 95%; /* 在平板上稍微宽一点 */
    max-width: none; /* 在小屏幕上不限制最大宽度 */
    padding: 14px;
    margin: 0 auto;
  }
  
  .input-wrapper:focus-within {
    border-color: var(--text-primary);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
  }
  
  .input-wrapper.drag-over {
    border-color: var(--text-primary);
    background: rgba(0, 0, 0, 0.02);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
  }
  
  .input-wrapper.drag-over::after {
    content: '释放以上传图片';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 16px;
    color: var(--text-primary);
    font-weight: 600;
    pointer-events: none;
    z-index: 10;
  }
}
  
  /* 输入框顶部栏 */
  .input-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
  }
  
  .input-hint-text {
    font-size: 12px;
    color: var(--text-muted);
  }
  
  .input-top-actions {
    display: flex;
    align-items: center;
    gap: 8px;
  }
  
  .deep-think-badge {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s;
    font-size: 11px;
    color: var(--text-muted);
    background: var(--background);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
  }
  
  .deep-think-badge:hover {
    border-color: var(--text-muted);
    background: var(--background-tertiary);
  }
  
  .deep-think-badge input[type="checkbox"] {
    display: none;
  }
  
  .deep-think-badge input[type="checkbox"]:checked + .badge-text {
    color: var(--text-primary);
    font-weight: 500;
  }
  
  .badge-text {
    transition: all 0.2s;
  }
  
  /* 图片预览（在输入框上方）*/
  .image-preview-container {
    padding: 8px 0 12px 0;
  }
  
  .image-preview-wrapper {
    position: relative;
    display: inline-block;
    max-width: 150px;
  }
  
  .image-preview-wrapper img {
    max-width: 100%;
    max-height: 120px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    display: block;
  }
  
  .btn-remove-image {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--text-primary);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    transition: all 0.2s;
    box-shadow: var(--shadow);
  }
  
  .btn-remove-image:hover {
    background: var(--text-secondary);
    transform: scale(1.1);
  }
  
  .input-content {
    display: flex;
    align-items: flex-end;
    gap: 12px;
  }
  
  #messageInput {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    resize: none;
    font-size: 16px;
    line-height: 1.5;
    max-height: 120px;
    font-family: inherit;
    color: var(--text-primary);
    min-height: 24px;
  }
  
  #messageInput::placeholder {
    color: var(--text-muted);
  }
  
  .input-actions {
    display: flex;
    align-items: center;
    gap: 8px;
  }
  
  .btn-send {
    background: var(--text-primary);
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: var(--shadow);
  }
  
  .btn-send:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
  }
  
  .btn-send:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
  }
  
  /* 底部免责声明（在输入框外） */
  .input-bottom-disclaimer {
    text-align: center;
    padding: 12px 0;
    font-size: 11px;
    color: var(--text-muted);
  }
  
  .btn-action {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
  }
  
  .btn-action:hover {
    color: var(--text-primary);
    background: var(--background-tertiary);
  }
  
  /* 遮罩层 */
  .overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
  }
  
  .overlay.show {
    display: block;
  }
  
  /* 动画 */
  @keyframes fadeInUp {
    from {
      opacity: 0;
      transform: translateY(20px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  
  /* 滚动条样式 - 显示滚动条 */
  .messages-container::-webkit-scrollbar {
    width: 6px;
    background: transparent;
  }
  
  .messages-container::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
  }
  
  .messages-container::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
  }
  
  .conversation-list::-webkit-scrollbar {
    width: 6px;
  }
  
  .conversation-list::-webkit-scrollbar-track {
    background: transparent;
  }
  
  .conversation-list::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
  }
  
  .conversation-list::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
  }
  
  /* Firefox 滚动条 */
  .messages-container {
    scrollbar-width: thin;
    -ms-overflow-style: auto;
  }
  
  /* 加载状态 */
  .loading {
    opacity: 0.7;
    pointer-events: none;
  }
  
  .typing-indicator {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: var(--background-secondary);
    border-radius: 16px;
    max-width: fit-content;
    position: relative;
    overflow: hidden;
  }
  
  .typing-indicator::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.05), transparent);
    animation: shimmer 2s infinite;
  }
  
  .typing-animation {
    display: flex;
    align-items: center;
    gap: 8px;
  }
  
  .typing-icon {
    font-size: 16px;
    animation: rotate 2s linear infinite;
  }
  
  .typing-icon.sun {
    color: #666666;
    animation: rotateSun 3s linear infinite;
  }
  
  .typing-icon.moon {
    color: #333333;
    animation: rotateMoon 2.5s linear infinite;
  }
  
  .typing-dots {
    display: flex;
    gap: 4px;
  }
  
  .typing-dot {
    width: 8px;
    height: 8px;
    background: var(--text-primary);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out;
  }
  
  .typing-dot:nth-child(1) {
    animation-delay: 0s;
  }
  
  .typing-dot:nth-child(2) {
    animation-delay: 0.2s;
  }
  
  .typing-dot:nth-child(3) {
    animation-delay: 0.4s;
  }
  
  .typing-text {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
  }
  
  /* 流式输出动画 */
  .streaming-text {
    position: relative;
  }
  
  .streaming-text::after {
    content: '|';
    color: var(--text-primary);
    animation: blink 1s infinite;
    font-weight: bold;
  }
  
  .message.streaming .message-text {
    background: linear-gradient(45deg, var(--background-secondary), rgba(0, 0, 0, 0.02));
    border: 1px solid rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
  }
  
  .message.streaming .message-text::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.05), transparent);
    animation: streamingShimmer 1.5s infinite;
  }
  
  /* 动画关键帧 */
  @keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
  }
  
  @keyframes rotateSun {
    0% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.1); }
    100% { transform: rotate(360deg) scale(1); }
  }
  
  @keyframes rotateMoon {
    0% { transform: rotate(0deg) scale(1); }
    25% { transform: rotate(90deg) scale(0.9); }
    50% { transform: rotate(180deg) scale(1.1); }
    75% { transform: rotate(270deg) scale(0.9); }
    100% { transform: rotate(360deg) scale(1); }
  }
  
  @keyframes bounce {
    0%, 60%, 100% {
      transform: translateY(0) scale(1);
      opacity: 0.7;
    }
    30% {
      transform: translateY(-12px) scale(1.2);
      opacity: 1;
    }
  }
  
  @keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
  }
  
  @keyframes streamingShimmer {
    0% { left: -100%; }
    100% { left: 100%; }
  }
  
  @keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
  }
  
  @keyframes typing {
    0%, 60%, 100% {
      transform: translateY(0);
      opacity: 0.4;
    }
    30% {
      transform: translateY(-10px);
      opacity: 1;
    }
  }

/* 小屏幕手机响应式设计 */
@media (max-width: 480px) {
  .chat-container {
    padding: 0 12px;
  }
  
  .messages-container {
    padding: 16px 0;
  }
  
  .input-wrapper {
    width: 98%; /* 在手机上几乎充满屏幕 */
    padding: 12px;
    margin: 0 auto;
  }
  
  .welcome-message h2 {
    font-size: 20px;
  }
  
  .welcome-message p {
    font-size: 14px;
  }
}
