:root {
  --bg: #f4f5f8;
  --white: #ffffff;
  --ink: #1f2430;
  --muted: #6b6f7a;
  --indigo: #3f51b5;
  --indigo-soft: #eef0ff;
  --frame: #c8cad0;
  --row-line: #e6e7eb;
  --drop-slot: #eef0f4;
  --drop-bar: #9fa8da;
  --tag-ink: #1a237e;
  --divider: #9aa3d6;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Noto Sans TC', 'Microsoft JhengHei', sans-serif;
}

.app {
  width: min(390px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  padding-bottom: 72px;
}

.header {
  height: 38px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  font-size: 14px;
  font-weight: 700;
}

.race-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px 10px;
  overflow-x: auto;
  scrollbar-width: none;
}

.race-tabs::-webkit-scrollbar {
  display: none;
}

.venue-drop,
.tab {
  height: 28px;
  border: 0;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
}

.venue-drop {
  min-width: 72px;
  padding: 0 8px;
  background: var(--indigo);
  color: #fff;
}

.tab {
  width: 28px;
  background: var(--indigo-soft);
  color: var(--indigo);
}

.tab.is-on {
  background: var(--indigo);
  color: #fff;
}

.view {
  flex: 1;
  background: var(--white);
}

.thead,
.trow {
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid var(--row-line);
}

.trow {
  min-height: 48px;
}

.thead {
  background: #eef0f4;
  min-height: 44px;
  font-size: 11px;
  font-weight: 700;
  color: var(--indigo);
}

.thead .is-sort {
  margin: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  user-select: none;
}

.thead button.th-rank,
.thead button.col {
  font-family: inherit;
}

.thead .is-sort.is-on {
  color: var(--tag-ink, #1a237e);
}

.th-rank,
.td-rank {
  width: 174px;
  flex: 1 1 auto;
  min-width: 0;
  padding: 6px 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.td-rank .no {
  width: 18px;
  flex: 0 0 18px;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

.td-rank .mid {
  min-width: 0;
  flex: 1;
}

.td-rank .name {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

.td-rank .meta {
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.col {
  flex: 0 0 56px;
  width: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--indigo);
}

.disc {
  margin: 8px 12px 0;
  font-size: 10px;
  color: var(--muted);
}

.float-bar {
  position: fixed;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  width: min(366px, calc(100% - 24px));
  height: 48px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px;
  background: var(--white);
  border: 1px solid var(--frame);
  border-radius: 10px;
  box-shadow: 0 4px 16px rgb(31 36 48 / 8%);
}

.float-bar button {
  min-width: 38px;
  height: 36px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: var(--indigo);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  font-family: inherit;
}

.float-bar button:disabled {
  opacity: 1;
  cursor: default;
}

.empty {
  padding: 24px 12px;
  color: var(--muted);
  font-size: 13px;
}
