/* MCP Hub - 浅色主题 */
/* 确保 hidden 属性始终生效：类选择器中的 display 会覆盖浏览器默认规则 */
[hidden] { display: none !important; }

:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #fafbff;
  --ink: #1a2235;
  --ink-2: #5b647a;
  --muted: #8b93a7;
  --line: #e8ebf2;
  --primary: #4f46e5;
  --primary-2: #6366f1;
  --primary-soft: #eef2ff;
  --danger: #e0483d;
  --danger-soft: #fef0ef;
  --ok: #16a34a;
  --shadow-sm: 0 1px 2px rgba(20, 28, 55, .05), 0 1px 3px rgba(20, 28, 55, .04);
  --shadow-md: 0 8px 24px rgba(20, 28, 55, .09);
  --shadow-lg: 0 24px 60px rgba(20, 28, 55, .20);
  --radius: 14px;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Roboto, sans-serif;
  font-size: 14px; line-height: 1.6; -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font-family: inherit; font-size: inherit; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 24px; }
.icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- 顶部导航 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40; background: rgba(255,255,255,.88);
  backdrop-filter: saturate(180%) blur(14px); border-bottom: 1px solid var(--line);
}
.topbar-inner { height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--primary), #7c3aed); color: #fff; font-weight: 800; font-size: 17px;
  box-shadow: 0 4px 12px rgba(79,70,229,.35);
}
.brand-name { font-size: 17px; font-weight: 600; letter-spacing: -.3px; }
.brand-name b { color: var(--primary); }
.brand-tag { font-size: 12px; color: var(--muted); border-left: 1px solid var(--line); padding-left: 10px; margin-left: 2px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.search-wrap { position: relative; }
.search-wrap .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 17px; height: 17px; }
.search-wrap input {
  width: 280px; height: 38px; padding: 0 12px 0 38px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--surface-2); color: var(--ink); outline: none; transition: .2s;
}
.search-wrap input:focus { background: #fff; border-color: var(--primary-2); box-shadow: 0 0 0 3px rgba(99,102,241,.12); }
.admin-chip {
  display: flex; align-items: center; gap: 7px; height: 34px; padding: 0 8px 0 12px;
  background: #eafaf0; color: #177245; border-radius: 999px; font-size: 13px; font-weight: 500;
}
.admin-chip .dot { width: 7px; height: 7px; border-radius: 50%; background: #22c55e; }
.chip-x { border: 0; background: transparent; color: #177245; cursor: pointer; font-size: 18px; line-height: 1; padding: 0 2px; opacity: .6; }
.chip-x:hover { opacity: 1; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; padding: 0 16px; border-radius: 10px; border: 1px solid transparent;
  font-weight: 600; font-size: 13px; cursor: pointer; transition: .18s; white-space: nowrap;
}
.btn .icon { width: 16px; height: 16px; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 3px 10px rgba(79,70,229,.25); }
.btn-primary:hover { background: #4338ca; transform: translateY(-1px); }
.btn-outline { background: #fff; border-color: var(--line); color: var(--ink); }
.btn-outline:hover { border-color: var(--primary-2); color: var(--primary); }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #c9372d; }
.btn-sm { height: 34px; padding: 0 12px; font-size: 12px; }

/* ---------- 英雄区 ---------- */
.hero {
  display: grid; grid-template-columns: 1fr 340px; gap: 40px; align-items: center;
  padding: 56px 0 34px;
}
.eyebrow { display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: 1.4px; text-transform: uppercase; color: var(--primary); margin-bottom: 14px; }
.hero h1 { margin: 0 0 12px; font-size: clamp(30px, 4vw, 44px); line-height: 1.2; letter-spacing: -1.2px; font-weight: 800; }
.grad { background: linear-gradient(100deg, #4f46e5, #7c3aed 55%, #db2777); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-copy p { margin: 0 0 24px; color: var(--ink-2); font-size: 16px; max-width: 560px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-art { position: relative; height: 240px; display: grid; place-items: center; }
.orbit { position: absolute; border: 1px dashed #d8dbea; border-radius: 50%; }
.o1 { width: 210px; height: 210px; }
.o2 { width: 140px; height: 140px; border-color: #e4e0fb; }
.core {
  width: 76px; height: 76px; border-radius: 22px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--primary), #7c3aed); color: #fff; font-weight: 800; font-size: 20px;
  box-shadow: 0 12px 30px rgba(79,70,229,.35);
}
.node { position: absolute; width: 42px; height: 42px; border-radius: 12px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-md); display: grid; place-items: center; font-size: 19px; }
.n1 { top: 8px; left: 50%; transform: translateX(-50%); }
.n2 { top: 50%; right: 4px; transform: translateY(-50%); }
.n3 { bottom: 10px; left: 50%; transform: translateX(-50%); }
.n4 { top: 50%; left: 4px; transform: translateY(-50%); }

/* ---------- 统计 ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 42px; }
.stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; box-shadow: var(--shadow-sm); display: flex; align-items: center; gap: 14px;
}
.stat-ico { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; font-size: 19px; }
.stat-val { font-size: 24px; font-weight: 800; letter-spacing: -.5px; line-height: 1.1; }
.stat-label { color: var(--muted); font-size: 12px; margin-top: 2px; }
.si-1 { background: #eef2ff; color: #4f46e5; }
.si-2 { background: #ecfeff; color: #0891b2; }
.si-3 { background: #fef3c7; color: #d97706; }
.si-4 { background: #dcfce7; color: #16a34a; }

/* ---------- 工具库 ---------- */
.section { padding-bottom: 50px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.section-head h2 { margin: 0; font-size: 22px; letter-spacing: -.4px; }
.sub { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.head-controls { display: flex; gap: 10px; align-items: center; }
.select { height: 34px; padding: 0 30px 0 12px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink); cursor: pointer; outline: none; }
.select:focus { border-color: var(--primary-2); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.chip {
  padding: 6px 13px; border-radius: 999px; border: 1px solid var(--line); background: #fff;
  color: var(--ink-2); font-size: 12.5px; cursor: pointer; transition: .16s; white-space: nowrap;
}
.chip:hover { border-color: var(--primary-2); color: var(--primary); }
.chip.active { background: var(--primary); color: #fff; border-color: var(--primary); box-shadow: 0 3px 8px rgba(79,70,229,.25); }
.chip .cnt { opacity: .6; margin-left: 4px; font-size: 11px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(285px, 1fr)); gap: 16px; }
.card {
  position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow-sm); cursor: pointer; transition: .2s; display: flex; flex-direction: column; min-height: 208px;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: #d5d9ea; }
.card-top { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.card-ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 22px; flex-shrink: 0; }
.card-title { font-size: 15px; font-weight: 700; margin: 1px 0 3px; letter-spacing: -.2px; }
.card-meta { font-size: 11.5px; color: var(--muted); }
.star { margin-left: auto; color: #f59e0b; font-size: 14px; }
.card-desc { color: var(--ink-2); font-size: 13px; line-height: 1.6; margin: 0 0 14px; flex: 1; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.tag { font-size: 11px; padding: 3px 8px; border-radius: 6px; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); }
.tag.cat { background: var(--primary-soft); color: var(--primary); border-color: transparent; font-weight: 600; }
.card-foot { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 12px; font-size: 12px; color: var(--muted); }
.card-foot .dl { display: flex; align-items: center; gap: 5px; }
.card-foot .ver { font-family: var(--mono); font-size: 11px; background: #f1f3f9; padding: 2px 7px; border-radius: 5px; color: var(--ink-2); }
.empty { text-align: center; padding: 70px 20px; color: var(--muted); }
.empty-icon { font-size: 42px; margin-bottom: 10px; }
.empty h3 { color: var(--ink); margin: 0 0 6px; }
.empty p { margin: 0 0 18px; }
.footer { display: flex; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); padding: 22px 0 34px; color: var(--muted); font-size: 12px; }
.footer code { font-family: var(--mono); background: #eef0f6; padding: 1px 5px; border-radius: 4px; }

/* ---------- 弹窗 ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(16,22,42,.5); backdrop-filter: blur(3px); animation: fade .18s ease; }
.modal-panel {
  position: relative; width: 100%; max-width: 620px; max-height: 90vh; overflow: auto;
  background: #fff; border-radius: 18px; box-shadow: var(--shadow-lg); padding: 28px;
  animation: pop .22s cubic-bezier(.2,.9,.3,1.2);
}
.modal-lg { max-width: 820px; }
.modal-sm { max-width: 430px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.98); } }
.modal-close { position: absolute; top: 16px; right: 18px; width: 30px; height: 30px; border: 0; border-radius: 8px; background: var(--surface-2); color: var(--muted); font-size: 21px; line-height: 1; cursor: pointer; z-index: 2; }
.modal-close:hover { background: #eef0f6; color: var(--ink); }
.modal-title { margin: 0 0 6px; font-size: 20px; }
.modal-desc { margin: 0 0 20px; color: var(--ink-2); font-size: 13px; }

/* ---------- 详情 ---------- */
.d-head { display: flex; gap: 16px; padding-right: 36px; margin-bottom: 22px; }
.d-ico { width: 60px; height: 60px; border-radius: 15px; display: grid; place-items: center; font-size: 30px; flex-shrink: 0; }
.d-title { font-size: 22px; font-weight: 800; margin: 0 0 6px; letter-spacing: -.4px; }
.d-sub { color: var(--muted); font-size: 12.5px; display: flex; flex-wrap: wrap; gap: 12px; }
.d-sub a { color: var(--primary); }
.d-actions { margin-left: auto; display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
.d-section { margin-top: 24px; }
.d-section h3 { font-size: 14px; margin: 0 0 10px; display: flex; align-items: center; gap: 8px; }
.d-section h3 .bar { width: 3px; height: 15px; border-radius: 2px; background: var(--primary); }
.d-desc { color: var(--ink-2); margin: 0; }
.code-box { position: relative; background: #1e2436; color: #e6e9f5; border-radius: 11px; padding: 14px 16px; overflow: auto; font-family: var(--mono); font-size: 12.5px; line-height: 1.65; }
.code-box pre { margin: 0; white-space: pre-wrap; word-break: break-word; }
.copy-btn { position: absolute; top: 9px; right: 9px; background: rgba(255,255,255,.1); border: 0; color: #cbd2e8; border-radius: 6px; padding: 4px 9px; font-size: 11px; cursor: pointer; }
.copy-btn:hover { background: rgba(255,255,255,.2); color: #fff; }
.md h4 { font-size: 13.5px; margin: 16px 0 6px; color: var(--ink); }
.md p { margin: 6px 0; color: var(--ink-2); }
.md ul { margin: 6px 0; padding-left: 20px; color: var(--ink-2); }
.md code { font-family: var(--mono); font-size: 12px; background: #eef0f6; color: #b83280; padding: 1px 5px; border-radius: 4px; }
.md .code-box code { background: transparent; color: inherit; padding: 0; }
.md a { color: var(--primary); }
.ver-list { border: 1px solid var(--line); border-radius: 11px; overflow: hidden; }
.ver-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.ver-row:last-child { border-bottom: 0; }
.ver-badge { font-family: var(--mono); font-size: 11.5px; font-weight: 700; color: var(--primary); background: var(--primary-soft); padding: 3px 9px; border-radius: 6px; flex-shrink: 0; }
.ver-info { flex: 1; min-width: 0; }
.ver-note { font-size: 12.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ver-date { font-size: 11px; color: var(--muted); }
.ver-row .btn { flex-shrink: 0; }
.icon-btn { border: 1px solid var(--line); background: #fff; color: var(--muted); width: 32px; height: 32px; border-radius: 8px; cursor: pointer; font-size: 16px; display: grid; place-items: center; }
.icon-btn:hover { color: var(--danger); border-color: #f3b6b1; background: var(--danger-soft); }

/* ---------- 表单 ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.span-2 { grid-column: span 2; }
.field input, .field textarea, .field select {
  width: 100%; border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px;
  background: var(--surface-2); color: var(--ink); outline: none; transition: .18s; resize: vertical;
}
.field input:focus, .field textarea:focus { border-color: var(--primary-2); background: #fff; box-shadow: 0 0 0 3px rgba(99,102,241,.11); }
.field input::placeholder, .field textarea::placeholder { color: #b3b9c8; }
.file-input { padding: 8px !important; font-size: 12px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--primary); }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.hint { font-size: 12px; color: var(--muted); margin: -6px 0 0; }
.hint code { font-family: var(--mono); background: #eef0f6; padding: 1px 5px; border-radius: 4px; }

/* ---------- Toast ---------- */
.toast-stack { position: fixed; top: 76px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast {
  min-width: 220px; max-width: 360px; padding: 12px 16px; border-radius: 11px; background: #fff;
  border: 1px solid var(--line); box-shadow: var(--shadow-md); font-size: 13px; display: flex; align-items: center; gap: 9px;
  animation: slidein .24s cubic-bezier(.2,.9,.3,1.2);
}
.toast.ok { border-left: 3px solid var(--ok); }
.toast.err { border-left: 3px solid var(--danger); }
.toast .t-ico { font-size: 16px; }
@keyframes slidein { from { opacity: 0; transform: translateX(24px); } }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding-top: 36px; }
  .hero-art { display: none; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .brand-tag { display: none; }
  .search-wrap input { width: 180px; }
}
@media (max-width: 700px) {
  /* 顶栏窄屏：导航移到第二行占满宽度，仍在顶栏内 */
  .topbar-inner { flex-wrap: wrap; height: auto; padding: 9px 0 8px; gap: 8px; }
  .module-nav { order: 3; width: 100%; margin: 0; }
  .module-tab { flex: 1; }
  .brand-tag { display: none; }
}
@media (max-width: 560px) {
  .wrap { padding: 0 16px; }
  .topbar-inner { gap: 8px; }
  .search-wrap input { width: 130px; }
  .btn-ghost { display: none; }
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat { padding: 14px; }
  .stat-val { font-size: 20px; }
  .form-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: span 1; }
  .section-head { flex-direction: column; align-items: stretch; }
  .head-controls { justify-content: space-between; }
  .d-actions { flex-direction: row; }
  .modal-panel { padding: 22px 18px; }
}

/* ---------- 用户菜单 / 登录注册 ---------- */
.auth-area { display: flex; align-items: center; }
.user-menu { position: relative; }
.user-trigger { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; color: var(--ink); transition: .16s; }
.user-trigger:hover { border-color: var(--primary-2); box-shadow: var(--shadow-sm); }
.avatar { width: 26px; height: 26px; border-radius: 8px; background: linear-gradient(135deg, var(--primary), #7c3aed); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.avatar.lg { width: 40px; height: 40px; border-radius: 11px; font-size: 17px; }
.user-name { font-size: 13px; font-weight: 600; max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.role-badge { font-size: 10.5px; padding: 2px 7px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-weight: 600; }
.role-badge.admin { background: #eef2ff; color: var(--primary); }
.caret { color: var(--muted); font-size: 11px; }
.user-dropdown { position: absolute; top: 44px; right: 0; width: 220px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-md); padding: 6px; z-index: 50; animation: pop .18s ease; }
.user-dropdown[hidden] { display: none; }
.dropdown-head { display: flex; align-items: center; gap: 10px; padding: 8px 8px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.dropdown-name { font-weight: 700; font-size: 13.5px; }
.dropdown-email { color: var(--muted); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; max-width: 140px; }
.dropdown-item { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: 9px 10px; border-radius: 8px; font-size: 13px; cursor: pointer; color: var(--ink-2); }
.dropdown-item:hover { background: var(--surface-2); color: var(--ink); }
.dropdown-item.danger:hover { background: var(--danger-soft); color: var(--danger); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: -4px 0 20px; }
.tab { border: 0; background: transparent; padding: 10px 14px; font-size: 13.5px; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: .16s; }
.tab:hover { color: var(--ink); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-pane[hidden] { display: none; }
.optional { font-style: normal; font-weight: 400; color: var(--muted); font-size: 11px; }
.btn-block { width: 100%; }
.form #loginForm .field, .form #registerForm .field { margin-bottom: 0; }

.user-list { display: flex; flex-direction: column; gap: 8px; max-height: 55vh; overflow: auto; }
.user-row { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.user-row-main { flex: 1; min-width: 0; }
.user-row-name { font-weight: 600; font-size: 13.5px; }
.user-row-meta { color: var(--muted); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-row .select { height: 30px; padding: 0 6px; font-size: 12px; }
.user-row .icon-btn:hover { color: var(--danger); }
@media (max-width: 560px) {
  .user-name, .role-badge .caret { display: none; }
  .user-name { max-width: 60px; }
  .topbar-right { gap: 6px; }
}

/* ================= 模块导航 / Skills Hub / API Hub / Link flow ================= */
/* 模块导航：置于顶栏，位于品牌与搜索/用户之间 */
.module-nav { display: flex; gap: 3px; padding: 4px; margin: 0 auto; background: var(--surface-2); border: 1px solid var(--line); border-radius: 11px; flex-shrink: 0; }
.module-tab { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 13px; border: 0; background: transparent; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--ink-2); cursor: pointer; transition: .16s; white-space: nowrap; }
.module-tab span { font-size: 15px; }
.module-tab:hover { background: var(--surface); color: var(--ink); }
.module-tab.active { background: var(--primary); color: #fff; box-shadow: 0 2px 8px rgba(79,70,229,.25); }
.module-view[hidden] { display: none; }
.hero-compact { min-height: 200px; }
.hero-compact .core { font-size: 20px; }

.subnav { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.subnav-tab { border: 0; background: transparent; padding: 12px 18px; font-size: 14px; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: .16s; }
.subnav-tab:hover { color: var(--ink); }
.subnav-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.subview[hidden] { display: none; }
.flow-tip { color: var(--ink-2); font-size: 13px; background: var(--primary-soft); border: 1px solid #dfe3ff; padding: 10px 14px; border-radius: 10px; margin-bottom: 18px; }

/* 卡片里的 HTTP method 徽标 */
.method-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 46px; height: 22px; padding: 0 7px; border-radius: 6px; font-size: 10.5px; font-weight: 800; letter-spacing: .4px; }
.method-GET { background: #e7f6ef; color: #15803d; }
.method-POST { background: #eef2ff; color: #4338ca; }
.method-PUT { background: #fff5e6; color: #b45309; }
.method-PATCH { background: #f3e8ff; color: #7e22ce; }
.method-DELETE { background: #fef0ef; color: #c62828; }
.api-path { font-family: var(--mono); font-size: 12px; color: var(--ink-2); background: var(--surface-2); padding: 4px 8px; border-radius: 6px; display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.d-endpoint { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--surface-2); padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line); }

/* 流程卡片 */
.flow-card { position: relative; }
.flow-card .flow-mini { height: 76px; display: flex; align-items: center; gap: 6px; padding: 12px 16px; overflow: hidden; }
.flow-mini-node { flex-shrink: 0; padding: 8px 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; font-size: 11px; font-weight: 600; color: var(--ink-2); max-width: 96px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flow-mini-arrow { color: var(--primary-2); font-weight: 700; flex-shrink: 0; }
.flow-node-count { font-size: 11.5px; color: var(--muted); }

/* 流程编排画布 */
.modal-xl { max-width: 1200px; width: calc(100% - 40px); }
.flow-editor-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding-right: 34px; margin-bottom: 16px; }
.flow-editor-actions { display: flex; gap: 8px; flex-shrink: 0; }
.flow-workspace { display: grid; grid-template-columns: 200px 1fr 240px; gap: 12px; height: 520px; }
.flow-palette, .flow-inspector { border: 1px solid var(--line); border-radius: 12px; padding: 12px; overflow: auto; background: var(--surface-2); }
.flow-palette h4, .flow-inspector h4 { font-size: 13px; margin: 0 0 2px; color: var(--ink); }
.flow-palette .hint, .flow-inspector .hint { font-size: 11px; margin: 0 0 10px; color: var(--muted); }
.palette-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; margin-bottom: 6px; cursor: pointer; font-size: 12px; transition: .14s; }
.palette-item:hover { border-color: var(--primary-2); background: var(--primary-soft); }
.palette-item .method-badge { min-width: 40px; height: 18px; font-size: 9px; }
.flow-canvas-wrap { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; background: #fbfbfe; }
.flow-toolbar { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--line); background: var(--surface); }
.flow-hint { font-size: 11px; color: var(--muted); margin-left: auto; }
.flow-canvas { position: relative; flex: 1; overflow: auto; background-image: radial-gradient(#dfe3f0 1px, transparent 1px); background-size: 18px 18px; min-height: 0; }
.flow-edges { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.flow-node { position: absolute; width: 172px; min-height: 66px; background: var(--surface); border: 2px solid var(--line); border-radius: 10px; padding: 9px 11px; cursor: grab; box-shadow: var(--shadow-sm); user-select: none; transition: border-color .14s, box-shadow .14s; }
.flow-node:hover { border-color: var(--primary-2); }
.flow-node.selected { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.flow-node.link-source { border-color: #16a34a; box-shadow: 0 0 0 3px rgba(22,163,74,.14); }
.flow-node-title { font-size: 12.5px; font-weight: 700; color: var(--ink); display: flex; align-items: center; gap: 6px; }
.flow-node .api-path { font-size: 10.5px; margin-top: 5px; padding: 2px 6px; max-width: 148px; }
.flow-node-del { position: absolute; top: -8px; right: -8px; width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--danger); font-size: 13px; line-height: 1; cursor: pointer; display: none; align-items: center; justify-content: center; box-shadow: var(--shadow-sm); }
.flow-node:hover .flow-node-del { display: flex; }
.flow-node-add { position: absolute; top: -9px; right: 14px; padding: 2px 7px; border-radius: 999px; border: 1px solid var(--primary-2); background: var(--primary); color: #fff; font-size: 10px; font-weight: 700; line-height: 1.3; cursor: pointer; display: none; align-items: center; gap: 3px; box-shadow: var(--shadow-sm); }
.flow-node.selected .flow-node-add { display: inline-flex; }
.flow-node-add:hover { filter: brightness(1.08); }
.flow-node-add[disabled] { display: none; }
.flow-inspector .field { margin-bottom: 10px; }
.flow-inspector .field span { font-size: 11.5px; }
.flow-inspector input, .flow-inspector textarea, .flow-inspector select { font-size: 12px; padding: 6px 8px; height: auto; }
.flow-inspector textarea { min-height: 56px; }
.flow-editor-foot { display: flex; align-items: center; gap: 10px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.flow-editor-foot .flow-summary { font-size: 12px; color: var(--muted); margin-right: auto; }
.flow-empty-canvas { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 13px; pointer-events: none; }

@media (max-width: 1000px) {
  .flow-workspace { grid-template-columns: 1fr; height: auto; }
  .flow-palette, .flow-inspector { max-height: 180px; }
  .flow-canvas { height: 380px; }
  .module-tab { font-size: 12px; padding: 8px 9px; }
  .module-tab span { display: none; }
}

/* ================= API 项目归属 / 全屏编排 / 画布缩放 / 数据转换 ================= */
.project-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.project-chip { display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); font-size: 12.5px; font-weight: 600; color: var(--ink-2); cursor: pointer; transition: .15s; }
.project-chip:hover { border-color: var(--primary-2); color: var(--ink); }
.project-chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.project-chip .cnt { font-size: 10.5px; padding: 1px 6px; border-radius: 999px; background: rgba(0,0,0,.06); }
.project-chip.active .cnt { background: rgba(255,255,255,.22); }
.card-project { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: var(--primary); background: var(--primary-soft); padding: 2px 8px; border-radius: 6px; font-weight: 600; }

/* 全屏编排工作区 */
.flow-fullscreen { position: fixed; inset: 0; z-index: 90; background: var(--bg); display: flex; flex-direction: column; }
.flow-fullscreen[hidden] { display: none; }
.flow-fs-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 12px 20px; background: var(--surface); border-bottom: 1px solid var(--line); flex-shrink: 0; }
.flow-fs-title { display: flex; align-items: center; gap: 16px; min-width: 0; }
.flow-fs-title h2 { margin: 0; font-size: 18px; }
.flow-fs-title p { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.flow-fs-back { border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-2); padding: 8px 14px; border-radius: 9px; font-size: 13px; font-weight: 600; cursor: pointer; transition: .15s; flex-shrink: 0; }
.flow-fs-back:hover { border-color: var(--primary-2); color: var(--primary); }
.flow-fullscreen .flow-workspace { display: grid; grid-template-columns: 230px 1fr 300px; gap: 12px; flex: 1; min-height: 0; height: auto; padding: 12px; }
.flow-palette-head { position: sticky; top: 0; background: var(--surface-2); padding-bottom: 10px; margin-bottom: 8px; border-bottom: 1px solid var(--line); z-index: 1; }
.flow-palette-head h4 { font-size: 13px; margin: 0 0 8px; color: var(--ink); }
.flow-palette-head .select, .flow-palette-head .input { width: 100%; height: 32px; font-size: 12px; margin-bottom: 6px; }
.flow-palette .hint { font-size: 10.5px; margin: 2px 0 0; color: var(--muted); }
.palette-group { margin-bottom: 12px; }
.palette-group-title { font-size: 11px; font-weight: 700; color: var(--muted); padding: 4px 6px; letter-spacing: .3px; }

/* 画布视口 + 可变换舞台 */
.flow-canvas-wrap { min-width: 0; }
.flow-canvas { overflow: hidden; cursor: grab; touch-action: none; }
.flow-canvas.panning { cursor: grabbing; }
.flow-stage { position: absolute; top: 0; left: 0; width: 5000px; height: 4000px; transform-origin: 0 0; background-image: radial-gradient(#dfe3f0 1px, transparent 1px); background-size: 18px 18px; }
.flow-stage .flow-edges { position: absolute; inset: 0; width: 100%; height: 100%; }
.flow-toolbar-sep { width: 1px; height: 20px; background: var(--line); margin: 0 2px; }
.zoom-level { min-width: 46px; text-align: center; font-size: 12px; font-weight: 700; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.flow-node { touch-action: none; }
.flow-edge-hit { stroke: transparent; stroke-width: 16; fill: none; pointer-events: stroke; cursor: pointer; }
.flow-edge-line { pointer-events: none; }
.flow-edge-line.selected { stroke: #4338ca; stroke-width: 3.5; }
.flow-fullscreen .flow-editor-foot { flex-shrink: 0; }

/* Inspector 双标签 + 数据转换编辑器 */
.flow-inspector-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.ins-tab { border: 0; background: transparent; padding: 7px 6px; font-size: 11px; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.ins-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.ins-pane[hidden] { display: none; }
.tf-mode-tabs { display: flex; gap: 4px; margin-bottom: 12px; background: var(--surface); padding: 3px; border-radius: 9px; border: 1px solid var(--line); }
.tf-mode-tab { flex: 1; border: 0; background: transparent; padding: 7px 4px; border-radius: 6px; font-size: 11.5px; font-weight: 600; color: var(--muted); cursor: pointer; }
.tf-mode-tab.active { background: var(--primary); color: #fff; }
.tf-scope { font-size: 11px; color: var(--muted); margin: 0 0 10px; line-height: 1.5; }
.tf-map-row { display: flex; align-items: center; gap: 5px; margin-bottom: 6px; }
.tf-map-row input { flex: 1; min-width: 0; height: 30px; font-size: 11.5px; padding: 4px 7px; }
.tf-map-row .tf-arrow { color: var(--muted); font-size: 13px; flex-shrink: 0; }
.tf-map-row .tf-del { border: 0; background: transparent; color: var(--danger); cursor: pointer; font-size: 15px; padding: 0 3px; flex-shrink: 0; }
.tf-add { width: 100%; margin: 4px 0 10px; }
.tf-code { width: 100%; min-height: 190px; font-family: var(--mono); font-size: 11.5px; line-height: 1.6; padding: 10px; border: 1px solid var(--line); border-radius: 9px; background: #fbfbfe; color: var(--ink); resize: vertical; }
.tf-code:focus { outline: none; border-color: var(--primary-2); box-shadow: 0 0 0 3px var(--primary-soft); }
.tf-actions { display: flex; gap: 8px; margin-top: 10px; }
.tf-actions .btn { flex: 1; }
.tf-status { font-size: 10.5px; margin-top: 8px; min-height: 14px; }
.tf-status.ok { color: #15803d; }
.tf-status.err { color: var(--danger); }
.tf-tip { font-size: 10.5px; color: var(--muted); line-height: 1.5; margin: 6px 0 0; }

/* ============ 字段定义树 / 字段映射 / 返回格式 ============ */
.schema-tree { max-height: 340px; overflow: auto; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); padding: 6px; }
.schema-field { display: flex; align-items: center; gap: 5px; min-height: 24px; padding: 2px 3px; border-radius: 5px; font-size: 11px; }
.schema-field:hover { background: var(--primary-soft); }
.schema-field.picked { background: var(--primary-soft); box-shadow: inset 2px 0 0 var(--primary); }
.schema-indent { flex-shrink: 0; }
.schema-type { flex-shrink: 0; font-size: 9px; font-weight: 700; padding: 1px 4px; border-radius: 4px; background: #eef2ff; color: #4338ca; font-family: var(--mono); }
.schema-type.t-object { background: #f1f5f9; color: #475569; }
.schema-type.t-array { background: #ecfeff; color: #0e7490; }
.schema-type.t-number, .schema-type.t-integer { background: #fef3c7; color: #b45309; }
.schema-type.t-boolean { background: #fce7f3; color: #be185d; }
.schema-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); font-family: var(--mono); }
.schema-req { flex-shrink: 0; font-size: 9px; color: var(--danger); }
.schema-pick { flex-shrink: 0; width: 18px; height: 18px; line-height: 1; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); color: var(--primary); font-size: 12px; cursor: pointer; }
.schema-pick:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

.out-toolbar { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.out-toolbar .btn { flex: 0 0 auto; }
.out-count { margin-left: auto; font-size: 10.5px; color: var(--muted); }
.out-list { max-height: 300px; overflow: auto; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); padding: 6px; margin-bottom: 10px; }
.out-row { display: flex; align-items: center; gap: 5px; padding: 3px 2px; border-radius: 5px; }
.out-row:hover { background: var(--primary-soft); }
.out-row input[type=checkbox] { width: 14px; height: 14px; flex-shrink: 0; accent-color: var(--primary); }
.out-path { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10.5px; font-family: var(--mono); color: var(--ink-2); }
.out-alias { width: 66px; flex-shrink: 0; height: 24px; padding: 2px 5px; font-size: 10.5px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface-2); }

.map-pick-edge { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.map-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.map-col { min-width: 0; }
.map-col-head { font-size: 10.5px; font-weight: 700; color: var(--ink-2); margin: 0 0 5px; display: flex; align-items: center; gap: 6px; }
.map-col-head .cnt { font-size: 9px; padding: 1px 5px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); }
.map-tree { max-height: 230px; }
.map-tree .schema-name { font-size: 9.5px; }
.map-pick-bar { display: flex; align-items: center; gap: 5px; margin: 10px 0; padding: 7px; border: 1px dashed var(--primary-2); border-radius: 9px; background: var(--primary-soft); }
.map-pick-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; font-family: var(--mono); color: var(--ink-2); }
.map-pick-bar .btn { flex-shrink: 0; padding: 5px 8px; font-size: 11px; }
.map-existing { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.map-row { display: flex; align-items: center; gap: 5px; margin-bottom: 6px; }
.map-row input { flex: 1; min-width: 0; height: 28px; font-size: 10.5px; padding: 3px 6px; font-family: var(--mono); }

/* 添加下级节点：API 搜索选择器 */
.child-picker { margin-top: -8px; }
.child-picker > .input { width: 100%; height: 36px; font-size: 12px; margin-bottom: 8px; }
.child-api-list { max-height: 380px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); padding: 8px; }
.child-group-title { font-size: 11px; font-weight: 700; color: var(--muted); padding: 6px 6px 4px; }
.child-api-item { display: flex; align-items: center; gap: 9px; padding: 9px 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; margin-bottom: 6px; cursor: pointer; transition: .14s; }
.child-api-item:hover { border-color: var(--primary-2); background: var(--primary-soft); }
.child-api-item .method-badge { min-width: 40px; height: 18px; font-size: 9px; }
.child-api-item .ci-main { flex: 1; min-width: 0; }
.child-api-item .ci-name { font-size: 12.5px; font-weight: 600; color: var(--ink); }
.child-api-item .ci-path { font-size: 10px; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.child-api-item .ci-go { color: var(--primary); font-size: 12px; flex-shrink: 0; }
.child-api-item.is-current { opacity: .62; }

/* 流程触发器设置 */
.trigger-type-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 2px 0 14px; }
.trigger-type { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 12px 6px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); cursor: pointer; text-align: center; transition: .14s; }
.trigger-type:hover { border-color: var(--primary-2); }
.trigger-type input { position: absolute; opacity: 0; pointer-events: none; }
.trigger-type:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 1px var(--primary) inset; }
.trigger-type .tt-ico { font-size: 20px; line-height: 1.2; }
.trigger-type .tt-name { font-size: 12px; font-weight: 700; color: var(--ink); }
.trigger-type .tt-desc { font-size: 9.5px; color: var(--muted); line-height: 1.35; }
.trigger-common { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); margin-bottom: 12px; }
.switch-line { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink); cursor: pointer; margin-bottom: 9px; }
.switch-line input { width: 15px; height: 15px; accent-color: var(--primary); }
.trigger-params { border: 1px solid var(--line); border-radius: 10px; padding: 14px; background: var(--surface); }
.trigger-params-head { font-size: 13px; font-weight: 700; color: var(--ink); margin: 0 0 12px; padding-bottom: 9px; border-bottom: 1px solid var(--line); }
.trigger-params .field { margin-bottom: 10px; }
.trigger-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.inline-fields { display: flex; gap: 6px; }
.inline-fields input { flex: 1; min-width: 0; }
.inline-fields .select, .inline-fields select { flex: 0 0 92px; }
.cron-presets { display: flex; flex-wrap: wrap; gap: 6px; margin: -3px 0 10px; }
.chip { border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-2); border-radius: 999px; padding: 4px 9px; font-size: 10.5px; cursor: pointer; transition: .14s; }
.chip:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.webhook-url-box { display: flex; align-items: center; gap: 8px; padding: 9px 10px; background: var(--surface-2); border: 1px dashed var(--primary-2); border-radius: 8px; margin-bottom: 12px; }
.webhook-url-box > span { font-size: 11px; font-weight: 600; color: var(--muted); flex-shrink: 0; }
.webhook-url-box code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--mono); font-size: 11px; color: var(--primary); }
.trigger-events { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
.te-head { display: flex; align-items: center; justify-content: space-between; font-size: 11.5px; color: var(--ink-2); margin-bottom: 7px; }
.te-list { max-height: 130px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); }
.te-item { display: flex; gap: 8px; align-items: center; padding: 6px 9px; border-bottom: 1px solid var(--line); font-size: 10.5px; }
.te-item:last-child { border-bottom: 0; }
.te-item .te-time { color: var(--muted); font-family: var(--mono); flex-shrink: 0; }
.te-item .te-method { font-weight: 700; color: var(--primary); min-width: 42px; }
.te-item .te-path { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--mono); color: var(--ink-2); }
.te-item .te-id { color: var(--muted); font-family: var(--mono); }
.cond-rows { margin: 4px 0 8px; }
.cond-row { display: grid; grid-template-columns: 1.4fr 1fr 1.1fr 26px; gap: 6px; align-items: center; margin-bottom: 6px; }
.cond-row input, .cond-row select { height: 30px; font-size: 11px; padding: 0 6px; min-width: 0; }
.cond-row input { font-family: var(--mono); }
.cond-row .cond-del { height: 26px; width: 26px; border: 1px solid var(--line); background: var(--surface-2); color: var(--danger); border-radius: 6px; cursor: pointer; line-height: 1; }
.flow-trigger-badge { display: inline-flex; align-items: center; gap: 3px; font-size: 10px; padding: 2px 7px; border-radius: 999px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); margin-left: 6px; }
.flow-trigger-badge.on { background: var(--primary-soft); color: var(--primary); border-color: var(--primary-2); }
@media (max-width: 900px) { .trigger-type-grid { grid-template-columns: repeat(2, 1fr); } .trigger-row-2 { grid-template-columns: 1fr; } .cond-row { grid-template-columns: 1fr 1fr; } }

/* ================= 通用筛选栏（分组/折叠/已选条件） ================= */
.filterbar-mount { margin-bottom: 20px; }
.fb { border: 1px solid var(--line); border-radius: 13px; background: var(--surface); box-shadow: var(--shadow-sm); overflow: hidden; }
.fb-row { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 10px 16px; padding: 11px 14px; }
.fb-title { display: inline-flex; align-items: center; height: 28px; font-size: 12.5px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.fb-group { display: flex; align-items: flex-start; gap: 7px; min-width: 0; }
.fb-gl { display: inline-flex; align-items: center; height: 28px; font-size: 11.5px; font-weight: 600; color: var(--muted); white-space: nowrap; flex-shrink: 0; }
.fb-gl::after { content: '·'; margin-left: 7px; color: var(--line); }
.fb-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.fb-chip { display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); color: var(--ink-2); font-size: 11.5px; font-weight: 600; cursor: pointer; transition: .15s; white-space: nowrap; }
.fb-chip:hover { border-color: var(--primary-2); color: var(--primary); }
.fb-chip.active { background: var(--primary); color: #fff; border-color: var(--primary); box-shadow: 0 2px 7px rgba(79,70,229,.25); }
.fb-chip .cnt { font-size: 10px; padding: 1px 5px; border-radius: 999px; background: rgba(0,0,0,.06); }
.fb-chip.active .cnt { background: rgba(255,255,255,.22); }
.fb-expand { height: 28px; padding: 0 9px; border: 1px dashed var(--primary-2); border-radius: 8px; background: transparent; color: var(--primary); font-size: 11px; font-weight: 600; cursor: pointer; }
.fb-expand:hover { background: var(--primary-soft); }
.fb-select { height: 28px; padding: 0 6px; font-size: 11.5px; max-width: 170px; }
.fb-more-btn { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px; margin-left: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); color: var(--ink-2); font-size: 11.5px; font-weight: 600; cursor: pointer; white-space: nowrap; transition: .15s; }
.fb-more-btn:hover, .fb-more-btn.open { border-color: var(--primary-2); color: var(--primary); background: var(--primary-soft); }
.fb-more-btn .fb-dot { min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; background: var(--primary); color: #fff; font-size: 10px; display: grid; place-items: center; }
.fb-more-btn .fb-caret { font-size: 10px; color: var(--muted); }
.fb-panel { display: flex; flex-wrap: wrap; gap: 12px 22px; padding: 12px 14px; border-top: 1px dashed var(--line); background: var(--surface-2); }
.fb-active { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; padding: 9px 14px; border-top: 1px solid var(--line); background: var(--primary-soft); }
.fb-active-label { font-size: 11px; font-weight: 700; color: var(--primary); white-space: nowrap; }
.fb-tag { display: inline-flex; align-items: center; gap: 5px; padding: 3px 6px 3px 9px; border: 1px solid var(--primary-2); border-radius: 999px; background: #fff; color: var(--ink-2); font-size: 11px; }
.fb-tag-x { width: 15px; height: 15px; border: 0; border-radius: 50%; background: var(--surface-2); color: var(--muted); font-size: 11px; line-height: 1; cursor: pointer; display: grid; place-items: center; }
.fb-tag-x:hover { background: var(--danger-soft); color: var(--danger); }
.fb-clear { margin-left: auto; border: 0; background: transparent; color: var(--primary); font-size: 11.5px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.fb-clear:hover { text-decoration: underline; }
@media (max-width: 700px) {
  .fb-row { padding: 10px; gap: 8px 10px; }
  .fb-more-btn { margin-left: 0; }
  .fb-panel { padding: 10px; }
  .fb-active { padding: 9px 10px; }
  .fb-select { max-width: 130px; }
}

/* ================= 内嵌紧凑筛选栏（编排面板 / 下级节点弹窗） ================= */
.fb-compact { border-radius: 10px; margin-bottom: 8px; box-shadow: none; }
.fb-compact .fb-row { padding: 8px 9px; gap: 7px 10px; }
.fb-compact .fb-title { font-size: 11.5px; height: 26px; }
.fb-compact .fb-group { width: 100%; flex-wrap: wrap; }
.fb-compact .fb-gl { font-size: 11px; height: 26px; }
.fb-compact .fb-chips { gap: 4px; }
.fb-compact .fb-chip { height: 26px; padding: 0 8px; font-size: 11px; }
.fb-compact .fb-chip .cnt { font-size: 9.5px; padding: 0 4px; }
.fb-compact .fb-expand { height: 26px; padding: 0 7px; font-size: 10.5px; }
.fb-compact .fb-more-btn { height: 26px; padding: 0 9px; font-size: 11px; margin-left: 0; }
.fb-compact .fb-panel { padding: 9px; gap: 9px 14px; }
.fb-compact .fb-select { height: 26px; font-size: 11px; max-width: 100%; }
.fb-compact .fb-active { padding: 7px 9px; gap: 5px; }
.fb-compact .fb-tag { font-size: 10px; }
.fb-compact .fb-clear { font-size: 10.5px; }
