/* 小屏：默认样式，宽度小于 1000px，演示与说明上下排列。 */

.shell {
  margin: auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 50px 16px;
  color: #000;
}

.shell-title-wrapper .subtitle {
  margin-top: 14px;
  line-height: 1.65;
  font-size: 14px;
  text-align: center;
  color: #666;
}

.evolution-layout {
  align-items: center;
  gap: 0;
  display: flex;
  flex-direction: column;
  margin-top: 24px;
  gap: 24px;
}

.landscape {
  position: relative;
  isolation: isolate;
  min-width: 0;
  width: 100%;
  aspect-ratio: 900/750;
}

.loop-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  z-index: 1;
  pointer-events: none;
  visibility: hidden;
}

.loop-track path {
  fill: none;
  stroke-linecap: round;
  marker-end: url(#arrow);
  stroke-width: 1.8;
  stroke: #a2dcc6;
}

.loop-current path {
  fill: none;
  stroke-linecap: round;
  stroke: #03cb94;
  marker-end: url(#arrow);
  transition: opacity 0.35s;
  opacity: 0;
  stroke-width: 1.9;
}

#terrain {
  position: absolute;
  pointer-events: none;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  z-index: 0;
  transition: none;
}

.actor {
  position: absolute;
  aspect-ratio: 1;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 4;
  border: 1px solid #c9ebde;
  box-shadow: 0 6px 24px #19573104;
  transition:
    border-color 0.35s,
    background 0.35s,
    box-shadow 0.35s,
    transform 0.35s;
  width: 22%;
  padding: 4px 3px 8px;
  overflow: visible;
  background: radial-gradient(circle at 35% 25%, #fff, #effbf6);
}

.actor-0 {
  left: 8%;
  top: 1%;
}

.actor-1 {
  right: 8%;
  top: 1%;
}

.actor-2 {
  left: 39%;
  bottom: 0;
}

.actor-art {
  position: relative;
  display: block;
}

.actor strong {
  display: block;
  font-weight: 600;
  line-height: 1.15;
  white-space: nowrap;
  letter-spacing: -0.04em;
  font-size: clamp(13px, 2.2vw, 22px);
}

.actor.active {
  box-shadow: 0 8px 30px #03cb9417;
  border-color: #03cb94;
  background: radial-gradient(circle at 30% 20%, #fff, #dcf9ee);
}

.flow-label {
  position: absolute;
  z-index: 3;
  line-height: 1.2;
  transition: color 0.3s;
  padding: 0;
  background: none;
  pointer-events: none;
  white-space: nowrap;
  color: #568366;
  font-size: clamp(10px, 1.5vw, 15px);
}

.label-0 {
  left: 50%;
  transform: translateX(-50%);
  top: 2%;
}

.label-1 {
  right: 2%;
  top: 59%;
}

.label-2 {
  left: 2%;
  top: 59%;
}

.stage-story {
  width: 100%;
  align-self: center;
}

.stage-row {
  display: flex;
  width: 100%;
  position: relative;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 12px;
  transition:
    background 0.3s,
    border 0.3s,
    box-shadow 0.3s;
  height: auto;
  min-height: 0;
  padding: 12px;
  gap: 15px;
  box-sizing: border-box;
}

.stage-number {
  line-height: 1.6;
  color: #666;
  font-variant-numeric: tabular-nums;
  transition: color 0.3s;
  font-size: 14px;
}

.stage-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.stage-content > strong {
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.2;
  font-size: 18px;
  white-space: normal;
}

.stage-role {
  line-height: 1.5;
  font-size: 14px;
  color: #666;
  margin-top: 8px;
}

.stage-description {
  font-size: 14px;
  max-width: 100%;
  color: #666;
  transition: color 0.25s;
  margin-top: 8px;
  line-height: 1.7;
}

.stage-row.active {
  border-radius: 12px;
  background: #edfbf5;
  border-color: #9ae2ca;
}

.stage-row.active .stage-number {
  color: #009d74;
}

.stage-light {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #c9d8cf;
  transition:
    background 0.3s,
    box-shadow 0.3s;
  right: 14px;
  top: 24px;
}

.stage-row.active .stage-light {
  background: #03cb94;
}

.loop-effects {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
}

.actor .code-name {
  display: flex;
  flex-direction: column;
  align-items: center;
  white-space: normal;
  margin-top: 1px;
  line-height: 1.02;
  font-size: clamp(11px, 1.9vw, 19px);
}

.code-name span {
  display: block;
  font-size: 0.9em;
  margin-top: 2px;
}

.molecule-labels {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  overflow: hidden;
}

.protein-anchor {
  position: absolute;
  width: 0;
  height: 0;
  pointer-events: none;
  opacity: 0;
}

.result-badge {
  position: absolute;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid #fff;
  border-radius: 50%;
  background: #03bb89;
  color: #fff;
  box-shadow: 0 2px 7px #25785020;
  transform-origin: center;
  left: 5px;
  top: -7px;
  width: 14px;
  height: 14px;
}

.result-badge.bad {
  background: #ed8775;
}

.result-badge svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  width: 10px;
  height: 10px;
  stroke-width: 2.7;
}

.actor:after {
  content: "";
  position: absolute;
  inset: -1px;
  border: 1.5px solid #03cb94;
  border-radius: 50%;
  opacity: calc(var(--arrival, 0) * 0.65);
  box-shadow:
    0 0 19px #03cb9425,
    inset 0 0 15px #63edaf28;
  pointer-events: none;
}

.loop-current .active {
  opacity: 0.34;
}

.loop-ready .loop-lines {
  visibility: visible;
}

html,
body {
  background: #fff;
}

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

#terrain #terrain-fallback {
  position: absolute;
  left: 14%;
  top: 23%;
  width: 72%;
  height: 46%;
}

.actor-art > svg.motion-icon {
  display: block;
  width: 100%;
  height: 100%;
  stroke: none;
  fill: none;
  overflow: visible;
}

.actor .actor-art {
  flex: 0 0 65%;
  width: 73%;
  height: 65%;
}

.actor-1 .actor-art {
  width: 68%;
  height: 61%;
  flex-basis: 61%;
}

.actor-2 .actor-art {
  width: 78%;
  height: 68%;
  flex-basis: 68%;
}

.motion-icon {
  filter: drop-shadow(0 3px 2px #1760380a);
}

.actor:before {
  content: "";
  position: absolute;
  inset: -1px;
  border: 2px solid #03cb94;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  box-shadow:
    0 0 22px 4px #03cb9438,
    inset 0 0 16px #03cb9424;
  transition: opacity 0.12s linear;
}

.actor.active:before {
  opacity: calc(0.22 + var(--breath, 0) * 0.72);
}

.actor:not(.active):after {
  opacity: 0;
}

.shell-title-wrapper .title {
  font-weight: 600;
  line-height: 1.28;
  font-size: 20px;
  word-break: normal;
  text-align: center;
}

/* 桌面：1000–1599px，只覆盖尺寸与两栏布局差异。 */
@media (min-width: 1000px) {
  .shell {
    max-width: 960px;
    height: 930px;
    padding: 0;
  }

  .shell-title-wrapper .subtitle {
    font-size: 15px;
    margin-top: 14px;
  }

  .evolution-layout {
    margin-top: 88px;
    display: grid;
    gap: 0;
    grid-template-columns: minmax(0, 65%) minmax(0, 35%);
  }

  .landscape {
    height: 610px;
    aspect-ratio: auto;
    width: auto;
    margin: 0;
  }

  .actor {
    padding: 9px 7px 12px;
    width: 19%;
  }

  .actor-0 {
    left: 10%;
  }

  .actor-1 {
    right: 10%;
  }

  .actor-2 {
    left: 40.5%;
  }

  .actor strong {
    letter-spacing: -0.035em;
    font-size: clamp(18px, 1.4vw, 25px);
  }

  .flow-label {
    font-size: 15px;
  }

  .label-0 {
    top: 1.6%;
  }

  .label-1 {
    right: 5%;
  }

  .label-2 {
    left: 5%;
  }

  .stage-row {
    padding: 20px 12px;
    gap: 12px;
    border-radius: 24px;
  }

  .stage-row.active {
    border-radius: 24px;
  }

  .stage-number {
    font-size: 16px;
    line-height: 1.6;
  }

  .stage-content > strong {
    font-size: 22px;
  }

  .stage-role {
    font-size: 15px;
    margin-top: 8px;
  }

  .stage-description {
    margin-top: 8px;
    line-height: 1.8;
    font-size: 15px;
  }

  .shell.en_US .stage-description {
    line-height: 1.5;
  }

  .stage-light {
    right: 10px;
    top: 20px;
  }

  .shell-title-wrapper .title {
    font-size: 32px;
  }

  .actor .code-name {
    font-size: clamp(16px, 1.38vw, 22px);
    line-height: 1.03;
  }

  .code-name span {
    margin-top: 3px;
  }

  .result-badge {
    left: 8px;
    width: 21px;
    height: 21px;
    top: -11px;
    border-width: 1.5px;
  }

  .result-badge svg {
    width: 16px;
    height: 16px;
    stroke-width: 2.6;
  }

  .actor .actor-art {
    width: 74%;
    height: 68%;
    flex-basis: 68%;
  }

  .actor-1 .actor-art {
    width: 72%;
    height: 66%;
    flex-basis: 66%;
  }

  .actor-2 .actor-art {
    height: 72%;
    flex-basis: 72%;
  }
}

/* 大屏：1600px 起，只覆盖大屏尺寸差异。 */
@media (min-width: 1600px) {
  .shell {
    max-width: 1400px;
    height: 1038px;
  }

  .landscape {
    height: 650px;
  }

  .actor strong {
    font-size: 25px;
  }

  .stage-row {
    padding: 24px 16px;
    gap: 17px;
  }

  .evolution-layout {
    margin-top: 112px;
  }

  .stage-content > strong {
    font-size: 28px;
  }

  .stage-role {
    font-size: 16px;
    margin-top: 12px;
  }

  .stage-description {
    font-size: 16px;
    margin-top: 12px;
  }

  .stage-light {
    right: 18px;
    top: 28px;
  }

  .result-badge {
    left: 11px;
    width: 23px;
    height: 23px;
  }

  .shell-title-wrapper .title {
    font-size: 40px;
  }

  .shell-title-wrapper .subtitle {
    font-size: 16px;
    margin-top: 16px;
  }

  .stage-number {
    font-size: 18px;
    line-height: 1.8;
  }
}
