/* Markdown */
.asst-content h1 { font-size: 19px; font-weight: 700; margin: 20px 0 10px; color: var(--text); }
.asst-content h2 { font-size: 16px; font-weight: 700; margin: 18px 0 8px; color: var(--text); }
.asst-content h3 { font-size: 15.5px; font-weight: 700; margin: 14px 0 6px; color: var(--text); }
.asst-content p  { margin-bottom: 12px; }
.asst-content p:last-child { margin-bottom: 0; }
.asst-content ul, .asst-content ol { padding-left: 22px; margin-bottom: 12px; }
.asst-content li { margin-bottom: 5px; }
.asst-content strong { font-weight: 600; color: var(--text); }
.asst-content a { color: var(--text-2); text-decoration: underline; text-decoration-color: rgba(0,0,0,0.2); text-underline-offset: 2px; }
.asst-content a:hover { color: var(--text); text-decoration-color: rgba(0,0,0,0.4); }
.asst-content hr { border: none; border-top: 1px solid var(--border); margin: 16px 0; }
.asst-content img {
  max-width: min(100%, 360px); max-height: 360px; width: auto; height: auto;
  display: block; margin: 10px 0; object-fit: contain;
  border-radius: 10px; border: 1px solid var(--border); cursor: zoom-in;
}
.asst-content blockquote {
  border-left: 3px solid var(--border2);
  padding-left: 14px; color: var(--text-2); margin: 12px 0;
}
.asst-content table { width: 100%; border-collapse: collapse; margin: 14px 0; font-size: 13.5px; }
.asst-content th, .asst-content td { border: 1px solid rgba(0,0,0,0.08); padding: 8px 12px; text-align: left; }
.asst-content th { background: rgba(0,0,0,0.04); font-weight: 600; color: var(--text); }
.asst-content td { color: var(--text-2); }
.asst-content tr:hover td { background: rgba(0,0,0,0.02); }
.asst-content code {
  background: rgba(0,0,0,0.06); padding: 2px 6px; border-radius: 4px;
  font-family: var(--mono); font-size: 12.5px; color: #C0392B;
}
.asst-content pre {
  background: #F7F7F8; border: 1px solid rgba(0,0,0,0.08);
  border-radius: 10px; margin: 12px 0; overflow: hidden;
}
.code-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 14px; border-bottom: 1px solid var(--border);
  font-size: 11.5px; color: var(--text-3); font-family: var(--mono);
}
.copy-code-btn {
  background: transparent; border: none; color: var(--text-3);
  font-size: 11.5px; cursor: pointer; padding: 2px 6px; border-radius: 4px;
  transition: color 0.15s; font-family: var(--font);
}
.copy-code-btn:hover { color: var(--accent); }
.asst-content pre code {
  display: block; padding: 14px; background: transparent;
  color: #24292E; font-size: 13px; line-height: 1.55;
  overflow-x: auto; white-space: pre; border: none; border-radius: 0;
}

/* Thinking dots */
.thinking { display: flex; gap: 5px; padding: 6px 0; align-items: center; }
.thinking span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--text-3);
  animation: blink 1.4s ease-in-out infinite;
}
.thinking span:nth-child(2) { animation-delay: 0.2s; }

/* 思考过程（2026-08-07）：模型 thinking 阶段的实时流，正文一出现就自动收起成一行摘要。
   刻意做得比正文安静——它是过程不是结论，不该跟回答抢注意力。 */
.reasoning {
  margin: 2px 0 10px;
  border-left: 2px solid var(--border2);
  padding-left: 12px;
}
.reasoning-head {
  list-style: none; cursor: pointer;
  font-size: 12px; color: var(--text-3);
  padding: 2px 0; user-select: none;
}
.reasoning-head::-webkit-details-marker { display: none; }
.reasoning-head::before {
  content: "▸"; display: inline-block; width: 12px;
  transition: transform 0.15s ease;
}
.reasoning[open] > .reasoning-head::before { transform: rotate(90deg); }
.reasoning-head:hover { color: var(--text-2); }
.reasoning-body {
  margin-top: 6px; max-height: 220px; overflow-y: auto;
  font-size: 12.5px; line-height: 1.65; color: var(--text-3);
  white-space: pre-wrap; word-break: break-word;
}

/* Processing hint (shown between tool_end and next text) */
.processing-hint {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 12px 4px 10px; border-radius: 20px;
  background: rgba(0,0,0,0.03);
  border: 1px solid rgba(0,0,0,0.06);
  font-size: 12px; color: var(--text-3);
}
.processing-hint span.dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--text-3);
  animation: blink 1.4s ease-in-out infinite;
}
.processing-hint span.dot:nth-child(2) { animation-delay: 0.2s; }
.processing-hint span.dot:nth-child(3) { animation-delay: 0.4s; }
.thinking span:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink {
  0%, 80%, 100% { opacity: 0.25; transform: scale(0.7); }
  40%           { opacity: 1;    transform: scale(1); }
}

/* Streaming cursor — spinning circle */
.stream-cursor {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid var(--text-3);
  border-top-color: var(--text-1);
  border-radius: 50%;
  margin-left: 4px;
  vertical-align: middle;
  animation: stream-spin 0.7s linear infinite;
}
@keyframes stream-spin {
  to { transform: rotate(360deg); }
}

/* ─── Tool status rows (ephemeral, inline) ─── */
.tg-row {
  display: flex; flex-direction: column;
  margin: 2px 0;
  font-size: 12px; color: var(--text-3);
  transition: opacity 0.3s ease;
}
.tg-row.tg-fading { opacity: 0; }
.tg-row-line { display: flex; align-items: center; gap: 8px; }
.tg-spin {
  width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0;
  border: 1.5px solid rgba(0,0,0,0.1);
  border-top-color: var(--text-3);
  animation: spin 0.75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.tg-name { font-family: var(--mono); font-size: 11.5px; flex-shrink: 0; }
.tg-param { font-size: 11px; opacity: 0.65; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 300px; }
.tg-subrows {
  display: flex; flex-direction: column;
  padding: 6px 10px 6px 18px; gap: 2px; margin-top: 4px;
  background: rgba(0,0,0,0.025);
  border-left: 2px solid rgba(0,0,0,0.10);
  border-radius: 0 4px 4px 0;
}
.tg-subrow {
  display: flex; align-items: center; gap: 7px;
  font-size: 11px; color: var(--text-3); opacity: 0.8;
}
.tg-subspin {
  width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
  border: 1.5px solid rgba(0,0,0,0.08);
  border-top-color: var(--text-3);
  animation: spin 0.75s linear infinite;
}
.tg-subrow.done { opacity: 0.4; }
.tg-subrow.done .tg-subspin { animation: none; border-color: transparent; background: var(--text-3); }
.tg-subtext {
  font-family: var(--mono);
  font-size: 10.5px;
  line-height: 1.45;
  color: var(--text-3);
  opacity: 0.75;
  padding: 4px 8px;
  margin: 2px 0;
  max-height: 96px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
  background: rgba(0,0,0,0.03);
  border-left: 2px solid rgba(0,0,0,0.08);
  border-radius: 3px;
}
.tg-subtext::-webkit-scrollbar { width: 4px; height: 4px; }
.tg-subtext::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.15); border-radius: 2px; }
.tg-spin.done {
  animation: none; border-color: transparent;
  background: var(--text-3); opacity: 0.4;
  width: 7px; height: 7px;
}

/* ─── Download buttons (injected by frontend on tool_end) ─── */
.download-block { margin: 6px 0 2px; }
.download-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 14px; border-radius: 8px; text-decoration: none;
  background: rgba(0,0,0,0.04); border: 1px solid rgba(0,0,0,0.1);
  color: var(--text-2); font-size: 12.5px; font-weight: 500;
  transition: background 0.15s;
}
.download-btn:hover { background: rgba(0,0,0,0.08); }
.download-btn svg { flex-shrink: 0; }
.download-size { color: var(--text-3); font-size: 11.5px; font-weight: 400; }

/* ─── OA 登录卡片（injected by frontend on tool_end，需要 OA 手机验证码登录时出现） ───
   刻意不用页面自带的紫色 accent：单独一套克制的暖灰+古铜色调，质感上更接近私人银行/
   金融机构的安全验证组件，而不是聊天界面里一个通用表单。 */
.oa-login-card {
  margin: 10px 0 2px; max-width: 320px;
  padding: 16px 18px 15px; border-radius: 12px;
  background: #FBFAF8;
  border: 1px solid rgba(28,27,25,0.09);
  box-shadow: 0 1px 2px rgba(28,27,25,0.04), 0 8px 22px rgba(28,27,25,0.055);
}
.oa-login-head { display: flex; align-items: center; gap: 7px; }
.oa-login-head svg { flex-shrink: 0; color: #9C7A3C; }
.oa-login-title { font-size: 13px; font-weight: 600; letter-spacing: 0.01em; color: #1C1B19; }
/* 系统徽标：两套 OA 登录态互相独立，卡片必须一眼看出这次登的是哪一套 */
.oa-login-sys {
  margin-left: auto; padding: 2px 7px; border-radius: 4px;
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.02em;
  color: #75601F; background: #F4EEDF; border: 1px solid #E0CF9E;
}
.oa-login-sub { font-size: 11px; color: var(--text-3); margin: 3px 0 14px 22px; }
.oa-login-field { margin-bottom: 14px; }
.oa-login-field:last-of-type { margin-bottom: 0; }
.oa-login-field-row { display: flex; align-items: flex-end; gap: 10px; }
.oa-login-label {
  display: block; font-size: 10px; color: var(--text-3);
  text-transform: uppercase; letter-spacing: 0.07em; margin-bottom: 5px;
}
.oa-login-input {
  width: 100%; min-width: 0; padding: 3px 1px 7px; font-size: 13.5px;
  border: none; border-bottom: 1px solid rgba(28,27,25,0.16); background: transparent;
  color: #1C1B19; outline: none; font-family: var(--font); transition: border-color 0.15s;
}
.oa-login-input:focus { border-bottom-color: #9C7A3C; }
.oa-login-input:disabled { color: var(--text-3); border-bottom-style: dotted; }
.oa-login-input::placeholder { color: var(--text-3); }
.oa-login-link-btn {
  flex-shrink: 0; padding: 0 0 7px; font-size: 12px; font-weight: 500;
  border: none; background: none; color: #9C7A3C; cursor: pointer;
  white-space: nowrap; transition: color 0.15s;
}
.oa-login-link-btn:hover:not(:disabled) { color: #75601F; }
.oa-login-link-btn:disabled { color: var(--text-3); cursor: default; }
.oa-login-submit {
  margin-top: 16px; width: 100%; padding: 9px; font-size: 12.5px; font-weight: 600;
  letter-spacing: 0.02em; border: none; border-radius: 8px;
  background: #1C1B19; color: #F1E6CE; cursor: pointer; transition: background 0.15s, opacity 0.15s;
}
.oa-login-submit:hover:not(:disabled) { background: #34322D; }
.oa-login-submit:disabled { opacity: 0.4; cursor: default; }
.oa-login-status { font-size: 11.5px; margin-top: 10px; min-height: 14px; }
.oa-login-status.pending { color: var(--text-3); }
.oa-login-status.err { color: #B23A3A; }
.oa-login-done { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: #2F6F4E; font-weight: 500; }
.oa-login-done svg { flex-shrink: 0; }
.oa-login-done-hint { font-size: 11px; color: var(--text-3); margin-top: 3px; }
@media (prefers-reduced-motion: no-preference) {
  .oa-login-done-wrap { animation: oaLoginIn 0.4s ease; }
}
@keyframes oaLoginIn { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: translateY(0); } }

