:root {
  --sb-w: 216px;
  --sb-bg: #323a4d;
  --accent: #e63757;
}

body { background: #f5f6f8; }

.app-wrap { display: flex; min-height: 100vh; }

/* 侧边栏 */
.app-sidebar { width: var(--sb-w); flex: 0 0 var(--sb-w); background: var(--sb-bg); display: flex; flex-direction: column; }
.brand { color: #fff; font-weight: 700; padding: 16px 18px; font-size: 1.05rem; letter-spacing: .02em; }
.brand .bi { color: var(--accent); margin-right: 4px; }
.app-sidebar nav { overflow-y: auto; flex: 1; padding: 0 0 24px; }
.sb-group { font-size: .72rem; color: #8b93a5; padding: 14px 18px 4px; letter-spacing: .12em; }
.sb-link { display: flex; align-items: center; gap: 10px; color: #cfd4de; padding: 8px 18px; text-decoration: none; font-size: .92rem; border-left: 3px solid transparent; }
.sb-link .bi { font-size: 1rem; }
.sb-link:hover { color: #fff; background: rgba(255,255,255,.06); }
.sb-link.active { color: #fff; background: rgba(255,255,255,.08); border-left-color: var(--accent); }

/* 主区域 */
.app-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.app-topbar { background: #fff; border-bottom: 1px solid #e8eaef; padding: 10px 20px; display: flex; align-items: center; position: sticky; top: 0; z-index: 10; }
.page-title { font-size: 1rem; }
.app-content { padding: 18px 20px 48px; }

/* 卡片与表格 */
.card { border: none; box-shadow: 0 1px 2px rgba(16,24,40,.06); }
.table { --bs-table-hover-bg: #f6f8fb; }
.table th { white-space: nowrap; font-size: .82rem; color: #5b6472; }
.table td { vertical-align: middle; }
.table-sm td, .table-sm th { padding: .45rem .5rem; }

/* 统计卡片 */
.stat-card { display: flex; align-items: center; gap: 12px; }
.stat-card .ico { width: 42px; height: 42px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1.15rem; }
.stat-card .num { font-size: 1.45rem; font-weight: 700; line-height: 1.1; }
.stat-card .lbl { color: #6c757d; font-size: .8rem; }

/* 完善度 */
.completeness { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; white-space: nowrap; }
.completeness .progress { width: 60px; height: 6px; }

/* 用户摘要块 */
.user-cell b { font-weight: 600; }
.user-cell .sub { color: #8a93a3; font-size: .78rem; }

/* 头像（详情页/列表页） */
.avatar-lg { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; }
.avatar-sm { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex: none; }
.avatar-empty { display: flex; align-items: center; justify-content: center; background: #eef1f6; color: #98a2b3; }
.avatar-empty.avatar-lg i { font-size: 2rem; }
.avatar-empty.avatar-sm i { font-size: 1.1rem; }
.avatar-wrap { position: relative; display: inline-block; width: 64px; height: 64px; flex: none; cursor: pointer; }
.avatar-wrap:hover .avatar-lg { filter: brightness(.92); }
.avatar-cam { position: absolute; right: -2px; bottom: -2px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: .68rem; border: 2px solid #fff; pointer-events: none; }

/* 客户相册 */
.photo-item { position: relative; width: 108px; flex: none; }
.photo-thumb { width: 108px; height: 108px; object-fit: cover; border-radius: 8px; border: 1px solid #e9edf3; display: block; transition: transform .12s; }
.photo-item:hover .photo-thumb { transform: scale(1.03); }
.photo-del { position: absolute; top: 4px; right: 4px; background-color: rgba(255,255,255,.92); border-radius: 50%; padding: 5px; box-shadow: 0 1px 3px rgba(16,24,40,.25); }
.photo-del:hover { transform: scale(1.12); }

/* 登录页 */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #f8f9fb 60%, #fdeef1); padding: 16px; }
.login-card { width: 100%; max-width: 380px; }

/* 详情页资料网格 */
.profile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px 18px; }
.profile-grid .k { color: #8a93a3; font-size: .78rem; }
.profile-grid .v { font-size: .9rem; }

/* 手机端：侧栏变顶部横向导航 */
@media (max-width: 991.98px) {
  .app-wrap { flex-direction: column; }
  .app-sidebar { width: 100%; flex: none; }
  .app-sidebar nav { display: flex; overflow-x: auto; padding: 0 8px 8px; }
  .sb-group { display: none; }
  .sb-link { white-space: nowrap; border-left: none; border-bottom: 3px solid transparent; padding: 10px 12px; }
  .sb-link.active { border-bottom-color: var(--accent); }
  .brand { padding: 10px 16px; font-size: .95rem; }
  .app-content { padding: 12px 12px 40px; }
}
