:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --ink: #182033;
  --muted: #637083;
  --line: #dce3ee;
  --accent: #146c94;
  --up: #bf2f32;
  --down: #16845f;
  --flat: #68758a;
  font-family: "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

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

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px clamp(16px, 4vw, 40px);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

h1 {
  margin: 0 0 6px;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.15;
  letter-spacing: 0;
}

p {
  margin: 0;
  color: var(--muted);
}

.export-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  color: var(--accent);
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
}

main {
  padding: 18px clamp(12px, 3vw, 32px) 32px;
}

.controls {
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) repeat(4, minmax(140px, 1fr)) minmax(240px, 1.3fr);
  gap: 12px;
  margin-bottom: 14px;
}

.reset-button {
  align-self: end;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}

label,
.quick-filters {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.quick-filters > div {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  flex-wrap: wrap;
}

input,
select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  padding: 0 10px;
}

.quick-filters button {
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}

.quick-filters button.active {
  border-color: var(--accent);
  background: #e6f3f7;
  color: var(--accent);
}

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

.summary > div {
  min-height: 78px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.summary span {
  display: block;
  margin-bottom: 4px;
  font-size: 24px;
  font-weight: 750;
}

.summary small {
  color: var(--muted);
  font-size: 13px;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

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

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

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #eef3f8;
  color: #415168;
  font-size: 12px;
  font-weight: 750;
}

th:first-child,
td:first-child,
th:nth-child(2),
td:nth-child(2),
th:nth-child(3),
td:nth-child(3),
th:last-child,
td:last-child {
  text-align: left;
}

tbody tr:hover {
  background: #f8fbfd;
}

.code {
  color: var(--muted);
  font-family: Consolas, "Courier New", monospace;
}

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

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

.flat {
  color: var(--flat);
}

.empty {
  padding: 32px 12px;
  text-align: center;
  color: var(--muted);
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

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

.pagination select {
  width: auto;
  min-height: 34px;
}

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

.page-buttons button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}

.page-buttons button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

@media (max-width: 820px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .controls,
  .summary {
    grid-template-columns: 1fr;
  }

  .pagination {
    align-items: stretch;
    flex-direction: column;
  }

  .page-buttons {
    justify-content: space-between;
  }

  main {
    padding-inline: 10px;
  }
}
