/* 云德设计器 · 全屏可视化编辑器（仿 300.cn 响应式编辑页） */

:root {
  --dsg-top: 52px;
  --dsg-rail: 72px;
  --dsg-panel: 348px;
  --dsg-ruler: 22px;
  --dsg-dark: #111827;
  --dsg-dark-2: #1f2937;
  --dsg-line: #e5e7eb;
  --dsg-blue: #2563eb;
  --dsg-blue-soft: #eff6ff;
  --dsg-text: #111827;
  --dsg-muted: #6b7280;
  --dsg-stage: #eef0f3;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", Helvetica, Arial, sans-serif;
  color: var(--dsg-text);
  background: var(--dsg-stage);
  overflow: hidden;
}

.hidden { display: none !important; }

svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------------- 登录 ---------------- */
.dsg-login {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(150deg, #0f172a, #1e3a8a 60%, #2563eb);
}
.dsg-login-box {
  width: 340px; padding: 32px 28px; background: #fff; border-radius: 12px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .35); text-align: center;
}
.dsg-login-box h1 { font-size: 20px; margin-bottom: 6px; }
.dsg-login-sub { color: var(--dsg-muted); font-size: 13px; margin-bottom: 22px; }
.dsg-login-box input {
  width: 100%; padding: 11px 13px; margin-bottom: 12px; font-size: 14px;
  border: 1px solid var(--dsg-line); border-radius: 7px; font-family: inherit;
}
.dsg-login-box input:focus { outline: 2px solid var(--dsg-blue-soft); border-color: var(--dsg-blue); }
.dsg-login-err { color: #dc2626; font-size: 13px; min-height: 18px; margin-top: 8px; }
.dsg-login-hint { color: var(--dsg-muted); font-size: 12px; margin-top: 10px; }
.dsg-login-hint a { color: var(--dsg-blue); }

/* ---------------- 骨架 ---------------- */
.dsg-app { display: flex; flex-direction: column; height: 100vh; }

.dsg-top {
  height: var(--dsg-top); flex: 0 0 var(--dsg-top);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 0 12px; background: var(--dsg-dark); color: #e5e7eb;
  border-bottom: 1px solid #000;
}
.dsg-top-l, .dsg-top-r, .dsg-top-c { display: flex; align-items: center; gap: 8px; }

.dsg-brand {
  font-size: 14px; font-weight: 600; color: #fff; letter-spacing: .3px;
  padding-right: 10px; margin-right: 2px; border-right: 1px solid #374151;
}
.dsg-pick { display: flex; align-items: center; gap: 5px; font-size: 12px; color: #9ca3af; }
.dsg-pick select {
  max-width: 190px; padding: 5px 8px; font-size: 12.5px; font-family: inherit;
  color: #f3f4f6; background: var(--dsg-dark-2); border: 1px solid #374151; border-radius: 6px;
}
.dsg-pick select:focus { outline: none; border-color: var(--dsg-blue); }
.dsg-dirty { width: 7px; height: 7px; border-radius: 50%; background: transparent; transition: background .2s; }
.dsg-dirty.on { background: #f59e0b; box-shadow: 0 0 0 3px rgba(245, 158, 11, .22); }

.dsg-seg { display: flex; background: var(--dsg-dark-2); border: 1px solid #374151; border-radius: 7px; overflow: hidden; }
.dsg-seg button {
  display: flex; align-items: center; gap: 4px; padding: 6px 10px; font-size: 12px; font-family: inherit;
  color: #9ca3af; background: none; border: none; cursor: pointer;
}
.dsg-seg button + button { border-left: 1px solid #374151; }
.dsg-seg button:hover { color: #fff; background: #374151; }
.dsg-seg button.active { color: #fff; background: var(--dsg-blue); }
.dsg-zoom button { padding: 6px 9px; min-width: 34px; justify-content: center; }

.dsg-btn {
  display: inline-flex; align-items: center; gap: 5px; padding: 7px 14px;
  font-size: 12.5px; font-family: inherit; border-radius: 6px; cursor: pointer;
  border: 1px solid transparent; background: none; color: #d1d5db; white-space: nowrap;
}
.dsg-btn:hover:not(:disabled) { background: #374151; color: #fff; }
.dsg-btn:disabled { opacity: .4; cursor: not-allowed; }
.dsg-btn.primary { background: var(--dsg-blue); color: #fff; }
.dsg-btn.primary:hover { background: #1d4ed8; }
.dsg-btn.ghost { border-color: #374151; }
.dsg-btn.block { width: 100%; justify-content: center; background: var(--dsg-blue); color: #fff; }
.dsg-btn.sm { padding: 5px 10px; font-size: 12px; border-color: var(--dsg-line); color: var(--dsg-text); }

/* ---------------- 主体三栏 ---------------- */
.dsg-body { flex: 1; display: flex; min-height: 0; position: relative; }

.dsg-stage { flex: 1; position: relative; min-width: 0; background: var(--dsg-stage); }

.dsg-ruler { position: absolute; background: #fff; z-index: 6; }
.dsg-ruler-x { top: 0; left: 0; right: 0; height: var(--dsg-ruler); border-bottom: 1px solid var(--dsg-line); overflow: hidden; }
.dsg-ruler-y { top: var(--dsg-ruler); left: 0; bottom: 0; width: var(--dsg-ruler); border-right: 1px solid var(--dsg-line); overflow: hidden; }
.dsg-ruler-in { position: relative; height: 100%; width: 100%; }
.dsg-ruler .tick { position: absolute; font-size: 9px; color: #9ca3af; }
.dsg-ruler-x .tick { top: 3px; padding-left: 2px; border-left: 1px solid #d1d5db; height: 100%; }
.dsg-ruler-y .tick { left: 2px; writing-mode: vertical-rl; border-top: 1px solid #d1d5db; width: 100%; }

.dsg-scroll {
  position: absolute; inset: var(--dsg-ruler) 0 0 var(--dsg-ruler);
  overflow: auto; padding: 18px 0 60px; display: flex; justify-content: center;
}
.dsg-canvas {
  position: relative; background: #fff; flex: 0 0 auto;
  width: 1440px; min-height: 400px;
  box-shadow: 0 2px 18px rgba(15, 23, 42, .1);
}
.dsg-canvas iframe { display: block; width: 100%; height: 400px; border: 0; }

.dsg-empty {
  position: absolute; inset: 0; display: flex; flex-direction: column; gap: 8px;
  align-items: center; justify-content: center; color: var(--dsg-muted);
  background: repeating-linear-gradient(45deg, #fafafa, #fafafa 12px, #f4f4f5 12px, #f4f4f5 24px);
  border: 1px dashed #d4d4d8; margin: 40px; border-radius: 10px; text-align: center; padding: 20px;
}
.dsg-empty p { font-size: 16px; color: var(--dsg-text); }
.dsg-empty span { font-size: 13px; }

/* 选中区块的悬浮工具条 */
.dsg-float {
  position: absolute; z-index: 20; display: flex; align-items: center; gap: 2px;
  background: var(--dsg-blue); color: #fff; border-radius: 7px; padding: 3px 4px;
  box-shadow: 0 6px 18px rgba(37, 99, 235, .35); white-space: nowrap;
}
.dsg-float-name { font-size: 11.5px; padding: 0 8px 0 6px; max-width: 190px; overflow: hidden; text-overflow: ellipsis; }
.dsg-float button {
  display: flex; align-items: center; justify-content: center; width: 26px; height: 26px;
  color: #fff; background: none; border: none; border-radius: 5px; cursor: pointer;
}
.dsg-float button:hover { background: rgba(255, 255, 255, .22); }
.dsg-float button.danger:hover { background: #dc2626; }
.dsg-float button svg { width: 15px; height: 15px; }

/* ---------------- 右侧图标栏 ---------------- */
.dsg-rail {
  flex: 0 0 var(--dsg-rail); width: var(--dsg-rail);
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding-top: 8px; background: #fff; border-left: 1px solid var(--dsg-line); z-index: 8;
}
.dsg-rail button {
  width: 62px; padding: 9px 0; display: flex; flex-direction: column; align-items: center; gap: 4px;
  font-size: 11px; font-family: inherit; color: var(--dsg-muted);
  background: none; border: none; border-radius: 8px; cursor: pointer;
}
.dsg-rail button:hover { background: #f3f4f6; color: var(--dsg-text); }
.dsg-rail button.active { background: var(--dsg-blue-soft); color: var(--dsg-blue); }
.dsg-rail button svg { width: 19px; height: 19px; }

/* ---------------- 右侧面板 ---------------- */
.dsg-panel {
  flex: 0 0 var(--dsg-panel); width: var(--dsg-panel);
  display: flex; flex-direction: column; min-height: 0;
  background: #fff; border-left: 1px solid var(--dsg-line);
}
.dsg-panel-head {
  flex: 0 0 42px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 12px; font-size: 13px; font-weight: 600; border-bottom: 1px solid var(--dsg-line);
}
.dsg-panel-head button { font-size: 20px; line-height: 1; color: var(--dsg-muted); background: none; border: none; cursor: pointer; }
.dsg-panel-body { flex: 1; overflow: auto; padding: 12px; }

/* ---- 组件库 ---- */
.dsg-lib-search { display: flex; gap: 6px; margin-bottom: 10px; }
.dsg-lib-search input {
  flex: 1; min-width: 0; padding: 7px 10px; font-size: 12.5px; font-family: inherit;
  border: 1px solid var(--dsg-line); border-radius: 6px;
}
.dsg-lib-search input:focus { outline: none; border-color: var(--dsg-blue); }
.dsg-lib-src { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 8px; }
.dsg-chip {
  padding: 3px 9px; font-size: 11.5px; font-family: inherit; color: var(--dsg-muted);
  background: #f3f4f6; border: 1px solid transparent; border-radius: 20px; cursor: pointer;
}
.dsg-chip:hover { background: #e5e7eb; }
.dsg-chip.active { background: var(--dsg-blue); color: #fff; }
.dsg-lib-count { font-size: 11.5px; color: var(--dsg-muted); margin-bottom: 8px; }

.dsg-lib-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.dsg-lib-card {
  border: 1px solid var(--dsg-line); border-radius: 8px; overflow: hidden;
  cursor: grab; background: #fff; position: relative;
}
.dsg-lib-card:active { cursor: grabbing; }
.dsg-lib-card:hover { border-color: var(--dsg-blue); box-shadow: 0 3px 12px rgba(37, 99, 235, .16); }
.dsg-lib-thumb { height: 82px; background: #f8fafc center top / cover no-repeat; border-bottom: 1px solid var(--dsg-line); }
.dsg-lib-thumb.no-img { background-image: none; background: repeating-linear-gradient(45deg, #f8fafc, #f8fafc 8px, #f1f5f9 8px, #f1f5f9 16px); }
.dsg-lib-meta { padding: 7px 8px 9px; }
.dsg-lib-meta b { display: block; font-size: 12px; font-weight: 600; line-height: 1.35; margin-bottom: 3px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dsg-lib-meta span { font-size: 10.5px; color: var(--dsg-muted); }
.dsg-lib-card .add {
  position: absolute; right: 6px; top: 6px; width: 22px; height: 22px; line-height: 20px; text-align: center;
  font-size: 15px; color: #fff; background: rgba(17, 24, 39, .62); border-radius: 50%;
  opacity: 0; transition: opacity .15s;
}
.dsg-lib-card:hover .add { opacity: 1; }

/* ---- 页面结构树 ---- */
.dsg-tree { display: flex; flex-direction: column; gap: 4px; }
.dsg-tree-row {
  display: flex; align-items: center; gap: 7px; padding: 8px 9px;
  border: 1px solid var(--dsg-line); border-radius: 7px; background: #fff; cursor: pointer;
}
.dsg-tree-row:hover { border-color: #bfdbfe; background: #f8fbff; }
.dsg-tree-row.active { border-color: var(--dsg-blue); background: var(--dsg-blue-soft); }
.dsg-tree-row.auto { opacity: .62; cursor: default; }
.dsg-tree-row.off .name { text-decoration: line-through; color: var(--dsg-muted); }
.dsg-tree-row .idx { font-size: 10.5px; color: var(--dsg-muted); min-width: 14px; }
.dsg-tree-row .name { flex: 1; min-width: 0; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dsg-tree-row .tag { font-size: 10px; color: var(--dsg-muted); background: #f3f4f6; padding: 1px 6px; border-radius: 10px; }
.dsg-tree-row .acts { display: flex; gap: 2px; }
.dsg-tree-row .acts button {
  width: 22px; height: 22px; display: flex; align-items: center; justify-content: center;
  color: var(--dsg-muted); background: none; border: none; border-radius: 4px; cursor: pointer;
}
.dsg-tree-row .acts button:hover { background: #e5e7eb; color: var(--dsg-text); }
.dsg-tree-row .acts button.danger:hover { background: #fee2e2; color: #dc2626; }
.dsg-tree-row[draggable="true"] { cursor: grab; }
.dsg-tree-row.dragging { opacity: .4; }
.dsg-tree-row.drop-before { box-shadow: 0 -3px 0 0 var(--dsg-blue); }
.dsg-tree-row.drop-after { box-shadow: 0 3px 0 0 var(--dsg-blue); }

/* ---- 属性表单 ---- */
.dsg-field { margin-bottom: 13px; }
.dsg-field > label { display: block; font-size: 12px; color: var(--dsg-muted); margin-bottom: 5px; }
.dsg-field input[type="text"], .dsg-field input[type="number"], .dsg-field select, .dsg-field textarea {
  width: 100%; padding: 8px 10px; font-size: 12.5px; font-family: inherit;
  border: 1px solid var(--dsg-line); border-radius: 6px; background: #fff; color: var(--dsg-text);
}
.dsg-field textarea { min-height: 84px; resize: vertical; line-height: 1.5; }
.dsg-field input:focus, .dsg-field select:focus, .dsg-field textarea:focus { outline: none; border-color: var(--dsg-blue); }
.dsg-field input[readonly], .dsg-field textarea[readonly] { background: #f9fafb; color: var(--dsg-muted); }
.dsg-field .hint { font-size: 11px; color: var(--dsg-muted); margin-top: 4px; }
.dsg-field .row { display: flex; gap: 6px; }
.dsg-field .row input { flex: 1; min-width: 0; }

.dsg-img-row { display: flex; gap: 6px; align-items: center; }
.dsg-img-prev { width: 46px; height: 46px; flex: 0 0 46px; border: 1px solid var(--dsg-line); border-radius: 6px; background: #f8fafc center/cover no-repeat; }

.dsg-list-item { border: 1px solid var(--dsg-line); border-radius: 7px; padding: 9px; margin-bottom: 8px; background: #fcfcfd; }
.dsg-list-item .head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 7px; font-size: 11.5px; color: var(--dsg-muted); }
.dsg-list-item .head button { color: #dc2626; background: none; border: none; cursor: pointer; font-size: 12px; }
.dsg-list-item .dsg-field:last-child { margin-bottom: 0; }

.dsg-panel-empty { padding: 32px 14px; text-align: center; color: var(--dsg-muted); font-size: 12.5px; line-height: 1.8; }
.dsg-sep { height: 1px; background: var(--dsg-line); margin: 14px 0; }
.dsg-group-title { font-size: 11.5px; font-weight: 600; color: var(--dsg-muted); margin: 4px 0 9px; }

/* ---- 多端差异化编辑：设备提示条 + 字段级「继承 / 已覆盖」开关 ---- */
.dsg-dev-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 10px; margin-bottom: 12px; border-radius: 7px;
  background: #eef6ff; border: 1px solid #cfe4ff; font-size: 12px; color: #1e40af;
}
.dsg-dev-bar b { font-weight: 600; }
.dsg-dev-hint { color: #6b8fc7; font-size: 11px; }
.dsg-field > label { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.dsg-ovr {
  border: 1px solid var(--dsg-line); background: #fff; color: var(--dsg-muted);
  font-size: 10.5px; line-height: 1; padding: 3px 7px; border-radius: 10px; cursor: pointer;
  flex: 0 0 auto;
}
.dsg-ovr:hover { border-color: var(--dsg-blue); color: var(--dsg-blue); }
.dsg-ovr.on { background: #fff4e6; border-color: #f5b872; color: #b45309; }
.dsg-field input.dsg-color {
  width: 40px; flex: 0 0 40px; height: 32px; padding: 2px;
  border: 1px solid var(--dsg-line); border-radius: 6px; background: #fff;
}
/* 设备切换按钮上的「本端已有覆盖」小圆点 */
.dsg-seg button.has-ovr { position: relative; }
.dsg-seg button.has-ovr::after {
  content: ""; position: absolute; right: 5px; top: 5px; width: 5px; height: 5px;
  border-radius: 50%; background: #f59e0b;
}

/* ---- 站点渲染方式：顶栏徽标 + 页面设置里的切换块 ---- */
.dsg-mode {
  margin-left: 8px; padding: 3px 9px; border-radius: 11px; cursor: pointer;
  font-size: 11.5px; line-height: 1.5; white-space: nowrap;
  border: 1px solid var(--dsg-line); background: #fff; color: var(--dsg-muted);
  font-family: inherit;
}
.dsg-mode:hover { border-color: var(--dsg-blue); color: var(--dsg-blue); }
.dsg-mode.visual { background: #eef9f3; border-color: #a7e0c6; color: #0f6e56; }
.dsg-mode.template { background: #fdf3e7; border-color: #f0cfa0; color: #92400e; }

.dsg-mode-box {
  border: 1px solid var(--dsg-line); border-radius: 8px; padding: 10px 11px;
  font-size: 12px; line-height: 1.7; color: var(--dsg-muted);
}
.dsg-mode-box b { color: var(--dsg-ink, #1f2937); font-weight: 600; display: block; margin-bottom: 4px; font-size: 12.5px; }
.dsg-mode-box.visual { background: #eef9f3; border-color: #a7e0c6; }
.dsg-mode-box.template { background: #fdf3e7; border-color: #f0cfa0; }
.dsg-mode-box + .dsg-btn { margin-top: 8px; }

/* ---- 页面管理 ---- */
.dsg-pg-bar { display: flex; gap: 6px; margin-bottom: 10px; }
.dsg-pg-bar .dsg-btn.ghost:hover { background: #f3f4f6; color: var(--dsg-text); }
.dsg-pg-list { display: flex; flex-direction: column; gap: 4px; }
.dsg-pg-row {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 8px 7px calc(4px + var(--depth, 0) * 14px);
  border: 1px solid var(--dsg-line); border-radius: 7px; background: #fff; cursor: pointer;
}
.dsg-pg-row:hover { border-color: #bfdbfe; background: #f8fbff; }
.dsg-pg-row.active { border-color: var(--dsg-blue); background: var(--dsg-blue-soft); }
.dsg-pg-row.dragging { opacity: .4; }
.dsg-pg-row.drop-before { box-shadow: 0 -3px 0 0 var(--dsg-blue); }
.dsg-pg-row.drop-after { box-shadow: 0 3px 0 0 var(--dsg-blue); }
.dsg-pg-row .grip { color: #cbd5e1; font-size: 12px; cursor: grab; letter-spacing: -1px; }
.dsg-pg-row .ttl {
  flex: 1; min-width: 0; font-size: 12.5px; display: flex; align-items: baseline; gap: 5px;
  overflow: hidden; white-space: nowrap;
}
.dsg-pg-row .ttl em {
  font-style: normal; font-size: 10.5px; color: var(--dsg-muted);
  overflow: hidden; text-overflow: ellipsis;
}
.dsg-pg-row .bd {
  flex: 0 0 auto; font-size: 10px; padding: 1px 6px; border-radius: 10px;
  background: #f3f4f6; color: var(--dsg-muted);
}
.dsg-pg-row .bd.home { background: #eef9f3; color: #0f7a53; }
.dsg-pg-row .bd.draft { background: #fdf3e7; color: #b45309; }
.dsg-pg-row .acts { display: flex; gap: 1px; flex: 0 0 auto; }
.dsg-pg-row .acts button {
  width: 22px; height: 22px; display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-family: inherit; color: var(--dsg-muted);
  background: none; border: none; border-radius: 4px; cursor: pointer;
}
.dsg-pg-row .acts button:hover:not(:disabled) { background: #e5e7eb; color: var(--dsg-text); }
.dsg-pg-row .acts button:disabled { opacity: .32; cursor: default; }
.dsg-pg-row .acts button.on { background: var(--dsg-blue); color: #fff; }
.dsg-pg-more {
  display: flex; flex-wrap: wrap; gap: 5px;
  margin: -1px 0 4px 16px; padding: 8px 9px;
  border: 1px dashed var(--dsg-line); border-radius: 0 0 7px 7px; background: #fafafa;
}
.dsg-pg-more button {
  padding: 4px 9px; font-size: 11.5px; font-family: inherit;
  color: var(--dsg-text); background: #fff; border: 1px solid var(--dsg-line);
  border-radius: 5px; cursor: pointer;
}
.dsg-pg-more button:hover { border-color: var(--dsg-blue); color: var(--dsg-blue); }
.dsg-pg-more button.danger:hover { border-color: #fca5a5; color: #dc2626; background: #fef2f2; }

/* ---- 组件库：收藏星标 ---- */
.dsg-lib-card .star {
  position: absolute; left: 6px; top: 6px; width: 22px; height: 22px; line-height: 22px;
  text-align: center; font-size: 13px; color: #fff; background: rgba(17, 24, 39, .42);
  border-radius: 50%; opacity: 0; transition: opacity .15s;
}
.dsg-lib-card:hover .star { opacity: 1; }
/* 已收藏的星标常显，不靠 hover —— 否则一眼看不出哪些收藏过 */
.dsg-lib-card .star.on { opacity: 1; color: #fbbf24; background: rgba(17, 24, 39, .72); }

/* ---- 模板面板 ---- */
.dsg-tpl { border: 1px solid var(--dsg-line); border-radius: 8px; overflow: hidden; margin-bottom: 10px; }
.dsg-tpl .cover { height: 92px; background: #f8fafc center top / cover no-repeat; border-bottom: 1px solid var(--dsg-line); }
.dsg-tpl .meta { padding: 9px 10px; }
.dsg-tpl .meta b { font-size: 12.5px; display: block; margin-bottom: 3px; }
.dsg-tpl .meta span { font-size: 11px; color: var(--dsg-muted); }
.dsg-tpl .meta .row { display: flex; gap: 6px; margin-top: 8px; }

/* ---------------- 提示 / 加载 ---------------- */
.dsg-toast {
  position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%);
  padding: 10px 20px; background: rgba(17, 24, 39, .93); color: #fff;
  font-size: 13px; border-radius: 8px; z-index: 300; max-width: 70vw; text-align: center;
}
.dsg-toast.err { background: #dc2626; }
.dsg-toast.ok { background: #16a34a; }

.dsg-loading {
  position: fixed; inset: 0; z-index: 250; display: flex; align-items: center; justify-content: center; gap: 10px;
  background: rgba(255, 255, 255, .55); color: var(--dsg-text); font-size: 13px; backdrop-filter: blur(1.5px);
}
.dsg-loading span {
  width: 16px; height: 16px; border: 2px solid var(--dsg-blue); border-top-color: transparent;
  border-radius: 50%; animation: dsg-spin .7s linear infinite;
}
@keyframes dsg-spin { to { transform: rotate(360deg); } }

/* ---------------- 顶栏「更多」菜单 ---------------- */
.dsg-more-wrap { position: relative; }
.dsg-menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 220;
  width: 258px; padding: 5px; background: #fff; border: 1px solid var(--dsg-line);
  border-radius: 9px; box-shadow: 0 12px 30px rgba(15, 23, 42, .18);
}
.dsg-menu button {
  display: block; width: 100%; padding: 8px 10px; text-align: left; cursor: pointer;
  background: none; border: none; border-radius: 6px; color: var(--dsg-text); font: inherit;
}
.dsg-menu button:hover { background: var(--dsg-blue-soft); }
.dsg-menu button b { display: block; font-size: 12.5px; font-weight: 600; }
.dsg-menu button span { display: block; font-size: 11px; color: var(--dsg-muted); margin-top: 2px; line-height: 1.5; }
.dsg-menu button.danger b { color: #dc2626; }
.dsg-menu button.danger:hover { background: #fef2f2; }

/* ---------------- 属性面板：容器列内组件 ---------------- */
.dsg-crumb { display: flex; align-items: center; gap: 8px; }
.dsg-crumb .dsg-btn.sm { padding: 3px 9px; }

.dsg-col-tabs { display: flex; gap: 4px; margin-bottom: 9px; }
.dsg-col-tab {
  flex: 1; padding: 6px 4px; cursor: pointer; font: inherit; font-size: 12px;
  background: #f9fafb; border: 1px solid var(--dsg-line); border-radius: 6px; color: var(--dsg-muted);
}
.dsg-col-tab:hover { border-color: #bfdbfe; color: var(--dsg-text); }
.dsg-col-tab.on { background: var(--dsg-blue-soft); border-color: var(--dsg-blue); color: var(--dsg-blue); }
.dsg-col-tab b { margin-left: 5px; font-size: 10.5px; opacity: .75; }

.dsg-kid { border: 1px solid var(--dsg-line); border-radius: 7px; padding: 7px 9px; margin-bottom: 6px; background: #fcfcfd; }
.dsg-kid:hover { border-color: #fdba74; background: #fffbf5; }
.dsg-kid-head { display: flex; align-items: center; gap: 6px; }
.dsg-kid-head .nm { flex: 1; min-width: 0; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dsg-kid-head .ty { font-size: 10px; color: var(--dsg-muted); background: #f3f4f6; padding: 1px 6px; border-radius: 10px; }
.dsg-kid-head .acts { display: flex; gap: 4px; flex-shrink: 0; }
.dsg-kid-head .acts .dsg-btn.sm { padding: 3px 8px; font-size: 11.5px; }
.dsg-kid-head .acts .dsg-btn.danger { color: #dc2626; }
.dsg-kid-head .acts .dsg-btn.danger:hover { background: #fee2e2; border-color: #fca5a5; }

.dsg-kid-pick {
  cursor: pointer; padding: 10px 12px; border: 1px solid var(--dsg-line);
  border-radius: 7px; background: #fff; text-align: left;
}
.dsg-kid-pick:hover { border-color: var(--dsg-blue); background: var(--dsg-blue-soft); }
.dsg-kid-pick .nm { font-size: 12.5px; }
.dsg-kid-pick .cat { font-size: 10.5px; color: var(--dsg-muted); margin-top: 3px; }

/* ---------------- 结构树：容器子层级 ---------------- */
.dsg-tree-row.kid { margin-left: 14px; background: #fcfcfd; }
.dsg-tree-row.kid .idx { min-width: 22px; }
.dsg-tree-col {
  margin: 5px 0 2px 14px; font-size: 10.5px; color: var(--dsg-muted);
  border-left: 2px solid var(--dsg-line); padding-left: 7px;
}
