:root {
  --bg: #f4f7fb;
  --panel: #ffffff;
  --ink: #172033;
  --muted: #667085;
  --line: #d9e2ef;
  --brand: #176b87;
  --brand-strong: #0f5067;
  --accent: #c2410c;
  --soft: #edf7f8;
  --shadow: 0 16px 40px rgba(23, 32, 51, 0.08);
}

* {
  box-sizing: border-box;
}

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

.app-shell {
  width: min(1480px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 22px 0 28px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  padding: 18px 22px;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

h1 {
  margin: 0 0 6px;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0;
}

p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.status-pill {
  min-width: 92px;
  padding: 8px 12px;
  border-radius: 6px;
  background: var(--soft);
  color: var(--brand-strong);
  text-align: center;
  font-size: 13px;
  white-space: nowrap;
}

.toolbar {
  display: grid;
  grid-template-columns: 90px repeat(4, minmax(130px, 1fr)) 96px 96px minmax(160px, 1.2fr) minmax(160px, 1.2fr) 84px 84px;
  gap: 10px;
  align-items: end;
  margin-top: 14px;
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.field {
  min-width: 0;
}

.field label {
  display: block;
  margin-bottom: 6px;
  color: #344054;
  font-size: 12px;
}

input,
select {
  width: 100%;
  height: 38px;
  padding: 0 10px;
  border: 1px solid #c9d4e3;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-size: 14px;
}

input:focus,
select:focus {
  outline: 2px solid rgba(23, 107, 135, 0.22);
  border-color: var(--brand);
}

button {
  height: 38px;
  border: 1px solid #c9d4e3;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font-size: 14px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.primary-btn {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
  font-weight: 700;
}

.primary-btn:hover {
  background: var(--brand-strong);
}

.ghost-btn:hover,
.pager button:hover,
.tab:hover {
  background: #f0f5fa;
}

.tabs {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.tab {
  min-width: 110px;
  padding: 0 16px;
  border-color: var(--line);
}

.tab.active {
  border-color: var(--brand);
  background: var(--soft);
  color: var(--brand-strong);
  font-weight: 700;
}

.summary-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}

.metric {
  min-width: 120px;
  padding: 10px 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
}

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

.metric strong {
  display: block;
  margin-top: 4px;
  font-size: 18px;
}

.pager {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.pager button {
  min-width: 84px;
}

.table-wrap {
  margin-top: 12px;
  overflow: auto;
  max-height: calc(100vh - 310px);
  min-height: 360px;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

table {
  width: 100%;
  min-width: 1120px;
  border-collapse: collapse;
}

thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  height: 42px;
  background: #eaf2f6;
  border-bottom: 1px solid var(--line);
  color: #25324a;
  font-size: 13px;
  text-align: left;
  white-space: nowrap;
}

th,
td {
  padding: 9px 10px;
  border-bottom: 1px solid #ecf1f6;
  font-size: 13px;
  vertical-align: middle;
}

tbody tr:hover {
  background: #f8fbfd;
}

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

.score {
  color: var(--accent);
  font-weight: 700;
}

.empty {
  height: 180px;
  color: var(--muted);
  text-align: center;
}

.source-link {
  color: var(--brand);
  text-decoration: none;
}

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

@media (max-width: 1180px) {
  .toolbar {
    grid-template-columns: repeat(4, minmax(120px, 1fr));
  }

  .primary-btn,
  .ghost-btn {
    width: 100%;
  }
}

@media (max-width: 720px) {
  .app-shell {
    width: calc(100vw - 18px);
    padding-top: 10px;
  }

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

  .toolbar {
    grid-template-columns: 1fr 1fr;
    padding: 12px;
  }

  h1 {
    font-size: 20px;
  }

  .pager {
    margin-left: 0;
  }

  .table-wrap {
    max-height: none;
  }
}
