:root {
  --bg: #f4f4f4;
  --panel: #ffffff;
  --panel-soft: #fafafa;
  --text: #111111;
  --muted: #666666;
  --line: #e3e3e3;
  --brand: #111111;
  --brand-soft: #f0f0f0;
  --accent: #2b2b2b;
  --shadow: 0 16px 36px rgba(0, 0, 0, 0.06);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  font-family: "Avenir Next", "PingFang SC", "Hiragino Sans GB", sans-serif;
  background: linear-gradient(180deg, #fcfcfc 0%, var(--bg) 100%);
}

.page-shell {
  width: min(1120px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 56px;
}

.hero,
.controls,
.table-shell,
.empty-state {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.9fr);
  gap: 20px;
  padding: 28px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--brand);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  font-family: "Iowan Old Style", "Songti SC", serif;
  font-size: clamp(30px, 5vw, 48px);
  line-height: 1.06;
}

.hero-text {
  margin: 14px 0 0;
  max-width: 56ch;
  color: var(--muted);
  line-height: 1.7;
}

.hero-stats {
  display: grid;
  gap: 12px;
}

.stat-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel-soft);
}

.stat-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
}

.stat-card strong {
  font-size: 28px;
}

.controls {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(140px, 1fr));
  gap: 14px;
  margin-top: 20px;
  padding: 18px;
}

.field {
  display: grid;
  gap: 8px;
}

.field span {
  color: var(--muted);
  font-size: 13px;
}

.field input,
.field select {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  font-size: 14px;
}

.field input:focus,
.field select:focus {
  outline: 2px solid rgba(17, 17, 17, 0.08);
  border-color: rgba(17, 17, 17, 0.28);
}

.toolbar {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin: 16px 0 10px;
}

.toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
}

.toolbar-actions .hidden {
  display: none;
}

.sync-status {
  color: var(--muted);
  font-size: 13px;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.filter-chip,
.reset-button {
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  font-size: 14px;
}

.filter-chip.active {
  border-color: transparent;
  background: var(--brand);
  color: #ffffff;
}

.reset-button {
  background: transparent;
}

.reset-button:disabled {
  cursor: wait;
  opacity: 0.6;
}

.results-bar {
  margin: 6px 2px 14px;
  color: var(--muted);
  font-size: 14px;
}

.delist-section {
  margin-bottom: 18px;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: end;
  margin: 0 2px 10px;
}

.section-heading h2 {
  margin: 0 0 6px;
  font-size: 22px;
}

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

.table-shell {
  overflow: hidden;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
}

.page-numbers {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.page-button {
  min-width: 42px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  font-size: 14px;
}

.page-button.active {
  border-color: transparent;
  background: var(--brand);
  color: #fff;
  cursor: default;
}

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

.page-ellipsis {
  display: inline-flex;
  align-items: center;
  padding: 0 2px;
  color: var(--muted);
}

.contracts-table {
  width: 100%;
  border-collapse: collapse;
}

.contracts-table thead {
  background: var(--panel-soft);
}

.contracts-table th,
.contracts-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 14px;
}

.contracts-table th {
  color: var(--muted);
  font-weight: 600;
}

.contracts-table tbody tr:hover {
  background: #fbfbfb;
}

.market-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 12px;
  font-weight: 600;
}

.type-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--accent);
  font-size: 12px;
  font-weight: 500;
}

.empty-state {
  margin-top: 16px;
  padding: 36px 24px;
  text-align: center;
}

.empty-state h2 {
  margin: 0 0 8px;
}

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

.hidden {
  display: none;
}

@media (max-width: 960px) {
  .hero,
  .controls {
    grid-template-columns: 1fr;
  }

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

  .toolbar-actions {
    justify-content: stretch;
  }

  .reset-button {
    width: 100%;
  }

  .pagination {
    justify-content: stretch;
  }
}

@media (max-width: 760px) {
  .page-shell {
    width: min(100vw - 20px, 1120px);
    padding-top: 18px;
  }

  .table-shell {
    border: 0;
    box-shadow: none;
    background: transparent;
  }

  .contracts-table,
  .contracts-table thead,
  .contracts-table tbody,
  .contracts-table tr,
  .contracts-table th,
  .contracts-table td {
    display: block;
  }

  .contracts-table thead {
    display: none;
  }

  .contracts-table tbody {
    display: grid;
    gap: 12px;
  }

  .contracts-table tr {
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--panel);
    box-shadow: var(--shadow);
    overflow: hidden;
  }

  .contracts-table td {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
  }

  .contracts-table td::before {
    content: attr(data-label);
    color: var(--muted);
  }
}
