:root {
  color-scheme: light;
  font-family: Inter, "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  --ink: #18384a;
  --muted: #6d8290;
  --line: #cfe1df;
  --panel: rgba(255, 255, 255, 0.92);
  --mint: #2f927d;
  --mint-dark: #1e6f61;
  --mint-soft: #e9f7f3;
  --shadow: 0 12px 34px rgba(32, 83, 80, 0.12);
}

* { box-sizing: border-box; }
html, body { min-width: 320px; min-height: 100%; margin: 0; }
body {
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 0%, rgba(137, 224, 210, .2), transparent 31%),
    linear-gradient(180deg, #f4fbfc 0%, #edf7f5 100%);
}
button, input { font: inherit; }
button { color: inherit; }

.independent-model-app { min-height: 100vh; display: flex; flex-direction: column; }
.independent-model-header {
  min-height: 94px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 18px 26px 12px;
  border-bottom: 1px solid rgba(142, 181, 181, .45);
}
.independent-model-back {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 102px;
  padding: 10px 12px 10px 8px;
  color: #246a5e;
  text-decoration: none;
  background: rgba(255,255,255,.88);
  border: 1px solid #c8e0dc;
  border-radius: 17px;
  box-shadow: 0 5px 16px rgba(43, 105, 95, .08);
}
.independent-model-back-icon { width: 45px; height: 32px; display: block; }
.independent-model-back-icon svg { width: 100%; height: 100%; }
.back-arrow-primary { fill: #53ab98; }
.back-arrow-secondary { fill: #82c8b9; }
.back-arrow-separator { fill: #f8fffd; }
.independent-model-back-label { display: grid; font-weight: 800; line-height: 1.05; }
.independent-model-heading { min-width: 0; }
.independent-model-kicker { color: #2d7567; font-size: 13px; font-weight: 800; letter-spacing: .03em; }
.independent-model-heading h1 { margin: 6px 0 0; font-size: clamp(25px, 3vw, 38px); line-height: 1.08; }
.independent-model-heading h1 small { margin-left: 12px; color: #5f7480; font-size: .48em; font-weight: 600; }

.independent-model-workspace { flex: 1; padding: 10px 22px 20px; }
.model-area {
  min-height: calc(100vh - 126px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  background: rgba(255,255,255,.86);
  border: 1px solid #c9dfdd;
  border-radius: 24px;
  box-shadow: var(--shadow);
}
.stage-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(155px, 1fr));
  gap: 7px;
  padding: 10px;
  overflow-x: auto;
  border-bottom: 1px solid #d4e5e3;
}
.stage-tab {
  min-width: 155px;
  min-height: 78px;
  display: grid;
  grid-template-columns: 24px 1fr;
  align-items: start;
  gap: 6px;
  padding: 12px 11px;
  text-align: left;
  background: #fff;
  border: 1px solid #d3e1e2;
  border-radius: 15px;
  cursor: pointer;
  transition: border-color .2s, background .2s, box-shadow .2s;
}
.stage-tab:hover { border-color: #79baae; }
.stage-tab.is-active { background: #e9f8f4; border-color: #55a998; box-shadow: inset 0 0 0 2px rgba(85,169,152,.15); }
.stage-number { color: #56717c; font-size: 13px; }
.stage-tab strong, .stage-tab small { display: block; }
.stage-tab strong { font-size: 16px; }
.stage-tab small { margin-top: 4px; color: #72858e; font-size: 11px; }

.control-dock { display: flex; align-items: center; gap: 14px; padding: 10px 12px; border-top: 1px solid #d2e3e0; background: rgba(255,255,255,.96); }
.control-group { display: flex; align-items: center; gap: 7px; }
.control-group-view { margin-left: auto; }
.control-button { min-height: 42px; padding: 0 13px; border: 1px solid #cddfdd; border-radius: 13px; background: #fff; font-weight: 700; cursor: pointer; }
.control-button:hover { background: #eff9f6; border-color: #76b8aa; }
.control-button.is-primary { color: #fff; background: #318b78; border-color: #318b78; }
.control-icon { margin-right: 5px; font-weight: 900; }
.timeline-wrap { min-width: 230px; display: flex; align-items: center; gap: 9px; color: #647a82; font-size: 12px; }
.timeline-wrap input { width: 100%; accent-color: #368f7c; }

.scene-svg text{font-family:"Segoe UI","Microsoft YaHei",sans-serif;fill:var(--ink);pointer-events:none}.scene-svg .small{font-size:14px;fill:#688084}.scene-svg .label{font-size:17px;font-weight:600}.scene-svg .protein-sub{font-size:13px;fill:#72868b}.scene-svg .ion text{text-anchor:middle;font-size:11px;font-weight:600;fill:white}.scene-svg .background-ion{opacity:.7}.scene-svg .background-ion text{font-size:11px}.scene-svg .protein{cursor:pointer}.scene-svg .protein .selection{fill:none;stroke:#6fa998;stroke-width:2;opacity:0}.scene-svg .protein.selected .selection{opacity:1}.scene-svg .charge{font-size:17px;font-weight:600;fill:#bd7a54}.scene-svg .charge.inner{fill:#6a7fa3}.scene-svg .flow-arrow{fill:none;stroke-width:2.2}.scene-svg .lipid-tail{fill:none;stroke-linecap:round}.scene-svg .lipid-tail-shadow{stroke:rgba(14,165,233,.16);stroke-width:4.6}.scene-svg .lipid-tail-core{stroke:url(#lipidTail2d);stroke-width:2.7}.active-transport-2d-nucleotide .phosphate-bond{stroke:#9a3412;stroke-width:2.4;stroke-linecap:round;fill:none}.active-transport-2d-nucleotide .nucleotide-bond{fill:none;stroke:#9a3412;stroke-width:2;stroke-linecap:round}.active-transport-2d-nucleotide .adenine-ring{fill:#fde68a;stroke:#d97706;stroke-width:1.7}.active-transport-2d-nucleotide .adenine-ring-small{fill:#fcd34d}.active-transport-2d-nucleotide .ribose-ring{fill:#fdba74;stroke:#d97706;stroke-width:1.8}.active-transport-2d-nucleotide [data-atp-label],.active-transport-2d-nucleotide [data-adp-label]{fill:#9a3412;font-size:15px;text-anchor:middle}.active-transport-2d-phosphate text{text-anchor:middle;font-size:10px;fill:#146d84}.hide-labels .optional-label{visibility:hidden}.focus-on .protein:not(.selected){opacity:.64}

/* Potential-specific content within the mature translation model shell. */
:root{--green:#318b78;--na:#367fbc;--k:#8652a5;font-size:15px;line-height:1.5}
button{touch-action:manipulation}button:focus-visible,input:focus-visible,[role=button]:focus-visible{outline:3px solid #e3a333;outline-offset:3px}button:disabled{cursor:wait;opacity:.5}
.stage-strip{grid-template-columns:repeat(5,minmax(155px,1fr))}.stage-tab[aria-pressed=true]{background:#e9f8f4;border-color:#55a998;box-shadow:inset 0 0 0 2px #55a99826}
.model-stage{display:grid;grid-template-columns:minmax(0,1fr) clamp(320px,27vw,380px);min-height:0}
.scene-panel{display:flex;flex-direction:column;min-width:0;min-height:0;padding:12px;border-right:1px solid #d7e5e3;background:#fbfefe}
.scene-title{display:flex;justify-content:space-between;gap:10px;padding:2px 7px 8px;font-size:12px;color:#647f87}.scene-title strong{font-weight:600}
.drawing-scroll{min-height:0;flex:1;display:flex;align-items:center;overflow:hidden}.scene-svg{display:block;width:100%;height:100%;min-height:0}
.scene-legend{display:flex;flex-wrap:wrap;gap:6px 16px;padding:9px 6px 3px;font-size:11px;color:#647982}.scene-note{font-size:10px;color:#8a9a9f;padding:1px 6px 3px}
.dot{display:inline-block;width:9px;height:9px;margin-right:5px;border-radius:50%;background:var(--na)}.dot.k{background:var(--k)}.dot.anion{background:#95a6aa}
.record-panel{min-height:0;min-width:0;overflow-y:auto;padding:16px;background:#f8fcfb;scrollbar-width:thin;scrollbar-color:#abc5bf transparent}
.stage-status{padding:13px 14px;background:white;border:1px solid #d7e5e4;border-radius:17px}.status-title{display:flex;justify-content:space-between;align-items:center;gap:8px}.stage-status-kicker{margin:0;color:#5e7681;font-size:11px;font-weight:800;letter-spacing:.08em}.status-time{font-size:11px;color:#6d8290;white-space:nowrap;font-variant-numeric:tabular-nums}.stage-status h2{font-size:21px;line-height:1.2;margin:5px 0 2px}.stage-status>small{font-size:11px;color:#72858e}.stage-status>p{margin:9px 0 0;font-size:12px;line-height:1.7;color:#657983}
.voltage-card{margin-top:12px;padding:12px 11px 10px;background:white;border:1px solid #dae7e4;border-radius:15px}.record-head{display:flex;justify-content:space-between;align-items:center}.record-head h2{font-size:14px;margin:0}.record-head small{font-size:10px;color:#7a8d91}.reading{white-space:nowrap}.reading strong{font:500 28px/1.1 "Segoe UI",sans-serif;color:#2b7568;font-variant-numeric:tabular-nums}.reading span{font-size:11px;color:#718b8c}
.record-plot{width:100%;height:auto;display:block;margin:6px 0}.plot-legend{display:flex;gap:16px;font-size:10px;color:#73888d}.plot-legend i{display:inline-block;width:20px;border-top:2px dashed #bfcfd2;margin-right:5px;vertical-align:middle}.plot-legend i.dark{border-top:3px solid #d84450}
.stimulus-controls{display:flex;gap:5px;margin-top:11px}.stimulus-controls button{font-size:12px;background:white;border:1px solid #cddfdd;border-radius:8px;padding:7px 9px;cursor:pointer}.stimulus-controls button[aria-pressed=true]{background:#e9f7f3;border-color:#69aa99;color:#256e61}.stimulus-controls .apply-stim{margin-left:auto;background:#318b78;color:white;border-color:#318b78}
.gate-states{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:13px}.gate-state{border-left:3px solid var(--na);padding-left:8px;font-size:10px;color:#758a91}.gate-state.kv{border-color:var(--k)}.gate-state b{display:block;font-size:12px;line-height:1.9;color:#244653}.gate-state small{font-size:9px;color:#84959b}.conductance{height:4px;background:#dfebeb;overflow:hidden;border-radius:3px}.conductance i{display:block;background:var(--na);height:100%;width:0}.kv .conductance i{background:var(--k)}.sample-note{font-size:10px;color:#7a8d94;line-height:1.6;margin:9px 0 0}
.structure-panel-title{display:flex;justify-content:space-between;align-items:center;margin:13px 0 8px;font-size:13px}.structure-panel-title span{font-size:10px;color:#8b9c9e}.structure-buttons{display:grid;grid-template-columns:1fr 1fr;gap:6px}.structure-button{display:flex;align-items:center;gap:7px;text-align:left;border:1px solid #d8e4e4;border-radius:9px;background:white;padding:8px;font-size:11px;cursor:pointer}.structure-button[aria-pressed=true]{border-color:var(--structure-color);box-shadow:inset 3px 0 var(--structure-color)}.structure-button-dot{width:8px;height:8px;border-radius:50%;background:var(--structure-color);flex:none}.structure-detail{background:white;border:1px solid #dde9e7;border-radius:11px;padding:10px;margin-top:9px;font-size:11px;color:#657b83;line-height:1.7}.structure-detail strong{display:block;color:#296d60;font-size:12px;margin-bottom:3px}
.control-dock{gap:10px}.control-button{white-space:nowrap;font-size:13px;padding:0 10px}.timeline-wrap{min-width:90px;flex:1;font-size:10px;gap:6px}.timeline-wrap>span:first-child{min-width:27px}.timeline-wrap input{min-width:40px;cursor:pointer}.timeline-wrap output{font-variant-numeric:tabular-nums;min-width:30px;color:#6d8290}.load-status:empty{display:none}.control-button[aria-pressed=true]:not(.is-primary){background:#f0f9f6}
.scene-svg .protein-state{fill:#52727d;font-size:12px}.scene-svg .selection{stroke:#4baf99!important}.scene-svg .circuit-wire{stroke:#4c6570;stroke-width:2.4;fill:none;stroke-linecap:round;stroke-linejoin:round}.scene-svg .circuit-unit,.scene-svg .instrument-box{fill:#fbfdfd;stroke:#526c77;stroke-width:2}.scene-svg .circuit-terminal{fill:white;stroke:#526c77;stroke-width:1.5}.scene-svg .probe-body{fill:#c4cfd5;stroke:#536c78;stroke-width:1.5}.scene-svg .probe-contact{stroke:#b38442;stroke-width:4;fill:none;stroke-linecap:round}.scene-svg .recording-probe{fill:#edf5f8;stroke:#5d7886;stroke-width:1.6}.scene-svg .stim-pulse{stroke:#d8912c;stroke-width:2;fill:none}
.scene-svg [data-stim-wave] text{fill:#a56622}
.scene-note::before{display:none}
.model-area:fullscreen,.is-css-fullscreen{background:#fff}.is-css-fullscreen{position:fixed!important;inset:0;z-index:9999}
@media(min-width:861px) and (max-width:1120px){.control-dock{flex-wrap:wrap;gap:7px}.control-group-view{margin-left:auto}.timeline-wrap{order:3;flex-basis:100%}.timeline-wrap>span:first-child{min-width:52px}.independent-model-heading h1{font-size:30px}.independent-model-heading h1 small{font-size:13px;margin-left:8px}}
@media(min-width:861px) and (max-height:740px){.stage-tab{min-height:66px;padding:9px 10px}.stage-tab strong{font-size:14px}.record-panel{padding:11px}.stage-status{padding:10px}.stage-status h2{font-size:19px}.stage-status>p{font-size:11px;margin-top:6px}.voltage-card{margin-top:9px}.scene-title{font-size:11px}.scene-note{font-size:9px}}
@media(max-width:860px){.independent-model-header{gap:11px}.independent-model-back{min-width:78px;padding:8px;gap:5px;border-radius:14px}.independent-model-back-icon{width:31px;height:27px}.independent-model-back-label{font-size:12px}.independent-model-kicker{font-size:10px}.independent-model-heading h1{font-size:22px;margin-top:3px;line-height:1.2}.independent-model-heading h1 small{display:block;margin:3px 0 0;font-size:11px}.model-area{border-radius:18px}.stage-strip{display:flex;gap:6px;padding:8px}.stage-tab{flex:0 0 158px;min-height:63px;min-width:0;padding:9px;gap:4px}.stage-tab strong{font-size:12px}.stage-tab small{font-size:9px;margin-top:2px}.stage-number{font-size:11px}.model-stage{display:block;overflow-y:auto!important}.scene-panel{height:390px;padding:8px;border-right:0;border-bottom:1px solid #d7e5e3}.drawing-scroll{overflow-x:auto;overflow-y:hidden}.scene-svg{flex:0 0 670px;min-width:670px;height:100%}.scene-title{font-size:10px}.scene-legend{font-size:10px;gap:6px 12px}.scene-note{font-size:9px}.record-panel{padding:12px;overflow:visible}.voltage-card{max-width:520px}.record-plot{max-height:300px}.control-dock{flex-wrap:wrap;gap:6px;padding:7px}.control-group{gap:5px}.control-group-primary{width:100%;justify-content:space-between}.control-group-view{margin-left:0;width:100%;justify-content:space-between}.control-button{min-height:33px;border-radius:9px;font-size:11px;padding:0 9px}.timeline-wrap{order:3;flex-basis:100%;min-height:18px}.timeline-wrap>span:first-child{min-width:52px}.structure-buttons{grid-template-columns:repeat(2,1fr)}}
@media(max-width:860px){.scene-note::before{content:"左右滑动模型，向下查看电位曲线。";display:block;color:#647f87}}
@media(max-width:860px) and (orientation:portrait){.scene-panel{height:524px}}
@media(max-width:360px){.independent-model-kicker{display:none}.independent-model-heading h1{font-size:18px}.independent-model-heading h1 small{font-size:9.5px}}
@media(max-width:860px) and (orientation:landscape){.control-dock{flex-wrap:nowrap}.control-group-primary,.control-group-view{width:auto}.control-group-view{margin-left:auto}.timeline-wrap{order:0;flex-basis:auto}.control-button{padding:0 7px;font-size:10px}.timeline-wrap>span:first-child,.timeline-wrap output{display:none}.stage-tab{min-height:52px}.scene-panel{height:480px}.scene-svg{min-width:0;flex-basis:100%}}

/* Compact stage geometry from transport@2.1.10, shell.css (767-785). */
.stage-strip{gap:6px;padding:7px}
.stage-tab{min-height:44px;padding:6px 9px;border-radius:11px;grid-template-columns:18px minmax(0,1fr);align-items:center;line-height:1.2}
.stage-tab strong{font-size:13px}.stage-tab small{font-size:10px;margin-top:2px;white-space:nowrap}
.timeline-wrap>span:first-child{flex:0 0 auto;min-width:4em;white-space:nowrap}
.timeline-wrap input{width:0;flex:1 1 40px}.timeline-wrap output{flex:0 0 auto}
.scene-svg .zoom-region{fill:#e8f5ed;stroke:#59a58e;stroke-width:1.6}
.scene-svg .zoom-region-inset{fill:#d9efe2;stroke-width:1.8}
.scene-svg .protein .function-bar{stroke:var(--protein-color);stroke-width:4;stroke-linecap:round;opacity:0}
.scene-svg .protein .protein-art{transition:filter .15s,opacity .15s}
.scene-svg.focus-on .protein:not(.selected){opacity:1}
.scene-svg.focus-on .protein:not(.is-stage-active) .protein-art{opacity:1}
.scene-svg.focus-on .protein.is-stage-active .protein-art{filter:drop-shadow(0 0 3px var(--protein-color)) drop-shadow(0 0 7px var(--protein-color));opacity:1}
.scene-svg.focus-on .protein.is-stage-active .function-bar{opacity:1}
.scene-svg .protein.selected .label{font-weight:750}
.scene-svg .charge,.scene-svg .charge.inner{font-size:27px;font-weight:800;text-anchor:middle;fill:#4268a0}
.scene-svg .charge.is-positive{fill:#c96932}
.scene-svg .flow-arrow{stroke-width:2.5}
.scene-svg .influx-ion text{font-size:9px;font-weight:700}
.scene-svg .active-transport-2d-nucleotide .nucleotide-atom{font-size:8px;font-weight:700;text-anchor:middle;fill:#8f4419;paint-order:stroke;stroke:#fff4d8;stroke-width:2.3px;stroke-linejoin:round}
.scene-svg .active-transport-2d-nucleotide .nucleotide-position{font-size:7px;fill:#a16435;text-anchor:middle}
@media(max-width:860px){.stage-tab{min-height:44px;padding:6px 8px}.stage-tab strong{font-size:12px}.stage-tab small{font-size:9px}}

/* Stage analysis: retain the compact shell, emphasize current observations. */
.model-area{--phase-color:#267e89;--phase-soft:#e8f5f6;--polarity-color:#315f95}
.model-area[data-polarity=positive]{--polarity-color:#b8592d}
.stage-tab[aria-pressed=true]{border-color:var(--stage-color);background:var(--stage-soft);box-shadow:inset 0 -3px var(--stage-color)}
.stage-tab[aria-pressed=true] .stage-number{color:var(--stage-color);font-weight:800}
.scene-title{align-items:center;gap:8px;min-height:47px;padding-bottom:8px}
.phase-step{display:grid;place-items:center;flex:none;width:31px;height:31px;border-radius:8px;background:var(--phase-color);color:white;font-size:14px;font-weight:800}
.phase-focus{min-width:0;flex:1}.phase-focus strong{display:block;font-size:13px;color:var(--phase-color);font-weight:750}.phase-focus>span{display:block;margin-top:2px;font-size:11px;color:#688089}
.stage-status{border-top:3px solid var(--phase-color)}.stage-status h2{color:var(--phase-color)}
.scene-svg .charge,.scene-svg .charge.inner{font-size:30px}
/* A one-second visual emphasis, independent of the millisecond voltage trace.
   Pause freezes this cue; playback speed does not turn it into rapid flashing. */
.scene-svg .charge-band-pulse{animation:charge-band-breathe 1s ease-in-out infinite}
.model-area[data-playing=false] .charge-band-pulse{animation-play-state:paused}
@keyframes charge-band-breathe{0%,100%{opacity:.35}50%{opacity:1}}
.reading strong{color:var(--polarity-color);font-weight:650}
.record-plot .threshold-label{font-size:11px;font-weight:650;fill:#986419;paint-order:stroke;stroke:#fff;stroke-width:3px;stroke-linejoin:round}
.threshold-note{font-size:10px;color:#839097;line-height:1.5;margin:7px 0 0}
@media(max-width:860px){.phase-focus strong{font-size:11px}.phase-focus>span{font-size:9px}.phase-step{width:27px;height:29px;font-size:12px}.scene-title{min-height:48px;gap:6px;padding-left:2px;padding-right:2px}}
