:root {
  --abg-ink: #e9f2ef;
  --abg-muted: rgba(233, 242, 239, .66);
  --abg-line: rgba(255, 255, 255, .12);
  --abg-glass: rgba(8, 14, 17, .66);
  --abg-green: #40b889;
  --abg-blue: #5aa7c8;
  --abg-red: #b42d3a;
  --abg-amber: #d7a348;
}

.abg-root {
  position: fixed;
  inset: 0;
  z-index: 760;
  overflow: hidden;
  color: var(--abg-ink);
  background: #010203;
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  letter-spacing: 0;
}

.abg-space,
.abg-graph {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.abg-space { z-index: 1; }
.abg-graph { z-index: 4; }

.abg-vignette {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(0,0,0,.7), rgba(0,0,0,0) 24%, rgba(0,0,0,0) 72%, rgba(0,0,0,.62)),
    linear-gradient(180deg, rgba(0,0,0,.78), rgba(0,0,0,0) 26%, rgba(0,0,0,.72));
}

.abg-boundary,
.abg-kpis,
.abg-drawer,
.abg-source-dock,
.abg-legend,
.abg-rail button {
  border: 1px solid var(--abg-line);
  background: var(--abg-glass);
  box-shadow: 0 18px 46px rgba(0, 0, 0, .38);
  backdrop-filter: blur(18px) saturate(140%);
}

.abg-boundary {
  position: absolute;
  z-index: 12;
  top: 84px;
  left: 50%;
  display: flex;
  max-width: min(760px, calc(100vw - 40px));
  min-height: 40px;
  align-items: center;
  gap: 12px;
  border-radius: 8px;
  padding: 0 14px;
  transform: translateX(-50%);
  color: var(--abg-muted);
}
.abg-boundary strong { color: #fff4c7; font-size: 12px; white-space: nowrap; }
.abg-boundary span { font-size: 12px; line-height: 1.4; }

.abg-kpis {
  position: absolute;
  z-index: 10;
  top: 138px;
  left: 50%;
  display: grid;
  width: min(760px, calc(100vw - 40px));
  grid-template-columns: repeat(5, minmax(0, 1fr));
  overflow: hidden;
  border-radius: 8px;
  transform: translateX(-50%);
}
.abg-kpis div { min-width: 0; padding: 9px 11px; border-right: 1px solid var(--abg-line); }
.abg-kpis div:last-child { border-right: 0; }
.abg-kpis span { display: block; color: var(--abg-muted); font-size: 10px; }
.abg-kpis strong { display: block; margin-top: 3px; overflow: hidden; color: #fff; font-size: 17px; text-overflow: ellipsis; white-space: nowrap; }

.abg-title {
  position: absolute;
  z-index: 7;
  top: 220px;
  left: 50%;
  width: min(620px, calc(100vw - 120px));
  transform: translateX(-50%);
  text-align: center;
  pointer-events: none;
}
.abg-title span { display: block; color: rgba(233,242,239,.64); font-size: 12px; font-weight: 800; }
.abg-title strong { display: block; margin-top: 7px; color: #fff; font-size: clamp(28px, 4.6vw, 56px); line-height: 1.05; text-shadow: 0 0 28px rgba(90,167,200,.32); }
.abg-title small { display: block; margin-top: 10px; color: rgba(233,242,239,.72); font-size: 13px; }

.abg-watermark {
  position: absolute;
  z-index: 6;
  right: 24px;
  bottom: 86px;
  color: rgba(255,255,255,.12);
  font-size: 34px;
  font-weight: 900;
  pointer-events: none;
}

.abg-rail { position: absolute; z-index: 12; top: 158px; left: 18px; display: grid; gap: 9px; }
.abg-rail button { width: 42px; height: 42px; border-radius: 8px; color: var(--abg-ink); font-size: 16px; font-weight: 900; }
.abg-rail button.active { border-color: rgba(64,184,137,.72); background: rgba(24,53,45,.68); color: #fff; }

.abg-drawer {
  position: absolute;
  z-index: 11;
  top: 86px;
  bottom: 24px;
  width: min(360px, calc(100vw - 96px));
  border-radius: 8px;
  overflow: hidden;
  transition: transform 220ms ease, opacity 220ms ease;
}
.abg-drawer-left { left: 72px; transform: translateX(-430px); }
.abg-drawer-right { right: 18px; transform: translateX(430px); }
.abg-drawer.open { transform: translateX(0); opacity: 1; }
.abg-drawer:not(.open) { opacity: .15; pointer-events: none; }
.abg-drawer-head { display: flex; min-height: 60px; align-items: center; justify-content: space-between; padding: 13px 14px; border-bottom: 1px solid var(--abg-line); background: rgba(5, 9, 11, .36); }
.abg-drawer-head span { color: var(--abg-green); font-size: 11px; font-weight: 900; }
.abg-drawer-head strong { display: block; margin-top: 2px; color: #fff; font-size: 16px; }
.abg-drawer-head button { height: 30px; border: 1px solid var(--abg-line); border-radius: 6px; background: rgba(19,32,30,.68); color: var(--abg-ink); }
.abg-drawer-body { height: calc(100% - 60px); overflow-y: auto; padding: 12px; }

.abg-card {
  display: grid;
  width: 100%;
  gap: 5px;
  margin-bottom: 8px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 7px;
  background: rgba(16,27,26,.62);
  padding: 10px;
  color: inherit;
  text-align: left;
}
.abg-card.active,
.abg-card:hover { border-color: rgba(64,184,137,.46); background: rgba(23,49,41,.62); }
.abg-card strong { color: #fff; font-size: 13px; line-height: 1.35; }
.abg-card span,
.abg-card small { overflow-wrap: anywhere; color: var(--abg-muted); font-size: 11px; line-height: 1.45; }

.abg-detail-title { color: #fff; font-size: 18px; font-weight: 900; line-height: 1.35; }
.abg-token { margin: 10px 0; padding: 9px; border-radius: 6px; background: rgba(90,167,200,.13); color: #bfe9ff; font-size: 11px; overflow-wrap: anywhere; }
.abg-detail-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; margin-bottom: 10px; }
.abg-detail-grid div { min-width: 0; border: 1px solid rgba(255,255,255,.08); border-radius: 7px; background: rgba(8,13,15,.55); padding: 8px; }
.abg-detail-grid span { display: block; color: var(--abg-muted); font-size: 10px; }
.abg-detail-grid strong { display: block; margin-top: 3px; overflow: hidden; color: #fff; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.abg-field { display: grid; gap: 4px; margin-top: 8px; padding: 9px; border-radius: 7px; background: rgba(255,255,255,.04); }
.abg-field label { color: var(--abg-muted); font-size: 11px; }
.abg-field div { overflow-wrap: anywhere; color: #dbe5f1; font-size: 12px; }
.abg-relation-list { display: grid; gap: 6px; margin-top: 10px; }
.abg-relation-list span { overflow-wrap: anywhere; border-left: 3px solid rgba(90,167,200,.55); border-radius: 5px; background: rgba(90,167,200,.08); padding: 7px 8px; color: #dbeafe; font-size: 11px; }
.abg-notice { margin-top: 12px; padding: 10px; border-left: 3px solid var(--abg-amber); border-radius: 6px; background: rgba(58,42,12,.48); color: #ffe3a3; font-size: 12px; line-height: 1.5; }

.abg-source-dock {
  position: absolute;
  z-index: 10;
  left: 50%;
  bottom: 24px;
  display: flex;
  max-width: min(920px, calc(100vw - 40px));
  gap: 7px;
  overflow-x: auto;
  border-radius: 8px;
  padding: 8px;
  transform: translateX(-50%);
}
.abg-source-dock button {
  display: flex;
  flex: 0 0 auto;
  min-width: 140px;
  height: 38px;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 7px;
  background: rgba(7,13,16,.62);
  color: var(--abg-ink);
  padding: 0 10px;
  font-size: 11px;
  font-weight: 800;
}
.abg-source-dock button i { width: 9px; height: 9px; border-radius: 999px; background: #60a5fa; box-shadow: 0 0 16px #60a5fa; }
.abg-source-dock button.active,
.abg-source-dock button:hover { border-color: rgba(96,165,250,.58); background: rgba(20,43,64,.72); }
.abg-source-dock span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.abg-legend {
  position: absolute;
  z-index: 10;
  right: 18px;
  bottom: 24px;
  display: grid;
  gap: 6px;
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--abg-muted);
  font-size: 11px;
}
.abg-legend span { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.abg-legend i { width: 8px; height: 8px; border-radius: 99px; background: var(--c); box-shadow: 0 0 13px var(--c); }

@media (max-width: 920px) {
  .abg-boundary { top: 118px; align-items: flex-start; flex-direction: column; gap: 4px; padding: 8px 12px; }
  .abg-kpis { top: 184px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .abg-title { top: 320px; width: calc(100vw - 52px); }
  .abg-drawer { top: 112px; bottom: 82px; width: calc(100vw - 96px); }
  .abg-source-dock { right: 12px; left: 12px; bottom: 12px; max-width: none; transform: none; }
  .abg-legend { display: none; }
  .abg-watermark { display: none; }
}
