html.tags-map-theme,
.tags-map-body {
  min-height: 100%;
  margin: 0;
  background: #1a222c;
}

.tags-map-body {
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

.tags-map-body * {
  box-sizing: border-box;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.tag-map-page {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  min-height: 100svh;
  padding: 6.7rem clamp(0.75rem, 1.5vw, 1.5rem) 2rem;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 18%, rgba(37, 101, 123, 0.22), transparent 30rem),
    radial-gradient(circle at 82% 72%, rgba(66, 185, 131, 0.11), transparent 32rem),
    #1a222c;
}

.tag-map-stars,
.tag-map-stars .particles-js-canvas-el {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100% !important;
  height: 100% !important;
}

.tag-map-header {
  position: relative;
  z-index: 3;
  text-align: center;
}

.tag-map-header__eyebrow {
  margin: 0 0 0.45rem;
  color: #74d8bd;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.tag-map-header h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(2.15rem, 5vw, 4.1rem);
  font-weight: 650;
  letter-spacing: -0.035em;
  line-height: 1.05;
}

.tag-map-header__back {
  display: inline-block;
  margin-top: 0.8rem;
  padding: 0.4rem 0.75rem;
  color: #d9e9e5;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
  border: 1px solid rgba(157, 222, 207, 0.48);
  border-radius: 999px;
  transition: color 0.18s ease, background-color 0.18s ease, border-color 0.18s ease;
}

.tag-map-header__back:hover,
.tag-map-header__back:focus-visible {
  color: #16232b;
  background: #74d8bd;
  border-color: #74d8bd;
}

.tag-map-header__back:focus-visible,
.tag-map-node:focus-visible,
.tag-map-results__close:focus-visible,
.tag-map-results__list a:focus-visible {
  outline: 3px solid #8de8d0;
  outline-offset: 3px;
}

.tag-map-edge:focus-visible {
  outline: 0;
}

.tag-map-edge:focus-visible .tag-map-edge__count {
  outline: 3px solid #8de8d0;
  outline-offset: 3px;
}

.tag-map-graph {
  position: relative;
  z-index: 2;
  width: 100%;
  margin: 1.35rem auto 0;
}

.tag-map-controls {
  position: relative;
  z-index: 4;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.65rem;
  width: min(100%, 64rem);
  margin: 0 auto 0.9rem;
}

.tag-map-search {
  display: flex;
  flex: 1 1 25rem;
  min-width: 0;
}

.tag-map-search__input {
  min-width: 0;
  flex: 1 1 auto;
  height: 2.75rem;
  padding: 0 0.95rem;
  color: #f5fffc;
  font: inherit;
  font-size: 0.86rem;
  background: rgba(8, 19, 27, 0.72);
  border: 1px solid rgba(157, 222, 207, 0.42);
  border-right: 0;
  border-radius: 0.7rem 0 0 0.7rem;
  outline: 0;
}

.tag-map-search__input::placeholder {
  color: rgba(224, 239, 235, 0.6);
}

.tag-map-search__input:focus {
  border-color: #8de8d0;
  box-shadow: 0 0 0 3px rgba(141, 232, 208, 0.16);
}

.tag-map-categories {
  position: relative;
  flex: 0 1 15rem;
  min-width: 12rem;
  color: #e8f5f1;
  font-size: 0.8rem;
}

.tag-map-categories summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  height: 2.75rem;
  padding: 0 0.9rem;
  font-weight: 800;
  list-style: none;
  background: rgba(8, 19, 27, 0.72);
  border: 1px solid rgba(157, 222, 207, 0.42);
  border-radius: 0.7rem;
  cursor: pointer;
}

.tag-map-categories summary::-webkit-details-marker {
  display: none;
}

.tag-map-categories summary::after {
  width: 0.48rem;
  height: 0.48rem;
  margin-left: auto;
  content: "";
  border-right: 2px solid #8de8d0;
  border-bottom: 2px solid #8de8d0;
  transform: rotate(45deg) translateY(-0.15rem);
  transition: transform 0.18s ease;
}

.tag-map-categories[open] summary::after {
  transform: rotate(225deg) translate(-0.12rem, -0.12rem);
}

.tag-map-categories summary:focus-visible {
  outline: 3px solid rgba(141, 232, 208, 0.52);
  outline-offset: 3px;
}

.tag-map-categories__summary {
  max-width: 7rem;
  overflow: hidden;
  color: #8de8d0;
  font-size: 0.72rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tag-map-categories__panel {
  position: absolute;
  top: calc(100% + 0.45rem);
  right: 0;
  z-index: 20;
  width: min(21rem, calc(100vw - 2rem));
  padding: 0.9rem;
  margin: 0;
  color: #26383f;
  background: rgba(251, 254, 253, 0.98);
  border: 1px solid rgba(157, 222, 207, 0.72);
  border-radius: 0.75rem;
  box-shadow: 0 1rem 2.6rem rgba(0, 0, 0, 0.34);
}

.tag-map-categories__help {
  margin: 0 0 0.65rem;
  color: #66777d;
  font-size: 0.7rem;
  line-height: 1.4;
}

.tag-map-categories__options {
  display: grid;
  gap: 0.18rem;
  max-height: 16rem;
  overflow: auto;
}

.tag-map-categories__options label {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.55rem;
  min-height: 2rem;
  padding: 0.25rem 0.4rem;
  border-radius: 0.42rem;
  cursor: pointer;
}

.tag-map-categories__options label:hover {
  background: #e8f5f1;
}

.tag-map-categories__options input {
  width: 1rem;
  height: 1rem;
  margin: 0;
  accent-color: #17866e;
}

.tag-map-categories__options input:focus-visible {
  outline: 2px solid #17866e;
  outline-offset: 2px;
}

.tag-map-categories__count {
  min-width: 1.6rem;
  padding: 0.12rem 0.4rem;
  color: #356258;
  font-size: 0.66rem;
  font-weight: 800;
  text-align: center;
  background: #dff1ec;
  border-radius: 999px;
}

.tag-map-categories__clear {
  width: 100%;
  margin-top: 0.7rem;
  padding: 0.48rem 0.65rem;
  color: #176653;
  font: inherit;
  font-size: 0.7rem;
  font-weight: 800;
  background: transparent;
  border: 1px solid #a8cec4;
  border-radius: 0.5rem;
  cursor: pointer;
}

.tag-map-categories__clear:hover,
.tag-map-categories__clear:focus-visible {
  color: #fff;
  background: #176653;
  border-color: #176653;
}

.tag-map-control-button {
  min-height: 2.75rem;
  padding: 0 1rem;
  color: #15313a;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
  background: #8de8d0;
  border: 1px solid #8de8d0;
  border-radius: 0 0.7rem 0.7rem 0;
  cursor: pointer;
  transition: color 0.18s ease, background-color 0.18s ease, border-color 0.18s ease;
}

.tag-map-control-button--secondary {
  color: #dcece8;
  background: rgba(8, 19, 27, 0.62);
  border-color: rgba(157, 222, 207, 0.42);
  border-radius: 0.7rem;
}

.tag-map-control-button:hover,
.tag-map-control-button:focus-visible {
  color: #10242b;
  background: #b4f4e3;
  border-color: #b4f4e3;
}

.tag-map-control-button:focus-visible {
  outline: 3px solid rgba(141, 232, 208, 0.52);
  outline-offset: 3px;
}

.tag-map-search__status {
  flex: 1 0 100%;
  min-height: 1.1rem;
  margin: -0.2rem 0 0;
  color: rgba(224, 239, 235, 0.72);
  font-size: 0.72rem;
  text-align: center;
}

.tag-map-stage {
  position: relative;
  width: 100%;
  height: max(36rem, calc(100svh - 15rem));
  min-height: 36rem;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 46%, rgba(22, 47, 61, 0.38), rgba(12, 22, 30, 0.18) 62%, rgba(7, 13, 19, 0.3)),
    rgba(12, 22, 30, 0.18);
  border: 1px solid rgba(157, 222, 207, 0.18);
  border-radius: 1.25rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 1.5rem 4rem rgba(0, 0, 0, 0.18);
}

.tag-map-edges,
.tag-map-nodes {
  position: absolute;
  inset: 0;
}

.tag-map-edges {
  z-index: 1;
}

.tag-map-nodes {
  z-index: 2;
  pointer-events: none;
}

.tag-map-node {
  position: absolute;
  display: grid;
  place-content: center;
  gap: 0.18rem;
  width: var(--node-size);
  height: var(--node-size);
  padding: 0.7rem;
  color: #fff;
  font: inherit;
  text-align: center;
  background:
    radial-gradient(circle at 31% 25%, hsla(var(--node-hue), 82%, 76%, 0.98), hsla(var(--node-hue), 58%, 47%, 0.98) 48%, hsla(var(--node-hue), 58%, 29%, 0.98));
  border: 1px solid hsla(var(--node-hue), 80%, 82%, 0.7);
  border-radius: 50%;
  box-shadow:
    0 0 0 0.35rem hsla(var(--node-hue), 70%, 62%, 0.08),
    0 0 2rem hsla(var(--node-hue), 78%, 61%, 0.28),
    0 0.75rem 1.5rem rgba(0, 0, 0, 0.28);
  cursor: grab;
  pointer-events: auto;
  touch-action: none;
  user-select: none;
  transform: translate(-50%, -50%) scale(var(--node-scale, 1));
  transition: filter 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  will-change: left, top, transform;
}

.tag-map-node__label {
  max-width: 100%;
  overflow-wrap: anywhere;
  font-size: clamp(0.68rem, 1.25vw, 0.9rem);
  font-weight: 800;
  line-height: 1.08;
  text-wrap: balance;
}

.tag-map-node__count {
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.62rem;
  font-weight: 650;
  letter-spacing: 0.04em;
}

.tag-map-node:hover,
.tag-map-node:focus-visible,
.tag-map-node.is-selected,
.tag-map-node.is-focus,
.tag-map-node.is-dragging {
  filter: brightness(1.14) saturate(1.05);
  box-shadow:
    0 0 0 0.45rem hsla(var(--node-hue), 78%, 65%, 0.14),
    0 0 2.8rem hsla(var(--node-hue), 82%, 68%, 0.48),
    0 0.75rem 1.5rem rgba(0, 0, 0, 0.28);
  transform: translate(-50%, -50%) scale(1);
}

.tag-map-node.is-dragging {
  cursor: grabbing;
}

.tag-map-node.is-pinned {
  border-style: dashed;
}

.tag-map-node.is-pinned::after {
  position: absolute;
  top: 10%;
  right: 11%;
  width: 0.48rem;
  height: 0.48rem;
  content: "";
  background: #f4fffc;
  border: 2px solid hsla(var(--node-hue), 68%, 33%, 0.95);
  border-radius: 50%;
  box-shadow: 0 0 0.5rem rgba(255, 255, 255, 0.65);
}

.tag-map-node.is-neighbor {
  opacity: 0.76;
  filter: saturate(0.9);
}

.tag-map-edge.is-related {
  opacity: 0.68;
}

.tag-map-node.is-muted {
  opacity: 0.18;
}

.tag-map-edge.is-muted {
  opacity: 0.08;
}

.tag-map-edge {
  position: absolute;
  z-index: 1;
  height: 2rem;
  padding: 0;
  color: #d7f5ed;
  background: transparent;
  border: 0;
  cursor: pointer;
  transform-origin: 0 50%;
  transition: opacity 0.2s ease;
  will-change: left, top, width, transform;
}

.tag-map-edge__line {
  position: absolute;
  top: 50%;
  right: 0;
  left: 0;
  height: var(--edge-width);
  background: linear-gradient(90deg, rgba(94, 189, 194, 0.52), rgba(116, 216, 189, 0.88), rgba(94, 189, 194, 0.52));
  border-radius: 999px;
  box-shadow: 0 0 0.65rem rgba(116, 216, 189, 0.23);
  transform: translateY(-50%);
}

.tag-map-edge__count {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  place-items: center;
  min-width: 1.75rem;
  height: 1.75rem;
  padding: 0 0.35rem;
  color: #15313a;
  font-size: 0.72rem;
  font-weight: 850;
  line-height: 1;
  background: #8de8d0;
  border: 2px solid rgba(238, 255, 251, 0.92);
  border-radius: 999px;
  box-shadow: 0 0 0 0.28rem rgba(141, 232, 208, 0.11), 0 0.35rem 0.8rem rgba(0, 0, 0, 0.24);
}

.tag-map-edge:hover .tag-map-edge__line,
.tag-map-edge:focus-visible .tag-map-edge__line,
.tag-map-edge.is-focus .tag-map-edge__line,
.tag-map-edge.is-selected .tag-map-edge__line {
  background: #a8f4df;
  box-shadow: 0 0 1rem rgba(141, 232, 208, 0.62);
}

.tag-map-results {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 900;
  width: min(24rem, calc(100% - 2rem));
  max-height: min(25rem, calc(100% - 2rem));
  padding: 1.25rem 1.35rem;
  overflow: auto;
  color: #263238;
  background: rgba(252, 254, 254, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 0.9rem;
  box-shadow: 0 1.2rem 3.4rem rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(12px);
}

.tag-map-results[hidden] {
  display: none;
}

.tag-map-results__close {
  position: absolute;
  top: 0.55rem;
  right: 0.65rem;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  color: #53636b;
  font: 400 1.55rem/1 Arial, sans-serif;
  background: transparent;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}

.tag-map-results__close:hover {
  color: #006f86;
  background: #e5f3f0;
}

.tag-map-results__type {
  margin: 0 2rem 0.35rem 0;
  color: #288068;
  font-size: 0.66rem;
  font-weight: 850;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.tag-map-results h2 {
  margin: 0 2rem 0.45rem 0;
  color: #24323a;
  font-size: 1.35rem;
  line-height: 1.2;
}

.tag-map-results__summary {
  margin: 0 0 0.75rem;
  color: #65747b;
  font-size: 0.82rem;
  line-height: 1.5;
}

.tag-map-results__list {
  padding: 0;
  margin: 0;
  list-style: none;
}

.tag-map-results__list li + li {
  border-top: 1px solid #dfe8e6;
}

.tag-map-results__list a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
  padding: 0.7rem 0;
  color: #284b5a;
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.35;
  text-decoration: none;
}

.tag-map-results__list a:hover {
  color: #0085a1;
}

.tag-map-results__list time {
  color: #78868c;
  font-size: 0.7rem;
  font-weight: 500;
  white-space: nowrap;
}

.tag-map-empty {
  position: absolute;
  top: 50%;
  left: 50%;
  margin: 0;
  color: #d5e6e2;
  transform: translate(-50%, -50%);
}

.tag-map-hint {
  margin: 0.85rem 0 0;
  color: rgba(224, 239, 235, 0.72);
  font-size: 0.76rem;
  text-align: center;
}

.tags-map-body footer {
  margin-top: 0;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

@media (max-width: 767px) {
  .tag-map-page {
    padding: 5.6rem 0.75rem 1.5rem;
  }

  .tag-map-header h1 {
    font-size: clamp(2rem, 12vw, 3rem);
  }

  .tag-map-graph {
    margin-top: 1rem;
  }

  .tag-map-controls {
    gap: 0.55rem;
    margin-bottom: 0.75rem;
  }

  .tag-map-search {
    flex-basis: 100%;
  }

  .tag-map-categories {
    flex: 1 1 100%;
    width: 100%;
  }

  .tag-map-categories__panel {
    position: static;
    width: 100%;
    margin-top: 0.4rem;
  }

  .tag-map-control-button--secondary {
    width: 100%;
  }

  .tag-map-stage {
    height: max(31rem, calc(100svh - 17rem));
    min-height: 31rem;
    border-radius: 0.85rem;
  }

  .tag-map-node__label {
    font-size: 0.66rem;
  }

  .tag-map-results {
    right: 0.75rem;
    bottom: 0.75rem;
    width: calc(100% - 1.3rem);
    max-height: min(55vh, 26rem);
  }

  .tag-map-results__list a {
    grid-template-columns: 1fr;
    gap: 0.15rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tag-map-header__back,
  .tag-map-control-button,
  .tag-map-categories summary::after,
  .tag-map-node,
  .tag-map-edge {
    transition: none;
  }
}
