/*! BIO-ORIGIN project=holiday-21-gene-expression; version=1.2.1-draft-web.1; official=https://bio2077.cn/; third-party licenses unchanged */
:root{color-scheme:dark;--bg:#09151f;--panel:#101f2b;--line:#2b414d;--text:#ebf4f6;--muted:#a7bcc7;--accent:#91e5c5;--stage:#091823}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--text);font:18px/1.45 'Segoe UI','Microsoft YaHei',sans-serif}button,select{font:inherit;color:inherit;background:#192d3b;border:1px solid #3b5261;border-radius:9px;min-height:44px;padding:7px 13px;cursor:pointer}button:hover{background:#2b4554;border-color:var(--accent)}button:focus-visible,select:focus-visible,input:focus-visible,summary:focus-visible{outline:3px solid #fcd589;outline-offset:3px}button.active,button.primary{background:var(--accent);color:#092a25;border-color:var(--accent);font-weight:650}button:disabled{opacity:.35;cursor:default}#app{height:100dvh;min-height:640px;display:flex;flex-direction:column;max-width:2400px;margin:auto;padding:18px 24px 12px;gap:12px}header{display:flex;align-items:center;gap:32px;flex:none}.brand .eyebrow{font-size:12px;letter-spacing:2.6px;color:var(--accent)}h1{font-size:29px;font-weight:650;letter-spacing:1px;margin:0}h1 span{font-weight:350;margin-left:8px;color:var(--muted)}nav{display:flex;gap:8px;align-items:center}nav button{font-size:21px}.flow{color:var(--muted)}.head-tools{margin-left:auto;display:flex;gap:8px}.workspace{display:grid;grid-template-columns:minmax(0,1fr) 330px;gap:22px;flex:1;min-height:260px}.stage{background:radial-gradient(ellipse at 45% 55%,#193344,var(--stage) 73%);border:1px solid var(--line);border-radius:18px;position:relative;min-width:0;overflow:hidden}#canvas-wrap{position:absolute;inset:0}canvas{display:block;width:100%;height:100%;touch-action:none}.stage-top{position:absolute;top:17px;left:22px;right:20px;display:flex;justify-content:space-between;pointer-events:none;color:var(--muted);gap:10px}#location{font-size:20px;letter-spacing:1px;color:var(--accent)}.badge{font-size:14px}#scene-caption{position:absolute;top:54px;left:22px;color:var(--muted);font-size:18px;pointer-events:none}.tools{position:absolute;right:12px;top:96px;display:flex;flex-direction:column;gap:6px}.tools button{width:54px;padding:4px;font-size:18px;background:#122734ed}.tools button:first-child,.tools button:nth-child(2){font-size:27px;line-height:1.2}.stage-bottom{position:absolute;bottom:13px;left:20px;right:80px;display:flex;justify-content:space-between;gap:12px;align-items:end;pointer-events:none}#selection{color:var(--accent);font-size:18px}details{pointer-events:auto;max-width:390px;background:#0b1b27ec;border:1px solid var(--line);border-radius:8px;padding:8px 12px}summary{cursor:pointer;font-size:16px}details p{font-size:16px;color:var(--muted);margin:8px 0}aside{display:flex;flex-direction:column;min-width:0;padding:4px 0}.step-meta{display:flex;justify-content:space-between;font-size:13px;letter-spacing:1px;color:var(--accent)}#step-count{font-size:17px}h2{font-size:26px;line-height:1.35;margin:14px 0 10px}#step-text{font-size:22px;margin:0 0 15px;color:var(--text)}.metric{display:flex;gap:18px;border-top:1px solid var(--line);border-bottom:1px solid var(--line);padding:9px 0;margin-bottom:13px}.metric strong{font-size:31px;color:var(--accent);margin-right:6px}.metric span{color:var(--muted);font-size:16px}.label{font-size:15px;color:var(--muted)}#objects{display:flex;flex-wrap:wrap;gap:7px;margin-top:6px}#objects button{padding:6px 10px;font-size:18px}.direction{margin-top:auto;padding-top:14px}.direction b{font-weight:500;color:var(--accent)}.direction p{font-size:16px;color:var(--muted);margin:3px 0 12px}.quiet{border:0;text-align:left;background:none;padding:5px 0;font-size:17px;color:var(--muted)}.sequence{border:1px solid var(--line);background:var(--panel);border-radius:12px;padding:9px 18px;flex:none}.sequence-head{display:flex;justify-content:space-between;font-size:15px;margin-bottom:7px;color:var(--muted)}.sequence-head b{color:var(--text);font-weight:500}#strands{display:flex;flex-direction:column;gap:5px}.strand{display:grid;grid-template-columns:150px 32px 1fr 32px;align-items:center;gap:8px}.strand .name{font-size:17px}.end{color:var(--muted);font:18px 'Segoe UI',sans-serif}.bases{display:flex;gap:4px;min-width:0}.base{flex:1;min-width:0;text-align:center;font:600 21px/1.25 ui-monospace,Consolas,monospace;color:var(--muted);border-radius:5px;padding:3px 0;border-bottom:2px solid transparent}.base.live{background:#91e5c526;color:var(--accent);border-color:var(--accent)}.base.current{background:#f3cf8d;color:#251f13;border-color:#f3cf8d}.base.wait{opacity:.25}.base.codon{font-size:21px;letter-spacing:6px}.base small{font:14px/1.4 'Microsoft YaHei',sans-serif;letter-spacing:0;display:block}.strand.rna .name{color:var(--accent)}footer{display:flex;align-items:center;gap:18px;flex:none}.transport{display:flex;gap:8px}#progress{flex:1;min-width:70px;accent-color:var(--accent);height:44px}.speed{display:flex;align-items:center;gap:7px;white-space:nowrap}.speed select{padding:4px 6px}dialog{border:1px solid var(--line);border-radius:18px;background:var(--panel);color:var(--text);width:min(760px,92vw);max-height:88dvh;padding:28px;line-height:1.65}dialog::backdrop{background:#0009}#close-dialog{float:right}dialog h2{clear:both;padding-top:12px}dialog a{color:var(--accent)}dialog p,dialog li{font-size:18px}.comparison{background:var(--bg);border-radius:9px;padding:18px;font-size:21px}body.contrast{--bg:#f3f4ed;--panel:#fff;--text:#152c3a;--muted:#425b68;--line:#b7c9ca;--accent:#126652;--stage:#eef5f4;color-scheme:light}body.contrast .stage{background:radial-gradient(ellipse,#fff,#e6f0f0)}body.contrast button,body.contrast select{background:#fff;color:#163849;border-color:#8ca8b2}body.contrast button.active,body.contrast button.primary{background:#126652;color:white}body.contrast .tools button,body.contrast details{background:#fffffff2}body.contrast .base.live{color:#126652;background:#d9efe4}body.focus aside{display:none}body.focus .workspace{grid-template-columns:1fr}body.focus #app{gap:8px}body.immersive #app{padding:8px;min-height:0}body.immersive header .brand,body.immersive .sequence,body.immersive aside{display:none}body.immersive .workspace{grid-template-columns:1fr}body.immersive header{min-height:48px}body.immersive #scene-caption{color:var(--text);font-size:22px;max-width:calc(100% - 110px)}#error{position:absolute;inset:20%;background:var(--panel);padding:24px;border:1px solid #ffbd82;border-radius:12px}
@media(max-width:1200px){#app{padding:12px;gap:9px}header{gap:20px}.workspace{grid-template-columns:minmax(0,1fr) 295px;gap:15px}h1{font-size:25px}h2{font-size:24px}#step-text{font-size:22px}.head-tools{gap:5px}.head-tools button{padding:6px 9px}.badge{display:none}.direction p{margin-bottom:4px}}
@media(max-height:800px) and (min-width:900px){#app{padding-top:10px}.brand .eyebrow{display:none}.workspace{gap:17px}h2{margin:7px 0;font-size:24px}#step-text{margin-bottom:9px}.metric{padding:5px 0;margin-bottom:7px}.metric strong{font-size:26px}.direction{padding-top:8px}.direction p{display:none}#objects{gap:5px}.sequence{padding:7px 14px}.base{font-size:20px;padding:1px 0}.sequence-head{margin-bottom:5px}.quiet{font-size:16px}footer{gap:12px}}
@media(max-width:900px){#app{height:auto;min-height:100dvh}header{flex-wrap:wrap;gap:10px}.brand{flex:1}.brand .eyebrow{font-size:10px}h1{font-size:24px}nav{order:3;width:100%}nav button{flex:1}.head-tools{gap:4px}.head-tools button{font-size:16px;padding:6px}.workspace{grid-template-columns:1fr;gap:12px}.stage{min-height:390px}aside{padding:0 8px;display:grid;grid-template-columns:1fr 1fr;gap:8px 18px}h2{grid-column:1/-1;margin:0}#step-text{grid-column:1/-1}.step-meta{grid-column:1/-1}.metric{margin:0}.direction{display:none}.quiet{grid-column:1/-1}.sequence{overflow-x:auto}.strand{grid-template-columns:100px 25px 1fr 25px;gap:4px;min-width:580px}.strand .name{font-size:15px}footer{flex-wrap:wrap;gap:8px}.transport{width:100%}.transport button{flex:1;padding:6px}#progress{min-width:120px}.sequence-head{min-width:580px}body.immersive #app{height:100dvh}body.immersive header{flex-wrap:nowrap}body.immersive nav{order:0;width:auto}body.immersive .stage{min-height:150px}body.immersive .head-tools #theme{display:none}body.immersive .workspace{min-height:0}body.immersive .head-tools button{font-size:14px}body.focus .stage{min-height:65dvh}.stage-bottom{left:12px;right:75px;flex-wrap:wrap;gap:6px}details{max-width:270px}#scene-caption{left:12px;right:65px;font-size:16px}.stage-top{left:12px}.tools{right:8px}body.immersive .stage-bottom #gestures{display:none}}

@media(max-width:600px){header .brand{flex-basis:100%;white-space:nowrap}.brand .eyebrow{display:none}.head-tools{margin-left:0;position:absolute;right:12px;top:11px}header .head-tools #view{display:none}header h1{font-size:22px;padding-right:145px}header h1 span{display:none}.stage{min-height:430px}.tools{top:auto;bottom:12px;left:10px;right:10px;flex-direction:row;justify-content:center;gap:5px}.tools button{width:auto;flex:1;min-width:44px;height:48px;font-size:16px}.tools button br{display:none}.stage-bottom{bottom:70px;left:12px;right:12px;align-items:center}#selection{font-size:16px}details{padding:4px 8px;max-width:210px}.workspace aside{grid-template-columns:1fr}.metric{padding:8px 0;gap:30px}.metric span{font-size:17px}.choose{margin-top:4px}.transport button{white-space:nowrap;font-size:16px;padding:5px}body.immersive .head-tools{position:static}body.immersive header{flex-wrap:wrap}body.immersive nav{flex:1}body.immersive .head-tools #view{display:none}body.immersive .stage-bottom{bottom:70px}body.immersive #scene-caption{font-size:18px}body.immersive .tools button{font-size:16px}}

.tools button.active{background:var(--accent);color:#082e24}body.contrast .tools button.active{color:white;background:#126652}
@media(max-width:600px){.stage{min-height:500px}#canvas-wrap{top:82px;bottom:105px}body.immersive #canvas-wrap{top:78px;bottom:104px}body.immersive .stage{min-height:260px}}

body.immersive header{position:absolute;top:14px;left:26px;right:26px;z-index:20;pointer-events:none}body.immersive header>*{pointer-events:auto}body.immersive footer{position:absolute;bottom:14px;left:26px;right:26px;z-index:20;background:var(--panel);padding:8px 12px;border:1px solid var(--line);border-radius:12px}body.immersive .stage-top{top:72px}body.immersive #scene-caption{top:110px}body.immersive .stage-bottom{bottom:90px}body.immersive .tools{top:152px}body.immersive .workspace{flex:1}
@media(max-width:600px){body.immersive header{left:18px;right:18px;top:16px}body.immersive footer{left:16px;right:16px;bottom:12px;gap:6px;padding:8px}body.immersive footer #sources{display:none}body.immersive .stage-top{top:76px}body.immersive #scene-caption{top:115px}body.immersive #canvas-wrap{top:140px;bottom:215px}body.immersive .stage-bottom{bottom:190px}body.immersive .tools{top:auto;bottom:131px}body.immersive .stage{min-height:300px}}

/* 1.1.0: back-row sequence readability */
.sequence{position:relative;padding-right:145px}.sequence .base,.sequence .base.codon{font-size:32px;line-height:1.12;font-weight:750;padding:2px 0;color:var(--text)}.sequence .base.wait{opacity:.4}.sequence .base.live{color:var(--accent)}.sequence .base.current{color:#17202c}.sequence .base small{font-size:16px}.sequence .end{font-size:24px}.sequence-head{font-size:16px}.sequence #big-sequence{position:absolute;right:14px;top:12px;font-size:18px}.sequence-head #seq-note{font-size:14px}.sequence-zoom:before{content:'';position:fixed;inset:0;background:#000a;z-index:45}.sequence-zoom .sequence{position:fixed;inset:18% 3% auto;z-index:50;padding:28px 22px 35px;box-shadow:0 20px 70px #0008;max-height:75dvh;overflow:auto}.sequence-zoom .sequence-head{margin-bottom:30px;padding-right:150px}.sequence-zoom .base,.sequence-zoom .base.codon{font-size:48px;line-height:1.35}.sequence-zoom .strand{grid-template-columns:145px 32px 1fr 32px}.sequence-zoom .sequence .end{font-size:30px}.sequence-zoom .sequence .name{font-size:21px}.sequence-zoom #strands{gap:16px}
@media(max-width:900px){.sequence{padding:12px}.sequence-head{padding-right:135px}.sequence .strand{min-width:760px}.sequence .base,.sequence .base.codon{font-size:32px}.sequence-zoom .sequence{inset:12% 12px auto}.sequence-zoom .strand{min-width:1080px}.sequence-zoom .sequence-head{min-width:0;padding-right:120px}.sequence-zoom .base,.sequence-zoom .base.codon{font-size:48px}}

/* 1.2: one mRNA / multiple independent ribosomes */
.polysome-mode #step-text{font-size:22px}.polysome-mode .sequence{padding-top:10px}.poly-readouts{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;margin-bottom:8px}.poly-readout{display:flex;align-items:baseline;gap:8px;border-left:4px solid var(--ribocolor);padding:4px 10px;background:#21333e;border-radius:5px;white-space:nowrap}.poly-readout b{font-size:18px}.poly-readout strong{font-size:32px;color:var(--ribocolor)}.poly-readout span{font-size:15px;color:var(--muted)}.poly-readout.selected{outline:1px solid var(--ribocolor)}.poly-codons{display:flex;align-items:center;gap:14px}.poly-codons>span{font-size:17px;white-space:nowrap}.poly-codons .bases{flex:1}.poly-codons .base.codon{font-size:28px}.poly-codons .base small{font-size:13px}.polysome-mode #poly-overview{width:100%;font-size:17px}.sequence-zoom .poly-readout strong{font-size:48px}.sequence-zoom .poly-codons .base.codon{font-size:48px}body.contrast .poly-readout{background:#e2f0ed}body.contrast .poly-readout strong{color:#194f54}
@media(max-width:1200px){header{gap:14px}header nav{gap:5px}header nav button{font-size:18px;padding:6px 10px}header h1 span{display:none}.poly-readouts{gap:5px}.poly-readout{gap:5px;padding:3px 7px}.poly-readout span{font-size:14px}.poly-codons>span{font-size:15px}}
@media(max-height:800px) and (min-width:900px){.polysome-mode .sequence-head{margin-bottom:4px}.poly-readout strong{font-size:28px}.poly-codons .base.codon{font-size:27px}.poly-readout{padding:0 7px}.polysome-mode #objects button{min-height:44px}.polysome-mode #step-text{margin-bottom:9px}}
@media(max-width:900px){header nav{flex-wrap:wrap}header nav button{white-space:nowrap;font-size:17px}.poly-readouts{min-width:740px}.poly-codons{min-width:740px}.polysome-mode .sequence-head{min-width:740px}body.immersive nav{flex-wrap:nowrap}body.immersive nav button{font-size:15px;padding:5px 7px}.polysome-mode #objects{display:flex}}
@media(max-width:600px){header nav{gap:5px}header nav .flow{display:none}header nav button{padding:5px 6px;font-size:16px}body.immersive nav button{font-size:13px;padding:5px}body.immersive .head-tools button{font-size:13px;padding:5px}.polysome-mode .stage{min-height:520px}}

.polysome-mode .workspace{grid-template-rows:minmax(0,1fr)}.polysome-mode aside{min-height:0}.poly-readout{text-align:left;color:var(--text);border-top:0;border-bottom:0;border-right:0;cursor:pointer}.polysome-mode .choose{margin-bottom:4px}

@media(max-width:600px){.poly-readouts{min-width:0;grid-template-columns:1fr 1fr}.poly-readout{display:grid;grid-template-columns:1fr 1fr;gap:0 7px;white-space:normal;padding:5px 9px}.poly-readout strong{font-size:30px;text-align:right}.poly-readout span{grid-column:1/-1;font-size:14px}}

.poly-codons .base.codon{font-size:32px}.sequence-zoom .poly-codons .base.codon{font-size:48px}
