:root {
  --nebula-night: #1d1737;
  --nebula-night-soft: #29204a;
  --nebula-paper: rgba(255, 253, 255, .94);
  --nebula-ink: #514461;
  --nebula-muted: #80758f;
  --nebula-lilac: #9b79c3;
  --nebula-coral: #dc8ca0;
  --nebula-sky: #7cafd2;
  --nebula-gold: #d8a95f;
}

.knowledge-nebula {
  margin: 24px 0 30px;
  overflow: hidden;
  border: 1px solid rgba(121, 94, 159, .22);
  border-radius: 30px;
  color: var(--nebula-ink);
  background: rgba(255, 253, 255, .88);
  box-shadow: 0 24px 60px rgba(87, 66, 122, .14);
}

.knowledge-nebula-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: end;
  padding: 28px 30px 22px;
}

.knowledge-nebula-kicker {
  margin: 0 0 6px;
  color: #8d6bad;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .15em;
  text-transform: uppercase;
}

.knowledge-nebula-header h3 {
  margin: 0;
  color: #59426c;
  font-family: "STKaiti", "FangSong", "KaiTi", serif;
  font-size: clamp(28px, 3.3vw, 42px);
  line-height: 1.2;
  letter-spacing: .05em;
}

.knowledge-nebula-header p:last-child {
  max-width: 720px;
  margin: 10px 0 0;
  color: var(--nebula-muted);
  line-height: 1.75;
}

.knowledge-nebula-summary {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 9px;
}

.knowledge-nebula-summary span {
  display: grid;
  place-items: center;
  min-width: 96px;
  min-height: 66px;
  padding: 8px 12px;
  border: 1px solid rgba(116, 91, 151, .14);
  border-radius: 18px;
  color: #857691;
  font-size: 12px;
  background: rgba(248, 244, 252, .88);
}

.knowledge-nebula-summary strong {
  color: #72588c;
  font-size: 22px;
  line-height: 1;
}

.knowledge-nebula-relation-guide {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 22px;
  align-items: center;
  margin: 0 30px 20px;
  padding: 17px 19px;
  border: 1px solid rgba(118, 91, 153, .14);
  border-radius: 18px;
  background: rgba(247, 242, 251, .74);
}

.knowledge-nebula-guide-label {
  color: #9a78ad;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .12em;
}

.knowledge-nebula-relation-guide h4 {
  margin: 3px 0 5px;
  color: #624d76;
  font-size: 17px;
}

.knowledge-nebula-relation-guide p {
  max-width: 720px;
  margin: 0;
  color: #82758d;
  font-size: 13px;
  line-height: 1.7;
}

.knowledge-nebula-legend {
  display: grid;
  gap: 7px;
  min-width: 250px;
  color: #766782;
  font-size: 12px;
}

.knowledge-nebula-legend span {
  display: grid;
  grid-template-columns: 34px auto 1fr;
  gap: 7px;
  align-items: center;
}

.knowledge-nebula-legend i {
  display: block;
  height: 2px;
  border-radius: 999px;
  background: rgba(119, 91, 153, .28);
}

.knowledge-nebula-legend i.is-bright {
  background: #d7a658;
  box-shadow: 0 0 6px rgba(216, 169, 95, .44);
}

.knowledge-nebula-legend i.is-none {
  height: 0;
  border-top: 1px dashed rgba(119, 91, 153, .22);
  background: transparent;
}

.knowledge-nebula-stage {
  position: relative;
  min-height: 760px;
  overflow: hidden;
  border-top: 1px solid rgba(115, 90, 151, .15);
  border-bottom: 1px solid rgba(115, 90, 151, .15);
  background: var(--nebula-night);
  isolation: isolate;
}

.knowledge-nebula-experience {
  min-height: 760px;
  background: rgba(255, 253, 255, .96);
  transform-origin: center;
}

.knowledge-nebula-stage.is-veiled .knowledge-nebula-experience {
  opacity: .22;
  filter: blur(8px);
  transform: scale(.72);
}

.knowledge-nebula-veil {
  position: absolute;
  z-index: 20;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #fff;
  text-align: center;
  background-color: #21183b;
  background-image: url('assets/knowledge-nebula/observatory-background-v1.png');
  background-position: center;
  background-size: cover;
  box-shadow: inset 0 0 140px rgba(11, 7, 27, .5);
}

.knowledge-nebula-veil[hidden] { display: none; }

.knowledge-nebula-veil-copy {
  width: min(86%, 560px);
  padding: 34px 38px;
  border: 1px solid rgba(245, 228, 255, .28);
  border-radius: 26px;
  background: rgba(29, 20, 54, .58);
  box-shadow: 0 30px 80px rgba(7, 4, 20, .34);
  backdrop-filter: blur(12px);
}

.knowledge-nebula-veil-copy span {
  color: rgba(238, 216, 250, .78);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .16em;
}

.knowledge-nebula-veil-copy strong {
  display: block;
  margin: 10px 0 8px;
  font-family: "STKaiti", "FangSong", "KaiTi", serif;
  font-size: clamp(28px, 4vw, 44px);
  letter-spacing: .05em;
}

.knowledge-nebula-veil-copy p {
  margin: 0 0 22px;
  color: rgba(242, 234, 248, .78);
  line-height: 1.7;
}

.knowledge-nebula-veil-copy button {
  min-height: 46px;
  padding: 0 24px;
  border: 1px solid rgba(255, 244, 218, .62);
  border-radius: 999px;
  color: #4f385f;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
  background: linear-gradient(135deg, #fff6dc, #e9c7e2);
  box-shadow: 0 12px 30px rgba(8, 5, 24, .28);
}

.knowledge-nebula-veil-copy button:focus-visible {
  outline: 3px solid rgba(255, 255, 255, .76);
  outline-offset: 4px;
}

.knowledge-nebula-stage.is-entering .knowledge-nebula-veil {
  animation: nebula-veil-open 1.5s cubic-bezier(.2, .72, .12, 1) forwards;
}

.knowledge-nebula-stage.is-entering .knowledge-nebula-veil-copy {
  animation: nebula-veil-copy-away .9s ease forwards;
}

.knowledge-nebula-stage.is-entering .knowledge-nebula-experience {
  animation: nebula-approach 1.5s cubic-bezier(.2, .72, .12, 1) both;
}

.knowledge-nebula-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  padding: 18px 30px;
}

.knowledge-nebula-search {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 5px;
  min-width: min(100%, 270px);
}

.knowledge-nebula-search span {
  color: #78678a;
  font-size: 12px;
  font-weight: 800;
}

.knowledge-nebula-search input {
  min-height: 42px;
  padding: 0 15px;
  border: 1px solid rgba(113, 87, 148, .22);
  border-radius: 999px;
  color: #4e405f;
  background: rgba(255, 255, 255, .92);
  outline: none;
}

.knowledge-nebula-search input:focus-visible {
  border-color: #9571bd;
  box-shadow: 0 0 0 3px rgba(149, 113, 189, .18);
}

.knowledge-nebula-filters {
  display: flex;
  flex: 1 1 520px;
  flex-wrap: wrap;
  gap: 7px;
}

.knowledge-nebula-filter,
.knowledge-nebula-reset,
.knowledge-nebula-detail-close {
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid rgba(112, 88, 145, .18);
  border-radius: 999px;
  color: #725f85;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  background: rgba(255, 255, 255, .76);
}

.knowledge-nebula-filter[aria-pressed="true"] {
  border-color: rgba(149, 113, 189, .48);
  color: #fff;
  background: #8c69ad;
  box-shadow: 0 8px 18px rgba(109, 78, 143, .18);
}

.knowledge-nebula-filter:focus-visible,
.knowledge-nebula-reset:focus-visible,
.knowledge-nebula-detail-close:focus-visible {
  outline: 3px solid rgba(226, 174, 205, .55);
  outline-offset: 2px;
}

.knowledge-nebula-reset { white-space: nowrap; }

.knowledge-nebula-workspace {
  display: block;
  min-height: 0;
  border-top: 1px solid rgba(115, 90, 151, .15);
  border-bottom: 1px solid rgba(115, 90, 151, .15);
}

.knowledge-nebula-viewport {
  width: 100%;
  height: clamp(650px, 70vh, 760px);
  min-width: 0;
  overflow: auto;
  background-color: var(--nebula-night);
  background-image: url('assets/knowledge-nebula/observatory-background-v1.png');
  background-position: center;
  background-size: cover;
  background-blend-mode: multiply;
  outline: none;
}

.knowledge-nebula-viewport:focus-visible {
  box-shadow: inset 0 0 0 3px rgba(227, 188, 221, .65);
}

.knowledge-nebula-canvas {
  position: relative;
  width: max(100%, 960px);
  height: 100%;
  min-height: 650px;
  isolation: isolate;
}

.knowledge-nebula-links,
.knowledge-nebula-planets,
.knowledge-nebula-clusters {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.knowledge-nebula-links { z-index: 0; overflow: visible; pointer-events: none; }
.knowledge-nebula-clusters { z-index: 1; pointer-events: none; }
.knowledge-nebula-planets { z-index: 2; }

.knowledge-nebula-link {
  stroke: rgba(222, 207, 245, .23);
  stroke-width: 1.15;
  stroke-linecap: round;
  stroke-dasharray: 4 8;
  vector-effect: non-scaling-stroke;
  transition: opacity .25s ease, stroke .25s ease, stroke-width .25s ease;
  animation: nebula-link-travel 16s linear infinite;
}

.knowledge-nebula-link.is-active {
  stroke: rgba(255, 225, 171, .92);
  stroke-width: 2.2;
  filter: drop-shadow(0 0 6px rgba(255, 207, 145, .72));
}

.knowledge-nebula-link.is-muted { opacity: .14; }

.knowledge-nebula-cluster-label {
  position: absolute;
  left: var(--x);
  top: var(--y);
  translate: -50% 0;
  padding: 4px 9px;
  border: 1px solid rgba(233, 220, 250, .22);
  border-radius: 999px;
  color: rgba(245, 237, 255, .74);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .05em;
  background: rgba(35, 25, 63, .45);
  backdrop-filter: blur(8px);
}

.knowledge-nebula-planet {
  position: absolute;
  left: var(--x);
  top: var(--y);
  display: grid;
  width: 104px;
  padding: 0;
  border: 0;
  color: #fff;
  text-align: center;
  cursor: pointer;
  background: transparent;
  translate: -50% -50%;
  transition: opacity .28s ease, filter .28s ease, scale .28s cubic-bezier(.2, .8, .2, 1);
}

.knowledge-nebula-stage.is-entering .knowledge-nebula-planet {
  animation: nebula-planet-reveal .72s cubic-bezier(.2, .8, .2, 1) var(--reveal-delay) both;
}

.knowledge-nebula-planet[hidden] { display: none; }

.knowledge-nebula-planet-visual {
  display: block;
  width: 104px;
  aspect-ratio: 1;
  animation: nebula-planet-float 6.4s ease-in-out var(--planet-delay) infinite;
}

.knowledge-nebula-planet img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 10px 14px rgba(10, 7, 26, .42));
}

.knowledge-nebula-planet-copy {
  display: grid;
  gap: 1px;
  justify-items: center;
  margin-top: -11px;
  text-shadow: 0 2px 7px rgba(13, 8, 31, .95);
}

.knowledge-nebula-planet-copy strong {
  font-size: 13px;
  line-height: 1.2;
  white-space: nowrap;
}

.knowledge-nebula-planet-copy small {
  color: rgba(236, 227, 248, .68);
  font-size: 9px;
  white-space: nowrap;
}

.knowledge-nebula-planet:hover,
.knowledge-nebula-planet:focus-visible,
.knowledge-nebula-planet.is-selected {
  z-index: 5;
  scale: 1.16;
  outline: none;
  filter: brightness(1.13) saturate(1.08);
}

.knowledge-nebula-planet:focus-visible .knowledge-nebula-planet-visual,
.knowledge-nebula-planet.is-selected .knowledge-nebula-planet-visual {
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(255, 238, 196, .82), 0 0 28px rgba(232, 176, 209, .72);
}

.knowledge-nebula-planet.is-related { filter: brightness(1.12); }
.knowledge-nebula-planet.is-dimmed { opacity: .34; filter: saturate(.55); }

.knowledge-nebula-stage.is-expanded-catalog .knowledge-nebula-planet {
  width: 62px;
}

.knowledge-nebula-stage.is-expanded-catalog .knowledge-nebula-planet-visual {
  width: 62px;
}

.knowledge-nebula-stage.is-expanded-catalog .knowledge-nebula-planet-copy {
  margin-top: -6px;
}

.knowledge-nebula-stage.is-expanded-catalog .knowledge-nebula-planet-copy strong {
  max-width: 92px;
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
}

.knowledge-nebula-stage.is-expanded-catalog .knowledge-nebula-cluster-label {
  font-size: 10px;
}

.knowledge-nebula-empty {
  position: absolute;
  z-index: 8;
  inset: 50% auto auto 50%;
  width: min(78%, 440px);
  margin: 0;
  padding: 18px 22px;
  border: 1px solid rgba(234, 218, 252, .24);
  border-radius: 18px;
  color: rgba(255, 248, 255, .88);
  text-align: center;
  background: rgba(31, 23, 56, .82);
  translate: -50% -50%;
}

.knowledge-nebula-detail {
  min-width: 0;
  padding: 24px;
  border-top: 1px solid rgba(112, 84, 146, .16);
  color: #514461;
  background: rgba(255, 252, 255, .96);
}

.knowledge-nebula-detail[hidden] {
  display: none;
}

.knowledge-nebula-detail-head {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr) auto;
  gap: 13px;
  align-items: center;
  padding-bottom: 17px;
  border-bottom: 1px solid rgba(111, 82, 145, .14);
}

.knowledge-nebula-detail-head img {
  width: 78px;
  height: 78px;
  object-fit: contain;
  filter: drop-shadow(0 8px 12px rgba(81, 60, 109, .2));
}

.knowledge-nebula-detail-head span {
  color: #9b79a9;
  font-size: 11px;
  font-weight: 900;
}

.knowledge-nebula-detail-head h4 {
  margin: 3px 0 4px;
  color: #5f4776;
  font-family: "STKaiti", "FangSong", "KaiTi", serif;
  font-size: 26px;
}

.knowledge-nebula-detail-head p {
  margin: 0;
  color: #87798f;
  font-size: 12px;
  line-height: 1.55;
}

.knowledge-nebula-detail-close {
  align-self: start;
  min-height: 30px;
  padding-inline: 10px;
}

.knowledge-nebula-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 15px;
}

.knowledge-nebula-detail-grid section {
  padding: 13px;
  border: 1px solid rgba(106, 79, 139, .12);
  border-radius: 16px;
  background: rgba(247, 242, 251, .72);
}

.knowledge-nebula-detail-grid section.is-wide { grid-column: 1 / -1; }

.knowledge-nebula-detail-grid h5 {
  margin: 0 0 8px;
  color: #6e5882;
  font-size: 13px;
}

.knowledge-nebula-detail-grid ul,
.knowledge-nebula-detail-grid ol {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 18px;
  color: #655c6c;
  font-size: 12px;
  line-height: 1.55;
}

.knowledge-nebula-detail-grid .is-risk-section {
  border-color: rgba(190, 93, 101, .2);
  background: rgba(253, 241, 242, .88);
}

.knowledge-nebula-detail-grid .is-risk-section h5 { color: #a45c64; }

.knowledge-nebula-competencies {
  margin-top: 15px;
  padding-top: 14px;
  border-top: 1px solid rgba(111, 82, 145, .14);
}

.knowledge-nebula-competencies > strong {
  color: #6e5882;
  font-size: 13px;
}

.knowledge-nebula-competencies > div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.knowledge-nebula-competencies span {
  padding: 5px 9px;
  border-radius: 999px;
  color: #6f5c82;
  font-size: 11px;
  background: #eee7f5;
}

.knowledge-nebula-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 20px;
  padding: 14px 30px 17px;
  color: #8a7e94;
  font-size: 12px;
}

.knowledge-nebula-footer p { margin: 0; }
.knowledge-nebula-footer p:first-child { color: #705b82; font-weight: 800; }

@keyframes nebula-planet-float {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-7px) rotate(1deg); }
}

@keyframes nebula-veil-open {
  0% { opacity: 1; filter: blur(0); background-size: 100% auto; }
  45% { opacity: .88; }
  100% { opacity: 0; filter: blur(14px); background-size: 230% auto; transform: scale(1.16); }
}

@keyframes nebula-veil-copy-away {
  to { opacity: 0; filter: blur(7px); transform: scale(1.22); }
}

@keyframes nebula-approach {
  0% { opacity: .18; filter: blur(9px); transform: scale(.72); }
  58% { opacity: .72; filter: blur(3px); }
  100% { opacity: 1; filter: blur(0); transform: scale(1); }
}

@keyframes nebula-planet-reveal {
  from { opacity: 0; transform: scale(.66); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes nebula-link-travel {
  to { stroke-dashoffset: -96; }
}

@media (max-width: 1080px) {
  .knowledge-nebula-relation-guide { grid-template-columns: 1fr; }
  .knowledge-nebula-legend { min-width: 0; }
}

@media (max-width: 720px) {
  .knowledge-nebula { border-radius: 22px; }
  .knowledge-nebula-header { grid-template-columns: 1fr; padding: 22px 18px 18px; }
  .knowledge-nebula-summary { justify-content: flex-start; }
  .knowledge-nebula-summary span { min-width: 82px; }
  .knowledge-nebula-relation-guide { margin-inline: 18px; }
  .knowledge-nebula-stage,
  .knowledge-nebula-experience { min-height: 700px; }
  .knowledge-nebula-veil-copy { padding: 27px 20px; }
  .knowledge-nebula-toolbar { padding: 0 18px 16px; }
  .knowledge-nebula-search { width: 100%; }
  .knowledge-nebula-canvas { width: 960px; }
  .knowledge-nebula-detail { padding: 19px 17px; }
  .knowledge-nebula-detail-grid { grid-template-columns: 1fr; }
  .knowledge-nebula-detail-grid section.is-wide { grid-column: auto; }
  .knowledge-nebula-footer { padding-inline: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .knowledge-nebula-stage.is-entering .knowledge-nebula-veil,
  .knowledge-nebula-stage.is-entering .knowledge-nebula-veil-copy,
  .knowledge-nebula-stage.is-entering .knowledge-nebula-experience,
  .knowledge-nebula-stage.is-entering .knowledge-nebula-planet,
  .knowledge-nebula-planet-visual,
  .knowledge-nebula-link { animation: none !important; }
  .knowledge-nebula-planet { transition-duration: .01ms; }
}

/* Observatory layout selected for the second knowledge-nebula iteration. */
.knowledge-nebula {
  border-color: rgba(220, 184, 128, .24);
  color: #eee4d2;
  background: #0c0d20;
  box-shadow: 0 28px 70px rgba(30, 23, 59, .28);
}

.knowledge-nebula-header {
  padding: 25px 30px 20px;
  border-bottom: 1px solid rgba(221, 191, 142, .15);
  background: #101126;
}

.knowledge-nebula-header h3 { color: #ead5ad; }
.knowledge-nebula-kicker { color: rgba(224, 193, 143, .62); }

.knowledge-nebula-count {
  align-self: center;
  padding: 8px 13px;
  border: 1px solid rgba(220, 184, 128, .22);
  border-radius: 999px;
  color: rgba(238, 220, 188, .72);
  font-size: 12px;
  letter-spacing: .08em;
}

.knowledge-nebula-stage,
.knowledge-nebula-experience {
  min-height: 990px;
  background: #0a0b1d;
}

.knowledge-nebula-toolbar {
  position: relative;
  z-index: 12;
  align-items: center;
  padding: 14px 24px;
  border-bottom: 1px solid rgba(229, 211, 242, .12);
  background: rgba(10, 11, 29, .92);
}

.knowledge-nebula-search span { color: rgba(228, 211, 238, .68); }
.knowledge-nebula-search input {
  border-color: rgba(222, 199, 239, .22);
  color: #f3eaf7;
  background: rgba(26, 24, 52, .88);
}
.knowledge-nebula-search input::placeholder { color: rgba(225, 211, 235, .45); }

.knowledge-nebula-filter,
.knowledge-nebula-reset {
  border-color: rgba(222, 199, 239, .17);
  color: rgba(235, 220, 242, .74);
  background: rgba(25, 23, 49, .74);
}
.knowledge-nebula-filter[aria-pressed="true"] {
  border-color: rgba(220, 181, 126, .58);
  color: #f4dfb7;
  background: rgba(116, 80, 132, .72);
  box-shadow: 0 0 22px rgba(142, 94, 167, .22);
}

.knowledge-nebula-viewport {
  height: 820px;
  overflow: auto hidden;
  background-color: #08091a;
  background-image: url('assets/knowledge-nebula/observatory-background-v1.png');
  background-position: center;
  background-size: cover;
  background-blend-mode: normal;
}

.knowledge-nebula-canvas {
  width: 100%;
  min-width: 1080px;
  min-height: 820px;
  overflow: hidden;
  perspective: 1200px;
}

.knowledge-nebula-planets,
.knowledge-nebula-clusters,
.knowledge-nebula-links {
  transition: opacity .62s ease, transform 1.05s cubic-bezier(.2, .75, .12, 1), filter .62s ease;
}

.knowledge-nebula-link {
  stroke: rgba(198, 173, 229, .27);
  stroke-width: 1.2;
  stroke-dasharray: 3 10;
  animation-duration: 11s;
}
.knowledge-nebula-link[data-lens="painLocation"] { stroke: rgba(118, 178, 238, .45); }
.knowledge-nebula-link[data-lens="dangerLevel"] { stroke: rgba(238, 119, 115, .48); }
.knowledge-nebula-link[data-lens="testTriage"] { stroke: rgba(103, 206, 204, .46); }
.knowledge-nebula-link[data-lens="masquerade"] { stroke: rgba(218, 177, 98, .5); }
.knowledge-nebula-link.is-active {
  stroke: #f3d69b;
  stroke-width: 2.35;
  filter: drop-shadow(0 0 7px rgba(238, 197, 127, .76));
}

.knowledge-nebula-cluster-label {
  border: 0;
  color: rgba(225, 211, 239, .46);
  font-size: 10px;
  letter-spacing: .13em;
  background: transparent;
  backdrop-filter: none;
}

.knowledge-nebula-planet {
  width: calc(118px * var(--depth));
  transform: translateZ(calc((var(--depth) - 1) * 150px));
}

.knowledge-nebula-planet-visual {
  width: calc(118px * var(--depth));
  animation-duration: 7.6s;
}

.knowledge-nebula-planet img {
  filter: drop-shadow(0 13px 20px rgba(2, 2, 13, .62)) drop-shadow(0 0 10px rgba(213, 181, 239, .2));
}

.knowledge-nebula-planet-copy { margin-top: -10px; }
.knowledge-nebula-planet-copy strong { color: #efe3d1; font-size: 13px; }
.knowledge-nebula-planet-copy small { color: rgba(222, 207, 235, .52); }
.knowledge-nebula-planet:hover,
.knowledge-nebula-planet:focus-visible { scale: 1.22; }

.knowledge-nebula-canvas.is-planet-focused .knowledge-nebula-planets {
  opacity: .24;
  filter: blur(1.5px) saturate(.7);
  transform: translate3d(-14%, -2%, -180px) scale(.78);
}
.knowledge-nebula-canvas.is-planet-focused .knowledge-nebula-clusters { opacity: .12; transform: translateX(-10%); }
.knowledge-nebula-canvas.is-planet-focused .knowledge-nebula-links { opacity: .32; transform: translateX(-9%) scale(.88); }
.knowledge-nebula-canvas.is-planet-focused .knowledge-nebula-planet.is-selected { opacity: 0; }

.knowledge-nebula-focus {
  position: absolute;
  z-index: 9;
  inset: 0;
  overflow: hidden;
  color: #f2e8da;
  animation: nebula-focus-arrive 1.05s cubic-bezier(.18, .78, .15, 1) both;
}
.knowledge-nebula-focus[hidden] { display: none; }

.knowledge-nebula-focus-back {
  position: absolute;
  z-index: 3;
  top: 24px;
  right: 28px;
  min-height: 40px;
  padding: 0 17px;
  border: 1px solid rgba(226, 191, 138, .32);
  border-radius: 999px;
  color: #ead4ad;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  background: rgba(18, 17, 39, .72);
  backdrop-filter: blur(12px);
}
.knowledge-nebula-focus-back:focus-visible { outline: 3px solid rgba(235, 199, 143, .48); outline-offset: 3px; }

.knowledge-nebula-focus-planet {
  position: absolute;
  left: 59%;
  top: 45%;
  width: 420px;
  translate: -50% -50%;
  text-align: center;
}
.knowledge-nebula-focus-planet img {
  display: block;
  width: 360px;
  height: 360px;
  margin: 0 auto -54px;
  object-fit: contain;
  filter: drop-shadow(0 30px 44px rgba(0, 0, 0, .62)) drop-shadow(0 0 30px rgba(236, 179, 116, .34));
  animation: nebula-focus-planet-breathe 5.8s ease-in-out infinite;
}
.knowledge-nebula-focus-planet span { color: rgba(229, 208, 178, .72); font-size: 12px; letter-spacing: .1em; }
.knowledge-nebula-focus-planet h4 {
  margin: 5px 0 7px;
  color: #f2dfbb;
  font-family: "STKaiti", "FangSong", "KaiTi", serif;
  font-size: 42px;
  letter-spacing: .08em;
  text-shadow: 0 3px 18px rgba(0, 0, 0, .72);
}
.knowledge-nebula-focus-planet small {
  padding: 4px 10px;
  border: 1px solid rgba(228, 189, 126, .28);
  border-radius: 999px;
  color: rgba(241, 219, 180, .76);
  background: rgba(23, 20, 43, .58);
}

.knowledge-nebula-orbit-node {
  position: absolute;
  width: 210px;
  padding-left: 20px;
  color: rgba(244, 235, 222, .82);
  animation: nebula-knowledge-reveal .7s ease both;
}
.knowledge-nebula-orbit-node::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #f0c77f;
  box-shadow: 0 0 0 4px rgba(240, 199, 127, .14), 0 0 16px rgba(240, 199, 127, .78);
}
.knowledge-nebula-orbit-node strong { color: #efd6a9; font-size: 17px; letter-spacing: .06em; }
.knowledge-nebula-orbit-node p { margin: 5px 0 0; font-size: 12px; line-height: 1.65; }
.knowledge-nebula-orbit-node.is-symptom { left: 81%; top: 13%; animation-delay: .12s; }
.knowledge-nebula-orbit-node.is-sign { left: 23%; top: 27%; animation-delay: .2s; }
.knowledge-nebula-orbit-node.is-risk { left: 81%; top: 59%; animation-delay: .28s; }
.knowledge-nebula-orbit-node.is-test { left: 54%; top: 78%; animation-delay: .36s; }
.knowledge-nebula-orbit-node.is-differential { left: 23%; top: 66%; animation-delay: .44s; }
.knowledge-nebula-orbit-node.is-risk strong { color: #f2aaa2; }
.knowledge-nebula-orbit-node.is-risk::before { background: #ef8f88; box-shadow: 0 0 0 4px rgba(239, 143, 136, .13), 0 0 16px rgba(239, 143, 136, .72); }

.knowledge-nebula-focus-relations {
  position: absolute;
  left: 25px;
  top: 23px;
  width: 320px;
  padding: 15px 17px;
  border: 1px solid rgba(215, 189, 231, .16);
  border-radius: 18px;
  background: rgba(13, 13, 34, .66);
  backdrop-filter: blur(13px);
  animation: nebula-knowledge-reveal .65s .5s ease both;
}
.knowledge-nebula-focus-relations > span { color: #dcbf8d; font-size: 12px; font-weight: 900; letter-spacing: .06em; }
.knowledge-nebula-focus-relations ul { display: grid; gap: 9px; margin: 11px 0 0; padding: 0; list-style: none; }
.knowledge-nebula-focus-relations li { display: grid; gap: 2px; padding-top: 8px; border-top: 1px solid rgba(221, 205, 233, .1); }
.knowledge-nebula-focus-relations li:first-child { padding-top: 0; border-top: 0; }
.knowledge-nebula-focus-relations strong { color: #eee0c9; font-size: 12px; }
.knowledge-nebula-focus-relations li span { color: rgba(225, 214, 232, .66); font-size: 11px; line-height: 1.55; }

.knowledge-nebula-footer {
  display: grid;
  gap: 10px;
  padding: 13px 18px 17px;
  color: rgba(227, 213, 236, .62);
  background: #0d0e22;
}
.knowledge-nebula-footer p:first-child { padding-left: 6px; color: rgba(230, 214, 238, .66); font-weight: 700; }
.knowledge-nebula-lenses { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.knowledge-nebula-lens {
  display: grid;
  gap: 3px;
  min-height: 58px;
  padding: 9px 12px;
  border: 1px solid rgba(218, 198, 231, .13);
  border-radius: 15px;
  color: rgba(231, 217, 238, .65);
  text-align: left;
  font: inherit;
  cursor: pointer;
  background: rgba(22, 21, 45, .72);
}
.knowledge-nebula-lens strong { font-size: 13px; }
.knowledge-nebula-lens small { overflow: hidden; font-size: 10px; line-height: 1.35; white-space: nowrap; text-overflow: ellipsis; }
.knowledge-nebula-lens[aria-pressed="true"] {
  border-color: rgba(223, 184, 124, .45);
  color: #f0d7a8;
  background: rgba(91, 62, 111, .74);
  box-shadow: inset 0 0 24px rgba(190, 134, 196, .1), 0 0 18px rgba(177, 120, 188, .12);
}
.knowledge-nebula-lens:focus-visible { outline: 3px solid rgba(231, 194, 137, .42); outline-offset: 2px; }

@keyframes nebula-focus-arrive {
  from { opacity: 0; filter: blur(8px); transform: scale(.76) translateX(12%); }
  to { opacity: 1; filter: blur(0); transform: scale(1) translateX(0); }
}
@keyframes nebula-focus-planet-breathe {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-9px) scale(1.025); }
}
@keyframes nebula-knowledge-reveal {
  from { opacity: 0; filter: blur(5px); transform: translateY(12px); }
  to { opacity: 1; filter: blur(0); transform: translateY(0); }
}

@media (max-width: 900px) {
  .knowledge-nebula-stage,
  .knowledge-nebula-experience { min-height: 950px; }
  .knowledge-nebula-canvas { width: 1080px; }
  .knowledge-nebula-lenses { grid-template-columns: repeat(5, 190px); overflow-x: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .knowledge-nebula-focus,
  .knowledge-nebula-focus-planet img,
  .knowledge-nebula-orbit-node,
  .knowledge-nebula-focus-relations { animation: none !important; }
}

/* Cinematic galaxy scene — selected third visual direction. */
.knowledge-nebula {
  position: relative;
  overflow: hidden;
  margin-top: 30px;
  padding: 0;
  border: 1px solid rgba(163, 126, 199, .28);
  border-radius: 28px;
  background: #070817;
  box-shadow: 0 30px 80px rgba(20, 13, 45, .2), inset 0 0 0 1px rgba(255, 255, 255, .025);
}

.knowledge-nebula-stage,
.knowledge-nebula-experience {
  min-height: 900px;
  background: #070817;
}

.knowledge-nebula-stage { position: relative; overflow: hidden; }
.knowledge-nebula-experience { position: relative; }
.knowledge-nebula-workspace { min-height: 812px; }

.knowledge-nebula-viewport {
  height: 812px;
  background-color: #17152f;
  background-image:
    radial-gradient(circle at 34% 42%, rgba(187, 151, 222, .2), transparent 38%),
    radial-gradient(circle at 76% 28%, rgba(111, 130, 202, .16), transparent 42%),
    linear-gradient(180deg, rgba(91, 72, 125, .13), rgba(18, 17, 46, .12)),
    url('assets/knowledge-nebula/milky-way-background-v2.png');
  background-position: center;
  background-size: cover;
  background-blend-mode: screen, screen, screen, normal;
}

.knowledge-nebula-canvas { min-height: 812px; }

.knowledge-nebula-scene-title {
  position: absolute;
  z-index: 11;
  top: 27px;
  left: 32px;
  pointer-events: none;
  text-shadow: 0 2px 0 rgba(255, 255, 255, .5), 0 8px 24px rgba(65, 48, 98, .2);
}
.knowledge-nebula-scene-title h3 {
  margin: 0 0 7px;
  color: #382b58;
  font-family: "STKaiti", "FangSong", "KaiTi", serif;
  font-size: clamp(25px, 2.35vw, 36px);
  font-weight: 700;
  letter-spacing: .08em;
}
.knowledge-nebula-scene-title span {
  color: rgba(64, 49, 91, .68);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .15em;
}

.knowledge-nebula-veil {
  position: absolute;
  z-index: 30;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: inherit;
  cursor: pointer;
  background-color: #09091b;
  background-image: linear-gradient(rgba(5, 5, 19, .12), rgba(5, 5, 19, .22)), url('assets/knowledge-nebula/nebula-veil-v1.png');
  background-position: center;
  background-size: cover;
  appearance: none;
}
.knowledge-nebula-veil[hidden] { display: none; }
.knowledge-nebula-veil:focus-visible { outline: 3px solid rgba(237, 205, 151, .9); outline-offset: -8px; }
.knowledge-nebula-veil-half {
  position: absolute;
  top: -2%;
  bottom: -2%;
  width: 52%;
  background-image: linear-gradient(rgba(5, 5, 19, .12), rgba(5, 5, 19, .22)), url('assets/knowledge-nebula/nebula-veil-v1.png');
  background-repeat: no-repeat;
  background-size: 200% 100%;
  filter: saturate(1.08) contrast(1.04);
  will-change: transform, opacity, filter;
}
.knowledge-nebula-veil-half.is-left { left: -1%; background-position: left center; }
.knowledge-nebula-veil-half.is-right { right: -1%; background-position: right center; }
.knowledge-nebula-veil::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 50% 50%, rgba(176, 122, 222, .08), rgba(5, 5, 18, .16) 52%, rgba(3, 3, 13, .34));
  box-shadow: inset 0 0 90px rgba(5, 3, 18, .54);
}

.knowledge-nebula-stage.is-veiled .knowledge-nebula-experience {
  opacity: .05;
  filter: blur(18px);
  transform: scale(.66);
}
.knowledge-nebula-stage.is-entering .knowledge-nebula-veil { animation: none; }
.knowledge-nebula-stage.is-entering .knowledge-nebula-veil { background-image: none; }
.knowledge-nebula-stage.is-entering .knowledge-nebula-veil-half.is-left {
  animation: nebula-veil-left-open 1.55s cubic-bezier(.2, .74, .1, 1) forwards;
}
.knowledge-nebula-stage.is-entering .knowledge-nebula-veil-half.is-right {
  animation: nebula-veil-right-open 1.55s cubic-bezier(.2, .74, .1, 1) forwards;
}
.knowledge-nebula-stage.is-entering .knowledge-nebula-veil::after {
  animation: nebula-veil-glow-away 1.25s ease forwards;
}
.knowledge-nebula-stage.is-entering .knowledge-nebula-experience {
  animation: nebula-approach 1.5s cubic-bezier(.2, .72, .12, 1) both;
}
.knowledge-nebula-stage.is-entered .knowledge-nebula-experience { opacity: 1; filter: none; transform: none; }

.knowledge-nebula-footer {
  min-height: 88px;
  padding: 14px 18px 16px;
  border-top: 1px solid rgba(218, 196, 230, .1);
  background: linear-gradient(180deg, rgba(13, 14, 34, .96), #0a0b20);
}
.knowledge-nebula-sr-status {
  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;
}
.knowledge-nebula-lens { min-height: 55px; border-radius: 10px; }

.knowledge-nebula-focus-planet { left: 60%; top: 43%; width: 470px; }
.knowledge-nebula-focus-planet img { width: 410px; height: 410px; margin-bottom: -64px; }
.knowledge-nebula-focus-planet h4 { font-size: 48px; }
.knowledge-nebula-orbit-node { width: 220px; }
.knowledge-nebula-orbit-node.is-symptom { left: 81%; top: 14%; }
.knowledge-nebula-orbit-node.is-sign { left: 22%; top: 27%; }
.knowledge-nebula-orbit-node.is-risk { left: 81%; top: 58%; }
.knowledge-nebula-orbit-node.is-test { left: 54%; top: 77%; }
.knowledge-nebula-orbit-node.is-differential { left: 22%; top: 65%; }

@keyframes nebula-veil-left-open {
  0% { opacity: 1; filter: blur(0) saturate(1.08); transform: translateX(0) scale(1); }
  32% { opacity: 1; filter: blur(1px) saturate(1.2); transform: translateX(-6%) scale(1.045); }
  100% { opacity: 0; filter: blur(18px) saturate(1.28); transform: translateX(-112%) scale(1.14); }
}
@keyframes nebula-veil-right-open {
  0% { opacity: 1; filter: blur(0) saturate(1.08); transform: translateX(0) scale(1); }
  32% { opacity: 1; filter: blur(1px) saturate(1.2); transform: translateX(6%) scale(1.045); }
  100% { opacity: 0; filter: blur(18px) saturate(1.28); transform: translateX(112%) scale(1.14); }
}
@keyframes nebula-veil-glow-away {
  0%, 28% { opacity: 1; }
  100% { opacity: 0; }
}

@media (max-width: 900px) {
  .knowledge-nebula-stage,
  .knowledge-nebula-experience { min-height: 938px; }
  .knowledge-nebula-workspace,
  .knowledge-nebula-viewport,
  .knowledge-nebula-canvas { min-height: 850px; }
  .knowledge-nebula-viewport { height: 850px; }
  .knowledge-nebula-scene-title { left: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  .knowledge-nebula-stage.is-entering .knowledge-nebula-veil-half,
  .knowledge-nebula-stage.is-entering .knowledge-nebula-veil::after { animation: none !important; }
}

/* Three depth planes keep the 17 planets from reading as a flat poster. */
.knowledge-nebula-planet {
  transform: translateZ(calc((var(--depth) - 1) * 430px));
}
.knowledge-nebula-planet.is-depth-far {
  z-index: 1;
  opacity: .66;
}
.knowledge-nebula-planet.is-depth-far .knowledge-nebula-planet-visual { animation-duration: 10.8s; }
.knowledge-nebula-planet.is-depth-far img {
  filter: blur(.55px) brightness(.8) saturate(.72) drop-shadow(0 8px 13px rgba(2, 2, 13, .48));
}
.knowledge-nebula-planet.is-depth-far .knowledge-nebula-planet-copy {
  opacity: .68;
  transform: scale(.92);
}
.knowledge-nebula-planet.is-depth-mid { z-index: 3; opacity: .9; }
.knowledge-nebula-planet.is-depth-near { z-index: 5; }
.knowledge-nebula-planet.is-depth-near .knowledge-nebula-planet-visual { animation-duration: 6.2s; }
.knowledge-nebula-planet.is-depth-near img {
  filter: brightness(1.08) saturate(1.12) drop-shadow(0 18px 27px rgba(2, 2, 13, .66)) drop-shadow(0 0 22px rgba(225, 191, 244, .34));
}
.knowledge-nebula-planet.is-depth-near .knowledge-nebula-planet-copy strong {
  color: #2e2448;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .86), 0 0 10px rgba(255, 250, 255, .72), 0 3px 12px rgba(41, 30, 69, .22);
}

/* Legible constellation labels across both luminous clouds and deeper blue space. */
.knowledge-nebula-planet-copy {
  width: max-content;
  max-width: 170px;
  margin-inline: auto;
  padding: 5px 10px 6px;
  border: 1px solid rgba(255, 255, 255, .38);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(255, 253, 255, .66), rgba(232, 226, 250, .44));
  box-shadow: 0 7px 18px rgba(46, 33, 76, .14), inset 0 1px rgba(255, 255, 255, .5);
  backdrop-filter: blur(7px);
}
.knowledge-nebula-planet-copy strong {
  color: #30254b;
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .055em;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .92), 0 0 9px rgba(255, 255, 255, .7), 0 3px 10px rgba(44, 31, 73, .18);
}
.knowledge-nebula-planet-copy small {
  margin-top: 2px;
  color: rgba(64, 49, 92, .66);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .08em;
}
.knowledge-nebula-cluster-label {
  display: none;
  color: rgba(55, 43, 82, .56);
  font-weight: 900;
  text-shadow: 0 1px 7px rgba(255, 255, 255, .8);
}

.knowledge-nebula-focus-planet span { color: rgba(60, 45, 85, .7); font-weight: 800; }
.knowledge-nebula-focus-planet h4 {
  color: #3a2c56;
  text-shadow: 0 2px 0 rgba(255, 255, 255, .72), 0 5px 18px rgba(54, 38, 84, .24);
}
.knowledge-nebula-focus-planet small {
  border-color: rgba(70, 51, 98, .24);
  color: #f7f1ff;
  background: rgba(49, 38, 72, .74);
  box-shadow: 0 6px 16px rgba(48, 34, 73, .18);
}
.knowledge-nebula-orbit-node {
  padding: 11px 13px 11px 32px;
  border: 1px solid rgba(255, 255, 255, .32);
  border-radius: 14px;
  color: rgba(50, 39, 74, .82);
  background: linear-gradient(135deg, rgba(255, 253, 255, .58), rgba(234, 228, 250, .36));
  box-shadow: 0 9px 24px rgba(51, 37, 78, .12), inset 0 1px rgba(255, 255, 255, .5);
  backdrop-filter: blur(7px);
}
.knowledge-nebula-orbit-node::before { left: 13px; top: 18px; }
.knowledge-nebula-orbit-node strong {
  color: #3c2d58;
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 16px;
  font-weight: 900;
  text-shadow: 0 1px rgba(255, 255, 255, .78);
}
.knowledge-nebula-orbit-node p {
  color: rgba(54, 42, 79, .76);
  font-weight: 650;
  text-shadow: 0 1px rgba(255, 255, 255, .68);
}
.knowledge-nebula-orbit-node.is-risk strong { color: #a44758; }

/* Cloud-curtain entrance: a close foreground layer that physically parts. */
.knowledge-nebula-veil {
  background-color: #c8b9de;
  background-image: url('assets/knowledge-nebula/cloud-curtain-v2.png');
}
.knowledge-nebula-veil-half {
  background-image: url('assets/knowledge-nebula/cloud-curtain-v2.png');
  filter: saturate(1.04) contrast(.98) brightness(1.03);
}
.knowledge-nebula-veil::after {
  background: radial-gradient(circle at 50% 48%, rgba(255, 247, 249, .16), rgba(111, 91, 148, .06) 64%, rgba(71, 60, 110, .13));
  box-shadow: inset 0 0 70px rgba(105, 88, 142, .15);
}

/* Names sit directly on the planets; no label boxes or system subtitles. */
.knowledge-nebula-planet-copy,
.knowledge-nebula-planet.is-depth-far .knowledge-nebula-planet-copy {
  position: absolute;
  z-index: 3;
  left: 50%;
  top: calc(64px * var(--depth));
  display: block;
  width: max-content;
  max-width: calc(126px * var(--depth));
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  opacity: 1;
  color: #fffdf6;
  background: none;
  box-shadow: none;
  backdrop-filter: none;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.knowledge-nebula-planet-copy strong,
.knowledge-nebula-planet.is-depth-near .knowledge-nebula-planet-copy strong {
  display: block;
  color: #fffdf5;
  font-size: calc(17px * var(--depth));
  font-weight: 300;
  line-height: 1.05;
  letter-spacing: .08em;
  white-space: normal;
  text-wrap: balance;
  text-shadow: 0 1px 1px rgba(38, 25, 65, .95), 0 2px 5px rgba(28, 18, 55, .9), 0 0 10px rgba(54, 36, 82, .82);
}

.knowledge-nebula-scene-title h3 { font-size: clamp(31px, 2.8vw, 43px); letter-spacing: .14em; }
.knowledge-nebula-focus-planet h4 { font-size: 54px; letter-spacing: .13em; }
.knowledge-nebula-orbit-node strong { font-size: 20px; letter-spacing: .08em; }

/* The relation deck belongs to the same luminous Milky Way palette. */
.knowledge-nebula-footer {
  border-top: 1px solid rgba(255, 255, 255, .5);
  background: linear-gradient(180deg, rgba(220, 215, 244, .94), rgba(190, 201, 237, .96));
  box-shadow: inset 0 12px 32px rgba(255, 255, 255, .28);
}
.knowledge-nebula-lenses {
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, .42);
  border-radius: 16px;
  background: rgba(247, 244, 255, .28);
}
.knowledge-nebula-lens {
  border-color: rgba(91, 70, 132, .18);
  color: rgba(55, 43, 82, .78);
  background: rgba(255, 253, 255, .4);
  box-shadow: inset 0 1px rgba(255, 255, 255, .52);
}
.knowledge-nebula-lens strong { color: #40305e; font-size: 18px; letter-spacing: .07em; }
.knowledge-nebula-lens small { color: rgba(60, 47, 86, .66); }
.knowledge-nebula-lens[aria-pressed="true"] {
  border-color: rgba(111, 75, 145, .34);
  color: #38284f;
  background: linear-gradient(135deg, rgba(250, 226, 241, .88), rgba(220, 211, 246, .9));
  box-shadow: 0 7px 18px rgba(77, 58, 111, .12), inset 0 1px rgba(255, 255, 255, .72);
}

/* One continuous mist layer; it expands and evaporates instead of opening like doors. */
.knowledge-nebula-veil-half { display: none; }
.knowledge-nebula-stage.is-veiled .knowledge-nebula-veil {
  animation: nebula-cloud-drift 8s ease-in-out infinite alternate;
}
.knowledge-nebula-stage.is-entering .knowledge-nebula-veil {
  background-image: url('assets/knowledge-nebula/cloud-curtain-v2.png');
  animation: nebula-cloud-dissolve 1.55s cubic-bezier(.22, .72, .12, 1) forwards;
}
.knowledge-nebula,
.knowledge-nebula-stage,
.knowledge-nebula-experience { background: #c9cbea; }

/* Match the established dimension-visualization typography. */
.knowledge-nebula-scene-title h3,
.knowledge-nebula-planet-copy strong,
.knowledge-nebula-focus-planet h4,
.knowledge-nebula-orbit-node strong,
.knowledge-nebula-lens strong {
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  font-style: normal;
}
.knowledge-nebula-scene-title h3 { font-weight: 800; letter-spacing: .08em; }
.knowledge-nebula-planet-copy strong {
  font-size: calc(14px * var(--depth));
  font-weight: 800;
  letter-spacing: .035em;
}
.knowledge-nebula-focus-planet h4 { font-weight: 800; letter-spacing: .08em; }
.knowledge-nebula-orbit-node strong,
.knowledge-nebula-lens strong { font-weight: 800; letter-spacing: .035em; }

@keyframes nebula-cloud-drift {
  from { background-position: 48% 50%; filter: saturate(1.02) brightness(1.02); }
  to { background-position: 52% 48%; filter: saturate(1.08) brightness(1.06); }
}
@keyframes nebula-cloud-dissolve {
  0% { opacity: 1; filter: blur(0) brightness(1.03); transform: scale(1.03); }
  34% { opacity: .96; filter: blur(2px) brightness(1.1); transform: scale(1.08); }
  100% { opacity: 0; filter: blur(24px) brightness(1.18); transform: scale(1.34); }
}

/* Panorama names sit below each planet without any container. */
.knowledge-nebula-planet-copy,
.knowledge-nebula-planet.is-depth-far .knowledge-nebula-planet-copy {
  top: calc(108px * var(--depth));
  max-width: calc(154px * var(--depth));
  color: #33264f;
  transform: translateX(-50%);
}
.knowledge-nebula-planet-copy strong,
.knowledge-nebula-planet.is-depth-near .knowledge-nebula-planet-copy strong {
  color: #33264f;
  font-size: calc(14px * var(--depth));
  line-height: 1.22;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .96), 0 0 8px rgba(255, 255, 255, .9), 0 3px 9px rgba(51, 38, 79, .18);
}

/* Once entered, the disease name becomes the planet's central label. */
.knowledge-nebula-focus-planet { position: absolute; }
.knowledge-nebula-focus-planet > div {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 205px;
  width: 86%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.knowledge-nebula-focus-planet span,
.knowledge-nebula-focus-planet small { display: none; }
.knowledge-nebula-focus-planet h4 {
  margin: 0;
  color: #fffaf0;
  font-size: 45px;
  line-height: 1.08;
  text-shadow: 0 2px 2px rgba(71, 39, 45, .88), 0 5px 16px rgba(72, 36, 50, .78), 0 0 14px rgba(255, 224, 194, .5);
}

/* Typography matched to the selected observatory visual: slim Chinese serif/Fangsong. */
.knowledge-nebula,
.knowledge-nebula button { font-family: "FangSong", "STFangsong", "Songti SC", "SimSun", serif; }
.knowledge-nebula-scene-title h3,
.knowledge-nebula-planet-copy strong,
.knowledge-nebula-focus-planet h4,
.knowledge-nebula-orbit-node strong,
.knowledge-nebula-orbit-node p,
.knowledge-nebula-lens strong,
.knowledge-nebula-lens small {
  font-family: "FangSong", "STFangsong", "Songti SC", "SimSun", serif;
  font-style: normal;
}
.knowledge-nebula-scene-title h3 { font-weight: 700; letter-spacing: .12em; }
.knowledge-nebula-scene-title span {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 600;
  letter-spacing: .18em;
}
.knowledge-nebula-planet-copy strong { font-weight: 700; letter-spacing: .06em; }
.knowledge-nebula-focus-planet h4 { font-weight: 700; letter-spacing: .12em; }
.knowledge-nebula-orbit-node strong,
.knowledge-nebula-lens strong { font-weight: 700; letter-spacing: .07em; }
.knowledge-nebula-orbit-node p,
.knowledge-nebula-lens small { font-weight: 600; letter-spacing: .025em; }

/* Focus view follows the selected celestial-map visual: art lines + plain text, never cards. */
.knowledge-nebula-focus-orbit-art {
  position: absolute;
  z-index: 1;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: .78;
  pointer-events: none;
  filter: sepia(.12) saturate(1.16) contrast(1.06) drop-shadow(0 1px 2px rgba(76, 50, 78, .2));
  animation: nebula-orbit-art-arrive 1.05s .08s cubic-bezier(.2, .75, .2, 1) both;
}
.knowledge-nebula-focus-planet { z-index: 2; }
.knowledge-nebula-focus-back { z-index: 5; }
.knowledge-nebula-orbit-node {
  z-index: 3;
  width: 218px;
  padding: 0 0 0 22px;
  border: 0;
  border-radius: 0;
  color: #302747;
  background: none;
  box-shadow: none;
  backdrop-filter: none;
  filter: none;
}
.knowledge-nebula-orbit-node::before {
  display: none;
  left: 1px;
  top: 9px;
  width: 8px;
  height: 8px;
  border: 1px solid rgba(103, 70, 71, .64);
  background: #fff4d5;
  box-shadow: 0 0 0 4px rgba(135, 91, 90, .13), 0 0 13px rgba(255, 243, 204, .94), 0 0 18px rgba(104, 66, 92, .42);
}
.knowledge-nebula-orbit-node strong {
  display: block;
  color: #352342;
  font-size: 21px;
  line-height: 1.18;
  font-weight: 700;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .96), 0 0 8px rgba(255, 255, 255, .82), 0 2px 8px rgba(54, 34, 70, .18);
}
.knowledge-nebula-orbit-node p {
  margin: 5px 0 0;
  color: #3b3151;
  font-size: 13px;
  line-height: 1.58;
  font-weight: 700;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .98), 0 0 7px rgba(255, 255, 255, .88);
}
.knowledge-nebula-orbit-node.is-risk strong { color: #7d3049; }
.knowledge-nebula-orbit-node.is-risk::before {
  border-color: rgba(137, 55, 76, .62);
  background: #ffe6dc;
  box-shadow: 0 0 0 4px rgba(151, 60, 84, .12), 0 0 14px rgba(255, 229, 214, .96), 0 0 18px rgba(126, 45, 73, .32);
}

/* Stronger ink colors remain legible on the bright lavender Milky Way. */
.knowledge-nebula-scene-title h3 { color: #27183b; text-shadow: 0 1px 0 rgba(255, 255, 255, .86), 0 4px 14px rgba(50, 34, 75, .16); }
.knowledge-nebula-scene-title span { color: #463753; text-shadow: 0 1px 0 rgba(255, 255, 255, .82); }
.knowledge-nebula-planet-copy strong,
.knowledge-nebula-planet.is-depth-near .knowledge-nebula-planet-copy strong {
  color: #28183e;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 1), 0 0 9px rgba(255, 255, 255, .96), 0 3px 10px rgba(40, 24, 62, .24);
}
.knowledge-nebula-lens strong { color: #2e2047; }
.knowledge-nebula-lens small { color: #453957; }

@keyframes nebula-orbit-art-arrive {
  from { opacity: 0; transform: scale(.96); }
  to { opacity: .78; transform: scale(1); }
}

/* Keep each live highlight dot locked to the center of its raster orbit medallion. */
.knowledge-nebula-focus { container-type: size; }
.knowledge-nebula-focus-orbit-art { object-fit: fill; }
.knowledge-nebula-orbit-node::before {
  display: block;
  left: 50%;
  top: -4.1cqh;
  width: 7px;
  height: 7px;
  border: 0;
  transform: translate(-50%, -50%);
}
.knowledge-nebula-orbit-node {
  padding: 0;
  text-align: center;
  translate: -50% 0;
}
.knowledge-nebula-orbit-node.is-symptom { left: 85.22%; top: 15.82%; }
.knowledge-nebula-orbit-node.is-sign { left: 25.72%; top: 39.26%; }
.knowledge-nebula-orbit-node.is-risk { left: 82.29%; top: 63.48%; }
.knowledge-nebula-orbit-node.is-test { left: 53.32%; top: 85.35%; }
.knowledge-nebula-orbit-node.is-differential { left: 16.08%; top: 77.44%; }

/* Selected full-network direction: all five semantic colors remain visible and animated together. */
.knowledge-nebula-link {
  fill: none;
  stroke-width: 1.55;
  stroke-linecap: round;
  stroke-dasharray: none;
  opacity: .56;
  vector-effect: non-scaling-stroke;
  filter: drop-shadow(0 0 2px rgba(255, 255, 255, .86));
  transition: opacity .28s ease, stroke-width .28s ease, filter .28s ease;
  animation: none;
}
.knowledge-nebula-link[data-lens="symptomPattern"] { stroke: rgba(218, 158, 42, .96); }
.knowledge-nebula-link[data-lens="painLocation"] { stroke: rgba(156, 102, 224, .95); }
.knowledge-nebula-link[data-lens="dangerLevel"] { stroke: rgba(220, 73, 83, .95); }
.knowledge-nebula-link[data-lens="testTriage"] { stroke: rgba(34, 170, 165, .95); }
.knowledge-nebula-link[data-lens="masquerade"] { stroke: rgba(74, 101, 211, .95); }
.knowledge-nebula-link.is-secondary-lens { opacity: .62; }
.knowledge-nebula-link.is-current-lens {
  stroke: #d7a437;
  stroke-width: 2.05;
  opacity: .94;
  filter: drop-shadow(0 0 2px rgba(255, 255, 255, 1)) drop-shadow(0 0 7px rgba(218, 160, 52, .82));
}
.knowledge-nebula-link.is-active {
  stroke: #efbd43;
  stroke-width: 3;
  opacity: 1;
  filter: drop-shadow(0 0 3px rgba(255, 252, 224, 1)) drop-shadow(0 0 10px rgba(214, 151, 42, .88));
}
.knowledge-nebula-link.is-muted { opacity: .075; }
.knowledge-nebula-link-glint {
  fill: none;
  stroke: #fff1bd;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-dasharray: 1 23;
  opacity: .9;
  pointer-events: none;
  vector-effect: non-scaling-stroke;
  filter: drop-shadow(0 0 4px rgba(255, 224, 143, .95));
  animation: nebula-constellation-glint 3.8s linear infinite;
}
.knowledge-nebula-link-glint.is-secondary-lens { opacity: .62; }
.knowledge-nebula-link-glint[data-relation-lens="symptomPattern"] { stroke: #fff0a5; }
.knowledge-nebula-link-glint[data-relation-lens="painLocation"] { stroke: #e2c3ff; }
.knowledge-nebula-link-glint[data-relation-lens="dangerLevel"] { stroke: #ffb9ad; }
.knowledge-nebula-link-glint[data-relation-lens="testTriage"] { stroke: #aef8e7; }
.knowledge-nebula-link-glint[data-relation-lens="masquerade"] { stroke: #c9d3ff; }

/* Bottom controls double as the five-color relationship legend. */
.knowledge-nebula-lens::before {
  content: '';
  display: block;
  width: 42px;
  margin: 0 0 7px;
  border-top: 3px solid #c89b42;
  border-radius: 999px;
  box-shadow: 0 0 6px rgba(200, 155, 66, .38);
}
.knowledge-nebula-lens[data-lens="painLocation"]::before { border-color: #8d65d1; box-shadow: 0 0 6px rgba(141, 101, 209, .4); }
.knowledge-nebula-lens[data-lens="dangerLevel"]::before { border-color: #cf5262; box-shadow: 0 0 6px rgba(207, 82, 98, .38); }
.knowledge-nebula-lens[data-lens="testTriage"]::before { border-color: #2a9c9d; box-shadow: 0 0 6px rgba(42, 156, 157, .38); }
.knowledge-nebula-lens[data-lens="masquerade"]::before { border-color: #536bbb; box-shadow: 0 0 6px rgba(83, 107, 187, .38); }

/* Larger, outlined labels remain readable across both white nebulae and periwinkle sky. */
.knowledge-nebula-planet-copy,
.knowledge-nebula-planet.is-depth-far .knowledge-nebula-planet-copy {
  max-width: calc(184px * var(--depth));
  opacity: 1;
}
.knowledge-nebula-planet-copy strong,
.knowledge-nebula-planet.is-depth-near .knowledge-nebula-planet-copy strong {
  color: #211334;
  font-size: clamp(16px, calc(17px * var(--depth)), 20px);
  font-weight: 800;
  line-height: 1.18;
  -webkit-text-stroke: .35px rgba(255, 255, 255, .92);
  paint-order: stroke fill;
  text-shadow: 0 1px 0 #fff, 0 0 7px #fff, 0 0 13px rgba(255, 255, 255, .92), 0 3px 9px rgba(31, 18, 52, .42);
}
.knowledge-nebula-planet:hover .knowledge-nebula-planet-copy strong,
.knowledge-nebula-planet.is-related .knowledge-nebula-planet-copy strong {
  color: #5d356f;
}
.knowledge-nebula-scene-title h3 { color: #20102f; }
.knowledge-nebula-scene-title span { color: #3d2c4d; }

/* The selected disease name uses a contrast-tuned tone paired with that planet's artwork. */
.knowledge-nebula-focus-planet h4 {
  color: var(--focus-title-color, #fff3df);
  font-weight: 700;
  -webkit-text-stroke: .7px var(--focus-title-outline, #4f315e);
  paint-order: stroke fill;
  text-shadow: 0 1px 1px rgba(255, 255, 255, .7), 0 3px 5px var(--focus-title-outline, #4f315e), 0 0 18px var(--focus-title-glow, rgba(255, 218, 160, .64));
}

/* Focus mode repurposes the footer as five disease-knowledge entrances. */
.knowledge-nebula-lenses.is-focus-topics .knowledge-nebula-topic-tab::before {
  border-color: #c89b42;
  box-shadow: 0 0 7px rgba(200, 155, 66, .48);
}
.knowledge-nebula-lenses.is-focus-topics .knowledge-nebula-topic-tab[data-topic="sign"]::before { border-color: #8d65d1; }
.knowledge-nebula-lenses.is-focus-topics .knowledge-nebula-topic-tab[data-topic="risk"]::before { border-color: #cf5262; }
.knowledge-nebula-lenses.is-focus-topics .knowledge-nebula-topic-tab[data-topic="test"]::before { border-color: #2a9c9d; }
.knowledge-nebula-lenses.is-focus-topics .knowledge-nebula-topic-tab[data-topic="differential"]::before { border-color: #536bbb; }
.knowledge-nebula-lenses.is-focus-topics .knowledge-nebula-topic-tab[aria-pressed="true"] {
  border-color: rgba(111, 75, 145, .45);
  background: linear-gradient(135deg, rgba(255, 235, 245, .96), rgba(218, 211, 247, .96));
  transform: translateY(-2px);
}

/* The selected knowledge point unfolds as typography along its orbit, never as a card. */
.knowledge-nebula-orbit-node {
  transition: width .34s ease, opacity .28s ease, filter .28s ease;
}
.knowledge-nebula-focus.has-expanded-topic .knowledge-nebula-orbit-node.is-muted {
  opacity: .48;
  filter: saturate(.65);
}
.knowledge-nebula-orbit-node.is-expanded {
  width: 310px;
  opacity: 1;
}
.knowledge-nebula-orbit-node.is-expanded strong::after {
  content: '';
  display: block;
  width: 72px;
  margin: 8px auto 7px;
  border-top: 1px solid rgba(169, 111, 45, .72);
  box-shadow: 0 0 7px rgba(222, 172, 92, .52);
}
.knowledge-nebula-topic-detail ul {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
  animation: nebula-topic-unfold .34s ease both;
}
.knowledge-nebula-topic-detail li {
  color: #332746;
  font-size: 14px;
  line-height: 1.45;
  font-weight: 700;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .98), 0 0 8px rgba(255, 255, 255, .94);
}
.knowledge-nebula-topic-detail li::before {
  content: '✦';
  margin-right: 7px;
  color: #a96f2d;
  font-size: 10px;
}
.knowledge-nebula-topic-detail[hidden],
.knowledge-nebula-topic-summary[hidden] { display: none; }

@keyframes nebula-topic-unfold {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

.knowledge-nebula-canvas.is-planet-focused .knowledge-nebula-links {
  opacity: 0;
}

@keyframes nebula-constellation-glint {
  to { stroke-dashoffset: -96; }
}

@media (prefers-reduced-motion: reduce) {
  .knowledge-nebula-link-glint { animation: none; }
}

/* Large-format readability pass: fill the footer and enlarge every star-map text tier. */
.knowledge-nebula-footer { display: block; }
.knowledge-nebula-lenses {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  align-items: stretch;
}
.knowledge-nebula-lens {
  min-width: 0;
  min-height: 74px;
  padding: 11px 16px;
}
.knowledge-nebula-lens strong { font-size: 22px; line-height: 1.2; }
.knowledge-nebula-lens small { font-size: 13px; line-height: 1.45; }
.knowledge-nebula-scene-title h3 { font-size: clamp(38px, 3.25vw, 50px); }
.knowledge-nebula-scene-title span { font-size: 12px; }
.knowledge-nebula-planet-copy,
.knowledge-nebula-planet.is-depth-far .knowledge-nebula-planet-copy {
  max-width: calc(210px * var(--depth));
}
.knowledge-nebula-planet-copy strong,
.knowledge-nebula-planet.is-depth-near .knowledge-nebula-planet-copy strong {
  font-size: clamp(18px, calc(20px * var(--depth)), 24px);
  line-height: 1.2;
}
.knowledge-nebula-focus-planet > div { width: 112%; }
.knowledge-nebula-focus-planet h4 { font-size: clamp(50px, 3.7vw, 60px); }
.knowledge-nebula-focus-back { min-height: 46px; padding-inline: 20px; font-size: 17px; }
.knowledge-nebula-orbit-node { width: 250px; }
.knowledge-nebula-orbit-node strong { font-size: 25px; }
.knowledge-nebula-orbit-node p { font-size: 15.5px; line-height: 1.58; }
.knowledge-nebula-orbit-node.is-expanded { width: 340px; }
.knowledge-nebula-topic-detail li { font-size: 16px; line-height: 1.48; }

@media (max-width: 900px) {
  .knowledge-nebula-lenses { width: 100%; min-width: 0; overflow-x: auto; }
  .knowledge-nebula-lens { min-width: 190px; }
}

/* A lens now shows one distinct diagnostic map, retaining the lens's own clinical color. */
.knowledge-nebula-link.is-current-lens {
  stroke-width: 2.35;
  opacity: .96;
}
.knowledge-nebula-link.is-current-lens[data-lens="symptomPattern"] { stroke: #d7a437; filter: drop-shadow(0 0 7px rgba(215, 164, 55, .72)); }
.knowledge-nebula-link.is-current-lens[data-lens="painLocation"] { stroke: #8d65d1; filter: drop-shadow(0 0 7px rgba(141, 101, 209, .7)); }
.knowledge-nebula-link.is-current-lens[data-lens="dangerLevel"] { stroke: #cf5262; filter: drop-shadow(0 0 7px rgba(207, 82, 98, .7)); }
.knowledge-nebula-link.is-current-lens[data-lens="testTriage"] { stroke: #2a9c9d; filter: drop-shadow(0 0 7px rgba(42, 156, 157, .7)); }
.knowledge-nebula-link.is-current-lens[data-lens="masquerade"] { stroke: #536bbb; filter: drop-shadow(0 0 7px rgba(83, 107, 187, .7)); }
.knowledge-nebula-link.is-current-lens.is-active { stroke-width: 3.35; opacity: 1; }
.knowledge-nebula-link.is-current-lens.is-active[data-lens="symptomPattern"] { stroke: #d7a437; }
.knowledge-nebula-link.is-current-lens.is-active[data-lens="painLocation"] { stroke: #8d65d1; }
.knowledge-nebula-link.is-current-lens.is-active[data-lens="dangerLevel"] { stroke: #cf5262; }
.knowledge-nebula-link.is-current-lens.is-active[data-lens="testTriage"] { stroke: #2a9c9d; }
.knowledge-nebula-link.is-current-lens.is-active[data-lens="masquerade"] { stroke: #536bbb; }
.knowledge-nebula-lens[data-lens="symptomPattern"][aria-pressed="true"] { border-color: rgba(200, 155, 66, .56); background: linear-gradient(135deg, rgba(255, 242, 198, .94), rgba(239, 222, 166, .88)); }
.knowledge-nebula-lens[data-lens="painLocation"][aria-pressed="true"] { border-color: rgba(141, 101, 209, .56); background: linear-gradient(135deg, rgba(241, 231, 255, .96), rgba(220, 205, 248, .88)); }
.knowledge-nebula-lens[data-lens="dangerLevel"][aria-pressed="true"] { border-color: rgba(207, 82, 98, .56); background: linear-gradient(135deg, rgba(255, 231, 232, .96), rgba(249, 210, 219, .88)); }
.knowledge-nebula-lens[data-lens="testTriage"][aria-pressed="true"] { border-color: rgba(42, 156, 157, .56); background: linear-gradient(135deg, rgba(224, 250, 245, .96), rgba(202, 235, 231, .88)); }
.knowledge-nebula-lens[data-lens="masquerade"][aria-pressed="true"] { border-color: rgba(83, 107, 187, .56); background: linear-gradient(135deg, rgba(229, 235, 255, .96), rgba(207, 218, 248, .88)); }

/* Full diagnostic atlas v2: 12 fixed system galaxies, then one system at a time. */
.knowledge-nebula { overflow: visible; }
#learning-records:has(.knowledge-nebula-stage.is-entering),
#learning-records:has(.knowledge-nebula-stage.is-entered) {
  z-index: 20;
  overflow: visible;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}
#learning-records:has(.knowledge-nebula-stage.is-entering)::before,
#learning-records:has(.knowledge-nebula-stage.is-entering)::after,
#learning-records:has(.knowledge-nebula-stage.is-entered)::before,
#learning-records:has(.knowledge-nebula-stage.is-entered)::after {
  opacity: 0;
}
.knowledge-nebula:has(.knowledge-nebula-stage.is-entering),
.knowledge-nebula:has(.knowledge-nebula-stage.is-entered) {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}
.knowledge-nebula-stage {
  width: min(96vw, 1720px);
  margin-inline: 50%;
  translate: -50% 0;
  min-height: 820px;
  border: 1px solid rgba(121, 104, 157, .28);
  border-radius: 28px;
  box-shadow: 0 34px 90px rgba(65, 54, 91, .28), 0 5px 18px rgba(93, 71, 116, .16);
  overflow: hidden;
}
.knowledge-nebula-stage.is-entered { animation: nebula-scroll-rise .9s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes nebula-scroll-rise {
  from { opacity: .35; transform: translateY(34px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.knowledge-nebula-experience {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: 100%;
  min-width: 0;
  min-height: 820px;
  overflow: hidden;
  background: #e9e7f4;
}
.knowledge-nebula-toolbar {
  position: relative;
  z-index: 40;
  display: grid;
  gap: 10px;
  padding: 14px 18px 12px;
  color: #433651;
  background: rgba(249, 247, 252, .95);
  border-bottom: 1px solid rgba(110, 88, 136, .18);
  box-shadow: 0 6px 22px rgba(82, 65, 104, .08);
  min-width: 0;
}
.knowledge-nebula-system-nav {
  grid-column: 1 / -1;
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 1px 1px 5px;
  scrollbar-width: thin;
}
.knowledge-nebula-system-nav button,
.knowledge-nebula-toolbar-actions > button,
.knowledge-nebula-search-results button {
  min-height: 36px;
  border: 1px solid rgba(112, 89, 140, .2);
  border-radius: 999px;
  padding: 7px 13px;
  color: #51405f;
  background: rgba(255, 255, 255, .78);
  font: 700 13px/1.2 "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  white-space: nowrap;
  cursor: pointer;
}
.knowledge-nebula-system-nav button[aria-pressed="true"],
.knowledge-nebula-toolbar-actions > button[aria-pressed="true"] {
  color: #fff;
  border-color: #79629d;
  background: #79629d;
  box-shadow: 0 5px 14px rgba(84, 62, 116, .2);
}
.knowledge-nebula-toolbar-actions {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) repeat(5, auto);
  align-items: center;
  gap: 7px;
  width: 100%;
  min-width: 0;
}
.knowledge-nebula-toolbar-actions > button { min-width: 0; }
.knowledge-nebula-search-wrap { position: relative; width: min(310px, 100%); }
.knowledge-nebula-search-wrap input {
  width: 100%;
  height: 40px;
  border: 1px solid rgba(109, 85, 139, .24);
  border-radius: 13px;
  padding: 0 14px;
  color: #493b56;
  background: rgba(255, 255, 255, .9);
  font: 600 14px/1 "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  outline: none;
}
.knowledge-nebula-search-wrap input:focus { border-color: #846ca7; box-shadow: 0 0 0 3px rgba(132, 108, 167, .14); }
.knowledge-nebula-search-results {
  position: absolute;
  top: calc(100% + 7px);
  left: 0;
  width: min(390px, 42vw);
  padding: 7px;
  border: 1px solid rgba(109, 85, 139, .2);
  border-radius: 15px;
  background: #fbf9fd;
  box-shadow: 0 18px 38px rgba(58, 45, 76, .22);
}
.knowledge-nebula-search-results button {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  border: 0;
  border-radius: 10px;
  background: transparent;
}
.knowledge-nebula-search-results button:hover { background: #eee8f5; }
.knowledge-nebula-search-results small { margin-left: 20px; color: #8a7b97; font-weight: 500; }
#nebulaZoomValue { min-width: 48px; color: #6d5a7d; text-align: center; font: 700 13px/1 "Microsoft YaHei", sans-serif; }
.knowledge-nebula-workspace { width: 100%; min-width: 0; min-height: 650px; }
.knowledge-nebula-viewport {
  width: 100%;
  min-width: 0;
  height: 650px;
  min-height: 650px;
  overflow: auto;
  cursor: grab;
  overscroll-behavior: contain;
  background-color: #d9d8ec;
  background-image: url("assets/knowledge-nebula/milky-way-background-v2.png");
  background-size: cover;
  background-position: center;
}
.knowledge-nebula-viewport:active { cursor: grabbing; }
.knowledge-nebula-canvas {
  position: relative;
  width: 1900px;
  min-width: 1900px;
  height: 650px;
  min-height: 650px;
  transform-origin: left top;
  isolation: isolate;
}
.knowledge-nebula-canvas.is-system-overview {
  width: 100%;
  min-width: 100%;
}
.knowledge-nebula-toolbar .knowledge-nebula-scene-title { position: static; width: 255px; align-self: center; text-align: left; }
.knowledge-nebula-scene-title h3 { color: #544167; font-size: 30px; letter-spacing: .18em; }
.knowledge-nebula-scene-title span { color: rgba(83, 65, 104, .68); font-size: 11px; letter-spacing: .16em; }
.knowledge-nebula-clusters,
.knowledge-nebula-planets,
.knowledge-nebula-links { position: absolute; inset: 0; width: 100%; height: 100%; }
.knowledge-nebula-clusters,
.knowledge-nebula-planets,
.knowledge-nebula-links { pointer-events: none; }
.knowledge-nebula-system-node,
.knowledge-nebula-planet { pointer-events: auto; }
.knowledge-nebula-system-node {
  position: absolute;
  left: var(--x);
  top: var(--y);
  translate: -50% -50%;
  display: grid;
  justify-items: center;
  width: 210px;
  min-height: 176px;
  padding: 12px 16px 15px;
  border: 1px solid color-mix(in srgb, var(--system-tone) 66%, white);
  border-radius: 42px 42px 28px 28px;
  color: #4f3e5d;
  background: rgba(250, 248, 252, .72);
  box-shadow: 0 16px 34px rgba(76, 58, 96, .16), inset 0 0 34px color-mix(in srgb, var(--system-tone) 16%, transparent);
  cursor: pointer;
  transition: transform .28s ease, box-shadow .28s ease;
}
.knowledge-nebula-system-node:hover,
.knowledge-nebula-system-node:focus-visible { transform: translateY(-8px) scale(1.035); box-shadow: 0 24px 46px rgba(73, 55, 94, .24), 0 0 30px color-mix(in srgb, var(--system-tone) 32%, transparent); }
.knowledge-nebula-system-node img { width: 94px; height: 94px; margin-top: -34px; object-fit: contain; filter: drop-shadow(0 12px 16px rgba(70, 50, 91, .2)); }
.knowledge-nebula-system-node strong { max-width: 180px; font: 700 18px/1.35 "FangSong", "STFangsong", "Songti SC", "SimSun", serif; text-align: center; }
.knowledge-nebula-system-node small { margin-top: 5px; color: #7d6b8d; font: 600 12px/1.2 "Microsoft YaHei", sans-serif; }
.knowledge-nebula-system-node.is-hub { border-style: dashed; background: rgba(246, 239, 218, .78); }
.knowledge-nebula-system-heading {
  position: absolute;
  left: 50%;
  top: 74px;
  translate: -50% 0;
  display: grid;
  justify-items: center;
  color: #59456b;
  text-align: center;
}
.knowledge-nebula-system-heading span { color: #8f789f; font: 700 12px/1.2 "Microsoft YaHei", sans-serif; letter-spacing: .2em; }
.knowledge-nebula-system-heading strong { margin-top: 5px; font: 700 31px/1.25 "FangSong", "STFangsong", "Songti SC", "SimSun", serif; letter-spacing: .12em; }
.knowledge-nebula-system-heading small { margin-top: 5px; font: 600 13px/1.3 "Microsoft YaHei", sans-serif; }
.knowledge-nebula-canvas.is-system-detail .knowledge-nebula-planet { width: 150px; }
.knowledge-nebula-canvas.is-system-detail .knowledge-nebula-planet-visual { width: 104px; height: 104px; }
.knowledge-nebula-canvas.is-system-detail .knowledge-nebula-planet-visual img { width: 104px; height: 104px; object-fit: contain; }
.knowledge-nebula-canvas.is-system-detail .knowledge-nebula-planet-copy { width: 190px; }
.knowledge-nebula-canvas.is-system-detail .knowledge-nebula-planet-copy strong { color: #4c3a5a; font-size: 17px; text-shadow: 0 1px 4px rgba(255,255,255,.9); }
.knowledge-nebula-planet.is-cross-portal { opacity: .9; }
.knowledge-nebula-planet.is-cross-portal .knowledge-nebula-planet-visual { width: 74px; height: 74px; }
.knowledge-nebula-planet.is-cross-portal .knowledge-nebula-planet-visual img { width: 74px; height: 74px; }
.knowledge-nebula-planet.is-cross-portal .knowledge-nebula-planet-copy strong { font-size: 14px; }
.knowledge-nebula-planet.is-cross-portal .knowledge-nebula-planet-copy small { display: block; margin-top: 3px; color: #806e8c; font: 600 10px/1.2 "Microsoft YaHei", sans-serif; }
.knowledge-nebula-planet.is-highlighted .knowledge-nebula-planet-visual { outline: 4px solid rgba(240, 181, 92, .86); outline-offset: 6px; border-radius: 50%; animation: nebula-search-pulse 1.5s ease-in-out infinite; }
@keyframes nebula-search-pulse { 50% { outline-offset: 12px; filter: drop-shadow(0 0 24px rgba(241, 173, 76, .78)); } }
.knowledge-nebula-link { fill: none; stroke: rgba(103, 79, 140, .44); stroke-width: 2; }
.knowledge-nebula-link.is-active { stroke: #8c5fa5; stroke-width: 3.2; }
.knowledge-nebula-link.is-muted { opacity: .1; }
.knowledge-nebula-footer { position: relative; z-index: 35; padding: 12px 18px 15px; background: rgba(249, 247, 252, .96); border-top: 1px solid rgba(110, 88, 136, .18); }
.knowledge-nebula-lenses { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 9px; width: 100%; min-width: 0; }
.knowledge-nebula-lens { min-width: 0; min-height: 66px; padding: 10px 12px; border-radius: 14px; }
.knowledge-nebula-lens strong { font-size: 16px; }
.knowledge-nebula-lens small { display: block; margin-top: 4px; font-size: 11px; line-height: 1.35; }
.knowledge-nebula-lens[data-lens="signPattern"][aria-pressed="true"],
.knowledge-nebula-lens[data-lens="crossDifferential"][aria-pressed="true"] { border-color: rgba(126, 96, 169, .5); background: #e9e1f3; }
@media (max-width: 1180px) {
  .knowledge-nebula-stage { width: 98vw; }
  .knowledge-nebula-toolbar-actions { overflow-x: auto; grid-template-columns: 250px repeat(5, auto); }
  .knowledge-nebula-search-wrap { min-width: 250px; width: 250px; }
  .knowledge-nebula-lenses { overflow-x: auto; grid-template-columns: repeat(5, 190px); }
}
@media (prefers-reduced-motion: reduce) {
  .knowledge-nebula-stage.is-entered,
  .knowledge-nebula-planet.is-highlighted .knowledge-nebula-planet-visual { animation: none !important; }
}

/* Knowledge Nebula Art V3: real generated assets, layered disease identities, no organ imagery. */
.knowledge-nebula-veil,
.knowledge-nebula-stage.is-veiled .knowledge-nebula-veil,
.knowledge-nebula-stage.is-entering .knowledge-nebula-veil {
  background-color: #181735;
  background-image: url("assets/knowledge-nebula/v3/environment/atlas-scroll-background-v3.png");
  background-position: center;
  background-size: cover;
}
.knowledge-nebula-stage.is-entering .knowledge-nebula-veil {
  animation: nebula-v3-unfurl .9s cubic-bezier(.2, .75, .18, 1) forwards;
}
@keyframes nebula-v3-unfurl {
  from { opacity: 1; transform: scale(1); filter: blur(0); }
  to { opacity: 0; transform: scale(1.08); filter: blur(12px); }
}
.knowledge-nebula-viewport {
  background-color: #17162f;
  background-image: url("assets/knowledge-nebula/v3/environment/atlas-scroll-background-v3.png");
  background-position: center;
  background-size: cover;
}
.knowledge-nebula-system-node {
  width: 230px;
  min-height: 168px;
  padding: 0 10px 12px;
  border: 0;
  border-radius: 0;
  color: #f9edf3;
  background: transparent;
  box-shadow: none;
}
.knowledge-nebula-system-node:hover,
.knowledge-nebula-system-node:focus-visible {
  transform: translateY(-7px) scale(1.045);
  box-shadow: none;
}
.knowledge-nebula-system-node:focus-visible { outline: 2px solid #f3d7a1; outline-offset: 4px; }
.knowledge-nebula-system-node img {
  width: 230px;
  height: 142px;
  margin: -18px 0 -22px;
  object-fit: contain;
  filter: drop-shadow(0 8px 16px rgba(4, 3, 19, .42));
}
.knowledge-nebula-system-node strong {
  color: #fff2e9;
  font-size: 18px;
  text-shadow: 0 2px 7px #171126, 0 0 14px rgba(244, 200, 221, .55);
}
.knowledge-nebula-system-node small {
  color: rgba(239, 222, 236, .78);
  text-shadow: 0 1px 5px #171126;
}
.knowledge-nebula-system-node.is-hub { border: 0; background: transparent; }
.knowledge-nebula-system-heading {
  top: 31px;
  width: 500px;
  min-height: 170px;
  justify-content: start;
  pointer-events: none;
}
.knowledge-nebula-system-heading img {
  position: absolute;
  z-index: -1;
  left: 50%;
  top: 50%;
  width: 500px;
  height: 210px;
  object-fit: cover;
  transform: translate(-50%, -50%);
  opacity: .7;
  filter: drop-shadow(0 10px 30px rgba(10, 7, 36, .4));
}
.knowledge-nebula-system-heading span,
.knowledge-nebula-system-heading strong,
.knowledge-nebula-system-heading small {
  color: #fff0e8;
  text-shadow: 0 2px 8px #1b102f, 0 0 18px rgba(230, 194, 226, .65);
}
.knowledge-nebula-canvas.is-system-detail .knowledge-nebula-planet-visual,
.knowledge-nebula-canvas.is-system-detail .knowledge-nebula-planet-visual img {
  width: 110px;
  height: 110px;
}
.knowledge-nebula-planet-visual,
.knowledge-nebula-focus-planet-art {
  position: relative;
  display: block;
  border-radius: 50%;
  filter: drop-shadow(0 9px 14px rgba(7, 5, 27, .42)) drop-shadow(0 0 12px color-mix(in srgb, var(--system-tone) 52%, transparent));
}
.knowledge-nebula-planet-archetype,
.knowledge-nebula-planet-modifier,
.knowledge-nebula-portal-art {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  object-fit: contain;
  pointer-events: none;
}
.knowledge-nebula-planet-archetype { position: relative; z-index: 1; }
.knowledge-nebula-planet-modifier.is-layer-1 { z-index: 2; }
.knowledge-nebula-planet-modifier.is-layer-2 { z-index: 3; }
.knowledge-nebula-portal-art {
  z-index: 0;
  inset: -25%;
  width: 150% !important;
  height: 150% !important;
  opacity: .72;
}
.knowledge-nebula-planet.is-cross-portal .knowledge-nebula-planet-visual {
  width: 82px;
  height: 82px;
}
.knowledge-nebula-planet-copy strong {
  color: #fff1ec !important;
  text-shadow: 0 2px 7px #171126, 0 0 12px rgba(241, 208, 226, .62) !important;
}
.knowledge-nebula-planet.is-cross-portal .knowledge-nebula-planet-copy small { color: rgba(237, 218, 234, .8); }
.knowledge-nebula-link { stroke: rgba(239, 203, 218, .56); filter: drop-shadow(0 0 4px rgba(209, 169, 218, .42)); }
.knowledge-nebula-link.is-active { stroke: #ffd9ad; }
.knowledge-nebula-focus-orbit-art { content: none; opacity: .88; filter: drop-shadow(0 5px 18px rgba(20, 12, 46, .32)); }
.knowledge-nebula-focus-planet-art {
  position: relative;
  display: block !important;
  width: 410px;
  height: 410px;
  margin-bottom: -64px;
}
.knowledge-nebula-focus-planet > .knowledge-nebula-focus-planet-art > img {
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
}
@media (prefers-reduced-motion: reduce) {
  .knowledge-nebula-stage.is-entering .knowledge-nebula-veil { animation: none !important; opacity: 0; }
}

/* Three.js focus layout: a restrained planet and an always-readable knowledge field. */
.knowledge-nebula-stage.is-three-active .knowledge-nebula-canvas.is-planet-focused {
  transform: none !important;
}
.knowledge-nebula-stage.is-three-active .knowledge-nebula-canvas.is-planet-focused .knowledge-nebula-planets,
.knowledge-nebula-stage.is-three-active .knowledge-nebula-canvas.is-planet-focused .knowledge-nebula-clusters,
.knowledge-nebula-stage.is-three-active .knowledge-nebula-canvas.is-planet-focused .knowledge-nebula-links {
  opacity: 0;
  visibility: hidden;
}
.knowledge-nebula-stage.is-three-active .knowledge-nebula-focus {
  display: grid;
  grid-template-columns: minmax(330px, 34%) repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(3, minmax(0, 1fr));
  gap: 12px 36px;
  padding: 66px 62px 30px;
  overflow: hidden;
  box-sizing: border-box;
  background: rgba(7, 6, 27, .12);
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
}
.knowledge-nebula-stage.is-three-active .knowledge-nebula-focus[hidden] { display: none; }
.knowledge-nebula-stage.is-three-active .knowledge-nebula-focus-orbit-art,
.knowledge-nebula-stage.is-three-active .knowledge-nebula-focus-planet-art { display: none !important; }
.knowledge-nebula-stage.is-three-active .knowledge-nebula-focus-planet {
  position: relative;
  left: auto;
  top: auto;
  grid-column: 1;
  grid-row: 1 / -1;
  width: 100%;
  height: 100%;
  transform: none !important;
  translate: none;
  pointer-events: none;
}
.knowledge-nebula-stage.is-three-active .knowledge-nebula-focus-planet > div {
  position: absolute;
  left: 50%;
  top: calc(50% + 120px);
  width: 100%;
  transform: translate(-50%, -50%);
}
.knowledge-nebula-stage.is-three-active .knowledge-nebula-focus-planet h4 {
  margin: 0 auto;
  width: max-content;
  max-width: calc(100% - 30px);
  padding: 10px 28px 12px;
  border: 1px solid rgba(255, 232, 199, .42);
  border-radius: 14px;
  color: #fffdf8;
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: clamp(32px, 2.6vw, 42px);
  font-weight: 800;
  letter-spacing: .1em;
  background: linear-gradient(90deg, rgba(5, 5, 23, .72), rgba(18, 12, 39, .94) 50%, rgba(5, 5, 23, .72));
  box-shadow: 0 10px 28px rgba(2, 2, 16, .42), inset 0 1px 0 rgba(255, 255, 255, .12);
  text-shadow: 0 2px 4px #000, 0 0 18px rgba(255, 222, 185, .7);
}
.knowledge-nebula-stage.is-three-active .knowledge-nebula-orbit-node {
  position: relative;
  left: auto;
  top: auto;
  align-self: center;
  width: auto;
  max-height: 154px;
  padding: 12px 16px 13px 19px;
  border: 1px solid color-mix(in srgb, var(--topic-color, #d4a243) 46%, transparent);
  border-left: 4px solid var(--topic-color, #d4a243);
  border-radius: 0 14px 14px 0;
  color: #f5edf8;
  text-align: left;
  translate: none;
  overflow: auto;
  background: linear-gradient(105deg, rgba(3, 4, 19, .96), rgba(10, 8, 32, .86) 72%, rgba(10, 8, 32, .62));
  box-shadow: 0 10px 26px rgba(0, 0, 12, .38), inset 0 1px 0 rgba(255, 255, 255, .08);
  backdrop-filter: blur(8px);
  animation-name: nebula-knowledge-reveal-clean;
}
.knowledge-nebula-stage.is-three-active .knowledge-nebula-orbit-node::before { display: none; }
.knowledge-nebula-stage.is-three-active .knowledge-nebula-orbit-node.is-symptom { --topic-color: #d4a243; grid-column: 2; grid-row: 1; }
.knowledge-nebula-stage.is-three-active .knowledge-nebula-orbit-node.is-sign { --topic-color: #9c73d0; grid-column: 3; grid-row: 1; }
.knowledge-nebula-stage.is-three-active .knowledge-nebula-orbit-node.is-risk { --topic-color: #db5b70; grid-column: 2; grid-row: 2; }
.knowledge-nebula-stage.is-three-active .knowledge-nebula-orbit-node.is-test { --topic-color: #32aaa8; grid-column: 3; grid-row: 2; }
.knowledge-nebula-stage.is-three-active .knowledge-nebula-orbit-node.is-differential { --topic-color: #6f8cda; grid-column: 2 / 4; grid-row: 3; }
.knowledge-nebula-stage.is-three-active .knowledge-nebula-orbit-node strong {
  color: color-mix(in srgb, var(--topic-color) 58%, white);
  font-size: 21px;
  font-weight: 800;
  text-shadow: 0 2px 4px #000, 0 0 12px color-mix(in srgb, var(--topic-color) 42%, transparent);
}
.knowledge-nebula-stage.is-three-active .knowledge-nebula-orbit-node p,
.knowledge-nebula-stage.is-three-active .knowledge-nebula-topic-detail li {
  color: #fff;
  font-size: 14.5px;
  font-weight: 650;
  line-height: 1.62;
  text-shadow: 0 2px 4px #000;
}
.knowledge-nebula-stage.is-three-active .knowledge-nebula-orbit-node.is-expanded {
  width: auto;
  max-height: 172px;
}
.knowledge-nebula-stage.is-three-active .knowledge-nebula-orbit-node.is-expanded strong::after {
  margin: 7px 0;
  border-color: var(--topic-color);
}
@media (min-width: 1181px) {
  .knowledge-nebula-stage.is-three-active .knowledge-nebula-orbit-node.is-risk { margin-left: 84px; }
}
@keyframes nebula-knowledge-reveal-clean {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (max-width: 1180px) {
  .knowledge-nebula-stage.is-three-active .knowledge-nebula-focus {
    grid-template-columns: 340px minmax(240px, 1fr);
    grid-template-rows: repeat(5, minmax(96px, auto));
    gap: 8px 24px;
    padding-inline: 38px;
    overflow-y: auto;
  }
  .knowledge-nebula-stage.is-three-active .knowledge-nebula-focus-planet { grid-column: 1; grid-row: 1 / 6; }
  .knowledge-nebula-stage.is-three-active .knowledge-nebula-orbit-node { grid-column: 2 !important; grid-row: auto !important; }
}

/* V3 atmosphere and motion refinement. */
.knowledge-nebula-toolbar {
  grid-template-columns: 255px minmax(0, 1fr);
  align-items: center;
  column-gap: 22px;
  row-gap: 8px;
  padding-block: 12px 10px;
}
.knowledge-nebula-toolbar .knowledge-nebula-scene-title {
  grid-column: 1;
  grid-row: 1;
  width: 255px;
}
.knowledge-nebula-toolbar-actions { grid-column: 2; grid-row: 1; }
.knowledge-nebula-system-nav { grid-column: 1 / -1; grid-row: 2; }
.knowledge-nebula-system-nav button {
  min-height: 32px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  padding: 5px 9px 7px;
  color: #6f617b;
  background: transparent;
  box-shadow: none;
}
.knowledge-nebula-system-nav button:hover { color: #4f3a64; border-bottom-color: rgba(126, 94, 158, .34); }
.knowledge-nebula-system-nav button[aria-pressed="true"] {
  color: #5c3b79;
  border-color: #8f6daf;
  background: transparent;
  box-shadow: none;
}
.knowledge-nebula-toolbar-actions > button {
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  color: #665872;
  background: transparent;
  box-shadow: inset 0 0 0 1px rgba(111, 88, 136, .16);
}
.knowledge-nebula-toolbar-actions > button:hover { color: #4f3667; background: rgba(113, 87, 143, .07); }
#nebulaReset { color: #71502c; background: rgba(210, 169, 96, .12); box-shadow: inset 0 0 0 1px rgba(181, 133, 62, .24); }
#nebulaClose { color: #7d4056; box-shadow: inset 0 0 0 1px rgba(157, 77, 105, .22); }
.knowledge-nebula-search-wrap input {
  border: 0;
  border-bottom: 2px solid rgba(106, 80, 133, .24);
  border-radius: 0;
  color: #4f405b;
  background: rgba(255, 255, 255, .42);
  box-shadow: none;
}
.knowledge-nebula-search-wrap input:focus { border-color: #8965a7; box-shadow: 0 3px 0 rgba(137, 101, 167, .09); }
.knowledge-nebula-system-node img {
  opacity: .84;
  mix-blend-mode: screen;
  filter: saturate(.78) contrast(.92) brightness(1.02);
  animation: nebula-system-breathe 8.4s ease-in-out infinite;
  animation-delay: var(--motion-delay, 0s);
  transform-origin: 50% 52%;
}
.knowledge-nebula-system-node:hover img,
.knowledge-nebula-system-node:focus-visible img { opacity: 1; filter: saturate(.96) contrast(.98) brightness(1.04); }
.knowledge-nebula-planet-visual {
  animation: nebula-planet-breathe 6.8s ease-in-out infinite;
  animation-delay: var(--motion-delay, 0s);
  transform-origin: center;
}
.knowledge-nebula-portal-art { animation: nebula-portal-drift 12s linear infinite; animation-delay: var(--motion-delay, 0s); }
@keyframes nebula-system-breathe {
  0%, 100% { transform: translateY(2px) scale(.975); opacity: .76; }
  50% { transform: translateY(-5px) scale(1.035); opacity: .94; }
}
@keyframes nebula-planet-breathe {
  0%, 100% { transform: translateY(1px) scale(.985); }
  50% { transform: translateY(-4px) scale(1.035); }
}
@keyframes nebula-portal-drift {
  from { transform: rotate(0deg) scale(.98); }
  50% { transform: rotate(180deg) scale(1.06); }
  to { transform: rotate(360deg) scale(.98); }
}
.knowledge-nebula-link {
  stroke-dasharray: 7 9;
  animation: nebula-relation-flow 4.8s linear infinite;
  animation-delay: var(--link-delay, 0s);
}
.knowledge-nebula-link[data-lens="symptomPattern"] { stroke: #d4a243; }
.knowledge-nebula-link[data-lens="signPattern"] { stroke: #8d6ac1; }
.knowledge-nebula-link[data-lens="dangerLevel"] { stroke: #c9576b; stroke-width: 2.6; }
.knowledge-nebula-link[data-lens="testTriage"] { stroke: #2e9f9e; }
.knowledge-nebula-link[data-lens="crossDifferential"] { stroke: #5874bd; stroke-dasharray: 11 7 2 7; }
.knowledge-nebula-link.is-active { stroke-width: 3.2; filter: drop-shadow(0 0 5px currentColor); }
@keyframes nebula-relation-flow { to { stroke-dashoffset: -64; } }
.knowledge-nebula-lenses {
  gap: 0;
  border: 1px solid rgba(111, 88, 136, .13);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255, 255, 255, .4);
}
.knowledge-nebula-lens {
  position: relative;
  min-height: 68px;
  border: 0;
  border-right: 1px solid rgba(111, 88, 136, .12);
  border-radius: 0;
  background: transparent;
  box-shadow: inset 0 3px 0 var(--lens-color, #9d7ab6);
}
.knowledge-nebula-lens:last-child { border-right: 0; }
.knowledge-nebula-lens[data-lens="symptomPattern"] { --lens-color: #dca323; }
.knowledge-nebula-lens[data-lens="signPattern"] { --lens-color: #9462d4; }
.knowledge-nebula-lens[data-lens="dangerLevel"] { --lens-color: #d94d65; }
.knowledge-nebula-lens[data-lens="testTriage"] { --lens-color: #168f91; }
.knowledge-nebula-lens[data-lens="crossDifferential"] { --lens-color: #4e70c9; }
.knowledge-nebula-lens[aria-pressed="true"],
.knowledge-nebula-lens[data-lens="signPattern"][aria-pressed="true"],
.knowledge-nebula-lens[data-lens="crossDifferential"][aria-pressed="true"] {
  border-color: rgba(111, 88, 136, .12);
  color: #3f314c;
  background: color-mix(in srgb, var(--lens-color) 14%, white);
  box-shadow: inset 0 4px 0 var(--lens-color);
}
.knowledge-nebula-lens strong { color: color-mix(in srgb, var(--lens-color) 70%, #342943); }
@media (prefers-reduced-motion: reduce) {
  .knowledge-nebula-system-node img,
  .knowledge-nebula-planet-visual,
  .knowledge-nebula-portal-art,
  .knowledge-nebula-link { animation: none !important; }
}
@media (max-width: 1180px) {
  .knowledge-nebula-toolbar { grid-template-columns: 1fr; }
  .knowledge-nebula-toolbar .knowledge-nebula-scene-title,
  .knowledge-nebula-toolbar-actions,
  .knowledge-nebula-system-nav { grid-column: 1; }
  .knowledge-nebula-toolbar .knowledge-nebula-scene-title { grid-row: 1; }
  .knowledge-nebula-toolbar-actions { grid-row: 2; }
  .knowledge-nebula-system-nav { grid-row: 3; }
}

/* Three.js realtime renderer: DOM remains the accessible interaction layer. */
.knowledge-nebula-three-canvas {
  position: absolute;
  z-index: -1;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.knowledge-nebula-stage.is-three-active .knowledge-nebula-viewport {
  background-color: #08071d;
  background-image: url('assets/knowledge-nebula/v4/environment/orion-luminous-nebula-v4.png');
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}
.knowledge-nebula-stage.is-three-active .knowledge-nebula-canvas { isolation: auto; }
.knowledge-nebula-stage.is-three-active .knowledge-nebula-clusters,
.knowledge-nebula-stage.is-three-active .knowledge-nebula-planets { z-index: 2; }
.knowledge-nebula-stage.is-three-active .knowledge-nebula-three-canvas { z-index: 0; }
.knowledge-nebula-stage.is-three-active .knowledge-nebula-links {
  opacity: 0;
  visibility: hidden;
}
.knowledge-nebula-stage.is-three-active .knowledge-nebula-system-node img,
.knowledge-nebula-stage.is-three-active .knowledge-nebula-planets .knowledge-nebula-planet-visual,
.knowledge-nebula-stage.is-three-active .knowledge-nebula-system-heading img {
  opacity: 0;
  visibility: hidden;
}
.knowledge-nebula-stage.is-three-active .knowledge-nebula-system-node,
.knowledge-nebula-stage.is-three-active .knowledge-nebula-planet {
  background: transparent;
  box-shadow: none;
}
.knowledge-nebula-stage.is-three-active .knowledge-nebula-canvas.is-system-detail .knowledge-nebula-planet {
  top: calc(var(--y) + 5%);
}
.knowledge-nebula-stage.is-three-active .knowledge-nebula-system-heading {
  top: 18px;
  min-height: 112px;
}
.knowledge-nebula-stage.is-three-active .knowledge-nebula-system-heading strong { font-size: 28px; }
.knowledge-nebula-stage.is-three-active .knowledge-nebula-system-node:focus-visible,
.knowledge-nebula-stage.is-three-active .knowledge-nebula-planet:focus-visible {
  outline-color: #ffd993;
}
.knowledge-nebula-stage.is-three-active .knowledge-nebula-system-node strong,
.knowledge-nebula-stage.is-three-active .knowledge-nebula-system-node small,
.knowledge-nebula-stage.is-three-active .knowledge-nebula-planet-copy strong,
.knowledge-nebula-stage.is-three-active .knowledge-nebula-planet-copy small,
.knowledge-nebula-stage.is-three-active .knowledge-nebula-system-heading span,
.knowledge-nebula-stage.is-three-active .knowledge-nebula-system-heading strong,
.knowledge-nebula-stage.is-three-active .knowledge-nebula-system-heading small {
  text-shadow: 0 2px 8px #100b28, 0 0 17px rgba(245, 216, 236, .62) !important;
}

/* V6: each diagnostic lens owns its semantic color, including the small legend stroke. */
.knowledge-nebula-lens::before {
  border-color: var(--lens-color, #dca323) !important;
  box-shadow: 0 0 8px color-mix(in srgb, var(--lens-color, #dca323) 52%, transparent) !important;
}
.knowledge-nebula-topic-tab[data-topic="symptom"] { --lens-color: #dca323; }
.knowledge-nebula-topic-tab[data-topic="sign"] { --lens-color: #9462d4; }
.knowledge-nebula-topic-tab[data-topic="risk"] { --lens-color: #d94d65; }
.knowledge-nebula-topic-tab[data-topic="test"] { --lens-color: #168f91; }
.knowledge-nebula-topic-tab[data-topic="differential"] { --lens-color: #4e70c9; }

/* Keep the selected planet's rendering field clear of the information panels. */
.knowledge-nebula-stage.is-three-active .knowledge-nebula-focus-planet {
  isolation: isolate;
}
.knowledge-nebula-stage.is-three-active .knowledge-nebula-focus-planet > div {
  z-index: 3;
}
@media (prefers-reduced-motion: reduce) {
  .knowledge-nebula-stage.is-three-active .knowledge-nebula-system-node,
  .knowledge-nebula-stage.is-three-active .knowledge-nebula-planet { transition: none !important; }
}

/* V9: readable focus cards and direct card interaction. */
.knowledge-nebula-stage.is-three-active .knowledge-nebula-orbit-node {
  max-height: 176px;
  padding: 15px 19px 16px 22px;
  cursor: pointer;
}
.knowledge-nebula-stage.is-three-active .knowledge-nebula-orbit-node:hover,
.knowledge-nebula-stage.is-three-active .knowledge-nebula-orbit-node:focus-visible {
  border-color: color-mix(in srgb, var(--topic-color) 74%, white);
  background: linear-gradient(105deg, rgba(3, 4, 19, .98), rgba(15, 11, 42, .94) 72%, rgba(14, 10, 40, .78));
  outline: none;
  box-shadow: 0 12px 30px rgba(0, 0, 12, .48), 0 0 0 2px color-mix(in srgb, var(--topic-color) 42%, transparent);
}
.knowledge-nebula-stage.is-three-active .knowledge-nebula-orbit-node strong { font-size: 24px; }
.knowledge-nebula-stage.is-three-active .knowledge-nebula-orbit-node p,
.knowledge-nebula-stage.is-three-active .knowledge-nebula-topic-detail li {
  font-size: 16.5px;
  font-weight: 650;
  line-height: 1.7;
}
.knowledge-nebula-stage.is-three-active .knowledge-nebula-orbit-node.is-expanded { max-height: 214px; }
.knowledge-nebula-lenses.is-focus-topics .knowledge-nebula-topic-tab strong { font-size: 17px; }
.knowledge-nebula-lenses.is-focus-topics .knowledge-nebula-topic-tab small { font-size: 14px; line-height: 1.5; }

/* V10: restrained hierarchy and unified celestial labels. */
.knowledge-nebula-toolbar {
  padding: 14px 20px 12px;
  box-shadow: 0 4px 16px rgba(82, 65, 104, .06);
}
.knowledge-nebula-toolbar-actions { gap: 8px; }
.knowledge-nebula-toolbar-actions > button {
  min-height: 40px;
  padding-inline: 14px;
  border-radius: 10px;
  box-shadow: inset 0 0 0 1px rgba(111, 88, 136, .15);
}
.knowledge-nebula-footer {
  padding: 15px 24px 18px;
  background: rgba(249, 247, 252, .98);
  box-shadow: 0 -5px 18px rgba(58, 43, 78, .05);
}
.knowledge-nebula-lenses {
  gap: 0;
  border-radius: 12px;
  background: #fff;
}
.knowledge-nebula-lens {
  min-height: 92px;
  padding: 15px 18px 14px;
  border-radius: 0;
  box-shadow: none;
}
.knowledge-nebula-lens::before {
  width: 34px;
  margin-bottom: 9px;
  border-top-width: 2px;
  box-shadow: none !important;
}
.knowledge-nebula-lens strong {
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: .02em;
}
.knowledge-nebula-lens small {
  display: block;
  margin-top: 6px;
  overflow: visible;
  color: #51465d;
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.55;
  white-space: normal;
  text-overflow: clip;
}
.knowledge-nebula-lens[aria-pressed="true"],
.knowledge-nebula-lens[data-lens="signPattern"][aria-pressed="true"],
.knowledge-nebula-lens[data-lens="crossDifferential"][aria-pressed="true"] {
  background: color-mix(in srgb, var(--lens-color) 9%, white);
  box-shadow: inset 0 3px 0 var(--lens-color);
}

.knowledge-nebula-stage.is-three-active .knowledge-nebula-system-node strong,
.knowledge-nebula-stage.is-three-active .knowledge-nebula-planet-copy strong,
.knowledge-nebula-stage.is-three-active .knowledge-nebula-planet-copy small,
.knowledge-nebula-stage.is-three-active .knowledge-nebula-system-heading strong {
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  letter-spacing: .025em;
  text-shadow: none !important;
  -webkit-text-stroke: 0;
}
.knowledge-nebula-stage.is-three-active .knowledge-nebula-focus-planet h4 {
  font-family: "KaiTi", "STKaiti", "FangSong", "STFangsong", serif;
  font-weight: 700;
  letter-spacing: .08em;
}
.knowledge-nebula-stage.is-three-active .knowledge-nebula-canvas.is-system-overview .knowledge-nebula-system-node {
  width: 230px;
  height: 176px;
  min-height: 176px;
}
.knowledge-nebula-stage.is-three-active .knowledge-nebula-canvas.is-system-overview .knowledge-nebula-system-node strong {
  position: absolute;
  left: 50%;
  top: 136px;
  max-width: 210px;
  padding: 7px 12px 8px;
  border: 1px solid rgba(218, 210, 239, .24);
  border-radius: 10px;
  color: #fff9f3;
  background: rgba(10, 10, 32, .74);
  font-size: 17px;
  font-weight: 650;
  line-height: 1.35;
  transform: translateX(-50%);
  backdrop-filter: blur(8px);
}
.knowledge-nebula-stage.is-three-active .knowledge-nebula-system-heading {
  left: 28px;
  top: 24px;
  width: auto;
  min-height: 0;
  translate: 0 0;
  justify-items: start;
  text-align: left;
}
.knowledge-nebula-stage.is-three-active .knowledge-nebula-system-heading span { display: none; }
.knowledge-nebula-stage.is-three-active .knowledge-nebula-system-heading strong {
  margin: 0;
  padding: 9px 14px 10px;
  border: 1px solid rgba(226, 216, 239, .25);
  border-radius: 10px;
  color: #fff9f3;
  background: rgba(9, 9, 31, .7);
  font-size: 24px;
  font-weight: 650;
  line-height: 1.25;
  backdrop-filter: blur(8px);
}
.knowledge-nebula-stage.is-three-active .knowledge-nebula-canvas.is-system-detail .knowledge-nebula-planet-copy,
.knowledge-nebula-stage.is-three-active .knowledge-nebula-canvas.is-system-detail .knowledge-nebula-planet.is-depth-far .knowledge-nebula-planet-copy {
  top: 116px;
  width: max-content;
  max-width: 176px;
  padding: 6px 10px 7px;
  border: 1px solid rgba(225, 216, 239, .22);
  border-radius: 9px;
  color: #fff;
  background: rgba(8, 9, 29, .74);
  box-shadow: none;
  opacity: 1;
  transform: translateX(-50%);
  backdrop-filter: blur(7px);
}
.knowledge-nebula-stage.is-three-active .knowledge-nebula-canvas.is-system-detail .knowledge-nebula-planet-copy strong,
.knowledge-nebula-stage.is-three-active .knowledge-nebula-canvas.is-system-detail .knowledge-nebula-planet.is-depth-near .knowledge-nebula-planet-copy strong {
  display: block;
  color: #fffaf5 !important;
  font-size: 16px;
  font-weight: 650;
  line-height: 1.35;
  white-space: normal;
}
.knowledge-nebula-stage.is-three-active .knowledge-nebula-canvas.is-system-detail .knowledge-nebula-planet-copy small {
  margin-top: 3px;
  color: rgba(239, 232, 247, .76);
  font-size: 11px;
  font-weight: 500;
}

.knowledge-nebula-lenses.is-focus-topics .knowledge-nebula-topic-tab strong { font-size: 18px; }
.knowledge-nebula-lenses.is-focus-topics .knowledge-nebula-topic-tab small { font-size: 14px; }

/* V11: constellation annotations belong to the sky, and Three anchors stay deterministic. */
.knowledge-nebula-stage.is-three-active .knowledge-nebula-canvas.is-system-overview .knowledge-nebula-system-node strong {
  top: 134px;
  width: max-content;
  max-width: 214px;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: rgba(255, 251, 246, .9);
  background: none;
  box-shadow: none;
  font-size: 17px;
  font-weight: 650;
  line-height: 1.38;
  letter-spacing: .045em;
  text-wrap: balance;
  text-shadow: 0 2px 3px rgba(3, 4, 18, .98), 0 0 8px rgba(3, 4, 18, .96), 0 0 18px rgba(113, 170, 255, .42) !important;
  backdrop-filter: none;
  transition: color .28s ease, letter-spacing .28s ease, text-shadow .28s ease;
}
.knowledge-nebula-stage.is-three-active .knowledge-nebula-canvas.is-system-overview .knowledge-nebula-system-node strong::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -18px;
  width: 48px;
  height: 17px;
  border-top: 1px solid rgba(184, 216, 255, .62);
  border-radius: 50%;
  transform: translateX(-50%) rotate(var(--annotation-tilt, -10deg));
  filter: drop-shadow(0 0 5px rgba(113, 181, 255, .56));
  opacity: .76;
  pointer-events: none;
}
.knowledge-nebula-stage.is-three-active .knowledge-nebula-canvas.is-system-overview .knowledge-nebula-system-node strong::after {
  content: "";
  position: absolute;
  left: 50%;
  top: -16px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #f7e7c7;
  box-shadow: 0 0 8px rgba(255, 231, 189, .9);
  transform: translateX(-50%);
  pointer-events: none;
}
.knowledge-nebula-stage.is-three-active .knowledge-nebula-canvas.is-system-overview .knowledge-nebula-system-node:nth-child(3n + 1) { --annotation-tilt: -14deg; }
.knowledge-nebula-stage.is-three-active .knowledge-nebula-canvas.is-system-overview .knowledge-nebula-system-node:nth-child(3n + 2) { --annotation-tilt: 11deg; }
.knowledge-nebula-stage.is-three-active .knowledge-nebula-canvas.is-system-overview .knowledge-nebula-system-node:nth-child(3n) { --annotation-tilt: -4deg; }
.knowledge-nebula-stage.is-three-active .knowledge-nebula-canvas.is-system-overview .knowledge-nebula-system-node:hover strong,
.knowledge-nebula-stage.is-three-active .knowledge-nebula-canvas.is-system-overview .knowledge-nebula-system-node:focus-visible strong {
  color: #fff;
  letter-spacing: .065em;
  text-shadow: 0 2px 3px rgba(3, 4, 18, .98), 0 0 9px rgba(3, 4, 18, .98), 0 0 22px rgba(132, 194, 255, .72) !important;
}
.knowledge-nebula-stage.is-three-active .knowledge-nebula-planet,
.knowledge-nebula-stage.is-three-active .knowledge-nebula-planet-visual {
  animation: none !important;
}
.knowledge-nebula-stage.is-three-active .knowledge-nebula-planet-visual { transform: none !important; }
.knowledge-nebula-stage.is-three-active .knowledge-nebula-canvas.is-system-detail .knowledge-nebula-planet-visual {
  justify-self: center;
}
.knowledge-nebula-stage.is-three-active .knowledge-nebula-planet.is-cross-portal .knowledge-nebula-planet-copy,
.knowledge-nebula-stage.is-three-active .knowledge-nebula-planet.is-cross-portal.is-depth-far .knowledge-nebula-planet-copy {
  top: 88px;
  max-width: 154px;
}
.knowledge-nebula-stage.is-three-active .knowledge-nebula-canvas.is-system-detail .knowledge-nebula-planet.is-cross-portal {
  width: 110px;
}
.knowledge-nebula-stage.is-three-active .knowledge-nebula-planet.is-cross-portal .knowledge-nebula-planet-copy::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -9px;
  width: 1px;
  height: 7px;
  background: linear-gradient(rgba(169, 207, 255, .7), transparent);
  box-shadow: 0 0 5px rgba(111, 176, 255, .55);
}
@media (prefers-reduced-motion: reduce) {
  .knowledge-nebula-stage.is-three-active .knowledge-nebula-canvas.is-system-overview .knowledge-nebula-system-node strong { transition: none; }
}

/* V13: cross-system names use astronomical callouts instead of floating plaques. */
.knowledge-nebula-stage.is-three-active .knowledge-nebula-canvas.is-system-detail .knowledge-nebula-planet.is-cross-portal .knowledge-nebula-planet-copy,
.knowledge-nebula-stage.is-three-active .knowledge-nebula-canvas.is-system-detail .knowledge-nebula-planet.is-cross-portal.is-depth-far .knowledge-nebula-planet-copy {
  top: 50%;
  width: 152px;
  max-width: 152px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  backdrop-filter: none;
  transform: translateY(-50%);
  text-align: left;
}
.knowledge-nebula-stage.is-three-active .knowledge-nebula-planet.is-cross-portal.is-portal-left .knowledge-nebula-planet-copy {
  left: 92px;
}
.knowledge-nebula-stage.is-three-active .knowledge-nebula-planet.is-cross-portal.is-portal-right .knowledge-nebula-planet-copy {
  left: auto;
  right: 92px;
  text-align: right;
}
.knowledge-nebula-stage.is-three-active .knowledge-nebula-planet.is-cross-portal .knowledge-nebula-planet-copy strong {
  display: inline;
  padding-bottom: 3px;
  border-bottom: 1px solid rgba(181, 211, 255, .68);
  color: rgba(255, 252, 245, .96) !important;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: .045em;
  text-shadow: 0 2px 3px rgba(3, 4, 18, .98), 0 0 9px rgba(3, 4, 18, .96), 0 0 18px rgba(124, 184, 255, .5) !important;
}
.knowledge-nebula-stage.is-three-active .knowledge-nebula-planet.is-cross-portal .knowledge-nebula-planet-copy small {
  display: block;
  margin-top: 7px;
  color: rgba(207, 222, 244, .78);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .04em;
  text-shadow: 0 1px 4px rgba(3, 4, 18, .96);
}
.knowledge-nebula-stage.is-three-active .knowledge-nebula-planet.is-cross-portal .knowledge-nebula-planet-copy::before {
  top: 50%;
  width: 30px;
  height: 1px;
  background: linear-gradient(90deg, rgba(123, 182, 255, .15), rgba(198, 222, 255, .82));
  box-shadow: 0 0 7px rgba(111, 176, 255, .62);
  transform: translateY(-50%);
}
.knowledge-nebula-stage.is-three-active .knowledge-nebula-planet.is-cross-portal.is-portal-left .knowledge-nebula-planet-copy::before {
  left: -38px;
}
.knowledge-nebula-stage.is-three-active .knowledge-nebula-planet.is-cross-portal.is-portal-right .knowledge-nebula-planet-copy::before {
  left: auto;
  right: -38px;
  background: linear-gradient(90deg, rgba(198, 222, 255, .82), rgba(123, 182, 255, .15));
}

/* V14: each system keeps a distinct spectral marker; selection washes in from left to right. */
.knowledge-nebula-system-nav button {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 34px;
  border: 0;
  border-bottom: 2px solid color-mix(in srgb, var(--system-nav-tone) 72%, transparent);
  border-radius: 7px 7px 2px 2px;
  padding: 6px 10px 8px;
  color: color-mix(in srgb, var(--system-nav-tone) 62%, #30263a);
  background: color-mix(in srgb, var(--system-nav-tone) 7%, transparent);
  box-shadow: none;
  transition: color .22s ease, border-color .22s ease, box-shadow .22s ease;
}
.knowledge-nebula-system-nav button::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: linear-gradient(100deg,
    color-mix(in srgb, var(--system-nav-tone) 92%, #30213e) 0%,
    color-mix(in srgb, var(--system-nav-tone) 76%, #f3e7ff) 100%);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .56s cubic-bezier(.22, .64, .28, 1);
}
.knowledge-nebula-system-nav button span {
  position: relative;
  z-index: 1;
}
.knowledge-nebula-system-nav button:hover {
  color: color-mix(in srgb, var(--system-nav-tone) 74%, #24172e);
  border-bottom-color: var(--system-nav-tone);
  background: color-mix(in srgb, var(--system-nav-tone) 13%, transparent);
}
.knowledge-nebula-system-nav button[aria-pressed="true"] {
  color: #fffdf8;
  border-color: var(--system-nav-tone);
  background: transparent;
  box-shadow: 0 5px 13px color-mix(in srgb, var(--system-nav-tone) 22%, transparent);
}
.knowledge-nebula-system-nav button[aria-pressed="true"]::before { transform: scaleX(1); }
.knowledge-nebula-system-nav button:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--system-nav-tone) 72%, #fff);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  .knowledge-nebula-system-nav button,
  .knowledge-nebula-system-nav button::before { transition: none; }
}

/* V15: content-aware celestial spacing, staggered ranks, and concise clinical points. */
.knowledge-nebula-viewport {
  height: min(72vh, 720px);
  min-height: 680px;
}
.knowledge-nebula-canvas.is-system-overview {
  width: auto;
  min-width: 0;
}
.knowledge-nebula-stage.is-three-active .knowledge-nebula-system-node strong {
  width: var(--label-width, 214px);
  max-width: var(--label-width, 214px);
  font-family: "KaiTi", "STKaiti", "FangSong", "STFangsong", "Songti SC", serif;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: .055em;
}
.knowledge-nebula-stage.is-three-active .knowledge-nebula-system-heading strong {
  font-family: "FangSong", "STFangsong", "KaiTi", "STKaiti", serif;
  font-size: 27px;
  font-weight: 700;
  letter-spacing: .07em;
}
.knowledge-nebula-stage.is-three-active .knowledge-nebula-canvas.is-system-detail .knowledge-nebula-planet-copy,
.knowledge-nebula-stage.is-three-active .knowledge-nebula-canvas.is-system-detail .knowledge-nebula-planet.is-depth-far .knowledge-nebula-planet-copy {
  width: var(--label-width, 176px);
  max-width: var(--label-width, 176px);
}
.knowledge-nebula-stage.is-three-active .knowledge-nebula-canvas.is-system-detail .knowledge-nebula-planet-copy strong,
.knowledge-nebula-stage.is-three-active .knowledge-nebula-canvas.is-system-detail .knowledge-nebula-planet.is-depth-near .knowledge-nebula-planet-copy strong {
  font-family: "KaiTi", "STKaiti", "FangSong", "STFangsong", "Songti SC", serif;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: .045em;
}
.knowledge-nebula-stage.is-three-active .knowledge-nebula-planet.is-cross-portal .knowledge-nebula-planet-copy strong,
.knowledge-nebula-stage.is-three-active .knowledge-nebula-planet.is-cross-portal .knowledge-nebula-planet-copy small {
  font-family: "KaiTi", "STKaiti", "FangSong", "STFangsong", serif;
}
.knowledge-nebula-topic-points,
.knowledge-nebula-stage.is-three-active .knowledge-nebula-topic-points {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 15px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}
.knowledge-nebula-topic-points li,
.knowledge-nebula-stage.is-three-active .knowledge-nebula-topic-points li {
  position: relative;
  padding-left: 13px;
  color: #fff;
  font-size: 16.5px;
  font-weight: 650;
  line-height: 1.45;
  white-space: nowrap;
  text-shadow: 0 2px 4px #000;
}
.knowledge-nebula-topic-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .62em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--topic-color, #d4a243);
  box-shadow: 0 0 7px color-mix(in srgb, var(--topic-color, #d4a243) 72%, transparent);
}
.knowledge-nebula-stage.is-three-active .knowledge-nebula-topic-detail ul {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 16px;
  margin-top: 8px;
}
.knowledge-nebula-stage.is-three-active .knowledge-nebula-topic-detail li { width: auto; }

/* V16: expanded knowledge cards stay exclusive; overview spacing is diameter-aware. */
.knowledge-nebula-topic-summary[hidden],
.knowledge-nebula-stage.is-three-active .knowledge-nebula-topic-summary[hidden] {
  display: none !important;
}

/* V17: formal clinical navigation copy and readable cross-system provenance. */
.knowledge-nebula-planet.is-cross-portal .knowledge-nebula-planet-copy small,
.knowledge-nebula-stage.is-three-active .knowledge-nebula-planet.is-cross-portal .knowledge-nebula-planet-copy small {
  display: block;
  margin-top: 6px;
  color: rgba(235, 243, 255, .96);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.35;
  letter-spacing: .045em;
  text-shadow: 0 2px 4px rgba(3, 4, 18, .98), 0 0 11px rgba(104, 166, 255, .5);
}

/* V18: restored user-selectable lightweight rendering without changing V17 typography. */
.knowledge-nebula-stage.is-lightweight .knowledge-nebula-planet-modifier.is-layer-2,
.knowledge-nebula-stage.is-lightweight .knowledge-nebula-portal-art {
  display: none;
}
.knowledge-nebula-stage.is-lightweight .knowledge-nebula-system-node img,
.knowledge-nebula-stage.is-lightweight .knowledge-nebula-planet-visual,
.knowledge-nebula-stage.is-lightweight .knowledge-nebula-focus-planet-art,
.knowledge-nebula-stage.is-lightweight .knowledge-nebula-link {
  animation: none !important;
  filter: none !important;
}

/* V19: full mode reuses the lightweight mode's visual identity; only Three.js supplies depth and motion. */
.knowledge-nebula-three-canvas[hidden] {
  display: none !important;
}
.knowledge-nebula-stage.is-three-active .knowledge-nebula-canvas.is-system-detail .knowledge-nebula-planet-copy {
  background: linear-gradient(100deg, rgba(7, 9, 31, .8), rgba(13, 17, 46, .58));
  border-color: rgba(185, 211, 245, .24);
  box-shadow: 0 8px 24px rgba(2, 4, 18, .28), inset 0 0 18px rgba(111, 158, 218, .05);
}
.knowledge-nebula-stage.is-three-active .knowledge-nebula-canvas.is-system-detail .knowledge-nebula-planet:hover .knowledge-nebula-planet-copy,
.knowledge-nebula-stage.is-three-active .knowledge-nebula-canvas.is-system-detail .knowledge-nebula-planet:focus-visible .knowledge-nebula-planet-copy,
.knowledge-nebula-stage.is-three-active .knowledge-nebula-canvas.is-system-detail .knowledge-nebula-planet.is-selected .knowledge-nebula-planet-copy {
  border-color: rgba(230, 222, 255, .5);
  background: linear-gradient(100deg, rgba(14, 15, 48, .94), rgba(28, 25, 69, .78));
}
.knowledge-nebula-stage.is-three-active .knowledge-nebula-canvas.is-system-detail .knowledge-nebula-planet.is-cross-portal .knowledge-nebula-planet-copy {
  background: none;
  border-color: transparent;
  box-shadow: none;
}

/* V20: the selected rendering mode is explicit instead of being hidden behind an ambiguous toggle label. */
.knowledge-nebula-mode-switch {
  display: grid;
  grid-template-columns: repeat(2, auto);
  align-items: center;
  gap: 2px;
  min-height: 40px;
  padding: 3px;
  border: 1px solid rgba(116, 83, 149, .2);
  border-radius: 10px;
  background: rgba(137, 105, 169, .07);
}
.knowledge-nebula-mode-switch button {
  min-height: 32px;
  padding: 0 11px;
  border: 0;
  border-radius: 7px;
  color: #6e5d7c;
  background: transparent;
  font: 700 13px/1.2 "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  white-space: nowrap;
  cursor: pointer;
  transition: color .18s ease, background-color .18s ease, box-shadow .18s ease, transform .12s ease;
}
.knowledge-nebula-mode-switch button:hover {
  color: #4f3667;
  background: rgba(113, 87, 143, .08);
}
.knowledge-nebula-mode-switch button[aria-pressed="true"] {
  color: #fff;
  background: #74578f;
  box-shadow: 0 3px 9px rgba(84, 62, 116, .2);
}
.knowledge-nebula-mode-switch button:focus-visible {
  outline: 2px solid rgba(116, 87, 143, .52);
  outline-offset: 2px;
}
.knowledge-nebula-mode-switch button:active { transform: scale(.98); }
@media (prefers-reduced-motion: reduce) {
  .knowledge-nebula-mode-switch button { transition: none; }
}

/* V21: lightweight mode is archived; its styles remain dormant while the full renderer is fixed active. */
/* V22: expanded planet identities rotate deterministically across every medical archetype. */
