/* ============================================================
   BacklinkHub 设计体系
   原则：teal 品牌色 + 语义状态色（好/警/坏各司其职，不混用）
        数字列 tabular-nums、可见焦点、动效只作用 color/bg/transform
   ============================================================ */

:root {
  color-scheme: light;

  /* ---------- 色板 ---------- */
  --bg: #f5f6f8;
  --panel: #ffffff;
  --ink: #18212f;
  --ink-secondary: #414d5f;
  --muted: #68758a;
  --line: #e3e7ed;
  --line-strong: #cbd3dd;

  --accent: #0f6f66;
  --accent-strong: #0a544e;
  --accent-soft: #e2f1ee;
  --accent-soft-line: #bcdfd8;

  --good: #067647;
  --good-bg: #e9f7ef;
  --good-line: #b5e2c8;
  --warn: #a15c07;
  --warn-bg: #fdf4e3;
  --warn-line: #eedcb2;
  --bad: #b42318;
  --bad-bg: #fdeceb;
  --bad-line: #f4c4be;
  --neutral-bg: #edf0f4;

  /* ---------- 尺寸 ---------- */
  --radius-s: 6px;
  --radius-m: 10px;
  --shadow-card: 0 1px 2px rgb(24 33 47 / 0.04), 0 2px 8px rgb(24 33 47 / 0.04);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, "Segoe UI", system-ui, -apple-system, "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.55;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-strong);
  text-decoration: underline;
}

:focus-visible {
  border-radius: var(--radius-s);
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ============================================================
   顶栏与导航
   ============================================================ */

.topbar {
  align-items: center;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 24px;
  height: 56px;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 5;
}

.brand {
  align-items: center;
  color: var(--ink);
  display: inline-flex;
  font-size: 16px;
  font-weight: 700;
  gap: 8px;
}

.brand:hover {
  color: var(--accent-strong);
  text-decoration: none;
}

.brand-mark {
  align-items: center;
  background: var(--accent);
  border-radius: var(--radius-s);
  color: #ffffff;
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  height: 24px;
  justify-content: center;
  width: 24px;
}

nav {
  display: flex;
  gap: 4px;
}

nav a {
  border-radius: 999px;
  color: var(--ink-secondary);
  font-weight: 550;
  padding: 6px 12px;
  transition: background-color 0.12s ease, color 0.12s ease;
}

nav a:hover {
  background: var(--neutral-bg);
  color: var(--ink);
  text-decoration: none;
}

nav a.active {
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 650;
}

/* ============================================================
   页面骨架
   ============================================================ */

.page {
  margin: 0 auto;
  max-width: 1280px;
  padding: 28px;
}

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

.page > section:not(.page-head) {
  margin-bottom: 28px;
}

h1,
h2 {
  margin: 0;
}

h1 {
  font-size: 26px;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

h2 {
  align-items: baseline;
  display: flex;
  font-size: 15px;
  gap: 8px;
  margin: 0 0 10px;
}

h2 .count {
  color: var(--muted);
  font-size: 13px;
  font-weight: 550;
}

p {
  color: var(--muted);
  margin: 6px 0 0;
}

.section-note {
  color: var(--muted);
  font-size: 13px;
  margin: 8px 0 0;
}

/* ============================================================
   按钮
   ============================================================ */

.button,
button {
  align-items: center;
  background: var(--accent);
  border: 1px solid transparent;
  border-radius: var(--radius-s);
  color: #ffffff;
  cursor: pointer;
  display: inline-flex;
  font-size: 14px;
  font-weight: 600;
  min-height: 36px;
  padding: 8px 14px;
  transition: background-color 0.12s ease;
}

.button:hover,
button:hover {
  background: var(--accent-strong);
  color: #ffffff;
  text-decoration: none;
}

.button-secondary {
  background: var(--panel);
  border-color: var(--line-strong);
  color: var(--ink);
}

.button-secondary:hover {
  background: var(--neutral-bg);
  border-color: var(--line-strong);
  color: var(--ink);
}

button:disabled {
  background: var(--neutral-bg);
  border-color: var(--line);
  color: var(--muted);
  cursor: not-allowed;
}

/* Collector 触发按钮：轻量 chip，避免一排深色大块 */
.chip-button {
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--ink-secondary);
  font-size: 13px;
  font-weight: 600;
  min-height: 32px;
  padding: 5px 14px;
}

.chip-button:hover {
  background: var(--accent-soft);
  border-color: var(--accent-soft-line);
  color: var(--accent-strong);
}

.chip-button:disabled {
  background: var(--neutral-bg);
  border-color: var(--line);
  color: var(--muted);
}

.link-button {
  background: transparent;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  min-height: 0;
  padding: 0;
}

.link-button:hover {
  background: transparent;
  color: var(--accent-strong);
  text-decoration: underline;
}

.danger-link:hover {
  color: var(--bad);
}

.action-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.action-row input[type="number"] {
  max-width: 90px;
}

.collector-form,
.inline-form {
  display: inline;
  margin: 0;
}

/* ============================================================
   指标卡（dataviz stat tile 规范：label + 大数值，比例数字）
   ============================================================ */

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

.metric {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-card);
  padding: 16px 18px;
}

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

.metric strong {
  display: block;
  font-size: 32px;
  font-weight: 650;
  letter-spacing: -0.01em;
  line-height: 1.15;
  margin-top: 6px;
}

.metric-alert strong {
  color: var(--bad);
}

.metric a {
  color: inherit;
}

.metric a:hover {
  text-decoration: none;
}

/* ============================================================
   表格
   ============================================================ */

table {
  background: var(--panel);
  border: 1px solid var(--line);
  border-collapse: separate;
  border-radius: var(--radius-m);
  border-spacing: 0;
  box-shadow: var(--shadow-card);
  overflow: hidden;
  width: 100%;
}

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

th {
  background: #f8f9fb;
  color: var(--ink-secondary);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

tbody tr {
  transition: background-color 0.1s ease;
}

tbody tr:hover {
  background: #f7fafa;
}

tbody tr.opportunity-row-hot {
  background: rgb(245 158 11 / 0.08);
}

tbody tr.opportunity-row-hot:hover {
  background: rgb(245 158 11 / 0.13);
}

tbody tr.opportunity-row-fresh {
  background: rgb(20 184 166 / 0.06);
}

tbody tr.opportunity-row-fresh:hover {
  background: rgb(20 184 166 / 0.1);
}

tr:last-child td {
  border-bottom: 0;
}

td.num {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.table-sort-link {
  color: var(--ink-secondary);
}

.table-sort-link.active {
  color: var(--accent-strong);
}

.media-sort-head {
  display: grid;
  gap: 4px;
}

.media-sort-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 11.5px;
  letter-spacing: 0;
}

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

.empty a {
  font-weight: 600;
}

.muted {
  color: var(--muted);
}

.nowrap {
  white-space: nowrap;
}

.opportunity-meta-cell {
  min-width: 108px;
  white-space: nowrap;
}

.reply-col,
.reply-cell {
  min-width: 92px;
  width: 96px;
}

.reply-link {
  background: var(--accent-soft);
  border: 1px solid var(--accent-soft-line);
  border-radius: var(--radius-s);
  color: var(--accent-strong);
  display: inline-flex;
  font-size: 12px;
  font-weight: 700;
  justify-content: center;
  line-height: 1.35;
  padding: 5px 9px;
  white-space: nowrap;
}

.reply-link:hover {
  background: #d4ebe6;
  color: var(--accent-strong);
  text-decoration: none;
}

.reply-empty {
  color: var(--muted);
}

.opportunity-meta-line {
  font-size: 12.5px;
  line-height: 1.45;
}

.opportunity-meta-line + .opportunity-meta-line {
  margin-top: 3px;
}

.meta-discovered {
  align-items: center;
  color: var(--ink-secondary);
  display: flex;
  flex-wrap: wrap;
  font-weight: 650;
  gap: 5px;
}

.meta-deadline {
  color: #667287;
}

.meta-source {
  color: #8994a6;
  font-size: 12px;
}

.freshness-pill {
  border: 1px solid transparent;
  border-radius: 999px;
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
  padding: 2px 7px;
  width: max-content;
}

.freshness-hot {
  background: rgb(245 158 11 / 0.17);
  border-color: rgb(245 158 11 / 0.28);
  color: #8a5300;
}

.freshness-fresh {
  background: rgb(20 184 166 / 0.14);
  border-color: rgb(20 184 166 / 0.26);
  color: #0f6f66;
}

/* 标题列拿走主要宽度，其余列收紧 */
.title-col {
  min-width: 320px;
  width: 38%;
}

.relevance-cell {
  max-width: none;
  width: 190px;
}

/* 行内主文案 + 次级描述（机会列表标题列） */
.row-title {
  color: var(--ink);
  display: block;
  font-weight: 600;
}

.row-title:hover {
  color: var(--accent-strong);
}

.row-desc {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.45;
  margin-top: 3px;
}

.ai-summary {
  background: var(--accent-soft);
  border: 1px solid var(--accent-soft-line);
  border-radius: var(--radius-s);
  color: var(--ink-secondary);
  display: block;
  font-size: 12.5px;
  line-height: 1.55;
  margin-top: 8px;
  overflow-wrap: anywhere;
  padding: 7px 9px;
  white-space: normal;
}

.ai-summary-muted {
  background: var(--neutral-bg);
  border-color: var(--line-strong);
  color: var(--muted);
}

.clamp-2 {
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  display: -webkit-box;
  overflow: hidden;
}

/* ============================================================
   徽章与状态
   ============================================================ */

.badge {
  border: 1px solid transparent;
  border-radius: 999px;
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  padding: 2px 9px;
  white-space: nowrap;
}

.badge-good {
  background: var(--good-bg);
  border-color: var(--good-line);
  color: var(--good);
}

.badge-warn {
  background: var(--warn-bg);
  border-color: var(--warn-line);
  color: var(--warn);
}

.badge-bad {
  background: var(--bad-bg);
  border-color: var(--bad-line);
  color: var(--bad);
}

.badge-neutral {
  background: var(--neutral-bg);
  border-color: var(--line);
  color: var(--ink-secondary);
}

.media-badges {
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 5px;
  margin-top: 6px;
}

.media-badge {
  border: 1px solid transparent;
  border-radius: var(--radius-s);
  color: var(--ink-secondary);
  display: inline-block;
  font-size: 11.5px;
  font-weight: 650;
  line-height: 1.35;
  padding: 2px 7px;
  white-space: nowrap;
}

.media-badge-type {
  background: rgb(34 197 150 / 0.14);
  border-color: rgb(34 197 150 / 0.28);
  color: #08765f;
}

.media-badge-influence {
  background: rgb(245 158 11 / 0.16);
  border-color: rgb(245 158 11 / 0.3);
  color: #8a5300;
}

.media-badge-link {
  background: rgb(139 92 246 / 0.14);
  border-color: rgb(139 92 246 / 0.28);
  color: #5e3bb3;
}

/* 匹配分数：≥80 推送(绿) / ≥60 候选(琥珀) / 其余留存(灰) */
.score {
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  display: inline-block;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  min-width: 36px;
  padding: 2px 7px;
  text-align: center;
}

.score-push {
  background: var(--good-bg);
  border-color: var(--good-line);
  color: var(--good);
}

.score-candidate {
  background: var(--warn-bg);
  border-color: var(--warn-line);
  color: var(--warn);
}

.score-retained {
  background: var(--neutral-bg);
  border-color: var(--line);
  color: var(--muted);
}

/* 截止时间紧迫度 */
.deadline-overdue {
  color: var(--bad);
  font-weight: 650;
}

.deadline-urgent {
  color: var(--bad);
  font-weight: 650;
}

.deadline-soon {
  color: var(--warn);
  font-weight: 600;
}

.deadline-normal,
.deadline-none {
  color: var(--ink-secondary);
}

/* Collector 运行状态（沿用 status 类名，模板会同时输出语义 label） */
.status {
  border-radius: 999px;
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 9px;
}

.status.failed {
  background: var(--bad-bg);
  color: var(--bad);
}

.status.skipped {
  background: var(--warn-bg);
  color: var(--warn);
}

.status.success {
  background: var(--good-bg);
  color: var(--good);
}

.status.running {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.system-message {
  background: var(--good-bg);
  border: 1px solid var(--good-line);
  border-radius: var(--radius-s);
  color: var(--good);
  margin-bottom: 16px;
  padding: 10px 14px;
}

.system-message-warn {
  background: var(--warn-bg);
  border-color: var(--warn-line);
  color: var(--warn);
}

.suggestion-panel {
  background: rgb(24 33 47 / 0.22);
  inset: 0;
  position: fixed;
  z-index: 30;
}

.suggestion-panel[hidden] {
  display: none;
}

.suggestion-drawer {
  background: var(--panel);
  border-left: 1px solid var(--line);
  box-shadow: -12px 0 28px rgb(24 33 47 / 0.14);
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100%;
  margin-left: auto;
  max-width: 440px;
  min-width: 360px;
  overflow-y: auto;
  padding: 24px;
}

.suggestion-close {
  align-self: flex-end;
  background: var(--neutral-bg);
  border-color: var(--line);
  border-radius: 999px;
  color: var(--ink-secondary);
  font-size: 20px;
  height: 32px;
  justify-content: center;
  min-height: 32px;
  padding: 0;
  width: 32px;
}

.suggestion-close:hover {
  background: var(--line);
  color: var(--ink);
}

.suggestion-eyebrow {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.suggestion-status {
  background: var(--accent-soft);
  border: 1px solid var(--accent-soft-line);
  border-radius: var(--radius-s);
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 650;
  padding: 8px 10px;
}

.suggestion-body {
  display: grid;
  gap: 12px;
}

.suggestion-section {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.suggestion-section h3 {
  color: var(--ink);
  font-size: 13px;
  margin: 0 0 6px;
}

.suggestion-section ul {
  color: var(--ink-secondary);
  margin: 0;
  padding-left: 18px;
}

.suggestion-section li + li {
  margin-top: 5px;
}

.suggestion-section p {
  color: var(--ink-secondary);
  margin: 0;
}

.suggestion-error {
  background: var(--bad-bg);
  border: 1px solid var(--bad-line);
  border-radius: var(--radius-s);
  color: var(--bad);
  margin: 0;
  padding: 10px;
}

/* ============================================================
   标签
   ============================================================ */

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.tag {
  background: var(--neutral-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  color: var(--ink-secondary);
  display: inline-block;
  font-size: 12px;
  line-height: 1.5;
  padding: 1px 7px;
}

.tag-more {
  background: transparent;
  border-style: dashed;
  color: var(--muted);
}

/* ============================================================
   布局网格
   ============================================================ */

.layout,
.detail-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.55fr);
}

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

/* ============================================================
   筛选侧栏
   ============================================================ */

.filter-sidebar {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-card);
  padding: 16px;
  position: sticky;
  top: 74px;
}

.filter-panel {
  display: grid;
  gap: 14px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  padding-right: 2px;
}

.filter-panel label {
  color: var(--muted);
  display: grid;
  font-size: 13px;
  gap: 5px;
}

.filter-heading {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 6px;
}

.source-options,
.client-options {
  display: grid;
  gap: 2px;
}

.client-options {
  max-height: 260px;
  overflow-y: auto;
  padding-right: 2px;
}

.source-filter {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.checkbox-row {
  align-items: center;
  border-radius: var(--radius-s);
  color: var(--ink);
  cursor: pointer;
  display: grid;
  font-size: 13px;
  gap: 8px;
  grid-template-columns: 14px minmax(0, 1fr) auto;
  min-height: 26px;
  padding: 2px 4px;
}

.checkbox-row:hover {
  background: var(--neutral-bg);
}

.checkbox-row.active {
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 650;
}

.checkbox-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.checkbox-row em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-variant-numeric: tabular-nums;
}

.source-options-compact .checkbox-row {
  color: var(--muted);
  grid-template-columns: 14px minmax(0, 1fr) auto;
}

.filter-actions {
  background: var(--panel);
  bottom: 0;
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr 1fr;
  margin-top: 2px;
  padding-top: 10px;
  position: sticky;
}

.filter-actions .button,
.filter-actions button {
  justify-content: center;
  min-height: 34px;
  padding: 7px 10px;
}

.opportunity-table-wrap {
  min-width: 0;
  overflow-x: auto;
}

.result-summary {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 10px;
}

/* 屏蔽操作：悬停行才显现，避免整列红字噪音 */
.identity-cell {
  align-items: flex-start;
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.identity-cell .inline-form {
  opacity: 0;
  transition: opacity 0.12s ease;
}

tbody tr:hover .identity-cell .inline-form,
.identity-cell .inline-form:focus-within {
  opacity: 1;
}

.relevance-cell {
  min-width: 180px;
}

.relevance-main {
  align-items: flex-start;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  min-height: 28px;
}

.relevance-client {
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  min-width: 0;
  overflow: visible;
  overflow-wrap: anywhere;
  white-space: normal;
}

.related-clients {
  display: grid;
  gap: 4px;
  margin-top: 6px;
}

.related-client {
  align-items: flex-start;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 12px;
  gap: 5px;
  line-height: 1.35;
  min-width: 0;
}

.relevance-match {
  position: relative;
}

.suggestion-button {
  background: var(--panel);
  border: 1px solid var(--accent-soft-line);
  border-radius: 999px;
  box-shadow: 0 2px 6px rgb(24 33 47 / 0.08);
  color: var(--accent-strong);
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.2;
  min-height: 24px;
  opacity: 0;
  padding: 3px 8px;
  pointer-events: none;
  position: absolute;
  right: 0;
  top: 0;
  transform: translateY(-2px);
  transition: opacity 0.12s ease, background-color 0.12s ease;
  white-space: nowrap;
  z-index: 2;
}

.suggestion-button:hover {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.suggestion-button-muted {
  border-color: var(--line);
  color: var(--muted);
  font-size: 11px;
  min-height: 22px;
  padding: 2px 7px;
  top: -1px;
}

.relevance-match:hover .suggestion-button,
.relevance-match:focus-within .suggestion-button {
  opacity: 1;
  pointer-events: auto;
}

.related-score {
  background: var(--neutral-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  color: var(--muted);
  display: inline-block;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  min-width: 28px;
  padding: 1px 5px;
  text-align: center;
}

.related-name {
  color: var(--muted);
  min-width: 0;
  overflow: visible;
  overflow-wrap: anywhere;
  white-space: normal;
}

.media-filter-panel {
  align-items: end;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-card);
  grid-template-columns: repeat(3, minmax(160px, 1fr)) 220px;
  margin-bottom: 14px;
  padding: 16px;
}

.media-profile-table th:first-child,
.media-profile-table td:first-child {
  width: 24%;
}

.media-profile-table th:nth-child(2),
.media-profile-table td:nth-child(2) {
  width: 28%;
}

.mini-dl {
  color: var(--ink-secondary);
  display: grid;
  font-size: 12.5px;
  gap: 4px 10px;
  grid-template-columns: 44px minmax(0, 1fr);
  margin-top: 10px;
}

.mini-dl dt {
  margin: 0;
}

.mini-dl dd {
  margin: 0;
}

.media-edit-form {
  display: grid;
  gap: 10px;
}

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

.media-edit-grid label {
  color: var(--muted);
  display: grid;
  font-size: 12px;
  gap: 4px;
}

.media-edit-wide {
  grid-column: 1 / -1;
}

.media-edit-form button {
  justify-content: center;
  min-height: 32px;
  padding: 6px 10px;
  width: fit-content;
}

/* ============================================================
   表单
   ============================================================ */

input,
select,
textarea {
  background: #ffffff;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-s);
  color: var(--ink);
  font: inherit;
  min-height: 36px;
  padding: 8px 10px;
  transition: border-color 0.12s ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  outline: 2px solid var(--accent-soft);
}

input::placeholder,
textarea::placeholder {
  color: #9aa4b5;
}

.filter-panel input,
.filter-panel select {
  min-height: 34px;
  min-width: 0;
  width: 100%;
}

.filter-panel input[type="checkbox"],
.filter-panel input[type="radio"] {
  accent-color: var(--accent);
  height: 14px;
  margin: 0;
  min-height: 14px;
  min-width: 14px;
  padding: 0;
  width: 14px;
}

.stacked-form {
  display: grid;
  gap: 12px;
}

.stacked-form label {
  color: var(--muted);
  display: grid;
  font-size: 13px;
  gap: 5px;
}

.stacked-form input,
.stacked-form select,
.stacked-form textarea {
  min-width: 0;
  width: 100%;
}

.checkbox-setting {
  align-items: center;
  color: var(--ink-secondary);
  display: flex;
  font-size: 13px;
  gap: 8px;
}

.checkbox-setting input[type="checkbox"] {
  accent-color: var(--accent);
  height: 16px;
  min-height: 16px;
  min-width: 16px;
  width: 16px;
}

/* ============================================================
   详情页
   ============================================================ */

.description {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-card);
  color: var(--ink);
  line-height: 1.65;
  padding: 18px 20px;
  white-space: pre-wrap;
}

aside {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-card);
  padding: 16px;
}

aside h2 {
  margin-top: 0;
}

aside h2 + table,
aside h2 + form {
  margin-top: 2px;
}

aside table {
  border: 1px solid var(--line);
  box-shadow: none;
}

aside h2:not(:first-child) {
  margin-top: 22px;
}

dl {
  margin: 0;
}

dt {
  color: var(--muted);
  font-size: 12px;
  margin-top: 12px;
}

dt:first-child {
  margin-top: 0;
}

dd {
  margin: 3px 0 0;
  overflow-wrap: anywhere;
}

.match-details {
  margin-top: 10px;
}

.match-details summary {
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  padding: 4px 2px;
  user-select: none;
  width: fit-content;
}

.match-details summary:hover {
  color: var(--accent-strong);
}

.match-details[open] summary {
  margin-bottom: 8px;
}

.reason-list {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
}

.insight-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-card);
  padding: 18px 20px;
}

.insight-head {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: space-between;
  margin-bottom: 8px;
}

.insight-head h2 {
  margin: 0;
}

.insight-summary {
  color: var(--ink);
  font-size: 16px;
  font-weight: 650;
  margin: 0 0 14px;
}

.insight-grid {
  display: grid;
  gap: 8px 16px;
  grid-template-columns: 110px minmax(0, 1fr);
}

.insight-grid dt {
  margin-top: 0;
}

.insight-grid dd {
  margin-top: 0;
}

.compact-list {
  margin: 0;
  padding-left: 18px;
}

/* ============================================================
   ROI 页
   ============================================================ */

.placement-link {
  display: grid;
  gap: 2px;
  margin-bottom: 10px;
}

.placement-link a {
  overflow-wrap: anywhere;
}

.placement-link span {
  color: var(--muted);
  font-size: 12px;
}

/* ============================================================
   响应式
   ============================================================ */

@media (max-width: 900px) {
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .layout,
  .detail-grid,
  .opportunity-layout {
    grid-template-columns: 1fr;
  }

  .media-filter-panel,
  .media-edit-grid {
    grid-template-columns: 1fr;
  }

  .filter-sidebar {
    position: static;
  }

  .page,
  .topbar {
    padding-left: 16px;
    padding-right: 16px;
  }

  .topbar {
    height: auto;
    padding-bottom: 10px;
    padding-top: 10px;
  }

  .topbar,
  .page-head {
    align-items: stretch;
    flex-direction: column;
  }

  nav {
    flex-wrap: wrap;
  }

  input {
    min-width: 0;
    width: 100%;
  }
}
