:root {
  color-scheme: light;
  --bg: #eef3f8;
  --surface: #ffffff;
  --surface-soft: #f7f9fc;
  --ink: #10233f;
  --muted: #66758a;
  --line: #dfe7f0;
  --navy: #173a63;
  --blue: #3867d6;
  --violet: #675bd7;
  --red: #c9565b;
  --green: #2f8f6b;
  --amber: #c58a2d;
  --shadow: 0 12px 30px rgba(20, 48, 82, 0.08);
  --radius-lg: 18px;
  --radius-md: 12px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 85% -10%, rgba(84, 111, 201, 0.11), transparent 32%),
    var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

.app-shell {
  width: min(1540px, 100%);
  margin: 0 auto;
  padding: 20px 28px 28px;
}

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

.brand-block,
.status-block,
.panel-heading,
.legend,
.news-card-meta,
.news-card-footer {
  display: flex;
  align-items: center;
}

.brand-block {
  gap: 14px;
}

.brand-mark {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 14px;
  background: var(--navy);
  box-shadow: 0 8px 20px rgba(23, 58, 99, 0.2);
  color: white;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.eyebrow,
.section-kicker {
  color: #6e7f95;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  margin-top: 3px;
  font-size: clamp(23px, 2vw, 30px);
  letter-spacing: -0.035em;
}

h2 {
  margin-top: 4px;
  font-size: 19px;
  letter-spacing: -0.02em;
}

.status-block {
  gap: 16px;
}

.mode-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 11px;
  border: 1px solid #c9d5ff;
  border-radius: 999px;
  background: #eef1ff;
  color: #4a56b5;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.update-meta {
  display: grid;
  gap: 2px;
  color: var(--muted);
  font-size: 11px;
  text-align: right;
}

.update-meta time {
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
}

.clear-button {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid #ccd7e4;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--navy);
  font-size: 13px;
  font-weight: 650;
  transition: border-color 150ms ease, background 150ms ease;
}

.clear-button:hover,
.clear-button:focus-visible {
  border-color: #9fb3ca;
  background: white;
  outline: none;
}

.notice-bar,
.warning-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  margin-top: 6px;
  padding: 8px 14px;
  border: 1px solid #d9e3ee;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.62);
  color: #52657d;
  font-size: 12px;
}

.notice-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--violet);
  box-shadow: 0 0 0 4px rgba(103, 91, 215, 0.1);
}

.filter-panel {
  display: grid;
  grid-template-columns: minmax(220px, 1.55fr) repeat(5, minmax(118px, 0.72fr));
  gap: 12px;
  margin: 14px 0;
  padding: 14px;
  border: 1px solid rgba(214, 224, 235, 0.9);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 8px 25px rgba(30, 57, 90, 0.04);
  backdrop-filter: blur(10px);
}

.filter-panel label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.field-label {
  color: #6d7d91;
  font-size: 11px;
  font-weight: 700;
}

.filter-panel select,
.search-control {
  width: 100%;
  height: 38px;
  border: 1px solid #d4deea;
  border-radius: 9px;
  background: white;
  color: var(--ink);
}

.filter-panel select {
  padding: 0 32px 0 11px;
}

.search-control {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 11px;
  color: #8190a3;
}

.search-control input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  color: var(--ink);
}

.search-control input::placeholder {
  color: #9aa7b6;
}

.filter-panel select:focus-visible,
.search-control:focus-within {
  border-color: #7d91d8;
  box-shadow: 0 0 0 3px rgba(76, 98, 189, 0.1);
  outline: none;
}

.warning-bar {
  margin-bottom: 14px;
  border-color: #ead5a8;
  background: #fffaf0;
  color: #865d1e;
}

.error-state {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 18px 0;
  padding: 18px;
  border: 1px solid #efc7ca;
  border-radius: var(--radius-md);
  background: #fff7f7;
  color: #7f3036;
}

.error-state p {
  margin-top: 5px;
  color: #98545a;
  font-size: 13px;
}

.error-icon {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: #f9dfe1;
  font-weight: 800;
}

.dashboard {
  transition: opacity 180ms ease;
}

.dashboard.is-loading {
  opacity: 0.45;
  pointer-events: none;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 14px;
}

.metric-card {
  position: relative;
  min-height: 108px;
  overflow: hidden;
  padding: 17px 18px;
  border: 1px solid #e0e8f0;
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 7px 22px rgba(27, 53, 84, 0.045);
}

.metric-card::after {
  position: absolute;
  right: -18px;
  bottom: -24px;
  width: 86px;
  height: 86px;
  border-radius: 50%;
  background: rgba(61, 94, 143, 0.05);
  content: "";
}

.metric-primary::after { background: rgba(56, 103, 214, 0.09); }
.metric-negative::after { background: rgba(201, 86, 91, 0.09); }
.metric-positive::after { background: rgba(47, 143, 107, 0.09); }
.metric-policy::after { background: rgba(138, 100, 196, 0.09); }
.metric-disruption::after { background: rgba(208, 106, 87, 0.09); }

.metric-label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.metric-card strong {
  display: block;
  margin: 5px 0 1px;
  color: var(--navy);
  font-size: 31px;
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.metric-number-group {
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.metric-number-group strong {
  display: inline-block;
}

.metric-unit {
  color: #9b4c53;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.02em;
}

.metric-negative strong { color: var(--red); }
.metric-positive strong { color: var(--green); }
.metric-policy strong { color: #7653ad; }
.metric-disruption strong { color: #bd5948; }

.metric-card small {
  color: #8a97a8;
  font-size: 10px;
}

.tracker-panel {
  display: grid;
  grid-template-columns: minmax(190px, 0.34fr) minmax(0, 1fr);
  gap: 22px;
  margin-bottom: 14px;
  padding: 16px 18px;
  border: 1px solid #dce5ef;
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: 0 7px 22px rgba(27, 53, 84, 0.045);
}

.tracker-heading {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  border-right: 1px solid #e7edf4;
  padding-right: 18px;
}

.tracker-note {
  color: #8290a2;
  font-size: 10px;
  line-height: 1.5;
}

.tracker-groups {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 24px;
}

.tracker-groups h3 {
  margin: 0 0 9px;
  color: #65768b;
  font-size: 10px;
  letter-spacing: 0.08em;
}

.stat-stack {
  display: grid;
  gap: 6px;
}

.stat-row {
  display: grid;
  grid-template-columns: minmax(100px, 0.8fr) minmax(70px, 1fr) 28px 40px;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 2px 5px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #5d6f85;
  text-align: left;
}

.stat-row:hover,
.stat-row:focus-visible,
.stat-row.is-active {
  background: #f0f4fa;
  outline: none;
}

.stat-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 10px;
  font-weight: 700;
}

.stat-label i {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--stat-color);
}

.stat-track {
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf1f6;
}

.stat-track span {
  display: block;
  min-width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--stat-color);
}

.stat-row strong {
  color: var(--ink);
  font-size: 11px;
  text-align: right;
}

.stat-row small {
  color: #8a98aa;
  font-size: 9px;
  text-align: right;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(340px, 0.75fr);
  gap: 14px;
}

.panel {
  min-width: 0;
  border: 1px solid #dde6ef;
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel-heading {
  justify-content: space-between;
  gap: 18px;
  min-height: 72px;
  padding: 14px 18px;
  border-bottom: 1px solid #e8eef4;
}

.legend {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
  color: var(--muted);
  font-size: 10px;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.legend-scale {
  width: 22px;
  height: 7px;
  border-radius: 999px;
  background: linear-gradient(90deg, #e4eaf2, #315f9b);
}

.dot-asset { background: var(--violet); }
.dot-decrease { background: var(--red); }
.dot-increase { background: var(--green); }
.dot-uncertain { background: var(--amber); }

.map-wrap {
  position: relative;
  min-height: 520px;
  overflow: hidden;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  background: linear-gradient(180deg, #f8fbff 0%, #f4f7fb 100%);
}

#world-map {
  width: 100%;
  height: 520px;
}

.map-hint {
  position: absolute;
  right: 14px;
  bottom: 12px;
  padding: 6px 9px;
  border: 1px solid rgba(208, 219, 231, 0.8);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  color: #738299;
  font-size: 10px;
  pointer-events: none;
}

.news-panel {
  height: 593px;
  overflow: hidden;
}

.panel-count {
  flex: 0 0 auto;
  padding: 5px 9px;
  border-radius: 999px;
  background: #f0f4f8;
  color: #617188;
  font-size: 11px;
  font-weight: 700;
}

.news-heading-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.compact-select select {
  min-width: 116px;
  height: 31px;
  padding: 0 28px 0 9px;
  border: 1px solid #d8e2ed;
  border-radius: 8px;
  background-color: #f8fafc;
  color: #53667d;
  font-size: 10px;
  font-weight: 700;
}

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

.news-list {
  height: 520px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: #c7d2df transparent;
  scrollbar-width: thin;
}

.news-card {
  position: relative;
  display: block;
  width: 100%;
  padding: 15px 17px 14px 20px;
  border: 0;
  border-bottom: 1px solid #edf1f5;
  background: white;
  color: inherit;
  text-align: left;
  transition: background 150ms ease, box-shadow 150ms ease;
}

.news-card::before {
  position: absolute;
  top: 17px;
  bottom: 17px;
  left: 9px;
  width: 3px;
  border-radius: 3px;
  background: var(--amber);
  content: "";
}

.news-card[data-direction="decrease"]::before { background: var(--red); }
.news-card[data-direction="increase"]::before { background: var(--green); }

.news-card:hover,
.news-card:focus-visible {
  background: #f8fafc;
  outline: none;
}

.news-card.is-selected {
  z-index: 1;
  background: #f2f5ff;
  box-shadow: inset 0 0 0 1px #bcc9f3;
}

.news-card.is-related {
  background: #f7f5ff;
}

.news-card-meta {
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
  color: #78879a;
  font-size: 10px;
}

.news-card h3 {
  margin: 0 0 6px;
  color: #1a3352;
  font-size: 14px;
  line-height: 1.45;
}

.news-card p {
  display: -webkit-box;
  overflow: hidden;
  color: #67778c;
  font-size: 11px;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.news-card-footer {
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
}

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

.tag {
  padding: 3px 6px;
  border-radius: 5px;
  background: #eef3f8;
  color: #617188;
  font-size: 9px;
  font-weight: 700;
}

.tag-high { background: #e7f4ee; color: #27795c; }
.tag-medium { background: #edf2ff; color: #4c65a8; }
.tag-low { background: #fff2dc; color: #96661c; }

.tag-event {
  border-left: 2px solid var(--event-color);
  background: color-mix(in srgb, var(--event-color) 10%, white);
  color: #43536a;
}

.source-module {
  max-width: 170px;
  overflow: hidden;
  padding: 3px 7px;
  border: 1px solid #d9e3ef;
  border-radius: 5px;
  background: #f8fafc;
  color: #52657c;
  font-size: 9px;
  font-weight: 700;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-module:hover {
  border-color: #aebfda;
  color: #355b9b;
}

.external-link {
  flex: 0 0 auto;
  color: #4868b0;
  font-size: 10px;
  font-weight: 700;
  text-decoration: none;
}

.external-link:hover {
  text-decoration: underline;
}

.news-card-actions {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
}

.impact-tag {
  color: #9a4d52;
  font-size: 9px;
  font-weight: 750;
  white-space: nowrap;
}

.impact-unquantified {
  color: #8996a6;
  font-weight: 600;
}

.no-coordinate {
  color: #a16c20;
  font-size: 9px;
}

.asset-panel {
  margin-top: 14px;
  overflow: hidden;
}

.asset-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.asset-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.asset-table th,
.asset-table td {
  padding: 13px 16px;
  border-bottom: 1px solid #edf1f5;
  text-align: left;
  vertical-align: middle;
}

.asset-table th {
  background: #f8fafc;
  color: #7b899a;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.asset-table th:first-child { width: 27%; }
.asset-table th:nth-child(2) { width: 14%; }
.asset-table th:nth-child(3) { width: 12%; }
.asset-table th:nth-child(4) { width: 12%; }
.asset-table th:nth-child(5) { width: 23%; }
.asset-table th:nth-child(6) { width: 12%; }

.asset-row {
  cursor: pointer;
  transition: background 150ms ease, box-shadow 150ms ease;
}

.asset-row:hover,
.asset-row:focus-visible {
  background: #f8fafc;
  outline: none;
}

.asset-row.is-selected {
  background: #f0f2ff;
  box-shadow: inset 3px 0 0 var(--violet);
}

.asset-row.is-related {
  background: #f7f5ff;
}

.asset-name {
  display: block;
  color: #1a3557;
  font-size: 13px;
  font-weight: 750;
}

.asset-company,
.cell-secondary {
  display: block;
  margin-top: 3px;
  color: #7a899c;
  font-size: 10px;
}

.asset-source-link {
  display: inline-block;
  margin-top: 5px;
  color: #536cb4;
  font-size: 9px;
  font-weight: 700;
  text-decoration: none;
}

.asset-source-link:hover,
.asset-source-link:focus-visible {
  text-decoration: underline;
  outline: none;
}

.location-quality {
  display: inline-flex;
  margin-top: 5px;
  padding: 2px 5px;
  border-radius: 5px;
  background: #fff2dc;
  color: #94651e;
  font-size: 8px;
  font-weight: 750;
}

.location-quality.is-mapped {
  background: #eaf1fb;
  color: #456a9b;
}

.location-source-link {
  display: inline-block;
  margin-left: 5px;
  color: #536cb4;
  font-size: 8px;
  font-weight: 700;
  text-decoration: none;
}

.location-source-link:hover,
.location-source-link:focus-visible {
  text-decoration: underline;
  outline: none;
}

.asset-table td {
  color: #4e6076;
  font-size: 11px;
}

.status-pill {
  display: inline-flex;
  padding: 4px 7px;
  border-radius: 999px;
  background: #edf2f7;
  color: #52677f;
  font-size: 9px;
  font-weight: 750;
}

.related-count {
  display: inline-grid;
  min-width: 25px;
  height: 25px;
  place-items: center;
  border-radius: 8px;
  background: #eef0ff;
  color: #564eb0;
  font-weight: 800;
}

.empty-state {
  display: grid;
  min-height: 190px;
  place-items: center;
  align-content: center;
  gap: 6px;
  padding: 30px;
  color: #8492a4;
  text-align: center;
}

.empty-state span {
  font-size: 26px;
}

.empty-state strong {
  color: #566a82;
}

.empty-state p {
  font-size: 11px;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 3px 0;
  color: #7d8b9d;
  font-size: 10px;
}

.is-hidden {
  display: none !important;
}

@media (max-width: 1100px) {
  .filter-panel {
    grid-template-columns: repeat(3, 1fr);
  }

  .search-field {
    grid-column: span 2;
  }

  .workspace-grid {
    grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.8fr);
  }

  .metric-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 840px) {
  .app-shell {
    padding: 14px;
  }

  .topbar,
  .status-block {
    align-items: flex-start;
  }

  .topbar {
    flex-direction: column;
    gap: 12px;
  }

  .status-block {
    width: 100%;
    flex-wrap: wrap;
  }

  .update-meta {
    margin-left: auto;
  }

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

  .search-field {
    grid-column: span 2;
  }

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

  .tracker-panel {
    grid-template-columns: 1fr;
  }

  .tracker-heading {
    border-right: 0;
    border-bottom: 1px solid #e7edf4;
    padding: 0 0 12px;
  }

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

  .map-wrap,
  #world-map {
    height: 440px;
    min-height: 440px;
  }

  .news-panel {
    height: 560px;
  }

  .news-list {
    height: 487px;
  }

  .asset-table {
    min-width: 780px;
  }
}

@media (max-width: 520px) {
  .app-shell {
    padding: 10px;
  }

  .brand-mark {
    width: 42px;
    height: 42px;
  }

  h1 {
    font-size: 22px;
  }

  .status-block {
    gap: 8px;
  }

  .mode-badge {
    order: 1;
  }

  .update-meta {
    order: 2;
  }

  .clear-button {
    width: 100%;
    order: 3;
  }

  .notice-bar {
    align-items: flex-start;
    margin-top: 10px;
    line-height: 1.45;
  }

  .filter-panel {
    gap: 9px;
    padding: 11px;
    border-radius: 14px;
  }

  .filter-panel label,
  .search-field {
    grid-column: span 2;
  }

  .filter-panel label:not(.search-field) {
    grid-column: span 1;
  }

  .metric-grid {
    gap: 8px;
  }

  .metric-card {
    min-height: 92px;
    padding: 13px;
  }

  .metric-card strong {
    font-size: 25px;
  }

  .metric-card small {
    display: none;
  }

  .metric-card:last-child {
    grid-column: 1 / -1;
  }

  .tracker-groups {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .stat-row {
    grid-template-columns: minmax(105px, 0.9fr) minmax(70px, 1fr) 26px 36px;
  }

  .panel-heading {
    min-height: 66px;
    padding: 12px 14px;
  }

  .map-panel .panel-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .legend {
    justify-content: flex-start;
    gap: 8px;
  }

  .map-wrap,
  #world-map {
    height: 340px;
    min-height: 340px;
  }

  .map-hint {
    right: 8px;
    bottom: 8px;
  }

  .news-panel {
    height: 520px;
  }

  .news-heading-controls {
    gap: 6px;
  }

  .compact-select select {
    min-width: 104px;
  }

  .news-list {
    height: 447px;
  }

  .news-card {
    padding-right: 13px;
  }

  .asset-table-wrap {
    overflow: visible;
  }

  .asset-table,
  .asset-table tbody,
  .asset-table tr,
  .asset-table td {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .asset-table thead {
    display: none;
  }

  .asset-row {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 8px 12px;
    padding: 14px;
    border-bottom: 1px solid #e8eef4;
  }

  .asset-table td {
    padding: 0;
    border: 0;
  }

  .asset-table td:first-child,
  .asset-table td:nth-child(5) {
    grid-column: span 2;
  }

  .asset-table td::before {
    display: block;
    margin-bottom: 3px;
    color: #8795a6;
    font-size: 9px;
    font-weight: 750;
  }

  .asset-table td:nth-child(2)::before { content: "地区"; }
  .asset-table td:nth-child(3)::before { content: "类型"; }
  .asset-table td:nth-child(4)::before { content: "状态"; }
  .asset-table td:nth-child(5)::before { content: "规模说明"; }
  .asset-table td:nth-child(6)::before { content: "关联新闻"; }

  .footer {
    flex-direction: column;
    gap: 4px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  * {
    transition: none !important;
  }
}
