:root {
  --bg: #0f1117;
  --bg-sidebar: #171b24;
  --bg-card: #1b212d;
  --bg-hover: #242d3b;
  --bg-active: #2e3848;
  --border: rgba(148, 163, 184, 0.18);
  --border-weak: rgba(148, 163, 184, 0.1);
  --text: #edf3ff;
  --text-dim: #9ba8bd;
  --accent: #7aa8ff;
  --accent-soft: rgba(122, 168, 255, 0.16);
  --green: #34c07a;
  --orange: #f0a132;
  --red: #e5534b;
  --r-s: 6px;
  --r-m: 10px;
  --r-l: 14px;
  --row-hover: #232c3c;
}
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-thumb {
  background: #2c3646;
  border-radius: 8px;
  border: 2px solid var(--bg);
}
::-webkit-scrollbar-track {
  background: transparent;
}
body {
  background:
    radial-gradient(circle at top left, rgba(122, 168, 255, 0.14), transparent 30%),
    linear-gradient(135deg, #0f1117 0%, #151b24 100%);
  color: var(--text);
  font-family: -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  height: 100vh;
  display: flex;
  overflow: hidden;
}
button {
  font-family: inherit;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

/* ===== 登录门 ===== */
#loginGate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}
.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-l);
  padding: 38px 42px;
  width: 350px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.login-logo {
  width: 54px;
  height: 54px;
  margin: 0 auto 14px;
  border-radius: 15px;
  background: linear-gradient(135deg, #6f9ee8, #9065b0);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  box-shadow: 0 8px 24px rgba(111, 158, 232, 0.35);
}
.login-card h1 {
  font-size: 21px;
  margin-bottom: 8px;
}
.login-card .sub {
  color: var(--text-dim);
  font-size: 13px;
  margin-bottom: 22px;
}
.login-card .note {
  color: #737d8e;
  font-size: 11px;
  font-style: italic;
  margin: -12px 0 18px;
}
#pwdInput {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--r-s);
  font-size: 15px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  outline: none;
  margin-bottom: 14px;
}
#pwdInput:focus {
  border-color: var(--accent);
}
#loginBtn {
  width: 100%;
  padding: 11px;
  font-size: 15px;
  border-radius: var(--r-s);
  background: var(--accent);
  border: none;
  color: #0d1117;
  font-weight: 600;
  cursor: pointer;
}
#loginBtn:hover {
  filter: brightness(1.12);
}
#loginMsg {
  margin-top: 14px;
  font-size: 13px;
  color: var(--red);
  min-height: 18px;
}

/* ===== 侧栏 ===== */
.sidebar {
  width: 248px;
  min-width: 248px;
  background: rgba(23, 27, 36, 0.92);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(10px);
}
.sidebar h1 {
  font-size: 15px;
  padding: 2px 10px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.sidebar h1 .dot {
  width: 20px;
  height: 20px;
  border-radius: 5px;
  background: linear-gradient(135deg, #6f9ee8, #9065b0);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
}
.search {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--r-s);
  padding: 6px 10px;
  font-size: 13px;
  margin-bottom: 6px;
  outline: none;
}
.search:focus {
  border-color: var(--accent);
}
.group-label {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 12px 10px 6px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  border-radius: var(--r-s);
  cursor: pointer;
  color: var(--text-dim);
  margin-bottom: 1px;
  user-select: none;
  transition: background 0.15s, color 0.15s;
}
.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text);
}
.nav-item.active {
  background: var(--bg-active);
  color: var(--text);
  font-weight: 500;
}
.nav-item .icon {
  width: 18px;
  text-align: center;
  font-size: 13px;
}
.nav-item .count {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-dim);
  background: var(--bg);
  border-radius: 8px;
  padding: 1px 7px;
}
.src-note {
  font-size: 11px;
  color: var(--text-dim);
  padding: 10px;
  line-height: 1.6;
  border-top: 1px solid var(--border);
  margin-top: 12px;
}
.src-note a {
  color: var(--accent);
  text-decoration: none;
  word-break: break-all;
}

/* 同步状态 + 账号操作 */
.side-foot {
  margin-top: auto;
  padding: 10px 10px 4px;
  border-top: 1px solid var(--border);
}
.local-badge {
  font-size: 11px;
  color: var(--orange);
  text-align: center;
  padding-bottom: 6px;
}
.sync-line {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--text-dim);
  padding: 4px 2px 8px;
}
.sync-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
}
.sync-dot.pending {
  background: var(--orange);
  box-shadow: 0 0 8px var(--orange);
}
.sync-dot.offline {
  background: var(--red);
  box-shadow: 0 0 8px var(--red);
}
.side-foot .btns {
  display: flex;
  gap: 6px;
}
.side-foot button {
  flex: 1;
  font-size: 12px;
  padding: 5px 0;
  border-radius: var(--r-s);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-dim);
  cursor: pointer;
  white-space: nowrap;
}
.side-foot button:hover {
  background: var(--bg-hover);
  color: var(--text);
}
.import-banner {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 0 8px;
  padding: 10px;
  border: 1px solid rgba(240, 161, 50, 0.45);
  background: rgba(240, 161, 50, 0.08);
  border-radius: var(--r-m);
  font-size: 12px;
  color: #e8a86b;
  word-break: break-all;
}
.import-banner .ib-btns {
  display: flex;
  gap: 6px;
}
.import-banner .btn {
  flex: 1;
}

/* ===== 主区域 ===== */
.main {
  flex: 1;
  overflow-y: auto;
  padding: 18px 22px 26px;
  background: linear-gradient(180deg, rgba(18, 22, 30, 0.32), rgba(18, 22, 30, 0));
}
.cat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}
.cat-header .big-icon {
  font-size: 24px;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  border: 1px solid var(--border);
}
.cat-header h2 {
  font-size: 23px;
  font-weight: 700;
}
.cat-desc {
  color: var(--text-dim);
  font-size: 13px;
  margin-bottom: 8px;
  line-height: 1.5;
}
.smart-panel {
  margin: 14px 0 18px;
  padding: 14px 16px;
  background: linear-gradient(135deg, rgba(111, 158, 232, 0.12), rgba(144, 101, 176, 0.08));
  border: 1px solid rgba(111, 158, 232, 0.25);
  border-radius: var(--r-l);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.smart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  font-size: 12px;
  color: var(--text-dim);
}
.smart-badge {
  background: rgba(52, 192, 122, 0.12);
  border: 1px solid rgba(52, 192, 122, 0.4);
  color: #7ecb9b;
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 11px;
  white-space: nowrap;
}
.smart-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}
/* ---------- 域名诊断面板（Domain Architect 规则） ---------- */
.diag-panel {
  margin: 0 0 16px;
  padding: 13px 16px;
  background: linear-gradient(135deg, rgba(91, 185, 140, 0.08), rgba(122, 168, 255, 0.07));
  border: 1px solid rgba(91, 185, 140, 0.22);
  border-radius: var(--r-l);
}
.diag-score {
  color: var(--sc, #5bb98c);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  margin-left: auto;
}
.diag-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}
.diag-item {
  display: flex;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--r-m);
  background: rgba(20, 23, 32, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-left: 3px solid var(--sev, #7aa8ff);
}
.diag-sev {
  flex: 0 0 auto;
  align-self: flex-start;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--sev, #7aa8ff);
  border: 1px solid var(--sev, #7aa8ff);
  border-radius: 999px;
  padding: 1px 8px;
}
.diag-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.diag-body strong {
  font-size: 13px;
  word-break: break-all;
}
.diag-body span {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.5;
}
.diag-btns {
  display: flex;
  gap: 8px;
  margin-top: 4px;
  flex-wrap: wrap;
}
.diag-btn {
  font-size: 11.5px;
  color: var(--text);
  background: rgba(122, 168, 255, 0.1);
  border: 1px solid rgba(122, 168, 255, 0.35);
  border-radius: 999px;
  padding: 3px 12px;
  cursor: pointer;
  transition: all 0.15s;
}
.diag-btn:hover {
  background: rgba(122, 168, 255, 0.22);
}
.diag-empty {
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--text-dim);
  padding: 8px 0 2px;
}
.smart-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border-radius: var(--r-m);
  background: rgba(20, 23, 32, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.04);
}
.smart-item .icon {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(111, 158, 232, 0.14);
  font-size: 14px;
}
.smart-item strong {
  display: block;
  margin-bottom: 3px;
  font-size: 13px;
}
.smart-item span {
  color: var(--text-dim);
  font-size: 12px;
  line-height: 1.5;
}
.smart-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 12px 0;
  padding: 8px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-m);
  font-size: 12.5px;
  color: var(--text-dim);
}
.smart-strip b {
  color: var(--text);
}
.smart-strip .smart-badge {
  margin-left: auto;
}
.related-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 8px 0 12px;
  padding: 7px 12px;
  background: var(--bg-card);
  border-radius: var(--r-s);
  border: 1px solid var(--border);
}
.related-bar .lbl {
  font-size: 12px;
  color: var(--text-dim);
}

/* 子分类过滤条 */
.filter-bar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 0 0 12px;
  align-items: center;
}
.fchip {
  font-size: 12px;
  padding: 3px 11px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-dim);
  cursor: pointer;
}
.fchip:hover {
  color: var(--text);
  background: var(--bg-hover);
}
.fchip.on {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}
.fchip .n {
  opacity: 0.6;
  margin-left: 3px;
  font-size: 11px;
}

.toolbar {
  display: flex;
  gap: 8px;
  margin: 0 0 6px;
  align-items: center;
  flex-wrap: wrap;
}
.toolbar .spacer {
  flex: 1;
}
.btn {
  font-size: 12.5px;
  padding: 6px 14px;
  border-radius: var(--r-s);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-dim);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.btn:hover {
  background: var(--bg-hover);
  color: var(--text);
}
.btn.primary {
  background: var(--accent);
  border-color: transparent;
  color: #0d1117;
  font-weight: 600;
}
.btn.primary:hover {
  filter: brightness(1.1);
  color: #0d1117;
}
.btn.danger:hover {
  border-color: var(--red);
  color: #ff9b95;
}
.btn.tiny {
  font-size: 11.5px;
  padding: 3px 10px;
}
.btn.armed,
.side-foot button.armed,
.row-del.armed,
.th-del.armed {
  background: rgba(229, 83, 75, 0.16) !important;
  border-color: var(--red) !important;
  color: #ff9b95 !important;
  animation: armPulse 1.2s ease infinite;
}
@keyframes armPulse {
  50% {
    box-shadow: 0 0 0 3px rgba(229, 83, 75, 0.15);
  }
}
.hint-line {
  font-size: 11.5px;
  color: var(--text-dim);
  opacity: 0.85;
  margin: 0 0 12px;
}
.pop-input {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}
.pop-input input {
  width: 150px;
  padding: 5px 10px;
  border-radius: var(--r-s);
  border: 1px solid var(--accent);
  background: var(--bg);
  color: var(--text);
  font-size: 12.5px;
  outline: none;
}
.pop-ok,
.pop-cancel {
  width: 28px;
  height: 28px;
  border-radius: var(--r-s);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-dim);
  cursor: pointer;
  font-size: 12px;
}
.pop-ok:hover {
  border-color: var(--green);
  color: var(--green);
}
.pop-cancel:hover {
  border-color: var(--red);
  color: #ff9b95;
}

/* ===== 表格 ===== */
.table-wrap {
  border: 1px solid var(--border);
  border-radius: var(--r-m);
  overflow: auto;
  background: var(--bg-card);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
}
table {
  border-collapse: separate;
  border-spacing: 0;
  width: max-content;
  min-width: 100%;
  table-layout: auto;
}
th,
td {
  max-width: 320px;
  overflow-wrap: anywhere;
}
th {
  text-align: left;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-dim);
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 2;
}
th .th-icon {
  margin-right: 5px;
  opacity: 0.7;
}
th .th-name {
  cursor: text;
  border-bottom: 1px dashed transparent;
}
th .th-name:hover {
  border-bottom-color: var(--text-dim);
}
.th-input {
  width: 110px;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--accent);
  background: var(--bg);
  color: var(--text);
  font-size: 12px;
  outline: none;
}
th .th-del {
  margin-left: 6px;
  color: #ef8b87;
  cursor: pointer;
  font-size: 11px;
  opacity: 0.28;
  white-space: nowrap;
}
th:hover .th-del {
  opacity: 0.7;
}
th .th-del:hover,
th .th-del.armed {
  opacity: 1;
}
td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-weak);
  vertical-align: top;
  min-width: 100px;
  outline: none;
  font-size: 13px;
  background: var(--bg-card);
}
th:first-child,
td:first-child {
  position: sticky;
  left: 0;
  border-right: 1px solid var(--border-weak);
}
th:first-child {
  z-index: 3;
}
td:first-child {
  z-index: 1;
}
tr:last-child td {
  border-bottom: none;
}
tr:hover td {
  background: var(--row-hover);
}
td[contenteditable]:hover {
  box-shadow: inset 0 0 0 1px rgba(122, 168, 255, 0.35);
}
td[contenteditable]:focus {
  box-shadow: inset 0 0 0 2px var(--accent);
  background: var(--row-hover);
  border-radius: 2px;
}
/* 编辑态：innerText 的换行真实显示为多行，与展示态分行视觉一致 */
td.editing {
  white-space: pre-wrap;
}
td:empty::before {
  content: "·";
  color: var(--text-dim);
  opacity: 0.35;
}
.cell-url {
  color: var(--accent);
  text-decoration: none;
  word-break: break-all;
  cursor: pointer;
}
.cell-url:hover {
  text-decoration: underline;
}
.multi {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
}
.row-del {
  color: var(--text-dim);
  cursor: pointer;
  font-size: 13px;
  padding: 0 4px;
  border-radius: 4px;
  white-space: nowrap;
}
.row-del:hover {
  color: #ef8b87;
  background: rgba(212, 76, 71, 0.15);
}
td.op {
  min-width: 48px;
  width: 48px;
  text-align: center;
}
tr.hl td {
  animation: hlFlash 2s ease;
}
@keyframes hlFlash {
  0% {
    background: rgba(122, 168, 255, 0.35);
  }
  100% {
    background: var(--bg-card);
  }
}
.empty {
  padding: 52px 20px;
  text-align: center;
  color: var(--text-dim);
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}
.empty .e-icon {
  font-size: 34px;
  opacity: 0.5;
}

.tag {
  display: inline-block;
  font-size: 12px;
  padding: 1px 8px;
  border-radius: var(--r-s);
  white-space: nowrap;
}
.tag-green {
  background: rgba(77, 158, 106, 0.2);
  color: #7ecb9b;
}
.tag-orange {
  background: rgba(201, 132, 66, 0.22);
  color: #e8a86b;
}
.tag-purple {
  background: rgba(144, 101, 176, 0.25);
  color: #c39bdd;
}
.tag-red {
  background: rgba(212, 76, 71, 0.2);
  color: #ef8b87;
}
.tag-blue {
  background: var(--accent-soft);
  color: var(--accent);
}
.tag-gray {
  background: rgba(148, 163, 184, 0.15);
  color: #a7b2c5;
}

.rel-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  padding: 1px 8px;
  border-radius: var(--r-s);
  background: rgba(144, 101, 176, 0.18);
  color: #c39bdd;
  cursor: pointer;
  margin: 1px 2px;
  border: 1px solid transparent;
}
.rel-link:hover {
  border-color: #9065b0;
  background: rgba(144, 101, 176, 0.32);
}
.rel-link .ar {
  font-size: 11px;
  opacity: 0.7;
}

.due {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.due .days {
  font-size: 11px;
  opacity: 0.85;
}
.d-safe {
  color: #7ecb9b;
}
.d-warn {
  color: #e8a86b;
}
.d-danger {
  color: #ef8b87;
}

/* ===== 总览：统计 + 项目卡片 + 对齐拓扑 ===== */
.overview-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}
.stat-card {
  position: relative;
  overflow: hidden;
  min-height: 76px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-m);
  background: linear-gradient(145deg, rgba(31, 39, 54, 0.96), rgba(24, 29, 40, 0.96));
}
.stat-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 2px;
  background: var(--stat-color, var(--accent));
  opacity: 0.85;
}
.stat-card .label {
  color: var(--text-dim);
  font-size: 11px;
}
.stat-card .value {
  display: block;
  margin-top: 5px;
  color: var(--stat-color, var(--accent));
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
}
.overview-content {
  display: grid;
  /* 左侧项目清单 60% / 右侧拓扑图 40%，窄屏自动堆叠 */
  grid-template-columns: minmax(0, 3fr) minmax(340px, 2fr);
  gap: 14px;
  align-items: stretch;
  margin-top: 14px;
}
.overview-content > section {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.overview-section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 0 0 9px;
  color: var(--text);
  font-size: 14px;
}
.overview-section-title small {
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 400;
}
.ov-group {
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
}
.ov-group:last-child {
  margin-bottom: 0;
}
.ov-group-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 8px;
}
.ov-group-title i {
  width: 8px;
  height: 8px;
  border-radius: 3px;
  background: var(--grp-color, #6f9ee8);
  align-self: center;
}
.ov-group-title small {
  font-size: 10.5px;
  font-weight: 400;
  color: var(--text-dim);
  margin-left: auto;
}
.ov-grid {
  display: grid;
  /* 自适应三列（参考图排版）：窄栏自动降为两列/一列 */
  grid-template-columns: repeat(auto-fill, minmax(176px, 1fr));
  grid-auto-rows: 1fr;
  gap: 10px;
}
.ov-card {
  min-height: 104px;
  background: rgba(20, 22, 28, 0.72);
  border: 1.5px solid var(--grp-color, #6f9ee8);
  border-radius: 12px;
  padding: 14px 10px 11px;
  cursor: pointer;
  transition: all 0.18s;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  text-align: center;
}
.ov-card:hover {
  background: var(--bg-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.38);
  filter: brightness(1.12);
}
.ov-card .ico {
  font-size: 30px;
  line-height: 1.1;
}
.ov-card .t {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--grp-color, #6f9ee8);
  word-break: break-word;
  line-height: 1.35;
}
.ov-card .meta {
  font-size: 10.5px;
  color: var(--text-dim);
}
.ov-card .meta b {
  color: var(--text);
  font-size: 12px;
}
.smart-item.clickable {
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.15s;
}
.smart-item.clickable:hover {
  background: var(--bg-hover, rgba(122, 168, 255, 0.08));
}

.topo-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: linear-gradient(160deg, rgba(35, 39, 51, 0.96), rgba(29, 31, 39, 0.94));
  border: 1px solid var(--border);
  border-radius: var(--r-l);
  padding: 13px 13px 9px;
}
.topo-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.topo-head .tt {
  font-size: 14px;
  font-weight: 600;
}
.legend {
  display: flex;
  gap: 14px;
  margin-left: auto;
  flex-wrap: wrap;
}
.legend span {
  font-size: 11px;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 5px;
}
.legend i {
  width: 9px;
  height: 9px;
  border-radius: 3px;
  display: inline-block;
}
.topo-svg {
  display: block;
  width: 100%;
  /* 随右侧栏高度自适应拉伸，viewBox 等比缩放居中 */
  flex: 1;
  min-height: 380px;
  overflow: visible;
}
.topo-svg .node {
  cursor: pointer;
  animation: nodeIn 0.45s ease both;
}
@keyframes nodeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.topo-svg .node rect.body {
  fill: #262a36;
  stroke: var(--nc);
  stroke-width: 1.4;
  transition: all 0.15s;
}
.topo-svg .node:hover rect.body {
  fill: #2f3444;
  filter: brightness(1.2);
}
.topo-svg .node:hover rect.glow {
  opacity: 0.55;
}
.topo-svg .edge {
  fill: none;
  stroke: #7183a8;
  stroke-width: 1.2;
  opacity: 0.58;
  stroke-dasharray: 4 5;
  transition: opacity 0.15s;
  animation: flow 3.5s linear infinite;
}
.topo-svg .edge:hover {
  opacity: 1;
  stroke-width: 2;
}
@keyframes flow {
  to {
    stroke-dashoffset: -18;
  }
}
.topo-svg text {
  pointer-events: none;
}
.topo-svg .edge-label {
  fill: #8e9ab1;
  font-size: 8px;
  opacity: 0.8;
}
.rel-chip {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--accent);
  margin: 2px 3px 2px 0;
  cursor: pointer;
}
.rel-chip:hover {
  background: rgba(111, 158, 232, 0.3);
}

/* ===== 全局搜索结果面板 ===== */
.search-results {
  margin: 0 0 16px;
}
.sr-head {
  font-size: 12.5px;
  color: var(--text-dim);
  margin: 0 0 8px;
}
.sr-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 8px;
}
.sr-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-m);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.sr-item:hover {
  background: var(--bg-hover);
  border-color: var(--accent);
}
.sr-ico {
  font-size: 16px;
  line-height: 1.3;
}
.sr-body {
  min-width: 0;
  flex: 1;
}
.sr-cat {
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.sr-cat small {
  font-weight: 400;
  font-size: 11px;
  color: var(--text-dim);
}
.sr-text {
  margin-top: 3px;
  font-size: 12px;
  color: var(--text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sr-item mark {
  background: rgba(122, 168, 255, 0.28);
  color: var(--text);
  border-radius: 3px;
  padding: 0 2px;
}
.sr-go {
  color: var(--text-dim);
  font-size: 13px;
  align-self: center;
}
.sr-item:hover .sr-go {
  color: var(--accent);
}

#toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-active);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 9px 20px;
  border-radius: var(--r-m);
  font-size: 13.5px;
  z-index: 200;
  opacity: 0;
  transition: opacity 0.25s;
  pointer-events: none;
  max-width: 80vw;
}
#toast.show {
  opacity: 1;
}

@media (max-width: 1180px) {
  .overview-content {
    grid-template-columns: 1fr;
  }
  .topo-svg {
    min-height: 0;
  }
}
@media (max-width: 720px) {
  body {
    display: block;
    overflow: auto;
  }
  .sidebar {
    width: 100%;
    min-width: 0;
    max-height: 42vh;
  }
  .main {
    min-height: 58vh;
    padding: 14px;
  }
  .overview-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .ov-grid {
    grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  }
  .topo-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .legend {
    margin-left: 0;
    gap: 8px;
  }
  .table-wrap {
    border: none;
    background: transparent;
    overflow: visible;
    box-shadow: none;
  }
  table,
  tbody {
    display: block;
  }
  thead {
    display: none;
  }
  tr {
    display: block;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-m);
    margin-bottom: 10px;
    padding: 4px 0;
  }
  td {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    border-bottom: 1px dashed var(--border-weak);
    padding: 7px 12px;
    min-width: 0;
    position: static;
    background: transparent;
  }
  td:last-child {
    border-bottom: none;
  }
  td::before {
    content: attr(data-label);
    color: var(--text-dim);
    font-size: 11px;
    flex: 0 0 auto;
  }
  td.op {
    justify-content: flex-end;
  }
  td.op::before {
    content: none;
  }
  td:empty::before {
    content: attr(data-label);
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
