@charset "UTF-8";

.insight-block { margin: 12px 18px 18px; padding: 12px 14px; border-left: 3px solid var(--evidence); background: var(--info-soft); border-radius: var(--radius-sm); min-width: 0; }
.dynamic-insight { font-size: 12px; line-height: 1.65; overflow-wrap: anywhere; }
.dynamic-insight + .dynamic-insight { border-top: 1px solid var(--line); margin-top: 10px; padding-top: 8px; }
.dynamic-insight p { margin: 6px 0; }
.dynamic-insight summary, .insight-more > summary { cursor: pointer; color: var(--ink-soft); min-height: 32px; padding: 5px 0; }
.dynamic-insight ul { padding-left: 20px; margin: 8px 0; }
.dynamic-insight li { margin-bottom: 5px; }
.insight-source { color: var(--muted); }

.flow-panel { padding: 16px 18px 14px; }
.flow-panel .dynamic-insight { margin-bottom: 6px; }
.flow-legend { display: flex; gap: 8px; margin: 8px 0 12px; align-items: center; }
.flow-list { display: grid; gap: 10px; }
.flow-item { display: grid; grid-template-columns: 120px 1fr 1fr; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.flow-kw { font-weight: 700; font-size: 13px; }
.flow-kw small { display: block; color: var(--muted); font-weight: 500; font-size: 11px; margin-top: 2px; }
.flow-dir { display: block; color: var(--evidence); font-size: 11px; font-weight: 700; margin-bottom: 4px; }
.flow-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.flow-chip { display: inline-block; padding: 2px 7px; border-radius: 4px; font-size: 11px; border: 1px solid var(--line); background: var(--surface-muted); color: var(--ink-soft); max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.flow-chip.kind-own { background: var(--brand-soft); border-color: rgba(191,38,56,.25); color: #8f1d2c; }
.flow-chip.kind-rival { background: var(--gold-soft); border-color: rgba(148,115,59,.35); color: #6e5326; }
.flow-chip.kind-noise { background: var(--surface-muted); border-color: var(--line-strong); color: var(--muted); text-decoration: line-through; }

/* 上下游词按用途分四组：只说明关联词共现，不解释成流量或路径 */
.flow-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 10px 0 12px; }
.flow-group { padding: 10px 12px; border: 1px solid var(--line); border-left: 3px solid var(--evidence); border-radius: var(--radius-sm); background: var(--surface); }
.flow-group-defense { border-left-color: var(--feihe); }
.flow-group-compare { border-left-color: var(--gold); }
.flow-group-noise { border-left-color: var(--line-strong); }
.flow-group h4 { display: flex; align-items: baseline; gap: 8px; margin: 0 0 4px; font-size: 13px; }
.flow-group h4 span { color: var(--muted); font-family: var(--mono); font-size: 10px; font-weight: 500; }
.flow-group p { margin: 0 0 7px; color: var(--ink-soft); font-size: 11px; line-height: 1.55; }

.flow-tasks { padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--info-soft); }
.flow-tasks > h4 { margin: 0 0 8px; font-size: 13px; }
.flow-tasks > small { display: block; margin-top: 8px; color: var(--muted); font-size: 10px; line-height: 1.55; }
.flow-task { padding: 9px 11px; border-radius: var(--radius-sm); background: var(--surface); margin-bottom: 7px; }
.flow-task > b { display: flex; align-items: baseline; gap: 8px; margin-bottom: 5px; font-size: 12px; }
.flow-task-group { padding: 1px 6px; border-radius: 4px; background: var(--surface-muted); color: var(--evidence); font-size: 10px; font-weight: 500; }
.flow-task dl { display: grid; gap: 3px; margin: 0; }
.flow-task dl > div { display: grid; grid-template-columns: 68px 1fr; gap: 8px; }
.flow-task dt { color: var(--muted); font-size: 10px; }
.flow-task dd { margin: 0; color: var(--ink-soft); font-size: 11px; line-height: 1.55; }
@media (max-width: 860px) { .flow-groups { grid-template-columns: 1fr; } .flow-task dl > div { grid-template-columns: 1fr; gap: 2px; } }
@media (max-width: 860px) { .flow-item { grid-template-columns: 1fr; } .flow-kw { display: flex; align-items: baseline; gap: 6px; } }
.thesis-card[aria-labelledby$="competition-heading"] { border-color: var(--gold); border-left-color: var(--gold); background: linear-gradient(110deg, var(--gold-soft), var(--info-soft)); }
.thesis-card[aria-labelledby$="competition-heading"] h3 { color: var(--gold-ink); }
.thesis-card[aria-labelledby$="competition-heading"] { display: block; }
.thesis-card[aria-labelledby$="competition-heading"]::after { display: none; }
.thesis-card[aria-labelledby$="competition-heading"] h3 { margin: 0 0 12px; font-size: 18px; }
.thesis-card[aria-labelledby$="competition-heading"] .dynamic-insight { font-size: 14px; line-height: 1.75; }
.thesis-card[aria-labelledby$="competition-heading"] .dynamic-insight strong { font-weight: 600; }
.exec-card .exec-headline { font-size: clamp(21px, 2.2vw, 27px); }
.exec-evidence > summary { min-height: 44px; }
@media (max-width: 680px) { .insight-block { margin: 10px 8px 14px; padding: 10px; } .dynamic-insight summary, .insight-more > summary { min-height: 44px; } .exec-evidence > summary { min-height: 44px; } }


:root {
  --shadow: 0 16px 38px rgba(23, 38, 48, 0.08);
  --shadow-soft: 0 4px 14px rgba(23, 38, 48, 0.05);
  --radius: 8px;
  --radius-sm: 6px;
  --radius-lg: 12px;
  --motion-fast: 140ms;
  --motion-base: 220ms;
}

body {
  background: var(--paper);
  font-size: 14px;
}

button,
a,
summary,
select,
label {
  touch-action: manipulation;
}

button:active,
.action-card:active {
  filter: brightness(0.96);
}

.nav-icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-item {
  min-height: 44px;
  grid-template-columns: 24px 1fr auto;
  font-size: 13px;
}

.nav-item:hover {
  transform: none;
}

.nav-item.is-active:hover { background: var(--brand-hover); }
.segmented button:hover,
.action-filters button:hover,
.battle-tabs button:hover { background: var(--brand-soft); color: var(--feihe); }
.drawer-close:hover,
.row-action:hover,
.filter-reset:hover,
.button-secondary:hover { background: var(--info-soft); color: var(--evidence); }
input { accent-color: var(--feihe); color: var(--ink); background-color: var(--surface); }
input::placeholder { color: var(--muted); }
select option { color: var(--ink); background: var(--surface); }

.button,
.field,
.brand-filter summary,
.brand-option,
.toggle-field,
.text-action,
.filter-reset,
.drawer-close,
.row-action,
.segmented button,
.action-filters button,
.battle-tabs button {
  min-height: 44px;
}

.field span,
.brand-filter summary span,
.panel-index,
th,
.status-pill,
.severity-pill,
.type-pill,
.basis-pill,
.strategy-fact span,
.drawer-section h3 {
  font-size: 11px;
}

.field select,
.brand-filter summary b,
.toggle-field,
.filter-reset,
.button,
.text-action,
.panel-header > p,
.section-intro > p,
.view-heading > p,
.view-heading > div + p,
.notice-card,
table,
.strategy-fact p,
.drawer-section p {
  font-size: 12px;
}

.title-block > p:last-child,
.thesis-body,
.kpi-foot,
.action-card b {
  font-size: 13px;
}

.kpi-delta.is-up,
.kpi-delta.is-down {
  color: var(--ink-soft);
}

.panel-header h3,
.strategy-fact.is-proposition p {
  font-size: 16px;
}

.title-block h1 {
  font-size: clamp(28px, 2.3vw, 38px);
  text-wrap: balance;
}

.eyebrow,
.section-kicker {
  font-size: 10px;
}

.panel-index {
  color: var(--evidence);
  letter-spacing: 0.08em;
}

.rank-section {
  margin-bottom: 18px;
}

.rank-section .compact-intro {
  align-items: center;
  margin-bottom: 8px;
}

.rank-section h3 {
  display: inline-block;
  margin: 0;
  font-family: var(--display);
  font-size: 16px;
}

.rank-legend {
  display: inline-flex;
  gap: 10px;
  margin: 0 0 0 12px;
  color: var(--muted);
  font-size: 11px;
}

.rank-table-wrap {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-soft);
  background: var(--surface);
}

.rank-row {
  min-height: 46px;
}

.rank-row .table-brand {
  font-size: 12px;
}

.rank-row td {
  padding-top: 9px;
  padding-bottom: 9px;
}

.view-context {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 15px;
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--evidence);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.view-context[hidden] {
  display: none;
}

.view-context-label,
.view-context-health {
  color: var(--muted);
  font-size: 11px;
}

.view-context-label {
  margin-right: 8px;
}

.view-context strong {
  font-size: 12px;
}

.view-context-health {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 999px;
  background: #e8f0ec;
  color: var(--quality);
}

.sr-status {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.thesis-card {
  margin-bottom: 12px;
  padding-top: 16px;
  padding-bottom: 16px;
}

.kpi-grid {
  gap: 8px;
  margin-bottom: 12px;
}

.kpi-card,
.panel,
.quality-stat,
.strategy-card {
  border-color: var(--line);
  box-shadow: var(--shadow-soft);
}

.chart-data {
  margin: 0 -2px 2px;
  border-top: 1px solid var(--line);
}

.chart-data summary {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 3px 4px;
  color: var(--evidence);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.chart-data summary span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.chart-data .table-wrap {
  max-height: 330px;
  margin-top: 8px;
}

.table-link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 7px;
  padding: 4px 7px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: var(--evidence);
  cursor: pointer;
  font-weight: 700;
}

.table-link:hover,
.table-link:focus-visible {
  border-color: var(--line);
  background: var(--surface-muted);
}

.table-wrap thead {
  position: sticky;
  z-index: 1;
  top: 0;
}

.table-wrap th {
  background: var(--surface-muted);
}

.row-action {
  min-width: 84px;
  padding: 8px 10px;
}

.action-filters {
  gap: 8px;
}

.action-filters button,
.segmented button {
  padding: 8px 12px;
}

.drawer-close {
  width: 44px;
  height: 44px;
}

.detail-drawer {
  overscroll-behavior: contain;
  padding-bottom: calc(30px + env(safe-area-inset-bottom));
}

.brand-menu {
  overscroll-behavior: contain;
}

.page-footer {
  font-size: 11px;
}

* {
  font-variant-numeric: tabular-nums;
}

@media (max-width: 860px) {
  .sidebar {
    gap: 8px;
    padding-top: calc(8px + env(safe-area-inset-top));
    overflow-x: auto;
    overscroll-behavior-x: contain;
  }

  .brand-lockup {
    position: sticky;
    z-index: 1;
    left: 0;
    background: var(--sidebar);
  }

  .sidebar,
  .primary-nav {
    scrollbar-width: none;
  }

  .sidebar::-webkit-scrollbar,
  .primary-nav::-webkit-scrollbar {
    display: none;
  }

  .primary-nav {
    min-width: max-content;
    justify-content: flex-start;
    gap: 8px;
  }

  .nav-item {
    width: auto;
    min-width: 72px;
    height: 48px;
    grid-template-columns: 18px auto;
    gap: 6px;
    padding: 0 10px;
  }

  .nav-item span:not(.nav-count) {
    display: inline;
    font-size: 11px;
  }

  .nav-count {
    display: none;
  }

  .workspace {
    padding-top: 22px;
  }
}

@media (max-width: 680px) {
  body {
    font-size: 15px;
  }

  .topbar {
    gap: 16px;
  }

  .title-block h1 {
    font-size: 28px;
  }

  .title-block > p:last-child,
  .thesis-body,
  .notice-card,
  .strategy-fact p {
    font-size: 14px;
  }

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

  .field,
  .brand-filter {
    min-width: 0;
  }

  .group-field {
    min-width: 0;
  }

  .toggle-field {
    min-height: 44px;
    padding: 0 10px;
  }

  .filter-reset {
    justify-self: end;
  }

  .view-context {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  #view-overview:not([hidden]) {
    display: flex;
    flex-direction: column;
  }

  #view-overview > .view-heading { order: 1; }
  #view-overview > .trust-strip { order: 2; }
  #view-overview > .exec-card { order: 3; }
  #view-overview > .kpi-grid { order: 4; }
  #view-overview > .todo-panel { order: 5; }
  #view-overview > .rank-section { order: 6; }
  #view-overview > .dashboard-grid { order: 7; }
  #view-overview > .alert-panel { order: 8; }

  .rank-section .compact-intro {
    align-items: flex-start;
  }

  .rank-legend {
    display: flex;
    margin: 4px 0 0;
  }

  .chart,
  .chart-large {
    height: 300px;
  }

  .chart-xl {
    height: 390px;
  }

  .chart-data summary {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .page-footer {
    font-size: 11px;
  }
}

@media (max-width: 460px) {
  .brand-copy {
    display: none;
  }

  .nav-item {
    width: auto;
    min-width: 68px;
  }

  .nav-item span:not(.nav-count) {
    display: inline;
  }

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

  .field,
  .brand-filter {
    min-width: 0;
    flex-basis: auto;
  }
}
