:root {
  --brand: #ec4899;
  --brand-dark: #be185d;
  --bg: #f5f6fa;
  --card: #ffffff;
  --line: #e8eaf0;
  --text: #1f2430;
  --muted: #8a90a2;
  --green: #22a06b;
  --red: #e5484d;
  --orange: #f5a623;
  --radius: 12px;
  --shadow: 0 2px 10px rgba(20, 30, 60, .06);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
}
a { color: var(--brand); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* ---------- Login ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  background: linear-gradient(160deg, #ec4899 0%, #f472b6 55%, #f9a8d4 100%);
}
.login-card {
  width: 100%; max-width: 380px;
  background: #fff; border-radius: 16px; padding: 32px 26px;
  box-shadow: 0 12px 40px rgba(20, 30, 80, .25);
}
.login-card h1 { font-size: 21px; margin: 0 0 4px; text-align: center; }
.login-card .sub { text-align: center; color: var(--muted); font-size: 13px; margin-bottom: 22px; }

/* ---------- Layout ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: var(--brand); color: #fff;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px; height: 54px;
}
.topbar .title { font-weight: 600; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.topbar .title .role-tag {
  font-size: 11px; background: rgba(255,255,255,.22); padding: 2px 8px; border-radius: 20px; font-weight: 500;
}
.topbar .user { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.topbar .user button {
  background: rgba(255,255,255,.16); color: #fff; border: none; padding: 6px 12px; border-radius: 8px; font-size: 13px;
}

.tabs {
  position: sticky; top: 54px; z-index: 19;
  background: #fff; border-bottom: 1px solid var(--line);
  display: flex; overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.tabs button {
  flex: 0 0 auto; border: none; background: none; padding: 14px 18px;
  font-size: 15px; color: var(--muted); position: relative; white-space: nowrap;
}
.tabs button.active { color: var(--brand); font-weight: 600; }
.tabs button.active::after {
  content: ""; position: absolute; left: 18px; right: 18px; bottom: 0; height: 3px;
  background: var(--brand); border-radius: 3px 3px 0 0;
}

.container { max-width: 1000px; margin: 0 auto; padding: 16px; }
.worker-watermarked { position: relative; min-height: calc(100vh - 108px); overflow: hidden; }
.worker-watermarked #content { position: relative; z-index: 1; }
.worker-wm {
  position: absolute; inset: 0; z-index: 2; pointer-events: none; user-select: none;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  grid-auto-rows: 84px; gap: 12px 18px; padding: 20px 0; overflow: hidden;
}
.worker-wm span {
  align-self: center; justify-self: center; transform: rotate(-28deg);
  color: rgba(31, 36, 48, .075); font-size: 18px; font-weight: 700;
  white-space: nowrap; letter-spacing: 0;
}

/* ---------- Cards & stats ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 14px; }
.card h3 { margin: 0 0 12px; font-size: 15px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat {
  background: #fff; border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 4px;
}
.stat .label { color: var(--muted); font-size: 13px; }
.stat .value { font-size: 24px; font-weight: 700; }
.stat .value.money { color: var(--green); }
.stat .value.warn { color: var(--orange); }

/* ---------- Forms ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.field-grid { display: grid; grid-template-columns: repeat(3, minmax(120px, 1fr)); gap: 12px; }
.field-grid .field { margin-bottom: 14px; }
@media (max-width: 760px) { .field-grid { grid-template-columns: 1fr; } }
input, select, textarea {
  width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px;
  font-size: 15px; color: var(--text); background: #fff; outline: none; transition: border .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--brand); }
textarea { resize: vertical; min-height: 60px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > .field { flex: 1 1 140px; margin-bottom: 14px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--brand); color: #fff; border: none; padding: 11px 18px;
  border-radius: 10px; font-size: 15px; font-weight: 500;
}
.btn:active { background: var(--brand-dark); }
.btn.block { width: 100%; }
.btn.sm { padding: 7px 12px; font-size: 13px; border-radius: 8px; }
.btn.ghost { background: #fff0f6; color: var(--brand); }
.btn.green { background: var(--green); }
.btn.red { background: var(--red); }
.btn.orange { background: var(--orange); }
.btn.blue { background: var(--brand); }
.btn.gray { background: #eceef3; color: #555; }
.btn.line { background: #fff; color: #555; border: 1px solid var(--line); }
.btn.line:active { background: #f2f4f8; }
.btn.danger { background: #fdecec; color: var(--red); }
.btn.danger:active { background: #f9dede; }
.btn.icon { flex: 0 0 auto; padding: 0; width: 30px; height: 30px; border-radius: 8px; font-size: 13px; line-height: 1; }
.btn:disabled { opacity: .5; }

/* ---------- Table ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius); box-shadow: var(--shadow); background:#fff; }
table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 520px; }
th, td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { background: #fafbff; color: var(--muted); font-weight: 600; }
tr:last-child td { border-bottom: none; }
tfoot td { background: #fafbff; font-weight: 700; border-top: 2px solid var(--line); border-bottom: none; }

/* ---------- Task cards ---------- */
.task { border: 1px solid var(--line); border-radius: 14px; padding: 15px 16px; margin-bottom: 12px; background: #fff; box-shadow: 0 1px 3px rgba(20,30,60,.05); transition: box-shadow .15s; }
.task:hover { box-shadow: 0 4px 16px rgba(20,30,60,.08); }
.task .th { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.task .th .who { font-weight: 700; font-size: 15px; }
.task .meta { display: grid; grid-template-columns: repeat(auto-fill, minmax(185px, 1fr)); gap: 8px 18px; font-size: 13px; margin-bottom: 4px; }
.task .meta > div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task .meta > div.wide { grid-column: 1 / -1; }
.task .meta .k { color: var(--muted); }
.task .fb { background: #f7f8fc; border-radius: 10px; padding: 12px; font-size: 13px; margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.task .fb .row { gap: 10px; }
.task .actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; align-items: center; }
.cell-sub { color: var(--muted); font-size: 12px; margin-top: 2px; }

/* 排期 */
.tab-dot { display: inline-flex; align-items: center; justify-content: center; min-width: 16px; height: 16px; padding: 0 4px; margin-left: 5px; border-radius: 9px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; vertical-align: middle; }
.sched-today { background: #fff5e6; border: 1px solid #ffd591; color: #ad4e00; border-radius: 10px; padding: 12px 14px; margin-bottom: 12px; font-size: 14px; line-height: 1.6; }
.sched-today b { color: var(--red); font-size: 16px; }
.sched-overdue { background: #fdecec; border: 1px solid #f5c2c2; color: var(--red); border-radius: 10px; padding: 10px 14px; margin-bottom: 12px; font-size: 13px; }
.sched-date { margin-top: 14px; }
.sched-date-h { font-size: 14px; font-weight: 700; margin-bottom: 8px; padding-left: 10px; border-left: 3px solid var(--brand); }
.sched-date.is-today .sched-date-h { border-left-color: var(--orange); color: #ad4e00; }
.sched-date.is-over .sched-date-h { border-left-color: var(--red); color: var(--red); }
.sched-date-h.is-today { border-left: 3px solid var(--orange); padding-left: 10px; color: #ad4e00; }
.sched-date-h.is-over { border-left: 3px solid var(--red); padding-left: 10px; color: var(--red); }
.sched-detail { margin-top: 14px; }
/* 日历 */
.cal { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.cal-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; gap: 8px; }
.cal-title { font-weight: 700; font-size: 15px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-dow { text-align: center; padding: 7px 0; font-size: 12px; color: var(--muted); background: #fafbff; border-top: 1px solid var(--line); }
.cal-cell { min-height: 62px; border-top: 1px solid var(--line); border-left: 1px solid #f1f3f7; padding: 6px 6px 4px; cursor: pointer; position: relative; }
.cal-cell:nth-child(7n+1) { border-left: none; }
.cal-cell.blank { background: #fafbfc; cursor: default; }
.cal-cell:not(.blank):hover { background: #fff0f6; }
.cal-cell.today { background: #fff5e6; }
.cal-cell.sel { box-shadow: inset 0 0 0 2px var(--brand); z-index: 1; }
.cal-day { font-size: 13px; color: #333; }
.cal-cell.past .cal-day { color: #b9bdc7; }
.cal-cell.today .cal-day { color: var(--orange); font-weight: 700; }
.cal-cnts { position: absolute; right: 5px; bottom: 5px; display: flex; gap: 3px; }
.cal-cnt { background: var(--brand); color: #fff; font-size: 11px; font-weight: 700; border-radius: 9px; min-width: 17px; height: 17px; display: inline-flex; align-items: center; justify-content: center; padding: 0 4px; }
.cal-cnt.done { background: var(--green); }
.cal-cell.past .cal-cnt { opacity: .5; }
.lg-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin: 0 3px 0 2px; vertical-align: middle; }
.lg-dot.brand { background: var(--brand); }
.lg-dot.green { background: var(--green); }
@media (max-width: 520px) { .cal-cell { min-height: 48px; } .cal-day { font-size: 12px; } }
.settle-search { margin: 6px 0 12px; }

.pager { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 4px 2px 2px; font-size: 13px; }
.pager .btn.sm { padding: 5px 14px; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge.pending { background: #fff4e0; color: #b8760a; }
.badge.claimed { background: #d9f2ee; color: #0f766e; }
.badge.contacting { background: #fce7f3; color: #be185d; }
.badge.to_publish { background: #f0e9fb; color: #7a3fd0; }
.badge.need_info { background: #fff0f6; color: #be185d; }
.badge.rejected { background: #fde8e8; color: #c0353a; }
.badge.accepted { background: #e3f7ee; color: #1a7d51; }
.badge.settled { background: #e3f7ee; color: #1a7d51; }
.badge.unsettled { background: #fff4e0; color: #b8760a; }

.warn-box { background: #fff4e0; border: 1px solid #ffd591; color: #b8760a; padding: 8px 10px; border-radius: 8px; font-size: 13px; margin: 8px 0; }
.dup-box { background: #fde8e8; border: 1px solid #ffa8a8; color: #c0353a; padding: 8px 10px; border-radius: 8px; font-size: 13px; margin: 8px 0; }

input[type=checkbox] { width: auto; margin-right: 6px; vertical-align: middle; transform: scale(1.15); }
.proof-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.proof-img { width: 92px; height: 92px; border-radius: 8px; border: 1px solid var(--line); object-fit: cover; display: block; }

.settle-list { max-height: 240px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; padding: 2px 12px; margin-bottom: 10px; }
.settle-item { display: flex; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; cursor: pointer; }
.settle-item:last-child { border-bottom: none; }
.settle-item .amt { margin-left: auto; color: var(--green); font-weight: 600; }
.settle-total { margin-bottom: 12px; font-size: 15px; }
.settle-total b { color: var(--green); font-size: 18px; }
.settle-total .warn { color: var(--red, #e5484d); }

/* 一键批量分配 */
.ba-modes { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 10px; font-size: 14px; }
.ba-modes label { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.ba-modes #ba-fill { margin-left: auto; }
.assign-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.assign-row:last-child { border-bottom: none; }
.assign-row .ba-name { flex: 1 1 auto; }
.assign-row .ba-num { width: 84px; text-align: right; }
.assign-row.off { opacity: .5; }
.assign-row.locked { background: #fafbff; }
.assign-row .ba-lock, .assign-row .ba-final { color: var(--muted); font-size: 12px; white-space: nowrap; }

.ledger { display: flex; flex-direction: column; }
.led-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.led-row:last-child { border-bottom: none; }
.led-t { font-weight: 600; font-size: 14px; }
.led-d { font-size: 12px; margin-top: 2px; }
.led-time { font-size: 12px; margin-top: 2px; }
.led-amt { font-weight: 700; font-size: 16px; white-space: nowrap; }
.led-amt.inc { color: var(--green); }
.led-amt.dec { color: var(--red); }

.filter-bar { display: flex; gap: 10px; padding: 12px 16px 0; flex-wrap: wrap; margin-bottom: 16px; }
.filter-bar select { flex: 1 1 140px; }

.quick-range { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.quick-range button { border: 1px solid var(--line); background: #fff; color: var(--muted); padding: 6px 14px; border-radius: 20px; font-size: 13px; }
.quick-range button:hover { border-color: var(--brand); color: var(--brand); }
.range-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.range-row input[type=date] { flex: 1 1 140px; }
.range-row .range-sep { color: var(--muted); }

.blogger-search { flex: 1 1 180px; }
.combo { position: relative; flex: 1 1 180px; }
.combo input { width: 100%; padding-right: 30px; }
.combo-clear { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); border: none; background: transparent; font-size: 20px; line-height: 1; color: var(--muted); cursor: pointer; padding: 0 4px; }
.combo-panel { position: absolute; top: calc(100% + 4px); left: 0; right: 0; background: #fff; border: 1px solid var(--line); border-radius: 8px; max-height: 260px; overflow-y: auto; z-index: 30; display: none; box-shadow: 0 8px 24px rgba(0,0,0,.14); }
.combo-item { padding: 10px 12px; cursor: pointer; font-size: 14px; border-bottom: 1px solid var(--line); }
.combo-item:last-child { border-bottom: none; }
.combo-item:hover { background: #f2f5ff; }

.reason-ctx { background: #f2f5ff; border-radius: 8px; padding: 8px 12px; font-size: 13px; color: var(--text); margin-bottom: 10px; }

.help-doc { max-height: 62vh; overflow-y: auto; font-size: 14px; line-height: 1.7; color: var(--text); padding-right: 4px; }
.help-doc .help-lead { background: #f2f5ff; border-radius: 8px; padding: 10px 12px; margin: 0 0 12px; }
.help-doc h4 { margin: 14px 0 6px; font-size: 14px; color: var(--brand); }
.help-doc ul { margin: 0 0 8px; padding-left: 20px; }
.help-doc li { margin: 3px 0; }

input[type=radio] { width: auto; margin: 0; flex: 0 0 auto; transform: scale(1.1); }
.claim-list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin-bottom: 12px; }
.claim-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--line); cursor: pointer; }
.claim-item:last-child { border-bottom: none; }
.claim-item.disabled { opacity: .6; cursor: not-allowed; background: #fafbfc; }
.claim-item .ci-main { flex: 1; min-width: 0; }
.claim-item .ci-l1 { font-size: 14px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.claim-item .ci-l2 { font-size: 12px; margin-top: 2px; }
.tag-first { background: #e3f7ee; color: #1a7d51; border-radius: 4px; padding: 0 6px; font-size: 11px; font-weight: 600; }
.tag-taken { background: #eceef3; color: #777; border-radius: 4px; padding: 0 6px; font-size: 11px; }
.field label.chk { display: flex; align-items: center; gap: 6px; font-weight: 400; cursor: pointer; color: var(--text); }
.pool-tip { background: #fff0f6; color: #be185d; border-radius: 8px; padding: 8px 12px; font-size: 13px; margin-bottom: 10px; }

.install-card { max-width: 460px; text-align: left; }
.install-sec { font-weight: 600; color: var(--brand); margin: 18px 0 8px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.install-card .btn.ghost { margin-top: 4px; }

.link-btn { border: none; background: #eef1fb; color: var(--brand); border-radius: 6px; padding: 2px 9px; font-size: 12px; margin-left: 6px; vertical-align: middle; }
.link-btn:active { background: #dbe2fb; }

.type-field { display: flex; flex-direction: column; gap: 8px; }
.type-field .type-new { margin-top: 0; }

.plat-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }
.plat-row .type-row-in { flex: 1 1 60px; width: auto; min-width: 0; }
.plat-row .p-name { flex: 0 0 100px; }
.plat-row .p-url { flex: 1 1 200px; }
.plat-row .p-en { flex: 0 0 auto; white-space: nowrap; font-size: 13px; color: var(--muted); display: flex; align-items: center; }
.reply-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.reply-row .radm-item { flex: 1 1 auto; width: auto; min-width: 0; resize: vertical; }
.radm-head { display: flex; justify-content: space-between; align-items: center; }
.radm-body { display: flex; gap: 12px; margin-top: 12px; align-items: stretch; min-height: 340px; }
.radm-groups { flex: 0 0 180px; width: 180px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fafbff; align-self: flex-start; }
.radm-grp { padding: 10px 12px; font-size: 13px; cursor: pointer; border-bottom: 1px solid #f0f2f7; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.radm-grp:hover { background: #fff0f6; }
.radm-grp.active { background: #fff; color: var(--brand); font-weight: 600; box-shadow: inset 3px 0 0 var(--brand); }
.radm-grp-n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.radm-grp-c { flex: 0 0 auto; font-size: 11px; color: var(--muted); background: #eef1f7; border-radius: 10px; padding: 0 7px; }
.radm-grp.active .radm-grp-c { color: var(--brand); }
.radm-addgrp { padding: 10px 12px; font-size: 13px; color: var(--brand); cursor: pointer; text-align: center; }
.radm-addgrp:hover { background: #fff0f6; }
.radm-detail { flex: 1 1 auto; min-width: 0; border: 1px solid var(--line); border-radius: 8px; padding: 12px; }
.radm-detail-head { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.radm-name { flex: 1 1 auto; width: auto; min-width: 0; font-weight: 600; }
@media (max-width: 640px) {
  .radm-body { flex-direction: column; }
  .radm-groups { flex: none; width: 100%; max-height: 180px; overflow-y: auto; }
}
.lbl-tip { font-weight: 400; font-size: 12px; color: var(--muted); }
.rm-reason-wrap { position: relative; }
.rp-pop { position: fixed; z-index: 1000; width: 560px; max-width: 92vw; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 34px rgba(0,0,0,.20); overflow: hidden; }
.rp-pop .rp-search { margin: 8px; width: calc(100% - 16px); }
.rp-pop .rp-body { height: 340px; border: none; border-top: 1px solid var(--line); border-radius: 0; }
.rp-search { width: 100%; margin-bottom: 10px; }
.rp-body { display: flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; height: 340px; }
.rp-groups { flex: 0 0 132px; border-right: 1px solid var(--line); overflow-y: auto; background: #fafbff; }
.rp-grp { padding: 10px 12px; font-size: 13px; cursor: pointer; border-bottom: 1px solid #f0f2f7; display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.rp-grp:hover { background: #fff0f6; }
.rp-grp.active { background: #fff; color: var(--brand); font-weight: 600; box-shadow: inset 3px 0 0 var(--brand); }
.rp-cnt { font-size: 11px; color: var(--muted); }
.rp-grp.active .rp-cnt { color: var(--brand); }
.rp-items { flex: 1 1 auto; overflow-y: auto; }
.rp-item { padding: 9px 12px; font-size: 13px; line-height: 1.45; cursor: pointer; border-bottom: 1px solid #f5f6fa; }
.rp-item.active, .rp-item:hover { background: #fff0f6; }
.rp-item.active .rp-item-c, .rp-item:hover .rp-item-c { color: var(--brand); }
.rp-item-g { display: inline-block; font-size: 11px; color: var(--muted); background: #eef1f7; border-radius: 4px; padding: 1px 6px; margin-right: 6px; }
.tpl-empty { padding: 14px 12px; color: var(--muted); font-size: 12px; }
code { background: #eef1fb; padding: 1px 5px; border-radius: 4px; font-size: 12px; }

.empty { text-align: center; color: var(--muted); padding: 40px 20px; }

.empty-guide { text-align: center; padding: 48px 20px; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }
.empty-guide .eg-title { font-size: 17px; font-weight: 700; margin-bottom: 8px; }
.empty-guide .eg-sub { color: var(--muted); font-size: 14px; line-height: 1.6; max-width: 360px; margin: 0 auto 18px; }
.muted { color: var(--muted); }
.hint { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* ---------- Modal ---------- */
.modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.modal { background: #fff; border-radius: 16px; width: 100%; max-width: 460px; max-height: 90vh; overflow-y: auto; padding: 22px; }
.modal.modal-wide { max-width: min(820px, 96vw); overflow: auto; }
.modal.modal-wide .table-wrap { max-width: 100%; overflow-x: auto; }
.modal.modal-wide table { min-width: 680px; }
.modal h3 { margin: 0 0 16px; }
.modal .modal-actions { display: flex; gap: 10px; margin-top: 8px; }
.edit-actions { display: flex; gap: 8px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 12px; margin: 12px 0; }
.more-pop { position: fixed; z-index: 80; min-width: 132px; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 28px rgba(20,30,60,.18); padding: 6px; }
.more-pop button { width: 100%; border: none; background: transparent; color: var(--text); text-align: left; padding: 9px 10px; border-radius: 8px; font-size: 13px; cursor: pointer; }
.more-pop button:hover { background: #fff0f6; color: var(--brand); }
.more-pop button.danger { color: var(--red); }
.more-pop button.danger:hover { background: #fdecec; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; top: 70px; transform: translateX(-50%) translateY(-20px);
  background: #1f2430; color: #fff; padding: 11px 18px; border-radius: 10px; font-size: 14px;
  opacity: 0; pointer-events: none; transition: all .25s; z-index: 100; max-width: 90%; text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { background: #c0353a; }
.toast.ok { background: #1a7d51; }

/* ---------- Filter chips ---------- */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 6px; margin-bottom: 12px; }
.chips button {
  flex: 0 0 auto; border: 1px solid var(--line); background: #fff; color: var(--muted);
  padding: 7px 15px; border-radius: 20px; font-size: 13px; font-weight: 500; transition: all .12s;
}
.chips button:hover { border-color: var(--brand); color: var(--brand); }
.chips button.active { background: var(--brand); color: #fff; border-color: var(--brand); box-shadow: 0 2px 8px rgba(236,72,153,.28); }
.chip-count { display: inline-block; min-width: 16px; margin-left: 6px; padding: 0 5px; border-radius: 9px;
  background: rgba(0,0,0,.08); color: inherit; font-size: 11px; font-weight: 600; line-height: 16px; text-align: center; }
.chips button.active .chip-count { background: rgba(255,255,255,.28); }

.wx-groups { display: flex; gap: 8px; overflow-x: auto; padding: 0 0 10px; margin: -2px 0 10px; }
.wxg {
  flex: 0 0 auto; display: flex; align-items: center; gap: 7px;
  border: 1px solid var(--line); background: #fff; color: var(--text);
  padding: 7px 10px; border-radius: 8px; font-size: 12px; max-width: 320px;
}
.wxg:hover { border-color: var(--brand); }
.wxg.active { border-color: var(--brand); background: #fff0f6; color: var(--brand); }
.wxg-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 160px; }
.wxg-num { color: var(--muted); background: #f2f4f8; border-radius: 6px; padding: 1px 5px; white-space: nowrap; }
.wxg.active .wxg-num { color: var(--brand); background: rgba(236,72,153,.12); }

.worker-stepper { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; padding: 2px 0 10px; margin-bottom: 4px; }
.worker-step {
  position: relative; min-width: 0; display: flex; align-items: center; gap: 9px;
  border: 1px solid var(--line); background: #fff; color: var(--muted); border-radius: 8px; padding: 10px 11px;
  text-align: left; transition: all .12s; cursor: pointer;
}
.worker-step-no {
  width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: #eef1f7; color: var(--muted); font-weight: 800; font-size: 13px; flex: none;
}
.worker-step-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.worker-step-text b { color: var(--text); font-size: 13px; line-height: 1.2; }
.worker-step-text em { font-style: normal; color: var(--muted); font-size: 12px; }
.worker-step-text em::after { content: " 条"; }
.worker-step:hover { border-color: var(--brand); }
.worker-step.active { border-color: var(--brand); background: #fff0f6; box-shadow: 0 2px 8px rgba(236,72,153,.14); }
.worker-step.active .worker-step-no { background: var(--brand); color: #fff; }
.worker-step.active .worker-step-text b, .worker-step.active .worker-step-text em { color: var(--brand); }
.worker-exceptions { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.worker-exception {
  flex: 0 0 auto; border: 1px dashed #cfd5e3; background: #fff; color: var(--muted);
  border-radius: 8px; padding: 7px 10px; font-size: 12px; cursor: pointer;
}
.worker-exception span { display: inline-block; min-width: 16px; margin-left: 6px; text-align: center; font-weight: 700; color: inherit; }
.worker-exception.active { border-style: solid; border-color: var(--brand); color: var(--brand); background: #fff0f6; }
.worker-stage-intro {
  display: flex; gap: 8px; align-items: flex-start; flex-wrap: wrap;
  background: #fff7fb; border: 1px solid #fbcfe8; border-left: 3px solid var(--brand);
  border-radius: 8px; padding: 10px 12px; margin: 0 0 12px; font-size: 13px; color: #4c566d;
}
.worker-stage-intro b { color: var(--brand); flex: 0 0 auto; }
.worker-stage-intro span { min-width: 0; flex: 1 1 240px; }
.contact-work .meta { margin-top: 8px; }
.settle-item small { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }

@media (min-width: 720px) {
  .task .th .who { font-size: 16px; }
}
@media (max-width: 480px) {
  .container { padding: 12px; }
  .stat .value { font-size: 20px; }
}

/* ===== 谈妥趋势折线图 ===== */
.viz-ptitle { font-size: 13px; font-weight: 600; color: var(--muted); margin: 14px 0 2px; }
.viz-ptitle:first-of-type { margin-top: 4px; }
.viz-svg { display: block; width: 100%; height: auto; overflow: visible; }
.viz-svg .viz-grid { stroke: var(--line); stroke-width: 1; }
.viz-svg .viz-axis { stroke: #c9cdd8; stroke-width: 1; }
.viz-svg .viz-wkd { fill: rgba(138,144,162,.09); }
.viz-svg .viz-tick { fill: var(--muted); font-size: 11px; }
.viz-svg .viz-dlabel { font-size: 12px; font-weight: 600; }
.viz-svg .viz-cross { stroke: #b6bac6; stroke-width: 1; stroke-dasharray: 3 3; }
.viz-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 8px 2px 2px; font-size: 13px; }
.viz-legend .viz-lg-it { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.viz-legend .viz-lg-sw { width: 22px; height: 3px; border-radius: 2px; }
.viz-tt {
  position: fixed; pointer-events: none; z-index: 200; display: none;
  background: var(--card); color: var(--text); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 10px; font-size: 12px; min-width: 118px;
  box-shadow: 0 6px 20px rgba(20,30,60,.18);
}
.viz-tt .viz-tt-h { font-weight: 700; margin-bottom: 5px; }
.viz-tt .viz-tt-r { display: flex; align-items: center; gap: 6px; line-height: 1.7; color: var(--muted); }
.viz-tt .viz-tt-d { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.viz-tt .viz-tt-v { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--text); font-weight: 600; }
