/* =========================================================================
 * 知识星图（/star-map）
 * 依赖 article.css 的 hero / 卡片基础样式
 * ========================================================================= */

.starmap-shell {
  position: relative;
  padding: 1.1rem 1.2rem 1.2rem;
}

.starmap-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.9rem 1.4rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid rgba(102, 204, 255, 0.12);
}

.starmap-toolbar-group {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.starmap-label {
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  color: rgba(150, 190, 220, 0.5);
}

.starmap-btn {
  padding: 0.28rem 0.75rem;
  font-size: 0.78rem;
  color: rgba(200, 230, 250, 0.75);
  background: rgba(10, 22, 36, 0.6);
  border: 1px solid rgba(102, 204, 255, 0.22);
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.starmap-btn:hover {
  color: #d9f1ff;
  border-color: rgba(102, 204, 255, 0.55);
}

.starmap-btn.is-active {
  color: #06131f;
  background: var(--miku-blue, #66ccff);
  border-color: transparent;
  box-shadow: 0 0 16px rgba(102, 204, 255, 0.35);
}

.starmap-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  font-size: 0.78rem;
  font-weight: normal;
  color: rgba(200, 230, 250, 0.7);
  cursor: pointer;
}

.starmap-switch input { cursor: pointer; }

.starmap-search { margin-left: auto; }

.starmap-input {
  width: 220px;
  padding: 0.3rem 0.7rem;
  font-size: 0.78rem;
  color: #d9f1ff;
  background: rgba(8, 18, 30, 0.7);
  border: 1px solid rgba(102, 204, 255, 0.22);
  border-radius: 999px;
  outline: none;
}

.starmap-input:focus { border-color: rgba(102, 204, 255, 0.6); }

.starmap-hint {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  margin-top: 0.8rem;
  padding: 0.45rem 0.75rem;
  font-size: 0.76rem;
  color: rgba(190, 225, 250, 0.75);
  background: rgba(102, 204, 255, 0.08);
  border: 1px solid rgba(102, 204, 255, 0.18);
  border-radius: 8px;
}

.starmap-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.9rem;
  margin-top: 0.8rem;
  font-size: 0.72rem;
  color: rgba(180, 215, 240, 0.72);
}

.starmap-legend-item { display: inline-flex; align-items: center; gap: 0.35rem; }
.starmap-legend-item i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.starmap-legend-item em { font-style: normal; color: rgba(150, 190, 220, 0.55); }

/* 标签分类 chips：点击切换该分类节点的显隐（纯前端过滤） */
.starmap-cat-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.6rem;
  margin-top: 0.6rem;
  font-size: 0.72rem;
  color: rgba(180, 215, 240, 0.72);
}

.starmap-cat-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(102, 204, 255, 0.24);
  background: rgba(102, 204, 255, 0.08);
  color: inherit;
  font-size: 0.72rem;
  cursor: pointer;
  transition: opacity 0.15s ease, border-color 0.15s ease;
}

.starmap-cat-chip i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.starmap-cat-chip em { font-style: normal; color: rgba(150, 190, 220, 0.55); }
.starmap-cat-chip:hover { border-color: rgba(102, 204, 255, 0.55); }
.starmap-cat-chip.is-off { opacity: 0.35; }

.starmap-canvas-wrap {
  position: relative;
  margin-top: 0.6rem;
  border-radius: 10px;
  overflow: hidden;
  background:
    radial-gradient(circle at 30% 20%, rgba(102, 204, 255, 0.08), transparent 55%),
    radial-gradient(circle at 78% 72%, rgba(255, 119, 170, 0.07), transparent 55%),
    rgba(6, 14, 24, 0.65);
  border: 1px solid rgba(102, 204, 255, 0.12);
}

.starmap-chart {
  width: 100%;
  height: 72vh;
  min-height: 460px;
}

.starmap-loading,
.starmap-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  padding: 1.5rem;
  text-align: center;
  font-size: 0.85rem;
  color: rgba(180, 215, 240, 0.7);
  background: rgba(6, 14, 24, 0.55);
}

.starmap-loading { pointer-events: none; }

/* 覆盖 UA 的 [hidden]，避免 display:flex 让隐藏元素重新出现 */
.starmap-hint[hidden],
.starmap-empty[hidden],
.starmap-loading[hidden] { display: none !important; }

.starmap-drawer {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  z-index: 6;
  width: min(320px, calc(100% - 1.8rem));
  max-height: calc(100% - 1.8rem);
  overflow-y: auto;
  padding: 1.1rem 1.15rem 1.2rem;
  background: rgba(8, 17, 28, 0.96);
  border: 1px solid rgba(102, 204, 255, 0.28);
  border-radius: 10px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(6px);
}

.starmap-drawer-close {
  position: absolute;
  top: 0.45rem;
  right: 0.6rem;
  padding: 0;
  width: 24px;
  height: 24px;
  font-size: 1.1rem;
  line-height: 1;
  color: rgba(180, 215, 240, 0.65);
  background: transparent;
  border: 0;
  cursor: pointer;
}

.starmap-drawer-close:hover { color: #fff; }

.starmap-drawer-title {
  margin: 0.2rem 0 0.5rem;
  font-size: 1.02rem;
  line-height: 1.5;
  color: #e3f4ff;
}

.starmap-drawer-summary {
  margin: 0 0 0.9rem;
  font-size: 0.8rem;
  line-height: 1.7;
  color: rgba(170, 205, 230, 0.72);
}

.starmap-drawer-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem 0.8rem;
  margin: 0 0 1rem;
}

.starmap-drawer-meta dt {
  margin: 0 0 0.1rem;
  font-size: 0.68rem;
  font-weight: normal;
  letter-spacing: 0.1em;
  color: rgba(150, 190, 220, 0.55);
}

.starmap-drawer-meta dd {
  margin: 0;
  font-size: 0.8rem;
  color: rgba(215, 240, 255, 0.88);
}

.starmap-drawer-link {
  display: inline-flex;
  width: 100%;
  align-items: center;
  justify-content: center;
}

@media (max-width: 767.98px) {
  .starmap-shell { padding: 0.9rem; }
  .starmap-search { margin-left: 0; width: 100%; }
  .starmap-input { width: 100%; }
  .starmap-chart { height: 60vh; min-height: 380px; }
  .starmap-drawer { top: auto; bottom: 0.6rem; right: 0.6rem; left: 0.6rem; width: auto; max-height: 55%; }
}
