/* APP WebView 低性能模式：降低重绘成本，保留背景机器人遮挡设计 */

html.webview-low-perf .chat-bubble,
html.webview-low-perf .page[data-page="home"].active .chat-row.user .chat-bubble,
html.webview-low-perf .page[data-page="home"].active .chat-row.assistant .chat-bubble {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

html.webview-low-perf .composer,
html.webview-low-perf .tabbar {
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
}

html.webview-low-perf .home-chat-bg,
html.webview-low-perf .page[data-page="home"].active .home-chat-bg {
  will-change: auto;
  transform: translateZ(0);
}

/* Markdown 安全格式化（流式结束后） */
.chat-bubble.chat-body-formatted {
  white-space: normal;
  word-break: break-word;
  overflow-wrap: break-word;
  line-height: 1.55;
}

.chat-bubble.chat-body-formatted .md-h {
  font-weight: 600;
  margin: 10px 0 6px;
  line-height: 1.35;
}

.chat-bubble.chat-body-formatted .md-h1 { font-size: 1.08em; }
.chat-bubble.chat-body-formatted .md-h2 { font-size: 1.04em; }
.chat-bubble.chat-body-formatted .md-h3,
.chat-bubble.chat-body-formatted .md-h4 { font-size: 1em; }

.chat-bubble.chat-body-formatted .md-p {
  margin: 6px 0;
}

.chat-bubble.chat-body-formatted .md-ul {
  margin: 6px 0 6px 1.1em;
  padding: 0;
  list-style: disc;
}

.chat-bubble.chat-body-formatted .md-ul.md-ol {
  list-style: decimal;
}

.chat-bubble.chat-body-formatted .md-li {
  margin: 4px 0;
}

.chat-bubble.chat-body-formatted .md-code {
  font-family: ui-monospace, monospace;
  font-size: 0.92em;
  opacity: 0.92;
}
