/* Yilinhut Tag Atlas v2 */

.ta-atlas {
  /* one bright cluster palette for both themes: the sky canvas is always deep space */
  --ta-c0: #94a3b8;
  --ta-c1: #34d399;
  --ta-c2: #38bdf8;
  --ta-c3: #fb7185;
  --ta-c4: #a78bfa;
  --ta-c5: #2dd4bf;
  --ta-c6: #fbbf24;
  --ta-c7: #818cf8;
  --ta-c8: #f472b6;
  --ta-c9: #b8b89f;
  --ta-glow: rgba(135, 220, 255, 0.9);
  margin: 3.4rem 0 1rem;
}

.ta-head {
  max-width: 46rem;
  margin-bottom: 1.4rem;
}

.ta-kicker {
  margin: 0 0 0.3rem;
  font-size: 12px;
  letter-spacing: 0.18em;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  color: var(--yh-accent, #0891b2);
}

.ta-head h2 {
  margin: 0.25rem 0 0.55rem;
  font-size: clamp(1.45rem, 2.6vw, 1.9rem);
}

.ta-lede {
  color: var(--yh-muted, #5c6875);
  font-size: 0.95rem;
  line-height: 1.75;
  margin: 0;
}

.ta-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 18px;
  align-items: stretch;
}

.ta-canvas-wrap {
  position: relative;
  border: 1px solid rgba(120, 150, 210, 0.24);
  border-radius: 18px;
  background:
    radial-gradient(ellipse 90% 70% at 50% 0%, rgba(58, 96, 180, 0.28), transparent 70%),
    linear-gradient(180deg, #060a18, #0d142e);
  overflow: hidden;
  box-shadow:
    inset 0 0 70px rgba(8, 15, 40, 0.6),
    0 12px 44px rgba(8, 14, 34, 0.22);
}

.ta-canvas {
  display: block;
  width: 100%;
  cursor: grab;
}

.ta-tip {
  position: absolute;
  pointer-events: none;
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  background: rgba(10, 16, 36, 0.92);
  color: #e8eef9;
  border: 1px solid rgba(130, 160, 220, 0.35);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  z-index: 3;
  white-space: nowrap;
}

.ta-controls {
  position: absolute;
  right: 10px;
  bottom: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 2;
}

.ta-controls button {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  border: 1px solid rgba(130, 160, 220, 0.35);
  background: rgba(14, 22, 46, 0.78);
  color: #dfe8f6;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.ta-controls button:hover {
  transform: translateY(-1px);
  border-color: var(--ta-glow);
}

.ta-side {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.ta-selection,
.ta-drawer {
  border: 1px solid var(--yh-line, rgba(15, 23, 31, 0.12));
  border-radius: 16px;
  background: var(--yh-panel, rgba(255, 255, 255, 0.72));
  padding: 14px 16px;
}

.ta-side-label {
  margin: 0 0 10px;
  font-size: 11px;
  letter-spacing: 0.14em;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  text-transform: uppercase;
  color: var(--yh-muted, #5c6875);
}

.ta-side-label b {
  color: var(--yh-accent, #0891b2);
  font-weight: 600;
  margin-left: 6px;
}

.ta-picked {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 30px;
}

.ta-empty-hint {
  font-size: 12.5px;
  color: var(--yh-muted, #5c6875);
  opacity: 0.75;
  line-height: 30px;
}

.ta-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px 5px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: color-mix(in srgb, var(--ta-c1) 14%, transparent);
  border-color: color-mix(in srgb, var(--ta-c1) 45%, transparent);
  color: var(--yh-ink, #11161c);
  font-size: 13px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.ta-pill[data-cluster="0"] { background: color-mix(in srgb, var(--ta-c0) 14%, transparent); border-color: color-mix(in srgb, var(--ta-c0) 45%, transparent); }
.ta-pill[data-cluster="2"] { background: color-mix(in srgb, var(--ta-c2) 14%, transparent); border-color: color-mix(in srgb, var(--ta-c2) 45%, transparent); }
.ta-pill[data-cluster="3"] { background: color-mix(in srgb, var(--ta-c3) 14%, transparent); border-color: color-mix(in srgb, var(--ta-c3) 45%, transparent); }
.ta-pill[data-cluster="4"] { background: color-mix(in srgb, var(--ta-c4) 14%, transparent); border-color: color-mix(in srgb, var(--ta-c4) 45%, transparent); }
.ta-pill[data-cluster="5"] { background: color-mix(in srgb, var(--ta-c5) 14%, transparent); border-color: color-mix(in srgb, var(--ta-c5) 45%, transparent); }
.ta-pill[data-cluster="6"] { background: color-mix(in srgb, var(--ta-c6) 14%, transparent); border-color: color-mix(in srgb, var(--ta-c6) 45%, transparent); }
.ta-pill[data-cluster="7"] { background: color-mix(in srgb, var(--ta-c7) 14%, transparent); border-color: color-mix(in srgb, var(--ta-c7) 45%, transparent); }
.ta-pill[data-cluster="8"] { background: color-mix(in srgb, var(--ta-c8) 14%, transparent); border-color: color-mix(in srgb, var(--ta-c8) 45%, transparent); }
.ta-pill[data-cluster="9"] { background: color-mix(in srgb, var(--ta-c9) 14%, transparent); border-color: color-mix(in srgb, var(--ta-c9) 45%, transparent); }

.ta-pill:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.ta-pill i {
  font-style: normal;
  opacity: 0.55;
}

.ta-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 12px;
}

.ta-open-results {
  font-size: 13px;
  font-weight: 600;
  color: var(--yh-accent, #0891b2);
  text-decoration: none;
}

.ta-open-results:hover {
  text-decoration: underline;
}

.ta-clear {
  border: 0;
  background: transparent;
  color: var(--yh-muted, #5c6875);
  font-size: 12.5px;
  cursor: pointer;
  padding: 0;
}

.ta-clear:hover {
  color: var(--yh-ink, #11161c);
}

.ta-drawer {
  flex: 1;
  overflow: auto;
  max-height: 430px;
  scrollbar-width: thin;
}

.ta-drawer.is-loading {
  opacity: 0.55;
}

.ta-results {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ta-results li {
  padding: 9px 0;
  border-bottom: 1px dashed var(--yh-line, rgba(15, 23, 31, 0.1));
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.ta-results li:last-child {
  border-bottom: 0;
}

.ta-results a {
  font-size: 14px;
  line-height: 1.55;
  color: var(--yh-ink, #11161c);
  text-decoration: none;
}

.ta-results a:hover {
  color: var(--yh-accent, #0891b2);
}

.ta-results small {
  font-size: 11.5px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  color: var(--yh-muted, #5c6875);
}

.ta-none {
  color: var(--yh-muted, #5c6875);
  font-size: 13px;
}

.ta-more {
  margin-top: 10px;
  width: 100%;
  padding: 7px 0;
  border-radius: 10px;
  border: 1px solid var(--yh-line, rgba(15, 23, 31, 0.14));
  background: transparent;
  color: var(--yh-muted, #5c6875);
  font-size: 12.5px;
  cursor: pointer;
}

.ta-more:hover {
  color: var(--yh-accent, #0891b2);
  border-color: var(--yh-accent, #0891b2);
}

.ta-all {
  margin-top: 16px;
  border: 1px solid var(--yh-line, rgba(15, 23, 31, 0.1));
  border-radius: 14px;
  background: var(--yh-panel, rgba(255, 255, 255, 0.55));
  padding: 14px 16px 16px;
}

.ta-search {
  width: 100%;
  max-width: 320px;
  margin-bottom: 12px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--yh-line, rgba(15, 23, 31, 0.16));
  background: transparent;
  color: var(--yh-ink, #11161c);
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ta-search:focus {
  border-color: var(--yh-accent, #0891b2);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--yh-accent, #0891b2) 18%, transparent);
}

.ta-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ta-chip.is-minor {
  border-style: dashed;
  opacity: 0.88;
}

.ta-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--yh-line, rgba(15, 23, 31, 0.16));
  background: transparent;
  color: var(--yh-ink, #11161c);
  font-size: 12.5px;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease, background 0.15s ease;
}

.ta-chip em {
  font-style: normal;
  font-size: 10.5px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  color: var(--yh-muted, #5c6875);
}

.ta-chip:hover {
  transform: translateY(-1px);
  border-color: var(--yh-accent, #0891b2);
}

.ta-chip.is-active {
  background: var(--yh-accent, #0891b2);
  border-color: var(--yh-accent, #0891b2);
  color: #fff;
}

.ta-chip.is-active em {
  color: rgba(255, 255, 255, 0.75);
}

.ta-results-note {
  margin: -0.4rem 0 1.4rem;
}

.ta-results-note a {
  font-size: 13.5px;
  color: var(--yh-accent, #0891b2);
  text-decoration: none;
}

.ta-results-note a:hover {
  text-decoration: underline;
}

@media (max-width: 980px) {
  .ta-layout {
    grid-template-columns: 1fr;
  }

  .ta-drawer {
    max-height: 320px;
  }
}


/* -------------------------- tag popover --------------------------------- */
.ta-pop {
  position: absolute;
  z-index: 9500;
  width: min(330px, calc(100vw - 20px));
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--yh-line, rgba(15, 23, 31, 0.14));
  background: var(--yh-panel, #fff);
  backdrop-filter: blur(12px);
  box-shadow: 0 18px 56px rgba(15, 23, 31, 0.2);
}

.ta-pop__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
}

.ta-pop__head strong {
  font-size: 1.05rem;
  color: var(--yh-ink, #11161c);
}

.ta-pop__all,
.ta-pop__atlas {
  font-size: 12px;
  color: var(--yh-accent, #0891b2);
  text-decoration: none;
}

.ta-pop__rel span,
.ta-pop__posts span {
  display: block;
  font-size: 11px;
  letter-spacing: 0.12em;
  font-family: ui-monospace, Menlo, monospace;
  color: var(--yh-muted, #5c6875);
  margin-bottom: 6px;
}

.ta-pop__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.ta-pop__posts ol {
  list-style: none;
  margin: 0 0 10px;
  padding: 0;
}

.ta-pop__posts li {
  padding: 5px 0;
  border-bottom: 1px dashed var(--yh-line, rgba(15, 23, 31, 0.1));
}

.ta-pop__posts li a {
  font-size: 13px;
  color: var(--yh-ink, #11161c);
  text-decoration: none;
  display: block;
  line-height: 1.5;
}

.ta-pop__posts li a:hover {
  color: var(--yh-accent, #0891b2);
}

.ta-pop__posts li small {
  font-size: 10.5px;
  font-family: ui-monospace, Menlo, monospace;
  color: var(--yh-muted, #5c6875);
}
