/* FlowMaster 界面原型 — 共享样式 */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;500;600;700&family=Noto+Serif+SC:wght@600;700&display=swap');

:root {
  --bg: #f4f6f9;
  --sidebar: #1a2332;
  --sidebar-hover: #243044;
  --primary: #2563eb;
  --primary-light: #dbeafe;
  --accent: #d97706;
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --card: #ffffff;
  --confirmed: #16a34a;
  --confirmed-bg: #dcfce7;
  --doubtful: #d97706;
  --doubtful-bg: #fef3c7;
  --issue: #dc2626;
  --issue-bg: #fee2e2;
  --pending: #64748b;
  --pending-bg: #f1f5f9;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 4px 12px rgba(0,0,0,.04);
}

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

body {
  font-family: 'Noto Sans SC', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

h1, h2, h3 { font-family: 'Noto Serif SC', serif; font-weight: 600; }

/* 布局 */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: 240px;
  background: var(--sidebar);
  color: #cbd5e1;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}

.sidebar-brand {
  padding: 24px 20px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.sidebar-brand h1 {
  color: #fff;
  font-size: 1.25rem;
  letter-spacing: .02em;
}

.sidebar-brand .domain-tag {
  display: inline-block;
  margin-top: 8px;
  padding: 3px 10px;
  background: rgba(37,99,235,.3);
  color: #93c5fd;
  border-radius: 20px;
  font-size: .75rem;
}

.sidebar nav { flex: 1; padding: 16px 12px; }

.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  color: #94a3b8;
  text-decoration: none;
  border-radius: 8px;
  font-size: .9rem;
  margin-bottom: 4px;
  transition: all .15s;
}

.sidebar nav a:hover { background: var(--sidebar-hover); color: #e2e8f0; }
.sidebar nav a.active { background: var(--primary); color: #fff; }

.sidebar nav a .icon { width: 20px; text-align: center; }

.sidebar-section-label {
  font-size: .7rem;
  font-weight: 600;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: 12px 14px 6px;
  margin-top: 4px;
}

.sidebar-divider {
  border: none;
  border-top: 1px solid rgba(255,255,255,.06);
  margin: 8px 0;
}

.main { flex: 1; display: flex; flex-direction: column; }

.topbar {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 14px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.topbar h2 { font-size: 1.15rem; }

.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: .85rem;
  color: var(--text-muted);
}

.user-avatar {
  width: 36px; height: 36px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: .85rem;
}

.content { padding: 28px; flex: 1; }

/* 卡片 */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.card-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-header h3 { font-size: 1rem; }

.card-body { padding: 22px; }

/* 网格 */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

/* 统计卡片 */
.stat-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.stat-card .label { font-size: .8rem; color: var(--text-muted); margin-bottom: 6px; }
.stat-card .value { font-size: 1.6rem; font-weight: 700; font-family: 'Noto Serif SC', serif; }
.stat-card .sub { font-size: .78rem; color: var(--text-muted); margin-top: 4px; }

/* 进度条 */
.progress-bar {
  height: 8px;
  background: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
  margin-top: 8px;
}

.progress-bar .fill {
  height: 100%;
  border-radius: 4px;
  transition: width .3s;
}

.progress-bar .fill.green { background: var(--confirmed); }
.progress-bar .fill.blue { background: var(--primary); }
.progress-bar .fill.amber { background: var(--accent); }

/* 状态标签 */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 500;
}

.badge-confirmed { background: var(--confirmed-bg); color: var(--confirmed); }
.badge-doubtful { background: var(--doubtful-bg); color: var(--doubtful); }
.badge-issue { background: var(--issue-bg); color: var(--issue); }
.badge-pending { background: var(--pending-bg); color: var(--pending); }

.badge-approved { background: #dbeafe; color: var(--primary); }
.badge-published { background: var(--confirmed-bg); color: var(--confirmed); }

/* 待办列表 */
.todo-list { list-style: none; }

.todo-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.todo-item:last-child { border-bottom: none; }

.todo-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.todo-dot.urgent { background: var(--issue); }
.todo-dot.normal { background: var(--accent); }
.todo-dot.low { background: var(--primary); }

.todo-item .info { flex: 1; }
.todo-item .title { font-weight: 500; font-size: .9rem; }
.todo-item .meta { font-size: .78rem; color: var(--text-muted); margin-top: 2px; }

/* 步骤卡片 */
.step-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  position: relative;
  transition: box-shadow .2s;
}

.step-card:hover { box-shadow: var(--shadow); }

.step-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  border-radius: var(--radius) 0 0 var(--radius);
}

.step-card.status-confirmed::before { background: var(--confirmed); }
.step-card.status-doubtful::before { background: var(--doubtful); }
.step-card.status-issue::before { background: var(--issue); }
.step-card.status-pending::before { background: var(--pending); }

.step-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.step-num {
  font-size: .75rem;
  color: var(--text-muted);
  background: var(--pending-bg);
  padding: 2px 8px;
  border-radius: 4px;
}

.step-title { font-weight: 600; font-size: 1rem; margin-top: 4px; }

.step-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 24px; font-size: .85rem; }
.step-fields .field-label { color: var(--text-muted); }
.step-fields .field-value { font-weight: 500; }

.step-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.step-comment {
  margin-top: 12px;
  padding: 10px 14px;
  background: #fffbeb;
  border-left: 3px solid var(--accent);
  border-radius: 0 6px 6px 0;
  font-size: .82rem;
}

.step-comment .author { font-weight: 600; color: var(--accent); }

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: 6px;
  font-size: .82rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: all .15s;
  font-family: inherit;
}

.btn-confirm { background: var(--confirmed-bg); color: var(--confirmed); }
.btn-confirm:hover { background: #bbf7d0; }
.btn-doubtful { background: var(--doubtful-bg); color: var(--doubtful); }
.btn-doubtful:hover { background: #fde68a; }
.btn-issue { background: var(--issue-bg); color: var(--issue); }
.btn-issue:hover { background: #fecaca; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: #1d4ed8; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { background: var(--bg); }

/* 表格 */
.table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.table th { text-align: left; padding: 10px 14px; background: var(--bg); color: var(--text-muted); font-weight: 500; border-bottom: 1px solid var(--border); }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--border); }
.table tr:hover td { background: #f8fafc; }

/* 审计时间线 */
.timeline { position: relative; padding-left: 28px; }

.timeline::before {
  content: '';
  position: absolute;
  left: 8px; top: 0; bottom: 0;
  width: 2px;
  background: var(--border);
}

.timeline-item { position: relative; margin-bottom: 24px; }

.timeline-item::before {
  content: '';
  position: absolute;
  left: -24px; top: 6px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid var(--card);
  box-shadow: 0 0 0 2px var(--primary-light);
}

.timeline-time { font-size: .75rem; color: var(--text-muted); }
.timeline-title { font-weight: 600; margin: 4px 0; }
.timeline-desc { font-size: .82rem; color: var(--text-muted); }
.timeline-change { margin-top: 8px; padding: 10px; background: var(--bg); border-radius: 6px; font-size: .8rem; font-family: monospace; }

/* 属性列表 */
.attr-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: .85rem;
}

.attr-row:last-child { border-bottom: none; }
.attr-name { flex: 1; font-weight: 500; }
.attr-type { color: var(--text-muted); font-size: .78rem; width: 80px; }
.attr-format { color: var(--text-muted); font-size: .78rem; width: 80px; }

/* 流程画布（列表视图） */
.flow-canvas { display: flex; flex-direction: column; align-items: center; gap: 0; padding: 20px 0; }

.flow-arrow {
  width: 2px; height: 24px;
  background: var(--border);
  position: relative;
}

.flow-arrow::after {
  content: '';
  position: absolute;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--border);
}

.flow-step-box {
  width: 100%;
  max-width: 520px;
}

/* 流程图画布（分支可视化） */
.flowchart-wrap {
  overflow-x: auto;
  padding: 8px 4px 16px;
}

.flowchart {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 720px;
  margin: 0 auto;
}

.fc-col {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.fc-vconn {
  width: 2px;
  height: 28px;
  background: #94a3b8;
  position: relative;
}

.fc-vconn::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #94a3b8;
}

.fc-node {
  position: relative;
  text-align: center;
  transition: box-shadow .2s, transform .2s;
}

.fc-node:hover {
  box-shadow: 0 4px 16px rgba(37, 99, 235, .15);
  transform: translateY(-1px);
}

.fc-node .fc-label {
  font-size: .72rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.fc-node .fc-title {
  font-weight: 600;
  font-size: .88rem;
  line-height: 1.35;
}

.fc-node .fc-meta {
  font-size: .72rem;
  color: var(--text-muted);
  margin-top: 6px;
}

.fc-start, .fc-end {
  min-width: 88px;
  padding: 8px 20px;
  border-radius: 24px;
  background: #1e293b;
  color: #fff;
  font-size: .82rem;
  font-weight: 600;
}

.fc-end.fc-end-fail {
  background: #7f1d1d;
}

.fc-task {
  min-width: 200px;
  max-width: 260px;
  padding: 14px 16px;
  border-radius: 10px;
  background: var(--card);
  border: 2px solid var(--border);
}

.fc-task.fc-highlight {
  border-color: #fca5a5;
  background: #fff5f5;
}

.fc-task.fc-highlight::before {
  content: '问题位置';
  position: absolute;
  top: -10px;
  right: 10px;
  font-size: .65rem;
  background: var(--issue);
  color: #fff;
  padding: 2px 8px;
  border-radius: 10px;
}

.fc-gateway-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.fc-gateway {
  width: 88px;
  height: 88px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fc-gateway .diamond {
  width: 62px;
  height: 62px;
  background: #fef3c7;
  border: 2px solid #f59e0b;
  transform: rotate(45deg);
  border-radius: 4px;
}

.fc-gateway .diamond-text {
  position: absolute;
  font-size: .78rem;
  font-weight: 600;
  color: #b45309;
  z-index: 1;
}

.fc-branch-zone {
  position: relative;
  width: 100%;
  max-width: 680px;
  margin-top: 4px;
}

.fc-branch-zone::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  width: 2px;
  height: 24px;
  background: #94a3b8;
  transform: translateX(-50%);
}

.fc-branch-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  padding-top: 24px;
  position: relative;
}

.fc-branch-row::before {
  content: '';
  position: absolute;
  top: 0;
  left: 25%;
  right: 25%;
  height: 2px;
  background: #94a3b8;
}

.fc-branch-col {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.fc-branch-col::before {
  content: '';
  width: 2px;
  height: 24px;
  background: #94a3b8;
  margin-bottom: 0;
}

.fc-branch-tag {
  font-size: .72rem;
  font-weight: 600;
  padding: 3px 12px;
  border-radius: 12px;
  margin-bottom: 8px;
}

.fc-branch-tag.success {
  background: var(--confirmed-bg);
  color: var(--confirmed);
}

.fc-branch-tag.fail {
  background: var(--issue-bg);
  color: var(--issue);
}

.fc-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px dashed var(--border);
  font-size: .75rem;
  color: var(--text-muted);
}

.fc-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.fc-legend .dot {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

.fc-legend .dot.start { background: #1e293b; border-radius: 50%; }
.fc-legend .dot.task { background: var(--card); border: 2px solid var(--border); }
.fc-legend .dot.gateway { background: #fef3c7; border: 2px solid #f59e0b; transform: rotate(45deg); width: 8px; height: 8px; }
.fc-legend .dot.branch-ok { background: var(--confirmed); border-radius: 50%; }
.fc-legend .dot.branch-fail { background: var(--issue); border-radius: 50%; }

.process-layout {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 20px;
  align-items: start;
}

.view-toggle .btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* 流程图 V2 — 视觉优化 */
.flow-v2 {
  padding: 28px 32px 20px;
  background:
    radial-gradient(circle at 20% 20%, rgba(37, 99, 235, .04) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(34, 197, 94, .04) 0%, transparent 50%),
    linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
  overflow-x: auto;
}

.flow-v2-section {
  margin-bottom: 8px;
}

.flow-v2-label {
  font-size: .72rem;
  font-weight: 600;
  color: #3b82f6;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 14px;
  padding-left: 4px;
}

.flow-v2-track {
  display: flex;
  align-items: center;
  gap: 0;
  min-width: max-content;
  padding: 8px 0;
}

.fv2-terminal {
  flex-shrink: 0;
  padding: 10px 22px;
  border-radius: 24px;
  font-size: .82rem;
  font-weight: 600;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
}

.fv2-start {
  background: linear-gradient(135deg, #1e293b, #334155);
  color: #fff;
}

.fv2-end-ok {
  background: linear-gradient(135deg, #16a34a, #22c55e);
  color: #fff;
  min-width: 64px;
}

.fv2-end-fail {
  background: linear-gradient(135deg, #dc2626, #ef4444);
  color: #fff;
  min-width: 64px;
}

.fv2-connector {
  width: 36px;
  height: 2px;
  background: linear-gradient(90deg, #cbd5e1, #94a3b8);
  position: relative;
  flex-shrink: 0;
}

.fv2-connector::after {
  content: '';
  position: absolute;
  right: -1px;
  top: 50%;
  transform: translateY(-50%);
  border: 5px solid transparent;
  border-left-color: #94a3b8;
}

.fv2-connector-ok {
  background: linear-gradient(90deg, #86efac, #22c55e);
}

.fv2-connector-ok::after {
  border-left-color: #22c55e;
}

.fv2-connector-fail {
  background: linear-gradient(90deg, #fca5a5, #ef4444);
}

.fv2-connector-fail::after {
  border-left-color: #ef4444;
}

.fv2-node {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 14px 18px;
  min-width: 108px;
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 8px rgba(15, 23, 42, .06), 0 1px 2px rgba(15, 23, 42, .04);
  position: relative;
  transition: transform .2s, box-shadow .2s;
}

.fv2-node::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: #3b82f6;
}

.fv2-node:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(37, 99, 235, .12);
}

.fv2-node-ok::before { background: #22c55e; }
.fv2-node-fail::before { background: #ef4444; }

.fv2-node-alert {
  background: linear-gradient(135deg, #fff, #fff5f5);
  border-color: #fecaca;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, .15), 0 4px 12px rgba(239, 68, 68, .1);
}

.fv2-alert-tag {
  position: absolute;
  top: -10px;
  right: 10px;
  font-size: .65rem;
  font-weight: 600;
  background: #ef4444;
  color: #fff;
  padding: 2px 8px;
  border-radius: 10px;
}

.fv2-num {
  font-size: .68rem;
  font-weight: 600;
  color: #94a3b8;
  background: #f1f5f9;
  padding: 2px 8px;
  border-radius: 10px;
}

.fv2-name {
  font-size: .85rem;
  font-weight: 600;
  color: #1e293b;
  text-align: center;
  line-height: 1.3;
  white-space: nowrap;
}

.fv2-gateway {
  flex-shrink: 0;
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fv2-diamond {
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border: 2px solid #f59e0b;
  transform: rotate(45deg);
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(245, 158, 11, .25);
  display: flex;
  align-items: center;
  justify-content: center;
}

.fv2-diamond span {
  transform: rotate(-45deg);
  font-size: .72rem;
  font-weight: 700;
  color: #b45309;
  text-align: center;
  line-height: 1.2;
}

.flow-v2-fork {
  height: 48px;
  margin: 4px 0 8px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.flow-v2-fork-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.flow-v2-branches {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 8px;
}

.flow-v2-branch {
  border-radius: 14px;
  padding: 18px 20px 14px;
  border: 1px solid transparent;
}

.flow-v2-branch-ok {
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
  border-color: #bbf7d0;
}

.flow-v2-branch-fail {
  background: linear-gradient(135deg, #fef2f2 0%, #fff1f2 100%);
  border-color: #fecaca;
}

.flow-v2-branch-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .82rem;
  font-weight: 600;
  margin-bottom: 14px;
}

.flow-v2-branch-ok .flow-v2-branch-head { color: #15803d; }
.flow-v2-branch-fail .flow-v2-branch-head { color: #b91c1c; }

.fv2-branch-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .72rem;
  font-weight: 700;
  color: #fff;
}

.flow-v2-branch-ok .fv2-branch-icon { background: #22c55e; }
.flow-v2-branch-fail .fv2-branch-icon { background: #ef4444; }

.flow-v2-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid #e2e8f0;
  font-size: .75rem;
  color: #64748b;
}

.flow-v2-legend span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.fv2-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

.fv2-dot.start { border-radius: 50%; background: #334155; }
.fv2-dot.task { background: #fff; border: 2px solid #3b82f6; }
.fv2-dot.gw { background: #fde68a; border: 2px solid #f59e0b; transform: rotate(45deg); width: 10px; height: 10px; }
.fv2-dot.ok { border-radius: 50%; background: #22c55e; }
.fv2-dot.fail { border-radius: 50%; background: #ef4444; }

@media (max-width: 900px) {
  .flow-v2-branches { grid-template-columns: 1fr; }
  .flow-v2-track { flex-wrap: wrap; justify-content: center; }
}

/* BPMN 横向流程图（旧版保留） */
.bpmn-wrap {
  padding: 20px 24px 12px;
  background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
  overflow-x: auto;
}

.bpmn-svg {
  width: 100%;
  min-width: 900px;
  height: auto;
  display: block;
}

.bpmn-svg .lane-label {
  font-size: 11px;
  font-weight: 600;
  fill: #0369a1;
  font-family: 'Noto Sans SC', sans-serif;
}

.bpmn-svg .lane-ok { fill: #15803d; }
.bpmn-svg .lane-fail { fill: #b91c1c; }

.bpmn-svg .bpmn-start-end {
  text-anchor: middle;
  font-size: 11px;
  font-weight: 600;
  fill: #fff;
  font-family: 'Noto Sans SC', sans-serif;
}

.bpmn-svg .bpmn-start-end-sm {
  text-anchor: middle;
  font-size: 10px;
  font-weight: 600;
  fill: #334155;
  font-family: 'Noto Sans SC', sans-serif;
}

.bpmn-svg .bpmn-step {
  text-anchor: middle;
  font-size: 9px;
  fill: #64748b;
  font-family: 'Noto Sans SC', sans-serif;
}

.bpmn-svg .bpmn-title {
  text-anchor: middle;
  font-size: 11px;
  font-weight: 600;
  fill: #1e293b;
  font-family: 'Noto Sans SC', sans-serif;
}

.bpmn-svg .bpmn-gateway {
  text-anchor: middle;
  font-size: 10px;
  font-weight: 700;
  fill: #b45309;
  font-family: 'Noto Sans SC', sans-serif;
}

.bpmn-svg .branch-label-ok {
  text-anchor: middle;
  font-size: 11px;
  font-weight: 700;
  fill: #16a34a;
  font-family: 'Noto Sans SC', sans-serif;
}

.bpmn-svg .branch-label-fail {
  text-anchor: middle;
  font-size: 11px;
  font-weight: 700;
  fill: #dc2626;
  font-family: 'Noto Sans SC', sans-serif;
}

.bpmn-svg .bpmn-flag {
  text-anchor: middle;
  font-size: 9px;
  font-weight: 600;
  fill: #fff;
  font-family: 'Noto Sans SC', sans-serif;
}

.bpmn-svg .bpmn-highlight .bpmn-flag {
  transform: translateY(-4px);
}

.bpmn-svg .bpmn-node {
  cursor: default;
}

.bpmn-svg .bpmn-node:hover rect {
  filter: drop-shadow(0 4px 8px rgba(37, 99, 235, .2));
}

.bpmn-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
  font-size: .75rem;
  color: var(--text-muted);
}

.bpmn-legend span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.bpmn-legend .lg {
  display: inline-block;
  width: 14px;
  height: 14px;
}

.bpmn-legend .lg-start {
  border-radius: 50%;
  background: #1e293b;
}

.bpmn-legend .lg-task {
  border-radius: 3px;
  background: #fff;
  border: 2px solid #3b82f6;
}

.bpmn-legend .lg-gw {
  background: #fef3c7;
  border: 2px solid #f59e0b;
  transform: rotate(45deg);
  width: 10px;
  height: 10px;
}

.bpmn-legend .lg-ok {
  border-radius: 50%;
  background: #16a34a;
}

.bpmn-legend .lg-fail {
  border-radius: 50%;
  background: #dc2626;
}

/* 流程关联实体面板 */
.step-entity-map {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.step-entity-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: .78rem;
}

.step-entity-chip strong {
  color: var(--primary);
  font-weight: 600;
}

.entity-panel-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.entity-detail-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
}

.entity-detail-card.core {
  border-color: #93c5fd;
  box-shadow: 0 0 0 1px #dbeafe;
}

.entity-detail-card.flagged {
  border-color: #fcd34d;
  box-shadow: 0 0 0 1px #fef3c7;
}

.entity-detail-header {
  padding: 14px 16px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.entity-detail-header h4 {
  font-size: .92rem;
  font-family: 'Noto Serif SC', serif;
}

.entity-detail-header .code {
  font-size: .72rem;
  color: var(--text-muted);
  font-family: monospace;
  margin-top: 2px;
}

.entity-detail-body {
  padding: 14px 16px;
  font-size: .82rem;
}

.entity-ref-steps {
  margin-bottom: 10px;
  color: var(--text-muted);
  font-size: .78rem;
}

.entity-ref-steps span {
  display: inline-block;
  background: var(--primary-light);
  color: var(--primary);
  padding: 1px 8px;
  border-radius: 10px;
  margin: 2px 4px 2px 0;
  font-size: .72rem;
}

.entity-attr-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .78rem;
  margin-top: 8px;
}

.entity-attr-table th {
  text-align: left;
  padding: 6px 8px;
  background: #f8fafc;
  color: var(--text-muted);
  font-weight: 500;
  border-bottom: 1px solid var(--border);
}

.entity-attr-table td {
  padding: 7px 8px;
  border-bottom: 1px solid var(--border);
}

.entity-attr-table tr:last-child td {
  border-bottom: none;
}

.entity-flow-name {
  font-size: .75rem;
  color: var(--text-muted);
  margin-top: 6px;
}

.entity-flow-name em {
  font-style: normal;
  color: var(--accent);
}

.entity-more {
  margin-top: 8px;
  font-size: .75rem;
  color: var(--primary);
  cursor: pointer;
}

.confirm-scope-note {
  padding: 10px 14px;
  background: #eff6ff;
  border-radius: 8px;
  border-left: 4px solid var(--primary);
  font-size: .82rem;
  margin-bottom: 14px;
  color: #1e40af;
}

@media (max-width: 1024px) {
  .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; }
  .grid-2, .process-layout { grid-template-columns: 1fr; }
  .fc-branch-row { gap: 24px; }
}

.action-card .action-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  border-radius: 8px;
  border-left: 3px solid transparent;
}
.action-card .action-urgent {
  background: #fef2f2;
  border-left-color: var(--issue);
}
.action-item .action-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.action-item .action-dot.urgent { background: var(--issue); }
.action-item .action-dot.normal { background: var(--accent); }
.action-item .action-dot.low { background: var(--primary); }
.action-item .action-info { flex: 1; }
.action-item .action-title { font-weight: 500; font-size: .88rem; }
.action-item .action-meta { font-size: .75rem; color: var(--text-muted); margin-top: 2px; }
.btn-sm { padding: 4px 12px; font-size: .78rem; }

.stat-card-link {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: box-shadow .15s, transform .15s;
  display: block;
}
.stat-card-link:hover {
  box-shadow: 0 4px 16px rgba(37, 99, 235, .12);
  transform: translateY(-2px);
}

.shortcut-link {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  transition: background .15s;
}
.shortcut-link:hover { background: var(--bg); }
.shortcut-icon {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.shortcut-title { font-weight: 600; font-size: .88rem; }
.shortcut-desc { font-size: .75rem; color: var(--text-muted); margin-top: 2px; }

.filter-bar { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; }
.filter-group { display: flex; flex-direction: column; gap: 4px; }
.filter-label { font-size: .75rem; font-weight: 500; color: var(--text-muted); }
.filter-select { padding: 6px 12px; border: 1px solid var(--border); border-radius: 6px; font-family: inherit; font-size: .82rem; background: #fff; }
.filter-search { flex: 1; }
.filter-input { width: 100%; padding: 6px 12px; border: 1px solid var(--border); border-radius: 6px; font-family: inherit; font-size: .82rem; }
.filter-summary { margin-top: 12px; font-size: .78rem; color: var(--text-muted); }
.code-cell { font-family: monospace; font-size: .78rem; color: var(--text-muted); }
.process-name-link { color: var(--primary); text-decoration: none; font-weight: 500; }
.process-name-link:hover { text-decoration: underline; }
.category-tag { display: inline-block; padding: 2px 10px; background: #f0f4ff; color: var(--primary); border-radius: 20px; font-size: .75rem; }
.pagination { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.pagination-info { font-size: .82rem; color: var(--text-muted); }
.pagination-pages { display: flex; gap: 6px; align-items: center; }
.page-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; height: 32px; padding: 0 8px; border-radius: 6px; border: 1px solid var(--border); font-size: .82rem; text-decoration: none; color: var(--text); cursor: pointer; }
.page-btn:hover { background: var(--bg); }
.page-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.page-jump-input { width: 50px; padding: 4px 8px; border: 1px solid var(--border); border-radius: 4px; text-align: center; font-size: .82rem; }
.check-options { display: flex; gap: 16px; }
.check-opt { font-size: .85rem; cursor: pointer; }
.check-opt input { margin-right: 4px; }
.ref-count { display: inline-block; padding: 2px 8px; background: #f0f4ff; color: var(--primary); border-radius: 12px; font-size: .72rem; font-weight: 600; text-align: center; min-width: 24px; }
.ref-link { display: inline-block; padding: 4px 12px; border: 1px solid var(--border); border-radius: 20px; font-size: .82rem; color: var(--primary); text-decoration: none; transition: background .15s; }
.ref-link:hover { background: var(--primary-light); }
.ref-link:hover { background: var(--primary-light); }

/* 流程优先级排序 — 属性列表 */
.priority-note {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  margin: 0 22px 0 22px;
  background: linear-gradient(90deg, #eff6ff, #f0fdf4);
  border-bottom: 1px solid var(--border);
  font-size: .82rem;
  color: #1e40af;
}
.priority-note .note-icon {
  font-size: 1rem;
  flex-shrink: 0;
}
.priority-note .note-text {
  flex: 1;
}

.attr-row[data-ref-count]:hover {
  background: #f8fafc;
}

.ref-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 11px;
  font-size: .72rem;
  font-weight: 700;
  background: var(--primary);
  color: #fff;
  flex-shrink: 0;
  transition: all .15s;
}
.ref-badge.high { background: linear-gradient(135deg, #dc2626, #ef4444); }
.ref-badge.medium { background: linear-gradient(135deg, #d97706, #f59e0b); color: #fff; }
.ref-badge.low { background: linear-gradient(135deg, #2563eb, #3b82f6); }
.ref-badge.zero { background: var(--pending-bg); color: var(--pending); }

.attr-ref-info {
  width: 100px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  font-size: .78rem;
  color: var(--text-muted);
}

.ref-link-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.ref-link-tag {
  font-size: .68rem;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--primary-light);
  color: var(--primary);
  cursor: pointer;
  transition: all .15s;
}
.ref-link-tag:hover {
  background: var(--primary);
  color: #fff;
}

.ref-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: .78rem;
  cursor: pointer;
  transition: all .15s;
  font-family: inherit;
  color: var(--text);
}
.ref-toggle:hover { border-color: var(--primary); color: var(--primary); }
.ref-toggle.active { border-color: var(--primary); background: var(--primary); color: #fff; }
.ref-toggle .toggle-icon { font-size: .9rem; }

/* 连接器 */
.connector { display: flex; justify-content: center; padding: 4px 0; color: var(--text-muted); font-size: .7rem; }

/* 原型标注 */
.proto-note {
  position: fixed;
  bottom: 16px; right: 16px;
  background: var(--sidebar);
  color: #94a3b8;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: .72rem;
  z-index: 100;
}

/* 流程目录 — 筛选栏 */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-end;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.filter-label {
  font-size: .72rem;
  color: var(--text-muted);
  font-weight: 500;
}

.filter-select {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: .82rem;
  font-family: inherit;
  color: var(--text);
  background: var(--card);
  min-width: 120px;
  cursor: pointer;
}

.filter-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-light);
}

.filter-input {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: .82rem;
  font-family: inherit;
  color: var(--text);
  background: var(--card);
  min-width: 220px;
}

.filter-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-light);
}

.filter-input::placeholder {
  color: #94a3b8;
}

.filter-search {
  flex: 1;
  min-width: 200px;
  max-width: 360px;
}

.filter-summary {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: .78rem;
  color: var(--text-muted);
}

/* 流程目录 — 表格增强 */
.code-cell {
  font-family: monospace;
  font-size: .78rem;
  color: var(--text-muted);
}

.process-name-link {
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  transition: color .15s;
}

.process-name-link:hover {
  color: var(--primary);
}

.category-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: .72rem;
  font-weight: 500;
  background: var(--bg);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.btn-sm {
  padding: 4px 10px;
  font-size: .75rem;
}

/* 流程目录 — 分页 */
.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  margin-top: 8px;
}

.pagination-info {
  font-size: .8rem;
  color: var(--text-muted);
}

.pagination-pages {
  display: flex;
  align-items: center;
  gap: 4px;
}

.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: .82rem;
  color: var(--text-muted);
  text-decoration: none;
  border: 1px solid transparent;
  transition: all .15s;
}

.page-btn:hover {
  background: var(--bg);
  border-color: var(--border);
}

.page-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.page-btn.next {
  color: var(--primary);
}

.page-btn.next:hover {
  background: var(--primary-light);
}

.page-ellipsis {
  padding: 0 4px;
  color: var(--text-muted);
  font-size: .82rem;
}

@media (max-width: 1024px) {
  .filter-bar { flex-wrap: wrap; }
  .filter-search { max-width: 100%; }
  .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; }
  .grid-2, .process-layout { grid-template-columns: 1fr; }
  .fc-branch-row { gap: 24px; }
}
