/* 板块雷达 - 行业面积热力图与成分浮层样式 */
#ranking {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
}

.heat-controls {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  align-self: start;
  gap: 8px;
  padding: 10px;
  background: var(--radar-rail);
  border: 1px solid var(--radar-border);
  border-radius: 8px;
}

.heat-controls select { display: block; width: auto; max-width: 100%; min-width: 0; flex: 0 1 auto; }
.heat-controls label { display: flex; flex-direction: row; align-items: center; gap: 5px; font-size: 14px; color: var(--radar-muted); }
.heat-controls strong { margin-right: 0; }

.heat-stage { min-width: 0; }
.heat-stage #classification { margin: 0 0 8px; font-size: 14px; }
.heat-stage #note { margin: 8px 0 0; font-size: 13px; }
.heat-stage #heatBreadth { margin: 7px 0; font-size: 14px; }

.heat-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; font-size: 14px; color: var(--radar-muted); }
.heat-scale { display: inline-flex; gap: 3px; }
.heat-scale span { display: inline-block; min-width: 37px; text-align: center; border-radius: 3px; padding: 3px; color: #192e2b; font-size: 12px; }

.heat-flow-details { color: var(--radar-text); font-size: 14px; }
.heat-flow-details .flow { padding: 8px 10px; margin: 6px 0; overflow-wrap: anywhere; }

#ranking #heatmap {
  position: relative;
  display: block;
  margin: 0;
  width: 100%;
  height: 600px;
  overflow: hidden;
  background: var(--radar-seam);
}

#ranking #heatmap .heat-group {
  position: absolute;
  box-sizing: border-box;
  overflow: hidden;
  pointer-events: none;
  border: 1px solid var(--radar-seam);
  border-radius: 0;
  background: var(--radar-seam);
}

#ranking #heatmap .heat-group-label {
  position: relative;
  z-index: 2;
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  background: var(--radar-rail);
  color: var(--radar-text);
  border-bottom: 1px solid var(--radar-border);
  font: 600 12px/20px system-ui, "Microsoft YaHei", sans-serif;
  padding-inline: 5px;
  pointer-events: none;
}

#ranking #heatmap button.heat-tile {
  position: absolute;
  box-sizing: border-box;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-width: 0;
  min-height: 0;
  max-width: none;
  max-height: none;
  aspect-ratio: auto;
  margin: 0;
  padding: 0 2px;
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--radar-seam);
  border-radius: 0;
  font-family: inherit;
  line-height: 1.15;
  text-align: center;
  text-shadow: none;
  container-type: size;
  transition: none;
}

#ranking #heatmap button.heat-tile span,
#ranking #heatmap button.heat-tile b {
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}

#ranking #heatmap button.heat-tile span { font-size: clamp(8px, 14cqw, 14px); font-weight: 600; }
#ranking #heatmap button.heat-tile b { font-size: clamp(7px, min(15cqw, 40cqh), 19px); }
#ranking #heatmap .heat-tile.tiny span,
#ranking #heatmap .heat-tile.tiny b { visibility: hidden; }
#ranking #heatmap .heat-tile.short-label span { visibility: visible; font-size: clamp(8px, 15cqw, 15px); }
#ranking #heatmap .heat-tile.short-label b { display: none; }
#ranking #heatmap .heat-tile:hover,
#ranking #heatmap .heat-tile:focus-visible,
#ranking #heatmap .heat-tile[aria-expanded="true"] {
  outline: 2px solid var(--radar-accent-strong);
  outline-offset: -2px;
  z-index: 3;
  filter: brightness(.97);
}
:root[data-theme="eye"] #heatmap .heat-tile { filter: saturate(.74); }

/* 热力图成分浮层检查器 */
#heatInspector {
  width: min(368px, calc(100vw - 16px));
  max-height: 70vh;
  background: var(--radar-panel);
  color: var(--radar-text);
  border: 1px solid var(--radar-border);
  border-radius: 9px;
  box-shadow: var(--radar-shadow);
  font-size: 14px;
}

.heat-inspector-head,
.heat-inspector-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--radar-rail);
}

.heat-inspector-title { font-weight: 700; color: var(--radar-text-strong); }
.heat-inspector-close { padding: 2px 8px; line-height: 1.2; }
.heat-inspector-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  padding: 8px 10px;
  color: var(--radar-muted);
  font-size: 12px;
}
.heat-inspector-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 52px 60px 56px;
  gap: 4px;
  align-items: center;
  padding: 5px 9px;
  border-top: 1px solid var(--radar-seam);
  cursor: pointer;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.heat-inspector-row:hover,
.heat-inspector-row:focus-visible { background: var(--radar-hover); }
.heat-row-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.heat-inspector-hint,
.heat-inspector-empty { padding: 7px 10px; color: var(--radar-muted); font-size: 12px; }
.heat-inspector-spark { font-size: 10px; color: var(--radar-muted); }
#heatInspector .heat-spark-svg { display: block; width: 100%; height: 20px; min-width: 0; background: none; }
.heat-inspector-actions button { font-size: 13px; padding: 5px 10px; }
