:root {
  --brand-50: #eef2ff;
  --brand-100: #e0e7ff;
  --brand-200: #c7d2fe;
  --brand-300: #a5b4fc;
  --brand-500: #6366f1;
  --brand-600: #4f46e5;
  --brand-700: #4338ca;
  --ink-900: #0f172a;
  --ink-700: #334155;
  --ink-500: #64748b;
  --ink-400: #94a3b8;
  --ink-100: #f1f5f9;
  --line: #e2e8f0;
  --card: #ffffff;
  --success: #16a34a;
  --success-bg: #dcfce7;
  --warning: #d97706;
  --warning-bg: #fef3c7;
  --hot: #e11d48;
  --hot-bg: #ffe4e6;
  --amber: #f59e0b;
  --amber-bg: #fef3c7;
  --sh-1: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .08);
  --sh-2: 0 4px 16px rgba(15, 23, 42, .10);
  --r: 14px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f6f7fb;
  color: var(--ink-900);
  font-size: 14px;
}
a { color: var(--brand-600); cursor: pointer; }
.boot { padding: 60px; text-align: center; color: var(--ink-400); }

/* ---------- 布局 ---------- */
.layout { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.sidebar {
  background: #0f172a; color: #cbd5e1; padding: 18px 14px;
  display: flex; flex-direction: column; gap: 4px;
}
.sidebar .brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 16px; }
.sidebar .brand .logo { width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(135deg, var(--brand-500), var(--brand-700)); display: grid; place-items: center; color: #fff; font-size: 15px; }
.sidebar .brand b { color: #fff; font-size: 14px; line-height: 1.2; }
.sidebar .brand small { color: var(--ink-400); font-size: 11px; }
.side-group { font-size: 11px; color: var(--ink-400); text-transform: uppercase; letter-spacing: .06em; margin: 14px 8px 4px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px;
  color: #cbd5e1; cursor: pointer; font-size: 13px; font-weight: 500;
}
.nav-item:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-item.active { background: var(--brand-600); color: #fff; }
.nav-item .ic { width: 18px; text-align: center; }
.nav-item .tag { margin-left: auto; font-size: 11px; background: var(--hot); color: #fff; border-radius: 9px; padding: 1px 7px; }
.nav-item .tag.green { background: var(--success); }

.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 56px; background: #fff; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 14px; padding: 0 22px; position: sticky; top: 0; z-index: 10;
}
.topbar .title { font-weight: 700; font-size: 15px; }
.topbar .spacer { flex: 1; }
.topbar .who { color: var(--ink-500); font-size: 13px; }
.content { padding: 22px; }

/* ---------- 卡片 / 通用 ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh-1); }
.page-head { margin-bottom: 16px; }
.page-head h1 { font-size: 20px; margin: 0 0 4px; }
.page-head p { margin: 0; color: var(--ink-500); font-size: 13px; }
.row { display: flex; gap: 14px; flex-wrap: wrap; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.stat { padding: 16px 18px; }
.stat .k { color: var(--ink-500); font-size: 12.5px; }
.stat .v { font-size: 26px; font-weight: 800; margin-top: 6px; }
.stat .v small { font-size: 13px; color: var(--ink-400); font-weight: 600; }

.btn {
  border: 1px solid var(--line); background: #fff; color: var(--ink-900);
  border-radius: 10px; padding: 9px 14px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.btn:hover { background: var(--ink-100); }
.btn.primary { background: var(--brand-600); color: #fff; border-color: var(--brand-600); }
.btn.primary:hover { background: var(--brand-700); }
.btn.danger { color: var(--hot); border-color: var(--hot-bg); }
.btn.sm { padding: 6px 10px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

input, select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  font-size: 13px; font-family: inherit; background: #fff; color: var(--ink-900);
}
input:focus, select:focus { outline: 2px solid var(--brand-200); border-color: var(--brand-400); }
label { display: block; font-size: 12.5px; color: var(--ink-700); font-weight: 600; margin-bottom: 6px; }
.form-row { margin-bottom: 14px; }
.form-input { width: 100%; }

/* Schema 字段编辑行：字段名 | 显示标签 | 类型 | 删除（grid 四列） */
.sf-row { display: grid; grid-template-columns: 1fr 1fr 90px 30px; gap: 8px; align-items: center; margin-bottom: 6px; }
.sf-row .form-input { height: 34px; }
.sf-row .sf-type { padding: 0 6px; text-align: center; text-align-last: center; } /* 修正 select 文字被 34px 高度截断 */
.sf-row .sf-del { padding: 0; display: flex; align-items: center; justify-content: center; height: 34px; color: var(--ink-400); }
.sf-row .sf-del:hover { color: var(--hot); border-color: var(--hot); }
.sf-row.sf-head { font-size: 11px; color: var(--ink-400); font-weight: 600; margin-bottom: 4px; }

/* Action 动作编辑行：动作类型 | 按钮名 | 删除（grid 三列） */
.af-row { display: grid; grid-template-columns: 150px 1fr 30px; gap: 8px; align-items: center; margin-bottom: 6px; }
.af-row .form-input { height: 34px; }
.af-row .af-type { padding: 0 6px; }
.af-row .af-del { padding: 0; display: flex; align-items: center; justify-content: center; height: 34px; color: var(--ink-400); }
.af-row .af-del:hover { color: var(--hot); border-color: var(--hot); }
.af-row.af-head { font-size: 11px; color: var(--ink-400); font-weight: 600; margin-bottom: 4px; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); }
th { color: var(--ink-500); font-weight: 600; font-size: 12px; background: #fafbff; }
tbody tr:hover { background: #fafbff; }

.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 700; padding: 2px 9px; border-radius: 999px; }
.badge.green { background: var(--success-bg); color: var(--success); }
.badge.amber { background: var(--amber-bg); color: var(--warning); }
.badge.gray { background: var(--ink-100); color: var(--ink-500); }
.badge.hot { background: var(--hot-bg); color: var(--hot); }
.badge.indigo { background: var(--brand-50); color: var(--brand-700); }
.badge.strike { text-decoration: line-through; opacity: .6; }

/* ---------- 进度条 ---------- */
.meter { margin-bottom: 10px; }
.meter .top { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-700); margin-bottom: 4px; }
.bar { height: 8px; background: var(--ink-100); border-radius: 6px; overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 6px; }
.bar > i.hot { background: linear-gradient(90deg, #fb7185, var(--hot)); }
.bar > i.green { background: linear-gradient(90deg, #4ade80, var(--success)); }
.bar > i.amber { background: linear-gradient(90deg, #fbbf24, var(--amber)); }

/* ---------- 认证页 ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(120% 120% at 50% 0%, #eef2ff 0%, #f6f7fb 55%); padding: 24px; }
.auth-card { width: 400px; max-width: 100%; background: #fff; border-radius: 18px; box-shadow: var(--sh-2); overflow: hidden; }
.auth-head { padding: 22px 24px 14px; }
.auth-head .brand { display: flex; align-items: center; gap: 10px; }
.auth-head .logo { width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, var(--brand-500), var(--brand-700)); display: grid; place-items: center; color: #fff; }
.auth-head h2 { font-size: 19px; margin: 14px 0 2px; }
.auth-head p { font-size: 12.5px; color: var(--ink-500); margin: 0; }
.auth-body { padding: 6px 24px 12px; display: flex; flex-direction: column; gap: 4px; }
.auth-foot { padding: 12px 24px 22px; font-size: 12.5px; color: var(--ink-500); text-align: center; }
.auth-switch { display: flex; gap: 8px; padding: 0 24px 14px; }
.auth-switch button { flex: 1; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 9px; font-weight: 700; font-size: 12.5px; color: var(--ink-500); cursor: pointer; }
.auth-switch button.active { background: var(--brand-50); border-color: var(--brand-300); color: var(--brand-700); }
.platform-head { background: linear-gradient(135deg, #0f172a, #312e81); color: #fff; }
.platform-head .logo { background: linear-gradient(135deg, #818cf8, #6366f1); }
.platform-head h2, .platform-head p { color: #fff; }
.code-box { display: flex; align-items: center; gap: 8px; background: var(--brand-50); border: 1px dashed var(--brand-300); border-radius: 10px; padding: 12px 14px; font-weight: 800; letter-spacing: 2px; color: var(--brand-700); font-size: 16px; }
.code-box .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

/* ---------- 今日成交任务三列 ---------- */
.todo-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 900px) { .todo-cols { grid-template-columns: 1fr; } }
.todo-col { padding: 14px; }
.todo-col h3 { font-size: 13.5px; margin: 0 0 12px; display: flex; align-items: center; gap: 7px; }
.todo-col .lead { display: flex; align-items: center; gap: 10px; padding: 11px; border-radius: 11px; border: 1px solid var(--line); margin-bottom: 10px; cursor: pointer; }
.todo-col .lead:hover { border-color: var(--brand-300); background: var(--brand-50); }
.todo-col .lead .av { width: 34px; height: 34px; border-radius: 9px; background: var(--brand-100); color: var(--brand-700); display: grid; place-items: center; font-weight: 800; }
.todo-col .lead .nm { font-weight: 700; }
.todo-col .lead .sub { font-size: 11.5px; color: var(--ink-500); }

/* ---------- 抽屉 / 详情 ---------- */
.drawer-mask { position: fixed; inset: 0; background: rgba(15, 23, 42, .35); display: grid; justify-items: end; z-index: 50; }
.drawer { width: 420px; max-width: 92vw; height: 100%; background: #fff; box-shadow: var(--sh-2); overflow-y: auto; animation: slideIn .2s ease; }
@keyframes slideIn { from { transform: translateX(40px); opacity: .4; } to { transform: none; opacity: 1; } }
.drawer .dh { padding: 16px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; }
.drawer .dh b { font-size: 16px; }
.drawer .db { padding: 18px; }
.section-t { font-size: 12.5px; font-weight: 800; color: var(--ink-700); margin: 16px 0 8px; display: flex; align-items: center; gap: 6px; }
.li { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--ink-100); }
.li .ic { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; font-size: 14px; flex: none; }
.li .ic.hot { background: var(--hot-bg); }
.li .ic.amber { background: var(--amber-bg); }
.li .ic.green { background: var(--success-bg); }
.nba { background: var(--brand-50); border: 1px solid var(--brand-200); border-radius: 11px; padding: 12px 14px; }
.nba .t { font-size: 12px; font-weight: 800; color: var(--brand-700); margin-bottom: 5px; }
.chip { display: inline-block; background: var(--ink-100); border-radius: 8px; padding: 3px 9px; font-size: 12px; margin: 0 6px 6px 0; }
.conv-line { font-size: 12.5px; line-height: 1.7; padding: 5px 0; border-bottom: 1px dashed var(--ink-100); }
.conv-line b { color: var(--brand-700); }
.conv-ts { color: var(--ink-500); font-size: 11px; margin-right: 8px; font-variant-numeric: tabular-nums; }

/* ---------- toast / modal ---------- */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--ink-900); color: #fff; padding: 10px 18px; border-radius: 10px; font-size: 13px; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 100; }
.toast.show { opacity: 1; }
.toast.err { background: var(--hot); }
.modal-card { width: 440px; max-width: 92vw; margin: auto; background: #fff; border-radius: 16px; box-shadow: var(--sh-2); margin-top: 12vh; }
.modal-card .mh { padding: 16px 20px; border-bottom: 1px solid var(--line); font-weight: 700; }
.modal-card .mb { padding: 20px; }
.modal-card .mf { padding: 0 20px 20px; display: flex; gap: 10px; justify-content: flex-end; }
.empty { padding: 40px; text-align: center; color: var(--ink-400); }
.muted { color: var(--ink-500); }

/* ---------- 桌面端微信实时会话联动横条 ---------- */
.wx-live-bar {
  display: none;
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 9999;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--brand-600, #4f46e5);
  color: #fff;
  font-size: 13px;
  box-shadow: 0 -2px 8px rgba(0,0,0,.18);
}
.wx-live-bar .wx-dot { width: 8px; height: 8px; border-radius: 50%; background: #34d399; display: inline-block; flex: none; }
.wx-live-bar .wx-id { opacity: .8; font-family: ui-monospace, monospace; font-size: 12px; }
.wx-live-bar .wx-tag { padding: 2px 8px; border-radius: 999px; font-size: 12px; }
.wx-live-bar .wx-tag.ok { background: rgba(52,211,153,.25); color: #d1fae5; }
.wx-live-bar .wx-tag.warn { background: rgba(251,191,36,.25); color: #fde68a; }
.wx-live-bar .wx-ana-inline { margin-left: 4px; }
.wx-live-bar .wx-ana-chip { background: rgba(255,255,255,.16); padding: 2px 9px; border-radius: 999px; font-size: 12px; white-space: nowrap; }
.wx-live-bar .wx-analysis-btn {
  margin-left: auto; border: 0; background: #fff; color: #4f46e5; font-weight: 700;
  font-size: 12px; padding: 4px 12px; border-radius: 999px; cursor: pointer; flex: none;
}
.wx-live-bar .wx-analysis-btn:hover { background: #eef2ff; }

/* ---------- AI 分析结论浮层（底部横条上方）---------- */
.wx-analysis-detail {
  display: none;
  position: fixed; left: 16px; right: 16px; bottom: 44px; z-index: 10000;
  max-height: 62vh; overflow: auto;
  background: #fff; color: #111827; border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0,0,0,.28); border: 1px solid #e5e7eb;
  padding: 16px 18px;
}
.wx-analysis-detail .wx-ad-h { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.wx-analysis-detail .wx-ad-close {
  margin-left: auto; border: 0; background: #f3f4f6; color: #6b7280; width: 26px; height: 26px;
  border-radius: 8px; cursor: pointer; font-size: 13px;
}
.wx-analysis-detail .wx-ad-close:hover { background: #e5e7eb; }
.wx-analysis-detail .wx-ad-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 12px; }
.wx-analysis-detail .wx-ad-cell {
  background: #f8fafc; border: 1px solid #eef2f7; border-radius: 10px; padding: 10px 12px;
  display: flex; flex-direction: column; gap: 4px;
}
.wx-analysis-detail .wx-ad-cell b { font-size: 20px; color: #4f46e5; }
.wx-analysis-detail .wx-ad-k { font-size: 11.5px; color: #6b7280; font-weight: 700; }
.wx-analysis-detail .wx-ad-row { padding: 8px 0; border-top: 1px solid #f1f5f9; }
.wx-analysis-detail .wx-ad-row > div { margin-top: 4px; font-size: 13px; line-height: 1.6; }
.wx-analysis-detail .wx-ad-row .wx-ad-k { display: block; }

/* ---------- 分析历史时间线（客户详情抽屉）---------- */
.hist-list { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.hist-row { background: var(--ink-50, #f8fafc); border: 1px solid var(--line, #eef2f7); border-radius: 10px; padding: 9px 12px; }
.hist-row .hist-t { font-size: 11.5px; color: var(--ink-500); font-variant-numeric: tabular-nums; }
.hist-row .hist-v { font-size: 13px; margin-top: 3px; }
.hist-row .hist-s { font-size: 11.5px; color: var(--ink-500); margin-top: 2px; }
.hist-delta { font-size: 11px; margin-left: 3px; font-weight: 800; }
.hist-delta.up { color: #16a34a; }
.hist-delta.down { color: #dc2626; }

/* ---------- 面板配置（老板后台）---------- */
.section-t { font-size: 12.5px; font-weight: 700; color: var(--ink-700); margin: 4px 0 10px; letter-spacing: .02em; }
.cmp-list { display: flex; flex-direction: column; gap: 10px; }
.cmp-row { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fcfdff; }
.cmp-meta { display: flex; flex-direction: column; gap: 2px; }
.cmp-meta b { font-size: 14px; color: var(--ink-900); }
.cmp-meta .muted { font-size: 12px; }
.kind-tabs { display: flex; gap: 10px; flex-wrap: wrap; }
.kind-tabs .btn { flex: 1; min-width: 110px; text-align: left; padding: 10px 12px; border-radius: 10px; }
.kind-tabs .btn.primary { box-shadow: 0 1px 2px rgba(79,70,229,.15); }

/* 开关（toggle） */
.switch { position: relative; display: inline-block; width: 44px; height: 24px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute; inset: 0; cursor: pointer; background: var(--ink-400);
  border-radius: 999px; transition: background .18s;
}
.switch .slider::before {
  content: ""; position: absolute; height: 18px; width: 18px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; transition: transform .18s; box-shadow: 0 1px 3px rgba(0,0,0,.25);
}
.switch input:checked + .slider { background: var(--brand-600); }
.switch input:checked + .slider::before { transform: translateX(20px); }

textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 13px;
  font-family: inherit; background: #fff; color: var(--ink-900); resize: vertical; line-height: 1.6; }
textarea:focus { outline: 2px solid var(--brand-200); border-color: var(--brand-400); }

/* ---------- 面板 2.0 / 待办管理（新视图）---------- */
.todo-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 13px; }
.todo-table th { background: var(--ink-50, #f8fafc); color: var(--ink-500); font-weight: 600; font-size: 11.5px;
  text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.todo-table td { padding: 11px 12px; border-bottom: 1px solid var(--line-soft, #eef2f7); vertical-align: top; }
.todo-table tr.overdue td { background: rgba(220,38,38,.06); }
.todo-table tr.editing td { background: #eef2ff; }
.todo-table .cell-ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.todo-table tbody tr:hover { background: var(--ink-50, #f8fafc); }
.tag-pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.tag-pill.hi { background: rgba(220,38,38,.10); color: #dc2626; border: 1px solid rgba(220,38,38,.2); }
.tag-pill.mid { background: rgba(245,158,11,.12); color: #b45309; border: 1px solid rgba(245,158,11,.2); }
.tag-pill.lo { background: rgba(37,99,235,.10); color: #2563eb; border: 1px solid rgba(37,99,235,.2); }
.tag-pill.done { background: rgba(22,163,74,.12); color: #16a34a; border: 1px solid rgba(22,163,74,.2); }
.tag-pill.open { background: rgba(147,51,234,.10); color: #7c3aed; border: 1px solid rgba(147,51,234,.2); }
.tag-pill.overdue { background: rgba(220,38,38,.10); color: #dc2626; border: 1px solid rgba(220,38,38,.2); }
.stat-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.stat-chip { padding: 4px 12px; border-radius: 999px; font-size: 12px; font-weight: 700; cursor: pointer;
  border: 1px solid var(--line); background: #fff; color: var(--ink-600); }
.stat-chip.active { background: var(--brand-600); color: #fff; border-color: var(--brand-600); }
.stat-chip .n { font-variant-numeric: tabular-nums; }
/* 待办统计看板 KPI */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; }
.kpi-card { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 14px 12px; }
.kpi-card .kpi-v { font-size: 24px; font-weight: 800; line-height: 1.1; color: var(--ink-800); font-variant-numeric: tabular-nums; }
.kpi-card .kpi-l { font-size: 12px; color: var(--ink-500); margin-top: 4px; }
.todo-table td.od { color: #dc2626; font-weight: 700; }
/* 查看会话抽屉 */
.todo-drawer { position: fixed; inset: 0; background: rgba(15,23,42,.35); z-index: 45; opacity: 0; pointer-events: none; transition: opacity .25s ease; }
.todo-drawer.show { opacity: 1; pointer-events: auto; }
.todo-drawer .panel { position: absolute; right: 0; top: 0; bottom: 0; width: 420px; max-width: 92vw; background: #fff;
  box-shadow: -8px 0 30px rgba(15,23,42,.18); display: flex; flex-direction: column; }
.todo-drawer .head { padding: 16px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.todo-drawer .body { flex: 1; overflow-y: auto; padding: 16px 18px; }
.todo-drawer .msg { margin-bottom: 10px; max-width: 80%; }
.todo-drawer .msg.mine { margin-left: auto; }
.todo-drawer .msg .bubble { padding: 8px 12px; border-radius: 12px; font-size: 13px; line-height: 1.5; }
.todo-drawer .msg.mine .bubble { background: var(--brand-100); border-top-right-radius: 4px; }
.todo-drawer .msg.other .bubble { background: var(--ink-50); border-top-left-radius: 4px; }
.todo-drawer .msg .t { font-size: 10.5px; color: var(--ink-400); margin-top: 3px; }
.todo-drawer .msg.highlight .bubble { outline: 2px solid #f59e0b; background: #fffbeb; }

/* ---------- 客户端面板实时预览（后台内嵌 440px 立体组件）---------- */
.panel-stage { display: flex; align-items: flex-start; gap: 16px; justify-content: center; }
@media (max-width: 1280px) { .panel-stage { flex-wrap: wrap; } }
.phone-panel {
  width: 360px; max-width: 100%; background: #f8fafc; border: 1px solid #e2e8f0;
  border-radius: 16px; overflow: hidden; box-shadow: 0 20px 25px -5px rgba(15,23,42,.10), 0 10px 10px -5px rgba(15,23,42,.04);
  flex-shrink: 0;
}
.phone-header { background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%); padding: 12px 16px; color: #fff; }
.phone-header .ph-avatar { width: 30px; height: 30px; border-radius: 50%; background: rgba(255,255,255,.22); display: grid; place-items: center; font-size: 13px; font-weight: 700; margin-right: 10px; flex: none; }
.phone-header .ph-name { font-size: 14px; font-weight: 700; }
.phone-header .ph-rel { font-size: 11px; opacity: .85; }
.phone-body { padding: 12px; overflow-y: auto; max-height: 520px; }
.phone-body::-webkit-scrollbar { width: 5px; }
.phone-body::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }

/* 面板内一张卡片 */
.phone-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 13px; margin-bottom: 10px; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.phone-card .pc-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.phone-card .pc-title { font-size: 12px; font-weight: 700; color: var(--ink-500); text-transform: uppercase; letter-spacing: .02em; }
.phone-card .pc-refresh { font-size: 10px; color: var(--brand-600); cursor: pointer; display: inline-flex; align-items: center; gap: 3px; border: 0; background: transparent; padding: 0; }
.phone-card .pc-refresh:hover { text-decoration: underline; }
.phone-card .pc-foot { margin-top: 8px; font-size: 10px; color: var(--ink-400); }
/* schema 字段行 */
.phone-schema .fld { display: flex; align-items: flex-start; padding: 4px 0; }
.phone-schema .fld .k { font-size: 11px; color: var(--ink-400); width: 64px; flex-shrink: 0; margin-top: 3px; }
.phone-schema .fld .v { flex: 1; min-width: 0; font-size: 12px; color: var(--ink-800); }
.phone-score { height: 6px; background: #e2e8f0; border-radius: 3px; overflow: hidden; margin-top: 3px; }
.phone-score > i { display: block; height: 100%; background: linear-gradient(90deg, #6366f1, #8b5cf6); border-radius: 3px; }
/* 面板内建议 / 待办项 */
.phone-sugg { padding: 9px 10px; background: #f8fafc; border: 1px solid #eef2f7; border-radius: 9px; margin-bottom: 8px; }
.phone-sugg .ps-meta { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.phone-sugg .ps-tone { font-size: 10px; color: var(--ink-400); }
.phone-sugg .ps-act { display: flex; gap: 8px; }
.phone-sugg .ps-act button { font-size: 10px; color: var(--brand-600); border: 0; background: transparent; cursor: pointer; padding: 0; }
.phone-sugg .ps-act button:hover { text-decoration: underline; }
.phone-sugg .ps-text { font-size: 12px; color: var(--ink-800); line-height: 1.55; }
.phone-todo { padding: 9px 10px; background: #f8fafc; border: 1px solid #eef2f7; border-radius: 9px; margin-bottom: 8px; }
.phone-todo .pt-text { font-size: 12px; color: var(--ink-800); line-height: 1.5; }
.phone-todo .pt-meta { display: flex; align-items: center; gap: 8px; margin-top: 5px; flex-wrap: wrap; }
.phone-todo .pt-meta .muted { font-size: 10px; color: var(--ink-400); }
.phone-todo .pt-meta .mt { font-size: 11px; }
.phone-todo .pt-meta .add { margin-left: auto; font-size: 10px; color: var(--brand-600); border: 0; background: transparent; cursor: pointer; padding: 0; }
.phone-todo .pt-meta .add:hover { text-decoration: underline; }
.phone-todo .pt-meta .added { margin-left: auto; font-size: 10px; color: var(--success); }
.phone-sess-todo { background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 13px; margin-bottom: 10px; }
.phone-sess-todo .psh { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.phone-sess-todo .psh .t { font-size: 12px; font-weight: 700; color: var(--ink-500); }
.phone-sess-todo .psh .add-btn { font-size: 10px; color: var(--brand-600); border: 0; background: transparent; cursor: pointer; display: inline-flex; align-items: center; gap: 3px; }
.phone-sess-todo .srow { display: flex; align-items: center; gap: 8px; padding: 7px 8px; background: #f8fafc; border: 1px solid #eef2f7; border-radius: 8px; margin-bottom: 6px; }
.phone-sess-todo .srow .dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.phone-sess-todo .srow .txt { flex: 1; min-width: 0; font-size: 12px; color: var(--ink-800); }
.phone-sess-todo .srow .txt.done { text-decoration: line-through; color: var(--ink-400); }
.phone-sess-todo .srow .prio { font-size: 10px; }
.phone-empty { padding: 36px 16px; text-align: center; color: var(--ink-400); font-size: 12px; }

/* 关系信息卡（企业工作台右侧） */
.rel-info-card { width: 260px; flex-shrink: 0; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 18px; box-shadow: var(--sh-1); }
.rel-info-card .ric-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.rel-info-card .ric-h h3 { font-size: 14px; font-weight: 800; color: var(--ink-900); margin: 0; }
.rel-info-card .ric-row { display: flex; align-items: flex-start; justify-content: space-between; font-size: 12px; padding: 6px 0; }
.rel-info-card .ric-row .k { color: var(--ink-400); }
.rel-info-card .ric-row .v { color: var(--ink-800); font-weight: 600; text-align: right; }
.rel-info-card .ric-div { border-top: 1px solid var(--line); margin: 10px 0; }
.rel-info-card .ric-desc { font-size: 11.5px; color: var(--ink-500); line-height: 1.6; }
.rel-info-card .ric-upgrade { margin-top: 10px; padding: 9px; border-radius: 8px; border: 1px solid #fbbf24; background: #fffbeb; font-size: 11.5px; color: #b45309; }
.rel-info-card .ric-upnotice { margin-top: 12px; padding: 10px 12px; border-radius: 10px; border: 1px solid #fbbf24; background: #fffbeb; }
.rel-info-card .ric-upnotice-t { font-size: 12px; font-weight: 700; color: #b45309; }
.rel-info-card .ric-upnotice-sub { font-size: 11px; color: #b45309; opacity: .85; margin-top: 4px; line-height: 1.5; }
.rel-info-card .ric-note { margin-top: 14px; font-size: 10px; color: var(--ink-400); }

/* 三栏布局（模板库 / 关系管理） */
.col-panel { height: 100%; display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; box-shadow: var(--sh-1); }
.col-panel .cp-head { padding: 14px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.col-panel .cp-head .cp-title { font-size: 14px; font-weight: 800; color: var(--ink-900); }
.col-panel .cp-head .cp-sub { font-size: 12px; color: var(--ink-500); margin-top: 1px; }
.col-panel .cp-head .cp-act { font-size: 12px; font-weight: 600; color: var(--brand-600); border: 0; background: transparent; cursor: pointer; white-space: nowrap; }
.col-panel .cp-head .cp-act:hover { color: var(--brand-700); }
.col-panel .cp-body { flex: 1; overflow-y: auto; padding: 12px; }
.col-panel .cp-body::-webkit-scrollbar { width: 5px; }
.col-panel .cp-body::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 3px; }

/* 模板库四列容器：模板列表 | 卡片列表 | 编辑器 | 实时预览 */
.cols-wrap { display: grid; grid-template-columns: 240px 280px minmax(0,1fr) 420px; gap: 16px; height: calc(100vh - 150px); min-height: 560px; }
@media (max-width: 1280px) { .cols-wrap { grid-template-columns: 220px 250px minmax(0,1fr) 380px; } }
@media (max-width: 1024px) { .cols-wrap { grid-template-columns: 1fr; height: auto; } }
/* 企业工作台：两栏（关系管理 | 实时预览），设计稿对齐——隐藏卡片列表与卡片编辑器 */
.cols-wrap.entre { grid-template-columns: 260px minmax(0,1fr); }
@media (max-width: 1024px) { .cols-wrap.entre { grid-template-columns: 1fr; height: auto; } }
.cols-wrap.entre .preview-col { display: flex; flex-direction: column; }
.cols-wrap.entre .preview-col .panel-stage { justify-content: flex-start; align-items: flex-start; }
/* 编辑器 / 预览作为 .cols-wrap 直接子列 */
.cols-wrap .editor-col { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 18px; box-shadow: var(--sh-1); min-width: 0; overflow-y: auto; }
.cols-wrap .editor-col .ec-title { font-size: 14px; font-weight: 800; margin-bottom: 14px; display: flex; align-items: center; justify-content: space-between; }
.cols-wrap .editor-col .ec-title .del { font-size: 12px; color: var(--hot); border: 0; background: transparent; cursor: pointer; }
.cols-wrap .editor-col .ec-title .del:hover { text-decoration: underline; }
.cols-wrap .preview-col { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px; box-shadow: var(--sh-1); min-width: 0; overflow-y: auto; }
.cols-wrap .preview-col .pc-title { font-size: 14px; font-weight: 800; margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; }
.cols-wrap .preview-col .pc-title .pc-sub { font-size: 11px; color: var(--ink-400); font-weight: 500; }
.cols-wrap .preview-col .panel-stage { justify-content: flex-start; }

/* 模板/关系列表项卡 */
.tpl-item, .rel-item { padding: 12px 14px; border: 1px solid var(--line); border-radius: 11px; cursor: pointer; background: #fff; margin-bottom: 10px; transition: all .15s; }
.tpl-item:hover, .rel-item:hover { border-color: var(--brand-300); box-shadow: 0 2px 8px rgba(79,70,229,.08); }
.tpl-item.active, .rel-item.active { border-color: var(--brand-500); background: #eef2ff; }
.tpl-item .ti-h, .rel-item .ri-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tpl-item .ti-h b, .rel-item .ri-h b { font-size: 14px; color: var(--ink-900); }
.tpl-item .ti-meta, .rel-item .ri-meta { font-size: 11px; color: var(--ink-400); margin-top: 4px; }
.tpl-item .ti-desc, .rel-item .ri-desc { font-size: 11px; color: var(--ink-400); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 企业关系项：绑定状态语义化 + 底部常驻动作条 */
.rel-item { position: relative; }
.rel-item .ri-bar { position: absolute; left: 0; top: 9px; bottom: 9px; width: 4px; border-radius: 2px; background: var(--ink-300); }
.rel-item.bound .ri-bar { background: var(--brand-500); }
.rel-item .ri-meta { padding-left: 6px; }
/* 语义化徽章：已绑定实心 indigo / 未绑定描边灰 */
.rel-item.bound .badge.indigo { background: var(--brand-600); color: #fff; }
.rel-item .badge.gray { border: 1px solid var(--ink-300); background: transparent; color: var(--ink-500); }
/* 未绑定引导 CTA */
.rel-item .ri-cta { margin-top: 6px; padding-left: 6px; }
.rel-item .ri-cta button { font-size: 11.5px; color: var(--brand-600); border: 0; background: transparent; padding: 0; font-weight: 500; cursor: pointer; }
.rel-item .ri-cta button:hover { color: var(--brand-700); text-decoration: underline; }
/* 底部常驻动作条 */
.rel-item .ri-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--ink-100); }
.rel-item .ri-actions button { font-size: 12px; padding: 4px 10px; border-radius: 7px; border: 1px solid var(--line); background: #fff; color: var(--ink-600); cursor: pointer; transition: all .12s; }
.rel-item .ri-actions button:hover { border-color: var(--brand-400); color: var(--brand-700); }
.rel-item .ri-actions button.del { color: var(--hot); }
.rel-item .ri-actions button.del:hover { border-color: var(--hot); background: #fef2f2; }
