/* ============================================
   高级配色方案 - 现代化技术文档样式
   ============================================ */

/* 全局配色变量 */
:root {
  /* 主色调 - 深蓝紫色系 */
  --primary-color: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #818cf8;
  
  /* 背景色 */
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-sidebar: #1e293b;
  --bg-sidebar-hover: #334155;
  --bg-code: #0f172a;
  --bg-code-block: #1e293b;
  --bg-code-inline: #f1f5f9;
  
  /* 文字颜色 */
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --text-sidebar: #e2e8f0;
  --text-code: #e2e8f0;
  
  /* 边框和分割线 */
  --border-color: #e2e8f0;
  --border-dark: #cbd5e1;
  
  /* 强调色 */
  --accent-color: #f59e0b;
  --success-color: #10b981;
  --warning-color: #f59e0b;
  --error-color: #ef4444;
  
  /* 阴影 */
  --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);
}

/* ============================================
   主体样式
   ============================================ */

/* 页面主体背景 */
.book-body {
  background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
  color: var(--text-primary);
}

/* 内容区域 */
.page-inner {
  background: var(--bg-primary);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  padding: 40px 50px;
  margin: 20px auto;
  max-width: 900px;
}

/* ============================================
   侧边栏样式 - 现代化菜单设计
   ============================================ */

.book-summary {
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  border-right: 3px solid var(--primary-color);
  box-shadow: 4px 0 20px rgba(0, 0, 0, 0.3);
}

/* 菜单项基础样式 */
.book-summary ul.summary li {
  position: relative;
  margin: 0;
}

.book-summary ul.summary li a {
  color: var(--text-sidebar);
  padding: 14px 20px 14px 50px;
  border-radius: 0;
  margin: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  position: relative;
  border-left: 3px solid transparent;
  font-size: 14px;
}

/* 菜单项图标（使用Unicode字符和CSS） */
.book-summary ul.summary li.chapter > a::before {
  content: '📄';
  position: absolute;
  left: 18px;
  font-size: 16px;
  transition: all 0.3s ease;
  opacity: 0.7;
  line-height: 1;
}

/* 不同章节类型的图标 */
.book-summary ul.summary li.chapter[data-path*="dev-environment"] > a::before {
  content: '⚙️';
}

.book-summary ul.summary li.chapter[data-path*="web-framework"] > a::before {
  content: '🌐';
}

.book-summary ul.summary li.chapter[data-path*="version"] > a::before {
  content: '🔢';
}

.book-summary ul.summary li.chapter[data-path*="syntax"] > a::before {
  content: '📝';
}

.book-summary ul.summary li.chapter[data-path*="backend-skills"] > a::before {
  content: '💼';
}

.book-summary ul.summary li.chapter[data-path*="database"] > a::before {
  content: '🗄️';
}

.book-summary ul.summary li.chapter[data-path*="interview"] > a::before {
  content: '💡';
}

.book-summary ul.summary li.chapter[data-path*="git"] > a::before {
  content: '🔀';
}

.book-summary ul.summary li.chapter[data-path*="tools-assistant"] > a::before {
  content: '🛠️';
}

.book-summary ul.summary li a:hover {
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.1), rgba(99, 102, 241, 0.05));
  color: #ffffff;
  border-left-color: var(--primary-light);
  padding-left: 55px;
}

.book-summary ul.summary li a:hover::before {
  opacity: 1;
  background: var(--primary-light);
}

.book-summary ul.summary li.active > a {
  background: linear-gradient(90deg, var(--primary-color), rgba(99, 102, 241, 0.8));
  color: #ffffff;
  font-weight: 600;
  box-shadow: inset 4px 0 12px rgba(0, 0, 0, 0.2);
  border-left-color: #ffffff;
  padding-left: 55px;
}

.book-summary ul.summary li.active > a::before {
  opacity: 1;
  background: #ffffff;
}

/* 章节标题（分类标题） */
.book-summary ul.summary li.header {
  color: var(--text-muted);
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-size: 11px;
  padding: 20px 20px 12px;
  margin-top: 10px;
  position: relative;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.book-summary ul.summary li.header:first-child {
  margin-top: 0;
}

/* 分隔线 */
.book-summary ul.summary li.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  margin: 8px 20px;
}

/* ============================================
   顶部导航栏
   ============================================ */

.book-header {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
  box-shadow: var(--shadow-md);
  border-bottom: 2px solid var(--primary-light);
}

.book-header .btn {
  color: rgba(255, 255, 255, 0.9);
  transition: all 0.2s ease;
}

.book-header .btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.book-header h1 {
  color: #ffffff;
  font-weight: 600;
}

/* ============================================
   标题样式
   ============================================ */

.markdown-section h1 {
  color: var(--text-primary);
  border-bottom: 3px solid var(--primary-color);
  padding-bottom: 10px;
  margin-bottom: 30px;
  font-weight: 700;
}

.markdown-section h2 {
  color: var(--primary-dark);
  margin-top: 40px;
  margin-bottom: 20px;
  font-weight: 600;
  position: relative;
  padding-left: 15px;
}

.markdown-section h2::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 24px;
  background: linear-gradient(180deg, var(--primary-color), var(--primary-light));
  border-radius: 2px;
}

.markdown-section h3 {
  color: var(--text-primary);
  margin-top: 30px;
  margin-bottom: 15px;
  font-weight: 600;
}

.markdown-section h4,
.markdown-section h5,
.markdown-section h6 {
  color: var(--text-secondary);
  font-weight: 600;
}

/* ============================================
   代码块样式 - 深色主题优雅展示
   ============================================ */

/* 代码块容器 - 深色主题 */
.markdown-section pre {
  background: #1e1e1e;
  border: 1px solid #2d2d2d;
  border-left: 4px solid var(--primary-color);
  border-radius: 8px;
  padding: 20px 24px;
  margin: 24px 0;
  box-shadow: 
    0 4px 12px rgba(0, 0, 0, 0.3),
    0 2px 4px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  overflow-x: auto;
  position: relative;
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', 'Consolas', 'Liberation Mono', 'Menlo', 'Courier', monospace;
  transition: all 0.2s ease;
}

.markdown-section pre:hover {
  border-color: #3d3d3d;
  box-shadow: 
    0 6px 16px rgba(0, 0, 0, 0.4),
    0 4px 8px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* 代码块内容 */
.markdown-section pre code {
  background: transparent;
  color: #d4d4d4;
  font-size: 14px;
  line-height: 1.75;
  padding: 0;
  display: block;
  white-space: pre;
  word-wrap: normal;
  overflow-wrap: normal;
  font-weight: 400;
}

/* 行内代码 - 深色主题适配 */
.markdown-section code {
  background: #2d2d2d;
  color: #d4d4d4;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.9em;
  font-weight: 500;
  border: 1px solid #3d3d3d;
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', 'Consolas', 'Liberation Mono', 'Menlo', 'Courier', monospace;
  transition: all 0.15s ease;
}

.markdown-section code:hover {
  background: #3d3d3d;
  border-color: #4d4d4d;
}

/* 代码块内的行内代码（不应用背景） */
.markdown-section pre code code {
  background: transparent;
  color: inherit;
  padding: 0;
  border: none;
  font-size: inherit;
}

/* 代码块语言标签（如果支持） */
.markdown-section pre::before {
  content: attr(data-lang);
  position: absolute;
  top: 10px;
  right: 16px;
  font-size: 10px;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 600;
  opacity: 0.7;
  background: rgba(0, 0, 0, 0.3);
  padding: 3px 10px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* 代码块滚动条 - 深色风格 */
.markdown-section pre::-webkit-scrollbar {
  height: 8px;
}

.markdown-section pre::-webkit-scrollbar-track {
  background: #1a1a1a;
  border-radius: 4px;
}

.markdown-section pre::-webkit-scrollbar-thumb {
  background: #4a4a4a;
  border-radius: 4px;
  transition: background 0.2s ease;
}

.markdown-section pre::-webkit-scrollbar-thumb:hover {
  background: #5a5a5a;
}

/* 代码块选中文本 */
.markdown-section pre::selection,
.markdown-section pre code::selection {
  background: rgba(99, 102, 241, 0.4);
  color: #ffffff;
}

/* 代码块特殊优化 */
.markdown-section pre {
  counter-reset: line;
}

/* 改进代码块的可读性 */
.markdown-section pre code {
  tab-size: 2;
  -moz-tab-size: 2;
}

/* 代码块前后间距优化 */
.markdown-section p + pre,
.markdown-section ul + pre,
.markdown-section ol + pre {
  margin-top: 16px;
}

.markdown-section pre + p,
.markdown-section pre + ul,
.markdown-section pre + ol {
  margin-top: 20px;
}

/* 代码块标题样式（如果有） */
.markdown-section pre + p:has(strong:contains("输出结果")),
.markdown-section pre + p:has(strong:contains("运行方式")) {
  margin-top: 12px;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--text-secondary);
}

/* 无语言标识的代码块（纯文本输出） */
.markdown-section pre:not([class]) {
  background: #1e1e1e;
  border-left-color: #4a4a4a;
}

.markdown-section pre:not([class]) code {
  color: #d4d4d4;
}

/* 代码块响应式优化 */
@media screen and (max-width: 768px) {
  .markdown-section pre {
    padding: 16px 18px;
    font-size: 13px;
    border-radius: 8px;
    margin: 18px 0;
  }
  
  .markdown-section pre code {
    font-size: 13px;
    line-height: 1.7;
  }
  
  .markdown-section code {
    font-size: 0.85em;
    padding: 2px 6px;
  }
  
  .markdown-section pre::before {
    font-size: 9px;
    top: 8px;
    right: 12px;
    padding: 1px 6px;
  }
}

/* 代码块焦点状态 */
.markdown-section pre:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* 代码块复制按钮区域（预留） */
.markdown-section pre:hover {
  position: relative;
}

/* ============================================
   代码高亮插件样式覆盖
   ============================================ */

/* Highlight.js 样式覆盖 - 深色主题优化 */
.markdown-section pre .hljs,
.markdown-section pre code.hljs {
  background: transparent !important;
  color: #d4d4d4 !important;
  padding: 0 !important;
}

/* 高亮语法元素颜色优化 - 深色主题（VS Code风格） */
.markdown-section pre .hljs-keyword,
.markdown-section pre .hljs-selector-tag,
.markdown-section pre .hljs-built_in,
.markdown-section pre .hljs-name {
  color: #c586c0;
  font-weight: 600;
}

.markdown-section pre .hljs-string,
.markdown-section pre .hljs-attr {
  color: #ce9178;
}

.markdown-section pre .hljs-comment,
.markdown-section pre .hljs-quote {
  color: #6a9955;
  font-style: italic;
}

.markdown-section pre .hljs-number,
.markdown-section pre .hljs-literal {
  color: #b5cea8;
}

.markdown-section pre .hljs-function,
.markdown-section pre .hljs-title {
  color: #dcdcaa;
}

.markdown-section pre .hljs-variable,
.markdown-section pre .hljs-template-variable {
  color: #9cdcfe;
}

.markdown-section pre .hljs-type,
.markdown-section pre .hljs-class {
  color: #4ec9b0;
}

.markdown-section pre .hljs-meta {
  color: #808080;
}

/* 确保高亮后的代码块保持统一样式 */
.markdown-section pre.hljs,
.markdown-section pre code.hljs {
  background: #1e1e1e !important;
  border: 1px solid #2d2d2d !important;
  border-left: 4px solid var(--primary-color) !important;
  border-radius: 8px !important;
  padding: 20px 24px !important;
  box-shadow: 
    0 4px 12px rgba(0, 0, 0, 0.3),
    0 2px 4px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
}

/* ============================================
   链接样式
   ============================================ */

.markdown-section a {
  color: var(--primary-color);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: all 0.2s ease;
}

.markdown-section a:hover {
  color: var(--primary-dark);
  border-bottom-color: var(--primary-color);
}

/* ============================================
   引用块样式
   ============================================ */

.markdown-section blockquote {
  border-left: 4px solid var(--accent-color);
  background: linear-gradient(90deg, #fffbeb, #ffffff);
  padding: 15px 20px;
  margin: 20px 0;
  border-radius: 6px;
  box-shadow: var(--shadow-sm);
}

.markdown-section blockquote p {
  color: var(--text-secondary);
  margin: 0;
}

/* ============================================
   表格样式
   ============================================ */

.markdown-section table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  margin: 20px 0;
  box-shadow: var(--shadow-sm);
  border-radius: 8px;
  overflow: hidden;
}

.markdown-section table th {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
  color: #ffffff;
  font-weight: 600;
  padding: 12px 15px;
  text-align: left;
}

.markdown-section table td {
  padding: 12px 15px;
  border-top: 1px solid var(--border-color);
}

.markdown-section table tr {
  background: var(--bg-primary);
  transition: background 0.2s ease;
}

.markdown-section table tr:hover {
  background: var(--bg-secondary);
}

.markdown-section table tr:nth-child(2n) {
  background: var(--bg-secondary);
}

.markdown-section table tr:nth-child(2n):hover {
  background: #f1f5f9;
}

/* ============================================
   列表样式
   ============================================ */

.markdown-section ul,
.markdown-section ol {
  padding-left: 25px;
}

.markdown-section ul li {
  list-style-type: none;
  position: relative;
  padding-left: 20px;
  margin: 8px 0;
}

.markdown-section ul li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--primary-color);
  font-weight: bold;
}

.markdown-section ol li {
  margin: 8px 0;
  padding-left: 5px;
}

/* ============================================
   分割线样式
   ============================================ */

.markdown-section hr {
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
  border: none;
  margin: 40px 0;
}

/* ============================================
   导航按钮样式 - 保持默认样式
   ============================================ */

/* 导航按钮使用默认样式，不添加自定义样式 */

/* ============================================
   搜索框样式
   ============================================ */

#book-search-input {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  margin: 10px;
}

#book-search-input input {
  color: var(--text-sidebar);
}

#book-search-input input::placeholder {
  color: var(--text-muted);
}

/* ============================================
   响应式设计
   ============================================ */

@media screen and (max-width: 1240px) {
  .page-inner {
    padding: 30px 20px;
    margin: 10px;
  }
}

@media screen and (max-width: 600px) {
  .page-inner {
    padding: 20px 15px;
    border-radius: 0;
  }
  
  .markdown-section h1 {
    font-size: 1.8em;
  }
  
  .markdown-section h2 {
    font-size: 1.5em;
  }
}

/* ============================================
   细节优化
   ============================================ */

/* 选中文本颜色 */
::selection {
  background: var(--primary-light);
  color: #ffffff;
}

/* 滚动条样式 */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-dark);
}

/* 细节标签样式 */
.markdown-section strong {
  color: var(--text-primary);
  font-weight: 600;
}

.markdown-section em {
  color: var(--text-secondary);
  font-style: italic;
}

/* ============================================
   AI助手浮动图标和对话框样式
   ============================================ */

/* 浮动按钮 */
#ai-assistant-button {
  position: fixed !important;
  top: 30px !important;
  right: 30px !important;
  width: 64px !important;
  height: 64px !important;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
  border-radius: 50% !important;
  box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4) !important;
  cursor: pointer !important;
  z-index: 99999 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  overflow: visible !important;
}

#ai-assistant-button:hover {
  transform: scale(1.1);
  box-shadow: 0 12px 32px rgba(102, 126, 234, 0.5);
}

#ai-assistant-button.active {
  background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

.ai-assistant-icon {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.ai-assistant-icon svg {
  width: 32px;
  height: 32px;
}

.ai-assistant-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #10b981;
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  border: 2px solid white;
  line-height: 1.2;
  min-width: 24px;
  text-align: center;
}

/* 对话框 */
#ai-assistant-dialog {
  position: fixed;
  top: 110px;
  right: 30px;
  width: 420px;
  max-width: calc(100vw - 60px);
  height: 600px;
  max-height: calc(100vh - 140px);
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  z-index: 999;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-20px) scale(0.95);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

#ai-assistant-dialog.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* 对话框头部 */
.ai-assistant-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.ai-assistant-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 16px;
}

.ai-assistant-title-icon {
  font-size: 20px;
}

.ai-assistant-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 400;
  margin-left: 12px;
  opacity: 0.9;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
  transition: background 0.3s;
  flex-shrink: 0;
}

.status-connected .status-dot {
  background: #10b981;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}

.status-connecting .status-dot,
.status-error .status-dot,
.status-disconnected .status-dot {
  background: #ef4444;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.3);
}

.status-connecting .status-dot {
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.ai-assistant-close {
  background: #ef4444;
  border: none;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  padding: 0;
}

.ai-assistant-close:hover {
  background: #dc2626;
  color: #fff;
  transform: rotate(90deg);
}

/* 消息容器 */
.ai-assistant-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ai-assistant-messages::-webkit-scrollbar {
  width: 6px;
}

.ai-assistant-messages::-webkit-scrollbar-track {
  background: transparent;
}

.ai-assistant-messages::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

.ai-assistant-messages::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* 欢迎消息 */
.ai-assistant-welcome {
  text-align: center;
  padding: 40px 20px;
  color: #64748b;
}

.welcome-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.welcome-text {
  font-size: 14px;
  line-height: 1.6;
}

/* 消息样式 */
.ai-assistant-message {
  display: flex;
  gap: 12px;
  animation: messageSlideIn 0.3s ease-out;
}

@keyframes messageSlideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ai-assistant-message-user {
  flex-direction: row-reverse;
}

.ai-assistant-message-user .message-content {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 18px 18px 4px 18px;
}

.ai-assistant-message-ai {
  flex-direction: row;
}

.message-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.message-content-wrapper {
  flex: 1;
  max-width: calc(100% - 44px);
}

.message-content {
  background: white;
  padding: 12px 16px;
  border-radius: 18px 18px 18px 4px;
  font-size: 14px;
  line-height: 1.6;
  color: #1e293b;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  word-wrap: break-word;
}

.message-content.system {
  background: #fef3c7;
  color: #92400e;
  text-align: center;
  font-size: 12px;
  padding: 8px 12px;
  border-radius: 12px;
}

.message-content code {
  background: rgba(0, 0, 0, 0.05);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
  font-size: 0.9em;
}

.message-content pre {
  background: #1e293b;
  color: #e2e8f0;
  padding: 12px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 8px 0;
  font-size: 12px;
}

.message-content pre code {
  background: transparent;
  padding: 0;
  color: inherit;
}

.message-time {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 4px;
  text-align: right;
}

.ai-assistant-message-user .message-time {
  text-align: left;
}

/* 加载动画 */
.ai-assistant-loading {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
}

.loading-dots {
  display: flex;
  gap: 6px;
  padding-left: 44px;
}

.loading-dots span {
  width: 8px;
  height: 8px;
  background: #94a3b8;
  border-radius: 50%;
  animation: loadingDot 1.4s ease-in-out infinite;
}

.loading-dots span:nth-child(1) {
  animation-delay: 0s;
}

.loading-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.loading-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes loadingDot {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.5;
  }
  30% {
    transform: translateY(-8px);
    opacity: 1;
  }
}

/* 输入容器 */
.ai-assistant-input-container {
  padding: 16px 20px;
  background: white;
  border-top: 1px solid #e2e8f0;
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.ai-assistant-input {
  flex: 1;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 14px;
  font-family: inherit;
  resize: none;
  max-height: 120px;
  transition: border-color 0.2s;
  line-height: 1.5;
}

.ai-assistant-input:focus {
  outline: none;
  border-color: #667eea;
}

.ai-assistant-send {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  border-radius: 12px;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.ai-assistant-send:hover:not(:disabled) {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.ai-assistant-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

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

/* 响应式设计 */
@media screen and (max-width: 768px) {
  #ai-assistant-button {
    top: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
  }

  #ai-assistant-dialog {
    top: 90px;
    right: 20px;
    left: 20px;
    width: auto;
    height: calc(100vh - 110px);
    max-height: calc(100vh - 110px);
  }

  .ai-assistant-icon svg {
    width: 28px;
    height: 28px;
  }
}


/* 动态加载AI助手脚本 - 通过CSS注入 */
