body.molecular-study-embedded .stage-column,
body.molecular-study-embedded .controls-panel { display: none !important; }
body.molecular-study-embedded .lab-layout { display: block; height: auto; min-height: 0; }
.molecular-study-host {
  /* 与动物细胞结构的生物学控制台使用同一组墨绿主题色。 */
  --study-accent: var(--accent, #1a4735);
  --study-panel: var(--bg, #e6f0ea);
  --study-soft: var(--accent-dark, #d0e2d7);
  --study-muted: #4a6657;
  --study-line: #bfd3c7;
  --study-track: #b5ccbe;
  --study-paper: #ffffffa6;
  min-width: 0;
  overflow: hidden;
  border-radius: 9px;
  background: var(--study-panel);
  color: var(--study-accent);
  color-scheme: light;
}
@scope (.molecular-study-host) {
  * { box-sizing: border-box; }
  [hidden] { display: none !important; }
  button, select, textarea { font: inherit; }
  button { border: 1px solid var(--study-line); border-radius: 7px; background: var(--study-paper); color: var(--study-accent); padding: 10px 12px; font-size: 13px; cursor: pointer; min-height: 38px; }
  button:hover:not(:disabled) { border-color: var(--study-accent); background: #fff; }
  button[aria-pressed="true"] { border-color: var(--study-accent); background: var(--study-soft); color: var(--study-accent); }
  button:disabled { opacity: .4; cursor: default; }
  button:focus-visible, canvas:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--study-accent); outline-offset: 3px; }
  .study-layout { display: grid; grid-template-columns: minmax(0, 1fr) 325px; grid-template-rows: minmax(0, 1fr); height: clamp(690px, calc(100dvh - 150px), 940px); min-height: 0; overflow: hidden; }
  .study-stage-column { display: grid; grid-template-rows: auto minmax(0, 1fr); height: 100%; min-width: 0; min-height: 0; overflow: hidden; }
  .study-stage { --study-accent: #b5d3c4; position: relative; min-width: 0; min-height: 0; overflow: hidden; color: #e6eee9; background: radial-gradient(ellipse at 50% 44%, #141511 0%, #020405 75%); color-scheme: dark; }
  .study-stage button:not(.study-label) { background: #1b2c25; border-color: #72937c66; color: #d3e3da; }
  .study-stage button:hover:not(:disabled, .study-label) { background: #284235; border-color: var(--study-accent); }
  .study-stage button[aria-pressed="true"]:not(.study-label) { background: #274738; border-color: var(--study-accent); color: #f1f8f4; }
  .study-canvas, .study-fallback { display: block; width: 100%; height: 100%; position: absolute; inset: 0; touch-action: none; }
  .study-canvas { cursor: grab; }
  .study-canvas:active { cursor: grabbing; }
  .study-fallback { pointer-events: none; }
  .study-heading { position: absolute; top: 25px; left: 28px; right: 28px; pointer-events: none; max-width: 590px; }
  .study-eyebrow { color: #b5d3c4; font-size: 11px; letter-spacing: .05em; }
  .study-heading h2 { font-size: 23px; font-weight: 500; margin: 8px 0 10px; color: #f1f5f3; }
  .study-heading small { display: block; color: #a7b9af; font-size: 11px; margin-top: 10px; min-height: 18px; font-variant-numeric: tabular-nums; }
  .study-toolbar { position: absolute; left: 16px; right: 16px; bottom: 16px; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; }
  .study-toolbar button { padding: 7px 10px; min-height: 34px; font-size: 12px; }
  .study-toolbar span { width: 100%; text-align: center; font-size: 11px; color: #a7b9af; }
  .study-direct { position: absolute; left: max(18px, calc((100% - 560px) / 2)); right: max(18px, calc((100% - 560px) / 2)); bottom: 88px; }
  .study-direct-buttons { display: flex; justify-content: center; gap: 8px; }
  .study-direct-buttons button { flex: 1; min-width: 0; max-width: 276px; line-height: 1.4; }
  .study-stage .study-direct-buttons .study-primary { border-color: #87b59c; background: #1a4735; color: #fff; }
  .study-scrub { display: grid; grid-template-columns: 112px minmax(0, 1fr) 44px; align-items: center; gap: 10px; min-height: 30px; margin-bottom: 6px; color: #d3e3da; font-size: 12px; }
  .study-scrub input { width: 100%; min-width: 0; height: 28px; margin: 0; accent-color: var(--study-accent); cursor: ew-resize; }
  .study-scrub output { text-align: right; font-variant-numeric: tabular-nums; }
  .study-sidebar { overflow-y: auto; overflow-x: hidden; min-height: 0; height: 100%; padding: 20px; background: var(--study-panel); border-left: 1px solid var(--study-line); overscroll-behavior: contain; scrollbar-gutter: stable; scrollbar-width: thin; scrollbar-color: var(--study-track) transparent; }
  .study-sidebar p, .study-sidebar li { font-size: 13px; line-height: 1.8; color: var(--study-muted); }
  .study-sidebar h3 { font-size: 16px; font-weight: 500; margin: 16px 0 10px; color: var(--study-accent); }
  .study-sidebar h4 { font-size: 14px; color: var(--study-accent); margin: 14px 0 8px; font-weight: 500; }
  .study-sidebar summary { color: var(--study-accent); font-size: 13px; cursor: pointer; margin: 8px 0; }
  .study-step { position: relative; z-index: 10; min-width: 0; padding: 10px 20px 8px; background: #f3f7f3; color: var(--study-accent); border-bottom: 1px solid var(--study-line); }
  .study-meta { position: relative; display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; font-size: 14px; font-variant-numeric: tabular-nums; }
  .study-meta > strong { white-space: nowrap; }
  .study-meta [data-ui="step-number"] { color: #477664; min-width: 46px; }
  .study-mode { margin-left: auto; font-size: 12px; color: #627e72; }
  .study-purpose { flex: none; }
  .study-purpose summary { padding: 5px 0 5px 8px; font-size: 13px; color: #315b4d; cursor: pointer; }
  .study-workflow-content { position: absolute; z-index: 20; top: calc(100% + 8px); right: 0; width: min(620px, 100%); max-height: min(42dvh, 320px); overflow: auto; overscroll-behavior: contain; scrollbar-gutter: stable; padding: 14px 20px; background: #f8fbf8; color: #365449; border: 1px solid #b7ccbf; border-radius: 8px; box-shadow: 0 12px 28px #10261c26; }
  .study-workflow-content p { font-size: 13px; line-height: 1.7; margin: 6px 0 12px; }
  .study-workflow-content ol { margin: 12px 0 0; padding-left: 24px; }
  .study-workflow-content li { padding: 8px 4px; font-size: 13px; border-top: 1px solid #dbe5df; }
  .study-workflow-content li p { margin: 3px 0 0; color: #5b7468; }
  .study-workflow-content li.completed > strong::after { content: ' · 已完成'; font-size: 11px; font-weight: 400; color: #537b66; }
  .study-workflow-content [aria-current="step"] { color: #174b34; border-left: 3px solid #3b8963; padding-left: 10px; background: #e9f2eb; }
  .study-step progress { display: block; width: 100%; height: 3px; margin: 4px 0 8px; accent-color: #4b9475; }
  .study-step-current { display: flex; align-items: center; gap: 16px; }
  .study-instruction { flex: 1; min-width: 0; }
  .study-step h3 { margin: 0; font-size: 17px; line-height: 1.4; color: #234b3c; }
  .study-instruction p { margin: 4px 0 0; max-height: 70px; overflow-y: auto; font-size: 14px; line-height: 1.6; color: #3d5f50; }
  .study-step .study-primary { flex: none; width: auto; max-width: 190px; min-height: 36px; padding: 8px 12px; line-height: 1.5; }
  .study-step-status { display: flex; align-items: start; gap: 12px; margin-top: 4px; }
  .study-checklist { display: flex; flex: 1; gap: 12px; min-width: 0; overflow-x: auto; list-style: none; padding: 0; margin: 0; color: #5b7468; }
  .study-checklist li { flex: none; font-size: 12px; line-height: 1.7; }
  .study-checklist li[data-done="true"] { color: #28724d; }
  .study-step .study-condition { flex: none; min-width: 130px; max-width: 40%; margin: 0; font-size: 12px; line-height: 1.7; color: #527465; text-align: right; font-variant-numeric: tabular-nums; }
  .study-step .study-feedback { margin: 4px 0 0; max-height: 44px; overflow-y: auto; font-size: 12px; line-height: 1.7; color: #446657; }
  .study-feedback:empty, .study-checklist:empty { display: none; }
  .study-step :is(button, summary, .study-workflow-content):focus-visible { outline: 2px solid #27744f; outline-offset: 3px; }
  .study-results-title { margin: 0 0 12px; font-size: 17px; color: var(--study-accent); }
  .study-review { border-top: 1px solid var(--study-line); padding-top: 8px; }
  .study-review > div { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  .study-review p { font-size: 12px; }
  .study-primary { width: 100%; background: var(--study-accent); border-color: var(--study-accent); color: #fff; }
  .study-primary:hover:not(:disabled) { background: var(--study-accent); color: #fff; filter: brightness(1.09); }
  .study-inspector { border-block: 1px solid var(--study-line); padding: 4px 0 12px; margin: 10px 0 15px; }
  .study-inspector p { min-height: 70px; }
  .study-parts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  .study-parts button { font-size: 12px; padding: 8px 4px; }
  .study-match, .study-note { display: block; color: var(--study-accent); font-size: 12px; line-height: 1.7; margin: 14px 0; }
  .study-match select, .study-note textarea { display: block; margin-top: 6px; width: 100%; min-width: 0; }
  select, textarea { border: 1px solid var(--study-line); border-radius: 6px; background: var(--study-paper); color: var(--study-accent); font-size: 12px; padding: 9px; }
  textarea::placeholder { color: var(--study-muted); opacity: .8; }
  textarea { resize: vertical; max-height: 180px; }
  .study-speed { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--study-muted); margin: 16px 0; }
  .study-result { border-top: 1px solid var(--study-line); padding-top: 8px; }
  .study-result ol { padding-left: 22px; }
  .study-result li { margin-bottom: 13px; overflow-wrap: anywhere; }
  .study-result button { width: 100%; margin: 12px 0; }
  .study-labels, .study-labels svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
  .study-labels polyline { fill: none; stroke: #fff; stroke-width: 1; opacity: .75; }
  .study-labels circle { fill: #fff; }
  .study-label { position: absolute; transform: translateY(-50%); pointer-events: auto; color: #e6eee9; background: transparent !important; border: 0 !important; border-radius: 0; padding: 3px 0; box-shadow: none; text-shadow: 0 1px 4px #000; font-size: 13px; line-height: 1.6; min-height: 42px; }
  .study-shell { padding-bottom: 16px; margin-bottom: 12px; border-bottom: 1px solid var(--study-line); }
  .study-shell .controls-heading { display: flex; flex-direction: column; align-items: stretch; padding: 0; margin: 0 0 12px; border: 0; gap: 8px; }
  .study-shell .controls-heading h2 { color: var(--study-accent); font-size: 13px; margin: 0; }
  .study-shell .learning-entries { display: flex; gap: 6px; flex-wrap: wrap; }
  .study-shell .learning-entry { flex: 1; padding: 8px 4px; font-size: 12px; border: 1px solid var(--study-line) !important; background: var(--study-soft) !important; color: var(--study-accent) !important; }
  .study-shell .learning-entry:hover { background: #fff !important; border-color: var(--study-accent) !important; }
  .study-shell .playback { display: block; border: 0; margin: 0; padding: 0; }
  .study-shell #demo { width: 100%; background: var(--study-accent) !important; border-color: var(--study-accent) !important; color: #fff !important; }
  .study-shell .transport { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
  .study-shell .transport .btn { background: var(--study-paper) !important; color: var(--study-muted) !important; border: 1px solid var(--study-line) !important; }
  .study-shell .transport .btn:hover:not(:disabled) { border-color: var(--study-accent) !important; }
  @media(max-width: 1100px) {
    .study-layout { grid-template-columns: minmax(0, 1fr) 310px; }
    .study-sidebar { padding: 15px; }
    .study-heading { left: 20px; right: 20px; }
    .study-heading h2 { font-size: 20px; }
    .study-step { padding-inline: 14px; }
    .study-step-current { gap: 10px; }
    .study-step .study-primary { max-width: 125px; font-size: 12px; padding: 8px; }
    .study-instruction p { font-size: 13px; }
    .study-meta { gap: 6px; font-size: 13px; }
    .study-mode { font-size: 11px; }
    .study-step-status { flex-wrap: wrap; gap: 4px; }
    .study-step .study-condition { margin-left: auto; max-width: 100%; }
  }
  @media(max-width: 650px) {
    .study-layout { display: flex; flex-direction: column; height: auto; }
    .study-stage-column { flex: none; height: auto; grid-template-rows: auto 620px; }
    .study-stage { height: 620px; flex: none; }
    .study-sidebar { height: 70dvh; max-height: 70dvh; flex: none; border-left: 0; border-top: 1px solid var(--study-line); }
    .study-toolbar span { width: 100%; text-align: center; }
    .study-step { padding: 8px 12px; }
    .study-step-current { flex-wrap: wrap; }
    .study-instruction { flex-basis: 100%; }
    .study-step .study-primary { max-width: 100%; }
    .study-label { font-size: 12px; }
    .study-toolbar { gap: 4px; }
    .study-toolbar button { padding: 7px 8px; font-size: 11px; }
    .study-scrub { grid-template-columns: 90px minmax(0, 1fr) 36px; gap: 7px; font-size: 11px; }
  }
}

body.phone-lab .molecular-study-host { height: 100%; min-height: 0; }
body.phone-lab .molecular-study-host .study-layout {
  display: grid; grid-template-columns: minmax(0, 1fr) var(--bio-sidebar);
  grid-template-rows: minmax(0, 1fr); height: 100%; min-height: 0;
}
body.phone-lab .study-stage-column { height: 100%; grid-template-rows: auto minmax(0, 1fr); }
body.phone-lab .study-stage { height: 100%; min-height: 0; }
body.phone-lab .study-sidebar { height: 100%; max-height: none; padding: 8px; overflow-y: auto; }
body.phone-lab .study-step { padding: 4px 10px; }
body.phone-lab .study-heading { top: 5px; left: 10px; }
body.phone-lab .study-heading h2 { font-size: 14px; margin: 0; }
body.phone-lab .study-eyebrow, body.phone-lab .study-heading small, body.phone-lab .study-toolbar span { display: none; }
body.phone-lab .study-sidebar :is(.study-toolbar,.study-direct) { position: static; transform: none; width: auto; margin: 6px 0; }
body.phone-lab .study-sidebar .study-scrub { grid-template-columns: 1fr 38px; }
body.phone-lab .study-sidebar .study-scrub label { grid-column: 1 / -1; }
body.phone-lab .study-sidebar .study-step-status { display: block; color: var(--study-accent); }
body.phone-lab .study-sidebar :is(.study-condition,.study-feedback) { font-size: 12px; line-height: 1.45; }
body.phone-lab .study-sidebar .study-checklist { flex-wrap: wrap; gap: 2px 8px; }
body.phone-lab .study-sidebar .study-checklist li { flex-shrink: 1; }
body.phone-lab .study-sidebar .study-scrub { color: var(--study-accent); }
body.phone-lab .study-step progress { margin: 2px 0; }
body.phone-lab .study-step h3 { font-size: 15px; }
body.phone-lab .study-instruction p { margin-top: 1px; line-height: 1.4; max-height: 2.8em; }
body.phone-lab .study-step-current { flex-wrap: nowrap; gap: 8px; }
body.phone-lab .study-step-current .study-instruction { flex: 1; }
