/* =========================================================================
   天津智慧后勤 · 业务专题大屏 & 图表设计器 —— 全局样式（深色科技风）
   ========================================================================= */
:root {
  --bg: #060d1f;
  --bg-2: #0a1730;
  --panel: rgba(13, 29, 58, 0.55);
  --panel-solid: #0d1d3a;
  --line: rgba(64, 150, 255, 0.28);
  --line-strong: rgba(64, 150, 255, 0.55);
  --cyan: #23d2ff;
  --blue: #3d85ff;
  --green: #23e6a8;
  --orange: #ffb14d;
  --red: #ff5d6c;
  --purple: #a77bff;
  --text: #d7e6ff;
  --text-dim: #7f9cc9;
  --text-faint: #54708f;
  --radius: 10px;
  --sidebar-w: 220px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  background: radial-gradient(1200px 700px at 20% -10%, #10264d 0%, transparent 60%),
              radial-gradient(1000px 600px at 100% 110%, #0d2140 0%, transparent 55%),
              var(--bg);
  color: var(--text);
  overflow: hidden;
}

#app { height: 100vh; width: 100vw; display: flex; flex-direction: column; }

/* ---------------- 顶部导航 ---------------- */
.topbar {
  height: 60px;
  flex: 0 0 60px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 20px;
  background: linear-gradient(90deg, rgba(13,29,58,0.9), rgba(9,20,42,0.85));
  border-bottom: 1px solid var(--line);
  position: relative;
  z-index: 20;
}
.topbar .brand {
  font-size: 19px; font-weight: 700; letter-spacing: 1px;
  background: linear-gradient(90deg, var(--cyan), var(--blue));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  white-space: nowrap;
}
.topbar .divider { width: 1px; height: 26px; background: var(--line); flex: 0 0 auto; }
.topbar nav { display: flex; gap: 6px; align-items: center; overflow-x: auto; flex: 1; min-width: 0; flex-wrap: nowrap; }
.topbar nav .nav-item {
  cursor: pointer; padding: 7px 14px; border-radius: 8px; white-space: nowrap; flex: 0 0 auto;
  color: var(--text-dim); font-size: 14px; transition: all 0.18s;
  border: 1px solid transparent;
}
.topbar nav .nav-item:hover { color: var(--text); background: rgba(64,150,255,0.08); }
.topbar nav .nav-item.active {
  color: #03132b; background: linear-gradient(90deg, var(--cyan), var(--blue));
  font-weight: 600;
}
.topbar .meta { font-size: 12px; color: var(--text-dim); white-space: nowrap; text-align: right; }

/* ---------------- 屏幕容器 ---------------- */
.screen-wrap { flex: 1; overflow: hidden; position: relative; }
.screen {
  position: absolute; left: 50%; top: 50%;
  width: 1920px; height: 1080px;
  padding: 14px 20px 20px;
  display: flex; flex-direction: column; gap: 14px;
  transform: translate(-50%, -50%) scale(1);
  transform-origin: center center;
  animation: fadeIn 0.4s ease;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; } }

/* 大屏标题 */
.screen-head { display: flex; align-items: center; justify-content: space-between; }
.screen-head h2 {
  margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 2px;
  background: linear-gradient(90deg, #eaf4ff, var(--cyan));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.screen-head .sub { font-size: 13px; color: var(--text-dim); }

/* 网格布局 */
.grid {
  flex: 1; display: grid; gap: 14px; min-height: 0;
  grid-template-columns: repeat(12, 1fr);
  grid-auto-rows: minmax(0, 1fr);
}
.g3 { grid-column: span 3; }
.g4 { grid-column: span 4; }
.g6 { grid-column: span 6; }
.g8 { grid-column: span 8; }
.g12 { grid-column: span 12; }

/* ---------------- 面板卡片 ---------------- */
.panel {
  position: relative; background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; display: flex; flex-direction: column; min-height: 0; min-width: 0;
  backdrop-filter: blur(2px);
}
.panel::before, .panel::after {
  content: ""; position: absolute; width: 16px; height: 16px;
  border-color: var(--line-strong); border-style: solid; pointer-events: none;
}
.panel::before { top: -1px; left: -1px; border-width: 2px 0 0 2px; }
.panel::after { bottom: -1px; right: -1px; border-width: 0 2px 2px 0; }
.panel .p-title {
  font-size: 15px; font-weight: 600; color: var(--text);
  display: flex; align-items: center; gap: 8px; margin-bottom: 8px;
}
.panel .p-title::before { content: ""; width: 4px; height: 15px; background: var(--cyan); border-radius: 2px; box-shadow: 0 0 8px var(--cyan); }
.panel .p-body { flex: 1; min-height: 0; position: relative; }
.chart-box { width: 100%; height: 100%; }

/* ---------------- 数据卡片 ---------------- */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.kpi {
  background: linear-gradient(180deg, rgba(64,150,255,0.08), rgba(64,150,255,0.02));
  border: 1px solid var(--line); border-radius: 9px; padding: 12px 14px;
  display: flex; flex-direction: column; gap: 3px;
}
.kpi .k-label { font-size: 12px; color: var(--text-dim); }
.kpi .k-value { font-size: 26px; font-weight: 700; color: #eaf4ff; font-variant-numeric: tabular-nums; }
.kpi .k-value em { font-style: normal; font-size: 13px; color: var(--text-dim); font-weight: 500; margin-left: 3px; }
.kpi .k-trend { font-size: 11px; color: var(--green); }
.kpi.danger .k-value { color: var(--red); }
.kpi.warn .k-value { color: var(--orange); }
.kpi.ok .k-value { color: var(--green); }

/* ---------------- 通用工具 ---------------- */
.mono { font-variant-numeric: tabular-nums; }
.row { display: flex; gap: 10px; align-items: center; }
.flexc { display: flex; align-items: center; justify-content: center; }
.col { display: flex; flex-direction: column; gap: 10px; }
.mt8 { margin-top: 8px; }
.scroll-y { overflow-y: auto; }
.scroll-x { overflow-x: auto; }

.tag {
  display: inline-block; padding: 3px 10px; border-radius: 20px;
  font-size: 12px; border: 1px solid var(--line); color: var(--text-dim);
}
.tag.ok { color: var(--green); border-color: rgba(35,230,168,0.5); }
.tag.warn { color: var(--orange); border-color: rgba(255,177,77,0.5); }
.tag.err { color: var(--red); border-color: rgba(255,93,108,0.5); }
.tag.info { color: var(--cyan); border-color: rgba(35,210,255,0.5); }

/* ---------------- 表格 ---------------- */
.table { width: 100%; border-collapse: collapse; font-size: 12px; }
.table th, .table td { text-align: left; padding: 7px 8px; border-bottom: 1px solid rgba(64,150,255,0.12); white-space: nowrap; }
.table th { color: var(--cyan); font-weight: 600; position: sticky; top: 0; background: var(--panel-solid); }
.table td { color: var(--text); }
.table tr:hover td { background: rgba(64,150,255,0.06); }

/* ---------------- 列表 ---------------- */
.list { display: flex; flex-direction: column; gap: 8px; }
.list-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  background: rgba(64,150,255,0.05); border-radius: 8px; border: 1px solid rgba(64,150,255,0.12);
  font-size: 13px;
}
.list-item .idx { color: var(--cyan); font-weight: 700; width: 20px; }

/* 装饰底面 */
.deco {
  height: 100%; border-radius: var(--radius);
  border: 1px dashed rgba(64,150,255,0.3);
  background-image: radial-gradient(rgba(64,150,255,0.12) 1px, transparent 1px);
  background-size: 18px 18px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-faint); font-size: 12px;
}

/* =========================================================================
   设计器页（图表设计器 / 表单设计器 同一页，页内标签切换）
   ========================================================================= */
.designer-host { position: absolute; inset: 0; display: flex; flex-direction: column; }
.designer-tabs {
  flex: 0 0 auto; height: 46px; display: flex; align-items: center; gap: 6px;
  padding: 0 16px; border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, rgba(13,29,58,0.9), rgba(9,20,42,0.85));
}
.designer-tabs .dt-item {
  display: flex; align-items: center; gap: 6px; cursor: pointer; white-space: nowrap;
  padding: 7px 16px; border-radius: 8px; font-size: 14px; color: var(--text-dim);
  border: 1px solid transparent; transition: all 0.18s; user-select: none;
}
.designer-tabs .dt-item .ic { font-size: 15px; }
.designer-tabs .dt-item:hover { color: var(--text); background: rgba(64,150,255,0.08); }
.designer-tabs .dt-item.active {
  color: #03132b; background: linear-gradient(90deg, var(--cyan), var(--blue)); font-weight: 600;
}
.designer-tabs .dt-spacer { flex: 1; }
.designer-tabs .dt-tip { font-size: 12px; color: var(--text-faint); white-space: nowrap; }
.designer-panes { flex: 1; position: relative; min-height: 0; }
.designer-pane { position: absolute; inset: 0; display: none; }
.designer-pane.active { display: block; }

/* =========================================================================
   图表设计器
   ========================================================================= */
.designer { position: absolute; inset: 0; display: flex; }
.designer .ph-palette {
  width: 260px; flex: 0 0 260px; border-right: 1px solid var(--line);
  background: rgba(9,20,42,0.7); padding: 12px; overflow-y: auto;
}
.designer .ph-canvas {
  flex: 1; overflow: auto; padding: 24px;
  background-image: radial-gradient(rgba(64,150,255,0.08) 1px, transparent 1px);
  background-size: 20px 20px; position: relative;
}
.designer .ph-panel {
  width: 300px; flex: 0 0 300px; border-left: 1px solid var(--line);
  background: rgba(9,20,42,0.7); padding: 12px; overflow-y: auto;
}
.designer .ph-head { font-size: 13px; color: var(--text-dim); margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center; }
.designer .d-toolbar { display: flex; gap: 8px; }

.d-group { margin-bottom: 14px; }
.d-group .dg-title {
  font-size: 12px; color: var(--text-dim); margin-bottom: 6px; letter-spacing: 1px;
  display: flex; align-items: center; gap: 6px;
}
.d-group .dg-title::before { content: ""; width: 3px; height: 11px; background: var(--cyan); border-radius: 2px; }
.d-palette-items { display: grid; grid-template-columns: repeat(2, 1fr); gap: 7px; }
.d-item {
  cursor: grab; border: 1px solid var(--line); border-radius: 8px;
  background: rgba(64,150,255,0.05); padding: 10px 8px; text-align: center;
  font-size: 12px; color: var(--text); transition: all 0.15s; user-select: none;
}
.d-item:hover { border-color: var(--cyan); background: rgba(64,150,255,0.14); transform: translateY(-1px); }
.d-item .ic { font-size: 20px; display: block; margin-bottom: 4px; }

/* 画布容器 */
.canvas {
  position: relative; width: 1280px; height: 720px; margin: 0 auto;
  background: linear-gradient(180deg, rgba(13,29,58,0.95), rgba(9,20,42,0.95));
  border: 1px solid var(--line-strong); border-radius: 8px;
  box-shadow: 0 0 40px rgba(35,210,255,0.08);
}
.canvas .canvas-rule { position: absolute; inset: 0; pointer-events: none; border: 1px dashed rgba(35,210,255,0.25); }
.canvas .drop-hint {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: var(--text-faint); font-size: 15px; pointer-events: none;
}
/* 画布上的元件 */
.canvas .comp {
  position: absolute; border: 1px solid rgba(64,150,255,0.35); border-radius: 6px;
  background: rgba(13,29,58,0.6); overflow: hidden; cursor: move;
}
.canvas .comp.selected {
  border-color: var(--cyan); box-shadow: 0 0 0 2px rgba(35,210,255,0.35), 0 0 16px rgba(35,210,255,0.3);
}
.canvas .comp .comp-label {
  position: absolute; top: 2px; left: 6px; font-size: 10px; color: var(--cyan);
  background: rgba(13,29,58,0.9); padding: 1px 5px; border-radius: 4px; pointer-events: none; display: none;
}
.canvas .comp.selected .comp-label { display: block; }
.canvas .comp .comp-body { width: 100%; height: 100%; padding: 8px; }
.canvas .comp .del {
  position: absolute; top: 2px; right: 4px; width: 18px; height: 18px; border-radius: 4px;
  background: var(--red); color: #fff; font-size: 12px; display: none; align-items: center; justify-content: center;
  cursor: pointer; opacity: 0.85; z-index: 3;
}
.canvas .comp.selected .del { display: flex; }

/* 属性面板 */
.prop { display: flex; flex-direction: column; gap: 12px; }
.prop .prop-title { font-size: 14px; font-weight: 600; color: var(--text); }
.prop .field { display: flex; flex-direction: column; gap: 5px; }
.prop label { font-size: 12px; color: var(--text-dim); }
.prop input[type="text"], .prop input[type="number"], .prop select, .prop textarea {
  background: rgba(64,150,255,0.06); border: 1px solid var(--line); color: var(--text);
  border-radius: 6px; padding: 7px 9px; font-size: 13px; width: 100%;
}
.prop input[type="color"] { width: 100%; height: 34px; border: 1px solid var(--line); background: transparent; }
.prop .btn-row { display: flex; gap: 8px; }
.prop .btn { flex: 1; cursor: pointer; }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 7px 14px; border-radius: 8px; font-size: 13px; cursor: pointer;
  border: 1px solid var(--line); color: var(--text); background: rgba(64,150,255,0.08);
  transition: all 0.15s; user-select: none;
}
.btn.primary { background: linear-gradient(90deg, var(--cyan), var(--blue)); color: #03132b; font-weight: 600; border-color: transparent; }
.btn:hover { filter: brightness(1.1); }
.btn.ghost { background: transparent; }

/* 设计器右上角操作 */
.designer-actions { position: fixed; right: 320px; top: 66px; display: flex; gap: 8px; z-index: 30; }

/* 预览模式 */
.designer.preview .ph-palette, .designer.preview .ph-panel, .designer.preview .comp .del, .designer.preview .comp .comp-label { display: none; }
.designer.preview .ph-canvas { padding: 10px; background: var(--bg); }
.designer.preview .canvas, .designer.preview .canvas .comp { cursor: default; }

/* =========================================================================
   表单设计器
   ========================================================================= */
.formdesigner .fd-canvas-col { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.formdesigner .fd-toolbar {
  flex: 0 0 auto; display: flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-bottom: 1px solid var(--line);
  background: rgba(9, 20, 42, 0.65);
}
.formdesigner .fd-toolbar .spacer { flex: 1; }
.formdesigner .fd-toolbar .tip { font-size: 12px; color: var(--text-faint); }
.formdesigner.preview .fd-toolbar .edit-only { display: none; }

/* ---------- 表单卡片 ---------- */
.fd-form {
  width: 760px; max-width: 100%; margin: 0 auto;
  background: linear-gradient(180deg, rgba(13,29,58,0.96), rgba(9,20,42,0.96));
  border: 1px solid var(--line-strong); border-radius: 10px;
  padding: 22px 26px 26px; box-shadow: 0 0 40px rgba(35,210,255,0.08);
  transition: width 0.2s;
}
.fd-form.fd-sm { width: 600px; }
.fd-form-head { border-bottom: 1px dashed rgba(64,150,255,0.25); padding-bottom: 12px; margin-bottom: 16px; }
.fd-form-title { font-size: 18px; font-weight: 700; color: #eaf4ff; letter-spacing: 1px; }
.fd-form-desc { font-size: 12px; color: var(--text-dim); margin-top: 6px; line-height: 1.6; }

/* ---------- 栅格 ---------- */
.fd-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 18px; align-items: start; }
.fd-form-grid .fd-field.span2 { grid-column: span 2; }
.fd-empty {
  grid-column: span 2; padding: 56px 0; text-align: center; font-size: 13px;
  color: var(--text-faint); border: 1px dashed rgba(64,150,255,0.3); border-radius: 8px;
}
/* 左侧标签布局 */
.fd-form-grid.fd-label-left { grid-template-columns: 1fr; gap: 2px; }
.fd-form-grid.fd-label-left .fd-field { display: grid; grid-template-columns: var(--fd-label-w, 110px) 1fr; column-gap: 12px; }
.fd-form-grid.fd-label-left .fd-field.span2 { grid-column: span 1; }
.fd-form-grid.fd-label-left .fd-label { justify-content: flex-end; text-align: right; margin: 9px 0 0; }

/* ---------- 字段 ---------- */
.fd-field {
  position: relative; padding: 8px 10px; border: 1px solid transparent;
  border-radius: 8px; transition: border-color 0.15s, background 0.15s;
}
.formdesigner:not(.preview) .fd-field { cursor: move; user-select: none; }
.fd-field:hover { border-color: rgba(64,150,255,0.35); background: rgba(64,150,255,0.05); }
.fd-field.selected {
  border-color: var(--cyan); background: rgba(35,210,255,0.07);
  box-shadow: 0 0 0 1px rgba(35,210,255,0.25);
}
.fd-field.drop-before::before, .fd-field.drop-after::after {
  content: ""; position: absolute; left: 6px; right: 6px; height: 2px;
  background: var(--cyan); box-shadow: 0 0 8px var(--cyan); border-radius: 2px;
}
.fd-field.drop-before::before { top: -4px; }
.fd-field.drop-after::after { bottom: -4px; }
.fd-empty.drop-before { border-color: var(--cyan); box-shadow: inset 0 0 0 1px rgba(35,210,255,0.35); }

.fd-label { display: flex; align-items: center; gap: 4px; font-size: 13px; color: var(--text-dim); margin-bottom: 6px; }
.fd-label .fd-req { color: var(--red); }
.fd-help { font-size: 11px; color: var(--text-faint); margin-top: 5px; line-height: 1.5; }

/* 悬浮操作条 */
.fd-field-bar { position: absolute; top: -10px; right: 6px; display: none; gap: 4px; z-index: 5; }
.fd-field:hover .fd-field-bar, .fd-field.selected .fd-field-bar { display: flex; }
.formdesigner.preview .fd-field-bar { display: none !important; }
.fd-op {
  width: 22px; height: 22px; border-radius: 5px; background: var(--panel-solid);
  border: 1px solid var(--line); color: var(--text-dim); font-size: 12px; line-height: 1;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.fd-op:hover { background: var(--cyan); border-color: transparent; color: #03132b; }
.fd-op.del:hover { background: var(--red); color: #fff; }

/* ---------- 控件 ---------- */
.formdesigner:not(.preview) .fd-control { pointer-events: none; }
.fd-control { position: relative; min-width: 0; }
.fd-input {
  width: 100%; background: rgba(64,150,255,0.06); border: 1px solid var(--line);
  color: var(--text); border-radius: 7px; padding: 8px 10px; font-size: 13px;
  font-family: inherit; outline: none; transition: border-color 0.15s;
}
.fd-input:focus { border-color: var(--cyan); box-shadow: 0 0 0 2px rgba(35,210,255,0.15); }
textarea.fd-input { min-height: 74px; resize: vertical; line-height: 1.6; }
.fd-sm .fd-input { padding: 5px 9px; font-size: 12px; }
.fd-sm .fd-label { font-size: 12px; }

.fd-options { display: flex; flex-wrap: wrap; gap: 8px 18px; padding-top: 5px; }
.fd-opt { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text); cursor: pointer; }
.fd-opt input { accent-color: var(--cyan); width: 15px; height: 15px; cursor: pointer; }

.fd-switch { display: inline-flex; align-items: center; cursor: pointer; }
.fd-switch input { display: none; }
.fd-switch .fd-switch-slider {
  width: 44px; height: 22px; border-radius: 20px; position: relative;
  background: rgba(64,150,255,0.18); border: 1px solid var(--line); transition: all 0.2s;
}
.fd-switch .fd-switch-slider::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px;
  border-radius: 50%; background: #cfe4ff; transition: all 0.2s;
}
.fd-switch input:checked + .fd-switch-slider { background: linear-gradient(90deg, var(--cyan), var(--blue)); border-color: transparent; }
.fd-switch input:checked + .fd-switch-slider::after { left: 24px; background: #03132b; }

.fd-rate { display: flex; gap: 4px; font-size: 20px; line-height: 1; color: rgba(255,177,77,0.25); }
.fd-rate .fd-star { cursor: pointer; }
.fd-rate .fd-star.on { color: var(--orange); }

.fd-slider-row { display: flex; align-items: center; gap: 12px; padding-top: 4px; }
.fd-range { flex: 1; accent-color: var(--cyan); background: transparent; border: 0; padding: 0; }
.fd-slider-val { font-size: 12px; color: var(--cyan); min-width: 42px; text-align: right; font-variant-numeric: tabular-nums; }

.fd-range-row { display: flex; align-items: center; gap: 8px; }
.fd-range-row .fd-range-sep { color: var(--text-faint); }

.fd-upload {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 18px; border: 1px dashed var(--line-strong); border-radius: 8px;
  color: var(--text-dim); font-size: 13px; cursor: pointer; background: rgba(64,150,255,0.04);
  transition: all 0.15s;
}
.fd-upload:hover { border-color: var(--cyan); color: var(--text); background: rgba(64,150,255,0.1); }
.fd-upload .fd-upload-ic { font-size: 16px; }

.fd-color { width: 100%; height: 34px; padding: 2px; background: transparent; border: 1px solid var(--line); border-radius: 7px; cursor: pointer; }

/* ---------- 布局类字段 ---------- */
.fd-group-title { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; color: #eaf4ff; letter-spacing: 0.5px; }
.fd-group-title::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line-strong), transparent); }
.fd-divider { display: flex; align-items: center; gap: 10px; height: 1px; background: linear-gradient(90deg, transparent, var(--line-strong), transparent); margin: 8px 0; }
.fd-divider span { flex: 0 0 auto; font-size: 11px; color: var(--text-faint); background: #0b1a33; padding: 0 8px; line-height: 1; transform: translateY(-1px); }
.fd-notice {
  font-size: 12px; color: var(--text-dim); line-height: 1.7;
  background: rgba(64,150,255,0.07); border-left: 3px solid var(--cyan);
  border-radius: 0 6px 6px 0; padding: 9px 12px;
}
.fd-btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 9px 22px; border-radius: 8px; font-size: 13px; cursor: pointer;
  border: 1px solid var(--line); background: rgba(64,150,255,0.1); color: var(--text);
}
.fd-btn.primary { background: linear-gradient(90deg, var(--cyan), var(--blue)); color: #03132b; font-weight: 600; border-color: transparent; }
.fd-btn:hover { filter: brightness(1.1); }

/* ---------- 预览提交 ---------- */
.fd-submit-row {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  margin-top: 20px; padding-top: 16px; border-top: 1px dashed rgba(64,150,255,0.25);
}
.fd-result { width: 100%; background: rgba(3,13,31,0.7); border: 1px solid var(--line); border-radius: 8px; padding: 12px; }
.fd-result-title { font-size: 12px; color: var(--green); margin-bottom: 8px; }
.fd-result pre {
  margin: 0; font-size: 12px; color: #bcd6ff; line-height: 1.6;
  white-space: pre-wrap; word-break: break-all; max-height: 200px; overflow: auto;
  font-family: ui-monospace, Menlo, Consolas, monospace;
}

/* ---------- 属性面板补充 ---------- */
.formdesigner .prop .prop-hint { font-size: 11px; color: var(--text-faint); line-height: 1.6; }
.formdesigner .prop .fd-sec {
  font-size: 12px; color: var(--text-dim); letter-spacing: 1px; margin: 4px 0 -4px;
  display: flex; align-items: center; gap: 6px;
}
.formdesigner .prop .fd-sec::before { content: ""; width: 3px; height: 11px; background: var(--cyan); border-radius: 2px; }
.formdesigner .prop .btn.danger { border-color: rgba(255,93,108,0.5); color: var(--red); background: rgba(255,93,108,0.08); }
.formdesigner .prop .btn.danger:hover { background: var(--red); color: #fff; }
.fd-kinds { display: flex; flex-wrap: wrap; gap: 6px; }
.fd-kind { font-size: 11px; color: var(--text-dim); border: 1px solid var(--line); border-radius: 20px; padding: 2px 9px; }

.fd-opt-editor { display: flex; flex-direction: column; gap: 6px; }
.fd-opt-list { display: flex; flex-direction: column; gap: 6px; }
.fd-opt-row { display: flex; align-items: center; gap: 6px; }
.fd-opt-row input { flex: 1; min-width: 0; }
.fd-opt-row .fd-op { flex: 0 0 auto; height: 30px; }
.fd-opt-editor .btn { align-self: flex-start; padding: 5px 12px; font-size: 12px; }

/* ---------- JSON 弹层 ---------- */
.fd-modal {
  position: absolute; inset: 0; z-index: 120; display: none;
  align-items: center; justify-content: center;
  background: rgba(3,8,20,0.72); backdrop-filter: blur(3px);
}
.fd-modal.open { display: flex; }
.fd-modal-box {
  width: 640px; max-width: 92%; max-height: 88%; display: flex; flex-direction: column; gap: 10px;
  background: var(--panel-solid); border: 1px solid var(--line-strong); border-radius: 12px;
  padding: 16px 18px; box-shadow: 0 24px 70px rgba(0,0,0,0.55);
}
.fd-modal-head { display: flex; align-items: center; justify-content: space-between; font-size: 14px; font-weight: 600; color: var(--text); }
.fd-modal-head .x { cursor: pointer; color: var(--text-dim); font-size: 13px; padding: 2px 6px; border-radius: 5px; }
.fd-modal-head .x:hover { color: var(--text); background: rgba(64,150,255,0.12); }
.fd-json {
  width: 100%; height: 340px; resize: vertical; padding: 12px;
  background: rgba(3,13,31,0.85); border: 1px solid var(--line); border-radius: 8px;
  color: #bcd6ff; font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 12px; line-height: 1.6; outline: none;
}
.fd-json:focus { border-color: var(--cyan); }
.fd-modal-foot { display: flex; align-items: center; gap: 8px; }
.fd-modal-foot .spacer { flex: 1; }
.fd-modal-msg { font-size: 12px; color: var(--text-dim); line-height: 1.6; }
.fd-modal-msg.err { color: var(--red); }
.fd-modal-msg.ok { color: var(--green); }
