:root {
  color-scheme: light;
  --bg: #f5f7fa;
  --panel: #ffffff;
  --text: #18212f;
  --muted: #667085;
  --line: #d9e0ea;
  --accent: #0f766e;
  --accent-strong: #0b5f59;
  --danger: #b42318;
  --shadow: 0 14px 35px rgba(24, 33, 47, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

.app-shell {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

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

h1 {
  margin: 0 0 6px;
  font-size: 30px;
  font-weight: 750;
  letter-spacing: 0;
}

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

.refresh-box {
  min-width: 168px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
}

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

.refresh-box strong {
  color: var(--accent);
  font-size: 16px;
}

.toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

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

.control {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.search {
  flex: 1 1 360px;
  min-width: min(360px, 100%);
}

input,
select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  padding: 8px 11px;
  font: inherit;
  outline: none;
}

select {
  min-width: 190px;
  cursor: pointer;
}

input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.16);
}

button {
  min-height: 40px;
  border: 0;
  background: var(--accent);
  color: white;
  padding: 8px 14px;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}

button:hover {
  background: var(--accent-strong);
}

button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.sport-tables {
  display: grid;
  gap: 18px;
}

.sport-section {
  display: grid;
  gap: 10px;
}

.sport-section__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 750;
  letter-spacing: 0;
}

.sport-section__meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.sport-section__meta span {
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 5px 8px;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
}

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

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

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #edf2f7;
  color: #344054;
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
}

td:nth-child(1),
td:nth-child(5),
td:nth-child(6),
td:nth-child(7) {
  white-space: normal;
}

.state-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 60px;
  padding: 4px 8px;
  border: 1px solid transparent;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.state-live {
  border-color: #7dd3b0;
  background: #dcfce7;
  color: #166534;
}

.state-upcoming {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.state-expired {
  border-color: #e5e7eb;
  background: #f3f4f6;
  color: #4b5563;
}

.state-unknown {
  border-color: #f5d0a9;
  background: #fff7ed;
  color: #9a3412;
}

tbody tr:hover {
  background: #f8fbfb;
}

.empty-panel {
  padding: 36px 14px;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  text-align: center;
  color: var(--muted);
}

.status-error {
  color: var(--danger);
}

@media (max-width: 720px) {
  .app-shell {
    width: min(100% - 20px, 1280px);
    padding-top: 18px;
  }

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

  .filters {
    flex-direction: column;
  }

  h1 {
    font-size: 24px;
  }

  .refresh-box {
    min-width: 0;
  }

  .sport-section__header {
    align-items: flex-start;
    flex-direction: column;
  }

  .sport-section__meta {
    justify-content: flex-start;
  }
}
