.sp-node-fleet {
  color-scheme: dark;
  --sp-bg: #02070d;
  --sp-panel: rgba(4, 13, 22, .92);
  --sp-panel-2: rgba(8, 22, 32, .95);
  --sp-line: rgba(106, 155, 180, .16);
  --sp-line-strong: rgba(93, 190, 231, .28);
  --sp-text: #f4f8fc;
  --sp-muted: #7f8da2;
  --sp-cyan: #00d8ff;
  --sp-blue: #087cff;
  --sp-green: #00efa2;
  --sp-danger: #ff5570;
  --sp-grid: rgba(78, 121, 145, .09);
}

.sp-node-fleet,
.sp-node-fleet * { box-sizing: border-box; }
.sp-node-fleet button,
.sp-node-fleet input { font: inherit; }
.sp-node-fleet button { color: inherit; }

.sp-node-demo-body {
  min-width: 320px;
  margin: 0;
  background: #02070d;
  color: #f4f8fc;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

.demo-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
}
.demo-page .sp-node-fleet {
  margin-top: 0;
  border: 0;
  border-radius: 0;
}

.sp-node-fleet {
  position: relative;
  width: 100%;
  color: var(--sp-text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  min-height: 760px;
  margin-top: 18px;
  overflow: hidden;
  border: 1px solid rgba(106, 155, 180, .18);
  border-radius: 28px;
  box-shadow: 0 24px 70px rgba(2, 12, 25, .2);
  isolation: isolate;
  padding: clamp(58px, 7vw, 96px) clamp(18px, 4vw, 64px);
  background:
    linear-gradient(var(--sp-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--sp-grid) 1px, transparent 1px),
    radial-gradient(circle at 28% 52%, rgba(0, 92, 190, .16), transparent 30%),
    var(--sp-bg);
  background-size: 52px 52px, 52px 52px, auto, auto;
}

.sp-node-fleet::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(2, 7, 13, .22), rgba(2, 7, 13, .8));
}

.sp-node-fleet p { margin-top: 0; }

.sp-node-fleet__heading {
  width: min(1180px, 100%);
  margin: 0 auto 34px;
}
.sp-node-fleet__eyebrow {
  margin: 0 0 8px;
  color: var(--sp-cyan);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .24em;
}
.sp-node-fleet__heading h2 {
  margin: 0;
  color: var(--sp-text);
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1.1;
  letter-spacing: -.035em;
}
.sp-node-fleet__heading > p:last-child {
  max-width: 650px;
  margin: 14px 0 0;
  color: var(--sp-muted);
  font-size: 15px;
  line-height: 1.8;
}

.sp-node-fleet__board {
  width: min(1380px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 410px);
  gap: clamp(24px, 4vw, 56px);
  align-items: center;
}

.sp-node-fleet__visual {
  position: relative;
  min-width: 0;
  height: clamp(500px, 58vw, 720px);
  touch-action: none;
  user-select: none;
}

.sp-node-fleet__canvas,
.sp-node-fleet__labels {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.sp-node-fleet__canvas { cursor: grab; }
.sp-node-fleet__canvas:active { cursor: grabbing; }
.sp-node-fleet__labels { pointer-events: none; overflow: hidden; }

.sp-node-fleet__online-pill {
  position: absolute;
  z-index: 4;
  top: 0;
  left: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 18px;
  border: 1px solid rgba(124, 153, 174, .18);
  border-radius: 999px;
  background: rgba(3, 9, 16, .84);
  box-shadow: 0 12px 28px rgba(0, 0, 0, .26);
  color: #8996a9;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .1em;
  backdrop-filter: blur(12px);
}
.sp-node-fleet__online-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--sp-green);
  box-shadow: 0 0 12px var(--sp-green);
  animation: sp-node-pulse 1.8s ease-in-out infinite;
}

.sp-node-fleet__tip {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: 5px;
  display: flex;
  gap: 14px;
  transform: translateX(-50%);
  color: #627388;
  font-size: 11px;
  letter-spacing: .08em;
}
.sp-node-fleet__tip span + span::before {
  content: "·";
  margin-right: 14px;
}

.sp-node-label {
  position: absolute;
  transform: translate(-50%, -50%);
  max-width: 210px;
  padding: 7px 10px;
  border: 1px solid rgba(0, 130, 255, .66);
  border-radius: 7px;
  background: rgba(3, 12, 23, .92);
  box-shadow: 0 7px 20px rgba(0, 0, 0, .35), inset 0 0 0 1px rgba(90, 190, 255, .04);
  color: #e8eef7;
  font-size: 11px;
  font-weight: 760;
  line-height: 1;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  opacity: 0;
  transition: opacity .18s ease, border-color .18s ease, background .18s ease;
}
.sp-node-label.is-visible { opacity: 1; }
.sp-node-label.is-active {
  border-color: var(--sp-cyan);
  background: rgba(0, 38, 58, .97);
  box-shadow: 0 0 24px rgba(0, 216, 255, .18);
}

.sp-node-panel {
  height: min(690px, 78vh);
  min-height: 530px;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  overflow: hidden;
  border: 1px solid rgba(107, 152, 174, .18);
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(0, 191, 233, .1), transparent 25%),
    var(--sp-panel);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .38), inset 0 1px 0 rgba(255, 255, 255, .03);
  backdrop-filter: blur(18px);
}

.sp-node-panel__header {
  min-height: 78px;
  padding: 0 25px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--sp-line);
}
.sp-node-panel__title {
  color: var(--sp-cyan);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .22em;
}
.sp-node-panel__count {
  margin-left: 10px;
  color: #8390a3;
  font-size: 12px;
  font-weight: 800;
}
.sp-node-panel__refresh {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(122, 169, 190, .18);
  border-radius: 10px;
  background: rgba(55, 91, 108, .14);
  cursor: pointer;
  transition: .2s ease;
}
.sp-node-panel__refresh:hover {
  border-color: rgba(0, 216, 255, .45);
  background: rgba(0, 216, 255, .1);
}
.sp-node-panel__refresh svg {
  width: 18px;
  fill: none;
  stroke: #7f90a4;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.sp-node-panel__refresh.is-loading svg { animation: sp-node-spin .8s linear infinite; }

.sp-node-panel__tools {
  padding: 18px 25px 16px;
  border-bottom: 1px solid rgba(97, 141, 161, .12);
}
.sp-node-panel__search {
  height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 13px;
  border: 1px solid rgba(107, 151, 172, .16);
  border-radius: 10px;
  background: rgba(1, 8, 15, .48);
  transition: border-color .2s ease, box-shadow .2s ease;
}
.sp-node-panel__search:focus-within {
  border-color: rgba(0, 216, 255, .52);
  box-shadow: 0 0 0 3px rgba(0, 216, 255, .06);
}
.sp-node-panel__search svg {
  width: 17px;
  flex: 0 0 auto;
  fill: none;
  stroke: #718195;
  stroke-width: 2;
  stroke-linecap: round;
}
.sp-node-panel__search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #e5edf6;
  font-size: 12px;
}
.sp-node-panel__search input::placeholder { color: #536276; }

.sp-node-panel__filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}
.sp-node-filter {
  min-width: 34px;
  height: 28px;
  padding: 0 8px;
  border: 1px solid rgba(0, 191, 233, .36);
  border-radius: 6px;
  background: rgba(0, 138, 185, .1);
  color: #22d6f5;
  font-size: 10px;
  font-weight: 900;
  cursor: pointer;
  transition: .18s ease;
}
.sp-node-filter:hover,
.sp-node-filter.is-active {
  background: rgba(0, 190, 230, .2);
  border-color: var(--sp-cyan);
  color: #dffaff;
}
.sp-node-filter[data-region="ALL"] {
  border-color: rgba(115, 133, 152, .2);
  background: rgba(95, 111, 129, .1);
  color: #8795a8;
}

.sp-node-panel__list {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(79, 102, 118, .42) transparent;
  padding: 8px 0 14px;
}
.sp-node-panel__list::-webkit-scrollbar { width: 5px; }
.sp-node-panel__list::-webkit-scrollbar-thumb { background: rgba(79, 102, 118, .42); border-radius: 99px; }

.sp-node-country {
  border-bottom: 1px solid rgba(82, 122, 142, .08);
}
.sp-node-country__button {
  width: 100%;
  min-height: 57px;
  padding: 0 25px;
  display: grid;
  grid-template-columns: 15px 27px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background .18s ease;
}
.sp-node-country__button:hover,
.sp-node-country.is-open > .sp-node-country__button,
.sp-node-country.is-active > .sp-node-country__button {
  background: linear-gradient(90deg, rgba(0, 176, 222, .08), rgba(0, 176, 222, .015));
}
.sp-node-country__chevron {
  width: 7px;
  height: 7px;
  border-right: 1.5px solid #66788d;
  border-bottom: 1.5px solid #66788d;
  transform: rotate(-45deg);
  transition: transform .18s ease;
}
.sp-node-country.is-open .sp-node-country__chevron { transform: rotate(45deg); }
.sp-node-country__flag { font-size: 17px; filter: saturate(.9); }
.sp-node-country__name {
  min-width: 0;
  overflow: hidden;
  color: #95a0b2;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: .055em;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.sp-node-country__code {
  display: inline-grid;
  place-items: center;
  margin-left: 5px;
  min-width: 25px;
  height: 19px;
  padding: 0 5px;
  border-radius: 5px;
  background: rgba(0, 192, 224, .16);
  color: #19cce9;
  font-size: 9px;
  font-weight: 900;
}
.sp-node-country__status {
  color: var(--sp-green);
  font-size: 11px;
  font-weight: 900;
}

.sp-node-country__nodes {
  max-height: 0;
  overflow: hidden;
  transition: max-height .25s ease;
}
.sp-node-country.is-open .sp-node-country__nodes { max-height: 500px; }
.sp-node-country__node {
  min-height: 42px;
  padding: 6px 25px 6px 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #6e7d91;
  font-size: 10px;
  cursor: pointer;
  transition: color .18s ease, background .18s ease;
}
.sp-node-country__node:hover,
.sp-node-country__node.is-active {
  color: #d9e5ef;
  background: rgba(0, 215, 255, .045);
}
.sp-node-country__node-name {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.sp-node-country__node-state {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #718297;
}
.sp-node-country__node-state::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--sp-green);
  box-shadow: 0 0 8px rgba(0, 239, 162, .55);
}
.sp-node-country__node.is-offline .sp-node-country__node-state::before { background: var(--sp-danger); box-shadow: none; }
.sp-node-country__node.is-offline .sp-node-country__node-state { color: var(--sp-danger); }

.sp-node-panel__empty {
  padding: 58px 25px;
  color: #67778b;
  text-align: center;
  font-size: 12px;
}
.sp-node-panel__footer {
  min-height: 48px;
  padding: 0 25px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  border-top: 1px solid rgba(95, 139, 160, .12);
  color: #536276;
  font-size: 9px;
  letter-spacing: .04em;
}
.sp-node-panel__footer span { display: inline-flex; align-items: center; gap: 7px; }
.sp-node-panel__footer i { width: 5px; height: 5px; border-radius: 50%; background: var(--sp-green); box-shadow: 0 0 7px rgba(0, 239, 162, .5); }

@keyframes sp-node-pulse { 50% { opacity: .38; transform: scale(.76); } }
@keyframes sp-node-spin { to { transform: rotate(360deg); } }

@media (max-width: 980px) {
  .sp-node-fleet { padding-inline: 18px; }
  .sp-node-fleet__board { grid-template-columns: 1fr; }
  .sp-node-fleet__visual { height: min(680px, 88vw); min-height: 430px; }
  .sp-node-panel { width: min(620px, 100%); height: 620px; margin: 0 auto; }
}

@media (max-width: 600px) {
  .sp-node-fleet { padding-top: 44px; background-size: 38px 38px, 38px 38px, auto, auto; }
  .sp-node-fleet__heading { margin-bottom: 16px; }
  .sp-node-fleet__heading > p:last-child { font-size: 13px; }
  .sp-node-fleet__visual { height: 430px; min-height: 430px; }
  .sp-node-fleet__online-pill { top: 6px; min-height: 32px; padding: 0 13px; font-size: 10px; }
  .sp-node-fleet__tip { display: none; }
  .sp-node-label { max-width: 150px; padding: 6px 8px; font-size: 9px; }
  .sp-node-panel { height: 590px; min-height: 500px; border-radius: 20px; }
  .sp-node-panel__header, .sp-node-panel__tools, .sp-node-country__button, .sp-node-panel__footer { padding-left: 18px; padding-right: 18px; }
  .sp-node-country__node { padding-left: 61px; padding-right: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .sp-node-fleet__online-dot { animation: none; }
  .sp-node-country__nodes, .sp-node-label { transition: none; }
}

/* =========================================================
   节点地图：日间 / 夜间模式
   网站通过 #app[data-theme="light|dark"] 控制主题
   ========================================================= */

/* 地区圆点不再表示在线状态 */
.sp-node-fleet__online-dot {
  background: var(--sp-cyan);
  box-shadow: 0 0 12px color-mix(in srgb, var(--sp-cyan) 72%, transparent);
  animation: none;
}

.sp-node-country__status {
  color: var(--sp-cyan);
}

/* 日间模式 */
html[data-theme="light"] .sp-node-fleet {
  color-scheme: light;

  --sp-bg: #f7f9fc;
  --sp-panel: rgba(255, 255, 255, 0.92);
  --sp-panel-2: rgba(245, 249, 253, 0.96);
  --sp-line: rgba(38, 62, 82, 0.12);
  --sp-line-strong: rgba(0, 137, 190, 0.24);
  --sp-text: #172033;
  --sp-muted: #667085;
  --sp-cyan: #008fb5;
  --sp-blue: #0877df;
  --sp-green: #0ca678;
  --sp-danger: #d6455d;
  --sp-grid: rgba(43, 82, 112, 0.065);

  color: var(--sp-text);
  border-color: rgba(45, 73, 96, 0.13);

  background:
    linear-gradient(var(--sp-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--sp-grid) 1px, transparent 1px),
    radial-gradient(
      circle at 28% 52%,
      rgba(32, 159, 226, 0.12),
      transparent 32%
    ),
    var(--sp-bg);

  background-size: 52px 52px, 52px 52px, auto, auto;

  box-shadow:
    0 24px 70px rgba(42, 67, 88, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

html[data-theme="light"] .sp-node-fleet::before {
  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.04),
      rgba(235, 243, 250, 0.52)
    );
}

html[data-theme="light"] .sp-node-fleet__online-pill {
  color: #536176;
  border-color: rgba(48, 75, 98, 0.14);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 12px 30px rgba(48, 72, 92, 0.12);
}

html[data-theme="light"] .sp-node-label {
  color: #263449;
  border-color: rgba(0, 123, 214, 0.48);
  background: rgba(255, 255, 255, 0.94);
  box-shadow:
    0 8px 22px rgba(44, 72, 94, 0.16),
    inset 0 0 0 1px rgba(255, 255, 255, 0.72);
}

html[data-theme="light"] .sp-node-label.is-active {
  color: #102f43;
  border-color: #00a4cf;
  background: rgba(228, 249, 255, 0.97);
  box-shadow: 0 0 24px rgba(0, 164, 207, 0.17);
}

html[data-theme="light"] .sp-node-panel {
  border-color: rgba(48, 76, 98, 0.14);

  background:
    linear-gradient(
      180deg,
      rgba(0, 174, 220, 0.08),
      transparent 25%
    ),
    rgba(255, 255, 255, 0.91);

  box-shadow:
    0 28px 70px rgba(43, 68, 89, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

html[data-theme="light"] .sp-node-panel__header,
html[data-theme="light"] .sp-node-panel__tools,
html[data-theme="light"] .sp-node-panel__footer {
  border-color: rgba(42, 71, 94, 0.11);
}

html[data-theme="light"] .sp-node-panel__count {
  color: #647186;
}

html[data-theme="light"] .sp-node-panel__refresh {
  border-color: rgba(50, 79, 100, 0.14);
  background: rgba(232, 240, 247, 0.75);
}

html[data-theme="light"] .sp-node-panel__refresh:hover {
  border-color: rgba(0, 151, 196, 0.38);
  background: rgba(0, 171, 218, 0.09);
}

html[data-theme="light"] .sp-node-panel__refresh svg {
  stroke: #62748a;
}

html[data-theme="light"] .sp-node-panel__search {
  border-color: rgba(45, 75, 98, 0.14);
  background: rgba(244, 247, 250, 0.9);
}

html[data-theme="light"] .sp-node-panel__search input {
  color: #233147;
}

html[data-theme="light"] .sp-node-panel__search input::placeholder {
  color: #8995a5;
}

html[data-theme="light"] .sp-node-panel__search svg {
  stroke: #77879a;
}

html[data-theme="light"] .sp-node-filter {
  border-color: rgba(0, 143, 181, 0.28);
  background: rgba(0, 143, 181, 0.07);
  color: #087c9c;
}

html[data-theme="light"] .sp-node-filter:hover,
html[data-theme="light"] .sp-node-filter.is-active {
  color: #006c89;
  border-color: #0099c1;
  background: rgba(0, 153, 193, 0.13);
}

html[data-theme="light"] .sp-node-filter[data-region="ALL"] {
  color: #667386;
  border-color: rgba(60, 80, 100, 0.16);
  background: rgba(88, 105, 121, 0.07);
}

html[data-theme="light"] .sp-node-country {
  border-color: rgba(54, 80, 100, 0.08);
}

html[data-theme="light"] .sp-node-country__button:hover,
html[data-theme="light"] .sp-node-country.is-open
  > .sp-node-country__button,
html[data-theme="light"] .sp-node-country.is-active
  > .sp-node-country__button {
  background:
    linear-gradient(
      90deg,
      rgba(0, 155, 199, 0.08),
      rgba(0, 155, 199, 0.015)
    );
}

html[data-theme="light"] .sp-node-country__name {
  color: #526074;
}

html[data-theme="light"] .sp-node-country__chevron {
  border-color: #75869a;
}

html[data-theme="light"] .sp-node-country__code {
  color: #047f9f;
  background: rgba(0, 155, 195, 0.1);
}

html[data-theme="light"] .sp-node-country__node {
  color: #69778a;
}

html[data-theme="light"] .sp-node-country__node:hover,
html[data-theme="light"] .sp-node-country__node.is-active {
  color: #24354b;
  background: rgba(0, 159, 203, 0.055);
}

html[data-theme="light"] .sp-node-panel__footer {
  color: #7c8999;
}

html[data-theme="light"] .sp-node-fleet__tip {
  color: #7c8998;
}