/* tech-db.css —— X-04「关联拓扑」（库↔库 / 表↔表）样式。
   起因（用户 2026-09-28 诉求）：要能一眼看到库与库、表与表之间的关联，且不要乱。
   styles.css 已超行数上限（棘轮只许缩小），按仓内既有做法：新样式单开文件，不写进 styles.css。 */

/* 区块外框（与 tech_db.js 里 block() 同款外观；本区块由本文件接管样式） */
.dash .db-topo { background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; padding: 20px; margin-bottom: 20px; }
.dash .db-topo .block-header { display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 12px; border-bottom: 1px solid #f3f4f6; padding-bottom: 12px; }
.dash .db-topo .block-title { font-size: 15px; font-weight: 600; color: #111827; }
.dash .db-topo .db-topo-h { margin: 18px 0 6px; font-size: 13px; font-weight: 600; color: #374151; }
.dash .db-topo .db-topo-hint { font-size: 12px; color: #6b7280; line-height: 1.7; margin: 4px 0 8px; }

/* 图区：层数多时横向滚动，不撑破正文；连线在底层（pointer-events:none）、节点在上层可点 */
.dash .db-topo .db-topo-body { overflow-x: auto; overflow-y: hidden; }
.dash .db-topo .db-topo-inner { position: relative; }
.dash .db-topo svg.db-topo-lines { position: absolute; left: 0; top: 0; pointer-events: none; }

/* 节点：固定尺寸（几何可被尺子量），表名过长省略号；三类外观＝普通表 / 库 / 跨库对端 */
.dash .db-topo-node { position: absolute; box-sizing: border-box; display: block; padding: 0 8px;
    font-size: 12px; line-height: 28px; color: #1f2937; background: #fff; border: 1px solid #cbd5e1;
    border-radius: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash .db-topo-node:hover { border-color: #2563eb; background: #eff6ff; }
.dash .db-topo-node.db { background: #eff6ff; border-color: #93c5fd; font-weight: 600; }
.dash .db-topo-node.ext { background: #f3f4f6; border-color: #d1d5db; border-style: dashed; color: #6b7280; }
.dash .db-topo-node.off { background: #fafafa; border-color: #e5e7eb; border-style: dashed; color: #9ca3af; }

/* 图例：线段示意（实线灰＝真实外键；虚线橙＝人工登记；灰块＝跨库对端 / 未接线） */
.dash .db-topo-legend { display: flex; flex-wrap: wrap; gap: 16px; margin: 8px 0 4px; font-size: 12px; color: #4b5563; }
.dash .db-topo-legend span { display: inline-flex; align-items: center; gap: 6px; }
/* 线段 class 一律带 db-topo 前缀：裸 "dash" 会命中页面容器 .dash（min-height:100vh）→ 线段被拉成整屏高 */
.dash .db-topo-legend i.db-topo-seg { display: inline-block; width: 22px; height: 0; border-top: 2px solid #94a3b8; }
.dash .db-topo-legend i.db-topo-seg-dash { border-top-style: dashed; border-top-color: #f59e0b; }
.dash .db-topo-legend i.db-topo-seg-box { width: 14px; height: 10px; border: 1px dashed #d1d5db; background: #f3f4f6; border-radius: 3px; }
