/* 水果物理实验母版。主题、布局、组件、视口适配。 */
:root {
  color-scheme: dark;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  --bg-deep: #10171b;
  --bg-surface: #161f24;
  --bg-elevated: #202e33;
  --bg-stage-center: #303d49;
  --bg-stage-edge: #11181e;
  --border-subtle: #34434a;
  --border-strong: #536e76;
  --text-primary: #e5eef0;
  --text-secondary: #b6c8cf;
  --text-muted: #94aab4;
  --accent: #a6d6db;
  --accent-soft: #253b40;
  --ray-parallel: #ffb459;
  --ray-center: #86c9f0;
  --ray-focus: #f0d38b;
  --warning: #dfba91;
  --radius-sm: 6px;
  --radius-md: 9px;
  --space-xs: 6px;
  --space-sm: 10px;
  --space-md: 16px;
  --space-lg: 24px;
  --transition-fast: 160ms;
  --transition-panel: 240ms;
  --header-height: 70px;
  --footer-height: 40px;
  --left-width: 192px;
  --right-width: 306px;
  color: var(--text-primary);
  background: var(--bg-deep);
}
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
button, input, select { font: inherit; }
button, select {
  color: var(--text-secondary);
  background: #ffffff04;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  min-height: 38px;
  padding: 8px var(--space-sm);
}
button { cursor: pointer; transition: background var(--transition-fast), border-color var(--transition-fast); }
button:hover:not(:disabled) { background: #ffffff0b; border-color: var(--border-strong); }
button.active, button[aria-pressed="true"], button[aria-selected="true"] {
  color: var(--text-primary);
  border-color: var(--border-strong);
  background: var(--accent-soft);
}
button:disabled, input:disabled { opacity: .42; cursor: default; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
header, footer { padding-inline: var(--space-lg); background: var(--bg-deep); }
header {
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  border-bottom: 1px solid var(--border-subtle);
}
.brand { display: flex; align-items: center; gap: 12px; font-size: 17px; font-weight: 600; letter-spacing: .09em; white-space: nowrap; }
.brand small { display: block; font-size: 11px; font-weight: 400; color: var(--text-muted); letter-spacing: .17em; margin-top: 3px; }
.brand-mark { width: 29px; height: 29px; border: 1px solid var(--border-strong); border-radius: 50%; position: relative; }
.brand-mark::before, .brand-mark::after { content: ""; position: absolute; inset: 3px 9px; border: 1px solid var(--accent); border-radius: 50%; }
.brand-mark::after { inset: 50% -3px auto; border: 0; height: 1px; background: var(--accent); transform: rotate(-22deg); }
h1 { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: .05em; }
h1 span { color: var(--text-muted); font-size: 12px; margin-left: 10px; }
.header-actions { display: flex; gap: var(--space-xs); white-space: nowrap; }
.header-actions button { font-size: 13px; }
.layout {
  display: grid;
  grid-template-columns: var(--left-width) minmax(0, 1fr) var(--right-width);
  height: calc(100dvh - var(--header-height) - var(--footer-height));
  min-height: 0;
  transition: grid-template-columns var(--transition-panel) ease;
}
.layout.is-focused { grid-template-columns: 0px minmax(0, 1fr) 0px; }
.left, .right {
  min-width: 0;
  min-height: 0;
  background: var(--bg-surface);
  transition: opacity var(--transition-fast), visibility var(--transition-panel);
}
.left { width: var(--left-width); padding: 20px var(--space-md); border-right: 1px solid var(--border-subtle); overflow: auto; scrollbar-width: thin; }
.right { width: var(--right-width); padding: var(--space-md); display: flex; flex-direction: column; gap: var(--space-sm); border-left: 1px solid var(--border-subtle); overflow: hidden; }
.is-focused > :is(.left, .right) { opacity: 0; visibility: hidden; pointer-events: none; width: 0; padding-inline: 0; border-inline: 0; }
.eyebrow { margin: 0 0 var(--space-sm); font-size: 12px; font-weight: 600; letter-spacing: .09em; color: var(--text-secondary); }
.vertical, .tool-buttons { display: grid; gap: 4px; }
.vertical, .object-options { margin-bottom: 20px; }
.vertical button, .tool-buttons button, .application-entry { text-align: left; font-size: 14px; }
.vertical button span, .object-options button span { display: block; margin-top: 4px; font-size: 12px; color: var(--text-muted); }
.object-options { display: flex; gap: var(--space-xs); }
.object-options button { flex: 1; min-width: 0; padding-inline: 2px; font-size: 20px; }
.feature-nav { margin-bottom: 14px; }
.tool-buttons button, .application-entry { width: 100%; border-color: transparent; background: transparent; }
.application-entry { margin-top: 4px; }
summary {
  cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between;
  min-height: 36px; padding-block: 8px; gap: var(--space-xs); color: var(--text-secondary); font-size: 13px;
}
summary::-webkit-details-marker { display: none; }
summary::after { content: "＋"; color: var(--text-muted); }
details[open] > summary::after { content: "−"; }
.quick-settings, .advanced { border-top: 1px solid var(--border-subtle); }
.presets { display: grid; gap: 5px; padding: 6px 0 12px; }
.presets button { text-align: left; font-size: 13px; }
.stage-shell { position: relative; min-width: 0; min-height: 0; }
.stage { height: 100%; position: relative; min-width: 0; overflow: hidden; background: radial-gradient(ellipse at 51% 43%, var(--bg-stage-center), var(--bg-stage-edge) 85%); }
.stage canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; touch-action: none; }
.stage::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at 52% 44%, transparent 40%, #070d1448);
}
.bench-readout, .stage-hint, .stage-help, .legend, .application-labels, .load-error { position: absolute; z-index: 1; }
.bench-readout, .stage-hint, .legend, .application-labels { left: var(--space-md); pointer-events: none; }
.bench-readout { top: var(--space-md); display: flex; flex-direction: column; gap: 4px; padding-left: var(--space-sm); border-left: 2px solid var(--accent); font-size: 12px; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.bench-readout b { font-weight: 500; color: var(--text-muted); }
#bench-distances { display: none; }
.stage-hint {
  top: 62px; max-width: calc(100% - 32px); padding: 7px 10px; border: 1px solid var(--border-subtle); border-radius: var(--radius-sm);
  color: var(--text-secondary); background: #10171be8; font-size: 12px; line-height: 1.5;
  opacity: 0; visibility: hidden; transition: opacity var(--transition-panel), visibility var(--transition-panel);
}
.stage-hint.is-visible, .stage-shell:has(.stage-help:is(:hover, :focus-visible)) .stage-hint { opacity: 1; visibility: visible; }
.stage-help { right: var(--space-md); top: var(--space-md); min-height: 28px; width: 28px; padding: 0; border-radius: 50%; background: #10171bd9; }
.legend {
  bottom: var(--space-md); display: flex; flex-wrap: wrap; gap: 9px 14px; padding: 8px 10px;
  border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); background: #10171be8; color: var(--text-secondary); font-size: 12px;
}
.legend span { display: inline-flex; align-items: center; gap: var(--space-xs); }
.legend i { width: 23px; height: 2px; background: var(--ray-color); }
.orange { --ray-color: var(--ray-parallel); }
.blue { --ray-color: var(--ray-center); }
.gold { --ray-color: var(--ray-focus); }
.load-error { top: 40%; inset-inline: 10%; font-size: 14px; color: var(--warning); }
.segments { display: grid; grid-template-columns: 1fr 1fr; flex-shrink: 0; gap: 3px; padding: 3px; border: 1px solid var(--border-subtle); border-radius: var(--radius-md); background: var(--bg-deep); }
.segments button { min-height: 34px; font-size: 13px; border-color: transparent; }
.inspector-scroll { flex: 1; min-height: 0; overflow: auto; scrollbar-width: thin; scrollbar-color: #546c75 transparent; padding: 4px 3px 6px; }
.inspector-scroll::-webkit-scrollbar { width: 4px; }
.inspector-scroll::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }
.parameter { display: block; margin: 0 0 14px; font-size: 14px; }
.parameter-head { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.readout { min-height: 26px; padding: 2px 4px; border: 1px solid transparent; background: transparent; font-size: 13px; font-weight: 600; color: var(--accent); font-variant-numeric: tabular-nums; white-space: nowrap; }
.readout:hover:not(:disabled) { text-decoration: underline dashed; text-underline-offset: 4px; }
.number-editor { width: 88px; min-height: 26px; text-align: right; padding: 2px 4px; color: var(--accent); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--bg-deep); font-size: 13px; font-variant-numeric: tabular-nums; }
input[type="range"] {
  --slot: #0d1519;
  --track: linear-gradient(to right, var(--accent) var(--range-fill, 0%), var(--slot) var(--range-fill, 0%));
  --knob: radial-gradient(circle at 33% 25%, #f2fbfc, #a9bdc4 52%, #657b83);
  appearance: none; width: 100%; display: block; height: 24px; margin: 2px 0 0;
  background: transparent; cursor: pointer; border-radius: var(--radius-sm);
}
input[type="range"]::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: var(--track); box-shadow: inset 0 0 0 1px #b6ccd42b; }
input[type="range"]::-moz-range-track { height: 4px; border-radius: 4px; background: var(--slot); box-shadow: inset 0 0 0 1px #b6ccd42b; }
input[type="range"]::-moz-range-progress { height: 4px; border-radius: 4px; background: var(--accent); }
input[type="range"]::-webkit-slider-thumb {
  appearance: none; width: 14px; height: 14px; margin-top: -5px; border-radius: 50%;
  border: 1px solid var(--accent); background: var(--knob); box-shadow: 0 0 7px #a6d6db4d; transition: transform var(--transition-fast);
}
input[type="range"]::-moz-range-thumb {
  width: 12px; height: 12px; border-radius: 50%;
  border: 1px solid var(--accent); background: var(--knob); box-shadow: 0 0 7px #a6d6db4d; transition: transform var(--transition-fast);
}
input[type="range"]:enabled:hover::-webkit-slider-thumb { transform: scale(1.14); }
input[type="range"]:enabled:hover::-moz-range-thumb { transform: scale(1.14); }
.switch { display: flex; align-items: center; justify-content: space-between; gap: var(--space-sm); min-height: 37px; margin-block: 6px; font-size: 13px; }
.switch input {
  appearance: none; flex: 0 0 35px; width: 35px; height: 19px; margin: 0;
  position: relative; background: var(--bg-deep); border: 1px solid var(--border-strong); border-radius: 20px; cursor: pointer;
  transition: background var(--transition-fast);
}
.switch input::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 13px; height: 13px; border-radius: 50%;
  background: #9aafb7; transition: transform var(--transition-fast), background var(--transition-fast);
}
.switch input:checked { background: var(--accent); }
.switch input:checked::after { transform: translateX(16px); background: #233a40; }
select { width: 100%; margin-top: 8px; background: var(--bg-elevated); font-size: 13px; }
.wide { width: 100%; font-size: 13px; }
#focus-screen { background: var(--accent-soft); border-color: var(--border-strong); }
.micro { margin: 8px 0 12px; color: var(--text-muted); font-size: 13px; line-height: 1.7; }
.context-heading { display: flex; align-items: center; justify-content: space-between; gap: var(--space-xs); }
.context-heading .eyebrow { margin: 0; font-size: 14px; }
.context-heading button { padding: 3px 7px; min-height: 28px; font-size: 12px; }
.tool-panel > .eyebrow { display: none; }
.fixed-actions { display: flex; gap: var(--space-xs); margin-block: var(--space-sm); }
.fixed-actions button { flex: 1; padding-inline: 5px; font-size: 13px; }
#center-screen { margin-top: 8px; }
.fixed-records { font-size: 12px; line-height: 1.8; color: var(--text-secondary); }
.fixed-records p { margin: 0; padding: 8px 0; border-top: 1px solid var(--border-subtle); }
.application-regime { font-size: 13px; line-height: 1.7; color: var(--text-secondary); }
.application-regime[data-regime="outside"] { color: var(--warning); }
#application-comparison { white-space: pre-line; border-left: 2px solid var(--accent); padding-left: 10px; }
.application-labels { bottom: 60px; display: flex; gap: 6px; font-size: 12px; color: var(--text-secondary); }
.data { flex-shrink: 0; padding: 13px 14px; border: 1px solid var(--border-subtle); border-radius: var(--radius-md); background: var(--bg-elevated); }
.data .eyebrow { margin-bottom: 5px; }
.nature { margin: 0 0 10px; font-size: 18px; font-weight: 600; }
dl { display: grid; grid-template-columns: 1fr auto; gap: 5px; font-size: 13px; margin: 0; }
dt { color: var(--text-secondary); }
dd { margin: 0; font-variant-numeric: tabular-nums; text-align: right; }
.data .micro { margin: 8px 0 0; padding-top: 7px; border-top: 1px solid var(--border-subtle); }
footer { height: var(--footer-height); display: flex; align-items: center; gap: var(--space-sm); border-top: 1px solid var(--border-subtle); color: var(--text-secondary); font-size: 12px; }
.status-dot { width: 5px; height: 5px; flex-shrink: 0; border-radius: 50%; background: var(--accent); }
.footer-note { margin-left: auto; color: var(--text-muted); white-space: nowrap; }
.explanation-wrap { max-width: 1100px; margin: 0 auto; padding: 18px 24px 28px; }
.explanation-wrap > summary { font-size: 12px; color: #90a9b8; }
.explanation { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 44px; padding: 10px 0; }
.explanation h2 { font-size: 13px; font-weight: 500; color: #aec4d1; }
.explanation p { font-size: 13px; line-height: 1.9; color: #899eab; }
@media (max-width: 1100px) {
  :root { --left-width: 155px; --right-width: 255px; }
}
@media (max-width: 820px) {
  :root { --header-height: 60px; }
  header, footer { padding-inline: 12px; }
  header { gap: 5px; }
  .brand { font-size: 14px; }
  .brand-mark { display: none; }
  h1 { font-size: clamp(13px, 4vw, 17px); letter-spacing: 0; }
  .header-actions button { font-size: 11px; padding: 5px; }
  .layout { display: flex; flex-direction: column; height: auto; }
  .stage { height: max(300px, 47svh); }
  .stage-notes {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) 16px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-subtle);
  }
  .stage-notes > * { position: static; }
  .stage-help { flex: 0 0 28px; }
  .stage-hint:not(.is-visible) { display: none; }
  .stage-notes .stage-hint { order: 1; flex-basis: 100%; max-width: none; }
  .stage-notes .legend { order: 2; }
  .stage-notes .application-labels { order: 3; }
  .stage-hint, .legend { font-size: 11px; }
  .legend i { width: 15px; }
  .left, .right { width: 100%; border-inline: none; padding: 14px 16px; }
  .left { order: 2; }
  .right { order: 1; }
  .is-focused > :is(.left, .right) { display: none; }
  .is-focused > .stage-shell > .stage { height: calc(100svh - var(--header-height) - var(--footer-height)); }
  .vertical, .tool-buttons { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .object-options { max-width: 240px; }
  .inspector-scroll { flex: none; overflow: visible; }
  .footer-note { display: none; }
  .explanation-wrap { padding: 14px 16px 24px; }
  .explanation { grid-template-columns: 1fr; gap: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  :root { --transition-fast: 0ms; --transition-panel: 0ms; }
}

/* Shared navigation, reading colors and experiment directory. */
:root {
  --font-serif: Georgia, "Times New Roman", serif;
  --text-reading: #f0d38b;
  --panel-glass: #202e33ba;
}
.brand { color: inherit; text-decoration: none; }
.brand:hover { color: var(--accent); }
h1 > span[lang="en"] {
  font-family: var(--font-serif);
  font-size: 14px;
  font-style: italic;
  font-weight: 400;
}
.readout, .number-editor, .parameter-head output, .data dd { color: var(--text-reading); }
.data, .experiment-card {
  background: var(--panel-glass);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.home-main {
  width: min(100% - 48px, 1040px);
  margin-inline: auto;
  padding-block: clamp(48px, 10vw, 112px);
}
.home-heading h1 {
  font-size: clamp(32px, 7vw, 62px);
  line-height: 1.12;
}
.home-heading h1 > span[lang="en"] {
  display: block;
  margin: 12px 0 0;
  font-size: clamp(18px, 3vw, 26px);
}
.lab-directory { margin-top: clamp(32px, 6vw, 64px); }
.lab-directory > h2 { margin: 0 0 14px; font-size: 16px; font-weight: 600; }
.lab-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: var(--space-md);
}
.experiment-card {
  display: grid;
  gap: 12px;
  padding: clamp(20px, 4vw, 32px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  text-decoration: none;
  transition: background var(--transition-fast), border-color var(--transition-fast);
}
.experiment-card:hover { border-color: var(--accent); background: var(--accent-soft); }
.experiment-card h3 { margin: 0; font-size: 23px; }
.experiment-card p { margin: 0; color: var(--text-secondary); line-height: 1.75; }
.experiment-card .card-action { margin-top: 8px; color: var(--accent); font-size: 14px; }

@media (max-width: 820px) {
  .home-main { width: min(100% - 32px, 1040px); }
  .lab-header {
    height: auto;
    min-height: var(--header-height);
    flex-wrap: wrap;
    column-gap: 12px;
    row-gap: 8px;
    padding-block: 8px;
  }
  .lab-header h1 > span[lang="en"] {
    display: block;
    margin: 3px 0 0;
    font-size: 12px;
  }
}

/* Lens and beam experiment */
.beam-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(280px, 28vw, 340px);
  grid-template-rows: auto minmax(0, 1fr);
  height: calc(100dvh - var(--header-height));
  min-height: 440px;
}
.beam-lab #modules {
  grid-column: 1 / -1;
  min-width: 0;
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-surface);
}
.beam-lab #moduleButtons {
  display: flex;
  gap: var(--space-xs);
  overflow-x: auto;
  scrollbar-width: thin;
  padding: 4px;
}
.beam-lab #moduleButtons button { flex-shrink: 0; font-size: 12px; }
.beam-lab :is(#moduleButtons button, #convex, #concave, #real, #model, #book).active,
.beam-lab #stageBadge {
  color: var(--text-primary);
  border-color: var(--border-strong);
  background: var(--accent-soft);
}
.beam-lab #stageBadge {
  justify-self: start;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 3px var(--space-xs);
}
.beam-stage {
  position: relative;
  min-width: 0;
  min-height: 0;
  clip-path: inset(0);
  background: radial-gradient(ellipse at 46% 43%, #1b2734, #0d151e 85%);
}
.beam-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(ellipse at 52% 44%, transparent 40%, #070d1448);
}
.beam-lab #scene { display: block; width: 100%; height: 100%; touch-action: none; }
.beam-lab #labels { position: fixed; inset: 0; z-index: 2; pointer-events: none; }
.beam-lab .tag {
  position: absolute;
  padding: 2px 5px;
  transform: translate(-50%, -50%);
  border: 1px solid #a6d6db32;
  border-radius: 4px;
  background: #10171b80;
  color: var(--text-primary);
  white-space: nowrap;
  font-size: 11px;
  line-height: 1.25;
  text-shadow: 0 1px 3px #10171b;
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}
.beam-lab :is(#label_source, #label_lens, #label_f) {
  background: #10171b55;
  border-color: #a6d6db21;
  font-size: 10.5px;
  padding: 1px 4px;
}
.beam-lab :is(#label_source, #label_lens, #label_f)::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  height: 6px;
  border-left: 1px solid currentColor;
  opacity: .30;
}
.beam-lab #label_f::after { top: auto; bottom: 100%; }
.beam-lab .tag.focus { color: var(--text-reading); }
.beam-lab .tag.virtual { border-style: dashed; color: var(--ray-center); }
.beam-lab .tag.focus.red { color: #f0a49a; }
.beam-lab .tag.focus.blue { color: #aec8ff; }
.beam-lab .tag.focus.green { color: #b8e1bc; }
.beam-lab .tag.draggable { pointer-events: auto; cursor: ew-resize; touch-action: none; }
.beam-lab #label_block { cursor: ns-resize; }
.beam-lab .error {
  display: none;
  position: absolute;
  z-index: 3;
  inset: 20% var(--space-md) auto;
  padding: var(--space-md);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  color: var(--warning);
}
.beam-inspector {
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  padding: var(--space-md);
  border-left: 1px solid var(--border-subtle);
  background: var(--bg-surface);
}
.beam-module { padding-bottom: var(--space-md); border-bottom: 1px solid var(--border-subtle); }
.beam-module h2 { margin: 0; font-size: 20px; }
.beam-module p { margin: var(--space-xs) 0; font-size: 13px; line-height: 1.6; color: var(--text-secondary); }
.beam-lab #progress { display: grid; gap: 4px; margin-top: var(--space-sm); font-size: 12px; color: var(--accent); }
.beam-lab #progress small { color: var(--text-muted); font-size: 12px; }
.beam-lab #controls h2 { margin: var(--space-md) 0 var(--space-sm); font-size: 13px; color: var(--text-secondary); }
.beam-lab #controls :is(label, details, .quality) { font-size: 13px; color: var(--text-secondary); }
.beam-lab #controls label { display: block; margin-block: var(--space-sm) 4px; line-height: 1.6; }
.beam-lab #controls label.switch { display: flex; cursor: pointer; }
.beam-lab #controls .switch input[type="checkbox"] { margin-inline: 0; }
.beam-lab #controls label b { float: right; color: var(--text-reading); font-variant-numeric: tabular-nums; }
.beam-lab #controls input[type="checkbox"] { accent-color: var(--accent); margin-inline: 0 6px; }
.beam-lab #controls button { font-size: 12px; }
.beam-lab #controls :is(button.wide, details, .quality, .applications) { margin-top: var(--space-sm); }
.beam-lab #controls details a { color: var(--accent); }
.beam-lab .row, .beam-lab .quality { display: flex; gap: var(--space-xs); }
.beam-lab .row { flex-wrap: wrap; }
.beam-lab .row button { flex: 1 0 auto; }
.beam-lab .quality { align-items: center; }
.beam-lab .quality span { margin-right: auto; }
.beam-lab .library { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-xs); }
.beam-lab .library button { padding-inline: 3px; }
.beam-lab .library svg { display: block; width: 100%; height: 46px; }
.beam-lab .scale { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-muted); }
.beam-lab .readout {
  display: flex;
  justify-content: space-between;
  gap: var(--space-sm);
  margin-top: var(--space-md);
  padding: var(--space-sm);
  border-color: var(--border-subtle);
  background: var(--panel-glass);
  white-space: normal;
}
.beam-lab .readout span { display: block; font-size: 11px; color: var(--text-secondary); }
.beam-lab .readout strong { display: block; margin-top: 4px; font-size: 18px; }
.beam-lab #effect { font-size: 15px; }
.beam-lab .spectralRamp {
  height: 4px;
  border-radius: 4px;
  background: linear-gradient(90deg, #702aff, #005cff, #1accc6, #58cf44, #e2d14e, #e98935, #c64335);
}
.beam-lab .comparison {
  margin-top: var(--space-sm);
  padding: var(--space-sm);
  border-radius: var(--radius-sm);
  background: var(--bg-deep);
  color: var(--text-secondary);
  font-size: 11px;
}
.beam-lab .comparison table { width: 100%; border-collapse: collapse; }
.beam-lab .comparison :is(td, th) { padding: 5px 2px; text-align: left; }
.beam-lab .comparison svg { display: block; width: 100%; height: 62px; }
.beam-lab #info {
  position: fixed;
  z-index: 2;
  left: var(--space-md);
  bottom: var(--space-md);
  width: min(360px, 39vw);
  max-height: 32dvh;
  overflow: auto;
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--panel-glass);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.beam-lab #handle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: grab;
  touch-action: none;
  user-select: none;
  font-size: 12px;
  color: var(--text-secondary);
}
.beam-lab #handle button { min-height: 30px; padding: 3px 9px; }
.beam-lab #info.collapsed #infobody { display: none; }
.beam-lab #conclusion { margin-block: var(--space-xs); font-size: 15px; color: var(--text-reading); }
.beam-lab #explain, .beam-lab #hint { font-size: 12px; line-height: 1.65; color: var(--text-secondary); }
.beam-lab .legend {
  position: static;
  padding: 0;
  background: transparent;
  border: 0;
}
.beam-lab .legend i { background: var(--text-reading); }
.beam-lab .legend i.dash { background: none; border-top: 2px dashed var(--ray-center); }
.beam-lab :is(#focusZoom, #screenPreview) {
  margin-top: var(--space-sm);
  padding-top: var(--space-xs);
  border-top: 1px solid var(--border-subtle);
}
.beam-lab #focusZoom svg { display: block; width: 100%; height: 65px; }
.beam-lab #screenPreview { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-xs); }
.beam-lab #screenPreview > :first-child { flex-basis: 100%; }
.beam-lab #screenZoom { width: 80px; height: 80px; border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); }

@media (max-width: 820px) {
  .beam-layout { display: flex; flex-direction: column; height: auto; min-height: 0; }
  .beam-stage { order: -1; height: max(300px, 47svh); }
  .beam-inspector { overflow: visible; border-left: 0; }
  .beam-lab #info { position: static; width: 100%; max-height: none; margin-block: var(--space-md); }
  .beam-lab #handle { cursor: auto; touch-action: auto; }
  .beam-lab .beam-drag-hint { display: none; }
}

@media (max-width: 480px) {
  .beam-lab #label_source { transform: translate(-50%, calc(-50% - 22px)); }
}
