:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-soft: #fafbfc;
  --line: #d9dee7;
  --line-strong: #b9c1cf;
  --text: #1f2933;
  --muted: #687385;
  --red: #d7332f;
  --red-soft: #fff0ef;
  --green: #147d46;
  --green-soft: #eaf7ef;
  --amber: #a86400;
  --amber-soft: #fff5df;
  --blue: #2563a8;
  --blue-soft: #edf5ff;
}

* {
  box-sizing: border-box;
}

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

.site-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
}

.nav-inner {
  width: min(1440px, calc(100% - 32px));
  min-height: 52px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.nav-brand,
.nav-links a {
  color: var(--text);
  text-decoration: none;
}

.nav-brand {
  font-size: 15px;
  font-weight: 800;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-links a {
  min-width: 78px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.nav-links a:hover {
  border-color: var(--line);
  color: var(--text);
  background: var(--surface-soft);
}

.nav-links a.active {
  border-color: var(--blue);
  background: var(--blue-soft);
  color: var(--blue);
}

.shell {
  width: min(1440px, calc(100% - 32px));
  margin: 0 auto;
  padding: 20px 0 36px;
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 6px 0 18px;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 28px;
  line-height: 1.2;
}

h2 {
  font-size: 16px;
  line-height: 1.3;
}

.status-box {
  min-width: 180px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--amber);
}

.status-box.ready .status-dot {
  background: var(--green);
}

.status-box.warmup .status-dot {
  background: var(--amber);
}

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

.kpi {
  min-height: 86px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 14px;
}

.kpi .label {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 8px;
}

.kpi .value {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.15;
}

.kpi .sub {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

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

.main-stack,
.side-stack {
  display: grid;
  gap: 14px;
  align-content: start;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
}

.panel-head {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}

.panel-head.tight {
  min-height: 52px;
}

.panel-head p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.filters {
  display: flex;
  gap: 8px;
  align-items: center;
}

select,
input {
  height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  padding: 0 10px;
  font-size: 13px;
}

input {
  width: 180px;
}

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

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

th,
td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  font-size: 13px;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-weight: 700;
  background: #fff;
}

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

.mobile-move-row {
  display: none;
}

.mobile-signal-row {
  display: none;
}

.num {
  font-variant-numeric: tabular-nums;
}

.up {
  color: var(--red);
  font-weight: 700;
}

.bar {
  position: relative;
  height: 9px;
  width: 100%;
  min-width: 90px;
  border-radius: 999px;
  background: #eef1f5;
  overflow: hidden;
}

.bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--red);
}

.grade {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 82px;
  height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 800;
}

.grade.STRONG {
  background: var(--green-soft);
  color: var(--green);
}

.grade.CANDIDATE {
  background: var(--blue-soft);
  color: var(--blue);
}

.grade.WATCH {
  background: var(--red-soft);
  color: var(--red);
}

.grade.WARMUP {
  background: var(--amber-soft);
  color: var(--amber);
}

.stock-list {
  display: grid;
}

.stock-row {
  display: grid;
  grid-template-columns: 160px 110px 140px minmax(0, 1fr);
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

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

.stock-code {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

.stock-score {
  font-size: 20px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

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

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
}

details {
  min-width: 0;
}

summary {
  cursor: pointer;
  color: var(--blue);
  font-size: 13px;
  font-weight: 700;
}

.reason {
  margin-top: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--text);
  font-size: 12px;
  line-height: 1.55;
}

.protocol-list {
  list-style: none;
  margin: 0;
  padding: 12px 16px 16px;
}

.protocol-list li {
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
  font-size: 13px;
  line-height: 1.5;
}

.protocol-list li:last-child {
  border-bottom: 0;
}

.coverage-chart {
  display: flex;
  align-items: end;
  gap: 4px;
  height: 128px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.coverage-bar {
  flex: 1;
  min-width: 4px;
  background: var(--blue);
  border-radius: 3px 3px 0 0;
}

.mapping-list {
  max-height: 520px;
  overflow: auto;
}

.mapping-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

.mapping-item:last-child {
  border-bottom: 0;
}

.mapping-item strong {
  display: block;
  font-size: 13px;
  margin-bottom: 4px;
}

.mapping-item p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.empty {
  padding: 18px 16px;
  color: var(--muted);
  font-size: 13px;
}

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

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

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

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

  .nav-inner {
    width: min(100% - 20px, 1440px);
    min-height: 64px;
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    padding: 8px 0;
  }

  .nav-links {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .nav-links a {
    min-width: 0;
    width: 100%;
  }

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

  .kpi-grid,
  .side-stack {
    grid-template-columns: 1fr;
  }

  .stock-row {
    grid-template-columns: 1fr;
  }

  input {
    width: 100%;
  }

  th,
  td {
    padding: 10px;
  }

  #dailyRows tr:not(.mobile-move-row) {
    display: none;
  }

  #dailyRows .mobile-move-row {
    display: table-row;
  }

  #dailyRows .mobile-move-row td {
    display: table-cell;
    padding: 0;
    white-space: normal;
  }

  .daily-table thead {
    display: none;
  }

  .mobile-move-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 12px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
  }

  .mobile-move-main {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .mobile-move-main .rank {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
  }

  .mobile-move-main strong {
    min-width: 0;
    overflow-wrap: anywhere;
    font-size: 16px;
  }

  .mobile-move-pct {
    align-self: center;
    font-size: 18px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
  }

  .mobile-move-card dl {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 0;
  }

  .mobile-move-card dl div {
    min-width: 0;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-soft);
  }

  .mobile-move-card dt {
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 11px;
  }

  .mobile-move-card dd {
    margin: 0;
    min-width: 0;
    overflow-wrap: anywhere;
    font-size: 14px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
  }

  .mobile-move-card .bar {
    grid-column: 1 / -1;
    min-width: 0;
    height: 8px;
  }

  #signalRows tr:not(.mobile-signal-row) {
    display: none;
  }

  #signalRows .mobile-signal-row {
    display: table-row;
  }

  #signalRows .mobile-signal-row td {
    display: table-cell;
    padding: 0;
    white-space: normal;
  }

  .signal-table thead {
    display: none;
  }

  .mobile-signal-card {
    display: grid;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
  }

  .mobile-signal-head {
    min-width: 0;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
  }

  .mobile-signal-head strong {
    min-width: 0;
    overflow-wrap: anywhere;
    font-size: 16px;
  }

  .mobile-signal-score {
    color: var(--text);
    font-size: 18px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
  }

  .mobile-signal-card dl {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 0;
  }

  .mobile-signal-card dl div {
    min-width: 0;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-soft);
  }

  .mobile-signal-card dt {
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 11px;
  }

  .mobile-signal-card dd {
    margin: 0;
    min-width: 0;
    overflow-wrap: anywhere;
    font-size: 14px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
  }

  .mobile-signal-card p {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
    overflow-wrap: anywhere;
  }
}
