/*
 * 客户详情页（2026-11-30 晚重做，页面在 pages.js 的 pages["/customer"]）。
 * 负责人给了一张别家后台的客户详情当参考：要大气、美观、好操作、内容全。三层：身份卡加一排关键数字、页签、每个页签里的卡片。
 * 规矩和客户列表一致：白底细线、留白，颜色只用品牌蓝；标签和说明的字不用很淡的灰；能改的地方鼠标到了才露出笔。
 */
.cdp { --cdp-line: #e9ebef; --cdp-soft: #f1f2f5; }
.workpage.cdp .crumbs { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; color: #8a8f99; font-size: 13px; }
.workpage.cdp .crumbs a { display: inline-flex; align-items: center; gap: 2px; color: #5d616b; font-size: 13px; transition: color .12s ease; }
.workpage.cdp .crumbs a:hover { color: var(--blue); }
.workpage.cdp .crumbs svg { width: 14px; height: 14px; }

/* ---------- 身份卡 ---------- */
.cdp-hero { overflow: hidden; border: 1px solid var(--cdp-line); border-radius: 18px; background: #fff; }
.cdp-id { display: flex; align-items: center; gap: 20px; padding: 26px 28px; }
/* 分级方块：和列表里的小方块一个配色，放大当头像；A 档加一点渐变和投影，有层次不是一块死色。 */
.cdp-avatar { width: 60px; height: 60px; flex: none; display: grid; place-items: center; border-radius: 18px; font-size: 27px; font-weight: 700; line-height: 1; }
.cdp-avatar.t-A { color: #fff; background: linear-gradient(145deg, #1b8ac2, #0f6791); box-shadow: 0 8px 18px -8px rgba(18, 116, 165, .55), inset 0 1px 0 rgba(255, 255, 255, .28); }
.cdp-avatar.t-B { color: #0f6791; background: linear-gradient(145deg, #e3f4fb, #c8e8f6); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7); }
.cdp-avatar.t-C { color: #55606c; background: linear-gradient(145deg, #f1f3f6, #e3e7ec); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7); }
.cdp-avatar.t-D { color: #8a8f99; background: #fff; box-shadow: inset 0 0 0 1.5px #dfe2e7; }
.cdp-avatar.t-N { color: #b3b8c0; border: 1.5px dashed #cdd1d8; font-weight: 500; }
.cdp-avatar.t-shop { color: var(--blue); background: linear-gradient(145deg, #eefafe, #dff2fa); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7); }
.cdp-avatar svg { width: 28px; height: 28px; }
.cdp-who { flex: 1; min-width: 0; }
.cdp-name { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.cdp-name h1 { margin: 0 4px 0 0; color: var(--ink); font-size: 24px; font-weight: 700; line-height: 1.3; letter-spacing: -.01em; overflow-wrap: anywhere; }
.cdp-tag { height: 24px; padding: 0 10px; border-radius: 6px; color: #0f6791; background: #eaf6fb; font-size: 12.5px; font-weight: 500; line-height: 24px; white-space: nowrap; }
.cdp-facts { display: flex; flex-wrap: wrap; row-gap: 4px; margin-top: 10px; color: var(--text-regular); font-size: 13.5px; line-height: 22px; }
.cdp-facts span + span::before { content: ""; display: inline-block; width: 1px; height: 12px; margin: 0 12px; background: #dfe2e7; vertical-align: -1px; }
.cdp-facts a { color: var(--blue); }
.cdp-contact { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 22px; margin-top: 10px; color: var(--text-regular); font-size: 13.5px; line-height: 22px; }
.cdp-phone { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.cdp-phone svg { width: 15px; height: 15px; color: var(--blue); }
.cdp-phone a { color: inherit; }
a.cdp-phone:hover, .cdp-phone a:hover { color: var(--blue); }
.cdp-addr { display: inline-flex; align-items: flex-start; gap: 5px; min-width: 0; }
.cdp-addr svg { width: 15px; height: 15px; flex: none; margin-top: 3px; color: #9aa0aa; }
.cdp-acts { display: flex; flex: none; gap: 10px; }
.cdp-acts .tool-btn { height: 38px; padding: 0 18px; }

/* 一排关键数字：能点的会跳到对应页签 */
.cdp-stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); border-top: 1px solid #eef0f3; background: #fafbfc; }
.cdp-stats.n5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.cdp-stats.n4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cdp-stats.n3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cdp-stats.n2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cdp-stats.n1 { grid-template-columns: minmax(0, 1fr); }
.cdp-stat { min-width: 0; display: flex; flex-direction: column; gap: 8px; padding: 18px 24px 20px; border: 0; border-left: 1px solid #eef0f3; color: inherit; background: none; font: inherit; text-align: left; }
.cdp-stat:first-child { border-left: 0; }
.cdp-stat span { color: #5d616b; font-size: 13px; }
.cdp-stat b { color: var(--ink); font-size: 22px; font-weight: 650; line-height: 1.25; letter-spacing: -.01em; font-variant-numeric: tabular-nums; white-space: nowrap; transition: color .12s ease; }
.cdp-stat b small { margin-left: 4px; color: #5d616b; font-size: 13px; font-weight: 400; letter-spacing: 0; }
.cdp-stat b .cd-yen { margin-right: 2px; color: #8a8f99; font-size: 15px; font-weight: 500; }
.cdp-nil { color: #c9cdd4; font-style: normal; font-weight: 400; }
button.cdp-stat { cursor: pointer; transition: background .15s ease; }
button.cdp-stat:hover { background: #f1f7fb; }
button.cdp-stat:hover b { color: var(--blue); }
button.cdp-stat:focus-visible { outline: 2px solid var(--blue-line); outline-offset: -2px; }

/* ---------- 页签 ---------- */
.cdp-tabs { position: sticky; top: 0; z-index: 4; display: flex; gap: 34px; margin: 6px 0 18px; padding: 0 6px; overflow-x: auto; border-bottom: 1px solid var(--cdp-line); background: var(--surface, #fff); scrollbar-width: none; }
.cdp-tabs::-webkit-scrollbar { display: none; }
.cdp-tabs button { position: relative; flex: none; padding: 16px 0 14px; border: 0; color: #5d616b; background: none; font: inherit; font-size: 15px; cursor: pointer; transition: color .12s ease; }
.cdp-tabs button:hover { color: var(--ink); }
.cdp-tabs button.on { color: var(--ink); font-weight: 600; }
.cdp-tabs button.on::after { content: ""; position: absolute; right: 0; bottom: -1px; left: 0; height: 2px; border-radius: 2px; background: var(--blue); }
.cdp-tabs button:focus-visible { outline: 0; color: var(--blue); }

/* ---------- 页签里的卡片 ---------- */
.cdp-panel { display: grid; gap: 18px; min-width: 0; }
.cdp-panel[hidden] { display: none; }
.cdp-cols { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(300px, 1fr); align-items: start; gap: 18px; }
/* 概况：左右两栏一排一排对齐，同一排的两张卡片一样高；落单的横着占满一排（2026-12-01 负责人要「工整一点」） */
.cdp-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(300px, 1fr); align-items: stretch; gap: 18px; }
.cdp-grid > .cdp-card.wide { grid-column: 1 / -1; }
.cdp-cols.even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cdp-main, .cdp-side { min-width: 0; display: grid; gap: 18px; }
.cdp-main:empty, .cdp-side:empty { display: none; }
.cdp-card { min-width: 0; overflow: hidden; border: 1px solid var(--cdp-line); border-radius: 16px; background: #fff; }
.cdp-card-head { min-height: 54px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 22px 0; }
.cdp-card-head h3 { margin: 0; color: var(--ink); font-size: 16px; font-weight: 600; white-space: nowrap; }
.cdp-card-head > span { color: #1d2129; font-size: 13.5px; }
.cdp-card-body { padding: 12px 22px 20px; }
.cdp-card > .rows { margin: 12px 0 0; }
.cdp-more { display: inline-flex; align-items: center; gap: 2px; padding: 0; border: 0; color: var(--blue); background: none; font: inherit; font-size: 13.5px; cursor: pointer; }
.cdp-more svg { width: 14px; height: 14px; transition: transform .14s ease; }
.cdp-more:hover svg { transform: translateX(2px); }
.cdp-head-links a { margin-left: 16px; color: var(--blue); font-size: 13.5px; }
.cdp-none { margin: 4px 0; color: #74757c; font-size: 14px; }
.cdp-text { margin: 0 0 10px; color: var(--text); font-size: 14.5px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
.cdp-text:last-child { margin-bottom: 0; }
.cdp-foot { margin: 0; padding: 12px 22px 16px; border-top: 1px solid var(--cdp-soft); color: #74757c; font-size: 13px; }

/* 客户信息：一行一项，标签在左、内容在右，两栏；能改的鼠标到了露出笔，点一下就改 */
/* 两栏、三栏之间不留缝，靠每格自己右边的留白隔开：这样每一排底下的横线是连着的一整条，不是一栏一小段（2026-12-01 负责人要「工整一点」）。 */
.cdp-kvs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 0; margin: 0 0 12px; padding: 6px 22px 0; overflow: hidden; }
.cdp-kvs:empty { display: none; }
.cdp-kv { min-width: 0; min-height: 50px; display: grid; grid-template-columns: 76px minmax(0, 1fr); align-items: center; gap: 12px; margin-bottom: -1px; padding-right: 28px; border-bottom: 1px solid var(--cdp-soft); }
.cdp-kv.wide { grid-column: 1 / -1; }
.cdp-kv dt { color: #1d2129; font-size: 14px; } /* 2026-12-03 傍晚起标签用深色字（负责人嫌灰字），主次靠内容加一点粗 */
.cdp-kv dd { min-width: 0; margin: 0; padding: 10px 0; color: var(--ink); font-size: 14.5px; font-weight: 500; line-height: 22px; overflow-wrap: anywhere; }
.cdp-kv dd a { color: var(--blue); }
/* 「高德门店」一行：店名是深色字（点了去门店那边的档案，鼠标上去变蓝），后面的「改绑定」才是蓝的，一眼分得清哪个是动作（2026-12-03）。 */
.cdp-kv dd a.cdp-shop { color: var(--text); text-decoration: none; transition: color .12s ease; }
.cdp-kv dd a.cdp-shop:hover { color: var(--blue); }
.cdp-dot { display: inline-block; width: 3px; height: 3px; margin: 0 10px; border-radius: 50%; background: #c5c9d1; vertical-align: middle; }
.cdp-edit { max-width: calc(100% + 18px); display: inline-flex; align-items: center; gap: 6px; margin: -5px -9px; padding: 5px 9px; border: 0; border-radius: 8px; color: var(--text); background: none; font: inherit; font-size: 14.5px; line-height: 22px; text-align: left; cursor: pointer; transition: background .12s ease, color .12s ease; }
.cdp-edit:hover, .cdp-edit:focus-visible { outline: 0; color: var(--blue); background: #f1f7fb; }
.cdp-edit.empty { color: var(--blue); } /* 没填的写「去填写」（2026-12-03 傍晚起蓝色，原来淡灰的「未填」负责人看着没有填写的欲望） */
.cdp-edit.empty:hover, .cdp-edit.empty:focus-visible { color: var(--blue); }
.cdp-pen { display: inline-flex; flex: none; opacity: 0; transition: opacity .12s ease; }
.cdp-pen svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.cdp-edit:hover .cdp-pen, .cdp-edit:focus-visible .cdp-pen { opacity: 1; }
@media (hover: none) { .cdp-pen { opacity: .6; } }

/*
 * ---------- 客户档案页签里的卡片（2026-12-01 重做，customer-profile.js 的 cpc）----------
 * 负责人：「不仅是前端不好看，交互也很奇怪。」原来一项一个蓝色的「去填写」加弹窗；现在一张卡片一个「编辑」，点了原地变成填写框、整张一起存。
 * 看和填用同一套格子：标签、内容、输入框落在同一个位置上，点「编辑」时版面不跳。没填的是淡色的「未填」，不是链接。
 */
.cdp-card-head h3 { display: inline-flex; align-items: center; gap: 6px; }
.cpc-acts { display: inline-flex; align-items: center; gap: 6px; }
.cpc-btn { height: 32px; display: inline-flex; align-items: center; padding: 0 16px; border: 1px solid #dfe2e7; border-radius: 999px; color: var(--text); background: #fff; font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; transition: border-color .14s ease, color .14s ease, background .14s ease; }
.cpc-btn:hover, .cpc-btn:focus-visible { outline: 0; border-color: var(--blue-line); color: var(--blue); background: #f6fbfe; }
.cpc-btn.quiet { padding: 0 10px; border-color: transparent; color: #1d2129; background: none; font-weight: 400; }
.cpc-btn.quiet:hover, .cpc-btn.quiet:focus-visible { border-color: transparent; color: var(--blue); background: none; }
.cpc { transition: border-color .16s ease, box-shadow .16s ease; }
.cpc.editing { border-color: var(--blue-line); box-shadow: 0 0 0 4px rgba(18, 116, 165, .06); }
.cpc.editing .cpc-acts { visibility: hidden; }
.cpc-tip { width: 20px; height: 20px; display: inline-grid; place-items: center; border-radius: 50%; color: #b3bac4; outline: 0; cursor: help; transition: color .14s ease, background .14s ease; }
.cpc-tip svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.cpc-tip:hover, .cpc-tip:focus { color: var(--blue); background: #e8f6fc; }
.cpc-empty { margin: 0; padding: 6px 22px 22px; color: #1d2129; font-size: 14px; }
.cdp-kvs.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cdp-kvs.one { grid-template-columns: minmax(0, 1fr); }
.cpc-lines + .cdp-kvs { margin-top: 0; padding-top: 2px; border-top: 1px solid var(--cdp-soft); }
.cpc-nil { color: var(--blue); }
/* 看的时候点某一行也能进编辑：鼠标到了字变蓝，「未填」跟着变 */
.cpc-row { cursor: pointer; }
.cpc-row dd { transition: color .12s ease; }
.cpc-row:hover dd, .cpc-row:hover .cpc-nil { color: var(--blue); }
.cpc-row:hover .cpc-nil { text-decoration: underline; text-underline-offset: 3px; }

/* 一行一条的表（联系人、竞品价格）：看的时候是字，填的时候同一套栏宽换成输入框 */
.cpc-lines { margin: 10px 0 0; padding: 0; list-style: none; }
.cpc-line { display: grid; align-items: center; gap: 16px; min-height: 48px; padding: 8px 22px; border-top: 1px solid var(--cdp-soft); color: var(--text); font-size: 14.5px; line-height: 22px; }
.cpc-line > * { min-width: 0; overflow-wrap: anywhere; }
.cpc-line.head { min-height: 38px; padding-top: 0; padding-bottom: 0; border-top: 0; color: #1d2129; background: #f7f8fa; font-size: 13.5px; }
.cpc-line b { color: var(--ink); font-weight: 600; }
.cpc-line .r { text-align: right; font-variant-numeric: tabular-nums; }
.cpc-contacts .cpc-line { grid-template-columns: minmax(0, 1fr) minmax(0, .8fr) minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1.7fr) 56px; }
.cpc-rival .cpc-line { grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr) 130px minmax(0, 1.5fr); }
/* 门店情况的填写框最下面：这家店另外记的几条（名称、内容） */
.cpc-sub { display: flex; align-items: center; gap: 6px; margin: 2px 22px 0; padding-top: 14px; border-top: 1px solid var(--cdp-soft); color: var(--text-regular); font-size: 13.5px; font-weight: 500; }
.cpc-extras.editing { margin-top: 4px; }
.cpc-extras.editing .cpc-line { grid-template-columns: minmax(0, 220px) minmax(0, 1fr) 32px; }
.cpc-extras.editing .cpc-line.ed:first-child { padding-top: 8px; }
.cp-dialog > .xs-trigger, .cp-dialog > select { width: 100%; height: 42px; }
.cpc-rival:not(.editing) .cpc-line > :last-child { padding-left: 24px; }
.cpc-who { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.cpc-flag { height: 20px; padding: 0 7px; border-radius: 5px; color: #0f6791; background: #eaf6fb; font-size: 12px; font-style: normal; font-weight: 500; line-height: 20px; white-space: nowrap; }
.cpc-tels { display: flex; flex-wrap: wrap; gap: 2px 16px; }
.cpc-tel { color: var(--ink); font-variant-numeric: tabular-nums; transition: color .12s ease; }
.cpc-tel:hover { color: var(--blue); }
.cpc-src { color: #1d2129; font-size: 13.5px; }

/* 填的时候 */
.cpc-form { margin: 0; }
.cpc-form .cdp-kv dd { padding: 6px 0; }
.cpc-form .cdp-kv dt label { cursor: pointer; }
.cpc-form input[type="text"], .cpc-form input[type="number"], .cpc-form select, .cpc-form textarea { width: 100%; min-width: 0; height: 36px; padding: 0 11px; border: 1px solid #dcdfe5; border-radius: 9px; color: var(--ink); background: #fff; font: inherit; font-size: 14px; line-height: 1.5; transition: border-color .12s ease, box-shadow .12s ease; }
.cpc-form textarea { display: block; height: auto; min-height: 62px; padding: 8px 11px; line-height: 1.6; resize: vertical; }
.cpc-form input::placeholder, .cpc-form textarea::placeholder { color: #b6bcc5; }
.cpc-form input:hover, .cpc-form select:hover, .cpc-form textarea:hover { border-color: #c5c9d1; }
.cpc-form input:focus, .cpc-form select:focus, .cpc-form textarea:focus { outline: 0; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(18, 116, 165, .1); }
/* 下拉框用自己的小箭头（和筛选区的一样），不用浏览器自带的；能选现成类型的输入框，自带的黑三角藏起来（点右边照样出选项） */
.cpc-form select { padding-right: 34px; -webkit-appearance: none; appearance: none; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2374757c' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='M8 10l4 4 4-4'/%3E%3C/svg%3E") no-repeat right 9px center / 18px; cursor: pointer; }
.cpc-form input::-webkit-calendar-picker-indicator { opacity: 0; cursor: pointer; }
/* 数字框不要浏览器自带的上下小箭头 */
.cpc-form input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
.cpc-form input[type="number"]::-webkit-inner-spin-button, .cpc-form input[type="number"]::-webkit-outer-spin-button { margin: 0; -webkit-appearance: none; }
.cpc-num { display: flex; align-items: center; gap: 8px; }
.cpc-num i { flex: none; min-width: 14px; color: #74757c; font-size: 13.5px; font-style: normal; }
.cpc-lines.editing .cpc-line { gap: 8px; }
.cpc-lines.editing .cpc-line.ed { min-height: 0; padding-top: 6px; padding-bottom: 6px; border-top-color: transparent; }
.cpc-lines.editing .cpc-line.head + .cpc-line.ed { padding-top: 12px; }
.cpc-lines.editing .cpc-line:not(.ed):not(.head) + .cpc-line.ed { padding-top: 12px; border-top-color: var(--cdp-soft); }
.cpc-contacts.editing .cpc-line { grid-template-columns: minmax(0, 1fr) minmax(0, .8fr) minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1.7fr) 96px; }
.cpc-contacts.editing .cpc-line:not(.ed) { gap: 8px; color: #5d616b; }
.cpc-contacts.editing .cpc-line:not(.ed):not(.head) > * { padding-left: 12px; }
.cpc-rival.editing .cpc-line { grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr) 104px 84px minmax(0, 1.5fr) 32px; }
.cpc-lines.editing .cpc-line.head > span { padding-left: 12px; }
.cpc-line-acts { display: flex; align-items: center; justify-content: flex-end; gap: 4px; }
.cpc-check { display: inline-flex; cursor: pointer; }
.cpc-check input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.cpc-check span { height: 28px; padding: 0 10px; border: 1px solid #dfe2e7; border-radius: 999px; color: #8a8f99; font-size: 12.5px; line-height: 26px; white-space: nowrap; transition: border-color .12s ease, color .12s ease, background .12s ease; }
.cpc-check:hover span { border-color: var(--blue-line); color: var(--blue); }
.cpc-check input:checked + span { border-color: var(--blue-line); color: #0f6791; background: #eaf6fb; font-weight: 500; }
.cpc-check input:focus-visible + span { box-shadow: 0 0 0 3px rgba(18, 116, 165, .14); }
.cpc-del { width: 30px; height: 30px; flex: none; padding: 0; border: 0; border-radius: 8px; color: #9aa0aa; background: none; font-size: 18px; line-height: 1; cursor: pointer; transition: color .12s ease, background .12s ease; }
.cpc-del:hover, .cpc-del:focus-visible { outline: 0; color: var(--danger); background: var(--danger-bg); }
.cpc-add { height: 32px; display: inline-flex; align-items: center; gap: 4px; margin: 6px 0 14px 22px; padding: 0 12px; border: 1px dashed #cfd4db; border-radius: 9px; color: var(--blue); background: none; font: inherit; font-size: 13.5px; cursor: pointer; transition: border-color .12s ease, background .12s ease; }
.cpc-add::before { content: "+"; font-size: 16px; line-height: 1; }
.cpc-add:hover, .cpc-add:focus-visible { outline: 0; border-color: var(--blue); background: #f6fbfe; }
.cpc-foot { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 14px 22px 16px; border-top: 1px solid var(--cdp-soft); background: #fbfcfd; }
.cpc-foot-note { flex: 1; min-width: 0; color: #8a8f99; font-size: 13px; }
.cpc-foot .cp-btn { min-width: 76px; }
.cdp-golink { padding: 0; border: 0; color: var(--blue); background: none; font: inherit; cursor: pointer; }
.cdp-golink:hover { text-decoration: underline; text-underline-offset: 3px; }
.cdp-who-name { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0 12px; }

/* 管理字段的弹窗：比单项的宽 */
.cp-dialog.wide { width: min(820px, 100%); max-height: calc(100vh - 40px); overflow: auto; }
.cp-dialog.wide .cp-hint { margin: -6px 0 16px; color: #74757c; font-size: 13.5px; }
.cp-dialog.wide .cp-btn.ghost { color: var(--blue); }
.cp-field-list { display: grid; gap: 8px; margin-bottom: 16px; }
.cp-field-row { display: grid; grid-template-columns: minmax(0, 1fr) 110px auto auto; align-items: center; gap: 10px; }
.cp-field-row > span { color: #5d616b; font-size: 13.5px; }
.cp-field-none { margin: 0; color: #74757c; font-size: 14px; }
.cp-field-add { display: grid; grid-template-columns: minmax(0, 1.4fr) 110px minmax(0, .8fr) auto; align-items: center; gap: 10px; padding-top: 16px; border-top: 1px solid var(--cdp-soft, #f1f2f5); }
.cp-dialog .cp-field-row input, .cp-dialog .cp-field-add input { height: 40px; padding: 0 12px; }
.cp-dialog .cp-field-add select { height: 40px; }
@media (max-width: 760px) {
  .cp-field-row { grid-template-columns: minmax(0, 1fr) auto auto; }
  .cp-field-row > span { display: none; }
  .cp-field-add { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}

/* 小列表：最近拜访、最近拿货、关联的开单客户 */
.cdp-list { margin: 0; padding: 0; list-style: none; }
.cdp-list li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: baseline; gap: 14px; padding: 10px 0; border-top: 1px solid var(--cdp-soft); color: var(--text); font-size: 14px; line-height: 21px; }
.cdp-list li:first-child { border-top: 0; padding-top: 4px; }
.cdp-list li:last-child { padding-bottom: 2px; }
.cdp-list b { min-width: 74px; color: var(--ink); font-weight: 500; font-variant-numeric: tabular-nums; }
.cdp-list span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cdp-list em { color: var(--text-regular); font-style: normal; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cdp-list li > a { grid-column: 1 / span 2; overflow: hidden; color: var(--blue); text-overflow: ellipsis; white-space: nowrap; }
/* 档案填了几项 */
.cdp-progress { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.cdp-progress b { color: var(--ink); font-size: 26px; font-weight: 650; line-height: 1.2; font-variant-numeric: tabular-nums; }
.cdp-progress span { color: #5d616b; font-size: 13.5px; }
.cdp-progress i { flex: 0 0 100%; height: 6px; margin-top: 6px; overflow: hidden; border-radius: 6px; background: #eef0f3; }
.cdp-progress em { display: block; height: 100%; border-radius: inherit; background: var(--blue); }
/* 应收按欠了多久分：五格 */
.cdp-ages { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); margin-top: 14px; border-top: 1px solid var(--cdp-soft); }
.cdp-ages > div { min-width: 0; padding: 16px 22px 18px; border-left: 1px solid var(--cdp-soft); }
.cdp-ages > div:first-child { border-left: 0; }
.cdp-ages span { display: block; color: #5d616b; font-size: 13px; }
.cdp-ages b { display: block; margin-top: 6px; color: var(--ink); font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cdp-ages .late b { color: #d5373a; }
.cdp-ages.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cdp-ages.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cdp-ages.two b, .cdp-ages.four b { font-size: 22px; }
.cdp-ages b small { margin-left: 8px; color: #5d616b; font-size: 13px; font-weight: 400; }
/* 合同快到期、已过期：直接写出来是几天，字是红的（不只靠颜色） */
.cdp-warn { margin-left: 12px; color: #d5373a; font-size: 13.5px; font-style: normal; white-space: nowrap; }
.cdp-grid > .cdp-card > .rows { margin-top: 12px; }
/* 最近收款：日期、类型、摘要、金额；手机上摘要那一栏不出（放不下） */
.cdp-receipts li { grid-template-columns: 104px 56px minmax(0, 1fr) 120px; }
.cdp-ages b.nil { color: #c9cdd4; font-weight: 400; }

/* 页签里沿用的老卡片：间距并进这一页的节奏 */
/* 进出门打卡那张表：标题旁边的说明用正常的灰，没打、没写的格子空着（不拿浅灰字填满）。 */
.cdp .cp-card { border-color: var(--cdp-line); border-radius: 16px; }
.cdp .cp-head span { color: #74757c; font-size: 13px; }
.cdp .cp-miss { display: none; }
.cdp .cp-none { color: #74757c; }
.cdp .cp-card, .cdp .card, .cdp .cp-punch { margin: 0; }
.cdp .card { border-color: var(--cdp-line); border-radius: 16px; }

/* ---------- 窄屏、手机 ---------- */
@media (max-width: 1360px) {
  .cdp-stats, .cdp-stats.n5, .cdp-stats.n6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cdp-stats.n6 .cdp-stat:nth-child(n + 4), .cdp-stats.n5 .cdp-stat:nth-child(n + 4) { border-top: 1px solid #eef0f3; }
  .cdp-stats.n6 .cdp-stat:nth-child(4), .cdp-stats.n5 .cdp-stat:nth-child(4) { border-left: 0; }
}
@media (max-width: 1100px) {
  .cdp-kvs.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cdp-kvs.three .cdp-kv.pad { display: none; }
  .cdp-cols, .cdp-cols.even, .cdp-grid { grid-template-columns: minmax(0, 1fr); }
  .cdp-id { flex-wrap: wrap; }
  .cdp-acts { flex-basis: 100%; }
}
@media (max-width: 760px) {
  .cdp-id { gap: 14px; padding: 18px 16px 16px; }
  .cdp-avatar { width: 48px; height: 48px; border-radius: 14px; font-size: 22px; }
  .cdp-who { flex-basis: calc(100% - 62px); }
  .cdp-name h1 { font-size: 20px; }
  .cdp-acts .tool-btn { flex: 1; justify-content: center; height: 42px; }
  .cdp-stats, .cdp-stats.n3, .cdp-stats.n4, .cdp-stats.n5, .cdp-stats.n6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cdp-stats .cdp-stat { padding: 14px 16px; border-top: 1px solid #eef0f3; border-left: 1px solid #eef0f3; }
  .cdp-stats .cdp-stat:nth-child(odd) { border-left: 0; }
  .cdp-stats .cdp-stat:nth-child(-n + 2) { border-top: 0; }
  .cdp-stat b { font-size: 19px; }
  .cdp-tabs { gap: 24px; margin: 4px -4px 14px; }
  .cdp-kvs, .cdp-kvs.three { grid-template-columns: minmax(0, 1fr); padding: 6px 16px 10px; }
  .cdp-kv { padding-right: 0; }
  .cdp-kv.pad { display: none; }
  /* 手机上一行一条的表换成一条一块：表头不出，名字一行、电话一行，身份、微信、备注前面带上是什么 */
  .cpc-empty { padding: 4px 16px 18px; }
  .cpc-line.head { display: none; }
  .cpc-lines .cpc-line, .cpc-lines.editing .cpc-line { grid-template-columns: minmax(0, 1fr); gap: 4px; padding: 12px 16px; }
  .cpc-lines .cpc-line > span:empty { display: none; }
  .cpc-line [data-l]:not(:empty)::before { content: attr(data-l) "　"; color: #8a8f99; font-size: 13px; }
  .cpc-line .r { text-align: left; }
  .cpc-src { position: absolute; top: 13px; right: 16px; }
  .cpc-lines .cpc-line { position: relative; }
  .cpc-lines.editing .cpc-line.ed { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 12px 16px; border-top-color: var(--cdp-soft); }
  .cpc-lines.editing .cpc-line.ed :is(input[data-k="phone"], input[data-k="wechat"], input[data-k="note"], input[data-k="brand"], input[data-k="product"]) { grid-column: 1 / -1; }
  .cpc-lines.editing .cpc-line.ed .cpc-line-acts { grid-column: 1 / -1; }
  .cpc-contacts.editing .cpc-line:not(.ed):not(.head) > * { padding-left: 0; }
  .cpc-add { margin-left: 16px; }
  .cpc-foot { padding: 12px 16px 14px; }
  .cpc-foot-note { display: none; }
  .cpc-foot .cp-btn { flex: 1; height: 42px; }
  .cpc-form input[type="text"], .cpc-form input[type="number"], .cpc-form select { height: 42px; font-size: 16px; }
  .cpc-form textarea { font-size: 16px; }
  .cdp-card-head { padding: 14px 16px 0; }
  .cdp-card-body { padding: 10px 16px 16px; }
  .cdp-ages, .cdp-ages.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cdp-receipts li { grid-template-columns: 100px 56px minmax(0, 1fr); padding-right: 16px; padding-left: 16px; }
  .cdp-receipts li > span:nth-child(3) { display: none; }
  .cdp-ages > div { padding: 12px 16px; border-top: 1px solid var(--cdp-soft); }
  .cdp-ages > div:nth-child(odd) { border-left: 0; }
  .cdp-ages > div:nth-child(-n + 2) { border-top: 0; }
}

/* 「跟进」页签（销售自己的跟进资料）：表单用客户档案那套输入框，日期框补一条同样的样子。 */
.cdp-follow input[type="date"] { width: 100%; min-width: 0; height: 36px; padding: 0 11px; border: 1px solid #dcdfe5; border-radius: 8px; color: var(--text); background: #fff; font: inherit; font-size: 14px; }
.cdp-follow input[type="date"]:hover { border-color: #c5c9d1; }
.cdp-follow input[type="date"]:focus { outline: 0; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(18, 116, 165, .1); }
.cdp-follow .cdp-kv dt label { cursor: pointer; }
.cdp-follow .cpc-foot-note.bad { color: #b42318; }
/* 「跟进」页签里前任记的跟进（交接时带过来的，只读）。 */
.cdp-before li { grid-template-columns: 200px 96px 120px minmax(0, 1fr); align-items: start; }
.cdp-before-note { white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 760px) { .cdp-before li { grid-template-columns: minmax(0, 1fr) 84px; } .cdp-before li span:nth-child(3) { display: none; } .cdp-before li .cdp-before-note { grid-column: 1 / -1; } .cdp-before li.head span:nth-child(4) { display: none; } }

