/* 少量补充样式，主要靠 Tailwind */

html { -webkit-text-size-adjust: 100%; }
body { overflow-wrap: break-word; }

/* 滚动条 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
::-webkit-scrollbar-track { background: transparent; }

/* 代码风格文本域（Prompt 编辑器） */
.prompt-area {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, "Courier New", monospace;
  font-size: 13px;
  line-height: 1.7;
  tab-size: 2;
}

/* 报告页导出长图时需要固定宽度，避免响应式导致排版错乱 */
.exporting #report-body {
  width: 820px !important;
  max-width: none !important;
}

/* html2canvas 自己实现文字排版，基线和行盒算得跟浏览器有偏差，盒子刚好包住文字时
   下半截会被切掉。truncate 带的 overflow:hidden 正好构成这个条件，昵称就只剩上半截。
   导出宽度固定 820px，本来也用不上省略号，截图期间直接放开限制并留出行高余量。 */
.exporting #report-body .truncate {
  overflow: visible !important;
  text-overflow: clip !important;
  white-space: normal !important;
  line-height: 1.6 !important;
}

/* 进度条动画：JS 每 120ms 推一次，这里只负责把两次之间补平。
   时间设太长会和 JS 打架，看起来一顿一顿的。 */
.progress-bar { transition: width .15s linear; }

/* 关键帧图片 */
.frame-img {
  aspect-ratio: 9 / 16;
  object-fit: cover;
  background: #0f172a;
}

/* 折叠面板 */
details > summary { list-style: none; cursor: pointer; }
details > summary::-webkit-details-marker { display: none; }

/* 打印 / 导出时隐藏 */
@media print {
  .no-print { display: none !important; }
}

/* ---------- 报告内容人工编辑 ---------- */

/* 平时完全看不出可编辑：报告随时可能被截屏发给客户，不能有编辑态的痕迹。
   虚线框只在编辑模式下出现。 */
body.editing [data-edit] {
  outline: 1px dashed #a5b4fc;
  outline-offset: 3px;
  border-radius: 3px;
  cursor: text;
}
/* 只有空字段才需要撑出一块可点区域。别对所有字段设 inline-block：
   整段总评本来是块级铺满，一进编辑模式就缩成一行宽，整页排版全跳一下。 */
body.editing [data-edit]:empty {
  display: inline-block;
  min-width: 8rem;
}
body.editing [data-edit]:focus {
  outline: 2px solid #6366f1;
  background: #eef2ff;
}

/* AI 原文被改过的地方，编辑时标出来，好知道哪些是自己写的 */
body.editing [data-edit].edited { outline-color: #f59e0b; }
body.editing [data-edit].edited::after {
  content: '已改';
  font-size: 10px;
  color: #b45309;
  background: #fef3c7;
  border-radius: 3px;
  padding: 0 3px;
  margin-left: 4px;
  vertical-align: middle;
}

/* AI 没写的字段：平时整行收起来，进编辑模式才露出来给人补 */
body.editing [data-edit]:empty::before {
  content: attr(data-hint);
  color: #c7d2fe;
}

/* 保存瞬间闪一下，否则「点到别处就存了」这件事没有任何反馈 */
@keyframes edit-saved { from { background: #dcfce7; } to { background: transparent; } }
[data-edit].saved { animation: edit-saved 1s ease-out; }
