:root {
  color-scheme: light;
  --canvas: #f2f5f9;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --surface-muted: #eef2f7;
  --ink: #111827;
  --ink-soft: #334155;
  --muted: #64748b;
  --muted-light: #94a3b8;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --navy: #0b1220;
  --navy-soft: #111c33;
  --primary: #2563eb;
  --primary-strong: #1d4ed8;
  --primary-soft: #eff6ff;
  --cyan: #0891b2;
  --cyan-soft: #ecfeff;
  --emerald: #059669;
  --emerald-soft: #ecfdf5;
  --amber: #d97706;
  --amber-soft: #fffbeb;
  --red: #dc2626;
  --red-soft: #fef2f2;
  --shadow-sm: 0 1px 2px rgb(15 23 42 / 5%);
  --shadow-md: 0 12px 32px rgb(15 23 42 / 7%);
  font-family:
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", ui-sans-serif, system-ui,
    -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--canvas);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--canvas);
}

button,
input,
select {
  font: inherit;
}

button,
a,
select {
  -webkit-tap-highlight-color: transparent;
}

.topbar {
  position: sticky;
  z-index: 30;
  top: 0;
  color: #fff;
  background: var(--navy);
  box-shadow: 0 1px 0 rgb(255 255 255 / 7%);
}

.topbar-inner {
  width: min(1500px, calc(100% - 40px));
  height: 72px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
}

.brand {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid rgb(255 255 255 / 16%);
  border-radius: 8px;
  color: #fff;
  background: var(--primary);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.brand-copy {
  min-width: 0;
}

.brand-copy strong {
  display: block;
}

.brand-copy strong {
  overflow: hidden;
  font-size: 16px;
  letter-spacing: 0.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-pill {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid rgb(255 255 255 / 10%);
  border-radius: 999px;
  background: rgb(255 255 255 / 5%);
  font-size: 11px;
}

.workspace-pill span {
  color: #8fa1bd;
}

.workspace-pill strong {
  max-width: 240px;
  overflow: hidden;
  color: #f8fafc;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-self: end;
  gap: 16px;
}

.connection {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #cbd5e1;
  font-size: 11px;
}

.connection i {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #f59e0b;
  box-shadow: 0 0 0 4px rgb(245 158 11 / 12%);
}

.connection.online i {
  background: #22c55e;
  box-shadow: 0 0 0 4px rgb(34 197 94 / 12%);
}

.connection.error i {
  background: #ef4444;
  box-shadow: 0 0 0 4px rgb(239 68 68 / 14%);
}

.button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease,
    color 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:disabled {
  cursor: wait;
  opacity: 0.65;
  transform: none;
}

.button-primary {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
}

.button-primary:hover {
  background: var(--primary-strong);
  border-color: var(--primary-strong);
}

.button-ghost {
  color: var(--ink-soft);
  background: #fff;
  border-color: var(--line-strong);
}

.button-ghost:hover {
  color: var(--primary);
  border-color: #93c5fd;
  background: var(--primary-soft);
}

.app-shell {
  width: min(1500px, calc(100% - 40px));
  margin: 0 auto;
  padding: 24px 0 48px;
}

.dashboard-heading {
  min-height: 146px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding: 28px 32px;
  border: 1px solid rgb(255 255 255 / 7%);
  border-radius: 8px;
  color: #fff;
  background: var(--navy-soft);
  box-shadow: var(--shadow-md);
}

.heading-copy {
  min-width: 0;
}

.heading-copy h1 {
  margin: 7px 0 8px;
  font-size: clamp(24px, 2.2vw, 34px);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.heading-copy p:last-child {
  margin: 0;
  color: #a9b7cc;
  font-size: 13px;
}

.next-draw-highlight {
  min-width: 230px;
  padding: 14px 18px;
  border-left: 3px solid #60a5fa;
  background: rgb(255 255 255 / 5%);
}

.next-draw-highlight span,
.next-draw-highlight strong,
.next-draw-highlight small {
  display: block;
}

.next-draw-highlight span {
  color: #7dd3fc;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.15em;
}

.next-draw-highlight strong {
  margin: 6px 0 3px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 24px;
}

.next-draw-highlight small {
  color: #a9b7cc;
  font-size: 12px;
}

.notice-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  margin: 14px 0;
  padding: 10px 14px;
  border: 1px solid #fde68a;
  border-radius: 8px;
  color: #854d0e;
  background: #fffbeb;
  font-size: 12px;
}

.notice-label {
  flex: 0 0 auto;
  padding-right: 12px;
  border-right: 1px solid #fde68a;
  font-weight: 800;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.metric-card {
  position: relative;
  min-height: 122px;
  overflow: hidden;
  padding: 20px 20px 17px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.metric-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--primary);
}

.metric-samples::before {
  background: var(--primary);
}

.metric-next::before {
  background: var(--cyan);
}

.metric-leader::before {
  background: var(--amber);
}

.metric-backtest::before {
  background: var(--emerald);
}

.metric-label,
.metric-card small {
  display: block;
}

.metric-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.metric-card strong {
  display: block;
  margin: 10px 0 6px;
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: clamp(25px, 2.3vw, 35px);
  line-height: 1;
}

.metric-card small {
  color: var(--muted);
  font-size: 11px;
}

.metric-leader strong {
  color: var(--amber);
}

.prediction-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(410px, 0.65fr);
  gap: 14px;
  margin-top: 14px;
}

.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.panel-header {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}

.panel-header.compact {
  min-height: 72px;
  padding-block: 15px;
}

.panel-header > div {
  min-width: 0;
}

.panel-header h2 {
  margin: 4px 0 0;
  font-size: 19px;
  letter-spacing: -0.01em;
}

.model-status {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.status-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--emerald);
  box-shadow: 0 0 0 4px rgb(5 150 105 / 10%);
}

.model-status strong,
.model-status small {
  display: block;
}

.model-status strong {
  font-size: 11px;
}

.model-status small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

.panel-badge {
  padding: 5px 9px;
  border: 1px solid #bae6fd;
  border-radius: 999px;
  color: #0369a1;
  background: var(--cyan-soft);
  font-size: 10px;
  font-weight: 800;
}

.ranking-list {
  padding: 8px 18px 16px;
}

.ranking-item {
  display: grid;
  grid-template-columns: 32px 44px minmax(100px, 1fr) 66px 104px;
  align-items: center;
  gap: 12px;
  min-height: 50px;
  border-bottom: 1px solid #edf1f5;
  transition: background 140ms ease;
}

.ranking-item:hover {
  background: #fafcff;
}

.ranking-item:last-child {
  border-bottom: 0;
}

.rank {
  color: var(--muted-light);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  font-weight: 800;
}

.zodiac {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-size: 14px;
  font-weight: 800;
}

.ranking-item:nth-child(1) .zodiac {
  color: #92400e;
  border-color: #fcd34d;
  background: var(--amber-soft);
}

.ranking-item:nth-child(2) .zodiac,
.ranking-item:nth-child(3) .zodiac {
  color: var(--primary-strong);
  border-color: #bfdbfe;
  background: var(--primary-soft);
}

.progress {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e9eef5;
}

.progress span {
  display: block;
  width: var(--value);
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
  transform-origin: left center;
  animation: grow 420ms ease both;
}

.ranking-item:nth-child(1) .progress span {
  background: var(--amber);
}

.ranking-item:nth-child(2) .progress span,
.ranking-item:nth-child(3) .progress span {
  background: var(--cyan);
}

.probability {
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  font-weight: 900;
  text-align: right;
}

.ranking-meta {
  color: var(--muted);
  font-size: 10px;
  text-align: right;
}

.segmented {
  width: calc(100% - 28px);
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  margin: 14px 14px 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.segmented button {
  min-width: 0;
  min-height: 34px;
  padding: 0 4px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
}

.segmented button.active {
  color: #fff;
  background: var(--navy-soft);
  box-shadow: 0 3px 10px rgb(15 23 42 / 16%);
}

.position-panel .ranking-list {
  max-height: 572px;
  overflow: auto;
}

.position-ranking .ranking-item {
  grid-template-columns: 32px 44px minmax(80px, 1fr) 66px;
}

.position-ranking .ranking-meta {
  display: none;
}

.special-panel,
.latest-panel,
.history-panel {
  margin-top: 14px;
}

.special-number-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  padding: 20px 22px 22px;
}

.special-number-card {
  position: relative;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.special-number-card:first-child {
  border-color: #fcd34d;
  background: var(--amber-soft);
}

.special-number-rank {
  position: absolute;
  top: 10px;
  right: 11px;
  color: var(--muted-light);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9px;
  font-weight: 800;
}

.special-number-main {
  display: flex;
  align-items: center;
  gap: 10px;
}

.special-number-ball {
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 2px solid var(--primary);
  border-radius: 999px;
  color: var(--primary);
  background: var(--primary-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 17px;
  font-weight: 900;
}

.special-number-card:first-child .special-number-ball {
  color: #92400e;
  border-color: var(--amber);
  background: #fff;
}

.special-number-zodiac {
  min-width: 0;
}

.special-number-zodiac strong,
.special-number-zodiac span {
  display: block;
}

.special-number-zodiac strong {
  font-size: 15px;
}

.special-number-zodiac span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

.special-number-prob {
  margin-top: 14px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 19px;
  font-weight: 900;
}

.special-number-bar {
  height: 6px;
  margin-top: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #e6ebf2;
}

.special-number-bar span {
  display: block;
  width: var(--value);
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
}

.special-number-card:first-child .special-number-bar span {
  background: var(--amber);
}

.special-number-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 9px;
}

.strategy-panel {
  margin-top: 14px;
}

.strategy-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 20px 22px 22px;
}

.strategy-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.strategy-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.strategy-card-head strong {
  font-size: 14px;
}

.strategy-card-head span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 9px;
}

.strategy-picks {
  min-height: 74px;
  display: flex;
  align-content: flex-start;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}

.strategy-pick {
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  font-size: 10px;
  font-weight: 800;
}

.strategy-pick.number {
  color: var(--primary);
  border-color: #bfdbfe;
  background: var(--primary-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.strategy-position-list {
  min-height: 74px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 10px;
  margin-top: 14px;
}

.strategy-position-row {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  font-size: 9px;
}

.strategy-position-row span:first-child {
  color: var(--muted);
}

.strategy-position-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.strategy-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.strategy-metrics span,
.strategy-metrics strong,
.strategy-metrics small {
  display: block;
}

.strategy-metrics span {
  color: var(--muted);
  font-size: 8px;
}

.strategy-metrics strong {
  margin-top: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
}

.strategy-metrics small {
  color: var(--muted);
  font-size: 8px;
}

.evaluation-panel {
  margin-top: 14px;
}

.evaluation-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
}

.evaluation-metrics article {
  min-width: 0;
  padding: 18px 22px;
  border-right: 1px solid var(--line);
}

.evaluation-metrics article:last-child {
  border-right: 0;
}

.evaluation-metrics span,
.evaluation-metrics strong,
.evaluation-metrics small {
  display: block;
}

.evaluation-metrics span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.evaluation-metrics strong {
  margin: 8px 0 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 25px;
}

.evaluation-metrics small {
  color: var(--muted);
  font-size: 9px;
}

.evaluation-table-wrap {
  max-height: 520px;
}

.evaluation-table-wrap table {
  min-width: 1180px;
}

.prediction-tags {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex-wrap: wrap;
}

.prediction-tag {
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  font-size: 10px;
  font-weight: 800;
}

.prediction-tag.number {
  color: var(--primary);
  border-color: #bfdbfe;
  background: var(--primary-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.rank-pill {
  display: inline-flex;
  min-width: 42px;
  min-height: 26px;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 10px;
  font-weight: 800;
}

.rank-pill.hit {
  color: #047857;
  border-color: #a7f3d0;
  background: var(--emerald-soft);
}

.rank-pill.miss {
  color: var(--red);
  border-color: #fecaca;
  background: var(--red-soft);
}

.issue-tag {
  padding: 7px 11px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  color: var(--primary-strong);
  background: var(--primary-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  font-weight: 900;
}

.ball-row {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 12px;
  padding: 20px 22px 22px;
}

.ball {
  position: relative;
  min-width: 0;
  min-height: 118px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.ball::before {
  content: attr(data-position);
  position: absolute;
  top: 9px;
  left: 11px;
  color: var(--muted-light);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.ball-circle {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border: 2px solid currentcolor;
  border-radius: 999px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 20px;
  font-weight: 900;
}

.ball strong {
  margin-top: 8px;
  font-size: 14px;
}

.ball.blue {
  color: var(--primary);
}

.ball.red {
  color: var(--red);
}

.ball.green {
  color: var(--emerald);
}

.ball.blue .ball-circle {
  background: var(--primary-soft);
}

.ball.red .ball-circle {
  background: var(--red-soft);
}

.ball.green .ball-circle {
  background: var(--emerald-soft);
}

.history-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--muted);
  font-size: 11px;
}

.text-link {
  color: var(--primary);
  font-weight: 800;
  text-decoration: none;
}

.text-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.history-toolbar {
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}

.filter-groups {
  display: grid;
  gap: 16px;
}

.filter-group {
  min-width: 0;
}

.filter-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.filter-group-title,
.filter-group-head > span,
.filter-search > span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.filter-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.filter-tag {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--ink-soft);
  background: #fff;
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
  transition:
    color 140ms ease,
    border-color 140ms ease,
    background 140ms ease,
    transform 140ms ease;
}

.filter-tag:hover {
  color: var(--primary);
  border-color: #93c5fd;
  background: var(--primary-soft);
  transform: translateY(-1px);
}

.filter-tag.active {
  color: #fff;
  border-color: var(--primary);
  background: var(--primary);
}

.number-tags {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 7px;
}

.number-tags .filter-tag {
  min-width: 0;
  padding-inline: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.filter-reset {
  margin-bottom: 7px;
  padding: 0;
  border: 0;
  color: var(--primary);
  background: transparent;
  cursor: pointer;
  font-size: 10px;
  font-weight: 800;
}

.filter-reset:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.filter-keyword-group {
  max-width: 720px;
}

.filter-search input,
.page-size select {
  width: 100%;
  height: 40px;
  min-width: 0;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  outline: none;
  color: var(--ink);
  background: #fff;
  font-size: 12px;
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease;
}

.filter-search input::placeholder {
  color: var(--muted-light);
}

.filter-search input:focus,
.page-size select:focus {
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgb(37 99 235 / 9%);
}

.table-wrap {
  width: 100%;
  max-height: 720px;
  overflow: auto;
}

table {
  width: 100%;
  min-width: 960px;
  border-collapse: collapse;
  font-size: 12px;
}

th,
td {
  padding: 12px 13px;
  border-bottom: 1px solid #edf1f5;
  text-align: center;
  white-space: nowrap;
}

th {
  position: sticky;
  z-index: 2;
  top: 0;
  color: var(--muted);
  background: #f8fafc;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.06em;
}

tbody tr {
  transition: background 130ms ease;
}

tbody tr:nth-child(even) {
  background: #fcfdff;
}

tbody tr:hover {
  background: var(--primary-soft);
}

th.selected-column,
td.selected-column {
  background: #edf5ff;
  box-shadow: inset 1px 0 0 #bfdbfe, inset -1px 0 0 #bfdbfe;
}

th.selected-column {
  z-index: 3;
  color: var(--primary-strong);
  box-shadow:
    inset 1px 0 0 #93c5fd,
    inset -1px 0 0 #93c5fd,
    inset 0 -2px 0 var(--primary);
}

tbody tr:hover td.selected-column {
  background: #dbeafe;
}

td:first-child,
th:first-child {
  text-align: left;
}

.table-message td {
  height: 160px;
  color: var(--muted);
  text-align: center;
}

.table-ball {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 58px;
  justify-content: center;
  padding: 4px 7px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 800;
}

.table-ball b {
  min-width: 24px;
  color: var(--ink);
}

.table-ball span {
  color: var(--muted);
  font-family: inherit;
  font-size: 10px;
  font-weight: 700;
}

.table-ball.blue {
  border-color: #bfdbfe;
  background: var(--primary-soft);
  color: var(--primary);
}

.table-ball.red {
  border-color: #fecaca;
  background: var(--red-soft);
  color: var(--red);
}

.table-ball.green {
  border-color: #a7f3d0;
  background: var(--emerald-soft);
  color: var(--emerald);
}

.pagination-bar {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 22px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.pagination-bar > div:first-child {
  min-width: 0;
}

.pagination-bar strong,
.pagination-bar span {
  display: block;
}

.pagination-bar strong {
  font-size: 11px;
}

.pagination-bar > div:first-child > span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

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

.page-size {
  width: 78px;
  margin-right: 4px;
}

.page-size > span {
  display: none;
}

.page-size select {
  height: 34px;
  padding-inline: 9px;
}

.page-button,
.page-number {
  min-width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  color: var(--ink-soft);
  background: #fff;
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
}

.page-button:hover:not(:disabled),
.page-number:hover:not(.active) {
  color: var(--primary);
  border-color: #93c5fd;
  background: var(--primary-soft);
}

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

.page-numbers {
  display: flex;
  gap: 5px;
}

.page-number.active {
  color: #fff;
  border-color: var(--primary);
  background: var(--primary);
}

.loading-block {
  min-height: 340px;
}

.loading-block::before {
  content: "";
  display: block;
  width: 100%;
  height: 36px;
  margin-top: 10px;
  border-radius: 6px;
  background: #eef2f7;
  box-shadow:
    0 48px 0 #f3f6fa,
    0 96px 0 #eef2f7,
    0 144px 0 #f3f6fa,
    0 192px 0 #eef2f7;
  animation: pulse 1.4s ease-in-out infinite alternate;
}

.empty-state {
  min-height: 220px;
  display: grid;
  place-items: center;
  padding: 30px;
  color: var(--muted);
  text-align: center;
}

.empty-state strong {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 16px;
}

.toast {
  position: fixed;
  z-index: 50;
  right: 24px;
  bottom: 24px;
  max-width: min(420px, calc(100vw - 48px));
  padding: 12px 15px;
  border: 1px solid #1e293b;
  border-radius: 8px;
  color: #f8fafc;
  background: #172033;
  box-shadow: 0 16px 40px rgb(15 23 42 / 24%);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.toast.error {
  border-color: #7f1d1d;
  background: #991b1b;
}

@keyframes grow {
  from {
    transform: scaleX(0);
  }
}

@keyframes pulse {
  to {
    opacity: 0.5;
  }
}

@media (max-width: 1180px) {
  .prediction-layout {
    grid-template-columns: 1fr;
  }

  .special-number-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .strategy-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .position-panel .ranking-list {
    max-height: none;
  }

  .number-tags {
    grid-template-columns: repeat(8, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .topbar-inner,
  .app-shell {
    width: min(100% - 24px, 1500px);
  }

  .topbar-inner {
    grid-template-columns: 1fr auto;
    height: 66px;
  }

  .workspace-pill,
  .connection {
    display: none;
  }

  .dashboard-heading {
    align-items: stretch;
    flex-direction: column;
    gap: 20px;
    padding: 24px;
  }

  .next-draw-highlight {
    min-width: 0;
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .metric-card {
    min-height: 108px;
    padding: 17px 16px 15px;
  }

  .ranking-item {
    grid-template-columns: 26px 40px minmax(70px, 1fr) 64px;
    gap: 8px;
  }

  .ranking-meta {
    display: none;
  }

  .segmented {
    width: calc(100% - 24px);
    margin-inline: 12px;
    grid-auto-flow: column;
    grid-auto-columns: 58px;
    grid-template-columns: none;
    overflow-x: auto;
  }

  .ball-row {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    padding: 14px;
  }

  .special-number-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding: 14px;
  }

  .strategy-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 14px;
  }

  .evaluation-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .evaluation-metrics article:nth-child(2) {
    border-right: 0;
  }

  .evaluation-metrics article:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .ball {
    min-height: 106px;
  }

  .history-toolbar {
    padding: 14px;
  }

  .number-tags {
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }

  .pagination-bar {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
    padding: 14px;
  }

  .pagination-controls {
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .page-numbers {
    order: 4;
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 520px) {
  .button {
    padding-inline: 12px;
  }

  .heading-copy h1 {
    font-size: 25px;
  }

  .notice-strip {
    align-items: flex-start;
  }

  .notice-strip > span:last-child {
    line-height: 1.55;
  }

  .metric-card strong {
    font-size: 23px;
  }

  .panel-header {
    padding-inline: 16px;
  }

  .model-status {
    display: none;
  }

  .ranking-list {
    padding-inline: 14px;
  }

  .ball-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .special-number-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .strategy-grid {
    grid-template-columns: 1fr;
  }

  .evaluation-metrics article {
    padding: 15px 16px;
  }

  .evaluation-metrics strong {
    font-size: 21px;
  }

  .latest-panel .panel-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .ball-circle {
    width: 49px;
    height: 49px;
    font-size: 18px;
  }

  .number-tags {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .history-meta {
    gap: 10px;
  }

  .page-number {
    display: none;
  }

  .page-number.active {
    display: inline-flex;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
