:root {
  color-scheme: light;
  --bg: #eef3f8;
  --ink: #172033;
  --muted: #68758a;
  --panel: #ffffff;
  --panel-2: #f8fbff;
  --line: #d8e2ee;
  --deep: #0b1828;
  --deep-2: #10263e;
  --blue: #1f66d1;
  --cyan: #12a7c8;
  --green: #19a974;
  --amber: #f0a126;
  --orange: #ec6b2e;
  --red: #d92d3a;
  --red-bg: #fff0f1;
  --shadow: 0 18px 50px rgba(18, 39, 65, 0.12);
  --radius: 8px;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(18, 54, 92, 0.06), transparent 360px),
    var(--bg);
}

button,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
}

.side-nav {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 22px 16px;
  color: #dbeafe;
  background: linear-gradient(180deg, #071524, #0e263e 56%, #0b1b2e);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 6px 8px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  color: white;
  background: linear-gradient(135deg, #1f66d1, #10b4d7);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(18, 167, 200, 0.25);
}

.brand-mark svg {
  width: 25px;
  height: 25px;
  fill: currentColor;
}

.brand strong,
.brand span {
  display: block;
}

.brand strong {
  font-size: 15px;
  letter-spacing: 0;
}

.brand span {
  margin-top: 3px;
  color: #91a7c2;
  font-size: 11px;
}

.nav-list {
  display: grid;
  gap: 8px;
}

.nav-item {
  height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 0 12px;
  color: #c6d5e8;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  text-align: left;
  font-size: 14px;
}

.nav-item:hover,
.nav-item.is-active {
  color: #fff;
  background: rgba(37, 99, 235, 0.18);
  border-color: rgba(148, 197, 255, 0.24);
}

.nav-icon {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  font-family: var(--mono);
  font-size: 13px;
}

.nav-foot {
  margin-top: auto;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.nav-foot span,
.nav-foot strong {
  display: block;
}

.nav-foot span {
  color: #91a7c2;
  font-size: 12px;
}

.nav-foot strong {
  margin-top: 5px;
  font-size: 14px;
}

.main {
  min-width: 0;
  padding: 24px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  margin-bottom: 20px;
}

.topbar h1 {
  margin: 0;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.16;
  letter-spacing: 0;
}

.topbar p {
  margin: 8px 0 0;
  max-width: 760px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.topbar-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 12px;
  color: #29445f;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 28px rgba(22, 52, 84, 0.08);
  font-size: 13px;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(25, 169, 116, 0.12);
}

.view {
  display: none;
}

.view.is-visible {
  display: block;
}

.hero-alert {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  padding: 22px;
  color: white;
  background:
    linear-gradient(90deg, rgba(217, 45, 58, 0.92), rgba(177, 30, 47, 0.88)),
    var(--red);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.hero-alert h2 {
  margin: 9px 0 7px;
  font-size: clamp(22px, 2.6vw, 32px);
  line-height: 1.2;
  letter-spacing: 0;
}

.hero-alert p {
  margin: 0;
  max-width: 820px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 15px;
  line-height: 1.7;
}

.severity-chip {
  display: inline-grid;
  place-items: center;
  min-width: 56px;
  height: 26px;
  padding: 0 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 800;
}

.severity-chip.critical {
  color: #fff;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.primary-action,
.secondary-action {
  min-height: 40px;
  padding: 0 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
}

.primary-action {
  flex: 0 0 auto;
  color: var(--red);
  background: white;
  border: 0;
}

.secondary-action {
  color: var(--deep);
  background: white;
  border: 1px solid var(--line);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0;
}

.metric-card {
  min-height: 112px;
  padding: 17px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 36px rgba(24, 47, 74, 0.08);
}

.metric-card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.metric-card strong {
  display: block;
  margin-top: 9px;
  font-size: 34px;
  line-height: 1;
  letter-spacing: 0;
}

.metric-card em {
  display: block;
  margin-top: 12px;
  color: #556478;
  font-size: 12px;
  font-style: normal;
}

.metric-card.danger strong {
  color: var(--red);
}

.content-grid {
  display: grid;
  gap: 18px;
}

.two-col {
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
}

.panel,
.report-page {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 14px 42px rgba(22, 52, 84, 0.08);
}

.panel {
  padding: 18px;
}

.panel-heading,
.section-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.panel-heading {
  margin-bottom: 14px;
}

.panel-heading h3,
.section-toolbar h2 {
  margin: 0;
}

.panel-heading h3 {
  font-size: 18px;
}

.panel-heading span,
.section-toolbar p {
  color: var(--muted);
}

.panel-heading span {
  font-size: 12px;
}

.section-toolbar {
  margin: 4px 0 16px;
}

.section-toolbar h2 {
  font-size: 25px;
  letter-spacing: 0;
}

.section-toolbar p {
  margin: 6px 0 0;
  font-size: 14px;
}

.conclusion-list,
.basis-stack {
  display: grid;
  gap: 12px;
}

.conclusion-item,
.basis-stack > div {
  padding: 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel-2);
}

.conclusion-item {
  border-left: 4px solid var(--blue);
}

.conclusion-item.danger {
  border-left-color: var(--red);
  background: var(--red-bg);
}

.conclusion-item.good {
  border-left-color: var(--green);
}

.conclusion-item.watch {
  border-left-color: var(--amber);
}

.conclusion-item strong,
.basis-stack b {
  display: block;
  font-size: 14px;
}

.conclusion-item p,
.basis-stack p {
  margin: 6px 0 0;
  color: #4e5c70;
  font-size: 13px;
  line-height: 1.65;
}

.segmented,
.filter-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.segmented {
  padding: 4px;
  background: #dfe8f2;
  border-radius: 8px;
}

.segmented button {
  min-height: 34px;
  padding: 0 12px;
  color: #4f6074;
  background: transparent;
  border: 0;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
}

.segmented button.is-selected {
  color: var(--deep);
  background: white;
  box-shadow: 0 4px 16px rgba(17, 30, 48, 0.12);
}

.topology-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
  align-items: stretch;
}

.topology-board {
  position: relative;
  min-height: 660px;
  overflow: hidden;
  padding: 18px;
  color: #e8f3ff;
  background:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    radial-gradient(circle at 28% 18%, rgba(31, 102, 209, 0.28), transparent 30%),
    #081625;
  background-size: 24px 24px, 24px 24px, auto, auto;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.topology-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.link-path {
  fill: none;
  stroke-width: 3.5;
  stroke-linecap: round;
  pointer-events: stroke;
  cursor: pointer;
}

.link-path.compliant {
  stroke: rgba(25, 169, 116, 0.95);
}

.link-path.controlled {
  stroke: rgba(157, 183, 213, 0.78);
  stroke-dasharray: 8 8;
}

.link-path.critical {
  stroke: var(--red);
  stroke-width: 5;
  filter: drop-shadow(0 0 9px rgba(217, 45, 58, 0.9));
  animation: pulse-link 1.4s infinite ease-in-out;
}

@keyframes pulse-link {
  0%,
  100% {
    opacity: 0.72;
  }
  50% {
    opacity: 1;
  }
}

.zone-lane {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr);
  gap: 14px;
  min-height: 92px;
  margin-bottom: 13px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 8px;
  background: rgba(7, 21, 36, 0.68);
  backdrop-filter: blur(6px);
}

.zone-label {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  min-width: 0;
}

.zone-label strong {
  font-size: 17px;
}

.zone-label span {
  color: #9bb3cc;
  font-size: 12px;
  line-height: 1.4;
}

.zone-assets {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.asset-node {
  position: relative;
  width: 178px;
  min-height: 74px;
  padding: 10px 10px 9px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.08);
}

.asset-node:focus,
.asset-node:hover {
  outline: 2px solid rgba(18, 167, 200, 0.75);
}

.asset-node .node-type {
  display: inline-block;
  margin-bottom: 7px;
  color: #b6d8ff;
  font-size: 11px;
}

.asset-node strong {
  display: block;
  color: white;
  font-size: 13px;
  line-height: 1.35;
}

.asset-node small {
  display: block;
  margin-top: 5px;
  color: #99adc4;
  font-family: var(--mono);
  font-size: 11px;
}

.asset-node.is-critical {
  border-color: rgba(217, 45, 58, 0.88);
  background: rgba(217, 45, 58, 0.16);
}

.detail-drawer {
  min-height: 660px;
  padding: 18px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.detail-drawer h3 {
  margin: 0 0 12px;
  font-size: 19px;
}

.detail-drawer .detail-meta {
  display: grid;
  gap: 10px;
}

.detail-block {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
}

.detail-block b {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
}

.detail-block p {
  margin: 0;
  color: #4d5a6b;
  font-size: 13px;
  line-height: 1.65;
}

.rules-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.rule-card {
  padding: 18px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(24, 47, 74, 0.07);
}

.rule-card header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.rule-card h3 {
  margin: 0;
  font-size: 17px;
  line-height: 1.35;
}

.rule-card dl {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 9px 12px;
  margin: 16px 0 0;
}

.rule-card dt {
  color: var(--muted);
  font-size: 12px;
}

.rule-card dd {
  margin: 0;
  color: #344155;
  font-size: 13px;
  line-height: 1.55;
}

.filter-row select {
  min-height: 38px;
  padding: 0 32px 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  font-size: 13px;
}

.finding-table {
  overflow: hidden;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.finding-row {
  display: grid;
  grid-template-columns: 88px minmax(250px, 1.25fr) 110px 132px 152px 156px 100px;
  gap: 12px;
  align-items: center;
  padding: 15px 16px;
  border-top: 1px solid var(--line);
}

.finding-row:first-child {
  border-top: 0;
}

.finding-row.header {
  min-height: 44px;
  color: #607083;
  background: #f4f8fc;
  font-size: 12px;
  font-weight: 800;
}

.finding-title {
  min-width: 0;
}

.finding-title strong {
  display: block;
  font-size: 14px;
}

.finding-title span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.status-pill,
.small-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.status-pill.danger,
.small-pill.danger {
  color: var(--red);
  background: var(--red-bg);
}

.status-pill.warn,
.small-pill.warn {
  color: #9a5a00;
  background: #fff7e6;
}

.small-pill.ok {
  color: #087a52;
  background: #eaf8f2;
}

.row-action {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--deep);
  font-size: 13px;
  font-weight: 700;
}

.report-page {
  padding: 30px;
}

.report-cover {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 18px;
  border-bottom: 2px solid #183a5c;
}

.report-cover h3 {
  margin: 0;
  font-size: 24px;
}

.report-cover p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.report-section {
  margin-top: 20px;
}

.report-section h4 {
  margin: 0 0 10px;
  font-size: 16px;
}

.report-section ul {
  margin: 0;
  padding-left: 20px;
}

.report-section li {
  margin: 8px 0;
  line-height: 1.65;
}

.report-topology-placeholder {
  min-height: 170px;
  display: grid;
  place-items: center;
  color: #dbeafe;
  background:
    linear-gradient(90deg, rgba(217, 45, 58, 0.16) 0 36%, transparent 36% 100%),
    linear-gradient(135deg, #0b1828, #153552);
  border-radius: 8px;
  border: 1px solid #244b71;
  text-align: center;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 10;
  transform: translateY(18px);
  opacity: 0;
  pointer-events: none;
  padding: 12px 14px;
  color: white;
  background: #10263e;
  border-radius: 8px;
  box-shadow: var(--shadow);
  transition: 0.2s ease;
  font-size: 13px;
}

.toast.is-visible {
  transform: translateY(0);
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 1120px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .side-nav {
    position: static;
    height: auto;
    padding: 14px;
  }

  .nav-list {
    display: flex;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .nav-item {
    flex: 0 0 auto;
    width: auto;
  }

  .nav-foot {
    display: none;
  }

  .topology-layout,
  .two-col {
    grid-template-columns: 1fr;
  }

  .detail-drawer {
    min-height: 0;
  }
}

@media (max-width: 820px) {
  .main {
    padding: 16px;
  }

  .topbar,
  .hero-alert,
  .section-toolbar,
  .panel-heading,
  .report-cover {
    flex-direction: column;
  }

  .topbar-actions,
  .primary-action,
  .secondary-action {
    width: 100%;
    justify-content: center;
  }

  .metric-grid,
  .rules-grid {
    grid-template-columns: 1fr;
  }

  .segmented,
  .filter-row {
    width: 100%;
    overflow-x: auto;
  }

  .nav-list {
    flex-wrap: wrap;
    overflow-x: visible;
  }

  .nav-item {
    flex: 1 1 calc(50% - 8px);
    justify-content: center;
  }

  .segmented button,
  .filter-row select {
    flex: 1 0 auto;
  }

  .topology-board {
    min-height: 760px;
    padding: 12px;
  }

  .zone-lane {
    grid-template-columns: 1fr;
  }

  .asset-node {
    width: min(100%, 220px);
  }

  .finding-table {
    overflow-x: auto;
  }

  .finding-row {
    min-width: 1060px;
  }

  .report-page {
    padding: 20px;
  }
}

.brand {
  position: relative;
}

.brand-text {
  min-width: 0;
  flex: 1;
}

.collapse-toggle,
.icon-button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: #cde4ff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
}

.collapse-toggle svg,
.icon-button svg,
.nav-icon svg,
.node-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.collapse-toggle svg {
  transition: transform 0.2s ease;
}

.nav-icon svg {
  width: 16px;
  height: 16px;
}

.sidebar-collapsed .app-shell {
  grid-template-columns: 82px minmax(0, 1fr);
}

.sidebar-collapsed .side-nav {
  padding-inline: 12px;
}

.sidebar-collapsed .brand {
  justify-content: center;
  padding-inline: 0;
}

.sidebar-collapsed .brand-text,
.sidebar-collapsed .nav-label,
.sidebar-collapsed .nav-foot {
  display: none;
}

.sidebar-collapsed .brand-mark {
  width: 42px;
  height: 42px;
}

.sidebar-collapsed .collapse-toggle {
  position: absolute;
  right: -9px;
  bottom: -17px;
  width: 28px;
  height: 28px;
  background: #132d48;
}

.sidebar-collapsed .collapse-toggle svg {
  transform: rotate(180deg);
}

.sidebar-collapsed .nav-item {
  justify-content: center;
  padding: 0;
}

.sidebar-collapsed .nav-icon {
  background: rgba(255, 255, 255, 0.1);
}

.overview-visual-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 18px;
  margin: 0 0 18px;
}

.flow-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.flow-step {
  position: relative;
  min-height: 132px;
  padding: 14px;
  overflow: hidden;
  color: #1d334d;
  text-align: left;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(244, 248, 252, 0.92)),
    radial-gradient(circle at 18% 14%, rgba(18, 167, 200, 0.18), transparent 44%);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(24, 47, 74, 0.07);
}

.flow-step::after {
  content: "";
  position: absolute;
  inset: auto 12px 12px auto;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(31, 102, 209, 0.16);
  border-radius: 50%;
  box-shadow: inset 0 0 0 9px rgba(31, 102, 209, 0.06);
}

.flow-step.is-hot {
  color: #621a22;
  background:
    linear-gradient(180deg, rgba(255, 245, 246, 0.95), rgba(255, 231, 234, 0.9)),
    radial-gradient(circle at 18% 14%, rgba(217, 45, 58, 0.2), transparent 44%);
  border-color: rgba(217, 45, 58, 0.28);
}

.flow-index {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-bottom: 12px;
  color: white;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  border-radius: 8px;
  font-size: 12px;
  font-weight: 900;
}

.flow-step.is-hot .flow-index {
  background: linear-gradient(135deg, var(--red), var(--orange));
}

.flow-step strong,
.flow-step small {
  display: block;
}

.flow-step strong {
  font-size: 14px;
}

.flow-step small {
  margin-top: 8px;
  color: #5d6b7e;
  font-size: 12px;
  line-height: 1.55;
}

.chart-combo {
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  min-height: 132px;
}

.donut-chart {
  position: relative;
  display: grid;
  place-items: center;
  width: 142px;
  height: 142px;
  margin: auto;
  background:
    radial-gradient(circle at 34% 30%, rgba(255, 255, 255, 0.9), transparent 17%),
    radial-gradient(circle, white 0 43%, transparent 44%),
    conic-gradient(var(--red) 0 34%, var(--amber) 34% 67%, var(--green) 67% 100%);
  border-radius: 50%;
  box-shadow:
    inset -12px -12px 24px rgba(10, 34, 58, 0.12),
    0 16px 30px rgba(22, 52, 84, 0.14);
}

.donut-chart span,
.donut-chart small {
  position: relative;
  z-index: 1;
  display: block;
  text-align: center;
}

.donut-chart span {
  font-size: 32px;
  font-weight: 900;
  line-height: 1;
  color: var(--red);
}

.donut-chart small {
  margin-top: -28px;
  color: #65758a;
  font-size: 12px;
  font-weight: 800;
}

.bar-chart {
  display: flex;
  gap: 8px;
  align-items: end;
  justify-content: space-around;
  min-height: 140px;
  padding: 12px 2px 0 8px;
  border-left: 1px dashed var(--line);
}

.bar-item {
  display: grid;
  justify-items: center;
  gap: 6px;
  min-width: 32px;
  color: #526276;
  font-size: 12px;
}

.bar-item span {
  width: 22px;
  border-radius: 7px 7px 3px 3px;
  box-shadow:
    inset -6px -8px 12px rgba(0, 0, 0, 0.12),
    0 10px 18px rgba(22, 52, 84, 0.12);
}

.bar-item b {
  color: var(--deep);
}

.topology-status-rail {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.topology-status-rail div {
  padding: 12px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 26px rgba(24, 47, 74, 0.06);
}

.topology-status-rail b,
.topology-status-rail span {
  display: block;
}

.topology-status-rail b {
  color: #1e3858;
  font-size: 13px;
}

.topology-status-rail span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.topology-board {
  min-height: 760px;
  padding: 0;
  background:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    radial-gradient(circle at 22% 18%, rgba(18, 167, 200, 0.22), transparent 28%),
    radial-gradient(circle at 76% 72%, rgba(217, 45, 58, 0.13), transparent 34%),
    #081625;
  background-size: 28px 28px, 28px 28px, auto, auto, auto;
}

.topology-svg {
  pointer-events: none;
  z-index: 2;
}

.link-path {
  pointer-events: stroke;
}

.link-pulse {
  fill: #bfefff;
  filter: drop-shadow(0 0 8px rgba(18, 167, 200, 0.8));
  pointer-events: none;
}

.link-pulse.danger {
  fill: #fff1f2;
  filter: drop-shadow(0 0 10px rgba(217, 45, 58, 0.95));
}

.topology-mode-caption {
  position: absolute;
  left: 18px;
  top: 16px;
  z-index: 5;
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 9px 12px;
  color: #e8f3ff;
  background: rgba(7, 21, 36, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  backdrop-filter: blur(8px);
}

.topology-mode-caption strong {
  font-size: 14px;
}

.topology-mode-caption span {
  color: #9fb8d4;
  font-size: 12px;
}

.domain-box {
  position: absolute;
  z-index: 0;
  display: flex;
  flex-direction: column;
  justify-content: end;
  padding: 16px;
  color: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.domain-box b {
  color: rgba(255, 255, 255, 0.92);
  font-size: 18px;
}

.domain-box span {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.5;
}

.production-box {
  inset: 74px 48% 128px 18px;
  background: linear-gradient(135deg, rgba(31, 102, 209, 0.18), rgba(18, 167, 200, 0.08));
}

.information-box {
  inset: 74px 15% 128px 53%;
  background: linear-gradient(135deg, rgba(25, 169, 116, 0.16), rgba(31, 102, 209, 0.06));
}

.external-box {
  inset: 74px 18px 128px 87%;
  padding-inline: 10px;
  background: linear-gradient(135deg, rgba(240, 161, 38, 0.12), rgba(217, 45, 58, 0.08));
}

.boundary-line {
  position: absolute;
  z-index: 1;
  top: 80px;
  bottom: 130px;
  border-left: 2px dashed rgba(255, 255, 255, 0.28);
}

.boundary-line span {
  position: absolute;
  left: -12px;
  top: 20px;
  writing-mode: vertical-rl;
  color: #bfd5ed;
  font-size: 12px;
  letter-spacing: 0;
}

.boundary-prod-info {
  left: 51%;
}

.boundary-info-external {
  left: 86%;
}

.bus-line {
  position: absolute;
  z-index: 1;
  left: 5%;
  right: 18%;
  height: 32px;
  border: 1px solid rgba(148, 197, 255, 0.18);
  border-radius: 8px;
  background: rgba(8, 22, 37, 0.66);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.bus-line span {
  position: absolute;
  left: 12px;
  top: 7px;
  color: #9fb8d4;
  font-size: 12px;
}

.bus-realtime {
  top: 29%;
}

.bus-nonreal {
  top: 55%;
}

.bus-info {
  top: 42%;
  left: 54%;
  right: 5%;
}

.asset-node {
  position: absolute;
  left: var(--x);
  top: var(--y);
  z-index: 5;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 3px 8px;
  width: 150px;
  min-height: 90px;
  transform: translate(-50%, -50%);
  padding: 11px;
  text-align: left;
  color: #e8f3ff;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.07)),
    rgba(8, 22, 37, 0.84);
  border-color: rgba(179, 216, 255, 0.18);
  backdrop-filter: blur(7px);
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    opacity 0.18s ease;
}

.asset-node:hover,
.asset-node:focus {
  transform: translate(-50%, -52%);
}

.asset-node.is-muted {
  opacity: 0.46;
}

.node-icon {
  grid-row: 1 / span 3;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  color: #8fe6ff;
  background: rgba(18, 167, 200, 0.12);
  border: 1px solid rgba(18, 167, 200, 0.2);
  border-radius: 8px;
}

.asset-node.is-critical .node-icon {
  color: #fff0f1;
  background: rgba(217, 45, 58, 0.18);
  border-color: rgba(217, 45, 58, 0.32);
}

.asset-node .node-type {
  margin: 0;
  font-size: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-node strong {
  font-size: 12px;
}

.asset-node strong,
.asset-node small {
  grid-column: 2;
}

.asset-node small {
  margin-top: 1px;
  font-size: 10px;
}

.scan-beacon {
  position: absolute;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 9px;
  color: #ccefff;
  background: rgba(7, 21, 36, 0.72);
  border: 1px solid rgba(18, 167, 200, 0.28);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 11px;
}

.scan-beacon span {
  width: 8px;
  height: 8px;
  background: var(--cyan);
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(18, 167, 200, 0.5);
  animation: beacon 1.8s infinite;
}

.beacon-a {
  left: 9%;
  bottom: 78px;
}

.beacon-b {
  left: 38%;
  bottom: 78px;
}

.beacon-c {
  right: 10%;
  bottom: 78px;
}

@keyframes beacon {
  0% {
    box-shadow: 0 0 0 0 rgba(18, 167, 200, 0.55);
  }
  70% {
    box-shadow: 0 0 0 12px rgba(18, 167, 200, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(18, 167, 200, 0);
  }
}

.topology-legend {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  color: #bfd5ed;
  background: rgba(7, 21, 36, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  backdrop-filter: blur(8px);
  font-size: 12px;
}

.legend-line {
  display: inline-block;
  width: 34px;
  height: 3px;
  margin-right: 7px;
  vertical-align: middle;
  border-radius: 999px;
}

.legend-line.ok {
  background: var(--green);
}

.legend-line.warn {
  background: #8ea1b7;
}

.legend-line.danger {
  height: 5px;
  background: var(--red);
  box-shadow: 0 0 10px rgba(217, 45, 58, 0.8);
}

.rule-toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
}

.segmented.compact button {
  min-height: 36px;
}

.rule-card {
  position: relative;
  overflow: hidden;
}

.rule-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--blue), var(--cyan));
}

.rule-card .rule-edit-button {
  margin-top: 16px;
}

.rules-grid.is-table {
  display: block;
  overflow-x: auto;
}

.rule-table {
  min-width: 900px;
  overflow: hidden;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.rule-table-row {
  display: grid;
  grid-template-columns: 92px minmax(220px, 1fr) 130px minmax(260px, 1.2fr) 96px;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border-top: 1px solid var(--line);
}

.rule-table-row:first-child {
  border-top: 0;
}

.rule-table-row.header {
  color: #607083;
  background: #f4f8fc;
  font-size: 12px;
  font-weight: 800;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(6, 18, 30, 0.56);
}

.modal-backdrop.is-visible {
  display: flex;
}

.rule-editor {
  width: min(720px, 100%);
  max-height: min(860px, calc(100vh - 40px));
  overflow: auto;
  padding: 20px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}

.modal-head,
.modal-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.modal-head h3 {
  margin: 0;
}

.icon-button {
  flex: 0 0 auto;
  color: #334963;
  background: #f4f8fc;
  border-color: var(--line);
}

.rule-editor label {
  display: grid;
  gap: 7px;
  margin-top: 14px;
  color: #536275;
  font-size: 13px;
  font-weight: 800;
}

.rule-editor input,
.rule-editor select,
.rule-editor textarea {
  width: 100%;
  padding: 10px 11px;
  color: var(--ink);
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  font-size: 14px;
}

.rule-editor textarea {
  resize: vertical;
}

.modal-actions {
  justify-content: flex-end;
  margin-top: 18px;
}

.primary-save {
  min-height: 40px;
  padding: 0 16px;
  color: white;
  background: var(--blue);
  border: 0;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 800;
}

@media (max-width: 1120px) {
  .sidebar-collapsed .app-shell {
    grid-template-columns: 1fr;
  }

  .collapse-toggle {
    display: none;
  }

  .brand-text,
  .sidebar-collapsed .brand-text {
    display: block;
  }

  .sidebar-collapsed .nav-label {
    display: inline;
  }

  .overview-visual-grid {
    grid-template-columns: 1fr;
  }

  .flow-strip {
    grid-template-columns: repeat(5, minmax(160px, 1fr));
    overflow-x: auto;
    padding-bottom: 2px;
  }
}

@media (max-width: 820px) {
  .overview-visual-grid,
  .chart-combo,
  .topology-status-rail {
    grid-template-columns: 1fr;
  }

  .chart-combo {
    justify-items: center;
  }

  .bar-chart {
    width: 100%;
    border-left: 0;
    border-top: 1px dashed var(--line);
  }

  .rule-toolbar {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .topology-board {
    min-height: 980px;
  }

  .topology-mode-caption {
    right: 12px;
    left: 12px;
    flex-direction: column;
    gap: 3px;
  }

  .domain-box {
    padding: 10px;
  }

  .domain-box b {
    font-size: 13px;
  }

  .domain-box span {
    display: none;
  }

  .production-box {
    inset: 82px 50% 138px 10px;
  }

  .information-box {
    inset: 82px 11px 138px 52%;
  }

  .external-box {
    inset: auto 11px 70px 52%;
    height: 58px;
  }

  .boundary-prod-info {
    left: 50.5%;
  }

  .boundary-info-external {
    display: none;
  }

  .bus-line {
    left: 6%;
    right: 6%;
  }

  .bus-info {
    left: 54%;
    right: 6%;
  }

  .asset-node {
    width: 138px;
    min-height: 92px;
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 2px 7px;
    padding: 9px;
  }

  .node-icon {
    width: 28px;
    height: 28px;
  }

  .asset-node .node-type {
    font-size: 9px;
  }

  .asset-node strong {
    font-size: 11px;
  }

  .asset-node small {
    font-size: 10px;
  }

  .topology-legend {
    left: 10px;
    right: 10px;
    bottom: 10px;
  }

  .scan-beacon {
    display: none;
  }
}

@media (max-width: 520px) {
  .topology-board {
    min-height: 1040px;
  }

  .asset-node {
    width: 126px;
  }

  .flow-step {
    min-height: 118px;
  }
}

/* Final product polish: tighter type scale and cleaner topology reading. */
:root {
  --text-xs: 11px;
  --text-sm: 12px;
  --text-md: 14px;
  --text-lg: 16px;
  --text-xl: 20px;
  --text-2xl: 28px;
}

body {
  font-size: var(--text-md);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.brand {
  align-items: flex-start;
}

.brand-text strong {
  display: grid;
  gap: 2px;
  color: #f4f8ff;
  font-size: 15px;
  line-height: 1.16;
  font-weight: 850;
}

.brand-text strong span {
  margin: 0;
  color: inherit;
  font-size: inherit;
}

.brand-text > span {
  margin-top: 7px;
  font-size: var(--text-xs);
  line-height: 1.25;
}

.nav-item,
.topbar p,
.hero-alert p,
.metric-card span,
.metric-card em,
.section-toolbar p,
.panel-heading span,
.basis-stack p,
.conclusion-item p,
.detail-block p,
.rule-card dd,
.finding-title span,
.report-section li {
  font-size: 13px;
  line-height: 1.62;
}

.topbar h1 {
  font-size: clamp(26px, 2.5vw, 32px);
  line-height: 1.22;
}

.section-toolbar h2 {
  font-size: 24px;
  line-height: 1.24;
}

.hero-alert h2 {
  font-size: clamp(24px, 2.2vw, 30px);
}

.metric-card strong {
  font-size: 32px;
}

.topbar-actions {
  border: 1px solid var(--line);
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

.topbar-actions:hover,
.topbar-actions:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(31, 102, 209, 0.34);
  box-shadow: 0 12px 30px rgba(22, 52, 84, 0.14);
  outline: none;
}

.topbar-actions::after {
  content: "查看数据";
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
}

.topology-layout {
  grid-template-columns: minmax(0, 1fr) 320px;
}

.topology-board {
  min-height: 590px;
  padding: 16px;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(247, 250, 254, 0.96)),
    #f8fbff;
  border: 1px solid #d9e5f1;
  box-shadow: 0 14px 34px rgba(22, 52, 84, 0.08);
}

.topology-svg {
  pointer-events: auto;
  z-index: 2;
}

.topology-clean-head {
  position: relative;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
  padding: 12px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.topology-clean-head strong,
.topology-clean-head span {
  display: block;
}

.topology-clean-head strong {
  color: #162840;
  font-size: 15px;
}

.topology-clean-head span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.topology-clean-head .topology-legend {
  position: static;
  inset: auto;
  width: auto;
  padding: 0;
  color: #53647a;
  background: transparent;
  border: 0;
  backdrop-filter: none;
}

.topology-clean-grid {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  align-items: stretch;
}

.clean-zone {
  min-width: 0;
  min-height: 410px;
  padding: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(246, 250, 254, 0.92)),
    white;
  border: 1px solid #dbe7f3;
  border-radius: 8px;
}

.clean-zone.is-warn {
  border-color: rgba(236, 107, 46, 0.28);
  background: linear-gradient(180deg, #fffaf6, #ffffff);
}

.clean-zone.is-danger {
  border-color: rgba(217, 45, 58, 0.3);
  background: linear-gradient(180deg, #fff7f8, #ffffff);
}

.clean-zone header {
  min-height: 78px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e4edf6;
}

.clean-zone header b,
.clean-zone header span,
.clean-zone header small {
  display: block;
}

.clean-zone header b {
  color: #162840;
  font-size: 17px;
  line-height: 1.25;
}

.clean-zone header span {
  margin-top: 4px;
  color: #465a72;
  font-size: 12px;
  font-weight: 800;
}

.clean-zone header small {
  margin-top: 5px;
  color: #7a899b;
  font-size: 11px;
  line-height: 1.35;
}

.clean-zone-assets {
  display: grid;
  gap: 10px;
  padding-top: 12px;
}

.topology-board .asset-node {
  position: relative;
  left: auto;
  top: auto;
  z-index: 5;
  width: 100%;
  min-width: 0;
  min-height: 74px;
  transform: none;
  display: grid;
  grid-template-columns: 1fr;
  gap: 5px;
  padding: 9px;
  color: #1a2a3f;
  background: white;
  border: 1px solid #dbe7f3;
  box-shadow: 0 8px 18px rgba(22, 52, 84, 0.06);
  backdrop-filter: none;
}

.topology-board .asset-node:hover,
.topology-board .asset-node:focus {
  transform: translateY(-1px);
  border-color: rgba(31, 102, 209, 0.34);
  box-shadow: 0 12px 24px rgba(22, 52, 84, 0.1);
}

.topology-board .asset-node.is-critical {
  background: #fff7f8;
  border-color: rgba(217, 45, 58, 0.38);
  box-shadow: 0 10px 22px rgba(217, 45, 58, 0.1);
}

.topology-board .asset-node.is-muted {
  opacity: 0.58;
}

.topology-board .node-icon {
  width: 28px;
  height: 28px;
  color: var(--blue);
  background: #eef6ff;
  border-color: #cfe2f8;
}

.topology-board .asset-node span,
.topology-board .asset-node strong,
.topology-board .asset-node small {
  min-width: 0;
}

.topology-board .asset-node.is-critical .node-icon {
  color: var(--red);
  background: #fff0f1;
  border-color: rgba(217, 45, 58, 0.24);
}

.topology-board .asset-node .node-type {
  color: #63748a;
  font-size: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topology-board .asset-node strong {
  color: #172033;
  font-size: 12px;
  line-height: 1.35;
  word-break: keep-all;
  overflow-wrap: anywhere;
  overflow: hidden;
}

.topology-board .asset-node small {
  color: #6d7f93;
  font-family: var(--mono);
  font-size: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topology-scan-note {
  position: relative;
  z-index: 4;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.topology-scan-note span {
  padding: 7px 9px;
  color: #53647a;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 12px;
}

.topology-scan-note b {
  color: #1d3c62;
}

.link-path {
  stroke-width: 2.5;
  opacity: 0.82;
}

.link-path.controlled {
  stroke: #9aaabd;
  stroke-dasharray: 7 7;
}

.link-path.compliant {
  stroke: var(--green);
}

.link-path.critical {
  stroke-width: 4;
  opacity: 0.96;
}

.link-pulse {
  fill: #1f66d1;
}

.detail-drawer {
  min-height: 0;
  padding: 16px;
  background:
    linear-gradient(180deg, #ffffff, #f8fbff);
  border-color: #dce7f3;
  box-shadow: 0 14px 34px rgba(22, 52, 84, 0.08);
}

.drawer-head {
  margin-bottom: 12px;
  padding: 14px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.drawer-head h3 {
  margin: 10px 0 6px;
  color: #172033;
  font-size: 17px;
  line-height: 1.38;
}

.drawer-head p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.detail-drawer .detail-meta {
  gap: 9px;
}

.detail-block {
  background: white;
  border-color: #dce7f3;
}

.detail-block b {
  color: #21354f;
  font-size: 12px;
}

.detail-block p {
  color: #4e5d70;
  font-size: 12px;
}

@media (max-width: 1120px) {
  .topology-layout {
    grid-template-columns: 1fr;
  }

  .topology-clean-grid {
    grid-template-columns: repeat(3, minmax(180px, 1fr));
  }

  .clean-zone {
    min-height: 0;
  }
}

@media (max-width: 1400px) {
  .topology-layout {
    grid-template-columns: 1fr;
  }

  .detail-drawer {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
  }

  .detail-drawer .detail-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .topbar h1 {
    font-size: 25px;
  }

  .topbar-actions::after {
    display: none;
  }

  .topology-board {
    min-height: 0;
    padding: 12px;
  }

  .topology-clean-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .topology-clean-grid {
    grid-template-columns: 1fr;
  }

  .clean-zone header {
    min-height: 0;
  }

  .topology-svg {
    display: none;
  }

  .detail-drawer,
  .detail-drawer .detail-meta {
    grid-template-columns: 1fr;
  }
}

/* Topology redesign: clear zones, 3D SVG device icons, adaptive details. */
.detail-toggle {
  display: none;
}

.topology-layout {
  grid-template-columns: minmax(0, 1fr) 336px;
  gap: 16px;
}

.topology-board {
  min-height: 620px;
  padding: 16px;
  overflow: hidden;
  color: #15243a;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.88), rgba(239, 246, 255, 0.96)),
    radial-gradient(circle at 20% 14%, rgba(37, 99, 235, 0.14), transparent 30%),
    radial-gradient(circle at 82% 72%, rgba(15, 169, 210, 0.13), transparent 34%);
  border: 1px solid #d7e4f2;
  box-shadow: 0 18px 42px rgba(18, 39, 65, 0.1);
}

.topology-clean-head {
  margin-bottom: 14px;
  padding: 12px 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 252, 255, 0.96));
  border-color: #d9e6f3;
  box-shadow: 0 10px 26px rgba(22, 52, 84, 0.06);
}

.topology-clean-head strong {
  font-size: 16px;
}

.tech-zone-grid {
  position: relative;
  isolation: isolate;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.tech-link-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: auto;
}

.tech-zone {
  position: relative;
  z-index: 3;
  min-width: 0;
  min-height: 430px;
  padding: 13px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(245, 250, 255, 0.86)),
    linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(148, 163, 184, 0.05));
  border: 1px solid rgba(135, 159, 188, 0.3);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    0 12px 28px rgba(22, 52, 84, 0.06);
}

.tech-zone::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background-image:
    linear-gradient(rgba(31, 102, 209, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(31, 102, 209, 0.045) 1px, transparent 1px);
  background-size: 18px 18px;
  mask-image: linear-gradient(180deg, #000, transparent 86%);
}

.tech-zone.is-warn {
  border-color: rgba(240, 161, 38, 0.34);
  background:
    linear-gradient(180deg, rgba(255, 252, 245, 0.86), rgba(248, 250, 252, 0.92)),
    linear-gradient(135deg, rgba(240, 161, 38, 0.12), rgba(37, 99, 235, 0.04));
}

.tech-zone.is-danger {
  border-color: rgba(217, 45, 58, 0.34);
  background:
    linear-gradient(180deg, rgba(255, 247, 248, 0.88), rgba(248, 250, 252, 0.94)),
    linear-gradient(135deg, rgba(217, 45, 58, 0.12), rgba(37, 99, 235, 0.04));
}

.tech-zone header {
  min-height: 82px;
  padding: 0 0 12px;
  border-bottom: 1px solid rgba(143, 161, 184, 0.24);
}

.tech-zone header b {
  color: #12223a;
  font-size: 20px;
  letter-spacing: 0;
}

.tech-zone header span {
  color: #1f4269;
  font-size: 12px;
}

.tech-zone header small {
  color: #718197;
  font-size: 11px;
}

.clean-zone-assets {
  gap: 12px;
  padding-top: 14px;
}

.topology-board .tech-device {
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 5px 10px;
  min-height: 86px;
  padding: 11px;
  color: #172033;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 251, 255, 0.94));
  border: 1px solid rgba(189, 205, 224, 0.82);
  box-shadow:
    0 16px 28px rgba(22, 52, 84, 0.09),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
  transform: translateY(0);
}

.topology-board .tech-device:hover,
.topology-board .tech-device:focus {
  transform: translateY(-3px);
  border-color: rgba(37, 99, 235, 0.42);
  box-shadow:
    0 20px 34px rgba(22, 52, 84, 0.14),
    0 0 0 3px rgba(37, 99, 235, 0.08);
}

.topology-board .tech-device.is-critical {
  background:
    linear-gradient(180deg, rgba(255, 250, 250, 0.98), rgba(255, 242, 244, 0.96));
  border-color: rgba(217, 45, 58, 0.36);
  box-shadow:
    0 18px 32px rgba(217, 45, 58, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.topology-board .tech-device .node-icon {
  grid-row: 1 / span 3;
  width: 48px;
  height: 48px;
  background: transparent;
  border: 0;
}

.device-svg {
  display: block;
  width: 48px;
  height: 48px;
  transform: perspective(320px) rotateX(7deg) rotateY(-8deg);
  transition: transform 0.2s ease;
}

.topology-board .node-icon .device-svg {
  width: 48px;
  height: 48px;
}

.tech-device:hover .device-svg,
.tech-device:focus .device-svg {
  transform: perspective(320px) rotateX(5deg) rotateY(-4deg) translateY(-2px);
}

.topology-board .tech-device .node-type {
  grid-column: 2;
  margin: 0;
  color: #64748b;
  font-size: 10px;
  line-height: 1.25;
}

.topology-board .tech-device strong {
  grid-column: 2;
  color: #111827;
  font-size: 12px;
  line-height: 1.32;
}

.topology-board .tech-device small {
  grid-column: 2;
  color: #617086;
  font-family: var(--mono);
  font-size: 10px;
}

.link-path {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.88;
  pointer-events: stroke;
}

.link-path.compliant {
  stroke: #0f9f78;
}

.link-path.controlled {
  stroke: #7e91a8;
  stroke-dasharray: 8 8;
}

.link-path.critical {
  stroke: #dc2638;
  stroke-width: 5;
  stroke-dasharray: 12 8;
  filter: drop-shadow(0 0 8px rgba(220, 38, 56, 0.55));
  animation: danger-flow 1.2s linear infinite;
}

.link-pulse {
  fill: #2563eb;
  filter: drop-shadow(0 0 7px rgba(37, 99, 235, 0.65));
}

.link-pulse.danger {
  fill: #fff1f2;
  filter: drop-shadow(0 0 12px rgba(220, 38, 56, 0.9));
}

@keyframes danger-flow {
  to {
    stroke-dashoffset: -40;
  }
}

.topology-scan-note {
  margin-top: 14px;
}

.topology-scan-note span {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(247, 251, 255, 0.9));
  border-color: rgba(188, 205, 224, 0.75);
}

.detail-drawer {
  align-self: start;
}

.drawer-head {
  background:
    linear-gradient(180deg, #ffffff, #f8fbff);
  box-shadow: 0 10px 22px rgba(22, 52, 84, 0.06);
}

@media (min-width: 1401px) {
  .detail-drawer {
    display: block;
  }
}

@media (max-width: 1400px) {
  .detail-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .topology-layout {
    grid-template-columns: 1fr;
  }

  .detail-drawer {
    display: none;
  }

  .detail-panel-open .detail-drawer {
    display: grid;
  }
}

@media (max-width: 1120px) {
  .tech-zone-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tech-zone {
    min-height: 0;
  }
}

@media (max-width: 820px) {
  .section-toolbar {
    gap: 12px;
  }

  .section-toolbar .segmented {
    order: 2;
  }

  .detail-toggle {
    order: 3;
    width: 100%;
  }

  .topology-board {
    min-height: 0;
    padding: 12px;
  }

  .topology-clean-head {
    padding: 12px;
  }

  .topology-clean-head .topology-legend {
    gap: 8px;
  }

  .tech-zone-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .tech-zone {
    min-height: 0;
    padding: 12px;
  }

  .tech-zone header {
    min-height: 0;
  }

  .clean-zone-assets {
    gap: 9px;
  }

  .topology-board .tech-device {
    grid-template-columns: 44px minmax(0, 1fr);
    min-height: 78px;
  }

  .topology-board .tech-device .node-icon,
  .device-svg,
  .topology-board .node-icon .device-svg {
    width: 44px;
    height: 44px;
  }

  .tech-link-layer {
    display: none;
  }

  .detail-panel-open .detail-drawer {
    display: block;
  }
}
