:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --panel: #ffffff;
  --text: #182230;
  --muted: #667085;
  --line: #d0d5dd;
  --soft: #eef2f6;
  --blue: #2563eb;
  --green: #16803c;
  --amber: #b45309;
  --red: #c2271a;
  --teal: #0f766e;
  font-family: Inter, "SF Pro Display", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  font-size: 16px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
}

h1,
h2,
h3,
p {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 30px;
  line-height: 1.18;
}

h2 {
  font-size: 20px;
  line-height: 1.25;
}

h3 {
  margin-bottom: 10px;
  font-size: 15px;
  line-height: 1.3;
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 32px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.eyebrow {
  margin-bottom: 6px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.status-pill,
.source-chip,
.status-tag,
.filter-button {
  border-radius: 999px;
  white-space: nowrap;
}

.status-pill {
  padding: 9px 13px;
  border: 1px solid var(--line);
  background: var(--soft);
  color: var(--text);
  font-size: 13px;
  font-weight: 850;
}

.status-pill.ok {
  border-color: rgba(22, 128, 60, 0.28);
  background: rgba(22, 128, 60, 0.08);
  color: var(--green);
}

.status-pill.warning,
.status-pill.unknown {
  border-color: rgba(180, 83, 9, 0.28);
  background: rgba(180, 83, 9, 0.09);
  color: var(--amber);
}

.status-pill.error {
  border-color: rgba(194, 39, 26, 0.28);
  background: rgba(194, 39, 26, 0.08);
  color: var(--red);
}

.layout {
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: 20px 24px 36px;
}

.conclusion,
.metric,
.section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.conclusion {
  padding: 18px;
}

.conclusion h2 {
  max-width: 980px;
  font-size: 23px;
}

.conclusion p:last-child {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

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

.metric {
  min-height: 100px;
  padding: 14px;
}

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

.metric strong {
  display: block;
  margin-top: 9px;
  font-size: 25px;
  line-height: 1.05;
}

.metric small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.metric.watch strong {
  color: var(--blue);
}

.metric.buy strong {
  color: var(--amber);
}

.metric.today strong {
  color: var(--teal);
}

.metric.warning strong,
.metric.error strong {
  color: var(--red);
}

.section {
  margin-top: 14px;
  padding: 18px;
}

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

.section-head.compact {
  margin-bottom: 12px;
}

.source-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.source-chip {
  padding: 5px 9px;
  border: 1px solid rgba(15, 118, 110, 0.26);
  background: rgba(15, 118, 110, 0.08);
  color: var(--teal);
  font-weight: 850;
}

.source-chip.warning {
  border-color: rgba(180, 83, 9, 0.32);
  background: rgba(180, 83, 9, 0.1);
  color: var(--amber);
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.filter-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid var(--line);
  background: #f8fafc;
  color: #344054;
  font: inherit;
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
}

.filter-button span {
  color: var(--muted);
}

.filter-button.active {
  border-color: rgba(15, 118, 110, 0.35);
  background: rgba(15, 118, 110, 0.1);
  color: var(--teal);
}

.table-wrap,
.mini-table-wrap {
  overflow-x: auto;
}

.stock-table,
.mini-table {
  width: 100%;
  border-collapse: collapse;
}

.stock-table th,
.stock-table td,
.mini-table th,
.mini-table td {
  border-bottom: 1px solid #e4e7ec;
  padding: 10px 9px;
  text-align: left;
  vertical-align: middle;
  font-size: 13px;
}

.stock-table th,
.mini-table th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.stock-table tbody tr {
  cursor: pointer;
}

.stock-table tbody tr:hover,
.stock-table tbody tr:focus {
  outline: 0;
  background: #f8fafc;
}

.stock-table td:first-child strong {
  display: block;
  font-size: 14px;
}

.stock-table td:first-child span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.status-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 25px;
  padding: 0 9px;
  border: 1px solid var(--line);
  background: var(--soft);
  color: #344054;
  font-size: 12px;
  font-weight: 850;
}

.status-tag.watch {
  border-color: rgba(37, 99, 235, 0.28);
  background: rgba(37, 99, 235, 0.08);
  color: var(--blue);
}

.status-tag.buy {
  border-color: rgba(180, 83, 9, 0.3);
  background: rgba(180, 83, 9, 0.1);
  color: var(--amber);
}

.status-tag.today {
  border-color: rgba(15, 118, 110, 0.28);
  background: rgba(15, 118, 110, 0.08);
  color: var(--teal);
}

.status-tag.history {
  border-color: #d0d5dd;
  background: #f2f4f7;
  color: #667085;
}

.status-tag.none {
  color: #667085;
}

.status-tag.ok {
  border-color: rgba(22, 128, 60, 0.24);
  background: rgba(22, 128, 60, 0.08);
  color: var(--green);
}

.status-tag.warning,
.status-tag.error {
  border-color: rgba(194, 39, 26, 0.28);
  background: rgba(194, 39, 26, 0.08);
  color: var(--red);
}

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

.detail-head h2 span {
  color: var(--muted);
  font-size: 15px;
  font-weight: 650;
}

.detail-head p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr 0.9fr;
  gap: 14px;
}

.detail-grid > section {
  min-width: 0;
  padding: 14px;
  border: 1px solid #e4e7ec;
  border-radius: 8px;
  background: #fcfcfd;
}

.condition-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.condition {
  padding: 5px 8px;
  border: 1px solid #d0d5dd;
  border-radius: 999px;
  background: #f2f4f7;
  color: #667085;
  font-size: 12px;
  font-weight: 750;
}

.condition.pass {
  border-color: rgba(22, 128, 60, 0.24);
  background: rgba(22, 128, 60, 0.08);
  color: var(--green);
}

.explain {
  margin-top: 12px;
  color: #344054;
  font-size: 13px;
  line-height: 1.55;
}

.chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.chart-grid > section {
  min-width: 0;
}

.chart {
  width: 100%;
  height: 470px;
  border: 1px solid #e4e7ec;
  border-radius: 8px;
  background: #fff;
}

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

.detail-list {
  display: grid;
  gap: 9px;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 9px;
  border-bottom: 1px solid #e4e7ec;
  color: var(--muted);
  font-size: 13px;
}

.detail-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.detail-row strong {
  color: var(--text);
  text-align: right;
}

.rules {
  display: grid;
  gap: 8px;
  color: #344054;
  font-size: 14px;
  line-height: 1.55;
}

.rules strong {
  color: var(--text);
}

.empty,
.loading,
.empty-cell {
  padding: 16px;
  color: var(--muted);
  border: 1px dashed #b8c1cc;
  border-radius: 8px;
  background: #f8fafc;
}

.empty-cell {
  text-align: center;
}

@media (max-width: 1080px) {
  .metric-grid,
  .detail-grid,
  .chart-grid,
  .split {
    grid-template-columns: 1fr;
  }

  .chart {
    height: 430px;
  }
}

@media (max-width: 720px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    padding: 20px 16px 14px;
  }

  h1 {
    font-size: 25px;
  }

  .layout {
    padding: 14px 10px 28px;
  }

  .conclusion,
  .section,
  .metric {
    padding: 14px;
  }

  .metric-grid {
    gap: 9px;
  }

  .section-head,
  .detail-head,
  .detail-row {
    flex-direction: column;
  }

  .source-meta {
    justify-content: flex-start;
  }

  .detail-row strong {
    text-align: left;
  }

  .stock-table th,
  .stock-table td {
    min-width: 112px;
  }

  .stock-table th:first-child,
  .stock-table td:first-child {
    min-width: 155px;
  }

  .chart {
    height: 390px;
  }
}
