/* 得物达人管理 · 样式表 */
:root {
  --bg: #f3f4f6;
  --surface: #ffffff;
  --surface-2: #fafbfc;
  --ink: #111418;
  --ink-2: #4a5563;
  --ink-3: #8b94a3;
  --line: #e4e7ec;
  --line-2: #eef0f3;
  --brand: #0fb5a6;
  --brand-ink: #0a8a7f;
  --brand-soft: #e4f6f4;
  --warn: #d97706;
  --warn-soft: #fef3c7;
  --danger: #d92d20;
  --danger-soft: #fee4e2;
  --ok: #0e9f6e;
  --ok-soft: #dcfce7;
  --info: #2563eb;
  --info-soft: #dbeafe;
  --violet: #7c3aed;
  --violet-soft: #ede9fe;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-md: 0 8px 24px rgba(16, 24, 40, .09);
  --shadow-lg: 0 28px 70px rgba(16, 24, 40, .22);
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 24px;
  background: #111418;
  color: #fff;
}
.topbar__brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar h1 { font-size: 17px; font-weight: 650; letter-spacing: .2px; }
.topbar__sub { font-size: 12px; color: rgba(255, 255, 255, .58); }
.logo {
  display: grid; place-items: center;
  width: 34px; height: 34px; flex: none;
  border-radius: 10px;
  background: var(--brand);
  color: #06231f; font-weight: 800; font-size: 17px;
}
.topbar__actions { display: flex; align-items: center; gap: 8px; flex: none; }

/* ---------- 通用控件 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font-size: 13px; font-weight: 550;
  white-space: nowrap;
  transition: background .15s, border-color .15s, box-shadow .15s, transform .1s;
}
.btn:hover { background: var(--surface-2); border-color: #d3d8df; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn--primary { background: var(--brand); border-color: var(--brand); color: #04211e; font-weight: 650; }
.btn--primary:hover { background: #10c4b4; border-color: #10c4b4; }
.btn--ghost { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .16); color: #fff; }
.btn--ghost:hover { background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .28); }
.btn--danger { color: var(--danger); border-color: #f6c8c4; background: #fff; }
.btn--danger:hover { background: var(--danger-soft); }
.btn--sm { height: 30px; padding: 0 11px; font-size: 12.5px; }
.btn--block { width: 100%; }
.linkbtn {
  border: 0; background: none; padding: 4px 2px;
  color: var(--brand-ink); font-size: 13px; font-weight: 550;
}
.linkbtn:hover { text-decoration: underline; }
.iconbtn {
  display: inline-grid; place-items: center;
  width: 30px; height: 30px; flex: none;
  border: 0; border-radius: 8px; background: none; color: var(--ink-2);
}
.iconbtn:hover { background: var(--line-2); color: var(--ink); }

input[type="text"], input[type="search"], input[type="tel"], input[type="number"], input[type="date"], select, textarea {
  width: 100%;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 13px;
  transition: border-color .15s, box-shadow .15s;
}
textarea { height: auto; min-height: 76px; padding: 8px 10px; resize: vertical; line-height: 1.55; }
select { appearance: none; padding-right: 28px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5L6 8l3.5-3.5' fill='none' stroke='%238b94a3' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(15, 181, 166, .16); }
input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--brand); cursor: pointer; margin: 0; }

/* ---------- 页面骨架 ---------- */
.page { max-width: 1440px; margin: 0 auto; padding: 20px 24px 64px; }

/* ---------- KPI ---------- */
.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi {
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  text-align: left;
}
button.kpi { transition: border-color .15s, box-shadow .15s, transform .12s; }
button.kpi:hover { border-color: #cfd5dd; box-shadow: var(--shadow-md); transform: translateY(-1px); }
.kpi__label { font-size: 12px; color: var(--ink-3); display: flex; align-items: center; gap: 6px; }
.kpi__value { margin-top: 6px; font-size: 24px; font-weight: 700; letter-spacing: -.4px; font-variant-numeric: tabular-nums; }
.kpi__hint { margin-top: 2px; font-size: 12px; color: var(--ink-3); }
.kpi--alert .kpi__value { color: var(--danger); }
.kpi--today .kpi__value { color: var(--warn); }
.kpi--ok .kpi__value { color: var(--ok); }

/* ---------- 视图切换 ---------- */
.tabs { display: flex; align-items: center; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.tab {
  position: relative;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 14px 11px;
  border: 0; background: none;
  color: var(--ink-2); font-size: 14px; font-weight: 550;
}
.tab:hover { color: var(--ink); }
.tab.is-active { color: var(--ink); font-weight: 650; }
.tab.is-active::after {
  content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px;
  height: 2px; border-radius: 2px; background: var(--brand);
}
.tab__badge {
  min-width: 18px; height: 18px; padding: 0 5px;
  display: inline-grid; place-items: center;
  border-radius: 9px; background: var(--danger); color: #fff;
  font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.tab__badge.is-zero { background: var(--line); color: var(--ink-3); }
.tabs__spacer { flex: 1; }

/* ---------- 筛选 ---------- */
.filters {
  padding: 14px 16px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 14px;
}
.filters__row { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px 12px; }
.filters__row--meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field--grow { grid-column: span 2; }
.field__label { font-size: 12px; color: var(--ink-3); font-weight: 550; }
.tagbar { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; min-width: 0; }
.tagchip {
  padding: 3px 10px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface);
  color: var(--ink-2); font-size: 12px;
  transition: all .12s;
}
.tagchip:hover { border-color: #cfd5dd; color: var(--ink); }
.tagchip.is-on { background: var(--ink); border-color: var(--ink); color: #fff; }
.filters__meta { display: flex; align-items: center; gap: 12px; flex: none; }
.result-count { font-size: 12.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }

/* ---------- 批量操作条 ---------- */
.bulkbar {
  position: sticky; top: 64px; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 9px 14px; margin-bottom: 12px;
  background: var(--ink); color: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}
.bulkbar__count { font-size: 13px; font-weight: 600; }
.bulkbar__actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bulkbar__actions select, .bulkbar__actions input[type="text"] { height: 30px; width: auto; min-width: 130px; font-size: 12.5px; }
.bulkbar .linkbtn { color: rgba(255, 255, 255, .75); }

/* ---------- 表格 ---------- */
.tablewrap {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: auto;
}
.table { width: 100%; border-collapse: separate; border-spacing: 0; min-width: 780px; }
.table thead th {
  position: sticky; top: 0; z-index: 2;
  padding: 10px 9px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  text-align: left; font-size: 12px; font-weight: 600; color: var(--ink-3);
  white-space: nowrap;
}
.table td { padding: 11px 9px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: #f8fafb; }
.table tbody tr[data-act="open"] { cursor: pointer; }
.table tbody tr.is-selected { background: var(--brand-soft); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.col-check { width: 38px; text-align: center; }
.col-ops { width: 132px; text-align: right; }

.creator { display: flex; align-items: center; gap: 10px; min-width: 168px; }
.avatar {
  display: grid; place-items: center; flex: none;
  width: 34px; height: 34px; border-radius: 10px;
  font-size: 14px; font-weight: 700; color: #fff;
}
.creator__name { font-weight: 600; display: flex; align-items: center; gap: 6px; }
.creator__name button { border: 0; background: none; padding: 0; font-weight: 600; text-align: left; color: var(--ink); }
.creator__name button:hover { color: var(--brand-ink); text-decoration: underline; }
.creator__meta { font-size: 12px; color: var(--ink-3); display: flex; gap: 8px; flex-wrap: wrap; }
.dot { color: #c8cdd6; }

.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill--new { background: #eef0f3; color: #5b6472; }
.pill--contacted { background: var(--info-soft); color: #1d4ed8; }
.pill--negotiating { background: var(--violet-soft); color: #6d28d9; }
.pill--quoted { background: var(--warn-soft); color: #b45309; }
.pill--cooperated { background: var(--ok-soft); color: #047857; }
.pill--paused { background: #f1f2f4; color: #8b94a3; }

.prio { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--ink-2); }
.prio i { width: 6px; height: 6px; border-radius: 50%; background: #c8cdd6; }
.prio--high i { background: var(--danger); }
.prio--mid i { background: var(--warn); }

.taglist { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; max-width: 260px; }
.tag {
  padding: 1px 7px; border-radius: 5px;
  background: var(--line-2); color: var(--ink-2);
  font-size: 11.5px; white-space: nowrap;
}
.cat { font-size: 12.5px; color: var(--ink-2); }

.due { font-size: 12.5px; font-variant-numeric: tabular-nums; color: var(--ink-2); white-space: nowrap; }
.due--overdue { color: var(--danger); font-weight: 650; }
.due--today { color: var(--warn); font-weight: 650; }
.due--none { color: var(--ink-3); }
.sub { font-size: 12px; color: var(--ink-3); max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rowops { display: flex; justify-content: flex-end; gap: 2px; }
.money { font-variant-numeric: tabular-nums; font-weight: 600; }

/* ---------- 账号等级 / 引力合作 / 链接 ---------- */
.level { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; background: #eef0f3; color: #4a5563; }
.level--0 { background: #eef0f3; color: #6b7280; }
.level--1 { background: #e0f2fe; color: #0369a1; }
.level--2 { background: #dcfce7; color: #15803d; }
.level--3 { background: #ede9fe; color: #6d28d9; }
.level--4 { background: #fef3c7; color: #b45309; }
.level--5 { background: #fee4e2; color: #b42318; }
.level--none { background: transparent; color: var(--ink-3); border: 1px dashed var(--line); font-weight: 500; }
.grav { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--ink-3); }
.grav::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #c8cdd6; }
.grav--yes { color: var(--ok); }
.grav--yes::before { background: var(--ok); }
.mode { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.mode::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #c8cdd6; }
.mode--self::before { background: var(--brand); }
.mode--agency::before { background: var(--violet); }
.mode--none { color: var(--ink-3); font-weight: 500; }
.mode--none::before { display: none; }
.acct { display: inline-flex; align-items: center; gap: 4px; color: var(--brand-ink); text-decoration: none; font-size: 12.5px; white-space: nowrap; }
.acct:hover { text-decoration: underline; }
.dealsum { font-size: 12.5px; color: var(--ink-2); }
.dealsum b { font-weight: 650; color: var(--ink); }
.dealsum .sub { display: block; max-width: 150px; }
.money small { font-weight: 400; color: var(--ink-3); }

/* ---------- 空状态 ---------- */
.empty { padding: 56px 20px; text-align: center; color: var(--ink-3); }
.empty h3 { font-size: 15px; color: var(--ink-2); margin-bottom: 6px; }
.empty p { font-size: 13px; margin-bottom: 14px; }

/* ---------- 分页 ---------- */
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 12px; font-size: 13px; color: var(--ink-2); }
.pager .btn { height: 30px; }
.pager__info { font-variant-numeric: tabular-nums; }

/* ---------- 看板 ---------- */
.kanban { display: grid; grid-template-columns: repeat(6, minmax(196px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.kcol {
  display: flex; flex-direction: column;
  background: #eceef1;
  border-radius: var(--radius);
  padding: 10px;
  min-height: 220px;
  transition: background .15s, box-shadow .15s;
}
.kcol.is-drop { background: var(--brand-soft); box-shadow: inset 0 0 0 2px var(--brand); }
.kcol__head { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px 10px; }
.kcol__title { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 650; }
.kcol__count { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.kcol__body { display: flex; flex-direction: column; gap: 8px; }
.kcard {
  padding: 11px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 11px;
  box-shadow: var(--shadow-sm);
  cursor: grab;
  transition: box-shadow .15s, transform .12s, border-color .15s;
}
.kcard:hover { box-shadow: var(--shadow-md); border-color: #d3d8df; }
.kcard.is-dragging { opacity: .45; transform: scale(.98); }
.kcard__top { display: flex; align-items: center; gap: 8px; }
.kcard__name { font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kcard__row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; font-size: 12px; color: var(--ink-3); }
.kcard__note { margin-top: 8px; font-size: 12px; color: var(--ink-2); background: var(--surface-2); border-radius: 7px; padding: 6px 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.kcol__empty { padding: 22px 8px; text-align: center; font-size: 12px; color: var(--ink-3); border: 1px dashed #d5d9e0; border-radius: 10px; }

/* ---------- 待跟进视图 ---------- */
.followup { display: grid; gap: 12px; }
.fgroup { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.fgroup__head { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line-2); font-weight: 650; font-size: 14px; }
.fgroup__head span { font-size: 12px; font-weight: 500; color: var(--ink-3); }
.fitem { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line-2); }
.fitem:last-child { border-bottom: 0; }
.fitem__main { flex: 1; min-width: 0; }
.fitem__title { font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fitem__title button { border: 0; background: none; padding: 0; font-weight: 600; color: var(--ink); }
.fitem__title button:hover { color: var(--brand-ink); text-decoration: underline; }
.fitem__sub { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fitem__actions { display: flex; gap: 6px; flex: none; }

/* ---------- 抽屉 ---------- */
.drawer { position: fixed; inset: 0; z-index: 60; display: flex; justify-content: flex-end; }
.drawer__mask { position: absolute; inset: 0; background: rgba(17, 20, 24, .42); animation: fade .18s ease-out; }
.drawer__panel {
  position: relative; z-index: 1;
  width: min(560px, 100vw);
  height: 100%;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column;
  animation: slide-in .22s cubic-bezier(.16, 1, .3, 1);
}
.drawer__head { padding: 18px 20px 14px; border-bottom: 1px solid var(--line); }
.drawer__body { flex: 1; overflow-y: auto; padding: 18px 20px 28px; }
.dhead { display: flex; align-items: flex-start; gap: 12px; }
.dhead__main { flex: 1; min-width: 0; }
.dhead__title { font-size: 18px; font-weight: 700; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dhead__meta { margin-top: 3px; font-size: 12.5px; color: var(--ink-3); }
.dhead__actions { display: flex; gap: 6px; flex: none; }
.dquick { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }

.section { margin-bottom: 22px; }
.section__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.section__title { font-size: 13px; font-weight: 700; color: var(--ink); letter-spacing: .2px; }
.infolist { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line-2); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.info { background: var(--surface); padding: 10px 12px; min-width: 0; }
.info--wide { grid-column: span 2; }
.info__k { font-size: 12px; color: var(--ink-3); }
.info__v { margin-top: 2px; font-size: 13.5px; font-weight: 550; overflow-wrap: anywhere; }
.info__v a { color: var(--brand-ink); text-decoration: none; }
.info__v a:hover { text-decoration: underline; }

.timeline { position: relative; padding-left: 20px; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 2px; background: var(--line); border-radius: 2px; }
.tl { position: relative; padding: 0 0 16px; }
.tl:last-child { padding-bottom: 0; }
.tl::before { content: ""; position: absolute; left: -19px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--brand); }
.tl__head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-3); }
.tl__head b { color: var(--ink); font-weight: 650; font-size: 13px; }
.tl__body { margin-top: 4px; font-size: 13.5px; color: var(--ink); background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 8px 10px; white-space: pre-wrap; overflow-wrap: anywhere; }
.tl__del { border: 0; background: none; color: var(--ink-3); font-size: 12px; padding: 0; }
.tl__del:hover { color: var(--danger); text-decoration: underline; }

.deal { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 11px; margin-bottom: 8px; }
.deal__main { flex: 1; min-width: 0; }
.deal__title { font-weight: 600; font-size: 13.5px; }
.deal__sub { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.deal__amt { font-variant-numeric: tabular-nums; font-weight: 650; }

/* ---------- 弹窗 ---------- */
.modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 20px; }
.modal__mask { position: absolute; inset: 0; background: rgba(17, 20, 24, .48); animation: fade .18s ease-out; }
.modal__panel {
  position: relative; z-index: 1;
  width: min(680px, 100%); max-height: calc(100vh - 40px);
  display: flex; flex-direction: column;
  background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-lg);
  animation: pop .2s cubic-bezier(.16, 1, .3, 1);
}
.modal__panel--sm { width: min(440px, 100%); }
.modal__head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px 12px; border-bottom: 1px solid var(--line); }
.modal__head h2 { font-size: 16px; font-weight: 700; }
.modal__body { padding: 18px 20px; overflow-y: auto; }
.modal__foot { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 12px 20px 16px; border-top: 1px solid var(--line); }
.modal__foot .spacer { flex: 1; }

.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.form .span2 { grid-column: span 2; }
.req { color: var(--danger); margin-left: 2px; }
.hint { font-size: 12px; color: var(--ink-3); margin-top: 4px; line-height: 1.5; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span {
  display: inline-block; padding: 5px 11px;
  border: 1px solid var(--line); border-radius: 999px;
  font-size: 12.5px; color: var(--ink-2); background: var(--surface);
  transition: all .12s;
}
.seg input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
.seg input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.err { color: var(--danger); font-size: 12.5px; margin-top: 10px; }

.dropzone {
  border: 1.5px dashed #cfd5dd; border-radius: 12px;
  padding: 26px 16px; text-align: center; color: var(--ink-2);
  background: var(--surface-2);
  transition: border-color .15s, background .15s;
}
.dropzone.is-over { border-color: var(--brand); background: var(--brand-soft); }
.dropzone strong { display: block; font-size: 14px; color: var(--ink); margin-bottom: 4px; }
.import-preview { margin-top: 14px; max-height: 220px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
.import-preview table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.import-preview th, .import-preview td { padding: 6px 10px; border-bottom: 1px solid var(--line-2); text-align: left; white-space: nowrap; }
.import-preview th { background: var(--surface-2); position: sticky; top: 0; font-weight: 600; color: var(--ink-3); }
.stack { display: grid; gap: 10px; }
.radio-row { display: flex; gap: 8px; flex-wrap: wrap; }
.radio-card { flex: 1; min-width: 180px; border: 1px solid var(--line); border-radius: 11px; padding: 10px 12px; cursor: pointer; transition: border-color .15s, background .15s; }
.radio-card:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.radio-card b { display: block; font-size: 13.5px; }
.radio-card span { font-size: 12px; color: var(--ink-3); }
.radio-card input { margin-right: 6px; }

/* ---------- Toast ---------- */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 100; display: grid; gap: 8px; }
.toast {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; min-width: 220px; max-width: 360px;
  background: var(--ink); color: #fff;
  border-radius: 11px; box-shadow: var(--shadow-md);
  font-size: 13px;
  animation: toast-in .22s cubic-bezier(.16, 1, .3, 1);
}
.toast--ok { background: #0b6b4f; }
.toast--err { background: #a8201a; }

@keyframes fade { from { opacity: 0; } }
@keyframes slide-in { from { transform: translateX(28px); opacity: .4; } }
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: .4; } }
@keyframes toast-in { from { transform: translateY(10px); opacity: 0; } }

/* ---------- 响应式 ---------- */
@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .topbar { padding: 10px 14px; }
  .topbar__sub { display: none; }
  .page { padding: 14px 12px 56px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .kpi { padding: 11px 12px; }
  .kpi__value { font-size: 20px; }
  .filters { padding: 12px; }
  .filters__row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .field--grow { grid-column: span 2; }
  .filters__row--meta { flex-direction: row; }
  .form { grid-template-columns: 1fr; }
  .form .span2 { grid-column: span 1; }
  .infolist { grid-template-columns: 1fr; }
  .info--wide { grid-column: span 1; }
  .tab { padding: 9px 10px 11px; font-size: 13.5px; }
  .btn { height: 36px; }
  .toasts { left: 14px; right: 14px; }
  .toast { max-width: none; }
}
@media (max-width: 480px) {
  .topbar__actions .btn { padding: 0 10px; }
  #btnExport { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ---------- 手机端卡片列表 ---------- */
.cards { display: none; gap: 10px; }
.card {
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.card.is-selected { border-color: var(--brand); background: var(--brand-soft); }
.card__head { display: flex; align-items: center; gap: 10px; }
.card__main { flex: 1; min-width: 0; }
.card__name { font-weight: 650; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card__sub { font-size: 12px; color: var(--ink-3); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card__check { display: grid; place-items: center; width: 40px; height: 40px; flex: none; margin: -8px -10px -8px 0; cursor: pointer; }
.card__check input { width: 18px; height: 18px; }
.card__tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: 10px; }
.card__foot { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line-2); }
.filters__toggle { display: none; }

/* ---------- 手机端布局 ---------- */
@media (max-width: 820px) {
  .topbar { padding: 10px 12px; gap: 8px; }
  .topbar h1 { font-size: 16px; }
  .topbar__actions { gap: 6px; }
  .topbar__actions .btn { height: 38px; padding: 0 10px; }
  .topbar__actions .btn__text { display: none; }
  .topbar__actions .btn--primary { padding: 0 12px; }
  #btnExport { display: inline-flex; }

  .page { padding: 12px 12px 96px; }

  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
  .kpi {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "label value" "hint value";
    align-items: center; column-gap: 10px; padding: 10px 12px; text-align: left;
  }
  .kpi__label { grid-area: label; }
  .kpi__value { grid-area: value; font-size: 20px; }
  .kpi__hint { grid-area: hint; margin-top: 0; }

  .filters { padding: 12px; }
  .filters__row--search { grid-template-columns: minmax(0, 1fr) auto; align-items: end; }
  .filters__row--search .field--grow { grid-column: span 1; }
  .filters__toggle { display: inline-flex; height: 40px; }
  #filtersMore { display: none; }
  .filters.is-open #filtersMore { display: grid; }
  .filters__row--meta { margin-top: 10px; }

  .tablewrap { display: none; }
  .cards { display: grid; }

  .bulkbar {
    position: fixed; top: auto; bottom: 0; left: 0; right: 0; z-index: 40;
    margin: 0; padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
    border-radius: 14px 14px 0 0;
  }
  .bulkbar__actions .btn { height: 38px; }

  .drawer__panel { width: 100vw; }
  .drawer__head { padding: 14px 16px 12px; }
  .drawer__body { padding: 16px 16px calc(24px + env(safe-area-inset-bottom)); }
  .dhead__actions .btn { height: 38px; }

  .modal { padding: 0; place-items: end center; }
  .modal__panel, .modal__panel--sm { width: 100%; max-height: 92vh; border-radius: 16px 16px 0 0; }
  .modal__head { padding: 14px 16px 10px; }
  .modal__body { padding: 16px; }
  .modal__foot { padding: 12px 16px calc(14px + env(safe-area-inset-bottom)); }
  .modal__foot .btn { flex: 1; height: 42px; }

  input[type="text"], input[type="search"], input[type="tel"], input[type="number"], input[type="date"], select, textarea { font-size: 16px; }
  .btn { height: 40px; }
  .pager { justify-content: center; }
  .toasts { left: 14px; right: 14px; bottom: 88px; }
  .toast { max-width: none; }
}
