/* 现象画面：深色观察窗里的器材和现象。先画"之前"，.run 后播放；.final 直接停在最后（观察窗、放大镜）。 */
.scene .bench { stroke: #4b5c55; stroke-width: 2; }
.scene .glass { fill: none; stroke: #e8e2d2; stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
.scene.unclear .fx { opacity: .55; }
/* 焰色不靠淡化表示"说不准"（深色窗上调淡会变成发灰发褐的一团）：颜色照旧不透明，靠小一号、一闪即逝、钴玻璃里的问号和窗外虚线框 */
.scene.flame.unclear .fx { opacity: 1; }
.scene .liquid { fill: var(--from); fill-opacity: var(--fop); transition: fill 1s .45s, fill-opacity 1s .45s; }
.scene.run .liquid { fill: var(--to); fill-opacity: var(--top); }
/* 浑浊：从落点像云一样散开（乳白 #eeeae2） */
.scene .cloud { fill: #eeeae2; opacity: 0; transform: scale(.06); transform-box: view-box; transform-origin: 160px 64px; transition: transform 1s .5s ease-out, opacity .35s .5s; }
.scene.run .cloud { transform: scale(1); opacity: var(--op); }
.scene .sediment { fill: #f4f1ea; opacity: 0; transition: opacity .6s 1s; }
.scene.run .sediment { opacity: 1; }
.scene .bubble { fill: rgba(255, 255, 255, .25); stroke: #fff; stroke-width: 1.2; opacity: 0; }
.scene.run .bubble { animation: rise 1s ease-in infinite; }
@keyframes rise { 0% { transform: translateY(0); opacity: 0; } 15% { opacity: 1; } 100% { transform: translateY(-40px); opacity: 0; } }
.scene .foam { fill: #f4f1ea; opacity: 0; transition: opacity .3s .5s; }
.scene.run .foam { opacity: .95; }
.scene .powder circle { fill: #fff; stroke: #c9c2b1; stroke-width: 1; }
.scene .powder { opacity: 0; }
.scene.run .powder { animation: fall .6s ease-in both; }
@keyframes fall { from { transform: translateY(0); opacity: 1; } to { transform: translateY(54px); opacity: 0; } }
.scene .drop { opacity: 0; }
.scene.run .drop { animation: drip .5s .25s ease-in both; }
@keyframes drip { from { transform: translateY(0); opacity: 1; } to { transform: translateY(32px); opacity: 0; } }
.scene .heat path { fill: none; stroke: #ff8a5c; stroke-width: 2.4; opacity: 0; }
.scene.run .heat path { animation: waver 1.2s .5s ease-in-out infinite; }
@keyframes waver { 0% { opacity: 0; transform: translateY(6px); } 40% { opacity: .95; } 100% { opacity: 0; transform: translateY(-10px); } }
.scene .lamp { fill: #c9d3d6; fill-opacity: .9; stroke: #e8e2d2; stroke-width: 2; }
.scene .wick { stroke: #e8e2d2; stroke-width: 2.5; }
.scene .lampflame { fill: #8db8e8; opacity: .9; }
.scene.run .lampflame { animation: flicker .18s infinite alternate; transform-box: fill-box; transform-origin: 50% 100%; }
@keyframes flicker { from { transform: scaleY(1); } to { transform: scaleY(1.08) scaleX(.95); } }
.scene .solid { fill: var(--from); stroke: #b9b2a2; stroke-width: 1; }
.scene.run .solid { animation: solid 1.25s .2s forwards; }
@keyframes solid { 0% { fill: var(--from); } 50% { fill: var(--mid); } 100% { fill: var(--to); } }
.scene .droplets circle { fill: #8fd0ff; opacity: 0; }
.scene.run .droplets circle { animation: appear .4s .9s both; }
@keyframes appear { from { opacity: 0; } to { opacity: 1; } }
.scene .smoke path { fill: none; stroke: #9a948a; stroke-width: 2.5; stroke-linecap: round; opacity: 0; }
.scene.run .smoke path { animation: waver 1.4s .6s infinite; }
.scene .pipe { fill: none; stroke: #e8e2d2; stroke-width: 2.2; }
.scene .stopper { fill: #8a6a4a; stroke: #e8e2d2; stroke-width: 1.2; }
.scene .lime { fill: var(--from); fill-opacity: var(--fop); transition: fill .8s 1s, fill-opacity .8s 1s; }
.scene.run .lime { fill: var(--to); fill-opacity: var(--top); }
.scene .limewater.faded { opacity: .3; }
.scene .wire { fill: none; stroke: #cfc8b8; stroke-width: 2; }
.scene .wire.thin { stroke-width: 1.6; }
.scene .battery { fill: #e7d9a8; stroke: #e8e2d2; stroke-width: 2; }
.scene .electrode { stroke: #b9b2a2; stroke-width: 4; stroke-linecap: round; }
.scene .bulb-glass { fill: rgba(232, 226, 210, .16); stroke: #e8e2d2; stroke-width: 2; transition: fill .4s .7s; }
.scene.run .bulb-glass { fill: var(--lit); }
.scene .glow { fill: #ffd246; opacity: 0; transition: opacity .5s .7s; }
.scene.run .glow { opacity: var(--glowop); }
.scene .rays path { stroke: #f2d48b; stroke-width: 2.5; stroke-linecap: round; opacity: 0; }
.scene.run .rays path { animation: appear .3s 1s both; }
/* 焰色：灯的淡蓝火焰一直在；样品的颜色不透明，从灯芯处长出来（不做淡入：半透明的黄叠在淡蓝上会发绿发灰）。
   一闪即逝：长出来以后满色 300ms，再用 400ms 缩没，之后只剩灯焰。
   --edge：深色描边（砖红是 #5b1f10），放多大都是 1px。 */
.scene .colored { fill: var(--to); stroke: var(--edge, none); stroke-width: 1; vector-effect: non-scaling-stroke; opacity: 0; transform: scale(0); transform-box: fill-box; transform-origin: 50% 100%; transition: transform .25s .4s ease-out, opacity 0s .4s; }
.scene.run .colored { opacity: 1; transform: scale(var(--s, 1)); }
.scene.run .colored.brief { animation: brief .75s .4s both; }
@keyframes brief {
  0% { opacity: 1; transform: scale(0); }
  6% { opacity: 1; transform: scale(var(--s, 1)); }
  46% { opacity: 1; transform: scale(var(--s, 1)); }
  100% { opacity: 1; transform: scale(0); }
}
/* 放大镜里停在最亮的那一下，加虚线框表示"刚才看到的" */
.scene .peak-frame { display: none; fill: none; stroke: #e8e2d2; stroke-width: 1.5; stroke-dasharray: 4 3; }
.scene.zoom.peak .peak-frame { display: inline; }
.scene .loop { fill: none; stroke: #b9b2a2; stroke-width: 2; }
.scene .cobalt-glass { fill: #1d3fa8; fill-opacity: .5; stroke: #8fa6e8; stroke-width: 1.5; }
.scene .cobalt { opacity: 0; transform: translateX(24px); transition: opacity .3s .8s, transform .3s .8s; }
.scene.run .cobalt { opacity: 1; transform: none; }
.scene .through { fill: var(--to); opacity: 0; transition: opacity .3s 1s; }
.scene.run .through { opacity: 1; }
/* 说不准：不画火焰，只画虚线圈和问号（不和钾的紫色混） */
.scene .through.unsure circle { fill: none; stroke: #9aa6c8; stroke-width: 1.5; stroke-dasharray: 3 2.5; }
.scene .through.unsure text { fill: #9aa6c8; font: 700 15px var(--sans); }
.scene .dish { fill: #e2dccd; stroke: #8a8270; stroke-width: 1.5; }
/* 两两混合开局：四只带滴管的瓶子 */
.scene .lab-bottle .body { fill: rgba(207, 227, 238, .08); stroke: #e8e2d2; stroke-width: 2; }
.scene .lab-bottle .neck { fill: #e8e2d2; }
.scene .lab-bottle .bulb { fill: #8a6a4a; stroke: #e8e2d2; stroke-width: 1.2; }
.scene .lab-bottle .liquid-static { fill: #cfe3ee; fill-opacity: .25; }
.scene .lab-bottle text { fill: #e8e2d2; font: 800 15px var(--sans); }
.scene .sample-pile { fill: #fff; stroke: #c9c2b1; stroke-width: 1.5; }

/* 两瓶混合：第二支滴管晚一点滴；白色沉淀从液面散开 */
.scene.mix .cloud { transform-origin: 160px 68px; }
.scene.run .dropper.second .drop { animation-delay: .5s; }

/* 停在最后一帧（观察窗、放大镜）：不再播放过渡，冒泡之类的循环照常 */
.scene.final, .scene.final * { transition: none !important; }
.scene.final .powder, .scene.final .drop { animation: none; opacity: 0; }
.scene.final .solid { animation: none; fill: var(--to); }
.scene.final .droplets circle, .scene.final .rays path { animation: none; opacity: 1; }
.scene.final .colored.brief { animation: none; opacity: 0; }
.scene.zoom.peak .colored.brief { animation: none; opacity: 1; transform: scale(var(--s, 1)); }

@media (prefers-reduced-motion: reduce) {
  /* 减少动态：和平时停下来的那一帧一样（一闪即逝的火焰在放大镜里停在最亮的一下） */
  .scene.run .bubble { animation: none !important; opacity: 1 !important; }
  .scene .lampflame { animation: none !important; }
}
