/* 门店团购项目跟进系统 —— 多彩主题 */
:root {
  --bg: #f4f6fb;
  --card: #ffffff;
  --ink: #22263a;
  --ink-2: #6b7189;
  --line: #e7eaf3;
  --brand: #5b8def;
  --c1: #5b8def; --c2: #f5a524; --c3: #16a34a; --c4: #a855f7;
  --c5: #ef476f; --c6: #06b6d4;
  --st-created: #5b8def; --st-talking: #f5a524; --st-deal: #16a34a;
  --shadow: 0 8px 24px rgba(28, 39, 82, .07);
  --radius: 16px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  background: var(--bg); color: var(--ink); font-size: 14px; line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
h1, h2, h3, h4 { margin: 0 0 .4em; font-weight: 700; }
h1 { font-size: 22px; }
h2 { font-size: 17px; }
.muted { color: var(--ink-2); font-weight: 400; }
.small { font-size: 12px; }

/* ---------------- 布局 ---------------- */
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: 228px; display: flex; flex-direction: column;
  background: linear-gradient(165deg, #2b3459 0%, #1f2740 55%, #241f3a 100%);
  color: #e8ecfa; padding: 18px 14px; z-index: 30;
}
.brand { display: flex; gap: 10px; align-items: center; padding: 6px 8px 18px; border-bottom: 1px solid rgba(255,255,255,.1); }
.brand-cat { width: 44px; height: 44px; border-radius: 13px; box-shadow: 0 4px 14px rgba(0,0,0,.3); }
.brand b { display: block; font-size: 15px; }
.brand span { font-size: 11px; color: #9aa6cf; letter-spacing: .3px; }
.nav { display: flex; flex-direction: column; gap: 4px; margin-top: 14px; flex: 1; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 11px;
  color: #c3cbec; font-weight: 500; transition: .16s;
}
.nav a i { font-style: normal; width: 20px; text-align: center; }
.nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav a.on { background: linear-gradient(90deg, rgba(91,141,239,.35), rgba(168,85,247,.25)); color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.14); }
.side-foot { border-top: 1px solid rgba(255,255,255,.1); padding-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.who { display: flex; gap: 9px; align-items: center; }
.who img { width: 38px; height: 38px; border-radius: 12px; }
.who b { display: block; font-size: 13px; }
.main { margin-left: 228px; padding: 26px 30px 60px; min-height: 100vh; }
body.plain .main { margin-left: 0; padding: 0; }
/* 移动端顶栏与抽屉遮罩：宽屏下完全不存在 */
.m-top { display: none; }
.page-head { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; justify-content: space-between; margin-bottom: 18px; }
.page-head p { margin: 0; color: var(--ink-2); }

/* ---------------- 组件 ---------------- */
.card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px 20px; border: 1px solid var(--line);
}
.grid { display: grid; gap: 16px; }
.kpis { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.cols-2 { grid-template-columns: 2fr 1fr; }
.cols-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
@media (max-width: 1100px) { .cols-2 { grid-template-columns: 1fr; } }

.kpi { position: relative; overflow: hidden; }
.kpi .val { font-size: 26px; font-weight: 800; letter-spacing: -.5px; }
.kpi .lbl { color: var(--ink-2); font-size: 13px; }
.kpi::after {
  content: ""; position: absolute; right: -22px; top: -22px; width: 76px; height: 76px;
  border-radius: 50%; background: var(--accent, var(--brand)); opacity: .13;
}
.kpi .spark { font-size: 11px; color: var(--ink-2); }

/* 看板主指标：成交金额（独占一行的大卡，放在最前面） */
.kpi.hero {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 14px 34px;
  margin-bottom: 16px; padding: 20px 24px;
  background: linear-gradient(115deg, #e8f9ef, #ffffff 62%);
  border: 1px solid #c9ebd5; border-left: 6px solid var(--st-deal);
}
.kpi.hero .hero-main { display: flex; flex-direction: column; gap: 3px; }
.kpi.hero .lbl { font-size: 13.5px; font-weight: 700; color: #15803d; }
.kpi.hero .val { font-size: 46px; line-height: 1.02; color: var(--st-deal); }
.kpi.hero::after { width: 150px; height: 150px; right: -40px; top: -52px; opacity: .09; }
.kpi.hero .hero-side { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; }
.kpi.hero .hero-side .up { color: #15803d; font-weight: 800; font-size: 14px; }
.kpi.hero .hero-side .down { color: #dc2626; font-weight: 800; font-size: 14px; }
.kpi.hero .hero-note {
  margin-left: auto; max-width: 330px; font-size: 12px; color: var(--ink-2); line-height: 1.6;
}
@media (max-width: 900px) {
  .kpi.hero { gap: 10px 18px; } .kpi.hero .val { font-size: 34px; }
  .kpi.hero .hero-note { margin-left: 0; max-width: none; }
}

/* 项目进度分布并入 KPI 那一排：5 张数字卡 + 环形图占两格，正好一行七等分 */
.kpis.dash { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.kpis.dash > .card { min-width: 0; }
.donut-cell { grid-column: span 2; }
.donut-cell::after { display: none; }
.donut-cell .donut-row { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.donut-cell .donut-row svg.chart { width: 92px; height: 92px; flex: none; }
.donut-cell .legend { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; font-size: 11.5px; }
@media (max-width: 1280px) { .kpis.dash { grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); } }

/* 看板分区：每张卡用顶部色条区分（--accent 由模板给） */
.sec { border-top: 3px solid var(--accent, var(--brand)); }
.sec > h2, .sec .section-title h2 { display: flex; align-items: center; gap: 7px; }

/* 登录页：密码显隐按钮 + 账号一键填入 */
.field .pw { display: flex; gap: 6px; align-items: center; width: 100%; }
.field .pw input { flex: 1; min-width: 0; }
.eye {
  flex: none; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 10px;
  background: #f8fafc; cursor: pointer; font-size: 15px; line-height: 1;
}
.eye:hover { background: #eef2f7; }
.remember { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: -2px 0 4px; }
.remember .ck { display: flex; align-items: center; gap: 5px; font-size: 12.5px; cursor: pointer; }
.remember .ck input { width: 15px; height: 15px; accent-color: var(--brand); cursor: pointer; }

/* 人员清单的密码列：默认打码，点眼睛看明文 */
.pwd-cell { white-space: nowrap; }
.pwd-cell .pwd {
  font-family: ui-monospace, Consolas, monospace; font-size: 12px; letter-spacing: .5px;
  background: #f1f5f9; border: 1px solid var(--line); border-radius: 7px; padding: 2px 7px;
}
.eye.xs { width: 27px; height: 27px; border-radius: 8px; font-size: 12.5px; vertical-align: middle; }

/* 自动结论条 */
.insights {
  display: flex; flex-wrap: wrap; gap: 6px 20px; align-items: baseline;
  margin-bottom: 14px; padding: 12px 18px; border-radius: 14px;
  border: 1px dashed #c3cee8; background: linear-gradient(95deg, #f3f6ff, #fdf6ff 55%, #f0fbf5);
  font-size: 12.8px; color: var(--ink-2); line-height: 1.7;
}
.insights .lead { font-weight: 800; color: var(--brand-deep); }
/* 句子里的 <b> 必须跟文字连排：这里若用 flex，数字会被拆成独立项、句子换行处断得七零八落 */
.insights .it { display: inline; }
.insights .it + .it::before { content: "·"; color: #b6bfd6; font-weight: 800; margin-right: 2px; }
.insights b { color: var(--ink); }

/* 排行榜（门店 / 业务员并排两列）：前三名站台 + 第 4—10 名滚动清单 */
.rank-pair { grid-template-columns: repeat(2, minmax(0, 1fr)); }   /* 五五分，minmax(0) 防内容撑破 */
.rank-pair > .card { margin-bottom: 0; min-width: 0; }
.rank-pair .section-title h2 { font-size: 15px; white-space: nowrap; }
.rank-pair .section-title .small { font-size: 11px; }
.board-rank .podium { gap: 10px; }
.board-rank .pod .medal { font-size: 26px; }
.board-rank .pod .pname { font-size: 13px; }
.board-rank .pod .pamt { font-size: 16px; }
.board-rank .board { max-height: 200px; }
.board-rank .board .row { grid-template-columns: 22px 1fr 1.6fr 84px 36px; gap: 8px; font-size: 12px; }
@media (max-width: 1000px) { .rank-pair { grid-template-columns: 1fr; } .rank-pair > .card { margin-bottom: 16px; } }
.podium { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; align-items: end; margin: 4px 0 14px; }
.pod {
  display: flex; flex-direction: column; justify-content: flex-end; text-align: center;
  padding: 14px 12px 0; border: 1px solid var(--line); border-radius: 14px; background: #f9fbfd;
}
.pod .medal { font-size: 30px; line-height: 1.15; }
.pod .pname { font-size: 14px; font-weight: 800; margin-top: 4px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.pod .pamt { font-size: 18px; font-weight: 800; color: var(--brand-deep); margin: 2px 0; }
.pod .pmeta { font-size: 11.5px; color: var(--ink-2); margin-bottom: 10px; }
.pod .pmeta .pct { display: block; font-weight: 700; color: var(--brand-deep); }
.pod .stand {
  display: flex; align-items: center; justify-content: center; height: 36px;
  border-radius: 9px 9px 0 0; background: #eef2f7; color: #94a3b8; font-weight: 900; font-size: 12.5px;
}
.pod1 { background: linear-gradient(180deg, #fffbeb, #fff); border-color: #fcd34d; }
.pod1 .stand { height: 70px; background: linear-gradient(180deg, #fde68a, #fef3c7); color: #b45309; font-size: 14px; }
.pod2 .stand { height: 52px; background: linear-gradient(180deg, #dbe2ea, #f1f5f9); color: #475569; }
.pod3 .stand { height: 42px; background: linear-gradient(180deg, #fed7aa, #ffedd5); color: #9a3412; }
.pod-empty { opacity: .6; } .pod-empty .medal { filter: grayscale(1); }
.board { max-height: 226px; overflow-y: auto; border: 1px solid var(--line); border-radius: 12px; padding: 2px 10px; }
.board .row {
  display: grid; grid-template-columns: 24px 1.1fr 2fr 92px 40px; gap: 10px; align-items: center;
  padding: 7px 2px; font-size: 12.5px; border-bottom: 1px dashed #eef2f7;
}
.board .row:last-child { border-bottom: 0; }
.board .no { text-align: center; font-weight: 800; color: #94a3b8; }
.board .nm { font-weight: 700; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.board .am { text-align: right; font-weight: 700; }
.board .pc { text-align: right; font-weight: 700; color: var(--brand-deep); font-size: 11.5px; }
.board .bar { height: 8px; }
.board-tip { margin: 6px 0 0; font-size: 11.5px; color: var(--ink-2); text-align: center; }
@media (max-width: 720px) { .podium { grid-template-columns: 1fr; } .pod .stand { height: 30px !important; } }

/* 已选筛选条件标签 */
.filters input[type=text] { flex: 1 1 240px; min-width: 210px; }
.filters select { min-width: 122px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.chips .chip a { color: #b42318; font-weight: 700; padding: 0 2px; }

.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; background: #eef1fa; color: var(--ink-2);
}
.badge.st-创建中 { background: #e9f0ff; color: #2f6fd0; }
.badge.st-沟通中 { background: #fff3dd; color: #b4770d; }
.badge.st-已成交 { background: #e4f7ea; color: #15803d; }
.role-badge { padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.role-badge.sales { background: rgba(91,141,239,.25); color: #dbe6ff; }
.role-badge.mid { background: rgba(168,85,247,.28); color: #f0e4ff; }
.badge.dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

.bar { height: 8px; border-radius: 999px; background: #edf0f7; overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 999px; background: var(--accent, var(--brand)); transition: width .5s; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; border-radius: 11px; border: 1px solid transparent; cursor: pointer;
  font-size: 14px; font-weight: 600; background: var(--brand); color: #fff; transition: .16s;
  text-align: center;
}
.btn:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn.alt { background: #eef1fa; color: var(--ink); }
.btn.green { background: var(--st-deal); }
.btn.amber { background: var(--st-talking); }
.btn.red { background: var(--c5); }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--ink-2); }
.btn.sm { padding: 6px 11px; font-size: 12.5px; border-radius: 9px; }
.btn-ghost { color: #c3cbec; border: 1px solid rgba(255,255,255,.18); border-radius: 10px; padding: 7px 10px; text-align: center; font-size: 13px; }
.btn-ghost:hover { background: rgba(255,255,255,.1); color: #fff; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 5px; font-weight: 600; }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=month],
input[type=month], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 11px;
  font: inherit; background: #fbfcff; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(91,141,239,.14); }
textarea { resize: vertical; min-height: 74px; }
.req { color: var(--c5); }

.flashes { position: sticky; top: 0; z-index: 40; display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.flash { padding: 11px 15px; border-radius: 12px; font-weight: 500; box-shadow: var(--shadow); }
.flash.ok { background: #e4f7ea; color: #15803d; border: 1px solid #b8e8c6; }
.flash.error { background: #ffeaea; color: #b42318; border: 1px solid #ffd2d2; }

table.tbl { width: 100%; border-collapse: collapse; }
table.tbl th, table.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; }
table.tbl th { font-size: 12px; color: var(--ink-2); text-transform: uppercase; letter-spacing: .4px; background: #fafbfe; }
table.tbl tr:hover td { background: #fafbff; }
.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------------- 项目卡片 ---------------- */
.proj-grid { grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); }
.proj {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column;
  border-top: 4px solid var(--accent, var(--brand));
  transition: .18s;
}
.proj:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(28,39,82,.13); }
.proj .body { padding: 15px 17px 17px; display: flex; flex-direction: column; gap: 11px; flex: 1; }
.proj h3 { font-size: 16.5px; margin: 0; }
.proj .meta { display: flex; flex-wrap: wrap; gap: 8px; color: var(--ink-2); font-size: 12.5px; }
.proj .meta span { display: inline-flex; align-items: center; gap: 4px; }
.proj .foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.proj .amount { font-weight: 800; color: var(--st-deal); font-size: 16px; }
.avatar-sm { width: 26px; height: 26px; border-radius: 8px; }

/* ---------------- 新动态提醒（卡片数字标识） ---------------- */
.unread {
  min-width: 21px; height: 21px; padding: 0 6px; border-radius: 11px;
  background: linear-gradient(135deg, #ff5f6d, #ef4444); color: #fff;
  font-size: 12px; font-weight: 800; display: inline-flex; align-items: center;
  justify-content: center; box-shadow: 0 3px 9px rgba(239, 68, 68, .4);
}
.new-tag {
  font-size: 12.5px; font-weight: 700; color: #dc2626;
  background: #fff1f2; border: 1px solid #fecdd3; border-radius: 8px; padding: 2px 8px;
}
.nav a .unread { margin-left: 6px; background: #ef4444; box-shadow: none; }
.nav-badge { min-width: 18px; height: 18px; font-size: 11px; }

.theme-0 { --accent: var(--c1); } .theme-1 { --accent: var(--c2); } .theme-2 { --accent: var(--c3); }
.theme-3 { --accent: var(--c4); } .theme-4 { --accent: var(--c5); } .theme-5 { --accent: var(--c6); }

/* ---------------- 进度时间线 ---------------- */
.steps { display: flex; gap: 8px; flex-wrap: wrap; }
.step {
  flex: 1; min-width: 175px; background: #fafbfe; border: 1px solid var(--line);
  border-radius: 13px; padding: 11px 13px; position: relative;
}
.step b { display: flex; align-items: center; gap: 7px; font-size: 14px; }
.step b i { font-style: normal; width: 20px; height: 20px; border-radius: 50%; background: #e6e9f2;
  color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; }
.step.done { background: linear-gradient(180deg, #f2fff6, #fff); border-color: #c9ebd5; }
.step.done b i { background: var(--st-deal); }
.step.now { background: linear-gradient(180deg, #fff7e6, #fff); border-color: #f7dfa8; }
.step.now b i { background: var(--st-talking); }
.step.todo { opacity: .72; }
.steps .step:last-child.now { background: linear-gradient(180deg, #f2fff6, #fff); border-color: #c9ebd5; }
.steps .step:last-child.now b i { background: var(--st-deal); }
.step p { margin: 3px 0 0; font-size: 12px; color: var(--ink-2); }

/* ---------------- 聊天 ---------------- */
.chat {
  background: #f0f2f7; border-radius: var(--radius); padding: 18px; max-height: 62vh; overflow-y: auto;
  border: 1px solid var(--line);
}
.chat-day { text-align: center; margin: 6px 0 14px; }
.chat-day span { background: #dfe3ec; color: #6b7189; font-size: 11.5px; padding: 3px 10px; border-radius: 999px; }
.msg { display: flex; gap: 10px; margin-bottom: 16px; align-items: flex-start; }
.msg img.face { width: 38px; height: 38px; border-radius: 12px; flex: none; }
.msg .col { max-width: 66%; }
.msg .who-line { font-size: 11.5px; color: var(--ink-2); margin-bottom: 3px; display: flex; gap: 6px; align-items: center; }
.bubble {
  background: #fff; padding: 10px 13px; border-radius: 4px 14px 14px 14px; box-shadow: 0 2px 8px rgba(28,39,82,.07);
  white-space: pre-wrap; word-break: break-word;
}
.msg.me { flex-direction: row-reverse; }
.msg.me .col { display: flex; flex-direction: column; align-items: flex-end; }
.msg.me .bubble { background: #95ec69; border-radius: 14px 4px 14px 14px; }
.msg.me .who-line { flex-direction: row-reverse; }
.bubble img.shot { border-radius: 10px; max-height: 230px; cursor: zoom-in; display: block; }
.file-chip {
  display: flex; gap: 9px; align-items: center; background: #fff; border: 1px solid var(--line);
  padding: 9px 12px; border-radius: 12px; margin-top: 6px; max-width: 320px;
}
.file-chip .ico { width: 34px; height: 34px; border-radius: 9px; background: #eef1fa; display: flex;
  align-items: center; justify-content: center; font-size: 16px; flex: none; }
.file-chip b { font-size: 13px; word-break: break-all; }
.composer { display: flex; gap: 10px; align-items: flex-end; margin-top: 14px; }
.composer textarea { min-height: 54px; }
.composer .tools { display: flex; flex-direction: column; gap: 8px; }
.attach-hint { font-size: 12px; color: var(--ink-2); }

.lightbox { position: fixed; inset: 0; background: rgba(15,18,32,.82); display: none;
  align-items: center; justify-content: center; z-index: 90; padding: 30px; }
.lightbox.on { display: flex; }
.lightbox img { max-height: 92vh; border-radius: 12px; background: #fff; }

/* ---------------- 成交信息 ---------------- */
.deal-box { border-left: 4px solid var(--st-deal); }
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px 18px; }
.kv div { border-bottom: 1px dashed var(--line); padding-bottom: 8px; }
.kv span { display: block; font-size: 12px; color: var(--ink-2); }
.kv b { font-size: 14.5px; word-break: break-all; }
.empty { text-align: center; color: var(--ink-2); padding: 34px 10px; }
.empty .cat { width: 90px; opacity: .9; }

/* ---------------- 图表 ---------------- */
.chart-wrap { overflow-x: auto; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-right: 5px; }
.hbar { display: grid; grid-template-columns: 88px 1fr 96px; gap: 10px; align-items: center; margin-bottom: 9px; }
.hbar .name { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar .val { text-align: right; font-size: 12.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.rank { display: flex; gap: 8px; align-items: center; }
.rank i { font-style: normal; width: 22px; height: 22px; border-radius: 7px; background: #eef1fa;
  display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: var(--ink-2); }
.rank i.top1 { background: #ffe6bf; color: #b4770d; } .rank i.top2 { background: #e5e9f5; color: #5b6479; }
.rank i.top3 { background: #ffe0d6; color: #c2542a; }

/* ---------------- 登录/注册 ---------------- */
.auth { display: grid; place-items: center; min-height: 100vh; padding: 26px;
  background: radial-gradient(1200px 600px at 12% 10%, #dfe8ff 0%, transparent 60%),
              radial-gradient(900px 500px at 88% 80%, #ffe6f2 0%, transparent 60%), var(--bg); }
.auth-card { width: min(520px, 100%); background: #fff; border-radius: 22px; box-shadow: 0 24px 60px rgba(28,39,82,.15); padding: 30px 32px; }
.auth-card h1 { display: flex; gap: 10px; align-items: center; font-size: 21px; }
.auth-card h1 img { width: 46px; height: 46px; border-radius: 14px; }
.auth-tabs { display: flex; gap: 8px; background: #f1f3fa; padding: 5px; border-radius: 12px; margin: 14px 0 20px; }
.auth-tabs a { flex: 1; text-align: center; padding: 8px; border-radius: 9px; font-weight: 600; color: var(--ink-2); }
.auth-tabs a.on { background: #fff; color: var(--ink); box-shadow: var(--shadow); }
.role-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.role-pick label { border: 1.5px solid var(--line); border-radius: 13px; padding: 11px 13px; cursor: pointer; transition: .15s; }
.role-pick label:hover { border-color: #c9d5f5; }
.role-pick input { display: none; }
.role-pick b { display: block; }
.role-pick small { color: var(--ink-2); }
.role-pick input:checked + b { color: var(--brand); }
.role-pick label.picked { border-color: var(--brand); background: #f3f7ff; box-shadow: 0 0 0 3px rgba(91,141,239,.12); }
.tip { background: #f6f8ff; border: 1px dashed #c8d5f7; border-radius: 12px; padding: 11px 13px; font-size: 12.5px; color: #4b567a; }
.cat-strip { display: flex; gap: 6px; }
.cat-strip img { width: 38px; height: 38px; border-radius: 11px; }

.cf-grid { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }

/* ---------------- 项目详情：左信息右会话 ---------------- */
.detail-grid { display: grid; grid-template-columns: minmax(320px, 1fr) minmax(420px, 1.15fr);
  gap: 16px; align-items: start; }
.col-left, .col-right { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.col-right { position: sticky; top: 18px; }
.chat-card .chat { max-height: 68vh; min-height: 320px; }
@media (max-width: 1180px) { .detail-grid { grid-template-columns: 1fr; } .col-right { position: static; } }

/* ---------------- 终止项目 ---------------- */
.badge.st-已终止 { background: #eef0f4; color: #5b6472; }
.stop-banner { border-left: 4px solid var(--c5); background: linear-gradient(180deg, #fff5f6, #fff); }
.stop-banner summary { cursor: pointer; font-size: 14.5px; }
.stop-banner summary .muted { font-weight: 400; }
.row-stopped td { opacity: .62; }
.row-stopped .badge { opacity: 1; }
.proj.stopped { filter: saturate(.45); }
.step.todo { opacity: .6; }

/* ---------------- 合同存档 ---------------- */
.contract-box { border-left: 4px solid var(--c4); }
.contract-row { display: flex; gap: 12px; align-items: center; padding: 11px 0;
  border-bottom: 1px dashed var(--line); }
.contract-row .ico { width: 38px; height: 38px; border-radius: 11px; background: #f3e9ff;
  display: flex; align-items: center; justify-content: center; font-size: 17px; flex: none; }
.contract-row .cinfo { flex: 1; min-width: 0; }
.upload-more summary { cursor: pointer; color: var(--brand); font-weight: 600; margin-top: 12px; }

/* 成交明细的「粘贴识别」区：默认收起，不挤占填表视线 */
details.paste { margin: 12px 0 6px; padding: 8px 12px; background: #fbfcff;
  border: 1px dashed var(--line); border-radius: 10px; }
details.paste > summary { cursor: pointer; color: var(--brand); font-weight: 600; font-size: 13.5px; }
details.paste textarea { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px;
  font-size: 13px; line-height: 1.6; }

/* ---------------- 项目列表表格 ---------------- */
.list-tbl { font-size: 13px; }
.list-tbl th, .list-tbl td { white-space: nowrap; }
.list-tbl th.cf { background: #f7f2ff; color: #6b21a8; }
.list-tbl td.wrap, .list-tbl th.wrap { white-space: normal; min-width: 160px; }
.list-tbl .sticky-l { position: sticky; left: 0; background: #fff; box-shadow: 1px 0 0 var(--line); }
.list-tbl thead .sticky-l { background: #fafbfe; z-index: 2; }
/* 成员管理：数据可见范围一栏的勾选区 */
.scope-form { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.scope-form details { width: 100%; }
.scope-peers { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 2px 10px; max-height: 168px; overflow-y: auto; padding: 6px 8px; margin-top: 4px;
  border: 1px solid var(--line); border-radius: 8px; background: #fbfcff; }
.scope-peers label { display: flex; gap: 5px; align-items: center; white-space: nowrap; }
/* 人员清单顶部：建号入口默认折叠，但要一眼看得见（原来藏在表格下面，没人找得到） */
.card-flat { background: none; border: none; box-shadow: none; padding: 0; }
.sum-primary { cursor: pointer; list-style: none; display: flex; flex-wrap: wrap;
  gap: 4px 10px; align-items: baseline; padding: 9px 13px; font-size: 14px;
  color: var(--brand); background: #f2f6ff; border: 1px dashed var(--brand); border-radius: 10px; }
.sum-primary:hover { background: #e8efff; }
.sum-primary::-webkit-details-marker { display: none; }
.sum-primary .small { color: var(--muted); }
details[open] > .sum-primary { border-style: solid; }
/* 说明性文字收进「?」小标：页面只留徽标，正文悬浮（或键盘聚焦、触屏点击）时才出现。
   提示框是 body 下的 fixed 元素，所以放在表格里也不会被 overflow-x:auto 裁掉。 */
.q { display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center;
  width: 15px; height: 15px; margin-left: 3px; border: 1px solid var(--line);
  border-radius: 50%; background: #fff; color: var(--muted);
  font: 700 11px/1 inherit; font-style: normal; vertical-align: 1px; cursor: help; }
.q:hover, .q:focus { outline: none; border-color: var(--brand); color: var(--brand); background: #f2f6ff; }
.q-tip { position: fixed; z-index: 80; max-width: 340px; padding: 8px 11px;
  white-space: pre-line;            /* 模板里 data-tip 换行 = 提示里分行，长说明也能读 */
  font-size: 12.5px; line-height: 1.65; color: var(--ink-2); background: #fff;
  border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 10px 28px rgba(20, 26, 52, .18); }
.q-tip[hidden] { display: none; }

/* 选人弹窗：清单里「从名单里挑人」（可管理的人员 / 额外可见同事）统一用它。
   勾选框真身仍在行内表单（.pick-data 隐藏），弹窗只是临时借过去显示。 */
.pick-data { display: none; }
.pick-modal { position: fixed; inset: 0; z-index: 60; display: flex;
  align-items: center; justify-content: center; padding: 16px; }
.pick-modal[hidden] { display: none; }
.pick-mask { position: absolute; inset: 0; background: rgba(15, 18, 32, .5); }
.pick-box { position: relative; display: flex; flex-direction: column; gap: 10px;
  width: min(470px, 94vw); max-height: 86vh; padding: 14px 16px; background: #fff;
  border-radius: 14px; box-shadow: 0 18px 48px rgba(20, 26, 52, .28); }
.pick-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pick-x { border: none; background: none; cursor: pointer; color: var(--muted); font-size: 15px; }
.pick-list { display: grid; gap: 1px; padding: 6px; overflow-y: auto; min-height: 120px;
  border: 1px solid var(--line); border-radius: 10px; background: #fbfcff;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.pick-list label { display: flex; gap: 5px; align-items: center; padding: 3px 6px;
  font-size: 13px; white-space: nowrap; border-radius: 7px; cursor: pointer; }
.pick-list label:hover { background: #eef4ff; }
.pick-list input[type=checkbox] { width: auto; margin: 0; }
.pick-bar, .pick-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pick-foot { justify-content: space-between; }
.pick-empty { margin: 0; padding: 10px 2px; font-size: 13px; color: var(--muted); text-align: center; }
/* 同一个项目的第 2 条起明细行：项目信息照旧重复，只是底色标成一组，方便对着看 */
.list-tbl tr.row-cont td { background: #fcfcfe; }
.list-tbl tr.row-cont .sticky-l { background: #fcfcfe; }
.list-tbl tr.row-cont td.sticky-l a { color: var(--ink-2); }
.list-tbl td.num { text-align: right; font-variant-numeric: tabular-nums; }
.list-tbl th.num { text-align: right; }

/* ---------------- 管理后台 ---------------- */
.mod-card { display: flex; flex-direction: column; justify-content: space-between; }
.mod-card.off { background: #fafbfd; color: var(--ink-2); }
.field-block { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 16px; }
.sub-title { font-size: 14.5px; margin: 0 0 10px; display: flex; align-items: center; gap: 7px; }
.sub-title::before { content: ""; width: 4px; height: 15px; border-radius: 3px; background: var(--brand); }
.sub-title.project::before { background: var(--c1); }
.sub-title.deal::before { background: var(--c3); }
.add-row { background: #fafbfe; border: 1px dashed var(--line); border-radius: 12px;
  padding: 11px 12px; margin-top: 10px; }
.row-off td { opacity: .55; }
.role-badge.admin { background: #ffe6bf; color: #96490b; }
.badge.st-主管理员 { background: #fff1de; color: #96490b; }
.tbl form { display: contents; }
.tbl input[type=text], .tbl input[type=number], .tbl input[type=password], .tbl select {
  padding: 6px 8px; font-size: 13px; border-radius: 8px; }

/* ---------------- 其他 ---------------- */
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.filters input, .filters select { width: auto; min-width: 130px; }
.section-title { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 8px; background: #f1f3fa; font-size: 12px; color: var(--ink-2); }
.amount-total { font-size: 22px; font-weight: 800; color: var(--st-deal); }
.err-page { text-align: center; padding: 70px 20px; }
.err-page .code { font-size: 68px; font-weight: 900; color: var(--brand); line-height: 1; }
.item-rows input { min-width: 90px; }
/* 系统管理二级导航与推送设置 */
.subnav { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.subnav a {
  display: flex; align-items: center; gap: 9px; padding: 9px 14px; border-radius: 12px;
  background: #fff; border: 1px solid var(--line); color: var(--ink-2); text-decoration: none;
  font-size: 13.5px; transition: .16s;
}
.subnav a i { font-style: normal; font-size: 16px; }
.subnav a div { display: flex; flex-direction: column; line-height: 1.25; }
.subnav a em { font-style: normal; font-size: 11px; color: var(--muted); }
.subnav a:hover { border-color: var(--brand); color: var(--brand); }
.subnav a.on {
  background: linear-gradient(135deg, rgba(91,141,239,.12), rgba(168,85,247,.12));
  border-color: var(--brand); color: var(--brand); font-weight: 700;
}
.subnav a.on em { color: var(--ink-2); }
.tip-row {
  display: flex; align-items: flex-start; gap: 11px; padding: 11px 0;
  border-top: 1px dashed var(--line);
}
.tip-row:first-of-type { border-top: none; }
.tip-row > i { font-style: normal; font-size: 19px; line-height: 1.4; }
.tip-row > div { flex: 1; }
.tip-row b { font-size: 14px; }
.tip-row p { margin: 3px 0 0; }
.pick-list { display: flex; flex-direction: column; gap: 8px; }
.pick {
  display: flex; gap: 10px; align-items: flex-start; padding: 11px 13px; cursor: pointer;
  border: 1px solid var(--line); border-radius: 12px; background: #fafbfe; transition: .16s;
}
.pick input { margin-top: 3px; }
.pick.on { border-color: var(--brand); background: rgba(91,141,239,.07); }
.pick b { font-size: 13.5px; }
.pick p { margin: 2px 0 0; }
.card.off { opacity: .72; background: #fafbfe; }
input.phone-like { border-color: #e57373; background: #fff6f6; }

/* ---------------- 侧栏模块排序 ---------------- */
.nav-sort {
  margin: 2px 0 10px; padding: 7px 10px; width: 100%; text-align: center; cursor: pointer;
  border: 1px dashed rgba(255, 255, 255, .22); border-radius: 10px;
  background: transparent; color: #9fb0dd; font-size: 12.5px; font-family: inherit;
}
.nav-sort:hover { color: #fff; border-color: rgba(255, 255, 255, .45); }
.nav-sort.on { color: #fff; border-style: solid; border-color: var(--brand); background: rgba(91, 141, 239, .2); }
.nav .mv {
  display: none; margin-left: auto; padding: 2px 6px; font-size: 10px; line-height: 1.3;
  color: #cfd8f5; border-radius: 6px; cursor: pointer;
}
.nav .mv + .mv { margin-left: 0; }
.nav .mv:hover { background: rgba(255, 255, 255, .16); color: #fff; }
.nav.sorting a { cursor: grab; border: 1px dashed rgba(255, 255, 255, .2); }
.nav.sorting .mv { display: inline-block; }
.nav a.dragging { opacity: .4; cursor: grabbing; }

/* ---------------- 沟通里的已读标记 ---------------- */
.read-mark { font-size: 11px; color: var(--ink-2); margin-top: 3px; }
.read-mark.ok { color: var(--st-deal); }

/* ---------------- 项目列表列设置 ---------------- */
.colset { margin-bottom: 16px; padding: 14px 18px; }
.colset summary { cursor: pointer; font-weight: 700; font-size: 14.5px; }
.colset-grid {
  display: grid; gap: 4px 12px; margin: 12px 0 2px;
  grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
}
.col-pick {
  display: flex; align-items: center; gap: 7px; font-size: 13.5px;
  padding: 4px 6px; border-radius: 8px; cursor: pointer;
}
.col-pick:hover { background: #f2f5fc; }
.colset .btn-row { margin-top: 10px; }

/* ---------------- 移动端（≤860px：手机、企业微信内置浏览器） ----------------
   侧栏收成抽屉、由顶栏 ☰ 拉出；主内容占满整屏宽；表格横向滚而不是撑破页面。
   原先这里把 .nav a 整个 display:none，手机上只剩两张头像、点不了任何模块。 */
@media (max-width: 860px) {
  html, body { overflow-x: hidden; }

  .m-top {
    display: flex; position: fixed; inset: 0 0 auto 0; height: 52px; z-index: 40;
    align-items: center; gap: 10px; padding: 0 12px; color: #fff;
    background: linear-gradient(165deg, #2b3459 0%, #1f2740 60%, #241f3a 100%);
    box-shadow: 0 2px 10px rgba(20, 28, 58, .28);
  }
  .m-menu {
    width: 40px; height: 40px; flex: 0 0 auto; font-size: 19px; line-height: 1;
    border: 0; border-radius: 11px; background: rgba(255, 255, 255, .15); color: #fff;
  }
  .m-title {
    flex: 1; min-width: 0; font-size: 16px; font-weight: 700;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .m-mask { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(17, 23, 46, .46); }
  .m-mask[hidden] { display: none; }

  .sidebar {
    inset: 0 auto 0 0; width: min(82vw, 296px); padding: 16px 13px; z-index: 60;
    transform: translateX(-100%); transition: transform .26s ease;
    overflow-y: auto; -webkit-overflow-scrolling: touch;
  }
  .sidebar.open { transform: none; box-shadow: 10px 0 34px rgba(12, 17, 38, .45); }
  .nav a { display: flex; font-size: 14px; padding: 12px; min-height: 46px; }
  .nav a i { font-size: 17px; }
  .brand div, .side-foot .who div, .side-foot .btn-ghost { display: block; }
  .side-foot { margin-top: 12px; }

  .main { margin-left: 0; padding: 64px 11px 34px; min-height: 0; }
  .page-head { gap: 10px; margin-bottom: 14px; }
  h1 { font-size: 19px; }
  h2 { font-size: 16px; }
  .card { padding: 14px 13px; min-width: 0; }
  .grid { gap: 12px; }
  .kpis, .kpis.dash { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi .val { font-size: 21px; }
  .cols-2, .cols-3, .rank-pair { grid-template-columns: minmax(0, 1fr); }
  .cols-2 > .card, .rank-pair > .card { margin-bottom: 12px; }

  .filters { gap: 8px; }
  .filters select { flex: 1 1 calc(50% - 4px); width: auto; min-width: 0; }   /* 一行两个，少滚半屏 */
  .filters input { flex: 1 1 100%; width: 100%; min-width: 0; }
  .btn-row { flex-wrap: wrap; }
  .btn-row .btn { flex: 1 1 auto; }

  .tbl-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table.tbl { font-size: 13px; }
  table.tbl th, table.tbl td { padding: 8px 9px; }
  .insights { flex-direction: column; align-items: flex-start; gap: 3px; padding: 11px 13px; }
  .msg .col { max-width: 86%; }
  .q { width: 22px; height: 22px; font-size: 12px; }   /* 「?」小标要指点得动 */
}

@media (max-width: 430px) {
  .kpis, .kpis.dash { grid-template-columns: minmax(0, 1fr); }
  .main { padding: 60px 8px 28px; }
}
