* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #f5f6f8;
  --panel: #ffffff;
  --line: #e3e6ea;
  --line-soft: #eef0f3;
  --text: #1b1f24;
  --text-2: #5c636d;
  --text-3: #8b929c;
  --brand: #1d63c9;
  --brand-soft: #eaf1fc;
  --brand-dark: #164e9e;
  --warn: #c2410c;
  --warn-soft: #fdf1e8;
  --danger: #c0392b;
  --danger-soft: #fdeeec;
  --ok: #16794a;
  --ok-soft: #e8f5ee;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 1px 2px rgba(16, 24, 40, .04);
}

body {
  font-family: "Microsoft YaHei", "PingFang SC", -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  height: 100vh;
  overflow: hidden;
}

/* ---------- 顶栏 ---------- */
.topbar {
  height: 56px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 16px;
}
.logo { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 600; }
.logo-mark {
  width: 28px; height: 28px; border-radius: 7px;
  background: var(--brand); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700;
}
.logo-sub { font-size: 12px; color: var(--text-3); font-weight: 400; margin-left: 2px; }
.topbar-spacer { flex: 1; }
.stat-chips { display: flex; gap: 8px; }
.chip {
  background: var(--bg); border: 1px solid var(--line);
  border-radius: 20px; padding: 4px 12px; font-size: 12px; color: var(--text-2);
}
.chip b { color: var(--brand); font-weight: 600; }

/* ---------- 顶部导航（客户 / 项目） ---------- */
.nav {
  display: flex; align-items: center; gap: 3px;
  background: var(--bg); border: 1px solid var(--line);
  border-radius: 9px; padding: 3px;
}
.nav-btn {
  border: none; background: transparent; padding: 6px 15px;
  border-radius: 7px; cursor: pointer; font-size: 13px; color: var(--text-2);
  font-family: inherit; transition: .12s; white-space: nowrap;
}
.nav-btn:hover { color: var(--text); background: #eef1f5; }
.nav-btn.active {
  background: #fff; color: var(--brand); font-weight: 600;
  box-shadow: var(--shadow);
}

/* ---------- 客户侧边栏：项目过滤 ---------- */
.proj-filter-row { margin-top: 9px; }
.proj-filter-row select { background: #fff; }

/* ---------- 客户侧边栏：状态筛选 ---------- */
.stage-tabs {
  display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px;
}
.stage-tab {
  border: 1px solid var(--line); background: #fff; color: var(--text-2);
  border-radius: 14px; padding: 4px 11px; font-size: 12px; cursor: pointer;
  font-family: inherit; white-space: nowrap; transition: .12s;
}
.stage-tab:hover { border-color: #c5daf7; color: var(--text); }
.stage-tab.active {
  background: var(--brand); color: #fff; border-color: var(--brand);
  font-weight: 500;
}

/* ---------- 竞品卡片 ---------- */
.comp-list { display: flex; flex-direction: column; gap: 12px; }
.comp-card {
  border: 1px solid var(--line); border-radius: 9px; overflow: hidden;
}
.comp-head {
  display: flex; align-items: center; gap: 10px; padding: 10px 13px;
  background: #fafbfc; border-bottom: 1px solid var(--line-soft);
}
.comp-head b { font-size: 14px; }
.comp-head .spacer { flex: 1; }
.comp-body { padding: 12px 13px; }

/* ---------- 布局 ---------- */
.layout { display: flex; height: calc(100vh - 56px); }
.sidebar {
  width: 300px; background: var(--panel); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; flex-shrink: 0;
}
.sidebar-head { padding: 14px; border-bottom: 1px solid var(--line-soft); }
.search-row { display: flex; gap: 8px; }
.search-row input { flex: 1; }
.customer-list { flex: 1; overflow-y: auto; padding: 8px; }
.customer-item {
  padding: 11px 12px; border-radius: var(--radius); cursor: pointer;
  border: 1px solid transparent; margin-bottom: 4px; transition: .12s;
}
.customer-item:hover { background: var(--bg); }
.customer-item.active { background: var(--brand-soft); border-color: #c5daf7; }
.ci-top { display: flex; align-items: center; gap: 8px; }
.ci-name { font-weight: 600; font-size: 14px; }
.ci-stage {
  font-size: 11px; padding: 1px 7px; border-radius: 4px;
  background: var(--bg); color: var(--text-2); border: 1px solid var(--line);
}
.ci-stage.hot { background: var(--warn-soft); color: var(--warn); border-color: #f5d5bf; }
.ci-stage.done { background: var(--ok-soft); color: var(--ok); border-color: #bfe3d0; }
.ci-stage.warm { background: #e8f4ff; color: #1d63c9; border-color: #c5daf7; }
.ci-stage.lost { background: #f5f6f8; color: var(--text-3); border-color: var(--line); }
.ci-meta { font-size: 12px; color: var(--text-3); margin-top: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ci-badges { display: flex; gap: 5px; margin-top: 6px; }
.badge {
  font-size: 11px; padding: 1px 6px; border-radius: 4px;
  background: var(--brand-soft); color: var(--brand);
}
.badge.gray { background: var(--bg); color: var(--text-3); }

/* ---------- 主区 ---------- */
.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.main-head {
  background: var(--panel); border-bottom: 1px solid var(--line);
  padding: 14px 20px 0;
}
.mh-title { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.mh-title h2 { font-size: 18px; font-weight: 600; }
.mh-sub { font-size: 13px; color: var(--text-3); }
.mh-actions { margin-left: auto; display: flex; gap: 8px; }
/* 返回按钮：默认隐藏，仅手机详情态显示（桌面端不出现） */
.mh-back { display: none; }
.tabs { display: flex; gap: 2px; }
.tab {
  padding: 9px 16px; cursor: pointer; font-size: 14px; color: var(--text-2);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 500; }
.tab-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--brand); margin-left: 5px; vertical-align: middle; }
.content { flex: 1; overflow-y: auto; padding: 20px; }

/* ---------- 卡片 / 表单 ---------- */
.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); margin-bottom: 16px; box-shadow: var(--shadow);
}
.card-head {
  padding: 12px 16px; border-bottom: 1px solid var(--line-soft);
  display: flex; align-items: center; gap: 10px;
}
.card-head h3 { font-size: 14px; font-weight: 600; }
.card-head .hint { font-size: 12px; color: var(--text-3); font-weight: 400; }
.card-head .spacer { flex: 1; }
.card-body { padding: 16px; }
.card.accent { border-color: #f0c9b4; }
.card.accent .card-head { background: var(--warn-soft); }
.card.accent .card-head h3 { color: var(--warn); }

.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.grid-1 { grid-template-columns: 1fr; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 13px; color: var(--text-2); font-weight: 500; }
.field label .req { color: var(--danger); margin-left: 2px; }

input[type=text], input[type=date], input[type=number], input[type=password],
select, textarea {
  width: 100%; padding: 8px 11px; border: 1px solid var(--line);
  border-radius: 7px; font-size: 13px; font-family: inherit;
  background: #fff; color: var(--text); transition: .12s; line-height: 1.5;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(29, 99, 201, .1);
}
input::placeholder, textarea::placeholder { color: #b4bac2; }
textarea { resize: vertical; min-height: 62px; }
select { cursor: pointer; }

/* ---------- 按钮 ---------- */
.btn {
  padding: 8px 15px; border: 1px solid var(--line); background: #fff;
  border-radius: 7px; cursor: pointer; font-size: 13px; font-family: inherit;
  color: var(--text); transition: .12s; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px;
}
.btn:hover { background: var(--bg); border-color: #cfd4da; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-dark); }
.btn.danger { color: var(--danger); border-color: #f0cdc8; }
.btn.danger:hover { background: var(--danger-soft); }
.btn.sm { padding: 5px 10px; font-size: 12px; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--bg); }

/* ---------- 空态 ---------- */
.empty { text-align: center; padding: 60px 20px; color: var(--text-3); }
.empty-icon {
  width: 52px; height: 52px; margin: 0 auto 14px; border-radius: 13px;
  background: var(--bg); display: flex; align-items: center; justify-content: center;
  font-size: 24px; color: #c4cad2;
}
.empty h3 { font-size: 15px; color: var(--text-2); margin-bottom: 6px; font-weight: 500; }
.empty p { font-size: 13px; max-width: 420px; margin: 0 auto 16px; line-height: 1.7; }

/* ---------- 录音 ---------- */
.rec-item { border: 1px solid var(--line); border-radius: 8px; margin-bottom: 10px; }
.rec-head { padding: 10px 13px; display: flex; align-items: center; gap: 10px;
  background: #fafbfc; border-radius: 8px 8px 0 0; }
.rec-name { font-weight: 500; font-size: 13px; }
.rec-date { font-size: 12px; color: var(--text-3); }
.rec-actions { margin-left: auto; display: flex; gap: 6px; }
.rec-body { padding: 13px; border-top: 1px solid var(--line-soft); }
.transcript {
  background: #fafbfc; border: 1px solid var(--line-soft); border-radius: 7px;
  padding: 12px; font-size: 13px; line-height: 1.85; max-height: 320px;
  overflow-y: auto; white-space: pre-wrap; word-break: break-word;
}
.status-tag { font-size: 11px; padding: 2px 8px; border-radius: 4px; }
.status-pending { background: var(--bg); color: var(--text-3); }
.status-done { background: var(--ok-soft); color: var(--ok); }
.status-failed { background: var(--danger-soft); color: var(--danger); }
.status-processing { background: var(--brand-soft); color: var(--brand); }

/* ---------- 情绪分析面板 ---------- */
.emotion-box {
  margin-top: 12px; padding: 13px; border: 1px solid #e3ecf7;
  border-left: 3px solid var(--brand); border-radius: 7px; background: #f7faff;
  font-size: 13px; line-height: 1.7;
}
.emo-tone { font-size: 13.5px; margin-bottom: 6px; }
.emo-audio { color: #6b7280; font-size: 12.5px; margin-bottom: 8px;
  padding: 6px 9px; background: #eef3fb; border-radius: 6px; }
.emo-sub { font-weight: 600; color: var(--text-2); margin: 10px 0 5px;
  font-size: 12.5px; letter-spacing: .3px; }
.emo-arc { list-style: none; margin: 0; padding: 0; }
.emo-arc li { padding: 7px 9px; margin-bottom: 6px; background: #fff;
  border: 1px solid var(--line-soft); border-radius: 6px; }
.emo-moment { display: block; color: var(--text-1); font-style: italic; }
.emo-tag { display: inline-block; margin: 4px 0; font-size: 11.5px; font-weight: 600;
  color: var(--brand); background: var(--brand-soft); padding: 1px 8px; border-radius: 10px; }
.emo-note { color: var(--text-3); font-size: 12.5px; }
.emo-fb { list-style: none; margin: 0; padding: 0; }
.emo-fb li { padding: 6px 9px; margin-bottom: 5px; border-radius: 6px; font-size: 12.5px;
  border: 1px solid var(--line-soft); }
.emo-fb li.pos { background: var(--ok-soft); color: var(--ok); }
.emo-fb li.neg { background: var(--danger-soft); color: var(--danger); }
.fb-tag { font-weight: 600; margin-right: 6px; }
.emo-voice { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line-soft);
  color: var(--text-2); }

/* ---------- 画像 ---------- */
.profile-hero {
  background: linear-gradient(180deg, #f7faff, #fff);
  border: 1px solid #d9e6f8; border-radius: var(--radius);
  padding: 18px; margin-bottom: 16px;
}
.profile-hero .oneline { font-size: 15px; font-weight: 500; line-height: 1.7; }
.prob { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px;
  font-size: 13px; }
.prob-tag { padding: 2px 10px; border-radius: 5px; font-weight: 600; font-size: 12px; }
.prob-高 { background: var(--ok-soft); color: var(--ok); }
.prob-中 { background: var(--warn-soft); color: var(--warn); }
.prob-低 { background: var(--danger-soft); color: var(--danger); }

.plist { list-style: none; }
.plist li {
  padding: 10px 0; border-bottom: 1px dashed var(--line-soft); font-size: 13px;
  line-height: 1.7;
}
.plist li:last-child { border-bottom: none; }
.plist .p-main { font-weight: 500; }
.plist .p-sub { color: var(--text-2); font-size: 12.5px; margin-top: 3px; }
.tag {
  display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 4px;
  margin-right: 6px; vertical-align: middle;
}
.tag-显性, .tag-高, .tag-强 { background: var(--danger-soft); color: var(--danger); }
.tag-隐性, .tag-中 { background: var(--warn-soft); color: var(--warn); }
.tag-低, .tag-弱 { background: var(--bg); color: var(--text-3); }
.kv { display: flex; gap: 10px; padding: 7px 0; font-size: 13px; }
.kv .k { color: var(--text-3); min-width: 84px; flex-shrink: 0; }

/* ---------- 演练 ---------- */
.chat-wrap { display: flex; gap: 16px; height: calc(100vh - 210px); }
.chat-main { flex: 1; display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; }
.chat-head { padding: 11px 15px; border-bottom: 1px solid var(--line-soft);
  display: flex; align-items: center; gap: 10px; background: #fafbfc; }
.chat-body { flex: 1; overflow-y: auto; padding: 18px; background: #fafbfc; }
.msg { display: flex; margin-bottom: 16px; gap: 10px; }
.msg.sales { flex-direction: row-reverse; }
.avatar {
  width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; color: #fff;
}
.msg.customer .avatar { background: #7f77dd; }
.msg.sales .avatar { background: var(--brand); }
.bubble {
  max-width: 74%; padding: 10px 14px; border-radius: 10px; font-size: 13.5px;
  line-height: 1.75; white-space: pre-wrap; word-break: break-word;
}
.msg.customer .bubble { background: #fff; border: 1px solid var(--line);
  border-top-left-radius: 3px; }
.msg.sales .bubble { background: var(--brand); color: #fff;
  border-top-right-radius: 3px; }
.chat-input { border-top: 1px solid var(--line); padding: 12px; background: #fff; }
.chat-input-row { display: flex; gap: 8px; }
.chat-input textarea { flex: 1; min-height: 46px; max-height: 130px; }
.chat-side { width: 268px; flex-shrink: 0; overflow-y: auto; }
.coach-box {
  background: #fffdf6; border: 1px solid #f0e2bd; border-radius: var(--radius);
  padding: 13px; font-size: 12.5px; line-height: 1.8;
}
.coach-box h4 { font-size: 13px; margin-bottom: 8px; color: #8a6d1f; }
.coach-box ul { padding-left: 17px; }
.coach-box li { margin-bottom: 8px; }
.session-item {
  position: relative; padding: 9px 34px 9px 11px;
  border: 1px solid var(--line); border-radius: 7px;
  margin-bottom: 6px; font-size: 12.5px;
}
.session-item:hover { background: var(--bg); }
.session-item.active { background: var(--brand-soft); border-color: #c5daf7; }
.si-main { cursor: pointer; }
.si-title { font-weight: 500; }
.si-meta { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.si-del {
  position: absolute; top: 50%; right: 6px; transform: translateY(-50%);
  width: 21px; height: 21px; line-height: 19px; text-align: center;
  border: none; background: transparent; color: var(--text-3);
  cursor: pointer; border-radius: 5px; font-size: 13px; padding: 0;
}
.si-del:hover { background: #fde2e1; color: #d4380d; }
.typing { color: var(--text-3); font-size: 13px; font-style: italic; }
.cursor { display: inline-block; margin-left: 1px; color: var(--text-3);
  animation: blink 1s steps(2, start) infinite; }
@keyframes blink { to { opacity: 0; } }

/* ---------- 报告 ---------- */
.report { font-size: 14px; line-height: 1.85; }
.report h2 { font-size: 16px; margin: 22px 0 10px; padding-bottom: 7px;
  border-bottom: 1px solid var(--line); font-weight: 600; }
.report h2:first-child { margin-top: 0; }
.report h3 { font-size: 14px; margin: 15px 0 7px; font-weight: 600; }
.report p { margin-bottom: 10px; }
.report ul, .report ol { margin: 0 0 12px 22px; }
.report li { margin-bottom: 5px; }
.report strong { font-weight: 600; color: #0d3a75; }
.report table { border-collapse: collapse; width: 100%; margin: 12px 0;
  font-size: 13px; }
.report th, .report td { border: 1px solid var(--line); padding: 8px 10px;
  text-align: left; vertical-align: top; }
.report th { background: var(--bg); font-weight: 600; }
.report code { background: var(--bg); padding: 1px 5px; border-radius: 4px;
  font-size: 12.5px; }
.report hr { border: none; border-top: 1px solid var(--line); margin: 18px 0; }
.report blockquote { border-left: 3px solid var(--brand); padding-left: 12px;
  color: var(--text-2); margin: 10px 0; }

/* ---------- 弹窗 ---------- */
.mask {
  position: fixed; inset: 0; background: rgba(16, 24, 40, .45);
  display: flex; align-items: center; justify-content: center; z-index: 100;
  padding: 24px;
}
.modal {
  background: #fff; border-radius: 12px; width: 100%; max-width: 620px;
  max-height: 88vh; display: flex; flex-direction: column;
  box-shadow: 0 20px 40px rgba(16, 24, 40, .18);
}
.modal.wide { max-width: 900px; }
.modal-head { padding: 16px 20px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; }
.modal-head h3 { font-size: 16px; font-weight: 600; }
.modal-head .close { margin-left: auto; cursor: pointer; color: var(--text-3);
  font-size: 20px; line-height: 1; padding: 0 4px; }
.modal-head .close:hover { color: var(--text); }
.modal-body { padding: 20px; overflow-y: auto; flex: 1; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--line);
  display: flex; gap: 10px; justify-content: flex-end; }

.section-title {
  font-size: 13px; font-weight: 600; color: var(--text-2); margin: 20px 0 10px;
  padding-bottom: 6px; border-bottom: 1px solid var(--line-soft);
}
.section-title:first-child { margin-top: 0; }
.tip {
  background: var(--brand-soft); border: 1px solid #cfe0f8; border-radius: 8px;
  padding: 11px 13px; font-size: 12.5px; color: #17457f; line-height: 1.7;
  margin-bottom: 14px;
}
.tip.warn { background: var(--warn-soft); border-color: #f2d6bd; color: #8a4415; }
.tip a { color: var(--brand); }

/* ---------- 提示条 ---------- */
#toast {
  position: fixed; top: 70px; left: 50%; transform: translateX(-50%);
  z-index: 300; display: flex; flex-direction: column; gap: 8px;
  align-items: center; pointer-events: none;
}
.toast-item {
  background: #21262d; color: #fff; padding: 9px 18px; border-radius: 8px;
  font-size: 13px; box-shadow: 0 6px 16px rgba(0, 0, 0, .18);
  animation: slidein .2s ease;
}
.toast-item.err { background: var(--danger); }
.toast-item.ok { background: var(--ok); }
@keyframes slidein { from { opacity: 0; transform: translateY(-8px); } }

.loading {
  display: inline-block; width: 13px; height: 13px; border: 2px solid #fff;
  border-top-color: transparent; border-radius: 50%; animation: spin .7s linear infinite;
}
.loading.dark { border-color: var(--brand); border-top-color: transparent; }
@keyframes spin { to { transform: rotate(360deg); } }

.center-load { text-align: center; padding: 50px; color: var(--text-3); }
.upload-zone {
  border: 2px dashed var(--line); border-radius: 9px; padding: 24px;
  text-align: center; cursor: pointer; transition: .15s; background: #fafbfc;
}
.upload-zone:hover, .upload-zone.over { border-color: var(--brand);
  background: var(--brand-soft); }
.upload-zone p { font-size: 13px; color: var(--text-2); }
.upload-zone .sub { font-size: 12px; color: var(--text-3); margin-top: 4px; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #d3d8de; border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: #bfc5cd; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- 客户对比 ---------- */
.compare-head { margin-bottom: 14px; }
.compare-select label { display: block; font-size: 12px; color: var(--text-3); margin-bottom: 5px; }
.compare-select select { background: #fff; min-width: 320px; }
.compare-score-box {
  text-align: center; padding: 18px; background: var(--bg); border-radius: 10px;
  border: 1px dashed var(--line); margin-bottom: 16px;
}
.similarity-score {
  font-size: 48px; font-weight: 700; line-height: 1;
  display: inline-flex; align-items: baseline; gap: 2px;
}
.similarity-score span { font-size: 18px; font-weight: 500; }
.similarity-score.high { color: var(--ok); }
.similarity-score.mid { color: var(--warn); }
.similarity-score.low { color: var(--text-2); }
.score-desc { font-size: 13px; color: var(--text-3); margin-top: 8px; }
.tag-row { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.sim-tag {
  font-size: 12px; padding: 3px 10px; border-radius: 12px;
  background: var(--bg); color: var(--text-2); border: 1px solid var(--line);
}
.sim-tag.match { background: var(--ok-soft); color: var(--ok); border-color: #bfe3d0; }
.sim-tag.diff { background: #fff2ea; color: #c45c2b; border-color: #f5d5bf; }
.compare-layout {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 6px;
}
.compare-col {
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  padding: 12px 14px;
}
.compare-col-head { font-weight: 600; font-size: 14px; color: var(--text); }
.compare-col-sub { font-size: 12px; color: var(--text-3); margin-top: 3px; }
.compare-rows { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.compare-row {
  display: grid; grid-template-columns: 110px 1fr 1fr; gap: 10px;
  padding: 10px 14px; border-bottom: 1px solid var(--line);
  background: #fff; align-items: start;
}
.compare-row:last-child { border-bottom: none; }
.compare-row.same { background: #f4faf7; }
.compare-label { font-size: 12px; color: var(--text-3); }
.compare-val { font-size: 13px; color: var(--text); white-space: pre-wrap; }
.compare-section { font-size: 13px; color: var(--text); margin-bottom: 10px; line-height: 1.6; }
.compare-section b { color: var(--text); }
.compare-section ul { margin: 6px 0 0 18px; padding: 0; }
.compare-section li { margin-bottom: 4px; }
.reasoning { font-size: 14px; line-height: 1.8; color: var(--text); }
.reasoning p { margin: 8px 0; }

/* ---------- 城市/事业部 层级 tab ---------- */
.div-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; align-items: center; }
.div-tab {
  border: 1px solid var(--line); background: #fff; color: var(--text-2);
  border-radius: 16px; padding: 4px 12px; font-size: 12px; cursor: pointer;
  white-space: nowrap; transition: .12s;
}
.div-tab:hover { border-color: var(--brand); color: var(--brand); }
.div-tab.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.div-tab-add { border-style: dashed; color: var(--brand); }
.div-del {
  border: 1px solid #f3c2c2; background: #fff5f5; color: #d4380d;
  border-radius: 16px; padding: 4px 10px; font-size: 12px; cursor: pointer;
  white-space: nowrap; transition: .12s;
}
.div-del:hover { background: #ffecec; }

/* ---------- 项目子视图切换 ---------- */
.subtabs { display: flex; gap: 6px; margin-top: 10px; }
.subtab {
  flex: 1; padding: 7px 0; border: 1px solid var(--line); background: #fff;
  border-radius: 7px; cursor: pointer; font-size: 13px; color: var(--text-2);
  transition: .12s;
}
.subtab:hover { background: var(--bg); }
.subtab.active { background: var(--brand); border-color: var(--brand); color: #fff; }

/* ---------- 项目地图 ---------- */
.map-wrap { display: flex; flex-direction: column; gap: 10px; }
.map-tip {
  background: var(--brand-soft); border: 1px solid #cfe0f8; border-radius: 8px;
  padding: 9px 13px; font-size: 12.5px; color: #17457f; line-height: 1.6;
}
.map-tip strong { color: var(--brand); }
.proj-map {
  width: 100%; height: calc(100vh - 220px); min-height: 420px;
  background: #eef0f3; border-radius: 10px; border: 1px solid var(--line);
}
.map-empty {
  text-align: center; color: var(--text-3); font-size: 13px;
  padding: 18px; background: var(--bg); border-radius: 8px;
}
.map-info {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  min-width: 180px; padding: 2px;
}
.map-info .mi-name { font-size: 14px; font-weight: 600; color: #1a1a1a; }
.map-info .mi-sub { font-size: 12px; color: #d4380d; margin-top: 3px; }
.map-info .mi-pos { font-size: 12px; color: #555; margin-top: 4px;
  line-height: 1.5; max-width: 220px; }
.map-info .mi-actions { display: flex; gap: 8px; margin-top: 10px; }
.map-info .mi-actions .btn { flex: 1; justify-content: center; }

/* ---------- 地图选点：地点搜索 ---------- */
.pick-search { display: flex; gap: 8px; margin-bottom: 10px; }
.pick-search input { flex: 1; }
.pick-search .btn { white-space: nowrap; }
.pick-results { margin-top: 10px; max-height: 190px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.pick-res { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; cursor: pointer; transition: all .15s; background: #fff; }
.pick-res:hover { border-color: var(--brand); background: #f5f9ff; }
.pick-res.active { border-color: var(--brand); background: #eaf2ff; box-shadow: 0 0 0 2px rgba(37,99,235,.12); }
.pick-res .pr-title { font-size: 13px; font-weight: 600; color: #1a1a1a; }
.pick-res .pr-sub { font-size: 12px; color: #666; margin-top: 2px; }
.pick-res-hint { font-size: 12px; color: #888; padding: 6px 2px; }

/* ---------- 演练：客户情绪状态面板 ---------- */
.state-card .card-body { padding: 12px 14px; }
.state-row { display: flex; align-items: center; gap: 8px; margin: 9px 0; }
.state-row .lab { width: 30px; font-size: 12.5px; color: var(--text-2); flex-shrink: 0; }
.state-row .bar { flex: 1; height: 8px; border-radius: 6px; background: #eef0f3; overflow: hidden; }
.state-row .bar .fill { display: block; height: 100%; border-radius: 6px;
  transition: width .45s ease, background .3s; }
.state-row .fill.good { background: var(--ok); }
.state-row .fill.mid { background: #d29922; }
.state-row .fill.low { background: var(--danger); }
.state-row .sval { width: 26px; text-align: right; font-size: 12.5px;
  font-weight: 600; font-variant-numeric: tabular-nums; }
.state-row .sval.good { color: var(--ok); }
.state-row .sval.mid { color: #b07d12; }
.state-row .sval.low { color: var(--danger); }
.card-head .hint.ok { color: var(--ok); font-weight: 600; }
.card-head .hint.bad { color: var(--danger); font-weight: 600; }

/* ---------- 演练：客户动作/神态提示 ---------- */
.cust-action { font-size: 12px; font-style: italic; color: #9a6b3f;
  margin: 0 0 3px 38px; line-height: 1.5; }
.msg.customer .cust-action::before { content: "🎭 "; }
/* 电话场景看不到动作，改成「听感」提示 */
.scene-phone .msg.customer .cust-action::before { content: "🎧 "; }
.scene-phone .cust-action { color: #5b6b8c; }

/* ---------- 演练：场景徽章 ---------- */
.scene-badge { display: inline-flex; align-items: center; gap: 4px;
  font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 20px;
  border: 1px solid transparent; white-space: nowrap; }
.scene-badge.onsite { background: #eaf4ec; color: #2f7d4a; border-color: #bfe3cf; }
.scene-badge.phone { background: #eaeff8; color: #3a5b93; border-color: #c4d3ee; }
.scene-tip { margin-top: 8px; font-size: 12.5px; line-height: 1.6;
  color: var(--text-2); background: #f6f7f9; border-left: 3px solid #c4d3ee;
  border-radius: 6px; padding: 8px 11px; }
.scene-tip b { color: var(--text-1); }

/* ---------- 演练：结局横幅 ---------- */
.outcome-banner { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 14px;
  font-weight: 600; font-size: 14px; text-align: center;
  display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; }
.outcome-banner.success { background: var(--ok-soft); color: var(--ok);
  border: 1px solid #bfe3cf; }
.outcome-banner.fail { background: var(--danger-soft); color: var(--danger);
  border: 1px solid #f1c4be; }
.outcome-banner .btn { font-weight: 500; }

/* ---------- 独立登录页 ---------- */
.auth-page {
  position: fixed; inset: 0; z-index: 1200;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #e8f0fe 0%, #f0f4f8 40%, #eaf2fc 100%);
  overflow: hidden;
}
.auth-bg-shape {
  position: absolute; border-radius: 50%; opacity: .35;
  filter: blur(60px); pointer-events: none;
}
.auth-bg-1 { width: 440px; height: 440px; background: #a3c4f7; top: -120px; right: -80px; }
.auth-bg-2 { width: 360px; height: 360px; background: #c7d8f5; bottom: -100px; left: -60px; }

.auth-card {
  position: relative; z-index: 1;
  width: 380px; max-width: 92vw;
  background: #fff; border-radius: 16px; padding: 36px 32px 32px;
  box-shadow: 0 8px 32px rgba(16, 24, 40, .12), 0 2px 8px rgba(16, 24, 40, .06);
}
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.auth-logo {
  width: 44px; height: 44px; border-radius: 11px;
  background: var(--brand); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 700; flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(29, 99, 201, .25);
}
.auth-brand-title { font-size: 19px; font-weight: 700; color: var(--text); line-height: 1.3; }
.auth-brand-sub { font-size: 12.5px; color: var(--text-3); margin-top: 2px; }

.auth-tabs {
  display: flex; gap: 0; margin-bottom: 22px;
  border-bottom: 2px solid var(--line-soft);
}
.auth-tab {
  cursor: pointer; padding: 8px 0; margin-right: 28px;
  color: var(--text-3); border-bottom: 2px solid transparent;
  font-size: 15px; font-weight: 500; margin-bottom: -2px; transition: .15s;
}
.auth-tab:hover { color: var(--text-2); }
.auth-tab.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }

.auth-form { display: flex; flex-direction: column; gap: 16px; }
.auth-field { display: flex; flex-direction: column; gap: 6px; }
.auth-field label { font-size: 13px; font-weight: 500; color: var(--text-2); }
.auth-field input {
  padding: 10px 14px; border: 1.5px solid var(--line); border-radius: 9px;
  font-size: 14px; outline: none; transition: .15s; background: #fafbfc;
}
.auth-field input:focus { border-color: var(--brand); background: #fff;
  box-shadow: 0 0 0 3px rgba(29, 99, 201, .1); }
.auth-submit {
  width: 100%; padding: 11px; font-size: 15px; font-weight: 600;
  border-radius: 9px; margin-top: 4px; justify-content: center;
}
.auth-err { color: var(--danger); font-size: 13px; min-height: 18px; text-align: center; }
.auth-note { font-size: 12px; color: var(--text-3); text-align: center; margin-top: -4px; }
.auth-footer {
  position: relative; z-index: 1;
  margin-top: 28px; font-size: 12.5px; color: var(--text-3);
}

/* ---------- 知识沉淀（RAG 闭环） ---------- */
.kb-wrap { display: flex; flex-direction: column; gap: 14px; max-width: 880px; }
.kb-tip { font-size: 12.5px; color: var(--text-3); line-height: 1.6; margin: 0 0 12px; }
.kb-tip b { color: var(--text-2); }
.kb-add { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.kb-add select { padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px;
  font-size: 13px; background: var(--bg); min-width: 96px; }
.kb-add input { flex: 1; min-width: 220px; padding: 8px 10px; border: 1px solid var(--line);
  border-radius: 7px; font-size: 13px; }
.kb-sessions { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 6px; }
.kb-group { margin-bottom: 14px; }
.kb-group:last-child { margin-bottom: 0; }
.kb-group-head { font-size: 13px; font-weight: 600; color: var(--text-2);
  margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
.kb-item { display: flex; align-items: center; gap: 8px; padding: 7px 10px;
  border: 1px solid var(--line); border-radius: 7px; margin-bottom: 5px; background: var(--bg); }
.kb-text { flex: 1; font-size: 13px; line-height: 1.5; }
.kb-del { border: none; background: transparent; color: var(--text-3); cursor: pointer;
  font-size: 13px; padding: 2px 6px; border-radius: 5px; }
.kb-del:hover { background: #fde2e1; color: var(--danger); }

.chat-input textarea:disabled, .chat-input .btn.primary:disabled {
  opacity: .5; cursor: not-allowed; }

/* ---------------- 客户一页纸报告 ---------------- */
.onepager { max-width: 920px; margin: 0 auto; font-size: 13px; color: var(--text-1); }
.op-head { border-bottom: 2px solid var(--accent); padding-bottom: 8px; margin-bottom: 12px; }
.op-title { font-size: 22px; font-weight: 700; color: var(--text-1); }
.op-sub { font-size: 13px; font-weight: 500; color: var(--text-3); margin-left: 6px; }
.op-meta { font-size: 12px; color: var(--text-3); margin-top: 4px; }
.op-summary { background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412;
  border-radius: 8px; padding: 9px 12px; font-size: 13px; line-height: 1.6; margin-bottom: 14px; }
.op-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.op-section { border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; background: #fff; }
.op-section.op-wide { margin-bottom: 12px; }
.op-h { font-size: 14px; font-weight: 700; color: var(--accent); margin-bottom: 6px;
  display: flex; align-items: center; gap: 6px; }
.op-h::before { content: ""; width: 4px; height: 14px; background: var(--accent); border-radius: 2px; display: inline-block; }
.op-note { font-size: 11px; color: var(--text-3); margin-bottom: 5px; }
.op-ul { margin: 0; padding-left: 18px; }
.op-ul li { line-height: 1.65; margin-bottom: 3px; }
.op-text { font-size: 13px; line-height: 1.7; }
.op-text p { margin: 4px 0; }
.op-text h1, .op-text h2, .op-text h3 { font-size: 14px; margin: 8px 0 4px; color: var(--text-2); }
.op-text ul, .op-text ol { margin: 4px 0; padding-left: 20px; }

@media print {
  body { background: #fff !important; }
  body * { visibility: hidden; }
  #opPrint, #opPrint * { visibility: visible; }
  #opPrint { position: absolute; left: 0; top: 0; width: 100%; max-width: 100%; }
  .no-print { display: none !important; }
  .onepager { max-width: 100%; }
  .op-section, .op-summary { break-inside: avoid; }
}

/* ---------- 三级权限：角色徽章 / 系统管理 / 项目申请 ---------- */
.role-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12.5px; font-weight: 600; padding: 4px 11px; border-radius: 20px;
  white-space: nowrap; border: 1px solid transparent;
}
.role-badge.r1 { background: #fdeede; color: #9a5b12; border-color: #f3d3ad; }
.role-badge.r2 { background: #e7f0ff; color: #1d63c9; border-color: #c3d9f7; }
.role-badge.r3 { background: #eef1f4; color: #5b6470; border-color: #dde2e8; }

.admin-tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.admin-tab {
  padding: 6px 14px; font-size: 13px; border-radius: 8px; cursor: pointer;
  background: var(--bg); color: var(--text-2); border: 1px solid var(--line);
}
.admin-tab.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.admin-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }

.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin-table th, .admin-table td {
  text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}
.admin-table th { color: var(--text-3); font-weight: 600; background: var(--bg); }
.admin-table tr:hover td { background: #fafbfc; }
.admin-table td.ops, .admin-table td.projs { white-space: nowrap; }
.admin-table select { max-width: 130px; }
.admin-table .projs .tag { background: var(--bg); color: var(--text-2); border: 1px solid var(--line); }

.tag.self { background: var(--brand-soft); color: var(--brand); }
.tag.pending { background: var(--warn-soft); color: var(--warn); }
.tag.warn { background: var(--warn-soft); color: var(--warn); border: 1px solid #f2d6bd; }
.tag.ok { background: #e6f6ec; color: #1f8a4c; }
.tag.no { background: #fdeceb; color: var(--danger); }
.muted { color: var(--text-3); }
.err { color: var(--danger); padding: 12px 0; }

.app-list { display: flex; flex-direction: column; gap: 10px; }
.app-row {
  border: 1px solid var(--line); border-radius: 9px; padding: 11px 13px;
  display: flex; flex-direction: column; gap: 4px; font-size: 13px;
}
.app-row .muted { font-size: 12px; }

/* ==================== 响应式适配 ==================== */

/* ---- 平板（≤ 1024px）---- */
@media (max-width: 1024px) {
  .topbar { padding: 0 14px; gap: 10px; }
  .logo-sub { display: none; }
  .stat-chips { gap: 5px; }
  .chip { font-size: 11px; padding: 3px 9px; }
  .sidebar { width: 260px; }
  .chat-side { width: 230px; }
  .compare-layout { grid-template-columns: 1fr; }
  .compare-row { grid-template-columns: 90px 1fr; }
  .compare-row .compare-val:last-child { display: none; }
}

/* ---- 手机（≤ 768px）---- */
@media (max-width: 768px) {
  body { font-size: 13px; }
  .topbar {
    height: auto; min-height: 48px; flex-wrap: wrap; padding: 8px 12px; gap: 8px;
  }
  .logo { font-size: 14px; gap: 8px; }
  .logo-mark { width: 24px; height: 24px; font-size: 13px; border-radius: 6px; }
  .nav { order: 3; width: 100%; }
  .nav-btn { flex: 1; text-align: center; padding: 6px 10px; font-size: 12px; }
  .topbar-spacer { display: none; }
  .stat-chips { display: none; }
  .role-badge { font-size: 11px; padding: 3px 8px; }
  .btn { padding: 7px 12px; font-size: 12px; }
  .btn.sm { padding: 5px 8px; font-size: 11px; }

  /* 手机：整屏分页（列表页 / 详情页），客户列表占满整屏好翻找 */
  .layout { flex-direction: column; height: calc(100vh - 48px); }
  .sidebar {
    width: 100%; max-height: none; height: 100%;
    border-right: none; border-bottom: 1px solid var(--line);
  }
  .sidebar-head { padding: 10px 12px; }
  .search-row { gap: 6px; }
  .search-row input { font-size: 13px; }
  .customer-list { padding: 6px; }
  .ci-meta { white-space: normal; }

  /* 列表态：隐藏详情区，客户列表占满整屏 */
  .main { display: none; }

  /* 详情态：隐藏列表，详情占满整屏，子项纵向排列 */
  body.mobile-detail .sidebar { display: none; }
  body.mobile-detail .main { display: flex; flex: 1; height: 100%; }
  .mh-back { display: none; }
  body.mobile-detail .mh-back { display: inline-flex; margin-bottom: 8px; }

  .main-head { padding: 10px 14px 0; }
  .mh-title { gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
  .mh-title h2 { font-size: 16px; }
  .mh-sub { font-size: 12px; }
  .mh-actions { margin-left: 0; }

  /* 子项（tabs）纵向排列，整屏宽 */
  body.mobile-detail .tabs {
    flex-direction: column; gap: 0; overflow: visible;
    border-bottom: 1px solid var(--line);
  }
  body.mobile-detail .tab {
    width: 100%; padding: 13px 14px; font-size: 14px;
    white-space: normal; border-bottom: 1px solid var(--line-soft);
    border-left: 3px solid transparent; border-bottom-width: 1px;
  }
  body.mobile-detail .tab.active {
    border-left-color: var(--brand); border-bottom-color: var(--line-soft);
    background: var(--brand-soft); font-weight: 500;
  }
  .content { padding: 14px; }

  .grid { grid-template-columns: 1fr; }
  .card { margin-bottom: 12px; }
  .card-head { padding: 10px 14px; }
  .card-body { padding: 14px; }

  /* 演练聊天 */
  .chat-wrap { flex-direction: column; height: calc(100vh - 160px); gap: 10px; }
  .chat-side { width: 100%; max-height: 160px; }
  .chat-body { padding: 12px; }
  .bubble { max-width: 85%; font-size: 13px; }

  /* 弹窗全屏 */
  .mask { padding: 0; }
  .modal { max-width: 100%; max-height: 100vh; border-radius: 0; height: 100vh; }
  .modal.wide { max-width: 100%; }

  /* 对比 */
  .compare-select select { min-width: auto; width: 100%; }
  .similarity-score { font-size: 36px; }

  /* 一页纸报告 */
  .op-grid { grid-template-columns: 1fr; }
  .onepager { max-width: 100%; }

  /* 管理表格 */
  .admin-table { font-size: 12px; }
  .admin-table th, .admin-table td { padding: 7px 6px; }
  .admin-table td.ops { white-space: normal; }
  .admin-table select { max-width: 100px; font-size: 12px; }

  /* 登录页 */
  .auth-card { width: 92vw; padding: 28px 22px 24px; }
  .auth-brand-title { font-size: 17px; }
}

/* ---- 小手机（≤ 480px）---- */
@media (max-width: 480px) {
  .topbar { padding: 6px 10px; }
  .logo { font-size: 13px; }
  .logo-mark { width: 22px; height: 22px; font-size: 12px; }
  .sidebar { max-height: none; }
  .content { padding: 10px; }
  .card-head { padding: 9px 12px; flex-wrap: wrap; }
  .card-body { padding: 12px; }
  .auth-card { padding: 22px 18px 20px; }
  .auth-brand { gap: 10px; margin-bottom: 22px; }
  .auth-logo { width: 38px; height: 38px; font-size: 19px; }
  .auth-brand-title { font-size: 16px; }
  .auth-brand-sub { font-size: 12px; }
  .bubble { max-width: 90%; font-size: 12.5px; }
}

/* ==================== 视觉产品化打磨 ==================== */

/* 空状态增强 */
.empty {
  padding: 50px 20px;
}
.empty-icon {
  width: 56px; height: 56px; border-radius: 14px;
  background: linear-gradient(135deg, var(--bg), #eef0f3);
  font-size: 26px; margin-bottom: 16px;
}

/* 卡片悬停微交互 */
.card { transition: box-shadow .2s; }
.card:hover { box-shadow: 0 2px 8px rgba(16, 24, 40, .08), 0 1px 3px rgba(16, 24, 40, .05); }

/* 按钮过渡 */
.btn { transition: all .15s ease; }
.btn:active { transform: scale(.97); }

/* 输入框统一圆角与过渡 */
input[type=text], input[type=date], input[type=number], input[type=password],
select, textarea {
  transition: border-color .15s, box-shadow .15s;
}

/* 顶栏微调 */
.topbar { transition: box-shadow .2s; box-shadow: 0 1px 0 rgba(16,24,40,.04); }

/* 客户列表项过渡 */
.customer-item { transition: all .12s; }
.customer-item:active { transform: scale(.99); }

/* Tab 下划线动画 */
.tab { transition: color .15s, border-bottom-color .15s; }

/* 演练气泡淡入 */
.msg { animation: msgIn .25s ease; }
@keyframes msgIn { from { opacity: 0; transform: translateY(6px); } }

/* 全局选中文本配色 */
::selection { background: var(--brand-soft); color: var(--brand-dark); }

/* 链接 */
a { color: var(--brand); text-decoration: none; transition: color .15s; }
a:hover { color: var(--brand-dark); }

/* 遮罩动画 */
.mask { animation: maskIn .18s ease; }
@keyframes maskIn { from { opacity: 0; } }
.modal { animation: modalIn .22s cubic-bezier(.16, 1, .3, 1); }
@keyframes modalIn { from { opacity: 0; transform: translateY(16px) scale(.97); } }
