/* ============ 力源时代获客系统 · 现代化样式 ============ */
:root {
  --bg:#f3f5f7; --surface:#ffffff; --accent:#00a884; --accent-2:#008f72; --accent-soft:#e7f6f1;
  --text:#16232b; --muted:#6b7a85; --line:#e7ebee; --chat-bg:#eef2f4;
  --bubble-out:#d9fdd3; --danger:#e5484d; --shadow:0 1px 3px rgba(16,35,47,.08),0 1px 2px rgba(16,35,47,.04);
  --radius:14px;
}
* { margin:0; padding:0; box-sizing:border-box; font-family:"Segoe UI","Microsoft YaHei","PingFang SC",system-ui,sans-serif; -webkit-tap-highlight-color:transparent; }
html,body { height:100%; }
body { display:flex; height:100vh; background:var(--bg); color:var(--text); overflow:hidden; font-size:14px; }
button { cursor:pointer; border:none; background:none; font-size:13px; color:inherit; }
input,select,textarea { font-size:13px; color:var(--text); outline:none; }

/* ---------- 顶栏 ---------- */
.topbar { position:fixed; top:0; left:0; right:0; height:52px; background:var(--surface); border-bottom:1px solid var(--line);
  display:flex; align-items:center; gap:12px; padding:0 16px; z-index:50; }
.topbar .logo { display:flex; align-items:center; gap:10px; min-width:0; }
.topbar .logo .mark { width:30px; height:30px; border-radius:9px; background:linear-gradient(135deg,var(--accent),var(--accent-2));
  color:#fff; display:flex; align-items:center; justify-content:center; font-weight:700; font-size:15px; flex:none; }
.topbar .logo .tt { line-height:1.15; min-width:0; }
.topbar .logo .tt b { font-size:14px; display:block; white-space:nowrap; }
.topbar .logo .tt i { font-style:normal; font-size:10px; color:var(--muted); letter-spacing:.5px; display:block; white-space:nowrap; }
.topbar .spacer { flex:1; }
.tbtn { display:inline-flex; align-items:center; gap:6px; padding:7px 12px; border-radius:9px; color:var(--muted); font-size:13px; }
.tbtn:hover { background:var(--bg); color:var(--text); }
.tbtn.primary { background:var(--accent); color:#fff; font-weight:600; }
.tbtn.primary:hover { background:var(--accent-2); }

/* ---------- 联系人侧栏 ---------- */
.sidebar { width:290px; margin-top:52px; background:var(--surface); border-right:1px solid var(--line); display:flex; flex-direction:column; }
.sidebar .search { padding:12px; }
.sidebar .search input { width:100%; padding:9px 12px; border:1px solid var(--line); border-radius:10px; background:var(--bg); }
.sidebar .search input:focus { border-color:var(--accent); background:#fff; }
.contacts { flex:1; overflow-y:auto; }
.contact { display:flex; gap:12px; padding:12px 14px; cursor:pointer; align-items:center; border-radius:0; transition:background .12s; }
.contact:hover { background:var(--bg); }
.contact.active { background:var(--accent-soft); }
.avatar { width:42px; height:42px; border-radius:50%; background:linear-gradient(135deg,var(--accent),var(--accent-2)); color:#fff;
  display:flex; align-items:center; justify-content:center; font-size:16px; flex:none; font-weight:600; }
.cinfo { flex:1; min-width:0; }
.cinfo .name { font-size:14px; font-weight:600; display:flex; align-items:center; gap:6px; }
.cinfo .name .ind { font-size:10px; background:#ffb020; color:#fff; border-radius:5px; padding:1px 5px; font-weight:500; }
.cinfo .last { font-size:12px; color:var(--muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; margin-top:3px; }
.addbtn { margin:12px; padding:10px; background:var(--accent); color:#fff; border-radius:10px; font-size:13px; font-weight:600; }
.addbtn:hover { background:var(--accent-2); }

/* ---------- 聊天 ---------- */
.chat { flex:1; margin-top:52px; display:flex; flex-direction:column; min-width:0; }
.chat-head { background:var(--surface); padding:10px 16px; border-bottom:1px solid var(--line); display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.chat-head .nm { font-weight:600; }
.chip { font-size:11px; background:var(--bg); border-radius:6px; padding:3px 8px; color:var(--muted); }
.chip.acc { background:var(--accent-soft); color:var(--accent-2); }
.backbtn { display:none; background:var(--bg); border-radius:8px; padding:6px 10px; font-size:13px; }
.messages { flex:1; overflow-y:auto; padding:18px; display:flex; flex-direction:column; gap:10px; background:var(--chat-bg); }
.msg { max-width:72%; padding:9px 13px; font-size:14px; line-height:1.55; box-shadow:var(--shadow); word-break:break-word; }
.msg.in { background:#fff; border-radius:4px 14px 14px 14px; align-self:flex-start; }
.msg.out { background:var(--bubble-out); border-radius:14px 4px 14px 14px; align-self:flex-end; }
.msg .tr { display:block; color:var(--accent-2); font-size:13px; margin-top:6px; padding-top:6px; border-top:1px dashed #b7ded0; }
.msg .eng { display:inline-block; font-size:10px; background:var(--accent); color:#fff; border-radius:5px; padding:0 5px; margin-left:6px; vertical-align:middle; }
.msg .t { display:block; font-size:10px; color:#9aa8b0; margin-top:4px; text-align:right; }

/* ---------- 输入区 ---------- */
.composer { background:var(--surface); padding:12px 14px; border-top:1px solid var(--line); }
.composer textarea { width:100%; height:66px; border:1px solid var(--line); border-radius:12px; padding:10px 12px; resize:none; font-size:14px; background:var(--bg); }
.composer textarea:focus { border-color:var(--accent); background:#fff; }
.quick { display:flex; gap:8px; margin-bottom:8px; flex-wrap:wrap; }
.quick span { font-size:12px; background:var(--accent-soft); color:var(--accent-2); border-radius:999px; padding:4px 12px; cursor:pointer; white-space:nowrap; }
.tools { display:flex; gap:8px; margin-top:9px; align-items:center; flex-wrap:wrap; }
.btn { padding:8px 14px; border-radius:9px; background:var(--bg); color:var(--text); font-size:13px; }
.btn:hover { background:var(--line); }
.btn.primary { background:var(--accent); color:#fff; font-weight:600; }
.btn.primary:hover { background:var(--accent-2); }
.btn.danger { color:var(--danger); }
.hint { font-size:11px; color:var(--muted); }

/* ---------- 右侧面板 ---------- */
.panel { width:350px; margin-top:52px; background:var(--surface); border-left:1px solid var(--line); overflow-y:auto; }
.panel .tabs { display:flex; gap:4px; padding:10px 12px; position:sticky; top:0; background:var(--surface); z-index:5; border-bottom:1px solid var(--line); }
.panel .tabs div { flex:1; text-align:center; padding:8px 0; font-size:13px; cursor:pointer; color:var(--muted); border-radius:9px; }
.panel .tabs div.on { background:var(--accent-soft); color:var(--accent-2); font-weight:600; }
.card { margin:12px; border-radius:var(--radius); padding:14px; background:var(--surface); box-shadow:var(--shadow); }
.card.hero { background:linear-gradient(135deg,var(--accent-soft),#fff); border:1px solid #cdeee3; }
.card h4 { font-size:13px; margin-bottom:10px; display:flex; align-items:center; justify-content:space-between; }
.card h4 .lock { font-size:10px; color:var(--muted); font-weight:400; }
.row { display:flex; align-items:center; justify-content:space-between; margin:9px 0; font-size:13px; gap:8px; }
.row.col { flex-direction:column; align-items:stretch; gap:5px; }
.row select, .row input[type=text], .row input[type=password] { padding:7px 9px; border:1px solid var(--line); border-radius:8px; font-size:12px; width:158px; min-width:0; background:#fff; }
.row select:focus, .row input:focus { border-color:var(--accent); }
.switch { position:relative; width:40px; height:22px; background:#d3dce1; border-radius:999px; transition:.18s; flex:none; cursor:pointer; }
.switch::after { content:''; position:absolute; top:2px; left:2px; width:18px; height:18px; background:#fff; border-radius:50%; transition:.18s; box-shadow:0 1px 2px rgba(0,0,0,.2); }
.switch.on { background:var(--accent); }
.switch.on::after { left:20px; }
.note { font-size:11.5px; color:var(--muted); line-height:1.65; }
.note b { color:var(--accent-2); }
.krow { display:flex; justify-content:space-between; align-items:center; margin:7px 0 0; font-size:12px; }
kbd { background:var(--bg); border:1px solid var(--line); border-bottom-width:2px; border-radius:6px; padding:1px 7px; font-size:11px; }
.savebtn { display:block; margin:6px 12px 24px; width:calc(100% - 24px); padding:10px; background:var(--accent); color:#fff; border-radius:10px; font-size:13px; font-weight:600; }
.savebtn:hover { background:var(--accent-2); }
.disabled { opacity:.4; pointer-events:none; }
.engcard { border-left:3px solid var(--accent); }
.badge-ok { background:var(--accent-soft); color:var(--accent-2); border-radius:6px; padding:2px 8px; font-size:11px; }
.badge-no { background:#fdecec; color:var(--danger); border-radius:6px; padding:2px 8px; font-size:11px; }

/* ---------- 弹窗 / 遮罩 ---------- */
.modal-bg { position:fixed; inset:0; background:rgba(15,35,43,.4); display:none; align-items:center; justify-content:center; z-index:100; backdrop-filter:blur(2px); }
.modal { background:var(--surface); border-radius:16px; padding:24px; width:min(400px,92vw); box-shadow:0 20px 60px rgba(0,0,0,.2); }
.modal h3 { margin-bottom:14px; font-size:16px; }
.modal label { display:block; font-size:12px; color:var(--muted); margin:12px 0 5px; }
.modal input, .modal select { width:100%; padding:10px 12px; border:1px solid var(--line); border-radius:10px; font-size:14px; }
.modal input:focus { border-color:var(--accent); }
.modal .btns { display:flex; gap:10px; margin-top:20px; justify-content:flex-end; }

/* 软件锁遮罩 */
.lockbg { position:fixed; inset:0; z-index:300; display:none; align-items:center; justify-content:center; }
.lockbg.frost { background:rgba(243,245,247,.6); backdrop-filter:blur(22px) saturate(1.2); }
.lockbg.opaque { background:var(--bg); }
.lockbg .box { background:var(--surface); border-radius:18px; padding:34px 30px; width:min(340px,90vw); text-align:center; box-shadow:0 24px 70px rgba(0,0,0,.18); }
.lockbg .ic { font-size:38px; }
.lockbg h3 { margin:10px 0 4px; font-size:16px; }
.lockbg .sub { font-size:12px; color:var(--muted); margin-bottom:16px; }
.lockbg input { width:100%; padding:11px; border:1px solid var(--line); border-radius:10px; text-align:center; font-size:18px; letter-spacing:6px; }
.lockbg .err { color:var(--danger); font-size:12px; margin-top:8px; min-height:16px; }
.lockbg button { width:100%; margin-top:12px; padding:11px; border-radius:10px; background:var(--accent); color:#fff; font-size:14px; font-weight:600; }
.lockbg button:hover { background:var(--accent-2); }

/* 授权激活遮罩 */
.licbg { position:fixed; inset:0; z-index:400; background:linear-gradient(160deg,#04443a,#00a884 130%); display:none; align-items:center; justify-content:center; }
.licbg .box { background:var(--surface); border-radius:20px; padding:36px 30px; width:min(420px,92vw); text-align:center; box-shadow:0 30px 90px rgba(0,0,0,.35); }
.licbg .mark { width:56px; height:56px; border-radius:16px; background:linear-gradient(135deg,var(--accent),var(--accent-2)); color:#fff; font-size:26px; font-weight:700; display:flex; align-items:center; justify-content:center; margin:0 auto 14px; }
.licbg h2 { font-size:18px; }
.licbg .en { font-size:11px; color:var(--muted); letter-spacing:1px; margin:4px 0 20px; }
.licbg input { width:100%; padding:12px; border:1px solid var(--line); border-radius:10px; text-align:center; font-size:15px; letter-spacing:1px; }
.licbg .err { color:var(--danger); font-size:12px; margin-top:10px; min-height:16px; }
.licbg button { width:100%; margin-top:14px; padding:12px; border-radius:10px; background:var(--accent); color:#fff; font-size:14px; font-weight:600; }
.licbg button:disabled { opacity:.6; }
.licbg .sub { font-size:11px; color:var(--muted); margin-top:16px; line-height:1.7; }

/* 手机端底部导航 */
.mobile-tabbar { display:none; }

/* ---------- 手机端(安卓/iOS 浏览器) ---------- */
@media (max-width: 768px) {
  body { flex-direction:column; }
  .topbar { padding:0 10px; gap:6px; height:50px; }
  .topbar .hidesm { display:none; }
  .topbar .logo .tt b { font-size:13px; }
  .sidebar, .chat, .panel { width:100%; margin-top:50px; margin-bottom:54px; border:none; }
  .mobile-tabbar { display:flex; position:fixed; bottom:0; left:0; right:0; height:54px; background:var(--surface); border-top:1px solid var(--line); z-index:60; padding:4px 8px calc(4px + env(safe-area-inset-bottom)); }
  .mobile-tabbar div { flex:1; display:flex; flex-direction:column; align-items:center; justify-content:center; font-size:10.5px; color:var(--muted); gap:2px; border-radius:10px; }
  .mobile-tabbar div.on { color:var(--accent-2); font-weight:600; background:var(--accent-soft); }
  .mobile-tabbar .ic { font-size:19px; }
  .view { display:none !important; }
  .sidebar.view.on { display:flex !important; }
  .chat.view.on { display:flex !important; }
  .panel.view.on { display:block !important; }
  .backbtn { display:inline-block; }
  .msg { max-width:88%; }
  .panel { position:fixed; top:50px; bottom:54px; left:0; right:0; overflow-y:auto; background:var(--surface); }
  .row select, .row input[type=text], .row input[type=password] { width:46vw; }
  .tools { gap:6px; }
  .btn { padding:8px 10px; }
}
