.pisell-topology-device-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  /** 顶对齐：避免在节点框内垂直居中，连线锚点（top）与内容之间出现大块空白 */
  justify-content: flex-start;
  width: 100%;
  height: 100%;
  min-height: 0;
  box-sizing: border-box;
  overflow: hidden;
  padding: 0 4px;
  gap: 0;
}

/** 图标区：固定高度，不参与 flex 撑满父级 */
.pisell-topology-device-card__main {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 40px;
  padding: 0;
}

.pisell-topology-device-card__status {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  max-width: calc(100% - 4px);
  padding: 0 4px;
  border-radius: 3px;
  font-size: 9px;
  font-weight: 600;
  line-height: 16px;
  text-transform: lowercase;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pisell-topology-device-card__status--online {
  color: #027a48;
  background: #ecfdf3;
}

.pisell-topology-device-card__status--offline {
  color: #475467;
  background: #f2f4f7;
}

.pisell-topology-device-card__status--warning {
  color: #b54708;
  background: #fffaeb;
}

.pisell-topology-device-card__status--unknown {
  color: #344054;
  background: #f9fafb;
}

/** Ghost：保存里有但接口已下线，整体灰底虚框 + 半透 */
.pisell-topology-device-card__status--removed {
  color: #98a2b3;
  background: #f2f4f7;
  border: 1px dashed #d0d5dd;
  line-height: 14px;
}

.pisell-topology-device-card--ghost {
  opacity: 0.55;
  filter: grayscale(0.6);
  border: 1px dashed #d0d5dd;
  border-radius: 6px;
  background: rgba(247, 248, 250, 0.4);

  .pisell-topology-device-card__name {
    color: #98a2b3;
  }
  .pisell-topology-device-card__ip {
    color: #b0b8c4;
  }
}

.pisell-topology-device-card__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 100%;
  height: 100%;
  /** 为左上状态徽标留空，略收紧以减少顶部空白 */
  padding-top: 5px;
  box-sizing: border-box;

  svg {
    display: block;
    width: auto;
    height: auto;
    max-width: 52px;
    max-height: 30px;
  }
}

.pisell-topology-device-card__footer {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  width: 100%;
  min-width: 0;
  margin-top: 1px;
  padding: 0;
}

.pisell-topology-device-card__name {
  max-width: 100%;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  color: #344054;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pisell-topology-device-card__ip {
  max-width: 100%;
  font-size: 9px;
  line-height: 1.2;
  text-align: center;
  color: #667085;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
