/* 中医教学系统 - 医疗专业风 v3.0 */

/* ==================== 基础重置 ==================== */
* { margin: 0; padding: 0; box-sizing: border-box; }

body { 
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif;
  background: #F5F8FA;
  color: #2C3E50;
  height: 100vh;
  overflow: hidden;
  font-size: 15px;
  line-height: 1.6;
}

/* ==================== 三栏容器 ==================== */
.main-container { 
  display: flex; 
  height: 100vh; 
  width: 100%; 
  gap: 0;
}

/* ==================== 左侧边栏（无限制调节） ==================== */
.sidebar { 
  width: 280px;
  background: #FFFFFF;
  border-right: 2px solid #E8EDF2;
  display: flex; 
  flex-direction: column; 
  flex-shrink: 0;
  box-shadow: 2px 0 8px rgba(0, 102, 204, 0.05);
}

.sidebar header { 
  padding: 16px;
  background: linear-gradient(135deg, #0066CC 0%, #00A67E 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(0, 102, 204, 0.15);
}

.header-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.back-home-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 8px;
  text-decoration: none;
  font-size: 18px;
  transition: all 0.2s;
  cursor: pointer;
}

.back-home-btn:hover {
  background: rgba(255,255,255,0.25);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.sidebar h2 { 
  font-size: 17px;
  font-weight: 600;
  margin: 0;
  letter-spacing: 0.3px;
  flex: 1;
}

.control-group { 
  padding: 16px;
  background: #F8FAFB;
  border-bottom: 1px solid #E8EDF2;
}

.control-group label { 
  display: block;
  font-size: 13px;
  color: #5A6C7D;
  margin-bottom: 8px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

#textbook-selector { 
  width: 100%;
  padding: 10px 12px;
  border: 2px solid #E8EDF2;
  border-radius: 8px;
  font-size: 14px;
  background: white;
  color: #2C3E50;
  transition: all 0.2s;
  cursor: pointer;
}

#textbook-selector:focus { 
  outline: none;
  border-color: #0066CC;
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

#toc-container { 
  flex: 1;
  overflow-y: auto;
  padding: 12px 8px;
  background: white;
}

#toc-tree { 
  list-style: none;
}

#toc-tree li { 
  margin: 3px 0;
}

#toc-tree a { 
  display: block;
  padding: 10px 14px;
  color: #2C3E50;
  text-decoration: none;
  border-radius: 8px;
  font-size: 14px;
  transition: all 0.2s;
  border-left: 3px solid transparent;
}

#toc-tree a:hover { 
  background: #F0F7FF;
  color: #0066CC;
  border-left-color: #0066CC;
  transform: translateX(2px);
}

#toc-tree a.active { 
  background: linear-gradient(90deg, #E6F2FF 0%, #F0F7FF 100%);
  color: #0066CC;
  font-weight: 600;
  border-left-color: #0066CC;
  box-shadow: 0 2px 4px rgba(0, 102, 204, 0.08);
}

#toc-tree ul { 
  list-style: none;
  margin-left: 20px;
  border-left: 2px solid #F0F4F8;
  padding-left: 8px;
}

/* ==================== 调节器 ==================== */
.resizer { 
  width: 6px;
  background: linear-gradient(90deg, #E8EDF2 0%, #F0F4F8 50%, #E8EDF2 100%);
  cursor: col-resize;
  flex-shrink: 0;
  transition: all 0.2s;
  position: relative;
}

.resizer::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 2px;
  height: 40px;
  background: #CBD5E0;
  border-radius: 2px;
  opacity: 0;
  transition: opacity 0.2s;
}

.resizer:hover {
  background: linear-gradient(90deg, #0066CC 0%, #00A67E 100%);
}

.resizer:hover::before {
  opacity: 1;
  background: white;
}

/* ==================== 中间内容区 ==================== */
.content-area { 
  flex: 1;
  min-width: 0;
  background: white;
  display: flex;
  flex-direction: column;
}

.content-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background: linear-gradient(135deg, #F8FBFF 0%, #F0F9FF 100%);
  border-bottom: 2px solid #E8EDF2;
  box-shadow: 0 2px 6px rgba(0, 102, 204, 0.08);
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.breadcrumb-item {
  color: #64748B;
  transition: color 0.2s;
}

.breadcrumb-item.current {
  color: #0066CC;
  font-weight: 500;
}

.breadcrumb-separator {
  color: #CBD5E0;
  user-select: none;
}

.content-tools {
  display: flex;
  gap: 8px;
}

.tool-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(0, 102, 204, 0.2);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 16px;
  backdrop-filter: blur(4px);
}

.tool-btn:hover {
  background: white;
  border-color: #0066CC;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 102, 204, 0.15);
}

#textbook-content-wrapper { 
  flex: 1;
  overflow-y: auto;
  padding: 40px;
  background: linear-gradient(180deg, #FAFBFC 0%, #FFFFFF 100%);
}

#textbook-content { 
  max-width: 900px;
  margin: 0 auto;
  background: white;
  padding: 40px;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
  border: 1px solid #F0F4F8;
}

#textbook-content h1 { 
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 3px solid #0066CC;
  color: #0066CC;
  letter-spacing: -0.5px;
}

#textbook-content h2 { 
  font-size: 24px;
  font-weight: 600;
  margin: 32px 0 16px;
  color: #00A67E;
  padding-left: 12px;
  border-left: 4px solid #00A67E;
}

#textbook-content h3 { 
  font-size: 20px;
  font-weight: 600;
  margin: 24px 0 12px;
  color: #2C3E50;
}

#textbook-content p { 
  margin-bottom: 16px;
  line-height: 1.8;
  text-indent: 2em;
  color: #34495E;
}

#textbook-content .placeholder { 
  text-align: center;
  color: #95A5A6;
  padding: 80px 20px;
  font-size: 16px;
  text-indent: 0;
  background: #F8FAFB;
  border-radius: 12px;
  border: 2px dashed #DDE4E9;
}

#textbook-content ul,
#textbook-content ol { 
  margin-left: 2em;
  margin-bottom: 16px;
  padding-left: 1em;
}

#textbook-content li { 
  margin-bottom: 8px;
  line-height: 1.8;
  color: #34495E;
}

/* ==================== 字体大小切换 ==================== */
/* 小号字体 */
#textbook-content.font-size-small h1 { font-size: 26px; }
#textbook-content.font-size-small h2 { font-size: 20px; }
#textbook-content.font-size-small h3 { font-size: 17px; }
#textbook-content.font-size-small p { font-size: 14px; line-height: 1.7; }
#textbook-content.font-size-small li { font-size: 14px; line-height: 1.7; }
#textbook-content.font-size-small .placeholder { font-size: 14px; }

/* 中号字体（默认） */
#textbook-content.font-size-medium h1 { font-size: 32px; }
#textbook-content.font-size-medium h2 { font-size: 24px; }
#textbook-content.font-size-medium h3 { font-size: 20px; }
#textbook-content.font-size-medium p { font-size: 16px; line-height: 1.8; }
#textbook-content.font-size-medium li { font-size: 16px; line-height: 1.8; }
#textbook-content.font-size-medium .placeholder { font-size: 16px; }

/* 大号字体 */
#textbook-content.font-size-large h1 { font-size: 38px; }
#textbook-content.font-size-large h2 { font-size: 28px; }
#textbook-content.font-size-large h3 { font-size: 24px; }
#textbook-content.font-size-large p { font-size: 18px; line-height: 1.9; }
#textbook-content.font-size-large li { font-size: 18px; line-height: 1.9; }
#textbook-content.font-size-large .placeholder { font-size: 18px; }

/* ==================== 持久化文本高亮 ==================== */
.persistent-highlight {
  background: linear-gradient(120deg, #0066CC 0%, #00A67E 100%);
  color: white;
  padding: 2px 4px;
  border-radius: 3px;
  box-shadow: 0 2px 4px rgba(0, 102, 204, 0.2);
  cursor: pointer;
  transition: all 0.2s;
}

.persistent-highlight:hover {
  background: linear-gradient(120deg, #0052A3 0%, #008C6A 100%);
  box-shadow: 0 3px 6px rgba(0, 102, 204, 0.3);
  transform: translateY(-1px);
}

/* 原生选区样式（选择时的临时高亮） */
#textbook-content ::selection {
  background: rgba(0, 102, 204, 0.3);
  color: inherit;
}

#textbook-content ::-moz-selection {
  background: rgba(0, 102, 204, 0.3);
  color: inherit;
}

/* ==================== 右侧AI助手（无限制调节） ==================== */
.ai-assistant-panel { 
  width: 420px;
  background: white;
  border-left: 2px solid #E8EDF2;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  box-shadow: -2px 0 8px rgba(0, 102, 204, 0.05);
}

/* AI头部 - 医疗风格 */
.ai-panel-header { 
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: linear-gradient(135deg, #0066CC 0%, #00A67E 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(0, 102, 204, 0.15);
}

.ai-panel-header h3 { 
  font-size: 15px;
  font-weight: 600;
  margin: 0;
  letter-spacing: 0.3px;
}

.panel-actions { 
  display: flex;
  gap: 6px;
}

.icon-btn { 
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  color: white;
  font-size: 14px;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-btn:hover { 
  background: rgba(255,255,255,0.25);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* AI结果区 - 病历卡风格 */
.ai-result-section { 
  flex: 2;
  display: flex;
  flex-direction: column;
  border-bottom: 2px solid #E8EDF2;
  min-height: 0;
  background: #F8FAFB;
}

.section-header { 
  display: flex;
  justify-content: space-between;
  padding: 12px 16px;
  background: white;
  border-bottom: 1px solid #E8EDF2;
}

.section-title { 
  font-size: 13px;
  font-weight: 600;
  color: #0066CC;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.section-hint { 
  font-size: 11px;
  color: #95A5A6;
}

.result-content { 
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: #FAFBFC;
  min-height: 0;
}

.empty-state { 
  text-align: center;
  color: #95A5A6;
  padding: 40px 20px;
  font-size: 14px;
  background: white;
  border-radius: 8px;
  border: 2px dashed #E8EDF2;
}

.hidden { 
  display: none !important;
}

.spinner { 
  border: 3px solid #F0F4F8;
  border-top: 3px solid #0066CC;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}

@keyframes spin { 
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 高度调节器 */
.height-resizer { 
  height: 6px;
  background: linear-gradient(180deg, #E8EDF2 0%, #F0F4F8 50%, #E8EDF2 100%);
  cursor: row-resize;
  flex-shrink: 0;
  transition: all 0.2s;
  position: relative;
}

.height-resizer::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 2px;
  background: #CBD5E0;
  border-radius: 2px;
  opacity: 0;
  transition: opacity 0.2s;
}

.height-resizer:hover {
  background: linear-gradient(180deg, #0066CC 0%, #00A67E 100%);
}

.height-resizer:hover::before {
  opacity: 1;
  background: white;
}

/* AI输入区 - 处方笺风格 */
.ai-input-section { 
  flex: 1.5;
  display: flex;
  flex-direction: column;
  border-bottom: 2px solid #E8EDF2;
  min-height: 0;
  background: #FFFEF5;
}

.input-wrapper { 
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 14px;
}

#ai-input { 
  flex: 1;
  border: 2px solid #E8EDF2;
  border-radius: 8px;
  padding: 12px;
  font-size: 14px;
  font-family: inherit;
  line-height: 1.6;
  resize: none;
  background: white;
  min-height: 100px;
  color: #2C3E50;
  transition: all 0.2s;
}

#ai-input:focus { 
  outline: none;
  border-color: #0066CC;
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
  background: #FAFBFC;
}

.input-actions { 
  display: flex;
  gap: 8px;
  margin-top: 10px;
  align-items: center;
}

.action-btn { 
  padding: 8px 14px;
  border: 2px solid #E8EDF2;
  border-radius: 8px;
  background: white;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
  color: #5A6C7D;
}

.action-btn:hover { 
  background: #F0F7FF;
  border-color: #0066CC;
  color: #0066CC;
  transform: translateY(-1px);
}

.char-count { 
  margin-left: auto;
  font-size: 12px;
  color: #95A5A6;
  font-weight: 500;
}

/* AI功能区 - 医疗工具卡片 */
.ai-function-section { 
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 14px;
  background: white;
}

.module-buttons-grid { 
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: space-around;
  padding: 8px 0;
}

.module-btn { 
  flex: 1;
  min-width: 75px;
  max-width: 90px;
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 2px solid #E8EDF2;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  color: white;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  position: relative;
  overflow: hidden;
}

.module-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0) 100%);
  opacity: 0;
  transition: opacity 0.3s;
}

.module-btn:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
  border-color: transparent;
}

.module-btn:hover::before {
  opacity: 1;
}

.module-btn .icon { 
  font-size: 28px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.module-btn .text { 
  font-size: 11px;
  text-align: center;
  line-height: 1.3;
  text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* 医疗专业配色 */
.module-btn[data-module="textbook_interpretation"] { 
  background: linear-gradient(135deg, #0066CC 0%, #0052A3 100%);
}

.module-btn[data-module="simplified_explanation"] { 
  background: linear-gradient(135deg, #00A67E 0%, #008C6A 100%);
}

.module-btn[data-module="quiz_generation"] { 
  background: linear-gradient(135deg, #3498DB 0%, #2980B9 100%);
}

.module-btn[data-module="case_generation"] { 
  background: linear-gradient(135deg, #1ABC9C 0%, #16A085 100%);
}

.module-btn[data-module="free_consultation"] { 
  background: linear-gradient(135deg, #FF6B35 0%, #E85A2A 100%);
}

.function-footer { 
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid #E8EDF2;
}

.shortcut-hint { 
  font-size: 11px;
  color: #95A5A6;
  display: block;
  text-align: center;
  line-height: 1.5;
}

/* ==================== 滚动条美化 ==================== */
::-webkit-scrollbar { 
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track { 
  background: #F5F8FA;
  border-radius: 5px;
}

::-webkit-scrollbar-thumb { 
  background: linear-gradient(180deg, #0066CC 0%, #00A67E 100%);
  border-radius: 5px;
  border: 2px solid #F5F8FA;
}

::-webkit-scrollbar-thumb:hover { 
  background: linear-gradient(180deg, #0052A3 0%, #008C6A 100%);
}

.sidebar header { 
  padding: 16px; 
  background: linear-gradient(135deg, #0ea5e9, #10b981); 
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.sidebar h2 { font-size: 16px; margin: 0; }
.back-link { 
  color: rgba(255,255,255,0.9); 
  text-decoration: none; 
  font-size: 13px; 
  padding: 4px 10px;
  border-radius: 4px;
  transition: 0.2s;
}
.back-link:hover { background: rgba(255,255,255,0.2); }
.control-group { padding: 16px; border-bottom: 1px solid #eee; }
.control-group label { display: block; font-size: 13px; color: #666; margin-bottom: 8px; font-weight: 500; }
#textbook-selector { width: 100%; padding: 8px; border: 1px solid #ddd; border-radius: 4px; font-size: 14px; }
#textbook-selector:focus { outline: none; border-color: #0ea5e9; }
#toc-container { flex: 1; overflow-y: auto; padding: 8px; }
#toc-tree { list-style: none; }
#toc-tree li { margin: 2px 0; }
#toc-tree a { display: block; padding: 8px 12px; color: #333; text-decoration: none; border-radius: 4px; font-size: 14px; transition: 0.2s; }
#toc-tree a:hover { background: #f0f0f0; color: #0ea5e9; }
#toc-tree a.active { background: #e0f2fe; color: #0ea5e9; font-weight: 500; }
#toc-tree ul { list-style: none; margin-left: 16px; }

/* 调节器 */
.resizer { width: 4px; background: #e0e0e0; cursor: col-resize; flex-shrink: 0; transition: 0.2s; }
.resizer:hover { background: #0ea5e9; }

/* 中间内容区 */
.content-area { flex: 1; min-width: 0; background: #fff; display: flex; flex-direction: column; }
#textbook-content-wrapper { flex: 1; overflow-y: auto; padding: 32px; }
#textbook-content { max-width: 900px; margin: 0 auto; }
#textbook-content h1 { font-size: 28px; margin-bottom: 20px; padding-bottom: 12px; border-bottom: 2px solid #eee; }
#textbook-content h2 { font-size: 22px; margin: 28px 0 14px; color: #0ea5e9; }
#textbook-content h3 { font-size: 18px; margin: 20px 0 10px; }
#textbook-content p { margin-bottom: 14px; line-height: 1.8; text-indent: 2em; }
#textbook-content .placeholder { text-align: center; color: #999; padding: 60px 20px; font-size: 15px; text-indent: 0; }
#textbook-content ul, #textbook-content ol { margin-left: 2em; margin-bottom: 14px; }
#textbook-content li { margin-bottom: 6px; line-height: 1.7; }

/* 右侧AI助手 - 无限制调节 */
.ai-assistant-panel { 
  width: 380px;
  background: #fff; 
  border-left: 1px solid #ddd; 
  display: flex; 
  flex-direction: column; 
  flex-shrink: 0; 
}

/* AI头部 */
.ai-panel-header { 
  display: flex; 
  justify-content: space-between; 
  align-items: center;
  padding: 14px 16px; 
  background: linear-gradient(135deg, #0ea5e9, #8b5cf6); 
  color: white; 
}
.ai-panel-header h3 { font-size: 15px; margin: 0; }
.panel-actions { display: flex; gap: 8px; }
.icon-btn { 
  background: rgba(255,255,255,0.2); 
  border: none; 
  color: white; 
  font-size: 16px; 
  width: 32px; 
  height: 32px; 
  border-radius: 6px; 
  cursor: pointer; 
  transition: 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.icon-btn:hover { background: rgba(255,255,255,0.3); transform: scale(1.05); }

/* AI结果区 */
.ai-result-section { 
  flex: 2; 
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid #eee; 
  min-height: 0;
}
.section-header { 
  display: flex; 
  justify-content: space-between; 
  padding: 10px 14px; 
  background: #f8f9fa; 
  border-bottom: 1px solid #eee; 
}
.section-title { font-size: 12px; font-weight: 600; color: #555; }
.section-hint { font-size: 11px; color: #999; }
.result-content { flex: 1; overflow-y: auto; padding: 14px; background: #fafafa; min-height: 0; }
.empty-state { text-align: center; color: #999; padding: 30px 16px; font-size: 13px; }
.hidden { display: none !important; }
.spinner { border: 3px solid #f0f0f0; border-top: 3px solid #0ea5e9; border-radius: 50%; width: 36px; height: 36px; animation: spin 0.8s linear infinite; margin: 0 auto 12px; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* 高度调节器 */
.height-resizer { height: 4px; background: #e0e0e0; cursor: row-resize; flex-shrink: 0; transition: 0.2s; }
.height-resizer:hover { background: #0ea5e9; }

/* AI输入区 */
.ai-input-section { 
  flex: 1.5; 
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid #eee; 
  min-height: 0;
}
.input-wrapper { 
  flex: 1; 
  display: flex; 
  flex-direction: column; 
  padding: 10px; 
}
#ai-input { 
  flex: 1;
  border: 1px solid #ddd; 
  border-radius: 6px; 
  padding: 10px; 
  font-size: 13px; 
  font-family: inherit; 
  line-height: 1.6;
  resize: none;
  background: #fffbeb;
  min-height: 80px;
}
#ai-input:focus { outline: none; border-color: #0ea5e9; box-shadow: 0 0 0 2px rgba(14,165,233,0.1); }
.input-actions { 
  display: flex; 
  gap: 8px; 
  margin-top: 8px; 
  align-items: center; 
}
.action-btn { 
  padding: 6px 12px; 
  border: 1px solid #ddd; 
  border-radius: 6px; 
  background: #fff; 
  font-size: 12px; 
  cursor: pointer; 
  transition: 0.2s;
  display: flex;
  align-items: center;
  gap: 4px;
}
.action-btn:hover { background: #f0f0f0; border-color: #0ea5e9; }
.char-count { margin-left: auto; font-size: 11px; color: #999; }

/* AI功能区 */
.ai-function-section { 
  flex: 1; 
  display: flex; 
  flex-direction: column; 
  padding: 14px;
  background: #FAFBFC;
  border-top: 2px solid #E8EDF2;
  border-bottom: 2px solid #E8EDF2;
}
.module-buttons-grid { 
  display: flex; 
  flex-direction: row;
  flex-wrap: wrap;
  gap: 8px;
  padding: 6px 0;
  justify-content: space-between;
}
.module-btn { 
  flex: 1;
  min-width: 70px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none; 
  border-radius: 8px; 
  font-size: 12px;
  font-weight: 500;
  color: white; 
  cursor: pointer;
  transition: 0.2s;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.module-btn:hover { 
  transform: translateY(-2px); 
  box-shadow: 0 4px 8px rgba(0,0,0,0.15); 
}
.module-btn .icon { 
  font-size: 16px; 
}
.module-btn .text { 
  font-size: 12px; 
  letter-spacing: 0.3px;
  white-space: nowrap;
}

/* 功能按钮统一医疗配色 - 蓝绿色系，高对比度 */
.module-btn[data-module="textbook_interpretation"] { 
  background: linear-gradient(135deg, #0066CC 0%, #0052A3 100%); 
}
.module-btn[data-module="simplified_explanation"] { 
  background: linear-gradient(135deg, #00A67E 0%, #008C6A 100%); 
}
.module-btn[data-module="quiz_generation"] { 
  background: linear-gradient(135deg, #0078D4 0%, #005A9E 100%); 
}
.module-btn[data-module="case_generation"] { 
  background: linear-gradient(135deg, #00B294 0%, #009B7D 100%); 
}
.module-btn[data-module="free_consultation"] { 
  background: linear-gradient(135deg, #2C6FBB 0%, #1E5499 100%); 
}

.function-footer { 
  margin-top: auto; 
  padding-top: 8px; 
  border-top: 1px solid #eee; 
}
.shortcut-hint { 
  font-size: 10px; 
  color: #999; 
  display: block; 
  text-align: center; 
  line-height: 1.4;
}

/* 滚动条美化 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #f5f5f5; }
::-webkit-scrollbar-thumb { background: #ccc; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #999; }

/* ==================== 结构化组件样式 ==================== */

/* 内容块基础样式 */
.content-block {
  margin-bottom: 15px;
  padding: 15px;
  border-radius: 8px;
  border-left: 4px solid;
  background-color: white;
}

/* 检索数据样式 */
.content-block.source-retrieved {
  background-color: #e8f5e9;
  border-left-color: #4caf50;
}

/* AI补充样式 */
.content-block.source-ai {
  background-color: #e3f2fd;
  border-left-color: #2196f3;
}

/* 无数据样式 */
.content-block.source-none {
  background-color: #f5f5f5;
  border-left-color: #9e9e9e;
}

/* 来源标识 */
.source-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: bold;
  margin-bottom: 10px;
}

.source-retrieved .source-badge {
  background-color: #4caf50;
  color: white;
}

.source-ai .source-badge {
  background-color: #2196f3;
  color: white;
}

.source-none .source-badge {
  background-color: #9e9e9e;
  color: white;
}

/* 结构化列表 */
.structured-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.list-item {
  background-color: white;
  padding: 12px;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.list-item-title {
  font-weight: bold;
  color: #333;
  margin-bottom: 6px;
  font-size: 15px;
}

.list-item-content {
  color: #666;
  line-height: 1.6;
}

/* 分类展示 */
.categorized-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.category-section {
  background-color: white;
  padding: 12px;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.category-title {
  font-weight: bold;
  color: #0066cc;
  margin-bottom: 8px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.category-content {
  color: #666;
  line-height: 1.6;
}

/* 卡片式布局 */
.card-layout {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.info-card {
  background-color: white;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0,0,0,0.08);
  transition: transform 0.2s, box-shadow 0.2s;
}

.info-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.12);
}

.card-header {
  background-color: #f5f5f5;
  padding: 12px 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #e0e0e0;
}

.card-title {
  margin: 0;
  color: #333;
  font-size: 16px;
  font-weight: bold;
}

.card-subtitle {
  background-color: #ff9800;
  color: white;
  padding: 3px 10px;
  border-radius: 10px;
  font-size: 12px;
}

.card-body {
  padding: 15px;
}

.card-field {
  margin: 8px 0;
  line-height: 1.6;
}

.card-field-label {
  color: #1976d2;
  font-weight: bold;
  margin-right: 6px;
}

.card-field-value {
  color: #666;
}

/* 来源引用 */
.source-ref {
  display: inline-block;
  margin-left: 8px;
  color: #4caf50;
  font-size: 12px;
  font-weight: bold;
}

.ai-note {
  display: inline-block;
  margin-left: 8px;
  color: #2196f3;
  font-size: 12px;
  font-style: italic;
}

/* 思维导图容器 */
.mermaid-container {
  background-color: white;
  padding: 20px;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
  margin: 15px 0;
  overflow-x: auto;
}

.mermaid-container .mermaid {
  display: flex;
  justify-content: center;
  min-height: 200px;
}

/* 测验卡片 */
.quiz-card {
  background-color: white;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 15px;
  transition: border-color 0.3s;
}

.quiz-card:hover {
  border-color: #2196f3;
}

.quiz-question {
  font-weight: bold;
  color: #333;
  margin-bottom: 12px;
  font-size: 15px;
  line-height: 1.6;
}

.quiz-answer {
  background-color: #e8f5e9;
  padding: 10px;
  border-radius: 6px;
  margin-bottom: 10px;
  border-left: 3px solid #4caf50;
}

.quiz-answer-label {
  font-weight: bold;
  color: #2e7d32;
  margin-bottom: 5px;
}

.quiz-answer-content {
  color: #555;
  line-height: 1.6;
}

.quiz-analysis {
  background-color: #fff3e0;
  padding: 10px;
  border-radius: 6px;
  border-left: 3px solid #ff9800;
}

.quiz-analysis-label {
  font-weight: bold;
  color: #e65100;
  margin-bottom: 5px;
}

.quiz-analysis-content {
  color: #555;
  line-height: 1.6;
}

/* 对比表格 */
.comparison-table {
  width: 100%;
  border-collapse: collapse;
  margin: 15px 0;
  background-color: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

.comparison-table th {
  background-color: #0066cc;
  color: white;
  padding: 12px;
  text-align: left;
  font-weight: bold;
  font-size: 14px;
}

.comparison-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #e0e0e0;
  color: #666;
  line-height: 1.5;
}

.comparison-table tr:last-child td {
  border-bottom: none;
}

.comparison-table tr:hover td {
  background-color: #f5f5f5;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  
  .comparison-table {
    font-size: 13px;
  }
  
  .comparison-table th,
  .comparison-table td {
    padding: 8px;
  }
}

