/* 内部撮合 */
.match-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: linear-gradient(90deg, var(--wake-bg), #FDF8EF 55%, var(--surface));
  border: 1px solid #F0DDBB;
  padding: 16px 20px;
}
.match-banner strong { font-size: 16px; font-weight: 800; display: block; }
.match-banner small { color: var(--ink-2); font-size: 12.5px; }
.banner-principles { display: flex; gap: 8px; flex-wrap: wrap; }
.banner-principles span {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 5px 13px;
  font-size: 12px;
  font-weight: 600;
  color: #9A6613;
}

.match-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(220px, 1.35fr); }
.match-kpis .stat-value { font-size: 24px; }

.funnel { margin-top: 8px; display: flex; flex-direction: column; gap: 5px; }
.funnel-row { display: flex; align-items: center; gap: 7px; font-size: 11px; }
.funnel-row small { width: 52px; color: var(--ink-2); flex: 0 0 52px; }
.funnel-bar { flex: 1; height: 9px; border-radius: 999px; background: var(--idle-bg); overflow: hidden; }
.funnel-bar i { display: block; height: 100%; background: var(--brand-grad); border-radius: 999px; }
.funnel-row b { width: 26px; text-align: right; }
.funnel-row em { font-style: normal; color: var(--ink-3); width: 42px; text-align: right; }

.match-main { grid-template-columns: 1fr 1.35fr 1.15fr; align-items: start; }

/* need cards */
.need-card {
  display: flex;
  gap: 10px;
  padding: 11px 4px;
  border-bottom: 1px solid var(--border);
  align-items: flex-start;
}
.need-card:last-child { border-bottom: 0; }
.need-done { opacity: 0.62; }
.need-ico {
  width: 34px; height: 34px;
  border-radius: 8px;
  background: var(--surface-warm);
  border: 1px solid var(--border);
  display: grid; place-items: center;
  font-size: 15px;
  flex: 0 0 34px;
}
.need-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.need-main strong { font-size: 13px; }
.need-main small { font-size: 11.5px; color: var(--ink-2); }
.need-days { color: var(--ink-3); font-size: 10.5px; white-space: nowrap; }

/* match cards */
.match-card {
  display: flex;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--r-m);
  padding: 11px 12px;
  margin-bottom: 10px;
  transition: border-color 160ms ease-out, box-shadow 160ms ease-out;
}
.match-card .thumb {
  width: 108px;
  height: 84px;
  border-radius: var(--r-s);
  flex-shrink: 0;
}
.match-card:hover, .match-card.match-on { border-color: var(--wake); box-shadow: var(--shadow-rest); }
.match-card.match-on { background: linear-gradient(90deg, var(--wake-bg), var(--surface) 40%); }
.match-rank {
  width: 22px; height: 22px;
  border-radius: 6px;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 800;
  background: var(--idle-bg); color: var(--ink-2);
  flex: 0 0 22px;
  align-self: flex-start;
}
.match-rank.r1 { background: var(--brand-grad); color: #fff; }
.match-rank.r2 { background: #E7C88A; color: #6E4A0C; }
.match-pair { flex: 1; min-width: 0; }
.match-pair strong { font-size: 12.5px; }
.match-pair small { font-size: 11px; color: var(--ink-3); }
.match-arrow { color: var(--wake); font-weight: 700; }
.match-pair .row-split { justify-content: flex-start; gap: 7px; flex-wrap: wrap; }
.match-subs { display: flex; flex-wrap: wrap; gap: 3px 12px; margin-top: 5px; font-size: 10.5px; color: var(--ink-3); }
.match-subs b { color: var(--ink); font-weight: 600; }
.match-scorebox { display: flex; flex-direction: column; align-items: center; gap: 5px; }

/* pair detail */
.pair-panels { display: grid; grid-template-columns: 1fr 30px 1fr; gap: 6px; align-items: stretch; }
.pair-panel {
  border: 1px solid var(--border);
  border-radius: var(--r-m);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 11.5px;
  color: var(--ink-2);
}
.pair-panel small { font-size: 10.5px; color: var(--ink-3); font-weight: 700; letter-spacing: 0.06em; }
.pair-panel strong { font-size: 13px; color: var(--ink); }
.pair-need { background: var(--wake-bg); border-color: #F0DDBB; }
.pair-supply { background: var(--alive-bg); border-color: #CBE3D4; }
.pair-flow { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.pair-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--wake); }
.pair-dot.alive { background: var(--alive); }
.pair-line { flex: 1; width: 2px; background: linear-gradient(var(--wake), var(--alive)); border-radius: 2px; }

.pair-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  font-size: 11.5px;
  color: var(--ink-2);
  padding: 10px 2px;
}
.pair-metrics b { font-weight: 700; }
.pair-reasons { background: var(--surface-warm); border-radius: var(--r-s); padding: 10px 12px; margin-bottom: 12px; }
.pair-reasons small { font-weight: 700; color: var(--ink-2); }
.pair-reasons ul { margin: 6px 0 0; padding-left: 16px; font-size: 12px; color: var(--ink-2); }
.pair-reasons li { margin-bottom: 3px; }

.match-bottom { grid-template-columns: 1.4fr 1fr 1fr; }

@media (max-width: 1440px) {
  .match-kpis { grid-template-columns: repeat(2, 1fr); }
  .match-main { grid-template-columns: 1fr 1fr; }
  .match-right { grid-column: span 2; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
  .match-right .mt { margin-top: 0; }
}
@media (max-width: 1360px) {
  .match-main, .match-bottom { grid-template-columns: 1fr; }
  .match-right { grid-column: span 1; grid-template-columns: 1fr; }
}
