/* ============================================================
   xs —— 小说写作工具 · 自定义样式 v2.0
   设计系统：文学创作工具 | 温暖、专业、沉浸式
   ============================================================ */

/* ---- CSS 变量 ---- */
:root {
  --primary: #3B5998;
  --primary-light: #5B7AB8;
  --primary-dark: #2A4070;
  --accent: #8B5CF6;
  --bg: #FAF9F7;
  --bg-sidebar: #F0EFED;
  --card: #FFFFFF;
  --text: #1A1A2E;
  --text-secondary: #4A4A6A;
  --text-muted: #8B8B9E;
  --border: #E2E0DD;
  --border-light: #EDEBE8;
  --danger: #E53E3E;
  --success: #38A169;
  --warning: #D69E2E;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
  --shadow: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 14px;
  --sidebar-width: 280px;
  --sidebar-collapsed: 0px;
  --topbar-height: 44px;
  --transition: 180ms ease;
}

/* ---- 全局基础 ---- */
* { box-sizing: border-box; }
html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
body { overflow: hidden; }

/* ---- 滚动条 ---- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #D0CDC8; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #B0ADA8; }

/* ============================================================
   布局系统 —— 全宽 + 可折叠侧栏
   ============================================================ */

/* 主工作区：flex row，撑满剩余高度 */
.workspace {
  display: flex;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

/* 左侧边栏 */
.sidebar {
  width: var(--sidebar-width);
  min-width: 0;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  overflow-x: hidden;
  flex-shrink: 0;
  transition: width var(--transition), min-width var(--transition);
}
.sidebar.collapsed {
  width: 0;
  border-right: none;
}
/* 侧栏折叠后的把手 */
.sidebar-handle {
  width: 4px;
  flex-shrink: 0;
  background: var(--border);
  cursor: col-resize;
  transition: background var(--transition);
}
.sidebar-handle:hover { background: var(--primary-light); }
.sidebar-handle.collapsed {
  width: 8px;
  background: var(--primary-light);
  opacity: 0.5;
}
.sidebar-handle.collapsed:hover { opacity: 1; }

/* 侧栏内边距 */
.sidebar-inner {
  padding: 12px;
  min-width: var(--sidebar-width);
}

/* 内容区域 */
.content-area {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--bg);
  min-height: 0;
}

/* ============================================================
   侧栏树形导航
   ============================================================ */

.tree-section {
  margin-bottom: 4px;
}
.tree-section-header {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: background var(--transition);
  user-select: none;
}
.tree-section-header:hover { background: rgba(0,0,0,0.04); }
.tree-section-header .chevron {
  width: 16px; height: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px;
  transition: transform var(--transition);
}
.tree-section-header .chevron.open { transform: rotate(90deg); }
.tree-section-header .count {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 400;
}
.tree-section-header .vol-actions { display: none !important; }
.tree-section-header:hover .vol-actions { display: flex !important; }

.tree-section-children {
  padding-left: 8px;
  overflow: hidden;
  transition: max-height 0.25s ease;
}
.tree-section-children.collapsed { max-height: 0 !important; }

.tree-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  color: var(--text-secondary);
  transition: all var(--transition);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tree-item:hover { background: rgba(59,89,152,0.08); color: var(--primary); }
.tree-item.active { background: rgba(59,89,152,0.12); color: var(--primary); font-weight: 600; }
.tree-item .item-icon { font-size: 14px; flex-shrink: 0; opacity: 0.7; }
.tree-item .item-title { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.tree-item .item-badge {
  font-size: 10px;
  color: var(--text-muted);
  flex-shrink: 0;
  margin-left: 4px;
}

/* 新建按钮 */
.tree-add-btn {
  display: block;
  width: 100%;
  padding: 4px 8px;
  margin: 2px 0;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  text-align: left;
  transition: all var(--transition);
}
.tree-add-btn:hover {
  border-color: var(--primary-light);
  color: var(--primary);
  background: rgba(59,89,152,0.04);
}

/* ============================================================
   顶部标签栏
   ============================================================ */
.tab-bar {
  display: flex;
  align-items: center;
  height: var(--topbar-height);
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 0 12px;
  gap: 2px;
  overflow-x: auto;
  flex-shrink: 0;
}
.tab-btn {
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition);
}
.tab-btn:hover { color: var(--text); background: rgba(0,0,0,0.04); }
.tab-btn.active {
  color: var(--primary);
  background: rgba(59,89,152,0.08);
  font-weight: 600;
}
.tab-btn.back {
  color: var(--text-muted);
  font-size: 12px;
  margin-right: 8px;
}

/* 侧栏切换按钮 */
.sidebar-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-muted);
  font-size: 16px;
  margin-right: 4px;
  transition: all var(--transition);
}
.sidebar-toggle:hover { background: rgba(0,0,0,0.06); color: var(--text); }
.sidebar-toggle::before {
  content: '☰';
  font-size: 16px;
}

/* 灵感侧边栏（作为workspace内flex面板） */
.insp-sidebar {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  background: var(--card);
  border-left: 1px solid var(--border);
  overflow: hidden;
}
.insp-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.insp-sidebar-header h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
}
.insp-sidebar-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  min-height: 0;
}
.insp-sidebar-footer {
  border-top: 1px solid var(--border-light);
  padding: 10px;
  flex-shrink: 0;
}
.insp-item {
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  margin-bottom: 6px;
  transition: background var(--transition);
}
.insp-item:hover { background: rgba(59,89,152,0.04); }
.insp-item-actions {
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity var(--transition);
}
.insp-item:hover .insp-item-actions { opacity: 1; }
.insp-fab {
  position: absolute;
  bottom: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #FACC15;
  border: none;
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  transition: background var(--transition), transform 0.15s;
  z-index: 10;
}
.insp-fab::before {
  content: '\2726';
  color: #fff;
  font-weight: bold;
}
.insp-fab:hover { background: #EAB308; transform: scale(1.1); }

/* ============================================================
   卡片 & 容器
   ============================================================ */
.card {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

/* 空状态 */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: var(--text-muted);
  text-align: center;
}
.empty-state .icon { font-size: 48px; margin-bottom: 12px; opacity: 0.5; }
.empty-state .title { font-size: 16px; font-weight: 600; color: var(--text-secondary); margin-bottom: 4px; }
.empty-state .desc { font-size: 13px; }

/* ============================================================
   按钮
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  white-space: nowrap;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text-secondary);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-danger {
  background: transparent;
  border: 1.5px solid #FECACA;
  color: var(--danger);
}
.btn-danger:hover { background: #FEF2F2; }
.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}
.btn-ghost:hover { background: rgba(0,0,0,0.04); color: var(--text); }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 15px; font-weight: 600; }

/* ============================================================
   输入框
   ============================================================ */
.input {
  width: 100%;
  padding: 8px 12px;
  font-size: 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--text);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.input:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(59,89,152,0.08);
}
.input::placeholder { color: var(--text-muted); }

.textarea {
  width: 100%;
  padding: 12px;
  font-size: 14px;
  line-height: 1.7;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--text);
  outline: none;
  resize: vertical;
  min-height: 120px;
  font-family: inherit;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.textarea:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(59,89,152,0.08);
}

.select {
  padding: 7px 11px;
  font-size: 13px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--text);
  outline: none;
  cursor: pointer;
}

/* ============================================================
   书籍卡片（书架网格）
   ============================================================ */
.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}
@media (min-width: 1200px) {
  .book-grid { grid-template-columns: repeat(5, 1fr); }
}
@media (max-width: 900px) {
  .book-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 600px) {
  .book-grid { grid-template-columns: repeat(2, 1fr); }
}

.book-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 12px;
  border: 1px solid var(--border-light);
  cursor: pointer;
  transition: all var(--transition);
  max-width: 200px;
}
.book-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.book-cover {
  aspect-ratio: 3/4;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #F0EFED;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}
.book-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.book-cover-placeholder {
  font-size: 40px;
  color: #C8C6C2;
}
.book-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.book-desc {
  font-size: 12px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 2px;
}
.book-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ============================================================
   概况页封面区域
   ============================================================ */
.cover-section {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}
.cover-image-wrap {
  position: relative;
  width: 160px;
  height: 220px;
  border-radius: var(--radius);
  overflow: hidden;
  background: #F0EFED;
  flex-shrink: 0;
}
.cover-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cover-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 60px;
  color: #C8C6C2;
  width: 100%;
  height: 100%;
}
.cover-upload-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition);
  cursor: pointer;
}
.cover-image-wrap:hover .cover-upload-overlay { opacity: 1; }
.cover-upload-text {
  color: #fff;
  font-size: 13px;
  font-weight: 500;
}
.cover-info {
  flex: 1;
  min-width: 0;
}

/* ============================================================
   阅读器
   ============================================================ */
.reader-container {
  min-height: 100vh;
  transition: background 0.4s ease, color 0.4s ease;
  padding-bottom: 80px;
}
.reader-theme-light {
  background: #FDFCFB;
  color: #2D2D3A;
}
.reader-theme-sepia {
  background: #F4ECD8;
  color: #5B4636;
}
.reader-theme-dark {
  background: #1A1A2E;
  color: #CFCFDF;
}

/* 阅读器顶栏 */
.reader-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0,0,0,0.06);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.reader-container:hover .reader-topbar,
.reader-topbar.pinned { opacity: 1; }

.reader-theme-dark .reader-topbar {
  background: rgba(26,26,46,0.9);
  border-bottom-color: rgba(255,255,255,0.08);
}
.reader-theme-sepia .reader-topbar {
  background: rgba(244,236,216,0.9);
}

/* 阅读器内容 */
.reader-content {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 20px;
}
.reader-chapter {
  margin-bottom: 60px;
}
.reader-volume-name {
  text-align: center;
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 8px;
  padding-top: 24px;
  letter-spacing: 2px;
}
.reader-chapter-title {
  text-align: center;
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 32px;
  line-height: 1.4;
}
.reader-chapter-body {
  font-family: "Noto Serif SC", "Source Han Serif SC", Georgia, "Times New Roman", serif;
  line-height: 1.9;
}
.reader-chapter-body p {
  text-indent: 2em;
  margin-bottom: 0.8em;
}
.reader-chapter-body h1 { font-size: 1.6em; margin: 1.2em 0 0.6em; text-indent: 0; }
.reader-chapter-body h2 { font-size: 1.3em; margin: 1em 0 0.5em; text-indent: 0; }
.reader-chapter-body h3 { font-size: 1.1em; margin: 0.8em 0 0.4em; text-indent: 0; }
.reader-chapter-body blockquote {
  border-left: 3px solid var(--primary-light);
  padding: 4px 16px;
  margin: 16px 0;
  color: var(--text-secondary);
  font-style: italic;
  text-indent: 0;
}
.reader-theme-sepia .reader-chapter-body blockquote {
  border-left-color: #B45309;
  color: #7C6B52;
}
.reader-theme-dark .reader-chapter-body blockquote {
  border-left-color: var(--primary-light);
  color: #A0AEC0;
}
.reader-chapter-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 32px 0;
  text-indent: 0;
}

/* 阅读器底栏 */
.reader-bottombar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 30;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(12px);
  border-top: 1px solid rgba(0,0,0,0.06);
  font-size: 13px;
}
.reader-theme-dark .reader-bottombar {
  background: rgba(26,26,46,0.9);
  border-top-color: rgba(255,255,255,0.08);
}
.reader-theme-sepia .reader-bottombar {
  background: rgba(244,236,216,0.9);
}

.reader-nav-btn {
  color: var(--primary);
  cursor: pointer;
  font-size: 13px;
  transition: opacity var(--transition);
  border: none;
  background: transparent;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  max-width: 35%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.reader-nav-btn:hover { background: rgba(59,89,152,0.08); }
.reader-nav-btn:disabled { opacity: 0.3; cursor: default; }
.reader-progress {
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
}
.reader-progress:hover { color: var(--primary); }

.toc-overlay {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(0,0,0,0.45);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fadeIn 0.2s ease;
}
.toc-drawer {
  width: 100%; max-width: 600px; max-height: 75vh;
  background: var(--card-bg); border-radius: 16px 16px 0 0;
  box-shadow: 0 -4px 24px rgba(0,0,0,0.18);
  display: flex; flex-direction: column;
  animation: slideUp 0.25s ease;
  overflow: hidden;
}
.toc-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px 12px; border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.toc-header-title { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.toc-close {
  width: 28px; height: 28px; display: flex; align-items: center; justify-content: center;
  border: none; background: none; cursor: pointer; font-size: 16px;
  color: var(--text-muted); border-radius: 50%; transition: background 0.15s;
}
.toc-close:hover { background: var(--hover-bg); }
.toc-body { overflow-y: auto; flex: 1; padding: 8px 0; }
.toc-volume-label {
  font-size: 11px; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; padding: 12px 20px 4px;
}
.toc-ch-item {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 20px; cursor: pointer; font-size: 13px; color: var(--text-secondary);
  transition: background 0.15s;
}
.toc-ch-item:hover { background: var(--hover-bg); }
.toc-ch-item.active { color: var(--primary); font-weight: 600; background: var(--primary-bg, rgba(59,89,152,0.06)); }
.toc-ch-item .toc-ch-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toc-ch-item .toc-ch-idx { color: var(--text-muted); font-size: 11px; flex-shrink: 0; }
.toc-ch-item.active .toc-ch-idx { color: var(--primary); }

.reader-theme-dark .toc-drawer { background: #1e1e2e; }
.reader-theme-sepia .toc-drawer { background: #f5eedf; }

@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* 阅读器字体控制 */
.reader-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}
.reader-font-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-secondary);
  transition: all var(--transition);
}
.reader-font-btn:hover { border-color: var(--primary); color: var(--primary); }

/* ============================================================
   模态框
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}
.modal {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 24px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-md);
  margin: 16px;
}
.modal-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 16px;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ============================================================
   表单
   ============================================================ */
.form-group { margin-bottom: 14px; }
.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* 封面拖拽上传区 */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--bg);
}
.upload-zone:hover { border-color: var(--primary-light); background: rgba(59,89,152,0.03); }
.upload-zone.dragover { border-color: var(--primary); background: rgba(59,89,152,0.06); }
.upload-zone input { display: none; }

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: calc(var(--topbar-height) + 56px);
    bottom: 0;
    z-index: 50;
    box-shadow: var(--shadow-md);
  }
  .sidebar.collapsed { left: calc(-1 * var(--sidebar-width)); width: var(--sidebar-width); }
  .sidebar-handle { display: none; }
  .cover-section { flex-direction: column; align-items: center; }
  .reader-content { padding: 0 12px; }
  /* 手机端隐藏顶部栏logo和标题 */
  .app-brand {
    display: none !important;
  }
  .book-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
}

/* ============================================================
   过渡 & 动画
   ============================================================ */
.fade-enter-active, .fade-leave-active { transition: opacity 0.2s; }
.fade-enter-from, .fade-leave-to { opacity: 0; }

/* Toast */
.toast-enter-active { transition: all 0.3s ease; }
.toast-leave-active { transition: all 0.3s ease; }
.toast-enter-from { opacity: 0; transform: translateY(10px); }
.toast-leave-to { opacity: 0; transform: translateY(-10px); }

/* ============================================================
   Quill 富文本编辑器样式
   ============================================================ */
.rich-editor-wrapper .ql-editor {
  font-family: "Microsoft YaHei", "微软雅黑", "Noto Serif SC", Georgia, "Times New Roman", serif;
  font-size: 18px;
  line-height: 2;
  padding: 20px 24px;
  min-height: 420px;
  max-height: 70vh;
  overflow-y: auto;
  text-indent: 2em;
}
.rich-editor-wrapper .ql-editor p {
  margin-bottom: 0.6em;
}
.rich-editor-wrapper .ql-editor h1 { font-size: 1.8em; margin: 1em 0 0.6em; text-indent: 0; }
.rich-editor-wrapper .ql-editor h2 { font-size: 1.5em; margin: 0.8em 0 0.5em; text-indent: 0; }
.rich-editor-wrapper .ql-editor h3 { font-size: 1.25em; margin: 0.7em 0 0.4em; text-indent: 0; }
.rich-editor-wrapper .ql-editor blockquote {
  border-left: 4px solid var(--primary-light);
  padding: 8px 16px;
  margin: 12px 0;
  color: var(--text-secondary);
  text-indent: 0;
}
.rich-editor-wrapper .ql-editor ul, .rich-editor-wrapper .ql-editor ol { padding-left: 2em; text-indent: 0; }
.rich-editor-wrapper .ql-editor li { margin-bottom: 4px; text-indent: 0; }
.rich-editor-wrapper .ql-editor hr { border: none; border-top: 2px solid var(--border); margin: 20px 0; }
.rich-editor-wrapper .ql-editor.ql-blank::before {
  font-style: normal;
  color: var(--text-muted);
  left: 24px;
  right: 24px;
  top: 20px;
}
/* 隐藏 Quill 默认工具栏（使用自定义工具栏） */
.rich-editor-wrapper .ql-toolbar { display: none !important; }
.rich-editor-wrapper .ql-container { border: none !important; }

/* compact 模式：小面板编辑器 */
.rich-editor-wrapper.compact .ql-editor {
  min-height: 100px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.6;
  text-indent: 0;
}

/* Quill 字体家族映射 */
.ql-font-songti { font-family: "SimSun", "宋体", serif; }
.ql-font-heiti { font-family: "SimHei", "黑体", sans-serif; }
.ql-font-kaiti { font-family: "KaiTi", "楷体", serif; }
.ql-font-yahei { font-family: "Microsoft YaHei", "微软雅黑", sans-serif; }
.ql-font-shouxieti { font-family: "STXingkai", "华文行楷", "KaiTi", cursive; }

/* 原始 HTML 嵌入块（表格等） */
.rich-editor-wrapper .ql-editor .ql-raw-html {
  overflow-x: auto;
  max-width: 100%;
}
.rich-editor-wrapper .ql-editor .ql-raw-html table {
  border-collapse: collapse;
  width: 100%;
}
.rich-editor-wrapper .ql-editor .ql-raw-html th,
.rich-editor-wrapper .ql-editor .ql-raw-html td {
  border: 1px solid #ccc;
  padding: 6px 10px;
  text-align: left;
  min-width: 60px;
}
.rich-editor-wrapper .ql-editor .ql-raw-html th {
  background: #f5f5f5;
  font-weight: 600;
}

/* ============================================================
   编辑器自定义工具栏小图标
   ============================================================ */
.editor-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 4px 8px;
  background: #FAFAFA;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 1px;
  user-select: none;
}
.editor-toolbar .tb-group {
  display: flex;
  align-items: center;
  gap: 1px;
}
.editor-toolbar .tb-sep {
  width: 1px;
  height: 18px;
  background: var(--border);
  margin: 0 3px;
}
.editor-toolbar button,
.editor-toolbar .tb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 13px;
  padding: 2px;
  transition: all 0.15s ease;
  flex-shrink: 0;
}
.editor-toolbar button:hover,
.editor-toolbar .tb-btn:hover {
  background: rgba(59, 89, 152, 0.08);
  color: var(--primary);
}
.editor-toolbar button.active,
.editor-toolbar .tb-btn.active {
  background: rgba(59, 89, 152, 0.12);
  color: var(--primary);
  border-color: rgba(59, 89, 152, 0.25);
}
.editor-toolbar button svg,
.editor-toolbar .tb-btn svg {
  width: 16px;
  height: 16px;
  pointer-events: none;
}
.editor-toolbar .tb-select {
  font-size: 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 3px;
  background: #fff;
  color: var(--text-secondary);
  cursor: pointer;
  outline: none;
  height: 26px;
}
.editor-toolbar .tb-select:focus {
  border-color: var(--primary-light);
}
.editor-toolbar .tb-info {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}
.shadow-sm{
  height:56px;
}

/* ── 导出弹窗选项 ── */
.export-option{
  display:flex;align-items:center;gap:12px;
  padding:14px 16px;border:2px solid var(--border);
  border-radius:var(--radius);cursor:pointer;
  transition:all .15s;
}
.export-option:hover{
  border-color:var(--primary-light);background:#fafbff;
}
.export-option.active{
  border-color:var(--primary);background:#eef2ff;
}
.export-option-icon{
  width:44px;height:44px;border-radius:10px;
  display:flex;align-items:center;justify-content:center;
  font-size:22px;flex-shrink:0;
}
