/*
 * 新万希销售助手。布局照金聚诚管理后台（百炼风格，10-17 之后的版本）：
 * 顶栏白底；列表页、总览页整页浅灰底 #f5f6f8，上面放白卡。
 * 配色跟新万希 logo 走：--brand 是 logo 的蓝（#30ACD8），--accent 是 logo 的橙（#EA9838）。
 * logo 蓝偏亮，配白字看不清，所以按钮、链接、选中态用同一色相压深一档的 --blue；橙色只做点缀（选中标记、名片、小标签），
 * 不拿来当主按钮，也不拿来表示警告。全站原来的宝蓝色是用 工具/logo/recolor.py 统一换过来的，明暗对比和换之前一样。
 * 金额一律等宽数字；涨红跌绿（国内习惯）。
 */
:root {
  color-scheme: light;
  --brand: #30acd8; --accent: #ea9838; --accent-deep: #a55f0a; --accent-soft: #fff4e3; --accent-line: #f7dcb4;
  --blue: #1274a5; --blue-hover: #106590; --blue-active: #0e5b81; --blue-soft: #e4f6fc; --blue-tint: #eefafe; --blue-line: #b9e3f3;
  --ink: #14151c; --text: #1d2129; --text-regular: #43444a; --text-muted: #74757c; --text-faint: #a9abb1;
  --page: #f5f6f8; --surface: #fff; --surface-soft: #f7f7f8; --fill: #f1f1f2; --fill-soft: #f5f5f6; --hover: #f6f6f7; --row-hover: #fafbfc;
  --border: #ececef; --border-strong: #dfe0e4; --border-deep: #c9cbd1; --row-line: #f0f1f4; --cell-line: #f2f3f5;
  --success: #16865c; --success-bg: #e8f7ef; --danger: #d13c4f; --danger-bg: #fdeeef; --up: #e5484d; --down: #16a34a;
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --ease: cubic-bezier(.4, 0, .2, 1);
  --shadow-md: 0 12px 32px -12px rgba(20, 21, 28, .16);
  --shadow-lg: 0 20px 48px -16px rgba(20, 21, 28, .22);
  --topbar: 60px;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { color: var(--text); background: var(--surface); font-family: var(--font); font-size: 14px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
.num, .tabular { font-variant-numeric: tabular-nums; }
.ell { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* ---------- 按钮 ---------- */
.btn { height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 18px; border: 1px solid #e1e2e6; border-radius: 999px; background: var(--surface); color: var(--text); font-size: 14px; font-weight: 500; white-space: nowrap; transition: background .16s, border-color .16s, color .16s; }
.btn svg { width: 17px; height: 17px; }
.btn:hover { background: var(--hover); }
.btn-primary { border-color: var(--blue); color: #fff; background: var(--blue); }
.btn-primary:hover { border-color: var(--blue-hover); background: var(--blue-hover); }
.btn-primary:active { background: var(--blue-active); }
.btn-primary:disabled { opacity: .5; cursor: default; }
.btn-block { width: 100%; height: 42px; }
.btn-sm { height: 30px; padding: 0 12px; font-size: 13px; }
.btn-link { border-color: transparent; background: transparent; color: var(--blue); }
.btn-link:hover { background: #f3f3f5; }
.icon-round { width: 40px; height: 40px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--text-muted); transition: background .14s, color .14s; }
.icon-round:hover { color: var(--ink); background: var(--fill); }
:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(18, 116, 165, .16); }
/* 输入框、文本框不套上面那圈光圈（2026-12-03 负责人：「前端不要有这种框内方框，弄自然点。」「你整个网站里检查一下，还有没有这种的」）：
   这些框大多包在一个格子里（搜索框、标签框、提示词框……），点中时由外面的格子变色；里面再亮一圈就成了框里套框。
   用 :where 压低优先级，各页自己写了点中样子的单独格子照旧。搜索框不要系统自带的样子（Safari 会给 search 画一层）。 */
:where(input:not([type=checkbox], [type=radio], [type=range], [type=color], [type=file], [type=button], [type=submit], [type=reset]), textarea, [contenteditable="true"]):focus-visible { box-shadow: none; }
:where(input[type=search]) { -webkit-appearance: none; appearance: none; }

/* ---------- 登录 ---------- */
.field { display: grid; gap: 6px; text-align: left; }
.field span { color: var(--text-regular); font-size: 13px; font-weight: 500; }
.field input { height: 42px; padding: 0 14px; border: 0; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--border-strong); background: var(--surface); outline: none; transition: box-shadow .16s; }
.field input:focus { box-shadow: inset 0 0 0 1px var(--blue), 0 0 0 3px rgba(18, 116, 165, .1); }
.form-error { min-height: 20px; margin: 8px 0 6px; color: var(--danger); font-size: 13px; text-align: left; }
.gate-foot { margin: 22px 0 0; color: var(--text-faint); font-size: 12px; }

/* ---------- 外壳 ---------- */
.shell { height: 100%; display: flex; flex-direction: column; }
.topbar { position: relative; z-index: 20; height: var(--topbar); flex: 0 0 auto; display: flex; align-items: center; gap: 28px; padding: 0 20px 0 24px; background: var(--surface); transition: box-shadow .2s; }
.topbar.raised { box-shadow: 0 1px 0 #ecedf0, 0 8px 18px -14px rgba(20, 21, 28, .22); }
.logo { display: flex; align-items: center; gap: 10px; min-width: 150px; }
.logo img { width: 32px; height: 32px; }
.logo b { display: block; font-size: 16px; font-weight: 700; line-height: 1.1; letter-spacing: .02em; }
.logo small { display: block; color: var(--text-muted); font-size: 11px; line-height: 1.2; }
.sections { display: flex; align-items: center; gap: 2px; }
.sections a { height: 36px; display: inline-flex; align-items: center; padding: 0 14px; border-radius: 18px; color: var(--text-muted); font-size: 15px; font-weight: 500; transition: color .14s, background .14s; }
.sections a:hover { color: var(--text); background: var(--hover); }
.sections a.active { color: var(--blue); font-weight: 600; }
.top-right { position: relative; margin-left: auto; display: flex; align-items: center; gap: 12px; }
.search { position: relative; width: 240px; height: 36px; display: flex; align-items: center; gap: 8px; padding: 0 8px 0 12px; border: 1px solid #e8e9ec; border-radius: 18px; background: var(--surface); color: var(--text-muted); transition: border-color .14s, box-shadow .14s; }
.search:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(18, 116, 165, .1); }
.search svg { width: 16px; height: 16px; }
.search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: none; background: transparent; font-size: 13px; color: var(--text); }
.search input::-webkit-search-cancel-button { display: none; }
.search kbd { height: 20px; padding: 0 6px; border-radius: 6px; background: var(--fill); color: var(--text-muted); font: 11px/20px var(--font); }
.search-pop { position: absolute; top: calc(100% + 8px); right: 0; width: 420px; max-height: 460px; overflow: auto; padding: 6px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-lg); }
.sp-group { padding: 8px 10px 4px; color: var(--text-faint); font-size: 12px; }
.sp-item { width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 0; border-radius: 10px; background: transparent; text-align: left; }
.sp-item:hover, .sp-item.on { background: var(--hover); }
.sp-item b { display: block; overflow: hidden; color: var(--text); font-size: 14px; font-weight: 500; white-space: nowrap; text-overflow: ellipsis; }
.sp-item small { display: block; color: var(--text-muted); font-size: 12px; }
.sp-item .sp-main { flex: 1; min-width: 0; }
.sp-empty { padding: 18px; color: var(--text-muted); font-size: 13px; text-align: center; }
.data-status { position: relative; height: 32px; display: flex; align-items: center; gap: 8px; padding: 0 12px; border-radius: 16px; background: var(--fill-soft); color: var(--text-muted); font-size: 12px; white-space: nowrap; cursor: default; }
.data-status b { color: var(--text-regular); font-weight: 500; font-variant-numeric: tabular-nums; }
.ds-sep { width: 1px; height: 12px; background: var(--border-strong); }
.dot { width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: var(--text-faint); }
.dot.ok { background: var(--success); box-shadow: 0 0 0 3px rgba(22, 134, 92, .14); }
.dot.bad { background: var(--danger); box-shadow: 0 0 0 3px rgba(209, 60, 79, .14); }
.ds-pop { position: absolute; top: calc(100% + 8px); right: 0; z-index: 30; width: 320px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-lg); color: var(--text-regular); font-size: 13px; line-height: 1.7; white-space: normal; opacity: 0; visibility: hidden; transform: translateY(-4px); transition: opacity .16s, transform .16s, visibility 0s linear .16s; }
.data-status:hover .ds-pop, .data-status:focus .ds-pop { opacity: 1; visibility: visible; transform: none; transition: opacity .16s, transform .16s; }
.ds-pop h4 { margin: 0 0 2px; color: var(--text); font-size: 13px; font-weight: 600; }
.ds-pop p { margin: 0 0 10px; }
.ds-pop p:last-child { margin: 0; }
.account { display: flex; align-items: center; gap: 10px; padding: 2px 2px 2px 8px; border: 0; border-radius: 20px; background: transparent; }
.account:hover { background: var(--hover); }
.account-text { display: grid; text-align: right; line-height: 1.25; }
.account-text b { font-size: 13px; font-weight: 600; color: var(--text); }
.account-text small { color: #9aa1ad; font-size: 11px; }
.avatar { width: 32px; height: 32px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; color: #fff; background: linear-gradient(135deg, #0f618a, #1586bf); font-size: 13px; font-weight: 600; }
.menu { position: absolute; top: calc(100% + 8px); right: 0; z-index: 30; width: 180px; padding: 6px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-lg); }
.menu button { width: 100%; height: 38px; display: flex; align-items: center; gap: 10px; padding: 0 12px; border: 0; border-radius: 10px; background: transparent; font-size: 14px; }
.menu button svg { width: 17px; height: 17px; color: var(--text-muted); }
.menu button:hover { background: var(--hover); }

.content { flex: 1; min-height: 0; overflow-y: auto; background: var(--page); scrollbar-width: thin; scrollbar-color: #d4d5da transparent; }
.page { width: min(1480px, 100%); margin: 0 auto; padding: 22px 32px 48px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin: 4px 0 18px; }
.page-head h1 { margin: 0; font-size: 24px; font-weight: 600; letter-spacing: .01em; }
.page-head p { margin: 4px 0 0; color: var(--text-muted); font-size: 13px; }
.page-actions { display: flex; align-items: center; gap: 10px; }
.crumbs { display: flex; align-items: center; gap: 6px; margin: 0 0 14px; color: var(--text-muted); font-size: 13px; }
.crumbs a:hover { color: var(--blue); }
.crumbs svg { width: 14px; height: 14px; }

/* ---------- 卡片 ---------- */
.card { border: 1px solid var(--border); border-radius: 18px; background: var(--surface); }
.card-head { min-height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 22px 0; }
.card-head h3 { margin: 0; font-size: 16px; font-weight: 600; white-space: nowrap; }
.card-head .sub { text-align: right; }
.card-head .sub { color: var(--text-muted); font-size: 12px; font-weight: 400; }
.card-head a.more { color: var(--blue); font-size: 13px; }
.card-head a.more:hover { text-decoration: underline; }
.card-body { padding: 14px 22px 20px; }
.grid { display: grid; gap: 16px; }
.g-main { grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-detail { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; }
.stack { display: grid; gap: 16px; align-content: start; }
.sticky { position: sticky; top: 16px; }

/* KPI 条：一张白卡，等分格子，格间细竖线 */
.kpis { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); padding: 22px 0; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); }
.kpi { min-width: 0; padding: 0 26px; border-left: 1px solid var(--cell-line); }
.kpi:first-child { border-left: 0; }
.kpi-label { display: flex; align-items: center; gap: 6px; color: var(--text-regular); font-size: 14px; }
.kpi-value { margin-top: 6px; overflow: hidden; color: var(--ink); font-size: 32px; font-weight: 700; line-height: 1.15; letter-spacing: -.02em; white-space: nowrap; font-variant-numeric: tabular-nums; }
.kpi-value small { margin-left: 3px; color: var(--text-regular); font-size: 14px; font-weight: 500; letter-spacing: 0; }
.kpi-value .yen { margin-right: 2px; font-size: .6em; font-weight: 600; }
.kpi-value.bad { color: var(--danger); }
.kpi-foot { margin-top: 6px; overflow: hidden; color: var(--text-muted); font-size: 13px; white-space: nowrap; text-overflow: ellipsis; }
.kpi-foot b { font-weight: 600; font-variant-numeric: tabular-nums; }
.up { color: var(--up); } .down { color: var(--down); } .bad { color: var(--danger); } .good { color: var(--success); } .muted { color: var(--text-muted); } .faint { color: var(--text-faint); }
.kpi a.kpi-link { color: inherit; }
.kpi:hover .kpi-label .go { opacity: 1; }
.kpi-label .go { margin-left: auto; color: var(--blue); font-size: 12px; opacity: 0; transition: opacity .14s; }

/* ---------- 分类胶囊、筛选行 ---------- */
.seg { display: inline-flex; gap: 2px; padding: 4px; border-radius: 14px; background: #e9ecf1; }
.seg button { height: 34px; padding: 0 16px; border: 0; border-radius: 10px; background: transparent; color: var(--text-regular); font-size: 14px; font-weight: 500; }
.seg button.on { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: 0 1px 2px rgba(20, 21, 28, .08), 0 2px 8px rgba(20, 21, 28, .04); }
.seg button i { margin-left: 6px; color: var(--text-muted); font-style: normal; font-weight: 500; font-variant-numeric: tabular-nums; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.pill { height: 34px; display: inline-flex; align-items: center; gap: 6px; padding: 0 14px; border: 0; border-radius: 17px; background: var(--surface); color: var(--text); font-size: 14px; transition: background .14s, color .14s; }
.pill i { color: var(--blue); font-style: normal; font-weight: 600; font-variant-numeric: tabular-nums; }
.pill i.alarm { color: var(--danger); }
.pill:hover { background: #edf1f8; }
.pill.on { background: var(--blue); color: #fff; font-weight: 600; }
.pill.on i { color: #fff; }
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 14px; }
.f-search { flex: 1 1 180px; max-width: 300px; height: 40px; display: flex; align-items: center; gap: 8px; padding: 0 14px; border-radius: 20px; background: var(--surface); color: var(--text-muted); }
.f-search:focus-within { box-shadow: inset 0 0 0 1px var(--blue); }
.f-search svg { width: 16px; height: 16px; }
.f-search input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; color: var(--text); }
.f-select { height: 40px; padding: 0 34px 0 16px; border: 0; border-radius: 20px; background: var(--surface) 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 12px center / 16px; color: var(--text); appearance: none; outline: none; cursor: pointer; }
.f-select:focus { box-shadow: inset 0 0 0 1px var(--blue); }
.f-clear { height: 40px; padding: 0 8px; border: 0; background: transparent; color: var(--blue); font-size: 13px; }
.f-count { margin-left: auto; color: var(--text-muted); font-size: 13px; white-space: nowrap; }
.f-count b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- 列表（grid 行） ---------- */
.list { overflow: hidden; }
.lx-tr { display: grid; align-items: center; gap: 20px; padding: 16px 22px; border-top: 1px solid var(--row-line); transition: background .12s; }
.lx-head { padding-top: 13px; padding-bottom: 13px; border-top: 0; background: var(--surface); color: var(--text-regular); font-size: 13px; font-weight: 600; }
.lx-row { cursor: pointer; }
.lx-row:hover { background: var(--row-hover); }
.lx-main { min-width: 0; }
.lx-name { display: flex; align-items: center; gap: 8px; overflow: hidden; color: var(--text); font-size: 15px; font-weight: 600; }
.lx-name span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.lx-sub { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 4px; color: var(--text-muted); font-size: 13px; }
.lx-sub span { display: inline-flex; align-items: center; gap: 5px; }
.lx-sub svg { width: 14px; height: 14px; color: var(--blue); }
.lx-num { color: var(--blue); font-weight: 600; }
.lx-r { text-align: right; font-variant-numeric: tabular-nums; }
.lx-money { color: var(--text); font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.lx-small { display: block; margin-top: 2px; color: var(--text-muted); font-size: 12px; font-weight: 400; white-space: nowrap; }
.lx-empty { padding: 56px 22px; color: var(--text-muted); text-align: center; }
.tag { height: 22px; display: inline-flex; align-items: center; padding: 0 8px; border-radius: 4px; background: #f2f3f5; color: var(--text); font-size: 12px; font-weight: 500; white-space: nowrap; }
.tag.ok { background: var(--success-bg); color: #12784b; }
.tag.info { background: #dff7ff; color: var(--blue); }
.tag.bad { background: var(--danger-bg); color: var(--danger); }
.tag.dark { background: var(--ink); color: #fff; }
.tier { width: 26px; height: 26px; display: inline-grid; place-items: center; border-radius: 8px; font-size: 13px; font-weight: 700; }
.tier.A { background: var(--ink); color: #fff; }
.tier.B { background: #dfeff4; color: #134762; }
.tier.C { background: #f2f3f5; color: var(--text-regular); }
.tier.D { background: var(--surface); color: var(--text-faint); box-shadow: inset 0 0 0 1px var(--border-strong); }
.bar { position: relative; height: 6px; overflow: hidden; border-radius: 3px; background: var(--fill); }
.bar > i { position: absolute; inset: 0 auto 0 0; border-radius: 3px; background: var(--blue); }
.bar > i.ok { background: var(--success); }
.bar > i.bad { background: var(--danger); }
.bar > b { position: absolute; top: -3px; bottom: -3px; width: 2px; border-radius: 1px; background: var(--ink); }
.pager { display: flex; justify-content: flex-end; align-items: center; gap: 6px; padding: 14px 22px; border-top: 1px solid var(--row-line); color: var(--text-muted); font-size: 13px; }
.pager button { min-width: 32px; height: 32px; padding: 0 8px; border: 1px solid transparent; border-radius: 8px; background: transparent; font-variant-numeric: tabular-nums; }
.pager button:hover:not(:disabled) { background: var(--hover); }
.pager button.on { border-color: var(--blue); color: var(--blue); background: var(--surface); font-weight: 600; }
.pager button:disabled { color: var(--text-faint); cursor: default; }

/* ---------- 小列表（总览卡片里） ---------- */
.mini { margin: 0; padding: 0; list-style: none; }
.mini li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--row-line); }
.mini li:first-child { border-top: 0; }
.mini li.link { cursor: pointer; border-radius: 10px; }
.mini li.link:hover .mini-name { color: var(--blue); }
.mini-name { overflow: hidden; color: var(--text); font-size: 14px; font-weight: 500; white-space: nowrap; text-overflow: ellipsis; transition: color .12s; }
.mini-sub { margin-top: 1px; overflow: hidden; color: var(--text-muted); font-size: 12px; white-space: nowrap; text-overflow: ellipsis; }
.mini-val { text-align: right; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mini-val small { display: block; color: var(--text-muted); font-size: 12px; font-weight: 400; }
.rank { width: 20px; height: 20px; display: inline-grid; place-items: center; margin-right: 8px; border-radius: 6px; background: var(--fill); color: var(--text-muted); font-size: 12px; font-weight: 600; }
.rank.top { background: var(--blue); color: #fff; }

/* 打卡流 */
.feed { margin: 0; padding: 0; list-style: none; }
.feed li { position: relative; padding: 0 0 16px 22px; }
.feed li::before { content: ""; position: absolute; left: 4px; top: 8px; bottom: -8px; width: 1px; background: #dfe2e6; }
.feed li:last-child::before { display: none; }
.feed li::after { content: ""; position: absolute; left: 0; top: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--blue); }
.feed li.dim::after { background: var(--border-deep); }
.feed-head { display: flex; align-items: baseline; gap: 8px; }
.feed-head b { font-size: 14px; font-weight: 600; }
.feed-head time { margin-left: auto; color: var(--text-faint); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.feed-body { margin-top: 2px; color: var(--text-regular); font-size: 13px; line-height: 1.7; }
.feed-body .no { color: var(--text-faint); }

/* 图表 */
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart rect, .chart text { stroke: none; }
.chart text { fill: var(--text-muted); font-size: 11px; font-family: var(--font); font-variant-numeric: tabular-nums; }
.chart .grid-line { stroke: #e5e6eb; stroke-dasharray: 4 4; stroke-width: 1; }
.chart .bar-main { fill: var(--blue); }
.chart .bar-bulk { fill: var(--blue-line); }
.chart .bar-zero { fill: var(--fill); }
.chart .val { fill: var(--text-regular); font-size: 11px; font-weight: 600; }
.chart g.col:hover .bar-main { fill: var(--blue-hover); }
.legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; margin-top: 10px; color: var(--text-muted); font-size: 12px; }
.legend i { display: inline-block; width: 10px; height: 10px; margin-right: 6px; border-radius: 3px; vertical-align: -1px; }
.donut-wrap { display: grid; grid-template-columns: 150px minmax(0, 1fr); align-items: center; gap: 20px; }
.donut-legend { display: grid; gap: 8px; }
.donut-legend div { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto 40px; align-items: center; gap: 10px; font-size: 13px; }
.donut-legend i { width: 10px; height: 10px; border-radius: 3px; }
.donut-legend span:nth-child(2) { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.donut-legend b { font-weight: 600; font-variant-numeric: tabular-nums; }
.donut-legend em { color: var(--text-muted); font-style: normal; text-align: right; font-variant-numeric: tabular-nums; }
.chart-note { margin: 10px 0 0; color: var(--text-muted); font-size: 12px; }

/* ---------- 客户详情 ---------- */
.d-head { display: flex; align-items: flex-start; gap: 18px; margin: 0 0 18px; }
.d-avatar { width: 64px; height: 64px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 16px; background: #f2f3f5; color: #86909c; font-size: 26px; font-weight: 600; }
.d-title { flex: 1; min-width: 0; }
.d-title h1 { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 2px 0 0; font-size: 28px; font-weight: 700; line-height: 1.3; }
.d-title h1 .tag { font-size: 13px; }
.d-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 8px; color: var(--text-regular); font-size: 13.5px; }
.d-meta span { display: inline-flex; align-items: center; gap: 6px; }
.d-meta svg { width: 15px; height: 15px; color: var(--text-muted); }
.dl { display: grid; grid-template-columns: 76px minmax(0, 1fr); margin: 0; }
.dl dt, .dl dd { padding: 9px 0; border-top: 1px solid var(--cell-line); font-size: 13.5px; }
.dl dt { color: var(--text-muted); }
.dl dd { margin: 0; color: var(--text); word-break: break-word; }
.dl dt:first-of-type, .dl dd:first-of-type { border-top: 0; }
.checks { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; margin-top: 12px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.check i { width: 18px; height: 18px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; background: var(--success-bg); color: var(--success); font-style: normal; font-size: 11px; font-weight: 700; }
.check.miss { color: var(--text-muted); }
.check.miss i { background: var(--fill); color: var(--text-faint); }
.big-progress { display: flex; align-items: baseline; gap: 8px; }
.big-progress b { font-size: 30px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.note-box { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: var(--surface-soft); color: var(--text-regular); font-size: 13px; line-height: 1.7; }
.rows { margin: 0; padding: 0; list-style: none; }
.rows li { display: grid; align-items: center; gap: 14px; padding: 12px 22px; border-top: 1px solid var(--row-line); font-size: 13.5px; }
.rows li.head { padding-top: 10px; padding-bottom: 10px; border-top: 0; background: #f7f8fa; color: var(--text-muted); font-size: 12.5px; font-weight: 500; }
.rows .r { text-align: right; font-variant-numeric: tabular-nums; }
.rows .ell { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.timeline { margin: 0; padding: 4px 0 0; list-style: none; }
.timeline li { position: relative; padding: 0 0 22px 22px; border-left: 1px solid #dfe2e6; margin-left: 4px; }
.timeline li:last-child { padding-bottom: 4px; border-left-color: transparent; }
.timeline li::before { content: ""; position: absolute; left: -5px; top: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--blue); }
.timeline li.voice::before { background: var(--success); }
.timeline li.empty::before { background: var(--border-deep); }
.tl-head { display: flex; align-items: baseline; gap: 10px; font-size: 13px; }
.tl-head b { font-weight: 600; }
.tl-head time { margin-left: auto; color: var(--text-faint); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tl-body { margin-top: 3px; color: var(--text-regular); font-size: 13.5px; line-height: 1.7; }
.tl-body.none { color: var(--text-faint); }

/* ---------- 应收账单 ---------- */
.sum-card { display: grid; grid-template-columns: minmax(240px, 1.3fr) repeat(4, minmax(0, 1fr)); align-items: center; padding: 22px 0; }
.sum-card > div { padding: 0 26px; border-left: 1px solid var(--cell-line); }
.sum-card > div:first-child { border-left: 0; }
.sum-card .sum-label { color: var(--text-regular); font-size: 14px; }
.sum-card .sum-main { margin-top: 4px; font-size: 34px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.sum-card .sum-val { margin-top: 4px; font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.bills { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 16px; align-items: start; margin-top: 16px; }
.acct-list { display: grid; gap: 8px; }
.acct { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); text-align: left; transition: border-color .14s, box-shadow .14s; }
.acct:hover { border-color: #94e4ff; }
.acct.on { border-color: var(--blue); box-shadow: 0 4px 14px rgba(18, 116, 165, .1); }
.acct b { overflow: hidden; font-size: 15px; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }
.acct .acct-total { font-weight: 600; font-variant-numeric: tabular-nums; }
.acct small { color: var(--text-muted); font-size: 12px; }
.acct .acct-over { text-align: right; color: var(--danger); font-size: 12px; font-variant-numeric: tabular-nums; }
.bill-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 20px 22px 16px; }
.bill-head h2 { margin: 0; font-size: 20px; font-weight: 600; }
.bill-head p { margin: 4px 0 0; color: var(--text-muted); font-size: 13px; }
.bill-stats { display: flex; gap: 28px; padding: 0 22px 16px; }
.bill-stats div small { display: block; color: var(--text-muted); font-size: 12px; }
.bill-stats div b { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }

.people { display: flex; flex-wrap: wrap; gap: 8px; }
.person-chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 18px; background: var(--surface-soft); font-size: 13px; }
.person-chip .avatar { width: 24px; height: 24px; font-size: 11px; background: var(--ink); }
.person-chip small { color: var(--text-muted); }

/* ---------- AI 助手（工作台） ---------- */
.assistant { flex: 1; min-height: 0; display: grid; grid-template-columns: 248px minmax(0, 1fr); overflow: hidden; border-top: 1px solid var(--border); background: var(--surface); transition: grid-template-columns .32s var(--ease); }
.assistant.rail-hidden { grid-template-columns: 0 minmax(0, 1fr); }
.rail { position: relative; min-width: 0; display: flex; flex-direction: column; overflow: hidden; background: var(--surface); transition: opacity .2s; }
.assistant.rail-hidden .rail { opacity: 0; visibility: hidden; }
.rail::after { content: ""; position: absolute; top: 0; right: 0; bottom: 0; width: 1px; pointer-events: none; background: linear-gradient(180deg, rgba(236, 237, 240, 0) 0%, #ecedf0 16%, #ecedf0 76%, rgba(236, 237, 240, 0) 100%); }
.rail-head { min-height: 56px; display: flex; align-items: center; justify-content: space-between; padding: 0 8px 0 22px; }
.rail-head b { font-size: 15px; font-weight: 600; }
.new-conversation { min-height: 40px; display: flex; align-items: center; gap: 10px; margin: 0 14px 12px; padding: 0 14px; border: 1px solid #e8e9ec; border-radius: 999px; background: var(--surface); font-size: 14px; font-weight: 500; transition: background .16s, border-color .16s; }
.new-conversation svg { width: 18px; height: 18px; }
.new-conversation:hover { border-color: var(--border-deep); background: var(--fill-soft); }
.history { flex: 1; min-height: 0; overflow-y: auto; padding: 0 10px 12px; scrollbar-width: thin; scrollbar-color: #dcdde1 transparent; }
.history-group { margin: 12px 0 4px; padding: 0 12px; color: var(--text-faint); font-size: 12px; }
.history-item { position: relative; width: 100%; min-height: 38px; display: flex; align-items: center; padding: 0 34px 0 12px; border: 0; border-radius: 999px; background: transparent; color: var(--text-regular); text-align: left; font-size: 14px; transition: background .14s; }
.history-item span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.history-item:hover { background: var(--fill-soft); }
.history-item.active { background: var(--fill); color: var(--text); font-weight: 500; }
.history-del { position: absolute; right: 4px; top: 5px; width: 28px; height: 28px; display: none; place-items: center; border-radius: 50%; color: var(--text-muted); }
.history-del svg { width: 15px; height: 15px; }
.history-item:hover .history-del, .history-item.active .history-del { display: grid; }
.history-del:hover { color: var(--danger); background: var(--surface); }
.history-empty { padding: 18px 12px; color: var(--text-faint); font-size: 13px; }
.pane { position: relative; min-width: 0; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.conversation-head { min-height: 56px; display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 6px; padding: 0 12px 0 8px; border-bottom: 1px solid transparent; transition: border-color .2s, box-shadow .2s; }
.conversation-head.raised { border-bottom-color: var(--border); box-shadow: 0 8px 18px -16px rgba(20, 21, 28, .28); }
.conversation-title { margin: 0; overflow: hidden; font-size: 15px; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }
.assistant:not(.rail-hidden) .rail-toggle { visibility: hidden; }
.message-scroll { flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #dcdde1 transparent; }
.welcome { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 24px calc(48px + 6vh); text-align: center; }
.welcome-mark { width: 60px; height: 60px; margin-bottom: 18px; }
.welcome h2 { margin: 0; font-size: clamp(26px, 2.4vw, 32px); font-weight: 600; letter-spacing: .01em; line-height: 1.25; }
.welcome-sub { margin: 10px 0 0; color: var(--text-muted); font-size: 14px; }
.welcome-slot { width: min(680px, 100%); margin-top: 28px; text-align: left; }
.welcome-slot .composer { border-radius: 20px; }
.welcome-slot textarea { min-height: 64px; }
.starters { width: min(720px, 100%); display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 16px; }
.starter { min-height: 34px; display: inline-flex; align-items: center; gap: 7px; padding: 0 14px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text-regular); font-size: 13px; transition: border-color .14s, background .14s, color .14s; }
.starter svg { width: 15px; height: 15px; color: var(--text-muted); }
.starter:hover { border-color: var(--border-deep); background: var(--fill-soft); color: var(--text); }
.message-article { width: min(calc(100% - 36px), 780px); margin: 0 auto; padding: 32px 22px 28px; }
.msg { margin: 0 0 36px; }
.msg-user { display: flex; flex-direction: column; align-items: flex-end; }
.bubble { max-width: min(84%, 560px); padding: 10px 18px; border-radius: 20px 20px 6px 20px; background: var(--fill-soft); color: var(--text); font-size: 15px; line-height: 1.7; white-space: pre-wrap; word-break: break-word; }
.msg-meta { min-height: 28px; display: flex; align-items: center; gap: 4px; margin-top: 4px; color: var(--text-faint); font-size: 12px; font-variant-numeric: tabular-nums; }
.msg-meta .sep::before { content: "·"; margin: 0 2px; }
.icon-btn { width: 28px; height: 28px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--text-muted); opacity: 0; transition: opacity .14s, background .14s; }
.icon-btn svg { width: 15px; height: 15px; }
.msg:hover .icon-btn, .icon-btn:focus-visible { opacity: 1; }
.icon-btn:hover { color: var(--ink); background: var(--fill); }
.dots { display: inline-flex; gap: 3px; }
.dots i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .35; animation: breathe 1.05s ease-in-out infinite; }
.dots i:nth-child(2) { animation-delay: .14s; }
.dots i:nth-child(3) { animation-delay: .28s; }
@keyframes breathe { 0%, 100% { opacity: .25; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-2px); } }
.md { color: #26272d; font-size: 16px; line-height: 1.8; word-break: break-word; }
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md p { margin: 0 0 12px; }
.md h1, .md h2, .md h3, .md h4 { margin: 22px 0 10px; color: var(--text); font-weight: 600; line-height: 1.4; }
.md h1 { font-size: 22px; } .md h2 { font-size: 19px; } .md h3 { font-size: 17px; } .md h4 { font-size: 16px; }
.md strong { color: var(--text); font-weight: 600; }
.md ul, .md ol { margin: 0 0 12px; padding-left: 1.4em; }
.md li { margin: 3px 0; }
.md li > p { margin: 0; }
.md a { color: var(--blue); }
.md a:hover { text-decoration: underline; }
.md code { padding: 1px 6px; border-radius: 6px; background: var(--fill); font-family: var(--mono); font-size: .88em; }
.md pre { margin: 0 0 12px; padding: 12px 14px; overflow: auto; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-soft); }
.md pre code { padding: 0; background: none; }
.md blockquote { margin: 0 0 12px; padding: 8px 16px; border-left: 3px solid var(--border-strong); border-radius: 0 10px 10px 0; background: var(--surface-soft); color: var(--text-regular); }
.md hr { margin: 18px 0; border: 0; border-top: 1px solid var(--border); }
.table-wrap { margin: 4px 0 14px; overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; }
.md table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.6; }
.md th, .md td { padding: 9px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.md th { background: var(--surface-soft); color: var(--text-regular); font-weight: 600; white-space: nowrap; }
.md tr:last-child td { border-bottom: 0; }
.md td.num, .md th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.md .caret { display: inline-block; width: 8px; height: 1.1em; margin-left: 2px; vertical-align: -2px; border-radius: 2px; background: var(--ink); animation: caret 1s steps(2) infinite; }
@keyframes caret { 50% { opacity: 0; } }
.answer-error { color: var(--text-muted); font-size: 14px; }
.file-card { display: flex; align-items: center; gap: 14px; min-height: 70px; margin: 12px 0 4px; padding: 12px 14px 12px 12px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); transition: border-color .16s, background .16s; }
.file-card:hover { border-color: var(--border-deep); background: var(--fill-soft); }
.file-icon { width: 40px; height: 46px; display: grid; place-items: end center; padding-bottom: 6px; border-radius: 6px 12px 6px 6px; color: #fff; background: linear-gradient(160deg, #2e9b6a, #16865c); font-size: 10px; font-weight: 700; letter-spacing: .04em; transform: rotate(-4deg); box-shadow: 0 6px 14px -8px rgba(22, 134, 92, .7); }
.file-text { flex: 1; min-width: 0; display: grid; }
.file-text b { overflow: hidden; font-size: 14px; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }
.file-text small { color: var(--text-muted); font-size: 12px; }
.file-dl { height: 34px; display: inline-flex; align-items: center; gap: 6px; padding: 0 14px; border-radius: 999px; color: #fff; background: var(--blue); font-size: 13px; font-weight: 500; }
.file-dl svg { width: 16px; height: 16px; }
.dock { flex: 0 0 auto; padding: 8px 22px 10px; background: var(--surface); }
.composer-slot { width: min(720px, 100%); margin: 0 auto; }
.composer { position: relative; border: 1px solid var(--border-strong); border-radius: 18px; background: var(--surface); box-shadow: 0 12px 32px -16px rgba(20, 21, 28, .18), 0 1px 2px rgba(20, 21, 28, .04); transition: border-color .16s, box-shadow .16s; }
.composer:hover { border-color: #d2d4d9; }
.composer.focused { border-color: var(--border-deep); box-shadow: 0 0 0 3px var(--fill), 0 14px 34px -16px rgba(20, 21, 28, .22); }
.composer textarea { width: 100%; min-height: 52px; max-height: 220px; display: block; padding: 14px 18px 4px; border: 0; outline: none; resize: none; background: transparent; font-size: 15px; line-height: 1.6; }
.composer textarea::placeholder { color: var(--text-faint); }
.composer-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 10px 10px 18px; }
.composer-hint { color: var(--text-faint); font-size: 12px; }
.composer-actions { display: flex; align-items: center; gap: 8px; }
.round-btn { width: 38px; height: 38px; display: grid; place-items: center; padding: 0; border: 1px solid var(--border-strong); border-radius: 50%; background: var(--surface); color: var(--text-regular); transition: background .14s, border-color .14s; }
.round-btn:hover { border-color: var(--border-deep); background: var(--fill-soft); }
.round-btn.recording { border-color: var(--danger); color: var(--danger); }
.send-btn { width: 38px; height: 38px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; color: #fff; background: var(--blue); transition: background .14s, transform .1s; }
.send-btn:hover:not(:disabled) { background: var(--blue-hover); }
.send-btn:active:not(:disabled) { transform: scale(.94); }
.send-btn:disabled { color: var(--text-muted); background: var(--fill); cursor: default; }
.send-btn svg { width: 19px; height: 19px; stroke-width: 2; }
.send-btn .i-stop { display: none; }
.send-btn.stop { background: var(--ink); }
.send-btn.stop .i-send { display: none; }
.send-btn.stop .i-stop { display: block; fill: currentColor; stroke: none; }
.dock-note { width: min(720px, 100%); margin: 8px auto 0; color: var(--text-faint); font-size: 12px; text-align: center; }
.voice-strip { display: flex; align-items: center; gap: 10px; margin: 10px 12px 0; padding: 8px 8px 8px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-soft); font-size: 13px; }
.voice-strip b { font-weight: 500; }
.voice-strip time { margin-right: auto; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.voice-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 0 4px rgba(209, 60, 79, .12); animation: pulse 1.2s ease-in-out infinite; }
.voice-strip.busy .voice-dot { background: var(--blue); box-shadow: 0 0 0 4px rgba(18, 116, 165, .12); }
@keyframes pulse { 50% { opacity: .4; } }
.chip-btn { height: 30px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--surface); font-size: 13px; }
.chip-btn.dark { border-color: var(--blue); color: #fff; background: var(--blue); }

/* ---------- 抽屉 ---------- */
.mask { position: fixed; inset: 0; z-index: 40; background: rgba(20, 21, 28, .18); }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 41; width: min(640px, 92vw); display: flex; flex-direction: column; background: var(--surface); box-shadow: -24px 0 48px -24px rgba(20, 21, 28, .35); transform: translateX(104%); transition: transform .28s var(--ease); }
.drawer.open { transform: none; }
.drawer-head { min-height: 72px; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 14px 14px 24px; border-bottom: 1px solid var(--border); }
.drawer-head small { color: var(--text-muted); font-size: 12px; }
.drawer-head h3 { margin: 2px 0 0; font-size: 18px; font-weight: 600; }
.drawer-head p { margin: 4px 0 0; color: var(--text-muted); font-size: 13px; }
.drawer-body { flex: 1; min-height: 0; overflow: auto; padding: 18px 24px 32px; font-size: 13px; }
.kv { display: grid; grid-template-columns: minmax(96px, max-content) minmax(0, 1fr); gap: 6px 16px; margin: 0 0 14px; }
.kv dt { color: var(--text-muted); }
.kv dd { margin: 0; color: var(--text); word-break: break-word; }
.kv .kv { margin: 0; padding: 8px 12px; border-radius: 10px; background: var(--surface-soft); }
.dv-section { margin: 0 0 16px; }
.dv-section > h4 { margin: 0 0 8px; font-size: 13px; font-weight: 600; }
.dv-table { overflow: auto; max-height: 460px; border: 1px solid var(--border); border-radius: 10px; }
.dv-table table { border-collapse: collapse; min-width: 100%; font-size: 12px; }
.dv-table th, .dv-table td { padding: 7px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; white-space: nowrap; max-width: 320px; overflow: hidden; text-overflow: ellipsis; }
.dv-table th { position: sticky; top: 0; background: var(--surface-soft); font-weight: 600; color: var(--text-regular); }
.dv-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.dv-more { margin: 6px 0 0; color: var(--text-muted); font-size: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; }
.chip { height: 26px; display: inline-flex; align-items: center; padding: 0 10px; border-radius: 999px; background: var(--fill); color: var(--text-regular); font-size: 12px; }

.toast { position: fixed; left: 50%; bottom: 28px; z-index: 60; padding: 10px 18px; border-radius: 999px; color: #fff; background: var(--ink); font-size: 13px; transform: translateX(-50%); box-shadow: 0 12px 28px -12px rgba(20, 21, 28, .5); }
.skeleton { height: 200px; border-radius: 18px; background: linear-gradient(90deg, #eef0f3 25%, #f6f7f9 37%, #eef0f3 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ---------- 窄一点的屏幕 ---------- */
@media (max-width: 1239px) {
  .g-main, .g-detail { grid-template-columns: minmax(0, 1fr); }
  .sticky { position: static; }
  .g-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .data-status { display: none; }
  .search { width: 200px; }
}
@media (max-width: 959px) {
  .kpis { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 18px; }
  .kpi:nth-child(odd) { border-left: 0; }
  .g-3, .bills, .sum-card { grid-template-columns: minmax(0, 1fr); }
  .sections a { padding: 0 10px; font-size: 14px; }
  .logo span, .search, .account-text { display: none; }
  .page { padding: 16px; }
  .assistant { grid-template-columns: minmax(0, 1fr); }
  .rail { position: fixed; top: var(--topbar); bottom: 0; left: 0; z-index: 25; width: min(280px, 86vw); box-shadow: 16px 0 40px -18px rgba(20, 21, 28, .28); transform: translateX(-104%); transition: transform .3s var(--ease); }
  .assistant.rail-open .rail { transform: none; }
  .assistant.rail-hidden .rail { opacity: 1; visibility: visible; }
  .assistant:not(.rail-hidden) .rail-toggle { visibility: visible; }
}

/* =====================================================================
 * 客户板块：照金聚诚「小程序客户」（用户管理）那套 —— 左侧栏 + 白底工作区。
 * 页头蓝色小字眉标 + 30px 标题；工作区一圈细描边、14px 圆角；工具栏 60px；
 * 筛选面板 220px 浅灰；表头 46px、行 54px；客户格 34px 浅蓝圆角头像。
 * ===================================================================== */
.body { flex: 1; min-height: 0; display: flex; }
.side { position: relative; width: 220px; flex: 0 0 220px; display: flex; flex-direction: column; gap: 2px; padding: 4px 14px 16px; overflow-y: auto; background: var(--surface); }
.side::after { content: ""; position: absolute; top: 0; right: 0; bottom: 0; width: 1px; pointer-events: none; background: linear-gradient(180deg, rgba(236, 237, 240, 0) 0%, #ecedf0 12%, #ecedf0 80%, rgba(236, 237, 240, 0) 100%); }
.side-group { height: 34px; display: flex; align-items: flex-end; margin-top: 6px; padding: 0 12px 6px; color: var(--text); font-size: 13px; font-weight: 600; }
.side a { height: 36px; display: flex; align-items: center; gap: 12px; padding: 0 12px; border-radius: 18px; color: var(--text-regular); font-size: 14px; transition: background .14s, color .14s; }
.side a svg { width: 18px; height: 18px; }
.side a:hover { background: var(--hover); }
.side a.on { background: var(--blue-soft); color: var(--blue); font-weight: 600; }
.side-foot { margin-top: auto; padding: 12px; color: var(--text-faint); font-size: 12px; line-height: 1.6; }
.body.has-side .content { background: var(--surface); }

.crm { width: min(1480px, 100%); margin: 0 auto; padding: 16px 32px 40px; }
.crm-head { min-height: 76px; display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 20px; }
.eyebrow { display: block; margin-bottom: 6px; color: var(--blue); font-size: 11px; font-weight: 700; line-height: 1.35; letter-spacing: .08em; }
.crm-head h1 { margin: 0; color: var(--text); font-size: 30px; font-weight: 680; line-height: 1.2; letter-spacing: -.02em; }
.crm-head p { max-width: 760px; margin: 7px 0 0; color: var(--text-muted); font-size: 13px; line-height: 1.6; }
.crm-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding-top: 18px; }
.workspace { overflow: hidden; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.workspace + .workspace { margin-top: 16px; }
/* 我的客户、我的拜访：本人还没关联金蝶、高德账号时整页只有这一块（pages.js 的 unlinkedPage） */
.xwx-unlinked { display: grid; justify-items: center; gap: 10px; padding: 88px 24px; text-align: center; }
.xwx-unlinked h2 { margin: 0; color: #1d2129; font-size: 18px; font-weight: 600; }
.xwx-unlinked p { margin: 0; color: #1d2129; font-size: 14px; line-height: 1.7; }
.toolbar { min-height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 24px; border-bottom: 1px solid var(--border); }
.tool-group { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.tool-btn { height: 36px; display: inline-flex; align-items: center; gap: 7px; padding: 0 16px; border: 1px solid #e1e2e6; border-radius: 999px; background: var(--surface); color: #2c2d33; font-size: 13px; font-weight: 500; white-space: nowrap; transition: border-color .14s, color .14s, background .14s; }
.tool-btn:hover { border-color: #d2d4d9; color: var(--ink); background: var(--hover); }
.tool-btn.on { border-color: #5bd5ff; color: var(--blue); background: var(--blue-soft); }
.tool-btn.primary { border-color: var(--blue); color: #fff; background: var(--blue); }
.tool-btn.primary:hover { border-color: var(--blue-hover); background: var(--blue-hover); }
.tool-btn svg { width: 14px; height: 14px; }
.tool-count { min-width: 19px; height: 19px; display: inline-grid; place-items: center; padding: 0 5px; border-radius: 999px; color: var(--blue); background: var(--blue-soft); font-size: 11px; line-height: 19px; font-variant-numeric: tabular-nums; }
.tool-count.alarm { color: var(--danger); background: var(--danger-bg); }
.tool-btn.primary .tool-count { color: var(--blue); background: #fff; }
.tool-info { color: var(--text-muted); font-size: 13px; white-space: nowrap; }
.tool-info b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.dropdown { position: absolute; top: calc(100% + 6px); left: 0; z-index: 15; min-width: 210px; padding: 6px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-lg); }
.dropdown button { width: 100%; height: 36px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; font-size: 13px; text-align: left; }
.dropdown button:hover { background: var(--hover); }
.dropdown button.on { color: var(--blue); font-weight: 600; }
.dropdown button span:last-child { color: var(--text-muted); font-variant-numeric: tabular-nums; }
.layout { min-width: 0; }
.layout.has-filters { display: grid; grid-template-columns: 220px minmax(0, 1fr); align-items: stretch; }
.filter-rail { min-width: 0; display: flex; flex-direction: column; gap: 15px; padding: 20px 16px; border-right: 1px solid var(--border); background: #f7f8fa; }
.ff { display: flex; flex-direction: column; gap: 6px; }
.ff > span { color: var(--text-muted); font-size: 11px; font-weight: 560; }
.ff input, .ff select { width: 100%; height: 34px; padding: 0 10px; border: 0; border-radius: 8px; box-shadow: inset 0 0 0 1px var(--border-strong); background: var(--surface); font-size: 13px; outline: none; }
.ff input:focus, .ff select:focus { box-shadow: inset 0 0 0 1px var(--blue), 0 0 0 3px rgba(18, 116, 165, .1); }
.ff-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding-top: 3px; }
.ff-actions .tool-btn { justify-content: center; padding: 0; }
.ftable { min-width: 0; overflow-x: auto; }
.ftable table { width: 100%; border-collapse: separate; border-spacing: 0; color: var(--text-regular); font-size: 13px; }
.ftable th { position: sticky; top: 0; z-index: 1; height: 46px; padding: 0 14px; background: #f7f7f8; color: var(--text); font-weight: 500; text-align: left; white-space: nowrap; }
.ftable td { height: 54px; padding: 8px 14px; border-bottom: 1px solid var(--border); background: var(--surface); line-height: 19px; vertical-align: middle; white-space: nowrap; }
.ftable td .ci-name b { max-width: 260px; }
.ftable tbody tr { cursor: pointer; }
.ftable tbody tr:hover td { background: #f8f8fa; }
.ftable .r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ftable th.ops, .ftable td.ops { position: sticky; right: 0; box-shadow: inset 1px 0 0 #eceef1, -10px 0 12px -12px rgba(20, 21, 28, .18); white-space: nowrap; }
.ftable td.ops a, .ftable td.ops button { height: 26px; padding: 0 6px; border: 0; border-radius: 6px; background: transparent; color: var(--blue); font-size: 13px; }
.ftable td.ops a:hover, .ftable td.ops button:hover { background: #f3f3f5; }
.ci { min-height: 38px; display: flex; align-items: center; gap: 10px; }
.ci-ava { width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 auto; border: 1px solid #b4deed; border-radius: 8px; color: var(--blue); background: var(--blue-soft); font-size: 13px; font-weight: 600; }
.ci-ava.gray { border-color: #e3e5e9; color: #86909c; background: #f2f3f5; }
.ci-txt { min-width: 0; }
.ci-name { display: flex; align-items: center; gap: 6px; color: var(--text); font-size: 13px; line-height: 18px; }
.ci-name b { overflow: hidden; max-width: 300px; font-weight: 620; white-space: nowrap; text-overflow: ellipsis; }
.ci-sub { display: block; overflow: hidden; max-width: 340px; color: var(--text-faint); font-size: 11px; line-height: 16px; white-space: nowrap; text-overflow: ellipsis; }
.t-strong { color: var(--text); font-weight: 600; }
.t-sub { display: block; color: var(--text-faint); font-size: 11px; line-height: 16px; white-space: nowrap; }
.tpager { min-height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 16px; border-top: 1px solid var(--border); color: var(--text-muted); font-size: 13px; }
.tpager .pager { padding: 0; border: 0; }
.t-empty { padding: 64px 24px; color: var(--text-muted); text-align: center; }
.ov-command { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); border-bottom: 1px solid var(--border); }
.ov-card { min-height: 94px; display: block; padding: 18px 20px; border: 0; border-right: 1px solid var(--border); background: var(--surface); color: var(--text); text-align: left; transition: background .14s; }
.ov-card:last-child { border-right: 0; }
.ov-card:hover { background: #f8f8fa; }
.ov-card.action { background: var(--blue-soft); }
.ov-card.action .ov-val { color: var(--blue); }
.ov-card.alert .ov-val { color: var(--danger); }
.ov-val { font-size: 26px; font-weight: 650; line-height: 32px; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.ov-val small { margin-left: 2px; font-size: 13px; font-weight: 500; letter-spacing: 0; }
.ov-label { margin-top: 5px; color: var(--text-muted); font-size: 12px; font-weight: 520; }
.ov-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.ov-block { min-width: 0; min-height: 230px; padding: 22px 24px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.ov-block:nth-child(even) { border-right: 0; }
.ov-block.wide { grid-column: 1 / -1; border-right: 0; }
.ov-grid > .ov-block:nth-last-child(-n + 2) { border-bottom: 0; }
.ov-panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 18px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.ov-panel-head h2 { margin: 0; color: var(--text); font-size: 15px; font-weight: 650; }
.ov-panel-head span { color: var(--text-faint); font-size: 11px; }
.ov-panel-head a { color: var(--blue); font-size: 12px; }
.ov-rows { display: grid; gap: 12px; }
.ov-row { display: grid; grid-template-columns: 96px minmax(0, 1fr) 72px 92px; align-items: center; gap: 12px; font-size: 13px; }
.ov-row .bar { height: 6px; background: #edf1f6; }
.ov-row b { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.ov-row em { color: var(--text-muted); font-style: normal; text-align: right; font-variant-numeric: tabular-nums; }
.ov-row.link { cursor: pointer; }
.ov-row.link:hover span:first-child { color: var(--blue); }
.d-head .eyebrow { margin-bottom: 4px; }
@media (max-width: 1239px) {
  .side { width: 64px; flex-basis: 64px; padding: 4px 10px; }
  .side a { justify-content: center; padding: 0; font-size: 0; }
  .side-group, .side-foot { display: none; }
  .ov-command { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ov-grid { grid-template-columns: minmax(0, 1fr); }
  .ov-block { border-right: 0; }
}

/* 分类标准 */
.rows.std li { grid-template-columns: 160px minmax(0, 1fr) 140px 150px; padding-left: 0; padding-right: 0; }
.rows.std li.head { background: transparent; border-bottom: 1px solid var(--border); }
.rows.std li.link { cursor: pointer; }
.rows.std li.link:hover { background: var(--row-hover); }
.std-src { display: grid; gap: 6px; margin-top: 14px; padding: 14px 16px; border-radius: 12px; background: var(--surface-soft); color: var(--text-regular); font-size: 13px; line-height: 1.7; }
.std-src p { margin: 0; }
.check small.src { margin-left: 2px; padding: 0 5px; border-radius: 4px; background: var(--blue-soft); color: var(--blue); font-size: 10px; }

/* ---------- 预览（2026-12-04）：老板以某位员工的身份看平台，最上面一条写明在看谁、能退出 ----------
   外框（.shell，theme.css）是网格：预览时多出最上面一行给这一条，顶栏、板块菜单、正文各往下挪一行；
   手机上从左边滑出的菜单、遮罩、助手栏原来贴着顶栏底下，也跟着往下让。浅金底、深色字，不用深色大色块。 */
body.is-preview { --pv-h: 42px; }
body.is-preview .shell { grid-template-rows: var(--pv-h) var(--topbar) minmax(0, 1fr); }
body.is-preview .topbar { grid-area: 2 / 1 / 3 / -1; }
body.is-preview .main-nav { grid-area: 3 / 1; }
body.is-preview .body, body.is-preview .assistant { grid-area: 3 / 2; }
body.is-preview .nav-scrim { inset: calc(var(--topbar) + var(--pv-h)) 0 0; }
.pv-bar { grid-area: 1 / 1 / 2 / -1; min-width: 0; height: var(--pv-h, 42px); display: flex; align-items: center; justify-content: center; gap: 12px; padding: 0 16px; border-bottom: 1px solid #f0dfb4; color: #1d2129; background: #fdf7e9; font-size: 14px; line-height: 20px; }
.pv-bar b { font-weight: 650; }
.pv-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-eye { width: 26px; height: 26px; display: grid; place-items: center; flex: none; border-radius: 50%; color: #a66d00; background: #f8e8c2; }
.pv-eye svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.pv-exit { height: 30px; flex: none; padding: 0 14px; border: 1px solid #e3cf9c; border-radius: 999px; color: #1d2129; background: #fff; font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; transition: border-color .12s ease, color .12s ease; }
.pv-exit:hover, .pv-exit:focus-visible { border-color: var(--blue-line); color: var(--blue); outline: 0; }
.pv-exit:disabled { opacity: .6; cursor: default; }
@media (max-width: 760px) {
  body.is-preview .body, body.is-preview .assistant { grid-area: 3 / 1 / 4 / -1; }
  body.is-preview .shell .main-nav, body.is-preview .rail { top: calc(var(--topbar) + var(--pv-h)); }
}
@media (max-width: 640px) { .pv-bar { justify-content: space-between; gap: 10px; padding: 0 12px; font-size: 13.5px; } .pv-eye, .pv-role { display: none; } }
