:root {
  --ink: #17344d;
  --ink2: #2c4f6d;
  --muted: #6f8498;
  --muted2: #93a6b7;
  --line: #d7e1eb;
  --bg: #e9eef3;
  --card: rgba(255, 255, 255, 0.92);
  --blue: #1f7ac4;
  --cyan: #25a9e0;
  --orange: #d9903a;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  overflow: hidden;
}

button { font: inherit; }

#app {
  position: relative;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: var(--bg);
}

#stageFrame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  z-index: 0;
}

#shade {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(233, 238, 243, 0.96) 0, rgba(233, 238, 243, 0.55) 9%, transparent 17%, transparent 74%, rgba(233, 238, 243, 0.72) 86%, rgba(233, 238, 243, 0.96) 100%),
    linear-gradient(0deg, rgba(233, 238, 243, 0.96) 0, rgba(233, 238, 243, 0.45) 13%, transparent 24%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.8) 0, transparent 12%);
}

#motionTrace {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 46px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-logo {
  position: relative;
  display: block;
  flex: 0 0 118px;
  width: 118px;
  height: 30px;
}
.brand img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: left center;
}
.brand .logo-dark { display: none; }
.brand .logo-light { transform: scale(1.05); transform-origin: left center; }
.brand div { display: flex; flex-direction: column; gap: 1px; padding-left: 10px; border-left: 1px solid var(--line); }
.brand b { font-size: 14px; letter-spacing: 0.05em; color: #12304a; }
.brand span { font-size: 8px; letter-spacing: 0.12em; color: var(--muted2); white-space: nowrap; }

.top-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 9px;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.top-meta b { color: #24506f; font-weight: 600; }

.tag {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #f4f8fc;
  font-size: 8px;
  letter-spacing: 0.08em;
}

.tag.sim { color: #9a631d; border-color: #ecd7b8; background: #fff8ee; }
.tag.ok { color: #1e7a55; border-color: #c7e2d5; background: #f0faf5; }
.tag.bus { color: #28688f; border-color: #c7ddec; background: #f0f8fd; }

.top-meta .metric {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  color: #8ca0b1;
  font-size: 7px;
  letter-spacing: 0.03em;
}

.top-meta .metric b {
  color: #254e6d;
  font-size: 10px;
  font-weight: 700;
}

.top-meta .metric i {
  color: #93a5b4;
  font-size: 6px;
  font-style: normal;
}

#full {
  height: 24px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  color: var(--ink2);
  font-size: 9px;
  cursor: pointer;
}

#anatomyBtn,
#neuroBtn,
#themeToggle {
  height: 24px;
  padding: 0 11px;
  border: 1px solid #b8d5ea;
  border-radius: 5px;
  background: linear-gradient(180deg, #f7fbff, #e8f4fd);
  color: #155d91;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
}

#anatomyBtn:hover,
#neuroBtn:hover,
#themeToggle:hover { border-color: #77b5dd; background: #f0f8ff; }

.acupoint-panel-toggle {
  position: absolute;
  left: calc(50% + 50px);
  bottom: 230px;
  z-index: 20;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 31px;
  padding: 0 13px;
  border: 1px solid #69b6d1;
  border-radius: 999px;
  background: rgba(8, 29, 41, 0.9);
  box-shadow: 0 8px 24px rgba(3, 18, 28, 0.28), 0 0 0 3px rgba(76, 180, 211, 0.08);
  color: #b8eaf5;
  font-size: 8px;
  font-weight: 650;
  letter-spacing: 0.04em;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transform: translateX(-50%);
}

.acupoint-panel-toggle span {
  display: inline-grid;
  min-width: 30px;
  height: 18px;
  padding: 0 5px;
  place-items: center;
  border-radius: 999px;
  background: rgba(91, 205, 230, 0.14);
  color: #75e5ff;
  font: 8px Arial, sans-serif;
}

.acupoint-panel-toggle:hover {
  border-color: #8ad4e9;
  background: rgba(12, 44, 61, 0.96);
}

body.lab-mode .acupoint-panel-toggle,
body.neuro-mode .acupoint-panel-toggle { display: none; }

body.acupoint-mode .acupoint-panel-toggle {
  left: 26%;
  bottom: 24px;
}

.view-toolbar {
  position: absolute;
  top: 54px;
  left: 50%;
  z-index: 15;
  display: flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 4px 6px;
  border: 1px solid rgba(206, 221, 234, 0.96);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 7px 22px rgba(35, 72, 105, 0.1);
  backdrop-filter: blur(12px);
  transform: translateX(-50%);
}

.view-toolbar.locked::after {
  content: "自动循环中 · 交互控件已锁定";
  position: absolute;
  top: 38px;
  left: 50%;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 248, 238, 0.96);
  color: #9a6a2e;
  font-size: 7px;
  white-space: nowrap;
  transform: translateX(-50%);
}

.view-toolbar .interaction-toggle {
  height: 24px;
  padding: 0 9px;
  border: 1px solid #a9cce2;
  border-radius: 5px;
  background: #f0f8fd;
  color: #22698f;
  font-size: 8px;
  font-weight: 600;
  cursor: pointer;
}

.view-toolbar:not(.locked) .interaction-toggle {
  border-color: #8fc5a7;
  background: #f0faf4;
  color: #25704e;
}

.toolbar-divider {
  width: 1px;
  height: 20px;
  background: #dce6ee;
}

.view-toolbar label {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 24px;
  padding: 0 5px;
  color: #557087;
  font-size: 8px;
  white-space: nowrap;
}

.view-toolbar input {
  width: 12px;
  height: 12px;
  margin: 0;
  accent-color: #1f7ac4;
}

.view-toolbar .acupoint-layer-label {
  border-radius: 5px;
  transition: background .18s ease, color .18s ease;
}

.view-toolbar .acupoint-layer-label.active {
  background: #e8f6fb;
  color: #17698d;
  font-weight: 650;
}

.view-toolbar .acupoint-layer-label input {
  accent-color: #d39a45;
}

.view-toolbar > button:not(.interaction-toggle) {
  height: 24px;
  padding: 0 9px;
  border: 1px solid #d4e0e9;
  border-radius: 5px;
  background: #f6fafc;
  color: #577087;
  font-size: 8px;
  cursor: pointer;
}

.view-toolbar > button.active {
  border-color: #8ac8a3;
  background: #dff4e4;
  color: #1f6848;
  font-weight: 650;
}

.view-toolbar .locked-control,
.view-toolbar button:disabled,
.view-toolbar input:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

body.lab-mode .view-toolbar {
  top: 126px;
}

.rail {
  position: absolute;
  top: 54px;
  bottom: 140px;
  z-index: 8;
  display: flex;
  flex-direction: column;
  gap: 5px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.rail::-webkit-scrollbar {
  width: 3px;
  height: 0;
}

.rail::-webkit-scrollbar-track {
  background: transparent;
}

.rail::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: transparent;
}

.rail:hover::-webkit-scrollbar-thumb {
  background: rgba(115, 143, 164, 0.24);
}

.rail.left { left: 8px; width: 232px; }
.rail.right { right: 8px; width: 362px; }

.card {
  flex: 0 0 auto;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--card);
  box-shadow: 0 2px 10px rgba(30, 60, 90, 0.05);
  backdrop-filter: blur(10px);
}

.card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 5px;
  margin-bottom: 5px;
  border-bottom: 1px solid rgba(215, 225, 235, 0.8);
  font-size: 10px;
  font-weight: 600;
  color: #34536f;
  letter-spacing: 0.03em;
}

.card-head span {
  font-size: 7px;
  font-weight: 500;
  color: var(--muted2);
  letter-spacing: 0.1em;
}

.kv {
  display: flex;
  align-items: baseline;
  gap: 4px;
  min-width: 0;
  padding: 2px 0;
  font-size: 9px;
  line-height: 1.45;
}

.kv span { flex: 1 1 auto; min-width: 0; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kv b { flex: 0 0 auto; font-size: 11px; font-weight: 650; color: var(--ink); font-variant-numeric: tabular-nums; }
.kv i { flex: 0 0 auto; font-style: normal; font-size: 7px; color: var(--muted2); }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; column-gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); column-gap: 8px; }

.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 2px 0 5px; }
.stat-row div { padding: 4px 5px; border-radius: 4px; background: #f4f8fc; text-align: center; }
.stat-row b { display: block; font-size: 14px; color: var(--blue); font-variant-numeric: tabular-nums; }
.stat-row span { display: block; margin-top: 1px; font-size: 7px; color: var(--muted2); }

.mini-bar { height: 3px; border-radius: 999px; background: #e3ebf3; overflow: hidden; }
.mini-bar i { display: block; height: 100%; width: 99.8%; background: linear-gradient(90deg, #7bd0ff, #1f7ac4); }

.note { margin: 4px 0 0; font-size: 7.5px; line-height: 1.55; color: var(--muted2); }

.levels { list-style: none; margin: 0; padding: 0; }
.levels li {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 2px;
  border-bottom: 1px dashed rgba(215, 225, 235, 0.7);
  font-size: 9px;
  color: var(--ink2);
}
.levels li:last-child { border-bottom: 0; }
.levels li span { width: 20px; font-size: 8px; color: var(--muted2); letter-spacing: 0.05em; }
.levels li b { margin-left: auto; font-size: 8px; font-weight: 500; color: var(--muted2); }

.boundary p { margin: 2px 0; font-size: 8px; line-height: 1.5; color: var(--muted); }

.hero-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.hero-row > div { padding: 3px 4px 5px; border-radius: 5px; background: #f5f9fc; }
.hero-row label { display: block; font-size: 8px; color: var(--muted); letter-spacing: 0.04em; }
.hero-row b { font-size: 22px; line-height: 1.15; color: #0f5f9e; font-variant-numeric: tabular-nums; }
.hero-row i { font-style: normal; font-size: 8px; color: var(--muted2); margin-left: 2px; }
#spark { width: 100%; height: 36px; display: block; margin-top: 4px; }
.hero-foot { display: flex; justify-content: space-between; margin-top: 2px; font-size: 7px; color: var(--muted2); letter-spacing: 0.06em; }

.hero-ring-row {
  display: grid;
  grid-template-columns: 94px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.fit-dial {
  --fit: 88;
  position: relative;
  display: grid;
  width: 82px;
  height: 82px;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(#29b5e5 calc(var(--fit) * 1%), #e5eef5 0);
  box-shadow: 0 0 0 5px #f4f9fc, 0 3px 12px rgba(37, 133, 183, 0.18);
}

.fit-dial::before {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  background: #fff;
}

.fit-dial > div {
  position: relative;
  z-index: 1;
  text-align: center;
}

.fit-dial b { color: #1a506f; font-size: 20px; font-variant-numeric: tabular-nums; }
.fit-dial i { color: #7290a4; font-size: 7px; font-style: normal; }
.fit-dial span { display: block; margin-top: 1px; color: #8499a9; font-size: 6.5px; }

.hero-side label {
  display: block;
  color: #748b9f;
  font-size: 7.5px;
}

.hero-side > div:not(.hero-quick) b {
  color: #0f5f9e;
  font-size: 22px;
  font-variant-numeric: tabular-nums;
}

.hero-side > div:not(.hero-quick) i {
  margin-left: 2px;
  color: #8da0b0;
  font-size: 7px;
  font-style: normal;
}

.hero-side p {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 4px 0 0;
  color: #6e8799;
  font-size: 7px;
}

.hero-side p span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #54b97a;
  box-shadow: 0 0 0 3px rgba(84, 185, 122, 0.12);
}

.hero-side p em { font-style: normal; }

.hero-quick {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  margin-top: 5px;
}

.hero-quick span {
  display: flex;
  align-items: baseline;
  gap: 2px;
  padding: 3px 4px;
  border-radius: 4px;
  background: #f4f8fb;
  color: #8094a5;
  font-size: 6.5px;
}

.hero-quick b {
  margin-left: auto;
  color: #2b6388;
  font-size: 8px;
  font-weight: 650;
}

.hero-quick i { color: #9aabba; font-size: 5.8px; font-style: normal; }

.balance { display: flex; align-items: center; gap: 6px; margin-top: 5px; font-size: 7.5px; color: var(--muted); }
.balance div { flex: 1; height: 3px; border-radius: 999px; background: linear-gradient(90deg, #6fb7ec, #e1c27c); overflow: hidden; }
.balance i { display: block; height: 100%; width: 50%; background: rgba(255, 255, 255, 0.45); }

.compact-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 3px;
  margin-top: 5px;
}

.compact-grid.five {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 2px;
}

.compact-grid.five div { padding: 4px 3px; }
.compact-grid.five span { font-size: 5.8px; }
.compact-grid.five b { font-size: 8px; }

.compact-grid div {
  min-width: 0;
  padding: 4px 5px;
  border-radius: 4px;
  background: #f4f8fb;
}

.compact-grid span {
  display: block;
  overflow: hidden;
  color: #8599aa;
  font-size: 6.2px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-grid b {
  color: #285b7d;
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}

.compact-grid i {
  margin-left: 1px;
  color: #91a4b4;
  font-size: 5.8px;
  font-style: normal;
}

.micro-chart {
  display: block;
  width: 100%;
  height: 34px;
  margin-top: 4px;
}

.inline-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 8px;
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px dashed rgba(215, 225, 235, 0.75);
  color: #8296a7;
  font-size: 6.5px;
}

.inline-metrics b { color: #416782; font-weight: 600; }

#ecg { width: 100%; height: 30px; display: block; margin-top: 4px; }

.heater-control {
  margin-top: 6px;
  padding: 6px 7px;
  border: 1px solid #d9e5ee;
  border-radius: 6px;
  background: linear-gradient(135deg, #f7fbfe, #f1f7fb);
}

.heater-head,
.heater-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

#heaterToggle {
  height: 22px;
  padding: 0 8px;
  border: 1px solid #bdd8e9;
  border-radius: 4px;
  background: #fff;
  color: #286b95;
  font-size: 8px;
  cursor: pointer;
}

.heater-control.on #heaterToggle {
  border-color: #e7b398;
  background: #fff7f1;
  color: #a6542c;
}

.heater-head b {
  color: #58748b;
  font-size: 7.5px;
  font-weight: 600;
}

.heater-control.on .heater-head b { color: #b65f32; }

.heater-track {
  height: 3px;
  margin-top: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #e0e9f0;
}

.heater-track i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #68bfe4, #e7b568, #e77545);
  transition: width 0.25s linear;
}

.heater-meta {
  margin-top: 4px;
  color: #91a2b1;
  font-size: 6.8px;
}

.heater-program {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 6px;
}

.heater-auto {
  flex: 0 0 auto;
  color: #7d92a3;
  font-size: 6.8px;
}

.heater-auto b { color: #b27438; font-weight: 600; }

.heat-stages {
  display: grid;
  flex: 1;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 3px;
}

.heat-stages span {
  display: grid;
  height: 20px;
  place-items: center;
  border: 1px solid #dce6ed;
  border-radius: 4px;
  background: #fbfdff;
  color: #8094a4;
  font-size: 6.5px;
  white-space: nowrap;
}

.heat-stages span.active {
  border-color: #dfbd91;
  background: #fff6ea;
  color: #a36427;
  font-weight: 600;
}

#heaterRun {
  width: 23px;
  height: 23px;
  padding: 0;
  border: 1px solid #cbdce8;
  border-radius: 5px;
  background: #f2f8fc;
  color: #286b95;
  font-size: 8px;
  cursor: pointer;
}

.heat-card #heatmap { width: 100%; height: 190px; display: block; }
.scale { display: flex; align-items: center; gap: 5px; margin-top: 3px; font-size: 7px; color: var(--muted2); }
.scale i { flex: 1; height: 3px; border-radius: 999px; background: linear-gradient(90deg, #5ea8d8, #8fd08a, #e1cb63, #e58b45, #d84b45); }

.insight p { margin: 2px 0 0; font-size: 9px; line-height: 1.55; color: var(--ink2); }

.insight-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.insight-tags span {
  padding: 2px 6px;
  border: 1px solid #d8e4ed;
  border-radius: 999px;
  background: #f7fafc;
  color: #607b91;
  font-size: 7px;
}

.radar-card #radarChart {
  display: block;
  width: 100%;
  height: 218px;
}

.radar-foot {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 1px;
  color: #8a9eae;
  font-size: 6.5px;
}

.sync-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  padding: 5px 7px;
  border: 1px solid #dbe7ef;
  border-radius: 5px;
  background: #f5fafc;
}

.sync-banner > span {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #41677f;
  font-size: 7.5px;
}

.sync-banner i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #46b97b;
  box-shadow: 0 0 0 3px rgba(70, 185, 123, 0.12);
}

.sync-banner b { font-weight: 600; }
.sync-banner em { color: #2f789e; font-size: 7px; font-style: normal; }
.linkage-grid { margin-top: 4px; }

.callout {
  position: absolute;
  top: 35%;
  right: calc(362px + 20px);
  z-index: 7;
  width: 186px;
  padding: 8px 9px;
  border: 1px solid rgba(215, 225, 235, 0.95);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 8px 24px rgba(30, 60, 90, 0.14);
  pointer-events: none;
}
.callout-title { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.callout-title b { font-size: 12px; color: #134b76; }
.callout-title span { font-size: 8px; color: var(--muted); }
.callout-sub { margin: 1px 0 5px; font-size: 7.5px; color: var(--muted2); letter-spacing: 0.06em; }
.callout-grid { display: grid; grid-template-columns: 1fr auto auto; gap: 2px 5px; font-size: 8.5px; color: var(--muted); }
.callout-grid b { color: var(--ink); font-size: 11px; font-variant-numeric: tabular-nums; }
.callout-grid i { font-style: normal; font-size: 7px; color: var(--muted2); }

.acu-popup {
  position: absolute;
  top: 20%;
  right: calc(362px + 22px);
  z-index: 14;
  display: none;
  width: min(330px, calc(100vw - 32px));
  padding: 12px;
  border: 1px solid rgba(195, 215, 231, 0.96);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 46px rgba(25, 61, 94, 0.2);
  backdrop-filter: blur(16px);
  transform: translateY(0);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.acu-popup.open {
  display: block;
  animation: acuIn 0.2s ease-out forwards;
}

@keyframes acuIn {
  from { opacity: 0; transform: translateY(6px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.acu-popup header,
.acu-title,
.acu-live,
.acu-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.acu-popup header {
  padding-bottom: 7px;
  border-bottom: 1px solid #dce7ef;
}

.acu-popup header span {
  display: inline-block;
  margin-right: 6px;
  color: #1f72a9;
  font-size: 10px;
  font-weight: 700;
}

.acu-popup header small {
  color: #8aa0b2;
  font-size: 7px;
  letter-spacing: 0.06em;
}

#acuClose {
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1px solid #d7e3ed;
  border-radius: 50%;
  background: #f7fafd;
  color: #617b90;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}

.acu-title {
  align-items: flex-end;
  margin-top: 9px;
}

.acu-title h2 {
  margin: 0;
  color: #133f61;
  font-size: 22px;
  font-weight: 650;
}

.acu-title span {
  color: #768ea2;
  font-size: 8px;
}

.acu-theory {
  margin: 8px 0;
  color: #546e83;
  font-size: 9px;
  line-height: 1.62;
}

.acu-device {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 6px;
  background: #eef6fc;
}

.acu-device span { color: #70899d; font-size: 7.5px; }
.acu-device b { color: #256d9d; font-size: 8px; font-weight: 600; }

.acu-live {
  margin-top: 8px;
  gap: 6px;
}

.acu-live div {
  flex: 1;
  padding: 6px 8px;
  border: 1px solid #e0e9f1;
  border-radius: 6px;
  background: #fbfdff;
}

.acu-live span { display: block; color: #8397a8; font-size: 7px; }
.acu-live b { color: #164c70; font-size: 16px; font-variant-numeric: tabular-nums; }
.acu-live i { margin-left: 2px; color: #8298aa; font-size: 7px; font-style: normal; }

.acu-popup footer {
  margin-top: 8px;
  color: #8b9ead;
  font-size: 7px;
  line-height: 1.5;
}

.acu-actions {
  justify-content: flex-end;
  margin-top: 8px;
}

.acu-actions button {
  height: 23px;
  padding: 0 9px;
  border: 1px solid #d2e0ea;
  border-radius: 5px;
  background: #fff;
  color: #3b6684;
  font-size: 7.5px;
  cursor: pointer;
}

body.acu-open .callout { display: none; }

.bottom {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  height: 126px;
  z-index: 9;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 230px minmax(350px, 390px);
  gap: 6px;
}

.points-wrap {
  min-width: 0;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.93);
  box-shadow: 0 2px 10px rgba(30, 60, 90, 0.05);
}

.bottom-head {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
  font-size: 9px;
  font-weight: 600;
  color: #34536f;
}
.bottom-head span { font-size: 7px; color: var(--muted2); font-weight: 500; letter-spacing: 0.08em; }

.point-grid {
  display: grid;
  grid-template-columns: repeat(31, minmax(0, 1fr));
  grid-auto-rows: 1fr;
  gap: 2px;
  height: calc(100% - 18px);
}

.pt {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: 1px 0;
  border: 1px solid #dbe5ee;
  border-radius: 3px;
  background: #fbfdff;
  color: #5c7389;
  cursor: pointer;
  overflow: hidden;
}
.pt b { font-size: 7px; line-height: 1; font-weight: 600; }
.pt i { font-size: 6.5px; line-height: 1; margin-top: 2px; font-style: normal; font-variant-numeric: tabular-nums; }
.pt.sel { outline: 1px solid #1f7ac4; outline-offset: -1px; }

.alerts, .play { min-width: 0; }
.alerts ul { list-style: none; margin: 0; padding: 0; }
.alerts li { display: flex; flex-direction: column; gap: 1px; padding: 3px 0; border-bottom: 1px dashed rgba(215, 225, 235, 0.7); }
.alerts li:last-child { border-bottom: 0; }
.alerts li b { font-size: 8.5px; color: #9a631d; font-weight: 600; }
.alerts li span { font-size: 7px; color: var(--muted2); }

.play-row { display: flex; align-items: center; gap: 6px; }
#play { width: 22px; height: 22px; border: 1px solid var(--line); border-radius: 50%; background: #fff; color: var(--ink2); font-size: 9px; cursor: pointer; }
.progress {
  flex: 1;
  height: 9px;
  padding: 2px;
  border: 1px solid #cbdce8;
  border-radius: 999px;
  background: #e3ebf3;
  overflow: hidden;
}
.progress i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #71cff8, #1f7ac4);
  box-shadow: 0 0 8px rgba(48, 155, 220, 0.38);
}
.play-row b { font-size: 8px; font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
.chapters { display: flex; justify-content: space-between; gap: 4px; margin-top: 6px; }
.chapters button {
  flex: 1;
  height: 20px;
  padding: 0 4px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--muted2);
  font: inherit;
  font-size: 7px;
  cursor: pointer;
}
.chapters button:hover { border-color: #cbdce8; background: #f5f9fc; }
.chapters button.active { border-color: #99cce9; background: #e9f6fd; color: #1f7ac4; font-weight: 650; }

#spineLab {
  display: none;
  position: absolute;
  inset: 46px 0 0;
  z-index: 12;
  pointer-events: none;
}

body.lab-mode #spineLab { display: block; }
body.lab-mode #stageFrame { visibility: hidden; }
body.lab-mode .rail,
body.lab-mode .bottom,
body.lab-mode .callout,
body.lab-mode #shade { display: none; }
#neuroLab {
  display: none;
  position: absolute;
  inset: 46px 0 0;
  z-index: 14;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(circle at 56% 46%, rgba(224, 242, 249, 0.98), rgba(231, 240, 247, 0.92) 38%, rgba(233, 238, 243, 0.98) 100%);
}

body.neuro-mode #neuroLab { display: block; }
body.neuro-mode #stageFrame { visibility: hidden; }
body.neuro-mode .rail,
body.neuro-mode .bottom,
body.neuro-mode .callout,
body.neuro-mode #viewToolbar,
body.neuro-mode #motionTrace,
body.neuro-mode #shade { display: none; }

#neuroCanvas {
  position: absolute;
  inset: 0;
  pointer-events: auto;
}

#neuroCanvas canvas {
  display: block;
  width: 100%;
  height: 100%;
  outline: none;
}

.neuro-vignette {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(231, 239, 246, 0.98), rgba(236, 244, 249, 0.24) 27%, transparent 45%, transparent 70%, rgba(231, 239, 246, 0.86) 86%, rgba(231, 239, 246, 0.99)),
    linear-gradient(0deg, rgba(231, 239, 246, 0.96), transparent 22%);
}

.neuro-top {
  position: absolute;
  z-index: 4;
  top: 18px;
  left: 22px;
  right: 22px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  pointer-events: none;
}

.neuro-heading {
  max-width: 620px;
  pointer-events: auto;
}

.neuro-heading > span {
  color: #417e9d;
  font-size: 8px;
  letter-spacing: 0.18em;
}

.neuro-heading h1 {
  margin: 7px 0 4px;
  color: #173f5d;
  font-size: 24px;
  font-weight: 620;
  letter-spacing: 0.03em;
}

.neuro-heading p {
  margin: 0;
  color: #708899;
  font-size: 9px;
  line-height: 1.6;
}

.neuro-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  pointer-events: auto;
}

.neuro-actions b {
  margin-right: 5px;
  color: #58839c;
  font-size: 8px;
  font-weight: 500;
}

.neuro-actions button {
  height: 29px;
  padding: 0 12px;
  border: 1px solid #c9dbe7;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.9);
  color: #315d79;
  font-size: 8px;
  cursor: pointer;
  backdrop-filter: blur(10px);
}

.neuro-actions button:hover,
.neuro-actions button.active {
  border-color: #75b9d8;
  background: #e9f7fd;
  color: #155f88;
}

.neuro-panel {
  position: absolute;
  z-index: 4;
  top: 104px;
  left: 22px;
  bottom: 44px;
  display: flex;
  width: 286px;
  flex-direction: column;
  gap: 11px;
  padding: 14px;
  overflow-y: auto;
  border: 1px solid rgba(200, 218, 231, 0.95);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 16px 38px rgba(35, 73, 102, 0.12);
  backdrop-filter: blur(16px);
  pointer-events: auto;
}

.neuro-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #244e68;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.03em;
}

.neuro-panel-head span {
  color: #6f9ab1;
  font-size: 7px;
  letter-spacing: 0.12em;
}

.neuro-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.neuro-stats div {
  padding: 8px 6px;
  border: 1px solid #e0eaf1;
  border-radius: 7px;
  background: #f4f9fc;
}

.neuro-stats b {
  display: block;
  color: #1a688c;
  font-size: 16px;
  font-weight: 620;
}

.neuro-stats span {
  color: #8499a8;
  font-size: 6.8px;
}

.neuro-filters {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
}

.neuro-filters button {
  height: 28px;
  border: 1px solid #d4e2ec;
  border-radius: 6px;
  background: #f8fbfd;
  color: #658095;
  font-size: 7.5px;
  cursor: pointer;
}

.neuro-filters button.active {
  border-color: #86bfd8;
  background: #e8f6fc;
  color: #176889;
  font-weight: 650;
}

.neuro-selection {
  min-height: 78px;
  padding: 11px;
  border-radius: 8px;
  background: linear-gradient(135deg, #edf7fb, #f7fbfd);
  border: 1px solid #dce9f1;
}

.neuro-selection span {
  color: #7891a2;
  font-size: 7px;
  letter-spacing: 0.1em;
}

.neuro-selection b {
  display: block;
  margin-top: 8px;
  color: #195d7b;
  font-size: 11px;
  line-height: 1.45;
}

.neuro-selection p {
  margin: 6px 0 0;
  color: #728a9b;
  font-size: 7.2px;
  line-height: 1.5;
}

.neuro-legend {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: #627e91;
  font-size: 7.5px;
}

.neuro-legend span {
  display: flex;
  align-items: center;
  gap: 7px;
}

.neuro-legend i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.neuro-legend .central { background: #c9b7ee; box-shadow: 0 0 9px rgba(147, 115, 205, 0.35); }
.neuro-legend .nerve { background: #64d4eb; box-shadow: 0 0 9px rgba(47, 167, 195, 0.35); }
.neuro-legend .spinal { background: #efbb63; box-shadow: 0 0 9px rgba(212, 151, 56, 0.34); }

.neuro-note {
  margin: 0;
  color: #748a9b;
  font-size: 7.5px;
  line-height: 1.65;
}

.neuro-source {
  color: #26789c;
  font-size: 7.5px;
  text-decoration: none;
}

.neuro-source:hover { text-decoration: underline; }

.neuro-loading {
  position: absolute;
  z-index: 8;
  top: 50%;
  left: 50%;
  width: min(340px, 72vw);
  padding: 18px;
  border: 1px solid #cfe0ea;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 48px rgba(30, 66, 94, 0.15);
  transform: translate(-50%, -50%);
  backdrop-filter: blur(16px);
}

.neuro-loading.hidden { display: none; }
.neuro-loading b { display: block; color: #22526e; font-size: 12px; }
.neuro-loading span { display: block; margin: 7px 0 11px; color: #758c9d; font-size: 8px; }
.neuro-loading > div > i { display: block; height: 3px; overflow: hidden; border-radius: 99px; background: #dce9f1; }
.neuro-loading em { display: block; width: 0; height: 100%; background: #36a6d0; transition: width 0.2s ease; }

.neuro-boundary {
  position: absolute;
  z-index: 3;
  bottom: 13px;
  left: 50%;
  margin: 0;
  color: #7f94a3;
  font-size: 7px;
  transform: translateX(-50%);
  white-space: nowrap;
}

html[data-theme="dark"] #neuroLab {
  background:
    radial-gradient(circle at 56% 44%, rgba(22, 63, 84, 0.95), rgba(9, 30, 44, 0.98) 43%, #051019 100%);
}

html[data-theme="dark"] .neuro-vignette {
  background:
    linear-gradient(90deg, rgba(4, 14, 22, 0.98), rgba(5, 17, 26, 0.28) 28%, transparent 48%, transparent 72%, rgba(4, 14, 22, 0.9) 88%, rgba(4, 14, 22, 0.99)),
    linear-gradient(0deg, rgba(4, 14, 22, 0.98), transparent 24%);
}

html[data-theme="dark"] .neuro-heading > span { color: #59c6e8; }
html[data-theme="dark"] .neuro-heading h1 { color: #e4f5fb; }
html[data-theme="dark"] .neuro-heading p,
html[data-theme="dark"] .neuro-actions b,
html[data-theme="dark"] .neuro-boundary { color: #8fa9b9; }
html[data-theme="dark"] .neuro-actions button,
html[data-theme="dark"] .neuro-panel,
html[data-theme="dark"] .neuro-loading {
  border-color: #24475a;
  background: rgba(8, 25, 37, 0.94);
  color: #b9d6e5;
}
html[data-theme="dark"] .neuro-panel-head,
html[data-theme="dark"] .neuro-selection b,
html[data-theme="dark"] .neuro-loading b { color: #d9eff8; }
html[data-theme="dark"] .neuro-stats div,
html[data-theme="dark"] .neuro-selection {
  border-color: #234455;
  background: #0b2130;
}
html[data-theme="dark"] .neuro-stats b,
html[data-theme="dark"] .neuro-source { color: #67d7f2; }
html[data-theme="dark"] .neuro-filters button {
  border-color: #284a5d;
  background: #0b1e2b;
  color: #8da8b9;
}
html[data-theme="dark"] .neuro-filters button.active {
  border-color: #3b92b4;
  background: #123c4e;
  color: #bceefa;
}
html[data-theme="dark"] .neuro-note,
html[data-theme="dark"] .neuro-selection p,
html[data-theme="dark"] .neuro-legend,
html[data-theme="dark"] .neuro-loading span { color: #8ca7b7; }

@media (max-width: 1050px) {
  .neuro-top {
    left: 14px;
    right: 14px;
    gap: 12px;
  }
  .neuro-heading {
    max-width: 430px;
  }
  .neuro-heading h1 {
    font-size: 20px;
  }
  .neuro-panel {
    top: 118px;
    left: 14px;
    bottom: 38px;
    width: 250px;
  }
  .neuro-actions b {
    display: none;
  }
}

@media (max-width: 640px) {
  body.neuro-mode .topbar {
    display: none;
  }
  body.neuro-mode #neuroLab {
    inset: 0;
  }
  #neuroBtn {
    padding: 0 8px;
  }
  .neuro-top {
    top: 12px;
    flex-direction: column;
    gap: 9px;
  }
  .neuro-heading {
    max-width: 100%;
  }
  .neuro-heading h1 {
    font-size: 18px;
  }
  .neuro-heading p {
    display: none;
  }
  .neuro-actions {
    width: 100%;
  }
  .neuro-actions button {
    flex: 1;
    height: 42px;
  }
  .neuro-panel {
    top: 116px;
    right: 10px;
    bottom: auto;
    left: 10px;
    width: auto;
    max-height: 42vh;
  }
  .neuro-filters button {
    min-height: 42px;
  }
  .neuro-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .neuro-note {
    display: none;
  }
  .neuro-boundary {
    bottom: 8px;
    width: calc(100vw - 20px);
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

#labCanvas {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: auto;
  background:
    radial-gradient(circle at 54% 47%, rgba(255, 255, 255, 0.96), rgba(232, 241, 248, 0.74) 34%, rgba(222, 234, 244, 0.55) 62%, rgba(229, 238, 246, 0.16) 100%);
}

#labCanvas canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.lab-vignette {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(233, 240, 247, 0.95), rgba(243, 248, 252, 0.32) 25%, transparent 42%, transparent 62%, rgba(240, 246, 251, 0.89) 78%, rgba(233, 240, 247, 0.98)),
    linear-gradient(0deg, rgba(236, 243, 249, 0.97), transparent 25%);
}

.lab-panel {
  border: 1px solid rgba(199, 216, 230, 0.96);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.93);
  box-shadow: 0 12px 30px rgba(35, 72, 105, 0.12);
  backdrop-filter: blur(14px);
  pointer-events: auto;
}

.lab-top {
  position: absolute;
  top: 12px;
  left: 18px;
  right: 18px;
  display: grid;
  grid-template-columns: minmax(340px, 1fr) auto auto;
  align-items: start;
  gap: 16px;
  pointer-events: auto;
  z-index: 4;
}

.lab-top > div:first-child span,
.lab-panel-head span,
.lab-selected > span,
.lab-strip-head small {
  color: #778da1;
  font-size: 7px;
  letter-spacing: 0.14em;
}

.lab-top h1 {
  margin: 2px 0 0;
  color: #123e60;
  font-size: 20px;
  font-weight: 650;
  letter-spacing: 0.04em;
}

.lab-heading { max-width: 480px; }

.lab-mode-center {
  display: flex;
  min-width: 330px;
  flex-direction: column;
  gap: 6px;
}

.lab-layer-toggle {
  display: inline-grid;
  grid-template-columns: 6px auto;
  grid-template-rows: auto auto;
  column-gap: 8px;
  align-items: center;
  align-self: flex-start;
  min-height: 34px;
  padding: 5px 11px 5px 10px;
  border: 1px solid rgba(183, 207, 222, 0.82);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.74);
  color: #476b83;
  backdrop-filter: blur(12px);
  cursor: pointer;
}

.lab-layer-toggle::before {
  content: "";
  grid-row: 1 / span 2;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #7aa9c2;
  box-shadow: 0 0 0 3px rgba(88, 159, 197, 0.1);
}

.lab-layer-toggle span {
  font-size: 9.5px;
  font-weight: 650;
  letter-spacing: 0.035em;
}

.lab-layer-toggle small {
  margin-top: 1px;
  color: #8298a8;
  font-size: 6.8px;
  letter-spacing: 0.06em;
}

.lab-layer-toggle:hover {
  border-color: rgba(79, 160, 204, 0.58);
  background: rgba(245, 251, 254, 0.94);
}

.lab-layer-toggle.active {
  border-color: rgba(67, 155, 201, 0.55);
  background: rgba(228, 244, 252, 0.96);
  color: #176995;
  box-shadow: inset 0 0 0 1px rgba(76, 167, 212, 0.08);
}

.lab-layer-toggle.active::before {
  background: #2f9fd8;
  box-shadow: 0 0 0 3px rgba(47, 159, 216, 0.12);
}

.lab-pathline {
  display: flex;
  align-items: center;
  gap: 5px;
  overflow: hidden;
  color: #6f8799;
  font-size: 6.8px;
  white-space: nowrap;
}

.lab-pathline span {
  overflow: hidden;
  padding: 3px 6px;
  border: 1px solid rgba(202, 217, 230, 0.9);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  text-overflow: ellipsis;
}

.lab-pathline span:nth-of-type(3) { border-color: #b8d8e8; color: #26749b; }
.lab-pathline i { color: #9ab0c0; font-size: 8px; font-style: normal; }

.lab-subline {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 4px;
  color: #71899c;
  font-size: 7px;
}

.lab-subline span {
  color: #8298a9;
  letter-spacing: 0.07em;
}

.lab-subline b {
  color: #2d5a77;
  font-size: 9px;
  font-weight: 650;
}

.lab-subline em {
  overflow: hidden;
  color: #748b9f;
  font-size: 7.5px;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lab-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.lab-actions b {
  margin-right: 4px;
  color: #48718f;
  font-size: 8px;
  font-weight: 500;
}

.lab-actions button,
.lab-bottom-row button {
  height: 27px;
  padding: 0 11px;
  border: 1px solid #c9d9e6;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.94);
  color: #315b78;
  font-size: 8.5px;
  cursor: pointer;
}

.lab-actions button:first-of-type { border-color: #abd0e8; color: #16679e; }
.lab-actions #labExplode.on {
  border-color: #7bb6d8;
  background: #e7f4fc;
  color: #145f8d;
  font-weight: 650;
}

.lab-index {
  position: absolute;
  top: 82px;
  left: 16px;
  bottom: 136px;
  width: 238px;
  padding: 10px;
  overflow: auto;
  z-index: 4;
}

.floating-conditions {
  position: absolute;
  top: 168px;
  right: 24px;
  bottom: 138px;
  left: 270px;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}

.condition-float-column {
  display: flex;
  width: 192px;
  flex-direction: column;
  gap: 7px;
  pointer-events: none;
}

.condition-float-column.left {
  justify-content: center;
  padding-bottom: 26px;
}

.condition-float-column.right {
  justify-content: flex-start;
}

.condition-count-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 26px;
  padding: 0 8px;
  border: 1px solid rgba(203, 219, 232, 0.94);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.91);
  color: #6e8799;
  font-size: 7.5px;
  backdrop-filter: blur(10px);
}

.condition-count-card b {
  color: #2e7299;
  font-size: 8px;
}

.condition-float-card {
  position: relative;
  width: 100%;
  min-height: 66px;
  padding: 8px 8px 7px 11px;
  overflow: hidden;
  border: 1px solid rgba(204, 220, 232, 0.94);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.91);
  box-shadow: 0 8px 20px rgba(30, 66, 94, 0.08);
  color: #365873;
  text-align: left;
  cursor: pointer;
  pointer-events: auto;
  backdrop-filter: blur(12px);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.condition-float-card::before {
  content: "";
  position: absolute;
  top: 9px;
  bottom: 9px;
  left: 5px;
  width: 2px;
  border-radius: 2px;
  background: var(--tone, #67a9d5);
}

.condition-float-card:hover,
.condition-float-card.active {
  z-index: 2;
  border-color: #92c8e5;
  box-shadow: 0 12px 28px rgba(30, 82, 121, 0.15);
  transform: translateY(-2px);
}

.condition-float-card header {
  display: flex;
  align-items: center;
  gap: 5px;
}

.condition-float-card header i {
  color: #8ba0b1;
  font-size: 6.5px;
  font-style: normal;
}

.condition-float-card header b {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  color: #254f6b;
  font-size: 8.5px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.condition-float-card header span {
  flex: 0 0 auto;
  padding: 2px 5px;
  border-radius: 999px;
  background: #eef6fb;
  color: var(--tone, #4f8fbb);
  font-size: 6.2px;
}

.condition-float-card p {
  display: -webkit-box;
  margin: 5px 0 0;
  overflow: hidden;
  color: #657e91;
  font-size: 7.2px;
  line-height: 1.48;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.condition-float-card footer {
  margin-top: 4px;
  overflow: hidden;
  color: #96a6b3;
  font-size: 6.3px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.floating-boundary {
  position: absolute;
  bottom: 142px;
  left: 50%;
  z-index: 3;
  width: min(510px, 46vw);
  margin: 0;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: #8a9cab;
  font-size: 6.8px;
  line-height: 1.35;
  text-align: center;
  transform: translateX(-50%);
  backdrop-filter: blur(8px);
}

.lab-tcm-panel {
  display: none;
  position: absolute;
  top: 166px;
  right: 16px;
  bottom: 132px;
  width: min(610px, 45vw);
  padding: 14px 14px 10px;
  overflow: hidden;
  flex-direction: column;
  z-index: 4;
}

.lab-tcm-panel > .lab-panel-head {
  align-items: baseline;
  padding-bottom: 10px;
  font-size: 15px;
  letter-spacing: 0.02em;
}

.lab-tcm-panel > .lab-panel-head small {
  color: #8499aa;
  font-size: 7.5px;
  font-weight: 500;
  letter-spacing: 0.06em;
}

#spineLab[data-layer="tcm"] .lab-tcm-panel { display: flex; }
#spineLab[data-layer="tcm"] .floating-conditions { display: none; }

#acupointHub {
  display: none;
  position: absolute;
  inset: 46px 0 0;
  z-index: 16;
  pointer-events: none;
}

body.acupoint-mode #acupointHub { display: block; }
body.acupoint-mode #viewToolbar,
body.acupoint-mode .rail,
body.acupoint-mode .bottom,
body.acupoint-mode .callout { display: none; }

.acupoint-hub-backdrop {
  position: absolute;
  inset: 0;
  pointer-events: auto;
  background:
    radial-gradient(circle at 27% 45%, rgba(24, 113, 151, 0.06), transparent 38%),
    linear-gradient(90deg, rgba(233, 238, 243, 0.02), rgba(233, 238, 243, 0.4) 52%, rgba(233, 238, 243, 0.72));
  backdrop-filter: blur(1px);
}

.acupoint-hub-panel {
  position: absolute;
  top: 18px;
  right: 24px;
  bottom: 18px;
  width: min(620px, 46vw);
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 15px;
  border: 1px solid rgba(188, 212, 228, 0.98);
  border-radius: 13px;
  background: rgba(250, 253, 255, 0.96);
  box-shadow: 0 22px 55px rgba(25, 65, 96, 0.22);
  backdrop-filter: blur(18px);
  pointer-events: auto;
}

.acupoint-3d-hud {
  position: absolute;
  z-index: 3;
  top: 22px;
  left: 24px;
  width: 196px;
  padding: 11px 12px;
  border: 1px solid rgba(139, 194, 218, 0.5);
  border-radius: 10px;
  background: rgba(7, 23, 34, 0.8);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(12px);
  pointer-events: none;
}

.acupoint-3d-hud > div {
  display: flex;
  align-items: baseline;
  gap: 5px;
}

.acupoint-3d-hud span {
  color: #6cb2cf;
  font-size: 7px;
  letter-spacing: 0.1em;
}

.acupoint-3d-hud b {
  color: #75e5ff;
  font: 25px/1 Arial, sans-serif;
  font-weight: 400;
}

.acupoint-3d-hud i {
  color: #a8c4d2;
  font-size: 7px;
  font-style: normal;
}

.acupoint-3d-hud p {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 7px 0 5px;
  color: #9fbdcb;
  font-size: 7px;
}

.acupoint-3d-hud .acu-dot,
.acupoint-3d-hud .device-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #69e2ef;
  box-shadow: 0 0 8px rgba(105, 226, 239, 0.8);
}

.acupoint-3d-hud .device-dot {
  margin-left: 6px;
  border: 1px solid #f0c77d;
  background: transparent;
  box-shadow: 0 0 7px rgba(240, 199, 125, 0.55);
}

.acupoint-3d-hud small {
  display: block;
  color: #718f9f;
  font-size: 6.5px;
}

.acupoint-3d-hud button {
  display: none;
  width: 100%;
  height: 24px;
  margin-top: 8px;
  border: 1px solid #3a7189;
  border-radius: 5px;
  background: #0d3040;
  color: #a9ddeb;
  font-size: 7px;
  cursor: pointer;
  pointer-events: auto;
}

body.acupoint-focus .acupoint-hub-panel,
body.acupoint-focus .acupoint-hub-backdrop {
  display: none;
}

body.acupoint-focus .acupoint-3d-hud {
  border-color: rgba(103, 202, 229, 0.62);
  background: rgba(5, 19, 29, 0.9);
}

body.acupoint-focus .acupoint-3d-hud button {
  display: block;
}

.acupoint-hub-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 9px;
  border-bottom: 1px solid #dce7ef;
}

.acupoint-hub-heading span {
  color: #4d819d;
  font-size: 7px;
  letter-spacing: 0.16em;
}

.acupoint-hub-heading h1 {
  margin: 4px 0 3px;
  color: #173e5a;
  font-size: 20px;
  font-weight: 650;
  letter-spacing: 0.04em;
}

.acupoint-hub-heading p {
  margin: 0;
  color: #6e8799;
  font-size: 8px;
  line-height: 1.5;
}

.acupoint-hub-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 0 0 auto;
}

.acupoint-hub-actions b {
  color: #648094;
  font-size: 7px;
  font-weight: 500;
  letter-spacing: 0.08em;
}

.acupoint-hub-actions button {
  height: 28px;
  padding: 0 12px;
  border: 1px solid #9fc6dd;
  border-radius: 6px;
  background: #edf8fe;
  color: #1e6d92;
  font-size: 8px;
  font-weight: 650;
  cursor: pointer;
}

.acupoint-standard-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 2px 2px 5px;
}

.acupoint-standard-head > div:first-child {
  display: grid;
  grid-template-columns: auto auto;
  align-items: end;
  column-gap: 8px;
}

.acupoint-standard-head > div:first-child span {
  grid-column: 1 / -1;
  color: #65859b;
  font-size: 7px;
  letter-spacing: 0.13em;
}

.acupoint-standard-head > div:first-child b {
  color: #1f79a9;
  font: 36px/1 Arial, sans-serif;
  font-weight: 400;
}

.acupoint-standard-head > div:first-child small {
  padding-bottom: 3px;
  color: #426c86;
  font-size: 9px;
}

.acupoint-standard-counts {
  display: flex;
  gap: 6px;
}

.acupoint-standard-counts span {
  padding: 5px 7px;
  border: 1px solid #d8e5ee;
  border-radius: 6px;
  background: #f7fbfd;
  color: #7a91a1;
  font-size: 7px;
  white-space: nowrap;
}

.acupoint-standard-counts b {
  color: #24759b;
  font-size: 9px;
}

.acupoint-standard-note {
  margin: 0;
  padding: 7px 9px;
  border-left: 2px solid #66a9cd;
  border-radius: 0 5px 5px 0;
  background: #f1f8fc;
  color: #617f93;
  font-size: 7px;
  line-height: 1.55;
}

.acupoint-search {
  display: grid;
  grid-template-columns: 92px 1fr;
  align-items: center;
  gap: 8px;
}

.acupoint-search span {
  color: #526f84;
  font-size: 8px;
}

.acupoint-search input {
  height: 29px;
  padding: 0 10px;
  border: 1px solid #ccdce8;
  border-radius: 6px;
  background: #fbfdff;
  color: #234c67;
  font: 8px/1 "Microsoft YaHei", sans-serif;
  outline: none;
}

.acupoint-search input:focus {
  border-color: #66afd1;
  box-shadow: 0 0 0 2px rgba(74, 164, 204, 0.14);
}

.acupoint-filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.acupoint-filter-group button {
  min-height: 23px;
  padding: 0 8px;
  border: 1px solid #d4e2eb;
  border-radius: 999px;
  background: #f8fbfd;
  color: #688396;
  font-size: 7px;
  cursor: pointer;
}

.acupoint-filter-group button.active {
  border-color: #78b4d0;
  background: #e8f5fb;
  color: #1c6b8e;
  font-weight: 650;
}

.acupoint-result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #56778d;
  font-size: 7.5px;
}

.acupoint-result-head small {
  color: #8a9eac;
  font-size: 6.5px;
}

.acupoint-results {
  display: grid;
  min-height: 0;
  flex: 1;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  gap: 4px;
  overflow-y: auto;
  padding: 2px 3px 2px 0;
  scrollbar-width: thin;
}

.acupoint-result {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  min-height: 31px;
  padding: 5px 6px;
  border: 1px solid #dce7ee;
  border-radius: 5px;
  background: #f9fcfd;
  color: #42637a;
  text-align: left;
  cursor: pointer;
}

.acupoint-result:hover,
.acupoint-result.active {
  border-color: #84c1dc;
  background: #eaf7fc;
}

.acupoint-result b {
  color: #257aa0;
  font: 8px/1.2 Arial, sans-serif;
}

.acupoint-result span {
  overflow: hidden;
  font-size: 8px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.acupoint-result i {
  grid-column: 1 / -1;
  margin-top: 3px;
  overflow: hidden;
  color: #8499a7;
  font-size: 6px;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.acupoint-detail {
  min-height: 66px;
  padding: 9px 10px;
  border: 1px solid #d8e6ef;
  border-radius: 7px;
  background: #f4f9fc;
}

.acupoint-detail b {
  color: #245a78;
  font-size: 10px;
}

.acupoint-detail b span {
  margin-left: 6px;
  color: #2881ab;
  font: 8px Arial, sans-serif;
}

.acupoint-detail p {
  margin: 5px 0 0;
  color: #6b8394;
  font-size: 7px;
  line-height: 1.55;
}

html[data-theme="dark"] .acupoint-standard-counts span,
html[data-theme="dark"] .acupoint-search input,
html[data-theme="dark"] .acupoint-filter-group button,
html[data-theme="dark"] .acupoint-result,
html[data-theme="dark"] .acupoint-detail {
  border-color: #294858;
  background: #0a1d2a;
  color: #a8c0cf;
}

html[data-theme="dark"] .acupoint-standard-head > div:first-child b,
html[data-theme="dark"] .acupoint-standard-counts b,
html[data-theme="dark"] .acupoint-result b,
html[data-theme="dark"] .acupoint-detail b span {
  color: #64d5f1;
}

html[data-theme="dark"] .acupoint-standard-note,
html[data-theme="dark"] .acupoint-detail {
  background: #0b2231;
}

html[data-theme="dark"] .acupoint-standard-head > div:first-child span,
html[data-theme="dark"] .acupoint-standard-counts span,
html[data-theme="dark"] .acupoint-standard-note,
html[data-theme="dark"] .acupoint-search span,
html[data-theme="dark"] .acupoint-filter-group button,
html[data-theme="dark"] .acupoint-result i,
html[data-theme="dark"] .acupoint-detail p,
html[data-theme="dark"] .acupoint-result-head small {
  color: #819cac;
}

html[data-theme="dark"] .acupoint-filter-group button.active,
html[data-theme="dark"] .acupoint-result:hover,
html[data-theme="dark"] .acupoint-result.active {
  border-color: #3c91b0;
  background: #103749;
  color: #c4eef8;
}

html[data-theme="dark"] .acupoint-hub-backdrop {
  background:
    radial-gradient(circle at 27% 45%, rgba(37, 169, 224, 0.13), transparent 38%),
    linear-gradient(90deg, rgba(3, 10, 16, 0.08), rgba(3, 12, 19, 0.72) 44%, rgba(3, 12, 19, 0.94));
}

html[data-theme="dark"] .acupoint-hub-panel {
  border-color: #294858;
  background: rgba(6, 18, 27, 0.96);
  box-shadow: 0 24px 62px rgba(0, 0, 0, 0.48);
}

html[data-theme="dark"] .acupoint-hub-top { border-bottom-color: #243d4b; }
html[data-theme="dark"] .acupoint-hub-heading h1 { color: #d7edf7; }
html[data-theme="dark"] .acupoint-hub-heading span { color: #68c9e7; }
html[data-theme="dark"] .acupoint-hub-heading p,
html[data-theme="dark"] .acupoint-hub-actions b { color: #819cac; }

html[data-theme="dark"] .acupoint-hub-actions button {
  border-color: #31596c;
  background: #102b3a;
  color: #a9e4f4;
}

.tcm-table-head,
.tcm-row {
  display: grid;
  grid-template-columns: 42px 82px minmax(105px, 1fr) minmax(112px, 1fr) minmax(120px, 1.2fr);
  gap: 5px;
  align-items: center;
}

.tcm-table-head {
  padding: 8px 8px 7px;
  border-bottom: 1px solid #e3ebf1;
  color: #7c92a5;
  font-size: 7.5px;
  letter-spacing: 0.05em;
}

.tcm-map-table {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  padding: 2px 2px 0 0;
  scrollbar-width: thin;
}

.tcm-row {
  width: 100%;
  min-height: 36px;
  margin-bottom: 0;
  padding: 6px 8px;
  border: 0;
  border-bottom: 1px solid rgba(212, 226, 235, 0.82);
  border-radius: 0;
  background: transparent;
  color: #4e6c83;
  text-align: left;
  cursor: pointer;
}

.tcm-row:hover,
.tcm-row.active {
  border-bottom-color: #b9dbea;
  background: rgba(232, 246, 253, 0.72);
  box-shadow: inset 2px 0 0 #60aad0;
}

.tcm-row.wave {
  box-shadow: inset 3px 0 0 #d79035;
}

.tcm-row > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 8px;
}

.tcm-row > span:first-child {
  color: #2d76a1;
  font-size: 9px;
  font-weight: 700;
}

.tcm-row > span:nth-child(2) b {
  color: #275a79;
  font-size: 8.5px;
}

.tcm-row > span:nth-child(2) small {
  margin-left: 3px;
  color: #92a3b1;
  font-size: 7px;
}

.tcm-detail {
  min-height: 78px;
  margin-top: 0;
  padding: 10px 4px 2px;
  border: 0;
  border-top: 1px solid #dde8ef;
  border-radius: 0;
  background: transparent;
  color: #60798d;
  font-size: 8px;
  line-height: 1.5;
}

.tcm-detail b {
  display: block;
  color: #245879;
  font-size: 9px;
}

.tcm-detail p { margin: 4px 0 0; }
.tcm-detail em {
  display: block;
  margin-top: 5px;
  color: #8b9dab;
  font-size: 6.5px;
  font-style: normal;
}

.lab-detail {
  position: absolute;
  top: 88px;
  right: 16px;
  bottom: 132px;
  z-index: 16;
  display: none;
  left: auto;
  width: min(590px, 42vw);
  height: auto;
  overflow: hidden;
  border: 1px solid rgba(153, 187, 207, 0.42);
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(252, 254, 255, 0.9), rgba(231, 243, 250, 0.76));
  box-shadow:
    0 30px 90px rgba(20, 55, 82, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.76);
  backdrop-filter: blur(24px) saturate(122%);
  isolation: isolate;
  pointer-events: auto;
}

.lab-detail::before {
  content: "";
  position: absolute;
  z-index: 4;
  top: 24%;
  bottom: 24%;
  left: 0;
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(95, 181, 224, 0.7), transparent);
  pointer-events: none;
}

.lab-detail.open {
  display: flex;
  flex-direction: column;
  animation: labDetailIn 0.26s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes labDetailIn {
  from { opacity: 0; transform: translate3d(18px, 0, 0) scale(0.992); }
  to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}

body.lab-detail-open #labCanvas {
  right: calc(min(590px, 42vw) + 28px);
}

body.lab-detail-open .floating-conditions,
body.lab-detail-open .floating-boundary,
body.lab-detail-open .lab-tcm-panel,
body.lab-detail-open .lab-acupoint-panel,
body.lab-detail-open .view-toolbar {
  display: none !important;
}

.lab-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 66px;
  padding: 12px 14px 12px 20px;
  border-bottom: 1px solid rgba(158, 186, 203, 0.32);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.44), transparent);
}

.lab-detail-head span {
  color: #7891a3;
  font-size: 8px;
  font-weight: 550;
  letter-spacing: 0.14em;
}

.lab-detail-head b {
  display: block;
  margin-top: 5px;
  color: #173f5a;
  font-size: 16px;
  font-weight: 630;
  letter-spacing: 0.015em;
}

.lab-detail-head button {
  min-width: 54px;
  height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(155, 181, 198, 0.42);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.56);
  color: #496b7f;
  font-size: 9px;
  font-weight: 550;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.lab-detail-head button:hover {
  border-color: rgba(67, 154, 197, 0.52);
  background: rgba(235, 247, 253, 0.92);
  color: #17658e;
}

.lab-detail-head button:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 3px rgba(67, 164, 211, 0.22);
}

.lab-detail-stage {
  position: relative;
  min-height: 0;
  flex: 1;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 52% 42%, rgba(255, 255, 255, 0.62), rgba(220, 238, 248, 0.2) 36%, transparent 62%),
    linear-gradient(135deg, rgba(202, 229, 242, 0.18), rgba(248, 252, 254, 0.05) 55%, rgba(208, 231, 242, 0.12));
}

.lab-detail-stage canvas {
  position: relative;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.detail-callout {
  position: absolute;
  z-index: 3;
  display: grid;
  grid-template-columns: 5px auto;
  column-gap: 9px;
  align-items: center;
  color: #42677e;
  font-size: 9px;
  letter-spacing: 0.025em;
  text-shadow: 0 1px 12px rgba(244, 250, 253, 0.9);
  pointer-events: none;
}

.detail-callout i {
  grid-row: 1 / span 2;
  width: 5px;
  height: 5px;
  border: 0;
  border-radius: 50%;
  background: #58a9cf;
  box-shadow:
    0 0 0 4px rgba(88, 169, 207, 0.11),
    0 0 14px rgba(88, 169, 207, 0.32);
}

.detail-callout b {
  font-size: 10px;
  font-weight: 620;
}

.detail-callout small {
  margin-top: 2px;
  color: #8298a7;
  font-size: 7.5px;
  letter-spacing: 0.035em;
}

.detail-callout.left { left: 22px; text-align: left; }
.detail-callout.right { right: 22px; direction: rtl; text-align: right; }
.detail-callout.left.body { top: 38%; }
.detail-callout.left.disc { top: 57%; }
.detail-callout.right.cord { top: 29%; }
.detail-callout.right.nerve { top: 43%; }
.detail-callout.right.transverse { top: 58%; }
.detail-callout.right.spinous { top: 73%; }

.lab-detail-note {
  min-height: 43px;
  margin: 0;
  padding: 11px 18px;
  border-top: 1px solid rgba(158, 186, 203, 0.3);
  background: rgba(248, 252, 254, 0.52);
  color: #788f9f;
  font-size: 7.5px;
  line-height: 1.5;
  letter-spacing: 0.035em;
  text-align: center;
}

.lab-disease {
  position: absolute;
  top: 82px;
  right: 16px;
  bottom: 106px;
  width: 310px;
  padding: 11px;
  overflow: hidden;
  z-index: 4;
}

.lab-panel-head {
  display: flex;
  justify-content: space-between;
  padding-bottom: 7px;
  border-bottom: 1px solid #dbe6ef;
  color: #355571;
  font-size: 10px;
  font-weight: 650;
}

.spine-group {
  margin-top: 9px;
  padding-bottom: 8px;
  border-bottom: 1px dashed #dce7ef;
}

.spine-group:last-child { border-bottom: 0; }

.spine-group-head {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  color: #748ba0;
  font-size: 8px;
}

.spine-group-head b { color: #335975; font-size: 8px; }

.level-buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}

.level-btn,
.level-node {
  min-width: 0;
  border: 1px solid #d5e2ec;
  background: #f7fbfe;
  color: #4f6d84;
  cursor: pointer;
}

.level-btn {
  height: 27px;
  border-radius: 5px;
  font-size: 8.5px;
  font-variant-numeric: tabular-nums;
}

.level-btn.active,
.level-node.active {
  border-color: #2490d0;
  background: #1f7ac4;
  color: #fff;
  box-shadow: 0 3px 9px rgba(31, 122, 196, 0.25);
}

.level-btn.mapped:not(.active),
.level-node.mapped:not(.active) {
  border-color: #82bedd;
  background: #e8f5fc;
  color: #176b96;
}

.condition-float-card.kind-warning {
  border-color: rgba(201, 79, 79, 0.46);
  background: rgba(255, 248, 247, 0.95);
}

.condition-float-card.kind-warning header span {
  background: #fff0ee;
  color: #b7443f;
}

.lab-legend {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 11px;
  padding: 8px;
  border-radius: 7px;
  background: #f3f8fc;
  color: #6d8498;
  font-size: 8px;
}

.lab-legend i {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 4px;
  border-radius: 50%;
  background: #2f8fd0;
  box-shadow: 0 0 0 3px rgba(47, 143, 208, 0.13);
}

.lab-index > p,
.lab-boundary {
  margin: 9px 0 0;
  color: #8094a6;
  font-size: 8px;
  line-height: 1.55;
}

.lab-selected {
  padding: 4px 3px 9px;
  border-bottom: 1px solid #dce6ef;
}

.lab-selected b {
  display: block;
  margin-top: 4px;
  color: #123f63;
  font-size: 20px;
  font-weight: 650;
}

.lab-selected p {
  margin: 5px 0 0;
  color: #5c7890;
  font-size: 9px;
}

.condition-index-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 9px;
  color: #365873;
  font-size: 9px;
  font-weight: 600;
}

.condition-index-head b {
  color: #7990a3;
  font-size: 7px;
  font-weight: 500;
}

#conditionList {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 6px;
}

.condition-item {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  width: 100%;
  min-height: 40px;
  padding: 6px 7px;
  border: 1px solid #dce7ef;
  border-radius: 7px;
  background: linear-gradient(135deg, #fbfdff, #f4f9fc);
  color: #365973;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.condition-item:hover,
.condition-item.active {
  border-color: #9fcbe5;
  box-shadow: 0 4px 12px rgba(30, 103, 149, 0.1);
  transform: translateX(-2px);
}

.condition-item > i {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 6px;
  background: #eaf5fc;
  color: #2b7baa;
  font-size: 8px;
  font-style: normal;
  font-weight: 650;
}

.condition-item > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 8.5px;
  font-weight: 600;
}

.condition-item > small {
  padding: 2px 5px;
  border-radius: 999px;
  background: #edf5fa;
  color: #7891a4;
  font-size: 6.8px;
  white-space: nowrap;
}

.condition-popup {
  position: absolute;
  top: 20%;
  left: 50%;
  z-index: 18;
  display: none;
  width: min(360px, calc(100vw - 32px));
  padding: 13px;
  border: 1px solid rgba(191, 214, 231, 0.98);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 20px 52px rgba(27, 65, 97, 0.22);
  backdrop-filter: blur(16px);
  transform: translate(-50%, -8px);
}

.condition-popup.open { display: block; animation: acuIn 0.2s ease-out forwards; }

.condition-popup header,
.condition-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.condition-popup header {
  padding-bottom: 7px;
  border-bottom: 1px solid #dce7ef;
}

#conditionTag {
  padding: 3px 7px;
  border-radius: 999px;
  background: #eaf5fc;
  color: #287aa9;
  font-size: 7.5px;
}

#conditionClose {
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1px solid #d7e3ed;
  border-radius: 50%;
  background: #f7fafd;
  color: #617b90;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}

.condition-popup-heading { margin-top: 9px; }
.condition-popup-heading small { color: #7e95a8; font-size: 7px; letter-spacing: 0.08em; }
.condition-popup-heading h2 {
  margin: 3px 0 0;
  color: #133f61;
  font-size: 21px;
  font-weight: 650;
}

.condition-detail {
  margin: 8px 0;
  color: #536f85;
  font-size: 9px;
  line-height: 1.62;
}

.condition-field {
  margin-top: 7px;
  padding: 8px;
  border-radius: 7px;
  background: #f4f9fc;
}

.condition-field.caution { background: #fff8f1; }
.condition-field > span { color: #7b91a2; font-size: 7px; }
.condition-field p { margin: 4px 0 0; color: #466479; font-size: 8.5px; line-height: 1.55; }

.condition-popup footer {
  margin-top: 8px;
  color: #8a9dac;
  font-size: 7px;
  line-height: 1.5;
}

.condition-actions {
  justify-content: flex-end;
  margin-top: 9px;
}

.condition-actions button {
  height: 23px;
  padding: 0 9px;
  border: 1px solid #d2e0ea;
  border-radius: 5px;
  background: #fff;
  color: #3b6684;
  font-size: 7.5px;
  cursor: pointer;
}

#conditionCards {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 8px;
}

.condition-card {
  position: relative;
  padding: 9px 10px 8px 13px;
  overflow: hidden;
  border: 1px solid #d8e4ee;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(244, 249, 253, 0.95));
}

.condition-card::before {
  content: "";
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 5px;
  width: 2px;
  border-radius: 2px;
  background: var(--tone, #3d9bd5);
}

.condition-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.condition-card header b {
  color: #214b69;
  font-size: 10px;
}

.condition-card header span {
  flex: 0 0 auto;
  padding: 2px 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--tone, #3d9bd5) 12%, white);
  color: var(--tone, #2580b7);
  font-size: 7px;
}

.condition-card p {
  margin: 5px 0 0;
  color: #647b8f;
  font-size: 8px;
  line-height: 1.48;
}

.condition-card footer {
  margin-top: 5px;
  padding-top: 4px;
  border-top: 1px dashed #e0e8ef;
  color: #8a9cab;
  font-size: 7px;
}

.lab-bottom {
  position: absolute;
  right: 16px;
  bottom: 12px;
  left: 16px;
  height: 116px;
  padding: 8px 11px;
  z-index: 4;
}

.lab-strip-head {
  display: flex;
  justify-content: space-between;
  color: #365873;
  font-size: 9px;
  font-weight: 600;
}

#levelRail {
  display: grid;
  grid-template-columns: repeat(25, minmax(0, 1fr));
  gap: 3px;
  margin-top: 5px;
}

.lab-device-strip-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 5px;
  color: #365873;
  font-size: 8px;
  font-weight: 600;
}

.lab-device-strip-head small {
  color: #8195a5;
  font-size: 6.5px;
  font-weight: 400;
}

.device-rail {
  display: grid;
  grid-template-columns: repeat(18, minmax(0, 1fr));
  gap: 3px;
  margin-top: 4px;
}

.device-node {
  position: relative;
  height: 20px;
  padding: 0;
  overflow: hidden;
  border: 1px solid #d5e2ec;
  border-radius: 4px;
  background: #f7fbfe;
  color: #49697f;
  font-size: 6.5px;
  font-weight: 650;
  cursor: pointer;
}

.device-node[data-region="颈肩"] { border-top-color: #59a8d7; }
.device-node[data-region="胸背"] { border-top-color: #71b18c; }
.device-node[data-region="腰骶"] { border-top-color: #cb839d; }

.device-node.active {
  border-color: #1f7ac4;
  background: #1f7ac4;
  color: #fff;
}

.device-node.wave::after {
  content: "";
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #f0a43c;
  box-shadow: 0 0 0 2px rgba(240, 164, 60, 0.18);
}

.lab-layer-toggle:focus-visible,
.tcm-row:focus-visible,
.device-node:focus-visible {
  outline: 2px solid #35a7dc;
  outline-offset: 2px;
}

.level-node {
  height: 23px;
  border-radius: 4px;
  font-size: 7px;
  font-weight: 600;
}

.level-node[data-region="颈椎"] { border-top-color: #6ab8e2; }
.level-node[data-region="胸椎"] { border-top-color: #94b3c9; }
.level-node[data-region="腰椎"] { border-top-color: #7fa9cf; }
.level-node[data-region="骶骨"] { border-top-color: #b1c7d7; }

.lab-bottom-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 5px;
  color: #8093a4;
  font-size: 7.5px;
}

.lab-bottom-row > div { display: flex; gap: 5px; margin-left: auto; }
.lab-bottom-row > span:last-child { margin-left: auto; }
.lab-bottom-row button { height: 20px; padding: 0 9px; font-size: 7.5px; }

@media (max-width: 1300px) {
  .rail.left { display: none; }
  .bottom { grid-template-columns: minmax(0, 1fr) 220px 340px; }
  .acu-popup {
    top: 118px;
    right: auto;
    left: 16px;
  }
  .callout {
    top: 118px;
    right: 16px;
    left: auto;
  }
}

@media (min-width: 1500px) {
  .rail.left { width: 258px; }
}

@media (max-width: 1000px) {
  .rail.right { display: none; }
  .bottom { grid-template-columns: minmax(0, 1fr) 260px; }
  .play { display: none; }
  .callout { display: none; }
  .top-meta span:nth-child(4), .top-meta span:nth-child(5) { display: none; }
  .point-grid { grid-template-columns: repeat(16, minmax(0, 1fr)); }
}

@media (max-width: 1050px) {
  .lab-top {
    grid-template-columns: minmax(280px, 1fr) auto;
  }
  .lab-mode-center {
    grid-column: 1 / -1;
    grid-row: 2;
    min-width: 0;
  }
  .lab-actions {
    grid-column: 2;
    grid-row: 1;
  }
  .lab-index { display: none; }
  body.lab-mode .view-toolbar { top: 180px; }
  .floating-conditions { top: 222px; }
  .lab-disease { width: 330px; }
  .level-buttons { grid-template-columns: repeat(5, 1fr); }
  .lab-tcm-panel {
    top: 220px;
    width: min(610px, calc(100vw - 32px));
  }
  .lab-detail {
    top: 176px;
    right: 8px;
    bottom: 126px;
    width: min(520px, 52vw);
    height: auto;
  }
  body.lab-detail-open #labCanvas { right: calc(min(520px, 52vw) + 20px); }
}

@media (max-width: 640px) {
  .brand { gap: 6px; min-width: 0; }
  .brand-logo { flex-basis: 94px; width: 94px; height: 24px; }
  .brand div { padding-left: 6px; }
  .brand b { font-size: 12px; white-space: nowrap; }
  .brand span { display: none; }
  .top-meta { gap: 5px; }
  .top-meta span:nth-child(2),
  .top-meta span:nth-child(3),
  .top-meta span:nth-child(4) { display: none; }
  .bottom { grid-template-columns: 1fr; height: 112px; }
  .alerts { display: none; }
  .point-grid { grid-template-columns: repeat(16, minmax(0, 1fr)); }
  .lab-top { align-items: flex-start; }
  .lab-top h1 { font-size: 16px; }
  .lab-actions b { display: none; }
  .lab-pathline { display: none; }
  .lab-actions button { height: 24px; padding: 0 7px; font-size: 7px; }
  body.lab-mode .view-toolbar { top: 126px; }
  .floating-conditions { top: 168px; }
  .lab-disease { top: 76px; right: 8px; bottom: 92px; width: min(330px, calc(100vw - 16px)); }
  .lab-bottom { right: 8px; bottom: 8px; left: 8px; height: 112px; }
  .lab-top { left: 8px; right: 8px; }
  .lab-tcm-panel { top: 166px; right: 8px; bottom: 126px; width: calc(100vw - 16px); }
  .lab-detail {
    top: 170px;
    right: 8px;
    bottom: 126px;
    width: calc(52vw);
    height: auto;
  }
  body.lab-detail-open #labCanvas { right: calc(52vw + 16px); }
  .lab-detail .detail-callout { display: none; }
  .tcm-table-head,
  .tcm-row { grid-template-columns: 38px 68px minmax(84px, 1fr) minmax(88px, 1fr); }
  .tcm-table-head span:last-child,
  .tcm-row > span:last-child { display: none; }
  .lab-bottom-row > span:last-child { display: none; }
}

html[data-theme="dark"] {
  color-scheme: dark;
  --ink: #e2eef7;
  --ink2: #c0d4e3;
  --muted: #8da3b5;
  --muted2: #657c8e;
  --line: #243847;
  --bg: #07121b;
  --card: rgba(10, 23, 34, 0.94);
  --blue: #4eb5ed;
  --cyan: #50d5f2;
  --orange: #e3a360;
}

html[data-theme="dark"],
html[data-theme="dark"] body,
html[data-theme="dark"] #app {
  background: #07121b;
  color: var(--ink);
}

html[data-theme="dark"] #shade {
  background:
    linear-gradient(90deg, rgba(5, 14, 22, 0.96), rgba(6, 16, 25, 0.58) 10%, transparent 23%, transparent 72%, rgba(5, 14, 22, 0.82) 87%, rgba(5, 14, 22, 0.97)),
    linear-gradient(0deg, rgba(5, 14, 22, 0.97), transparent 26%),
    linear-gradient(180deg, rgba(6, 16, 25, 0.9), transparent 16%);
}

html[data-theme="dark"] .topbar {
  border-bottom-color: #203442;
  background: rgba(7, 18, 28, 0.95);
}

html[data-theme="dark"] .brand .logo-light { display: none; }
html[data-theme="dark"] .brand .logo-dark { display: block; }

html[data-theme="dark"] .brand div { border-left-color: #314756; }
html[data-theme="dark"] .brand b { color: #edf6fc; }
html[data-theme="dark"] .top-meta { color: #8ea3b3; }
html[data-theme="dark"] .top-meta b { color: #d9ebf5; }
html[data-theme="dark"] .top-meta .metric i { color: #657d8f; }

html[data-theme="dark"] .tag {
  border-color: #2d4555;
  background: #0e2130;
  color: #a8c0d1;
}
html[data-theme="dark"] .tag.bus { color: #8fcff0; border-color: #2e566d; background: #0b2637; }
html[data-theme="dark"] .tag.ok { color: #83d8ac; border-color: #285440; background: #0d2a20; }
html[data-theme="dark"] .rail:hover::-webkit-scrollbar-thumb {
  background: rgba(128, 161, 181, 0.24);
}

html[data-theme="dark"] #anatomyBtn,
html[data-theme="dark"] #neuroBtn,
html[data-theme="dark"] #themeToggle,
html[data-theme="dark"] #full {
  border-color: #335367;
  background: #102534;
  color: #b9d9ec;
}

html[data-theme="dark"] .card,
html[data-theme="dark"] .points-wrap {
  border-color: #233846;
  background: rgba(9, 22, 33, 0.94);
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.28);
}

html[data-theme="dark"] .card-head,
html[data-theme="dark"] .bottom-head {
  border-bottom-color: #243947;
  color: #b8d0e0;
}
html[data-theme="dark"] .card-head span,
html[data-theme="dark"] .bottom-head span { color: #657f92; }
html[data-theme="dark"] .kv span,
html[data-theme="dark"] .levels,
html[data-theme="dark"] .note,
html[data-theme="dark"] .boundary p { color: #8da2b2; }
html[data-theme="dark"] .kv b { color: #d9e8f2; }
html[data-theme="dark"] .levels li { border-bottom-color: #213642; }
html[data-theme="dark"] .stat-row div,
html[data-theme="dark"] .hero-quick span,
html[data-theme="dark"] .compact-grid div {
  background: #0e2231;
}
html[data-theme="dark"] .hero-quick b,
html[data-theme="dark"] .compact-grid b { color: #8bc7e8; }
html[data-theme="dark"] .mini-bar,
html[data-theme="dark"] .progress,
html[data-theme="dark"] .heater-track { background: #1b303f; }

html[data-theme="dark"] .fit-dial {
  background: conic-gradient(#49c2ee calc(var(--fit) * 1%), #203847 0);
  box-shadow: 0 0 0 5px #0c1c28, 0 3px 14px rgba(25, 140, 192, 0.24);
}
html[data-theme="dark"] .fit-dial::before { background: #0b1b27; }
html[data-theme="dark"] .fit-dial b,
html[data-theme="dark"] .hero-side > div:not(.hero-quick) b { color: #dff3ff; }
html[data-theme="dark"] .fit-dial span,
html[data-theme="dark"] .hero-side label,
html[data-theme="dark"] .hero-side p,
html[data-theme="dark"] .hero-foot { color: #8298a9; }

html[data-theme="dark"] .heater-control {
  border-color: #29404f;
  background: linear-gradient(135deg, #0c1e2b, #0b1a25);
}
html[data-theme="dark"] #heaterToggle,
html[data-theme="dark"] #heaterRun,
html[data-theme="dark"] .heat-stages span {
  border-color: #2d4555;
  background: #102431;
  color: #9dbfd4;
}
html[data-theme="dark"] .heater-head b,
html[data-theme="dark"] .heater-meta { color: #728b9e; }
html[data-theme="dark"] .heater-control.on #heaterToggle {
  border-color: #785539;
  background: #2a1c14;
  color: #efb37e;
}
html[data-theme="dark"] .heat-stages span.active {
  border-color: #805a3b;
  background: #2a1d14;
  color: #e8ae75;
}

html[data-theme="dark"] .inline-metrics { border-top-color: #223642; color: #7d93a4; }
html[data-theme="dark"] .insight-tags span { border-color: #2b4251; background: #0e2230; color: #90a8b9; }
html[data-theme="dark"] .radar-foot { color: #71899b; }
html[data-theme="dark"] .sync-banner { border-color: #28404f; background: #0d2230; }
html[data-theme="dark"] .sync-banner > span { color: #a9c2d2; }
html[data-theme="dark"] .sync-banner em { color: #75c5e9; }

html[data-theme="dark"] .view-toolbar {
  border-color: #2a4252;
  background: rgba(8, 21, 31, 0.94);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}
html[data-theme="dark"] .view-toolbar label { color: #91a8b9; }
html[data-theme="dark"] .view-toolbar .acupoint-layer-label.active {
  background: #14343f;
  color: #8fe8f5;
}
html[data-theme="dark"] .view-toolbar > button:not(.interaction-toggle),
html[data-theme="dark"] .view-toolbar .interaction-toggle {
  border-color: #304958;
  background: #102432;
  color: #a9c9dc;
}
html[data-theme="dark"] .view-toolbar > button.active {
  border-color: #397c5b;
  background: #17362a;
  color: #8de0b1;
}
html[data-theme="dark"] .toolbar-divider { background: #2c4352; }
html[data-theme="dark"] .view-toolbar.locked::after {
  background: rgba(47, 34, 20, 0.92);
  color: #dfaa6e;
}

html[data-theme="dark"] .callout {
  border-color: #2d4453;
  background: rgba(9, 22, 32, 0.95);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
}
html[data-theme="dark"] .callout-title b,
html[data-theme="dark"] .callout-grid b { color: #d6eaf6; }
html[data-theme="dark"] .callout-sub,
html[data-theme="dark"] .callout-title span,
html[data-theme="dark"] .callout-grid i { color: #738a9b; }

html[data-theme="dark"] .pt {
  border-color: #273e4c;
  background: #0c1d29;
  color: #8fa7b8;
}
html[data-theme="dark"] .pt.sel { outline-color: #4fb7ea; }
html[data-theme="dark"] .alerts li { border-bottom-color: #223642; }
html[data-theme="dark"] #play,
html[data-theme="dark"] .acu-actions button,
html[data-theme="dark"] .condition-actions button {
  border-color: #304756;
  background: #102432;
  color: #b5d0e1;
}
html[data-theme="dark"] .progress { border-color: #294351; background: #18303f; }
html[data-theme="dark"] .chapters button:hover { border-color: #304b5b; background: #102330; }
html[data-theme="dark"] .chapters button.active { border-color: #347da5; background: #12334a; color: #73d2fb; }

html[data-theme="dark"] .acu-popup,
html[data-theme="dark"] .condition-popup {
  border-color: #2d4555;
  background: rgba(8, 21, 31, 0.97);
  box-shadow: 0 20px 52px rgba(0, 0, 0, 0.44);
}
html[data-theme="dark"] .acu-popup header,
html[data-theme="dark"] .condition-popup header { border-bottom-color: #253b49; }
html[data-theme="dark"] .acu-popup header span,
html[data-theme="dark"] .acu-title h2,
html[data-theme="dark"] .condition-popup-heading h2 { color: #e1f0f8; }
html[data-theme="dark"] .acu-theory,
html[data-theme="dark"] .condition-detail { color: #afc4d2; }
html[data-theme="dark"] .acu-device,
html[data-theme="dark"] .condition-field { background: #0d2230; }
html[data-theme="dark"] .acu-live div { border-color: #29404e; background: #0d1e29; }
html[data-theme="dark"] .acu-live b { color: #d8ecf7; }
html[data-theme="dark"] .condition-field.caution { background: #241b14; }
html[data-theme="dark"] .condition-field p { color: #aec2d0; }

body.lab-mode[data-theme="dark"],
html[data-theme="dark"] .lab-vignette {
  background: linear-gradient(90deg, rgba(5, 13, 21, 0.97), rgba(8, 21, 31, 0.45) 25%, transparent 42%, transparent 62%, rgba(5, 13, 21, 0.82) 80%, rgba(5, 13, 21, 0.98)), linear-gradient(0deg, rgba(5, 13, 21, 0.98), transparent 30%);
}

html[data-theme="dark"] #labCanvas {
  background: radial-gradient(circle at 52% 44%, #19394b, #0d2331 36%, #08151f 72%, #050d14);
}
html[data-theme="dark"] .lab-panel,
html[data-theme="dark"] .condition-float-card,
html[data-theme="dark"] .condition-count-card {
  border-color: #29414f;
  background: rgba(7, 19, 28, 0.93);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.32);
}
html[data-theme="dark"] .lab-top h1,
html[data-theme="dark"] .lab-subline b { color: #e2f0f8; }
html[data-theme="dark"] .lab-subline,
html[data-theme="dark"] .lab-subline em,
html[data-theme="dark"] .lab-subline span,
html[data-theme="dark"] .lab-actions b,
html[data-theme="dark"] .lab-panel-head,
html[data-theme="dark"] .spine-group-head,
html[data-theme="dark"] .lab-index > p,
html[data-theme="dark"] .floating-boundary { color: #8ba2b3; }
html[data-theme="dark"] .lab-panel-head,
html[data-theme="dark"] .spine-group,
html[data-theme="dark"] .spine-group:last-child { border-color: #263b48; }
html[data-theme="dark"] .level-btn,
html[data-theme="dark"] .level-node {
  border-color: #2b4352;
  background: #0d202c;
  color: #a8c0d1;
}
html[data-theme="dark"] .level-btn.mapped:not(.active),
html[data-theme="dark"] .level-node.mapped:not(.active) {
  border-color: #39728e;
  background: #102b3b;
  color: #8ed4f0;
}
html[data-theme="dark"] .lab-actions button,
html[data-theme="dark"] .lab-bottom-row button {
  border-color: #304956;
  background: #102432;
  color: #aac9dc;
}
html[data-theme="dark"] .condition-float-card header b { color: #d5e8f4; }
html[data-theme="dark"] .condition-float-card.kind-warning {
  border-color: rgba(202, 92, 85, 0.58);
  background: rgba(39, 20, 22, 0.94);
}
html[data-theme="dark"] .condition-float-card.kind-warning header span {
  background: #3a2021;
  color: #f0a09a;
}
html[data-theme="dark"] .condition-float-card p { color: #a5b9c7; }
html[data-theme="dark"] .condition-float-card footer { color: #718899; }
html[data-theme="dark"] .condition-float-card header span,
html[data-theme="dark"] .condition-count-card b { background: #122a39; color: #8fc9e6; }
html[data-theme="dark"] .floating-boundary { background: rgba(6, 17, 25, 0.8); }
html[data-theme="dark"] .lab-layer-toggle,
html[data-theme="dark"] .lab-pathline span {
  border-color: #29414f;
  background: rgba(8, 24, 34, 0.92);
  color: #9cb8c9;
}
html[data-theme="dark"] .lab-layer-toggle small { color: #7e99aa; }
html[data-theme="dark"] .lab-layer-toggle:hover { border-color: #3e718a; background: #0d2636; color: #c8e3f0; }
html[data-theme="dark"] .lab-layer-toggle.active { border-color: #376e89; background: #102b3b; color: #94d9f3; }
html[data-theme="dark"] .lab-pathline span:nth-of-type(3) { border-color: #35647d; color: #8bd8f3; }
html[data-theme="dark"] .lab-pathline i { color: #547486; }
html[data-theme="dark"] .lab-tcm-panel > .lab-panel-head small { color: #7892a3; }
html[data-theme="dark"] .tcm-table-head { border-color: #263e4c; color: #7892a3; }
html[data-theme="dark"] .tcm-row {
  border-color: #223946;
  background: transparent;
  color: #a9c1d0;
}
html[data-theme="dark"] .tcm-row:hover,
html[data-theme="dark"] .tcm-row.active {
  border-bottom-color: #396e87;
  background: rgba(18, 48, 64, 0.72);
  box-shadow: inset 2px 0 0 #4ca9d2;
}
html[data-theme="dark"] .tcm-row > span:nth-child(2) b,
html[data-theme="dark"] .tcm-detail b { color: #d5edf8; }
html[data-theme="dark"] .tcm-detail {
  border-color: #263e4c;
  background: transparent;
  color: #a7becb;
}
html[data-theme="dark"] .tcm-detail em { color: #718999; }
html[data-theme="dark"] .lab-device-strip-head { color: #b6cedc; }
html[data-theme="dark"] .device-node {
  border-color: #2b4352;
  background: #0d202c;
  color: #a8c0d1;
}
html[data-theme="dark"] .device-node.active { background: #1977ad; color: #fff; }
html[data-theme="dark"] .lab-detail {
  border-color: rgba(106, 149, 171, 0.24);
  background:
    linear-gradient(145deg, rgba(12, 31, 43, 0.88), rgba(4, 14, 22, 0.78));
  box-shadow:
    0 34px 100px rgba(0, 0, 0, 0.42),
    inset 0 1px 0 rgba(197, 229, 244, 0.075);
  backdrop-filter: blur(26px) saturate(128%);
}
html[data-theme="dark"] .lab-detail-head,
html[data-theme="dark"] .lab-detail-note { border-color: rgba(91, 128, 148, 0.24); }
html[data-theme="dark"] .lab-detail-head {
  background: linear-gradient(180deg, rgba(138, 192, 218, 0.045), transparent);
}
html[data-theme="dark"] .lab-detail-head span,
html[data-theme="dark"] .lab-detail-note,
html[data-theme="dark"] .detail-callout small { color: #8097a7; }
html[data-theme="dark"] .lab-detail-head b,
html[data-theme="dark"] .detail-callout { color: #e2f0f7; }
html[data-theme="dark"] .lab-detail-head button {
  border-color: rgba(108, 151, 172, 0.26);
  background: rgba(19, 44, 58, 0.44);
  color: #b9d2df;
}
html[data-theme="dark"] .lab-detail-head button:hover {
  border-color: rgba(99, 190, 232, 0.48);
  background: rgba(22, 62, 81, 0.72);
  color: #e4f5fd;
}
html[data-theme="dark"] .lab-detail-stage {
  background:
    radial-gradient(ellipse at 52% 43%, rgba(55, 136, 168, 0.24), rgba(19, 56, 74, 0.08) 38%, transparent 64%),
    linear-gradient(135deg, rgba(42, 110, 138, 0.08), rgba(3, 12, 18, 0.01) 52%, rgba(22, 70, 88, 0.08));
}
html[data-theme="dark"] .detail-callout {
  text-shadow: 0 1px 14px rgba(2, 10, 16, 0.92);
}
html[data-theme="dark"] .detail-callout i {
  background: #64b8df;
  box-shadow:
    0 0 0 4px rgba(100, 184, 223, 0.1),
    0 0 16px rgba(83, 185, 229, 0.3);
}
html[data-theme="dark"] .lab-detail-note {
  background: rgba(6, 19, 28, 0.42);
}

@media (prefers-reduced-motion: reduce) {
  .lab-detail.open { animation: none; }
}

@media (max-width: 1050px) {
  .acupoint-hub-panel {
    right: 12px;
    width: min(590px, 58vw);
  }
  .acupoint-results {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  body.acupoint-mode .topbar {
    display: none;
  }
  body.acupoint-mode #acupointHub {
    inset: 0;
  }
  .acupoint-hub-panel {
    top: 8px;
    right: 8px;
    bottom: 8px;
    left: 8px;
    width: auto;
    padding: 11px;
  }
  .acupoint-hub-top {
    align-items: center;
  }
  .acupoint-hub-heading p,
  .acupoint-hub-actions b {
    display: none;
  }
  .acupoint-3d-hud {
    display: none;
  }
  .acupoint-standard-head {
    align-items: flex-start;
  }
  .acupoint-standard-head > div:first-child b {
    font-size: 30px;
  }
  .acupoint-standard-counts {
    flex-direction: column;
  }
  .acupoint-results {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
