:root {
  --site-red: #cc2c2c;
  --site-red-dark: #a82a2a;
  --ink: #242b28;
  --muted: #53605a;
  --line: #dbe5df;
  --soft: #f4faf6;
  color: var(--ink);
  background: #edfcf6;
  font: 14px/1.45 "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, select { font: inherit; }
button, select:not(:disabled) { cursor: pointer; }
a:focus-visible, button:focus-visible, select:focus-visible, input:focus-visible, summary:focus-visible {
  outline: 2px solid var(--site-red-dark);
  outline-offset: 2px;
}

.page {
  width: min(100%, 800px);
  min-height: 100vh;
  margin-inline: auto;
  background: #fff;
}

.masthead {
  display: grid;
  min-height: 45px;
  grid-template-columns: 46px minmax(0, 1fr) 46px;
  place-items: center;
  color: #fff;
  background: var(--site-red);
}

.masthead h1 { margin: 0; font-size: 19px; font-weight: 700; letter-spacing: .06em; }
.masthead a {
  display: grid;
  width: 100%;
  min-height: 45px;
  place-items: center;
  color: inherit;
  font: 23px/1 "Segoe UI Symbol", sans-serif;
  text-decoration: none;
}
.masthead a:hover { background: #a62a2a; }
.masthead a:focus-visible { outline-color: #fff; outline-offset: -4px; }

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

.view-nav a {
  display: flex;
  min-width: 0;
  min-height: 64px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 3px 0;
  border-bottom: 2px solid transparent;
  color: var(--ink);
  font-size: clamp(12px, 3.8vw, 14px);
  text-decoration: none;
  white-space: nowrap;
}

.view-nav a + a { border-left: 1px solid #eef1ef; }
.view-nav [aria-current] { border-bottom-color: var(--site-red); color: var(--site-red-dark); font-weight: 700; }
.view-nav a:hover, .view-nav [aria-current] { background: #fff6f6; }
.view-nav span {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 9px;
  color: var(--site-red-dark);
  background: #f9eeee;
  font: 18px/1 "Segoe UI Symbol", sans-serif;
}
.view-nav [aria-current] span { color: #fff; background: var(--site-red); }

.filter-panel { padding: 7px 8px; border-bottom: 1px solid var(--line); background: var(--soft); }
.region-nav, .filters {
  display: grid;
  border: 1px solid #cbd9d0;
  border-radius: 4px;
  background: #fff;
}
.region-nav { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 6px; }
.region-nav a, .filters > * {
  display: flex;
  min-width: 0;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.region-nav a + a, .filters > * + * { border-left: 1px solid #dce6df; }
.region-nav a:first-child { border-radius: 3px 0 0 3px; }
.region-nav a:last-child { border-radius: 0 3px 3px 0; }
.region-nav a { font-weight: 600; }
.region-nav a:hover, .filter-link:hover { background: #fff6f6; }
.region-nav [aria-current], .region-nav [aria-current]:hover { color: #fff; background: var(--site-red); }
.region-nav a:focus-visible, .filters a:focus-visible, .filters select:focus-visible { outline-offset: -3px; }

.filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.filters[data-layout="history"] {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.08fr) minmax(0, 1.27fr);
}
.filters select {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  padding: 0 2px;
  border: 0;
  border-radius: 3px;
  color: inherit;
  background: transparent;
  text-align: center;
}
.order-filter { gap: 4px; cursor: pointer; }
.order-filter input { width: 13px; height: 13px; margin: 0; accent-color: var(--site-red); }
.filter-link { color: var(--site-red-dark); font-weight: 650; }
#retry {
  min-height: 34px;
  padding: 3px 5px;
  border: 1px solid #cbd9d0;
  border-radius: 4px;
  color: var(--ink);
  background: #fff;
}

.status, .load-error { margin: 0; padding: 10px; }
.load-error { color: var(--site-red-dark); }
.load-error p { margin: 0 0 6px; }

.view-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 2px 12px;
  padding: 8px 10px;
  color: var(--muted);
}
.view-summary h2 { margin: 0; color: var(--ink); font-size: 15px; }
.view-summary p { margin: 0; font-size: 13px; }

.history-grid {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.draw-column { width: clamp(68px, 17vw, 130px); }
.separator-column { width: clamp(13px, 4vw, 24px); }
.history-grid th, .history-grid td { padding: 5px 0; border-bottom: 1px solid #e7ede9; }
.history-grid thead th { height: 0; padding: 0; border: 0; }
.history-grid tbody tr:nth-child(even) { background: #fafcfb; }
.history-grid .special-cell { background: #fff8f5; }
.draw-separator { color: var(--muted); font-size: 18px; font-weight: 600; }
.draw-label { color: var(--ink); line-height: 1.25; }
.draw-label time, .draw-label .period { display: block; white-space: nowrap; }
.draw-label time { color: var(--muted); font-size: 11px; font-weight: 400; }
.draw-label .period { margin-top: 2px; font-size: 14px; font-weight: 750; }

.ball-chip { display: inline-grid; justify-items: center; gap: 1px; vertical-align: middle; }
.ball-surface {
  display: grid;
  width: clamp(23px, 7.5vw, 32px);
  aspect-ratio: 1;
  place-items: center;
  border-radius: 50%;
  color: #1d2320;
  background: var(--ball-art, #ecefec) center / contain no-repeat;
  font-size: clamp(13px, 3.8vw, 16px);
  font-weight: 750;
  line-height: 1;
}
.ball-surface.ball-red { --ball-art: url('/static/2/images/ball-red.png'); }
.ball-surface.ball-blue { --ball-art: url('/static/2/images/ball-blue.png'); }
.ball-surface.ball-green { --ball-art: url('/static/2/images/ball-green.png'); }
.ball-meta { color: var(--muted); font-size: clamp(10px, 3.2vw, 12px); line-height: 1.2; white-space: nowrap; }

.attribute-note { margin: 0; padding: 0 10px 8px; color: var(--muted); font-size: 13px; }
.zodiac-list { margin: 0; }
.zodiac-row { display: grid; grid-template-columns: 48px minmax(0, 1fr); border-top: 1px solid var(--line); }
.zodiac-row dt { display: grid; margin: 0; place-items: center; background: #eef4f0; font-weight: 700; }
.zodiac-row dd {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: start;
  justify-items: center;
  gap: 5px;
  margin: 0;
  padding: 5px;
}
.zodiac-row:last-child { border-bottom: 1px solid var(--line); }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (max-width: 360px) {
  .view-nav a { min-height: 59px; }
  .view-nav span { width: 27px; height: 27px; border-radius: 7px; font-size: 16px; }
  .filters { font-size: 12px; }
  .draw-label time { font-size: 10px; }
}
