/* ===================== 修谱可视化编撰工作台 ===================== */
.editor-toolbar { flex-wrap: wrap; gap: 14px; align-items: center; }
/* 工作台面板不做营销卡片式的悬浮抬起，保持编辑器沉稳感 */
.editor-toolbar.glass:hover,
.editor-layout .glass:hover { transform: none; box-shadow: none; }
.editor-layout .glass:hover { border-color: var(--border-strong); }
.identity-box { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.id-label { font-size: 12px; color: var(--muted, #888); }
.id-btns { display: inline-flex; gap: 4px; background: rgba(127,127,127,.12); padding: 3px; border-radius: 10px; }
.id-btns button { border: none; background: transparent; color: var(--text, #222); padding: 5px 10px; border-radius: 8px; cursor: pointer; font-size: 13px; transition: .2s; }
.id-btns button.active { background: linear-gradient(135deg, var(--accent), #e74c3c); color: #fff; }
.id-current { font-size: 12px; color: var(--accent, #b8432f); font-weight: 600; }

/* 布局：可拖拽缩放 / 收起展开的 3 栏工作台 */
.editor-layout { display: flex; align-items: stretch; gap: 0; height: 72vh; margin-top: 16px; }

.editor-list, .editor-drawer { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.editor-list { width: 280px; flex: 0 0 auto; }
.editor-drawer { width: 360px; flex: 0 0 auto; }
.editor-center { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }

/* 面板头（标题 + 收起/展开按钮） */
.panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  flex: 0 0 auto; padding: 9px 12px;
  background: var(--surface-2); border-bottom: 1px solid var(--border);
  transition: background .3s, border-color .3s;
}
.panel-title { font-weight: 700; font-size: 13px; letter-spacing: .5px; color: var(--accent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.panel-toggle {
  flex: 0 0 auto; width: 26px; height: 24px; border: 1px solid var(--border); border-radius: 7px; cursor: pointer;
  background: var(--surface); color: var(--text); font-size: 14px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center; transition: .15s;
}
.panel-toggle:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

/* 面板内容区 */
.panel-body { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 12px; }
.editor-drawer .panel-body { padding: 16px; }
.editor-center .panel-body { padding: 0; display: flex; flex-direction: column; }

.editor-tree-wrap { flex: 1 1 auto; min-height: 0; height: auto; padding: 0; overflow: hidden; position: relative; }
#editor-tree-svg { width: 100%; height: 100%; display: block; cursor: grab; }
#editor-tree-svg.grabbing { cursor: grabbing; }
.editor-drawer .empty { color: var(--muted,#888); text-align: center; padding: 40px 10px; }

/* 拖拽手柄（拖动改变相邻栏宽度） */
.resize-handle { flex: 0 0 10px; align-self: stretch; cursor: col-resize; position: relative; }
.resize-handle::after {
  content: ""; position: absolute; left: 4px; top: 0; bottom: 0; width: 2px;
  background: var(--border-strong); border-radius: 2px; transition: background .15s, width .15s;
}
.resize-handle:hover::after, .resize-handle.dragging::after { background: var(--accent); width: 3px; }

/* 收起状态 */
.editor-list.collapsed, .editor-drawer.collapsed { width: 46px !important; flex: 0 0 46px !important; }
.editor-center.collapsed { flex: 0 0 46px !important; }
.collapsed .panel-body { display: none; }
.collapsed .panel-head { border-bottom: none; flex-direction: column; align-items: center; gap: 10px; padding: 10px 4px; }
.collapsed .panel-title { writing-mode: vertical-rl; text-orientation: upright; letter-spacing: 3px; }

/* 检索 + 审核汇总 */
.review-summary { display: flex; flex-wrap: wrap; gap: 5px; margin: 10px 0; }
.rs-pill { font-size: 11px; padding: 2px 8px; border-radius: 20px; background: rgba(127,127,127,.15); }
.person-list { display: flex; flex-direction: column; gap: 4px; }
.pl-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 9px; border-radius: 8px; cursor: pointer; transition: .15s; }
.pl-item:hover, .pl-item.active { background: var(--accent-soft); }
.pl-main { display: flex; flex-direction: column; min-width: 0; }
.pl-name { font-weight: 600; }
.pl-gen { font-size: 11px; color: var(--muted,#888); }
.pl-more { font-size: 11px; color: var(--muted,#888); text-align: center; padding: 8px; }

/* 审核状态点 */
.rs-dot { font-size: 11px; padding: 2px 8px; border-radius: 20px; white-space: nowrap; color: #fff; }
.rs-draft { background: #9aa0a6; }
.rs-submitted { background: #2f80ed; }
.rs-spec { background: #9b51e0; }
.rs-fam { background: #f2994a; }
.rs-pub { background: #27ae60; }
.rs-rej { background: #eb5757; }

/* 抽屉表单 */
.drawer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.drawer-head h3 { margin: 0; font-size: 18px; }

/* 数据摘要（键盘用 JS 属性赋值，不渲染时也能直观看到原值，避免「字段没填」误解） */
.drawer-summary {
  margin-bottom: 14px;
  padding: 11px 12px;
  background: var(--accent-soft);
  border: 1px dashed var(--accent);
  border-radius: 10px;
  font-size: 12px;
}
.drawer-summary .ds-title { font-weight: 700; color: var(--accent,#b8432f); margin-bottom: 7px; font-size: 12px; }
.drawer-summary .ds-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px 14px; }
.drawer-summary .ds-row { display: flex; gap: 8px; align-items: baseline; line-height: 1.5; }
.drawer-summary .ds-k { color: var(--muted,#888); min-width: 38px; font-weight: 600; }
.drawer-summary .ds-v { color: var(--text,#222); word-break: break-all; }
.drawer-summary .ds-v em { font-style: normal; }

.drawer-body { display: flex; flex-direction: column; gap: 9px; }
.drawer-body label { display: flex; flex-direction: column; font-size: 12px; color: var(--muted,#888); gap: 3px; }
.drawer-body input, .drawer-body select, .drawer-body textarea {
  font: 14px/1.4 inherit; padding: 7px 9px; border-radius: 8px;
  border: 1px solid var(--border, #ccc); background: var(--surface-solid, #fff); color: var(--text,#222);
}
.drawer-body input[data-placeholder="true"], .drawer-body textarea[data-placeholder="true"] {
  font-style: italic;
}
.drawer-body textarea { min-height: 52px; resize: vertical; }

/* 父节点组合框（可输入过滤 + 下拉选择，已过滤配偶「氏」） */
.combo { position: relative; }
.combo-input { width: 100%; box-sizing: border-box; cursor: text; }
.combo-list {
  position: absolute; z-index: 50; left: 0; right: 0; top: calc(100% + 2px);
  max-height: 240px; overflow: auto; background: var(--surface-solid, #fff);
  border: 1px solid var(--border, #ccc); border-radius: 8px;
  box-shadow: 0 6px 18px rgba(0,0,0,.14); padding: 4px; box-sizing: border-box;
}
.combo-empty { padding: 8px 10px; color: var(--muted,#888); font-size: 12px; }
.combo-item {
  display: flex; align-items: baseline; gap: 8px; justify-content: space-between;
  padding: 7px 9px; border-radius: 7px; cursor: pointer; font-size: 13px;
}
.combo-item:hover, .combo-item.active { background: var(--accent-soft); }
.combo-item.selected { background: var(--accent-glow); font-weight: 600; }
.combo-item-name { color: var(--text,#222); word-break: break-all; }
.combo-item-sub { color: var(--muted,#888); font-size: 11px; flex: none; }
.drawer-body .chk { flex-direction: row; align-items: center; gap: 6px; color: var(--text,#222); }
.drawer-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }
.drawer-actions .btn { flex: 1 1 auto; }
.drawer-rel { margin-top: 16px; border-top: 1px dashed var(--border,#ccc); padding-top: 12px; }
.rel-title { font-size: 12px; color: var(--muted,#888); margin: 8px 0 4px; }
.rel-list { display: flex; flex-wrap: wrap; gap: 5px; }
.rel-chip { font-size: 12px; background: var(--accent-soft); color: var(--accent); padding: 3px 8px; border-radius: 8px; cursor: pointer; }
.rel-chip em { color: var(--muted,#888); font-style: normal; font-size: 11px; }
.muted { color: var(--muted,#888); }

/* 审核队列 */
.review-queue { padding: 16px; }
.rq-head { font-weight: 600; margin-bottom: 10px; }
.rq-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.rq-table th, .rq-table td { border: 1px solid var(--border,#ddd); padding: 8px 10px; text-align: left; }
.rq-table th { background: var(--surface-2); }
.rq-remark { max-width: 240px; color: var(--muted,#888); }

/* 版本管理 */
.version-bar { display: flex; align-items: center; gap: 12px; margin: 16px 0; }
.version-bar .hint { color: var(--muted,#888); font-size: 13px; }
.version-layout { display: grid; grid-template-columns: 340px 1fr; gap: 16px; }
.version-list { padding: 12px; max-height: 66vh; overflow: auto; }
.vl-title { font-weight: 600; margin-bottom: 8px; }
.vl-item { display: flex; justify-content: space-between; gap: 8px; padding: 9px; border-radius: 9px; border: 1px solid var(--border); margin-bottom: 8px; }
.vl-ops { display: flex; flex-direction: column; gap: 4px; }
.version-diff { padding: 14px; max-height: 66vh; overflow: auto; }
.df-head { font-weight: 700; font-size: 16px; margin-bottom: 8px; }
.df-counts { display: flex; gap: 6px; margin-bottom: 10px; }
.df-sec { margin-top: 12px; border-top: 1px dashed var(--border,#ccc); padding-top: 8px; }
.df-add { color: #27ae60; font-size: 13px; }
.df-del { color: #eb5757; font-size: 13px; }
.df-field { font-size: 13px; padding: 2px 0; }

/* 导出 */
.export-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 18px; }
.export-card { padding: 20px; text-align: center; }
.export-card .ico { font-size: 30px; }
.export-card h4 { margin: 10px 0 6px; }
.export-card p { font-size: 13px; color: var(--muted,#888); min-height: 42px; }
.export-card .btn { margin-top: 8px; width: 100%; }

.btn.small { padding: 5px 10px; font-size: 12px; }
.btn.warn { background: linear-gradient(135deg,#f2994a,#f2c94c); color: #3a2a00; }
.btn.danger { background: linear-gradient(135deg,#eb5757,#c0392b); color: #fff; }

/* 响应式 */
@media (max-width: 1100px) {
  .editor-layout { flex-direction: column; height: auto; }
  .editor-list, .editor-drawer, .editor-center { width: auto !important; flex: 1 1 auto !important; max-height: 56vh; }
  .editor-tree-wrap { height: 56vh; flex: none; }
  .resize-handle { display: none !important; }
  .editor-list.collapsed, .editor-drawer.collapsed, .editor-center.collapsed { width: auto !important; flex: 0 0 auto !important; max-height: none; }
  .collapsed .panel-title { writing-mode: horizontal-tb; letter-spacing: .5px; }
  .version-layout { grid-template-columns: 1fr; }
  .export-grid { grid-template-columns: 1fr; }
}

/* 谱籍信息编辑 */
.meta-edit { max-width: 520px; padding: 24px; margin-top: 18px; }
.meta-edit h3 { margin: 0 0 4px; }
.meta-edit .muted { color: var(--muted,#888); font-size: 13px; margin: 0 0 16px; }
.meta-edit .field { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.meta-edit .field label { width: 64px; font-weight: 600; color: var(--text2); flex: none; }
.meta-edit .field input { flex: 1; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 14px; background: var(--surface-solid); color: var(--text); }
.meta-edit .field input::placeholder { color: var(--muted); }
.meta-edit .field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-glow); }
.meta-edit .meta-actions { margin-top: 8px; display: flex; align-items: center; gap: 12px; }
