/* ========== 语呼机器人 · 智能语音外呼平台 ========== */
:root {
  --primary: #2f6bff;
  --primary-dark: #1e4fd8;
  --primary-light: #e8effc;
  --bg: #f3f5fa;
  --card: #ffffff;
  --border: #e4e8f0;
  --text: #1f2733;
  --text-2: #5b6676;
  --text-3: #8a94a6;
  --green: #18a058;
  --red: #d93026;
  --orange: #f08c1e;
  /* 客户分类六色（2026-10-28 新口径）：A 有意向 / B 无意向 / C 明确拒绝 / D 已接通 / E 未接通 / F 空号 */
  --A: #e5484d;
  --B: #7d8796;
  --C: #8b5cf6;
  --D: #2f80ed;
  --E: #98a2b3;
  --F: #4b5563;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 1px 2px rgba(16, 24, 40, .04);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
.icon { vertical-align: -2px; flex: none; }

/* ---------- 登录页 ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #e9f0ff 0%, #f5f7fb 45%, #eef6f4 100%);
  padding: 24px;
}
.login-card {
  width: 420px;
  max-width: 100%;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(31, 60, 136, .12);
  padding: 40px 44px 32px;
}
.login-logo {
  width: 52px; height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary), #6a3df0);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 18px;
}
.login-card h1 { font-size: 22px; font-weight: 700; }
.login-sub { color: var(--text-2); font-size: 13px; margin: 6px 0 26px; }
.login-card .label { display: block; font-size: 13px; color: var(--text-2); margin: 14px 0 6px; }
.login-demo {
  margin-top: 22px;
  padding: 12px 14px;
  background: #f6f8fc;
  border: 1px dashed var(--border);
  border-radius: 8px;
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.9;
}
.login-demo-title { font-weight: 600; color: var(--text); }

/* ---------- 主框架 ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 224px;
  flex: none;
  background: #fff;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.logo {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--border);
}
.logo-mark {
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(135deg, var(--primary), #6a3df0);
  color: #fff; display: flex; align-items: center; justify-content: center;
  flex: none;
}
.logo-name { font-weight: 700; font-size: 15px; }
.logo-sub { font-size: 11px; color: var(--text-3); }
#nav { flex: 1; overflow-y: auto; padding: 10px 10px 16px; }
.nav-group { margin-top: 10px; }
.nav-group-title {
  font-size: 11px; color: var(--text-3);
  padding: 6px 10px 4px;
  letter-spacing: .5px;
}
.nav-item {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--text-2);
  font-size: 13.5px;
  cursor: pointer;
  margin-bottom: 2px;
  border-left: 3px solid transparent;
}
.nav-item:hover { background: #f3f5fa; color: var(--text); }
.nav-item.active {
  background: var(--primary-light);
  color: var(--primary-dark);
  font-weight: 600;
  border-left-color: var(--primary);
}
.nav-item .icon { color: inherit; }
.sidebar-foot { padding: 12px 16px; border-top: 1px solid var(--border); }
.version-badge {
  display: inline-block;
  font-size: 12px;
  padding: 3px 12px;
  border-radius: 999px;
  font-weight: 600;
}
.version-badge.ops { background: #fff3e2; color: #b45309; }
.version-badge.app { background: var(--primary-light); color: var(--primary-dark); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 58px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
  position: sticky; top: 0; z-index: 50;
}
.topbar-title { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.topbar-title h2 { font-size: 16px; font-weight: 700; }
.topbar-title span { font-size: 12px; color: var(--text-3); }
.topbar-crumb { font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.user-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 12px 5px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  cursor: pointer;
  background: #fff;
}
.user-chip:hover { border-color: #cdd6e4; }
.user-name { font-size: 13px; font-weight: 600; line-height: 1.2; display: flex; align-items: center; gap: 6px; }
.user-role { font-size: 11px; color: var(--text-3); line-height: 1.2; }
.chip-badge {
  display: inline-block; padding: 1px 7px; border-radius: 999px;
  font-size: 10px; font-weight: 600; line-height: 1.5;
  color: #8a5a00; background: #fff4d6; border: 1px solid #ffd977;
}
.switch-choice { display: flex; gap: 10px; margin-top: 16px; }
.switch-choice .btn { flex: 1; justify-content: center; }
/* 话术节点 · 真人录音 */
.rec-strip {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 8px; padding: 7px 10px; border-radius: 8px;
  background: #f6f8fc; border: 1px dashed #d8dfeb;
}
.rec-tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 600;
  color: #0b5c8a; background: #e3f2fb; border: 1px solid #b9dcf0;
}
.tts-tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 600;
  color: #6b4bb8; background: #f1ebfc; border: 1px solid #d9c9f2;
}
.rec-name { font-size: 12px; color: var(--text-2); max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rec-none { font-size: 12px; color: var(--text-3); }
.faq-strip { margin-top: 8px; }
.faq-strip .textarea { font-family: inherit; }
.faq-strip .faq-rows { display: flex; flex-direction: column; gap: 6px; }
.faq-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.faq-row .input { font-size: 12.5px; padding: 5px 8px; min-width: 0; }
.faq-row .rec-name { max-width: 130px; }
.content { padding: 22px 24px 40px; flex: 1; }
.loading { padding: 60px; text-align: center; color: var(--text-3); }
.empty { padding: 48px 16px; text-align: center; color: var(--text-3); font-size: 13px; }

/* ---------- 卡片 / KPI ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.card-title { font-weight: 700; font-size: 14.5px; }
.card-title-sub { font-size: 12px; color: var(--text-3); font-weight: 400; margin-left: 8px; }
.card-body { padding: 16px 18px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 1100px) { .grid-2 { grid-template-columns: 1fr; } }
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.kpi {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
}
.kpi-label { font-size: 12.5px; color: var(--text-2); }
.kpi-value { font-size: 26px; font-weight: 700; margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.kpi-sub { font-size: 12px; color: var(--text-3); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 13px;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
.btn:hover { border-color: #b9c4d8; background: #f8fafc; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-danger { color: var(--red); border-color: #f3c2bf; }
.btn-danger:hover { background: #fdf2f1; border-color: var(--red); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: #f0f3f8; }
.btn-sm { padding: 4px 10px; font-size: 12px; border-radius: 6px; }
.btn-block { width: 100%; justify-content: center; padding: 10px; margin-top: 18px; font-size: 14px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- 表单 ---------- */
.label { display: block; font-size: 13px; color: var(--text-2); margin: 12px 0 5px; }
.input, .select, .textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 11px;
  font-size: 13.5px;
  font-family: inherit;
  background: #fff;
  color: var(--text);
  outline: none;
  transition: border-color .15s;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--primary); }
.textarea { resize: vertical; min-height: 70px; }
.input-sm, .select-sm { padding: 5px 8px; font-size: 12.5px; border-radius: 6px; }
.form-row { display: flex; gap: 12px; }
.form-row > * { flex: 1; }
.checkbox-row { display: flex; align-items: center; gap: 7px; font-size: 13px; padding: 3px 0; }
.checkbox-row input { accent-color: var(--primary); }
.switch { position: relative; display: inline-block; width: 42px; height: 22px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch-slider {
  position: absolute; inset: 0; border-radius: 999px;
  background: #cdd4e0; transition: .2s; cursor: pointer;
}
.switch-slider::before {
  content: ""; position: absolute; width: 18px; height: 18px;
  left: 2px; top: 2px; border-radius: 50%; background: #fff; transition: .2s;
}
.switch input:checked + .switch-slider { background: var(--primary); }
.switch input:checked + .switch-slider::before { transform: translateX(20px); }
.range { width: 100%; accent-color: var(--primary); }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  text-align: left;
  font-size: 12px;
  color: var(--text-3);
  font-weight: 600;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  background: #fafbfd;
  white-space: nowrap;
}
.table td { padding: 10px 12px; border-bottom: 1px solid #eef1f6; vertical-align: middle; }
.table tbody tr:hover { background: #f8fafd; }
.table .num { font-variant-numeric: tabular-nums; }
.table-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- 徽章 ---------- */
.badge {
  display: inline-block;
  font-size: 12px;
  padding: 2px 9px;
  border-radius: 999px;
  font-weight: 600;
  white-space: nowrap;
}
.badge-A { background: #fdecec; color: var(--A); }
.badge-B { background: #eef0f4; color: var(--B); }
.badge-C { background: #f1ebfd; color: var(--C); }
.badge-D { background: #e8f1fd; color: var(--D); }
.badge-E { background: #f2f4f7; color: var(--E); }
.badge-F { background: #e9ebef; color: var(--F); }
.badge-none { background: #f3f5f8; color: var(--text-3); font-weight: 400; }
.badge-status { font-weight: 500; }
.badge-pending { background: #eef0f4; color: #5b6676; }
.badge-running { background: #e6f7ee; color: #0d8a4e; }
.badge-paused { background: #fdf3e3; color: #b45309; }
.badge-done { background: #e8f1fd; color: #1e4fd8; }
.badge-stopped { background: #fdecec; color: var(--A); }
.badge-answered { background: #e6f7ee; color: #0d8a4e; }
.badge-no_answer { background: #eef0f4; color: #5b6676; }
.badge-busy { background: #fdf3e3; color: #b45309; }
.badge-rejected { background: #fdecec; color: var(--A); }
.badge-in_call { background: #e8f1fd; color: #1e4fd8; }
.badge-ringing { background: #f3ecfd; color: #6a3df0; }
/* 通话结果徽章色调：ok=接通 / busy=拒接·正忙 / bad=关机·空号·停机等 / none=无人接听·其他 */
.badge-result-ok { background: #e6f7ee; color: #0d8a4e; }
.badge-result-busy { background: #fdf3e3; color: #b45309; }
.badge-result-bad { background: #fdecec; color: #c23333; }
.badge-result-none { background: #eef0f4; color: #5b6676; }
.tag {
  display: inline-block;
  font-size: 11.5px;
  background: #eef2f9;
  color: #40506b;
  border-radius: 5px;
  padding: 1px 7px;
  margin-right: 4px;
}

/* ---------- 进度条 ---------- */
.progress {
  flex: 1; min-width: 70px; height: 7px;
  background: #edf0f5; border-radius: 999px; overflow: hidden;
}
.progress-bar { height: 100%; border-radius: 999px; background: var(--primary); transition: width .4s; }
.progress-bar.done { background: var(--green); }
.progress-wrap { display: flex; align-items: center; gap: 8px; }
.progress-text { font-size: 12px; color: var(--text-2); white-space: nowrap; }

/* ---------- 存储空间行（运行状态页） ---------- */
.storage-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0; border-bottom: 1px dashed var(--border);
}
.storage-row:last-child { border-bottom: none; }
.storage-name { flex: none; width: 118px; font-size: 13px; font-weight: 600; }
.storage-path { font-size: 11px; color: var(--text-3); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; margin-top: 3px; line-height: 1.45; word-break: break-all; }
.storage-main { flex: 1; min-width: 0; }
.storage-detail { font-size: 12px; color: var(--text-2); margin-top: 3px; }
.storage-val { flex: none; width: 150px; text-align: right; font-size: 13px; font-weight: 600; white-space: nowrap; }
.storage-val .sub { display: block; font-size: 11px; font-weight: 400; color: var(--text-3); }
@media (max-width: 900px) {
  .storage-row { flex-wrap: wrap; }
  .storage-name { width: auto; }
  .storage-val { width: auto; text-align: left; }
}

/* ---------- 标签页 ---------- */
.tabs {
  display: flex; gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 18px;
}
.tab {
  padding: 9px 16px;
  font-size: 13.5px;
  color: var(--text-2);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  display: inline-flex; align-items: center; gap: 6px;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary-dark); border-bottom-color: var(--primary); font-weight: 600; }

/* ---------- 筛选栏 ---------- */
.filter-bar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  margin-bottom: 14px;
}
.filter-bar .select, .filter-bar .input { width: auto; min-width: 130px; }
.filter-spacer { flex: 1; }

/* ---------- 多选下拉（筛选条件） ---------- */
.ms { position: relative; display: inline-block; }
.ms-panel {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 120;
  min-width: 190px; max-height: 260px; overflow-y: auto;
  background: #fff; border: 1px solid var(--line, #e4e8f0); border-radius: 10px;
  box-shadow: 0 8px 24px rgba(16, 24, 40, .12);
  padding: 8px;
}
.ms-panel[hidden] { display: none; }
.ms-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px; border-radius: 6px; font-size: 13px; cursor: pointer;
  white-space: nowrap;
}
.ms-item:hover { background: #f3f6fb; }
.ms-item input { flex: none; }

/* ---------- 弹窗 / 抽屉 ---------- */
.modal-mask, .drawer-mask {
  position: fixed; inset: 0;
  background: rgba(23, 32, 48, .45);
  z-index: 200;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 40px 16px;
  overflow-y: auto;
}
.drawer-mask { justify-content: flex-end; padding: 0; align-items: stretch; }
.modal {
  background: #fff;
  border-radius: 12px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(16, 24, 40, .25);
  animation: pop .18s ease-out;
}
@keyframes pop { from { transform: translateY(-8px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head, .drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 15px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-title, .drawer-title { font-weight: 700; font-size: 15px; }
.modal-x {
  border: none; background: transparent; cursor: pointer;
  color: var(--text-3); padding: 4px; border-radius: 6px;
  display: flex;
}
.modal-x:hover { background: #f0f3f8; color: var(--text); }
.modal-body { padding: 18px 20px; }
.modal-foot {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
}
.drawer {
  background: #fff;
  width: 100%;
  height: 100%;
  display: flex; flex-direction: column;
  box-shadow: -8px 0 40px rgba(16, 24, 40, .18);
  animation: slide .2s ease-out;
}
@keyframes slide { from { transform: translateX(40px); opacity: .4; } to { transform: none; opacity: 1; } }
.drawer-body { padding: 18px 20px; overflow-y: auto; flex: 1; }

/* ---------- Toast ---------- */
#toast-root { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 400; }
.toast {
  background: #1f2733; color: #fff;
  border-radius: 8px;
  padding: 9px 18px;
  font-size: 13px;
  margin-bottom: 8px;
  opacity: 0; transform: translateY(-8px);
  transition: all .25s;
  box-shadow: 0 8px 24px rgba(16, 24, 40, .25);
  max-width: 480px;
}
.toast.show { opacity: 1; transform: none; }
.toast-success { background: #0d8a4e; }
.toast-error { background: #c53030; }

/* ---------- 分页 ---------- */
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 12px 2px 2px; }
.pager-info { font-size: 12px; color: var(--text-3); }
.pager-btns { display: flex; gap: 4px; }
.page-btn {
  border: 1px solid var(--border); background: #fff;
  border-radius: 6px; min-width: 26px; height: 26px;
  font-size: 12px; cursor: pointer; color: var(--text-2);
}
.page-btn:hover { border-color: var(--primary); color: var(--primary); }
.page-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ---------- 图表 ---------- */
.chart { width: 100%; height: auto; display: block; }
.chart-text { font-size: 10.5px; fill: #8a94a6; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 8px; }
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); }
.legend-dot { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.donut-wrap { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.donut-legend { display: flex; flex-direction: column; gap: 8px; }
.donut-legend .legend-item { font-size: 13px; }
.donut-center { font-size: 22px; font-weight: 700; fill: var(--text); }
.donut-sub { font-size: 10px; fill: #8a94a6; }

/* ---------- 通话记录 / 对话 ---------- */
.transcript { display: flex; flex-direction: column; gap: 12px; padding: 6px 2px; }
.chat-row { display: flex; gap: 9px; }
.chat-row.customer { flex-direction: row-reverse; }
.chat-avatar {
  width: 28px; height: 28px; border-radius: 8px; flex: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff;
}
.chat-row.bot .chat-avatar { background: var(--primary); }
.chat-row.customer .chat-avatar { background: #18a058; }
.chat-bubble {
  max-width: 78%;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.6;
  background: #f2f5fa;
  border: 1px solid #e8ecf3;
}
.chat-row.customer .chat-bubble { background: #e9f8ef; border-color: #cdeed9; }
.chat-meta { font-size: 11px; color: var(--text-3); margin-top: 3px; }
.chat-row.customer .chat-meta { text-align: right; }

/* 机器人回答旁的「纠错」入口（话术体验） */
.chat-correct {
  margin-left: 6px; padding: 0 7px; border-radius: 999px; font-size: 11px; line-height: 18px;
  color: #a15c00; background: #fff6e8; border: 1px solid #f0d9a8; cursor: pointer;
}
.chat-correct:hover { background: #ffeccc; }
.chat-correct.done { color: #1a7f37; background: #eaf7ee; border-color: #bfe6cb; cursor: default; }
.fb-n {
  display: inline-block; min-width: 17px; margin-left: 5px; padding: 0 4px; border-radius: 999px;
  font-size: 11px; font-weight: 700; text-align: center; color: #fff; background: var(--D, #d4380d);
}

/* ---------- 话术体验（对话测试） ---------- */
.trial-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 10px 12px; margin-bottom: 12px; border-radius: 8px;
  background: #f6f8fc; border: 1px solid #e4e9f2;
}
.trial-status {
  margin: 10px 0; padding: 8px 10px; border-radius: 8px;
  background: #fbfcfe; border: 1px dashed #d8dfeb; min-height: 34px;
}
.trial-input { display: flex; gap: 8px; }
.trial-input .input { flex: 1; }
.trial-voice {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin: -4px 0 10px; padding: 7px 10px; border-radius: 8px;
  background: #f8f9fc; border: 1px solid #e7ebf3;
}

/* ---------- 体验纠错记录 ---------- */
.fb-item {
  padding: 10px 12px; margin-bottom: 8px; border-radius: 8px;
  background: #fffdf8; border: 1px solid #f0e3c4;
}
.fb-item.fb-done { background: #f8fafc; border-color: #e6eaf2; }
.fb-item.fb-done .fb-qa { opacity: 0.72; }
.fb-qa {
  margin-top: 7px; padding: 8px 10px; border-radius: 6px; font-size: 12.5px; line-height: 1.7;
  background: #fff; border: 1px dashed #e3e8f0;
}
.fb-qa > div + div { margin-top: 3px; }
.fb-fix { color: #8a5a00; }

/* 话术编辑器节点定位高亮（纠错「去修正」滚动到对应节点） */
.node-flash { animation: nodeFlash 2.6s ease; }
@keyframes nodeFlash {
  0%, 100% { box-shadow: none; }
  15%, 55% { box-shadow: 0 0 0 3px rgba(255, 152, 0, 0.55); }
}

/* ---------- 微信推送模拟 ---------- */
.wechat-fab {
  position: fixed; right: 22px; bottom: 22px; z-index: 150;
  width: 52px; height: 52px; border-radius: 14px;
  background: #07c160; color: #fff;
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 24px rgba(7, 193, 96, .35);
}
.wechat-fab:hover { background: #06ad56; }
.wx-dot {
  position: absolute; top: -4px; right: -4px;
  min-width: 18px; height: 18px; border-radius: 999px;
  background: var(--red); color: #fff;
  font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  padding: 0 5px;
}
.wx-dot.hidden { display: none; }
.wechat-panel {
  position: fixed; right: 22px; bottom: 86px; z-index: 160;
  width: 340px; max-width: calc(100vw - 32px);
  height: 460px; max-height: calc(100vh - 140px);
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 16px 48px rgba(16, 24, 40, .22);
  display: flex; flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
}
.wechat-panel.hidden { display: none; }
.wx-head {
  background: #07c160; color: #fff;
  padding: 12px 16px;
  display: flex; align-items: center; justify-content: space-between;
}
.wx-head-title { font-weight: 700; font-size: 14px; }
.wx-head-sub { font-size: 11px; opacity: .85; }
.wx-close { background: none; border: none; color: #fff; cursor: pointer; font-size: 16px; line-height: 1; }
.wx-body { flex: 1; overflow-y: auto; padding: 14px; background: #f3f5f8; display: flex; flex-direction: column; gap: 10px; }
.wx-msg {
  background: #fff; border-radius: 10px; padding: 10px 12px;
  font-size: 12.5px; box-shadow: var(--shadow);
}
.wx-msg-title { font-weight: 700; margin-bottom: 3px; color: #1f2733; }
.wx-msg-content { color: #40506b; white-space: pre-line; line-height: 1.6; }
.wx-msg-time { font-size: 11px; color: var(--text-3); margin-top: 5px; }
.wx-empty { text-align: center; color: var(--text-3); font-size: 12px; padding: 40px 0; }

/* ---------- 其他 ---------- */
.page-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; margin-bottom: 16px; flex-wrap: wrap;
}
.page-title { font-size: 18px; font-weight: 700; }
.page-desc { font-size: 12.5px; color: var(--text-2); margin-top: 3px; max-width: 720px; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.notice {
  background: #fff8e6; border: 1px solid #f5dfa8; color: #92600a;
  border-radius: 8px; padding: 9px 13px; font-size: 12.5px; margin-bottom: 14px;
}
.notice-ok { background: #e9f8ef; border-color: #bfe6cf; color: #0d7a45; }
.notice-err { background: #fdecec; border-color: #f3c2bf; color: #b3261e; }
/* 中性提示（如「按呼叫间隔等待中」）：蓝色，避免被误读成错误或告警 */
.notice-info { background: #eaf2fe; border-color: #c3d8f7; color: #1e4fd8; }
.hint { font-size: 12px; color: var(--text-3); margin-top: 6px; line-height: 1.7; }
.kv { display: grid; grid-template-columns: 92px 1fr; gap: 6px 12px; font-size: 13px; }
.kv dt { color: var(--text-3); }
.kv dd { color: var(--text); }
.section-title { font-weight: 700; font-size: 14px; margin: 18px 0 10px; }
.perm-matrix { display: flex; flex-direction: column; gap: 6px; }
.perm-group { font-size: 12px; color: var(--text-3); margin-top: 8px; }
.candidate-list {
  max-height: 250px; overflow-y: auto;
  border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 10px;
}
.candidate-list .checkbox-row { padding: 4px 2px; }
.search-inline { margin-bottom: 8px; }
.stat-line { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.mini-bar { height: 6px; border-radius: 3px; background: var(--primary); display: inline-block; }
.mono { font-variant-numeric: tabular-nums; }
.flex { display: flex; align-items: center; gap: 8px; }
.flex-wrap { flex-wrap: wrap; }
.mt8 { margin-top: 8px; } .mt16 { margin-top: 16px; }
.text-2 { color: var(--text-2); } .text-3 { color: var(--text-3); }
.text-ok { color: var(--green); } .text-err { color: var(--red); }
.fs12 { font-size: 12px; } .fs13 { font-size: 13px; }
.nowrap { white-space: nowrap; }

/* 录音播放器 */
.rec-player { text-align: center; padding: 6px 0; }
.rec-player .rec-icon {
  width: 52px; height: 52px; margin: 0 auto 14px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary-soft, #eef3ff); color: var(--primary);
}
.rec-player audio { height: 40px; }

/* ========== 粤语识别测试台 ========== */
.asr-engine-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.asr-script { display: flex; flex-direction: column; gap: 8px; max-height: 300px; overflow-y: auto; padding-right: 4px; }
.asr-node { border: 1px solid #e7ebf3; border-radius: 10px; padding: 9px 12px; background: #fbfcfe; }
.asr-node.cur { border-color: var(--primary, #3b6ef6); background: #f3f7ff; box-shadow: 0 0 0 3px rgba(59,110,246,.08); }
.asr-node-head { display: flex; gap: 8px; align-items: center; }
.asr-node-text { font-size: 13px; color: var(--text-1, #1f2733); margin-top: 5px; line-height: 1.65; }
.asr-node-faq { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.asr-chip { border: 1px solid #d8e0ec; background: #fff; border-radius: 999px; padding: 2px 10px; font-size: 12px; color: var(--text-2, #4a5568); cursor: pointer; transition: all .15s; }
.asr-chip:hover { border-color: var(--primary, #3b6ef6); color: var(--primary, #3b6ef6); background: #f3f7ff; }
.asr-conv { margin-top: 14px; border-top: 1px dashed #e3e8f0; padding-top: 12px; }
.asr-mic { display: inline-flex; align-items: center; gap: 8px; border: none; border-radius: 999px; padding: 10px 22px; font-size: 14px; font-weight: 600; color: #fff; background: var(--primary, #3b6ef6); cursor: pointer; box-shadow: 0 2px 8px rgba(59,110,246,.28); transition: all .15s; }
.asr-mic:hover { filter: brightness(1.06); }
.asr-mic.listening { background: #e5484d; box-shadow: 0 2px 8px rgba(229,72,77,.3); animation: asr-pulse 1.2s ease-in-out infinite; }
@keyframes asr-pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.05); } }
/* 录音电平条（round33）：说话时持续跳动=麦克风正常；不动=没选对设备/被静音/太轻 */
.asr-mic-level { display: inline-block; width: 76px; height: 9px; border-radius: 5px; background: var(--bg-3, #eef1f6); overflow: hidden; vertical-align: middle; }
.asr-mic-level > i { display: block; height: 100%; width: 0%; border-radius: 5px; background: #c0c0c0; transition: width .08s linear, background .15s; }
.asr-expect { margin-top: 10px; }
.asr-interim { min-height: 22px; margin-top: 8px; font-size: 13px; }
.asr-result { margin-top: 8px; }
.asr-result-card { border: 1px solid #e7ebf3; border-radius: 10px; padding: 11px 14px; background: #fbfcfe; }
.asr-kv { display: inline-flex; flex-direction: column; line-height: 1.35; }
.asr-kv b { font-size: 14px; }
.asr-kv i { font-style: normal; font-size: 11px; color: var(--text-3, #8a94a6); }
.asr-stat { display: inline-flex; flex-direction: column; min-width: 92px; line-height: 1.4; }
.asr-stat b { font-size: 17px; font-weight: 700; }
.asr-stat i { font-style: normal; font-size: 11.5px; color: var(--text-3, #8a94a6); }
.asr-quick { display: inline-flex; flex-wrap: wrap; gap: 5px; vertical-align: middle; }
/* 麦克风识别不可用时常驻诊断清单 */
.asr-support-warn { border: 1px solid #f3c2c4; background: #fdf3f4; border-radius: 10px; padding: 10px 14px; margin-top: 10px; }
.asr-diag-item { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; line-height: 1.6; padding: 3px 0; }
.asr-diag-item .asr-diag-flag { flex: none; font-weight: 700; }
.asr-diag-item.ok .asr-diag-flag { color: #1a9e5c; }
.asr-diag-item.bad .asr-diag-flag { color: #e5484d; }
/* 话术面板：FAQ 条目行（可选话术 · 自选测试） */
.asr-node.target { border-color: #f5a623; box-shadow: 0 0 0 3px rgba(245,166,35,.12); }
.asr-node-faq { margin-top: 6px; display: flex; flex-direction: column; gap: 4px; }
.asr-faq { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; border: 1px dashed #e3e8f0; border-radius: 8px; padding: 5px 9px; background: #fff; }
.asr-faq.cur { border-color: var(--primary, #3b6ef6); border-style: solid; background: #f3f7ff; }
.asr-faq-no { font-size: 11.5px; font-weight: 700; color: var(--text-2, #4a5568); flex: none; }
.asr-faq-trig { display: inline-flex; flex-wrap: wrap; gap: 4px; }
/* 追加触发词弹窗 */
.asr-trig-list { display: flex; flex-direction: column; gap: 6px; max-height: 260px; overflow-y: auto; }
.asr-trig-radio { display: flex; gap: 8px; align-items: flex-start; border: 1px solid #e7ebf3; border-radius: 8px; padding: 8px 10px; cursor: pointer; background: #fbfcfe; }
.asr-trig-radio.cur { border-color: var(--primary, #3b6ef6); background: #f3f7ff; }
.asr-trig-radio input { margin-top: 3px; }

/* ===== 真实外呼录音质检视图 ===== */
.qc-list { display: flex; flex-direction: column; gap: 14px; }
.qc-card { border: 1px solid var(--line, #e7ebf3); border-radius: 12px; padding: 14px 16px; background: #fff; }
.qc-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px dashed var(--line, #e7ebf3); }
.qc-side { margin-top: 8px; }
.qc-side-title { font-size: 12.5px; font-weight: 700; color: var(--text-2, #4a5568); margin-bottom: 6px; }
.qc-side-text { font-size: 13px; line-height: 1.6; color: var(--text, #1f2733); background: #f7f9fc; border-radius: 8px; padding: 8px 10px; }
.qc-seg-list { display: flex; flex-direction: column; gap: 6px; }
.qc-seg { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.qc-seg-text { flex: 1; color: var(--text, #1f2733); }
