/* ============================================================
   四川弈城数字科技有限公司 - 获客信息统计系统
   全局样式
   ============================================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --success: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;
  --sidebar-bg: #1c2534;
  --sidebar-text: #cbd5e1;
  --bg: #f1f5f9;
  --card: #ffffff;
  --border: #e2e8f0;
  --text: #1e293b;
  --muted: #64748b;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(15, 23, 42, .08);
}

html, body { height: 100%; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
}
a { color: var(--primary); text-decoration: none; }
.mono { font-family: Consolas, "Courier New", monospace; }
.muted { color: var(--muted); font-size: 12.5px; }
.num { text-align: right; }
.ok { color: var(--success); }
.no { color: var(--danger); }

/* ---------------- 登录页 ---------------- */
.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
  padding: 20px;
}
.login-wrap { width: 100%; max-width: 420px; }
.login-card {
  background: #fff; border-radius: 14px; padding: 32px;
  box-shadow: 0 20px 50px rgba(0,0,0,.25);
}
.login-card .table { margin-top: 10px; }
.login-brand { text-align: center; margin-bottom: 20px; }
.login-brand .brand-logo { margin: 0 auto 10px; }
.login-brand h1 { font-size: 19px; color: #0f172a; }
.login-brand p { color: var(--muted); font-size: 13px; margin-top: 4px; }
.login-hint { text-align: center; color: var(--muted); font-size: 12px; margin-top: 16px; }

/* ---------------- 整体布局 ---------------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 230px; flex-shrink: 0;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 20px 18px; border-bottom: 1px solid rgba(255,255,255,.06); }
.brand-logo {
  width: 38px; height: 38px; border-radius: 10px;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff; font-size: 20px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.brand-logo.lg { width: 54px; height: 54px; font-size: 28px; border-radius: 14px; }
.brand-name { color: #fff; font-weight: 700; font-size: 16px; }
.brand-sub { color: #94a3b8; font-size: 11px; margin-top: 2px; }

.nav { padding: 14px 10px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px; margin-bottom: 4px;
  border-radius: 8px; color: var(--sidebar-text);
  font-size: 14px; transition: background .15s;
}
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav-item:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-item.active { background: var(--primary); color: #fff; font-weight: 600; }
.sidebar-foot { padding: 14px 18px; font-size: 11px; color: #64748b; border-top: 1px solid rgba(255,255,255,.06); }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  background: #fff; border-bottom: 1px solid var(--border);
  padding: 14px 24px; display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 10;
}
.page-title { font-size: 17px; font-weight: 700; }
.topbar-user { display: flex; align-items: center; gap: 12px; }
.user-name { font-weight: 600; }
.role-badge {
  padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600;
}
.badge-boss { background: #fef3c7; color: #92400e; }
.badge-specialist { background: #dbeafe; color: #1e40af; }

.content { padding: 24px; flex: 1; }
.footer {
  padding: 14px 24px; color: var(--muted); font-size: 12px;
  border-top: 1px solid var(--border); background: #fff;
}

/* ---------------- 卡片 ---------------- */
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  margin-bottom: 20px; overflow: hidden;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
}
.card-head h2 { font-size: 15px; color: #0f172a; }
.card-head-right { display: flex; align-items: center; gap: 10px; }
.card-body { padding: 18px; }
.card-body.table-wrap { padding: 0; overflow-x: auto; }
.link { font-size: 13px; }

/* ---------------- 表单 ---------------- */
.form-group { margin-bottom: 14px; flex: 1; min-width: 0; }
.form-group label { display: block; margin-bottom: 6px; font-size: 13px; color: #334155; font-weight: 600; }
.form-row { display: flex; gap: 14px; flex-wrap: wrap; }
.form-control {
  width: 100%; padding: 9px 12px;
  border: 1px solid #cbd5e1; border-radius: 8px;
  font-size: 14px; background: #fff; color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.form-control-sm { padding: 5px 8px; font-size: 13px; width: auto; }
.form-actions { display: flex; gap: 10px; margin-top: 18px; }
.filter-form .form-row { align-items: flex-end; }
.filter-btn { display: flex; gap: 8px; padding-bottom: 0; }
.inline-form { display: inline-flex; align-items: center; gap: 6px; }
.inline-details { display: inline-block; }
.inline-details summary { cursor: pointer; list-style: none; }
.inline-details[open] summary { margin-bottom: 6px; }

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; border-radius: 8px; border: 1px solid transparent;
  font-size: 14px; cursor: pointer; transition: background .15s, border-color .15s;
  background: #e2e8f0; color: var(--text);
}
.btn:hover { filter: brightness(.96); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-warn { background: var(--warning); color: #fff; }
.btn-ghost { background: transparent; border-color: #cbd5e1; }
.btn-ghost:hover { background: #f8fafc; }
.btn-sm { padding: 5px 10px; font-size: 12.5px; border-radius: 6px; }
.btn-block { width: 100%; }

/* ---------------- 提示 ---------------- */
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 14px; }
.alert-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.alert-danger { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-warn { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }

/* ---------------- 表格 ---------------- */
.table { width: 100%; border-collapse: collapse; min-width: 640px; }
.table th, .table td {
  padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--border);
  font-size: 13.5px; white-space: nowrap;
}
.table th { background: #f8fafc; color: #475569; font-weight: 600; }
.table tbody tr:hover { background: #f8fafc; }
.td-limit { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.td-actions { display: flex; gap: 8px; align-items: center; }
.td-actions form { margin: 0; }

/* ---------------- 徽标 ---------------- */
.badge {
  display: inline-block; padding: 3px 9px; border-radius: 20px;
  font-size: 12px; font-weight: 600; line-height: 1.5;
}
.badge-success { background: #dcfce7; color: #166534; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-warn { background: #fef3c7; color: #92400e; }
.badge-muted { background: #e2e8f0; color: #475569; }
.badge-boss-tag { background: #fef3c7; color: #92400e; }
.badge-specialist-tag { background: #dbeafe; color: #1e40af; }

/* ---------------- 进度条 ---------------- */
.progress { height: 8px; background: #e2e8f0; border-radius: 20px; overflow: hidden; margin: 8px 0 4px; }
.progress-bar { height: 100%; border-radius: 20px; transition: width .4s; }
.prog-good { background: var(--success); }
.prog-mid { background: var(--warning); }
.prog-bad { background: var(--danger); }
.stat-foot { font-size: 12px; }

/* ---------------- 统计卡片 ---------------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px;
}
.stat-label { color: var(--muted); font-size: 13px; }
.stat-value { font-size: 30px; font-weight: 800; color: #0f172a; margin: 6px 0; }
.stat-value.stat-red, .stat-link .stat-link-inner:hover .stat-value.stat-red { color: #dc2626; }
.stat-unit { font-size: 14px; font-weight: 500; color: var(--muted); }
.stat-foot { font-size: 12.5px; color: var(--muted); }

/* ---------------- 复制电话按钮 ---------------- */
.copy-phone-btn {
  background: #dc2626; color: #fff; border: none; border-radius: 6px;
  padding: 6px 16px; font-size: 13px; font-weight: 600; cursor: pointer;
  transition: background .15s;
}
.copy-phone-btn:hover:not(:disabled) { background: #b91c1c; }
.copy-phone-btn.copied {
  background: #9ca3af; color: #fff; cursor: pointer;
}
.copy-phone-btn.copied:hover { background: #6b7280; }
.copy-phone-btn:disabled {
  opacity: 0.55; cursor: not-allowed;
}
.copy-phone-btn.copied:disabled {
  background: #9ca3af; opacity: 0.7;
}

/* ---------------- AI辅助机器人图标按钮 ---------------- */
.ai-assist-icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff; border: none; cursor: pointer;
  box-shadow: 0 2px 6px rgba(59,130,246,0.35);
  transition: transform .15s, box-shadow .15s;
  padding: 0;
}
.ai-assist-icon-btn:hover {
  transform: scale(1.12);
  box-shadow: 0 4px 12px rgba(59,130,246,0.5);
}
.ai-assist-icon-btn svg {
  width: 18px; height: 18px;
}

/* ---------------- 客户信息卡片 ---------------- */
.customer-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  margin-bottom: 14px;
  overflow: hidden;
  transition: box-shadow .15s;
}
.customer-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.customer-card-header {
  background: #f8fafc;
  margin-bottom: 10px;
}
.customer-table {
  margin-bottom: 0;
  width: 100%;
}
.customer-table thead th {
  background: transparent;
  border-bottom: 1px solid #e5e7eb;
}
.customer-table .copy-row {
  background: #f0f7ff;
}
.customer-table .copy-row td {
  padding: 10px 16px;
  border-top: 1px solid #dbeafe;
}

/* ---------------- 表格粗横线分隔 ---------------- */
.friend-follow-table .record-sep td,
.records-table .record-sep td {
  height: 5px;
  background: #1f2937;
  padding: 0;
  border: none;
}

/* ---------------- 编辑弹窗 ---------------- */
.edit-modal-overlay {
  display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5); z-index: 9999; justify-content: center; align-items: center;
}
.edit-modal-overlay.active { display: flex; }
.edit-modal {
  background: #fff; border-radius: 12px; padding: 24px; width: 90%; max-width: 520px;
  max-height: 85vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.edit-modal h3 { margin: 0 0 16px 0; font-size: 18px; }
.edit-modal .form-row { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.edit-modal .form-item label { display: block; margin-bottom: 4px; font-size: 13px; font-weight: 600; color: #374151; }
.edit-modal .form-item input { width: 100%; padding: 8px 12px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 14px; box-sizing: border-box; }
.edit-modal .modal-actions { display: flex; gap: 10px; justify-content: flex-end; }

/* ---------------- 迷你进度条（报表） ---------------- */
.mini-bar {
  display: inline-block; width: 90px; height: 8px;
  background: #e2e8f0; border-radius: 20px; overflow: hidden;
  vertical-align: middle;
}
.mini-bar-fill { height: 100%; border-radius: 20px; }
.mini-bar-text { font-size: 12px; margin-left: 8px; vertical-align: middle; font-weight: 600; }

/* ---------------- 其他 ---------------- */
.empty { color: var(--muted); text-align: center; padding: 28px 0; }
.quick-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.pager { display: flex; gap: 6px; padding: 14px; flex-wrap: wrap; }
.page-link {
  padding: 6px 11px; border: 1px solid var(--border); border-radius: 6px;
  color: var(--text); font-size: 13px; background: #fff;
}
.page-link.current { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ---------------- v2：弹窗 ---------------- */
.modal-mask {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(15,23,42,.5);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal {
  background: #fff; border-radius: 12px; width: 100%; max-width: 900px;
  max-height: 86vh; display: flex; flex-direction: column;
  box-shadow: 0 20px 50px rgba(0,0,0,.3); overflow: hidden;
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
}
.modal-head h3 { font-size: 15px; }
.modal-close { border: none; background: none; font-size: 22px; line-height: 1; cursor: pointer; color: var(--muted); }
.modal-close:hover { color: var(--danger); }
.modal-body { padding: 18px; overflow: auto; }
.modal-foot {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 12px 18px; border-top: 1px solid var(--border); background: #f8fafc;
}

/* ---------------- v2：录入查重提示 ---------------- */
.field-hint { margin-top: 6px; font-size: 12.5px; }
.dup-warn { color: var(--danger); font-weight: 600; }
.dup-ok { color: var(--success); font-weight: 600; }

/* ---------------- v2：区块标题 ---------------- */
.sec-title { font-size: 14px; font-weight: 700; margin: 0 0 12px; color: #0f172a; }
.sec-divider { border: none; border-top: 1px dashed var(--border); margin: 22px 0; }
.req { color: var(--danger); }
.link-btn {
  border: none; background: none; padding: 0; cursor: pointer;
  color: var(--primary); font-size: 13.5px; text-decoration: underline;
}
.link-btn:hover { color: var(--primary-dark); }

/* ---------------- v2：统计卡链接 / 小卡 ---------------- */
.stat-link .stat-link-inner { display: block; color: inherit; }
.stat-link .stat-link-inner:hover .stat-value { color: var(--primary); }
.small-grid .stat-card { padding: 12px; }
.small-grid .stat-value { font-size: 22px; }

/* ---------------- v2：考核日历 ---------------- */
.cal-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.cal-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px;
}
.cal-head {
  text-align: center; font-size: 12px; font-weight: 700; color: var(--muted);
  padding: 4px 0;
}
.cal-cell {
  border: 1px solid var(--border); border-radius: 8px; padding: 7px 8px;
  min-height: 74px; background: #fff; position: relative;
  cursor: pointer; transition: box-shadow .15s, border-color .15s;
}
.cal-cell:hover { border-color: var(--primary); box-shadow: 0 2px 8px rgba(37,99,235,.15); }
.cal-cell .cal-date { font-size: 12px; font-weight: 700; color: #334155; }
.cal-cell .cal-week { font-size: 10.5px; color: var(--muted); }
.cal-cell .cal-target { margin-top: 5px; font-size: 11.5px; color: #475569; line-height: 1.35; }
.cal-cell .cal-meta { margin-top: 4px; font-size: 10.5px; }
.cal-cell.future { background: #fafafa; cursor: default; }
.cal-cell.today { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(37,99,235,.2); }
.cal-cell.no-assess { background: #f8fafc; }
.cal-cell.no-assess .cal-target { color: var(--muted); text-decoration: line-through; }
.cal-cell.has-override { border-style: dashed; border-color: var(--warning); }
.tag-free { display: inline-block; background: #f1f5f9; color: var(--muted); border-radius: 4px; padding: 1px 6px; font-size: 10.5px; }
.tag-override { display: inline-block; background: #fef3c7; color: #92400e; border-radius: 4px; padding: 1px 6px; font-size: 10.5px; }
.tag-month { display: inline-block; background: #dbeafe; color: #1e40af; border-radius: 4px; padding: 1px 6px; font-size: 10.5px; }

/* ---------------- v2：成单/意向徽标 ---------------- */
.badge-deal { background: #dcfce7; color: #166534; }
.badge-intent-strong { background: #fee2e2; color: #991b1b; }
.badge-intent-normal { background: #fef3c7; color: #92400e; }
.badge-intent-unreplied { background: #e2e8f0; color: #475569; }
.chk { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; cursor: pointer; }

@media (max-width: 900px) {
  .sidebar { width: 64px; }
  .brand-text, .nav-item span, .sidebar-foot { display: none; }
  .brand { justify-content: center; }
  .nav-item { justify-content: center; }
  .content { padding: 16px; }
}

/* ============================================================
   v3：等宽布局（所有内容区块尽量等宽且较宽）
   ============================================================ */
.content { max-width: 1280px; margin: 0 auto; width: 100%; }
.stat-grid { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.card-head, .card-body { }
/* 卡片与统计卡统一为较宽等宽容器 */
.card { width: 100%; }
.stat-card { width: 100%; }

/* ============================================================
   v3：AI 智能悬浮助手
   ============================================================ */
.ai-fab {
  position: fixed; left: 22px; bottom: 22px; z-index: 950;
  width: 58px; height: 58px; border-radius: 50%; border: none; cursor: pointer;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: #fff; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 22px rgba(37, 99, 235, .5);
  transition: transform .15s, box-shadow .15s;
}
.ai-fab:hover { transform: scale(1.07); box-shadow: 0 10px 26px rgba(37, 99, 235, .6); }
.ai-fab svg { width: 28px; height: 28px; }
.ai-fab-tag {
  position: absolute; top: -5px; right: -5px;
  background: var(--danger); color: #fff; font-size: 10px; font-weight: 700;
  padding: 2px 6px; border-radius: 10px; line-height: 1.2;
}
.ai-fab-ring {
  position: absolute; inset: -8px; border-radius: 50%;
  border: 2px solid rgba(59, 130, 246, .55);
  animation: aiPulse 2s ease-out infinite; pointer-events: none;
}
@keyframes aiPulse {
  0% { transform: scale(.85); opacity: .9; }
  100% { transform: scale(1.55); opacity: 0; }
}

.ai-panel {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%);
  z-index: 960;
  width: 480px; max-width: calc(100vw - 40px);
  height: min(78vh, 680px);
  background: #fff; border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .28);
  display: none; flex-direction: column; overflow: hidden;
}
.ai-panel.open { display: flex; }
.ai-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, #1e3a8a, #2563eb);
  color: #fff;
}
.ai-panel-title { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.ai-panel-title-row { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; min-width: 0; }
.ai-panel-dot { width: 8px; height: 8px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 6px #4ade80; flex-shrink: 0; }
.ai-panel-sub { font-size: 12px; opacity: .85; font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-left: 16px; }
.ai-panel-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.ai-icon-btn {
  background: rgba(255,255,255,.16); color: #fff; border: none; border-radius: 6px;
  padding: 4px 9px; font-size: 12px; cursor: pointer;
}
.ai-icon-btn:hover { background: rgba(255,255,255,.28); }
.ai-close { border: none; background: none; color: #fff; font-size: 22px; line-height: 1; cursor: pointer; }
.ai-close:hover { color: #fca5a5; }

.ai-tabs { display: flex; border-bottom: 1px solid var(--border); background: #f8fafc; }
.ai-tab {
  flex: 1; padding: 10px 6px; text-align: center; font-size: 13px; cursor: pointer;
  color: var(--muted); border-bottom: 2px solid transparent; user-select: none;
}
.ai-tab:hover { color: var(--primary); }
.ai-tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; background: #fff; }

.ai-body { flex: 1; overflow: auto; padding: 14px; background: #f8fafc; }
.ai-hide { display: none !important; }
.ai-welcome { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 14px; margin-bottom: 12px; }
.ai-welcome-title { font-weight: 700; margin-bottom: 6px; }
.ai-welcome p { font-size: 12.5px; color: var(--muted); margin: 4px 0; }
.ai-welcome ul { margin: 6px 0 0 16px; font-size: 12.5px; color: #334155; }

.ai-msg { display: flex; margin-bottom: 12px; }
.ai-msg.user { justify-content: flex-end; }
.ai-bubble {
  max-width: 86%; padding: 9px 12px; border-radius: 12px;
  font-size: 13.5px; line-height: 1.6; word-break: break-word;
}
.ai-msg.user .ai-bubble { background: var(--primary); color: #fff; border-top-right-radius: 3px; white-space: pre-wrap; }
.ai-msg.assistant .ai-bubble { background: #fff; color: var(--text); border: 1px solid var(--border); border-top-left-radius: 3px; }
.ai-msg.assistant .ai-bubble code { background: #eef2ff; padding: 1px 5px; border-radius: 4px; font-size: 12px; }
.ai-num { color: var(--primary); }
.ai-loading { color: var(--muted); font-size: 12.5px; padding: 6px 2px; }
.ai-loading:after { content: '…'; animation: aiDots 1.2s infinite; }
@keyframes aiDots { 0%{content:'.'} 33%{content:'..'} 66%{content:'...'} }

.ai-inputbar { display: flex; gap: 8px; align-items: flex-end; padding: 10px 12px; border-top: 1px solid var(--border); background: #fff; }
.ai-inputbar textarea {
  flex: 1; border: 1px solid #cbd5e1; border-radius: 10px; padding: 9px 12px;
  font-size: 13.5px; font-family: inherit; resize: none; min-height: 38px; max-height: 100px; outline: none;
}
.ai-inputbar textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.ai-inputbar .btn { flex-shrink: 0; }

/* 知识库 */
.ai-kb-form { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 12px; margin-bottom: 12px; }
.ai-kb-form .form-group { margin-bottom: 8px; }
.ai-kb-item { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; }
.ai-kb-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ai-kb-cat { background: #dbeafe; color: #1e40af; border-radius: 4px; padding: 1px 7px; font-size: 11px; font-weight: 600; }
.ai-kb-ops { margin-left: auto; display: flex; gap: 8px; }
.ai-kb-content { margin-top: 6px; font-size: 12.5px; color: #475569; line-height: 1.6; }

/* 上传 */
.ai-upload-row { display: flex; gap: 8px; align-items: center; }
.ai-upload-row .form-control { flex: 1; }
