/* ====== Report reading surface ====== */
.report-shell{
  padding:0;
  background:#fff;
  border:1px solid #d9ded9;
  box-shadow:0 24px 70px rgba(25,37,31,.08);
}
.report-toolbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:16px 24px;
  background:linear-gradient(135deg,#f8faf8,#f1f5f2);
  border-bottom:1px solid #dfe5e0;
}
.report-toolbar>div{display:flex;align-items:center;gap:12px}
.report-toolbar>div>span{
  width:34px;height:34px;
  border-radius:10px;
  background:var(--green);
  color:#fff;
  display:grid;place-items:center;
  font-size:12px;font-weight:800;
}
.synthesis-result .report-toolbar>div>span{background:var(--blue)}
.report-toolbar>div>div{display:flex;flex-direction:column;gap:3px}
.report-toolbar b{font-size:13px}
.report-toolbar small{font-size:8px;letter-spacing:.13em;color:var(--muted)}
.report-status{
  padding:6px 10px;
  border:1px solid #cbd9d0;
  border-radius:99px;
  color:var(--green);
  background:#f7fbf8;
  font-size:9px;font-weight:700;
}

/* ====== Two-column report layout: TOC + content ====== */
.report-document{
  display:grid;
  grid-template-columns:200px minmax(0,1fr);
  background:#fff;
  align-items:start;
}
.report-toc{
  position:sticky;
  top:148px;
  max-height:calc(100vh - 180px);
  overflow-y:auto;
  padding:20px 14px 20px 20px;
  border-right:1px solid #eceee9;
  background:#fbfcfb;
}
.report-toc-head{
  display:flex;align-items:center;gap:6px;
  margin-bottom:12px;padding-bottom:10px;
  border-bottom:1px solid #e4e7e2;
  color:var(--muted);
  font-size:9px;font-weight:800;letter-spacing:.14em;
}
.report-toc ul{
  list-style:none;margin:0;padding:0;
  display:flex;flex-direction:column;gap:2px;
}
.report-toc li{margin:0}
.report-toc a{
  display:block;
  padding:7px 10px;
  border-radius:8px;
  color:#5a6660;
  font-size:11px;line-height:1.45;
  text-decoration:none;
  transition:background .15s,color .15s;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
.report-toc a:hover{background:#eef4f0;color:var(--ink)}
.report-toc a.toc-active{
  background:var(--green-soft);
  color:var(--green);
  font-weight:700;
}
.report-toc-empty{
  padding:14px 10px;
  color:var(--muted);
  font-size:10px;
  line-height:1.6;
}

.report-document-body{
  padding:20px 30px 30px;
  min-width:0;
}

/* Section cards inside report */
.section-card{
  display:grid;
  grid-template-columns:52px minmax(0,1fr);
  gap:0;
  margin:0;
  padding:18px 0;
  border:0;
  border-bottom:1px solid #e8ebe8;
  border-radius:0;
  background:transparent;
  box-shadow:none!important;
  scroll-margin-top:140px;
}
.section-card:last-child{border-bottom:0}
.section-card.pending{
  border-left:0;
  background:linear-gradient(90deg,#fff9f5 0,transparent 46%);
}
.sec-index{
  padding-top:2px;
  color:#98a29c;
  font-size:9px;font-weight:800;letter-spacing:.08em;
}
.sec-content{min-width:0}
.sec-header{
  margin:0 0 10px;
  padding:0;
  gap:10px;
}
.sec-heading{
  font-family:"Microsoft YaHei UI","Microsoft YaHei",sans-serif;
  font-size:18px;
  line-height:1.35;
  font-weight:750;
  letter-spacing:-.025em;
}
.sec-actions{
  opacity:.2;
  transition:opacity .18s;
}
.section-card:hover .sec-actions,
.section-card:focus-within .sec-actions{opacity:1}
.sec-action{
  padding:5px 10px;
  border-color:#dce1dd;
  border-radius:99px;
  background:#fff;
  font-size:10px;
}
.sec-action.annotate:before{content:"+ ";font-weight:800}

/* Markdown rendering inside report — compact */
.markdown-body{
  max-width:900px;
  color:#34413a;
  font-size:13px;
  line-height:1.75;
}
.markdown-body p{
  margin:0 0 .7em;
  color:#3b4941;
  font-size:13px;
  line-height:1.75;
}
.markdown-body h2,.markdown-body h3,.markdown-body h4{
  margin:1.3em 0 .5em;
  color:#17221c;
  letter-spacing:-.015em;
}
.markdown-body h2{font-size:18px}
.markdown-body h3{font-size:15px}
.markdown-body h4{font-size:13px}
.markdown-body ul,.markdown-body ol{
  margin:.3em 0 .8em;
  padding-left:1.35em;
}
.markdown-body li{
  margin:.2em 0;
  padding-left:.2em;
}
.markdown-body li::marker{color:var(--green);font-weight:700}
.markdown-body strong{color:#17251e;font-weight:750}
.markdown-body em{color:#526159}
.markdown-body a{
  display:inline;
  padding:1px 2px;
  color:#175fa8;
  text-decoration:none;
  border-bottom:1px solid #9ebfe0;
  border-radius:3px;
  overflow-wrap:anywhere;
  transition:color .15s,background .15s,border-color .15s;
}
.markdown-body a:hover{color:#0c4a87;background:#eaf4ff;border-color:#4f8fc9}
.markdown-body a span{font-size:.78em}
.markdown-body .bare-link{font-family:Consolas,"Microsoft YaHei",monospace;font-size:.9em}
.markdown-body code{
  padding:2px 5px;
  border-radius:5px;
  background:#eef1ee;
  color:#9b402c;
  font:11px Consolas,monospace;
}
.markdown-body pre{
  overflow:auto;
  margin:10px 0;
  padding:14px;
  border-radius:10px;
  background:#17201c;
  color:#e8f0eb;
}
.markdown-body pre code{padding:0;background:transparent;color:inherit}
.markdown-body blockquote{
  margin:10px 0;
  padding:10px 14px;
  border-left:3px solid #82a595;
  background:#f4f8f5;
  color:#516158;
}
.markdown-body hr{
  border:0;
  border-top:1px solid #e1e6e2;
  margin:18px 0;
}
.md-table-wrap{
  max-width:100%;
  overflow-x:auto;
  margin:10px 0 14px;
  border:1px solid #dfe4e0;
  border-radius:10px;
}
.md-table-wrap table{min-width:620px;background:#fff}
.md-table-wrap th{
  padding:9px 12px;
  background:#f3f6f4;
  color:#526159;
  font-size:10px;
  white-space:nowrap;
}
.md-table-wrap td{
  padding:9px 12px;
  color:#3c4942;
  font-size:11px;
  line-height:1.55;
  vertical-align:top;
}

/* Annotations */
.sec-annotations{
  margin-top:12px;
  padding:10px 12px;
  border:0;
  border-left:2px solid #e89a76;
  border-radius:0 8px 8px 0;
  background:#fff8f4;
}
.annotation{
  display:grid;
  grid-template-columns:auto minmax(0,1fr) auto;
  gap:8px;
  align-items:start;
  padding:5px 0;
}
.annotation p{font-size:11px!important;line-height:1.55!important}
.annotation small{padding-top:2px;color:#b26a49;font-size:8px;white-space:nowrap}
.annotation.resolved small{color:var(--green)}
.annotation-actions{display:flex;gap:4px;grid-column:2/4}
.annotation-actions button{
  padding:3px 7px;
  border:1px solid #e3c9bb;
  border-radius:5px;
  background:#fff;
  color:#8b5b45;
  font-size:8px;
  cursor:pointer;
}
.annotation-actions button:hover{border-color:#c78b6d;color:#6e3e28}
.annotation-actions .delete-annotation{color:#9d4a3d}
.section-send-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-top:8px;
  padding-top:9px;
  border-top:1px solid #f0dcd2;
}
.section-send-row>span{font-size:9px;color:#94634d}
.section-send-row button{
  padding:7px 11px;
  border:0;
  border-radius:8px;
  background:var(--orange);
  color:#fff;
  font-size:9px;
  font-weight:700;
  cursor:pointer;
}
.section-send-row button:disabled{opacity:.6;cursor:wait}
.section-send-row button span{margin-left:7px}

/* Ann input */
.ann-input{
  position:relative;
  margin-top:14px;
  padding:15px;
  border:1px solid #d9dfda;
  border-radius:13px;
  background:linear-gradient(145deg,#f7faf8,#f2f5f2);
  box-shadow:0 10px 26px rgba(27,46,36,.06);
}
.ann-input:before{
  content:"";
  position:absolute;
  top:-7px;right:34px;
  width:12px;height:12px;
  border-left:1px solid #d9dfda;
  border-top:1px solid #d9dfda;
  background:#f6f9f7;
  transform:rotate(45deg);
}
.ann-compose-head{display:flex;align-items:flex-start;gap:10px;margin-bottom:10px}
.ann-compose-icon{
  width:28px;height:28px;flex:0 0 auto;
  display:grid;place-items:center;
  border-radius:8px;
  background:#e2eee7;
  color:var(--green);
  font-size:11px;
}
.ann-compose-head>div{display:flex;flex-direction:column;gap:3px}
.ann-compose-head b{font-size:11px;color:#213129}
.ann-compose-head small{font-size:9px;line-height:1.5;color:#748078}
.ann-input textarea{
  display:block;width:100%;
  min-height:80px;
  padding:10px 12px;
  border:1px solid #cfd7d1;
  border-radius:9px;
  background:#fff;
  color:var(--ink);
  font:11px/1.7 Arial,"Microsoft YaHei",sans-serif;
  resize:vertical;outline:none;
  box-shadow:inset 0 1px 2px rgba(20,35,27,.03);
  transition:border-color .15s,box-shadow .15s;
}
.ann-input textarea:focus{border-color:#6c9a83;box-shadow:0 0 0 3px rgba(35,111,89,.1)}
.ann-input textarea::placeholder{color:#a2aaa5}
.ann-input-acts{display:flex;justify-content:flex-end;gap:8px;margin-top:8px}
.ann-input-acts button{min-width:76px;padding:7px 13px;border-radius:8px;font-size:10px;font-weight:700}
.ann-cancel{border:1px solid #d4dad6;background:transparent;color:#657169}
.ann-submit{border:1px solid var(--green);background:var(--green);color:#fff;box-shadow:0 5px 12px rgba(23,79,63,.16)}
.ann-submit:hover{background:var(--green2)}

/* Editing */
.markdown-body.is-editing{max-width:none;width:100%}
.sec-editor{
  display:block;width:100%;max-width:none;
  min-height:280px;
  background:#fbfcfb;
  font:12px/1.75 Consolas,monospace;
}

/* Review actions */
.report-review-actions{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:18px;
  align-items:start;
  margin-top:18px;
}
.global-feedback{
  padding:18px;
  border:1px solid #d9dfda;
  border-radius:14px;
  background:linear-gradient(145deg,#f7faf8,#f2f5f2);
  box-shadow:0 12px 32px rgba(27,46,36,.06);
}
.feedback-head{display:flex;align-items:flex-start;gap:11px}
.feedback-head>span{
  width:30px;height:30px;flex:0 0 auto;
  display:grid;place-items:center;
  border-radius:9px;
  background:#deebe3;
  color:var(--green);
  font-size:11px;
}
.feedback-head>div{display:flex;flex-direction:column;gap:4px}
.feedback-head b{font-size:12px}
.feedback-head small{font-size:9px;line-height:1.55;color:var(--muted)}
.global-feedback textarea{
  display:block;width:100%;
  min-height:90px;
  margin-top:12px;
  padding:11px 13px;
  border:1px solid #ccd5cf;
  border-radius:10px;
  background:#fff;
  color:var(--ink);
  font:11px/1.75 Arial,"Microsoft YaHei",sans-serif;
  resize:vertical;outline:none;
  transition:border-color .15s,box-shadow .15s;
}
.global-feedback textarea:focus{border-color:#6c9a83;box-shadow:0 0 0 3px rgba(35,111,89,.1)}
.global-feedback textarea::placeholder{color:#9fa8a2}
.feedback-submit{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  margin-top:10px;
}
.feedback-submit>span{font-size:9px;color:#7b867f}
.feedback-submit button{
  padding:9px 15px;
  border:0;
  border-radius:8px;
  background:var(--green);
  color:#fff;
  font-size:10px;
  font-weight:700;
  cursor:pointer;
  white-space:nowrap;
}
.feedback-submit button:disabled{opacity:.55;cursor:wait}
.feedback-submit button>span{margin-left:9px}
.synthesis-feedback .feedback-head>span{background:#e6ebf8;color:var(--blue)}
.synthesis-feedback textarea:focus{border-color:#7792cf;box-shadow:0 0 0 3px rgba(39,98,213,.1)}
.synthesis-feedback .feedback-submit button{background:var(--blue)}
.review-next-actions{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:9px;
  margin-top:14px;
  flex-wrap:wrap;
}

/* Mobile */
@media(max-width:900px){
  .report-document{
    grid-template-columns:1fr;
  }
  .report-toc{
    display:none;
  }
  .report-document-body{
    padding:16px 18px 22px;
  }
}
@media(max-width:800px){
  .report-document-body{padding:0 18px 18px}
  .section-card{grid-template-columns:1fr;padding:16px 0}
  .sec-index{margin-bottom:6px}
  .sec-heading{font-size:16px}
  .markdown-body,.markdown-body p{font-size:12px}
  .md-table-wrap{margin-right:-18px;border-radius:8px 0 0 8px}
  .global-feedback{padding:14px}
  .feedback-submit{flex-direction:column;align-items:stretch}
  .feedback-submit button{width:100%}
  .review-next-actions{flex-direction:column;align-items:stretch}
  .review-next-actions button{width:100%}
}
