/* ============================================================
   捷径工坊 · Field Shortcut Studio
   共享样式层（设计契约唯一来源：token / 壳层 / 组件）
   ============================================================ */

/* ---------- 1. Design tokens ---------- */
:root {
  --blue: #3370ff;
  --blue-hover: #245bdb;
  --blue-soft: #eef4ff;
  --blue-tint: #f6f9ff;
  --amber: #ff7d00;
  --amber-soft: #fff4e6;
  --green: #00b578;
  --green-soft: #e8f8f1;
  --red: #f54a45;
  --red-soft: #ffeceb;
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #fafbfc;
  --surface-3: #f2f3f5;
  --ink: #1f2329;
  --ink-2: #4e5969;
  --ink-3: #86909c;
  --ink-4: #a9aeb8;
  --line: #e5e6eb;
  --line-2: #f0f1f3;
  --sidebar-w: 236px;
  --r-xs: 4px;
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 16px;
  --sh-sm: 0 1px 2px rgba(31, 35, 41, 0.06), 0 1px 3px rgba(31, 35, 41, 0.04);
  --sh-md: 0 4px 16px rgba(31, 35, 41, 0.08), 0 1px 2px rgba(31, 35, 41, 0.04);
  --sh-lg: 0 18px 48px rgba(31, 35, 41, 0.14);
  --font-sans: "HarmonyOS Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --font-serif: "Songti SC", "Noto Serif SC", "Source Han Serif SC", Georgia, serif;
  --font-mono: "SF Mono", ui-monospace, "JetBrains Mono", Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ---------- 2. Reset & base ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink);
  background:
    radial-gradient(900px 420px at 6% -10%, rgba(51, 112, 255, 0.10), transparent 62%),
    radial-gradient(760px 380px at 98% 0%, rgba(255, 125, 0, 0.06), transparent 60%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; font-size: 14px; color: var(--ink); }
svg { display: block; }
::selection { background: rgba(51, 112, 255, 0.18); }

/* ---------- 3. App shell (frozen) ---------- */
.app-nav {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  width: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  padding: 18px 12px 14px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-right: 1px solid var(--line);
  overflow-y: auto;
}
.app-content {
  margin-left: var(--sidebar-w);
  padding: 24px 32px 56px;
  max-width: 1440px;
}
/* 项目页使用独立布局：不显示全局导航，内容占满整宽 */
body[data-page="project"] .app-content {
  margin-left: 0;
  padding: 24px 32px 56px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 18px;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: var(--r-md);
  color: #fff;
  background: linear-gradient(145deg, #4d84ff, #245bdb);
  box-shadow: 0 4px 12px rgba(51, 112, 255, 0.28);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 15px; font-weight: 600; letter-spacing: 0.01em; }
.brand-text em {
  font-style: normal;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  color: var(--ink-3);
  margin-top: 3px;
}
.nav-caption {
  padding: 12px 10px 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--ink-4);
  text-transform: uppercase;
}
.nav-list { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 38px;
  padding: 0 10px;
  border-radius: var(--r-sm);
  color: var(--ink-2);
  font-size: 13.5px;
  transition: background 0.18s var(--ease), color 0.18s var(--ease);
}
.nav-item svg { color: var(--ink-3); transition: color 0.18s var(--ease); flex: none; }
.nav-item:hover { background: var(--surface-2); color: var(--ink); }
.nav-item:hover svg { color: var(--ink-2); }
.nav-item.active {
  background: var(--blue-soft);
  color: var(--blue);
  font-weight: 600;
}
.nav-item.active svg { color: var(--blue); }
.nav-note {
  position: relative;
  margin: 20px 4px 14px;
  padding: 12px 12px 12px 34px;
  border: 1px dashed #cfd8ea;
  border-radius: var(--r-md);
  background: var(--blue-tint);
}
.nav-note-ico {
  position: absolute;
  left: 10px;
  top: 12px;
  color: var(--blue);
}
.nav-note p { font-size: 12px; color: var(--ink-2); }
.nav-note strong { color: var(--blue); font-family: var(--font-mono); }
.nav-note a {
  display: inline-block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--blue);
  border-bottom: 1px solid rgba(51, 112, 255, 0.35);
}
.nav-user {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 8px 4px;
  border-top: 1px solid var(--line-2);
}
.avatar {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #e8edf7;
  color: #39507a;
  font-size: 12px;
  font-weight: 600;
  flex: none;
}
.nav-user-txt { display: flex; flex-direction: column; line-height: 1.35; min-width: 0; }
.nav-user-txt strong { font-size: 12.5px; }
.nav-user-txt em { font-style: normal; font-size: 11px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- 4. Page head ---------- */
.page-head {
  position: relative;
  z-index: 30;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 20px;
}
/* 标题区占满剩余宽度，超长副标题在窄屏下正常换行而不挤压右侧操作区 */
.page-head-main { flex: 1 1 auto; min-width: 0; }
.crumb {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--ink-3);
  margin-bottom: 8px;
}
.crumb svg { color: var(--ink-4); }
.page-title {
  font-size: 24px;
  line-height: 1.3;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.page-sub {
  margin-top: 6px;
  max-width: 640px;
  font-size: 13px;
  color: var(--ink-3);
  line-height: 1.7;
}
.head-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--ink-3);
  text-transform: uppercase;
}

/* ---------- 5. Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  transition: all 0.18s var(--ease);
}
.btn:hover { border-color: #c9cdd4; color: var(--ink); background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid rgba(51, 112, 255, 0.28); outline-offset: 1px; }
.btn svg { flex: none; }
.btn.is-loading { pointer-events: none; opacity: 0.8; }
.btn-spinner {
  flex: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-top-color: transparent;
  animation: btn-spin 0.7s linear infinite;
}
@keyframes btn-spin { to { transform: rotate(360deg); } }
.btn-primary {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
  box-shadow: 0 3px 10px rgba(51, 112, 255, 0.22);
}
.btn-primary:hover { background: var(--blue-hover); border-color: var(--blue-hover); color: #fff; }
.btn-primary:disabled {
  background: #b8ccf5;
  border-color: #b8ccf5;
  box-shadow: none;
  cursor: not-allowed;
}
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface); border-color: var(--line); }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12px; border-radius: var(--r-xs); }
.btn-lg { height: 40px; padding: 0 20px; font-size: 14px; }
.btn-block { width: 100%; }
.btn.is-loading { pointer-events: none; opacity: 0.72; }
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid transparent;
  border-radius: var(--r-xs);
  background: transparent;
  color: var(--ink-3);
  transition: all 0.18s var(--ease);
}
.icon-btn:hover { background: var(--surface-2); border-color: var(--line); color: var(--ink-2); }
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12.5px;
  color: var(--blue);
  font-weight: 500;
}
.link-arrow:hover { gap: 7px; }
.link-arrow { transition: gap 0.18s var(--ease); }
/* 执行记录里的记录 ID：点击打开工作区对应记录的详情 / 编辑 */
.record-link { color: var(--blue); font-weight: 500; }
.record-link:hover { text-decoration: underline; }

/* ---------- 6. Inputs ---------- */
.input, .select, .textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  padding: 0 12px;
  height: 34px;
  transition: border 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
.input:hover, .select:hover, .textarea:hover { border-color: #c9cdd4; }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(51, 112, 255, 0.12);
}
.input::placeholder, .textarea::placeholder { color: var(--ink-4); }
.textarea { height: auto; min-height: 76px; padding: 9px 12px; resize: vertical; line-height: 1.7; }
.select { appearance: none; padding-right: 32px; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2386909c' stroke-width='2'><path d='m6 9 6 6 6-6'/></svg>"); background-repeat: no-repeat; background-position: right 12px center; }
.search-wrap {
  position: relative;
  flex: 1;
  min-width: 240px;
}
.search-wrap svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-3);
  pointer-events: none;
}
.search-wrap .input { padding-left: 36px; height: 36px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.field-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
}
.field-label .req { color: var(--red); font-weight: 400; }
.field-hint { font-size: 11.5px; color: var(--ink-3); line-height: 1.6; }
.req-mark { color: var(--red); font-weight: 600; }
.prompt-tools { display: flex; align-items: center; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.prompt-tools .select { max-width: 220px; }
/* 可搜索下拉（码表引用） */
.combo { position: relative; }
.combo-input { padding-right: 30px; }
.combo-caret {
  position: absolute; right: 11px; top: 50%; transform: translateY(-50%);
  color: var(--ink-4); font-size: 11px; pointer-events: none;
}
.combo-list {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30;
  max-height: 220px; overflow: auto; padding: 4px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 10px 28px rgba(20, 24, 32, 0.14);
}
.combo-item {
  display: flex; flex-direction: column; gap: 2px; width: 100%;
  padding: 8px 10px; border: none; border-radius: 6px;
  background: transparent; text-align: left; cursor: pointer;
}
.combo-item:hover, .combo-item.active { background: var(--blue-soft); }
.combo-name { font-size: 12.5px; color: var(--ink-1); }
.combo-meta { font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); }
.combo-empty { padding: 10px; font-size: 12px; color: var(--ink-3); }
/* 公式大全 */
#formulaRefMask { z-index: 90; }
/* 插入引用弹框：需要在字段 / 动作 / 提示词弹框之上打开 */
#wsRefMask, #wfRefMask, #scRefMask { z-index: 90; }
.ref-links:empty { display: none; }
.formula-list { margin-top: 12px; max-height: 55vh; overflow: auto; padding-right: 4px; display: flex; flex-direction: column; gap: 18px; }
.formula-group h4 { font-size: 12.5px; color: var(--ink-3); margin-bottom: 8px; }
.formula-items { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.formula-item {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); text-align: left; cursor: pointer;
}
.formula-item:hover { border-color: var(--blue); background: var(--blue-soft); }
.formula-name { font-family: var(--font-mono); font-size: 12px; font-weight: 600; color: var(--blue); }
.formula-sig { font-family: var(--font-mono); font-size: 11px; color: var(--ink-2); overflow-wrap: anywhere; }
.formula-desc { font-size: 11.5px; color: var(--ink-3); }
@media (max-width: 560px) { .formula-items { grid-template-columns: 1fr; } }
/* 码表条目 */
#codeTableMask { z-index: 90; }
.code-table-modal { max-width: 860px; }
.code-table-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.code-entry-list { display: flex; flex-direction: column; gap: 6px; max-height: 55vh; overflow: auto; }
.code-entry-row { display: flex; align-items: center; gap: 6px; }
.code-entry-row .code-code { flex: 0 0 120px; width: 120px; }
.code-entry-row .code-name { flex: 1 1 auto; min-width: 120px; }
.code-entry-row .code-parent { flex: 0 0 170px; width: 170px; }
.code-entry-row .code-sort { flex: 0 0 70px; width: 70px; }
.code-entry-row .check-item { flex: 0 0 auto; white-space: nowrap; }
.field-error { display: none; font-size: 11.5px; color: var(--red); }
.field.has-error .input, .field.has-error .textarea { border-color: var(--red); }
.field.has-error .field-error { display: block; }
/* 独立错误行（不包在 .field 里）需要显式显示，否则永远不可见 */
.field-error.is-visible { display: block; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }

/* ---------- 动作显示条件 ---------- */
.cond-box { display: flex; flex-direction: column; gap: 8px; }
.cond-head { display: flex; align-items: center; gap: 8px; }
.cond-head .select { flex: 1; min-width: 0; }
.cond-list { display: flex; flex-direction: column; gap: 8px; }
.cond-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: var(--surface);
}
.cond-row-head { display: flex; align-items: center; gap: 6px; }
.cond-row-head .select { flex: 1; min-width: 0; }
/* 插入字段 / 参数：点选后插入到比较值光标处 */
.cond-tools { display: flex; gap: 6px; }
.cond-tools .select { flex: 1; min-width: 0; height: 30px; font-size: 12px; padding: 0 26px 0 10px; }
.cond-row .cond-value { width: 100%; min-height: 52px; resize: vertical; }
/* 表达式条件不绑定字段 */
.cond-row.expr-mode [data-cond-field] { display: none; }
.cond-remove { color: var(--ink-3); font-size: 16px; line-height: 1; }
.cond-remove:hover { color: var(--red); }
.cond-foot { display: flex; justify-content: flex-end; }
.cond-help { white-space: nowrap; }
/* 子条件组：用于表达 (A 且 B) 或 (C 且 D) 这类嵌套逻辑 */
.cond-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px;
  border: 1px dashed var(--line-2);
  border-radius: 8px;
  background: var(--bg-soft, rgba(0, 0, 0, 0.02));
}
.cond-group-head { display: flex; align-items: center; gap: 6px; }
.cond-group-head .select { flex: 1; min-width: 0; }
.cond-group .cond-list { padding-left: 6px; border-left: 2px solid var(--line-2); }

/* 工作流画布 */
.wf-canvas-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.wf-canvas-toolbar .field-hint { flex: 1; min-width: 220px; }
.wf-canvas-layout { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 12px; align-items: stretch; }
.wf-canvas-wrap {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  overflow: auto;
  max-height: 520px;
}
.wf-canvas {
  position: relative;
  min-width: 820px;
  min-height: 440px;
  background-image: radial-gradient(#dfe5ee 1px, transparent 1px);
  background-size: 18px 18px;
}
.wf-edges { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.wf-edge-line { fill: none; stroke: #a9b5c6; stroke-width: 1.6; }
.wf-edge-line.is-selected { stroke: var(--blue); stroke-width: 2.4; }
.wf-edge-hit { fill: none; stroke: transparent; stroke-width: 14; pointer-events: stroke; cursor: pointer; }
.wf-edge-temp { fill: none; stroke: var(--blue); stroke-width: 2; stroke-dasharray: 5 4; }
.wf-edge-label {
  font-size: 9px;
  fill: var(--ink-2);
  paint-order: stroke;
  stroke: #fbfcfe;
  stroke-width: 2.5px;
  stroke-linejoin: round;
}
.wf-canvas-node {
  position: absolute;
  width: 110px;
  height: 40px;
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: 7px;
  background: var(--surface);
  box-shadow: var(--sh-sm);
  cursor: grab;
  user-select: none;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 5px;
}
.wf-canvas-node.is-selected { border-color: var(--blue); box-shadow: 0 0 0 2px rgba(51, 112, 255, 0.16); }
/* 开始 / 结束：圆形 */
.wf-shape-circle {
  width: 40px;
  height: 40px;
  padding: 0;
  border: 2px solid var(--green);
  border-left-width: 2px;
  border-radius: 50%;
  background: var(--green-soft);
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0;
}
.wf-type-end.wf-shape-circle { border-color: var(--ink-4); background: var(--surface); }
.wf-canvas-node.wf-shape-circle .wf-node-icon {
  width: auto;
  height: auto;
  background: none;
  color: inherit;
}
.wf-type-start.wf-shape-circle .wf-node-icon { color: var(--green); background: none; }
.wf-type-end.wf-shape-circle .wf-node-icon { color: var(--ink-3); background: none; }
.wf-shape-circle .wf-node-name {
  max-width: 34px;
  font-size: 10px;
  line-height: 1.3;
  text-align: center;
}
/* 条件节点：菱形 */
.wf-shape-condition {
  width: 72px;
  height: 48px;
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
  align-items: center;
  justify-content: center;
}
.wf-shape-condition.is-selected { border-color: transparent; box-shadow: none; }
.wf-condition-shape {
  position: absolute;
  inset: 0;
  background: var(--amber);
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
}
.wf-condition-shape::before {
  content: '';
  position: absolute;
  inset: 1.5px;
  background: var(--surface);
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
}
.wf-shape-condition.is-selected .wf-condition-shape { background: var(--blue); }
.wf-shape-condition.is-selected .wf-condition-shape::before { background: var(--blue-tint); }
.wf-shape-condition .wf-node-name {
  position: relative;
  z-index: 1;
  max-width: 52px;
  padding: 0;
  font-size: 10px;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wf-node-icon {
  width: 19px;
  height: 19px;
  border-radius: 5px;
  flex: none;
  display: grid;
  place-items: center;
  background: var(--surface-3);
  color: var(--ink-2);
}
.wf-node-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  min-width: 0;
  flex: 1;
}
.wf-node-name {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wf-node-sub {
  font-size: 9.5px;
  line-height: 1.2;
  color: var(--ink-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wf-type-start { border-left-color: var(--green); }
.wf-type-start .wf-node-icon { background: var(--green-soft); color: var(--green); }
.wf-type-end { border-left-color: var(--ink-4); }
.wf-type-end .wf-node-icon { background: var(--surface-3); color: var(--ink-3); }
.wf-type-condition { border-left-color: var(--amber); }
.wf-type-condition .wf-node-icon { background: var(--amber-soft); color: var(--amber); }
.wf-type-parallel { border-left-color: #7b61ff; }
.wf-type-parallel .wf-node-icon { background: #f0edff; color: #7b61ff; }
.wf-type-aggregate { border-left-color: #13a8a8; }
.wf-type-aggregate .wf-node-icon { background: #e6f7f7; color: #13a8a8; }
.wf-type-approval { border-left-color: var(--blue); }
.wf-type-approval .wf-node-icon { background: var(--blue-soft); color: var(--blue); }
.wf-type-auto { border-left-color: #e8590c; }
.wf-type-auto .wf-node-icon { background: #fff1e6; color: #e8590c; }
.wf-port {
  position: absolute;
  left: 50%;
  top: auto;
  width: 10px;
  height: 10px;
  margin: 0;
  transform: translateX(-50%);
  border-radius: 50%;
  background: var(--surface);
  border: 1.5px solid #9aa8bb;
  cursor: crosshair;
  z-index: 2;
}
.wf-port-in { top: -5px; }
.wf-port-out { top: auto; bottom: -5px; }
.wf-port-success { left: 28%; }
.wf-port-failed { left: 72%; }
.wf-port-success:hover { border-color: var(--green); }
.wf-port-failed:hover { border-color: var(--red); }
.wf-edge-line.wf-edge-failed { stroke: #e8898a; }
.wf-edge-label.is-failed { fill: var(--red); }
.wf-branch-flag {
  flex: none;
  padding: 1px 6px;
  border-radius: 9px;
  font-size: 10.5px;
  line-height: 16px;
}
.wf-branch-flag.is-success { background: var(--green-soft); color: #07825a; }
.wf-branch-flag.is-failed { background: var(--red-soft); color: #c0392b; }
.wf-port:hover { border-color: var(--blue); }
.wf-side {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface-2);
  max-height: 520px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.wf-side-head { display: flex; align-items: center; justify-content: space-between; }
.wf-side-empty { margin: 0; font-size: 12px; color: var(--ink-3); line-height: 1.7; }
.wf-side-danger { color: var(--red); align-self: flex-start; }
.wf-branch-list { display: flex; flex-direction: column; gap: 6px; }
.wf-branch {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  font-size: 12px;
}
.wf-branch-no {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--surface-3);
  color: var(--ink-2);
  font-size: 10.5px;
  flex: none;
}
.wf-branch-target { flex: none; max-width: 82px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.wf-branch-cond {
  flex: 1;
  min-width: 0;
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 10.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 工作流独立页面 */
body[data-page="workflow"] { overflow: hidden; background: var(--bg); }
.wf-page { display: flex; flex-direction: column; height: 100vh; }
.wf-page-head {
  flex: none;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.wf-page-title { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; }
.wf-page-title .crumb-link {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 12px;
  color: var(--ink-3);
  text-decoration: none;
  white-space: nowrap;
}
.wf-page-title .crumb-link:hover { color: var(--blue); }
.wf-page-sep { color: var(--ink-4); font-size: 12px; }
.wf-page-project { font-size: 12px; color: var(--ink-2); white-space: nowrap; }
.wf-name-input { max-width: 320px; height: 32px; font-weight: 600; }
.wf-page-meta { font-size: 11.5px; color: var(--ink-3); white-space: nowrap; }
.wf-page-actions { display: flex; align-items: center; gap: 8px; flex: none; }
/* 版本徽标：与捷径流一致，显示当前保存版本 */
.wf-version-badge {
  flex: none;
  padding: 2px 8px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 650;
  color: var(--blue);
  background: var(--blue-soft);
}
/* 版本历史列表 */
.wf-version-list { display: flex; flex-direction: column; gap: 8px; }
.wf-version-item {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
}
.wf-version-item.is-current { border-color: var(--blue); background: var(--blue-soft); }
.wf-version-item-head { display: flex; align-items: center; gap: 8px; }
.wf-version-tag {
  flex: none;
  padding: 1px 7px;
  border-radius: var(--r-xs);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 650;
  color: var(--blue);
  background: #fff;
  border: 1px solid var(--blue);
}
.wf-version-item-head strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12.5px;
  font-weight: 600;
}
.wf-version-current { flex: none; font-size: 10.5px; color: var(--blue); font-weight: 600; }
.wf-version-time { margin-left: auto; flex: none; font-size: 11px; color: var(--ink-3); }
.wf-version-meta { margin: 6px 0 8px; font-size: 11px; color: var(--ink-3); }
.wf-version-actions { display: flex; gap: 6px; }
.wf-version-empty { padding: 18px 0; text-align: center; font-size: 12px; color: var(--ink-3); }
.wf-page-body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr) 300px;
}
.wf-palette-panel {
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 14px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.wf-palette-panel h3 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 8px;
}
.wf-palette-hint { font-size: 11px; color: var(--ink-3); font-weight: 400; line-height: 1.6; }
.wf-palette { display: flex; flex-direction: column; gap: 8px; }
.wf-palette-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: 8px;
  background: var(--surface);
  font-size: 12.5px;
  color: var(--ink);
  cursor: grab;
  user-select: none;
}
.wf-palette-item:hover { border-color: var(--blue); background: var(--blue-tint); }
.wf-palette-item:active { cursor: grabbing; }
.wf-palette-item.wf-type-start { border-left-color: var(--green); }
.wf-palette-item.wf-type-approval { border-left-color: var(--blue); }
.wf-palette-item.wf-type-condition { border-left-color: var(--amber); }
.wf-palette-item.wf-type-parallel { border-left-color: #7b61ff; }
.wf-palette-item.wf-type-aggregate { border-left-color: #13a8a8; }
.wf-palette-item.wf-type-end { border-left-color: var(--ink-4); }
.wf-props { display: flex; flex-direction: column; gap: 10px; }
.wf-props .field { margin: 0; }
.wf-canvas-stage {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: #fbfcfe;
}
.wf-canvas-stage .wf-canvas-toolbar {
  flex: none;
  margin: 0;
  padding: 8px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.wf-zoom { display: flex; align-items: center; gap: 6px; flex: none; }
.wf-zoom .btn { min-width: 34px; justify-content: center; padding: 4px 8px; }
.wf-canvas-stage .wf-canvas-wrap {
  flex: 1;
  min-height: 0;
  max-height: none;
  border: none;
  border-radius: 0;
  overflow: auto;
}
.wf-canvas-scaler { position: relative; min-width: 100%; min-height: 100%; }
.wf-canvas-stage .wf-canvas {
  position: absolute;
  left: 0;
  top: 0;
  min-width: 0;
  min-height: 0;
  transform-origin: 0 0;
}
.wf-marquee {
  position: absolute;
  z-index: 5;
  border: 1px solid var(--blue);
  background: rgba(51, 112, 255, 0.1);
  border-radius: 2px;
  pointer-events: none;
}
.wf-page-body .wf-side {
  border-top: 0;
  border-right: 0;
  border-bottom: 0;
  border-radius: 0;
  max-height: none;
  background: var(--surface);
}
@media (max-width: 1180px) {
  .wf-page-body { grid-template-columns: 220px minmax(0, 1fr) 260px; }
}
.wf-approvers { display: flex; flex-direction: column; gap: 6px; }
/* 审批节点的通过 / 驳回后置动作 */
.wf-hook-block { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); }
.wf-hook-block .field-label { margin-top: 8px; }

/* 工作流连线：Groovy 判断脚本代码块（与捷径流 Groovy 编辑器一致） */
.wf-code-block { display: flex; flex-direction: column; gap: 6px; }
.wf-code-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.wf-code-block .CodeMirror {
  height: 240px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.7;
  background: #fbfcfd;
}
.wf-code-block .CodeMirror-scroll { min-height: 0; }
.wf-code-block .CodeMirror-gutters { background: #f5f7fa; border-right: 1px solid var(--line); }
.wf-code-block .CodeMirror-activeline-background { background: rgba(51, 112, 255, .06); }
.wf-code-block.is-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 95;
  gap: 10px;
  padding: 16px 20px 20px;
  background: #fff;
}
.wf-code-block.is-fullscreen .CodeMirror { flex: 1; height: auto; min-height: 0; font-size: 13px; }
.wf-code-block.is-fullscreen .CodeMirror-scroll { min-height: 0; }
.wf-code-block.is-fullscreen .wf-code-head .field-label { font-size: 14px; }

/* 通知接收人：复选列表比多选下拉更直观 */
.wf-form-field-list { display: flex; flex-direction: column; gap: 4px; }
.wf-form-field-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.wf-check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 4px 10px;
  margin-top: 4px;
}
.wf-check-item { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 13px; cursor: pointer; }
.wf-check-item input { flex: 0 0 auto; }
.wf-check-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wf-check-scroll { max-height: 148px; overflow-y: auto; padding-right: 4px; }

/* 指定成员 / 角色：标签 + 搜索添加，避免几百人平铺 */
.wf-picker { position: relative; display: flex; flex-direction: column; gap: 6px; }
.wf-picker-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.wf-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2, #f1f5f9);
  font-size: 12px;
}
.wf-chip-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 150px; }
.wf-chip-x {
  border: none;
  background: none;
  padding: 0 2px;
  cursor: pointer;
  color: inherit;
  font-size: 13px;
  line-height: 1;
}
.wf-picker-menu {
  margin-top: 4px;
  max-height: 180px;
  overflow-y: auto;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface, #fff);
}
.wf-picker-option {
  display: block;
  width: 100%;
  padding: 6px 8px;
  border: none;
  border-radius: 6px;
  background: none;
  text-align: left;
  font-size: 13px;
  cursor: pointer;
}
.wf-picker-option:hover { background: var(--surface-2, #f1f5f9); }
.wf-picker-empty { padding: 8px; font-size: 12px; color: var(--muted, #64748b); }

.wf-approver {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 6px;
  background: var(--surface-3);
}
.wf-approver .select { flex: 1; min-width: 0; height: 30px; font-size: 12px; }
.wf-approver .select:first-child { flex: 0 0 128px; }
.wf-approver-value { flex: 1; min-width: 0; display: flex; }
.wf-approver-value .select { width: 100%; }

/* ---------- 表达式参考页 ---------- */
body[data-page="expr-help"] .app-content { margin-left: 0; padding: 24px 32px 56px; max-width: 1080px; }
.eh-page .panel { margin-bottom: 16px; }
.eh-page code {
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 1px 6px;
  border-radius: 5px;
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  white-space: nowrap;
}
.eh-list { margin: 0; padding-left: 18px; font-size: 12.5px; line-height: 1.9; color: var(--ink-2); }
.eh-list li { margin: 4px 0; }
.eh-rows { margin-top: 10px; }
.eh-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: var(--surface-2);
}
.eh-row + .eh-row { margin-top: 6px; }
.eh-row code { background: transparent; border: none; padding: 0; font-size: 12.5px; }
.eh-row .eh-desc { margin-left: auto; font-size: 12px; color: var(--ink-3); text-align: right; }
.eh-order { font-size: 12.5px; line-height: 2; color: var(--ink-2); }
.eh-order code { background: transparent; border: none; padding: 0 2px; }

/* ---------- 消息队列 ---------- */
.combo-input { margin-top: 6px; }
.msg-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-bottom: 12px; font-size: 12px; color: var(--ink-2); }
.msg-meta em { font-style: normal; color: var(--ink-3); margin-right: 4px; }
.msg-payload {
  margin: 0;
  max-height: 220px;
  overflow: auto;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--line-2);
  background: var(--surface-2);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-all;
}
.msg-status {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  background: var(--surface-2);
  color: var(--ink-2);
}
.msg-status.ok { background: #e8f5ee; color: #1a7f4b; }
.msg-status.bad { background: #fdecec; color: #b42318; }
.msg-status.wait { background: #fff4e4; color: #a15c00; }
.msg-attempt { display: block; font-size: 11.5px; color: var(--ink-3); line-height: 1.7; }

/* ---------- 添加字段：选中捷径后的联动卡 ---------- */
.shortcut-panel {
  margin: 2px 0 4px;
  padding: 14px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: var(--surface-2);
}
.sp-head { display: flex; gap: 10px; align-items: flex-start; }
.sp-main { min-width: 0; }
.sp-main strong { display: block; font-size: 13px; font-weight: 600; }
.sp-main .sp-meta { display: block; font-size: 11.5px; color: var(--ink-3); margin-top: 1px; }
.sp-main p { font-size: 12px; line-height: 1.6; color: var(--ink-2); margin: 6px 0 8px; }
.sp-params { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.sp-param {
  padding: 4px 8px;
  font-size: 11.5px;
  color: var(--ink-2);
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: 6px;
}
.sp-param b { font-weight: 600; color: var(--ink); }
.sp-preview:empty { display: none; }
.sp-preview { margin-top: 10px; }
/* 字段清单里的来源标签可点击进入配置向导 */
.src-cell a.tag { text-decoration: none; }
.src-cell a.tag:hover { border-color: var(--blue); color: var(--blue); }

.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px dashed var(--line-2); }
.switch-row:last-child { border-bottom: none; }
.switch-copy strong { display: block; font-size: 13px; font-weight: 500; }
.switch-copy span { font-size: 11.5px; color: var(--ink-3); }
.switch {
  position: relative;
  width: 40px;
  height: 22px;
  border-radius: 11px;
  border: none;
  background: #d9dde3;
  flex: none;
  cursor: pointer;
  transition: background 0.2s var(--ease);
}
.switch::after {
  content: "";
  position: absolute;
  left: 2px;
  top: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.16);
  transition: transform 0.2s var(--ease);
}
.switch:disabled { opacity: 0.45; cursor: not-allowed; }
.switch-state { font-style: normal; font-size: 11.5px; color: var(--ink-3); margin-left: 4px; }
.switch[aria-checked="true"] { background: var(--blue); }
.switch[aria-checked="true"]::after { transform: translateX(18px); }
.radio-row { display: flex; flex-wrap: wrap; gap: 8px; }
.radio-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  font-size: 12.5px;
  color: var(--ink-2);
  transition: all 0.18s var(--ease);
}
.radio-pill::before {
  content: "";
  width: 12px;
  height: 12px;
  border: 1px solid #c9cdd4;
  border-radius: 50%;
}
.radio-pill.active { border-color: var(--blue); background: var(--blue-soft); color: var(--blue); font-weight: 500; }
.radio-pill.active::before { border-color: var(--blue); background: var(--blue); box-shadow: inset 0 0 0 3px #fff; }
.tags-input {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px 8px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
}
.tags-input:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(51, 112, 255, 0.12); }
.tags-input input { border: none; outline: none; flex: 1; min-width: 90px; height: 24px; padding: 0 4px; background: transparent; }
.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 24px;
  padding: 0 8px;
  border-radius: var(--r-xs);
  background: var(--surface-3, #f2f3f5);
  font-size: 11.5px;
  color: var(--ink-2);
}
.tag-chip button { border: none; background: none; color: var(--ink-3); padding: 0; display: grid; place-items: center; }
.range-row { display: flex; align-items: center; gap: 12px; }
.range-row input[type="range"] { flex: 1; accent-color: var(--blue); }
.range-val {
  min-width: 44px;
  text-align: right;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  padding: 2px 6px;
}
.seg {
  display: inline-flex;
  padding: 3px;
  border-radius: var(--r-sm);
  background: var(--surface-3, #f2f3f5);
  gap: 2px;
}
.seg-btn {
  height: 28px;
  padding: 0 12px;
  border: none;
  border-radius: var(--r-xs);
  background: transparent;
  font-size: 12px;
  color: var(--ink-3);
  transition: all 0.18s var(--ease);
}
.seg-btn:hover { color: var(--ink-2); }
.seg-btn.active { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: var(--sh-sm); }

/* ---------- 7. Tags / pills ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 20px;
  padding: 0 7px;
  border-radius: var(--r-xs);
  font-size: 11px;
  font-weight: 500;
  background: var(--surface-3, #f2f3f5);
  color: var(--ink-3);
  white-space: nowrap;
}
.tag-blue { background: var(--blue-soft); color: var(--blue); }
.tag-amber { background: var(--amber-soft); color: #b35b00; }
.tag-green { background: var(--green-soft); color: #00875a; }
.tag-red { background: var(--red-soft); color: #c0392b; }
.tag-mono { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.02em; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 9px;
  border-radius: 11px;
  font-size: 11.5px;
  font-weight: 500;
  background: var(--surface-3, #f2f3f5);
  color: var(--ink-3);
}
.pill::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.pill-success { background: var(--green-soft); color: #00875a; }
.pill-warn { background: var(--amber-soft); color: #b35b00; }
.pill-blue { background: var(--blue-soft); color: var(--blue); }
.provider {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--ink-3);
}
.provider-official { color: var(--blue); }
.provider-featured { color: #b35b00; }

/* ---------- 8. Cards / market ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-sm);
}
.market-hero {
  position: relative;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 28px;
  padding: 32px 34px;
  border-radius: var(--r-xl);
  border: 1px solid #dbe4f7;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.96) 0%, rgba(246, 249, 255, 0.96) 100%);
  box-shadow: 0 10px 30px rgba(51, 112, 255, 0.07), var(--sh-sm);
  overflow: hidden;
}
.market-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(51, 112, 255, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(51, 112, 255, 0.055) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(120% 90% at 100% 0%, #000 0%, transparent 68%);
  pointer-events: none;
}
.hero-copy { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 14px; }
.hero-copy h2 {
  font-size: 30px;
  line-height: 1.35;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.hero-copy h2 em { font-style: normal; color: var(--blue); }
.hero-copy p { max-width: 480px; font-size: 13px; color: var(--ink-2); line-height: 1.8; }
.hero-actions { display: flex; gap: 8px; margin-top: 4px; }
.hero-stats { display: flex; gap: 28px; margin-top: 10px; }
.hero-stats div { display: flex; flex-direction: column; gap: 2px; }
.hero-stats strong { font-family: var(--font-serif); font-size: 24px; font-weight: 600; line-height: 1.2; }
.hero-stats span { font-size: 11.5px; color: var(--ink-3); }
.hero-visual {
  position: relative;
  z-index: 1;
  align-self: center;
  padding: 14px;
  border-radius: var(--r-lg);
  border: 1px solid rgba(51, 112, 255, 0.14);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--sh-md);
  transform: rotate(-1.1deg);
}
.mini-table { border-radius: var(--r-md); overflow: hidden; background: #fff; border: 1px solid var(--line); }
.mini-head {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  background: #f7f8fa;
  border-bottom: 1px solid var(--line);
}
.mini-head span {
  padding: 8px 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-2);
  border-right: 1px solid var(--line-2);
}
.mini-head span:last-child { border-right: none; }
.mini-row { display: grid; grid-template-columns: 1fr 1fr 1fr; border-bottom: 1px solid var(--line-2); }
.mini-row:last-child { border-bottom: none; }
.mini-row span {
  padding: 9px 10px;
  font-size: 11px;
  color: var(--ink-3);
  border-right: 1px solid var(--line-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mini-row span:last-child { border-right: none; }
.mini-row .cell-ai { color: var(--blue); font-weight: 500; }
.float-chip {
  position: absolute;
  right: 16px;
  bottom: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 12px;
  border-radius: 14px;
  background: var(--blue);
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  box-shadow: 0 8px 18px rgba(51, 112, 255, 0.28);
}
.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0 14px;
}
/* 系统用户等页面：查询项保持紧凑，避免搜索框拉满整行 */
.toolbar-compact .search-wrap { flex: 0 1 320px; }
.toolbar-compact .select { max-width: 220px; }
.toolbar-right { display: flex; align-items: center; gap: 10px; flex: none; flex-wrap: wrap; justify-content: flex-end; margin-left: auto; }
/* 工具栏里的下拉框按内容宽度显示，避免 width:100% 参与宽度计算时把同行按钮挤到下一行 */
.toolbar-right .select { width: auto; flex: 0 0 auto; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px;
  border-radius: 15px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 12.5px;
  color: var(--ink-2);
  transition: all 0.18s var(--ease);
}
.chip:hover { border-color: #c9cdd4; }
.chip.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip .count {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-3);
}
.chip.active .count { color: rgba(255, 255, 255, 0.66); }
.result-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 2px 12px;
  font-size: 12px;
  color: var(--ink-3);
  border-bottom: 1px solid var(--line);
}
.result-bar b { color: var(--ink); font-family: var(--font-mono); }
.shortcut-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}
.shortcut-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-sm);
  transition: transform 0.22s var(--ease), box-shadow 0.22s var(--ease), border-color 0.22s var(--ease);
  cursor: pointer;
  overflow: hidden;
}
.shortcut-card::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 3px;
  height: 0;
  background: var(--blue);
  transition: height 0.24s var(--ease);
}
.shortcut-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--sh-md);
  border-color: #d5def0;
}
.shortcut-card:hover::after { height: 100%; }
.shortcut-card.is-installed { border-color: #c8e6d8; background: linear-gradient(180deg, #fbfefc 0%, #fff 60%); }
.sc-top { display: flex; align-items: flex-start; gap: 12px; }
.sc-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: var(--r-md);
  flex: none;
}
.tile-blue { background: var(--blue-soft); color: var(--blue); }
.tile-amber { background: var(--amber-soft); color: #c96a00; }
.tile-green { background: var(--green-soft); color: #00875a; }
.tile-gray { background: #f2f3f5; color: #5b6472; }
.sc-title-wrap { flex: 1; min-width: 0; }
.sc-name-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sc-name { font-size: 14px; font-weight: 600; letter-spacing: 0.005em; }
.sc-provider { margin-top: 3px; }
.sc-desc { font-size: 12px; line-height: 1.7; color: var(--ink-3); min-height: 40px; }
.sc-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.sc-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px dashed var(--line-2);
  margin-top: auto;
}
.sc-installs {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--ink-3);
  font-family: var(--font-mono);
}
.sc-add {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 28px;
  padding: 0 10px;
  border-radius: var(--r-xs);
  border: 1px solid var(--line);
  background: #fff;
  font-size: 12px;
  color: var(--ink-2);
  transition: all 0.18s var(--ease);
}
.sc-add:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-tint); }
.sc-add.installed { background: var(--green-soft); border-color: #bfe6d5; color: #00875a; }
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 64px 24px;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: var(--r-lg);
  background: var(--surface-2);
  color: var(--ink-3);
}
.empty-state svg { color: var(--ink-4); }
.empty-state strong { font-size: 14px; color: var(--ink-2); }
.empty-state p { font-size: 12px; }

/* ---------- 9. Guide strip ---------- */
.guide-strip {
  margin-top: 40px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.guide-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 14px; }
.guide-item {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.66);
}
.guide-item strong { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
.guide-item p { margin-top: 6px; font-size: 12px; color: var(--ink-3); line-height: 1.7; }
.guide-item code {
  font-family: var(--font-mono);
  font-size: 11px;
  background: var(--surface-3, #f2f3f5);
  border-radius: 3px;
  padding: 1px 4px;
}
/* 帮助中心：卡片与面板内边距对齐，避免贴住边框 */
.dataset-guide .guide-grid { padding: 20px; margin-top: 0; }
.doc-section { margin-top: 16px; }
.doc-body {
  padding: 18px 20px;
  font-size: 12.5px;
  color: var(--ink-3);
  line-height: 1.8;
}
.doc-body p + p,
.doc-body p + pre,
.doc-body pre + p,
.doc-body ul + p { margin-top: 10px; }
.doc-body ul { margin: 6px 0 0 18px; }
.doc-body li { margin-bottom: 5px; }
/* 操作指引：分步列表与子标题 */
.doc-subtitle {
  margin: 16px 0 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}
.doc-subtitle:first-child { margin-top: 0; }
.doc-steps { counter-reset: doc-step; margin: 6px 0 0; }
.doc-steps > li {
  position: relative;
  margin-bottom: 8px;
  padding-left: 28px;
  line-height: 1.75;
}
.doc-steps > li::before {
  counter-increment: doc-step;
  content: counter(doc-step);
  position: absolute;
  left: 0;
  top: 2px;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 11px;
  font-weight: 600;
}
.doc-steps + .field-hint { margin-top: 8px; display: block; }
.doc-body strong { color: var(--ink); font-weight: 600; }
.doc-body code,
.doc-table code {
  font-family: var(--font-mono);
  font-size: 11px;
  background: var(--surface-3, #f2f3f5);
  border-radius: 3px;
  padding: 1px 4px;
}
.doc-body .code-body {
  margin-top: 10px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
}
.doc-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.doc-table th,
.doc-table td {
  padding: 11px 20px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line-2);
}
.doc-table th {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ink-4);
  background: var(--surface-2);
}
.doc-table tbody tr:last-child td { border-bottom: none; }
.doc-table td:first-child { white-space: nowrap; color: var(--ink); font-weight: 500; }
.doc-table td:nth-child(2) { color: var(--ink-2); }
.doc-actions { display: flex; flex-wrap: wrap; gap: 10px; }
@media (max-width: 980px) {
  .dataset-guide .guide-grid { padding: 16px; }
  .doc-body { padding: 16px; }
  .doc-table th,
  .doc-table td { padding: 10px 14px; }
}

/* ---------- 10. Panels / wizard ---------- */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-sm);
  overflow: hidden;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line-2);
}
.panel-head h3 { font-size: 14px; font-weight: 600; }
.panel-body { padding: 20px; }
.panel-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  border-top: 1px solid var(--line-2);
  background: var(--surface-2);
}
.wizard-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(300px, 0.7fr);
  gap: 20px;
  align-items: start;
}
.side-panel { position: sticky; top: 24px; display: flex; flex-direction: column; gap: 14px; }
.side-block {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--sh-sm);
}
.side-block h4 {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 10px;
}
.side-kv { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 0; font-size: 12.5px; border-bottom: 1px dashed var(--line-2); }
.side-kv:last-child { border-bottom: none; }
.side-kv span { color: var(--ink-3); }
.side-kv strong { font-weight: 500; color: var(--ink); text-align: right; }
.side-kv strong.mono { font-family: var(--font-mono); font-size: 11.5px; }
.side-list { display: flex; flex-direction: column; gap: 9px; }
.side-list li { display: flex; gap: 8px; font-size: 12px; color: var(--ink-2); line-height: 1.6; }
.side-list svg { flex: none; color: var(--green); margin-top: 3px; }
.side-tip {
  padding: 14px 16px;
  border-radius: var(--r-md);
  background: var(--blue-tint);
  border: 1px solid #dbe4f7;
  font-size: 12px;
  color: var(--ink-2);
  line-height: 1.75;
}
.side-tip strong { color: var(--blue); }
.quick-summary {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line-2);
  background: linear-gradient(90deg, var(--blue-tint), #fff 70%);
}
.quick-summary .sc-icon { width: 42px; height: 42px; }
.quick-summary-main { flex: 1; min-width: 0; }
.quick-summary-main h2 { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.quick-summary-main p { font-size: 12px; color: var(--ink-3); margin-top: 3px; }
.steps {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 18px 20px 6px;
}
.step {
  display: flex;
  align-items: center;
  gap: 8px;
  border: none;
  background: none;
  padding: 0;
  color: var(--ink-3);
  font-size: 12px;
}
.step-dot {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
  flex: none;
}
.step:disabled { opacity: 0.5; cursor: not-allowed; }
.step.done .step-dot { border-color: #bfe6d5; background: var(--green-soft); color: #00875a; }
.step.active { color: var(--ink); font-weight: 600; }
.step.active .step-dot { border-color: var(--blue); background: var(--blue); color: #fff; }
.step-line { flex: 1; height: 1px; background: var(--line); min-width: 24px; }
.wizard-step { display: none; padding: 8px 20px 20px; }
.wizard-step.active { display: block; }
.step-title { font-size: 15px; font-weight: 600; margin: 8px 0 4px; }
.step-desc { font-size: 12px; color: var(--ink-3); margin-bottom: 18px; line-height: 1.7; }
.type-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface-2);
}
.type-card strong { font-size: 12.5px; }
.type-card span { font-size: 11px; color: var(--ink-3); }
.preview-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.preview-table th {
  text-align: left;
  padding: 8px 10px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  font-weight: 600;
  color: var(--ink-2);
  font-size: 11.5px;
  white-space: nowrap;
}
.preview-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--line-2);
  color: var(--ink-2);
  vertical-align: top;
}
.preview-table tr:last-child td { border-bottom: none; }
.preview-table .ai-cell { color: var(--blue); }
.conf-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-3);
}
.conf-bar i { display: block; height: 4px; border-radius: 2px; background: #dfe6f5; width: 48px; overflow: hidden; }
.conf-bar i b { display: block; height: 100%; background: var(--blue); border-radius: 2px; }
.success-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 30px 20px;
  text-align: center;
}
.success-box .ok-ring {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green);
}
.success-box h3 { font-size: 17px; font-weight: 600; }
.success-box p { font-size: 12.5px; color: var(--ink-3); max-width: 420px; line-height: 1.8; }
.success-actions { display: flex; gap: 8px; margin-top: 6px; }

/* ---------- 11. Blueprint ---------- */
.stat-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 4px 0 20px;
}
.stat-cell {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.78);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.stat-cell strong {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.2;
}
.stat-cell span { font-size: 11.5px; color: var(--ink-3); }
.stat-cell em { font-style: normal; font-family: var(--font-mono); font-size: 10px; color: var(--ink-4); letter-spacing: 0.06em; }
.bp-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(300px, 0.72fr);
  gap: 20px;
  align-items: start;
}
.table-picker { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; padding: 16px 20px 0; }
.table-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 12px 11px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  text-align: left;
  transition: all 0.18s var(--ease);
}
.table-card:hover { border-color: #c9cdd4; background: var(--surface-2); }
.table-card.active { border-color: var(--blue); background: var(--blue-tint); box-shadow: 0 0 0 3px rgba(51, 112, 255, 0.08); }
.table-card .tc-head { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--ink); }
.table-card.active .tc-head { color: var(--blue); }
.table-card .tc-sub { font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-3); }
.field-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.field-table th {
  text-align: left;
  padding: 9px 12px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-3);
  white-space: nowrap;
}
.field-table td { padding: 9px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.field-table tr:last-child td { border-bottom: none; }
.field-table tbody tr:hover { background: #fbfcfe; }
.field-name { display: flex; align-items: center; gap: 7px; font-weight: 500; }
.field-name svg { color: var(--ink-3); flex: none; }
.src-cell { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.req-dot { color: var(--red); font-weight: 600; font-size: 11px; }
.gen-panel { position: sticky; top: 24px; }
.gen-panel .panel-body { display: flex; flex-direction: column; gap: 14px; }
.module-pick { display: flex; flex-direction: column; gap: 6px; }
.module-pick label {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  font-size: 12.5px;
  cursor: pointer;
  transition: all 0.18s var(--ease);
}
.module-pick label:hover { border-color: #c9cdd4; background: var(--surface-2); }
.module-pick input { accent-color: var(--blue); margin: 0; }
.module-pick .mp-main { flex: 1; min-width: 0; }
.module-pick .mp-sub { display: block; font-size: 10.5px; color: var(--ink-3); font-family: var(--font-mono); }
.module-pick label.checked { border-color: var(--blue); background: var(--blue-tint); }
.divider { height: 1px; background: var(--line-2); margin: 2px 0; }

/* ---------- 引用标签：表达式下方可点击的引用芯片 ---------- */
.ref-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ref-link {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--blue-tint);
  color: var(--blue);
  font-size: 12px;
  cursor: pointer;
}
.ref-link:hover { border-color: var(--blue); }

/* ---------- 12. Modal ---------- */
.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(31, 35, 41, 0.36);
  backdrop-filter: blur(3px);
}
.modal-mask.open { display: flex; animation: fade-in 0.2s var(--ease); }
.modal {
  width: 100%;
  max-width: 520px;
  max-height: 88vh;
  overflow: auto;
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--sh-lg);
  animation: pop-in 0.24s var(--ease);
}
.modal.wide { max-width: 640px; }
.modal.xwide { max-width: 820px; }
.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px 0;
}
.modal-head h3 { font-size: 16px; font-weight: 600; }
.modal-head p { font-size: 12px; color: var(--ink-3); margin-top: 4px; line-height: 1.6; }
.modal-body { padding: 18px 22px; }
.modal-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 22px 20px;
}
.progress { height: 6px; border-radius: 3px; background: var(--surface-3, #f2f3f5); overflow: hidden; }
.progress-bar { height: 100%; width: 0; border-radius: 3px; background: linear-gradient(90deg, #4d84ff, var(--blue)); transition: width 0.4s var(--ease); }
.gen-steps { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.gen-step { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--ink-3); }
.gen-step .gs-dot {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-4);
  flex: none;
}
.gen-step.active { color: var(--ink); font-weight: 500; }
.gen-step.active .gs-dot { border-color: var(--blue); color: var(--blue); animation: spin 1.1s linear infinite; }
.gen-step.done { color: var(--ink-2); }
.gen-step.done .gs-dot { border-color: #bfe6d5; background: var(--green-soft); color: #00875a; }
.gen-step .gs-time { margin-left: auto; font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-4); }

/* ---------- 13. Project ---------- */
.tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 6px 0 20px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}
.tab {
  position: relative;
  height: 38px;
  padding: 0 14px;
  border: none;
  background: none;
  font-size: 13px;
  color: var(--ink-3);
  white-space: nowrap;
  transition: color 0.18s var(--ease);
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--ink); font-weight: 600; }
.tab.active::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: -1px;
  height: 2px;
  border-radius: 1px;
  background: var(--blue);
}
.tab .tab-count { font-family: var(--font-mono); font-size: 10px; color: var(--ink-4); margin-left: 4px; }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fade-up 0.32s var(--ease); }
.overview-banner {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 24px;
  padding: 24px 26px;
  border-radius: var(--r-lg);
  border: 1px solid #dbe4f7;
  background: linear-gradient(115deg, #ffffff 0%, #f7faff 60%, #f2f7ff 100%);
  box-shadow: var(--sh-sm);
  margin-bottom: 16px;
}
.overview-banner h2 { font-size: 20px; font-weight: 600; letter-spacing: -0.01em; }
.overview-banner .ob-sub { font-size: 12px; color: var(--ink-3); margin-top: 6px; line-height: 1.75; }
.ob-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.ob-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-content: start; }
.ob-stat {
  padding: 12px 14px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.8);
}
.ob-stat strong { display: block; font-family: var(--font-serif); font-size: 20px; font-weight: 600; line-height: 1.25; }
.ob-stat span { font-size: 10.5px; color: var(--ink-3); }
.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 26px 0 12px;
}
.section-title-row h3 { font-size: 14px; font-weight: 600; }
.section-title-row .hint { font-size: 11.5px; color: var(--ink-3); }
.log-list { display: flex; flex-direction: column; gap: 0; }
.log-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--line-2);
  font-size: 12px;
  color: var(--ink-2);
}
.log-item:last-child { border-bottom: none; }
.log-item svg { color: var(--green); flex: none; }
.log-item .log-time { margin-left: auto; font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-4); }
.module-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.module-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--sh-sm);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.module-card .mc-head { display: flex; align-items: flex-start; gap: 9px; }
.module-card .mc-head .sc-icon { width: 30px; height: 30px; border-radius: var(--r-sm); }
.module-card h4 { font-size: 13px; font-weight: 600; }
.module-card .mc-sub { font-size: 11px; color: var(--ink-3); font-family: var(--font-mono); margin-top: 2px; }
.module-card p { font-size: 11.5px; color: var(--ink-3); line-height: 1.65; min-height: 38px; }
.progress-line { display: flex; align-items: center; gap: 8px; font-size: 10.5px; color: var(--ink-3); font-family: var(--font-mono); }
.progress-line .track { flex: 1; height: 4px; border-radius: 2px; background: #eef0f3; overflow: hidden; }
.progress-line .track b { display: block; height: 100%; background: var(--blue); border-radius: 2px; }
.mc-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 8px; border-top: 1px dashed var(--line-2); }
.mini-avatars { display: flex; }
.mini-avatars span {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #e8edf7;
  color: #39507a;
  font-size: 9px;
  border: 1px solid #fff;
  margin-left: -5px;
}
.mini-avatars span:first-child { margin-left: 0; }
.model-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.model-card .panel-body { padding: 0; }
.model-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.model-table td { padding: 8px 18px; border-bottom: 1px solid var(--line-2); }
.model-table tr:last-child td { border-bottom: none; }
.model-table td:first-child { font-weight: 500; color: var(--ink); width: 38%; }
.model-table td:last-child { color: var(--ink-3); }
.code-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}
.file-tree { padding: 10px 8px; max-height: 620px; overflow: auto; }
.tree-group { margin-bottom: 6px; }
.tree-item {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 5px 8px;
  border: none;
  background: none;
  border-radius: var(--r-xs);
  font-size: 11.5px;
  color: var(--ink-3);
  text-align: left;
  font-family: var(--font-mono);
}
.tree-item svg { flex: none; color: var(--ink-4); }
.tree-item.file { color: var(--ink-2); }
.tree-item.file:hover { background: var(--surface-2); }
.tree-item.file.active { background: var(--blue-soft); color: var(--blue); }
.tree-item.file.active svg { color: var(--blue); }
.tree-item.dir { cursor: default; color: var(--ink-2); font-weight: 500; }
.tree-indent { padding-left: 18px; }
.code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}
.code-head .path { font-family: var(--font-mono); font-size: 11px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.code-head .lang { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.1em; color: var(--ink-4); text-transform: uppercase; margin-right: 8px; }
.code-body {
  margin: 0;
  padding: 16px 18px;
  max-height: 560px;
  overflow: auto;
  background: #fbfcfe;
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.85;
  color: #33415c;
  tab-size: 2;
}
.code-body .ln { color: #b9c0cc; user-select: none; display: inline-block; width: 22px; text-align: right; margin-right: 12px; }
.code-body .kw { color: #1f5fd1; }
.code-body .str { color: #0f7b5f; }
.code-body .cm { color: #93a0b4; font-style: italic; }
.code-body .fn { color: #7a3fa8; }
.api-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.api-table th {
  text-align: left;
  padding: 10px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  font-size: 11.5px;
  color: var(--ink-3);
  font-weight: 600;
  white-space: nowrap;
}
.api-table td { padding: 10px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.api-table tr:last-child td { border-bottom: none; }
.api-table tbody tr:hover { background: #fbfcfe; }
.api-path { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink); }
.method {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 46px;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--r-xs);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.method-get { background: #e8f8f1; color: #00875a; }
.method-post { background: var(--blue-soft); color: var(--blue); }
.method-patch { background: var(--amber-soft); color: #b35b00; }
.method-delete { background: var(--red-soft); color: #c0392b; }
.timeline { position: relative; padding-left: 22px; }
.timeline::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: var(--line);
}
.tl-item { position: relative; padding: 0 0 18px 10px; }
.tl-dot {
  position: absolute;
  left: -22px;
  top: 4px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 2px solid var(--line);
  background: var(--surface);
}
.tl-item.done .tl-dot { border-color: var(--green); background: var(--green); }
.tl-item.doing .tl-dot { border-color: var(--blue); background: var(--blue-soft); }
.tl-item h4 { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; flex-wrap: wrap; }
.tl-item .tl-meta { display: flex; gap: 14px; margin-top: 4px; font-size: 11px; color: var(--ink-3); font-family: var(--font-mono); }

/* ---------- 14. Toast / skeleton / motion ---------- */
.toast-wrap {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%);
  z-index: 120;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--r-md);
  background: rgba(31, 35, 41, 0.94);
  color: #fff;
  font-size: 12.5px;
  box-shadow: var(--sh-md);
  animation: toast-in 0.28s var(--ease);
}
.toast svg { color: #7ee2b8; }
.toast.error svg { color: #ffb0ad; }
.skeleton { position: relative; overflow: hidden; background: #f0f2f5; border-radius: var(--r-xs); }
.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.65), transparent);
  animation: shimmer 1.4s infinite;
}
.sk-line { height: 12px; margin-bottom: 8px; }
.reveal { animation: rise 0.55s var(--ease) both; animation-delay: calc(var(--d, 0) * 70ms); }
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fade-up {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop-in {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes shimmer { to { transform: translateX(100%); } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 15. Utilities ---------- */
.muted { color: var(--ink-3); }
.mono { font-family: var(--font-mono); }
.row { display: flex; align-items: center; gap: 8px; }
.spacer { flex: 1; }
.hidden { display: none !important; }
.note-line { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--ink-3); }
.note-line svg { color: var(--ink-4); }

/* ---------- 16. Responsive ---------- */
@media (max-width: 1240px) {
  .shortcut-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .module-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 1080px) {
  .wizard-layout, .bp-layout { grid-template-columns: minmax(0, 1fr); }
  .side-panel, .gen-panel { position: static; }
  .table-picker { grid-template-columns: repeat(2, 1fr); }
  .market-hero { grid-template-columns: 1fr; }
  .hero-visual { max-width: 520px; }
  .overview-banner { grid-template-columns: 1fr; }
  .code-layout { grid-template-columns: 1fr; }
  .file-tree { max-height: 260px; }
}
@media (max-width: 980px) {
  .app-nav {
    position: sticky;
    top: 0;
    bottom: auto;
    width: 100%;
    height: auto;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-right: none;
    border-bottom: 1px solid var(--line);
    overflow-x: auto;
    overflow-y: visible;
  }
  .brand { padding: 0 10px 0 0; flex: none; }
  .brand-text em { display: none; }
  .nav-caption, .nav-note, .nav-user { display: none; }
  .nav-list { flex-direction: row; gap: 2px; flex: none; }
  .nav-item { height: 34px; white-space: nowrap; }
  .app-content { margin-left: 0; padding: 18px 18px 44px; }
  .page-head { flex-direction: column; align-items: flex-start; gap: 14px; }
  .head-actions { width: 100%; }
  .shortcut-grid, .guide-grid, .model-grid, .module-grid, .form-grid { grid-template-columns: 1fr; }
  .stat-strip { grid-template-columns: 1fr 1fr; }
  .toolbar { flex-wrap: wrap; }
  .search-wrap { min-width: 100%; }
  /* 窄屏：查询项整体换行并左对齐，避免下拉框独占一行、按钮掉到下一行 */
  .toolbar-right { flex: 1 1 100%; justify-content: flex-start; }
  .code-body { font-size: 11px; }
}
/* ---------- 13. Projects（项目管理） ---------- */
.conn-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  font-size: 12.5px;
  color: var(--ink-2);
}
.conn-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-4); flex: none; }
.conn-dot.ok { background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.conn-dot.bad { background: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
.conn-bar code { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-3); }
.conn-bar .spacer { flex: 1; }

.proj-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}
.proj-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--sh-sm);
  transition: box-shadow 0.18s var(--ease), transform 0.18s var(--ease), border-color 0.18s var(--ease);
}
.proj-card:hover { box-shadow: var(--sh-md); transform: translateY(-1px); border-color: #d8dfff; }
.proj-card.archived { opacity: 0.72; }
.proj-top { display: flex; align-items: flex-start; gap: 12px; }
.proj-tags { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: none; }
.proj-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 10px;
  background: var(--blue-soft);
  color: var(--blue);
}
.proj-main { flex: 1; min-width: 0; }
.proj-name { font-size: 15px; font-weight: 600; letter-spacing: 0.005em; }
.proj-meta {
  margin-top: 3px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-4);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.proj-desc {
  font-size: 12px;
  line-height: 1.7;
  color: var(--ink-3);
  min-height: 40px;
}
.proj-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 12px 0;
  border-top: 1px dashed var(--line-2);
  border-bottom: 1px dashed var(--line-2);
}
.proj-stat strong { display: block; font-size: 16px; font-weight: 600; }
.proj-stat span { font-size: 11px; color: var(--ink-3); }
.proj-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.proj-site {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--blue-soft);
  color: var(--blue);
  font-family: var(--font-mono);
  font-size: 11px;
  min-width: 0;
}
.proj-site a {
  color: inherit;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.proj-site a:hover { text-decoration: underline; }
/* 已应用项目：内容存储用量与配额 */
.proj-storage {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: var(--surface-2);
}
.proj-storage-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11.5px;
  color: var(--ink-3);
}
.proj-storage-line strong { color: var(--ink-2); }
.proj-storage-bar {
  display: block;
  height: 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.08);
  overflow: hidden;
}
.proj-storage-bar i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--blue);
  transition: width 0.2s ease;
}
.proj-storage-bar.is-warn i { background: var(--red); }
.tpl-dataset-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tpl-dataset-list { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.tpl-dataset-row { display: flex; align-items: center; gap: 10px; }
.tpl-dataset-row strong {
  flex: none;
  width: 88px;
  font-size: 12px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tpl-dataset-row .select { flex: 1; min-width: 0; }
.tpl-dataset-empty { font-size: 12px; color: var(--ink-3); margin: 0; }
/* 创建成功：模板生成的本地 Excel 文件 */
.tpl-done-datasets {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line-2);
}
.tpl-done-datasets h4 { margin-bottom: 6px; font-size: 12.5px; }
.tpl-done-dataset {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface-2);
}
.tpl-done-dataset-head { display: flex; flex-direction: column; gap: 2px; flex: none; }
.tpl-done-dataset-head strong { font-size: 12px; }
.tpl-done-dataset-head span { font-size: 10.5px; color: var(--ink-4); }
.tpl-done-dataset code {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  font-size: 11px;
  color: var(--ink-2);
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* 站点图片管理：按页面分组替换模板配图 */
.si-content { max-width: 1280px; }
.si-note { margin-bottom: 18px; }
.si-note code { padding: 1px 6px; border-radius: 6px; background: var(--surface-2); font-size: 11.5px; }
.si-loading { padding: 48px 0; text-align: center; font-size: 13px; color: var(--ink-3); }
.si-error {
  padding: 14px 16px;
  border: 1px solid #ffd6d6;
  border-radius: var(--r-md);
  background: #fff5f5;
  font-size: 13px;
  color: #d4380d;
}
.si-empty { padding: 40px 16px; text-align: center; font-size: 13px; color: var(--ink-3); }
.si-group { margin-bottom: 24px; }
.si-group-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.si-group-head h3 { font-size: 15px; }
.si-group-head span { font-size: 11.5px; color: var(--ink-4); }
.si-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.si-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  overflow: hidden;
}
.si-thumb {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, #eef2ff, #f8fafc);
  background-size: cover;
  background-position: center;
  color: #b8c2d6;
}
.si-thumb.has-image::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.05), rgba(15, 23, 42, 0.22));
}
.si-status {
  position: absolute;
  left: 8px;
  top: 8px;
  z-index: 1;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-style: normal;
  line-height: 16px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink-2);
}
.si-status-default { color: var(--ink-3); }
.si-status-custom { color: #0f7b4f; background: rgba(230, 255, 242, 0.95); }
.si-status-empty { color: var(--ink-4); background: rgba(255, 255, 255, 0.8); }
.si-meta { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px 0; }
.si-meta strong {
  font-size: 12.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.si-meta span { font-size: 10.5px; color: var(--ink-4); }
.si-actions { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 12px 12px; }
.si-file-input {
  position: fixed;
  right: 16px;
  bottom: 16px;
  width: 24px;
  height: 24px;
  opacity: 0.01;
}

/* 模板版本升级弹窗 */
.tpl-upgrade-version {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--blue-soft);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--blue);
}
.tpl-upgrade-version span { font-weight: 400; color: var(--ink-3); }
.tpl-upgrade-list { margin: 0 0 10px; padding-left: 18px; font-size: 12.5px; line-height: 2; color: var(--ink-2); }
/* 模板版本列表：版本号 + 备注 + 回滚按钮 */
.tpl-version-list { display: flex; flex-direction: column; gap: 8px; }
.tpl-version-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface-2);
}
.tpl-version-pick { cursor: pointer; justify-content: flex-start; }
.tpl-version-pick input { margin: 0; flex: none; }
.tpl-version-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tpl-version-main strong { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.tpl-version-meta { font-size: 12px; color: var(--ink-3); }
/* 工作区模板版本弹窗里的回滚区 */
.tpl-rollback-block { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--line); }
.tpl-rollback-block h4 { margin: 0 0 6px; font-size: 13px; font-weight: 600; color: var(--ink); }
/* 友情链接板块：模板预览 / 公开站点 / 后台管理通用 */
.pv-links { display: flex; flex-wrap: wrap; gap: 10px 14px; }
.pv-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 12.5px;
  color: var(--ink-2);
  transition: border-color 0.18s var(--ease), color 0.18s var(--ease);
}
.pv-link:hover { border-color: var(--blue); color: var(--blue); }
.pv-link span { font-size: 11.5px; color: var(--ink-3); }
.tpl-link-list { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.tpl-link-item { font-size: 12.5px; color: var(--blue); }
.tpl-link-item:hover { text-decoration: underline; }
.ad-links { display: flex; flex-wrap: wrap; gap: 10px 18px; }
.ad-link { font-size: 12.5px; color: var(--blue); }
.ad-link:hover { text-decoration: underline; }
/* 数据集绑定弹窗：字段 → 数据集列映射 */
.dataset-map-list { display: flex; flex-direction: column; gap: 8px; max-height: 300px; overflow: auto; }
.dataset-map-row { display: grid; grid-template-columns: 140px 14px minmax(0, 1fr); align-items: center; gap: 8px; }
.dataset-map-field {
  font-size: 13px;
  color: var(--ink-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dataset-map-arrow { color: var(--ink-4); font-size: 12px; text-align: center; }
.dataset-map-row .select { width: 100%; min-width: 0; }
/* 字段较多时按钮始终贴在弹窗底部，避免被内容挤出可视区域 */
#datasetBindMask .modal-foot {
  position: sticky;
  bottom: 0;
  background: var(--surface);
  border-top: 1px solid var(--line);
  z-index: 2;
}
.proj-path {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-4);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.proj-actions { display: flex; align-items: center; gap: 6px; flex: none; }

/* ---------- 14. Workspace（项目工作区） ---------- */
.ws-layout {
  display: grid;
  grid-template-columns: 232px 1fr;
  gap: 16px;
  align-items: start;
}
.ws-layout.side-collapsed { grid-template-columns: 52px 1fr; }
.ws-layout.side-collapsed .ws-side { padding: 10px 8px; }
.ws-layout.side-collapsed .ws-side-head { flex-direction: column; gap: 6px; margin-bottom: 0; }
.ws-layout.side-collapsed .ws-side-head h3,
.ws-layout.side-collapsed #newGroupBtn,
.ws-layout.side-collapsed #newModuleBtn { display: none; }
.ws-layout.side-collapsed .ws-side-head .row { flex-direction: column; }
.ws-layout.side-collapsed .module-list,
.ws-layout.side-collapsed .ws-hint { display: none; }
.ws-side {
  position: sticky;
  top: 24px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
}
.ws-side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.ws-side-head h3 { font-size: 13px; font-weight: 600; }
.module-list { display: flex; flex-direction: column; gap: 2px; }
.module-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.module-item:hover { background: var(--surface-3); }
.module-item.active { background: var(--blue-soft); color: var(--blue); }
.module-item .mi-name {
  flex: 1;
  min-width: 0;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.4;
  white-space: normal;
  word-break: break-word;
}
.module-item .mi-status { font-size: 10.5px; color: var(--ink-4); flex: none; }
.module-item .mi-edit { opacity: 0; transition: opacity 0.15s var(--ease); }
.module-item:hover .mi-edit { opacity: 1; }
.ws-hint { font-size: 11.5px; color: var(--ink-4); line-height: 1.6; }

/* ---------- 项目概览（原「项目工作台」的真实内容） ---------- */
.ws-overview { display: none; }
.ws-main.is-overview .ws-overview { display: block; }
.ws-main.is-overview #moduleHead,
.ws-main.is-overview #viewBar,
.ws-main.is-overview #moduleTabs,
.ws-main.is-overview .tab-panel { display: none !important; }
.ov-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.ov-head-main h2 { font-size: 18px; font-weight: 600; margin-bottom: 4px; }
.ov-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ov-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.ov-stat {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
}
.ov-stat strong { display: block; font-size: 22px; font-weight: 600; line-height: 1.2; }
.ov-stat span { font-size: 11.5px; color: var(--ink-4); }
.ov-caps,
.ov-refs { margin-top: 14px; }
.ov-caps .ov-table td:first-child { white-space: nowrap; }
.ov-caps .ov-table td:last-child { white-space: nowrap; color: var(--ink-3); }
.ov-panel > .ws-hint { padding: 20px; }
.ov-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.ov-table th,
.ov-table td { padding: 9px 20px; text-align: left; border-bottom: 1px solid var(--line-2); }
.ov-table th { font-size: 11.5px; font-weight: 500; color: var(--ink-4); }
.ov-table tbody tr:last-child td { border-bottom: none; }

/* 概览 · 接口接入 */
.ov-api { margin-top: 14px; }
.ov-api-body { padding: 16px 20px; }
.ov-api-kv {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.ov-api-kv > span { flex: none; min-width: 64px; font-size: 11.5px; color: var(--ink-4); }
.ov-api-kv code {
  font-family: var(--font-mono);
  font-size: 11.5px;
  background: var(--surface-3, #f2f3f5);
  padding: 3px 8px;
  border-radius: 4px;
  word-break: break-all;
}
.ov-api-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 14px 0 10px; }
.ov-api-bar label { font-size: 12px; color: var(--ink-3); }
.ov-api-bar .select { width: auto; min-width: 180px; }
.ov-api .doc-table { border: 1px solid var(--line-2); border-radius: var(--r-md); }
.ov-api .doc-table th,
.ov-api .doc-table td { padding: 9px 14px; }
.ov-api .doc-table th:first-child { width: 72px; }
.ov-api .doc-table td:nth-child(2) { font-family: var(--font-mono); font-size: 11.5px; word-break: break-all; }
.ov-api .doc-table td:nth-child(2) code { background: none; padding: 0; }
.api-m {
  display: inline-block;
  min-width: 46px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--surface-3, #f2f3f5);
  color: var(--ink-3);
}
.api-m.get { background: #e8f5ee; color: #1a7f4b; }
.api-m.post { background: #e8efff; color: #2a5bd7; }
.api-m.patch { background: #fff4e4; color: #a15c00; }
.api-m.delete { background: #fdecec; color: #b42318; }
.ov-api-example { margin-top: 14px; }
.ov-api-example-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}
.ov-api-example-head strong { font-size: 12.5px; }
.ov-api .code-body { margin: 0; max-height: 220px; }
.ov-api .doc-table th:last-child,
.ov-api .doc-table td:last-child { width: 84px; text-align: right; white-space: nowrap; }
.api-try-cell .btn { padding: 3px 10px; }
.api-try-line { display: flex; align-items: center; gap: 8px; }
.api-try-line .input { flex: 1 1 auto; min-width: 0; }
.api-try-headers { font-family: var(--font-mono); font-size: 11.5px; line-height: 1.7; }
.api-try-result {
  min-height: 120px;
  max-height: 320px;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-all;
}
@media (max-width: 1100px) {
  .ov-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.module-group { margin-bottom: 2px; }
.mg-head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 8px;
  border-radius: var(--r-sm);
  cursor: pointer;
  color: var(--ink-3);
}
.mg-head:hover { background: var(--surface-3); }
.mg-caret { flex: none; transition: transform 0.15s var(--ease); }
.module-group.collapsed .mg-caret { transform: rotate(-90deg); }
.module-group.collapsed .mg-body { display: none; }
.mg-name {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  white-space: normal;
  word-break: break-word;
}
.mg-count { font-family: var(--font-mono); font-size: 10px; color: var(--ink-4); flex: none; }
.mg-add { opacity: 0; transition: opacity 0.15s var(--ease); }
.mg-head:hover .mg-add { opacity: 1; }
.mg-body { display: flex; flex-direction: column; gap: 1px; padding: 2px 0 4px 6px; }
.mg-body .module-item { padding: 7px 10px 7px 16px; }

.ws-main { min-width: 0; }
/* 独立显示模式（workspace.html?embed=1）：只保留查询项与数据内容，用于单独展示 / 嵌入 */
body.embed-mode .page-head,
body.embed-mode .conn-bar,
body.embed-mode .ws-side,
body.embed-mode .ws-module-head,
body.embed-mode #viewBar,
body.embed-mode #moduleTabs,
body.embed-mode .ws-overview,
body.embed-mode .tab-panel[data-panel="fields"] { display: none !important; }
body.embed-mode[data-page="project"] .app-content { padding: 14px 16px 28px; max-width: none; }
body.embed-mode .ws-layout { grid-template-columns: 1fr; gap: 0; }
.table-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.table-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  font-size: 12.5px;
  color: var(--ink-2);
  transition: all 0.15s var(--ease);
}
.table-tab:hover { border-color: #c9d8ff; color: var(--blue); }
.table-tab.active { background: var(--blue-soft); border-color: #c9d8ff; color: var(--blue); font-weight: 600; }
.table-tab .tab-count { font-family: var(--font-mono); font-size: 10.5px; opacity: 0.75; }
.table-tab.add { border-style: dashed; color: var(--ink-3); }

.record-wrap { overflow-x: auto; }
.record-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}
.record-toolbar .toolbar-main {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  flex: 1;
  min-width: 0;
  flex-wrap: wrap;
}
.merge-wrap { min-width: 0; }
.merge-wrap .input { width: 100%; height: 30px; }
#queryToggleBtn.active { color: var(--blue); border-color: var(--blue); background: var(--blue-tint); }
/* 这三个按钮用 margin-top 跟查询项首行对齐，关闭过渡避免位移被动画吞掉 */
#queryToggleBtn, #queryApply, #queryReset { transition: none; }
.more-menu { position: relative; }
.head-actions .more-menu > .btn { white-space: nowrap; }
.head-menu-caret {
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-left: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-1px);
  opacity: 0.6;
}
.more-sep { height: 1px; margin: 4px 6px; background: var(--line-2); }
.more-list a.more-item { text-decoration: none; box-sizing: border-box; }
.more-list .more-item.is-new { color: var(--blue); font-weight: 600; }
.more-list {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 50;
  min-width: 152px;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(20, 24, 32, 0.14);
}
.more-item {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-radius: 6px;
  background: transparent;
  text-align: left;
  font-size: 12.5px;
  color: var(--ink-2);
  cursor: pointer;
}
.more-item:hover { background: var(--blue-tint); }
.record-toolbar .row { display: flex; align-items: center; gap: 8px; }
.record-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.record-table th {
  text-align: left;
  padding: 10px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  font-weight: 600;
  color: var(--ink-2);
  white-space: nowrap;
}
.record-table th .th-type {
  display: block;
  margin-top: 2px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 400;
  color: var(--ink-4);
}
.record-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-2);
  color: var(--ink-2);
  white-space: nowrap;
}
.record-table tbody tr:hover td { background: var(--blue-tint); }
.record-table th.sortable { cursor: pointer; user-select: none; }
.record-table th.sortable:hover { background: var(--blue-tint); }
.record-table th.sort-active { color: var(--blue); }
.sort-arrow { display: inline-block; margin-left: 6px; font-size: 11px; color: var(--ink-4); }
.record-table th.sort-active .sort-arrow { color: var(--blue); }
.record-table.dense th { padding: 6px 12px; }
.record-table.dense td { padding: 5px 12px; }
.record-table.dense th .th-type { display: none; }
.record-empty { padding: 48px 20px; text-align: center; color: var(--ink-3); font-size: 12.5px; }
.record-actions { display: flex; gap: 4px; justify-content: flex-end; }
/* 行内操作：增删改查用小图标；超过 3 个时其余收进「更多」下拉 */
.btn.btn-icon { padding: 4px 6px; line-height: 0; }
.btn.btn-icon svg { display: block; }
.row-menu {
  position: fixed;
  z-index: 320;
  min-width: 132px;
  max-height: 280px;
  overflow-y: auto;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(20, 24, 32, 0.14);
}
.row-menu-item {
  display: block;
  width: 100%;
  padding: 7px 10px;
  border: none;
  border-radius: 6px;
  background: transparent;
  text-align: left;
  font-size: 12.5px;
  color: var(--ink-2);
  white-space: nowrap;
  cursor: pointer;
}
.row-menu-item:hover { background: var(--blue-tint); }
/* 查找结果多行展示：列名做弱化标签，空值已在上层跳过 */
.lookup-lines { display: flex; flex-direction: column; gap: 2px; white-space: normal; }
.lookup-lines .lk-line { line-height: 1.5; }
.lookup-lines .lk-label { color: var(--ink-4); font-weight: 500; }
.lookup-result { margin-top: 6px; }
.lookup-result .field-hint { display: block; margin-bottom: 2px; }

.column-panel {
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface-2);
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 4px 14px;
}
.column-panel .cp-head {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
}
.column-panel .cp-head span { font-size: 11px; font-weight: 400; color: var(--ink-4); }

.import-summary { margin: 4px 0 12px; }
.import-picker { display: flex; align-items: center; gap: 8px; }
.import-picker .input { flex: 1; min-width: 0; }
.import-cols { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.import-errors {
  margin: 6px 0 0;
  padding-left: 18px;
  max-height: 120px;
  overflow: auto;
  font-size: 11.5px;
  color: var(--red);
}
.import-table-wrap { max-height: 220px; overflow: auto; border: 1px solid var(--line-2); border-radius: var(--r-sm); }
.import-table-wrap:empty { display: none; }

.field-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.field-table th {
  text-align: left;
  padding: 8px 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-4);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.field-table td {
  padding: 9px 10px;
  border-bottom: 1px dashed var(--line-2);
  color: var(--ink-2);
  vertical-align: middle;
}
.field-table tbody tr:hover td { background: var(--blue-tint); }
.field-table .ft-name { font-weight: 500; white-space: nowrap; }
.field-table .ft-type { font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); white-space: nowrap; }
.field-table .ft-params {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-4);
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.field-table .ft-actions { text-align: right; white-space: nowrap; }
.field-table .ft-attrs { white-space: nowrap; }
.attr-switch { display: inline-flex; align-items: center; gap: 5px; margin-right: 10px; font-size: 11px; color: var(--ink-3); }
.attr-switch:last-child { margin-right: 0; }
.attr-switch b { font-weight: 400; }
.attr-switch.is-disabled { opacity: 0.5; }
.switch-xs { width: 32px; height: 18px; border-radius: 9px; }
.switch-xs::after { width: 14px; height: 14px; }
.switch-xs[aria-checked="true"]::after { transform: translateX(14px); }
.query-merge .query-label { color: var(--blue); }

.ws-module-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}
.wm-main { min-width: 0; }
.wm-main h2 { font-size: 17px; font-weight: 600; margin-bottom: 4px; }

.field-picker { display: grid; grid-template-columns: 220px 1fr; gap: 18px; }
.fp-list {
  max-height: 420px;
  overflow: auto;
  padding-right: 12px;
  border-right: 1px solid var(--line-2);
}
.fp-group {
  margin: 12px 0 4px;
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: var(--ink-4);
}
.fp-group:first-child { margin-top: 0; }
.fp-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 8px;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  background: transparent;
  font-size: 12.5px;
  color: var(--ink-2);
  text-align: left;
}
.fp-item:hover { background: var(--surface-3); }
.fp-item.active { background: var(--blue-soft); border-color: #c9d8ff; color: var(--blue); font-weight: 500; }
.fp-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fp-form { min-width: 0; }

/* 字段新增 / 编辑弹窗：加宽加高，头部与底部固定，内容区独立滚动 */
.modal.field-modal {
  max-width: min(1120px, 96vw);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.field-modal .modal-head { padding-bottom: 14px; border-bottom: 1px solid var(--line-2); }
.field-modal .modal-body { flex: 1 1 auto; overflow: auto; padding: 18px 24px 22px; }
.field-modal .modal-foot { border-top: 1px solid var(--line-2); background: var(--surface); padding: 14px 24px 18px; }
.field-modal .field-picker { grid-template-columns: 260px 1fr; gap: 22px; }
.field-modal .fp-list { max-height: none; }
@media (max-width: 820px) {
  .modal.field-modal { max-width: 96vw; }
}
.check-list { display: flex; flex-wrap: wrap; gap: 8px; }
.column-label-list { display: flex; flex-direction: column; gap: 6px; }
.column-label-row { display: flex; align-items: center; gap: 8px; }
.column-label-key {
  flex: 0 0 auto;
  min-width: 64px;
  max-width: 40%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 4px 8px;
  border-radius: var(--r-sm);
  background: var(--surface-3);
  color: var(--ink-3);
  font-size: 12px;
}
.column-label-row .input { flex: 1 1 auto; min-width: 0; }
.check-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  font-size: 12px;
  color: var(--ink-2);
  cursor: pointer;
}
.check-item:hover { border-color: #c9d8ff; color: var(--blue); }
.check-item input { margin: 0; }
.check-item em {
  font-style: normal;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-4);
}

/* 人员 / 部门 / 角色选择器与附件控件（系统级固定控件） */
.picker-list {
  margin-top: 12px;
  max-height: 320px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.picker-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  background: transparent;
  font-size: 12.5px;
  color: var(--ink-2);
  text-align: left;
  cursor: pointer;
}
.picker-item:hover { background: var(--surface-3); }
.picker-item.active { background: var(--blue-soft); border-color: #c9d8ff; color: var(--blue); font-weight: 500; }
.pi-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pi-id { font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-4); }
.pick-row { display: flex; align-items: center; gap: 8px; }
.pick-row .input { flex: 1; min-width: 0; cursor: pointer; }
.cascade-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cascade-row .select { min-width: 120px; flex: 1 1 120px; }
.cascade-upload { cursor: pointer; }
.money-input { display: flex; align-items: center; gap: 0; }
.money-input span {
  padding: 0 10px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-right: none;
  border-radius: var(--r-sm) 0 0 var(--r-sm);
  background: var(--surface-3);
  color: var(--ink-3);
  font-size: 12.5px;
}
.money-input .input { border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.attach-box {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  border: 1px dashed var(--line);
  border-radius: var(--r-sm);
}
.attach-list { display: flex; flex-wrap: wrap; gap: 6px; }
.attach-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: var(--r-sm);
  background: var(--surface-3);
  font-size: 11.5px;
  color: var(--ink-2);
}
.attach-chip em { font-style: normal; color: var(--ink-4); font-size: 10.5px; }
.attach-chip button {
  border: none;
  background: none;
  padding: 0;
  line-height: 1;
  font-size: 14px;
  color: var(--ink-4);
  cursor: pointer;
}
.attach-chip button:hover { color: var(--red, #c0392b); }
.attach-add { cursor: pointer; }
.attach-add.hidden { display: none; }

/* 查询项：直接铺在工具栏里，按等宽列换行，首行放不下的收进「展开」 */
.query-panel {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  align-items: end;
  gap: 10px 14px;
  flex: 1 1 0;
  min-width: 260px;
}
.query-panel.hidden { display: none; }
/* 查询项容器不参与布局，内部查询项直接进入外层网格列 */
.query-fields { display: contents; }
.query-item { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.query-item-collapsed { display: none; }
.query-label { font-size: 11px; color: var(--ink-3); }
.query-item .input, .query-item .select { height: 30px; width: 100%; min-width: 0; font-size: 12px; }
.query-range-body { display: flex; align-items: center; gap: 6px; }
.query-range-body .input { min-width: 0; width: auto; flex: 1 1 0; }
.query-range-sep { font-size: 11px; color: var(--ink-4); flex: none; }
.query-range-picker { position: relative; }
.query-combo { min-width: 0; width: 100%; }
/* 查询项里的下拉输入去掉消息队列表单的 6px 上间距，否则比同级查询项高出一截 */
.query-combo .combo-input { margin-top: 0; }
.query-combo .combo-list { max-height: 240px; }
.query-item .range-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  width: 100%;
  min-width: 0;
  padding: 0 10px;
  font-size: 12px;
  text-align: left;
  color: var(--ink-3);
  cursor: pointer;
}
.range-trigger.range-filled { color: var(--ink); }
.range-pop {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 60;
  width: 268px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  box-shadow: 0 12px 32px rgba(15, 25, 45, 0.16);
}
.range-pop.hidden { display: none; }
.range-pop-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.range-nav {
  width: 24px; height: 24px; border: 1px solid var(--line); border-radius: 6px;
  background: var(--surface); cursor: pointer; color: var(--ink-2); font-size: 14px; line-height: 1;
}
.range-pop-title { font-size: 12.5px; font-weight: 600; color: var(--ink); }
.range-week, .range-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.range-week { margin-bottom: 4px; }
.range-week span { text-align: center; font-size: 11px; color: var(--ink-4); padding: 2px 0; }
.range-day {
  height: 26px; border: none; background: transparent; border-radius: 5px;
  font-size: 11.5px; color: var(--ink-2); cursor: pointer;
}
.range-day.muted { cursor: default; }
.range-day:hover { background: var(--blue-tint); }
.range-day.in-range { background: rgba(59, 130, 246, 0.1); border-radius: 0; }
.range-day.is-start, .range-day.is-end { background: var(--blue); color: #fff; }
.range-day.is-start.is-end { border-radius: 5px; }
.range-pop-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.range-hint { font-size: 11px; color: var(--ink-4); }
.query-actions { display: flex; gap: 8px; margin-left: auto; }

/* 富文本编辑器 */
.rich-editor {
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  overflow: hidden;
  background: #fff;
}
.rich-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 6px 8px;
  background: var(--surface-3);
  border-bottom: 1px solid var(--line-2);
}
.rich-cmd {
  min-width: 26px;
  height: 26px;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  color: var(--ink-2);
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
}
.rich-cmd:hover { border-color: #c9d8ff; color: var(--blue); }
.rich-body {
  min-height: 120px;
  max-height: 320px;
  overflow-y: auto;
  padding: 10px 12px;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--ink-1);
  outline: none;
}
.rich-body:empty::before {
  content: attr(data-placeholder);
  color: var(--ink-4);
}
.rich-body ul, .rich-body ol { padding-left: 20px; margin: 4px 0; }
.rich-body a { color: var(--blue); }
.rich-body img, .rich-body video {
  display: block;
  max-width: 100%;
  max-height: 320px;
  margin: 8px 0;
  border-radius: var(--r-sm);
}

.scope-block { padding-top: 12px; border-top: 1px dashed var(--line-2); }
.role-row {
  display: grid;
  grid-template-columns: 1fr 170px 1.4fr;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line-2);
}
.role-row:last-child { border-bottom: none; }
.rr-main strong { display: block; font-size: 13px; font-weight: 600; }
.rr-main em {
  font-style: normal;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-4);
}

@media (max-width: 760px) {
  .role-row { grid-template-columns: 1fr; }
}
.fp-selected {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  margin-bottom: 14px;
  border-radius: var(--r-sm);
  background: var(--surface-3);
  font-size: 12px;
  color: var(--ink-2);
}

@media (max-width: 760px) {
  .field-picker { grid-template-columns: 1fr; }
  .fp-list {
    max-height: 180px;
    border-right: none;
    border-bottom: 1px solid var(--line-2);
    padding: 0 0 10px;
  }
}

@media (max-width: 980px) {
  .ws-layout { grid-template-columns: 1fr; }
  .ws-side { position: static; }
}

@media (max-width: 560px) {
  .hero-copy h2 { font-size: 24px; }
  .hero-stats { gap: 18px; }
  .table-picker { grid-template-columns: 1fr; }
  .steps { flex-wrap: wrap; }
  .step-line { display: none; }
  .panel-body { padding: 16px; }
  .preview-table { font-size: 11px; }
  .btn-lg { padding: 0 14px; }
  .success-actions { flex-direction: column; width: 100%; }
  .success-actions .btn { width: 100%; }
}

/* ---------- 12. 数据资产中心 ---------- */
.dataset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.dataset-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease), transform 0.18s var(--ease);
}
.dataset-card:hover {
  border-color: var(--blue);
  box-shadow: 0 10px 26px rgba(51, 112, 255, 0.12);
  transform: translateY(-1px);
}
.dataset-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.dataset-name { font-size: 14px; font-weight: 600; color: var(--ink-1); margin: 0; }
.dataset-desc {
  font-size: 11.5px;
  color: var(--ink-3);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dataset-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-size: 11px;
  color: var(--ink-3);
}
.dataset-meta b { font-weight: 500; color: var(--ink-2); }
.dataset-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px dashed var(--line-2);
}
.dataset-actions { display: flex; gap: 4px; }
.dataset-status { font-size: 11px; padding: 2px 8px; border-radius: 10px; }
.dataset-status.is-ready { color: var(--green); background: var(--green-soft); }
.dataset-status.is-failed { color: var(--red); background: var(--red-soft); }
.dataset-status.is-syncing { color: var(--amber); background: var(--amber-soft); }
.ds-empty {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 56px 20px;
  border: 1px dashed var(--line);
  border-radius: var(--r-md);
  color: var(--ink-3);
  text-align: center;
}
.ds-empty h3 { margin: 0; font-size: 15px; color: var(--ink-1); }
.ds-empty p { margin: 0; font-size: 12.5px; }
.dataset-guide { margin-top: 26px; }
.ds-preview {
  margin: 6px 0 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface-3);
}
.ds-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--ink-3);
}
.ds-preview-head strong { font-size: 12.5px; color: var(--ink-1); }
.ds-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 20px 12px;
  font-size: 12.5px;
  color: var(--ink-3);
}
.ds-loading .btn-spinner { border-color: var(--blue); border-top-color: transparent; }
/* 预览里的字段设置：左列原始字段名，中间改名，右侧类型 */
.ds-columns-head {
  display: grid;
  grid-template-columns: 96px 1fr 104px;
  gap: 8px;
  margin-bottom: 6px;
  padding-right: 2px;
  font-size: 11.5px;
  color: var(--ink-3);
}
.ds-columns-editor {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 190px;
  overflow: auto;
  margin-bottom: 10px;
  padding-right: 2px;
}
.ds-column-row { display: grid; grid-template-columns: 96px 1fr 104px; align-items: center; gap: 8px; }
.ds-col-label { height: 30px; font-size: 12px; min-width: 0; }
.ds-col-type { height: 30px; font-size: 12px; min-width: 0; }
.ds-col-origin {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11.5px;
  color: var(--ink-3);
}
/* 字段设置独立页面 */
.ds-field-head { justify-content: space-between; align-items: center; margin-bottom: 6px; }
.ds-col-tag {
  display: inline-block;
  margin-right: 4px;
  padding: 0 4px;
  border-radius: 3px;
  background: var(--bg-2);
  color: var(--ink-2);
  font-size: 10px;
}
.df-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
@media (max-width: 1100px) {
  .df-layout { grid-template-columns: minmax(0, 1fr); }
}
.df-table td { vertical-align: middle; }
.df-table .input,
.df-table .select { height: 32px; font-size: 12.5px; }
.df-key { font-size: 12px; color: var(--ink-2); word-break: break-all; }
.df-path { font-size: 12px; color: var(--ink-2); word-break: break-all; }
.df-row-derived td { background: color-mix(in srgb, var(--bg-2) 55%, transparent); }
/* JSON / JSON 数组字段行内展开：参考模块视图的字段面板 */
.df-expand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-right: 2px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  color: var(--ink-3);
  font-size: 10px;
  cursor: pointer;
  vertical-align: middle;
}
.df-expand:hover { color: var(--ink-1); border-color: var(--ink-4); }
.df-delete:hover { color: var(--red); border-color: var(--red); background: var(--red-soft); }
.df-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--ink-2);
  cursor: pointer;
  user-select: none;
}
.df-toggle input { accent-color: var(--blue); cursor: pointer; }
.df-row-generated td { background: color-mix(in srgb, var(--blue) 3%, transparent); }
.df-excluded {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 10px;
  padding: 8px 12px;
  border: 1px dashed var(--line);
  border-radius: var(--r-sm);
  background: var(--surface-2);
}
.df-excluded-label { flex: none; font-size: 12px; color: var(--ink-3); line-height: 22px; }
.df-excluded-list { display: flex; flex-wrap: wrap; gap: 6px; }
.df-excluded-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 4px 0 8px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  font-size: 12px;
  color: var(--ink-3);
}
.df-excluded-chip > span { text-decoration: line-through; }
.df-restore {
  height: 18px;
  padding: 0 6px;
  border: none;
  border-radius: 9px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 11px;
  cursor: pointer;
}
.df-restore:hover { background: var(--blue); color: #fff; }
.df-key-count { margin-left: 6px; font-size: 11px; color: var(--ink-4); }
.df-row-expanded td { background: color-mix(in srgb, var(--blue) 4%, transparent); }
.df-key-row td { padding: 0 !important; background: var(--bg-2); }
.df-key-panel { padding: 8px 12px 10px; border-left: 2px solid var(--blue); }
.df-key-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--ink-2);
}
.df-key-list { display: flex; flex-direction: column; gap: 2px; }
.df-key-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border-radius: var(--r-sm);
  background: #fff;
}
.df-key-item:hover { background: color-mix(in srgb, var(--blue) 5%, #fff); }
.df-key-path { font-size: 12px; color: var(--ink-1); font-weight: 500; word-break: break-all; }
.df-key-meta { flex: 1; font-size: 11px; color: var(--ink-4); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.df-key-done { font-size: 11px; color: var(--ink-4); }
.df-key-empty {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.df-key-label {
  flex: 1;
  min-width: 120px;
  height: 26px;
  font-size: 12px;
  padding: 0 8px;
}
.df-key-type {
  width: 96px;
  height: 26px;
  font-size: 12px;
  padding: 0 24px 0 8px;
}
.df-candidates {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 520px;
  overflow: auto;
  margin: 8px 0;
}
.df-candidate {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) 46px;
  align-items: center;
  gap: 8px;
  padding: 6px 4px;
  border-radius: var(--r-sm);
  cursor: pointer;
}
.df-candidate:hover { background: var(--bg-2); }
.df-candidate-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.df-candidate-path { font-size: 12.5px; color: var(--ink-1); word-break: break-all; }
.df-candidate-sub { font-size: 11px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.df-candidate-fill { font-size: 11px; color: var(--ink-3); text-align: right; }
.df-add { width: 100%; }
.df-explode-form { display: flex; flex-direction: column; gap: 12px; max-width: 720px; }
.df-explode-form .input { max-width: 360px; }
.df-explode-fields {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 6px 12px;
  margin-top: 4px;
}
.df-explode-field { font-size: 12.5px; }
.df-explode-filters { display: flex; flex-direction: column; gap: 6px; margin: 6px 0; }
.df-filter-row {
  display: grid;
  grid-template-columns: minmax(0, 200px) minmax(0, 280px) 60px;
  gap: 8px;
  align-items: center;
}
/* 数据集的自动同步计划与同步记录 */
.ds-plan {
  margin: 12px 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface-3);
}
.ds-plan-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--ink-3);
}
.ds-plan-head strong { font-size: 12.5px; color: var(--ink-1); }
.ds-plan-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ds-plan-row .select { width: 136px; height: 30px; font-size: 12px; }
.ds-plan-params { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ds-plan-params .input, .ds-plan-params .select { height: 30px; font-size: 12px; }
.ds-plan-params .input[type="time"] { width: 104px; }
.ds-plan-params .input[type="text"] { width: 240px; }
.ds-plan-params .hint { font-size: 11.5px; color: var(--ink-3); }
.ds-runs { margin-bottom: 12px; }
.ds-runs-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--ink-3);
}
.ds-runs-head strong { font-size: 12.5px; color: var(--ink-1); }
.ds-runs-list { display: flex; flex-direction: column; gap: 6px; max-height: 168px; overflow: auto; }
.ds-run-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: #fff;
  font-size: 11.5px;
  color: var(--ink-2);
}
.ds-run-status { flex: none; padding: 1px 8px; border-radius: 999px; font-size: 11px; }
.ds-run-status.ok { color: #0a7a3d; background: rgba(34, 160, 90, 0.12); }
.ds-run-status.bad { color: var(--red); background: rgba(220, 60, 60, 0.12); }
.ds-run-msg { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-3); }
.ds-run-item .btn { height: 24px; padding: 0 8px; font-size: 11px; }
/* 数据集可见项目范围 */
.ds-project-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  max-height: 160px;
  overflow: auto;
  margin-top: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface-3);
}
.ds-project-list .check-item { font-size: 12px; }
/* 最近连接快捷入口 */
.ds-recent-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 11.5px;
  color: var(--ink-3);
}
.ds-recent-list { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.ds-recent-chip {
  display: inline-flex;
  align-items: center;
  height: 26px;
  max-width: 100%;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 11.5px;
  color: var(--ink-2);
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ds-recent-chip:hover { border-color: var(--blue); color: var(--blue); }
.link-btn { border: none; background: none; padding: 0; font-size: 11.5px; color: var(--ink-3); cursor: pointer; }
.link-btn:hover { color: var(--red); }
.ds-column-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.ds-column-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  font-size: 11px;
  color: var(--ink-2);
}
.ds-column-chip em { font-style: normal; font-family: var(--font-mono); font-size: 10px; color: var(--ink-4); }
.ds-preview-table { max-height: 260px; overflow: auto; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: #fff; }
.ds-preview-table .record-table th,
.ds-preview-table .record-table td { padding: 6px 10px; font-size: 11.5px; }
.ds-detail-modal { max-width: 980px; }
.ds-detail-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  background: var(--surface-3);
  font-size: 11.5px;
  color: var(--ink-3);
}
.ds-detail-meta b { font-weight: 500; color: var(--ink-2); }
.ds-run-message { color: var(--red); }
.ds-filter-row { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.ds-filter-row .select { width: 180px; }
.ds-filter-row .input { width: 240px; }
.ds-rows-wrap { max-height: 360px; overflow: auto; }
.ds-engine { font-style: normal; color: var(--blue); }

/* 数据源类型分组：文件导入 / 数据库 / 自定义取数 */
.ds-type-groups { display: flex; flex-direction: column; gap: 10px; margin-bottom: 6px; }
.ds-type-group { display: flex; flex-direction: column; gap: 6px; }
.ds-type-title { font-size: 11.5px; color: var(--ink-4); }
.ds-type-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 3px;
  border-radius: var(--r-sm);
  background: var(--surface-3, #f2f3f5);
}
.ds-type-btns .seg-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 14px;
}
.ds-type-badge {
  padding: 0 6px;
  border-radius: 999px;
  font-size: 10px;
  line-height: 16px;
  color: #0a7a3d;
  background: rgba(34, 160, 90, 0.14);
}
/* 关联数据集：左右数据集 + 关联字段对 */
.ds-join-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 8px;
  margin-bottom: 8px;
}
.ds-join-head .select { height: 32px; font-size: 12px; }
.ds-join-pairs { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.ds-join-pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 16px minmax(0, 1fr) 28px;
  align-items: center;
  gap: 8px;
}
.ds-join-pair .select { height: 32px; font-size: 12px; }
.ds-join-eq { text-align: center; color: var(--ink-4); }
.ds-join-summary {
  padding: 10px 12px;
  border: 1px dashed var(--line);
  border-radius: var(--r-sm);
  background: var(--surface-3, #f7f8fa);
  font-size: 12.5px;
  color: var(--ink-2);
}
/* 接口模板表单按认证 / 请求 / 分页分区 */
.ds-form-section {
  margin: 12px 0 8px;
  padding-bottom: 6px;
  border-bottom: 1px dashed var(--line);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
}
/* Groovy 脚本编辑器与试运行结果 */
.ds-script-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.ds-script-head .select { height: 30px; width: 108px; font-size: 12px; }
.ds-script-editor {
  width: 100%;
  min-height: 240px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.7;
  tab-size: 4;
  white-space: pre;
  overflow: auto;
  background: #fbfcfd;
  border: 1px solid var(--line);
}
.ds-script-result {
  margin-top: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface-3);
}
.ds-script-summary { margin-bottom: 6px; font-size: 11.5px; color: var(--ink-3); }
.ds-script-logs {
  max-height: 140px;
  overflow: auto;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-2);
}
.ds-script-log { padding: 1px 0; white-space: pre-wrap; word-break: break-all; }
/* Groovy 脚本区块：工具条 + CodeMirror 编辑器 */
.ds-script-block { display: flex; flex-direction: column; gap: 6px; }
/* 固定高度交给 CodeMirror 自己滚；用 max-height 会裁掉内容且不出现滚动条 */
.ds-script-block .CodeMirror {
  height: 320px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.7;
  background: #fbfcfd;
}
.ds-script-block .CodeMirror-scroll { min-height: 0; }
/* 编辑弹窗还有名称、备注、项目等字段，编辑器矮一些，减少弹窗内嵌套滚动 */
.ds-script-block--compact .CodeMirror { height: 260px; }
.ds-script-block .CodeMirror-gutters { background: #f5f7fa; border-right: 1px solid var(--line); }
.ds-script-block .CodeMirror-activeline-background { background: rgba(77, 132, 255, 0.06); }
/* 全屏：铺满窗口，只留工具条与编辑器 */
.ds-script-block.is-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 90;
  gap: 10px;
  padding: 16px 20px 20px;
  background: #fff;
}
.ds-script-block.is-fullscreen .CodeMirror {
  flex: 1;
  height: auto;
  min-height: 0;
}
.ds-script-block.is-fullscreen .CodeMirror-scroll { min-height: 0; }
.ds-script-block.is-fullscreen .ds-script-head .field-label { font-size: 14px; }
body.ds-fullscreen-open { overflow: hidden; }
/* 大模型 JSON 编辑器：工具条 + CodeMirror，可全屏编辑 */
.llm-json-block { display: flex; flex-direction: column; gap: 6px; }
.llm-json-block .llm-json-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.llm-json-block .CodeMirror {
  height: 240px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.7;
  background: #fbfcfd;
}
.llm-json-block--compact .CodeMirror { height: 90px; }
.llm-json-block .CodeMirror-scroll { min-height: 0; }
.llm-json-block .CodeMirror-gutters { background: #f5f7fa; border-right: 1px solid var(--line); }
.llm-json-block .CodeMirror-activeline-background { background: rgba(77, 132, 255, 0.06); }
.llm-json-block.is-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 90;
  gap: 10px;
  padding: 16px 20px 20px;
  background: #fff;
}
.llm-json-block.is-fullscreen .CodeMirror {
  flex: 1;
  height: auto;
  min-height: 0;
  font-size: 13.5px;
}
.llm-json-block.is-fullscreen .CodeMirror-scroll { min-height: 0; }
.llm-json-block.is-fullscreen .llm-json-head .field-label { font-size: 14px; }
/* 大模型试运行结果 */
.llm-test-output {
  min-height: 140px;
  max-height: 45vh;
  overflow: auto;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: #fbfcfd;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}
.ds-script-error { font-size: 11.5px; color: var(--red); white-space: pre-wrap; }
/* Groovy 参考代码：等宽、可横向滚动，避免长行挤压弹窗 */
.script-ref-code {
  max-height: 60vh;
  overflow: auto;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: #fbfcfd;
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--ink-2);
  white-space: pre;
}
/* 试运行输出：限制高度，避免把编辑弹窗撑得过长 */
.ds-script-output { max-height: 220px; margin-top: 6px; }
/* 卡片上的失败原因：只显示首行，完整内容在悬停与同步记录里 */
.dataset-error {
  margin-top: 4px;
  overflow: hidden;
  font-size: 11.5px;
  color: var(--red);
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 760px) {
  .ds-filter-row .select, .ds-filter-row .input { width: 100%; }
}


/* ---------- 登录页 ---------- */
.login-page {
  min-height: 100vh;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(900px 500px at 12% 10%, rgba(77, 132, 255, .16), transparent 60%),
    radial-gradient(700px 420px at 88% 90%, rgba(35, 196, 147, .14), transparent 60%),
    var(--bg);
}
.login-shell {
  width: min(920px, 100%);
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(17, 32, 68, .14);
}
.login-brand {
  padding: 44px 40px;
  color: #fff;
  background: linear-gradient(150deg, #1f3a6e, #2f63c9 60%, #3f8ef0);
}
.login-brand .brand-mark {
  display: inline-flex;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, .16);
}
.login-brand h1 { margin: 18px 0 4px; font-size: 28px; letter-spacing: 2px; }
.login-brand p { margin: 0 0 26px; font-size: 11px; letter-spacing: 3px; opacity: .7; }
.login-brand ul { margin: 0; padding-left: 18px; line-height: 2; font-size: 13px; opacity: .9; }
.login-card { padding: 44px 40px; display: flex; flex-direction: column; justify-content: center; }
.login-card h2 { margin: 0 0 6px; font-size: 22px; }
.login-sub { margin: 0 0 24px; color: var(--ink-2); font-size: 13px; }
.login-pass { display: flex; gap: 8px; align-items: center; }
.login-pass .input { flex: 1; }
.login-submit { width: 100%; height: 42px; justify-content: center; margin-top: 6px; }
.login-hint { margin: 18px 0 0; font-size: 12px; line-height: 1.7; color: var(--ink-2); }
#loginError { min-height: 20px; margin: 6px 0; }
@media (max-width: 780px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-brand { display: none; }
  .login-card { padding: 32px 24px; }
}

/* ---------- 字段级权限配置 ---------- */
.field-perm-list {
  max-height: 300px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}
.field-perm-row {
  display: grid;
  grid-template-columns: 1fr 160px;
  gap: 12px;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
}
.field-perm-row:last-child { border-bottom: none; }
.field-perm-row strong { font-size: 13px; font-weight: 600; }
.field-perm-row em { margin-left: 6px; font-style: normal; font-size: 11px; color: var(--ink-2); }

/* 只读字段与工具栏动作容器 */
.field-label .tag-readonly { margin-left: 6px; }
.rich-body[contenteditable="false"] { background: var(--bg); cursor: not-allowed; }
.record-action-bar { display: inline-flex; gap: 8px; flex-wrap: wrap; }
.is-readonly-field { opacity: .78; }
.is-readonly-field input, .is-readonly-field select, .is-readonly-field textarea { cursor: not-allowed; }
.nav-user { position: relative; }
.nav-user-pwd {
  position: absolute;
  right: 10px;
  top: 8px;
  border: none;
  background: transparent;
  color: var(--blue);
  font-size: 11px;
  cursor: pointer;
  padding: 2px 4px;
}
.nav-user-pwd:hover { text-decoration: underline; }

/* 字段捷径中心：动态参数/输出行 */
.shortcut-rows { display: flex; flex-direction: column; gap: 8px; }
.shortcut-row { display: flex; gap: 8px; align-items: center; }
.shortcut-row .input { flex: 1; min-width: 80px; }
.shortcut-row .select { width: 110px; flex: none; }
.shortcut-row .check-item { white-space: nowrap; }
.shortcut-prompt-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.shortcut-ref-wrap { position: relative; }
.shortcut-ref-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 40;
  min-width: 160px;
  max-height: 220px;
  overflow-y: auto;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--sh-md);
}
.shortcut-ref-menu button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 12px;
  color: var(--ink-2);
  cursor: pointer;
}
.shortcut-ref-menu button:hover { background: var(--blue-soft); color: var(--blue); }
.shortcut-ref-menu .shortcut-ref-new { color: var(--blue); border-top: 1px solid var(--line-2); margin-top: 4px; padding-top: 8px; }
.shortcut-code + .CodeMirror {
  height: 180px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  font-size: 12px;
  line-height: 1.6;
}
.shortcut-code + .CodeMirror .CodeMirror-scroll { min-height: 180px; }

/* ---------- 帮助中心：分页文档与搜索 ---------- */
.help-layout {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.help-side {
  position: sticky;
  top: 18px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-sm);
}
.help-search { position: relative; }
.help-search input {
  width: 100%;
  height: 34px;
  padding: 0 30px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  font-family: var(--font-sans);
  font-size: 12.5px;
  color: var(--ink);
  outline: none;
}
.help-search input:focus {
  border-color: var(--blue);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(51, 112, 255, 0.12);
}
.help-search > svg {
  position: absolute;
  left: 9px;
  top: 9px;
  color: var(--ink-4);
  pointer-events: none;
}
.help-search-clear {
  position: absolute;
  right: 6px;
  top: 5px;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--ink-4);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}
.help-search-clear:hover { background: var(--surface-3); color: var(--ink-2); }
.help-side-title {
  margin: 14px 4px 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--ink-4);
}
.help-side-nav { display: flex; flex-direction: column; gap: 1px; }
.help-side-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: var(--r-sm);
  font-size: 12.5px;
  color: var(--ink-2);
}
.help-side-link:hover { background: var(--surface-2); color: var(--ink); }
.help-side-link.active { background: var(--blue-soft); color: var(--blue); font-weight: 600; }
.help-side-link svg { flex: none; }
.help-side-toc {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 2px 0 4px 14px;
  padding-left: 10px;
  border-left: 1px solid var(--line);
}
.help-side-toc a {
  padding: 3px 0;
  font-size: 11.5px;
  color: var(--ink-3);
  line-height: 1.5;
}
.help-side-toc a:hover { color: var(--blue); }
.help-results { display: flex; flex-direction: column; gap: 4px; max-height: 460px; overflow: auto; }
.help-results-empty { padding: 10px 6px; font-size: 11.5px; color: var(--ink-4); line-height: 1.7; }
.help-result {
  display: block;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
}
.help-result:hover { background: var(--surface-2); border-color: var(--line); }
.help-result strong { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink); }
.help-result span { display: block; margin-top: 2px; font-size: 10.5px; color: var(--ink-4); }
.help-result em {
  display: block;
  margin-top: 4px;
  font-style: normal;
  font-size: 11.5px;
  color: var(--ink-3);
  line-height: 1.6;
}
.help-result mark { padding: 0 1px; border-radius: 3px; background: rgba(51, 112, 255, 0.14); color: var(--blue); }
.help-hero {
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, #f7faff, #fff);
  box-shadow: var(--sh-sm);
}
.help-search--hero input { height: 44px; padding-left: 38px; font-size: 14px; }
.help-search--hero > svg { top: 13px; left: 13px; }
.help-hero-tip { margin-top: 10px; font-size: 11.5px; color: var(--ink-3); }
.help-hero-tip a { margin-right: 10px; color: var(--blue); }
.help-hero .help-results { margin-top: 12px; max-height: none; }
.help-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 18px 20px;
}
.help-card {
  display: block;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  transition: box-shadow 0.15s var(--ease), border-color 0.15s var(--ease);
}
.help-card:hover { border-color: #c9d8ff; box-shadow: var(--sh-md); }
.help-card strong { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink); }
.help-card p { margin-top: 6px; font-size: 11.5px; color: var(--ink-3); line-height: 1.65; }
.help-card em { display: block; margin-top: 8px; font-style: normal; font-size: 10.5px; color: var(--ink-4); }
.help-main section[id] { scroll-margin-top: 18px; }
.help-pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 16px; }
.help-pager a {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  font-size: 11.5px;
  color: var(--ink-3);
}
.help-pager a:hover { border-color: #c9d8ff; }
.help-pager a strong { font-size: 12.5px; color: var(--ink); }
.help-pager a.next { margin-left: auto; text-align: right; }
@media (max-width: 1080px) {
  .help-layout { grid-template-columns: 1fr; }
  .help-side { position: static; }
  .help-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .help-card-grid { grid-template-columns: 1fr; }
  .help-hero { padding: 16px; }
}

/* ---------- AI 助手抽屉 ---------- */
.ai-mask {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  justify-content: flex-end;
  background: rgba(31, 35, 41, 0.28);
  animation: fade-in 0.18s var(--ease);
}
.ai-drawer {
  display: flex;
  flex-direction: column;
  width: 460px;
  max-width: 92vw;
  height: 100%;
  background: var(--surface);
  border-left: 1px solid var(--line);
  box-shadow: var(--sh-lg);
  animation: ai-slide-in 0.22s var(--ease);
}
@keyframes ai-slide-in {
  from { transform: translateX(24px); opacity: 0.6; }
  to { transform: none; opacity: 1; }
}
.ai-drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line-2);
}
.ai-drawer-head strong { font-size: 15px; font-weight: 600; }
.ai-drawer-sub { display: block; margin-top: 3px; font-size: 12px; color: var(--ink-3); }
.ai-drawer-body { flex: 1; overflow-y: auto; padding: 16px 20px; }
.ai-drawer-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 20px;
  border-top: 1px solid var(--line-2);
  background: var(--surface-2);
}
.ai-intro { margin-bottom: 10px; font-size: 12.5px; color: var(--ink-3); line-height: 1.7; }
/* AI 助手对话记录 */
.ai-chat {
  margin-bottom: 12px;
  max-height: 240px;
  overflow-y: auto;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.ai-chat.hidden { display: none; }
.ai-chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--ink-3);
}
.ai-chat-clear {
  border: 0;
  background: transparent;
  color: var(--ink-3);
  font-size: 12px;
  cursor: pointer;
  padding: 2px 4px;
}
.ai-chat-clear:hover { color: var(--ink-1); text-decoration: underline; }
.ai-chat-msg { display: flex; margin-bottom: 6px; }
.ai-chat-msg.is-user { justify-content: flex-end; }
.ai-chat-bubble {
  max-width: 86%;
  padding: 7px 11px;
  border-radius: 10px;
  font-size: 12.5px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}
.ai-chat-msg.is-user .ai-chat-bubble { background: #3370ff; color: #fff; }
.ai-chat-msg.is-ai .ai-chat-bubble { background: #fff; color: var(--ink-1); border: 1px solid var(--line); }
.ai-modes { display: flex; gap: 6px; margin-bottom: 12px; }
.ai-mode {
  height: 28px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-2);
  font-size: 12px;
  transition: all 0.18s var(--ease);
}
.ai-mode:hover { border-color: #c9cdd4; color: var(--ink); }
.ai-mode.active { border-color: var(--blue); background: var(--blue-soft); color: var(--blue); font-weight: 600; }
.ai-input { min-height: 110px; }
/* AI 参考文档：站点模板生成时可上传 Word / Excel / PPT / PDF / 图片 */
.ai-upload {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px dashed #cfd8ea;
  border-radius: var(--r-sm);
  background: var(--surface-2);
}
.ai-upload-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; }
.ai-upload-head strong { font-size: 12.5px; }
.ai-upload-head span { font-size: 11px; color: var(--ink-3); }
.ai-upload-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; max-height: 132px; overflow-y: auto; }
.ai-upload-list:empty { display: none; }
.ai-upload-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 12px;
}
.ai-upload-kind {
  flex: none;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 10px;
}
.ai-upload-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-upload-remove {
  flex: none;
  padding: 0 2px;
  border: none;
  background: none;
  color: var(--ink-3);
  font-size: 14px;
  line-height: 1;
}
.ai-upload-remove:hover { color: var(--red); }
.ai-upload-actions { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.ai-upload-btn { cursor: pointer; }
.ai-upload-hint { font-size: 11px; color: var(--ink-4); }
.ai-run-row { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.ai-hint { font-size: 11.5px; color: var(--ink-4); }
.ai-result { margin-top: 16px; }
.ai-summary { margin-bottom: 6px; font-size: 14px; font-weight: 600; }
.ai-explain { font-size: 13px; color: var(--ink-2); line-height: 1.75; }
.ai-model { margin-top: 6px; font-family: var(--font-mono); font-size: 11px; color: var(--ink-4); }
.ai-session {
  margin-top: 8px;
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--blue-soft);
  font-size: 12px;
  line-height: 1.6;
  color: var(--blue);
}
.ai-section-title { margin: 16px 0 8px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
/* AI 生成进度：长任务（模板复刻）用阶段文案 + 缓动进度条给出「没卡死」的反馈 */
.ai-progress { margin: 12px 0 2px; }
.ai-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--ink-3);
}
.ai-progress-track {
  height: 6px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
  overflow: hidden;
}
.ai-progress-track i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #3370ff, #6f4bff);
  transition: width 0.5s ease;
}
/* AI 草稿效果预览：缩小渲染整页，像一张可核对的预览图 */
.ai-preview { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface); }
.ai-preview-stage { position: relative; height: 420px; overflow: hidden; background: #eef1f5; }
.ai-preview-stage iframe {
  width: 1180px;
  height: 1200px;
  border: 0;
  transform: scale(0.35);
  transform-origin: top left;
  pointer-events: none;
  background: #fff;
}
.ai-preview-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-top: 1px solid var(--line-2);
  font-size: 11.5px;
  color: var(--ink-3);
  background: var(--surface-2);
}
.ai-preview-bar .btn { flex: 0 0 auto; }
.ai-diff { display: flex; flex-direction: column; gap: 6px; }
.ai-diff-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  font-size: 12.5px;
}
.ai-diff-kind {
  flex: none;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--r-xs);
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 11px;
  line-height: 20px;
}
.ai-diff-update .ai-diff-kind { background: var(--amber-soft); color: var(--amber); }
.ai-diff-remove .ai-diff-kind { background: var(--red-soft); color: var(--red); }
.ai-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-left: 18px;
  font-size: 12.5px;
  color: var(--ink-2);
  list-style: disc;
}
.ai-code {
  max-height: 320px;
  margin: 0;
  padding: 12px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface-3);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.65;
  white-space: pre;
}
.ai-warn { color: var(--amber); }
.ai-issues { display: flex; flex-direction: column; gap: 8px; }
.ai-issue {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  font-size: 12.5px;
}
.ai-issue-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.ai-issue-level {
  flex: none;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--r-xs);
  background: var(--surface-3);
  color: var(--ink-2);
  font-size: 11px;
  line-height: 20px;
}
.ai-issue-error { border-color: #f7c9c7; background: var(--red-soft); }
.ai-issue-error .ai-issue-level { background: #f9d2d0; color: var(--red); }
.ai-issue-warn { border-color: #f7d9b8; background: var(--amber-soft); }
.ai-issue-warn .ai-issue-level { background: #ffe0bd; color: var(--amber); }
.ai-issue p { color: var(--ink-2); line-height: 1.7; }
.ai-issue-fix { color: var(--blue); }
.ai-empty {
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: var(--r-sm);
  font-size: 12.5px;
  color: var(--ink-3);
  text-align: center;
}
.ai-json { margin-top: 16px; font-size: 12px; color: var(--ink-3); }
.ai-json summary { cursor: pointer; }
.ai-json pre {
  max-height: 240px;
  margin-top: 8px;
  padding: 10px;
  overflow: auto;
  border-radius: var(--r-sm);
  background: var(--surface-3);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.6;
}

/* ---------- 数据视图：视图栏 / 编辑器 / 分组 / 看板 / 透视 / 图表 ---------- */
.view-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.view-bar.hidden { display: none; }
.view-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  padding-bottom: 2px;
}
.view-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-3);
  font-size: 12.5px;
  white-space: nowrap;
  cursor: pointer;
}
.view-tab:hover { background: var(--surface-2); color: var(--ink); }
.view-tab.active { background: var(--blue-soft); border-color: #d6e4ff; color: var(--blue); font-weight: 600; }
.view-tab-badge {
  padding: 0 5px;
  border-radius: 4px;
  background: var(--blue);
  color: #fff;
  font-size: 9px;
  line-height: 14px;
}
.view-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.view-editor-options { display: flex; gap: 18px; margin-top: 10px; }
.view-filter-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.view-filter-head .select { max-width: 220px; }
.metric-list { display: flex; flex-direction: column; gap: 6px; }
.metric-row { display: grid; grid-template-columns: 1fr 130px auto; gap: 8px; align-items: center; }
.metric-row .select { width: 100%; }
.view-type-section { margin-top: 6px; }
.view-type-section.hidden { display: none; }
.check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 4px 12px;
  max-height: 180px;
  overflow: auto;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.view-type-section select[multiple] { width: 100%; min-height: 92px; padding: 6px 10px; }
.modal.modal-wide { max-width: 860px; }

/* 透视表拖拽布局：左侧字段面板 + 行 / 列 / 值拖拽区 */
.pivot-builder { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 12px; margin-top: 6px; }
.pivot-palette {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  max-height: 300px;
  overflow: hidden;
}
.pivot-panel-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}
.pivot-panel-head span { font-size: 12px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.pivot-search { height: 28px; padding: 2px 8px; font-size: 12px; }
.pivot-palette-list {
  flex: 1;
  overflow: auto;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.pivot-palette-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  font-size: 12px;
  cursor: grab;
  user-select: none;
}
.pivot-palette-item:hover { border-color: var(--blue); background: var(--blue-tint); }
.pivot-palette-item em { font-style: normal; font-size: 10px; color: var(--ink-4); }
.pivot-palette-group { display: flex; flex-direction: column; gap: 3px; }
.pivot-palette-group-head { background: var(--surface-2); font-weight: 600; }
.pivot-palette-child { margin-left: 14px; border-style: dashed; }
.pivot-palette-child span { color: var(--ink-2); }
.pivot-zones { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.pivot-zone {
  border: 1px dashed var(--line);
  border-radius: var(--r-md);
  background: var(--surface-2);
  display: flex;
  flex-direction: column;
  min-height: 100px;
}
.pivot-zone-values { grid-column: 1 / -1; }
.pivot-zone-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 7px 10px 0; }
.pivot-zone-head span { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.pivot-zone-head em { font-style: normal; font-size: 10px; color: var(--ink-4); }
.pivot-zone-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 7px 8px 8px;
  min-height: 64px;
  border-radius: var(--r-md);
}
.pivot-zone-body:empty::before { content: '拖入字段'; font-size: 12px; color: var(--ink-4); }
.pivot-zone-body.drag-over { background: var(--blue-tint); outline: 1px dashed var(--blue); outline-offset: -3px; }
.pivot-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  font-size: 12px;
  cursor: grab;
}
.pivot-chip-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pivot-chip .select { width: auto; height: 26px; padding: 0 6px; font-size: 11px; }
.pivot-agg-static { font-size: 11px; color: var(--ink-4); }
.pivot-chip-remove {
  border: none;
  background: none;
  color: var(--ink-4);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0 2px;
}
.pivot-chip-remove:hover { color: var(--red); }

/* 分享弹窗：链接输入 + 复制按钮 */
.share-link-row { display: flex; align-items: center; gap: 8px; margin: 6px 0 2px; }
.share-link-row .input { flex: 1; font-size: 12px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.record-group-row td {
  background: var(--surface-2);
  padding: 8px 14px;
  border-top: 1px solid var(--line);
}
.record-group-row strong { font-size: 12.5px; color: var(--ink); }
.record-group-count { margin-left: 8px; color: var(--ink-4); font-size: 11.5px; }
.record-group-metrics { margin-left: 14px; color: var(--blue); font-size: 11.5px; }
.record-summary-cell { background: var(--blue-tint); font-weight: 600; color: var(--ink); }
.view-hint { margin-top: 8px; font-size: 11.5px; color: var(--ink-4); }
.view-warning { color: var(--amber); font-size: 11.5px; }

/* 看板 */
.kanban {
  display: flex;
  gap: 12px;
  padding: 14px;
  overflow-x: auto;
  align-items: flex-start;
  min-height: 420px;
  background: var(--surface-2);
  border-radius: var(--r-lg);
}
.kanban-col {
  flex: 0 0 268px;
  max-height: 640px;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.kanban-col-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-2);
  font-size: 12.5px;
  font-weight: 600;
}
.kanban-col-head em {
  font-style: normal;
  font-size: 11px;
  color: var(--ink-4);
  background: var(--surface-2);
  padding: 1px 7px;
  border-radius: 999px;
}
.kanban-cards { display: flex; flex-direction: column; gap: 8px; padding: 10px; overflow-y: auto; }
.kanban-card {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--sh-sm);
  cursor: grab;
}
.kanban-card[draggable="true"]:hover { border-color: #c9d8ff; }
.kanban-card.dragging { opacity: 0.5; }
.kanban-card-title { font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 8px; }
.kanban-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 2px 0;
  font-size: 11.5px;
  color: var(--ink-3);
}
.kanban-row b { font-weight: 500; color: var(--ink-2); text-align: right; }
.kanban-card-foot { display: flex; justify-content: flex-end; margin-top: 8px; }
.kanban-empty { padding: 16px; text-align: center; color: var(--ink-4); font-size: 11.5px; }

/* 透视表 */
.pivot-wrap { overflow: auto; padding: 4px; }
.pivot-table { border-collapse: collapse; font-size: 12px; min-width: 100%; }
.pivot-table th, .pivot-table td { border: 1px solid var(--line); padding: 7px 10px; white-space: nowrap; }
.pivot-table thead th { background: var(--surface-2); font-weight: 600; color: var(--ink-2); text-align: center; }
.pivot-table th.pivot-corner { text-align: left; vertical-align: middle; }
.pivot-table th.pivot-metric { font-weight: 500; font-size: 11px; color: var(--ink-4); }
.pivot-table td.pivot-row-head { background: var(--surface-2); font-weight: 500; color: var(--ink-2); text-align: left; }
.pivot-table td.pivot-value { text-align: right; font-variant-numeric: tabular-nums; }
.pivot-table td.pivot-value[data-pivot-cell] { cursor: pointer; }
.pivot-table td.pivot-value[data-pivot-cell]:hover { background: var(--blue-tint); }
.pivot-table tr.pivot-subtotal-row td { background: var(--surface-2); font-weight: 600; }
.pivot-table td.pivot-subtotal { font-weight: 600; }
.pivot-table tfoot td { background: var(--blue-tint); font-weight: 600; }
/* 多级分组：列维度逐层 colspan，行维度按同一父级 rowspan 合并 */
.pivot-table th.pivot-group { background: var(--surface-3, var(--surface-2)); }
.pivot-table th.pivot-total-col { border-left: 2px solid var(--line); }
.pivot-table td.pivot-row-head { vertical-align: middle; }
.pivot-table td.pivot-level-1 { padding-left: 22px; }
.pivot-table td.pivot-level-2 { padding-left: 36px; }

/* JSON 字段：字段配置里的 key 定义 + 记录表单的逐项填写 */
.json-key-editor, .json-value-editor { display: flex; flex-direction: column; gap: 6px; }
.json-key-item { display: flex; flex-direction: column; gap: 4px; }
.json-key-row { display: grid; grid-template-columns: 1fr 0.9fr 96px 1.4fr auto; gap: 6px; align-items: center; }
.json-key-item .json-key-expr { display: none; width: 100%; box-sizing: border-box; }
.json-key-item[data-type="formula"] .json-key-expr {
  display: block;
  min-height: 62px;
  margin-top: 2px;
  border-color: #c9d8ff;
  background: var(--blue-tint, #f5f8ff);
}
.json-key-item[data-type="formula"] .json-key-options { display: none; }
.json-key-tools { display: flex; flex-direction: column; gap: 6px; }
.json-key-tools.is-hidden { display: none; }
.json-key-tool-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.json-key-tool-row .select { width: auto; min-width: 150px; }
.json-key-actions { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.json-value-row { display: grid; grid-template-columns: 110px 1fr; gap: 8px; align-items: center; }
.json-value-key { font-size: 12px; color: var(--ink-2); }
/* 公式 key 只读结果 */
.json-formula-value {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 4px 10px;
  border: 1px dashed var(--line);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.json-table td .json-formula-value { display: flex; width: 100%; box-sizing: border-box; }
/* JSON 数组按表格编辑 */
.json-table-wrap { overflow-x: auto; }
.json-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.json-table th, .json-table td { border: 1px solid var(--line); padding: 6px 8px; text-align: left; vertical-align: middle; }
.json-table th { background: var(--surface-2); font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.json-table td .input, .json-table td .select, .json-table td .textarea { width: 100%; box-sizing: border-box; }
.json-table th.json-table-op, .json-table td:last-child { width: 72px; text-align: center; }
.json-table-actions { display: flex; align-items: center; gap: 8px; margin-top: 8px; }

/* 图表 */
.chart-wrap { padding: 18px; }
.view-chart { width: 100%; height: auto; display: block; }
.chart-grid { stroke: var(--line-2); stroke-width: 1; }
.chart-axis { fill: var(--ink-4); font-size: 11px; }
.chart-total { fill: var(--ink); font-size: 16px; font-weight: 600; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; justify-content: center; }
.chart-legend-item { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--ink-3); }
.chart-legend-item i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }

/* 大模型功能分类 */
.model-filter { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.model-category {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}
.model-category-general { background: var(--blue-soft); color: var(--blue); }
.model-category-text { background: #f2f3f5; color: #4e5969; }
.model-category-image { background: var(--green-soft); color: var(--green); }
.model-category-video { background: var(--amber-soft); color: var(--amber); }

/* ---------- 模板中心 ---------- */
.tpl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.tpl-empty {
  grid-column: 1 / -1;
  padding: 48px 16px;
  text-align: center;
  color: var(--ink-3);
  font-size: 12.5px;
  border: 1px dashed var(--line);
  border-radius: var(--r-lg);
}
.tpl-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--sh-sm);
  overflow: hidden;
  transition: box-shadow 0.18s var(--ease), transform 0.18s var(--ease);
}
.tpl-card:hover { box-shadow: var(--sh-md); transform: translateY(-2px); }
.tpl-cover {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 4px;
  min-height: 132px;
  padding: 16px;
  color: #fff;
}
.tpl-cover strong { font-size: 17px; font-weight: 600; }
.tpl-cover em { font-style: normal; font-size: 12px; opacity: 0.85; }
.tpl-cover-icon {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.18);
}
.tpl-cover-commerce { background: linear-gradient(135deg, #ff7d00, #ff4d4f); }
.tpl-cover-official { background: linear-gradient(135deg, #3370ff, #6f4bff); }
.tpl-cover-directory { background: linear-gradient(135deg, #00b578, #0f9b8e); }
.tpl-cover-admin { background: linear-gradient(135deg, #1d4ed8, #0ea5e9); }
.tpl-cover-bbs { background: linear-gradient(135deg, #2563eb, #7c3aed); }
.tpl-body { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px 16px; flex: 1; }
.tpl-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tpl-title strong { font-size: 14px; }
.tpl-desc { font-size: 12px; color: var(--ink-3); line-height: 1.6; min-height: 38px; }
.tpl-meta { font-size: 11.5px; color: var(--ink-4); }
.tpl-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tpl-tags span { padding: 1px 8px; border-radius: 999px; background: var(--surface-2); color: var(--ink-3); font-size: 10.5px; }
.tpl-actions { display: flex; gap: 6px; margin-top: auto; padding-top: 6px; }

/* 已应用项目：按模板分组 */
.tpl-applied { display: flex; flex-direction: column; gap: 24px; }
.tpl-applied-group { display: flex; flex-direction: column; gap: 12px; }
.tpl-applied-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.tpl-applied-head strong { font-size: 15px; font-weight: 600; }
.tpl-applied-head .tpl-meta { margin-left: 10px; }
.proj-card-compact { gap: 10px; }

/* 模板预览 */
.tpl-site { border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: #fff; }
.tpl-site-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; color: #fff; background: #1f2329; }
.tpl-site-nav div { display: flex; gap: 14px; font-size: 12px; opacity: 0.85; }
.tpl-site-hero { padding: 36px 24px; text-align: center; color: #fff; }
.tpl-site-hero h3 { font-size: 24px; font-weight: 600; margin-bottom: 8px; }
.tpl-site-hero p { font-size: 13px; opacity: 0.9; margin-bottom: 14px; }
.tpl-hero-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.tpl-site.tpl-cover-commerce .tpl-site-hero { background: linear-gradient(135deg, #ff7d00, #ff4d4f); }
.tpl-site.tpl-cover-official .tpl-site-hero { background: linear-gradient(135deg, #3370ff, #6f4bff); }
.tpl-site.tpl-cover-directory .tpl-site-hero { background: linear-gradient(135deg, #00b578, #0f9b8e); }
.tpl-site.tpl-cover-admin .tpl-site-hero { background: linear-gradient(135deg, #1d4ed8, #0ea5e9); }
.tpl-site.tpl-cover-bbs .tpl-site-hero { background: linear-gradient(135deg, #2563eb, #7c3aed); }
.tpl-section { padding: 20px 24px; border-top: 1px solid var(--line-2); }
.tpl-section h4 { font-size: 15px; margin-bottom: 12px; }
.tpl-section-desc { font-size: 12px; color: var(--ink-3); }
.tpl-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.tpl-mini-card { display: flex; flex-direction: column; gap: 4px; padding: 10px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.tpl-mini-card strong { font-size: 12.5px; }
.tpl-mini-card b { font-size: 12px; color: #ff4d4f; }
.tpl-mini-card p { font-size: 11px; color: var(--ink-4); }
.tpl-mini-cover { height: 64px; border-radius: var(--r-sm); background: linear-gradient(135deg, #eef4ff, #dbe7ff); }
.tpl-mini-cover[data-index="1"] { background: linear-gradient(135deg, #fff4e6, #ffe3c2); }
.tpl-mini-cover[data-index="2"] { background: linear-gradient(135deg, #e8f8f1, #c9efe1); }
.tpl-list { display: flex; flex-direction: column; gap: 8px; }
.tpl-list-row { padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-md); }
.tpl-list-row strong { font-size: 12.5px; }
.tpl-list-cells { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 4px; font-size: 11.5px; color: var(--ink-3); }
.tpl-site-foot { padding: 18px 24px; background: var(--surface-2); color: var(--ink-4); font-size: 11.5px; text-align: center; }
.tpl-model-list { margin-top: 16px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2); }
.tpl-model-list h4 { font-size: 13px; margin-bottom: 10px; }
.tpl-model-row { display: flex; gap: 12px; padding: 6px 0; font-size: 12px; border-top: 1px solid var(--line-2); }
.tpl-model-row strong { min-width: 84px; }
.tpl-model-row span { color: var(--ink-3); }

/* 预览弹窗：页面切换与页面说明 */
.tpl-page-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.tpl-page-tab {
  height: 28px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-3);
  font-size: 12px;
  cursor: pointer;
}
.tpl-page-tab:hover { border-color: #c9d8ff; color: var(--blue); }
.tpl-page-tab.active { background: var(--blue-soft); border-color: #c9d8ff; color: var(--blue); font-weight: 600; }
/* 子页面标记：模板详情与预览里区分下拉子菜单 */
.tpl-child-mark, .tdp-child-mark { margin-right: 3px; color: var(--ink-3); font-weight: 400; }
.tpl-page-desc { margin: 0 0 10px; font-size: 12px; color: var(--ink-3); }
.tpl-site-nav div span.is-active { opacity: 1; font-weight: 600; text-decoration: underline; text-underline-offset: 4px; }

/* 模板详情独立页：封面头部 + 悬浮 tab + 分页面板 */
.tdp-loading { padding: 72px 0; text-align: center; font-size: 13px; color: var(--ink-3); }
.tdp-error {
  padding: 14px 16px;
  border: 1px solid #ffd6d6;
  border-radius: var(--r-md);
  background: #fff5f5;
  font-size: 13px;
  color: #d4380d;
}
.tdp-hero {
  position: relative;
  overflow: hidden;
  margin-bottom: 18px;
  padding: 26px 28px 24px;
  border-radius: var(--r-lg);
  background: linear-gradient(135deg, #3370ff, #6f4bff);
  background-size: cover;
  background-position: center;
  color: #fff;
}
.tdp-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(9, 14, 28, 0.5), rgba(9, 14, 28, 0.1));
  pointer-events: none;
}
.tdp-hero-inner { position: relative; z-index: 1; max-width: 900px; }
.tdp-hero .crumb { margin-bottom: 6px; color: rgba(255, 255, 255, 0.76); }
.tdp-hero .crumb a { color: rgba(255, 255, 255, 0.76); }
.tdp-hero .crumb a:hover { color: #fff; }
.tdp-hero .crumb i { color: rgba(255, 255, 255, 0.5); }
.tdp-title { margin: 4px 0 8px; font-size: 26px; line-height: 1.3; }
.tdp-sub { max-width: 780px; font-size: 13px; line-height: 1.75; color: rgba(255, 255, 255, 0.86); }
.tdp-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.tdp-meta > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  font-size: 11.5px;
}
.tdp-swatch { display: inline-flex; align-items: center; gap: 6px; }
.tdp-swatch i { width: 11px; height: 11px; border-radius: 3px; border: 1px solid rgba(255, 255, 255, 0.4); }
.tdp-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.tdp-btn-light { background: #fff; border-color: transparent; color: var(--blue); }
.tdp-btn-light:hover { background: rgba(255, 255, 255, 0.9); color: var(--blue); }
.tdp-btn-ghost { background: rgba(255, 255, 255, 0.14); border-color: rgba(255, 255, 255, 0.34); color: #fff; }
.tdp-btn-ghost:hover { background: rgba(255, 255, 255, 0.24); color: #fff; }

/* 悬浮主 tab */
.tdp-tabbar {
  position: sticky;
  top: 12px;
  z-index: 30;
  display: inline-flex;
  gap: 4px;
  margin-bottom: 16px;
  padding: 5px;
  border: 1px solid rgba(15, 23, 42, 0.07);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(14px);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
}
.tdp-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 16px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-3);
  font-size: 12.5px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.tdp-tab:hover { color: var(--blue); }
.tdp-tab.active { background: var(--blue); color: #fff; font-weight: 600; box-shadow: 0 4px 12px rgba(51, 112, 255, 0.32); }
.tdp-tab-count {
  min-width: 16px;
  padding: 0 5px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.07);
  font-size: 10.5px;
  line-height: 16px;
  text-align: center;
}
.tdp-tab.active .tdp-tab-count { background: rgba(255, 255, 255, 0.24); }

/* 面板 */
.tdp-panel {
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
}
.tdp-block + .tdp-block { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line-2); }
.tdp-block h4 { margin-bottom: 10px; font-size: 13.5px; }
.tdp-text { font-size: 13px; line-height: 1.9; color: var(--ink-2); }
.tdp-list { margin: 0; padding-left: 18px; font-size: 12.5px; line-height: 2; color: var(--ink-2); }
.tdp-hint { margin-bottom: 10px; font-size: 11.5px; color: var(--ink-4); }
.tdp-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tdp-tags span { padding: 4px 12px; border-radius: 999px; background: var(--blue-soft); color: var(--blue); font-size: 11.5px; }

/* 模板介绍：页面结构索引 */
.tdp-page-index { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.tdp-page-index-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface-2);
  text-align: left;
  cursor: pointer;
}
.tdp-page-index-item:hover { border-color: #c9d8ff; background: #fff; }
.tdp-page-index-item strong { font-size: 12.5px; }
.tdp-page-index-item span {
  flex: 1;
  overflow: hidden;
  font-size: 11px;
  color: var(--ink-4);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tdp-page-index-item i { color: var(--ink-4); }

/* 页面能力：悬浮子 tab + 单页能力 */
.tdp-subtabs {
  position: sticky;
  top: 64px;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: -4px -4px 16px;
  padding: 5px;
  border-radius: 14px;
  background: rgba(247, 248, 250, 0.92);
  backdrop-filter: blur(10px);
}
.tdp-subtab {
  height: 30px;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-3);
  font-size: 12px;
  cursor: pointer;
}
.tdp-subtab:hover { color: var(--blue); }
.tdp-subtab.active {
  border-color: var(--line);
  background: #fff;
  color: var(--blue);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}
.tdp-page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.tdp-page-head h3 { margin-bottom: 4px; font-size: 17px; }
.tdp-page-head p { font-size: 12.5px; line-height: 1.7; color: var(--ink-3); }
.tdp-page-actions { display: flex; flex-shrink: 0; flex-wrap: wrap; gap: 6px; }
.tdp-page-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.tdp-page-card { padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2); }
.tdp-page-card h5 { margin-bottom: 8px; font-size: 12px; color: var(--ink-2); }
.tdp-section-list { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; }
.tdp-section-list li { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.tdp-section-list li span {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  font-size: 10px;
  line-height: 17px;
  text-align: center;
  color: var(--ink-4);
}
.tdp-section-list li strong { min-width: 64px; }
.tdp-section-list li em {
  overflow: hidden;
  font-style: normal;
  font-size: 11.5px;
  color: var(--ink-4);
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 数据模型 */
.tdp-module-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.tdp-module { padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2); }
.tdp-module-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.tdp-module-head strong { font-size: 12.5px; }
.tdp-module-head span { font-size: 11px; color: var(--ink-4); }
.tdp-module p { margin: 5px 0; font-size: 11.5px; color: var(--ink-3); }
.tdp-fields { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tdp-fields span {
  padding: 1px 8px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: var(--surface);
  font-size: 10.5px;
  color: var(--ink-3);
}

@media (max-width: 720px) {
  .tdp-hero { padding: 20px; }
  .tdp-title { font-size: 21px; }
  .tdp-tabbar { display: flex; flex-wrap: wrap; border-radius: 18px; position: static; }
  .tdp-subtabs { position: static; }
  .tdp-page-head { flex-direction: column; }
}

/* 按参考网站主题渲染的站点预览 */
.tpl-site { background: var(--tpl-bg, #fff); color: var(--tpl-text, #1f2329); }
.tpl-site .btn { background: var(--tpl-primary, #3370ff); border-color: transparent; color: #fff; }
.tpl-site .btn:hover { filter: brightness(0.94); }
.tpl-site-nav {
  background: var(--tpl-surface, #fff);
  color: var(--tpl-text, #1f2329);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
.tpl-site-nav div { color: var(--tpl-text, #1f2329); opacity: 0.72; }
.tpl-site-hero { border-radius: 0; }
.tpl-site-hero h3 { letter-spacing: -0.01em; }
.tpl-section { border-top: 1px solid rgba(0, 0, 0, 0.06); }
.tpl-section-head { margin-bottom: 14px; }
.tpl-section-head h4 { font-size: 18px; margin-bottom: 4px; }
.tpl-section-head p { font-size: 12.5px; color: rgba(0, 0, 0, 0.55); }
.tpl-feature-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.tpl-feature { display: flex; flex-direction: column; gap: 6px; }
.tpl-feature-media {
  height: 96px;
  border-radius: var(--tpl-radius, 12px);
  background: linear-gradient(135deg, var(--tpl-primary, #3370ff), var(--tpl-accent, #6f4bff));
  background-size: cover;
  background-position: center;
  opacity: 0.92;
}
.tpl-feature strong { font-size: 13px; }
.tpl-feature p { font-size: 12px; line-height: 1.6; color: rgba(0, 0, 0, 0.58); }
.tpl-mini-card { border-radius: var(--tpl-radius, 12px); background: var(--tpl-surface, #fff); }
.tpl-mini-cover { background: linear-gradient(135deg, var(--tpl-primary, #3370ff), var(--tpl-accent, #6f4bff)); background-size: cover; background-position: center; border-radius: calc(var(--tpl-radius, 12px) - 4px); }
.tpl-mini-card b { color: var(--tpl-primary, #ff4d4f); }
.tpl-list-row { border-radius: var(--tpl-radius, 12px); background: var(--tpl-surface, #fff); }
.tpl-cta {
  text-align: center;
  padding: 34px 24px;
  color: #fff;
  background: linear-gradient(135deg, var(--tpl-primary, #3370ff), var(--tpl-accent, #6f4bff));
}
.tpl-cta h4 { font-size: 20px; margin-bottom: 6px; }
.tpl-cta p { font-size: 12.5px; opacity: 0.9; margin-bottom: 14px; }
.tpl-cta .btn { background: #fff; color: var(--tpl-primary, #3370ff); }




/* 系统级 AI 助手 */
.agent-fab {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 60;
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, #3370ff, #6f4bff);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(51, 112, 255, 0.35);
  transition: transform .16s ease, box-shadow .16s ease;
}
.agent-fab:hover { transform: translateY(-2px); box-shadow: 0 16px 34px rgba(51, 112, 255, 0.42); }
.nav-agent { border: 0; background: transparent; cursor: pointer; width: 100%; text-align: left; }
.agent-mask {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(15, 23, 42, .22);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease;
}
.agent-mask.open { opacity: 1; pointer-events: auto; }
.agent-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 71;
  width: min(430px, 100vw);
  display: flex;
  flex-direction: column;
  background: var(--surface, #fff);
  box-shadow: -18px 0 40px rgba(15, 23, 42, .14);
  transform: translateX(100%);
  transition: transform .2s ease;
}
.agent-drawer.open { transform: none; }
.agent-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line, #e5e7eb);
}
.agent-head strong { display: block; font-size: 14px; color: var(--ink, #111827); }
.agent-head span { display: block; margin-top: 4px; font-size: 12px; color: var(--ink-3, #8a8f99); }
.agent-close {
  border: 0;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  color: var(--ink-3, #8a8f99);
  cursor: pointer;
  padding: 0 2px;
}
.agent-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: var(--bg-2, #f7f8fa);
}
.agent-welcome { margin-bottom: 10px; font-size: 13px; color: var(--ink-2, #4b5563); }
.agent-welcome p { margin: 6px 0 0; font-size: 12px; color: var(--ink-3, #8a8f99); }
.agent-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.agent-chip {
  border: 1px solid var(--line, #e5e7eb);
  background: var(--surface, #fff);
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  color: var(--ink-2, #4b5563);
  cursor: pointer;
}
.agent-chip:hover { border-color: #3370ff; color: #3370ff; }
.agent-msg { display: flex; margin-bottom: 12px; }
.agent-msg.user { justify-content: flex-end; }
.agent-bubble {
  max-width: 90%;
  padding: 10px 12px;
  border: 1px solid var(--line, #e5e7eb);
  border-radius: 12px;
  background: var(--surface, #fff);
  font-size: 13px;
  line-height: 1.65;
  color: var(--ink, #111827);
  word-break: break-word;
}
.agent-msg.user .agent-bubble { background: #3370ff; border-color: #3370ff; color: #fff; }
.agent-bubble.agent-error { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }
.agent-bubble.agent-thinking { color: var(--ink-3, #8a8f99); }
.agent-steps { display: flex; flex-direction: column; gap: 6px; margin-top: 9px; }
.agent-step {
  padding: 6px 8px;
  border-radius: 8px;
  background: var(--bg-2, #f7f8fa);
  font-size: 12px;
  color: var(--ink-2, #4b5563);
}
.agent-step.failed { background: #fef2f2; color: #b91c1c; }
.agent-step div { margin-top: 3px; color: var(--ink-3, #8a8f99); }
.agent-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.agent-head-actions { display: flex; align-items: center; gap: 6px; }
.agent-clear {
  border: 1px solid var(--line, #e5e7eb);
  background: transparent;
  color: var(--ink-3, #8a8f99);
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 11.5px;
  cursor: pointer;
}
.agent-clear:hover { color: #b91c1c; border-color: #fecaca; background: #fef2f2; }
.agent-tabs { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 18px 0; }
.agent-tabs.hidden { display: none; }
.agent-tab {
  border: 1px solid var(--line, #e5e7eb);
  background: var(--surface, #fff);
  color: var(--ink-2, #4b5563);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
}
.agent-tab:hover { border-color: #3370ff; color: #3370ff; }
.agent-tab.active { background: #3370ff; border-color: #3370ff; color: #fff; }
.agent-context { padding: 8px 18px 10px; border-top: 1px solid var(--line, #e5e7eb); }
.agent-context.hidden { display: none; }
.agent-context-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11.5px;
  color: var(--ink-3, #8a8f99);
}
.agent-context-btn {
  border: 1px solid var(--line, #e5e7eb);
  background: var(--surface, #fff);
  color: var(--ink-2, #4b5563);
  border-radius: 8px;
  padding: 3px 8px;
  font-size: 11.5px;
  cursor: pointer;
}
.agent-context-btn:hover:not(:disabled) { border-color: #3370ff; color: #3370ff; }
.agent-context-btn:disabled { opacity: .45; cursor: not-allowed; }
.agent-context-bar { height: 6px; border-radius: 3px; background: #eef1f5; overflow: hidden; margin-top: 6px; }
.agent-context-bar span { display: block; height: 100%; background: #22c55e; transition: width .2s ease; }
.agent-context.warn .agent-context-bar span { background: #f59e0b; }
.agent-context.danger .agent-context-bar span { background: #ef4444; }
.agent-context-hint { margin-top: 5px; font-size: 11px; color: #b45309; }
.agent-notice {
  margin: 0 0 10px;
  padding: 6px 10px;
  border: 1px solid #99f6e4;
  border-radius: 8px;
  background: #ecfdf5;
  color: #0f766e;
  font-size: 11.5px;
  text-align: center;
}
.agent-files { padding: 8px 12px 0; border-top: 1px solid var(--line, #e5e7eb); max-height: 190px; overflow-y: auto; }
.agent-files.hidden { display: none; }
.agent-file {
  border: 1px solid var(--line, #e5e7eb);
  border-radius: 10px;
  padding: 8px 10px;
  margin-bottom: 8px;
  background: var(--surface, #fff);
}
.agent-file-loading { color: var(--ink-3, #8a8f99); font-size: 12px; }
.agent-file-head { display: flex; align-items: center; gap: 8px; }
.agent-file-head strong {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12.5px;
  color: var(--ink, #111827);
}
.agent-file-head span { font-size: 11px; color: var(--ink-3, #8a8f99); flex: none; }
.agent-file-remove {
  border: 0;
  background: transparent;
  color: var(--ink-3, #8a8f99);
  font-size: 11.5px;
  cursor: pointer;
  flex: none;
}
.agent-file-remove:hover { color: #b91c1c; }
.agent-file-columns {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--ink-3, #8a8f99);
}
.agent-col {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line, #e5e7eb);
  border-radius: 999px;
  padding: 2px 7px;
  font-size: 11px;
  color: var(--ink-2, #4b5563);
  background: #f7f8fa;
}
.agent-batch-cols .agent-col { cursor: pointer; }
.agent-batch-cols .agent-col:hover { border-color: #3370ff; color: #3370ff; }
.agent-file-preview {
  margin-top: 6px;
  font-size: 11px;
  color: var(--ink-3, #8a8f99);
  overflow: hidden;
  max-height: 34px;
  line-height: 1.5;
}
.agent-file-warning { margin-top: 5px; font-size: 11px; color: #b45309; }
.agent-file-actions { display: flex; gap: 6px; margin-top: 6px; }
.agent-msg-files { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.agent-msg-file {
  border-radius: 999px;
  padding: 2px 7px;
  font-size: 11px;
  background: rgba(255, 255, 255, 0.22);
}
.agent-attach {
  border: 1px solid var(--line, #e5e7eb);
  background: var(--surface, #fff);
  border-radius: 10px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-3, #8a8f99);
  cursor: pointer;
  flex: none;
}
.agent-attach:hover { border-color: #3370ff; color: #3370ff; }
.agent-batch { padding: 10px 12px; border-top: 1px solid var(--line, #e5e7eb); max-height: 46vh; overflow-y: auto; }
.agent-batch.hidden { display: none; }
.agent-batch-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12.5px; }
.agent-batch-close {
  border: 0;
  background: transparent;
  color: var(--ink-3, #8a8f99);
  font-size: 11.5px;
  cursor: pointer;
}
.agent-batch-hint { margin: 6px 0; font-size: 11px; color: var(--ink-3, #8a8f99); line-height: 1.5; }
.agent-batch-cols {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin-bottom: 6px;
  font-size: 11px;
  color: var(--ink-3, #8a8f99);
}
.agent-batch-input {
  width: 100%;
  min-height: 64px;
  resize: vertical;
  border: 1px solid var(--line, #e5e7eb);
  border-radius: 10px;
  padding: 8px 10px;
  font: inherit;
  font-size: 12.5px;
  color: var(--ink, #111827);
  background: var(--surface, #fff);
  outline: none;
}
.agent-batch-input:focus { border-color: #3370ff; box-shadow: 0 0 0 3px rgba(51, 112, 255, .12); }
.agent-batch-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.agent-batch-row label { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--ink-3, #8a8f99); }
.agent-batch-row input { width: 80px; height: 30px; }
.agent-batch-loading { margin-top: 8px; font-size: 11.5px; color: var(--ink-3, #8a8f99); }
.agent-batch-summary {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: var(--ink-3, #8a8f99);
}
.agent-batch-csv {
  border: 1px solid var(--line, #e5e7eb);
  background: var(--surface, #fff);
  border-radius: 8px;
  padding: 3px 8px;
  font-size: 11px;
  color: var(--ink-2, #4b5563);
  cursor: pointer;
}
.agent-batch-csv:hover { border-color: #3370ff; color: #3370ff; }
.agent-batch-table-wrap {
  margin-top: 6px;
  max-height: 240px;
  overflow: auto;
  border: 1px solid var(--line, #e5e7eb);
  border-radius: 8px;
}
.agent-batch-table { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.agent-batch-table th,
.agent-batch-table td {
  padding: 5px 7px;
  border-bottom: 1px solid var(--line-2, #eef1f5);
  text-align: left;
  vertical-align: top;
}
.agent-batch-table th { background: #f7f8fa; font-weight: 500; color: var(--ink-2, #4b5563); }
.agent-batch-error { color: #b91c1c; }
.agent-batch-job {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed var(--line, #e5e7eb);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.agent-batch-job-title { font-size: 11.5px; font-weight: 500; color: var(--ink-2, #4b5563); }
.agent-batch-job input { width: 100%; height: 32px; }
.agent-batch-job .btn { align-self: flex-start; }
.agent-jobs { padding: 10px 12px; border-top: 1px solid var(--line, #e5e7eb); max-height: 46vh; overflow-y: auto; }
.agent-jobs.hidden { display: none; }
.agent-jobs-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; font-size: 12.5px; }
.agent-job {
  border: 1px solid var(--line, #e5e7eb);
  border-radius: 10px;
  padding: 8px 10px;
  margin-bottom: 8px;
  background: var(--surface, #fff);
}
.agent-job-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.agent-job-head strong {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12.5px;
  color: var(--ink, #111827);
}
.agent-job-status {
  border-radius: 999px;
  padding: 2px 7px;
  font-size: 11px;
  background: #f2f3f5;
  color: var(--ink-3, #8a8f99);
  flex: none;
}
.agent-job-status.running { background: #e8f0ff; color: #3370ff; }
.agent-job-status.queued { background: #fff7e6; color: #b45309; }
.agent-job-status.succeeded { background: #ecfdf5; color: #0f766e; }
.agent-job-status.partial { background: #fff7e6; color: #b45309; }
.agent-job-status.failed { background: #fef2f2; color: #b91c1c; }
.agent-job-status.canceled { background: #f2f3f5; color: var(--ink-3, #8a8f99); }

/* ---------- 在线咨询（项目后台） ---------- */
.consult-btn-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  margin-left: 6px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--red, #f54a45);
  color: #fff;
  font-size: 10px;
  line-height: 1;
}
.consult-body {
  display: grid;
  grid-template-columns: minmax(0, 320px) minmax(0, 1fr);
  gap: 16px;
  min-height: 440px;
}
.consult-list {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding-right: 16px;
  border-right: 1px solid var(--line-2, #f0f1f3);
}
.consult-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.consult-filters { display: flex; gap: 4px; }
.consult-filter {
  position: relative;
  padding: 6px 10px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-3, #86909c);
  font-size: 12.5px;
  cursor: pointer;
}
.consult-filter:hover { background: var(--surface-3, #f2f3f5); color: var(--ink, #1f2329); }
.consult-filter.active { background: var(--blue-soft, #eef4ff); color: var(--blue, #3370ff); font-weight: 600; }
.consult-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 15px;
  height: 15px;
  margin-left: 4px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--red, #f54a45);
  color: #fff;
  font-size: 10px;
  line-height: 1;
}
.consult-items {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 6px;
  max-height: calc(70vh - 160px);
  overflow-y: auto;
  padding-right: 4px;
}
.consult-item {
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--surface-2, #fafbfc);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease;
}
.consult-item:hover { border-color: var(--line, #e5e6eb); background: #fff; }
.consult-item.is-active { border-color: var(--blue, #3370ff); background: var(--blue-tint, #f6f9ff); }
.consult-item-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.consult-item-top strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink, #1f2329);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.consult-item-text {
  display: -webkit-box;
  margin: 6px 0;
  overflow: hidden;
  color: var(--ink-3, #86909c);
  font-size: 12px;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.consult-item-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--ink-4, #a9aeb8);
  font-size: 11px;
}
.consult-status {
  flex: none;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
}
.consult-status.wait { background: var(--amber-soft, #fff4e6); color: #b45309; }
.consult-status.ok { background: var(--green-soft, #e8f8f1); color: #047857; }
.consult-empty-list { padding: 24px 12px; color: var(--ink-3, #86909c); font-size: 12.5px; text-align: center; }
.consult-detail { display: flex; flex-direction: column; min-width: 0; }
.consult-empty {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  min-height: 280px;
  color: var(--ink-3, #86909c);
  font-size: 12.5px;
}
.consult-thread { display: flex; flex: 1; flex-direction: column; min-height: 0; }
.consult-thread-head { padding-bottom: 10px; border-bottom: 1px solid var(--line-2, #f0f1f3); }
.consult-thread-title { display: flex; align-items: center; gap: 8px; }
.consult-thread-title strong { font-size: 14px; }
.consult-thread-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin-top: 6px;
  color: var(--ink-3, #86909c);
  font-size: 11.5px;
}
.consult-thread-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 10px;
  max-height: calc(70vh - 260px);
  overflow-y: auto;
  padding: 14px 2px;
}
.consult-msg { max-width: 86%; padding: 10px 12px; border-radius: 12px; }
.consult-msg.visitor { align-self: flex-start; background: var(--surface-3, #f2f3f5); }
.consult-msg.staff { align-self: flex-end; background: var(--blue-soft, #eef4ff); }
.consult-msg-content { color: var(--ink, #1f2329); font-size: 13px; white-space: pre-wrap; word-break: break-word; }
.consult-msg-meta { margin-top: 6px; color: var(--ink-3, #86909c); font-size: 11px; }
.consult-reply { padding-top: 12px; border-top: 1px solid var(--line-2, #f0f1f3); }
.consult-reply .textarea { width: 100%; min-height: 72px; resize: vertical; }
.consult-reply-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 8px; }
.consult-reply-foot .field-error { flex: 1; min-height: 16px; }

@media (max-width: 860px) {
  .consult-body { grid-template-columns: 1fr; }
  .consult-list { padding-right: 0; border-right: 0; }
  .consult-items { max-height: 32vh; }
  .consult-thread-body { max-height: none; }
}

/* ---------- 站点页面编辑（文案 / 条目 / 图片） ---------- */
.site-pages-body {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 16px;
  min-height: 460px;
}
.site-pages-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 65vh;
  overflow-y: auto;
  padding-right: 14px;
  border-right: 1px solid var(--line-2);
}
.sp-page {
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--surface-2);
  text-align: left;
  cursor: pointer;
}
.sp-page strong { display: block; color: var(--ink); font-size: 13px; }
.sp-page span { color: var(--ink-3); font-size: 11px; }
.sp-page:hover { border-color: var(--line); background: #fff; }
.sp-page.active { border-color: var(--blue); background: var(--blue-tint); }
.sp-page-row { display: flex; align-items: stretch; gap: 4px; }
.sp-page-row.is-child { margin-left: 16px; }
.sp-page-row.is-child .sp-page strong { font-weight: 500; }
.sp-page-branch { margin-right: 3px; color: var(--ink-3); font-weight: 400; }
.sp-page-row .sp-page { flex: 1; min-width: 0; }
.sp-page-acts { display: flex; flex-direction: column; justify-content: center; gap: 2px; }
.sp-page-act {
  width: 22px;
  height: 17px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  color: var(--ink-3);
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
}
.sp-page-act:hover:not(:disabled) { border-color: var(--blue); color: var(--blue); }
.sp-page-act:disabled { opacity: 0.35; cursor: not-allowed; }
.sp-page-act.danger:hover:not(:disabled) { border-color: var(--red); color: var(--red); }
.sp-page-add {
  margin-top: 4px;
  padding: 8px 10px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--ink-3);
  font-size: 12.5px;
  cursor: pointer;
}
.sp-page-add:hover { border-color: var(--blue); color: var(--blue); }
.theme-color-input { height: 36px; padding: 2px; cursor: pointer; }
.site-theme-preview {
  margin-bottom: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.site-theme-preview-inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 18px;
  border: 1px solid rgba(0, 0, 0, 0.06);
}
.site-theme-kicker { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.14em; opacity: 0.7; }
.site-theme-preview-inner strong { font-size: 18px; }
.site-theme-preview-inner p { margin: 0; font-size: 13px; opacity: 0.75; }
.site-theme-preview-btn { border: 0; }
.site-pages-main {
  min-width: 0;
  max-height: 65vh;
  overflow-y: auto;
  padding-right: 4px;
}
.sp-page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
}
.sp-page-head .sp-field { min-width: 240px; }
.sp-page-meta { padding-bottom: 8px; color: var(--ink-3); font-size: 11.5px; }
.sp-note {
  margin: 0 0 12px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--amber-soft);
  color: #b45309;
  font-size: 12px;
}
.sp-sections { display: flex; flex-direction: column; gap: 12px; }
.sp-section {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.sp-section-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.sp-section-head strong { font-size: 13px; }
.sp-kind { color: var(--ink-4); font-family: var(--font-mono); font-size: 10px; }
.sp-module {
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 11px;
}
.sp-section-actions { display: flex; gap: 4px; margin-left: auto; }
.sp-section-actions .btn { height: 26px; padding: 0 8px; }
.sp-add-section { display: flex; justify-content: center; margin-top: 12px; }
.sp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sp-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  color: var(--ink-2);
  font-size: 12px;
}
.sp-field .input, .sp-field .textarea { width: 100%; }
.sp-span2 { grid-column: 1 / -1; }
.sp-image-row { display: flex; gap: 8px; }
.sp-image-row .input { flex: 1; }
.sp-slide-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.sp-slide-item {
  padding: 10px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: var(--surface-2);
}
.sp-slide-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.sp-slide-head strong { color: var(--ink-3); font-size: 12px; }
.sp-link-row { display: flex; gap: 6px; }
.sp-link-row .input { flex: 1; }
.sp-link-tabs { display: flex; gap: 4px; margin-bottom: 10px; }
.sp-link-pages, .sp-link-records {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 320px;
  overflow-y: auto;
}
.sp-link-option {
  padding: 8px 10px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: var(--surface-2);
  text-align: left;
  cursor: pointer;
}
.sp-link-option:hover { border-color: var(--line); background: #fff; }
.sp-link-option strong { display: block; color: var(--ink); font-size: 13px; }
.sp-link-option span { color: var(--ink-4); font-size: 11px; }
.sp-link-external { display: flex; gap: 8px; }
.sp-link-external .input { flex: 1; }
.sp-module-hint { margin: 10px 0 0; color: var(--ink-3); font-size: 12px; }
.sp-items { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); }
.sp-items-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.sp-items-head .ws-hint { margin-left: auto; }
.sp-item {
  margin-bottom: 8px;
  padding: 10px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: var(--surface-2);
}
.sp-item-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.sp-item-head strong { color: var(--ink-3); font-size: 12px; }
.sp-item-actions { display: flex; gap: 4px; }
.sp-item-actions .btn { height: 26px; padding: 0 8px; }

@media (max-width: 860px) {
  .site-pages-body { grid-template-columns: 1fr; }
  .site-pages-nav {
    flex-direction: row;
    flex-wrap: wrap;
    max-height: none;
    padding-right: 0;
    border-right: 0;
  }
  .site-pages-main { max-height: none; }
  .sp-grid { grid-template-columns: 1fr; }
}
.agent-job-meta { margin-top: 5px; font-size: 11px; color: var(--ink-3, #8a8f99); }
.agent-job-bar { height: 5px; border-radius: 3px; background: #eef1f5; overflow: hidden; margin-top: 6px; }
.agent-job-bar span { display: block; height: 100%; background: #3370ff; transition: width .2s ease; }
.agent-job-actions { display: flex; gap: 6px; margin-top: 6px; }
.agent-job-detail-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.agent-job-detail-head strong { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; }
.agent-foot {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--line, #e5e7eb);
}
.agent-input {
  flex: 1;
  min-height: 40px;
  max-height: 120px;
  resize: vertical;
  border: 1px solid var(--line, #e5e7eb);
  border-radius: 10px;
  padding: 9px 10px;
  font: inherit;
  font-size: 13px;
  color: var(--ink, #111827);
  background: var(--surface, #fff);
  outline: none;
}
.agent-input:focus { border-color: #3370ff; box-shadow: 0 0 0 3px rgba(51, 112, 255, .12); }
@media (max-width: 640px) {
  .agent-fab { right: 16px; bottom: 16px; }
  .agent-drawer { width: 100vw; }
}

/* 数据集模块扩展字段状态 */
.record-data-hint {
  margin-bottom: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 12px;
}
.record-data-hint.failed { background: #fef2f2; color: #b91c1c; }
.record-data-hint .btn { margin-left: 10px; }

/* 备案信息编辑：名称 / 号码 / 查询链接 */
.filing-rows { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.filing-row { display: grid; grid-template-columns: 190px 1fr 1fr 32px; gap: 8px; align-items: center; }
.filing-row .input { width: 100%; }
@media (max-width: 720px) {
  .filing-row { grid-template-columns: 1fr; }
}

/* 站点信息：Logo 预览 + 品牌字段 */
.branding-logo { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.branding-logo-preview {
  width: 64px;
  height: 64px;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: linear-gradient(135deg, #3370ff, #6f4bff);
  background-size: cover;
  background-position: center;
  color: #fff;
  font-size: 24px;
  font-weight: 700;
}
.branding-logo-actions { min-width: 0; }
.branding-logo-actions .field-hint { margin: 6px 0 0; }
.branding-form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.branding-form label { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--ink-2, #4b5563); }
.branding-form .branding-full { grid-column: 1 / -1; }
.branding-form .input { width: 100%; }
@media (max-width: 640px) {
  .branding-form { grid-template-columns: 1fr; }
}

/* ---------- 论坛板块管理 ---------- */
.bbs-admin-settings {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
}
.bbs-admin-settings .sp-field { min-width: 130px; }
.bbs-admin-check { display: flex; flex-direction: row; align-items: center; gap: 6px; }
.bbs-admin-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 40vh;
  margin: 10px 0 16px;
  overflow-y: auto;
}
.bbs-admin-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: #fff;
}
.bbs-admin-main strong { color: var(--ink); font-size: 13px; }
.bbs-admin-main span { margin-left: 8px; color: var(--ink-3); font-size: 11.5px; }
.bbs-admin-main p { margin: 4px 0 0; color: var(--ink-3); font-size: 11.5px; }
.bbs-admin-actions { display: flex; flex: none; gap: 4px; }
.bbs-admin-form { padding: 12px; border: 1px dashed var(--line); border-radius: 10px; }
.bbs-admin-form > strong { display: block; margin-bottom: 8px; font-size: 13px; }
.bbs-admin-form-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.bbs-members-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 10px; }
.bbs-members-toolbar .input { flex: 1 1 200px; min-width: 160px; }
.bbs-members-toolbar .ws-hint { margin: 0; }
/* 系统用户：外部程序 API 令牌 */
.api-token-toolbar { display: flex; gap: 8px; margin-bottom: 8px; }
.api-token-toolbar .input { flex: 1 1 auto; min-width: 0; }
.api-token-list { margin-top: 12px; max-height: 46vh; overflow-y: auto; }
.api-token-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: #fff;
}
.api-token-row + .api-token-row { margin-top: 8px; }
.api-token-main { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.api-token-main strong { font-size: 12.5px; }
.api-token-main code {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-2);
  background: var(--surface-2);
  padding: 4px 6px;
  border-radius: 6px;
  word-break: break-all;
}
