:root {
  --shadow-card: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
  --shadow-elevated: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  --backdrop-panel: blur(8px);
}

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

    html,
    body {
      width: 100%;
      height: 100%;
      overflow: hidden;
      font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
      background: #f8fafc;
      color: #1e293b;
      -webkit-font-smoothing: antialiased;
    }

    #main-layout {
      display: flex;
      flex-direction: column;
      width: 100%;
      height: 100%;
    }

    .btn-tool {
      padding: 5px 12px;
      border: 1px solid #cbd5e1;
      background: #fff;
      border-radius: 6px;
      cursor: pointer;
      color: #334155;
      font-size: 14px;
      font-weight: 500;
      display: inline-flex;
      align-items: center;
      gap: 5px;
      transition: all 0.2s ease;
      user-select: none;
    }

    .btn-tool:hover {
      background: #f1f5f9;
      border-color: #94a3b8;
      color: #0f172a;
    }

    .btn-tool:active {
      transform: translateY(1px);
    }

    .btn-tool:disabled {
      opacity: 0.45;
      cursor: not-allowed;
      background: #f8fafc;
    }

    .btn-tool.primary {
      background: #2563eb;
      color: #fff;
      border-color: #2563eb;
    }

    .btn-tool.primary:hover {
      background: #1d4ed8;
      border-color: #1d4ed8;
    }

    .btn-tool.active-tool {
      background: #eff6ff;
      border-color: #3b82f6;
      color: #2563eb;
      font-weight: 600;
    }

    /* 顶部导航栏 */
    #toolbar,
    #header {
      height: 48px;
      background: #ffffff;
      border-bottom: 1px solid #e2e8f0;
      display: flex;
      align-items: center;
      padding: 0 16px;
      gap: 10px;
      flex-shrink: 0;
      box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
      z-index: 30;
    }

    #toolbar .brand-group,
    #header .brand-group {
      display: flex;
      align-items: center;
      gap: 6px;
    }

    #toolbar .brand,
    #header .brand {
      font-size: 17px;
      font-weight: 700;
      color: #0f172a;
      letter-spacing: -0.2px;
    }

    .separator,
    #toolbar .separator,
    #header .separator {
      width: 1px;
      height: 22px;
      background: #e2e8f0;
      margin: 0 4px;
    }

    /* 场景切换 Tabs */
    .scene-tabs {
      display: flex;
      gap: 6px;
      align-items: center;
    }

    .scene-tabs .tab {
      padding: 5px 12px;
      font-size: 14px;
      font-weight: 500;
      color: #64748b;
      cursor: pointer;
      border-radius: 6px;
      transition: all 0.2s ease;
      background: transparent;
      display: flex;
      align-items: center;
      gap: 5px;
      text-decoration: none;
      border: 1px solid transparent;
    }

    .scene-tabs .tab:hover {
      background: #f1f5f9;
      color: #1e293b;
    }

    .scene-tabs .tab.active {
      background: #eff6ff;
      border-color: #bfdbfe;
      color: #2563eb;
      font-weight: 600;
    }

    .badge-sub {
      font-size: 12px;
      padding: 1px 6px;
      background: #3b82f6;
      color: #ffffff;
      border-radius: 10px;
      font-weight: 600;
    }

    /* 二级面包屑导航栏 */
    #breadcrumb-bar {
      height: 40px;
      background: #ffffff;
      border-bottom: 1px solid #e2e8f0;
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 0 16px;
      font-size: 14px;
      color: #475569;
      z-index: 25;
      flex-shrink: 0;
    }

    .breadcrumb-trail {
      display: flex;
      align-items: center;
      gap: 6px;
      flex-wrap: wrap;
    }

    .breadcrumb-item {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      padding: 3px 8px;
      border-radius: 4px;
      cursor: pointer;
      color: #2563eb;
      font-weight: 500;
      transition: background 0.15s;
    }

    .breadcrumb-item:hover {
      background: #eff6ff;
    }

    .breadcrumb-item.current {
      color: #0f172a;
      font-weight: 600;
      cursor: default;
      background: #f8fafc;
    }

    .breadcrumb-sep {
      color: #94a3b8;
      font-size: 13px;
    }

    .breadcrumb-right-tools {
      display: flex;
      align-items: center;
      gap: 12px;
    }

    .drill-status-tag {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      padding: 2px 8px;
      border-radius: 12px;
      font-size: 13px;
      font-weight: 500;
      background: #f0fdf4;
      color: #16a34a;
      border: 1px solid #bbf7d0;
    }

    .drill-status-tag.sub {
      background: #eff6ff;
      color: #2563eb;
      border-color: #bfdbfe;
    }

    /* 主视口布局 */
    #content {
      position: relative;
      flex: 1;
      width: 100%;
      height: calc(100% - 88px);
      overflow: hidden;
      display: flex;
    }

    #network-view {
      flex: 1;
      height: 100%;
      position: relative;
    }

    #network-view canvas {
      outline: none;
    }

    /* 左侧传输系统边栏 */
    #sys-sidebar {
      position: absolute;
      top: 14px;
      left: 14px;
      bottom: 14px;
      width: 290px;
      background: rgba(255, 255, 255, 0.96);
      border: 1px solid #cbd5e1;
      border-radius: 10px;
      overflow: hidden;
      display: flex;
      flex-direction: column;
      z-index: 40;
      box-shadow: var(--shadow-card);
      backdrop-filter: var(--backdrop-panel);
      transition: transform 0.25s ease;
    }

    #sys-sidebar.collapsed {
      transform: translateX(-310px);
    }

    #sys-sidebar-header {
      padding: 12px 14px;
      border-bottom: 1px solid #e2e8f0;
      background: #f8fafc;
    }

    .sidebar-title-row {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 8px;
    }

    .sidebar-title-row h3 {
      font-size: 16px;
      font-weight: 700;
      color: #0f172a;
      display: flex;
      align-items: center;
      gap: 6px;
    }

    #sys-search-input {
      width: 100%;
      padding: 6px 10px;
      border: 1px solid #cbd5e1;
      border-radius: 6px;
      font-size: 13px;
      outline: none;
      transition: border-color 0.2s;
    }

    #sys-search-input:focus {
      border-color: #3b82f6;
      box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
    }

    #sys-list {
      flex: 1;
      overflow-y: auto;
      padding: 8px 10px;
      display: flex;
      flex-direction: column;
      gap: 4px;
    }

    .sys-level-header {
      font-size: 12px;
      font-weight: 700;
      color: #64748b;
      padding: 6px 8px 4px 8px;
      text-transform: uppercase;
      letter-spacing: 0.5px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-top: 4px;
    }

    .sys-list-item {
      padding: 8px 10px;
      border-radius: 6px;
      border: 1px solid transparent;
      cursor: pointer;
      display: flex;
      flex-direction: column;
      gap: 4px;
      background: #ffffff;
      transition: all 0.15s ease;
    }

    .sys-list-item:hover {
      background: #f1f5f9;
      border-color: #cbd5e1;
    }

    .sys-list-item.active {
      background: #eff6ff;
      border-color: #93c5fd;
    }

    .sys-item-top {
      display: flex;
      justify-content: space-between;
      align-items: center;
    }

    .sys-item-name {
      font-size: 14px;
      font-weight: 600;
      color: #1e293b;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      max-width: 195px;
    }

    .sys-item-badge {
      font-size: 12px;
      padding: 1px 6px;
      border-radius: 10px;
      background: #e2e8f0;
      color: #475569;
      font-weight: 600;
      border: 1px dashed rgba(0, 0, 0, 0.18);
    }

    .sys-item-meta {
      display: flex;
      align-items: center;
      gap: 6px;
      font-size: 12px;
      color: #64748b;
    }

    /* 右侧详情与统计面板 */
    #right-panel-container {
      position: absolute;
      top: 14px;
      right: 14px;
      width: 335px;
      max-height: calc(100% - 28px);
      display: flex;
      flex-direction: column;
      gap: 12px;
      z-index: 40;
      pointer-events: none;
    }

    .panel-card {
      background: rgba(255, 255, 255, 0.96);
      border: 1px solid #cbd5e1;
      border-radius: 10px;
      padding: 14px 16px;
      box-shadow: var(--shadow-card);
      backdrop-filter: var(--backdrop-panel);
      font-size: 14px;
      color: #334155;
      pointer-events: auto;
      overflow-y: auto;
      max-height: calc(100vh - 120px);
      display: flex;
      flex-direction: column;
    }

    .panel-card h3 {
      font-size: 16px;
      font-weight: 700;
      color: #0f172a;
      border-bottom: 1px solid #f1f5f9;
      padding-bottom: 8px;
      margin-bottom: 10px;
      display: flex;
      align-items: center;
      justify-content: space-between;
    }

    .stat-grid {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 8px;
      margin-bottom: 10px;
    }

    .stat-box {
      background: #f8fafc;
      border: 1px solid #f1f5f9;
      border-radius: 6px;
      padding: 8px 10px;
      display: flex;
      flex-direction: column;
      gap: 2px;
    }

    .stat-box .num {
      font-size: 22px;
      font-weight: 700;
      color: #2563eb;
      font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    }

    .stat-box .desc {
      font-size: 12px;
      color: #64748b;
    }

    .info-row {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 6px 0;
      border-bottom: 1px dashed #f1f5f9;
      font-size: 13px;
      gap: 10px;
    }

    .info-row.multiline {
      align-items: flex-start;
    }

    .info-row .lbl {
      color: #64748b;
      flex-shrink: 0;
      min-width: 70px;
    }

    .info-row .val {
      font-weight: 600;
      color: #0f172a;
      max-width: 210px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      text-align: right;
    }

    .info-row.multiline .val,
    .info-row .val.wrap,
    .info-row .val.multiline {
      white-space: normal;
      word-break: break-all;
      overflow: visible;
      text-overflow: clip;
      max-width: none;
      flex: 1;
      line-height: 1.45;
      text-align: right;
    }

    /* 提示条卡片 */
    .tip-box {
      background: #eff6ff;
      border: 1px solid #bfdbfe;
      border-radius: 6px;
      padding: 8px 10px;
      font-size: 13px;
      color: #1e40af;
      line-height: 1.5;
      margin-top: 6px;
      display: flex;
      align-items: flex-start;
      gap: 6px;
    }

    /* 悬浮缩放工具条 (置于右下角平铺图例上方) */
    #floating-toolbar {
      position: absolute;
      bottom: 56px;
      right: 20px;
      display: flex;
      flex-direction: column;
      gap: 6px;
      z-index: 45;
    }

    #floating-toolbar button {
      width: 38px;
      height: 38px;
      border: 1px solid #cbd5e1;
      background: #ffffff;
      border-radius: 8px;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
      color: #475569;
      font-size: 16px;
      font-weight: 600;
      transition: all 0.2s ease;
    }

    #floating-toolbar button:hover {
      background: #f8fafc;
      color: #2563eb;
      border-color: #94a3b8;
    }

    #floating-toolbar button:active {
      transform: scale(0.95);
    }

    /* 页面右下角平铺图例 */
    #bottom-legend-bar {
      position: absolute;
      bottom: 12px;
      right: 20px;
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 6px 14px;
      background: rgba(255, 255, 255, 0.94);
      backdrop-filter: blur(8px);
      -webkit-backdrop-filter: blur(8px);
      border: 1px solid #cbd5e1;
      border-radius: 8px;
      box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
      z-index: 45;
      font-size: 12px;
      color: #334155;
      user-select: none;
      pointer-events: auto;
    }

    .legend-title {
      font-weight: 700;
      color: #1e293b;
      font-size: 12px;
      margin-right: 2px;
    }

    .legend-group {
      display: flex;
      align-items: center;
      gap: 10px;
    }

    .legend-item {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      color: #475569;
      font-weight: 500;
      font-size: 12px;
      white-space: nowrap;
    }

    .legend-dot {
      width: 8px;
      height: 8px;
      border-radius: 50%;
      display: inline-block;
      flex-shrink: 0;
    }

    .legend-icon-badge {
      width: 14px;
      height: 10px;
      border-radius: 2px;
      display: inline-block;
      flex-shrink: 0;
      box-sizing: border-box;
    }

    .legend-line {
      width: 14px;
      height: 3px;
      border-radius: 1.5px;
      display: inline-block;
      flex-shrink: 0;
    }

    .legend-divider {
      width: 1px;
      height: 14px;
      background: #cbd5e1;
      margin: 0 2px;
    }

    /* 地区弹窗 */
    #region-modal-overlay {
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: rgba(15, 23, 42, 0.45);
      backdrop-filter: blur(4px);
      display: none;
      align-items: center;
      justify-content: center;
      z-index: 9999;
    }

    #region-modal {
      background: #ffffff;
      border-radius: 12px;
      width: 680px;
      max-height: 80vh;
      display: flex;
      flex-direction: column;
      box-shadow: var(--shadow-elevated);
      overflow: hidden;
    }

    #region-modal-header {
      padding: 16px 20px;
      border-bottom: 1px solid #f1f5f9;
      display: flex;
      justify-content: space-between;
      align-items: center;
    }

    #region-modal-body {
      padding: 20px;
      overflow-y: auto;
      display: flex;
      flex-direction: column;
      gap: 16px;
    }

    .province-title {
      font-size: 15px;
      font-weight: 700;
      color: #475569;
      margin-bottom: 8px;
    }

    .city-chips-grid {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
    }

    .city-chip {
      padding: 6px 14px;
      background: #f8fafc;
      border: 1px solid #e2e8f0;
      border-radius: 6px;
      font-size: 14px;
      color: #334155;
      cursor: pointer;
      transition: all 0.15s;
    }

    .city-chip:hover {
      background: #eff6ff;
      border-color: #bfdbfe;
      color: #2563eb;
    }

    .city-chip.active {
      background: #2563eb;
      border-color: #2563eb;
      color: #ffffff;
      font-weight: 600;
    }

    /* 简易徽章 */
    .badge {
      display: inline-block;
      padding: 2px 6px;
      border-radius: 4px;
      font-size: 12px;
      font-weight: 600;
    }

/* 多维度图层切换组件样式 (局站/机房/网元) */
.dimension-switcher {
  display: inline-flex;
  align-items: center;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 2px;
  gap: 2px;
  margin-left: 8px;
}
.dim-btn {
  border: none;
  background: transparent;
  padding: 5px 12px;
  border-radius: 4px;
  font-size: 13px;
  color: #64748b;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
  font-weight: 500;
}
.dim-btn:hover {
  color: #1e293b;
}
.dim-btn.active {
  background: #ffffff;
  color: #2563eb;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  font-weight: 600;
}

/* 全局数据加载与拓扑渲染过渡动画 Loading 遮罩 */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(248, 250, 252, 0.76);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.loading-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.loading-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  padding: 34px 44px;
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.12), 0 12px 24px -8px rgba(15, 23, 42, 0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  min-width: 380px;
  max-width: 460px;
  text-align: center;
  transform: scale(0.94);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.loading-overlay.active .loading-card {
  transform: scale(1);
}

.loading-spinner-box {
  position: relative;
  width: 58px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loading-spinner-ring {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 4px solid #eff6ff;
  border-top-color: #2563eb;
  border-right-color: #3b82f6;
  animation: spin-ring 0.9s cubic-bezier(0.55, 0.15, 0.45, 0.85) infinite;
}

.loading-spinner-core {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  box-shadow: 0 0 14px rgba(37, 99, 235, 0.55);
  animation: pulse-core 1.6s ease-in-out infinite alternate;
}

@keyframes spin-ring {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes pulse-core {
  0% { transform: scale(0.72); opacity: 0.5; }
  100% { transform: scale(1.18); opacity: 1; }
}

.loading-title {
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

#loading-city-label {
  color: #2563eb;
  background: #eff6ff;
  padding: 2px 8px;
  border-radius: 5px;
  border: 1px solid #bfdbfe;
  font-size: 14px;
  font-weight: 700;
}

.loading-desc {
  font-size: 13px;
  color: #64748b;
  margin-top: 5px;
  line-height: 1.5;
  min-height: 20px;
  transition: all 0.2s ease;
}

.loading-progress-track {
  width: 100%;
  height: 4px;
  background: #f1f5f9;
  border-radius: 999px;
  overflow: hidden;
  position: relative;
  margin-top: 4px;
}

.loading-progress-bar {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 40%;
  background: linear-gradient(90deg, #3b82f6, #2563eb, #1d4ed8);
  border-radius: 999px;
  animation: indeterminate-progress 1.5s infinite ease-in-out;
}

@keyframes indeterminate-progress {
  0% { left: -40%; width: 40%; }
  50% { left: 25%; width: 65%; }
  100% { left: 100%; width: 40%; }
}

