/* ============================================================
   客户详情页（2026-11-05）
   全部选择器锁在 #custPage 下，复用 style.css :root 里的品牌变量，
   不新增任何全局类名，避免污染既有样式。
   z-index 1090：高于 .bottom-nav(1000) / .quick-dock(999)，
   与 #sellPage 同层，手机端不会被底部导航盖住。
   ============================================================ */
#custPage{
  position:fixed; inset:0; z-index:1090; display:none;
  background:var(--bg-page); color:var(--text-primary);
  font-family:var(--font-ui); font-size:14px; line-height:1.6;
  overflow:auto; -webkit-overflow-scrolling:touch;
}
#custPage.on{display:block}
#custPage *{box-sizing:border-box}
#custPage button{font-family:inherit;cursor:pointer;border:none;background:none}
#custPage input,#custPage textarea,#custPage select{
  font-family:inherit;font-size:14px;color:var(--text-primary);
  width:100%;padding:9px 11px;border:1px solid var(--border);
  border-radius:var(--radius-sm);background:#fff;outline:none;
}
#custPage input:focus,#custPage textarea:focus,#custPage select:focus{
  border-color:var(--brand-gold);box-shadow:0 0 0 3px var(--brand-gold-soft);
}

/* ---------- 顶栏 ---------- */
#custPage .cp-top{
  height:60px;background:#fff;border-bottom:1px solid var(--border);
  display:flex;align-items:center;justify-content:space-between;
  padding:0 20px;position:sticky;top:0;z-index:20;
}
#custPage .cp-top-l{display:flex;align-items:center;gap:14px;min-width:0}
#custPage .cp-back{
  font-size:14px;color:var(--brand-gold-dark);padding:6px 12px;
  border:1px solid var(--border);border-radius:var(--radius-pill);background:#fff;
  white-space:nowrap;flex:0 0 auto;
}
#custPage .cp-back:hover{background:var(--brand-gold-soft)}
#custPage .cp-title{
  font-family:var(--font-brand);font-size:19px;letter-spacing:.5px;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
#custPage .cp-top-r{flex:0 0 auto}
#custPage .cp-chip{
  font-size:12px;color:var(--text-muted);background:var(--bg-subtle);
  border:1px solid var(--border);border-radius:var(--radius-pill);padding:5px 12px;
}

/* ---------- 容器 ---------- */
#custPage .cp-wrap{max-width:1080px;margin:0 auto;padding:18px 20px 48px}

/* ---------- 概览 ---------- */
#custPage .cp-hero{
  background:#fff;border:1px solid var(--border);border-radius:var(--radius);
  box-shadow:var(--shadow-sm);padding:18px 20px;margin-bottom:14px;
  display:flex;align-items:center;gap:16px;flex-wrap:wrap;
}
#custPage .cp-avatar{
  width:52px;height:52px;flex:0 0 auto;border-radius:50%;
  background:linear-gradient(135deg,#2c1e0f,#5a3e1b);color:#f6e6cf;
  display:flex;align-items:center;justify-content:center;
  font-family:var(--font-brand);font-size:22px;
}
#custPage .cp-hero-main{flex:1 1 200px;min-width:0}
#custPage .cp-name{
  font-family:var(--font-brand);font-size:20px;letter-spacing:.5px;
  display:flex;align-items:center;gap:8px;flex-wrap:wrap;
}
#custPage .cp-tag{
  font-family:var(--font-ui);font-size:11px;font-weight:normal;letter-spacing:0;
  color:var(--brand-gold-dark);background:var(--brand-gold-soft);
  border:1px solid #EBD9BF;border-radius:var(--radius-pill);padding:2px 9px;
}
#custPage .cp-sub{font-size:12px;color:var(--text-muted);margin-top:3px}
#custPage .cp-stats{display:flex;gap:22px;flex-wrap:wrap}
#custPage .cp-stat{text-align:right;min-width:62px}
#custPage .cp-stat b{display:block;font-size:17px;font-weight:600;color:var(--brand-brown);line-height:1.3}
#custPage .cp-stat span{font-size:11px;color:var(--text-muted)}

/* ---------- 两栏：档案窄（内容固定）、跟进宽（会一直长） ---------- */
#custPage .cp-grid{display:grid;grid-template-columns:minmax(0,340px) minmax(0,1fr);gap:14px;margin-bottom:14px}
@media (max-width:860px){ #custPage .cp-grid{grid-template-columns:1fr} }

#custPage .cp-card{
  background:#fff;border:1px solid var(--border);border-radius:var(--radius);
  box-shadow:var(--shadow-sm);padding:16px 18px;margin-bottom:14px;
}
#custPage .cp-grid .cp-card{margin-bottom:0;display:flex;flex-direction:column}
#custPage .cp-card-h{
  display:flex;align-items:center;justify-content:space-between;
  padding-bottom:10px;margin-bottom:12px;border-bottom:1px solid var(--border);
  font-family:var(--font-brand);font-size:15px;letter-spacing:.5px;
}
#custPage .cp-count{font-family:var(--font-ui);font-size:12px;color:var(--text-muted)}
#custPage .cp-mini{
  font-family:var(--font-ui);font-size:12px;color:var(--brand-gold-dark);
  border:1px solid var(--border);border-radius:var(--radius-pill);
  padding:3px 12px;background:#fff;
}
#custPage .cp-mini:hover{background:var(--brand-gold-soft)}

/* ---------- 档案 ---------- */
#custPage .cp-row{
  display:flex;gap:12px;padding:7px 0;border-bottom:1px dashed #F1E7D6;font-size:13px;
}
#custPage .cp-row:last-child{border-bottom:none}
#custPage .cp-k{flex:0 0 62px;color:var(--text-muted);font-size:12px;padding-top:1px}
#custPage .cp-v{flex:1;min-width:0;word-break:break-word}
#custPage .cp-miss{color:#b0a48f;background:#F7F4ED;border-radius:4px;padding:0 6px;font-size:11px}
#custPage .cp-row-warn .cp-k{color:#b08d57}

#custPage .cp-form{display:grid;grid-template-columns:62px 1fr;gap:9px 12px;align-items:center}
#custPage .cp-form label{font-size:12px;color:var(--text-muted);text-align:right}
#custPage .cp-form-actions{display:flex;gap:10px;justify-content:flex-end;margin-top:14px}
#custPage .cp-primary{
  background:var(--brand-gold);color:#fff;font-size:13px;
  padding:8px 20px;border-radius:var(--radius-sm);
}
#custPage .cp-primary:hover{background:var(--brand-gold-dark)}
#custPage .cp-ghost{
  background:#fff;color:var(--text-secondary);font-size:13px;
  padding:8px 18px;border:1px solid var(--border);border-radius:var(--radius-sm);
}
#custPage .cp-ghost:hover{background:var(--bg-subtle)}

/* ---------- 跟进 ---------- */
/* 先写字，再选类型，最后提交 —— 顺序跟人的动作一致 */
#custPage .cp-note-form{display:flex;flex-direction:column;gap:8px;margin-bottom:14px}
#custPage .cp-note-form textarea{resize:vertical;min-height:52px}
#custPage .cp-note-bar{display:flex;align-items:center;gap:8px}
#custPage .cp-note-bar select{width:116px;flex:0 0 auto}
#custPage .cp-note-bar button{margin-left:auto}
#custPage .cp-notes{display:flex;flex-direction:column;gap:9px;max-height:340px;overflow:auto}
#custPage .cp-note{background:#FCFAF6;border:1px solid #F1E7D6;border-radius:var(--radius-sm);padding:9px 11px}
#custPage .cp-note-h{display:flex;align-items:center;gap:8px;margin-bottom:4px}
#custPage .cp-kind{
  font-size:11px;border-radius:var(--radius-pill);padding:1px 8px;
  background:var(--bg-subtle);color:var(--brand-gold-dark);
}
#custPage .cp-kind-wechat{background:#e8f5ee;color:#1f9d6b}
#custPage .cp-kind-service{background:#e8f1f8;color:#2c6e9e}
#custPage .cp-kind-gift{background:#fbeef4;color:#a8346a}
#custPage .cp-kind-visit{background:#fdf3e3;color:#b7791f}
#custPage .cp-note-time{font-size:11px;color:var(--text-muted);flex:1;min-width:0}
#custPage .cp-del{color:#c9bda9;font-size:12px;padding:0 2px;flex:0 0 auto}
#custPage .cp-del:hover{color:#c0392b}
#custPage .cp-note-c{font-size:13px;white-space:pre-wrap;word-break:break-word}
#custPage .cp-empty{
  font-size:13px;color:var(--text-muted);text-align:center;
  padding:22px 12px;background:#FCFAF6;border-radius:var(--radius-sm);
}
#custPage .cp-loading{font-size:13px;color:var(--text-muted);padding:20px;text-align:center;width:100%}

/* ---------- 消费 ---------- */
#custPage .cp-otable{display:flex;flex-direction:column}
#custPage .cp-orow{
  display:flex;align-items:center;gap:12px;
  padding:10px 0;border-bottom:1px dashed #F1E7D6;
}
#custPage .cp-orow:last-child{border-bottom:none}
#custPage .cp-omain{flex:1;min-width:0}
#custPage .cp-otitle{font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#custPage .cp-osub{font-size:11px;color:var(--text-muted);margin-top:2px}
#custPage .cp-oamt{font-size:14px;font-weight:600;color:var(--brand-gold-dark);flex:0 0 auto}
#custPage .cp-finsum{
  margin-top:12px;padding-top:12px;border-top:1px solid var(--border);
  font-size:12px;color:var(--text-secondary);
}
#custPage .cp-finsum span{color:var(--text-muted);font-size:11px}
#custPage .cp-frow{
  display:flex;justify-content:space-between;gap:12px;
  font-size:12px;color:var(--text-muted);padding:5px 0;
}
#custPage .cp-frow b{font-weight:600;color:var(--text-secondary)}

/* ---------- 手机端 ---------- */
@media (max-width:640px){
  #custPage .cp-top{height:auto;padding:8px 12px;flex-wrap:wrap;gap:6px}
  #custPage .cp-wrap{padding:12px 12px calc(28px + env(safe-area-inset-bottom,0px))}
  #custPage .cp-hero{padding:14px;gap:12px}
  #custPage .cp-stats{width:100%;justify-content:space-between;gap:10px}
  #custPage .cp-stat{text-align:left;min-width:0}
  #custPage .cp-stat b{font-size:15px}
  #custPage .cp-card{padding:14px}
  #custPage .cp-notes{max-height:none}
}
