:root {
  --bg: #f7f8fa;
  --panel: #ffffff;
  --primary: #2f6bff;
  --primary-dark: #1f4fd6;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --chip: #eef3ff;
  --user-bubble: #2f6bff;
  --ai-bubble: #ffffff;
  --danger: #ef4444;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(0,0,0,.04);
}
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--text);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
button {
  font-family: inherit; cursor: pointer; border: none; border-radius: 10px;
  padding: 10px 18px; font-size: 14px; font-weight: 600; transition: .15s;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }

/* ---- Markdown 渲染 ---- */
.bubble .md-table-wrap { overflow-x: auto; margin: 8px 0; max-width: 100%; }
.bubble table { border-collapse: collapse; width: 100%; font-size: 13px; background: #fff; }
.bubble th, .bubble td { border: 1px solid var(--border); padding: 6px 10px; text-align: left; vertical-align: top; }
.bubble th { background: #f8fafc; font-weight: 600; white-space: nowrap; }
.bubble tr:nth-child(even) td { background: #fafbfc; }
.bubble h3 { margin: 14px 0 6px; font-size: 15px; font-weight: 700; color: var(--text); }
.bubble h4 { margin: 10px 0 4px; font-size: 14px; font-weight: 600; color: var(--text); }
.bubble h5 { margin: 8px 0 3px; font-size: 13px; font-weight: 600; color: var(--muted); }
.bubble ul { margin: 4px 0; padding-left: 20px; }
.bubble li { margin: 3px 0; line-height: 1.65; }
.bubble p { margin: 5px 0; line-height: 1.7; }
.bubble strong { font-weight: 700; color: var(--text); }
.bubble br + br { display: block; margin-top: 6px; content: ''; }

/* ---- LLM 降级提示 ---- */
.fallback-notice {
  display: inline-block;
  background: #fff7ed;
  color: #b45309;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 13px;
  margin: 0 0 8px 0;
}
