/* 编辑器页（flex 纵向布局：导航 / 横幅 / 工具栏 / 画布自适应） */
html, body { overflow: hidden; }
body.editor-page { display: flex; flex-direction: column; height: 100vh; }
body.editor-page > .nav,
body.editor-page > .guest-banner,
body.editor-page > .toolbar { flex: none; }

.editor-nav { gap: 12px; }
.editor-nav .title-input {
  width: 260px; padding: 6px 12px; font-size: 15px; font-weight: 600;
  border: 1px solid transparent; border-radius: 8px; background: transparent;
  color: var(--ink); outline: none;
}
.editor-nav .title-input:hover { background: var(--bg); }
.editor-nav .title-input:focus { background: #fff; border-color: var(--brand); }
.save-state { font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.save-state.dirty { color: var(--warn); }
.save-state.ok { color: var(--ok); }

.guest-banner {
  background: #fff7ec; color: #9a6b1f; border-bottom: 1px solid #f3e2c4;
  padding: 8px 24px; font-size: 13px;
}
.guest-banner a { margin: 0 2px; }

/* 工具栏 */
.toolbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 8px 16px; background: var(--panel); border-bottom: 1px solid var(--line);
}
.tb-btn {
  padding: 5px 11px; font-size: 13px; border: 1px solid var(--line);
  border-radius: 7px; background: var(--panel); color: var(--ink-2);
  transition: all .12s; white-space: nowrap;
}
.tb-btn:hover { border-color: var(--brand); color: var(--brand); }
.tb-sep { width: 1px; height: 18px; background: var(--line); margin: 0 4px; flex: none; }
.tb-spacer, .editor-nav .spacer { flex: 1; }
.tb-label { font-size: 13px; color: var(--ink-3); display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.tb-select {
  padding: 4px 8px; font-size: 13px; border: 1px solid var(--line);
  border-radius: 7px; background: var(--panel); color: var(--ink); outline: none;
}
.tb-zoom { font-size: 12px; color: var(--ink-3); min-width: 42px; text-align: center; }
.tb-node-count { font-size: 12px; color: var(--ink-3); margin-right: 8px; white-space: nowrap; }

/* 画布 */
#mindMapContainer {
  flex: 1; min-height: 0; position: relative;
  background: radial-gradient(rgba(79, 110, 247, .05) 1px, transparent 1px);
  background-size: 22px 22px;
  overflow: hidden;
}
#mindMapContainer svg { max-width: none; max-height: none; }

/* 导出下拉 */
.dropdown { position: relative; flex: none; }
.dd-menu {
  display: none; position: absolute; right: 0; top: 34px; z-index: 100;
  background: var(--panel); border: 1px solid var(--line); border-radius: 9px;
  box-shadow: var(--shadow); padding: 6px; min-width: 130px;
}
.dropdown.show .dd-menu { display: block; }
.dd-menu a { display: block; padding: 7px 12px; border-radius: 6px; font-size: 13px; color: var(--ink); cursor: pointer; white-space: nowrap; }
.dd-menu a:hover { background: var(--brand-soft); color: var(--brand); }

/* 移动端 */
@media (max-width: 640px) {
  .editor-nav { padding: 0 10px; height: 52px; gap: 8px; }
  .editor-nav .logo span, .editor-nav .logo { font-size: 16px; }
  .editor-nav .logo img { width: 24px; height: 24px; }
  .editor-nav .title-input { width: auto; flex: 1; min-width: 60px; font-size: 14px; padding: 5px 8px; }
  .save-state { display: none; }
  .editor-nav .user-chip > span:last-child { display: none; } /* 手机端藏昵称，只留头像 */
  .editor-nav .btn.sm { padding: 7px 10px; }
  .guest-banner { padding: 6px 12px; font-size: 12px; }
  /* 工具栏横向滚动，不折行 */
  .toolbar { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; padding: 6px 10px; gap: 6px; scrollbar-width: none; }
  .toolbar::-webkit-scrollbar { display: none; }
  .tb-spacer { display: none; }
  .tb-btn { padding: 8px 12px; font-size: 13px; }
  .tb-select { max-width: 120px; }
  .dropdown .dd-menu { position: fixed; top: auto; right: 10px; }
}
