/* 主工作台与独立研究功能共用同一组导航控件。 */
/* Win98 选项卡（win98.css 有一条 *{box-shadow:none!important} 的重置，斜面必须带 !important）：标签只画上、左、右三边斜面，底下一条白线是面板的上边；当前页签高出 2px、盖住那条白线，和面板连成一片（与论文工作区的 01/02/03 页签同一画法）。 */
.research-nav{display:flex;gap:0;flex-wrap:wrap;align-items:flex-end;padding:6px 2px 0;margin-bottom:6px;border-bottom:1px solid var(--w-lighter,#fff)}
.research-nav a{position:relative;display:inline-flex;align-items:center;justify-content:center;min-height:0;margin-bottom:-1px;padding:3px 12px 4px;background:var(--w-face,#c0c0c0);color:var(--w-text,#000);box-shadow:inset -1px 0 var(--w-darker,#0a0a0a),inset 1px 1px var(--w-light,#dfdfdf),inset -2px 0 var(--w-shadow,#808080),inset 2px 2px var(--w-lighter,#fff)!important;font-family:var(--w-font);font-size:var(--w-size,12px);line-height:1.5;text-decoration:none;border-radius:0}
.research-nav a[aria-current=page]{z-index:2;margin-top:-2px;margin-left:-2px;margin-right:-2px;padding:4px 14px 6px;background:var(--w-face,#c0c0c0);font-weight:700}
.research-nav a:first-child[aria-current=page]{margin-left:0}
.research-nav a:focus-visible{outline:1px dotted #000;outline-offset:-4px}
html[data-visual-theme=win98] .composer>.brand{gap:6px;padding:2px 24px 0;min-height:20px}
html[data-visual-theme=win98] .composer>.brand h1{font-size:16px;line-height:18px}

/* 同页切换（index.html）：选中公式推导/文献检索时，三扇窗让位给工具区，工具区横跨整个 shell 网格。
   shell 的 className 会被 intake.js 整串重写，所以状态挂在 body[data-tool] 上。 */
.tool-host{display:none;min-width:0;min-height:0}
/* 三个模式共用 rail-open 状态；工具页保留独立开合入口。 */
body[data-tool=derivation] .shell>:not(.tool-host):not(.rail),
body[data-tool=literature] .shell>:not(.tool-host):not(.rail){display:none!important}
body[data-tool=derivation] .shell>.tool-host:not([hidden]),
body[data-tool=literature] .shell>.tool-host:not([hidden]){display:flex;flex-direction:column;grid-column:-2/-1;align-self:stretch}
html.is-embedded .research-shell>.composer>.brand{padding-right:4px}
.research-shell .brand .embedded-history-toggle{margin-left:auto;flex-shrink:0;min-height:18px;padding:1px 5px;font-size:12px;line-height:16px;color:#000;white-space:nowrap}
.research-shell .brand .embedded-history-toggle:focus-visible{outline:1px dotted #000;outline-offset:-3px}
.tool-host>.tool-frame{flex:1;min-height:0}
@media (min-width:1081px){
  body[data-tool=derivation] .shell,body[data-tool=literature] .shell{grid-template-columns:minmax(0,1fr)!important;max-width:none}
  body[data-tool=derivation] .shell.rail-open,body[data-tool=literature] .shell.rail-open{grid-template-columns:248px minmax(0,1fr)!important}
  body[data-tool=derivation] .shell>.rail,body[data-tool=literature] .shell>.rail{display:none!important}
  body[data-tool=derivation] .shell.rail-open>.rail,body[data-tool=literature] .shell.rail-open>.rail{display:grid!important;grid-column:1}
  body[data-tool=derivation] .shell>.tool-host:not([hidden]),body[data-tool=literature] .shell>.tool-host:not([hidden]){grid-column:-2/-1}
}
@media (max-width:1080px){
  body[data-tool=derivation] .shell>.tool-host:not([hidden]),body[data-tool=literature] .shell>.tool-host:not([hidden]){grid-column:1/-1}
}
/* 嵌入时任务记录由外层的对话列表管理，工具页自己的「本机任务记录」下拉不再显示。 */
html.is-embedded label[for=history],html.is-embedded #history{display:none!important}
.tool-frame{display:block;width:100%;height:100%;border:0;background:transparent}
.tool-frame[hidden]{display:none}
@media (max-width:1080px){.tool-host .tool-frame{height:calc(100dvh - 60px);min-height:560px}}

/* 被嵌入时（research-tools.html 在 iframe 里）：外层已留出托盘带与窗口边距，里面不再重复留。 */
html.is-embedded .shell,
html.is-embedded body:has(#auth-widget) .shell{padding:0!important;max-width:none}
