:root {
  --bg: #f3f4f1;
  --surface: #ffffff;
  --surface-soft: #f8faf7;
  --text: #172022;
  --muted: #697477;
  --line: #dfe4df;
  --line-strong: #c8d0ca;
  --primary: #0f766e;
  --primary-dark: #0b5f59;
  --accent: #b85c38;
  --accent-soft: #fff1e9;
  --danger: #b42318;
  --danger-dark: #8f1b12;
  --warning: #a15c07;
  --shadow: 0 18px 45px rgba(23, 32, 34, 0.08);
  --shadow-soft: 0 8px 24px rgba(23, 32, 34, 0.06);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.08), transparent 36%),
    linear-gradient(315deg, rgba(184, 92, 56, 0.09), transparent 34%),
    var(--bg);
  font-family: "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
  font-size: 14px;
  letter-spacing: 0;
}

h1,
h2,
h3,
p {
  margin: 0;
}

a {
  color: inherit;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 30px;
  color: #fff;
  background: rgba(20, 29, 28, 0.94);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 10px 30px rgba(20, 29, 28, 0.18);
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 280px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  border-radius: 8px;
  color: #ffffff;
  background: linear-gradient(135deg, #0f766e, #c66a3b);
  font-weight: 800;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.brand h1 {
  font-size: 20px;
  line-height: 1.25;
  font-weight: 800;
}

.brand p {
  margin-top: 5px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 13px;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.nav a,
.ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 8px 13px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.78);
  background: rgba(255, 255, 255, 0.06);
  text-decoration: none;
  white-space: nowrap;
}

.nav a:hover,
.ghost:hover,
.nav a.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
}

.status-dot {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 8px 12px;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.82);
  background: rgba(15, 118, 110, 0.35);
  white-space: nowrap;
}

.status-dot::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #67e8c9;
  box-shadow: 0 0 0 4px rgba(103, 232, 201, 0.14);
}

.workspace {
  width: min(1480px, calc(100% - 40px));
  margin: 0 auto;
  padding: 26px 0 34px;
}

.workspace.wide {
  width: min(1900px, calc(100% - 20px));
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: end;
  padding: 30px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 10px;
  color: #fff;
  background:
    linear-gradient(120deg, rgba(21, 33, 31, 0.96), rgba(40, 59, 52, 0.9)),
    linear-gradient(135deg, rgba(15, 118, 110, 0.8), rgba(184, 92, 56, 0.55));
  box-shadow: var(--shadow);
}

.eyebrow {
  margin-bottom: 10px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero-panel .eyebrow {
  color: #f9b28c;
}

.hero-panel h2 {
  max-width: 850px;
  font-size: 30px;
  line-height: 1.26;
  font-weight: 850;
}

.hero-panel p {
  max-width: 760px;
  margin-top: 12px;
  color: rgba(255, 255, 255, 0.76);
  line-height: 1.7;
}

.quick-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.quick-links a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 10px 15px;
  border-radius: 8px;
  color: #172022;
  background: #fff;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.quick-links a:hover {
  background: #f4f7f5;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 14px;
  margin: 18px 0;
}

.metric-card,
.surface {
  border: 1px solid rgba(223, 228, 223, 0.9);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-soft);
}

.metric-card {
  padding: 18px;
}

.metric-card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.metric-card strong {
  display: block;
  margin-top: 10px;
  color: var(--text);
  font-size: 30px;
  line-height: 1;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(430px, 0.9fr) minmax(560px, 1.1fr);
  gap: 18px;
}

.surface {
  padding: 18px;
  overflow: hidden;
}

.surface-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.surface-head h2 {
  font-size: 19px;
  line-height: 1.35;
  font-weight: 850;
}

.surface-head p,
.summary {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.55;
}

.task-surface {
  min-width: 0;
}

.schedule-surface {
  margin-top: 18px;
}

.inline-schedule-field {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.inline-schedule-field input {
  min-width: 205px;
  min-height: 38px;
  padding: 7px 9px;
}

.schedule-message {
  min-height: 20px;
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13px;
}

.task-source-cell {
  min-width: 190px;
  vertical-align: top;
}

.task-source-details {
  min-width: 0;
}

.task-source-details summary {
  cursor: pointer;
  color: #0d5f8f;
  font-weight: 750;
  white-space: nowrap;
}

.task-source-list {
  display: grid;
  gap: 4px;
  max-height: 180px;
  margin-top: 8px;
  overflow: auto;
  color: var(--text);
  font-size: 12px;
  line-height: 1.45;
}

.task-source-list strong {
  color: #0d5f8f;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 13px;
}

.field span {
  color: #425052;
  font-size: 13px;
  font-weight: 700;
}

textarea,
input,
select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text);
  background: #fff;
  font: inherit;
  outline: none;
}

textarea {
  resize: vertical;
  line-height: 1.55;
}

textarea:focus,
input:focus,
select:focus {
  border-color: rgba(15, 118, 110, 0.65);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12);
}

.form-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr 1fr 1fr;
  gap: 12px;
}

button {
  border: 0;
  border-radius: 8px;
  min-height: 38px;
  padding: 9px 14px;
  color: #fff;
  background: var(--primary);
  font: inherit;
  font-weight: 750;
  cursor: pointer;
  white-space: nowrap;
}

button:hover {
  background: var(--primary-dark);
}

button.primary {
  background: linear-gradient(135deg, var(--primary), #149181);
}

button.primary:hover {
  background: linear-gradient(135deg, var(--primary-dark), #117b70);
}

button.secondary {
  color: #243033;
  background: #edf1ee;
  border: 1px solid #d9e1dc;
}

button.secondary:hover {
  background: #e1e8e3;
}

button.danger {
  background: var(--danger);
}

button.danger:hover {
  background: var(--danger-dark);
}

button.small,
.small {
  min-height: 30px;
  padding: 5px 9px;
  border-radius: 7px;
  font-size: 12px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.button-row,
.filters,
.pager,
.bulkbar,
.row-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.button-row {
  flex-wrap: wrap;
}

#formMessage {
  color: var(--muted);
}

.table-shell {
  width: 100%;
  max-height: 760px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.table-shell.compact {
  max-height: 345px;
}

table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
}

.column-resizable-table {
  table-layout: fixed;
  width: 100%;
  min-width: 0;
}

.column-resizable-table th {
  position: relative;
  min-width: 0 !important;
  overflow: hidden;
}

.column-resizable-table td {
  min-width: 0 !important;
  overflow: hidden;
}

.column-resize-handle {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 30;
  width: 14px;
  height: 100%;
  cursor: col-resize;
  touch-action: none;
}

/* 筛选按钮必须位于列宽拖动区域之上，避免点击被 resize handle 截走。 */
.column-resizable-table .th-title,
.column-resizable-table .filter-toggle,
.column-resizable-table .sort-head {
  position: relative;
  z-index: 10;
}

.column-resizable-table .filter-toggle {
  pointer-events: auto;
}

.column-resize-handle::after {
  content: "";
  position: absolute;
  top: 22%;
  left: 7px;
  width: 2px;
  height: 56%;
  background: rgba(15, 118, 110, 0.16);
  border-radius: 2px;
}

.column-resize-handle:hover::after,
.is-resizing-column .column-resize-handle::after {
  background: var(--accent, #0f8b72);
}

.is-resizing-column,
.is-resizing-column * {
  cursor: col-resize !important;
  user-select: none !important;
}

th,
td {
  padding: 10px 11px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  position: sticky;
  top: 0;
  z-index: 2;
  color: #344244;
  background: #f7faf7;
  font-size: 13px;
  font-weight: 850;
  min-width: 116px;
}

td {
  color: #2f3d40;
  line-height: 1.5;
}

.loading-cell {
  padding: 26px 12px;
  color: var(--muted);
  text-align: center;
}

tbody tr:hover td {
  background: #fbfcfa;
}

.select-col {
  width: 44px;
  min-width: 44px;
}

.nowrap {
  white-space: nowrap;
}

.ellipsis {
  max-width: 360px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.th-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  min-width: 0;
  overflow: hidden;
}

.sort-head {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 26px;
  padding: 0;
  color: #344244;
  background: transparent;
  text-align: left;
  font-weight: 850;
}

.sort-head:hover,
.sort-head.active {
  color: var(--primary);
  background: transparent;
}

.sort-mark {
  color: var(--primary);
  font-size: 12px;
  font-weight: 900;
}

.filter-toggle {
  width: 26px;
  height: 26px;
  min-height: 26px;
  padding: 0;
  border-radius: 7px;
  color: var(--primary);
  background: #e5f2ee;
  line-height: 26px;
}

.filter-toggle:hover {
  background: #d4ebe4;
}

.filter-toggle.active {
  color: #fff;
  background: var(--primary);
}

.filter-panel {
  position: absolute;
  z-index: 50;
  display: none;
  width: 240px;
  padding: 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 18px 40px rgba(23, 32, 34, 0.18);
}

.filter-panel.visible {
  display: block;
}

.filter-panel-title {
  margin-bottom: 8px;
  color: #344244;
  font-size: 13px;
  font-weight: 850;
}

.filter-panel input {
  min-height: 36px;
  padding: 8px 10px;
}

.filter-panel-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.filter-panel-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}

.link-cell a {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--primary);
  background: #e9f6f2;
  font-weight: 850;
  text-decoration: none;
  white-space: nowrap;
}

.link-cell a:hover {
  color: #fff;
  background: var(--primary);
}

.customer-note-name {
  display: inline;
  min-height: 0;
  max-width: 100%;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  font: inherit;
  font-weight: 750;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-note-name:hover {
  color: var(--primary);
  background: transparent;
  text-decoration: underline;
}

.customer-note-name.has-note {
  color: var(--danger);
}

.editable-ip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 23px;
  max-width: 100%;
  padding: 2px 7px;
  border: 1px solid #d9e1dc;
  border-radius: 999px;
  color: #334244;
  background: #f4f7f5;
  font-size: 12px;
  font-weight: 750;
}

.editable-ip:hover {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
}

.note-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(23, 32, 34, 0.34);
}

.note-dialog-backdrop.visible {
  display: flex;
}

.note-dialog {
  width: min(460px, 100%);
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(23, 32, 34, 0.22);
}

.note-dialog h3 {
  font-size: 18px;
}

.note-dialog p {
  margin: 6px 0 12px;
  color: var(--muted);
}

.note-dialog textarea {
  min-height: 126px;
}

.note-image-area {
  margin-top: 10px;
}

.note-image-area img {
  display: none;
  max-width: 100%;
  max-height: 220px;
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: contain;
  background: var(--surface-soft);
}

.note-image-area img.visible {
  display: block;
}

.note-paste-zone {
  display: grid;
  place-items: center;
  min-height: 42px;
  margin-bottom: 10px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 13px;
  outline: none;
}

.note-paste-zone:focus {
  border-color: rgba(15, 118, 110, 0.7);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12);
}

.note-image-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.note-image-actions input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.note-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 12px;
}

.status-chip,
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 4px 9px;
  border-radius: 999px;
  color: #506063;
  background: #eef2ef;
  white-space: nowrap;
}

.badge.intent {
  color: #075a47;
  background: #dff7ee;
}

.badge.deleted {
  color: #8f1b12;
  background: #fde7e4;
}

.log-box {
  height: 178px;
  margin-top: 12px;
  padding: 12px;
  overflow: auto;
  border: 1px solid #20302e;
  border-radius: 10px;
  color: #dcefed;
  background: #121c1b;
  font-family: Consolas, "Microsoft YaHei", monospace;
  line-height: 1.65;
  white-space: pre-wrap;
}

.management {
  padding: 20px;
  min-height: calc(100vh - 128px);
}

.filters {
  flex-wrap: wrap;
  padding: 14px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
}

.filters input {
  max-width: 430px;
}

.filters #taskFilter {
  max-width: 140px;
}

.filters select {
  max-width: 190px;
}

.filters #pageSize {
  max-width: 150px;
}

.check-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  white-space: nowrap;
}

.check-inline input,
.select-col input {
  width: auto;
  min-height: auto;
  accent-color: var(--primary);
}

.bulkbar {
  justify-content: flex-start;
  flex-wrap: wrap;
  min-height: 54px;
  padding: 10px 0 12px;
}

.bulkbar span {
  min-width: 82px;
  color: var(--muted);
}

.empty-hint {
  display: none;
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid #f2d4bf;
  border-radius: 8px;
  color: #894414;
  background: #fff7ed;
}

.empty-hint.visible {
  display: block;
}

.ip-enrich-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
}

.ip-enrich-controls input {
  width: 86px;
  min-height: 32px;
  padding: 6px 8px;
}

.ip-enrich-controls button {
  min-height: 32px;
  padding: 6px 9px;
  font-size: 12px;
}

.ip-enrich-controls span {
  max-width: 360px;
}

.row-actions {
  align-items: flex-start;
  flex-wrap: nowrap;
}

.pager {
  justify-content: flex-end;
  margin-top: 14px;
}

.task-layout {
  display: grid;
  grid-template-columns: minmax(720px, 1fr) 420px;
  gap: 16px;
  align-items: start;
}

.task-list-shell {
  max-height: calc(100vh - 285px);
  min-height: 560px;
}

.selected-row td {
  background: #edf8f5;
}

.task-detail {
  position: sticky;
  top: 104px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.detail-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.detail-metrics div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.detail-metrics span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.detail-metrics strong {
  display: block;
  margin-top: 6px;
  font-size: 24px;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.secondary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid #d9e1dc;
  border-radius: 8px;
  color: #243033;
  background: #edf1ee;
  font-weight: 750;
  text-decoration: none;
  white-space: nowrap;
}

.secondary-link:hover {
  background: #e1e8e3;
}

.secondary-link.disabled {
  pointer-events: none;
  opacity: 0.5;
}

.detail-block {
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.detail-block + .detail-block {
  margin-top: 14px;
}

.detail-block h3 {
  margin-bottom: 10px;
  font-size: 15px;
}

.detail-block dl {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 8px 10px;
  margin: 0;
}

.detail-block dt {
  color: var(--muted);
}

.detail-block dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

.mini-log {
  max-height: 260px;
  overflow: auto;
  padding: 10px;
  border-radius: 8px;
  color: #dcefed;
  background: #121c1b;
  font-family: Consolas, "Microsoft YaHei", monospace;
  line-height: 1.6;
  white-space: pre-wrap;
}

.remark-editor {
  min-height: 92px;
  margin-bottom: 8px;
}

.remark-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.remark-actions span {
  color: var(--muted);
  font-size: 13px;
}

.prospect-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 18px;
  align-items: center;
  margin-bottom: 18px;
  padding: 26px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(120deg, #14201f, #26372f);
  box-shadow: var(--shadow);
}

.prospect-hero h2 {
  font-size: 28px;
  line-height: 1.3;
}

.prospect-hero p {
  margin-top: 10px;
  color: rgba(255, 255, 255, 0.72);
}

.prospect-score {
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  text-align: center;
}

.prospect-score span {
  color: rgba(255, 255, 255, 0.7);
}

.prospect-score strong {
  display: block;
  margin-top: 8px;
  font-size: 44px;
}

.prospect-layout {
  display: grid;
  grid-template-columns: 420px minmax(0, 1fr);
  gap: 16px;
}

.task-composer {
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
}

.task-composer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.task-composer-head h3 {
  font-size: 16px;
}

.task-composer-head p {
  margin-top: 5px;
  color: var(--muted);
}

.task-picker-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 190px auto auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}

.task-picker-toolbar input,
.task-picker-toolbar select {
  min-height: 38px;
}

.selected-task-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 34px;
  margin: 2px 0 12px;
}

.selected-task-empty {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  color: var(--muted);
  font-size: 13px;
}

.selected-task-chip {
  display: inline-flex;
  align-items: center;
  max-width: 360px;
  min-height: 30px;
  padding: 4px 5px 4px 10px;
  border: 1px solid rgba(15, 118, 110, 0.28);
  border-radius: 999px;
  color: #075a47;
  background: #e5f6f1;
  font-size: 13px;
  font-weight: 750;
}

.selected-task-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selected-task-chip button {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  min-height: 22px;
  margin-left: 6px;
  padding: 0;
  border-radius: 50%;
  color: #075a47;
  background: rgba(15, 118, 110, 0.12);
  font-size: 16px;
  line-height: 1;
}

.selected-task-chip button:hover {
  color: #fff;
  background: var(--primary);
}

.task-picker {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 10px;
  max-height: 360px;
  overflow: auto;
  padding-right: 4px;
}

.task-option {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

.task-option:hover {
  border-color: rgba(15, 118, 110, 0.45);
  background: #f8fcfa;
}

.task-option.selected {
  border-color: rgba(15, 118, 110, 0.82);
  background: #edf8f5;
  box-shadow: inset 4px 0 0 var(--primary);
}

.task-option input {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  min-height: 18px;
  margin-top: 3px;
  accent-color: var(--primary);
  cursor: pointer;
}

.task-option-main {
  min-width: 0;
}

.task-option-main strong,
.task-option-main small,
.task-option-main em {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-option-main small {
  margin-top: 4px;
  color: var(--muted);
}

.task-option-main em {
  margin-top: 4px;
  color: #7a4a22;
  font-size: 12px;
  font-style: normal;
}

.prospect-chart {
  min-height: 520px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
}

.chart-row {
  display: grid;
  grid-template-columns: 28px minmax(90px, 120px) minmax(0, 1fr) 42px;
  gap: 8px;
  align-items: center;
  min-height: 38px;
}

.chart-rank {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  color: #fff;
  background: var(--primary);
  font-size: 12px;
  font-weight: 800;
}

.chart-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 750;
}

.chart-bar {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #e3e9e4;
}

.chart-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

.chart-row strong {
  color: var(--accent);
  text-align: right;
}

.prospect-table {
  max-height: 680px;
}

.score-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  min-height: 28px;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  font-weight: 900;
}

/* Dense data pages: fit more columns before horizontal scrolling is needed. */
.workspace.wide {
  width: min(1980px, calc(100% - 12px));
}

.management {
  padding: 14px;
}

.management .surface-head {
  margin-bottom: 12px;
}

.management .filters {
  gap: 7px;
  padding: 10px;
}

.management .filters input,
.management .filters select,
.management .filters button {
  min-height: 34px;
  padding: 7px 9px;
  font-size: 13px;
}

.management .filters input[type="number"] {
  width: 118px;
  max-width: 140px;
}

.inline-status {
  margin: -4px 0 12px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.68);
  font-size: 13px;
}

.management .bulkbar {
  min-height: 42px;
  padding: 6px 0 8px;
}

.management .table-shell {
  border-radius: 8px;
}

.management table,
.prospect-table table,
.task-list-shell table {
  min-width: 0;
  table-layout: fixed;
}

.management th,
.management td,
.prospect-table th,
.prospect-table td,
.task-list-shell th,
.task-list-shell td {
  min-width: 0;
  padding: 7px 6px;
  font-size: 12.5px;
  line-height: 1.35;
}

.management td,
.prospect-table td,
.task-list-shell td {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.management .select-col {
  width: 32px;
  min-width: 32px;
}

.management .th-title {
  gap: 3px;
}

.management .sort-head {
  min-width: 0;
  gap: 2px;
  font-size: 12.5px;
}

.management .filter-toggle {
  width: 20px;
  height: 20px;
  min-height: 20px;
  border-radius: 5px;
  line-height: 20px;
  font-size: 11px;
}

.management .link-cell a {
  min-height: 24px;
  padding: 2px 6px;
  font-size: 12px;
}

.management .row-actions {
  gap: 4px;
  flex-wrap: wrap;
}

.management th:last-child,
.management td:last-child {
  width: 150px;
  min-width: 150px;
  position: sticky;
  right: 0;
  z-index: 12;
  background: #fff;
  box-shadow: -8px 0 14px rgba(23, 32, 34, 0.07);
}

.management td:last-child {
  overflow: visible;
  white-space: normal;
}

.management .customer-remark-cell {
  overflow: hidden;
}

.customer-remark-button {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 24px;
  padding: 3px 7px;
  border: 1px solid #d9e1dc;
  border-radius: 7px;
  color: #52605e;
  background: #f4f7f5;
  font-size: 12px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-remark-button:hover {
  color: #fff;
  border-color: var(--primary);
  background: var(--primary);
}

.customer-remark-button.has-note {
  color: var(--danger);
  border-color: rgba(180, 35, 24, 0.24);
  background: #fff5f3;
}

.management .row-actions button,
.management .row-actions .secondary-link,
.management .row-actions a {
  min-height: 24px;
  padding: 3px 6px;
  font-size: 12px;
}

.management .badge,
.management .status-chip {
  min-height: 22px;
  padding: 2px 6px;
  font-size: 12px;
}

.task-layout {
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 12px;
}

.task-detail {
  padding: 12px;
}

.detail-metrics {
  gap: 6px;
}

.detail-metrics div {
  padding: 8px;
}

.detail-metrics strong {
  font-size: 20px;
}

.detail-block {
  padding-top: 10px;
}

.detail-block + .detail-block {
  margin-top: 10px;
}

.prospect-layout {
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 12px;
}

.prospect-chart {
  padding: 10px;
}

.chart-row {
  grid-template-columns: 24px minmax(72px, 92px) minmax(0, 1fr) 34px;
  gap: 5px;
}

.prospect-table {
  max-height: 720px;
}

@media (max-width: 1180px) {
  .app-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav {
    justify-content: flex-start;
  }

  .dashboard-grid,
  .hero-panel {
    grid-template-columns: 1fr;
  }

  .quick-links {
    justify-content: flex-start;
  }

  .metric-grid {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
  }

  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .task-layout {
    grid-template-columns: 1fr;
  }

  .prospect-layout,
  .prospect-hero {
    grid-template-columns: 1fr;
  }

  .task-picker {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }

  .task-picker-toolbar {
    grid-template-columns: 1fr 1fr;
  }

  .task-detail {
    position: static;
  }
}

@media (max-width: 760px) {
  body {
    font-size: 13px;
  }

  .app-header {
    padding: 14px;
  }

  .brand {
    min-width: 0;
    align-items: flex-start;
  }

  .brand h1 {
    font-size: 18px;
  }

  .workspace,
  .workspace.wide {
    width: calc(100% - 20px);
    padding-top: 14px;
  }

  .hero-panel,
  .surface,
  .management {
    padding: 16px;
  }

  .hero-panel h2 {
    font-size: 22px;
  }

  .metric-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .surface-head {
    flex-direction: column;
  }

  .filters input,
  .filters select,
  .filters #taskFilter {
    max-width: none;
  }

  .filters button,
  .bulkbar button,
  .button-row button {
    flex: 1 1 auto;
  }

  .task-composer-head {
    flex-direction: column;
  }

  .task-picker {
    grid-template-columns: 1fr;
  }

  .task-picker-toolbar {
    grid-template-columns: 1fr;
  }

  .table-shell {
    max-height: 560px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .management table,
  .prospect-table table,
  .task-list-shell table {
    width: max-content;
    min-width: 1080px;
    table-layout: auto;
  }

  .task-list-shell table {
    min-width: 980px;
  }

  .prospect-table table {
    min-width: 1120px;
  }

  .management th,
  .management td,
  .prospect-table th,
  .prospect-table td,
  .task-list-shell th,
  .task-list-shell td {
    min-width: 72px;
    padding: 8px 10px;
  }

  .management .select-col {
    min-width: 38px;
    width: 38px;
  }

  /* 手机或窄窗口仍允许横向查看，但已启用拖拽的表格不能再被文字和 72px 最小列宽限制。 */
  .management table.column-resizable-table,
  .prospect-table table.column-resizable-table,
  .task-list-shell table.column-resizable-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed !important;
  }

  .management .column-resizable-table th,
  .management .column-resizable-table td,
  .prospect-table .column-resizable-table th,
  .prospect-table .column-resizable-table td,
  .task-list-shell .column-resizable-table th,
  .task-list-shell .column-resizable-table td {
    min-width: 0 !important;
  }
}

.cookie-check-panel {
  margin-top: 12px;
  border: 1px solid #d8dee8;
  border-radius: 12px;
  padding: 12px;
  background: #f8fafc;
  color: #334155;
  font-size: 13px;
  line-height: 1.6;
}

.cookie-check-title {
  font-weight: 700;
  margin-bottom: 4px;
}

.cookie-check-panel.is-good {
  border-color: #86efac;
  background: #f0fdf4;
  color: #14532d;
}

.cookie-check-panel.is-warn {
  border-color: #fde68a;
  background: #fffbeb;
  color: #78350f;
}

.cookie-check-panel.is-bad {
  border-color: #fecaca;
  background: #fef2f2;
  color: #7f1d1d;
}

.cookie-check-panel code {
  background: rgba(15, 23, 42, .08);
  border-radius: 6px;
  padding: 1px 5px;
}
