:root {
  color-scheme: light;
  --bg: #f6f8fb;
  --panel: #ffffff;
  --ink: #172033;
  --muted: #667085;
  --line: #d8dee8;
  --line-strong: #b8c2d2;
  --primary: #1f5eff;
  --primary-ink: #ffffff;
  --header: #0b2545;
  --header-ink: #ffffff;
  --region-fill: #edf2f7;
  --soft-fill: #f8fafc;
  --success: #047857;
  --danger: #b42318;
  font-family:
    "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

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

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

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

h1 {
  margin: 0;
  color: var(--header);
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: 0;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.toolbar {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.toolbar label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

input,
select {
  height: 36px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
}

input {
  width: 320px;
  padding: 0 11px;
}

select {
  width: 180px;
  padding: 0 10px;
}

.metric {
  min-width: 104px;
  height: 48px;
  padding: 6px 12px;
  border-left: 1px solid var(--line);
}

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

.metric strong {
  display: block;
  margin-top: 2px;
  font-size: 20px;
}

.table-shell {
  position: relative;
  margin-top: 12px;
  height: calc(100vh - 174px);
  min-height: 540px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

table {
  width: 100%;
  min-width: 1580px;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

th,
td {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 8px 10px;
  vertical-align: middle;
  overflow-wrap: anywhere;
}

th {
  position: sticky;
  top: 0;
  z-index: 2;
  height: 42px;
  background: var(--header);
  color: var(--header-ink);
  font-size: 14px;
  text-align: center;
}

td {
  background: #ffffff;
  font-size: 14px;
  line-height: 1.45;
}

tbody tr:nth-child(even) td {
  background: #fbfdff;
}

td:nth-child(1) {
  width: 92px;
  text-align: center;
  font-weight: 800;
  color: var(--header);
  background: var(--region-fill);
}

th:nth-child(1) {
  width: 92px;
}

th:nth-child(2),
td:nth-child(2) {
  width: 158px;
  text-align: center;
  font-weight: 700;
}

th:nth-child(3),
td:nth-child(3) {
  width: 230px;
}

th:nth-child(4),
td:nth-child(4) {
  width: 250px;
}

th:nth-child(5),
td:nth-child(5) {
  width: 132px;
  text-align: center;
}

th:nth-child(6),
td:nth-child(6) {
  width: 310px;
}

th:nth-child(7),
td:nth-child(7) {
  width: 320px;
}

th:nth-child(8),
td:nth-child(8) {
  width: 160px;
  text-align: center;
  font-weight: 700;
}

.empty-state {
  position: sticky;
  left: 0;
  padding: 32px;
  color: var(--muted);
  font-size: 16px;
  text-align: center;
}

@media (max-width: 760px) {
  body {
    min-width: 0;
  }

  .app-shell {
    width: calc(100vw - 20px);
    padding-top: 12px;
  }

  .topbar,
  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  input,
  select {
    width: 100%;
  }

  .table-shell {
    height: calc(100vh - 300px);
  }
}
