:root {
  --bg: #f6f7f8;
  --panel: #ffffff;
  --panel-strong: #111827;
  --text: #17202a;
  --muted: #667085;
  --line: #d9dee6;
  --accent: #0f766e;
  --accent-strong: #115e59;
  --warn: #b45309;
  --critical: #b42318;
  --shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
}

a {
  color: inherit;
}

.shell {
  width: min(1440px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 24px 0 40px;
}

.module-nav {
  display: flex;
  min-height: 44px;
  gap: 24px;
  margin-bottom: 12px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  scrollbar-width: none;
}

.module-nav::-webkit-scrollbar {
  display: none;
}

.module-nav a {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
}

.module-nav a::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  background: transparent;
  content: "";
}

.module-nav a:hover,
.module-nav a.active {
  color: var(--accent-strong);
}

.module-nav a.active::after {
  background: var(--accent);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 76px;
  margin-bottom: 18px;
}

h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.2;
  font-weight: 750;
  letter-spacing: 0;
}

h2 {
  margin: 0 0 12px;
  font-size: 16px;
  line-height: 1.2;
}

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

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

button,
input,
select {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  font: inherit;
}

button {
  padding: 0 14px;
  cursor: pointer;
  font-weight: 650;
}

button:hover {
  border-color: var(--accent);
}

#refreshButton {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

#refreshButton:hover {
  background: var(--accent-strong);
}

button[aria-pressed="true"] {
  border-color: var(--accent);
  color: var(--accent-strong);
}

button:disabled {
  cursor: wait;
  opacity: 0.7;
}

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

.hotspot-panel {
  margin: 0 0 14px;
  padding: 14px 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

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

.panel-help {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

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

.hotspot-row {
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.hotspot-row:first-child {
  border-top: 0;
  padding-top: 0;
}

.hotspot-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.hotspot-title {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.hotspot-title strong {
  font-size: 15px;
  line-height: 1.35;
}

.hotspot-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.hotspot-score {
  min-width: 52px;
  text-align: right;
  font-size: 22px;
  font-weight: 800;
  color: var(--accent-strong);
}

.hotspot-reason {
  margin-top: 8px;
  color: #344054;
  line-height: 1.5;
  font-size: 13px;
}

.hotspot-keywords,
.matched-keywords {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  margin-top: 9px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.hotspot-keywords strong,
.matched-keywords strong {
  color: var(--accent-strong);
  font-weight: 750;
  white-space: nowrap;
}

.hotspot-keywords span,
.matched-keywords span {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 5px;
}

.hotspot-keywords em,
.matched-keywords em {
  padding: 2px 7px;
  border: 1px solid #c7e7df;
  border-radius: 999px;
  background: #f2fbf8;
  color: #087f6d;
  font-style: normal;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.matched-keywords {
  padding-top: 9px;
  border-top: 1px dashed var(--line);
}

.matched-keywords.is-empty {
  color: #98a2b3;
}

.matched-keywords.is-empty strong {
  color: #667085;
}

.hotspot-evidence {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.hotspot-evidence-item {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.metrics article,
.source-panel,
.news-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metrics article {
  min-height: 84px;
  padding: 14px 16px;
}

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

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

.filters {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 160px 140px;
  gap: 10px;
  margin-bottom: 14px;
}

input,
select {
  width: 100%;
  padding: 0 12px;
}

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

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

.news-card {
  padding: 14px 16px;
}

.news-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: #eef2f7;
  color: #344054;
  font-size: 12px;
  font-weight: 700;
}

.badge.high {
  background: #fef3c7;
  color: var(--warn);
}

.badge.critical {
  background: #fee4e2;
  color: var(--critical);
}

.badge.normal {
  background: #dcfce7;
  color: #166534;
}

.badge.ignore {
  background: #eef2f7;
  color: #475467;
}

.badge.tier-1 {
  background: #fee4e2;
  color: var(--critical);
}

.badge.tier-2 {
  background: #fef3c7;
  color: var(--warn);
}

.badge.tier-3 {
  background: #e0f2fe;
  color: #155e75;
}

.news-card h3 {
  margin: 0;
  font-size: 17px;
  line-height: 1.35;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.news-card h3 a {
  text-decoration: none;
}

.news-card h3 a:hover {
  color: var(--accent-strong);
}

.summary {
  margin-top: 8px;
  color: #344054;
  line-height: 1.55;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.original {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.45;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.tag {
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 8px;
  background: #edf7f5;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.source-panel {
  position: sticky;
  top: 14px;
  padding: 14px;
}

.source-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 9px 0;
  border-top: 1px solid var(--line);
  font-size: 13px;
}

.source-item:first-of-type {
  border-top: 0;
}

.source-name {
  font-weight: 700;
}

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

.empty {
  min-height: 200px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: var(--panel);
  border: 1px dashed var(--line);
  border-radius: 8px;
}

.empty.source-empty {
  min-height: 96px;
  font-size: 13px;
}

@media (max-width: 900px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .actions {
    width: 100%;
    justify-content: stretch;
  }

  .actions button {
    flex: 1 1 140px;
  }

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

  .hotspot-head,
  .panel-head {
    flex-direction: column;
  }

  .hotspot-score {
    text-align: left;
  }

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

  .source-panel {
    position: static;
  }
}

@media (max-width: 520px) {
  .shell {
    width: min(100vw - 20px, 1440px);
    padding-top: 16px;
  }

  h1 {
    font-size: 24px;
  }

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

  .hotspot-evidence-item {
    grid-template-columns: 1fr;
  }
}
