/* ============================================================
   LangGraph Learn — Custom Styles
   深色主题 · 品牌色 #7c5cfc · 圆角卡片 · 平滑过渡
   ============================================================ */

/* ---------- 全局基础 ---------- */
:root {
  --brand: #7c5cfc;
  --brand-light: #9b7efd;
  --brand-dark: #5a3db8;
  --bg-primary: #1a1a2e;
  --bg-secondary: #16213e;
  --bg-card: #1e2a4a;
  --bg-code: #0f0f23;
  --text-primary: #e8e8f0;
  --text-secondary: #a0a0b8;
  --text-muted: #6c6c8a;
  --border: #2a2a4a;
  --success: #2d7d46;
  --info: #2563eb;
  --warning: #d97706;
  --danger: #dc2626;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  --transition: all 0.3s ease;
}

* {
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  font-size: 16px;
}

/* ---------- 滚动条 ---------- */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--brand-dark);
}

/* ---------- 侧边栏 ---------- */
.sidebar {
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  color: var(--text-primary);
}
.sidebar a {
  color: var(--text-secondary);
  transition: var(--transition);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  margin: 2px 8px;
}
.sidebar a:hover {
  color: var(--brand-light);
  background: rgba(124, 92, 252, 0.1);
}
.sidebar ul li a.active {
  color: var(--brand);
  border-left: 3px solid var(--brand);
  background: rgba(124, 92, 252, 0.08);
}
.sidebar-nav {
  padding: 12px 0;
}
.sidebar-nav ul {
  list-style: none;
  padding-left: 0;
}
.sidebar-nav ul li {
  margin: 4px 0;
}
.sidebar-nav ul ul {
  padding-left: 16px;
}
.sidebar .sidebar-nav li > p {
  font-weight: 600;
  color: var(--text-primary);
  padding: 8px 16px 4px;
  margin: 0;
  font-size: 0.85em;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.7;
}

/* ---------- 搜索框 ---------- */
.search {
  border-bottom: 1px solid var(--border) !important;
  padding: 12px 16px !important;
}
.search input {
  background: var(--bg-primary) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-sm) !important;
  color: var(--text-primary) !important;
  padding: 8px 12px !important;
  font-size: 14px !important;
  transition: var(--transition);
}
.search input:focus {
  border-color: var(--brand) !important;
  box-shadow: 0 0 0 2px rgba(124, 92, 252, 0.2) !important;
  outline: none !important;
}
.search .clear-button {
  color: var(--text-muted) !important;
}

/* ---------- 内容区域 ---------- */
.content {
  background: var(--bg-primary);
}
.markdown-section {
  max-width: 860px;
  padding: 32px 48px;
}
.markdown-section h1,
.markdown-section h2,
.markdown-section h3,
.markdown-section h4 {
  color: var(--text-primary);
  font-weight: 600;
  margin-top: 2em;
  margin-bottom: 0.8em;
}
.markdown-section h1 {
  font-size: 2.2em;
  border-bottom: 2px solid var(--brand);
  padding-bottom: 12px;
}
.markdown-section h2 {
  font-size: 1.6em;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}
.markdown-section h3 {
  font-size: 1.25em;
}
.markdown-section h4 {
  font-size: 1.05em;
  color: var(--brand-light);
}
.markdown-section p {
  color: var(--text-secondary);
  margin-bottom: 1em;
}
.markdown-section a {
  color: var(--brand-light);
  text-decoration: none;
  transition: var(--transition);
  border-bottom: 1px solid transparent;
}
.markdown-section a:hover {
  color: var(--brand);
  border-bottom-color: var(--brand);
}

/* ---------- 引用块 ---------- */
.markdown-section blockquote {
  border-left: 4px solid var(--brand);
  background: rgba(124, 92, 252, 0.08);
  padding: 12px 20px;
  margin: 16px 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-secondary);
}
.markdown-section blockquote p {
  margin: 4px 0;
}

/* ---------- 代码块 ---------- */
.markdown-section pre {
  background: var(--bg-code) !important;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 20px 24px;
  overflow-x: auto;
  position: relative;
  margin: 20px 0;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
  transition: var(--transition);
}
.markdown-section pre:hover {
  border-color: var(--brand);
  box-shadow: 0 4px 20px rgba(124, 92, 252, 0.2);
}
.markdown-section code {
  font-family: 'Fira Code', 'JetBrains Mono', 'Cascadia Code', Consolas, monospace;
  font-size: 0.88em;
  background: rgba(124, 92, 252, 0.1);
  color: var(--brand-light);
  padding: 2px 6px;
  border-radius: 4px;
}
.markdown-section pre code {
  background: transparent;
  color: var(--text-primary);
  padding: 0;
  border-radius: 0;
  font-size: 0.92em;
  line-height: 1.65;
}

/* 代码块语言标签（右上角） */
.markdown-section pre[data-lang]::before {
  content: attr(data-lang);
  display: block;
  position: absolute;
  top: 0;
  right: 0;
  background: var(--brand-dark);
  color: #fff;
  padding: 3px 12px;
  font-size: 0.7em;
  border-radius: 0 var(--radius-sm) 0 var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  opacity: 0.85;
  z-index: 2;
}

/* Prism 行号 */
.line-numbers .line-numbers-rows {
  border-right: 1px solid var(--border) !important;
  padding: 20px 0 !important;
  top: 0;
}
.line-numbers .line-numbers-rows > span::before {
  color: var(--text-muted) !important;
  padding-right: 12px !important;
}

/* 行号容器调整 */
.markdown-section pre.line-numbers {
  padding-left: 60px !important;
}

/* 复制按钮 */
.docsify-copy-code-button {
  background: var(--brand-dark) !important;
  border: 1px solid var(--brand) !important;
  border-radius: var(--radius-sm) !important;
  color: #fff !important;
  font-size: 0.75em !important;
  padding: 4px 14px !important;
  transition: var(--transition);
  cursor: pointer;
  z-index: 3;
}
.docsify-copy-code-button:hover {
  background: var(--brand) !important;
  border-color: var(--brand-light) !important;
}
.docsify-copy-code-button.success {
  background: var(--success) !important;
  border-color: #4ade80 !important;
}

/* 行内代码与代码块的上下文过渡 */
.markdown-section p + pre,
.markdown-section ul + pre,
.markdown-section ol + pre {
  margin-top: 12px;
}
.markdown-section pre + p,
.markdown-section pre + ul,
.markdown-section pre + ol {
  margin-top: 20px;
}

/* 代码块内 highlighted lines */
.markdown-section pre .highlight-line {
  background: rgba(124, 92, 252, 0.1);
  display: block;
  margin: 0 -24px;
  padding: 0 24px;
  border-left: 3px solid var(--brand);
}

/* ---------- 表格 ---------- */
.markdown-section table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 16px 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.markdown-section table thead {
  background: linear-gradient(135deg, var(--brand-dark), var(--brand));
}
.markdown-section table th {
  color: #fff;
  font-weight: 600;
  padding: 12px 16px;
  text-align: left;
  font-size: 0.95em;
  letter-spacing: 0.3px;
}
.markdown-section table td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  background: var(--bg-card);
}
.markdown-section table tr:last-child td {
  border-bottom: none;
}
.markdown-section table tr:hover td {
  background: rgba(124, 92, 252, 0.05);
}

/* ---------- 列表 ---------- */
.markdown-section ul,
.markdown-section ol {
  color: var(--text-secondary);
  padding-left: 24px;
}
.markdown-section li {
  margin: 6px 0;
}
.markdown-section li > input[type="checkbox"] {
  accent-color: var(--brand);
}

/* ---------- 水平线 ---------- */
.markdown-section hr {
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--brand), transparent);
  margin: 32px 0;
}

/* ---------- 图片 ---------- */
.markdown-section img {
  max-width: 100%;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  margin: 16px 0;
}

/* ---------- 任务列表 ---------- */
.markdown-section .task-list-item {
  list-style: none;
  margin-left: -24px;
}
.markdown-section .task-list-item input[type="checkbox"] {
  margin-right: 8px;
}

/* ---------- 目录 (TOC) ---------- */
.markdown-section .docsify-toc {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 24px;
  margin: 16px 0;
}

/* ============================================================
   思维链专用样式
   ============================================================ */

/* 思维链容器 */
.chain-of-thought {
  background: rgba(124, 92, 252, 0.06);
  border: 1px solid var(--brand);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin: 20px 0;
  position: relative;
}
.chain-of-thought::before {
  content: '🧠 思维链引导';
  display: block;
  font-weight: 600;
  color: var(--brand);
  font-size: 0.85em;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
}
.chain-of-thought ol {
  margin: 0;
  padding-left: 20px;
}
.chain-of-thought li {
  margin: 8px 0;
  color: var(--text-primary);
}
.chain-of-thought li strong {
  color: var(--brand-light);
}

/* 思维链步骤 */
.cot-step {
  display: flex;
  align-items: flex-start;
  margin: 12px 0;
}
.cot-step-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  background: var(--brand);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  margin-right: 12px;
  margin-top: 2px;
}
.cot-step-content {
  flex: 1;
  color: var(--text-secondary);
  line-height: 1.6;
}
.cot-step-content strong {
  color: var(--text-primary);
}

/* ============================================================
   揭露式引导卡片
   ============================================================ */

.reveal-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin: 20px 0;
  position: relative;
  transition: var(--transition);
}
.reveal-card:hover {
  border-color: var(--brand);
  box-shadow: 0 4px 20px rgba(124, 92, 252, 0.15);
}
.reveal-card::before {
  content: '🔍 揭露时刻';
  display: block;
  font-weight: 600;
  color: var(--brand);
  font-size: 0.85em;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

/* ============================================================
   关键知识点卡片
   ============================================================ */

.key-point {
  background: linear-gradient(135deg, rgba(124, 92, 252, 0.1), rgba(45, 125, 70, 0.1));
  border: 1px solid var(--brand);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin: 20px 0;
}
.key-point::before {
  content: '💡 关键知识点';
  display: block;
  font-weight: 600;
  color: var(--brand);
  font-size: 0.85em;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}
.key-point ul {
  margin: 8px 0 0;
  padding-left: 20px;
}
.key-point li {
  margin: 6px 0;
}

/* ============================================================
   难度徽章
   ============================================================ */

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75em;
  font-weight: 600;
  letter-spacing: 0.3px;
  vertical-align: middle;
}
.badge-beginner {
  background: rgba(45, 125, 70, 0.2);
  color: #4ade80;
  border: 1px solid rgba(45, 125, 70, 0.4);
}
.badge-intermediate {
  background: rgba(37, 99, 235, 0.2);
  color: #60a5fa;
  border: 1px solid rgba(37, 99, 235, 0.4);
}
.badge-production {
  background: rgba(217, 119, 6, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(217, 119, 6, 0.4);
}
.badge-expert {
  background: rgba(220, 38, 38, 0.2);
  color: #f87171;
  border: 1px solid rgba(220, 38, 38, 0.4);
}

/* ============================================================
   课前思考
   ============================================================ */

.prethink {
  background: rgba(37, 99, 235, 0.06);
  border: 1px solid var(--info);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin: 20px 0;
}
.prethink::before {
  content: '🤔 课前思考';
  display: block;
  font-weight: 600;
  color: var(--info);
  font-size: 0.85em;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}
.prethink ul {
  margin: 8px 0 0;
  padding-left: 20px;
}

/* ============================================================
   步骤容器
   ============================================================ */

.step-container {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin: 24px 0;
}
.step-title {
  font-weight: 600;
  font-size: 1.1em;
  color: var(--brand-light);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

/* ============================================================
   警告 / 提示 / 注意
   ============================================================ */

.tip {
  background: rgba(45, 125, 70, 0.1);
  border-left: 4px solid var(--success);
  padding: 12px 16px;
  margin: 16px 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-secondary);
}
.tip::before {
  content: '💡 提示: ';
  font-weight: 600;
  color: var(--success);
}
.warning {
  background: rgba(217, 119, 6, 0.1);
  border-left: 4px solid var(--warning);
  padding: 12px 16px;
  margin: 16px 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-secondary);
}
.warning::before {
  content: '⚠️ 注意: ';
  font-weight: 600;
  color: var(--warning);
}
.danger {
  background: rgba(220, 38, 38, 0.1);
  border-left: 4px solid var(--danger);
  padding: 12px 16px;
  margin: 16px 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-secondary);
}
.danger::before {
  content: '🚨 警告: ';
  font-weight: 600;
  color: var(--danger);
}

/* ============================================================
   下一步导航
   ============================================================ */

.next-step {
  background: linear-gradient(135deg, var(--bg-card), rgba(124, 92, 252, 0.08));
  border: 1px solid var(--brand);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin: 32px 0;
  text-align: center;
}
.next-step a {
  display: inline-block;
  background: var(--brand);
  color: #fff !important;
  padding: 10px 24px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  transition: var(--transition);
  border: none !important;
}
.next-step a:hover {
  background: var(--brand-light);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(124, 92, 252, 0.4);
}
.next-step .prev-link {
  display: inline-block;
  color: var(--text-secondary) !important;
  padding: 10px 24px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  margin-right: 12px;
  transition: var(--transition);
  border: 1px solid var(--border) !important;
}
.next-step .prev-link:hover {
  border-color: var(--brand) !important;
  color: var(--brand) !important;
}

/* ============================================================
   分页导航
   ============================================================ */

.docsify-pagination-container {
  border-top: 1px solid var(--border) !important;
  padding-top: 24px !important;
  margin-top: 32px !important;
}
.pagination-item-label {
  color: var(--text-muted) !important;
  font-size: 0.85em !important;
}
.pagination-item-title {
  color: var(--brand-light) !important;
  font-size: 1em !important;
}
.pagination-item:hover .pagination-item-title {
  color: var(--brand) !important;
}

/* ============================================================
   封面页
   ============================================================ */

.cover {
  background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 50%, #0f0f23 100%) !important;
}
.cover-main {
  margin: 0 auto;
  max-width: 800px;
}
.cover-main h1 {
  font-size: 3.5em;
  background: linear-gradient(135deg, var(--brand), var(--brand-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 16px;
}
.cover-main blockquote {
  border-left-color: var(--brand) !important;
}
.cover-main .cover-button {
  background: var(--brand) !important;
  color: #fff !important;
  border: none !important;
  border-radius: var(--radius-sm) !important;
  padding: 12px 32px !important;
  font-size: 1.1em !important;
  transition: var(--transition);
}
.cover-main .cover-button:hover {
  background: var(--brand-light) !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(124, 92, 252, 0.4);
}
.cover-main ul {
  color: var(--text-secondary) !important;
}

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

@media (max-width: 768px) {
  .markdown-section {
    padding: 16px 24px;
  }
  .markdown-section h1 {
    font-size: 1.6em;
  }
  .markdown-section h2 {
    font-size: 1.3em;
  }
  .sidebar {
    width: 260px !important;
    transform: translateX(-260px);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  body.close .sidebar {
    transform: translateX(-260px);
  }
  .cover-main h1 {
    font-size: 2em;
  }
  .next-step .prev-link,
  .next-step a {
    display: block;
    margin: 8px 0;
  }
}

@media (max-width: 480px) {
  .markdown-section {
    padding: 12px 16px;
  }
  .markdown-section table {
    font-size: 0.85em;
  }
  .markdown-section table th,
  .markdown-section table td {
    padding: 8px 10px;
  }
}

/* ============================================================
   自定义滚动条动画
   ============================================================ */

.sidebar a,
.markdown-section a,
.markdown-section pre,
.markdown-section img,
.reveal-card,
.key-point,
.chain-of-thought,
.step-container {
  transition: var(--transition);
}

/* ============================================================
   字数统计
   ============================================================ */

.count {
  color: var(--text-muted) !important;
  border-bottom: 1px solid var(--border) !important;
  padding-bottom: 4px !important;
  margin-bottom: 8px !important;
}

/* ============================================================
   Mermaid 图表
   ============================================================ */

.markdown-section .mermaid {
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin: 16px 0;
  text-align: center;
}

/* ============================================================
   键盘按键样式
   ============================================================ */

.markdown-section kbd {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-primary);
  padding: 2px 8px;
  font-size: 0.85em;
  font-family: inherit;
  box-shadow: 0 1px 0 var(--border);
}

/* ============================================================
   详情/折叠
   ============================================================ */

.markdown-section details {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin: 16px 0;
}
.markdown-section details summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--brand-light);
}
.markdown-section details summary:hover {
  color: var(--brand);
}
.markdown-section details[open] {
  padding-bottom: 16px;
}

/* ============================================================
   图片缩放
   ============================================================ */

.zoom-image {
  cursor: zoom-in;
  transition: var(--transition);
}
.zoom-image:hover {
  opacity: 0.9;
}

/* ============================================================
   固定工具栏（回到顶部 + 思维导图切换）
   ============================================================ */

.deer-toolbar {
  position: fixed;
  top: 16px;
  right: 24px;
  z-index: 9998;
  display: flex;
  gap: 8px;
  background: rgba(30, 42, 74, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 6px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

.deer-tb-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid transparent;
  border-radius: 22px;
  padding: 8px 14px;
  font-size: 0.82em;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.25s ease;
  white-space: nowrap;
  outline: none;
}
.deer-tb-btn:hover {
  background: rgba(124, 92, 252, 0.15);
  color: var(--brand-light);
  border-color: rgba(124, 92, 252, 0.3);
}
.deer-tb-btn svg {
  flex-shrink: 0;
}
.deer-tb-btn.active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
  box-shadow: 0 0 12px rgba(124, 92, 252, 0.4);
}
.deer-tb-btn.active:hover {
  background: var(--brand-light);
}

/* ============================================================
   Mermaid 全屏遮罩
   ============================================================ */

.deer-fullscreen-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(10, 10, 30, 0.96);
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.deer-fs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  border-bottom: 1px solid rgba(124, 92, 252, 0.2);
  background: rgba(26, 26, 46, 0.8);
  flex-shrink: 0;
}

.deer-fs-title {
  color: var(--text-primary);
  font-size: 0.95em;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.deer-fs-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.deer-fs-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(124, 92, 252, 0.12);
  color: var(--text-secondary);
  border: 1px solid rgba(124, 92, 252, 0.2);
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 0.8em;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
  outline: none;
  white-space: nowrap;
}
.deer-fs-btn:hover {
  background: rgba(124, 92, 252, 0.25);
  color: var(--brand-light);
  border-color: var(--brand);
}

.deer-fs-export {
  background: rgba(124, 92, 252, 0.2);
  font-weight: 600;
  letter-spacing: 0.3px;
}
.deer-fs-export:hover {
  background: var(--brand);
  color: #fff;
}

.deer-fs-close {
  margin-left: 4px;
  font-size: 1.1em;
  padding: 5px 12px;
}
.deer-fs-close:hover {
  background: rgba(220, 38, 38, 0.3);
  color: #f87171;
  border-color: rgba(220, 38, 38, 0.5);
}

.deer-fs-sep {
  width: 1px;
  height: 20px;
  background: rgba(124, 92, 252, 0.2);
  margin: 0 4px;
}

.deer-fs-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  padding: 32px;
}
.deer-fs-body svg {
  max-width: 100%;
  max-height: 100%;
  border-radius: 4px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
}

/* ============================================================
   Markmap 思维导图容器
   ============================================================ */

.deer-markmap-container {
  display: none; /* 默认隐藏，导图模式打开 */
  width: 100%;
  height: calc(100vh - 60px); /* 留出顶部导航空间 */
  min-height: 500px;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  overflow: hidden;
}
.deer-markmap-container svg {
  cursor: grab;
}
.deer-markmap-container svg:active {
  cursor: grabbing;
}

.deer-markmap-loading,
.deer-markmap-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: var(--text-muted);
  font-size: 0.95em;
}

.deer-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: deer-spin 0.8s linear infinite;
}

@keyframes deer-spin {
  to { transform: rotate(360deg); }
}

/* markmap 节点样式覆盖（深色适配） */
.deer-markmap-container .markmap-node .markmap-foreign {
  color: var(--text-primary);
}
.deer-markmap-container .markmap-link {
  stroke: rgba(124, 92, 252, 0.3);
}

/* ============================================================
   响应式 — 工具栏适配
   ============================================================ */

@media (max-width: 768px) {
  .deer-toolbar {
    top: 8px;
    right: 8px;
    gap: 4px;
    padding: 4px;
  }
  .deer-tb-btn {
    padding: 7px 12px;
    font-size: 0.75em;
    gap: 4px;
  }
  .deer-tb-btn span {
    display: none;
  }
  .deer-fs-header {
    padding: 8px 14px;
  }
  .deer-fs-actions {
    gap: 3px;
  }
  .deer-fs-btn {
    padding: 5px 8px;
    font-size: 0.72em;
  }
  .deer-fs-body {
    padding: 16px;
  }
}
