/* 组件样式 */

/* ── 呼吸动画 ── */
@keyframes dot-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(103,194,58,0.4); }
  50%      { box-shadow: 0 0 0 4px rgba(103,194,58,0); }
}

/* ── 区块 ── */
.block {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  margin-bottom: 16px;
  overflow: hidden;
  min-width: 0;
  transition: box-shadow var(--duration-normal) ease, transform var(--duration-normal) ease;
}

/* ── 分组标题（替代嵌套 block） ── */
.group {
  margin-top: var(--space-group-top);
}

.group:first-child {
  margin-top: 0;
}

.group__title {
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-500);
  padding-bottom: 4px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--gray-100);
}

.group--plan {
  opacity: 0.8;
}

.group--plan > .group__title {
  font-style: italic;
}

.group--nested > .svc,
.group--nested > .group--nested {
  margin-left: 14px;
  padding-left: 10px;
  border-left: 2px solid var(--purple-100);
}

.block__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: var(--space-block-y) var(--space-block-x);
  border-bottom: 1px solid var(--gray-100);
  cursor: default;
}

.block__icon {
  font-size: 18px;
  flex-shrink: 0;
}

.block__title {
  font-weight: 600;
  font-size: 15px;
  flex: 1;
}

.block__badge {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: var(--radius);
  font-weight: 500;
}

.block__note-bar {
  font-size: 12px;
  color: var(--gray-500);
  padding: 6px 18px;
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-100);
  line-height: 1.5;
}

.block--nested .block__note-bar {
  background: #fff;
}

.block__body {
  padding: var(--space-block-y) var(--space-block-x);
  min-width: 0;
  overflow: hidden;
}

/* ── 服务行 ── */
.svc {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: var(--space-svc-y) 4px;
  font-size: 13px;
  border-bottom: 1px solid var(--gray-100);
  min-width: 0;
  border-radius: 4px;
  transition: background var(--duration-fast) ease;
}

.svc:hover {
  background: var(--hover-bg-purple);
}

.svc:last-child { border-bottom: none; }

.svc--plan {
  opacity: 0.8;
}

.svc--plan .svc__name {
  font-style: italic;
  color: var(--gray-700);
}

.block--plan {
  opacity: 0.8;
  border-style: dashed;
}

.svc__dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 5px;
}

.svc__dot--run {
  animation: dot-pulse var(--duration-pulse) ease-in-out infinite;
}

.svc__dot--plan {
  background: transparent !important;
  border: 1.5px dashed var(--amber);
  width: 7px; height: 7px;
}

.svc__name {
  font-weight: 600;
  color: var(--gray-900);
  white-space: nowrap;
}

.svc__port {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--purple-500);
  background: var(--purple-50);
  padding: 1px 7px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

.svc__url {
  font-size: 11px;
  color: var(--purple-500);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}

.svc__url:hover {
  text-decoration: underline;
}

.svc__desc {
  color: var(--gray-500);
  font-size: 12px;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.svc__repo {
  font-size: 9px;
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--gray-300);
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

/* ── 流向条 ── */
.flow {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--purple-50);
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.flow:last-child { margin-bottom: 0; }

.flow__arrow { color: var(--purple-500); font-weight: 700; }
.flow__note  { color: var(--gray-500); font-size: 12px; margin-left: auto; }

/* ── 小节标题 ── */
.sub-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 14px 0 8px;
}

.sub-title:first-child { margin-top: 0; }

/* ── hover ── */
.block:hover {
  box-shadow: var(--shadow-purple);
  transform: var(--hover-lift);
}
