/* 智曜 AI 运营后台样式 */
:root {
  --navy-950: #081228;
  --navy-900: #0d1c3d;
  --navy-800: #10294f;
  --navy-700: #1b3a68;
  --accent: #c8102e;
  --accent-soft: #fdeef1;
  --bg: #f4f6fb;
  --surface: #ffffff;
  --line: #e4e8f2;
  --line-strong: #d3d9e8;
  --text: #101a33;
  --muted: #6b7390;
  --muted-2: #9aa2b8;
  --blue: #2f6fed;
  --violet: #7c5cff;
  --amber: #d18a12;
  --green: #0f9d58;
  --red: #d92d20;
  --radius: 14px;
  --shadow-sm: 0 1px 2px rgba(16, 41, 79, .04);
  --shadow: 0 10px 28px rgba(16, 41, 79, .09);
  --font: "PingFang SC", "Microsoft YaHei", "Source Han Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, p { margin: 0; }
button, input, select, textarea { font-family: inherit; font-size: 14px; color: inherit; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- 登录 ---------- */
.login-view {
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  background:
    radial-gradient(900px 520px at 12% 0%, #1b3a68 0%, transparent 60%),
    radial-gradient(700px 480px at 100% 100%, #23305c 0%, transparent 58%),
    var(--navy-950);
}
.login-shell {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border-radius: 18px;
  padding: 30px 30px 24px;
  box-shadow: 0 28px 70px rgba(4, 12, 30, .45);
}
.login-brand, .sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(140deg, var(--accent), #8f0b21);
  box-shadow: 0 6px 16px rgba(200, 16, 46, .3);
  flex: none;
}
.brand-mark-img {
  display: block;
  width: auto;
  height: 38px;
  border-radius: 0;
  background: none;
  box-shadow: none;
  object-fit: contain;
}
.login-brand b, .sidebar-brand b { display: block; font-size: 15px; letter-spacing: .4px; }
.login-brand span, .sidebar-brand span { display: block; font-size: 11px; color: var(--muted); letter-spacing: 1.4px; }
.login-shell h1 { margin: 24px 0 6px; font-size: 21px; }
.login-hint { color: var(--muted); font-size: 13px; margin-bottom: 20px; }
.login-foot { margin-top: 18px; text-align: center; font-size: 11px; color: var(--muted-2); letter-spacing: 1px; }

/* ---------- 表单 ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > span { font-size: 12px; font-weight: 600; color: var(--muted); }
.field > small { font-size: 11px; color: var(--muted-2); }
input, select, textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: #fff;
  outline: none;
  transition: border-color .16s, box-shadow .16s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(47, 111, 237, .14);
}
textarea { resize: vertical; min-height: 76px; line-height: 1.65; }
.form-error { min-height: 18px; color: var(--red); font-size: 12px; margin: 2px 0 10px; }
.form-note { color: var(--muted); font-size: 12px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.form-grid .field.is-full { grid-column: 1 / -1; }
.check { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; color: var(--muted); margin: 4px 0 12px; }
.check input { width: 15px; height: 15px; margin-top: 3px; flex: none; }

.btn-primary, .btn-ghost, .mini-btn, .ghost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 9px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background .16s, border-color .16s, color .16s, transform .12s;
  white-space: nowrap;
}
.btn-primary {
  padding: 9px 18px;
  background: var(--navy-800);
  color: #fff;
  font-weight: 600;
}
.btn-primary:hover { background: var(--navy-700); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:disabled { opacity: .55; cursor: not-allowed; }
.btn-block { width: 100%; padding: 11px; }
.btn-ghost {
  padding: 7px 14px;
  background: #fff;
  border-color: var(--line-strong);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--navy-800); color: var(--navy-800); }
.ghost-btn {
  padding: 6px 12px;
  background: transparent;
  border-color: var(--line-strong);
  color: var(--muted);
  font-size: 12px;
}
.ghost-btn:hover { color: var(--navy-800); border-color: var(--navy-800); }
.mini-btn {
  padding: 4px 10px;
  font-size: 12px;
  background: #f2f5fc;
  color: var(--navy-800);
  border-color: transparent;
}
.mini-btn:hover { background: #e5ebf9; }
.mini-btn.danger { background: var(--accent-soft); color: var(--accent); }
.mini-btn.danger:hover { background: #fbdde4; }

/* ---------- 应用框架 ---------- */
.app-view { display: flex; min-height: 100vh; }
.sidebar {
  width: 244px;
  flex: none;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, var(--navy-900), var(--navy-800));
  color: #dbe3f5;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar-brand {
  padding: 20px 18px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.sidebar-brand b { color: #fff; }
.sidebar-brand span { color: rgba(219, 227, 245, .55); }
.tree { flex: 1; overflow-y: auto; padding: 12px 10px 20px; }
.tree-group { margin-bottom: 4px; }
.tree-parent {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border: 0;
  background: transparent;
  color: rgba(219, 227, 245, .62);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.2px;
  cursor: pointer;
  border-radius: 8px;
}
.tree-parent:hover { color: #fff; background: rgba(255, 255, 255, .05); }
.tree-parent::after {
  content: "";
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform .18s;
}
.tree-group.is-collapsed .tree-parent::after { transform: rotate(-45deg); }
.tree-group.is-collapsed .tree-children { display: none; }
.tree-children { display: flex; flex-direction: column; gap: 1px; padding: 2px 0 8px; }
.tree-link {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px 8px 20px;
  border-radius: 8px;
  color: #c6d1e8;
  font-size: 13px;
}
.tree-link:hover { background: rgba(255, 255, 255, .07); color: #fff; text-decoration: none; }
.tree-link.is-active { background: rgba(255, 255, 255, .12); color: #fff; font-weight: 600; }
.tree-link.is-active::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 50%;
  width: 3px;
  height: 16px;
  margin-top: -8px;
  border-radius: 3px;
  background: var(--accent);
}
.tree-count {
  font-size: 11px;
  color: rgba(219, 227, 245, .55);
  background: rgba(255, 255, 255, .08);
  border-radius: 999px;
  padding: 1px 7px;
  font-variant-numeric: tabular-nums;
}
.tree-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--amber);
  flex: none;
}
.sidebar-foot {
  padding: 14px 16px;
  border-top: 1px solid rgba(255, 255, 255, .08);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sidebar-foot .who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.sidebar-foot .who-text { min-width: 0; }
.sidebar-foot .avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  background: #fff;
  border: 1px solid rgba(255, 255, 255, .24);
  flex: none;
}
.sidebar-foot .who b { display: block; color: #fff; font-size: 13px; }
.sidebar-foot .who span { display: block; font-size: 11px; color: rgba(219, 227, 245, .5); }
.sidebar-foot .ghost-btn {
  width: 100%;
  border-color: rgba(255, 255, 255, .2);
  color: rgba(255, 255, 255, .7);
}
.sidebar-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sidebar-actions .ghost-btn { padding: 6px 4px; }
.sidebar-foot .ghost-btn:hover { color: #fff; border-color: rgba(255, 255, 255, .5); }

.content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 14px;
  height: 60px;
  padding: 0 26px;
  background: rgba(255, 255, 255, .86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.crumb { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); }
.crumb b { color: var(--text); font-weight: 600; }
.crumb i { font-style: normal; color: var(--muted-2); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.topbar-right .link { font-size: 12px; color: var(--muted); }
.topbar-right .link:hover { color: var(--navy-800); }
.menu-btn {
  display: none;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: #fff;
  align-items: center;
  justify-content: center;
}
.menu-btn span, .menu-btn span::before, .menu-btn span::after {
  display: block;
  width: 15px;
  height: 1.6px;
  background: var(--text);
  content: "";
  position: relative;
}
.menu-btn span::before { position: absolute; top: -5px; }
.menu-btn span::after { position: absolute; top: 5px; }
.sidebar-mask { position: fixed; inset: 0; background: rgba(8, 18, 40, .45); z-index: 60; }

.bell-btn {
  position: relative;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  transition: color .16s, border-color .16s;
}
.bell-btn:hover, .bell-btn.has-unread { color: var(--navy-800); border-color: var(--navy-800); }
.bell-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 15px;
  height: 15px;
  padding: 0 3px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 15px;
  text-align: center;
  border: 2px solid #fff;
  box-sizing: content-box;
}

/* ---------- 提醒列表 ---------- */
.notify-list { display: flex; flex-direction: column; gap: 8px; }
.notify-item {
  display: flex;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  transition: background .14s, border-color .14s;
}
.notify-item:hover { background: #f7f9ff; border-color: #c9d3e8; }
.notify-item.is-unread { background: #f4f7ff; border-color: #cfdcfb; }
.notify-dot {
  width: 7px;
  height: 7px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex: none;
}
.notify-main { flex: 1; min-width: 0; }
.notify-title { font-size: 13px; font-weight: 600; word-break: break-word; }
.notify-body {
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
  white-space: pre-line;
  word-break: break-word;
}
.notify-time { margin-top: 4px; font-size: 11px; color: var(--muted-2); }

.main { padding: 24px 26px 56px; max-width: 1440px; width: 100%; margin: 0 auto; }

/* ---------- 页面结构 ---------- */
.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.page-head h1 { font-size: 22px; letter-spacing: -.2px; }
.page-head p { color: var(--muted); font-size: 13px; margin-top: 4px; max-width: 720px; }
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.toolbar input[type="search"] { width: 200px; }
.toolbar select { width: auto; min-width: 108px; }
.section { margin-bottom: 18px; }
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.section-title h2 { font-size: 15px; }
.section-title span { font-size: 12px; color: var(--muted); }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}
.card-head h3 { font-size: 14px; }
.card-head span { font-size: 12px; color: var(--muted); }
.card-body { padding: 16px 18px; }
.card-body.is-flush { padding: 0; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.stack { display: flex; flex-direction: column; gap: 16px; }

/* ---------- KPI ---------- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(172px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.kpi-card {
  position: relative;
  padding: 15px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform .16s, box-shadow .16s, border-color .16s;
  overflow: hidden;
}
.kpi-card::after {
  content: "";
  position: absolute;
  right: -18px;
  top: -18px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(47, 111, 237, .06);
}
.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: #c9d3e8;
}
.kpi-label { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.kpi-label .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--blue); }
.kpi-value {
  margin-top: 6px;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -.6px;
  font-variant-numeric: tabular-nums;
}
.kpi-value small { font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 3px; }
.kpi-foot { margin-top: 4px; font-size: 11px; color: var(--muted-2); display: flex; gap: 8px; align-items: center; }
.delta { font-size: 11px; font-weight: 600; padding: 1px 6px; border-radius: 999px; }
.delta.up { color: #0b7a44; background: #e8f7ef; }
.delta.down { color: var(--accent); background: var(--accent-soft); }
.delta.flat { color: var(--muted); background: #f0f2f8; }

/* ---------- 图表 ---------- */
.chart-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.chart-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; }
.bars {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 172px;
  padding-top: 20px;
  overflow-x: auto;
}
.bar-col {
  flex: 1;
  min-width: 22px;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  cursor: pointer;
  border-radius: 8px;
  padding: 0 2px;
  transition: background .15s;
}
.bar-col:hover { background: #f5f7fd; }
.bar-track { width: 100%; flex: 1; display: flex; align-items: flex-end; justify-content: center; }
.bar-fill {
  width: min(100%, 26px);
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, #4a7ef0, #2c4f9c);
  min-height: 2px;
  transition: height .35s ease;
}
.bar-fill.is-alt { background: linear-gradient(180deg, #a78bfa, #6d4bd8); }
.bar-label { font-size: 10px; color: var(--muted-2); white-space: nowrap; }
.bar-value { font-size: 10px; color: var(--muted); font-variant-numeric: tabular-nums; height: 13px; }

.hbars { display: flex; flex-direction: column; gap: 7px; }
.hbar-row { display: grid; grid-template-columns: 42px 1fr 34px; gap: 10px; align-items: center; }
.hbar-label { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.hbar-track { height: 9px; border-radius: 999px; background: #eef1f8; overflow: hidden; }
.hbar-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #4a7ef0, #7c5cff); min-width: 0; }
.hbar-value { font-size: 11px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }

.source-bar { display: flex; height: 12px; border-radius: 999px; overflow: hidden; background: #eef1f8; }
.source-bar span { display: block; height: 100%; }
.seg-kb { background: var(--blue); }
.seg-ai { background: var(--violet); }
.seg-fallback { background: #e0a526; }
.source-rows { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.source-row { display: grid; grid-template-columns: 10px 1fr auto auto; gap: 8px; align-items: center; font-size: 12px; }
.source-row i { width: 8px; height: 8px; border-radius: 2px; }
.source-row b { font-variant-numeric: tabular-nums; }
.source-row em { font-style: normal; color: var(--muted); min-width: 46px; text-align: right; }

.funnel { display: flex; flex-direction: column; gap: 9px; }
.funnel-row { display: grid; grid-template-columns: 72px 1fr 40px; gap: 10px; align-items: center; }
.funnel-label { font-size: 12px; color: var(--muted); }
.funnel-track { height: 24px; border-radius: 7px; background: #eef1f8; overflow: hidden; }
.funnel-fill { height: 100%; border-radius: 7px; background: linear-gradient(90deg, #2c4f9c, #4a7ef0); min-width: 2px; }
.funnel-row:nth-child(2) .funnel-fill { background: linear-gradient(90deg, #2f6fed, #6c9bff); }
.funnel-row:nth-child(3) .funnel-fill { background: linear-gradient(90deg, #6d4bd8, #a78bfa); }
.funnel-row:nth-child(4) .funnel-fill { background: linear-gradient(90deg, #0f8a4d, #3fc27e); }
.funnel-row:nth-child(5) .funnel-fill { background: linear-gradient(90deg, #b9c0d4, #d7dcea); }
.funnel-value { font-size: 12px; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .4px;
  color: var(--muted);
  background: #f8f9fd;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #f0f2f8;
  vertical-align: middle;
  font-size: 13px;
}
.data-table tbody tr { transition: background .12s; cursor: pointer; }
.data-table tbody tr:hover { background: #f7f9ff; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.cell-main { display: block; font-weight: 600; }
.cell-sub { display: block; font-size: 11px; color: var(--muted); margin-top: 1px; }
.cell-num { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.text-muted { color: var(--muted); }
.text-danger { color: var(--red); }
.text-warn { color: var(--amber); }

/* ---------- 徽章 ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.7;
  background: #eef1f8;
  color: var(--muted);
  white-space: nowrap;
}
.badge.new { background: #e8f0ff; color: #2456c7; }
.badge.contacted { background: #fff4e2; color: #a96a00; }
.badge.qualified { background: #efe9ff; color: #6035cf; }
.badge.closed { background: #e7f7ef; color: #0b7a44; }
.badge.invalid { background: #f0f2f8; color: #868ea6; }
.badge.kb { background: #e8f0ff; color: #2456c7; }
.badge.ai { background: #efe9ff; color: #6035cf; }
.badge.fallback { background: #fff4e2; color: #a96a00; }
.badge.soft { background: #f2f4fa; color: var(--muted); }
.badge.high { background: var(--accent-soft); color: var(--accent); }
.badge.low { background: #f0f2f8; color: #868ea6; }
.badge.normal { background: #eef1f8; color: var(--muted); }

.prio-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.prio-dot.high { background: var(--accent); }
.prio-dot.normal { background: var(--blue); }
.prio-dot.low { background: #b9c0d4; }

/* ---------- 统计筛选条 ---------- */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #fff;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  transition: all .15s;
}
.chip:hover { border-color: var(--navy-700); color: var(--navy-800); }
.chip.is-active { background: var(--navy-800); border-color: var(--navy-800); color: #fff; }
.chip b { font-variant-numeric: tabular-nums; }
.chip.is-active b { color: rgba(255, 255, 255, .8); }

/* ---------- 会话卡片 ---------- */
.conv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(292px, 1fr)); gap: 14px; }
.conv-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 15px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform .16s, box-shadow .16s, border-color .16s;
}
.conv-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: #c9d3e8; }
.conv-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.conv-id { font-size: 12px; font-weight: 700; letter-spacing: .3px; color: var(--navy-800); white-space: nowrap; }
.conv-time { font-size: 11px; color: var(--muted-2); flex: none; }
.conv-stats { display: flex; gap: 14px; font-size: 11px; color: var(--muted); flex-wrap: wrap; }
.conv-stats b { color: var(--text); font-size: 13px; font-variant-numeric: tabular-nums; }
.conv-src { display: flex; flex-direction: column; gap: 5px; }
.conv-last {
  font-size: 12px;
  color: var(--muted);
  border-top: 1px dashed var(--line);
  padding-top: 9px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 40px;
}

/* ---------- 时间线 ---------- */
.timeline { position: relative; padding-left: 22px; }
.timeline::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 6px;
  bottom: 6px;
  width: 1px;
  background: var(--line);
}
.timeline-item { position: relative; padding-bottom: 16px; }
.timeline-item::before {
  content: "";
  position: absolute;
  left: -20px;
  top: 5px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--blue);
}
.timeline-item.type-call::before { border-color: var(--green); }
.timeline-item.type-wechat::before { border-color: #0f9d58; }
.timeline-item.type-email::before { border-color: var(--violet); }
.timeline-head { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.timeline-head b { color: var(--text); font-size: 12px; }
.timeline-body { margin-top: 4px; font-size: 13px; white-space: pre-wrap; word-break: break-word; }

/* ---------- 详情弹窗内容 ---------- */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.detail-list { list-style: none; margin: 0; padding: 0; }
.detail-list li {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 7px 0;
  border-bottom: 1px dashed #eef1f8;
  font-size: 13px;
}
.detail-list li:last-child { border-bottom: 0; }
.detail-list span { color: var(--muted); flex: none; }
.detail-list b { font-weight: 600; text-align: right; word-break: break-word; }
.detail-block { margin-top: 14px; }
.detail-block h4 { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.detail-block p { font-size: 13px; white-space: pre-wrap; word-break: break-word; }

/* ---------- 对话气泡 ---------- */
.chat-log { display: flex; flex-direction: column; gap: 12px; padding: 6px 0 14px; }
.msg { max-width: 78%; display: flex; flex-direction: column; gap: 4px; }
.msg.user { align-self: flex-end; align-items: flex-end; }
.msg.assistant { align-self: flex-start; }
.msg-bubble {
  padding: 9px 12px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}
.msg.user .msg-bubble { background: var(--navy-800); color: #fff; border-bottom-right-radius: 4px; }
.msg.assistant .msg-bubble { background: #f3f5fb; color: var(--text); border-bottom-left-radius: 4px; }
.msg-meta { font-size: 10px; color: var(--muted-2); display: flex; gap: 8px; align-items: center; }

/* ---------- 设置 ---------- */
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 16px; align-items: start; }
.settings-grid .card.is-wide { grid-column: 1 / -1; }
.section-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}
.section-card-head h3 { font-size: 14px; }
.section-card-head p { font-size: 12px; color: var(--muted); margin-top: 3px; }
.settings-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.range-row { display: flex; align-items: center; gap: 12px; }
.range-row input[type="range"] { flex: 1; padding: 0; border: 0; background: transparent; accent-color: var(--navy-800); }
.range-val {
  min-width: 58px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--navy-800);
}
.kv-list { list-style: none; margin: 0; padding: 0; }
.kv-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px dashed #eef1f8;
  font-size: 13px;
}
.kv-list li:last-child { border-bottom: 0; }
.kv-list span { color: var(--muted); }
.kv-list b { font-weight: 600; }

/* ---------- 分页 / 空状态 ---------- */
.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
  flex-wrap: wrap;
}
.pager-actions { display: flex; gap: 8px; }
.pager button {
  padding: 5px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #fff;
  font-size: 12px;
  color: var(--text);
  cursor: pointer;
}
.pager button:hover:not(:disabled) { border-color: var(--navy-800); color: var(--navy-800); }
.pager button:disabled { opacity: .45; cursor: not-allowed; }
.empty { padding: 34px 18px; text-align: center; color: var(--muted-2); font-size: 13px; }
.loading { padding: 34px 18px; text-align: center; color: var(--muted-2); font-size: 13px; }

/* ---------- 弹窗 ---------- */
.modal { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center; padding: 22px; }
.modal-mask { position: absolute; inset: 0; background: rgba(8, 18, 40, .52); backdrop-filter: blur(2px); }
.modal-card {
  position: relative;
  width: min(560px, 100%);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 28px 70px rgba(8, 18, 40, .32);
  animation: modal-in .18s ease;
}
.modal-card.is-wide { width: min(920px, 100%); }
@keyframes modal-in {
  from { opacity: 0; transform: translateY(10px) scale(.99); }
  to { opacity: 1; transform: none; }
}
.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px 12px;
  border-bottom: 1px solid var(--line);
}
.modal-head h3 { font-size: 16px; }
.modal-head p { font-size: 12px; color: var(--muted); margin-top: 2px; }
.icon-btn {
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  flex: none;
}
.icon-btn:hover { color: var(--text); border-color: var(--line-strong); }
.modal-body { padding: 16px 20px 6px; overflow-y: auto; }
.modal-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 20px 16px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}
.modal-foot .spacer { margin-right: auto; }

/* ---------- 提示 ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 12px);
  z-index: 100;
  padding: 9px 18px;
  border-radius: 999px;
  background: var(--navy-900);
  color: #fff;
  font-size: 13px;
  box-shadow: 0 12px 30px rgba(8, 18, 40, .3);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s, transform .18s;
}
.toast.is-show { opacity: 1; transform: translate(-50%, 0); }
.toast.is-error { background: var(--accent); }

.tooltip {
  position: fixed;
  z-index: 95;
  max-width: 300px;
  padding: 8px 11px;
  border-radius: 9px;
  background: rgba(13, 28, 61, .96);
  color: #fff;
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-line;
  box-shadow: 0 10px 26px rgba(8, 18, 40, .3);
  pointer-events: none;
  opacity: 0;
  transition: opacity .12s;
}
.tooltip.is-show { opacity: 1; }
.tooltip b { color: #fff; }
.tooltip .tip-row { display: flex; justify-content: space-between; gap: 16px; }
.tooltip .tip-row span { color: rgba(255, 255, 255, .65); }
.tooltip .tip-title { font-weight: 600; margin-bottom: 4px; }

/* ---------- 响应式 ---------- */
@media (max-width: 1180px) {
  .grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 1024px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 70;
    transform: translateX(-100%);
    transition: transform .24s ease;
    height: 100vh;
  }
  .sidebar.is-open { transform: none; }
  .menu-btn { display: inline-flex; }
  .content { width: 100%; }
  .main { padding: 20px 20px 48px; }
  .topbar { padding: 0 20px; }
}
@media (max-width: 860px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .main { padding: 16px 14px 40px; }
  .topbar { padding: 0 14px; gap: 10px; }
  .topbar-right .link { display: none; }
  .page-head { margin-bottom: 14px; }
  .page-head h1 { font-size: 19px; }
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi-value { font-size: 22px; }
  .toolbar { width: 100%; }
  .toolbar input[type="search"] { flex: 1; width: auto; min-width: 0; }
  .toolbar select { flex: 1; min-width: 0; }
  .settings-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .modal { padding: 12px; }
  .modal-card { max-height: 92vh; }
  .msg { max-width: 88%; }
  .data-table thead { display: none; }
  .data-table, .data-table tbody, .data-table tr, .data-table td { display: block; width: 100%; }
  .data-table tr {
    border: 1px solid var(--line);
    border-radius: 12px;
    margin: 0 12px 10px;
    padding: 6px 12px;
    background: #fff;
  }
  .data-table tbody { padding-top: 12px; }
  .data-table td {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 5px 0;
    border-bottom: 1px dashed #f0f2f8;
    text-align: right;
  }
  .data-table td:last-child { border-bottom: 0; }
  .data-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
    text-align: left;
    flex: none;
  }
  .data-table td[data-label=""]::before { display: none; }
  .row-actions { justify-content: flex-end; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
