/* ============ 支行管理平台样式 ============ */
:root {
  --primary: #2563eb;
  --primary-dark: #1e40af;
  --primary-light: #dbeafe;
  --sidebar-bg: #0f2647;
  --sidebar-bg2: #16345e;
  --bg: #f1f5f9;
  --card: #ffffff;
  --border: #e2e8f0;
  --text: #1e293b;
  --text2: #64748b;
  --text3: #94a3b8;
  --green: #16a34a;
  --green-bg: #dcfce7;
  --orange: #d97706;
  --orange-bg: #fef3c7;
  --red: #dc2626;
  --red-bg: #fee2e2;
  --blue-bg: #dbeafe;
  --purple: #7c3aed;
  --purple-bg: #ede9fe;
  --gray-bg: #f1f5f9;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(15, 23, 42, .08);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg); color: var(--text); font-size: 14px;
}
#app { display: flex; height: 100vh; overflow: hidden; }

/* ---------- 侧边栏 ---------- */
.sidebar {
  width: 232px; flex-shrink: 0; display: flex; flex-direction: column;
  background: linear-gradient(180deg, var(--sidebar-bg), var(--sidebar-bg2)); color: #cbd5e1;
}
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 18px 16px 14px; }
.brand-logo { width: 38px; height: 38px; border-radius: 10px; background: rgba(255,255,255,.12); display: flex; align-items: center; justify-content: center; font-size: 20px; }
.brand-name { color: #fff; font-size: 15px; font-weight: 700; letter-spacing: .5px; }
.brand-sub { font-size: 10px; color: #7d93b8; letter-spacing: 1px; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 6px 10px 16px; }
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 2px; }
.nav-group { margin-top: 14px; }
.nav-group-title { font-size: 11px; color: #6b81a6; padding: 0 10px 6px; letter-spacing: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px;
  color: #b9c6da; cursor: pointer; margin-bottom: 2px; transition: all .15s; font-size: 13.5px;
}
.nav-item:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-item.active { background: var(--primary); color: #fff; font-weight: 600; box-shadow: 0 2px 8px rgba(37,99,235,.45); }
.nav-icon { width: 18px; text-align: center; font-size: 15px; }
.sidebar-foot { padding: 14px 16px; font-size: 11px; color: #5d7399; border-top: 1px solid rgba(255,255,255,.08); }

/* ---------- 主区域 ---------- */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 54px; background: #fff; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; padding: 0 22px; flex-shrink: 0;
}
.crumb { font-size: 15px; font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.user-label { color: var(--text3); font-size: 12px; }
.user-select {
  border: 1px solid var(--border); border-radius: 8px; padding: 5px 10px; font-size: 13px;
  background: #f8fafc; color: var(--text); cursor: pointer; outline: none; font-weight: 600;
}
.page { flex: 1; overflow-y: auto; padding: 20px 22px 40px; }

/* ---------- 通用卡片/布局 ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 16px; gap: 14px; flex-wrap: wrap; }
.page-title { font-size: 18px; font-weight: 700; }
.page-desc { color: var(--text3); font-size: 12.5px; margin-top: 4px; }
.head-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* 统计卡 */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; display: flex; gap: 14px; align-items: center; }
.stat-icon { width: 44px; height: 44px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0; }
.stat-val { font-size: 22px; font-weight: 800; line-height: 1.15; }
.stat-name { color: var(--text3); font-size: 12px; margin-top: 2px; }
.stat-sub { font-size: 11px; color: var(--text3); margin-top: 1px; }

/* 两栏布局 */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3-2 { display: grid; grid-template-columns: 3fr 2fr; gap: 16px; }
@media (max-width: 1100px) { .grid-2, .grid-3-2 { grid-template-columns: 1fr; } }

/* ---------- 工具条 ---------- */
.toolbar { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; align-items: center; }
.search-box { position: relative; flex: 1; min-width: 200px; max-width: 340px; }
.search-box input {
  width: 100%; padding: 8px 12px 8px 32px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 13px; outline: none; background: #fff; transition: border .15s;
}
.search-box input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.search-box::before { content: "🔍"; position: absolute; left: 9px; top: 50%; transform: translateY(-50%); font-size: 12px; opacity: .5; }
.toolbar select {
  padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px;
  background: #fff; outline: none; cursor: pointer; color: var(--text);
}
.toolbar select:focus { border-color: var(--primary); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 5px; border: none; border-radius: 8px; cursor: pointer;
  padding: 8px 14px; font-size: 13px; font-weight: 600; transition: all .15s; white-space: nowrap;
  background: var(--gray-bg); color: var(--text);
}
.btn:hover { filter: brightness(.97); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); filter: none; }
.btn-danger { background: #fff; color: var(--red); border: 1px solid #fecaca; }
.btn-danger:hover { background: var(--red-bg); }
.btn-success { background: var(--green); color: #fff; }
.btn-sm { padding: 4px 9px; font-size: 12px; border-radius: 6px; }
.btn-ghost { background: #fff; border: 1px solid var(--border); color: var(--text2); }
.btn-ghost:hover { color: var(--primary); border-color: var(--primary); }

/* ---------- 表格 ---------- */
.table-wrap { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); overflow: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 700px; }
table.data th {
  text-align: left; padding: 11px 14px; background: #f8fafc; color: var(--text2);
  font-weight: 600; border-bottom: 1px solid var(--border); white-space: nowrap; font-size: 12.5px;
}
table.data td { padding: 11px 14px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
table.data tbody tr:hover { background: #f8fbff; }
table.data tbody tr:last-child td { border-bottom: none; }
.td-actions { white-space: nowrap; display: flex; gap: 6px; }
.link { color: var(--primary); cursor: pointer; font-weight: 600; }
.link:hover { text-decoration: underline; }
.muted { color: var(--text3); }
.strong { font-weight: 700; }
.empty-tip { text-align: center; color: var(--text3); padding: 44px 0 40px; }
.empty-tip .icon { font-size: 34px; display: block; margin-bottom: 10px; opacity: .45; }

/* 徽章 */
.badge {
  display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 12px; font-weight: 600; line-height: 1.7;
  white-space: nowrap;
}
.badge.green { background: var(--green-bg); color: var(--green); }
.badge.orange { background: var(--orange-bg); color: var(--orange); }
.badge.red { background: var(--red-bg); color: var(--red); }
.badge.blue { background: var(--blue-bg); color: var(--primary-dark); }
.badge.purple { background: var(--purple-bg); color: var(--purple); }
.badge.gray { background: var(--gray-bg); color: var(--text2); }
.badge.cyan { background: #cffafe; color: #0e7490; }

/* 进度条 */
.progress-wrap { display: flex; align-items: center; gap: 8px; min-width: 110px; }
.progress-bar { flex: 1; height: 7px; background: #e8edf3; border-radius: 4px; overflow: hidden; }
.progress-inner { height: 100%; background: linear-gradient(90deg, #3b82f6, #2563eb); border-radius: 4px; transition: width .3s; }
.progress-num { font-size: 12px; color: var(--text2); min-width: 32px; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; background: #e8edf3; border-radius: 9px; padding: 3px; width: fit-content; }
.tab {
  padding: 6px 16px; border-radius: 7px; cursor: pointer; font-size: 13px; color: var(--text2);
  font-weight: 600; transition: all .15s; white-space: nowrap; user-select: none;
}
.tab.active { background: #fff; color: var(--primary-dark); box-shadow: 0 1px 4px rgba(0,0,0,.1); }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(15,23,42,.5); display: flex;
  align-items: flex-start; justify-content: center; z-index: 100; padding: 46px 16px; overflow-y: auto; backdrop-filter: blur(2px);
}
.modal {
  background: #fff; border-radius: 14px; width: 640px; max-width: 100%; box-shadow: 0 20px 60px rgba(0,0,0,.25);
  animation: pop .18s ease; max-height: calc(100vh - 92px); display: flex; flex-direction: column;
}
.modal.wide { width: 860px; }
@keyframes pop { from { transform: translateY(14px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head {
  display: flex; align-items: center; justify-content: space-between; padding: 16px 22px;
  border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.modal-title { font-size: 16px; font-weight: 700; }
.modal-close { border: none; background: none; font-size: 19px; color: var(--text3); cursor: pointer; line-height: 1; padding: 4px; }
.modal-close:hover { color: var(--red); }
.modal-body { padding: 20px 22px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--border); flex-shrink: 0; }

/* ---------- 表单 ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.form-grid .full { grid-column: 1 / -1; }
.form-item label { display: block; font-size: 12.5px; color: var(--text2); font-weight: 600; margin-bottom: 6px; }
.form-item label .req { color: var(--red); margin-left: 2px; }
.form-input {
  width: 100%; padding: 8px 11px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 13px; outline: none; background: #fff; color: var(--text); font-family: inherit; transition: border .15s;
}
.form-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
textarea.form-input { resize: vertical; min-height: 84px; line-height: 1.65; }
.form-input[type=range] { padding: 0; border: none; accent-color: var(--primary); }
.form-hint { font-size: 11.5px; color: var(--text3); margin-top: 4px; }

/* ---------- 详情 ---------- */
.detail-rows { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 20px; }
.detail-item .dl { font-size: 11.5px; color: var(--text3); margin-bottom: 3px; }
.detail-item .dv { font-size: 13.5px; font-weight: 600; word-break: break-all; }
.detail-item.full { grid-column: 1 / -1; }
.section-title { font-size: 14px; font-weight: 700; margin: 20px 0 10px; display: flex; align-items: center; gap: 7px; }
.section-title::before { content: ""; width: 3.5px; height: 15px; background: var(--primary); border-radius: 2px; }

/* ---------- 文章/新闻 ---------- */
.article-meta { display: flex; gap: 14px; color: var(--text3); font-size: 12.5px; margin: 8px 0 18px; flex-wrap: wrap; align-items: center; }
.article-content { line-height: 1.95; font-size: 14.5px; color: #334155; white-space: pre-wrap; word-break: break-word; }
.back-link { display: inline-flex; align-items: center; gap: 5px; color: var(--primary); cursor: pointer; font-weight: 600; margin-bottom: 14px; font-size: 13px; }
.back-link:hover { text-decoration: underline; }

/* 跟帖 */
.comment-item { display: flex; gap: 12px; padding: 13px 0; border-bottom: 1px dashed #e8edf3; }
.comment-item:last-child { border-bottom: none; }
.comment-avatar {
  width: 34px; height: 34px; border-radius: 50%; background: var(--blue-bg); color: var(--primary-dark);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; flex-shrink: 0;
}
.comment-body { flex: 1; min-width: 0; }
.comment-head { display: flex; align-items: baseline; gap: 8px; }
.comment-author { font-weight: 700; font-size: 13px; }
.comment-time { color: var(--text3); font-size: 11.5px; }
.comment-text { margin-top: 4px; font-size: 13px; color: #334155; line-height: 1.7; word-break: break-all; }
.comment-box { display: flex; gap: 10px; margin-top: 14px; }
.comment-box textarea { flex: 1; }

/* ---------- 汇总卡片（业绩） ---------- */
.perf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; margin-bottom: 18px; }
.perf-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 15px 17px; }
.perf-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.perf-name { font-weight: 700; font-size: 14px; }
.perf-pos { color: var(--text3); font-size: 11.5px; font-weight: 400; margin-left: 6px; }
.perf-num { font-size: 18px; font-weight: 800; }
.perf-num small { font-size: 11px; color: var(--text3); font-weight: 400; margin-left: 2px; }
.perf-bar { height: 7px; border-radius: 4px; background: #e8edf3; overflow: hidden; margin: 8px 0 6px; }
.perf-bar > div { height: 100%; background: linear-gradient(90deg,#f59e0b,#16a34a); border-radius: 4px; }
.perf-label { font-size: 11.5px; color: var(--text3); display: flex; justify-content: space-between; }

/* 漏斗/分布条 */
.dist-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.dist-name { width: 76px; font-size: 12.5px; color: var(--text2); text-align: right; flex-shrink: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dist-barwrap { flex: 1; height: 20px; background: #eef2f7; border-radius: 5px; overflow: hidden; }
.dist-bar { height: 100%; border-radius: 5px; min-width: 2px; transition: width .4s; }
.dist-val { width: 60px; font-size: 12.5px; font-weight: 700; flex-shrink: 0; }

/* 动态列表 */
.feed-item { display: flex; gap: 12px; padding: 10px 2px; border-bottom: 1px dashed #e8edf3; }
.feed-item:last-child { border-bottom: none; }
.feed-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); margin-top: 6px; flex-shrink: 0; }
.feed-main { flex: 1; min-width: 0; }
.feed-text { font-size: 13px; line-height: 1.55; word-break: break-all; }
.feed-time { font-size: 11.5px; color: var(--text3); margin-top: 2px; }

/* ---------- Toast ---------- */
#toast-root { position: fixed; top: 18px; right: 18px; z-index: 300; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: #1e293b; color: #fff; padding: 11px 18px; border-radius: 10px; font-size: 13.5px;
  box-shadow: 0 8px 30px rgba(0,0,0,.25); display: flex; align-items: center; gap: 8px;
  animation: slideIn .25s ease; max-width: 340px;
}
.toast.ok { background: #059669; }
.toast.err { background: var(--red); }
@keyframes slideIn { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }

/* 数字着色 */
.money { color: var(--primary-dark); font-weight: 700; }

/* ---------- 登录页 ---------- */
body.login-mode .sidebar, body.login-mode .topbar { display: none; }
body.login-mode .main { width: 100%; }
body.login-mode .page { padding: 0; overflow: hidden; }
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px;
  background:
    radial-gradient(1000px 520px at 12% -10%, #1e40af 0%, transparent 60%),
    radial-gradient(760px 460px at 108% 8%, #0ea5e9 0%, transparent 58%),
    linear-gradient(160deg, #0f2647 0%, #16345e 55%, #1e293b 100%);
}
.login-card {
  width: 400px; max-width: 100%; background: #fff; border-radius: 20px;
  padding: 34px 34px 22px; box-shadow: 0 24px 60px rgba(2,6,23,.35); text-align: center;
  animation: loginIn .28s ease;
}
@keyframes loginIn { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }
.login-head { margin-bottom: 22px; }
.login-logo {
  width: 66px; height: 66px; margin: 0 auto 14px; border-radius: 18px;
  background: linear-gradient(135deg, #1e40af, #2563eb); display: flex; align-items: center; justify-content: center;
  font-size: 33px; box-shadow: 0 10px 24px rgba(37,99,235,.35);
}
.login-card h2 { font-size: 21px; color: var(--text); letter-spacing: .5px; }
.login-sub { font-size: 10.5px; letter-spacing: 2.4px; color: var(--text3); margin-top: 5px; }
.login-card .form-item { text-align: left; margin-bottom: 14px; }
.login-field { position: relative; }
.login-field .lf-icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); font-size: 13px; opacity: .55; }
.login-field .form-input { padding-left: 34px; height: 42px; }
.login-btn {
  width: 100%; padding: 12px; font-size: 15px; margin-top: 6px;
  justify-content: center; letter-spacing: 4px; height: 44px;
  box-shadow: 0 8px 20px rgba(37,99,235,.28);
}
.login-btn:hover { transform: translateY(-1px); }
.login-btn:active { transform: scale(.98); }
.login-tip { font-size: 11.5px; color: var(--text3); margin-top: 12px; }
.login-foot {
  margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--border);
  font-size: 12px; color: var(--text2); letter-spacing: .3px;
}
.login-err { color: var(--red); font-size: 12.5px; min-height: 18px; margin: 2px 0 4px; }

/* ---------- 顶栏用户徽章 ---------- */
.user-badge { display: flex; align-items: center; gap: 7px; font-weight: 700; font-size: 13px; }
.user-badge .ub-avatar {
  width: 28px; height: 28px; border-radius: 50%; background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 13px; flex-shrink: 0;
}
.user-badge .ub-role { font-size: 11px; padding: 1px 8px; }

/* ---------- 移动端适配 ---------- */
.menu-btn { display: none; border: none; background: none; font-size: 19px; cursor: pointer; padding: 6px 8px; color: var(--text); border-radius: 8px; }
.menu-btn:active { background: var(--gray-bg); }
.sidebar-mask { display: none; position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 49; }

/* 富文本正文（行业研究等）按 HTML 排版，不再按纯文本保留换行 */
.article-content.rich { white-space: normal; }

/* 移动端表格横滑提示（桌面端隐藏） */
.table-scroll-hint { display: none; font-size: 11.5px; color: var(--text3); padding: 6px 2px 0; }

/* 表单内人员多选：整行撑满，便于触屏勾选 */
.form-item .people-check { max-height: 168px; }
.people-check .pc { padding: 6px 12px; font-size: 13px; }

@media (max-width: 768px) {
  .menu-btn { display: block; }
  .sidebar {
    position: fixed; left: -244px; top: 0; bottom: 0; height: 100vh; z-index: 50;
    transition: left .22s ease; box-shadow: none; width: 244px;
  }
  .sidebar.open { left: 0; box-shadow: 6px 0 28px rgba(0,0,0,.3); }
  .nav-item { padding: 12px 14px; font-size: 14px; }
  .nav-group-title { padding: 4px 12px 6px; }
  body.side-open .sidebar-mask { display: block; }
  .topbar { padding: 0 12px; }
  .user-label { display: none; }
  .page { padding: 14px 12px calc(60px + env(safe-area-inset-bottom)); }
  /* 触控友好：按钮 / 输入框最小高度，输入框 ≥16px 防 iOS 自动缩放 */
  .btn { min-height: 38px; }
  .btn-sm { min-height: 32px; }
  .form-input, .toolbar select, .search-box input { font-size: 16px; }
  .td-actions { flex-wrap: wrap; gap: 6px; }
  .table-scroll-hint { display: block; }
  /* 弹窗：底部按钮固定，适配全面屏底部安全区 */
  .modal-foot {
    position: sticky; bottom: 0; background: #fff;
    padding-bottom: calc(14px + env(safe-area-inset-bottom));
  }
  .modal-foot .btn { flex: 1; justify-content: center; min-height: 44px; }
  .modal-body { padding: 16px 14px calc(20px + env(safe-area-inset-bottom)); }
  .form-grid { gap: 12px; }
  .kp-table { min-width: 560px; }
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { padding: 12px 13px; gap: 10px; }
  .stat-icon { width: 38px; height: 38px; font-size: 19px; }
  .stat-val { font-size: 18px; }
  .stat-sub { display: none; }
  .perf-grid { grid-template-columns: 1fr; }
  .grid-2, .grid-3-2 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .detail-rows { grid-template-columns: 1fr 1fr; gap: 10px 14px; }
  .page-head { flex-direction: column; align-items: stretch; }
  .head-actions { width: 100%; }
  .head-actions .btn { flex: 1; justify-content: center; }
  .head-actions .badge { display: none; }
  .modal-mask { padding: 0; align-items: stretch; }
  .modal { width: 100%; max-width: 100%; height: 100%; max-height: 100%; border-radius: 0; }
  .comment-box { flex-direction: column; }
  .comment-box .btn { align-self: stretch; }
  table.data { font-size: 12.5px; }
  table.data td, table.data th { padding: 9px 10px; }
  .tabs { width: 100%; overflow-x: auto; }
  .search-box { max-width: 100%; }
  .toolbar select { flex: 1; min-width: 0; }
  .article-content { font-size: 14px; }
  .grid-3-2 { gap: 12px; }
}
@media (max-width: 480px) {
  .stat-grid { grid-template-columns: 1fr; }
  .brand-sub { display: none; }
  .login-card { padding: 28px 20px 18px; border-radius: 16px; }
  .login-logo { width: 56px; height: 56px; font-size: 28px; }
  .login-card h2 { font-size: 19px; }
  .page-title { font-size: 17px; }
  .cal-cell { min-height: 74px; padding: 3px 4px; }
  .head-actions { gap: 6px; }
  .detail-rows { grid-template-columns: 1fr; }
}

/* 页面加载动画 */
.loading-tip { text-align: center; color: var(--text3); padding: 60px 0; }
.loading-tip::after {
  content: ""; display: block; width: 26px; height: 26px; margin: 12px auto 0;
  border: 3px solid #dbeafe; border-top-color: var(--primary); border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 滚动条 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ---------- 客户表单：产品多选 / 核心关键人 ---------- */
.product-checks { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.check-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px;
  border: 1px solid var(--border); border-radius: 8px; cursor: pointer;
  font-size: 13px; background: #fff; user-select: none;
}
.check-chip:has(input:checked) { border-color: var(--primary); background: var(--blue-bg); color: var(--primary-dark); font-weight: 600; }
.check-chip input { accent-color: var(--primary); margin: 0; }

.kp-section { margin-top: 14px; }
.kp-table input.form-input { padding: 6px 8px; font-size: 12.5px; }
.kp-table td { padding: 5px 6px; }

/* ---------- 移动端适配（客户表单） ---------- */
@media (max-width: 720px) {
  .product-checks { gap: 8px; }
  .check-chip { padding: 6px 10px; font-size: 12.5px; }
  #prod-other-text { max-width: 100% !important; }
}

/* ============ 评论组件（客户评论 / 场景评论 通用） ============ */
.comment-section { margin-top: 22px; border-top: 1px solid var(--border); padding-top: 16px; }
.comment-box { margin-bottom: 14px; font-size: 13px; color: var(--text2); }
.comment-list { display: flex; flex-direction: column; gap: 14px; }
.comment-item { display: flex; gap: 10px; }
.comment-avatar {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, #3b82f6, #6366f1); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600;
}
.comment-main { flex: 1; min-width: 0; }
.comment-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.comment-author { font-weight: 600; color: var(--text); font-size: 13px; }
.comment-time { font-size: 11.5px; color: var(--text3); }
.comment-del {
  margin-left: auto; border: none; background: none; color: var(--text3);
  font-size: 11.5px; cursor: pointer; padding: 2px 6px; border-radius: 4px; visibility: hidden;
}
.comment-item:hover .comment-del { visibility: visible; }
.comment-del:hover { color: var(--red); background: var(--red-bg); }
.comment-content {
  background: var(--gray-bg); border-radius: 0 10px 10px 10px; padding: 10px 12px;
  line-height: 1.65; color: var(--text); word-break: break-word; overflow-wrap: anywhere;
}
.comment-content:empty { display: none; }
.comment-content p { margin: 0 0 4px; }
.comment-content p:last-child { margin-bottom: 0; }
.comment-content img { max-width: 100%; border-radius: 6px; margin: 4px 0; border: 1px solid var(--border); }
.comment-content table { border-collapse: collapse; margin: 6px 0; max-width: 100%; display: block; overflow-x: auto; }
.comment-content table td, .comment-content table th {
  border: 1px solid #cbd5e1; padding: 4px 8px; font-size: 12.5px; background: #fff;
}
.comment-content a { color: var(--primary); text-decoration: underline; }
.comment-content .mention {
  color: var(--primary); background: var(--blue-bg); border-radius: 4px;
  padding: 0 4px; font-weight: 600; margin: 0 1px;
}
.comment-atts { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 6px; }
.att-chip {
  display: inline-flex; align-items: center; gap: 5px; background: #fff; border: 1px solid var(--border);
  border-radius: 6px; padding: 3px 8px; font-size: 12px; color: var(--text2); cursor: pointer;
  text-decoration: none !important; transition: all .15s; max-width: 260px;
}
.att-chip:hover { border-color: var(--primary); color: var(--primary); }
.att-chip .att-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.comment-editor { margin-top: 14px; background: #fff; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.comment-editor:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--blue-bg); }
.comment-toolbar {
  display: flex; align-items: center; gap: 4px; padding: 6px 10px; border-bottom: 1px solid var(--border);
  background: var(--gray-bg); font-size: 12px; color: var(--text3);
}
.comment-toolbar .btn { margin-left: 6px; }
.cb-mention, .cb-att { white-space: nowrap; }
.comment-input {
  min-height: 72px; max-height: 220px; overflow-y: auto; padding: 10px 12px;
  line-height: 1.6; outline: none; font-size: 13.5px;
}
.comment-input:empty::before {
  content: attr(data-placeholder); color: var(--text3); pointer-events: none;
}
.comment-input img { max-width: 100%; border-radius: 6px; }
.comment-input table { border-collapse: collapse; }
.comment-input table td, .comment-input table th { border: 1px solid #cbd5e1; padding: 4px 8px; min-width: 32px; }
.mention-list {
  position: absolute; z-index: 50; background: #fff; border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 8px 24px rgba(15,23,42,.16); max-height: 220px; overflow-y: auto; min-width: 168px; padding: 4px;
}
.mention-item {
  display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 7px;
  cursor: pointer; font-size: 13px;
}
.mention-item:hover { background: var(--blue-bg); color: var(--primary-dark); font-weight: 600; }
.mention-item .mi-avatar { width: 24px; height: 24px; border-radius: 50%; background: var(--blue-bg); color: var(--primary-dark); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; }
.mention-item .mi-role { font-size: 11px; color: var(--text3); margin-left: auto; }

/* ============ 场景拓客：卡片列表 ============ */
.sc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; }
.sc-card { display: flex; flex-direction: column; gap: 8px; position: relative; transition: all .15s; }
.sc-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(15,23,42,.12); }
.sc-card-head { display: flex; align-items: flex-start; gap: 10px; }
.sc-card-icon { font-size: 24px; line-height: 1.2; }
.sc-card-title { font-size: 15px; font-weight: 700; color: var(--text); }
.sc-card-desc { font-size: 12.5px; color: var(--text2); line-height: 1.5; min-height: 36px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sc-card-stats { display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--text2); margin-top: auto; padding-top: 8px; border-top: 1px dashed var(--border); }
.comment-count { display: inline-flex; align-items: center; gap: 4px; }
.sc-del { position: absolute; top: 10px; right: 10px; opacity: 0; transition: opacity .15s; }
.sc-card:hover .sc-del { opacity: 1; }
.sc-open-hint { font-size: 11.5px; color: var(--primary); font-weight: 600; }

/* ============ 场景拓客：关系树 ============ */
.legend-bar {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin: 12px 0;
  font-size: 12.5px; color: var(--text2); background: #fff; border: 1px solid var(--border);
  border-radius: 10px; padding: 8px 14px;
}
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.dot-mark { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.dot-green { background: var(--green); }
.dot-gray { background: var(--text3); }
.dot-red { background: var(--red); }
.tree-viewport {
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
  overflow: auto; padding: 24px; position: relative;
  background-image: radial-gradient(#e2e8f0 1px, transparent 1px); background-size: 20px 20px;
}
.tree-rel-label {
  font-size: 11.5px; fill: #64748b;
}
.tree-rel-label-bg { fill: #fff; rx: 4; }
.tree-node {
  position: absolute; width: 186px; background: #fff; border: 1.5px solid var(--border);
  border-radius: 10px; box-shadow: 0 1px 3px rgba(15,23,42,.08); cursor: pointer;
  transition: box-shadow .15s, border-color .15s, transform .15s;
}
.tree-node:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(15,23,42,.14); }
.tree-node.dot-green { border-color: #86efac; }
.tree-node.dot-gray { border-color: #cbd5e1; }
.tree-node.dot-red { border-color: #fca5a5; }
.tn-head { display: flex; align-items: center; gap: 7px; padding: 9px 10px 0; }
.tn-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.dot-green .tn-dot, .tn-dot.dot-green { background: var(--green); box-shadow: 0 0 0 3px var(--green-bg); }
.dot-gray .tn-dot, .tn-dot.dot-gray { background: var(--text3); box-shadow: 0 0 0 3px #e2e8f0; }
.dot-red .tn-dot, .tn-dot.dot-red { background: var(--red); box-shadow: 0 0 0 3px var(--red-bg); }
.tn-label { font-size: 13px; font-weight: 700; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.tn-edit { font-size: 10.5px; color: var(--text3); border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px; flex-shrink: 0; }
.tn-remark { font-size: 11.5px; color: var(--text2); line-height: 1.45; padding: 4px 10px 0; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.tn-remark.muted { color: var(--text3); font-style: normal; }
.tn-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  padding: 6px 10px 8px; margin-top: 6px; font-size: 11px; color: var(--text3);
  border-top: 1px dashed var(--border);
}
.tn-in { display: inline-flex; align-items: center; gap: 3px; color: var(--green); font-weight: 600; }
.tn-in:empty { display: none; }

/* ---------- 移动端适配（评论 / 场景树） ---------- */
@media (max-width: 720px) {
  .sc-grid { grid-template-columns: 1fr; }
  .tree-viewport { padding: 12px; }
  .comment-input { font-size: 13px; }
  .att-chip { max-width: 190px; }
}

/* ============ 工作台：项目到期提醒 ============ */
.due-card { border: 1px solid #fde68a; background: linear-gradient(180deg, #fffbeb, #ffffff 60%); }
.due-row { align-items: flex-start; }
.due-row .feed-text { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; line-height: 1.7; }
.due-tag {
  font-size: 10.5px; font-weight: 700; border-radius: 10px; padding: 1px 8px; flex-shrink: 0;
  letter-spacing: .5px; white-space: nowrap;
}
.tag-over { background: var(--red-bg); color: var(--red); border: 1px solid #fecaca; }
.tag-soon { background: var(--orange-bg); color: var(--orange); border: 1px solid #fde68a; }
.due-row.due-over .link { color: var(--red-dark, #b91c1c); }

/* @成员独立浮层（不占用 modal，可在详情弹窗内使用） */
.mention-pop {
  position: fixed; z-index: 1000;
  background: #fff; border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 10px 30px rgba(15,23,42,.2); padding: 4px;
}
.mention-pop .mention-list { position: static; border: none; box-shadow: none; padding: 0; min-width: 176px; }

/* ============================================================
 * 日程管理（日历） + 会议管理
 * ============================================================ */
.cal-card { padding: 16px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cal-head .btn { padding: 5px 12px; font-size: 12.5px; }
.cal-ym { font-size: 16px; font-weight: 700; display: flex; align-items: center; }
.cal-week { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; font-size: 12px;
  color: var(--muted, #64748b); padding-bottom: 8px; border-bottom: 1px solid var(--border); font-weight: 600; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; padding-top: 8px; }
.cal-cell { min-height: 96px; border: 1px solid var(--border); border-radius: 8px; padding: 5px 6px;
  cursor: default; transition: border-color .15s, box-shadow .15s; overflow: hidden; }
.cal-cell:not(.cal-pad):hover { border-color: #94a3b8; box-shadow: 0 2px 8px rgba(15,23,42,.06); }
.cal-cell.cal-pad { background: transparent; border-style: dashed; border-color: transparent; }
.cal-cell.cal-today { border: 1.5px solid #2563eb; background: #eff6ff; }
.cal-cell.cal-today .cal-date { color: #2563eb; }
.cal-date { font-size: 12.5px; font-weight: 700; color: #334155; margin-bottom: 3px; }
.cal-item { display: flex; align-items: center; gap: 4px; font-size: 11px; padding: 2px 5px; margin-bottom: 3px;
  border-radius: 5px; background: #f1f5f9; cursor: pointer; white-space: nowrap; overflow: hidden; }
.cal-item::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--dot, #94a3b8); flex: none; }
.cal-item:hover { background: #e2e8f0; }
.cal-time { color: #64748b; flex: none; font-size: 10.5px; }
.cal-title { overflow: hidden; text-overflow: ellipsis; }
.cal-item.cal-done { opacity: .55; }
.cal-item.cal-done .cal-title { text-decoration: line-through; }
.cal-check { color: #16a34a; font-weight: 700; flex: none; }
.cal-more { font-size: 10.5px; color: #2563eb; cursor: pointer; padding: 1px 5px; }
.cal-more:hover { text-decoration: underline; }
.cal-legend { display: flex; align-items: center; gap: 16px; margin: 10px 2px 0; font-size: 12px; color: #475569; }
.cal-legend .cal-dot { display: inline-block; }
.cal-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 4px; vertical-align: middle; }

.today-card .today-row { padding: 7px 4px; }
.today-card .section-title { display: flex; align-items: center; }

/* 人员多选 checkbox */
.people-check { display: flex; flex-wrap: wrap; gap: 6px 10px; padding: 8px 10px;
  background: #f8fafc; border: 1px solid var(--border); border-radius: 8px; max-height: 150px; overflow-y: auto; }
.people-check .pc { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; cursor: pointer;
  padding: 3px 10px; border: 1px solid var(--border); border-radius: 999px; background: #fff; }
.people-check .pc:has(input:checked) { background: #eff6ff; border-color: #2563eb; color: #1d4ed8; }
.people-check .pc input { accent-color: #2563eb; }

/* 会议卡片 */
.mtg-card { display: flex; gap: 14px; align-items: stretch; margin-bottom: 12px; cursor: pointer;
  transition: box-shadow .15s, border-color .15s; }
.mtg-card:hover { border-color: #93c5fd; box-shadow: 0 4px 14px rgba(15,23,42,.08); }
.mtg-main { flex: 1; min-width: 0; }
.mtg-title { font-size: 15px; font-weight: 700; margin-bottom: 5px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mtg-meta { font-size: 12.5px; color: #475569; margin-bottom: 4px; }
.mtg-people { font-size: 12.5px; color: #64748b; margin-bottom: 6px; }
.mtg-content { font-size: 12.5px; color: #64748b; background: #f8fafc; border-radius: 6px; padding: 6px 10px; }
.mtg-side { display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between;
  border-left: 1px solid var(--border); padding-left: 14px; min-width: 92px; }
.mtg-cmt { font-size: 13px; font-weight: 600; color: #475569; }
.mtg-rec { font-size: 11.5px; }

/* 项目赋分 */
.score-slider { display: flex; align-items: center; gap: 8px; }
.score-slider input[type="range"] { flex: 1; accent-color: #1677ff; max-width: 320px; }
.score-slider .score-val { font-weight: 700; min-width: 28px; text-align: right; font-size: 14px; color: #1677ff; }
.score-slider small { color: #94a3b8; font-size: 12px; }
.score-chip { display: inline-block; padding: 2px 8px; background: #eef2ff; color: #4338ca; border-radius: 999px;
  font-size: 12px; font-weight: 600; }
.score-readonly { font-weight: 700; color: #1677ff; }

/* KPI 看板 */
.kpi-table { width: 100%; border-collapse: separate; border-spacing: 0; background: #fff;
  border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.kpi-table th, .kpi-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); border-right: 1px solid var(--border);
  font-size: 13px; text-align: left; vertical-align: middle; }
.kpi-table th { background: #f8fafc; font-weight: 600; color: #334155; }
.kpi-table tr:last-child td, .kpi-table tr:last-child th { border-bottom: none; }
.kpi-table th:last-child, .kpi-table td:last-child { border-right: none; }
.kpi-cell { cursor: pointer; min-width: 90px; }
.kpi-cell:hover { background: #eff6ff; }
.kpi-cell.empty { color: #cbd5e1; font-style: italic; }
.kpi-add { color: #94a3b8; cursor: pointer; text-align: center; user-select: none; background: #fafafa; }
.kpi-add:hover { background: #f1f5f9; color: #475569; }
.kpi-row-hd { display: flex; align-items: center; gap: 4px; min-width: 120px; }
.kpi-row-hd .label { flex: 1; }
.kpi-row-hd button { font-size: 11px; padding: 0 6px; height: 20px; line-height: 18px; border-radius: 4px;
  border: 1px solid var(--border); background: #fff; cursor: pointer; color: #64748b; }
.kpi-row-hd button:hover { border-color: #94a3b8; color: #1e293b; }
.kpi-row-hd button.danger:hover { border-color: #ef4444; color: #ef4444; }
.kpi-empty-board { padding: 40px; text-align: center; color: #94a3b8; background: #fff; border: 1px dashed var(--border); border-radius: 8px; }

/* 富文本编辑器 */
.rich-editor { min-height: 140px; max-height: 360px; overflow-y: auto; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 6px; background: #fff; outline: none; }
.rich-editor:focus { border-color: #1677ff; box-shadow: 0 0 0 3px rgba(22,119,255,.08); }
.rich-editor:empty::before { content: attr(data-placeholder); color: #cbd5e1; }
.rich-editor img { max-width: 100%; border-radius: 4px; margin: 4px 0; }
.rich-editor table { border-collapse: collapse; width: 100%; margin: 6px 0; }
.rich-editor table td, .rich-editor table th { border: 1px solid var(--border); padding: 4px 6px; }
.rich-toolbar { display: flex; gap: 4px; padding: 6px 8px; border: 1px solid var(--border); border-bottom: none;
  border-radius: 6px 6px 0 0; background: #f8fafc; flex-wrap: wrap; }
.rich-toolbar + .rich-editor { border-radius: 0 0 6px 6px; border-top: none; }
.rich-toolbar button { font-size: 12px; padding: 3px 8px; border: 1px solid var(--border); border-radius: 4px;
  background: #fff; cursor: pointer; color: #475569; }
.rich-toolbar button:hover { border-color: #1677ff; color: #1677ff; }

/* article-content 富文本排版（party_news 等） */
.article-content { line-height: 1.75; font-size: 14px; color: #1e293b; }
.article-content h1, .article-content h2, .article-content h3, .article-content h4 { margin: 14px 0 8px; font-weight: 700; }
.article-content h1 { font-size: 19px; }
.article-content h2 { font-size: 17px; }
.article-content h3 { font-size: 15.5px; }
.article-content p { margin: 8px 0; }
.article-content img { max-width: 100%; border-radius: 6px; margin: 6px 0; }
.article-content blockquote { border-left: 3px solid #cbd5e1; padding: 4px 12px; color: #475569; margin: 8px 0; background: #f8fafc; }
.article-content hr { border: none; border-top: 1px dashed var(--border); margin: 12px 0; }
.article-content table { border-collapse: collapse; width: 100%; margin: 8px 0; }
.article-content table td, .article-content table th { border: 1px solid var(--border); padding: 6px 8px; }
.article-content a { color: #1677ff; text-decoration: underline; }


/* ============================================================
 * 2.0 新增：楼中楼跟帖 / 支行知识库 / 员工天地 / 内部分工 /
 *           关系树缩放 / 日程周视图 / Markdown 会议记录
 * ============================================================ */

/* ---------- 评论：楼中楼回复 ---------- */
.comment-item.comment-sub { background: #f8fafc; border-radius: 8px; padding: 8px 10px; margin-top: 8px; }
.comment-item.comment-sub .comment-avatar { width: 26px; height: 26px; font-size: 11px; }
.reply-list { margin-left: 10px; padding-left: 12px; border-left: 2px solid var(--border); }
.comment-actions { margin-top: 4px; }
.comment-actions .cm-reply { cursor: pointer; padding: 1px 8px; font-size: 11.5px; color: var(--text2); }
.comment-actions .cm-reply:hover { color: var(--primary); }
.reply-to { display: inline-block; font-size: 11.5px; color: var(--primary); background: var(--blue-bg);
  border-radius: 4px; padding: 0 6px; margin-right: 6px; }
.reply-slot:empty { display: none; }
.reply-slot { margin: 8px 0 2px; }
.reply-slot .comment-editor { background: #fff; border: 1px dashed var(--border); border-radius: 8px; padding: 8px; }
.reply-slot .comment-input { min-height: 62px; }
.comment-main-editor { margin-top: 12px; }

/* ---------- 支行知识库：目录切换 ---------- */
.kb-tabs { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 12px 0 14px; }
.kb-tab {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 16px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border); background: #fff; color: var(--text2); font-size: 13px; font-weight: 600;
  transition: all .15s;
}
.kb-tab:hover { border-color: #94a3b8; color: var(--text); }
.kb-tab.active { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 4px 12px rgba(37,99,235,.25); }
.kb-tab-n { font-size: 11px; background: rgba(0,0,0,.08); border-radius: 999px; padding: 0 7px; font-weight: 700; }
.kb-tab.active .kb-tab-n { background: rgba(255,255,255,.22); }

/* ---------- 员工天地：员工相册 ---------- */
.album-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(258px, 1fr)); gap: 14px; }
.album-card { padding: 0; overflow: hidden; cursor: pointer; transition: all .15s; }
.album-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(15,23,42,.13); }
.album-thumb { height: 168px; background: var(--gray-bg) center/cover no-repeat; }
.album-body { padding: 10px 12px 12px; }
.album-title { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.album-desc { font-size: 12.5px; color: var(--text2); line-height: 1.5; min-height: 20px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.album-foot { display: flex; align-items: center; gap: 10px; font-size: 11.5px; color: var(--text2);
  margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--border); }
.album-foot .album-del { margin-left: auto; }
.album-preview img { border-radius: 10px; box-shadow: var(--shadow); }
.album-detail-img { text-align: center; background: #f8fafc; border-radius: 10px; padding: 10px; }
.album-detail-img img { max-width: 100%; max-height: 460px; border-radius: 8px; }
.album-detail-meta { display: flex; gap: 16px; align-items: center; flex-wrap: wrap;
  font-size: 12.5px; color: var(--text2); margin: 10px 0 4px; }

/* ---------- 员工天地：我的同事（私密留言） ---------- */
.ew-wrap { display: grid; grid-template-columns: 272px 1fr; gap: 14px; align-items: start; }
.ew-side { padding: 14px; max-height: calc(100vh - 200px); overflow-y: auto; }
.ew-chat { padding: 0; min-height: 460px; display: flex; flex-direction: column; }
.ew-chat-hd { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.peer-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; transition: background .15s; }
.peer-item:hover { background: var(--gray-bg); }
.peer-item.active { background: var(--blue-bg); }
.peer-info { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.peer-name { font-size: 13px; font-weight: 600; display: flex; align-items: center; }
.peer-last { font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 168px; }
.peer-cnt { font-size: 11px; background: var(--primary); color: #fff; border-radius: 999px; padding: 1px 7px; font-weight: 700; }
.msg-list { flex: 1; padding: 14px 16px; overflow-y: auto; min-height: 200px; max-height: calc(100vh - 340px); }
.msg-item { display: flex; gap: 10px; margin-bottom: 14px; }
.msg-item.msg-mine { flex-direction: row-reverse; }
.msg-item .msg-body { max-width: 76%; }
.msg-mine .msg-body { text-align: right; }
.msg-head { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--text3); margin-bottom: 3px; }
.msg-mine .msg-head { flex-direction: row-reverse; }
.msg-name { font-weight: 700; color: var(--text); font-size: 12.5px; }
.msg-text {
  display: inline-block; text-align: left; padding: 8px 12px; border-radius: 12px; background: #fff;
  border: 1px solid var(--border); font-size: 13.5px; line-height: 1.6; word-break: break-word;
}
.msg-mine .msg-text { background: var(--blue-bg); border-color: #bfdbfe; }
.msg-item.msg-sub { margin-left: 42px; }
.msg-item.msg-sub.msg-mine { margin-left: 0; margin-right: 42px; }
.ew-chat-editor { border-top: 1px solid var(--border); padding: 12px 16px; }
.ew-chat-editor .comment-editor { margin: 0; }

/* ---------- 关系树：缩放工具条 ---------- */
.tree-toolbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 8px 12px; border-bottom: 1px solid var(--border); background: #f8fafc;
}
.tree-zoom-btn {
  width: 30px; height: 28px; border: 1px solid var(--border); border-radius: 6px; background: #fff;
  cursor: pointer; font-size: 15px; line-height: 1; color: var(--text2); transition: all .15s;
}
.tree-zoom-btn:hover { border-color: var(--primary); color: var(--primary); }
.tree-zoom-val { font-size: 12px; font-weight: 700; color: var(--text2); min-width: 42px; text-align: center; }
/* 画布独立滚动区：滚动不向页面传导，捏合手势不触发浏览器整页缩放 */
.tree-scroll {
  overflow: auto; padding: 12px; max-height: calc(100vh - 230px); background: #f8fafc;
  overscroll-behavior: contain; touch-action: pan-x pan-y;
}
.tree-scale-box { position: relative; margin: 0 auto; }

/* ---------- 日程：周视图（手机端） ---------- */
.week-list { display: flex; flex-direction: column; gap: 8px; }
.week-day { border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; background: #fff; }
.week-day.wk-today { border-color: var(--primary); background: #eff6ff; }
.week-day-hd { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.wd-weekend { font-size: 12.5px; font-weight: 700; color: var(--text2); width: 34px; }
.wd-weekend.rest { color: var(--orange); }
.wd-date { font-size: 13px; font-weight: 700; color: var(--text); }
.week-day-hd .wd-add { margin-left: auto; padding: 2px 8px; font-size: 11.5px; }
.wd-items { display: flex; flex-direction: column; gap: 4px; }
.wd-items .cal-item { cursor: pointer; }

/* ---------- Markdown（会议记录） ---------- */
.md-input { font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace; font-size: 13px; line-height: 1.7; }
.md-preview, .md-body {
  border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; background: #fff;
  min-height: 60px; line-height: 1.75; font-size: 14px; color: var(--text);
}
.md-body { border: none; padding: 0; background: transparent; }
.md-body h1, .md-body h2, .md-body h3, .md-body h4, .md-preview h1, .md-preview h2 { font-weight: 700; margin: 10px 0 6px; }
.md-body h1, .md-preview h1 { font-size: 19px; }
.md-body h2, .md-preview h2 { font-size: 16.5px; }
.md-body h3, .md-preview h3 { font-size: 15px; }
.md-body h4, .md-preview h4 { font-size: 14px; }
.md-body p, .md-preview p { margin: 7px 0; }
.md-body ul, .md-preview ul, .md-body ol, .md-preview ol { margin: 7px 0 7px 22px; }
.md-body li, .md-preview li { margin: 3px 0; }
.md-body blockquote, .md-preview blockquote { border-left: 3px solid var(--border); padding: 2px 12px; color: var(--text2); background: #f8fafc; margin: 8px 0; }
.md-body hr, .md-preview hr { border: none; border-top: 1px dashed var(--border); margin: 10px 0; }
.md-body img, .md-preview img { max-width: 100%; border-radius: 6px; }
.md-body a, .md-preview a { color: var(--primary); }
.md-pre { background: #0f172a; color: #e2e8f0; padding: 10px 12px; border-radius: 8px; overflow-x: auto; font-size: 12.5px; }
.md-body code, .md-preview code { font-family: "SFMono-Regular", Consolas, Menlo, monospace; font-size: 12.5px;
  background: var(--gray-bg); padding: 1px 5px; border-radius: 4px; }
.md-pre code { background: transparent; padding: 0; color: inherit; }

/* ---------- 人员管理：内部分工组织架构树 ---------- */
.org-tree-card { padding: 18px 16px; overflow-x: auto; }
.org-tree { display: flex; flex-direction: column; gap: 12px; }
.org-children { display: flex; flex-direction: column; gap: 10px; margin: 10px 0 0 30px; padding-left: 18px;
  border-left: 2px solid var(--border); }
.org-card {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: #fff;
  border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); transition: all .15s;
}
.org-card:hover { border-color: #94a3b8; box-shadow: 0 4px 12px rgba(15,23,42,.1); }
.org-photo {
  width: 46px; height: 46px; border-radius: 50%; flex-shrink: 0; overflow: hidden;
  background: linear-gradient(135deg, var(--blue-bg), #e0e7ff); color: var(--primary-dark);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px;
}
.org-photo img { width: 100%; height: 100%; object-fit: cover; }
.org-photo.lg { width: 66px; height: 66px; font-size: 18px; }
.org-info { flex: 1; min-width: 0; }
.org-name { font-size: 14.5px; font-weight: 700; color: var(--text); display: flex; align-items: center; flex-wrap: wrap; }
.org-posts { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 3px; font-size: 12.5px; color: var(--text2); }
.org-posts .op i, .org-duty i { font-style: normal; color: var(--text3); margin-right: 5px; font-size: 11.5px; }
.org-duty { margin-top: 3px; font-size: 12.5px; color: var(--text); line-height: 1.5; }
.org-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex-shrink: 0; }
.org-orphan { margin-top: 14px; padding: 14px; border-color: #fde68a; background: #fffbeb; }
.org-card.role-president { border-color: #fca5a5; }
.org-card.role-vice { border-color: #fdba74; }
.org-card.role-manager { border-color: #93c5fd; }
.org-card.role-secretary { border-color: #c4b5fd; }

/* ---------- 移动端适配 ---------- */
@media (max-width: 900px) {
  .ew-wrap { grid-template-columns: 1fr; }
  .ew-side { max-height: 220px; }
}
@media (max-width: 720px) {
  .album-grid { grid-template-columns: 1fr; }
  .tree-scroll { max-height: 68vh; }
  .reply-list { margin-left: 4px; padding-left: 8px; }
  .msg-item .msg-body { max-width: 84%; }
  .org-children { margin-left: 12px; padding-left: 10px; }
  .org-card { flex-wrap: wrap; }
  .org-actions { flex-direction: row; align-items: center; width: 100%; justify-content: space-between; }
  .peer-last { max-width: 130px; }
  .reply-slot .comment-input { font-size: 13px; }
}

/* ============ 工作台 · 同事留言卡片 ============ */
.wb-msg-card .wb-msg-text {
  margin: 4px 0 2px; font-size: 13px; line-height: 1.7; color: var(--text);
  background: #f8fafc; border: 1px solid var(--border); border-radius: 8px;
  padding: 6px 10px; max-height: 96px; overflow: auto;
}
.wb-msg-card .wb-msg-text img { max-height: 78px; max-width: 100%; }
.wb-msg-card .wb-msg-text table { font-size: 12px; }
.wb-reply-slot:empty { display: none; }
.wb-reply-slot .comment-editor { margin-top: 8px; }

/* ============ 公务用车 · 车辆管理员设置 ============ */
.admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 8px; }
.admin-chip {
  display: flex; align-items: center; gap: 6px; padding: 7px 10px;
  border: 1px solid var(--border); border-radius: 8px; background: #fff;
  font-size: 13px; cursor: pointer;
}
.admin-chip:hover { border-color: #94a3b8; }
.admin-chip.on { border-color: var(--primary); background: var(--blue-bg); }

@media (max-width: 720px) {
  .admin-grid { grid-template-columns: 1fr 1fr; }
  .wb-msg-card .wb-msg-text { max-height: 120px; }
}

/* ============ 公告通知 ============ */
.ann-board { border-left: 3px solid var(--primary); margin-bottom: 14px; }
.ann-line {
  display: flex; align-items: center; gap: 8px; padding: 7px 4px;
  border-top: 1px dashed var(--border); font-size: 13.5px;
}
.ann-line:first-of-type { border-top: none; }
.ann-line.ann-line-top { background: #fffbeb; border-radius: 6px; }
.ann-line-title { font-weight: 600; }
.ann-flags-inline { display: inline-flex; gap: 4px; }
.ann-card { margin-bottom: 12px; }
.ann-card.ann-top { border-left: 3px solid var(--red); }
.ann-hd { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.ann-title { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ann-meta { font-size: 12px; color: var(--text2); white-space: nowrap; }
.ann-body {
  margin-top: 8px; font-size: 13.5px; line-height: 1.8; color: var(--text);
  background: #f8fafc; border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px;
}
.ann-body img { max-width: 100%; }
.ann-ops { margin-top: 10px; display: flex; gap: 8px; justify-content: flex-end; }
.ann-flags { display: flex; gap: 8px; flex-wrap: wrap; }

/* ============ 日程 · 用车联动 ============ */
.car-sub { border: 1px dashed var(--primary); border-radius: 10px; padding: 10px 12px; background: #f8fbff; }
.car-sub-title { font-size: 13px; font-weight: 600; color: var(--primary-dark); margin-bottom: 8px; }
.cal-car { font-size: 11px; margin-left: 3px; }

@media (max-width: 720px) {
  .ann-hd { flex-direction: column; }
  .ann-ops { justify-content: flex-start; }
}
