/* 赢筹智能 CRM：浅色、克制，蓝色做主色，橙色只给“新增跟进”这类最常用的动作 */
:root {
  --blue: #1F5FD6;
  --blue-d: #174AAB;
  --blue-50: #EEF3FD;
  --blue-100: #DCE7FB;
  --orange: #EE8216;
  --orange-d: #D9700A;
  --orange-50: #FEF4E8;
  --ink: #0F172A;
  --text: #1F2937;
  --muted: #6B7280;
  --faint: #9CA3AF;
  --line: #E5E9F0;
  --line-soft: #EEF1F5;
  --bg: #F5F7FA;
  --hover: #F8FAFC;
  --card: #FFFFFF;
  --green: #15803D;
  --green-50: #EAF7EF;
  --red: #DC2626;
  --red-50: #FDEEEE;
  --amber: #B45309;
  --amber-50: #FEF5E6;
  --gray-50: #F1F3F6;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, .14);
  --side: 220px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font: 14px/1.6 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; color: var(--ink); line-height: 1.35; font-weight: 600; }
h1 { font-size: 20px; }
h2 { font-size: 15px; }
h3 { font-size: 14px; }
input, select, textarea, button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* ---------- 外框 ---------- */
.app { display: flex; min-height: 100vh; }
.side {
  width: var(--side); flex: none; background: #fff; border-right: 1px solid var(--line);
  position: fixed; inset: 0 auto 0 0; display: flex; flex-direction: column; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 20px 16px; color: var(--ink); text-decoration: none !important; }
.brand img { width: 34px; height: auto; }
.brand b { display: block; font-size: 15px; letter-spacing: .5px; }
.brand small { display: block; font-size: 11px; color: var(--faint); line-height: 1.2; }
.nav { flex: 1; padding: 4px 12px; overflow-y: auto; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px; margin: 1px 0;
  border-radius: 8px; color: #4B5563; text-decoration: none;
}
.nav a:hover { background: var(--hover); color: var(--ink); }
.nav a.on { background: var(--blue-50); color: var(--blue); font-weight: 600; }
.nav svg { width: 18px; height: 18px; flex: none; }
.nav .badge { margin-left: auto; }
.side-foot { display: flex; align-items: center; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line-soft); font-size: 13px; }
.side-foot .who { flex: 1; min-width: 0; line-height: 1.3; }
.side-foot .who b { display: block; color: var(--ink); font-weight: 500; }
.side-foot .who small { color: var(--faint); }
.side-foot button { background: none; border: 0; color: var(--faint); padding: 4px; cursor: pointer; font-size: 13px; }
.side-foot button:hover { color: var(--red); }

.main { flex: 1; margin-left: var(--side); min-width: 0; }
.top {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 12px;
  padding: 10px 28px; background: rgba(245, 247, 250, .88); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-soft);
}
.search { position: relative; flex: 1; max-width: 440px; }
.search input[type=search] { width: 100%; padding-left: 34px; background: #fff; }
.search svg { position: absolute; left: 11px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); color: var(--faint); }
.search-pop {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-lg); max-height: 60vh; overflow: auto; padding: 6px;
}
.search-pop a { display: flex; justify-content: space-between; gap: 8px; padding: 7px 10px; border-radius: 6px; color: var(--text); text-decoration: none; }
.search-pop a:hover { background: var(--blue-50); }
.search-pop small { color: var(--faint); white-space: nowrap; }
.search-pop .grp { font-size: 12px; color: var(--faint); padding: 6px 10px 2px; }
.top .spacer { flex: 1; }
body.on-customer #quick-follow, body.on-customer .fab { display: none !important; }

.page { padding: 24px 28px 64px; max-width: 1880px; }
.page-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { margin-right: auto; }
.page-head .sub { color: var(--muted); font-size: 13px; width: 100%; margin-top: -6px; }
.back { display: inline-flex; gap: 4px; color: var(--muted); font-size: 13px; margin-bottom: 12px; }
.back:hover { color: var(--blue); text-decoration: none; }

/* ---------- 按钮与输入 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 14px;
  border: 1px solid var(--line); background: #fff; border-radius: 8px; cursor: pointer; white-space: nowrap;
  color: var(--text); text-decoration: none !important; transition: background .15s, border-color .15s;
}
.btn:hover { border-color: #CBD3DF; background: var(--hover); }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:hover { background: var(--blue-d); border-color: var(--blue-d); }
.btn.accent { background: var(--orange); border-color: var(--orange); color: #fff; }
.btn.accent:hover { background: var(--orange-d); border-color: var(--orange-d); }
.btn.danger { color: var(--red); }
.btn.danger:hover { border-color: var(--red); background: var(--red-50); }
.btn.ghost { border-color: transparent; background: none; color: var(--muted); }
.btn.ghost:hover { background: var(--gray-50); color: var(--text); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 13px; }
.btn.xs { height: 24px; padding: 0 8px; font-size: 12px; border-radius: 6px; }
.btn.link { border: 0; background: none; color: var(--blue); padding: 0 4px; height: auto; }
.btn svg { width: 16px; height: 16px; }
.btn:disabled { opacity: .5; cursor: default; }

input[type=text], input[type=password], input[type=search], input[type=date], input[type=number], input[type=tel],
input[type=email], input:not([type]), select, textarea {
  height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; min-width: 0;
  outline: none; transition: border-color .15s, box-shadow .15s;
}
textarea { height: auto; min-height: 84px; padding: 8px 10px; resize: vertical; width: 100%; line-height: 1.6; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(31, 95, 214, .12); }
input::placeholder, textarea::placeholder { color: var(--faint); }
select { padding-right: 26px; color: var(--text); }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.toolbar input[type=search] { width: 240px; }
.toolbar .grow { flex: 1; }
.seg { display: inline-flex; padding: 2px; border-radius: 8px; background: var(--gray-50); }
.seg button { border: 0; background: none; padding: 0 12px; height: 28px; border-radius: 6px; cursor: pointer; color: var(--muted); font-size: 13px; }
.seg button.on { background: #fff; color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(16, 24, 40, .1); }
.chk { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; user-select: none; font-size: 13px; color: var(--muted); }

/* 下拉菜单 */
.menu-wrap { position: relative; }
.menu {
  position: absolute; right: 0; top: calc(100% + 4px); min-width: 140px; background: #fff; border: 1px solid var(--line);
  border-radius: 10px; box-shadow: var(--shadow-lg); padding: 4px; z-index: 40;
}
.menu button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 7px 12px; border-radius: 6px; cursor: pointer; }
.menu button:hover { background: var(--blue-50); color: var(--blue); }

/* ---------- 卡片 ---------- */
.card { background: var(--card); border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow); min-width: 0; }
.card-h { display: flex; align-items: center; gap: 8px; padding: 16px 20px 4px; min-height: 52px; }
.card-h h2 { margin-right: auto; }
.card-h .count { color: var(--faint); font-size: 13px; }
.card-b { padding: 8px 20px 18px; }
.card > .table-wrap, .card > .pager { border-radius: var(--radius); }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
/* 两栏各自往下排，避免卡片高低不齐留大块空白 */
.cols { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.cols > .stack { display: grid; gap: 16px; min-width: 0; }

.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.kpi { padding: 16px 20px; }
.kpi .k { color: var(--muted); font-size: 13px; }
.kpi .v { font-size: 26px; font-weight: 600; color: var(--ink); margin: 4px 0 2px; font-variant-numeric: tabular-nums; letter-spacing: -.3px; line-height: 1.25; }
.kpi .v small { font-size: 13px; font-weight: 400; color: var(--muted); margin-left: 3px; letter-spacing: 0; }
.kpi .s { font-size: 12px; color: var(--faint); }
.kpi .s b { color: var(--muted); font-weight: 500; }
.kpi.warn .v { color: var(--red); }

/* 小标签 */
.badge {
  display: inline-block; padding: 0 7px; border-radius: 6px; font-size: 12px; line-height: 20px; white-space: nowrap;
  background: var(--gray-50); color: var(--muted); vertical-align: 1px;
}
.badge.blue { background: var(--blue-50); color: var(--blue); }
.badge.green { background: var(--green-50); color: var(--green); }
.badge.red { background: var(--red-50); color: var(--red); }
.badge.amber { background: var(--amber-50); color: var(--amber); }
.badge.orange { background: var(--orange); color: #fff; }
.nav .badge.orange, .mob-nav .badge.orange { border-radius: 99px; min-width: 20px; text-align: center; font-weight: 600; }
.level-a { color: var(--orange); font-weight: 600; font-size: 12px; }

/* 状态：圆点 + 文字 */
.st { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font-size: 13px; color: var(--text); --c: var(--faint); }
.st::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c); flex: none; }
.st.s-gray { --c: #A3AAB6; color: var(--muted); }
.st.s-blue { --c: #3B82F6; }
.st.s-green { --c: #22A05A; }
.st.s-amber { --c: #F59E0B; }
.st.s-red { --c: #EF4444; color: var(--muted); }

/* 成员头像 */
.av {
  display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; color: #fff;
  font-size: 11px; font-weight: 600; flex: none; line-height: 1;
}
.person { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }

.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12px; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.red { color: var(--red); }
.green { color: var(--green); }
.nowrap { white-space: nowrap; }
.empty { text-align: center; color: var(--faint); padding: 32px 12px; font-size: 13px; }
.empty b { display: block; color: var(--muted); font-weight: 500; font-size: 14px; margin-bottom: 4px; }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; }
.t th, .t td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.t th { font-weight: 500; color: var(--faint); font-size: 12px; white-space: nowrap; padding-top: 11px; padding-bottom: 11px; border-bottom-color: var(--line); }
.t tbody tr { cursor: pointer; transition: background .1s; }
.t tbody tr:hover { background: var(--hover); }
.t tbody tr:last-child td { border-bottom: 0; }
.t td { white-space: nowrap; }
.t td.title { font-weight: 500; color: var(--ink); white-space: normal; min-width: 200px; }
.t td .sub { display: block; font-weight: 400; color: var(--faint); font-size: 12px; }
.pager { display: flex; align-items: center; gap: 8px; justify-content: flex-end; padding: 10px 16px; color: var(--faint); font-size: 13px; border-top: 1px solid var(--line-soft); }

/* ---------- 提醒列表 ---------- */
.rem { list-style: none; margin: 0; padding: 0; }
.rem li {
  display: grid; grid-template-columns: 8px minmax(0, 1fr) auto auto; gap: 12px; align-items: center;
  padding: 10px 0; border-bottom: 1px solid var(--line-soft);
}
.rem li:last-child { border-bottom: 0; }
.rem .dot { width: 8px; height: 8px; border-radius: 50%; }
.rem .body { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rem .body a.c { color: var(--ink); font-weight: 500; margin-right: 8px; }
.rem .body .d { color: var(--muted); }
.rem .body .o { color: var(--faint); font-size: 12px; margin-left: 6px; }
.rem .when { font-size: 12px; white-space: nowrap; color: var(--faint); text-align: right; min-width: 56px; }
.rem .when.red { color: var(--red); }
.rem .acts { width: 64px; text-align: right; }
.rem .acts .btn { opacity: 0; transition: opacity .15s; }
.rem li:hover .acts .btn { opacity: 1; }
.more-link { display: block; text-align: center; padding-top: 10px; font-size: 13px; }

/* ---------- 条形图 ---------- */
.bars { display: grid; gap: 12px; }
.bar-row { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; gap: 12px; align-items: center; font-size: 13px; }
.bar-row .lbl { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { height: 8px; background: var(--gray-50); border-radius: 99px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--blue); border-radius: 99px; min-width: 3px; }
.bar-fill.soft { background: #7FA6EA; }
.bar-row .val { font-variant-numeric: tabular-nums; white-space: nowrap; min-width: 84px; text-align: right; color: var(--text); }
.bar-row .val small { color: var(--faint); margin-left: 4px; }
.chart svg { width: 100%; height: auto; display: block; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; vertical-align: 0; }
.foot-note { color: var(--faint); font-size: 12px; margin: 14px 0 0; }

/* ---------- 动态 ---------- */
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 8px 0; font-size: 13px; }
.feed time { padding-top: 1px; }
.feed .fx { min-width: 0; color: var(--muted); line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.feed .fx b { color: var(--text); font-weight: 500; margin-right: 4px; }
.feed .fx a { color: var(--text); }
.feed time { color: var(--faint); font-size: 12px; white-space: nowrap; }
.feed.full li { border-bottom: 1px solid var(--line-soft); }

/* ---------- 跟进时间线 ---------- */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline > li { position: relative; padding: 0 0 20px 22px; }
.timeline > li::before { content: ""; position: absolute; left: 4px; top: 10px; bottom: -4px; width: 1px; background: var(--line); }
.timeline > li:last-child { padding-bottom: 4px; }
.timeline > li:last-child::before { display: none; }
.timeline > li::after {
  content: ""; position: absolute; left: 0; top: 6px; width: 9px; height: 9px; border-radius: 50%;
  background: #fff; border: 2px solid var(--blue);
}
.timeline .meta { font-size: 12px; color: var(--faint); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.timeline .meta .date { color: var(--text); font-weight: 600; font-size: 13px; }
.timeline .meta a.cust { color: var(--ink); font-weight: 500; font-size: 13px; }
.timeline .content { white-space: pre-wrap; word-break: break-word; margin: 4px 0 6px; color: var(--text); }
.timeline .next { font-size: 12px; background: var(--orange-50); color: #9A4D06; padding: 2px 8px; border-radius: 6px; display: inline-block; }
.timeline .tools { margin-left: auto; opacity: 0; transition: opacity .15s; }
.timeline > li:hover .tools { opacity: 1; }

/* ---------- 客户详情 ---------- */
.dh { padding: 20px 24px 0; margin-bottom: 16px; }
.dh-top { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.dh-top .who { flex: 1; min-width: 240px; }
.dh-top h1 { font-size: 21px; }
.dh-top .tags { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 6px; font-size: 13px; color: var(--muted); }
.dh-top .acts { display: flex; gap: 8px; }
.stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); margin-top: 18px; border-top: 1px solid var(--line-soft); }
.stats > div { padding: 14px 0 16px; min-width: 0; }
.stats > div + div { padding-left: 20px; border-left: 1px solid var(--line-soft); }
.stats .k { font-size: 12px; color: var(--faint); }
.stats .v { font-size: 15px; color: var(--ink); font-weight: 500; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stats .v.red { color: var(--red); }
.stats .v small { font-size: 12px; font-weight: 400; color: var(--faint); margin-left: 4px; }
.kv { display: grid; grid-template-columns: 72px 1fr; gap: 8px 12px; font-size: 13px; margin: 0; }
.kv dt { color: var(--faint); }
.kv dd { margin: 0; word-break: break-word; color: var(--text); }
.mini { list-style: none; margin: 0; padding: 0; }
.mini li { padding: 10px 0; border-bottom: 1px solid var(--line-soft); display: flex; gap: 10px; align-items: center; cursor: pointer; }
.mini li:first-child { padding-top: 2px; }
.mini li:last-child { border-bottom: 0; padding-bottom: 0; }
.mini li > div { flex: 1; min-width: 0; }
.mini li:hover .t1 { color: var(--blue); }
.mini .t1 { font-weight: 500; color: var(--ink); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.mini .t2 { font-size: 12px; color: var(--faint); margin-top: 1px; }
.mini svg { width: 20px; height: 20px; }
.progress { height: 4px; border-radius: 99px; background: var(--gray-50); overflow: hidden; margin-top: 6px; }
.progress i { display: block; height: 100%; background: #22A05A; border-radius: 99px; }

/* ---------- 商机看板 ---------- */
.kanban { display: grid; grid-template-columns: repeat(4, minmax(176px, 1fr)); gap: 14px; padding-bottom: 8px; }
.col { background: #EDF0F4; border-radius: var(--radius); padding: 12px 10px 4px; min-height: 240px; }
.col-h { display: flex; align-items: center; gap: 8px; margin: 0 4px 10px; font-weight: 600; color: var(--ink); font-size: 14px; }
.col-h .n { background: #fff; color: var(--muted); border-radius: 99px; padding: 0 8px; font-size: 12px; font-weight: 500; }
.col-h small { margin-left: auto; font-weight: 400; color: var(--muted); font-size: 12px; }
.deal {
  background: #fff; border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; cursor: pointer;
  border: 1px solid transparent; box-shadow: 0 1px 2px rgba(16, 24, 40, .06); transition: border-color .15s;
}
.deal:hover { border-color: var(--blue-100); }
.deal .t1 { font-weight: 500; color: var(--ink); }
.deal .t2 { font-size: 12px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.deal .row { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; font-size: 13px; gap: 8px; }
.deal .amt { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.deal .deal-acts { display: flex; gap: 4px; opacity: 0; transition: opacity .15s; }
.deal:hover .deal-acts { opacity: 1; }
.col .none { text-align: center; color: var(--faint); font-size: 12px; padding: 24px 0; }

/* ---------- 弹窗 ---------- */
.modal-bg {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .4); z-index: 100; display: flex;
  align-items: flex-start; justify-content: center; padding: 6vh 16px; overflow-y: auto;
}
.modal { background: #fff; border-radius: 14px; width: 100%; max-width: 600px; box-shadow: 0 24px 64px rgba(15, 23, 42, .25); }
.modal.wide { max-width: 820px; }
.modal-h { display: flex; align-items: center; padding: 18px 22px 6px; }
.modal-h h2 { flex: 1; font-size: 16px; }
.modal-h .x { border: 0; background: none; font-size: 22px; line-height: 1; cursor: pointer; color: var(--faint); padding: 4px 8px; border-radius: 6px; }
.modal-h .x:hover { background: var(--gray-50); color: var(--text); }
.modal-b { padding: 10px 22px 6px; }
.modal-f { display: flex; gap: 8px; justify-content: flex-end; padding: 14px 22px 20px; align-items: center; }
.modal-f .left { margin-right: auto; }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.form .f { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.form .f.full { grid-column: 1 / -1; }
.form label.l { font-size: 13px; color: var(--muted); }
.form label.l .req { color: var(--red); margin-left: 2px; }
.form .f input, .form .f select { width: 100%; }
.form .err { color: var(--red); font-size: 12px; }
.form .err:empty { display: none; }
.form .f.bad input, .form .f.bad select, .form .f.bad textarea { border-color: var(--red); }
.form .sect { grid-column: 1 / -1; font-weight: 600; color: var(--ink); border-top: 1px solid var(--line-soft); padding-top: 14px; margin-top: 2px; font-size: 13px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips label { border: 1px solid var(--line); border-radius: 8px; padding: 3px 12px; cursor: pointer; font-size: 13px; user-select: none; color: var(--muted); }
.chips label:hover { border-color: #CBD3DF; }
.chips input { display: none; }
.chips label:has(input:checked) { background: var(--blue-50); border-color: var(--blue); color: var(--blue); }
.quick-dates { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 2px; }
.quick-dates button { border: 0; background: var(--gray-50); border-radius: 6px; font-size: 12px; padding: 2px 8px; cursor: pointer; color: var(--muted); }
.quick-dates button:hover { color: var(--blue); background: var(--blue-50); }
.form-error { background: var(--red-50); color: var(--red); padding: 8px 12px; border-radius: 8px; margin-bottom: 12px; font-size: 13px; }

.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); background: var(--ink); color: #fff;
  padding: 10px 18px; border-radius: 10px; z-index: 200; box-shadow: var(--shadow-lg); font-size: 14px;
  max-width: calc(100vw - 32px);
}
.toast.err { background: var(--red); }

/* ---------- 登录 ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: var(--bg); }
.auth .box { background: #fff; border-radius: 16px; padding: 36px 32px; width: 100%; max-width: 380px; border: 1px solid var(--line); box-shadow: 0 8px 32px rgba(16, 24, 40, .08); }
.auth .logo { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.auth .logo img { width: 46px; }
.auth .logo b { font-size: 18px; color: var(--ink); display: block; }
.auth .logo small { color: var(--faint); font-size: 12px; }
.auth form { display: grid; gap: 12px; }
.auth input { width: 100%; height: 42px; }
.auth .btn { height: 42px; font-size: 15px; }
.auth p { color: var(--muted); font-size: 13px; margin: 0 0 14px; }

/* ---------- 设置 ---------- */
.settings { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 20px; align-items: start; }
.settings nav { display: grid; gap: 2px; position: sticky; top: 76px; scrollbar-width: none; }
.settings nav::-webkit-scrollbar { display: none; }
.settings nav a { padding: 8px 12px; border-radius: 8px; color: var(--muted); text-decoration: none; }
.settings nav a:hover { color: var(--ink); background: #fff; }
.settings nav a.on { background: #fff; color: var(--blue); font-weight: 600; box-shadow: var(--shadow); border: 1px solid var(--line); }
.opt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.opt-grid textarea { min-height: 160px; font-size: 13px; }

/* ================= 第二轮：侧栏收起、账号区、图表、动效 ================= */

/* 侧栏收起 */
.side, .main, .brand .txt, .nav a .txt { transition: width .22s ease, margin-left .22s ease, opacity .15s ease; }
.nav a { position: relative; white-space: nowrap; overflow: hidden; }
.side-toggle {
  display: flex; align-items: center; gap: 10px; margin: 0 12px 8px; padding: 8px 12px; border: 0; background: none;
  color: var(--faint); border-radius: 8px; cursor: pointer; font-size: 13px; white-space: nowrap; overflow: hidden;
}
.side-toggle:hover { background: var(--hover); color: var(--text); }
.side-toggle svg { width: 18px; height: 18px; flex: none; }
.side .txt { overflow: hidden; white-space: nowrap; }
.app.side-mini { --side: 68px; }
.app.side-mini .brand { padding-left: 17px; padding-right: 0; }
.app.side-mini .txt { opacity: 0; width: 0; pointer-events: none; }
.app.side-mini .nav a { padding-left: 13px; padding-right: 0; }
.app.side-mini .nav .badge { position: absolute; top: 3px; left: 30px; font-size: 10px; line-height: 15px; padding: 0 4px; min-width: 16px; }
.app.side-mini .side-toggle { padding-left: 13px; }
.app.side-mini .me { padding: 0; justify-content: center; gap: 0; }
.app.side-mini .me .txt { display: none; }
.app.side-mini .me-wrap { padding: 12px 8px; }
.app.side-mini .menu.up { left: 8px; right: auto; }

/* 账号区 */
.side-foot { display: none; }
.me-wrap { position: relative; padding: 12px; border-top: 1px solid var(--line-soft); }
.me {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 1px solid transparent; border-radius: 10px;
  background: none; cursor: pointer; text-align: left; transition: background .15s, border-color .15s;
}
.me:hover, .me.open { background: var(--hover); border-color: var(--line); }
.me .av { width: 32px; height: 32px; font-size: 14px; box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--line); }
.me .txt { flex: 1; min-width: 0; line-height: 1.35; overflow: hidden; }
.me .txt b { display: block; color: var(--ink); font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me .txt small { color: var(--faint); font-size: 12px; }
.me .chev { flex: none; width: 16px; color: var(--faint); transition: transform .2s; }
.me .chev svg { width: 16px; height: 16px; display: block; }
.me.open .chev { transform: rotate(180deg); }
.menu.up { bottom: calc(100% - 4px); top: auto; left: 12px; right: 12px; min-width: 200px; }
.menu-head { display: flex; gap: 10px; align-items: center; padding: 10px 12px 10px; border-bottom: 1px solid var(--line-soft); margin-bottom: 4px; }
.menu-head .av { width: 36px; height: 36px; font-size: 15px; }
.menu-head b { display: block; color: var(--ink); font-weight: 600; }
.menu-head small { color: var(--faint); font-size: 12px; }
.menu button { display: flex; align-items: center; gap: 10px; }
.menu button svg { width: 16px; height: 16px; color: var(--faint); }
.menu button.danger:hover { background: var(--red-50); color: var(--red); }
.menu button.danger:hover svg { color: var(--red); }
.menu-sep { height: 1px; background: var(--line-soft); margin: 4px 0; }
.menu { animation: pop .14s ease-out; transform-origin: bottom left; }

/* 顶栏 */
.search kbd {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%); font: 11px/18px inherit; color: var(--faint);
  border: 1px solid var(--line); border-radius: 4px; padding: 0 6px; background: var(--hover); pointer-events: none;
}
.search input:focus ~ kbd { display: none; }
.search-pop a.on { background: var(--blue-50); }
.auth-foot { margin: 16px 0 0 !important; text-align: center; font-size: 12px !important; color: var(--faint) !important; }

/* 带标签的信息行（代替“·”拼接） */
.ml { display: flex; flex-wrap: wrap; gap: 2px 16px; font-size: 12px; color: var(--muted); margin-top: 2px; }
.ml em { font-style: normal; color: var(--faint); margin-right: 4px; }
i.gap { display: inline-block; width: 12px; }
.tag { display: inline-block; padding: 0 6px; border-radius: 4px; background: var(--gray-50); color: var(--muted); font-size: 12px; line-height: 18px; }
.timeline .meta .tag { color: var(--blue); background: var(--blue-50); }
.steps { margin: 0 0 14px; padding-left: 20px; line-height: 1.9; color: var(--text); }
.sub-h { display: flex; align-items: center; margin: 18px 0 8px; }
.sub-h h3 { flex: 1; }
.kv.two { grid-template-columns: 72px 1fr 72px 1fr; }
.mini .t1.done { text-decoration: line-through; color: var(--faint); font-weight: 400; }
.mini .tick { width: 16px; height: 16px; flex: none; accent-color: var(--blue); cursor: pointer; }
.t td.row-act { width: 64px; text-align: right; }
.t td.row-act .btn { opacity: 0; transition: opacity .15s; }
.t tbody tr:hover td.row-act .btn { opacity: 1; }
.menu-list li { gap: 12px; padding: 14px 16px !important; }
.menu-list li svg { width: 20px; height: 20px; color: var(--blue); flex: none; }

/* 进度条（回款率等） */
.meter { height: 6px; border-radius: 99px; background: var(--blue-50); overflow: hidden; margin-top: 8px; }
.meter i { display: block; height: 100%; width: var(--w); background: var(--blue); border-radius: 99px; animation: grow-x .8s cubic-bezier(.2, .8, .2, 1) both; transform-origin: left; }
.pay-meter { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 20px; padding: 14px 16px; background: var(--hover); border-radius: 10px; margin-bottom: 18px; }
.pay-meter .k { font-size: 12px; color: var(--faint); }
.pay-meter .v { font-size: 18px; font-weight: 600; color: var(--ink); }
.pay-meter .v.red { color: var(--red); }
.pay-meter .bar { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; }
.pay-meter .bar .meter { flex: 1; margin: 0; background: #E3EAF6; }
.pay-meter .bar span { font-size: 12px; color: var(--muted); white-space: nowrap; }

/* 数字卡片 */
.kpi { position: relative; overflow: hidden; display: flex; flex-direction: column; }
.kpi .v { font-variant-numeric: normal; }
.kpi .s { margin-top: auto; }
.kpi .spark { position: absolute; right: 14px; top: 16px; width: 76px; height: 26px; }
.kpi .meter { margin-top: 8px; }
.kpi[data-tip] { cursor: help; }

/* 条形图：长度动画 */
.bar-fill { width: var(--w); animation: grow-x .7s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i, 0) * 60ms); transform-origin: left; }
.bar-row[data-tip] { cursor: default; }
.bar-row:hover .bar-track { background: #E7EBF1; }

/* 柱状图 */
.chart .axis { font-size: 11px; fill: var(--faint); }
.bar-c { transform-box: fill-box; transform-origin: bottom; animation: grow-y .6s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i, 0) * 35ms); }
.chart .hit { fill: transparent; cursor: default; }
.chart .hit:hover { fill: rgba(31, 95, 214, .05); }

/* 客户状态分段条 */
.stack-bar { display: flex; gap: 2px; height: 12px; border-radius: 99px; overflow: hidden; margin: 6px 0 16px; }
.stack-bar span { min-width: 4px; animation: grow-x .7s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i, 0) * 70ms); transform-origin: left; }
.legend-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 20px; font-size: 13px; }
.legend-list li { display: flex; align-items: center; gap: 8px; }
.legend-list i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.legend-list span { color: var(--muted); flex: 1; }
.legend-list b { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.legend-list em { font-style: normal; color: var(--faint); font-size: 12px; min-width: 32px; text-align: right; }

/* 团队工作量里的小横条 */
.inline-bar { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.inline-bar span { display: block; height: 6px; border-radius: 99px; background: #7FA6EA; width: calc(var(--w) * .7); min-width: 3px; animation: grow-x .7s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i, 0) * 60ms); transform-origin: left; }
.inline-bar b { font-weight: 500; font-variant-numeric: tabular-nums; }

/* 悬停提示 */
.tip {
  position: fixed; left: 0; top: 0; z-index: 300; max-width: 280px; padding: 8px 10px; border-radius: 8px;
  background: var(--ink); color: #fff; font-size: 12px; line-height: 1.6; pointer-events: none;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .2); animation: fade .12s ease-out;
}
.tip b { display: block; font-weight: 600; margin-bottom: 2px; }
.tip span { display: flex; align-items: center; gap: 6px; }
.tip i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }

/* 商机拖拽 */
.deal[draggable=true] { cursor: grab; }
.deal.dragging { opacity: .4; transform: scale(.98); }
.col.over { background: var(--blue-50); box-shadow: inset 0 0 0 2px var(--blue-100); }
.drop-zones { position: fixed; left: calc(var(--side) + 28px); right: 28px; bottom: 20px; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; z-index: 50; animation: rise .2s ease-out; }
.drop-zones .zone {
  height: 64px; display: grid; place-items: center; border-radius: 12px; border: 2px dashed; font-weight: 600; font-size: 14px;
  background: rgba(255, 255, 255, .96); box-shadow: var(--shadow-lg); transition: background .15s, transform .15s;
}
.drop-zones .win { border-color: #22A05A; color: var(--green); }
.drop-zones .lose { border-color: #EF4444; color: var(--red); }
.drop-zones .win.over { background: var(--green-50); transform: scale(1.02); }
.drop-zones .lose.over { background: var(--red-50); transform: scale(1.02); }
.deal { transition: border-color .15s, box-shadow .15s, transform .15s; }
.deal:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(16, 24, 40, .08); }

/* ---------- 动效 ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }
@keyframes grow-x { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes grow-y { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes sheet { from { transform: translateY(100%); } to { transform: none; } }

/* 页面内容依次浮现 */
.page > * { animation: rise .32s ease-out both; }
.page > *:nth-child(2) { animation-delay: .04s; }
.page > *:nth-child(3) { animation-delay: .08s; }
.page > *:nth-child(4) { animation-delay: .12s; }
.kpis > .kpi { animation: rise .35s ease-out both; }
.kpis > .kpi:nth-child(2) { animation-delay: .04s; }
.kpis > .kpi:nth-child(3) { animation-delay: .08s; }
.kpis > .kpi:nth-child(4) { animation-delay: .12s; }
.kpis > .kpi:nth-child(5) { animation-delay: .16s; }
.stack > .card { animation: rise .35s ease-out both; }
.stack > .card:nth-child(2) { animation-delay: .06s; }
.stack > .card:nth-child(3) { animation-delay: .12s; }
.stack > .card:nth-child(4) { animation-delay: .18s; }

/* 卡片与按钮的细节反馈 */
.card { transition: box-shadow .2s, border-color .2s; }
.kpi:hover, .stack > .card:hover { box-shadow: 0 4px 16px rgba(16, 24, 40, .06); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.nav a svg { transition: transform .2s; }
.nav a:hover svg { transform: translateX(1px); }

/* 弹窗 */
.modal-bg { animation: fade .16s ease-out; }
.modal { animation: pop .18s cubic-bezier(.2, .8, .2, 1); }
.modal-bg.closing { animation: fade .16s ease-in reverse both; }
.modal-bg.closing .modal { animation: pop .16s ease-in reverse both; }
.modal-h .x svg { width: 18px; height: 18px; display: block; }

/* 提示条 */
.toast { animation: toast-in .22s cubic-bezier(.2, .8, .2, 1); }
.toast.out { animation: toast-in .2s ease-in reverse both; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
}

/* ================= 第三轮：自制下拉框、开关、静默刷新 ================= */

/* 原生下拉隐藏，只作取值用 */
select.native-hidden { display: none !important; }

/* 下拉按钮 */
.sel { position: relative; display: inline-flex; min-width: 0; }
.sel.block { display: flex; width: 100%; }
.sel-btn {
  display: flex; align-items: center; gap: 8px; width: 100%; height: 34px; padding: 0 10px 0 12px; min-width: 120px;
  border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; text-align: left; color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.sel-btn:hover { border-color: #CBD3DF; }
.sel-btn:focus-visible, .sel.open .sel-btn { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(31, 95, 214, .12); }
.sel-val { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sel-val.ph { color: var(--muted); }
.toolbar .sel.has-value .sel-btn { border-color: var(--blue-100); background: var(--blue-50); color: var(--blue); }
.toolbar .sel.has-value .sel-val { color: var(--blue); }
.sel-btn svg { width: 16px; height: 16px; color: var(--faint); flex: none; transition: transform .2s; }
.sel.open .sel-btn svg { transform: rotate(180deg); color: var(--blue); }
.form .f.bad .sel-btn { border-color: var(--red); }

/* 可输入的联想框 */
.combo { position: relative; display: flex; width: 100%; }
.combo input { width: 100%; padding-right: 32px; }
.combo-ico { position: absolute; right: 1px; top: 1px; bottom: 1px; width: 30px; display: grid; place-items: center; color: var(--faint); cursor: pointer; border-radius: 0 8px 8px 0; }
.combo-ico svg { width: 16px; height: 16px; transition: transform .2s; }
.combo.open .combo-ico svg { transform: rotate(180deg); color: var(--blue); }

/* 下拉浮层 */
.dd {
  position: fixed; left: 0; top: 0; z-index: 400; max-height: 300px; overflow-y: auto; padding: 4px;
  background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 32px rgba(16, 24, 40, .14);
  opacity: 0; transition: opacity .12s ease-out; overscroll-behavior: contain;
}
.dd.show { opacity: 1; }
.dd-opt {
  display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 6px; cursor: pointer; font-size: 14px; color: var(--text);
  line-height: 1.45;
}
.dd-opt span { flex: 1; min-width: 0; }
.dd-opt.on { background: var(--hover); }
.dd-opt.sel { color: var(--blue); font-weight: 500; }
.dd-opt.sel.on, .dd-opt.on:hover { background: var(--blue-50); }
.dd-opt.ph { color: var(--muted); }
.dd-opt svg { width: 16px; height: 16px; color: var(--blue); flex: none; }
.dd-opt mark { background: none; color: var(--blue); font-weight: 600; }
.dd-empty { padding: 10px 12px; color: var(--faint); font-size: 13px; }
.dd::-webkit-scrollbar { width: 8px; }
.dd::-webkit-scrollbar-thumb { background: #DCE1E8; border-radius: 99px; border: 2px solid #fff; }

/* 开关 */
.switch { position: relative; display: flex; align-items: center; gap: 12px; cursor: pointer; user-select: none; padding: 4px 0; }
/* 隐藏的勾选框固定在开关内部，避免跑出弹窗撑出横向滚动条 */
.switch input { position: absolute; left: 0; top: 0; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }
.switch .track {
  position: relative; width: 38px; height: 22px; border-radius: 99px; background: #D5DBE4; flex: none; transition: background .2s;
}
.switch .track::after {
  content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .2); transition: transform .2s cubic-bezier(.2, .8, .2, 1);
}
.switch input:checked + .track { background: var(--blue); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { box-shadow: 0 0 0 3px rgba(31, 95, 214, .2); }
.switch .sw-text { font-size: 14px; color: var(--text); line-height: 1.4; }
.switch .sw-text small { display: block; font-size: 12px; color: var(--faint); margin-top: 2px; }

/* 顶部加载细线 */
.main { position: relative; }
.progress-line { position: sticky; top: 55px; z-index: 9; height: 2px; margin-bottom: -2px; overflow: hidden; pointer-events: none; }
.progress-line::after { content: ""; display: block; height: 100%; width: 40%; background: var(--blue); border-radius: 99px; transform: translateX(-100%); opacity: 0; }
.progress-line.on::after { opacity: 1; animation: loading 1s ease-in-out infinite; }
@keyframes loading { from { transform: translateX(-100%); } to { transform: translateX(260%); } }

/* 同一页面内的更新不再播放进场动画 */
.page.quiet, .page.quiet * { animation: none !important; }

/* 侧栏底部：收起 / 展开两种状态高度一致 */
.side-toggle { height: 36px; padding-top: 0; padding-bottom: 0; line-height: 36px; }
.me { height: 52px; padding: 0 10px 0 5px; }  /* 头像中心与上方图标同一竖线，收起时不左右跳 */

/* 批量操作 */
.t th.chk-col, .t td.chk-col { width: 44px; padding-right: 0; }
.t tr.picked { background: var(--blue-50); }
.t tr.picked:hover { background: #E6EEFC; }
.bulk-bar {
  position: fixed; left: calc(var(--side) + 28px); right: 28px; bottom: 20px; z-index: 45; display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 10px 14px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); animation: rise .2s ease-out;
}
.bulk-bar .bulk-n { font-size: 14px; color: var(--text); }
.bulk-bar .bulk-n b { color: var(--blue); }
.bulk-bar .grow { flex: 1; }
.page:has(.bulk-bar:not([hidden])) { padding-bottom: 110px; }

/* 导入预览 */
.sheet-sum { margin: 0; padding-left: 18px; line-height: 1.9; font-size: 13px; }

/* 权限设置 */
.perm-list { display: grid; gap: 4px; }
.perm-item { padding: 14px 0; border-bottom: 1px solid var(--line-soft); align-items: flex-start; }
.perm-item:last-child { border-bottom: 0; }
.perm-item .track { margin-top: 1px; }
.perm-item .sw-text { font-weight: 500; }
.perm-item .sw-text small { font-weight: 400; line-height: 1.7; max-width: 640px; }

/* 弹窗本身只允许上下滚动 */
.modal-bg { overflow-x: hidden; }
/* 表格里的“日期 + 剩余天数”上下排，省出宽度 */
.due .badge { margin-left: 6px; }
.t .due .badge { margin-left: 0; }
.t .due { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.pay-cell { line-height: 1.5; }
.pay-cell .sub { margin-top: 1px; }
/* 中等宽度屏幕隐藏次要列，避免表格出现横向滚动 */
@media (min-width: 761px) and (max-width: 1280px) {
  .t .hide-md { display: none; }
}

/* ---------- 响应式 ---------- */
.mob-nav, .fab { display: none; }
@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cols, .g-main, .g3 { grid-template-columns: minmax(0, 1fr); }
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stats > div:nth-child(4) { padding-left: 0; border-left: 0; }
}
@media (hover: none) {
  .rem .acts .btn, .deal .deal-acts, .timeline .tools, .t td.row-act .btn { opacity: 1; }
  .deal[draggable=true] { cursor: pointer; }
}
@media (max-width: 760px) {
  body { font-size: 15px; }
  .side { display: none; }
  .main { margin-left: 0; padding-bottom: 72px; }
  .top { padding: 8px 12px; background: rgba(245, 247, 250, .95); }
  .top #quick-follow, .top .spacer { display: none; }
  .search { max-width: none; }
  .search kbd { display: none; }
  .page { padding: 16px 12px 40px; }
  .page-head { margin-bottom: 14px; }
  .page-head .btn { height: 32px; padding: 0 10px; }
  /* 手机上数字卡片横着滑，把“需要处理的事”留在第一屏 */
  .kpis { display: flex; gap: 10px; overflow-x: auto; margin: 0 -12px 14px; padding: 0 12px 2px; scroll-padding: 0 12px; scroll-snap-type: x mandatory; scrollbar-width: none; }
  .kpis::-webkit-scrollbar { display: none; }
  .kpi { flex: 0 0 40vw; padding: 12px 14px; scroll-snap-align: start; }
  .kpi .v { font-size: 21px; }
  .kpi .s { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .card-h { padding: 14px 16px 2px; min-height: 46px; }
  .card-b { padding: 6px 16px 16px; }
  .g2 { grid-template-columns: minmax(0, 1fr); }
  .form { grid-template-columns: 1fr; }
  .toolbar input[type=search] { width: 100%; }
  .toolbar select, .toolbar label, .toolbar .sel { flex: 1 1 calc(50% - 4px); min-width: 0; }
  .toolbar .sel-btn { min-width: 0; }
  .progress-line { top: 51px; }
  .toolbar .grow { display: none; }
  .toolbar label input[type=date] { width: 100%; }
  .settings { grid-template-columns: 1fr; }
  .settings nav { position: static; display: flex; overflow-x: auto; }
  .settings nav a { white-space: nowrap; }
  .modal-bg { padding: 0; align-items: flex-end; }
  .modal { border-radius: 16px 16px 0 0; max-height: 92vh; overflow-y: auto; }
  .modal-f { position: sticky; bottom: 0; background: #fff; border-top: 1px solid var(--line-soft); }

  .rem li { grid-template-columns: 8px minmax(0, 1fr) auto; row-gap: 6px; align-items: start; }
  .rem .dot { margin-top: 8px; }
  .rem .when { padding-top: 2px; }
  .rem .body { white-space: normal; }
  .rem .body a.c { display: block; }
  .rem .acts { grid-column: 2 / -1; width: auto; text-align: left; }
  .rem .acts:empty { display: none; }

  .dh { padding: 16px 16px 0; }
  .dh-top .acts { width: 100%; }
  .dh-top .acts .btn.accent { flex: 1; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats > div { padding: 10px 0 12px; }
  .stats > div + div { padding-left: 0; border-left: 0; }
  .stats > div:nth-child(even) { padding-left: 16px; border-left: 1px solid var(--line-soft); }
  .stats > div:nth-child(n+3) { border-top: 1px solid var(--line-soft); }
  .stats > div:last-child:nth-child(odd) { grid-column: 1 / -1; }

  .kv.two { grid-template-columns: 72px 1fr; }
  .bulk-bar { left: 8px; right: 8px; bottom: calc(66px + env(safe-area-inset-bottom)); padding: 8px 10px; }
  .bulk-bar .grow { display: none; }
  .t td.chk-col { position: absolute; right: 12px; top: 12px; width: auto; padding: 0; }
  .t tr { position: relative; }
  .pay-meter { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .drop-zones { display: none !important; }
  .legend-list { gap: 8px 14px; }
  .t td.row-act { width: auto; text-align: left; margin-top: 6px; }

  /* 表格在手机上变卡片 */
  table.t thead { display: none; }
  table.t, .t tbody, .t tr, .t td { display: block; width: 100%; }
  .t tr { padding: 12px 16px; border-bottom: 1px solid var(--line-soft); }
  .t td { border: 0; padding: 1px 0; text-align: left; white-space: normal; font-size: 13px; color: var(--muted); }
  .t td[data-l]::before { content: attr(data-l) "  "; color: var(--faint); font-size: 12px; }
  .t td.title { font-size: 15px; color: var(--ink); margin-bottom: 2px; min-width: 0; }
  .t td.hide-m { display: none; }
  .num { text-align: left; }

  .kanban { grid-template-columns: repeat(4, 82vw); overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -12px; padding: 0 12px 8px; scrollbar-width: none; }
  .kanban::-webkit-scrollbar { display: none; }
  .col { scroll-snap-align: center; }

  .mob-nav {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: #fff; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
  }
  .mob-nav a { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 8px 0 6px; font-size: 11px; color: var(--faint); text-decoration: none; position: relative; }
  .mob-nav a.on { color: var(--blue); font-weight: 600; }
  .mob-nav svg { width: 22px; height: 22px; }
  .mob-nav .badge { position: absolute; top: 3px; left: 54%; font-size: 10px; line-height: 16px; padding: 0 5px; }
  .fab {
    display: grid; place-items: center; position: fixed; right: 16px; bottom: calc(80px + env(safe-area-inset-bottom)); width: 54px; height: 54px; border-radius: 50%;
    background: var(--orange); color: #fff; border: 0; box-shadow: 0 6px 18px rgba(238, 130, 22, .4); z-index: 25; cursor: pointer;
  }
  .fab svg { width: 26px; height: 26px; }
}
@media print {
  .side, .top, .mob-nav, .fab { display: none !important; }
  .main { margin: 0; }
}
