/**
 * 益泰 AI 产业助手 - Taste 风格改造
 * 目标：去掉纯平大黑框，用 subtle 渐变、纹理、深度、精致卡片营造 calm-premium SaaS 质感
 * design-taste-frontend dials: variance 5 / motion 4 / density 5
 *
 * TODO 拆分计划（3082行 → 5个模块文件）：
 *   ai-messages.css  — 消息气泡、操作、thinking 动画、系统消息、Markdown 渲染
 *   ai-cards.css     — 聚类卡、报告卡、搜索卡、分析卡、对比卡、图表、内联卡片
 *   ai-welcome.css   — Kimi 欢迎页、Launcher、新手卡、话题流程、建议词条
 *   ai-panels.css    — 模态框、登录表单、输入栏、空状态、加载态、骨架屏、帮助中心
 *   ai-utilities.css — 工具类、Switch 开关、路由提示、高级提示、紧凑模式、打印样式
 */

/* ===================== 聚类模块 ===================== */

.ai-cluster-panel {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.ai-cluster-intro {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--ai-border);
  margin-bottom: 16px;
}

.ai-cluster-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  overflow-y: auto;
}

.ai-cluster-card {
  background: var(--ai-card);
  border: 1px solid var(--ai-border);
  border-radius: var(--radius);
  padding: 16px;
  transition: background-color 0.2s var(--ease-out), border-color 0.2s var(--ease-out), color 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out), transform 0.15s var(--ease-out), opacity 0.2s var(--ease-out);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

/* Hallmark audit fix: removed top-stripe pseudo-element (side-stripe AI tell) */
.ai-cluster-card:hover {
  border-color: var(--ai-border-highlight);
  box-shadow: var(--ai-shadow-md);
}

.ai-cluster-header {
  margin-bottom: 12px;
}

.ai-cluster-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--ai-text);
  margin-bottom: 4px;
}

.ai-cluster-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.ai-cluster-actions {
  padding-top: 12px;
  border-top: 1px solid var(--ai-border);
}

/* 聚类卡片顶部元数据行 */
.ai-cluster-meta-row {
  display: flex; align-items: center; gap: 8px; margin-bottom: 8px;
}
.ai-cluster-rank {
  font-size: 11px; color: var(--ai-text-muted); font-family: "SF Mono", "Cascadia Code", monospace;
  min-width: 20px;
}
.ai-cluster-patent-tag {
  font-size: 11px; padding: 3px 10px; border-radius: 12px; font-weight: 500;
}
.ai-cluster-star {
  font-size: 13px; color: #D4A00E;
}
.ai-cluster-trend-up {
  font-size: 13px; color: #10B981;
}
.ai-cluster-trend-stable {
  font-size: 13px; color: var(--ai-text-muted);
}

/* 聚类卡片统计行 */
.ai-cluster-stats-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; margin-top: 4px;
}
.ai-cluster-growth {
  font-size: 12px; font-weight: 600; color: #10B981;
}
.ai-cluster-innov {
  font-size: 12px; color: var(--ai-text-muted);
}

/* 聚类关键词标签 */
.ai-cluster-kw-tag {
  font-size: 11px; padding: 3px 10px; border-radius: 10px;
  background: var(--ai-bg-1); color: var(--ai-text-secondary);
  border: 1px solid var(--ai-border);
}

/* 聚类详情按钮 */
.ai-cluster-detail-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  width: 100%; padding: 8px 0; border-radius: 6px; border: none;
  background: transparent; color: var(--ai-text-secondary);
  font-size: 13px; cursor: pointer; transition: background-color 0.2s var(--ease-out), border-color 0.2s var(--ease-out), color 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out), transform 0.15s var(--ease-out), opacity 0.2s var(--ease-out);
}
.ai-cluster-detail-btn:hover {
  background: var(--ai-primary-soft); color: var(--ai-primary);
}

/* 高价值创新 / 新兴趋势 芯片列表 */
.ai-cluster-highlights-list,
.ai-cluster-trends-list {
  display: flex; flex-wrap: wrap; gap: 8px;
}

/* 聚类详情模态框 */
.ai-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 20px;
}

.ai-modal-content {
  background: var(--ai-surface);
  border: 1px solid var(--ai-border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.ai-modal-content.large {
  max-width: 900px;
}

.ai-modal-content.xlarge {
  max-width: 1100px;
}

.ai-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 20px;
  border-bottom: 1px solid var(--ai-border);
  position: sticky;
  top: 0;
  background: var(--ai-surface);
  z-index: 10;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.ai-modal-header h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--ai-text);
  margin: 0;
}

.ai-modal-body {
  padding: 20px;
}

.ai-modal-body.report-preview {
  padding: 32px;
  line-height: 1.8;
}

.ai-modal-body.report-preview h4 {
  font-size: 16px;
  font-weight: 600;
  color: var(--ai-text);
  margin: 24px 0 12px;
  padding-left: 12px;
  border-left: 3px solid var(--ai-primary);
}

.ai-modal-body.report-preview p {
  color: var(--ai-text-secondary);
  font-size: 14px;
  margin: 0 0 12px;
  text-align: justify;
}

.ai-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 20px;
  border-top: 1px solid var(--ai-border);
  position: sticky;
  bottom: 0;
  background: var(--ai-surface);
  z-index: 10;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* ===================== 模态框通用组件（表单 + 按钮，AI 主题） ===================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 13px; font-weight: 500; line-height: 1;
  padding: 9px 16px; border-radius: var(--radius-sm);
  border: 1px solid transparent; cursor: pointer;
  transition: background-color 0.2s var(--ease-out), border-color 0.2s var(--ease-out), color 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out), transform 0.15s var(--ease-out);
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-xs { padding: 4px 10px; font-size: 12px; }
.btn-primary { background: var(--ai-primary); color: #fff; border-color: var(--ai-primary); }
.btn-primary:hover { background: var(--ai-primary-hover); box-shadow: 0 0 16px var(--ai-primary-glow); }
.btn-outline { background: transparent; color: var(--ai-text-secondary); border-color: var(--ai-border); }
.btn-outline:hover { color: var(--ai-text); border-color: var(--ai-primary); background: var(--ai-primary-soft); }
.btn-ghost { background: transparent; color: var(--ai-text-muted); }
.btn-ghost:hover { color: var(--ai-text); background: var(--ai-border-highlight); }

.form-label { display: block; font-size: 12px; font-weight: 600; color: var(--ai-text-secondary); margin: 0 0 6px; }
.form-input, .form-select {
  width: 100%; padding: 10px 12px; font-size: 13px; line-height: 1.6;
  color: var(--ai-text); background: var(--ai-bg-1);
  border: 1px solid var(--ai-border); border-radius: var(--radius-sm); outline: none;
  transition: border-color 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
}
.form-input:focus, .form-select:focus { border-color: var(--ai-primary); box-shadow: 0 0 0 3px var(--ai-primary-soft); }
.form-input::placeholder { color: var(--ai-text-muted); }
textarea.form-input { resize: vertical; min-height: 80px; }

/* ===================== 登录/注册表单 ===================== */
.ai-auth-body {
  padding: 28px 32px 24px;
}
.ai-auth-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 24px;
  background: var(--ai-bg-1);
  border-radius: var(--radius);
  padding: 4px;
}
.ai-auth-tab {
  flex: 1;
  padding: 10px 0;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--ai-text-muted);
  background: transparent;
  border: none;
  border-radius: calc(var(--radius) - 2px);
  cursor: pointer;
  transition: background-color 0.2s var(--ease-out), border-color 0.2s var(--ease-out), color 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out), transform 0.15s var(--ease-out), opacity 0.2s var(--ease-out);
}
.ai-auth-tab.active {
  background: var(--ai-surface);
  color: var(--ai-text);
  box-shadow: var(--ai-shadow-sm);
}
.ai-auth-field {
  margin-bottom: 18px;
}
.ai-auth-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--ai-text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.ai-auth-input {
  width: 100%;
  padding: 11px 14px;
  background: var(--ai-bg-1);
  border: 1px solid var(--ai-border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--ai-text);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.ai-auth-input::placeholder {
  color: var(--ai-text-muted);
  opacity: 0.7;
}
.ai-auth-input:focus {
  border-color: var(--ai-primary);
  box-shadow: 0 0 0 3px var(--ai-primary-soft);
}
.ai-auth-submit {
  width: 100%;
  padding: 12px 0;
  background: var(--ai-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s var(--ease-out), border-color 0.2s var(--ease-out), color 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out), transform 0.15s var(--ease-out), opacity 0.2s var(--ease-out);
  margin-top: 8px;
}
.ai-auth-submit:hover {
  background: var(--ai-primary-hover);
  box-shadow: var(--ai-shadow-md);
}
.ai-auth-alt {
  text-align: center;
  margin-top: 20px;
  font-size: 13px;
  color: var(--ai-text-muted);
}
.ai-auth-alt a {
  color: var(--ai-primary);
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
}
.ai-auth-alt a:hover {
  text-decoration: underline;
}
.ai-auth-extras {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 4px;
}
.ai-auth-check {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--ai-text-secondary);
  cursor: pointer;
}
.ai-auth-check input[type="checkbox"] {
  accent-color: var(--ai-primary);
}
.ai-auth-forgot {
  color: var(--ai-primary);
  text-decoration: none;
  font-weight: 500;
  cursor: pointer;
}
.ai-auth-forgot:hover {
  text-decoration: underline;
}
.ai-auth-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: var(--ai-bg-1);
  color: var(--ai-text-muted);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s var(--ease-out), transform 0.15s var(--ease-out), opacity 0.15s var(--ease-out);
}
.ai-auth-close:hover {
  background: var(--ai-bg-2);
  color: var(--ai-text);
}
.ai-auth-brand {
  text-align: center;
  margin-bottom: 20px;
}
.ai-auth-brand-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--ai-primary), var(--ai-secondary));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: #fff;
  margin-bottom: 10px;
}
.ai-auth-brand h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--ai-text);
  margin: 0;
}
.ai-auth-brand p {
  font-size: 12px;
  color: var(--ai-text-muted);
  margin: 4px 0 0;
}
/* ===================== 灵感收藏模块 ===================== */

.ai-inspiration-panel {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.ai-inspiration-intro {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--ai-border);
  margin-bottom: 16px;
}

/* ===================== 搜索模块增强 ===================== */

.ai-results-toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.ai-results-toolbar .ai-btn-sm {
  transition: background-color 0.2s var(--ease-out), border-color 0.2s var(--ease-out), color 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out), transform 0.15s var(--ease-out), opacity 0.2s var(--ease-out);
}

.ai-results-toolbar .ai-btn-sm:hover {
  transform: translateY(-1px);
}

/* ===================== 分析模块增强 ===================== */

.ai-analysis-insights {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.ai-insight-card {
  background: var(--ai-card);
  border: 1px solid var(--ai-border);
  border-radius: 12px;
  padding: 18px;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.ai-insight-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--ai-shadow-md);
  border-color: var(--ai-border-highlight);
}

.ai-insight-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.03), transparent);
  pointer-events: none;
}

.ai-insight-card .ai-card-header {
  font-weight: 600;
  font-size: 14px;
  color: var(--ai-text);
  margin-bottom: 8px;
  padding-right: 60px;
  position: relative;
  z-index: 1;
}

.ai-cluster-detail-title-row {
  display: flex; align-items: center; gap: 10px; margin-bottom: 4px;
}
.ai-cluster-detail-title-row h3 {
  font-size: 18px; font-weight: 700; color: var(--ai-text); margin: 0;
}
.ai-cluster-detail-patent-tag {
  font-size: 12px; padding: 4px 12px; border-radius: 14px; font-weight: 500;
}
.ai-cluster-detail-stats {
  display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ai-text-secondary);
}
.ai-cluster-detail-sep {
  color: var(--ai-border-highlight);
}

/* 模态框按钮 */
.ai-modal-close-btn {
  background: none; border: none; color: var(--ai-text-muted);
  font-size: 18px; cursor: pointer; padding: 4px; border-radius: 6px;
  transition: background-color 0.2s var(--ease-out), border-color 0.2s var(--ease-out), color 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out), transform 0.15s var(--ease-out), opacity 0.2s var(--ease-out); flex-shrink: 0;
}
.ai-modal-close-btn:hover { color: var(--ai-text); background: var(--ai-bg-1); }
.ai-modal-btn-primary {
  padding: 8px 16px; border-radius: 8px; border: none; cursor: pointer;
  font-size: 13px; font-weight: 500; background: var(--ai-primary); color: #fff;
  transition: background 0.2s; display: inline-flex; align-items: center; gap: 6px;
}
.ai-modal-btn-primary:hover { background: var(--ai-primary-hover); }
.ai-modal-btn-secondary {
  padding: 8px 16px; border-radius: 8px; border: 1px solid var(--ai-border); cursor: pointer;
  font-size: 13px; font-weight: 500; background: transparent; color: var(--ai-text-secondary);
  transition: background-color 0.2s var(--ease-out), border-color 0.2s var(--ease-out), color 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out), transform 0.15s var(--ease-out), opacity 0.2s var(--ease-out); display: inline-flex; align-items: center; gap: 6px;
}
.ai-modal-btn-secondary:hover {
  border-color: var(--ai-border-highlight); color: var(--ai-text);
  background: var(--ai-bg-1);
}

/* ===================== 产业分析模块 ===================== */

.ai-analysis-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; flex-wrap: wrap; gap: 12px;
}
.ai-analysis-header h2 {
  font-size: 20px; font-weight: 700; color: var(--ai-text); margin: 0;
  display: flex; align-items: center; gap: 10px;
}

.ai-industry-chips {
  display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px;
}
.ai-industry-chip {
  padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 500;
  border: 1px solid var(--ai-border); background: var(--ai-card);
  color: var(--ai-text-secondary); cursor: pointer; white-space: nowrap;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease, opacity 0.2s ease;
}
.ai-industry-chip:hover {
  border-color: var(--ai-border-highlight);
  color: var(--ai-text); background: var(--ai-surface-elevated);
}
.ai-industry-chip.active {
  background: var(--ai-primary); border-color: var(--ai-primary); color: #fff;
}

.ai-analysis-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px; margin-bottom: 18px;
}
@media (max-width: 768px) { .ai-analysis-grid { grid-template-columns: 1fr; } }

.ai-insight-card .ai-insight-accent {
  position: absolute; top: 0; right: 0; width: 56px; height: 56px;
  border-radius: 0 12px 0 12px; display: flex;
  align-items: center; justify-content: center; opacity: 0.12;
}
.ai-insight-card .ai-insight-icon {
  position: absolute; top: 14px; right: 14px; font-size: 22px; z-index: 1;
}
.ai-insight-card .ai-insight-title {
  font-weight: 600; font-size: 14px; color: var(--ai-text);
  margin-bottom: 8px; padding-right: 48px;
}
.ai-insight-card .ai-insight-text {
  font-size: 13px; color: var(--ai-text-secondary); line-height: 1.65;
}

.ai-chart-card {
  background: var(--ai-card); border: 1px solid var(--ai-border);
  border-radius: 12px; padding: 20px; margin-bottom: 18px;
}
.ai-chart-card .ai-chart-title {
  font-weight: 600; font-size: 14px; color: var(--ai-text); margin-bottom: 14px;
  display: flex; align-items: center; gap: 8px;
}

.ai-summary-card {
  background: var(--ai-card); border: 1px solid var(--ai-border);
  border-radius: 12px; padding: 20px; margin-bottom: 18px;
}
.ai-summary-card .ai-summary-title {
  font-weight: 600; font-size: 14px; color: var(--ai-text); margin-bottom: 10px;
}
.ai-summary-card .ai-summary-text {
  font-size: 13px; color: var(--ai-text-secondary); line-height: 1.7; margin: 0 0 14px 0;
}
.ai-summary-tags {
  display: flex; gap: 8px; flex-wrap: wrap;
}
.ai-summary-tag {
  font-size: 12px; padding: 5px 12px; border-radius: 12px;
  background: var(--ai-primary-soft); color: var(--ai-primary);
  font-weight: 500;
}

.ai-compare-card {
  background: var(--ai-card); border: 1px solid var(--ai-border);
  border-radius: 12px; padding: 20px; margin-bottom: 18px;
}
.ai-compare-title {
  font-weight: 600; font-size: 14px; color: var(--ai-text); margin-bottom: 14px;
}
.ai-compare-list {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px; margin-bottom: 16px;
}
.ai-compare-item {
  background: var(--ai-bg-1); border: 1px solid var(--ai-border);
  border-radius: 10px; padding: 14px; transition: border-color 0.2s;
}
.ai-compare-item:hover { border-color: var(--ai-border-highlight); }
.ai-compare-name {
  font-weight: 600; color: var(--ai-text); font-size: 14px; margin-bottom: 4px;
}
.ai-compare-meta {
  font-size: 12px; color: var(--ai-text-secondary); margin-bottom: 10px;
}
.ai-compare-bar-bg {
  height: 6px; background: var(--ai-border); border-radius: 3px; overflow: hidden;
}
.ai-compare-bar-fill {
  height: 100%; border-radius: 3px;
  background: linear-gradient(90deg, var(--ai-primary), var(--ai-secondary));
}
.ai-compare-btn {
  padding: 9px 18px; border-radius: 8px; background: var(--ai-primary);
  color: #fff; border: none; cursor: pointer; font-size: 13px; font-weight: 500;
  transition: background 0.2s, transform 0.15s;
}
.ai-compare-btn:hover { background: var(--ai-primary-hover); transform: translateY(-1px); }

/* ===================== 技术集群增强 ===================== */

.ai-cluster-highlights {
  margin-top: 16px; padding: 14px 16px;
  background: linear-gradient(135deg, rgba(251,191,36,0.06), rgba(0,103,255,0.06));
  border: 1px solid rgba(251,191,36,0.18); border-radius: 10px;
}
.ai-cluster-highlights-label {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 600; color: #D4A00E; margin-bottom: 10px;
}
.ai-cluster-highlight-chip {
  font-size: 12px; padding: 5px 12px; border-radius: 14px; cursor: pointer;
  font-weight: 500; border: 1px solid transparent;
  transition: transform 0.15s, border-color 0.2s;
}
.ai-cluster-highlight-chip:hover {
  transform: scale(1.04); border-color: currentColor;
}

.ai-cluster-trends {
  margin-top: 14px; padding: 14px 16px;
  background: linear-gradient(135deg, rgba(52,211,153,0.06), rgba(0,103,255,0.06));
  border: 1px solid rgba(52,211,153,0.18); border-radius: 10px;
}
.ai-cluster-trends-label {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 600; color: #10B981; margin-bottom: 10px;
}
.ai-cluster-trend-chip {
  font-size: 12px; padding: 5px 12px; border-radius: 14px; cursor: pointer;
  font-weight: 500; border: 1px solid transparent;
  background: rgba(52,211,153,0.08); color: #10B981;
  transition: transform 0.15s, border-color 0.2s;
}
.ai-cluster-trend-chip:hover {
  transform: scale(1.04); border-color: #10B981;
}

.ai-cluster-footer {
  margin-top: 16px; padding: 12px 14px;
  background: var(--ai-card); border: 1px solid var(--ai-border);
  border-radius: 8px; display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--ai-text-muted);
}

/* 聚类详情模态框 */
.ai-cluster-detail-modal {
  max-width: 640px; width: 100%; max-height: 85vh; overflow-y: auto;
  background: var(--ai-surface); border: 1px solid var(--ai-border);
  border-radius: 16px; box-shadow: var(--ai-shadow-xl, 0 20px 60px rgba(0,0,0,0.4));
}
.ai-cluster-detail-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 20px 24px 16px; border-bottom: 1px solid var(--ai-border);
}
.ai-cluster-detail-header h3 {
  font-size: 18px; font-weight: 700; color: var(--ai-text); margin: 0 0 4px 0;
}
.ai-cluster-detail-body { padding: 20px 24px; }

.ai-cluster-detail-meta {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
  margin-bottom: 18px; padding: 14px 16px;
  background: var(--ai-bg-1); border: 1px solid var(--ai-border);
  border-radius: 10px;
}
.ai-cluster-meta-item-label {
  font-size: 11px; color: var(--ai-text-muted); margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.04em;
}
.ai-cluster-meta-item-value { font-size: 14px; font-weight: 600; color: var(--ai-text); }
.ai-cluster-innov-bar-bg {
  flex: 1; height: 8px; background: var(--ai-border); border-radius: 4px; overflow: hidden;
}
.ai-cluster-innov-bar-fill {
  height: 100%; border-radius: 4px; background: var(--ai-primary);
}

.ai-cluster-section {
  margin-bottom: 18px;
}
.ai-cluster-section-title {
  font-size: 13px; font-weight: 600; color: var(--ai-text); margin-bottom: 10px;
  display: flex; align-items: center; gap: 6px;
}
.ai-cluster-tag-list { display: flex; flex-wrap: wrap; gap: 8px; }
.ai-cluster-tag {
  font-size: 12px; padding: 5px 12px; border-radius: 14px;
  background: var(--ai-primary-soft); color: var(--ai-primary); font-weight: 500;
}
.ai-cluster-tag-blue {
  background: rgba(0,103,255,0.08); color: var(--ai-primary);
}
.ai-cluster-tag-green {
  background: rgba(52,211,153,0.08); color: #10B981;
}

.ai-cluster-emerging {
  padding: 14px 16px; margin-bottom: 18px;
  background: linear-gradient(135deg, rgba(0,103,255,0.04), rgba(139,92,246,0.04));
  border: 1px solid rgba(0,103,255,0.15); border-radius: 10px;
}
.ai-cluster-cross-domain {
  padding: 14px 16px; margin-bottom: 18px;
  background: linear-gradient(135deg, rgba(52,211,153,0.04), rgba(0,103,255,0.04));
  border: 1px solid rgba(52,211,153,0.15); border-radius: 10px;
}

.ai-cluster-related-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; background: var(--ai-bg-1); border-radius: 8px;
  cursor: pointer; transition: background 0.2s; margin-bottom: 6px;
}
.ai-cluster-related-item:hover { background: var(--ai-primary-soft); }
.ai-cluster-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}

.ai-search-panel {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.ai-search-intro {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--ai-border);
  margin-bottom: 16px;
}

.ai-search-history,
.ai-search-suggestions {
  margin-bottom: 16px;
}

/* ===================== 报告模块 ===================== */

.ai-reports-panel {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.ai-reports-intro {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--ai-border);
  margin-bottom: 16px;
}

.ai-reports-templates {
  margin-bottom: 16px;
}

.ai-report-template {
  padding: 12px;
  background: var(--ai-card);
  border: 1px solid var(--ai-border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background-color 0.2s var(--ease-out), border-color 0.2s var(--ease-out), color 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out), transform 0.15s var(--ease-out), opacity 0.2s var(--ease-out);
}

.ai-report-template:hover {
  border-color: var(--ai-border-highlight);
  transform: translateY(-2px);
  box-shadow: var(--ai-shadow);
}

.ai-recent-reports {
  flex: 1;
  overflow-y: auto;
}

.ai-recent-reports .ai-report-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--ai-card);
  border: 1px solid var(--ai-border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background-color 0.2s var(--ease-out), border-color 0.2s var(--ease-out), color 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out), transform 0.15s var(--ease-out), opacity 0.2s var(--ease-out);
}

.ai-recent-reports .ai-report-item:hover {
  border-color: var(--ai-border-highlight);
  background: var(--ai-surface);
}

/* 主内容区报告模块 */
.ai-reports-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.ai-report-item {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  background: var(--ai-card);
  border: 1px solid var(--ai-border);
  border-radius: var(--radius);
  transition: background-color 0.2s var(--ease-out), border-color 0.2s var(--ease-out), color 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out), transform 0.15s var(--ease-out), opacity 0.2s var(--ease-out);
}

.ai-report-item:hover {
  border-color: var(--ai-border-highlight);
  transform: translateY(-2px);
  box-shadow: var(--ai-shadow-md);
}

.ai-report-item .ai-report-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ai-report-item .ai-report-type {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(245, 158, 11, 0.15);
  color: var(--ai-warning);
  font-weight: 500;
}

.ai-report-item .ai-report-date {
  font-size: 12px;
  color: var(--ai-text-secondary);
}

.ai-report-item .ai-report-title {
  font-weight: 600;
  font-size: 15px;
  color: var(--ai-text);
  line-height: 1.5;
  margin: 0;
}

.ai-report-item .ai-report-meta {
  font-size: 12px;
  color: var(--ai-text-secondary);
  margin: 0;
}

.ai-report-item .ai-report-summary {
  font-size: 13px;
  color: var(--ai-text-secondary);
  line-height: 1.6;
  margin: 0;
  flex: 1;
}

.ai-report-item .ai-report-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
  padding-top: 8px;
}

.ai-report-item .btn-primary {
  background: var(--ai-primary);
  color: #fff;
}

.ai-report-item .btn-primary:hover {
  background: var(--ai-primary-hover);
}

.ai-report-item .btn-outline {
  background: var(--ai-border-highlight);
  color: var(--ai-text);
}

.ai-report-item .btn-outline:hover {
  background: var(--ai-surface);
  color: var(--ai-primary);
}

/* ===================== 搜索模块样式 ===================== */

.ai-search-suggestions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ai-suggestion-label {
  font-size: 12px;
  color: var(--ai-text-muted);
  margin: 0;
}

.ai-suggestion-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.ai-suggestion-chip {
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 16px;
  background: var(--ai-card);
  border: 1px solid var(--ai-border);
  color: var(--ai-text-secondary);
  cursor: pointer;
  transition: background-color 0.2s var(--ease-out), border-color 0.2s var(--ease-out), color 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out), transform 0.15s var(--ease-out), opacity 0.2s var(--ease-out);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.ai-suggestion-chip:hover {
  background: var(--ai-surface);
  border-color: var(--ai-border-highlight);
  color: var(--ai-text);
}

.ai-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.ai-tabs::-webkit-scrollbar {
  height: 4px;
}

.ai-tabs::-webkit-scrollbar-thumb {
  background: var(--ai-border);
  border-radius: 2px;
}

.ai-results-count {
  font-size: 13px;
  color: var(--ai-text-secondary);
  margin: 0 0 12px;
}

/* 检索结果网格：响应式多列，避免单列窄卡片留下大片空白 */
.ai-results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.ai-results-toolbar {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--ai-border);
  flex-wrap: wrap;
}

/* 通用小按钮 */
.ai-btn-sm {
  font-size: 13px;
  padding: 8px 14px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s var(--ease-out), border-color 0.2s var(--ease-out), color 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out), transform 0.15s var(--ease-out), opacity 0.2s var(--ease-out);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.ai-btn-sm.btn-primary {
  background: var(--ai-primary);
  color: #fff;
}

.ai-btn-sm.btn-primary:hover {
  background: var(--ai-primary-hover);
}

.ai-btn-sm.btn-outline {
  background: var(--ai-border-highlight);
  color: var(--ai-text);
}

.ai-btn-sm.btn-outline:hover {
  background: var(--ai-surface);
  color: var(--ai-primary);
}

/* 批量操作工具栏 */
.ai-batch-toolbar {
  display: none;
  gap: 8px;
  margin-top: 16px;
  padding: 12px;
  background: var(--ai-surface);
  border: 1px solid var(--ai-primary);
  border-radius: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.ai-batch-toolbar.show {
  display: flex;
}

.ai-batch-toolbar .batch-info {
  font-size: 13px;
  color: var(--ai-text-secondary);
}

.ai-batch-toolbar .batch-count {
  color: var(--ai-primary);
  font-weight: 600;
}

.ai-batch-toolbar .flex-spacer {
  flex: 1;
}

/* ===================== 底部输入栏 - Floating Bar ===================== */
.ai-inputbar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 24px;
  width: min(720px, calc(100% - 160px));
  z-index: 950;
  display: flex;
  justify-content: center;
  flex-direction: column;
  align-items: center;
}

.ai-inputbar-inner {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 18px 16px;
  background: var(--ai-glass);
  border: 1px solid var(--ai-border-highlight);
  border-radius: 20px;
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease, opacity 0.2s ease;
}

.ai-inputbar-inner:focus-within {
  border-color: rgba(43, 127, 255, 0.35);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.45),
    0 0 0 3px rgba(43, 127, 255, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.ai-mode-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 2px;
}

.ai-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: transparent;
  border: 1px solid transparent;
  color: var(--ai-text-muted);
  font-size: 12px;
  font-weight: 500;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease, opacity 0.2s ease;
}

.ai-chip:hover {
  color: var(--ai-text-secondary);
  background: rgba(148, 163, 184, 0.08);
}

.ai-chip.active {
  color: var(--ai-primary);
  background: var(--ai-primary-soft);
  border-color: rgba(43, 127, 255, 0.2);
}

.ai-inputbox {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 6px 10px;
  background: rgba(26, 35, 50, 0.7);
  border: 1px solid var(--ai-border);
  border-radius: 14px;
}

.ai-input {
  flex: 1;
  min-height: 24px;
  max-height: 140px;
  padding: 6px 4px;
  background: transparent;
  border: none;
  outline: none;
  color: var(--ai-text);
  font-size: 15px;
  line-height: 1.5;
  resize: none;
}

.ai-input::placeholder {
  color: var(--ai-text-muted);
}

.ai-send-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--ai-primary);
  color: #fff;
  flex-shrink: 0;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease, opacity 0.2s ease;
}

.ai-send-btn:hover {
  background: var(--ai-primary-hover);
  box-shadow: 0 0 16px var(--ai-primary-glow);
}

.ai-send-btn i {
  font-size: 16px;
}

.ai-enhance-btn {
  background: transparent;
  color: var(--ai-primary);
  border: 1px solid var(--ai-primary);
}
.ai-enhance-btn:hover {
  background: var(--ai-primary-soft);
  box-shadow: 0 0 12px var(--ai-primary-glow);
}

.ai-input-hint {
  display: flex;
  justify-content: center;
  font-size: 11px;
  color: var(--ai-text-muted);
}

.ai-input-hint i {
  margin-right: 5px;
  font-size: 12px;
}

/* ===================== 消息气泡 ===================== */
.ai-message {
  display: flex;
  width: 100%;
  margin-bottom: 24px;
  animation: ai-fade-in 0.35s ease;
}

.ai-message-user {
  justify-content: flex-end;
}

.ai-message-ai {
  justify-content: flex-start;
}

.ai-message-inner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  max-width: min(85%, 720px);
}

.ai-message-user .ai-message-inner {
  flex-direction: row-reverse;
}

.ai-avatar {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--ai-primary), var(--ai-secondary));
  color: #fff;
  box-shadow: 0 4px 14px rgba(43, 127, 255, 0.25);
}

.ai-avatar i {
  font-size: 16px;
}

.ai-message-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ai-bubble {
  padding: 13px 17px;
  border-radius: 18px;
  font-size: 14.5px;
  line-height: 1.65;
  word-break: break-word;
  box-shadow: var(--ai-shadow-sm);
}

.ai-message-user .ai-bubble {
  background: linear-gradient(135deg, var(--ai-primary) 0%, var(--ai-primary-gradient-end) 100%);
  color: #fff;
  border-bottom-right-radius: 6px;
  box-shadow: 0 6px 18px rgba(43, 127, 255, 0.22);
}

.ai-message-ai .ai-bubble {
  background: var(--ai-card);
  color: var(--ai-text);
  border: 1px solid var(--ai-border);
  border-bottom-left-radius: 6px;
}

.ai-message-meta {
  font-size: 11px;
  color: var(--ai-text-muted);
  text-align: right;
}

.ai-message-ai .ai-message-meta {
  text-align: left;
}

/* ===================== 消息操作 ===================== */

.ai-message-actions {
  display: inline-flex;
  gap: 4px;
  margin-left: 8px;
  opacity: 0;
  transition: opacity 0.2s;
}

.ai-message-meta:hover .ai-message-actions,
.ai-message-body:hover .ai-message-actions {
  opacity: 1;
}

.ai-message-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--ai-text-muted);
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s var(--ease-out), border-color 0.2s var(--ease-out), color 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out), transform 0.15s var(--ease-out), opacity 0.2s var(--ease-out);
}

.ai-message-action:hover {
  background: var(--ai-surface);
  color: var(--ai-text);
}

.ai-message-action i {
  font-size: 12px;
}

/* 编辑状态 */
.ai-bubble[style*="border-left"] {
  border-left: 3px solid var(--ai-primary) !important;
}

/* 反馈按钮 */
.ai-feedback-buttons {
  display: inline-flex;
  gap: 4px;
  margin-left: 8px;
}

.ai-feedback-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--ai-border);
  background: transparent;
  color: var(--ai-text-muted);
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.2s var(--ease-out), border-color 0.2s var(--ease-out), color 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out), transform 0.15s var(--ease-out), opacity 0.2s var(--ease-out);
}

.ai-feedback-btn:hover {
  background: var(--ai-surface);
  transform: scale(1.1);
}

.ai-feedback-btn.positive:hover {
  border-color: var(--ai-success);
  color: var(--ai-success);
}

.ai-feedback-btn.negative:hover {
  border-color: var(--ai-error);
  color: var(--ai-error);
}

/* ===================== 思考中动画 ===================== */
.ai-thinking {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 20px;
  background: var(--ai-card);
  border: 1px solid var(--ai-border);
  color: var(--ai-text-secondary);
  font-size: 12px;
  font-weight: 500;
  box-shadow: var(--ai-shadow-sm);
}

.ai-thinking-dots {
  display: inline-flex;
  gap: 4px;
}

.ai-thinking-dots span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--ai-primary);
  animation: ai-bounce 1.4s infinite ease-in-out both;
}

.ai-thinking-dots span:nth-child(1) { animation-delay: -0.32s; }
.ai-thinking-dots span:nth-child(2) { animation-delay: -0.16s; }
.ai-thinking-dots span:nth-child(3) { animation-delay: 0s; }

@keyframes ai-bounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

/* ===================== 系统消息 ===================== */
.ai-system-text {
  width: 100%;
  text-align: center;
  font-size: 12px;
  color: var(--ai-text-muted);
  padding: 8px 0;
}

/* ===================== Kimi 式欢迎页 ===================== */
.ai-welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
  padding: 60px 24px 80px;
  color: var(--ai-text-secondary);
}

.ai-welcome-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  margin-bottom: 36px;
  width: 100%;
  max-width: 640px;
}

.ai-welcome-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ai-primary);
  color: #fff;
  font-size: 24px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.ai-welcome-title {
  margin: 0 0 8px;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ai-text);
}

.ai-welcome-subtitle {
  margin: 0;
  font-size: 14px;
  max-width: 440px;
  line-height: 1.6;
  color: var(--ai-text-muted);
}

/* 中央输入框 */
.ai-welcome-input-wrap {
  width: 100%;
  max-width: 720px;
  margin-bottom: 32px;
}

.ai-welcome-input-box {
  display: flex;
  align-items: flex-end;
  gap: 0;
  background: var(--ai-card);
  border: 1px solid var(--ai-border);
  border-radius: 20px;
  padding: 16px 20px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ai-welcome-input-box:focus-within {
  border-color: var(--ai-primary);
  box-shadow: 0 0 0 3px var(--ai-primary-soft);
}

.ai-welcome-textarea {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  color: var(--ai-text);
  font-size: 16px;
  font-family: inherit;
  line-height: 1.5;
  resize: none;
  padding: 4px 0;
  min-height: 28px;
  max-height: 180px;
  overflow-y: auto;
}

.ai-welcome-textarea::placeholder {
  color: var(--ai-text-muted);
}

.ai-welcome-send {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: none;
  background: var(--ai-primary);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 10px;
  transition: opacity 0.15s, transform 0.15s;
}

.ai-welcome-send:hover {
  opacity: 0.88;
  transform: scale(1.04);
}

.ai-welcome-send:active {
  transform: scale(0.96);
}

/* 欢迎页「AI 优化」按钮：覆盖 .ai-welcome-send 的实底样式，保持魔法按钮的描边风格 */
.ai-welcome-send.ai-enhance-btn {
  background: transparent;
  color: var(--ai-primary);
  border: 1px solid var(--ai-primary);
}
.ai-welcome-send.ai-enhance-btn:hover {
  background: var(--ai-primary-soft);
  box-shadow: 0 0 12px var(--ai-primary-glow);
  opacity: 1;
}

/* ===================== 输入优化预览弹窗 ===================== */
.ai-enhance-head {
  display: flex; align-items: flex-start; gap: 12px;
  flex: 1; min-width: 0;
}
.ai-enhance-badge {
  width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 19px; color: #fff;
  background: linear-gradient(135deg, var(--ai-primary) 0%, var(--ai-secondary) 100%);
  box-shadow: 0 4px 14px var(--ai-primary-glow);
}
.ai-enhance-titlewrap { flex: 1; min-width: 0; }
.ai-enhance-subtitle {
  font-size: 12px; color: var(--ai-text-muted); margin: 3px 0 0; line-height: 1.5;
}

.ai-enhance-section-label {
  display: flex; align-items: center; gap: 7px;
  font-size: 12px; font-weight: 600; color: var(--ai-text-secondary);
  margin: 0 0 8px;
}
.ai-enhance-section-label .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--ai-text-muted); flex-shrink: 0;
}
.ai-enhance-section-label .dot.accent { background: var(--ai-primary); }

.ai-enhance-original {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--ai-bg-1);
  border: 1px solid var(--ai-border);
  border-left: 3px solid var(--ai-border-highlight);
  color: var(--ai-text-secondary);
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

.ai-enhance-arrow {
  display: flex; align-items: center; gap: 10px;
  margin: 4px 0;
}
.ai-enhance-arrow .line { flex: 1; height: 1px; background: var(--ai-border); }
.ai-enhance-arrow .arrow-badge {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--ai-primary); background: var(--ai-primary-soft);
  border: 1px solid var(--ai-border-highlight);
  font-size: 14px;
}

.ai-enhance-input {
  width: 100%; padding: 12px 14px; font-size: 13px; line-height: 1.7;
  color: var(--ai-text); background: var(--ai-bg-1);
  border: 1px solid var(--ai-primary); border-radius: var(--radius-sm); outline: none;
  box-shadow: 0 0 0 3px var(--ai-primary-soft);
  resize: vertical; min-height: 96px; font-family: inherit;
  transition: box-shadow 0.2s var(--ease-out), border-color 0.2s var(--ease-out);
}
.ai-enhance-input:focus {
  box-shadow: 0 0 0 3px var(--ai-primary-soft), 0 0 20px var(--ai-primary-glow);
}
.ai-enhance-input::placeholder { color: var(--ai-text-muted); }

.ai-enhance-hint {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; color: var(--ai-primary); margin-top: 7px;
}

/* 输入框下方功能按钮行 */
.ai-welcome-actions {
  display: flex; align-items: center; gap: 8px;
  max-width: 720px; width: 100%; margin-top: 10px;
}
.ai-welcome-action-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 18px; border: 1px solid var(--ai-border);
  background: transparent; color: var(--ai-text-secondary);
  font-size: 12px; cursor: pointer; transition: background-color 0.2s var(--ease-out), border-color 0.2s var(--ease-out), color 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out), transform 0.15s var(--ease-out), opacity 0.2s var(--ease-out);
}
.ai-welcome-action-btn:hover {
  border-color: var(--ai-border-highlight); color: var(--ai-text);
  background: var(--ai-bg-1);
}

/* Kimi 式工具卡片网格 */
.ai-kimi-tools {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 1fr;
  gap: 12px;
  max-width: 720px;
  width: 100%;
  margin-bottom: 32px;
}

.ai-kimi-tool-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--ai-card);
  border: 1px solid var(--ai-border);
  border-radius: 14px;
  cursor: pointer;
  transition: background-color 0.2s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.15s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: left;
  font-family: inherit;
  color: inherit;
}

.ai-kimi-tool-card:hover {
  background: var(--ai-surface);
  border-color: rgba(43, 127, 255, 0.25);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
}

.ai-kimi-tool-icon {
  font-size: 22px;
  color: var(--ai-primary);
  flex-shrink: 0;
  width: 28px;
  text-align: center;
}

.ai-kimi-tool-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.ai-kimi-tool-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ai-text);
}

.ai-kimi-tool-desc {
  font-size: 11px;
  color: var(--ai-text-muted);
  line-height: 1.4;
}

/* ===================== 话题对话流程卡片 ===================== */

.ai-topic-flows-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ai-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 12px;
  max-width: 640px;
  width: 100%;
  text-align: left;
}

.ai-topic-flows-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  max-width: 640px;
  width: 100%;
}

.ai-topic-flow-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px 16px;
  background: var(--ai-card);
  border: 1px solid var(--ai-border);
  border-radius: 14px;
  cursor: pointer;
  transition: border-color 0.2s cubic-bezier(0.16, 1, 0.3, 1), background 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: left;
  font-family: inherit;
  color: inherit;
}

.ai-topic-flow-card:hover {
  border-color: rgba(43, 127, 255, 0.4);
  background: var(--ai-surface-elevated);
}

.ai-topic-flow-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.ai-topic-flow-icon {
  font-size: 20px;
  color: var(--ai-primary);
  flex-shrink: 0;
}

.ai-topic-flow-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ai-text);
  line-height: 1.3;
}

.ai-topic-flow-subtitle {
  font-size: 12px;
  color: var(--ai-text-muted);
  line-height: 1.4;
  width: 100%;
  margin-top: -2px;
}

.ai-topic-flow-steps {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--ai-divider);
}

.ai-topic-flow-step {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--ai-text-secondary);
}

.ai-topic-flow-step-num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 1;
}

.ai-topic-flow-step.query .ai-topic-flow-step-num {
  background: var(--ai-primary-soft);
  color: var(--ai-primary);
}

.ai-topic-flow-step.answer .ai-topic-flow-step-num {
  background: rgba(148, 163, 184, 0.1);
  color: var(--ai-text-muted);
}

.ai-topic-flow-step-text {
  flex: 1;
  line-height: 1.4;
}

/* ===================== 提示词工程按钮 + 选中提示词 ===================== */
.ai-prompt-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  max-width: 720px;
  width: 100%;
  margin-bottom: 32px;
}

.ai-prompt-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--ai-border-highlight);
  background: var(--ai-primary-soft);
  color: var(--ai-text-secondary);
  box-shadow: var(--ai-shadow-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.2s cubic-bezier(0.16, 1, 0.3, 1), color 0.2s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

.ai-prompt-chip i {
  font-size: 15px;
  color: var(--ai-primary);
}

.ai-prompt-chip:hover {
  border-color: rgba(43, 127, 255, 0.4);
  color: var(--ai-text);
  background: var(--ai-surface);
  transform: translateY(-1px);
}

.ai-role-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  margin-bottom: 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--ai-border-highlight);
  background: var(--ai-primary-soft);
  font-size: 12px;
  color: var(--ai-text-secondary);
}

.ai-role-badge > i {
  font-size: 14px;
  color: var(--ai-primary);
  flex-shrink: 0;
}

.ai-role-badge-label {
  color: var(--ai-text-muted);
  font-size: 12px;
  flex-shrink: 0;
}

.ai-role-badge-name {
  font-weight: 600;
  color: var(--ai-text);
}

.ai-role-badge-clear {
  margin-left: auto;
  border: none;
  background: transparent;
  color: var(--ai-text-muted);
  font-size: 14px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  transition: color 0.15s, background-color 0.15s;
}

.ai-role-badge-clear:hover {
  color: var(--ai-text);
  background: rgba(148, 163, 184, 0.14);
}

/* ===================== 案例卡片预览 ===================== */
.ai-case-preview {
  font-size: 12px;
  color: var(--ai-text-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ai-case-preview::before {
  content: "Q ";
  color: var(--ai-primary);
  font-weight: 600;
}

.ai-case-meta {
  font-size: 11px;
  color: var(--ai-text-muted);
  opacity: 0.85;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* 建议词条 */
.ai-welcome-suggestions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  max-width: 640px;
}

.ai-welcome-suggestion-chip {
  display: inline-flex;
  align-items: center;
  padding: 10px 16px;
  border-radius: var(--radius-pill);
  background: var(--ai-surface);
  border: 1px solid var(--ai-border);
  color: var(--ai-text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.15s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: inherit;
}

.ai-welcome-suggestion-chip:hover {
  border-color: rgba(43, 127, 255, 0.35);
  color: var(--ai-text);
  background: var(--ai-surface-elevated);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

/* ===================== 能力模块盒 ===================== */

.ai-capabilities-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ai-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 12px;
  max-width: 960px;
  width: 100%;
  text-align: left;
}

.ai-capability-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  max-width: 960px;
  width: 100%;
  margin-bottom: 32px;
}

.ai-capability-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  background: var(--ai-card);
  border: 1px solid var(--ai-border);
  border-radius: 14px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s cubic-bezier(0.16, 1, 0.3, 1), background 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

.ai-capability-card:hover {
  border-color: rgba(43, 127, 255, 0.3);
  background: var(--ai-surface);
  transform: translateY(-2px);
}

.ai-capability-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.ai-capability-icon {
  font-size: 20px;
  color: var(--ai-primary);
  flex-shrink: 0;
  width: 24px;
  text-align: center;
  margin-top: 1px;
}

.ai-capability-titles {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.ai-capability-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ai-text);
}

.ai-capability-desc {
  font-size: 11px;
  color: var(--ai-text-muted);
  line-height: 1.4;
}

.ai-capability-subs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ai-capability-sub {
  font-size: 11px;
  color: var(--ai-text-secondary);
  background: var(--ai-surface);
  border: 1px solid var(--ai-border);
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
}

.ai-trustline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 28px;
  font-size: 12px;
  color: var(--ai-text-muted);
  flex-wrap: wrap;
  text-align: center;
  max-width: 960px;
}
.ai-trustline i {
  color: var(--ai-success);
  font-size: 14px;
  flex-shrink: 0;
}

/* 响应式 */
@media (max-width: 768px) {
  .ai-welcome {
    padding: 36px 16px 60px;
  }
  .ai-welcome-brand {
    max-width: 100%;
  }
  .ai-welcome-title {
    font-size: 24px;
  }
  .ai-welcome-input-wrap {
    max-width: 100%;
  }
  .ai-kimi-tools {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .ai-topic-flows-grid {
    grid-template-columns: 1fr;
    max-width: 100%;
  }
  .ai-topic-flows-label {
    max-width: 100%;
  }
  .ai-capability-grid {
    grid-template-columns: repeat(2, 1fr);
    max-width: 100%;
  }
  .ai-capabilities-label {
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  .ai-capability-grid {
    grid-template-columns: 1fr;
  }
}

/* ===================== 模块通用 ===================== */
.ai-module-header {
  margin-bottom: 20px;
}

.ai-module-header h2 {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 700;
  color: var(--ai-text);
  letter-spacing: -0.01em;
}

.ai-module-header p {
  margin: 0;
  font-size: 13px;
  color: var(--ai-text-muted);
}

.ai-module-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 260px);
  color: var(--ai-text-muted);
}

.ai-placeholder-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
  padding: 40px;
  background: var(--ai-surface);
  border: 1px solid var(--ai-border);
  border-radius: var(--radius-lg);
}

.ai-placeholder-inner i {
  font-size: 42px;
  color: var(--ai-primary);
  opacity: 0.8;
}

.ai-placeholder-inner h3 {
  margin: 0;
  font-size: 18px;
  color: var(--ai-text);
}

.ai-placeholder-inner p {
  margin: 0;
  font-size: 13px;
  color: var(--ai-text-muted);
}

/* ===================== 消息内联卡片 ===================== */
.ai-card-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.ai-card {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 13px;
  border-radius: var(--radius);
  background: var(--ai-card);
  border: 1px solid var(--ai-border);
  min-width: 200px;
  max-width: 300px;
  transition: background-color 0.2s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.15s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.ai-card:hover {
  border-color: var(--ai-border-highlight);
  background: var(--ai-card-hover);
  transform: translateY(-2px);
  box-shadow: var(--ai-shadow);
}

.ai-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 3px;
}

.ai-card-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--ai-primary-soft);
  color: var(--ai-primary);
  font-size: 10px;
  font-weight: 600;
}

.ai-card-id {
  font-size: 10px;
  color: var(--ai-text-muted);
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

.ai-card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ai-text);
  line-height: 1.5;
}

.ai-card-subtitle {
  font-size: 11px;
  color: var(--ai-text-muted);
}

.ai-card-meta {
  font-size: 11px;
  color: var(--ai-text-muted);
}

.ai-card-desc {
  font-size: 12px;
  color: var(--ai-text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ai-card-action {
  margin-top: 5px;
  padding: 5px 11px;
  border-radius: var(--radius-sm);
  background: var(--ai-primary);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease, opacity 0.2s ease;
  align-self: flex-start;
}

.ai-card-action:hover {
  background: var(--ai-primary-hover);
}

.ai-chart-placeholder {
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  gap: 7px;
  height: 70px;
  padding: 8px 0;
}

.ai-chart-bar {
  flex: 1;
  max-width: 20px;
  border-radius: 3px 3px 0 0;
  background: linear-gradient(180deg, var(--ai-primary), rgba(43, 127, 255, 0.45));
  opacity: 0.85;
}

/* ===================== 图表卡片 - 用于 viz 模块 ===================== */
.ai-chart-card {
  min-width: 260px;
  flex: 1;
}

.ai-bar-chart {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 0;
}

.ai-bar-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.ai-bar-track {
  width: 24px;
  background: rgba(148, 163, 184, 0.1);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}


.ai-bar-fill {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  border-radius: 4px;
  background: linear-gradient(180deg, var(--ai-primary), rgba(43, 127, 255, 0.5));
}

.ai-bar-label {
  font-size: 10px;
  color: var(--ai-text-muted);
  text-align: center;
  max-width: 60px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===================== 数据表格 - 轻量样式 ===================== */
.ai-data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.ai-data-table th,
.ai-data-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--ai-border);
}

.ai-data-table th {
  font-weight: 600;
  color: var(--ai-text-secondary);
  font-size: 12px;
}

.ai-data-table td {
  color: var(--ai-text);
}

.ai-data-table tr:last-child td {
  border-bottom: none;
}

/* ===================== 工具类 ===================== */
.ai-hidden { display: none !important; }
.ai-flex { display: flex; }
.ai-flex-col { flex-direction: column; }
.ai-items-center { align-items: center; }
.ai-justify-between { justify-content: space-between; }
.ai-gap-2 { gap: 8px; }
.ai-gap-3 { gap: 12px; }
.ai-gap-4 { gap: 16px; }
.ai-text-primary { color: var(--ai-text); }
.ai-text-muted { color: var(--ai-text-muted); }
.ai-text-brand { color: var(--ai-primary); }
.ai-font-semibold { font-weight: 600; }
.ai-font-bold { font-weight: 700; }
.ai-mt-2 { margin-top: 8px; }
.ai-mt-3 { margin-top: 12px; }
.ai-mt-4 { margin-top: 16px; }
.ai-mb-2 { margin-bottom: 8px; }
.ai-mb-3 { margin-bottom: 12px; }
.ai-mb-4 { margin-bottom: 16px; }
.ai-w-full { width: 100%; }

@keyframes ai-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===================== Markdown 渲染 ===================== */

/* Slash Commands 菜单 */
.ai-slash-menu {
  background: var(--ai-surface);
  border: 1px solid var(--ai-border);
  border-radius: 8px;
  box-shadow: var(--ai-shadow-lg);
  padding: 4px;
  max-height: 300px;
  overflow-y: auto;
  z-index: 1000;
}

.ai-slash-menu-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
}

.ai-slash-menu-item:hover {
  background: var(--ai-card);
}

.ai-slash-menu-command {
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 13px;
  font-weight: 600;
  color: var(--ai-primary);
  min-width: 80px;
}

.ai-slash-menu-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--ai-text);
  min-width: 100px;
}

.ai-slash-menu-desc {
  font-size: 12px;
  color: var(--ai-text-muted);
  flex: 1;
}

.ai-bubble {
  /* 确保 Markdown 内容正确渲染 */
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Markdown 标题 */
.ai-bubble h1,
.ai-bubble h2,
.ai-bubble h3,
.ai-bubble h4,
.ai-bubble h5,
.ai-bubble h6 {
  margin-top: 1em;
  margin-bottom: 0.5em;
  font-weight: 600;
  line-height: 1.4;
}

.ai-bubble h1 { font-size: 1.5em; }
.ai-bubble h2 { font-size: 1.3em; }
.ai-bubble h3 { font-size: 1.15em; }
.ai-bubble h4 { font-size: 1.05em; }

/* Markdown 段落和列表 */
.ai-bubble p {
  margin: 0.5em 0;
}

.ai-bubble p:first-child {
  margin-top: 0;
}

.ai-bubble p:last-child {
  margin-bottom: 0;
}

.ai-bubble ul,
.ai-bubble ol {
  margin: 0.5em 0;
  padding-left: 1.5em;
}

.ai-bubble li {
  margin: 0.25em 0;
}

/* Markdown 引用 */
.ai-bubble blockquote {
  border-left: 3px solid var(--ai-primary);
  padding-left: 1em;
  margin: 0.5em 0;
  color: var(--ai-text-muted);
}

/* Markdown 链接 */
.ai-bubble a {
  color: var(--ai-primary);
  text-decoration: none;
  transition: opacity 0.2s;
}

.ai-bubble a:hover {
  opacity: 0.8;
  text-decoration: underline;
}

/* Markdown 分隔线 */
.ai-bubble hr {
  border: none;
  border-top: 1px solid var(--ai-border);
  margin: 1em 0;
}

/* 行内代码 */
.ai-inline-code {
  background: rgba(43, 127, 255, 0.1);
  color: var(--ai-primary);
  padding: 0.2em 0.4em;
  border-radius: 4px;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 0.9em;
}

/* 代码块容器 */
.ai-code-block-wrapper {
  margin: 1em 0;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--ai-border);
  background: var(--ai-code-bg);
}

/* 代码块头部 */
.ai-code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--ai-border);
  font-size: 12px;
  color: var(--ai-text-muted);
}

.ai-code-lang {
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  text-transform: uppercase;
  font-size: 11px;
}

/* 代码块复制按钮 */
.ai-code-copy {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  background: transparent;
  border: 1px solid var(--ai-border);
  border-radius: 4px;
  color: var(--ai-text-muted);
  font-size: 11px;
  cursor: pointer;
  transition: background-color 0.2s var(--ease-out), border-color 0.2s var(--ease-out), color 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out), transform 0.15s var(--ease-out), opacity 0.2s var(--ease-out);
}

.ai-code-copy:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--ai-primary);
  color: var(--ai-primary);
}

.ai-code-copy.copied {
  background: rgba(0, 180, 42, 0.1);
  border-color: var(--ai-success);
  color: var(--ai-success);
}

/* 代码块内容 */
.ai-code-block-wrapper pre {
  margin: 0;
  padding: 12px;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.5;
}

.ai-code-block-wrapper code {
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  background: transparent;
  color: inherit;
}

/* 表格样式 */
.ai-bubble table {
  border-collapse: collapse;
  margin: 1em 0;
  width: 100%;
}

.ai-bubble th,
.ai-bubble td {
  border: 1px solid var(--ai-border);
  padding: 8px 12px;
  text-align: left;
}

.ai-bubble th {
  background: rgba(255, 255, 255, 0.03);
  font-weight: 600;
}

.ai-bubble tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.01);
}

/* 图片样式 */
.ai-bubble img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 0.5em 0;
}

/* 报告项操作按钮 */
.ai-report-item .btn {
  font-size: 11px !important;
  padding: 2px 8px !important;
  border-radius: 4px;
  background: transparent !important;
  border: none !important;
  color: var(--ai-text-muted) !important;
  cursor: pointer;
  transition: background-color 0.2s var(--ease-out), border-color 0.2s var(--ease-out), color 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out), opacity 0.2s var(--ease-out) !important;
}

.ai-report-item .btn:hover {
  background: var(--ai-surface) !important;
  color: var(--ai-primary) !important;
}

.ai-report-item .btn.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
}

.ai-report-actions {
  display: flex;
  gap: 4px;
  padding: 4px 8px 8px;
}


/* ===================== 帮助中心 ===================== */

.ai-help-section {
  line-height: 1.7;
}

.ai-help-section h4 {
  font-size: 15px;
  font-weight: 600;
  color: var(--ai-text);
  margin: 20px 0 10px;
}

.ai-help-section h4:first-child {
  margin-top: 0;
}

.ai-help-section p {
  font-size: 14px;
  color: var(--ai-text-secondary);
  margin: 0 0 10px;
}

.ai-help-section ul {
  margin: 0 0 10px 20px;
  padding: 0;
}

.ai-help-section li {
  font-size: 14px;
  color: var(--ai-text-secondary);
  margin: 6px 0;
}

.ai-help-section strong {
  color: var(--ai-text);
  font-weight: 600;
}

.ai-help-section kbd {
  display: inline-block;
  padding: 2px 6px;
  font-size: 12px;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  background: var(--ai-card);
  border: 1px solid var(--ai-border);
  border-radius: 4px;
  color: var(--ai-text);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* ===================== 偏好设置 ===================== */

.ai-preferences-panel {
  line-height: 1.6;
}

.ai-preferences-panel .mb-4 {
  margin-bottom: 20px;
}

.ai-preferences-panel .text-sm {
  font-size: 14px;
}

.ai-preferences-panel .text-xs {
  font-size: 12px;
}

.ai-preferences-panel .font-semibold {
  font-weight: 600;
  color: var(--ai-text);
  margin-bottom: 12px;
}

.ai-preferences-panel .space-y-3 > div {
  margin-bottom: 12px;
}

.ai-preferences-panel .flex {
  display: flex;
}

.ai-preferences-panel .items-center {
  align-items: center;
}

.ai-preferences-panel .justify-between {
  justify-content: space-between;
}

/* Switch 开关 */
.ai-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.ai-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.ai-switch-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--ai-border);
  transition: .2s;
  border-radius: 24px;
}

.ai-switch-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .2s;
  border-radius: 50%;
}

.ai-switch input:checked + .ai-switch-slider {
  background-color: var(--ai-primary);
}

.ai-switch input:checked + .ai-switch-slider:before {
  transform: translateX(20px);
}

/* ===================== 打印样式 ===================== */
@media print {
  /* 隐藏非报告内容 */
  .ai-topbar,
  .ai-sidebar,
  .ai-panel,
  .ai-inputbar,
  .ai-modal-overlay::before {
    display: none !important;
  }

  /* 报告预览打印优化 */
  .ai-modal-overlay {
    position: relative;
    background: white !important;
  }

  .ai-modal-content.large,
  .ai-modal-content.xlarge {
    max-width: 100% !important;
    box-shadow: none !important;
    border: none !important;
  }

  .ai-modal-header {
    position: relative;
    background: white !important;
    border-bottom: 2px solid #333 !important;
    padding: 16px 0 !important;
  }

  .ai-modal-header h3 {
    color: #000 !important;
    font-size: 24px !important;
  }

  .ai-modal-body.report-preview {
    padding: 24px 0 !important;
  }

  .ai-modal-body.report-preview h4 {
    color: #000 !important;
    border-left-color: #000 !important;
    font-size: 18px !important;
    margin-top: 32px !important;
    page-break-after: avoid;
  }

  .ai-modal-body.report-preview p {
    color: #333 !important;
    font-size: 12pt !important;
    line-height: 1.6 !important;
  }

  .ai-modal-footer {
    position: relative;
    background: white !important;
    border-top: 1px solid #ccc !important;
    padding: 16px 0 !important;
  }

  /* 强制背景色打印 */
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* 避免内容截断 */
  .ai-modal-body.report-preview h4,
  .ai-modal-body.report-preview p {
    orphans: 3;
    widows: 3;
  }
}

/* 紧凑模式 */
body.compact-mode .ai-bubble {
  padding: 10px 14px;
  font-size: 14px;
}

body.compact-mode .ai-message-inner {
  gap: 8px;
}

/* ===================== 空状态 (Empty State) ===================== */
.ai-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
  min-height: 300px;
}

.ai-empty-state-icon {
  font-size: 64px;
  color: var(--ai-text-muted);
  margin-bottom: 16px;
  opacity: 0.5;
  filter: grayscale(0.5);
}

.ai-empty-state-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--ai-text);
  margin-bottom: 8px;
}

.ai-empty-state-desc {
  font-size: 14px;
  color: var(--ai-text-muted);
  max-width: 400px;
  line-height: 1.6;
  margin-bottom: 24px;
}

.ai-empty-state-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.ai-empty-state-tips {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--ai-border);
  max-width: 500px;
  width: 100%;
}

.ai-empty-state-tips-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--ai-text-secondary);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ai-empty-state-tips-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ai-empty-state-tips-list li {
  font-size: 13px;
  color: var(--ai-text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.ai-empty-state-tips-list li i {
  font-size: 14px;
  color: var(--ai-primary);
}

/* ===================== 加载状态 (Loading State) ===================== */
.ai-loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  min-height: 300px;
}

.ai-loading-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--ai-border);
  border-top-color: var(--ai-primary);
  border-radius: 50%;
  animation: ai-spin 0.8s linear infinite;
  margin-bottom: 16px;
}

@keyframes ai-spin {
  to { transform: rotate(360deg); }
}

.ai-loading-text {
  font-size: 14px;
  color: var(--ai-text-muted);
  margin-bottom: 8px;
}

.ai-loading-progress {
  width: 200px;
  height: 4px;
  background: var(--ai-border);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 12px;
}

.ai-loading-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--ai-primary), var(--ai-primary-hover));
  border-radius: 2px;
  animation: ai-loading-progress 2s ease-in-out infinite;
}

@keyframes ai-loading-progress {
  0% { width: 0%; transform: translateX(0); }
  50% { width: 70%; }
  100% { width: 100%; transform: translateX(0); }
}

.ai-loading-dots {
  display: flex;
  gap: 6px;
  margin-top: 12px;
}

.ai-loading-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ai-text-muted);
  animation: ai-dot-bounce 1.4s ease-in-out infinite both;
}

.ai-loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.ai-loading-dots span:nth-child(2) { animation-delay: -0.16s; }
.ai-loading-dots span:nth-child(3) { animation-delay: 0s; }

@keyframes ai-dot-bounce {
  0%, 80%, 100% {
    transform: scale(0);
    opacity: 0.5;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* ===================== 骨架屏 (Skeleton) ===================== */
.ai-skeleton {
  background: linear-gradient(
    90deg,
    var(--ai-card) 25%,
    var(--ai-surface-elevated) 50%,
    var(--ai-card) 75%
  );
  background-size: 200% 100%;
  animation: ai-skeleton-shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

@keyframes ai-skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.ai-skeleton-text {
  height: 16px;
  margin-bottom: 8px;
  border-radius: 4px;
}

.ai-skeleton-text.short { width: 60%; }
.ai-skeleton-text.medium { width: 80%; }
.ai-skeleton-text.full { width: 100%; }

.ai-skeleton-title {
  height: 24px;
  width: 40%;
  margin-bottom: 16px;
  border-radius: 6px;
}

.ai-skeleton-card {
  padding: 16px;
  background: var(--ai-card);
  border: 1px solid var(--ai-border);
  border-radius: var(--radius);
  margin-bottom: 12px;
}

.ai-skeleton-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
}

.ai-skeleton-button {
  height: 36px;
  width: 120px;
  border-radius: var(--radius-pill);
}

/* ===================== Kimi 式 Launcher 卡片网格 ===================== */
.ai-launcher-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  margin-top: 28px;
  margin-bottom: 20px;
  width: 100%;
}

.ai-launcher-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: var(--ai-card);
  border: 1px solid var(--ai-border);
  border-radius: 12px;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease, opacity 0.2s ease;
  text-align: left;
  color: var(--ai-text);
  font-family: inherit;
}

.ai-launcher-card:hover {
  background: var(--ai-surface);
  border-color: var(--ai-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.ai-launcher-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--ai-primary), var(--ai-primary-hover));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #fff;
  flex-shrink: 0;
}

.ai-launcher-card-body {
  flex: 1;
  min-width: 0;
}

.ai-launcher-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ai-text);
  margin-bottom: 4px;
}

.ai-launcher-card-desc {
  font-size: 12px;
  color: var(--ai-text-muted);
  line-height: 1.4;
}

.ai-launcher-card-arrow {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--ai-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--ai-text-muted);
  transition: background-color 0.2s var(--ease-out), border-color 0.2s var(--ease-out), color 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out), transform 0.15s var(--ease-out), opacity 0.2s var(--ease-out);
}

.ai-launcher-card:hover .ai-launcher-card-arrow {
  background: var(--ai-primary);
  color: #fff;
}

/* ===================== Kimi 式工作区顶部工具栏 ===================== */
.ai-workspace-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0 12px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--ai-border);
}

.ai-workspace-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--ai-border);
  background: var(--ai-card);
  color: var(--ai-text-muted);
  font-size: 13px;
  cursor: pointer;
  transition: background-color 0.2s var(--ease-out), border-color 0.2s var(--ease-out), color 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out), transform 0.15s var(--ease-out), opacity 0.2s var(--ease-out);
  white-space: nowrap;
  font-family: inherit;
}

.ai-workspace-back-btn:hover {
  background: var(--ai-surface);
  color: var(--ai-text);
  border-color: var(--ai-primary);
}

.ai-workspace-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--ai-text);
}

.ai-workspace-spacer {
  flex: 1;
}

/* ===================== 全部工具：渐进展开按钮 ===================== */
.ai-tools-toggle-row {
  text-align: center;
  padding: 4px 0 0;
  margin-bottom: 20px;
}

.ai-tools-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 20px;
  border-radius: 8px;
  border: 1px dashed var(--ai-border);
  background: none;
  color: var(--ai-text-muted);
  font-size: 13px;
  cursor: pointer;
  transition: background-color 0.15s var(--ease-out), transform 0.15s var(--ease-out), opacity 0.15s var(--ease-out);
  font-family: inherit;
}

.ai-tools-toggle:hover {
  color: var(--ai-primary);
  border-color: var(--ai-primary);
  background: var(--ai-primary-soft, rgba(43, 127, 255, 0.06));
}

.ai-tools-toggle .bi {
  font-size: 12px;
  transition: transform 0.2s;
}

.ai-tools-toggle.open .bi {
  transform: rotate(180deg);
}

/* ===================== 新手提问卡片 ===================== */
.ai-beginner-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 20px;
  margin-bottom: 24px;
  max-width: 720px;
  width: 100%;
}

.ai-beginner-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 14px;
  background: var(--ai-card);
  border: 1px solid var(--ai-border);
  border-radius: 12px;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease, opacity 0.2s ease;
  text-align: left;
  font-family: inherit;
  color: inherit;
}

.ai-beginner-card:hover {
  background: var(--ai-surface);
  border-color: var(--ai-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.ai-beginner-card-icon {
  font-size: 20px;
  line-height: 1;
  color: var(--ai-primary);
}

.ai-beginner-card-q {
  font-size: 13px;
  font-weight: 600;
  color: var(--ai-text);
  line-height: 1.4;
}

.ai-beginner-card-hint {
  font-size: 11px;
  color: var(--ai-text-muted);
  line-height: 1.3;
}

/* ===================== 智能路由提示气泡 (AIA-003) ===================== */
.ai-routing-hint {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: var(--ai-surface-elevated);
  border: 1px solid rgba(43, 127, 255, 0.25);
  border-radius: 10px;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--ai-text-secondary);
  animation: ai-fade-in 0.2s ease;
}

.ai-routing-hint.show { display: flex; }

.ai-routing-hint-icon {
  font-size: 16px;
  flex-shrink: 0;
}

.ai-routing-hint-text { flex: 1; }

.ai-routing-hint-link {
  color: var(--ai-primary);
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

.ai-routing-hint-link:hover { text-decoration: underline; }

.ai-routing-hint-close {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--ai-text-muted);
  cursor: pointer;
  padding: 2px 4px;
  font-size: 14px;
  line-height: 1;
  border-radius: 4px;
  transition: background-color 0.15s var(--ease-out), transform 0.15s var(--ease-out), opacity 0.15s var(--ease-out);
}

.ai-routing-hint-close:hover {
  color: var(--ai-text);
  background: rgba(148, 163, 184, 0.1);
}

/* ===================== 高级提示区 ===================== */
.ai-advanced-tips {
  margin-top: 16px;
  padding: 14px 18px;
  background: var(--ai-card);
  border: 1px solid var(--ai-border);
  border-radius: 12px;
  max-width: 720px;
  width: 100%;
  text-align: left;
}

.ai-advanced-tips-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--ai-text-secondary);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ai-advanced-tips-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.ai-advanced-tips-list li {
  font-size: 12px;
  color: var(--ai-text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.ai-advanced-tips-list li code {
  background: rgba(43, 127, 255, 0.1);
  color: var(--ai-primary);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-family: 'Consolas', 'Monaco', monospace;
}

/* ===================== 响应式：新手卡片 ===================== */
@media (max-width: 768px) {
  .ai-beginner-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ===================== 运行轨迹（研发调试视图） ===================== */

.ai-panel-tabs {
  display: flex; gap: 4px; flex: 1;
}
.ai-panel-tab {
  flex: 1; padding: 7px 0; border-radius: var(--radius-sm);
  border: 1px solid transparent; background: transparent;
  font-size: 13px; font-weight: 500; color: var(--ai-text-muted);
  cursor: pointer; transition: all 0.18s ease;
}
.ai-panel-tab:hover { color: var(--ai-text-secondary); }
.ai-panel-tab.active {
  background: var(--ai-primary-soft); color: var(--ai-primary);
  border-color: var(--ai-border-highlight);
}

.ai-trace-list { display: flex; flex-direction: column; gap: 12px; }
.ai-trace-empty {
  padding: 24px 8px; text-align: center; color: var(--ai-text-muted);
  font-size: 13px; line-height: 1.7;
}

.ai-trace-card {
  background: var(--ai-card); border: 1px solid var(--ai-border);
  border-radius: var(--radius); padding: 12px 14px;
  display: flex; flex-direction: column; gap: 10px;
}
.ai-trace-head {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.ai-trace-turn {
  font-size: 12px; font-weight: 600; color: var(--ai-text-secondary);
}
.ai-trace-badge {
  font-size: 11px; padding: 2px 8px; border-radius: var(--radius-pill);
  font-weight: 500;
}
.ai-trace-badge.mode-mock { background: var(--ai-secondary); color: #fff; }
.ai-trace-badge.mode-real { background: var(--ai-primary-soft); color: var(--ai-primary); }
.ai-trace-badge.status-done { background: rgba(0, 180, 42, 0.12); color: var(--ai-success); }
.ai-trace-badge.status-streaming { background: rgba(251, 191, 36, 0.14); color: var(--ai-warning); }
.ai-trace-badge.status-error { background: rgba(245, 63, 63, 0.12); color: var(--ai-error); }
.ai-trace-time { margin-left: auto; font-size: 11px; color: var(--ai-text-muted); }

.ai-trace-q, .ai-trace-answer {
  display: flex; flex-direction: column; gap: 4px;
}
.ai-trace-q-label {
  font-size: 11px; font-weight: 600; color: var(--ai-text-muted);
  text-transform: uppercase; letter-spacing: 0.04em;
}
.ai-trace-q-text, .ai-trace-answer-text {
  font-size: 13px; line-height: 1.6; color: var(--ai-text);
  white-space: pre-wrap; word-break: break-word;
}
.ai-trace-answer-text {
  color: var(--ai-text-secondary);
  max-height: 120px; overflow-y: auto;
}

.ai-trace-block {
  border: 1px solid var(--ai-border); border-radius: var(--radius-sm);
  padding: 8px 10px; background: var(--ai-surface);
}
.ai-trace-block summary {
  cursor: pointer; font-size: 12px; font-weight: 600;
  color: var(--ai-text-secondary); user-select: none;
}
.ai-trace-block summary:hover { color: var(--ai-text); }
.ai-trace-steps {
  margin: 8px 0 0; padding-left: 18px;
  display: flex; flex-direction: column; gap: 6px;
}
.ai-trace-steps li {
  font-size: 12px; color: var(--ai-text-secondary); line-height: 1.5;
}
.ai-trace-muted { font-size: 12px; color: var(--ai-text-muted); }

.ai-trace-msg {
  margin-top: 8px; display: flex; flex-direction: column; gap: 4px;
}
.ai-trace-role {
  align-self: flex-start; font-size: 10px; font-weight: 600;
  padding: 1px 7px; border-radius: var(--radius-pill); letter-spacing: 0.03em;
}
.ai-trace-role.role-system { background: var(--ai-secondary); color: #fff; }
.ai-trace-role.role-user { background: var(--ai-primary-soft); color: var(--ai-primary); }
.ai-trace-role.role-assistant { background: rgba(0, 180, 42, 0.12); color: var(--ai-success); }
.ai-trace-msg-body {
  font-size: 11px; line-height: 1.55; color: var(--ai-text-muted);
  white-space: pre-wrap; word-break: break-word;
  font-family: 'Consolas', 'Monaco', monospace;
  max-height: 160px; overflow-y: auto;
}

.ai-trace-tokens {
  display: flex; align-items: center; gap: 12px;
  font-size: 12px; color: var(--ai-text-secondary);
  padding-top: 8px; border-top: 1px dashed var(--ai-border);
}
.ai-trace-tokens b { color: var(--ai-text); font-weight: 600; }
.ai-trace-est {
  font-size: 10px; color: var(--ai-text-muted);
  border: 1px solid var(--ai-border); border-radius: var(--radius-pill);
  padding: 0 6px;
}

/* ===================== 企业列表卡片（enterprises 类型） ===================== */
.ai-card-enterprise-list {
  list-style: none; margin: 6px 0 0; padding: 0;
}
.ai-card-enterprise-list li {
  padding: 6px 0; font-size: 13px; color: var(--ai-text-secondary);
  border-bottom: 1px solid var(--ai-divider);
}
.ai-card-enterprise-list li:last-child { border-bottom: none; }

/* ===================== 推荐面板项 ===================== */
.ai-panel-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 12px; border-radius: var(--radius-sm);
  cursor: pointer; transition: background-color 0.15s var(--ease-out);
}
.ai-panel-item:hover { background: var(--ai-card); }
.ai-panel-item i {
  font-size: 18px; color: var(--ai-primary); flex-shrink: 0; line-height: 1;
}
.ai-panel-item-title {
  font-size: 13px; font-weight: 500; color: var(--ai-text);
  line-height: 1.4;
}
.ai-panel-item-desc {
  font-size: 12px; color: var(--ai-text-muted); margin-top: 2px; line-height: 1.4;
}

/* ===================== 推荐：最佳对话实践 ===================== */
.ai-practice-item {
  display: flex; flex-direction: column; gap: 7px;
  padding: 12px; border: 1px solid var(--ai-border);
  border-radius: var(--radius-sm); cursor: pointer; margin-bottom: 8px;
  transition: border-color 0.15s var(--ease-out), background 0.15s var(--ease-out);
}
.ai-practice-item:hover { border-color: var(--ai-primary); background: var(--ai-card); }
.ai-practice-head { display: flex; align-items: center; gap: 8px; }
.ai-practice-head i { font-size: 16px; color: var(--ai-primary); flex-shrink: 0; line-height: 1; }
.ai-practice-title { font-size: 13px; font-weight: 600; color: var(--ai-text); }
.ai-practice-why { font-size: 12px; color: var(--ai-text-muted); line-height: 1.5; }
.ai-practice-sample {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 12px; color: var(--ai-text-secondary); line-height: 1.5;
  background: var(--ai-surface); border: 1px dashed var(--ai-border);
  border-radius: var(--radius-sm); padding: 8px 10px;
}
.ai-practice-sample span { min-width: 0; }
.ai-practice-sample i { color: var(--ai-primary); font-size: 12px; flex-shrink: 0; }

/* ===================== 系统引导卡片 ===================== */
.ai-card-guide {
  border-color: var(--ai-border-highlight);
  background: linear-gradient(180deg, var(--ai-primary-soft), transparent);
}
.ai-card-tag-guide {
  background: var(--ai-primary-soft); color: var(--ai-primary);
}
.ai-guide-goal {
  font-size: 13px; line-height: 1.55; color: var(--ai-text);
  margin: 4px 0 10px;
}
.ai-guide-actions {
  display: flex; gap: 8px; flex-wrap: wrap;
}
.ai-guide-btn {
  padding: 7px 14px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500; cursor: pointer;
  text-decoration: none; display: inline-flex; align-items: center;
  transition: background-color 0.15s var(--ease-out), border-color 0.15s var(--ease-out);
}
.ai-guide-btn.primary {
  background: var(--ai-primary); color: #fff; border: 1px solid transparent;
}
.ai-guide-btn.primary:hover { background: var(--ai-primary-hover); }
.ai-guide-btn.ghost {
  background: transparent; color: var(--ai-primary); border: 1px solid var(--ai-primary);
}
.ai-guide-btn.ghost:hover { background: var(--ai-primary-soft); }
.ai-guide-steps {
  list-style: none; margin: 12px 0 0; padding: 0;
  display: flex; flex-direction: column; gap: 10px;
}
.ai-guide-step {
  display: flex; gap: 10px; align-items: flex-start;
}
.ai-guide-step-num {
  flex-shrink: 0; width: 20px; height: 20px; border-radius: 50%;
  background: var(--ai-primary-soft); color: var(--ai-primary);
  font-size: 12px; font-weight: 600; display: flex; align-items: center; justify-content: center;
  margin-top: 1px;
}
.ai-guide-step-title {
  font-size: 13px; font-weight: 600; color: var(--ai-text);
}
.ai-guide-step-desc {
  font-size: 12px; color: var(--ai-text-secondary); line-height: 1.5; margin-top: 2px;
}
