:root {
  --ink: #17211f;
  --muted: #65716c;
  --paper: #f3f6f5;
  --bench: #e8eeeb;
  --line: #cbd6d0;
  --nickel: #71807a;
  --blue: #2d6f91;
  --blue-soft: #e4f0f5;
  --specimen: #b64078;
  --specimen-soft: #f6e7ee;
  --lamp: #f0b429;
  --success: #2d8366;
  --danger: #a33832;
  --shadow: rgba(31, 49, 43, .15);
  --display: "STKaiti", "KaiTi", "Songti SC", serif;
  --body: "PingFang SC", "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  --utility: "SFMono-Regular", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { width: 100%; min-width: 320px; height: 100%; scroll-behavior: smooth; }
body {
  width: 100%;
  min-width: 320px;
  height: 100dvh;
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  background: radial-gradient(circle at 16% -10%, #fff 0, transparent 38rem), var(--paper);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-x: none;
}
button, input { font: inherit; }
button { color: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .45; }
button:focus-visible, input:focus-visible, summary:focus-visible, canvas:focus-visible {
  outline: 3px solid rgba(45, 111, 145, .38);
  outline-offset: 3px;
}

.app-shell {
  width: min(1500px, calc(100% - 28px));
  height: 100dvh;
  margin: 0 auto;
  padding: 10px 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}
.topbar {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 18px;
  padding: 0 3px 11px;
  border-bottom: 1px solid var(--line);
}
.brand { min-width: 0; display: flex; align-items: center; gap: 11px; }
.brand > span:last-child { min-width: 0; }
.brand strong { display: block; }
.brand strong { font-family: var(--display); font-size: 16px; letter-spacing: .08em; white-space: nowrap; }
.brand-mark {
  position: relative;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border: 1px solid rgba(45,111,145,.72);
  border-radius: 50%;
  box-shadow: inset -8px -2px 0 rgba(87,114,106,.12);
}
.brand-mark i { position: absolute; width: 4px; height: 4px; border-radius: 50%; background: var(--blue); }
.brand-mark i:nth-child(1) { left: 10px; top: 9px; }
.brand-mark i:nth-child(2) { left: 16px; top: 16px; }
.brand-mark i:nth-child(3) { left: 22px; top: 20px; }
.lab-layout {
  grid-row: 2; /* 页头被工作台隐藏时（display:none），防止主体掉进第一行按内容收缩 */
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr);
  grid-template-rows: minmax(0, 1fr);
  gap: 10px;
  padding-top: 10px;
}
.instrument-stage {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255,255,255,.92), rgba(231,237,234,.83)),
    var(--bench);
  box-shadow: 0 18px 36px rgba(46, 67, 59, .07);
  isolation: isolate;
  touch-action: none;
  overscroll-behavior: contain;
}
.instrument-stage::before {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  background-image: linear-gradient(rgba(75,99,90,.03) 1px, transparent 1px), linear-gradient(90deg, rgba(75,99,90,.03) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(to bottom, black, transparent 75%);
}
.instrument-stage::after {
  position: absolute;
  left: 7%;
  right: 7%;
  bottom: 7%;
  height: 1px;
  z-index: -1;
  pointer-events: none;
  content: "";
  background: linear-gradient(90deg, transparent, #aebbb5 20%, #aebbb5 80%, transparent);
}
.stage-heading { position: absolute; z-index: 4; top: 18px; left: 18px; pointer-events: none; }
.stage-heading h1 { margin: 0; font-family: var(--display); font-size: clamp(20px, 2.2vw, 28px); letter-spacing: .05em; }

#sceneCanvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; user-select: none; -webkit-user-select: none; }
.hotspot-layer { display: none !important; }
.hotspot {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 4px 8px 4px 5px;
  border: 0;
  background: rgba(248,251,250,.91);
  box-shadow: 0 5px 15px rgba(31,49,43,.15);
  color: #1e3533;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  pointer-events: auto;
  transform: translate(-13px, -50%);
  transition: opacity .15s ease, transform .15s ease, background .15s ease;
  white-space: nowrap;
  will-change: left, top, opacity;
}
.hotspot::before {
  width: 11px;
  height: 11px;
  flex: 0 0 11px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 1px var(--blue), 0 0 0 6px rgba(45,111,145,.12);
  animation: hotspot-breathe 1.8s ease-in-out infinite;
  content: "";
}
.hotspot:hover, .hotspot.selected { color: #fff; background: var(--blue); transform: translate(-13px, -50%) scale(1.03); }
.hotspot:hover::before, .hotspot.selected::before { background: #fff; border-color: var(--blue); box-shadow: 0 0 0 1px #fff, 0 0 0 6px rgba(45,111,145,.22); }
.hotspot.is-hidden { opacity: 0; transform: translate(-13px, -50%) scale(.86); pointer-events: none; }
.labels-off .hotspot { opacity: 0; pointer-events: none; }
@keyframes hotspot-breathe {
  0%, 100% { box-shadow: 0 0 0 1px var(--blue), 0 0 0 4px rgba(45,111,145,.10); }
  50% { box-shadow: 0 0 0 1px var(--blue), 0 0 0 9px rgba(45,111,145,.02); }
}

.loading-panel {
  position: absolute;
  z-index: 12;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 7px;
  color: #28423e;
  background: rgba(240,245,243,.84);
  backdrop-filter: blur(6px);
  transition: opacity .32s ease, visibility .32s ease;
}
.loading-panel.ready { opacity: 0; visibility: hidden; pointer-events: none; }
.loading-panel strong { font-family: var(--display); font-size: 17px; letter-spacing: .06em; }
.loading-panel > span:last-child { color: var(--muted); font-size: 11px; }
.loading-lens { width: 45px; height: 45px; margin-bottom: 7px; border: 1px solid var(--blue); border-radius: 50%; box-shadow: inset -9px -3px 0 rgba(45,111,145,.14); animation: lens-turn 1.35s linear infinite; }
@keyframes lens-turn { to { transform: rotate(360deg); } }

.part-card {
  position: relative;
  width: auto;
  margin: 0 14px 14px;
  padding: 12px 12px 11px;
  border: 1px solid #aebfba;
  border-left: 3px solid var(--blue);
  background: #f9fbfa;
  box-shadow: 0 7px 18px rgba(31,49,43,.09);
}
.part-card[hidden] { display: none; }
.card-close { position: absolute; top: 4px; right: 5px; width: 28px; height: 28px; border: 0; background: transparent; color: var(--muted); font-size: 20px; line-height: 1; }
.card-index { color: var(--blue); font: 9px/1 var(--utility); letter-spacing: .14em; }
.part-card h2 { margin: 5px 30px 8px 0; font-family: var(--display); font-size: 19px; letter-spacing: .05em; }
.part-card dl { margin: 0; }
.part-card dl div { display: grid; grid-template-columns: 54px 1fr; gap: 7px; padding: 6px 0; border-top: 1px solid #d5dfda; }
.part-card dt { color: var(--blue); font-size: 10px; font-weight: 800; }
.part-card dd { margin: 0; color: #4f5f5a; font-size: 10px; line-height: 1.5; }
.teaching-tip { margin: 7px 0 0; padding: 7px 8px; background: var(--blue-soft); font-size: 10px; line-height: 1.5; }
.teaching-tip b { display: inline-block; margin-right: 7px; color: var(--blue); }
.light-path { position: absolute; inset: 0; z-index: 5; width: 100%; height: 100%; overflow: visible; pointer-events: none; opacity: 0; transition: opacity .35s ease; }
.light-enabled .light-path { opacity: 1; }
.beam { fill: none; stroke-linecap: round; filter: url(#beamGlow); }
.beam-in { stroke: rgba(255, 211, 92, .72); stroke-width: 3; stroke-dasharray: 8 7; }
.beam-out { stroke: rgba(255, 225, 119, .95); stroke-width: 4; }
.beam-hit { fill: rgba(255, 232, 137, .85); filter: url(#beamGlow); opacity: 0; }
.lamp-source {
  position: absolute;
  z-index: 8;
  top: 24px;
  right: 25px;
  width: 72px;
  height: 82px;
  display: grid;
  justify-items: center;
  align-content: start;
  color: #786019;
  pointer-events: none;
  opacity: .55;
  transition: opacity .3s ease, filter .3s ease;
}
.light-enabled .lamp-source { opacity: 1; filter: drop-shadow(0 0 9px rgba(240,180,41,.45)); }
.lamp-head { position: relative; width: 42px; height: 32px; margin-top: 10px; border: 2px solid #9b7a24; border-radius: 22px 22px 10px 10px; background: linear-gradient(160deg, #fff7c7, #f1bb37); transform: rotate(22deg); }
.lamp-head::after { position: absolute; left: 17px; top: 28px; width: 6px; height: 22px; border-radius: 3px; background: #786f58; content: ""; }
.lamp-rays { position: absolute; top: 0; width: 58px; height: 48px; background: repeating-conic-gradient(from 0deg, rgba(240,180,41,.7) 0 3deg, transparent 3deg 22deg); mask: radial-gradient(circle, transparent 0 22px, #000 23px); }
.lamp-source b { margin-top: 27px; font-size: 9px; letter-spacing: .08em; }

.observation-scope { position: absolute; z-index: 8; top: 50%; left: 16px; width: 172px; margin: 0; pointer-events: none; transform: translateY(-50%); transform-origin: left center; }
.observation-scope figcaption { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 7px; padding: 0 4px; color: #243d38; font-size: 9px; font-weight: 800; }
.observation-scope figcaption output { color: var(--specimen); font: 8px/1 var(--utility); text-align: right; }
.scope-lens {
  position: relative;
  width: 156px;
  aspect-ratio: 1;
  margin: auto;
  overflow: hidden;
  border: 6px solid #202827;
  border-radius: 50%;
  background: #020304;
  box-shadow: 0 8px 24px rgba(20,28,26,.24), inset 0 0 0 2px #8b9894;
}
.scope-field {
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 48% 45%, #fffdf2 0 35%, #e9e2b7 62%, #879087 100%);
  opacity: 0;
  transition: opacity .18s linear, filter .18s linear;
}
.scope-lens img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
  transform: scale(1.42);
  filter: blur(13px) saturate(.85) contrast(.85);
  transition: filter .16s linear, opacity .25s ease, transform .28s ease;
}
.scope-darkness { position: absolute; inset: -2px; z-index: 2; border-radius: 50%; background: #000; opacity: .98; transition: opacity .2s linear; }
.scope-reticle { position: absolute; z-index: 3; inset: 50% auto auto 50%; width: 8px; height: 8px; border: 1px solid rgba(255,255,255,.6); border-radius: 50%; transform: translate(-50%,-50%); opacity: .35; }

.focus-sightline { position: absolute; inset: 0; z-index: 9; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.focus-sightline[hidden] { display: none; }
.focus-sightline path { fill: none; stroke: rgba(182,64,120,.88); stroke-width: 2; stroke-linecap: round; stroke-dasharray: 7 7; animation: sightline-flow 1.1s linear infinite; }
.focus-sightline circle { fill: var(--specimen); stroke: #fff; stroke-width: 2; filter: drop-shadow(0 0 5px rgba(182,64,120,.45)); }
@keyframes sightline-flow { to { stroke-dashoffset: -28; } }

.focus-eye {
  position: absolute;
  z-index: 10;
  width: 226px;
  display: grid;
  grid-template-columns: minmax(86px, 1fr) 96px;
  align-items: center;
  gap: 9px;
  padding: 9px 10px 8px 12px;
  border: 1px solid #b7c7c1;
  border-left: 3px solid var(--specimen);
  background: rgba(250,252,251,.96);
  box-shadow: 0 10px 24px rgba(31,49,43,.18);
  color: #3d4d48;
  font-size: 10px;
  pointer-events: none;
  transform: translate(-50%, -50%);
  transition: left .42s ease, top .42s ease, opacity .2s ease;
}
.focus-eye[hidden] { display: none; }
.focus-eye b { line-height: 1.4; }
.focus-eye.eyepiece-view { border-left-color: var(--blue); }
.eye-face { position: relative; width: 96px; height: 60px; --look-x: 0px; --look-y: 1px; }
.focus-eye.side-view .eye-face { --look-x: 6px; --look-y: 2px; }
.focus-eye.eyepiece-view .eye-face { --look-x: 0px; --look-y: 6px; }
.eye-brow { position: absolute; z-index: 2; top: 2px; width: 35px; height: 14px; border-top: 4px solid #1b2523; border-radius: 50%; }
.brow-left { left: 5px; transform: rotate(-8deg); }
.brow-right { right: 5px; transform: rotate(8deg); }
.cartoon-eye {
  position: absolute;
  top: 18px;
  width: 42px;
  height: 36px;
  overflow: hidden;
  border: 2.5px solid #16201e;
  border-radius: 48% 48% 52% 52%;
  background: radial-gradient(circle at 50% 24%, #fff 0 38%, #eef4f2 78%, #cbd8d3 100%);
  box-shadow: inset 0 -4px 7px rgba(53,82,74,.12), 0 1px 0 rgba(255,255,255,.75);
  transform-origin: center;
  animation: eye-blink 4.6s ease-in-out infinite;
}
.cartoon-eye.eye-left { left: 4px; }
.cartoon-eye.eye-right { right: 4px; animation-delay: .045s; }
.eye-iris {
  position: absolute;
  left: 50%;
  top: 52%;
  width: 19px;
  height: 19px;
  border: 1px solid #0d1513;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 53%, #050706 0 29%, #295d5d 31% 60%, #0c1715 62% 100%);
  box-shadow: 0 0 0 2px rgba(41,93,93,.15);
  transform: translate(calc(-50% + var(--look-x)), calc(-50% + var(--look-y)));
  transition: transform .35s ease;
}
.eye-iris::after { position: absolute; left: 4px; top: 3px; width: 5px; height: 5px; border-radius: 50%; background: #fff; box-shadow: 5px 7px 0 -1px rgba(255,255,255,.35); content: ""; }
@keyframes eye-blink {
  0%, 43%, 47%, 82%, 86%, 100% { transform: scaleY(1); }
  45%, 84% { transform: scaleY(.08); }
}

.specimen-tray {
  position: absolute;
  z-index: 9;
  left: 18px;
  top: 47%;
  display: grid;
  justify-items: start;
  gap: 6px;
  opacity: 0;
  visibility: hidden;
  transform: translateX(-15px);
  transition: opacity .25s ease, transform .25s ease, visibility .25s;
  touch-action: none;
}
.specimen-tray.show { opacity: 1; visibility: visible; transform: translateX(0); }
.specimen-tray > span { color: var(--specimen); font-size: 10px; font-weight: 800; }
.specimen-slide {
  position: relative;
  width: 148px;
  height: 55px;
  display: grid;
  grid-template-columns: 42px 1fr;
  grid-template-rows: 1fr 1fr;
  align-items: center;
  padding: 7px 10px;
  border: 1px solid rgba(107,137,146,.7);
  background: rgba(225,244,248,.82);
  box-shadow: 0 8px 18px rgba(31,49,43,.14);
  color: #304b53;
  cursor: grab;
  user-select: none;
  touch-action: none;
}
.specimen-slide:active, .specimen-slide.dragging { cursor: grabbing; box-shadow: 0 13px 24px rgba(31,49,43,.22); }
.specimen-slide i { grid-row: 1 / 3; width: 31px; height: 31px; border: 2px solid rgba(182,64,120,.5); border-radius: 50%; background: radial-gradient(circle at 55% 45%, #cf7da5 0 4px, #f6bdd6 5px 15px, transparent 16px); }
.specimen-slide b { align-self: end; font-size: 10px; }
.specimen-slide small { align-self: start; color: var(--muted); font-size: 8px; }
.slide-drop-zone {
  position: absolute;
  z-index: 6;
  min-width: 88px;
  min-height: 45px;
  display: grid;
  place-items: center;
  border: 2px dashed rgba(182,64,120,.7);
  background: rgba(246,231,238,.22);
  color: var(--specimen);
  font-size: 10px;
  font-weight: 800;
  opacity: 0;
  transform: scale(.92);
  transform-origin: center;
  transition: opacity .2s ease, transform .2s ease, left .08s linear, top .08s linear, width .08s linear, height .08s linear;
  pointer-events: none;
}
.slide-drop-zone.active { opacity: 1; transform: scale(1); animation: drop-pulse 1.5s ease-in-out infinite; }
@keyframes drop-pulse { 50% { background: rgba(246,231,238,.5); } }
.clamp-feedback {
  position: absolute;
  z-index: 9;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border: 1px solid #a9c9bd;
  background: rgba(238,248,244,.95);
  color: var(--success);
  font-size: 10px;
  font-weight: 800;
  opacity: 0;
  transform: translate(-50%,-50%) scale(.85);
  pointer-events: none;
}
.clamp-feedback.show { animation: clamp-arrive 1.8s ease both; }
.clamp-feedback i { width: 11px; height: 4px; background: var(--nickel); transform-origin: center; }
.clamp-feedback i:first-child { transform: rotate(30deg); }
.clamp-feedback i:nth-child(2) { transform: rotate(-30deg); }
@keyframes clamp-arrive { 0% { opacity: 0; transform: translate(-50%,-50%) scale(.75); } 20%, 80% { opacity: 1; transform: translate(-50%,-50%) scale(1); } 100% { opacity: 0; transform: translate(-50%,-50%) scale(.92); } }
.workbench { min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, .44fr) minmax(0, .56fr); gap: 10px; align-items: stretch; overflow: hidden; }
.desk-module { min-width: 0; height: 100%; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; border: 1px solid var(--line); background: rgba(249,251,250,.94); box-shadow: 0 14px 30px rgba(46,67,59,.06); }
.module-heading { position: sticky; z-index: 5; top: 0; min-height: 68px; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); background: linear-gradient(90deg, #f9fbfa, #edf3f0); }
.usage-module .module-heading { flex-wrap: wrap; }
.module-heading > span:nth-child(2) { min-width: 0; flex: 1 1 auto; }
.module-heading b, .module-heading small { display: block; }
.module-heading b { font-family: var(--display); font-size: 19px; letter-spacing: .05em; }
.module-heading small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.module-heading output { flex: 0 0 auto; padding: 5px 8px; color: var(--blue); border: 1px solid #bad0db; background: var(--blue-soft); font: 10px/1 var(--utility); }
.module-reset { flex: 0 0 auto; min-height: 31px; padding: 6px 9px; border: 1px solid #b5c5bf; background: #f9fbfa; color: var(--specimen); font-size: 9px; font-weight: 800; white-space: nowrap; }
.module-reset:hover { border-color: var(--specimen); background: var(--specimen-soft); }
.module-icon { position: relative; width: 35px; height: 35px; flex: 0 0 35px; border: 1px solid var(--blue); border-radius: 50%; }
.structure-icon::before { position: absolute; left: 15px; top: 6px; width: 5px; height: 19px; border: 2px solid var(--blue); border-radius: 4px; content: ""; }
.structure-icon::after { position: absolute; left: 8px; bottom: 6px; width: 19px; height: 4px; background: var(--blue); content: ""; }
.usage-icon { border-color: var(--specimen); }
.usage-icon::before { position: absolute; left: 7px; top: 7px; width: 19px; height: 19px; border: 2px solid var(--specimen); border-radius: 50%; content: ""; }
.usage-icon::after { position: absolute; left: 16px; top: 3px; width: 2px; height: 27px; background: var(--specimen); transform: rotate(42deg); content: ""; }

.part-name-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 7px; padding: 14px; }
.part-name-button { position: relative; min-height: 42px; padding: 7px 6px; border: 1px solid #c4d0cb; background: #f8faf9; font-size: 11px; font-weight: 800; transition: border-color .16s ease, background .16s ease, color .16s ease, transform .16s ease; }
.part-name-button:hover, .part-name-button.active { color: #fff; border-color: var(--blue); background: var(--blue); }
.part-name-button.pulse { animation: control-shake .62s ease both; }
@keyframes control-shake { 0%,100% { transform: translateX(0); } 20% { transform: translateX(-4px); } 40% { transform: translateX(4px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(2px); } }
.structure-readout { display: grid; grid-template-columns: auto 1fr; gap: 3px 11px; margin: 0 14px 14px; padding: 11px 12px; border-left: 3px solid var(--blue); background: var(--blue-soft); }
.structure-readout span { grid-row: 1 / 3; align-self: center; color: var(--blue); font-size: 9px; font-weight: 800; letter-spacing: .08em; writing-mode: vertical-rl; }
.structure-readout strong { font-family: var(--display); font-size: 18px; }
.structure-readout small { color: var(--muted); font-size: 9px; }

.experiment-steps { display: grid; grid-template-columns: repeat(5,1fr); margin: 0; padding: 12px 14px 0; list-style: none; }
.experiment-steps li { position: relative; min-width: 0; }
.experiment-steps li:not(:last-child)::after { position: absolute; z-index: 0; left: 65%; right: -35%; top: 14px; height: 1px; background: #c2ceca; content: ""; }
.experiment-steps button { position: relative; z-index: 1; width: 100%; display: grid; justify-items: center; gap: 4px; padding: 0 2px 8px; border: 0; background: transparent; color: var(--muted); font-size: 10px; font-weight: 800; }
.experiment-steps button span { width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid #aebdb7; border-radius: 50%; background: #f8faf9; color: var(--muted); font: 10px/1 var(--utility); }
.experiment-steps button.active { color: var(--blue); }
.experiment-steps button.active span { border-color: var(--blue); background: var(--blue); color: #fff; box-shadow: 0 0 0 4px rgba(45,111,145,.11); }
.experiment-steps button.complete span { border-color: var(--success); background: var(--success); color: #fff; }
.experiment-steps button.complete i { position: absolute; top: 8px; left: calc(50% + 5px); width: 7px; height: 4px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(-45deg); }
.step-panels { padding: 0 14px 14px; }
.experiment-panel { min-height: 196px; display: grid; align-content: space-between; gap: 13px; padding: 15px 16px; border-top: 1px solid var(--line); background: linear-gradient(145deg, rgba(255,255,255,.75), rgba(232,240,237,.42)); }
.experiment-panel[hidden] { display: none; }
.experiment-copy > span { color: var(--specimen); font: 9px/1 var(--utility); letter-spacing: .16em; }
.experiment-copy h2 { margin: 6px 0 4px; font-family: var(--display); font-size: 18px; letter-spacing: .03em; }
.experiment-copy p { margin: 0; color: #52615c; font-size: 11px; line-height: 1.6; }
.primary-action { min-height: 40px; padding: 8px 15px; border: 1px solid var(--blue); background: var(--blue); color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .03em; }
.primary-action:hover { background: #245d79; }
.dual-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.usage-module .dual-controls, .usage-module .practice-grid { grid-template-columns: 1fr; }
.range-control { display: block; }
.range-control > span { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.range-control b { font-size: 10px; }
.range-control output { color: var(--blue); font: 9px/1 var(--utility); }
input[type="range"] { width: 100%; height: 22px; margin: 0; accent-color: var(--blue); cursor: ew-resize; }
input[type="range"]:disabled { cursor: not-allowed; }
.experiment-feedback { min-height: 33px; display: flex; align-items: center; padding: 7px 9px; color: var(--blue); border-left: 3px solid var(--blue); background: var(--blue-soft); font-size: 10px; font-weight: 800; }
.experiment-feedback.success { color: var(--success); border-color: var(--success); background: #e8f3ef; }
.focus-meter { position: relative; min-height: 35px; display: grid; place-items: center; overflow: hidden; background: #dbe4e0; color: #25453d; font: 9px/1 var(--utility); }
.focus-meter span { position: absolute; inset: 0 auto 0 0; width: 0; background: linear-gradient(90deg, #91b7c8, #72b096); transition: width .15s linear; }
.focus-meter b { position: relative; z-index: 1; }
.focus-objective-block { display: grid; gap: 7px; }
.focus-objective-block > span { color: var(--muted); font-size: 9px; font-weight: 800; }
.focus-targets { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 5px 12px; margin-top: -5px; color: var(--muted); font-size: 9px; }
.focus-targets b { color: var(--specimen); font: 800 10px/1 var(--utility); }
.practice-tools { margin: 0 14px 14px; border-top: 1px solid var(--line); }
.practice-tools summary { padding: 10px 0; color: var(--muted); font-size: 10px; font-weight: 800; cursor: pointer; }
.practice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; padding-bottom: 10px; }
.objective-switch { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.objective-switch button { position: relative; display: grid; justify-items: center; gap: 2px; min-height: 51px; padding: 6px 3px; border: 1px solid #c4d0cb; background: #f8faf9; }
.objective-switch button:hover, .objective-switch button.active { border-color: var(--blue); background: #edf6f9; box-shadow: inset 0 -3px 0 var(--blue); }
.objective-switch i { width: 18px; height: 3px; margin-bottom: 2px; background: currentColor; }
.ring-red { color: #b9322d; }.ring-yellow { color: #d3931d; }.ring-blue { color: #2c69ad; }
.objective-switch b { font: 700 12px/1 var(--utility); }
.objective-switch small { color: var(--muted); font-size: 8px; }
.assembly-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.assembly-actions button { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-height: 42px; padding: 7px 8px; border: 1px solid #c4d0cb; background: #f8faf9; }
.assembly-actions button:hover, .assembly-actions button[aria-pressed="true"] { border-color: var(--blue); background: var(--blue-soft); }
.assembly-actions span { font-size: 10px; font-weight: 700; }
.assembly-actions b { color: var(--blue); font-size: 9px; }
.reset-structure { width: 100%; min-height: 37px; border: 1px solid var(--blue); background: transparent; color: var(--blue); font-size: 10px; font-weight: 800; }
.offline-note { display: flex; align-items: center; justify-content: flex-end; gap: 7px; margin: 10px 3px 0; color: var(--muted); font-size: 9px; line-height: 1.45; }
.offline-note span { width: 6px; height: 6px; flex: 0 0 6px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 3px rgba(45,131,102,.12); }

.drawing-dialog { width: min(920px, calc(100% - 28px)); max-height: calc(100dvh - 28px); overflow: auto; padding: 0; border: 1px solid #9faea8; background: #f7faf8; color: var(--ink); box-shadow: 0 30px 80px rgba(20,31,28,.35); }
.drawing-dialog::backdrop { background: rgba(18,28,26,.58); backdrop-filter: blur(3px); }
.drawing-heading { min-height: 63px; display: flex; align-items: center; justify-content: space-between; padding: 10px 15px; border-bottom: 1px solid var(--line); background: #edf3f0; }
.drawing-heading small, .drawing-heading strong { display: block; }
.drawing-heading small { color: var(--specimen); font: 8px/1 var(--utility); letter-spacing: .14em; }
.drawing-heading strong { margin-top: 4px; font-family: var(--display); font-size: 20px; }
.drawing-heading button { width: 36px; height: 36px; border: 0; background: transparent; color: var(--muted); font-size: 25px; }
.drawing-workspace { display: grid; grid-template-columns: 230px 1fr; gap: 12px; padding: 14px; }
.drawing-workspace figure { margin: 0; }
.drawing-workspace figure img { width: 100%; aspect-ratio: 1; display: block; object-fit: cover; border-radius: 50%; background: #020304; }
.drawing-workspace figcaption { margin-top: 7px; color: var(--muted); font-size: 9px; line-height: 1.5; }
.drawing-board { position: relative; min-height: 330px; overflow: hidden; border: 1px solid #b9c7c2; background: #fff; }
.drawing-board::before {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(84,112,103,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(84,112,103,.06) 1px, transparent 1px);
  background-size: 24px 24px;
  content: "";
}
.drawing-board canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }
.drawing-board > span { position: absolute; right: 9px; bottom: 7px; color: #a7b1ad; font-size: 9px; pointer-events: none; }
.drawing-result { display: block; min-height: 38px; margin: 0 14px; padding: 9px 11px; border-left: 3px solid var(--blue); background: var(--blue-soft); color: var(--blue); font-size: 11px; font-weight: 800; }
.drawing-result.correct { border-color: var(--success); background: #e8f3ef; color: var(--success); }
.drawing-result.wrong { border-color: var(--danger); background: #f6e8e7; color: var(--danger); }
.correct-drawing { display: grid; grid-template-columns: minmax(160px, 270px) 1fr; gap: 14px; align-items: center; margin: 12px 14px 0; padding: 12px; border: 1px solid #b8ccc4; background: #edf6f2; }
.correct-drawing[hidden] { display: none; }
.correct-drawing img { width: 100%; max-height: 210px; display: block; object-fit: contain; background: #fff; }
.correct-drawing figcaption { display: grid; gap: 6px; }
.correct-drawing figcaption b { color: var(--success); font-family: var(--display); font-size: 18px; }
.correct-drawing figcaption span { color: var(--muted); font-size: 10px; line-height: 1.6; }
.drawing-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 14px 14px; }
.drawing-actions > button:not(.primary-action) { min-height: 40px; padding: 8px 15px; border: 1px solid #b7c5c0; background: #f7faf8; font-size: 11px; font-weight: 800; }

@media (max-width: 980px) {
  .lab-layout { grid-template-columns: minmax(0, 1.65fr) minmax(300px, 1fr); }
  .stage-heading { left: 18px; }
  .part-name-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
}
@media (max-width: 720px) {
  .app-shell { width: 100%; padding: 0; }
  .topbar { min-height: 55px; padding: 7px 12px; background: rgba(248,250,249,.96); }
  .lab-layout { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(260px, 1.2fr) minmax(245px, 1fr); gap: 6px; padding-top: 0; }
  .instrument-stage { border-width: 0 0 1px; }
  .stage-heading { top: 9px; left: 12px; right: 90px; }
  .stage-heading h1 { font-size: 15px; }
  .observation-scope { top: 50%; left: 7px; width: 146px; transform: translateY(-50%); }
  .scope-lens { width: 128px; border-width: 5px; }
  .lamp-source { top: 8px; right: 8px; transform: scale(.86); transform-origin: top right; }
  .part-card { margin: 0 10px 10px; }
  .hotspot { padding-right: 6px; font-size: 10px; }
  .specimen-tray { left: 8px; top: 51%; transform: scale(.88) translateX(-15px); transform-origin: left center; }
  .specimen-tray.show { transform: scale(.88) translateX(0); }
  .workbench { display: flex; gap: 6px; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; }
  .desk-module { flex: 0 0 min(88vw, 540px); scroll-snap-align: start; border-left: 0; }
  .part-name-grid { grid-template-columns: repeat(3,1fr); }
  .experiment-steps button { font-size: 9px; }
  .dual-controls, .practice-grid { grid-template-columns: 1fr; }
  .drawing-workspace { grid-template-columns: 1fr; }
  .drawing-workspace figure { display: grid; grid-template-columns: 92px 1fr; align-items: center; gap: 10px; }
  .drawing-workspace figure img { width: 92px; }
  .drawing-board { min-height: 300px; }
  .correct-drawing { grid-template-columns: 1fr; }
}
@media (max-width: 430px) {
  .brand-mark { width: 36px; height: 36px; flex-basis: 36px; }
  .brand strong { font-size: 14px; }
  .lab-layout { grid-template-rows: minmax(235px, 1.05fr) minmax(245px, 1fr); }
  .stage-heading { display: block; left: 12px; right: 86px; }
  .observation-scope { transform: translateY(-50%) scale(.84); transform-origin: left center; }
  .lamp-source { transform: scale(.74); }
  .part-name-grid { padding: 10px; gap: 5px; }
  .part-name-button { min-height: 40px; font-size: 10px; }
  .module-heading { padding: 10px; }
  .module-heading b { font-size: 17px; }
  .module-heading small { max-width: 235px; }
  .step-panels { padding: 0 10px 10px; }
  .experiment-panel { padding: 12px; }
  .drawing-dialog { width: calc(100% - 12px); max-height: calc(100dvh - 12px); }
  .drawing-workspace { padding: 9px; }
  .drawing-board { min-height: 270px; }
  .drawing-actions { padding: 9px; }
}
@media (max-height: 650px) and (min-width: 721px) {
  .lab-layout { grid-template-rows: minmax(0, 1fr); }
  .observation-scope { transform: translateY(-50%) scale(.84); transform-origin: left center; }
  .lamp-source { transform: scale(.82); transform-origin: top right; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
