/* workshop.css — 工坊三栏布局 */
.ws-root {
  position: relative;
  display: flex;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #fafafa;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.ws-sidebar {
  width: 200px;
  min-width: 200px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #e5e5e5;
  background: #fff;
}

.ws-nav {
  flex: 1;
  padding: 8px;
  overflow-y: auto;
}

.ws-nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  border: none;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  color: #333;
  text-align: left;
  margin-bottom: 2px;
}
.ws-nav-item:hover { background: #f0f0f0; }
.ws-nav-item.active { background: #e8f0fe; color: #1a73e8; font-weight: 500; }
.ws-nav-icon { width: 20px; text-align: center; }

.ws-sidebar-footer {
  padding: 8px;
  border-top: 1px solid #e5e5e5;
}
.ws-search {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 13px;
  box-sizing: border-box;
}

.ws-main {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.ws-detail {
  width: 360px;
  min-width: 360px;
  border-left: 1px solid #e5e5e5;
  background: #fff;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

/* 概览仪表盘 */
.ws-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.ws-stat-card {
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  padding: 16px;
}
.ws-stat-num { font-size: 28px; font-weight: 600; color: #1a73e8; }
.ws-stat-label { font-size: 12px; color: #888; margin-top: 4px; }

.ws-section-title { font-size: 16px; font-weight: 600; margin: 16px 0 8px; }

/* 资源网格 */
.ws-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}
.ws-card {
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  padding: 12px;
  cursor: pointer;
  transition: box-shadow 0.15s;
}
.ws-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
.ws-card-title { font-weight: 500; font-size: 14px; margin-bottom: 4px; }
.ws-card-meta { font-size: 12px; color: #999; }

.ws-list { display: flex; flex-direction: column; gap: 4px; }
.ws-list-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; border-radius: 6px; cursor: pointer;
}
.ws-list-item:hover { background: #f0f0f0; }

.ws-empty { text-align: center; padding: 40px; color: #aaa; }

/* 副页 */
.ws-detail-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px; border-bottom: 1px solid #e5e5e5;
}
.ws-detail-close {
  border: none; background: none; cursor: pointer; font-size: 18px; color: #999;
}
.ws-detail-close:hover { color: #333; }
.ws-detail-body { padding: 12px; flex: 1; overflow-y: auto; }

/* 工具栏 */
.ws-toolbar {
  display: flex; align-items: center; gap: 8px; margin-bottom: 12px;
}
.ws-toolbar button {
  padding: 4px 10px; border: 1px solid #ddd; background: #fff;
  border-radius: 4px; cursor: pointer; font-size: 12px;
}
.ws-toolbar button.active { background: #1a73e8; color: #fff; border-color: #1a73e8; }

/* 顶部按钮行：汉堡 + 工坊入口 水平排列 */
.fh-btn-row {
  display: flex;
  align-items: center;
  gap: 4px;
}
.fh-hamburger {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border: none; background: transparent;
  border-radius: 6px; cursor: pointer; color: #555;
  padding: 0;
}
.fh-hamburger:hover { background: #f0f0f0; color: #1a73e8; }
.fh-hamburger-active { background: #e8f0fe; color: #1a73e8; }

/* 工坊入口按钮 */
.fh-workshop-btn {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border: none; background: transparent;
  border-radius: 6px; cursor: pointer; color: #555;
  padding: 0;
}
.fh-workshop-btn:hover { background: #f0f0f0; color: #1a73e8; }

/* ws-count 计数 */
.ws-count { font-size: 12px; color: #999; }

/* 视图切换 */
.ws-view-toggle { display: flex; gap: 2px; }
.ws-view-toggle button {
  width: 28px; height: 28px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
}

/* 列表项标题 */
.ws-list-title { flex: 1; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 统计卡片可点击 */
.ws-stat-card { cursor: pointer; transition: box-shadow 0.15s; }
.ws-stat-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.1); }

/* 加载态 */
.ws-loading { text-align: center; padding: 40px; color: #aaa; font-size: 14px; }

/* 副页内容 */
.ws-detail-title { font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-detail-actions { margin-bottom: 12px; }
.ws-card-preview {
  padding: 12px; background: #f9f9f9; border-radius: 6px;
  max-height: 400px; overflow-y: auto;
}
.ws-preview-text { font-size: 13px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
.ws-preview-json { font-size: 11px; white-space: pre-wrap; word-break: break-word; margin: 0; }

.ws-box-desc { font-size: 13px; color: #666; margin-bottom: 12px; line-height: 1.5; }

.ws-work-meta { margin-bottom: 12px; }
.ws-meta-row { margin-bottom: 8px; }
.ws-meta-label { display: block; font-size: 11px; color: #999; margin-bottom: 2px; }
.ws-meta-value { font-size: 13px; color: #333; }

.ws-chapter-order { font-size: 12px; color: #999; min-width: 24px; }

/* ═══════ 笔记编辑器 ═══════ */
.ne-root { display: flex; flex-direction: column; height: 100%; min-height: 300px; }
.ne-header { padding: 8px 0; border-bottom: 1px solid #eee; }
.ne-embedded .ne-header { padding: 0 0 8px; }
.ne-title {
  width: 100%; border: none; font-size: 18px; font-weight: 600;
  padding: 4px 0; outline: none; background: transparent;
  font-family: inherit; box-sizing: border-box;
}
.ne-toolbar { display: flex; gap: 4px; padding: 6px 0; border-bottom: 1px solid #eee; flex-wrap: wrap; }
.ne-toolbar button {
  width: 30px; height: 30px; border: 1px solid #e0e0e0; background: #fff;
  border-radius: 4px; cursor: pointer; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
}
.ne-toolbar button:hover { background: #f5f5f5; border-color: #ccc; }
.ne-content {
  flex: 1; overflow-y: auto; padding: 12px 0;
  outline: none; font-size: 14px; line-height: 1.7;
  min-height: 150px;
}
.ne-content:empty::before { content: attr(data-placeholder); color: #ccc; }
.ne-status { font-size: 11px; color: #888; padding: 4px 0; border-top: 1px solid #f0f0f0; }

/* 浮窗内笔记编辑器 body 填充 */
.fw-window[data-type="note-editor"] .fw-body { padding: 12px; }

/* 选择/拖拽 分裂按钮：主区域 + 右侧模式子控件集成在同一按钮内 */
.tool-split-btn {
  display: flex;
  align-items: stretch;
  padding: 0;
  overflow: hidden;
  gap: 0;
}
.tool-split-main {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 10px;
  font-size: 12px;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.tool-split-mode {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  padding: 0 10px;
  border: none;
  border-left: 1px solid rgba(0,0,0,.08);
  background: transparent;
  color: inherit;
  font-size: 11px;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}
.tool-split-mode:hover { background: rgba(0,0,0,.06); }

/* active 时整体蓝底，模式子控件用半透明白底 */
.tool-split-btn.active .tool-split-mode {
  border-left-color: rgba(255,255,255,.25);
  background: rgba(255,255,255,.15);
}
.tool-split-btn.active .tool-split-mode:hover {
  background: rgba(255,255,255,.25);
}

/* 非选择工具时模式子控件变暗 */
.tool-split-btn:not(.active) .tool-split-mode {
  opacity: 0.45;
}
.tool-split-btn:not(.active) .tool-split-mode:hover {
  opacity: 0.8;
}

/* kbd 在分裂按钮内 */
.tool-split-main kbd {
  margin-left: auto;
  font-size: 10px;
  opacity: .6;
}

/* 卡片预览空状态 */
.ws-preview-empty {
  text-align: center;
  padding: 32px 16px;
  color: #94a3b8;
  font-size: 13px;
  line-height: 1.8;
}
.ws-preview-hint {
  font-size: 11px;
  color: #cbd5e1;
}
.ws-preview-text {
  padding: 12px;
  background: #f8fafc;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.7;
  color: #334155;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Star (W4) */
.ws-card { position: relative; }
.ws-list-item { position: relative; }
.ws-star {
  position: absolute; top: 6px; right: 8px;
  background: none; border: none; cursor: pointer;
  font-size: 16px; line-height: 1; padding: 2px 4px;
  color: #c0c4cc; opacity: 0.6;
  transition: opacity .15s, color .15s, transform .15s;
  z-index: 2;
}
.ws-star:hover { opacity: 1; transform: scale(1.2); }
.ws-star.on { color: #f5a623; opacity: 1; }
.ws-card.starred { background: linear-gradient(135deg, #fffbf0 0%, #fff 60%); border-color: #f5d896; }
.ws-list-item.starred { background: #fffbf0; }
.ws-list-item .ws-star { top: 50%; transform: translateY(-50%); right: 60px; }
.ws-list-item .ws-star.on { transform: translateY(-50%); }

/* ═══════════ 工坊（Studio）三栏创作布局 ═══════════ */
.studio-root {
  display: flex;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--c-bg);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.studio-left {
  width: 280px;
  min-width: 220px;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--c-border);
  background: var(--c-bg-subtle);
  overflow: hidden;
  flex-shrink: 0;
}

.studio-canvas-pane {
  height: 200px;
  min-height: 120px;
  border-bottom: 1px solid var(--c-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--c-bg);
}

.studio-canvas-body {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px;
}

.studio-canvas-select {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  font-size: 12px;
  background: var(--c-bg);
  color: var(--c-text);
  margin-bottom: 8px;
  box-sizing: border-box;
  outline: none;
}
.studio-canvas-select:focus { border-color: var(--c-accent); }

.studio-minimap-wrap {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.studio-minimap-svg { max-width: 100%; max-height: 100%; }

.studio-quick-pane {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.studio-pane-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--c-text-secondary);
  border-bottom: 1px solid var(--c-border);
  background: var(--c-bg-subtle);
  flex-shrink: 0;
}

.studio-quick-filter {
  display: flex;
  gap: 2px;
}
.studio-filter-btn {
  padding: 2px 8px;
  border: none;
  background: transparent;
  border-radius: var(--r-sm);
  font-size: 11px;
  color: var(--c-text-muted);
  cursor: pointer;
}
.studio-filter-btn:hover { background: var(--c-bg-hover); }
.studio-filter-btn.active { color: var(--c-accent); background: var(--c-bg-active); font-weight: 500; }

.studio-quick-search-wrap { padding: 6px 8px; flex-shrink: 0; }
.studio-quick-search {
  width: 100%;
  padding: 5px 10px;
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  font-size: 12px;
  background: var(--c-bg);
  color: var(--c-text);
  box-sizing: border-box;
  outline: none;
}
.studio-quick-search:focus { border-color: var(--c-accent); }
.studio-quick-search::placeholder { color: var(--c-text-muted); }

.studio-quick-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 6px;
}

.studio-quick-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px;
  border-radius: var(--r-sm);
  cursor: grab;
  transition: background 0.12s;
  margin-bottom: 2px;
}
.studio-quick-item:hover { background: var(--c-bg-hover); }
.studio-quick-item.dragging { opacity: 0.5; }
.studio-quick-item.starred { background: rgba(245,166,35,0.06); }

.studio-quick-icon {
  font-size: 14px;
  color: var(--c-text-muted);
  flex-shrink: 0;
  line-height: 1.4;
}
.studio-quick-info { flex: 1; min-width: 0; }
.studio-quick-title {
  font-size: 12px;
  font-weight: 500;
  color: var(--c-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.studio-quick-preview {
  font-size: 11px;
  color: var(--c-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.studio-divider {
  width: 5px;
  cursor: col-resize;
  background: transparent;
  flex-shrink: 0;
  transition: background 0.15s;
  position: relative;
  z-index: 5;
}
.studio-divider:hover,
.studio-divider:active {
  background: var(--c-accent);
  opacity: 0.3;
}

.studio-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--c-bg);
  min-width: 0;
}

.studio-work {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.studio-work-root {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.studio-work-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--c-border);
  background: var(--c-bg);
  flex-shrink: 0;
}
.studio-work-title {
  flex: 1;
  border: none;
  font-size: 16px;
  font-weight: 600;
  color: var(--c-text);
  background: transparent;
  outline: none;
  padding: 4px 0;
  min-width: 0;
}
.studio-work-title::placeholder { color: var(--c-text-muted); }

.studio-chapter-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.studio-ch-btn, .studio-ch-insert {
  width: 28px; height: 28px;
  border: 1px solid var(--c-border);
  background: var(--c-bg);
  border-radius: var(--r-sm);
  cursor: pointer;
  font-size: 16px;
  color: var(--c-text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
}
.studio-ch-btn:hover, .studio-ch-insert:hover {
  background: var(--c-bg-hover);
  border-color: var(--c-accent);
  color: var(--c-accent);
}
.studio-ch-insert { font-size: 18px; font-weight: 300; }
.studio-ch-indicator {
  font-size: 12px;
  color: var(--c-text-muted);
  min-width: 36px;
  text-align: center;
}

/* Chapter axis */
.studio-chapter-axis-wrap {
  flex-shrink: 0;
  border-bottom: 1px solid var(--c-border);
  background: var(--c-bg-subtle);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}
.studio-chapter-axis-wrap::-webkit-scrollbar { display: none; }

.studio-chapter-axis {
  padding: 0;
}
.studio-axis-track {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 8px 16px;
  min-width: 100%;
}
.studio-axis-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.2s;
}
.studio-axis-node:hover { transform: translateY(-1px); }
.studio-axis-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--c-border);
  border: 2px solid var(--c-bg);
  transition: all 0.2s;
}
.studio-axis-node.current .studio-axis-dot {
  background: var(--c-accent);
  width: 10px; height: 10px;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
}
.studio-axis-label {
  font-size: 10px;
  color: var(--c-text-muted);
  white-space: nowrap;
  max-width: 64px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.studio-axis-node.current .studio-axis-label {
  color: var(--c-accent);
  font-weight: 500;
}
.studio-axis-empty { padding: 12px; text-align: center; font-size: 12px; color: var(--c-text-muted); }

/* Toolbar */
.studio-editor-toolbar {
  display: flex;
  gap: 2px;
  padding: 6px 16px;
  border-bottom: 1px solid var(--c-border);
  background: var(--c-bg-subtle);
  flex-shrink: 0;
  flex-wrap: wrap;
}
.studio-editor-toolbar button {
  width: 28px; height: 28px;
  border: none;
  background: transparent;
  border-radius: var(--r-sm);
  cursor: pointer;
  font-size: 13px;
  color: var(--c-text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.studio-editor-toolbar button:hover { background: var(--c-bg-hover); color: var(--c-text); }
.studio-editor-toolbar button:active { background: var(--c-bg-active); }

/* Editor */
.studio-editor {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  font-size: 15px;
  line-height: 1.8;
  color: var(--c-text);
  outline: none;
  word-break: break-word;
}
.studio-editor:empty::before {
  content: attr(data-placeholder);
  color: var(--c-text-muted);
  pointer-events: none;
}
.studio-editor.drag-over {
  background: rgba(37,99,235,0.04);
  outline: 2px dashed var(--c-accent);
  outline-offset: -4px;
}

/* Reference block in editor */
.studio-ref-block {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  margin: 8px 0;
  background: var(--c-bg-subtle);
  border: 1px solid var(--c-border);
  border-left: 3px solid var(--c-accent);
  border-radius: var(--r-sm);
  position: relative;
  user-select: none;
}
.studio-ref-icon {
  font-size: 16px;
  color: var(--c-accent);
  flex-shrink: 0;
  line-height: 1.4;
}
.studio-ref-body { flex: 1; min-width: 0; }
.studio-ref-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--c-text);
  margin-bottom: 2px;
}
.studio-ref-preview {
  font-size: 12px;
  color: var(--c-text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.studio-ref-remove {
  position: absolute;
  top: 6px; right: 8px;
  width: 20px; height: 20px;
  border: none;
  background: transparent;
  color: var(--c-text-muted);
  font-size: 16px;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
}
.studio-ref-remove:hover { background: var(--c-bg-hover); color: #ef4444; }

/* Status bar */
.studio-statusbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 6px 16px;
  border-top: 1px solid var(--c-border);
  background: var(--c-bg-subtle);
  font-size: 11px;
  color: var(--c-text-muted);
  flex-shrink: 0;
}
.studio-save-status { margin-left: auto; }

/* Placeholder */
.studio-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: var(--c-text-muted);
  font-size: 13px;
}

.studio-empty-hint {
  text-align: center;
  padding: 24px 16px;
  color: var(--c-text-muted);
  font-size: 12px;
  line-height: 1.8;
}
.studio-empty-hint small { font-size: 11px; color: var(--c-text-muted); opacity: 0.7; }

.studio-mini-loading {
  text-align: center;
  padding: 16px;
  color: var(--c-text-muted);
  font-size: 12px;
}

/* FAB styles (W3) */
.vault-fab {
  position: absolute;
  bottom: 20px;
  right: 20px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--c-accent);
  color: #fff;
  border: none;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(37,99,235,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: transform 0.15s, box-shadow 0.15s;
  line-height: 1;
  padding: 0;
}
.vault-fab:hover {
  transform: scale(1.08);
  box-shadow: 0 4px 12px rgba(37,99,235,0.4);
}
.vault-fab:active { transform: scale(0.95); }

.vault-fab-menu {
  position: absolute;
  bottom: 76px;
  right: 20px;
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  overflow: hidden;
  z-index: 10;
  min-width: 140px;
}
.vault-fab-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 16px;
  border: none;
  background: transparent;
  font-size: 13px;
  color: var(--c-text);
  cursor: pointer;
  text-align: left;
  transition: background 0.12s;
}
.vault-fab-item:hover { background: var(--c-bg-hover); }
.vault-fab-item-icon { font-size: 16px; width: 20px; text-align: center; }

/* fh vault/studio buttons */
.fh-vault-btn, .fh-studio-btn {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border: none; background: transparent;
  border-radius: var(--r-sm); cursor: pointer; color: var(--c-text-secondary);
  padding: 0;
}
.fh-vault-btn:hover, .fh-studio-btn:hover {
  background: var(--c-bg-hover); color: var(--c-accent);
}

/* ═══════════ 移动端适配 ═══════════ */
@media (max-width: 640px) {
  .studio-root {
    flex-direction: column;
  }
  .studio-left {
    width: 100% !important;
    max-width: 100%;
    min-width: 0;
    height: 40vh;
    border-right: none;
    border-bottom: 1px solid var(--c-border);
    flex-shrink: 0;
  }
  .studio-canvas-pane {
    height: 140px;
    min-height: 100px;
  }
  .studio-divider {
    display: none;
  }
  .studio-right {
    flex: 1;
    min-height: 0;
  }
  .studio-editor {
    padding: 14px 16px;
    font-size: 15px;
  }
  .studio-work-head {
    padding: 8px 12px;
    flex-wrap: wrap;
    gap: 8px;
  }
  .studio-work-title { font-size: 15px; }
  .studio-editor-toolbar {
    padding: 4px 8px;
  }
  .studio-statusbar {
    padding: 4px 12px;
  }
}

/* ═══ Bugfix batch: 2026-08-23 ═══ */

/* ── 序列轴：横向滚动 + 操作按钮 ── */
.studio-chapter-axis {
  position: relative;
  display: flex;
  align-items: center;
  padding: 0;
  min-height: 64px;
}
.studio-axis-scroll {
  flex: 1;
  overflow-x: auto;
  overflow-y: hidden;
  position: relative;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 10px 12px 8px;
}
.studio-axis-scroll::-webkit-scrollbar { display: none; }

.studio-axis-line {
  position: absolute;
  left: 12px;
  right: 12px;
  top: 22px;
  height: 2px;
  background: var(--c-border);
  border-radius: 1px;
  pointer-events: none;
}

.studio-axis-track {
  display: inline-flex;
  align-items: flex-start;
  gap: 0;
  position: relative;
  min-width: 100%;
}

.studio-axis-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4px 10px;
  cursor: pointer;
  position: relative;
  min-width: 64px;
  flex-shrink: 0;
  border-radius: 6px;
  transition: background 0.15s;
}
.studio-axis-node:hover { background: var(--c-bg-hover); }
.studio-axis-node:hover .studio-axis-actions { opacity: 1; pointer-events: auto; }

.studio-axis-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--node-dot, var(--c-border));
  border: 2px solid var(--c-bg);
  box-shadow: 0 0 0 1px var(--node-dot, var(--c-border));
  margin-bottom: 4px;
  transition: transform 0.15s;
  z-index: 1;
}
.studio-axis-node.current .studio-axis-dot {
  background: var(--node-dot, var(--c-accent));
  box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
  transform: scale(1.2);
}
.studio-axis-node.highlighted .studio-axis-dot {
  box-shadow: 0 0 0 3px rgba(245,166,35,0.25);
}
.studio-axis-node.highlighted {
  background: var(--node-bg, rgba(245,166,35,0.08));
}

.studio-axis-label {
  font-size: 11px;
  color: var(--c-text-muted);
  white-space: nowrap;
  line-height: 1.3;
}
.studio-axis-node.current .studio-axis-label {
  color: var(--c-accent);
  font-weight: 600;
}
.studio-axis-words {
  font-size: 9px;
  color: var(--c-text-muted);
  opacity: 0.7;
}

.studio-axis-actions {
  position: absolute;
  top: -10px;
  right: 2px;
  display: flex;
  gap: 1px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: 4px;
  padding: 1px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  z-index: 2;
}
.studio-axis-act-btn {
  border: none;
  background: transparent;
  width: 20px;
  height: 20px;
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  border-radius: 3px;
  color: var(--c-text-muted);
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.studio-axis-act-btn:hover { background: var(--c-bg-hover); color: var(--c-text); }
.studio-axis-act-btn.danger:hover { background: rgba(239,68,68,0.1); color: #ef4444; }

.studio-axis-add {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px dashed var(--c-border);
  background: var(--c-bg);
  color: var(--c-text-muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  margin: 0 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.studio-axis-add:hover {
  border-color: var(--c-accent);
  color: var(--c-accent);
  background: rgba(37,99,235,0.05);
}
.studio-axis-empty {
  padding: 12px 16px;
  font-size: 12px;
  color: var(--c-text-muted);
  white-space: nowrap;
}

/* ── 快捷仓库：内联编辑 + 操作按钮 ── */
.studio-quick-item {
  position: relative;
}
.studio-quick-actions {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.15s;
}
.studio-quick-item:hover .studio-quick-actions { opacity: 1; }

.sq-action-btn {
  border: none;
  background: transparent;
  width: 24px;
  height: 24px;
  font-size: 12px;
  cursor: pointer;
  border-radius: 4px;
  color: var(--c-text-muted);
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sq-action-btn:hover { background: var(--c-bg-hover); color: var(--c-text); }
.sq-action-btn.on { color: #f5a623; opacity: 1; }
.studio-quick-item.starred .sq-action-btn.on { color: #f5a623; }

.studio-quick-empty { color: var(--c-text-muted); font-style: italic; }

.studio-quick-item.editing {
  flex-direction: column;
  align-items: stretch;
  padding: 8px;
}
.studio-quick-item.editing .studio-quick-icon,
.studio-quick-item.editing .studio-quick-actions { display: none; }

.sq-inline-editor {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sq-inline-title {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--c-border);
  border-radius: 4px;
  font-size: 13px;
  background: var(--c-bg);
  color: var(--c-text);
  box-sizing: border-box;
}
.sq-inline-title:focus { outline: none; border-color: var(--c-accent); }
.sq-inline-body {
  width: 100%;
  min-height: 80px;
  padding: 6px 8px;
  border: 1px solid var(--c-border);
  border-radius: 4px;
  font-size: 12px;
  background: var(--c-bg);
  color: var(--c-text);
  resize: vertical;
  box-sizing: border-box;
  font-family: inherit;
}
.sq-inline-body:focus { outline: none; border-color: var(--c-accent); }
.sq-inline-hint {
  font-size: 11px;
  color: var(--c-text-muted);
  padding: 4px 0;
}
.sq-inline-actions {
  display: flex;
  gap: 6px;
}
.sq-inline-btn {
  padding: 4px 12px;
  border: 1px solid var(--c-border);
  border-radius: 4px;
  background: var(--c-bg);
  color: var(--c-text);
  font-size: 12px;
  cursor: pointer;
}
.sq-inline-btn:hover { border-color: var(--c-accent); }
.sq-inline-btn.save {
  background: var(--c-accent);
  color: #fff;
  border-color: var(--c-accent);
}
.sq-inline-btn.save:hover { opacity: 0.9; }
.sq-inline-btn.save.error { background: #ef4444; border-color: #ef4444; }

/* ═══ Axis spacing + visible scrollbar: 2026-08-23 20:30 ═══ */
.studio-axis-track {
  gap: 1cm;
}
.studio-axis-scroll {
  scrollbar-width: thin;
  scrollbar-color: var(--c-border) transparent;
  -ms-overflow-style: auto;
  padding-bottom: 14px;
}
.studio-axis-scroll::-webkit-scrollbar {
  display: block;
  height: 5px;
}
.studio-axis-scroll::-webkit-scrollbar-track {
  background: transparent;
}
.studio-axis-scroll::-webkit-scrollbar-thumb {
  background: var(--c-border);
  border-radius: 3px;
}
.studio-axis-scroll::-webkit-scrollbar-thumb:hover {
  background: var(--c-text-muted);
}

/* ═══ Axis v2 fix: 2026-08-23 20:55 ═══
   - 轴线放到 track 的 ::before 上，撑满内容宽度（修复线半路断）
   - 节点间距收紧到点中心约 1cm
   - 横向滚动条可见 */

/* 老的固定线废弃 */
.studio-axis-line { display: none !important; }

.studio-axis-track {
  display: inline-flex;
  align-items: flex-start;
  gap: 28px;            /* 圆点中心间距 = 10px(dot) + 28px(gap) ≈ 1cm */
  position: relative;
  min-width: 100%;
  padding: 10px 16px 18px;
}

/* 整条横线，跟着 track 一起滚动，长度 = 内容宽度 */
.studio-axis-track::before {
  content: '';
  position: absolute;
  left: 16px;
  right: 16px;
  top: 19px;            /* 圆点垂直中心 */
  height: 2px;
  background: var(--c-border);
  border-radius: 1px;
  pointer-events: none;
  z-index: 0;
}

.studio-axis-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0;           /* 去掉水平 padding，让间距由 gap 控制 */
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  border-radius: 6px;
  transition: background 0.15s;
  z-index: 1;
}
.studio-axis-node:hover { background: var(--c-bg-hover); }
.studio-axis-node:hover .studio-axis-actions { opacity: 1; pointer-events: auto; }

.studio-axis-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--node-dot, var(--c-border));
  border: 2px solid var(--c-bg);
  box-shadow: 0 0 0 1px var(--node-dot, var(--c-border));
  margin-bottom: 4px;
  transition: transform 0.15s;
  z-index: 2;
  position: relative;
}

.studio-axis-label {
  font-size: 11px;
  color: var(--c-text-muted);
  white-space: nowrap;
  line-height: 1.3;
  padding: 0 2px;
}
.studio-axis-words {
  font-size: 9px;
  color: var(--c-text-muted);
  opacity: 0.7;
  white-space: nowrap;
}

/* 滚动容器：给滚动条留位 */
.studio-axis-scroll {
  flex: 1;
  overflow-x: auto;
  overflow-y: hidden;
  position: relative;
  scrollbar-width: thin;
  scrollbar-color: var(--c-border) transparent;
  -ms-overflow-style: auto;
}
.studio-axis-scroll::-webkit-scrollbar {
  display: block;
  height: 5px;
}
.studio-axis-scroll::-webkit-scrollbar-track { background: transparent; }
.studio-axis-scroll::-webkit-scrollbar-thumb {
  background: var(--c-border);
  border-radius: 3px;
}
.studio-axis-scroll::-webkit-scrollbar-thumb:hover {
  background: var(--c-text-muted);
}

/* ═══ Workshop detail v2: inline editing ═══ */
.ws-inline-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 4px 2px 12px;
}
.ws-field-label {
  font-size: 11px;
  color: var(--c-text-muted);
  margin-top: 6px;
  font-weight: 500;
}
.ws-field-label:first-child { margin-top: 0; }
.ws-input, .ws-textarea {
  width: 100%;
  padding: 7px 9px;
  border: 1px solid var(--c-border);
  border-radius: 5px;
  font-size: 13px;
  background: var(--c-bg);
  color: var(--c-text);
  box-sizing: border-box;
  font-family: inherit;
  transition: border-color .15s;
}
.ws-input:focus, .ws-textarea:focus {
  outline: none;
  border-color: var(--c-accent);
}
.ws-textarea {
  resize: vertical;
  min-height: 80px;
  line-height: 1.55;
}
.ws-field-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}
.ws-field-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ws-field-col .ws-field-label { margin-top: 0; }
.ws-check {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--c-text);
  cursor: pointer;
  margin-top: 6px;
}
.ws-meta-hint {
  margin-left: auto;
  font-size: 11px;
  color: var(--c-text-muted);
}
.ws-inline-msg {
  font-size: 11px;
  min-height: 16px;
  color: var(--c-text-muted);
}
.ws-inline-msg.ok { color: #16a34a; }
.ws-inline-msg.error { color: #ef4444; }

.ws-detail-actions {
  display: flex;
  gap: 8px;
  margin: 4px 0 10px;
}
.btn {
  padding: 6px 12px;
  border: 1px solid var(--c-border);
  border-radius: 5px;
  background: var(--c-bg);
  color: var(--c-text);
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  transition: all .15s;
}
.btn:hover { border-color: var(--c-accent); }
.btn.primary {
  background: var(--c-accent);
  color: #fff;
  border-color: var(--c-accent);
}
.btn.primary:hover { opacity: .9; }
.btn.danger {
  color: #ef4444;
  border-color: rgba(239,68,68,.3);
}
.btn.danger:hover {
  background: rgba(239,68,68,.08);
  border-color: #ef4444;
}

.ws-box-members .ws-remove-card {
  margin-left: auto;
  border: none;
  background: transparent;
  color: var(--c-text-muted);
  width: 22px;
  height: 22px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .15s, background .15s;
}
.ws-box-members .ws-list-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 4px;
  cursor: pointer;
}
.ws-box-members .ws-list-item:hover .ws-remove-card { opacity: 1; }
.ws-box-members .ws-remove-card:hover {
  background: rgba(239,68,68,.12);
  color: #ef4444;
}

/* fix: 确保仓库/工坊按钮在侧边栏展开时始终可见 */
.fh-btn-row {
  display: flex !important;
  gap: 4px;
  align-items: center;
}
.sidebar.collapsed .fh-btn-row {
  display: none;
}


/* ═══════════════════════════════════════════════════════════
   Studio Quick Pane - Tab & Empty State (v1.1.0)
   ═══════════════════════════════════════════════════════════ */

/* Tab switcher */
.studio-quick-tabs {
  display: flex;
  gap: 2px;
  margin-left: auto;
  background: var(--c-bg-sunken, #f5f5f5);
  border-radius: 6px;
  padding: 2px;
}

.studio-tab {
  padding: 4px 12px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--c-text-muted, #888);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
}

.studio-tab:hover {
  color: var(--c-text, #333);
}

.studio-tab.active {
  background: var(--c-bg, #fff);
  color: var(--c-text, #333);
  box-shadow: 0 1px 2px rgba(0,0,0,.08);
}

/* Empty state for canvas mode */
.studio-empty-canvas {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  text-align: center;
}

.studio-empty-icon {
  font-size: 32px;
  color: var(--c-text-muted, #aaa);
  margin-bottom: 12px;
  opacity: .5;
}

.studio-empty-text {
  font-size: 13px;
  color: var(--c-text-secondary, #666);
  margin-bottom: 16px;
  line-height: 1.5;
}

.studio-empty-btn {
  padding: 8px 16px;
  border: 1px solid var(--c-accent, #4f46e5);
  border-radius: 6px;
  background: var(--c-accent, #4f46e5);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
}

.studio-empty-btn:hover {
  opacity: .9;
  transform: translateY(-1px);
}

.studio-empty-btn:active {
  transform: translateY(0);
}

