/* explorer-shell v1.0 · 微观馆漫游共享外壳（细胞 / 神经元 / 外泌体，之后的 DNA、RNA 页面直接复用）
   image-first stage + minimal HUD + on-demand Explain drawer + 中 / EN / 中英 language toggle.
   Loaded after each page's inline <style>; every rule is scoped to html.xs. */
:root{--dw:min(440px,40vw);--sh:62dvh;--xt:78px}

/* ---------- language ---------- */
html[data-lang=zh] .t-en{display:none!important}
html[data-lang=en] .t-zh{display:none!important}
html[data-lang=both] .t-en{display:block;font-size:.8em;line-height:1.38;opacity:.72;font-weight:400;letter-spacing:0;margin-top:1px;text-transform:none;font-family:var(--sans)}
html[data-lang=both] .bi-in .t-en{display:inline;margin-left:.42em;font-size:.86em}
html[data-lang=both] .mono .t-en,html[data-lang=both] b .t-en{font-family:var(--sans)}

/* ---------- stage fills the viewport ---------- */
html.xs body{overflow:hidden}
html.xs .app{display:block;position:relative;height:100vh;height:100dvh;padding:0;gap:0;overflow:hidden}
html.xs .view{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:0}
html.xs .lower{display:none!important}
html.xs .vm2{display:none!important}
html.xs .corner{opacity:.55}

/* ---------- top HUD: title chip (left) + status (right) ---------- */
html.xs .top{position:absolute;left:10px;right:10px;top:10px;z-index:8;display:flex;justify-content:space-between;align-items:flex-start;gap:10px;pointer-events:none}
html.xs .top>*{pointer-events:auto}
html.xs .glass{background:rgba(8,14,34,.5);border-color:rgba(140,180,255,.16)}
html.xs .title{padding:7px 12px 8px;max-width:min(46vw,460px);min-width:0}
html.xs .title .brand a{font-size:9.5px}
html.xs .title h1{font-size:17px;margin:3px 0 0;white-space:normal}
html.xs .title h1 .t-en{font-size:11.5px;letter-spacing:.04em;margin-top:2px}
html.xs .title p{display:none}
html.xs .status{flex-direction:row;align-items:center;gap:10px;padding:6px 8px 6px 12px;min-width:0}
html.xs .xmg{display:flex;flex-direction:column;align-items:flex-end;gap:3px}
html.xs .status .mg{display:flex;align-items:baseline;gap:8px}
html.xs .mag{font-size:19px;white-space:nowrap}
html.xs .status{flex:none}
html.xs .status .ibtns,html.xs .status .ib,html.xs .xlang{flex:none}
html.xs .title{flex:0 1 auto}
html.xs .fov{white-space:nowrap}
@media (max-width:1180px){html.xs .app.xopen .fov{display:none}}
html.xs .live{font-size:10px}
html.xs .xlang{display:flex;border:1px solid var(--line2);border-radius:8px;overflow:hidden}
html.xs .xlang button{border:0;background:transparent;padding:0 8px;height:28px;font:600 11.5px var(--sans);color:var(--mute);cursor:pointer;white-space:nowrap}
html.xs .xlang button+button{border-left:1px solid var(--line)}
html.xs .xlang button.on{background:rgba(94,231,255,.16);color:#fff}
html.xs .ib.on{background:rgba(94,231,255,.16);border-color:var(--acc)}

/* ---------- in-stage HUD ---------- */
html.xs .chip{top:var(--xt);left:10px;max-width:calc(100% - 220px);flex-wrap:wrap;row-gap:2px}
html.xs .chip b{font-size:13px}
html.xs .chip .t-en{font-size:11px}
html.xs .labhud{top:calc(var(--xt) + 46px);left:10px;width:280px;background:rgba(8,14,34,.78)}
html.xs .stops{right:10px;width:172px;max-height:calc(100% - var(--xt) - 90px);overflow:auto;scrollbar-width:none;background:rgba(8,14,34,.46);padding:6px}
html.xs .stops::-webkit-scrollbar{display:none}
html.xs .stops button{font-size:12px;padding:4px 7px;line-height:1.25}
html.xs .stops button>span{display:block;min-width:0}
html.xs .stops button .t-en{font-size:10px;margin-top:0}
html.xs .stops button em{align-self:flex-start;margin-top:1px}
html.xs .stops .xcolb{display:flex;justify-content:center;align-items:center;cursor:pointer;color:var(--dim);font:600 12px var(--mono);padding:3px 6px 1px;margin-top:3px;border-top:1px solid var(--line);border-radius:0 0 6px 6px}
html.xs .stops .xcolb:hover{color:#fff;background:rgba(255,255,255,.05)}
html.xs .stops .xcolb i{display:none}
html.xs .stops.xcol{width:auto}
html.xs .stops.xcol button:not(.xcolb)>span,html.xs .stops.xcol .actk{display:none}
html.xs .stops.xcol button:not(.xcolb) em{margin-left:6px}
html.xs .loc.xhud{position:absolute;left:10px;bottom:10px;z-index:4;width:116px;padding:6px 7px 7px}
html.xs .loc.xhud .hd{margin-bottom:5px;cursor:pointer}
html.xs .loc.xhud .hd .k{font-size:9px;letter-spacing:.1em}
html.xs .loc.xhud.xcol .mini{display:none}
html.xs .loc.xhud.xcol .hd{margin:0}
html.xs .scale{left:12px;bottom:150px}
html.xs .app.xmcol .scale{bottom:44px}
html.xs .ai{right:12px;bottom:10px}
html.xs .ctrl{bottom:12px;gap:3px;width:max-content;max-width:calc(100% - 20px);white-space:nowrap}
html.xs .ctrl .xexp{width:auto;padding:0 12px;gap:7px;display:flex;align-items:center;background:rgba(255,181,71,.14);color:#ffd9a0;font:700 12.5px var(--sans);border:1px solid rgba(255,181,71,.35)}
html.xs .ctrl .xexp:hover{background:rgba(255,181,71,.24)}
html.xs .ctrl .xexp kbd{font:600 10px var(--mono);border:1px solid rgba(255,217,160,.4);border-radius:4px;padding:0 4px;opacity:.8}
html.xs .app.xopen .ctrl .xexp{background:rgba(255,181,71,.3);color:#fff}
html.xs .hs span .t-en{font-size:10px}
/* clean view: hide everything but title, status and the play bar */
html.xs .app.xclean .stops,html.xs .app.xclean .loc.xhud,html.xs .app.xclean .chip,html.xs .app.xclean .corner,html.xs .app.xclean .mchips,html.xs .app.xclean .labhud,html.xs .app.xclean .hs{display:none!important}

/* ---------- Explain drawer ---------- */
html.xs .xdrawer{position:absolute;top:0;right:0;bottom:0;width:var(--dw);z-index:12;display:flex;flex-direction:column;
  background:rgba(9,15,36,.95);border-left:1px solid var(--line2);box-shadow:-18px 0 40px rgba(0,0,0,.35);
  transform:translateX(100%);visibility:hidden;transition:transform .32s cubic-bezier(.3,.7,.2,1),visibility 0s linear .32s}
html.xs .app.xopen .xdrawer{transform:none;visibility:visible;transition-delay:0s}
html.xs .app.xopen .view{right:var(--dw)}
html.xs .app.xopen .top{right:calc(var(--dw) + 10px)}
.xd-hd{display:flex;align-items:flex-start;gap:10px;padding:14px 16px 12px;border-bottom:1px solid var(--line)}
.xd-hd .xd-t{flex:1;min-width:0}
.xd-hd .xd-t b{display:block;font-size:15px;color:#fff}
.xd-hd .xd-t b .t-en{font-size:11px}
.xd-hd .xd-t small{display:block;font-size:11.5px;color:var(--mute);margin-top:3px;line-height:1.4}
.xd-hd .xd-t small .t-en{font-size:10.5px}
.xd-body{flex:1;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:rgba(140,180,255,.45) transparent;padding-bottom:22px}
.xd-body::-webkit-scrollbar{width:8px}.xd-body::-webkit-scrollbar-thumb{background:rgba(140,180,255,.4);border-radius:4px}
.xdrawer::after{content:"";position:absolute;left:0;right:8px;bottom:0;height:28px;pointer-events:none;background:linear-gradient(transparent,rgba(9,15,36,.95))}
.xdrawer .p,.xdrawer .profile,.xdrawer .atp{background:none!important;border:0;border-radius:0;box-shadow:none;-webkit-backdrop-filter:none;backdrop-filter:none;
  padding:14px 18px;border-bottom:1px solid var(--line);height:auto!important;overflow:visible!important;width:auto!important;min-width:0}
.xdrawer .p .hd{margin-bottom:9px;align-items:flex-start}
.xdrawer .p .hd .k .t-en{display:inline;margin-left:.4em;font-size:1em;opacity:.7}
.xdrawer .focus .nm{display:block;margin-bottom:8px}
.xdrawer .focus .nm h2{font-size:20px}
.xdrawer .focus .nm h2 .t-en{font-size:13.5px;margin-top:3px;opacity:.75}
.xdrawer .focus .nm small{display:block;margin-top:4px}
.xdrawer .focus .one{font-size:14px;line-height:1.62}
.xdrawer .focus li{font-size:13.5px;line-height:1.6}
.xdrawer .focus .t-en{line-height:1.5;margin-top:3px}
.xdrawer .focus .clin{font-size:13px;line-height:1.55}
.xdrawer .focus .clin>b{display:block;margin-bottom:3px}
.xdrawer .focus .clin>b .t-en{display:inline;font-size:.92em;margin-left:.4em}
.xdrawer .focus .sz{font-size:11.5px;line-height:1.5}
.xdrawer .vit{grid-template-columns:1fr 1fr;gap:12px 14px}
.xdrawer .vit div b{white-space:normal;font-size:16px}
.xdrawer .vit div b .t-en{font-size:11px;font-weight:600;margin-top:2px}
.xdrawer .vit .rg{font-size:12.5px}
.xdrawer .vit .rg .t-en{display:inline;margin-left:.35em}
.xdrawer .vit .lb,.xdrawer .vit .k{display:block}
.xdrawer .profile{display:grid!important;grid-template-columns:1fr 1fr;gap:10px 14px}
.xdrawer .profile>.hd{grid-column:1/-1;margin:0}
.xdrawer .profile b{white-space:normal;overflow:visible;font-size:12.5px}
.xdrawer .profile b .t-en{font-size:10.5px}
.xdrawer .atp{display:block!important}
.xdrawer .atp .row{margin-top:8px}
.xdrawer .bars{gap:7px}
.xdrawer .bars .r{grid-template-columns:132px 1fr 26px;font-size:12px}
.xdrawer .bars .r span:first-child{white-space:normal;overflow:visible}
.xdrawer .bars .r .t-en{font-size:10px;margin-top:0}
.xdrawer .log{height:150px;font-size:11px}
.xdrawer .log .t-en{display:inline!important;margin-left:.5em;font-size:.95em;font-family:var(--mono)}
html[data-lang=zh] .xdrawer .log .t-en{display:none!important}
.xdrawer .foot{text-align:left;padding:14px 18px 0;font-size:11.5px;line-height:1.6;color:var(--mute)}
.xdrawer .foot .t-en{font-size:10.5px}

/* info sheet: bilingual paragraphs */
html.xs .sheet .t-en{margin-top:4px}
html.xs .sheet li .t-en{margin-top:2px}

/* ---------- phone / narrow ---------- */
@media (max-width:820px){
  html.xs .top{left:8px;right:8px;top:8px;gap:6px}
  html.xs .title{padding:6px 9px 7px;max-width:none;flex:1 1 auto}
  html.xs .title h1{font-size:15px}
  html.xs .title h1 .t-en{font-size:10.5px}
  html.xs .status{padding:5px 6px 5px 9px;gap:6px;flex:none}
  html.xs .mag{font-size:15px}
  html.xs .xlang button{display:none;padding:0 7px;height:30px}
  html.xs .xlang button.on{display:block;background:transparent}
  html.xs .chip{left:8px;max-width:calc(100% - 16px)}
  html.xs .labhud{top:calc(var(--xt) + 40px);left:8px;width:min(230px,calc(100% - 16px))}
  html.xs .loc.xhud{display:none}
  html.xs #xHud{display:none}
  html.xs .scale,html.xs .app.xmcol .scale{left:10px;bottom:104px}
  html.xs .ai{top:auto;right:10px;bottom:104px}
  html.xs .ctrl{bottom:calc(10px + env(safe-area-inset-bottom))}
  html.xs .ctrl .xexp{padding:0 11px}
  html.xs .ctrl .xexp kbd{display:none}
  html.xs .mchips{display:flex;position:absolute;left:0;right:0;bottom:calc(60px + env(safe-area-inset-bottom));z-index:4;padding:0 8px;gap:6px}
  html.xs .mchips button{background:rgba(8,14,34,.6);font-size:12px;padding:5px 10px}
  html.xs .mchips button .t-en{font-size:10.5px}
  html.xs .xdrawer{top:auto;left:0;width:auto;height:var(--sh);border-left:0;border-top:1px solid var(--line2);border-radius:16px 16px 0 0;transform:translateY(100%);box-shadow:0 -14px 34px rgba(0,0,0,.4)}
  html.xs .xd-hd::before{content:"";position:absolute;left:50%;top:6px;width:40px;height:4px;margin-left:-20px;border-radius:2px;background:rgba(255,255,255,.22)}
  html.xs .xd-hd{position:relative;padding-top:16px}
  html.xs .app.xopen .view{right:0;bottom:var(--sh)}
  html.xs .app.xopen .top{right:8px}
  html.xs .app.xopen .mchips,html.xs .app.xopen .chip,html.xs .app.xopen .scale,html.xs .app.xopen .ai,html.xs .app.xopen .labhud{display:none!important}
  .xdrawer .p,.xdrawer .profile,.xdrawer .atp{padding:12px 14px}
  .xdrawer .bars .r{grid-template-columns:118px 1fr 26px}
  .xdrawer .focus .nm h2{font-size:18px}
}
@media (min-width:821px) and (max-height:700px){
  html.xs .loc.xhud{width:96px}
  html.xs .scale{bottom:128px}
  html.xs .labhud{width:240px}
}
@media (prefers-reduced-motion:reduce){html.xs .xdrawer{transition:none}}
html:not([data-lang=zh]) .zo{display:none!important}
/* page CSS styles every span inside a hotspot label; reset the nested language spans */
html.xs .hs span span{position:static;transform:none;padding:0;border:0;background:none;left:auto;right:auto;top:auto;font:inherit;border-radius:0}
html.xs .hs span .t-en{font-size:10px;opacity:.75}
html[data-lang=both] .stops button:not(.on):not(:hover) .t-en{display:none}
html.xs .loc.xhud .hd .k .t-en{display:none}
html[data-lang=en] .loc.xhud .hd .k .t-en{display:inline!important}
