:root {
  color-scheme: light;
  --ink: #17202a;
  --muted: #637083;
  --line: #d9e1ea;
  --paper: #f7f9fb;
  --surface: #ffffff;
  --surface-2: #eef3f7;
  --red: #df3f4e;
  --red-soft: #ffe9ec;
  --blue: #226d8b;
  --blue-soft: #e1f2f7;
  --green: #26735c;
  --green-soft: #e3f3ed;
  --gold: #a56a14;
  --gold-soft: #fff1d8;
  --violet: #5d5aa8;
  --shadow: 0 18px 50px rgb(23 32 42 / 9%);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.app-shell {
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  border-right: 1px solid var(--line);
  background: #fbfcfd;
  padding: 24px 18px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-weight: 800;
  font-size: 11px;
}

.brand-row h1,
.topbar h2,
.section-heading h3,
.panel h3 {
  margin: 0;
}

.brand-row h1 {
  font-size: 15px;
  line-height: 1.25;
}

.brand-row p,
.section-heading p,
.source-list span,
.creator-meta,
.creator-tags,
.detail-panel p,
.eyebrow {
  margin: 0;
  color: var(--muted);
}

.search-field {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 0 12px;
}

.compact-search {
  margin-top: 22px;
}

.side-nav {
  display: grid;
  gap: 8px;
  margin: 18px 0 8px;
}

.side-nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 42px;
  border-radius: 8px;
  color: #6c7b91;
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  padding: 0 12px;
}

.side-nav a.active {
  background: #e9edf2;
  color: var(--ink);
}

.side-nav svg {
  width: 21px;
  height: 21px;
}

.search-field svg {
  width: 18px;
  height: 18px;
  color: var(--muted);
}

.search-field input {
  border: 0;
  outline: 0;
  min-width: 0;
  width: 100%;
  background: transparent;
  color: var(--ink);
}

.filter-section {
  margin-top: 22px;
}

.filter-section h2 {
  margin: 0 0 10px;
  font-size: 13px;
  color: #344154;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip-list.compact {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.chip-list.mini {
  margin-top: 8px;
}

.chip,
.segment {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: #354155;
  min-height: 36px;
  padding: 7px 10px;
}

.chip {
  font-size: 13px;
}

.segment {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-weight: 700;
}

.chip.active,
.segment.active {
  border-color: #1e6f85;
  background: var(--blue-soft);
  color: #164f63;
}

.tag-field span {
  color: var(--blue);
  font-weight: 900;
}

.number-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.number-pair label,
.source-count {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  min-height: 42px;
  padding: 0 10px;
}

.number-pair span,
.source-count span {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.number-pair input,
.source-count input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-weight: 800;
}

.range-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

output {
  color: var(--blue);
  font-weight: 800;
  font-size: 13px;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--blue);
}

.secondary-button,
.primary-button,
.icon-text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  border-radius: 8px;
  border: 1px solid var(--line);
  padding: 0 14px;
  white-space: nowrap;
}

.secondary-button {
  width: 100%;
  margin-top: 24px;
  background: var(--surface);
  color: #354155;
}

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

.icon-text-button {
  background: var(--surface);
  color: var(--ink);
}

.secondary-button svg,
.primary-button svg,
.icon-text-button svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.workspace {
  padding: 24px;
  min-width: 0;
}

.topbar,
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar {
  margin-bottom: 18px;
}

.eyebrow {
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 800;
  color: var(--blue);
}

.topbar h2 {
  margin-top: 3px;
  font-size: clamp(24px, 3vw, 34px);
}

.topbar-actions {
  display: flex;
  gap: 10px;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.collection-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}

.mode-tabs,
.sort-tabs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.mode-tabs {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px;
  margin-bottom: 28px;
}

.mode-tabs button,
.sort-tabs button {
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #74839a;
  min-height: 36px;
  padding: 0 16px;
  font-weight: 800;
}

.mode-tabs button.active,
.sort-tabs button.active {
  background: #eef1f5;
  color: var(--ink);
}

.collection-panel p {
  color: #708098;
  margin: 0 0 28px;
  font-weight: 700;
}

.collect-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
}

.collect-input {
  display: flex;
  align-items: center;
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 6px 14px rgb(23 32 42 / 5%);
  padding: 0 16px;
}

.collect-input input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}

.collection-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 22px;
}

.platform-checks {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.platform-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 0;
  min-height: 34px;
  font-weight: 800;
}

.check-dot {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #d8e0e8;
  color: #fff;
  font-size: 16px;
  line-height: 1;
}

.platform-check.active .check-dot {
  background: #111827;
}

.source-count {
  width: 126px;
}

.cost-hint {
  color: #718199;
  font-size: 13px;
}

.sort-tabs {
  margin-top: 20px;
}

.sort-tabs > span {
  color: #708098;
  font-weight: 800;
}

.sort-tabs {
  color: #708098;
}

.metric {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 8px 20px rgb(23 32 42 / 4%);
}

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

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 27px;
  line-height: 1;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 352px;
  gap: 18px;
  align-items: start;
}

.primary-column,
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.primary-column {
  padding: 18px;
  min-width: 0;
}

.section-heading {
  margin-bottom: 14px;
}

.section-heading h3,
.panel h3 {
  font-size: 17px;
}

.section-heading p {
  font-size: 13px;
  margin-top: 4px;
}

.section-heading.tight {
  margin-bottom: 12px;
}

select {
  min-height: 38px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  padding: 0 10px;
}

.creator-list {
  display: grid;
  gap: 10px;
}

.creator-card {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}

.creator-card.selected {
  border-color: var(--blue);
  background: #f4fbfd;
}

.avatar {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  background-size: cover;
  background-position: center;
  border: 1px solid rgb(23 32 42 / 12%);
}

.creator-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.creator-title-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 16px;
}

.platform-badge,
.stage-badge,
.risk-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 6px;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.platform-badge.redbook {
  color: #a82232;
  background: var(--red-soft);
}

.platform-badge.douyin {
  color: #155a71;
  background: var(--blue-soft);
}

.stage-badge {
  color: #38516a;
  background: var(--surface-2);
}

.risk-badge.low {
  color: var(--green);
  background: var(--green-soft);
}

.risk-badge.medium {
  color: var(--gold);
  background: var(--gold-soft);
}

.risk-badge.high {
  color: #9d3340;
  background: var(--red-soft);
}

.creator-meta,
.creator-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 7px;
  font-size: 13px;
}

.creator-tags span {
  color: #405068;
}

.creator-actions {
  display: grid;
  justify-items: end;
  gap: 8px;
  min-width: 128px;
}

.score-ring {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(#fff 57%, transparent 58%),
    conic-gradient(var(--green) var(--score), #e6edf2 0);
  font-weight: 900;
  color: var(--green);
}

.contact-button {
  border: 1px solid var(--blue);
  color: var(--blue);
  background: #fff;
  border-radius: 8px;
  min-height: 34px;
  padding: 0 10px;
  font-weight: 800;
}

.insight-column {
  display: grid;
  gap: 14px;
}

.panel {
  padding: 16px;
}

.count-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 26px;
  border-radius: 99px;
  background: var(--ink);
  color: #fff;
  font-weight: 800;
  font-size: 13px;
}

.pipeline-board {
  display: grid;
  gap: 10px;
}

.pipeline-row {
  display: grid;
  grid-template-columns: 76px 1fr 28px;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.pipeline-track {
  height: 9px;
  border-radius: 99px;
  background: var(--surface-2);
  overflow: hidden;
}

.pipeline-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
}

.source-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.source-list article {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

.source-list strong,
.source-list span {
  display: block;
}

.source-list strong {
  font-size: 14px;
}

.source-list span {
  margin-top: 2px;
  font-size: 12px;
}

.source-list b {
  color: var(--green);
  font-size: 13px;
}

.source-logo {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 900;
}

.red-source {
  background: var(--red);
}

.ocean-source {
  background: var(--blue);
}

.gold-source {
  background: var(--gold);
}

.detail-panel:empty {
  display: none;
}

.detail-panel {
  border-color: #b8d6df;
}

.detail-header {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.detail-header .avatar {
  width: 46px;
  height: 46px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-top: 12px;
}

.detail-kpi {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

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

.detail-kpi strong {
  display: block;
  margin-top: 5px;
}

.brief-box {
  margin-top: 12px;
  padding: 12px;
  border-radius: 8px;
  background: #f5f8fa;
  color: #354155;
  font-size: 13px;
  line-height: 1.6;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  max-width: min(360px, calc(100vw - 32px));
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 180ms ease,
    transform 180ms ease;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  padding: 12px 14px;
  box-shadow: var(--shadow);
  font-size: 14px;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1120px) {
  .app-shell {
    grid-template-columns: 240px minmax(0, 1fr);
  }

  .content-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 820px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .workspace {
    padding: 18px;
  }

  .topbar,
  .creator-card {
    align-items: stretch;
  }

  .topbar {
    flex-direction: column;
  }

  .topbar-actions {
    width: 100%;
  }

  .topbar-actions button {
    flex: 1;
  }

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

  .collect-row {
    grid-template-columns: 1fr;
  }

  .creator-card {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .creator-actions {
    grid-column: 1 / -1;
    grid-template-columns: auto 1fr;
    justify-items: stretch;
    align-items: center;
  }

  .score-ring {
    width: 46px;
    height: 46px;
  }
}

@media (max-width: 560px) {
  .workspace,
  .sidebar {
    padding: 14px;
  }

  .metrics-grid,
  .insight-column,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .creator-title-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .source-list article {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .source-list b {
    grid-column: 2;
  }
}
