#stage {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background: radial-gradient(ellipse at 39% 44%, #101925, #05070d 72%);
  padding: 20px clamp(16px, 3vw, 44px) 14px;
}
.stage-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 22px; }
.stage-head h2 { margin: 0; font-size: 18px; font-weight: 650; }
#stage .seg button { min-height: 36px; padding: 4px 12px; color: var(--accent); }
#stage .seg button.on { color: #20170a; }
.figures {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(240px, 1fr);
  align-items: stretch;
  gap: clamp(10px, 2vw, 30px);
  padding: 10px 0 14px;
}
.body-view { min-width: 0; min-height: 0; display: grid; justify-items: center; }
#anatomy { display: block; width: 100%; height: 100%; min-height: 0; overflow: visible; }
.organ-tracks { fill: none; stroke-linejoin: round; stroke-linecap: round; }
.organ-tracks path { stroke: transparent; stroke-width: 20px; pointer-events: stroke; cursor: pointer; }
.organ-tracks path:hover { stroke: #ffc94a40; }
.organ-tracks path.current { stroke: #ffc94a58; stroke-width: 12px; }
.organ-label { cursor: pointer; fill: #d6c3c0; font-size: 15px; }
.organ-label path { stroke: #98828b; stroke-width: 1px; fill: none; }
.organ-label circle { fill: #d9aba3; }
.organ-label.current, .organ-label:hover { fill: #ffe4a0; }
.organ-label.current circle { fill: #ffc94a; }
#food { pointer-events: none; }
.specimen {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  min-width: 0;
  width: 100%;
  max-width: 410px;
  margin: 0 auto;
}
.specimen-copy { min-height: 108px; }
.specimen h3 { margin: 0; color: var(--accent); font-size: 18px; }
#action { margin: 4px 0; font-size: 15px; color: #eee0d9; }
#action span { white-space: nowrap; }
#stage-note { margin: 4px 0 0; color: #a7b4c6; font-size: 12px; min-height: 2.9em; }
.magnifier {
  position: relative;
  height: clamp(120px, 36vh, 350px);
  overflow: hidden;
  border: 1px solid #373746;
  border-radius: 16px;
  background: radial-gradient(ellipse at 50% 50%, #211b25, #0d111b 80%);
}
.magnifier svg { display: block; width: 100%; height: 100%; }
#organ-close { padding: 10px; }
#villus { padding: 8px 10px 29px; }
#villus-legend {
  position: absolute; left: 0; right: 0; bottom: 5px;
  display: flex; justify-content: center; flex-wrap: wrap;
  gap: 2px 12px; color: #ded3db; font-size: 11px;
}
#villus-legend span::before {
  content: ""; display: inline-block; width: 9px; height: 3px;
  margin-right: 4px; vertical-align: middle; background: #da7180;
}
#villus-legend span + span::before { background: #72b69a; }
.villus-tracks path { opacity: 0; }
.villus-tracks path.current { opacity: .65; stroke: #e7cec1; stroke-width: 1.3; stroke-dasharray: 2 4; }
.nutrient-picker { justify-content: center; }
#stage .nutrient-picker button { padding-inline: 8px; }
#stage [hidden] { display: none; }
.transport {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 10px;
  align-items: center; padding-top: 10px; border-top: 1px solid #253041;
}
.transport .learn-fab { position: static; transform: none; text-align: center; min-height: 36px; display: grid; place-items: center; }
.transport input { margin: 0; min-height: 36px; cursor: ew-resize; }
.transport .small, .panel-actions .small { color: var(--accent); min-height: 40px; }
#play, #next { min-width: 64px; }
#detail { color: #e1dce0; margin: 8px 0; font-size: 13px; }
.stations { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.stations button {
  display: flex; flex-direction: column; justify-content: center; gap: 2px;
  min-height: 54px; padding: 6px 9px; cursor: pointer;
  color: var(--accent); background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 8px; text-align: left; font: inherit;
}
.stations button small { color: #b1bac7; font-size: 11px; }
.stations button.on, .stations button:hover { border-color: var(--accent); }
.stations button.on { background: #30291e; }
.panel-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); }

@media (max-width: 920px) and (min-width: 761px) {
  #panel { width: 275px; }
  .figures { grid-template-columns: minmax(0, 1fr) minmax(156px, .8fr); }
  #stage .nutrient-picker button { padding-inline: 4px; font-size: 11px; }
}
@media (max-width: 760px) {
  #stage { padding: 9px 12px 9px; }
  .stage-head { gap: 5px 10px; }
  .stage-head h2 { font-size: 16px; }
  .scenarios { width: 100%; }
  #stage .seg button { min-height: 40px; }
  #panelToggle { position: relative; inset: auto; min-height: 36px; color: var(--accent); padding: 4px 10px; }
  #panel.collapsed { visibility: hidden; }
  .figures { grid-template: minmax(0, 1fr) auto / 1fr; gap: 4px; padding: 2px 0 6px; }
  .specimen { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .95fr); align-items: center; gap: 6px 10px; max-width: 520px; }
  .specimen-copy { min-height: 0; }
  .specimen h3 { font-size: 16px; }
  #action { font-size: 13px; }
  #stage-note { font-size: 11px; }
  .magnifier { height: clamp(108px, 17dvh, 170px); border-radius: 11px; }
  #villus { padding: 0 1px 20px; }
  #villus-legend { gap: 2px 6px; font-size: 10px; bottom: 3px; }
  .nutrient-picker { grid-column: 1 / -1; justify-content: stretch; }
  .nutrient-picker button { flex: 1; }
  .organ-tracks path { stroke-width: 28px; }
  .organ-tracks path.current { stroke-width: 28px; stroke: #ffc94a31; }
  .transport { padding-top: 5px; gap: 5px; }
  .transport .learn-fab { padding-inline: 6px; font-size: 11px; }
  #play, #next { min-width: 52px; padding-inline: 4px; }
}
@media (max-width: 760px) and (max-height: 510px) {
  #stage { padding-block: 4px; }
  .figures { grid-template: minmax(0, 1fr) / 1fr 1fr; gap: 6px; }
  .specimen { display: flex; gap: 3px; align-items: initial; }
  .magnifier { height: 105px; }
  #stage .nutrient-picker button { padding-inline: 4px; min-height: 36px; }
}
@media (prefers-reduced-motion: reduce) {
  #panel { transition: none; }
}

/* 肠管的高亮随各自的解剖层叠放。 */
.organ-tracks path.current:is([data-organ="intestine"], [data-organ="colon"]):not(:hover) { stroke: transparent; }
