/* 布局沿用主工作台 shell/composer/workspace，视觉沿用 win98.css。 */
*{box-sizing:border-box}
body{margin:0;overflow-x:hidden}
.shell.research-shell{display:grid;gap:8px;padding:8px}
.shell.research-shell>.composer{padding:3px 3px 8px!important;gap:8px}
.shell.research-shell>.composer::after{content:'就绪'}
.research-shell>.composer>.brand{margin-top:0!important;flex:none}
.research-input-body{min-height:0;overflow:auto;padding:4px 8px 10px}
.input-panel h2{font-size:16px;margin:6px 0}
.input-panel label{display:block;margin:14px 0 4px}
.input-panel p{margin:8px 0;line-height:1.7}
.input-panel textarea{resize:vertical;width:100%;max-width:100%;font:inherit;line-height:1.7}
.input-panel #submit,.input-panel #history{width:100%}
.year-fields{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.year-fields input{width:100%;min-width:0}
.note{font-size:12px;line-height:1.6}
#status{box-shadow:var(--w-status)!important;padding:8px;overflow-wrap:anywhere}
.research-shell>.research-output{position:relative;display:flex;flex-direction:column;overflow:hidden;animation:none;padding:3px!important;gap:0}
.research-output::before{content:'AutoPaper AI - 研究工作区';flex:none}
.output-panel{flex:1;min-height:0;min-width:0;overflow:auto;padding:12px;background:var(--w-face)}
.empty{display:grid;align-content:center;text-align:center;min-height:480px;color:#444}
.output-panel h2{margin:0 0 8px;font-size:16px}
.filters,.export-bar{display:flex;gap:10px;align-items:end;flex-wrap:wrap;margin:12px 0}
.filters label{display:flex;flex-direction:column;gap:4px}
.filters input{width:210px;max-width:100%}
.filters select{min-width:130px}
.export-bar{align-items:center}
.table-scroll{overflow:auto;max-height:650px;border:1px solid #808080;background:white}
table{border-collapse:collapse;width:100%;font-size:12px}
th,td{border:1px solid #bbb;padding:8px;text-align:left;vertical-align:top}
th{background:#ddd;position:sticky;top:0;z-index:1;white-space:nowrap}
td:nth-child(2){min-width:320px;max-width:540px}td:nth-child(3){min-width:120px;max-width:220px}td:nth-child(5){min-width:120px}td:nth-child(9){min-width:160px}
td details{margin-top:8px}td details p{white-space:pre-wrap;max-width:600px}td a{display:block;overflow-wrap:anywhere}
.pagination{display:flex;justify-content:center;gap:15px;align-items:center;margin:14px 0}
.notice{background:#ffffe1;border:1px solid #808080;padding:10px;white-space:pre-wrap}
.derivation-content{padding:12px;background:white;line-height:1.9;font-family:var(--w-font-read);overflow-wrap:anywhere}
.derivation-content p{white-space:pre-wrap}.derivation-content .katex-display{overflow:auto;padding:5px 0}
.derivation-content h2{font-size:19px;margin-top:26px}.derivation-content h3{font-size:16px;margin-top:18px}
pre{white-space:pre-wrap;word-break:break-word;max-height:500px;overflow:auto;font-size:12px}
.derivation-table{overflow:auto;margin:16px 0}.derivation-table td,.derivation-table th{min-width:100px;max-width:none;position:static}.derivation-table table{font:inherit}
.pdf-reader{position:relative;box-shadow:var(--w-sunken)!important;background:#808080}
.pdf-native{display:block;width:100%;height:70vh;min-height:450px;border:0;background:#525659}
.pdf-fullscreen{position:absolute;right:14px;bottom:14px;z-index:3;padding:5px 10px;background:#fff;color:#000;cursor:pointer}
.pdf-reader:fullscreen,.pdf-reader.is-fullscreen{border:0;background:#525659}
.pdf-reader.is-fullscreen{position:fixed;inset:0;z-index:1000}
.pdf-reader:fullscreen .pdf-native,.pdf-reader.is-fullscreen .pdf-native{height:100vh;min-height:100vh}
.pdf-reader:fullscreen .pdf-scroll,.pdf-reader.is-fullscreen .pdf-scroll{height:calc(100vh - 42px);min-height:0}
body.derivation-fullscreen-open{overflow:hidden}
.pdf-toolbar{display:flex;justify-content:center;align-items:center;gap:10px;flex-wrap:wrap;padding:8px;background:var(--w-face)}
.pdf-toolbar label{display:flex;align-items:center;gap:5px}
.pdf-scroll{height:70vh;min-height:450px;overflow:auto;padding:12px;text-align:center}
.pdf-pages{display:flex;flex-direction:column;align-items:center;gap:14px;width:max-content;min-width:100%}
.pdf-page{flex:none;background:white;overflow:hidden;box-shadow:0 1px 4px #555}
.pdf-page canvas{display:block;width:100%;height:100%;image-rendering:auto}
#derivation-content{margin:14px 0}#download-derivation-pdf,#open-derivation-pdf{color:#000080}
#pdf-status{white-space:pre-wrap}
[hidden]{display:none!important}
/* 文献检索的对话列与检索方案卡片 */
.visually-hidden{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.lit-chat{display:flex;flex-direction:column;gap:8px;min-height:0}
.lit-chat-log{box-shadow:var(--w-sunken);background:#fff;padding:8px;min-height:220px;max-height:46vh;overflow:auto;display:flex;flex-direction:column;gap:8px}
.lit-chat-empty{margin:0;color:#555;line-height:1.7}
.lit-msg{max-width:92%;padding:6px 8px;border:1px solid #808080;line-height:1.65;white-space:pre-wrap;overflow-wrap:anywhere}
.lit-msg p{margin:0}.lit-msg-role{font-size:11px;color:#555;margin-bottom:2px!important}
.lit-msg-user{align-self:flex-end;background:#e8e8fa}.lit-msg-assistant{align-self:flex-start;background:#f4f4ef}
.lit-chips{display:flex;flex-wrap:wrap;gap:6px}
.lit-chips .chip{font:inherit;padding:3px 10px;cursor:pointer}
.chip-recommended{font-weight:bold}.chip-active{background:#000080!important;color:#fff!important}
#chat-form{display:flex;flex-direction:column;gap:6px}
#chat-input{width:100%;resize:vertical;font:inherit;line-height:1.7}
.lit-chat-actions{display:flex;flex-wrap:wrap;gap:6px}.lit-chat-actions button{flex:1 1 auto}
.plan-panel h2{margin-bottom:10px}
#derivation-plan-fields p,#derivation-plan-fields li{white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.8}
#derivation-plan-fields ul,#derivation-plan-fields ol{padding-left:24px}
#plan-template-slot select{max-width:100%;width:100%}
.plan-block{margin:12px 0}.plan-block>strong{display:block;margin-bottom:6px}
.plan-taxonomy-list{margin:6px 0;padding-left:22px;display:grid;gap:6px}
.plan-taxonomy-list li{display:grid;grid-template-columns:minmax(120px,1fr) minmax(160px,2fr) auto;gap:6px;align-items:center}
.plan-taxonomy-list input{width:100%;min-width:0;font:inherit}
.plan-panel label{display:block;margin:12px 0 4px}#plan-exclusions{width:100%;font:inherit}
.plan-panel .year-fields{margin:12px 0}
#plan-confirm{width:100%;margin-top:6px}#plan-status{white-space:pre-wrap}
@media(max-width:700px){.plan-taxonomy-list li{grid-template-columns:1fr}}
.literature-stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin:14px 0}
.literature-stats>div{box-shadow:var(--w-sunken);padding:8px;background:#eee}
.literature-stats p{margin:2px 0;font-size:12px}.literature-stats .stat-number{font-size:22px;font-weight:bold;color:#000080}
.ranking-explanation{padding:8px;background:#ffffe1;border:1px solid #808080;font-size:12px;line-height:1.7}
.literature-table{min-width:880px;line-height:1.65}
.literature-table td:nth-child(1){min-width:65px;width:65px}
.literature-table td:nth-child(2){min-width:280px;width:38%;max-width:540px}
.literature-table td:nth-child(3){min-width:210px;width:29%;max-width:400px}
.literature-table td:nth-child(4){min-width:92px}.literature-table td:nth-child(5){min-width:160px;max-width:310px}
.literature-table td p{margin:0 0 7px;overflow-wrap:anywhere}
.literature-table tbody tr:nth-child(even){background:#f4f4ef}
.paper-rank{font-weight:bold;color:#000080}.paper-title{font-size:14px;font-weight:bold}
.paper-meta{color:#555;font-size:12px}.paper-alert{color:#980000;font-weight:bold}
.relevance-badge{display:inline-block;padding:1px 7px;border:1px solid #808080;background:#eee}
.relevance-core{color:#004800;background:#e4efe4}.relevance-related{color:#000080;background:#e8e8fa}
.abstract-preview{border-top:1px dotted #aaa;padding-top:7px}
.filters #topic-filter{max-width:240px}.paper-doi{font-size:11px}
@media(max-width:600px){.literature-stats{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:1080px){.research-shell{height:auto;min-height:100vh;overflow:visible}.research-shell>.research-output{min-height:550px;overflow:visible}.output-panel{overflow:visible}.research-input-body{overflow:visible}.empty{min-height:350px}}
/* 2026-09-30 等待时的扫雷（public/run-game.js，与综述写作等待页同一组件）：任务运行时出现在进度提示下方。 */
.research-output .run-game{display:flex;flex-direction:column;align-items:center;gap:10px;margin:12px 0}

/* Let the reader use the whole result pane, including inside the workspace iframe. */
#pdf-status:empty{display:none}
.shell.research-shell>.composer::after{content:none;display:none}
.input-panel #derivation-template{width:100%;max-width:100%}
.research-output::before{content:attr(data-workspace-title)}
@media(min-width:881px){
  .shell.research-shell{grid-template-columns:minmax(280px,28%) minmax(0,1fr);height:100dvh;min-height:0;overflow:hidden}
  .research-shell>.composer{min-height:0;overflow:hidden}
  .research-input-body{overflow:auto}
  .research-shell>.research-output{min-height:0;overflow:hidden}
  .output-panel{overflow:auto}
  .output-panel:has(#derivation-pdf:not([hidden])){display:flex;flex-direction:column;overflow:hidden}
  #derivation-result:has(#derivation-pdf:not([hidden])){display:flex;flex-direction:column;flex:1;min-height:0}
  #derivation-result>h2,#derivation-result>.export-bar,#derivation-result>#pdf-status{flex:none}
  #derivation-result>.export-bar{margin:8px 0}
  #derivation-pdf:not([hidden]){display:flex;flex-direction:column;flex:1;min-height:0}
  #derivation-pdf>.pdf-native,#derivation-pdf>.pdf-scroll{flex:1;min-height:0;height:0}
  #derivation-pdf>.pdf-toolbar{flex:none}
}
@media(max-width:880px){
  .pdf-native{height:calc(100dvh - 110px);min-height:320px}
  .pdf-scroll{height:calc(100dvh - 150px);min-height:320px}
}
@media(max-width:600px){
  .research-shell button,.research-shell select,.research-shell .export-bar a,.research-shell .research-nav a{min-height:40px!important}
  .research-shell .export-bar a,.research-shell .research-nav a{display:inline-flex;align-items:center;justify-content:center;padding:6px 10px}
  .research-shell .input-panel select{height:40px!important}
  .research-shell .input-panel textarea,.research-shell .input-panel input,.research-shell .input-panel select{font-size:16px!important}
  .research-shell .input-panel label{margin-top:10px}
  .pdf-fullscreen{right:8px;bottom:8px}
}

/* Literature uses the same continuous PDF reader as derivation. */
#literature-details{margin-top:14px}#literature-details>summary{cursor:pointer;padding:8px;box-shadow:var(--w-raised)}
#literature-pdf-preview #pdf-status:empty{display:none}

#derivation-verification{flex:none;max-height:220px;overflow:auto;margin:8px 0}
#derivation-verification summary{cursor:pointer;font-weight:bold}
#derivation-attachments{flex:none;gap:6px}
#continue-derivation,#show-derivation-text{flex:none;align-self:flex-start}
#continue-status:empty{display:none}
.lit-msg button,.lit-msg a{margin:5px 8px 0 0}

@media(min-width:881px){
  .output-panel:has(#literature-result:not([hidden])){display:block;overflow:auto}
  #literature-pdf-preview #derivation-pdf{height:calc(100dvh - 270px);min-height:420px}
  #literature-pdf-preview #derivation-pdf:is(:fullscreen,.is-fullscreen){height:100dvh;min-height:0}
}

.year-fields .lit-type-filter{display:flex;align-items:center;gap:8px;align-self:end;min-height:28px}
.year-fields input[type="checkbox"]{width:auto;box-shadow:none;margin:0}
#lit-effective-constraints{grid-column:1/-1;margin:6px 0;line-height:1.7}
