.rp-waterfall [data-rp-layout-root] {
  display: grid;
  gap: 1.5rem;
}

.rp-waterfall .rp-section__title, .rp-waterfall .rp-btn--ghost { color: var(--aidc-text-strong); }
.rp-waterfall .rp-section__lead, .rp-waterfall .rp-section__eyebrow { color: var(--aidc-text-muted); }

.rp-floor-plans[hidden], .rp-stack-model [hidden] { display: none; }

.rp-floor-plans > h2 {
  margin: 0 0 .8rem;
  color: var(--aidc-text-strong);
  font-size: 1.15rem;
  font-weight: 700;
}

.rp-floor-list {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
  align-items: start;
}

.rp-floor-card {
  display: grid;
  gap: .8rem;
  align-content: start;
  min-width: 0;
  scroll-margin-top: 1rem;
  padding: 1rem;
}

.rp-floor-card-title {
  margin: 0;
  color: var(--aidc-text-strong);
  font-size: 1.02rem;
  font-weight: 700;
}

@media (min-width: 900px) {
  .rp-floor-list {
    grid-template-columns: repeat(2, calc(50% - .5rem));
    justify-content: space-between;
  }
}

.rp-floor-diagram svg {
  display: block;
  width: 92%;
  max-width: 33rem;
  height: auto;
  margin: 0 auto;
}

.rp-floor-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: .38rem;
}

.rp-floor-button {
  min-height: 2.75rem;
  padding: .38rem .68rem;
  border: 1px solid var(--aidc-border);
  border-radius: .46rem;
  background: var(--aidc-surface);
  color: var(--aidc-text-muted);
  font-size: .81rem;
  font-weight: 650;
  cursor: pointer;
}

.rp-floor-button:hover, .rp-floor-button:focus-visible { color: var(--aidc-accent-text); }
.rp-floor-button[aria-pressed='true'] {
  border-color: var(--aidc-accent);
  color: var(--aidc-accent-text);
  background: var(--aidc-surface-muted);
}

.rp-floor-diagram {
  min-width: 0;
  padding: .55rem;
  border: 1px solid var(--aidc-border);
  border-radius: .75rem;
  background: var(--aidc-surface);
}

.rp-floor-diagram .rp-plan-slab {
  stroke: var(--aidc-text-soft);
  stroke-width: .55;
}

.rp-floor-diagram .rp-plan-zone {
  fill-opacity: .18;
  stroke-width: .32;
}

.rp-floor-dimension path {
  fill: none;
  stroke: var(--aidc-text-soft);
  stroke-width: .26;
  stroke-linejoin: round;
}

.rp-floor-dimension text {
  fill: var(--aidc-text-strong);
  font-size: 3.15px;
  font-weight: 700;
}

.rp-plan-colors {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem .8rem;
  margin: .35rem 0 0;
  padding: .5rem .6rem;
  border: 1px solid var(--aidc-border);
  border-radius: .5rem;
  list-style: none;
  color: var(--aidc-text-muted);
  font-size: .75rem;
}

.rp-plan-colors li { display: inline-flex; align-items: center; gap: .32rem; }
.rp-plan-colors li::before {
  content: '';
  width: .72rem;
  height: .72rem;
  flex: 0 0 auto;
  border: 1px solid var(--zone-color);
  border-radius: .2rem;
  background: color-mix(in srgb, var(--zone-color) 18%, var(--aidc-surface));
}

.rp-plan-fan { fill: #214354; }
.rp-plan-zone-label {
  fill: var(--aidc-text-strong);
  stroke: var(--aidc-surface);
  stroke-width: .95;
  stroke-linejoin: round;
  paint-order: stroke;
  font-size: 2.9px;
  font-weight: 725;
  text-anchor: middle;
  dominant-baseline: central;
}

.rp-plan-outline { fill: none; stroke-width: .78; stroke-dasharray: 2.3 1.3; }
.rp-plan-outline--hall { stroke: #c75136; }
.rp-plan-outline--pod { stroke: var(--rp-plan-pod-color); stroke-width: .95; stroke-dasharray: 2.8 1.4; }
html[data-theme='dark'] .rp-plan-outline--hall { stroke: #fc9477; }

.rp-floor-plans { --rp-plan-pod-color: #dc2626; }
html[data-theme='dark'] .rp-floor-plans { --rp-plan-pod-color: #f87171; }
.rp-plan-pod-badge rect { fill: #b91c1c; }
.rp-plan-pod-badge text {
  fill: #fff;
  font-size: 3.1px;
  font-weight: 750;
  text-anchor: middle;
  dominant-baseline: central;
}

.rp-plan-key {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem .85rem;
  color: var(--aidc-text-muted);
  font-size: .78rem;
}
.rp-plan-key span::before {
  content: '';
  display: inline-block;
  width: 1.1rem;
  margin-right: .35rem;
  vertical-align: middle;
  border-top: 2px dashed #c75136;
}
html[data-theme='dark'] .rp-plan-key .rp-key-hall::before { border-color: #fc9477; }
.rp-plan-key .rp-key-pod::before { border-top-color: var(--rp-plan-pod-color); }
.rp-plan-key .rp-key-half-pod::before {
  border-top-style: dotted;
  border-top-color: var(--rp-plan-pod-color);
  opacity: 0.85;
}

.rp-layout-source, .rp-stack-hint {
  color: var(--aidc-text-muted);
  font-size: .82rem;
  line-height: 1.55;
}
.rp-layout-source { display: flex; flex-wrap: wrap; gap: .24rem .75rem; margin: .75rem 0 0; }
.rp-layout-source a { color: var(--aidc-accent-text); text-decoration: underline; }

.rp-stack-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding: .7rem;
}
.rp-air-phase { margin: 0; padding: .35rem .8rem; color: var(--aidc-text); font-weight: 650; }
.rp-stack-stage { height: clamp(24rem, 64vh, 43rem); position: relative; overflow: hidden; }
/* 全部楼层：舞台加高，爆炸四层与附图占比接近（楼层占卡片主体） */
.rp-stack-building-card .rp-stack-stage {
  height: clamp(28rem, 78vh, 54rem);
}
.rp-stack-stage canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.rp-stack-stage .rp-stack-labels { position: absolute; inset: 0; pointer-events: none; }
.rp-pod-aisle-active .rp-stack-labels { visibility: hidden; }
.rp-stack-compact-levels .rp-stack-labels { visibility: hidden; }
.rp-stack-compact-levels [data-layer-height]::after {
  content: attr(data-layer-height);
  margin-inline-start: .35rem;
  color: var(--aidc-text-muted);
  white-space: nowrap;
}
.rp-model-layer-label {
  display: inline-flex;
  align-items: center;
  gap: .36rem;
  padding: .24rem .48rem .24rem .25rem;
  border: 1px solid var(--aidc-border);
  border-radius: .48rem;
  background: var(--aidc-surface);
  box-shadow: 0 3px 12px #10233b24;
  color: var(--aidc-text-strong);
  font-size: .74rem;
  font-weight: 700;
  white-space: nowrap;
}
.rp-model-layer-height { color: var(--aidc-text-muted); font-variant-numeric: tabular-nums; }
.rp-model-layer-label strong {
  min-width: 1.54rem;
  padding: .11rem .18rem;
  border-radius: .26rem;
  background: #254763;
  color: #fff;
  text-align: center;
}
html[data-theme='dark'] .rp-model-layer-label,
html.dark .rp-model-layer-label {
  background: var(--aidc-surface);
  border-color: var(--aidc-border);
  box-shadow: 0 3px 14px #00000055;
  color: var(--aidc-text-strong);
}
html[data-theme='dark'] .rp-model-layer-label strong,
html.dark .rp-model-layer-label strong {
  background: #3d6a8c;
}
html[data-theme='dark'] .rp-model-layer-height,
html.dark .rp-model-layer-height {
  color: var(--aidc-text-muted);
}
.rp-stack-hint { margin: 0; padding: .55rem .75rem; }
.rp-stack-building-capacity {
  margin: 0;
  padding: .45rem .75rem;
  color: var(--aidc-text);
  font-weight: 650;
  font-size: .92rem;
}
.rp-stack-building-capacity[hidden] { display: none; }
.rp-stack-stage[hidden] + .rp-stack-building-capacity,
.rp-stack-stage[hidden] + .rp-stack-building-capacity + .rp-stack-hint,
.rp-stack-stage[hidden] + .rp-stack-hint { display: none; }
.rp-stack-pod-key:not([hidden]) {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .45rem 1.25rem;
  border-top: 1px solid var(--aidc-border);
  padding: .65rem .75rem;
  color: var(--aidc-text-muted);
  font-size: .82rem;
}
.rp-stack-pod-key ul { display: flex; flex-wrap: wrap; gap: .35rem 1rem; }
.rp-stack-pod-capacity { flex-basis: 100%; color: var(--aidc-text); font-weight: 650; }
.rp-stack-pod-key li { display: inline-flex; align-items: center; gap: .35rem; }
.rp-stack-pod-key li::before {
  content: "";
  width: .9rem;
  height: .22rem;
  border-radius: 1rem;
  background: var(--rp-pod-route);
}
.rp-layout-stack:has(.rp-stack-pod-key:not([hidden])) .rp-layout-source #plan-dimension-note {
  display: none;
}

.rp-model-stack {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.rp-model-stack > .rp-card {
  margin: 0;
}

@media (min-width: 900px) {
  .rp-stack-model:has(.rp-stack-pod-key:not([hidden])) .rp-stack-stage {
    height: clamp(26rem, 74vh, 48rem);
  }
  .rp-stack-building-card .rp-stack-stage {
    height: clamp(32rem, 82vh, 56rem);
  }
}

@media (max-width: 768px) {
  .rp-floor-diagram { padding: .35rem; }
  .rp-plan-zone-label, .rp-floor-dimension text { font-size: 3.8px; }
}

@media (max-width: 620px) {
  .rp-model-layer-label > span:not(.rp-model-layer-height) { display: none; }
}

.rp-pod-inspect-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.rp-pod-topology { display: grid; flex-basis: 100%; gap: .25rem; margin: .22rem 0; line-height: 1.55; }
.rp-pod-topology > div { display: grid; grid-template-columns: max-content 1fr; gap: .65rem; }
.rp-pod-topology dt { color: var(--aidc-text-strong); font-weight: 650; }
.rp-pod-topology dd { margin: 0; }
.rp-pod-power-note { flex-basis: 100%; }
.rp-rack-dialog {
  width: min(58rem, calc(100% - 2rem));
  max-height: calc(100dvh - 2rem);
  margin: auto;
  padding: 0;
  overflow: auto;
  border: 1px solid var(--aidc-border);
  border-radius: 1rem;
  background: var(--aidc-surface);
  color: var(--aidc-text);
  box-shadow: 0 18px 65px #101d35ac;
}
.rp-rack-dialog::backdrop { background: #111d35a8; }
.rp-rack-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: .75rem;
  padding: 1.04rem 1.15rem;
  border-bottom: 1px solid var(--aidc-border);
}
.rp-rack-header h2 { margin: 0; color: var(--aidc-text-strong); font-size: clamp(1.04rem, 2.4vw, 1.32rem); font-weight: 720; }
.rp-rack-header p { margin: .26rem 0 0; color: var(--aidc-text-muted); font-size: .84rem; }
.rp-rack-body { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
.rp-rack-preview { position: relative; min-width: 0; overflow: hidden; background: #e7eff7; }
html[data-theme='dark'] .rp-rack-preview { background: #17263a; }
.rp-rack-view { position: relative; min-height: 26rem; height: 100%; }
.rp-rack-view canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
.rp-rack-view canvas:active { cursor: grabbing; }
.rp-rack-overlay { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.rp-rack-dimension, .rp-rack-power {
  padding: .25rem .44rem;
  border: 1px solid var(--aidc-border);
  border-radius: .36rem;
  background: var(--aidc-surface);
  color: var(--aidc-text-strong);
  font-size: .75rem;
  font-weight: 680;
  white-space: nowrap;
}
.rp-rack-power { position: absolute; top: .65rem; left: .65rem; pointer-events: none; }
.rp-rack-reset { position: absolute; right: .65rem; bottom: .65rem; }
.rp-rack-status:not([hidden]) {
  position: absolute; inset: 45% 10% auto; padding: .45rem .65rem; margin: 0; border-radius: .4rem;
  background: var(--aidc-surface); color: var(--aidc-text); text-align: center;
}
.rp-rack-information { padding: .55rem 1.05rem .95rem; }
.rp-rack-specs { display: grid; margin: 0 0 .64rem; }
.rp-rack-specs > div { display: grid; grid-template-columns: minmax(5.2rem, .82fr) minmax(0, 1.4fr); gap: .5rem; padding: .44rem 0; border-bottom: 1px solid var(--aidc-border); font-size: .83rem; }
.rp-rack-specs dt { color: var(--aidc-text-muted); }
.rp-rack-specs dd { margin: 0; font-weight: 620; overflow-wrap: anywhere; }
.rp-rack-note { margin: 0 0 .5rem; color: var(--aidc-text-muted); font-size: .78rem; line-height: 1.55; }
.rp-rack-sources { display: flex; flex-wrap: wrap; gap: .22rem .7rem; font-size: .77rem; }
.rp-rack-sources a { color: var(--aidc-accent-text); text-decoration: underline; }

@media (max-width: 680px) {
  .rp-rack-body { grid-template-columns: 1fr; }
  .rp-rack-view { height: clamp(17rem, 45dvh, 22rem); min-height: 0; }
}

.rp-it-dimension {
  padding: .08rem .3rem;
  border: 1px solid var(--aidc-border);
  border-radius: .28rem;
  background: var(--aidc-surface);
  color: var(--aidc-text-strong);
  font-size: .72rem;
  font-weight: 650;
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.rp-stack-model:not(.rp-pod-dimensions-compact) .rp-pod-it-floor-label .rp-model-layer-height { display: none; }
.rp-pod-it-summary {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.rp-pod-dimensions-compact .rp-pod-it-summary {
  position: static;
  display: grid;
  flex-basis: 100%;
  width: auto;
  height: auto;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .36rem .8rem;
  margin: 0;
  overflow: visible;
  clip-path: none;
  white-space: normal;
}
.rp-pod-it-summary div { display: flex; justify-content: space-between; gap: .4rem; }
.rp-pod-it-summary dd { margin: 0; font-weight: 650; white-space: nowrap; }
.rp-pod-it-levels { flex-basis: 100%; }
