/* ============ 新时代AI销售系统 ============ */
/* Apple 设计语言：SF/PingFang 字体栈、#f5f5f7 底、#0071e3 蓝、大圆角、毛玻璃 */

* { margin:0; padding:0; box-sizing:border-box; -webkit-tap-highlight-color:transparent; }
:root {
  --bg:#f5f5f7; --bg2:#eef0f4; --card:#ffffff; --line:#e8e8ed;
  --ink:#1d1d1f; --ink2:#6e6e73; --ink3:#aeaeb2;
  --blue:#0071e3; --blue-d:#0060c0; --green:#34c759; --orange:#ff9500; --red:#ff3b30; --purple:#af52de;
  --r:18px; --r-s:12px;
  --shadow:0 1px 3px rgba(0,0,0,.05), 0 8px 24px rgba(0,0,0,.06);
  --shadow-lg:0 4px 12px rgba(0,0,0,.08), 0 16px 48px rgba(0,0,0,.12);
  --font:-apple-system,BlinkMacSystemFont,"SF Pro Text","PingFang SC","HarmonyOS Sans SC","Microsoft YaHei",sans-serif;
}
html,body { height:100%; }
body { font-family:var(--font); background:var(--bg); color:var(--ink); font-size:15px; line-height:1.55; overflow:hidden; }
[hidden] { display:none !important; }
button { font-family:var(--font); cursor:pointer; border:none; background:none; color:inherit; font-size:inherit; }
::-webkit-scrollbar { width:8px; height:8px; }
::-webkit-scrollbar-thumb { background:#d2d2d7; border-radius:4px; }
::-webkit-scrollbar-track { background:transparent; }

/* ============ 布局 ============ */
.app { display:flex; height:100dvh; }
.sidebar {
  width:232px; flex:none; background:rgba(255,255,255,.8); backdrop-filter:blur(24px); -webkit-backdrop-filter:blur(24px);
  border-right:1px solid var(--line); display:flex; flex-direction:column; padding:20px 12px 16px; z-index:5;
}
.brand { display:flex; align-items:center; gap:10px; padding:4px 10px 20px; }
.brand-logo {
  width:40px; height:40px; border-radius:12px; background:linear-gradient(135deg,#0a84ff,#0055d4);
  color:#fff; font-weight:700; font-size:19px; display:block; object-fit:cover;
  box-shadow:0 4px 12px rgba(0,113,227,.35);
}
.brand-name { font-weight:700; font-size:16px; letter-spacing:.5px; }
.brand-sub { font-size:9px; color:var(--ink3); letter-spacing:1.5px; }
.nav { flex:1; display:flex; flex-direction:column; gap:2px; }
.nav-item {
  display:flex; align-items:center; gap:10px; padding:10px 12px; border-radius:10px;
  color:var(--ink2); font-weight:500; text-align:left; transition:background .15s,color .15s; font-size:14px;
}
.nav-item:hover { background:rgba(0,0,0,.045); }
.nav-item.active { background:var(--blue); color:#fff; box-shadow:0 2px 8px rgba(0,113,227,.3); }
.nav-ico { width:20px; text-align:center; font-size:15px; }
.sidebar-foot { display:flex; flex-direction:column; gap:2px; border-top:1px solid var(--line); padding-top:10px; }

.main { flex:1; overflow:hidden; position:relative; }
.view { display:none; height:100%; overflow-y:auto; padding:28px 32px 40px; }
.view.active { display:block; animation:fadeUp .3s cubic-bezier(.2,.8,.3,1); }
.view#view-assistant.active { display:flex; padding:0; }
@keyframes fadeUp { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:none; } }

.view-head { display:flex; align-items:flex-end; justify-content:space-between; gap:12px; margin-bottom:20px; flex-wrap:wrap; }
h1 { font-size:26px; font-weight:700; letter-spacing:-.3px; }
.muted { color:var(--ink2); font-size:13.5px; }
.small { font-size:12px; }
.sec-title { font-size:16px; font-weight:700; margin:26px 0 12px; }

/* ============ 通用组件 ============ */
.card { background:var(--card); border-radius:var(--r); box-shadow:var(--shadow); }
.card.pad { padding:22px; }
.btn {
  display:inline-flex; align-items:center; justify-content:center; gap:6px;
  padding:9px 18px; border-radius:11px; background:#fff; border:1px solid var(--line);
  font-weight:600; font-size:14px; color:var(--ink); transition:all .15s; white-space:nowrap;
}
.btn:hover { background:#fafafa; transform:translateY(-1px); }
.btn:active { transform:scale(.97); }
.btn.primary { background:var(--blue); border-color:var(--blue); color:#fff; box-shadow:0 2px 10px rgba(0,113,227,.35); }
.btn.primary:hover { background:var(--blue-d); }
.btn.danger { background:var(--red); border-color:var(--red); color:#fff; }
.btn.ghost { border-color:transparent; background:transparent; }
.btn.small { padding:6px 12px; font-size:13px; border-radius:9px; }
.btn.big { width:100%; padding:14px; font-size:16px; border-radius:14px; margin-top:18px; }
.input {
  width:100%; padding:11px 14px; border:1px solid var(--line); border-radius:11px; font-family:var(--font);
  font-size:14px; background:#fff; color:var(--ink); outline:none; transition:border .15s, box-shadow .15s;
}
.input:focus { border-color:var(--blue); box-shadow:0 0 0 3.5px rgba(0,113,227,.12); }
.input.area { resize:vertical; line-height:1.6; }
.modal-body .input { margin-bottom:10px; }
.row { display:flex; align-items:center; }
.row.gap { gap:10px; flex-wrap:wrap; }
.chip {
  padding:7px 14px; border-radius:999px; background:#fff; border:1px solid var(--line);
  font-size:13px; font-weight:500; color:var(--ink2); transition:all .15s; white-space:nowrap;
}
.chip:hover { border-color:var(--blue); color:var(--blue); }
.empty { padding:36px 20px; text-align:center; color:var(--ink3); font-size:14px; }
.empty.tall { padding:60px 24px; }
.empty p { margin:4px 0; }

/* ============ 工作台 ============ */
.stat-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(140px,1fr)); gap:14px; }
.stat-card {
  background:var(--card); border-radius:var(--r); padding:18px 20px; box-shadow:var(--shadow);
  cursor:pointer; transition:transform .2s cubic-bezier(.2,.8,.3,1), box-shadow .2s;
}
.stat-card:hover { transform:translateY(-3px); box-shadow:var(--shadow-lg); }
.stat-num { font-size:30px; font-weight:700; letter-spacing:-.5px; color:var(--blue); }
.stat-label { font-size:12.5px; color:var(--ink2); margin-top:2px; }
.quick-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(250px,1fr)); gap:14px; }
.quick-card {
  display:flex; gap:14px; align-items:flex-start; background:var(--card); border-radius:var(--r);
  padding:18px; box-shadow:var(--shadow); cursor:pointer; transition:transform .2s cubic-bezier(.2,.8,.3,1), box-shadow .2s;
}
.quick-card:hover { transform:translateY(-3px); box-shadow:var(--shadow-lg); }
.quick-ico {
  width:44px; height:44px; flex:none; border-radius:13px; display:flex; align-items:center; justify-content:center;
  font-size:20px; color:#fff;
}
.quick-ico.blue { background:linear-gradient(135deg,#0a84ff,#0055d4); }
.quick-ico.green { background:linear-gradient(135deg,#30d158,#1fa845); }
.quick-ico.orange { background:linear-gradient(135deg,#ff9f0a,#f07800); }
.quick-ico.purple { background:linear-gradient(135deg,#bf5af2,#8e34c9); }
.quick-body b { display:block; font-size:15px; margin-bottom:3px; }
.quick-body span { font-size:12.5px; color:var(--ink2); }
.recent-item { display:flex; gap:10px; align-items:center; padding:12px 18px; border-bottom:1px solid var(--line); font-size:13.5px; }
.recent-item:last-child { border-bottom:none; }
.recent-item .t { color:var(--ink3); margin-left:auto; font-size:12px; flex:none; }

/* ============ 知识库 ============ */
.upload-zone {
  border:2px dashed #c7c7cc; border-radius:var(--r); padding:36px 20px; text-align:center;
  display:flex; flex-direction:column; gap:6px; align-items:center; cursor:pointer;
  background:rgba(255,255,255,.6); transition:all .2s; margin-bottom:16px;
}
.upload-zone:hover, .upload-zone.drag { border-color:var(--blue); background:rgba(0,113,227,.05); }
.upload-ico { font-size:26px; color:var(--blue); }
.kb-toolbar { display:flex; gap:10px; margin-bottom:8px; }
.kb-list { display:flex; flex-direction:column; gap:10px; }
.kb-item {
  display:flex; align-items:center; gap:14px; background:var(--card); border-radius:var(--r-s);
  padding:14px 18px; box-shadow:var(--shadow);
}
.kb-item .fico { width:38px; height:38px; flex:none; border-radius:10px; background:#eef4ff; color:var(--blue); display:flex; align-items:center; justify-content:center; font-weight:700; font-size:11px; }
.kb-item .fbody { flex:1; min-width:0; }
.kb-item .fname { font-weight:600; font-size:14px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.kb-item .fmeta { font-size:12px; color:var(--ink3); }
.kb-item .ops { display:flex; gap:6px; flex:none; }
.kb-hit { background:var(--card); border-radius:var(--r-s); padding:14px 18px; margin:10px 0; box-shadow:var(--shadow); font-size:13.5px; }
.kb-hit .src { font-size:12px; color:var(--blue); font-weight:600; margin-bottom:4px; }
.doc-pre { white-space:pre-wrap; font-family:var(--font); font-size:13.5px; line-height:1.7; color:var(--ink); max-height:55vh; overflow-y:auto; }

/* ============ 销售助手（分栏） ============ */
.split { display:flex; width:100%; height:100%; }
.split-left { width:280px; flex:none; border-right:1px solid var(--line); background:rgba(255,255,255,.7); display:flex; flex-direction:column; }
.split-left-head { display:flex; align-items:center; justify-content:space-between; padding:16px 14px 10px; }
.split-left-head b { font-size:16px; }
.stage-tabs { display:flex; gap:4px; padding:0 12px 10px; overflow-x:auto; }
.stage-tab { padding:5px 11px; border-radius:999px; font-size:12px; color:var(--ink2); background:rgba(0,0,0,.045); white-space:nowrap; }
.stage-tab.active { background:var(--ink); color:#fff; }
.cus-list { flex:1; overflow-y:auto; padding:4px 10px 20px; }
.cus-item { padding:11px 12px; border-radius:11px; cursor:pointer; transition:background .12s; }
.cus-item:hover { background:rgba(0,0,0,.04); }
.cus-item.active { background:rgba(0,113,227,.1); }
.cus-item .cname { font-weight:600; font-size:14px; display:flex; align-items:center; gap:6px; }
.cus-item .clast { font-size:12px; color:var(--ink3); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; margin-top:1px; }
.badge { font-size:10px; padding:2px 7px; border-radius:999px; font-weight:600; flex:none; }
.badge.lead { background:#f2f2f7; color:var(--ink2); }
.badge.follow { background:#fff3e0; color:#c77400; }
.badge.closing { background:#ffe5e0; color:#d63a2f; }
.badge.won { background:#e2f8e9; color:#1e9e4a; }
.split-right { flex:1; display:flex; flex-direction:column; min-width:0; background:var(--bg); }

.chat-head {
  display:flex; align-items:center; gap:12px; padding:12px 18px;
  background:rgba(245,245,247,.85); backdrop-filter:blur(20px); -webkit-backdrop-filter:blur(20px);
  border-bottom:1px solid var(--line); z-index:3;
}
.chat-head-info { flex:1; min-width:0; display:flex; align-items:center; gap:10px; }
.chat-head-info b { font-size:15px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.stage-sel { border:1px solid var(--line); border-radius:8px; padding:4px 8px; font-size:12px; font-family:var(--font); background:#fff; color:var(--ink); }
.mode-switch { display:flex; background:rgba(0,0,0,.06); border-radius:10px; padding:3px; flex:none; }
.mode-btn { padding:5px 13px; border-radius:8px; font-size:12.5px; font-weight:600; color:var(--ink2); transition:all .15s; }
.mode-btn.active { background:#fff; color:var(--ink); box-shadow:0 1px 4px rgba(0,0,0,.12); }

.chat-body { flex:1; overflow-y:auto; padding:20px 18px; display:flex; flex-direction:column; gap:12px; }
.msg { display:flex; flex-direction:column; max-width:78%; animation:fadeUp .25s cubic-bezier(.2,.8,.3,1); }
.msg.user { align-self:flex-end; align-items:flex-end; }
.msg.ai { align-self:flex-start; align-items:flex-start; }
.bubble {
  padding:11px 15px; border-radius:20px; font-size:14.5px; line-height:1.6; white-space:pre-wrap; word-break:break-word;
}
.msg.user .bubble { background:var(--blue); color:#fff; border-bottom-right-radius:6px; }
.msg.ai .bubble { background:#fff; color:var(--ink); border-bottom-left-radius:6px; box-shadow:var(--shadow); }
.msg .meta { font-size:11px; color:var(--ink3); margin:4px 6px 0; display:flex; gap:8px; align-items:center; }
.copy-link { color:var(--blue); cursor:pointer; font-weight:600; }
.msg.closingReply .bubble { border:1.5px solid var(--green); background:#f2fcf5; }
.closing-tag { font-size:10.5px; font-weight:700; color:var(--green); margin:0 6px 3px; }
.msg.coach { align-self:stretch; max-width:100%; align-items:stretch; margin:2px 0; }
.msg.coach .bubble { background:#fff8ec; border:1.5px solid #ffd591; color:var(--ink); border-radius:14px; box-shadow:0 2px 10px rgba(255,153,0,.12); }
.msg.coach .meta { color:#b06a00; font-weight:600; }
.typing { display:inline-flex; gap:4px; padding:14px 16px; }
.typing i { width:7px; height:7px; border-radius:50%; background:var(--ink3); animation:blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay:.2s; } .typing i:nth-child(3) { animation-delay:.4s; }
@keyframes blink { 0%,60%,100% { opacity:.25; } 30% { opacity:1; } }

.quick-prompts { display:flex; gap:8px; padding:8px 16px 0; overflow-x:auto; }
.chat-input {
  display:flex; align-items:flex-end; gap:10px; padding:10px 16px calc(12px + env(safe-area-inset-bottom));
  background:rgba(245,245,247,.85); backdrop-filter:blur(20px); -webkit-backdrop-filter:blur(20px);
}
.chat-input textarea {
  flex:1; border:1px solid var(--line); border-radius:20px; padding:11px 16px; font-family:var(--font);
  font-size:14.5px; resize:none; outline:none; background:#fff; max-height:132px; line-height:1.5; color:var(--ink);
}
.chat-input textarea:focus { border-color:var(--blue); }
.send-btn {
  width:40px; height:40px; flex:none; border-radius:50%; background:var(--blue); color:#fff; font-size:16px;
  display:flex; align-items:center; justify-content:center; transition:all .15s; box-shadow:0 2px 8px rgba(0,113,227,.4);
}
.send-btn:hover { background:var(--blue-d); }
.send-btn:active { transform:scale(.92); }

/* ============ 对练 ============ */
#view-training .chat-head { border-radius:var(--r) var(--r) 0 0; }
#trainRoom { display:flex; flex-direction:column; height:calc(100dvh - 130px); background:var(--card); border-radius:var(--r); box-shadow:var(--shadow); overflow:hidden; }
#trainRoom .chat-body { background:var(--bg); }

/* ---------- 对练子板块切换 ---------- */
.subtabs { display:flex; gap:10px; margin-bottom:18px; padding:6px; background:var(--card); border-radius:14px; box-shadow:var(--shadow); }
.subtab { flex:1; padding:10px 14px; border-radius:10px; border:none; background:transparent; color:var(--ink2); font-size:13.5px; font-weight:600; cursor:pointer; transition:all .15s; }
.subtab:hover { background:rgba(0,113,227,.06); }
.subtab.active { background:var(--blue); color:#fff; box-shadow:0 2px 8px rgba(0,113,227,.25); }

/* ---------- 销售黄埔军校 ---------- */
#trainAcademy .academy-head { text-align:center; padding:18px 0 8px; }
#trainAcademy .rank-badge { display:inline-flex; align-items:center; gap:10px; padding:10px 22px; border-radius:50px; background:linear-gradient(135deg,#1c1c1e,#434344); color:#ffd60a; font-size:15px; font-weight:800; box-shadow:0 4px 14px rgba(0,0,0,.18); margin-bottom:8px; }
#trainAcademy .rank-badge .star { font-size:20px; }
#trainAcademy .rank-desc { color:var(--ink2); font-size:13px; margin-top:6px; }
#trainAcademy .radar-wrap { display:flex; justify-content:center; padding:10px 0; }
#trainAcademy .radar-wrap svg { max-width:320px; width:100%; height:auto; }
#trainAcademy .subject-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(220px,1fr)); gap:12px; margin-top:18px; }
#trainAcademy .subject-card { background:var(--card); border-radius:var(--r); box-shadow:var(--shadow); padding:16px; border:1.5px solid transparent; transition:all .15s; }
#trainAcademy .subject-card:hover { transform:translateY(-2px); border-color:#b9d7f7; }
#trainAcademy .subject-card.passed { border-color:var(--green); background:#f4fff8; }
#trainAcademy .subject-top { display:flex; align-items:center; justify-content:space-between; margin-bottom:10px; }
#trainAcademy .subject-ico { font-size:24px; }
#trainAcademy .subject-score { font-size:18px; font-weight:800; color:var(--blue); }
#trainAcademy .subject-score.pass { color:var(--green); }
#trainAcademy .subject-name { font-size:14px; font-weight:700; margin-bottom:4px; }
#trainAcademy .subject-desc { font-size:12px; color:var(--ink3); line-height:1.5; margin-bottom:12px; }
#trainAcademy .subject-bar { height:6px; border-radius:3px; background:#eee; overflow:hidden; margin-bottom:12px; }
#trainAcademy .subject-fill { height:100%; border-radius:3px; background:linear-gradient(90deg,#0a84ff,#5ac8fa); }
#trainAcademy .subject-card.passed .subject-fill { background:linear-gradient(90deg,#34c759,#30d158); }
#trainAcademy .subject-card .btn { width:100%; font-size:13px; padding:9px 0; }
#trainAcademy .coach-tip { display:flex; gap:10px; align-items:flex-start; background:#f0f7ff; border:1px solid #cfe5ff; border-radius:12px; padding:12px 14px; margin:14px 0; font-size:13px; color:#1a5fb4; }
#trainAcademy .coach-tip b { flex:none; }
#trainAcademy .academy-foot { text-align:center; color:var(--ink2); font-size:12px; margin-top:18px; line-height:1.7; }
#trainAcademy .subject-card .btn[disabled] { opacity:.45; cursor:not-allowed; }
/* 军校对话（诊断 / 靶向训练） */
#trainAcademy[data-phase="diagnose"], #trainAcademy[data-phase="train"] {
  display:flex; flex-direction:column; height:calc(100dvh - 130px);
  background:var(--card); border-radius:var(--r); box-shadow:var(--shadow); overflow:hidden;
}
#trainAcademy .chat-body { background:var(--bg); }
/* 阶段判定 / 定制方案 */
.ac-stagebox { background:linear-gradient(135deg,#fffaf0,#fff5e6); border:1px solid #ffe0a3; border-radius:12px; padding:14px 16px; margin:14px 0; }
.ac-stage-t { font-size:14px; font-weight:700; color:#8a5a00; margin-bottom:4px; }
.ac-stage-t b { color:#b06a00; }
.ac-stage-d { font-size:13px; color:var(--ink2); line-height:1.65; }
.ac-goal { background:#f0f7ff; border:1px solid #cfe5ff; border-radius:12px; padding:14px 16px; margin:16px 0; font-size:13.5px; line-height:1.7; color:#1a5fb4; }
.ac-goal b { display:block; margin-bottom:4px; font-size:14px; }
.ac-focus { border:1px solid var(--line); border-radius:12px; padding:14px 16px; margin-bottom:12px; background:var(--card); }
.ac-focus-h { display:flex; align-items:center; gap:8px; margin-bottom:6px; flex-wrap:wrap; }
.ac-focus-h b { font-size:14.5px; }
.ac-step { width:22px; height:22px; flex:none; border-radius:50%; background:var(--blue); color:#fff; font-size:12px; font-weight:800; display:flex; align-items:center; justify-content:center; }
.ac-tag { font-size:11.5px; font-weight:700; color:var(--blue); background:rgba(0,113,227,.1); border-radius:20px; padding:2px 10px; }
.ac-focus-why { font-size:13px; color:var(--ink2); line-height:1.65; margin-bottom:8px; }
.ac-task { font-size:13px; color:var(--ink); line-height:1.8; }
.pick-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(150px,1fr)); gap:10px; margin:10px 0 20px; }
.pick {
  padding:13px 14px; border-radius:13px; border:1.5px solid var(--line); background:#fff; text-align:left;
  font-weight:600; font-size:13.5px; transition:all .15s; line-height:1.4;
}
.pick span { display:block; font-weight:400; font-size:11.5px; color:var(--ink3); margin-top:2px; }
.pick:hover { border-color:#b9d7f7; }
.pick.active { border-color:var(--blue); background:rgba(0,113,227,.06); box-shadow:0 0 0 3px rgba(0,113,227,.1); }
.card.pad h3 { font-size:14.5px; margin-top:6px; }

.report-card { background:var(--card); border-radius:var(--r); box-shadow:var(--shadow); padding:26px; margin-bottom:16px; }
.score-hero { text-align:center; padding:10px 0 20px; }
.score-big { font-size:56px; font-weight:800; letter-spacing:-2px; background:linear-gradient(135deg,#0a84ff,#bf5af2); -webkit-background-clip:text; background-clip:text; color:transparent; }
.score-hero .lvl { font-size:15px; font-weight:700; }
.dim-row { display:flex; align-items:center; gap:12px; margin:10px 0; }
.dim-name { width:90px; flex:none; font-size:13px; font-weight:600; }
.dim-bar { flex:1; height:10px; border-radius:5px; background:#eee; overflow:hidden; }
.dim-fill { height:100%; border-radius:5px; background:linear-gradient(90deg,#0a84ff,#5ac8fa); transition:width .8s cubic-bezier(.2,.8,.3,1); }
.dim-val { width:34px; text-align:right; font-weight:700; font-size:13px; flex:none; }
.rp-sec { margin-top:18px; }
.rp-sec h4 { font-size:14.5px; margin-bottom:8px; display:flex; align-items:center; gap:6px; }
.rp-li { padding:9px 13px; background:var(--bg); border-radius:10px; margin-bottom:7px; font-size:13.5px; line-height:1.6; }
.rp-li.good { border-left:3px solid var(--green); }
.rp-li.bad { border-left:3px solid var(--orange); }
.rp-li.gold { border-left:3px solid var(--purple); }
.rp-li .cp { color:var(--blue); font-weight:600; cursor:pointer; font-size:12px; margin-left:6px; white-space:nowrap; }
.intent-badge { display:inline-block; font-size:22px; font-weight:800; padding:4px 18px; border-radius:12px; }
.intent-A { background:#e2f8e9; color:#1e9e4a; } .intent-B { background:#eef4ff; color:var(--blue); }
.intent-C { background:#fff3e0; color:#c77400; } .intent-D { background:#ffe5e0; color:#d63a2f; }
.hist-item { display:flex; align-items:center; gap:12px; background:var(--card); border-radius:var(--r-s); padding:14px 18px; margin-bottom:10px; box-shadow:var(--shadow); cursor:pointer; transition:transform .15s; }
.hist-item:hover { transform:translateY(-2px); }
.hist-item .hscore { font-size:22px; font-weight:800; color:var(--blue); flex:none; width:52px; text-align:center; }
.hist-item .hbody { flex:1; min-width:0; }
.hist-item .htitle { font-weight:600; font-size:14px; }
.hist-item .hmeta { font-size:12px; color:var(--ink3); }

/* ============ 登录前锁定主界面（仅显示登录遮罩）============ */
body.auth-locked #app { display: none !important; }

/* ============ 弹窗 / Toast ============ */
.modal-mask {
  position:fixed; inset:0; background:rgba(0,0,0,.35); backdrop-filter:blur(6px); -webkit-backdrop-filter:blur(6px);
  display:flex; align-items:center; justify-content:center; z-index:100; padding:20px; animation:maskIn .2s;
}
@keyframes maskIn { from { opacity:0; } }
.modal {
  width:100%; max-width:520px; background:var(--card); border-radius:22px; box-shadow:var(--shadow-lg);
  display:flex; flex-direction:column; max-height:86dvh; animation:popIn .3s cubic-bezier(.2,.9,.3,1.2);
}
.modal.small-modal { max-width:400px; }
@keyframes popIn { from { opacity:0; transform:scale(.94) translateY(12px); } }
.modal-head { display:flex; align-items:center; justify-content:space-between; padding:18px 22px 0; font-size:17px; }
.modal-head .x { width:30px; height:30px; border-radius:50%; background:rgba(0,0,0,.06); font-size:13px; color:var(--ink2); }
.modal-body { padding:16px 22px; overflow-y:auto; }
.modal-body h4 { font-size:13px; color:var(--ink2); margin:10px 0 8px; font-weight:600; }
.modal-body.center { text-align:center; }
.modal-foot { padding:0 22px 20px; display:flex; justify-content:flex-end; gap:10px; }
.qr-box { display:flex; justify-content:center; padding:14px; }
.qr-box img, .qr-box canvas { border-radius:14px; box-shadow:var(--shadow); }
.share-url { font-size:12.5px; color:var(--ink2); word-break:break-all; background:var(--bg); border-radius:10px; padding:10px 14px; margin:10px 0 14px; }
.toast {
  position:fixed; left:50%; bottom:90px; transform:translateX(-50%); background:rgba(29,29,31,.92); color:#fff;
  padding:11px 22px; border-radius:999px; font-size:14px; z-index:200; box-shadow:var(--shadow-lg);
  animation:toastIn .3s cubic-bezier(.2,.9,.3,1.2); max-width:80vw; text-align:center;
}
@keyframes toastIn { from { opacity:0; transform:translateX(-50%) translateY(14px); } }

/* ============ 客户 CRM ============ */
.crm-toolbar { display:flex; gap:10px; margin-bottom:16px; flex-wrap:wrap; }
.crm-sel { max-width:160px; }
.crm-list { display:flex; flex-direction:column; gap:10px; }
.crm-card { display:flex; align-items:center; gap:12px; background:var(--card); border-radius:var(--r-s); padding:14px 18px; box-shadow:var(--shadow); }
.crm-main { flex:1; min-width:0; cursor:pointer; }
.crm-top { display:flex; align-items:center; gap:8px; font-size:15px; }
.crm-sub { font-size:12.5px; color:var(--ink2); margin-top:3px; }
.tag-pill { display:inline-block; padding:2px 8px; border-radius:999px; background:#eef4ff; color:var(--blue); font-size:11px; margin-right:4px; }
.crm-todo { font-size:12px; color:var(--orange); margin-top:4px; }
.crm-card > .btn { flex:none; }

/* 批量导入预览 */
.imp-list { max-height:46vh; overflow:auto; display:flex; flex-direction:column; gap:8px; margin:6px 0; }
.imp-row { display:flex; align-items:center; gap:8px; flex-wrap:wrap; padding:8px 10px; background:#f5f7fa; border-radius:10px; font-size:13px; }
.imp-row b { min-width:56px; }

/* 客户 360 弹窗 */
.todo-box { display:flex; flex-direction:column; gap:6px; }
.todo-item { display:flex; align-items:center; gap:8px; background:var(--bg); border-radius:9px; padding:8px 12px; font-size:13.5px; }
.todo-item.done span { text-decoration:line-through; color:var(--ink3); }
.todo-item label { flex:1; display:flex; align-items:center; gap:8px; cursor:pointer; }
.todo-due { font-size:11px; color:var(--ink3); }
.todo-del { color:var(--red); font-size:13px; padding:2px 6px; }

/* ============ 团队驾驶舱 ============ */
.team-grid { display:flex; flex-direction:column; gap:10px; }
.team-card { background:var(--card); border-radius:var(--r); box-shadow:var(--shadow); padding:16px 20px; }
.team-card.wide { grid-column:1 / -1; }
.team-card h3 { font-size:15px; margin-bottom:14px; }
.team-children { display:flex; flex-direction:column; gap:10px; border-left:3px solid var(--blue); margin-left:24px; padding-left:16px; margin-top:6px; }
.team-children .team-card { background:#f8fafc; box-shadow:none; border:1px solid var(--line); }
.team-children .team-children { border-left-color:#34c759; margin-left:20px; }
.rank-item { display:flex; align-items:center; gap:12px; padding:10px 4px; border-bottom:1px solid var(--line); }
.rank-item:last-child { border-bottom:none; }
.rank-no { width:22px; text-align:center; font-weight:800; color:var(--ink3); font-size:15px; flex:none; }
.rank-ava { width:36px; height:36px; border-radius:50%; color:#fff; font-weight:700; display:flex; align-items:center; justify-content:center; flex:none; }
.rank-body { flex:1; min-width:0; display:flex; flex-direction:column; }
.rank-body b { font-size:14px; }
.rank-body .muted { font-size:11.5px; }
.me-tag, .demo-tag { font-size:10px; padding:1px 7px; border-radius:999px; margin-left:6px; font-weight:600; }
.me-tag { background:#eef4ff; color:var(--blue); }
.demo-tag { background:#f2f2f7; color:var(--ink3); }
.rank-score { font-size:18px; font-weight:800; color:var(--blue); flex:none; }
.funnel { display:flex; flex-direction:column; gap:10px; }
.funnel-row { display:flex; align-items:center; gap:12px; }
.funnel-label { width:64px; flex:none; font-size:13px; font-weight:600; }
.funnel-bar { flex:1; height:26px; background:#f0f0f3; border-radius:8px; overflow:hidden; }
.funnel-fill { height:100%; border-radius:8px; background:linear-gradient(90deg,#0a84ff,#5ac8fa); color:#fff; font-weight:700; font-size:12px; display:flex; align-items:center; padding-left:10px; min-width:28px; transition:width .8s cubic-bezier(.2,.8,.3,1); }
.radar { text-align:center; }
.radar-legend { display:flex; justify-content:center; gap:18px; margin-top:6px; font-size:12px; color:var(--ink2); }
.radar-legend i { display:inline-block; width:12px; height:12px; border-radius:3px; margin-right:5px; vertical-align:-1px; }
.team-table { display:flex; flex-direction:column; }
.tt-row { display:flex; align-items:center; gap:8px; padding:10px 4px; border-bottom:1px solid var(--line); font-size:13.5px; }
.tt-row:last-child { border-bottom:none; }
.tt-row > span { flex:1; text-align:left; }
.tt-row.tt-head { font-weight:700; color:var(--ink2); font-size:12px; border-bottom:1.5px solid var(--line); }
.tt-dot { display:inline-block; width:9px; height:9px; border-radius:50%; margin-right:6px; vertical-align:0px; }

/* ============ 黄金话术库 ============ */
.golden-list { display:grid; grid-template-columns:repeat(auto-fill,minmax(320px,1fr)); gap:14px; }
.golden-card { background:var(--card); border-radius:var(--r-s); box-shadow:var(--shadow); padding:16px 18px; display:flex; flex-direction:column; gap:10px; }
.golden-head { display:flex; align-items:center; justify-content:space-between; }
.golden-scene { font-size:11px; padding:2px 9px; border-radius:999px; font-weight:600; }
.scene-破冰 { background:#eef4ff; color:var(--blue); }
.scene-异议 { background:#ffe5e0; color:#d63a2f; }
.scene-报价 { background:#f3e8ff; color:#8e34c9; }
.scene-逼单 { background:#e2f8e9; color:#1e9e4a; }
.scene-跟进 { background:#fff3e0; color:#c77400; }
.scene-其他 { background:#f2f2f7; color:var(--ink2); }
.golden-body { font-size:14px; line-height:1.6; flex:1; }
.golden-ops { display:flex; gap:6px; }

/* ============ AI 内容工厂 ============ */
.fac-item { display:flex; align-items:flex-start; gap:12px; padding:12px 14px; background:var(--bg); border-radius:11px; margin-bottom:9px; }
.fac-idx { width:24px; height:24px; border-radius:50%; background:var(--blue); color:#fff; font-weight:700; font-size:12px; display:flex; align-items:center; justify-content:center; flex:none; }
.fac-text { flex:1; font-size:14px; line-height:1.6; }
.fac-ops { display:flex; flex-direction:column; gap:6px; flex:none; }
.fac-ops .cp { font-size:12px; }

/* ============ 移动端 ============ */
.tabbar { display:none; }
.only-mobile { display:none; }
@media (max-width: 860px) {
  .sidebar { display:none; }
  .only-mobile { display:inline-flex; }
  .tabbar {
    display:flex; position:fixed; left:0; right:0; bottom:0; z-index:50;
    background:rgba(255,255,255,.85); backdrop-filter:blur(24px); -webkit-backdrop-filter:blur(24px);
    border-top:1px solid var(--line); padding:6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .tab { flex:1; display:flex; flex-direction:column; align-items:center; gap:1px; font-size:10.5px; color:var(--ink3); padding:4px 0; font-weight:500; }
  .tab span { font-size:18px; line-height:1.2; }
  .tab.active { color:var(--blue); }
  .view { padding:20px 16px calc(80px + env(safe-area-inset-bottom)); }
  .view#view-assistant.active { padding:0; }
  .split-left { position:absolute; inset:0; width:100%; z-index:4; background:var(--bg); }
  .split-left.hide { display:none; }
  .split-right { padding-bottom:calc(58px + env(safe-area-inset-bottom)); }
  .msg { max-width:88%; }
  h1 { font-size:22px; }
  .mode-switch { transform:scale(.92); transform-origin:right center; }
  #trainRoom { height:calc(100dvh - 190px); }
  .stat-grid { grid-template-columns:repeat(2,1fr); }
  .crm-toolbar { flex-wrap:wrap; }
  .crm-sel { flex:1; min-width:110px; }
  .team-grid { grid-template-columns:1fr; }
  .golden-list { grid-template-columns:1fr; }
  .funnel-label { width:54px; font-size:11px; }
  .radar-legend { font-size:11px; gap:12px; }
}

/* ============ 语音输入 ============ */
.voice-field { position:relative; flex:1; min-width:0; }
.voice-btn {
  position:absolute; right:9px; top:9px; width:32px; height:32px; border-radius:50%;
  border:1px solid var(--line); background:#fff; color:var(--blue);
  display:flex; align-items:center; justify-content:center; cursor:pointer; z-index:6;
  padding:0; transition:.15s; box-shadow:0 1px 4px rgba(0,0,0,.1);
}
.voice-btn:hover { background:#eef4ff; }
.voice-btn svg { width:17px; height:17px; pointer-events:none; }
.voice-btn.listening { background:var(--red); border-color:var(--red); color:#fff; animation:micPulse 1.25s infinite; }
@keyframes micPulse {
  0% { box-shadow:0 0 0 0 rgba(255,59,48,.45); }
  70% { box-shadow:0 0 0 11px rgba(255,59,48,0); }
  100% { box-shadow:0 0 0 0 rgba(255,59,48,0); }
}
.voice-tip {
  position:absolute; right:48px; top:11px; font-size:12px; font-weight:600; color:var(--red);
  background:#fff; border:1px solid var(--line); padding:3px 9px; border-radius:999px;
  box-shadow:0 1px 4px rgba(0,0,0,.1); display:none; z-index:7; white-space:nowrap; pointer-events:none;
}
.voice-btn.listening ~ .voice-tip { display:block; }

/* fix: 语音包裹层接管输入框后，必须让内部 input/textarea 撑满宽度，
   否则裸 textarea（asInput/trainInput 等无 .input 类）会脱离 .chat-input 直接子级导致 flex:1 失效、
   宽度塌陷成窄框，且麦克风按钮绝对定位会盖住输入区，造成“输入框点不进/打不进字”的错觉 */
.voice-field > input, .voice-field > textarea {
  width: 100%;
  display: block;
  box-sizing: border-box;
}
/* 给麦克风按钮留出右侧空间，避免输入的文字被按钮遮挡 */
.voice-field > input, .voice-field > textarea { padding-right: 46px; }
.voice-field > textarea { resize: vertical; }

/* 离线模板标注：AI 生成失败时提示用户，避免与真实 AI 输出混淆 */
.offline-tag { display:inline-block; margin:2px 0 8px; padding:4px 10px; border-radius:999px; background:#fff4e5; color:#b25e09; font-size:12px; font-weight:600; border:1px solid #ffd9a8; }

/* ---- 跟进提醒 ---- */
.reminder-toolbar { margin: 14px 0 10px; }
.reminder-list { display: flex; flex-direction: column; gap: 8px; }
.rem-item { display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; transition: all .2s; }
.rem-item:hover { border-color: #b25e09; }
.rem-item.done { opacity: .55; }
.rem-item.done .rem-text { text-decoration: line-through; }
.rem-item.overdue { border-color: #f5222d; background: #fff1f0; }
.rem-item.overdue .rem-text { color: #cf1322; font-weight: 600; }
.rem-body { flex: 1; min-width: 0; }
.rem-text { font-size: 15px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rem-meta { font-size: 12px; color: #999; margin-top: 2px; }
.rem-check { display: flex; align-items: center; }
.rem-check input { width: 18px; height: 18px; cursor: pointer; }

/* ---- 助手图片上传 ---- */
.img-btn { width: 38px; height: 38px; border: 1px solid #d1d5db; border-radius: 10px; background: #f9fafb; cursor: pointer; font-size: 18px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: all .15s; }
.img-btn:hover { background: #e8f5e9; border-color: #2bb673; }
.msg-img { margin-bottom: 6px; }
.msg-img img { border: 1px solid #e5e7eb; }
.msg-img img:hover { border-color: #b25e09; }

/* ---- 电话话术 ---- */
.callScriptMsg .bubble { max-width: 620px !important; white-space: normal !important; line-height: 1.9; }
.call-script { font-size: 14px; white-space: pre-wrap; word-break: break-word; }
/* 图片上传提示 */
.img-hint { font-size: 11px; color: #b25e09; margin-left: 6px; }

/* ---- 对练答题解析 ---- */
.train-analysis { margin-top: 8px; padding: 10px 12px; border-radius: 8px; font-size: 13px; line-height: 1.6; }
.train-analysis.wrong { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.train-analysis.right { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }
.train-analysis b { display: block; margin-bottom: 2px; font-size: 14px; }

/* ============================================================
   工作台 2.0 —— 今日作战台
   ============================================================ */

/* ---- 本月业绩进度 ---- */
.goal-card {
  background: linear-gradient(135deg, #fff 0%, #fafbff 100%);
  border: 1px solid var(--line); border-radius: var(--r);
  padding: 18px 20px; margin-bottom: 22px; box-shadow: var(--shadow);
}
.goal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.goal-label { font-size: 13px; color: var(--ink2); margin-right: 10px; font-weight: 500; }
.goal-amt { font-size: 26px; font-weight: 700; color: var(--ink); letter-spacing: -.5px; }
.goal-sep { color: var(--ink3); margin: 0 6px; font-size: 18px; }
.goal-target { font-size: 16px; color: var(--ink2); font-weight: 500; }
.goal-bar { height: 10px; background: #eef0f4; border-radius: 5px; overflow: hidden; margin: 14px 0 10px; }
.goal-fill { height: 100%; border-radius: 5px; transition: width .5s cubic-bezier(.4,0,.2,1); }
.goal-fill.low  { background: linear-gradient(90deg, #ff9500, #ffb340); }
.goal-fill.mid  { background: linear-gradient(90deg, #0071e3, #4da3ff); }
.team-self-card { background: linear-gradient(135deg, #fff 0%, #fafbff 100%); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 20px; margin-bottom: 22px; box-shadow: var(--shadow); }
.team-self-head { font-size: 15px; font-weight: 600; color: var(--ink); margin-bottom: 10px; }
.team-self-body { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.team-self-select { min-width: 240px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; font-size: 14px; background: #fff; color: var(--ink); }
.goal-fill.good { background: linear-gradient(90deg, #0071e3, #34c759); }
.goal-fill.done { background: linear-gradient(90deg, #34c759, #30d158); }
.goal-foot { font-size: 13px; color: var(--ink2); }
.goal-foot b { color: var(--ink); font-weight: 600; }

/* ---- 今日作战清单 ---- */
.battle-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 24px; }
.battle-col {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column;
}
.battle-head {
  padding: 12px 16px; font-size: 14px; font-weight: 600;
  display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line);
}
.battle-head span { font-size: 13px; font-weight: 700; min-width: 22px; height: 22px; line-height: 22px;
  text-align: center; border-radius: 11px; padding: 0 7px; }
.battle-head.danger { background: #fff5f5; color: #c0271f; }
.battle-head.danger span { background: #ff3b30; color: #fff; }
.battle-head.warn { background: #fffaf0; color: #a35c00; }
.battle-head.warn span { background: #ff9500; color: #fff; }
.battle-head.info { background: #f0f7ff; color: #0059b3; }
.battle-head.info span { background: #0071e3; color: #fff; }
.battle-body { padding: 8px; max-height: 320px; overflow-y: auto; flex: 1; }
.empty-mini { padding: 22px 12px; text-align: center; color: var(--ink3); font-size: 13px; }

.bt-item {
  padding: 10px 12px; border-radius: 10px; margin-bottom: 6px; cursor: pointer;
  border-left: 3px solid transparent; transition: background .15s, transform .15s;
}
.bt-item:last-child { margin-bottom: 0; }
.bt-item:hover { background: #f5f6f8; transform: translateX(2px); }
.bt-item.danger { border-left-color: #ff3b30; background: #fffafa; }
.bt-item.warn { border-left-color: #ff9500; background: #fffdf7; }
.bt-item.info { border-left-color: #0071e3; background: #fafcff; }
.bt-t { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.bt-t b { font-size: 14px; font-weight: 600; }
.bt-badge {
  font-size: 10px; padding: 1px 7px; border-radius: 8px; font-weight: 600;
  background: #eef0f4; color: var(--ink2); white-space: nowrap;
}
.bt-badge.lead { background: #eef2f7; color: #5a6b80; }
.bt-badge.follow { background: #e6f2ff; color: #0059b3; }
.bt-badge.closing { background: #fff2e0; color: #a35c00; }
.bt-badge.won { background: #e6f9ed; color: #1a7f42; }
.bt-badge.over { background: #ff3b30; color: #fff; }
.bt-s { font-size: 12px; color: var(--ink2); margin-top: 3px; }
.bt-x {
  font-size: 12px; color: #8a5a00; margin-top: 4px; background: #fff8e6;
  padding: 3px 7px; border-radius: 6px; display: inline-block; max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ---- CRM 健康度 ---- */
.health-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; display: inline-block; }
.health-dot.ok { background: #34c759; }
.health-dot.warn { background: #ff9500; box-shadow: 0 0 0 3px rgba(255,149,0,.15); }
.health-dot.danger { background: #ff3b30; box-shadow: 0 0 0 3px rgba(255,59,48,.15); animation: hpulse 2s infinite; }
@keyframes hpulse { 0%,100% { box-shadow: 0 0 0 3px rgba(255,59,48,.15); } 50% { box-shadow: 0 0 0 6px rgba(255,59,48,.06); } }
.health-txt { font-size: 11px; padding: 1px 7px; border-radius: 8px; font-weight: 500; }
.health-txt.ok { color: var(--ink3); }
.health-txt.warn { background: #fff4e0; color: #a35c00; }
.health-txt.danger { background: #ffeceb; color: #c0271f; font-weight: 600; }
.crm-card.h-danger { border-left: 3px solid #ff3b30; }
.crm-card.h-warn { border-left: 3px solid #ff9500; }
.crm-pain { font-size: 12px; color: #0059b3; margin-top: 5px; background: #f0f7ff; padding: 4px 8px; border-radius: 6px; }
.crm-blocker { font-size: 12px; color: #a35c00; margin-top: 4px; background: #fff8e6; padding: 4px 8px; border-radius: 6px; }
.crm-acts { display: flex; flex-direction: column; gap: 6px; flex: none; }

@media (max-width: 900px) {
  .battle-grid { grid-template-columns: 1fr; }
  .goal-amt { font-size: 22px; }
}

/* ===== 管理后台 ===== */
.admin-body { padding: 8px 4px 40px; }
.admin-bar { display: flex; align-items: center; gap: 10px; margin: 6px 0 14px; }
.admin-bar .muted { font-size: 12px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin-table th, .admin-table td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.admin-table th { background: var(--bg2); color: var(--ink3); font-weight: 600; }
.admin-table tbody tr:hover { background: var(--bg2); }
.admin-log { list-style: none; padding: 0; margin: 0; max-height: 320px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
.admin-log li { padding: 7px 12px; border-bottom: 1px solid var(--line); font-size: 13px; display: flex; gap: 8px; flex-wrap: wrap; }
.admin-log li .t { color: var(--ink3); font-size: 11px; white-space: nowrap; }
.admin-log .badge { background: var(--bg2); color: var(--ink2); border-radius: 6px; padding: 1px 7px; font-size: 11px; }
.admin-log .badge.err { background: #ffeceb; color: #c0271f; }
.admin-chat { border: 1px solid var(--line); border-radius: 10px; margin: 8px 0; padding: 8px 10px; background: #fff; }
.admin-chat .ch-head { font-size: 12px; color: var(--ink3); font-weight: 600; margin-bottom: 6px; }
.ch-msg { padding: 5px 0; font-size: 13px; line-height: 1.5; border-bottom: 1px dashed var(--line); }
.ch-msg .who { display: inline-block; min-width: 38px; font-weight: 700; color: var(--blue); margin-right: 8px; }
.ch-msg.ai .who, .ch-msg.coach .who { color: #ff9500; }
.ch-msg.client .who { color: #34c759; }
.admin-pre { white-space: pre-wrap; word-break: break-word; font-size: 12px; line-height: 1.5; margin: 4px 0; max-height: 300px; overflow: auto; background: var(--bg2); padding: 8px; border-radius: 8px; }
.admin-body h4 { margin: 18px 0 6px; font-size: 14px; }
.btn.ghost { background: transparent; border: 1px solid var(--line); color: var(--ink2); }

/* ===== 驾驶舱（个人 / 团队） ===== */
.cockpit { padding: 4px 2px 40px; }
.cockpit-head { display: flex; align-items: center; gap: 12px; margin: 4px 0 16px; flex-wrap: wrap; }
.cockpit-head h3 { margin: 0; font-size: 18px; }
.cockpit-head .muted { font-size: 13px; }
.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.kpi-v { font-size: 26px; font-weight: 700; color: var(--ink1, #1d1d1f); line-height: 1.1; }
.kpi-l { font-size: 13px; color: var(--ink2); margin-top: 4px; }
.kpi-s { font-size: 11px; color: var(--ink3); margin-top: 2px; }
.kpi.green .kpi-v { color: #34a853; } .kpi.blue .kpi-v { color: #1a73e8; } .kpi.amber .kpi-v { color: #f59e0b; }
.cockpit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 16px; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.panel-h { font-size: 14px; font-weight: 600; margin-bottom: 10px; color: var(--ink2); }
.rank-item { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--line); }
.rank-no { width: 24px; text-align: center; font-weight: 700; color: var(--ink3); }
.rank-ava { width: 36px; height: 36px; border-radius: 50%; background: #0071e3; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.rank-body { flex: 1; }
.rank-body b { font-size: 14px; }
.rank-body .muted { display: block; font-size: 12px; margin-top: 2px; }
.rank-score { font-weight: 700; color: #0071e3; font-size: 15px; }
.me-tag, .demo-tag { font-size: 11px; background: #e7f0ff; color: #0071e3; border-radius: 6px; padding: 1px 6px; margin-left: 6px; }
.act-line { padding: 7px 4px; border-bottom: 1px solid var(--line); font-size: 13px; display: flex; gap: 8px; }
.act-line .t { color: var(--ink3); font-size: 11px; white-space: nowrap; }
.bars { margin-top: 6px; }
.bc-l { font-size: 12px; fill: var(--ink2); }
.bc-v { font-size: 12px; fill: var(--ink1, #1d1d1f); font-weight: 600; }
.empty, .loading { padding: 24px; text-align: center; color: var(--ink3); font-size: 13px; }
.muted.small { font-size: 12px; }
@media (max-width: 900px) { .cockpit-grid { grid-template-columns: 1fr; } }

/* ===== 管理后台四标签页 + 权限/团队升级样式 ===== */
.admin-tabs { display:flex; gap:8px; margin:6px 0 14px; flex-wrap:wrap; }
.atab { border:1px solid var(--line); background:var(--bg2); color:var(--ink2); border-radius:10px; padding:8px 16px; font-size:14px; cursor:pointer; }
.atab.active { background:var(--blue); color:#fff; border-color:var(--blue); }
.me-tag.admin { background:#ffeceb; color:#c0271f; }
.me-tag.mgr { background:#fff4e0; color:#b76e00; }
.pill { display:inline-block; font-size:11px; padding:1px 8px; border-radius:999px; background:var(--bg2); color:var(--ink2); margin-left:4px; }
.pill.ok { background:#e8f7ee; color:#1a8a4a; }
.pill.bad { background:#ffeceb; color:#c0271f; }
.admin-table td.ops { white-space:nowrap; }
.admin-table .btn.small { margin-right:4px; }
.team-head { display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-bottom:10px; }
.team-head b { font-size:15px; }
.team-ops { margin-left:auto; display:flex; gap:6px; }
.team-members { display:flex; flex-wrap:wrap; gap:6px; margin-bottom:10px; min-height:24px; }
.mem-chip { display:inline-flex; align-items:center; gap:4px; background:var(--bg2); border-radius:999px; padding:3px 10px; font-size:12px; }
.mem-chip .x { border:none; background:transparent; color:var(--ink3); cursor:pointer; font-size:14px; line-height:1; }
.team-add { display:flex; gap:8px; align-items:center; }
.team-add select { flex:1; padding:7px 8px; border:1px solid var(--line); border-radius:8px; }
.team-children { border-left:2px dashed var(--line); margin-left:12px; padding-left:12px; margin-top:10px; }
.team-grid > .team-children { border-left:none; margin-left:0; padding-left:0; }
.team-card { margin-top:10px; }
.team-grid > .team-card:first-child { margin-top:0; }
.modal-body .form-row { display:flex; align-items:center; gap:12px; margin:12px 0; }
.modal-body .form-row > label { width:84px; flex:none; color:var(--ink2); font-size:13px; }
.modal-body .form-row > input, .modal-body .form-row > select { flex:1; padding:9px 10px; border:1px solid var(--line); border-radius:9px; font-size:14px; }
.modal-body .form-row.check { align-items:flex-start; }
.modal-body .form-row.check label { width:auto; display:flex; align-items:center; gap:8px; cursor:pointer; }
.admin-log li.admin-act { border-left:3px solid var(--blue); padding-left:10px; background:rgba(0,113,227,.04); }
.badge.admin { background:var(--blue); color:#fff; }
.perm-result { color:var(--green); font-size:13px; margin-top:8px; }

/* ===== 黄金话术库升级（成熟度 / 标签 / 贡献人 / 危险操作） ===== */
.golden-head { display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin-bottom:8px; }
.golden-mat { font-size:11px; padding:1px 9px; border-radius:999px; font-weight:600; }
.golden-mat.maturity-ok { background:#e8f7ee; color:#1a8a4a; }
.golden-mat.maturity-mid { background:#fff4e0; color:#b76e00; }
.golden-tags { margin-top:8px; display:flex; flex-wrap:wrap; gap:6px; }
.gtag { font-size:11px; background:var(--bg2); color:var(--ink2); border-radius:999px; padding:2px 9px; }
.golden-ops .btn.danger { color:#c0271f; border-color:#f3c2bf; }
.golden-ops .btn.danger:hover { background:#ffeceb; }
/* ===== 团队价市场（业绩与提成看板） ===== */
.market-summary { display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:12px; margin-bottom:16px; }
.market-kpi { background:var(--card); border:1px solid var(--line); border-radius:14px; padding:14px 16px; }
.market-kpi .mk-num { font-size:24px; font-weight:700; color:var(--ink); }
.market-kpi .mk-num.green { color:var(--green); }
.market-kpi .mk-label { font-size:12px; color:var(--ink3); margin-top:2px; }
.tier-table { width:100%; border-collapse:collapse; margin:8px 0 4px; }
.tier-table th, .tier-table td { border:1px solid var(--line); padding:8px 10px; font-size:13px; text-align:center; }
.tier-table th { background:var(--bg2); color:var(--ink2); font-weight:600; }
.tier-rate { color:var(--green); font-weight:700; }
.lb-table { width:100%; border-collapse:collapse; }
.lb-table th, .lb-table td { border-bottom:1px solid var(--line); padding:10px 10px; font-size:14px; text-align:left; }
.lb-table th { color:var(--ink3); font-size:12px; font-weight:600; }
.lb-rank { width:34px; height:34px; border-radius:50%; display:inline-flex; align-items:center; justify-content:center; font-weight:700; background:var(--bg2); color:var(--ink2); }
.lb-rank.r1 { background:#ffd700; color:#7a5b00; }
.lb-rank.r2 { background:#cfd8e3; color:#3a4756; }
.lb-rank.r3 { background:#e7b48a; color:#6b3a14; }
.lb-commission { color:var(--green); font-weight:700; }
.me-commission { background:linear-gradient(135deg,#e8f7ee,#eef6ff); border:1px solid #cfe9d8; }

/* ============ 移动端增强：底部栏 + 管理后台窄屏适配 ============ */
@media (max-width: 860px) {
  /* 底部标签栏：权限越多标签越多，允许横向滚动而非挤压变形 */
  .tabbar {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    justify-content: flex-start;
    scrollbar-width: none;
  }
  .tabbar::-webkit-scrollbar { display: none; }
  .tabbar .tab { flex: 0 0 auto; min-width: 58px; }

  /* 管理后台成员表 → 卡片式堆叠，每行带字段标签，便于手机查看每位用户的使用状态 */
  .admin-body .table-wrap { border: none; }
  .admin-body .admin-table,
  .admin-body .admin-table thead,
  .admin-body .admin-table tbody,
  .admin-body .admin-table tr,
  .admin-body .admin-table td { display: block; width: 100%; box-sizing: border-box; }
  .admin-body .admin-table thead { display: none; }
  .admin-body .admin-table tr {
    border: 1px solid var(--line);
    border-radius: 12px;
    margin-bottom: 10px;
    padding: 4px 12px;
    background: #fff;
  }
  .admin-body .admin-table td {
    border: none;
    padding: 7px 0;
    white-space: normal;
    text-align: right;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
  }
  .admin-body .admin-table td::before {
    content: attr(data-label);
    color: var(--ink3);
    font-size: 12px;
    font-weight: 600;
    text-align: left;
    flex: none;
  }
  .admin-body .admin-table td.ops { justify-content: flex-start; }
  .admin-body .admin-table td.ops::before { display: none; }
  .admin-body .admin-log { max-height: 280px; }
}
