:root {
  color-scheme: light;
  --ink: #161922;
  --muted: #6d7280;
  --line: #d9dee8;
  --paper: #ffffff;
  --surface: #f5f7fb;
  --blue: #1a3d96;
  --green: #147c45;
  --red: #c82231;
  --gold: #f1b91d;
}

* {
  box-sizing: border-box;
}

[v-cloak] {
  display: none;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--surface);
  color: var(--ink);
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

html {
  scroll-behavior: smooth;
}

body {
  display: flex;
  justify-content: center;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

#app,
.admin-page,
.history-page {
  width: min(100%, 720px);
  min-height: 100vh;
  background: #fff;
  box-shadow: 0 0 18px rgba(20, 30, 60, 0.1);
}

.top-banner {
  width: 100%;
  aspect-ratio: 800 / 196;
  background: #fff;
  overflow: hidden;
}

.top-banner img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 16px 14px;
  background: #102b6f;
  color: #fff;
}

.site-header h1 {
  margin: 2px 0 0;
  font-size: 25px;
  letter-spacing: 0;
}

.eyebrow {
  margin: 0;
  color: inherit;
  opacity: 0.72;
  font-size: 12px;
  text-transform: uppercase;
}

.admin-link,
.ghost-btn,
.danger-btn,
.year-form button,
.admin-form button,
.stream-actions a {
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  padding: 0 13px;
  background: var(--gold);
  color: #1d2440;
  font-weight: 700;
  cursor: pointer;
}

.ghost-btn:disabled,
.danger-btn:disabled,
.admin-form button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.top-nav {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: #0b1f51;
}

.top-nav a {
  padding: 11px 4px;
  background: var(--blue);
  color: #fff;
  text-align: center;
  font-size: 14px;
}

.feature-links {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px 8px;
  padding: 12px 10px 8px;
  background: #fff;
}

.feature-links a {
  display: grid;
  place-items: center;
  min-width: 0;
  height: 36px;
  border-radius: 999px;
  background: #1261d7;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}

.feature-links a:hover,
.feature-links a:focus-visible,
.feature-links a:active {
  background: #df1747;
}

.feature-links a.pending {
  background: #6f86b8;
}

.resource-strip {
  margin: 0 10px 8px;
  border: 1px solid #cfd4dc;
  background: #fff;
}

.resource-strip-head {
  display: grid;
  min-height: 36px;
  place-items: center;
  background: #008000;
  color: #fff200;
  font-size: 18px;
  font-weight: 900;
  line-height: 1.2;
  text-align: center;
}

.resource-strip-body {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 5px 10px;
  color: #000;
  font-size: 22px;
  font-weight: 900;
  line-height: 1.1;
  text-align: center;
}

.resource-arrow {
  display: inline-block;
  font-size: 31px;
  letter-spacing: -6px;
  white-space: nowrap;
}

.resource-arrow-one,
.resource-arrow-two {
  display: inline-block;
}

.resource-arrow-one {
  animation: resource-arrow-one-pulse 0.65s steps(1, end) infinite;
}

.resource-arrow-two {
  animation: resource-arrow-two-pulse 0.65s steps(1, end) infinite;
}

@keyframes resource-arrow-one-pulse {
  0%,
  49% {
    color: #ff1d13;
    text-shadow: 2px 0 0 rgba(255, 70, 50, 0.35);
  }

  50%,
  100% {
    color: #ff9a8e;
    text-shadow: 2px 0 0 rgba(255, 185, 175, 0.42);
  }
}

@keyframes resource-arrow-two-pulse {
  0%,
  49% {
    color: #ff9a8e;
    text-shadow: 2px 0 0 rgba(255, 185, 175, 0.42);
  }

  50%,
  100% {
    color: #ff1d13;
    text-shadow: 2px 0 0 rgba(255, 70, 50, 0.35);
  }
}

main {
  padding: 14px 12px 28px;
}

.lottery-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: -6px 0 10px;
  border: 1px solid #1d74ff;
  border-bottom: 2px solid #1d74ff;
  background: #fff;
}

.lottery-tabs button {
  min-width: 0;
  min-height: 38px;
  border: 0;
  border-right: 1px solid #bcc2ca;
  border-radius: 0;
  background: #fff;
  color: #9fa5ad;
  font-weight: 800;
  cursor: pointer;
}

.lottery-tabs button:last-child {
  border-right: 0;
}

.lottery-tabs button.active {
  color: #006eff;
  background: #fff;
}

.panel {
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  padding: 14px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.section-head h2,
.panel h2 {
  margin: 2px 0 0;
  font-size: 20px;
  letter-spacing: 0;
}

.history-shortcut {
  flex: 0 0 auto;
  color: #ff1616;
  font-size: 16px;
  font-weight: 800;
}

.history-shortcut:hover,
.history-shortcut:focus-visible {
  text-decoration: underline;
}

.draw-topline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  margin-bottom: 7px;
}

.draw-current-issue {
  justify-self: start;
  color: #000;
  font-size: 17px;
  line-height: 1.1;
}

.draw-current-issue span,
.next-draw-line span {
  color: #f00;
}

.draw-countdown {
  justify-self: center;
  color: #111;
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.draw-topline .history-shortcut {
  justify-self: end;
}

.badge {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 6px 10px;
  background: #e8f4ec;
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
}

.badge.warn {
  background: #fff7df;
  color: #946800;
}

.badge.manual {
  background: #fdebee;
  color: var(--red);
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 13px;
}

.balls,
.drawing-message {
  --draw-ball-size: clamp(44px, calc((100vw - 116px) / 7), 86px);
  --draw-plus-width: 22px;

  display: grid;
  grid-template-columns: repeat(6, var(--draw-ball-size)) var(--draw-plus-width) var(--draw-ball-size);
  align-items: start;
  justify-content: center;
  gap: 6px;
}

.balls.compact {
  gap: 6px;
}

.drawing-message {
  min-height: calc(var(--draw-ball-size) + 28px);
}

.drawing-message-char {
  display: grid;
  width: var(--draw-ball-size);
  height: var(--draw-ball-size);
  place-items: center;
  background: #d1d1d1;
  color: #000;
  font-size: clamp(29px, 6vw, 43px);
  font-weight: 900;
  line-height: 1;
}

.drawing-message-plus {
  display: grid;
  width: var(--draw-plus-width);
  height: var(--draw-ball-size);
  place-items: center;
  color: #f00;
  font-size: clamp(23px, 4vw, 31px);
  font-weight: 800;
  line-height: 1;
}

.ball-item {
  min-width: 0;
  text-align: center;
}

.draw-plus {
  display: grid;
  width: var(--draw-plus-width);
  height: var(--draw-ball-size);
  place-items: center;
  color: #f00;
  font-size: clamp(23px, 4vw, 31px);
  font-weight: 800;
  line-height: 1;
}

.ball {
  display: grid;
  place-items: center;
  width: var(--draw-ball-size);
  height: var(--draw-ball-size);
  margin: 0 auto;
  border-radius: 0;
  color: #fff;
  font-size: clamp(29px, 6vw, 43px);
  font-weight: 900;
  line-height: 1;
}

.zodiac {
  margin-top: 6px;
  color: #000;
  font-size: 18px;
  font-weight: 500;
  line-height: 1.1;
}

.draw-footer-row {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}

.next-draw-line {
  flex: 1 1 auto;
  min-width: 0;
  color: #111;
  font-size: 16px;
  line-height: 1.4;
}

.next-draw-line.muted {
  color: var(--muted);
}

.refresh-btn {
  min-height: 30px;
  border: 0;
  border-radius: 5px;
  padding: 0 9px;
  background: #ff9f00;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.refresh-btn:hover,
.refresh-btn:focus-visible {
  background: #f08d00;
}

.wave-red {
  background: var(--red);
}

.wave-blue {
  background: #2367bd;
}

.wave-green {
  background: var(--green);
}

.wave-gray {
  background: #767d8f;
}

.ball.wave-red {
  background: #f00;
}

.ball.wave-blue {
  background: #00f;
}

.ball.wave-green {
  background: #008000;
}

.source,
.error {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

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

.promo-band {
  margin-bottom: 14px;
  min-height: 150px;
  border: 1px solid #b9c6d9;
  border-radius: 8px;
  padding: 20px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.7)),
    repeating-linear-gradient(45deg, #dbe9ff 0 12px, #f8fbff 12px 24px);
}

.promo-title {
  color: #102b6f;
  font-size: 24px;
  font-weight: 900;
}

.promo-copy {
  max-width: 390px;
  margin-top: 8px;
  color: #40506f;
  line-height: 1.6;
}

.content-section {
  margin-bottom: 14px;
  background: #fff;
}

.zodiac-reference {
  padding: 0 12px 18px;
  background: #fff;
}

.zodiac-reference-button {
  display: block;
  width: min(100%, 580px);
  margin: 0 auto;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.zodiac-reference-button:focus-visible {
  outline: 3px solid #1d74ff;
  outline-offset: 3px;
}

.zodiac-reference-image {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid #d4d4d4;
  background: #fff;
}

.content-promo-note {
  display: grid;
  gap: 2px;
  min-height: 50px;
  place-items: center;
  padding: 7px 10px;
  color: #ff00ff;
  font-family: "Microsoft YaHei", "SimSun", sans-serif;
  font-size: 17px;
  font-weight: 900;
  line-height: 1.2;
  text-align: center;
}

.content-promo-note span {
  display: inline-block;
  background: #000;
  padding: 0 4px;
}

.content-promo-note strong {
  color: #00f;
  font-size: 15px;
}

.content-card {
  margin-bottom: 10px;
  border: 1px solid #8b8b8b;
  background: #fff;
  font-family: "Microsoft YaHei", "SimSun", sans-serif;
  scroll-margin-top: 8px;
}

.content-card-title {
  display: grid;
  min-height: 56px;
  place-items: center;
  border: 7px double #00f;
  background: #00f;
  color: #ff0;
  font-size: 20px;
  font-weight: 900;
  line-height: 1.15;
  text-align: center;
}

.content-card-subtitle {
  min-height: 28px;
  padding: 3px 8px;
  background: #0c35f5;
  color: #fff;
  font-size: 20px;
  font-weight: 900;
  line-height: 1.1;
  text-align: center;
}

.content-card-pending-source,
.content-card-missing-source {
  border-color: #bfc8da;
  background: #f8fafc;
}

.content-card-pending-source .content-card-title,
.content-card-missing-source .content-card-title {
  min-height: 42px;
  border-color: #6f86b8;
  background: #6f86b8;
  color: #fff;
}

.pending-source-note {
  margin: 0;
  padding: 18px 12px;
  color: #59657a;
  font-size: 16px;
  font-weight: 700;
  text-align: center;
}

.content-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  background: #fff;
}

.content-table th,
.content-table td {
  border: 1px solid #9a9a9a;
  padding: 8px 7px;
  vertical-align: middle;
}

.content-table th {
  width: 18%;
  color: #00f;
  font-size: 17px;
  font-weight: 900;
  text-align: center;
}

.content-table td {
  color: #34495e;
  font-size: 19px;
  font-weight: 900;
  line-height: 1.55;
  text-align: left;
}

.formula-seven-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  background: #fff;
  color: #f00;
  font-family: "Microsoft YaHei", "SimSun", sans-serif;
}

.formula-seven-table th,
.formula-seven-table td {
  border: 1px solid #00f;
  padding: 3px 5px;
  text-align: center;
  vertical-align: middle;
}

.formula-seven-table th {
  width: 12%;
  color: #f00;
  font-size: 16px;
  font-weight: 900;
  white-space: nowrap;
}

.formula-seven-table td:nth-child(2) {
  color: #f00;
  font-size: 16px;
  font-weight: 900;
  word-spacing: 2px;
}

.formula-seven-table td:nth-child(3) {
  width: 16%;
  color: #f00;
  font-size: 16px;
  font-weight: 900;
  white-space: nowrap;
}

.formula-seven-prefix {
  margin-right: 4px;
  color: #000;
  font-weight: 900;
}

.formula-seven-table span {
  display: inline-block;
  margin: 0 2px;
}

.formula-seven-table span.hit {
  background: #ff0;
}

.formula-seven-table td.hit {
  color: #f00;
}

.formula-seven-table td.miss {
  color: #000;
}

.content-card-killer-table .content-card-title {
  min-height: 42px;
  border: 1px solid #00f;
  background: #00f;
  color: #ff0;
  font-size: 20px;
}

.killer-source-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  background: #fff;
  color: #f00;
  font-family: "Microsoft YaHei", "SimSun", sans-serif;
}

.killer-source-table th,
.killer-source-table td {
  border: 1px solid #00f;
  padding: 3px 5px;
  text-align: center;
  vertical-align: middle;
}

.killer-source-table th {
  width: 11%;
  color: #f00;
  font-size: 16px;
  font-weight: 900;
  white-space: nowrap;
}

.killer-source-table td:nth-child(2) {
  color: #f00;
  font-size: 16px;
  font-weight: 900;
  word-spacing: 2px;
}

.killer-source-table td:nth-child(3) {
  width: 14%;
  color: #f00;
  font-size: 16px;
  font-weight: 900;
  white-space: nowrap;
}

.killer-source-table strong {
  margin-right: 4px;
  color: #000;
  font-weight: 900;
}

.killer-source-table span {
  display: inline-block;
  margin: 0 2px;
}

.killer-source-table span.hit {
  background: #ff0;
}

.killer-source-table td.hit {
  color: #f00;
}

.killer-source-table td.miss {
  color: #000;
}

.content-card-featured-table .content-card-title {
  min-height: 42px;
  border: 1px solid #00f;
  background: #00f;
  color: #ff0;
  font-size: 20px;
}

.featured-source-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  background: #fff;
  color: #f00;
  font-family: "Microsoft YaHei", "SimSun", sans-serif;
}

.featured-source-table th,
.featured-source-table td {
  border: 1px solid #00f;
  padding: 3px 5px;
  text-align: center;
  vertical-align: middle;
}

.featured-source-table th {
  width: 9%;
  color: #f00;
  font-size: 16px;
  font-weight: 900;
  white-space: nowrap;
}

.featured-source-table td:nth-child(2) {
  width: 39%;
}

.featured-source-table td:nth-child(3) {
  width: 40%;
}

.featured-source-table td:nth-child(2),
.featured-source-table td:nth-child(3),
.featured-source-table td:nth-child(4) {
  color: #f00;
  font-size: 16px;
  font-weight: 900;
}

.featured-source-table td:nth-child(4) {
  width: 12%;
  white-space: nowrap;
}

.featured-source-table strong {
  margin-right: 4px;
  color: #000;
  font-weight: 900;
}

.featured-source-table span {
  display: inline-block;
  margin: 0 2px;
}

.featured-source-table span.hit {
  background: #ff0;
}

.featured-source-table td.hit {
  color: #f00;
}

.featured-source-table td.miss {
  color: #000;
}

.content-card-source-simple-table .content-card-title {
  min-height: 42px;
  border: 1px solid #00f;
  background: #00f;
  color: #ff0;
  font-size: 20px;
}

.source-simple-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  background: #fff;
  color: #f00;
  font-family: "Microsoft YaHei", "SimSun", sans-serif;
}

.source-simple-table th,
.source-simple-table td {
  border: 1px solid #00f;
  padding: 3px 5px;
  text-align: center;
  vertical-align: middle;
}

.source-simple-table th {
  width: 13%;
  color: #f00;
  font-size: 16px;
  font-weight: 900;
  white-space: nowrap;
}

.source-simple-table td:nth-child(2) {
  color: #f00;
  font-size: 16px;
  font-weight: 900;
  word-spacing: 2px;
}

.source-simple-table td:nth-child(3) {
  width: 15%;
  color: #f00;
  font-size: 16px;
  font-weight: 900;
  white-space: nowrap;
}

.source-simple-table strong {
  color: #000;
  font-weight: 900;
}

.source-simple-table span {
  display: inline-block;
  margin: 0 2px;
}

.source-simple-table .source-row-yjzy span {
  margin: 0;
  color: #000;
}

.source-simple-table .source-row-yjzy span.zodiac-char {
  color: #f00;
}

.source-simple-table span.hit {
  background: #ff0;
}

.source-simple-table td.hit {
  color: #f00;
}

.source-simple-table td.miss {
  color: #000;
}

.source-simple-table .source-row-period-plan-numbers th {
  font-size: 14px;
}

.source-simple-table .source-row-period-plan-numbers td:nth-child(2) {
  font-size: 15px;
  word-spacing: 1px;
}

.source-simple-label {
  margin-right: 4px;
}

.content-number {
  display: inline-block;
  margin-right: 7px;
  color: #f00;
  font-size: 18px;
  white-space: nowrap;
}

.content-zodiac {
  display: inline-block;
  margin-right: 3px;
  color: #34495e;
  font-size: 22px;
  white-space: nowrap;
}

.content-result {
  display: inline-block;
  margin-left: 4px;
  color: #333;
  font-size: 16px;
  white-space: nowrap;
}

.content-result.hit {
  color: #f00;
}

.content-result.miss {
  color: #555;
}

.content-line-list {
  display: grid;
  background: #fff;
  border-top: 1px solid #8b8b8b;
}

.content-line-item {
  display: grid;
  grid-template-columns: minmax(92px, auto) minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  border-bottom: 1px solid #c7c7c7;
  padding: 5px 8px;
  color: #17324f;
  font-size: 16px;
  font-weight: 900;
  line-height: 1.25;
}

.content-line-item strong {
  min-width: 0;
  color: #e60000;
  word-break: break-word;
}

.content-line-item em {
  color: #222;
  font-style: normal;
  white-space: nowrap;
}

.content-line-item.hit em {
  color: #f00;
}

.content-line-item.miss em {
  color: #333;
}

.content-line-list.killer .content-line-item strong {
  color: #0050c8;
}

.content-gallery-block {
  border-top: 1px solid #8b8b8b;
  background: #fff;
}

.content-source-image-wrap {
  padding: 8px;
  border-bottom: 1px solid #cfcfcf;
  background: #f6f6f6;
}

.content-source-image-button {
  display: block;
  width: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: zoom-in;
}

.content-source-image-button:focus-visible {
  outline: 3px solid #1d74ff;
  outline-offset: 3px;
}

.content-source-image {
  display: block;
  width: 100%;
  max-height: 420px;
  object-fit: contain;
  background: #fff;
}

body.image-preview-open {
  overflow: hidden;
}

.image-preview-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 48px 8px 18px;
  background: rgba(0, 0, 0, 0.88);
}

.image-preview-img {
  display: block;
  max-width: 96vw;
  max-height: 90vh;
  object-fit: contain;
  background: #fff;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
}

.image-preview-close {
  position: fixed;
  top: 12px;
  right: 12px;
  min-height: 36px;
  border: 0;
  border-radius: 999px;
  padding: 0 15px;
  background: #fff;
  color: #111;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
}

.content-source-lines {
  padding: 10px 10px 8px;
  border-bottom: 1px solid #cfcfcf;
  background: #fff;
  color: #0d2f56;
  font-size: 23px;
  font-weight: 900;
  line-height: 1.4;
}

.content-source-lines p {
  margin: 0 0 4px;
}

.content-source-lines p:last-child {
  margin-bottom: 0;
}

.content-gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: #b8b8b8;
}

.content-gallery-grid a {
  display: grid;
  gap: 2px;
  min-height: 44px;
  place-items: center;
  padding: 5px 3px;
  background: #fff;
  color: #f00;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.1;
  text-align: center;
}

.content-gallery-grid span {
  display: inline;
  background: #ff0;
}

.content-gallery-grid small {
  color: #1356c8;
  font-size: 11px;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.quick-grid a {
  display: grid;
  min-height: 45px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f9fbff;
  color: #17306f;
  font-weight: 700;
}

.stream-actions,
.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.stream-actions a {
  display: inline-grid;
  place-items: center;
  background: var(--blue);
  color: #fff;
}

.empty-note {
  display: inline-grid;
  min-height: 38px;
  place-items: center;
  border-radius: 6px;
  padding: 0 13px;
  background: #eef2f8;
  color: var(--muted);
  font-weight: 700;
}

.year-form {
  display: flex;
  gap: 7px;
}

.year-form input {
  width: 76px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 8px;
}

.history-list {
  display: grid;
  gap: 9px;
}

.history-item {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px;
  background: #fbfcff;
}

.history-title {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.history-title strong {
  color: var(--ink);
  font-size: 14px;
}

.mini-balls {
  display: flex;
  gap: 5px;
  margin-top: 9px;
}

.mini-balls span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.info-panel ul {
  margin: 10px 0 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.8;
}

.footer {
  padding: 18px 12px 30px;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
}

.history-body {
  align-items: flex-start;
  background: #82cbe8;
}

.history-page {
  width: min(100%, 980px);
  box-shadow: none;
}

.history-topbar {
  display: flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #000;
  color: #fff;
  font-size: 14px;
  text-align: center;
}

.history-topbar strong,
.history-topbar a {
  color: #1bb6ff;
}

.history-shell {
  overflow-x: auto;
  padding: 0;
}

.history-years {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  min-width: 980px;
  background: #fff;
}

.history-years button {
  min-height: 58px;
  border: 0;
  background: #fff;
  color: #333;
  font-size: 29px;
  font-weight: 800;
  cursor: pointer;
}

.history-years button.active {
  color: #0875ff;
}

.history-mode-row {
  display: grid;
  grid-template-columns: 1fr repeat(3, auto);
  align-items: center;
  gap: 28px;
  min-width: 980px;
  min-height: 58px;
  padding: 0 62px;
  background: #fff;
  color: #000;
  font-size: 25px;
  font-weight: 900;
}

.history-mode-row > span {
  color: #ff6500;
}

.history-mode-row label {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
}

.history-state {
  padding: 28px;
  background: #fff;
  color: #333;
  font-size: 20px;
  font-weight: 800;
  text-align: center;
}

.history-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  table-layout: fixed;
  background: #fff;
  color: #000;
}

.history-table th {
  height: 48px;
  background: #eee;
  font-size: 27px;
  font-weight: 900;
}

.history-table th:nth-child(1) {
  width: 20%;
}

.history-table th:nth-child(2) {
  width: 18%;
  background: #f5ed91;
}

.history-table th:nth-child(3) {
  width: 51%;
}

.history-table th:nth-child(4) {
  width: 11%;
  background: #f5ed91;
}

.history-table td {
  height: 108px;
  border-bottom: 1px solid #e0e0e0;
  text-align: center;
  vertical-align: middle;
}

.history-table td:nth-child(2),
.history-table td:nth-child(4) {
  background: #f5ed91;
}

.history-row {
  cursor: pointer;
}

.history-row:focus {
  outline: none;
}

.history-row:focus-visible td:first-child,
.history-row:focus-visible td:nth-child(3),
.history-row:hover td:first-child,
.history-row:hover td:nth-child(3),
.history-row.is-row-active td:first-child,
.history-row.is-row-active td:nth-child(3) {
  background: #f5ed91;
}

.history-date-cell strong {
  display: block;
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  font-size: 27px;
  font-weight: 900;
  line-height: 1.1;
  transform: translateY(-50%);
}

.history-date-cell {
  position: relative;
}

.history-row.is-row-active .history-date-cell strong,
.history-row:hover .history-date-cell strong,
.history-row:focus-visible .history-date-cell strong {
  top: 10px;
  transform: none;
}

.history-date-detail {
  display: block;
  position: absolute;
  top: 42px;
  left: 0;
  right: 0;
  visibility: hidden;
  opacity: 0;
  font-size: 20px;
  font-weight: 500;
  line-height: 1.15;
}

.history-row.is-row-active .history-date-detail,
.history-row:hover .history-date-detail,
.history-row:focus-visible .history-date-detail {
  visibility: visible;
  opacity: 1;
}

.history-expect-cell {
  font-size: 27px;
  font-weight: 900;
}

.history-code-row {
  display: flex;
  justify-content: center;
  gap: 38px;
}

.history-code {
  display: inline-grid;
  width: 44px;
  min-height: 82px;
  grid-template-rows: 36px 40px;
  place-items: stretch center;
  border: 3px solid #888;
  background: #fff;
  color: #000;
  vertical-align: middle;
}

.history-code-number {
  display: grid;
  width: 100%;
  place-items: center;
  color: #fff;
  font-size: 27px;
  font-weight: 900;
  line-height: 1;
}

.history-code-zodiac {
  display: grid;
  width: 100%;
  place-items: center;
  background: #fff;
  color: #000;
  font-size: 28px;
  font-weight: 900;
  line-height: 1;
}

.history-code.wave-red .history-code-number {
  background: #f00;
}

.history-code.wave-blue .history-code-number {
  background: #00f;
}

.history-code.wave-green .history-code-number {
  background: #008000;
}

.history-code.wave-gray .history-code-number {
  background: #777;
}

.history-code.mode-number {
  min-height: 44px;
  grid-template-rows: 38px;
}

.history-code.mode-zodiac {
  min-height: 44px;
  grid-template-rows: 38px;
}

.history-code.mode-zodiac .history-code-zodiac {
  font-size: 27px;
}

.history-special-cell .history-code {
  margin: 0 auto;
}

.admin-form {
  display: grid;
  gap: 12px;
}

.admin-form label {
  display: grid;
  gap: 6px;
  color: #303849;
  font-size: 14px;
  font-weight: 700;
}

.admin-form input,
.admin-form select,
.admin-form textarea {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 10px;
  color: var(--ink);
  background: #fff;
}

.admin-form textarea {
  min-height: 78px;
  padding: 10px;
  resize: vertical;
}

.checkbox-row {
  grid-template-columns: 22px 1fr;
  align-items: center;
}

.checkbox-row input {
  min-height: auto;
}

.danger-btn {
  background: #fdebee !important;
  color: var(--red) !important;
}

.source-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.source-list h3 {
  margin: 0;
  font-size: 18px;
}

.source-item {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
}

.source-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.source-item-head strong {
  color: var(--ink);
  font-size: 14px;
}

.source-item-head span {
  border-radius: 999px;
  padding: 3px 8px;
  background: #e8f6ef;
  color: #087a3b;
  font-weight: 800;
  white-space: nowrap;
}

.source-item-head span.pending {
  background: #f1f3f7;
  color: #6b7280;
}

.source-item p {
  margin: 0;
}

.source-lottery-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.source-lottery-grid div {
  display: grid;
  gap: 3px;
  min-width: 0;
  border: 1px solid #e5e9f1;
  border-radius: 6px;
  padding: 8px;
  background: #f8fafc;
}

.source-lottery-grid small {
  overflow-wrap: anywhere;
}

.log-list {
  display: grid;
  gap: 8px;
}

.log-item {
  display: grid;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 9px;
  color: var(--muted);
  font-size: 12px;
}

.log-item strong {
  color: var(--ink);
}

.private-record .admin-actions {
  margin-top: 6px;
}

.content-admin-list {
  margin-top: 12px;
}

@media (max-width: 440px) {
  .site-header h1 {
    font-size: 22px;
  }

  .section-head {
    align-items: center;
    flex-direction: row;
  }

  .draw-topline {
    gap: 6px;
  }

  .draw-current-issue,
  .history-shortcut {
    font-size: 15px;
  }

  .draw-countdown {
    font-size: 17px;
  }

  .balls,
  .drawing-message {
    --draw-ball-size: clamp(34px, calc((100vw - 97px) / 7), 48px);
    --draw-plus-width: 17px;

    grid-template-columns: repeat(6, var(--draw-ball-size)) var(--draw-plus-width) var(--draw-ball-size);
    justify-content: center;
    gap: 4px;
  }

  .drawing-message {
    min-height: calc(var(--draw-ball-size) + 24px);
  }

  .drawing-message-char {
    width: var(--draw-ball-size);
    height: var(--draw-ball-size);
    font-size: clamp(21px, 6vw, 29px);
  }

  .drawing-message-plus {
    font-size: 21px;
  }

  .ball {
    width: var(--draw-ball-size);
    height: var(--draw-ball-size);
    font-size: clamp(21px, 6vw, 29px);
  }

  .draw-plus {
    font-size: 21px;
  }

  .zodiac {
    margin-top: 5px;
    font-size: 16px;
  }

  .draw-footer-row {
    gap: 8px;
  }

  .next-draw-line {
    font-size: 15px;
  }

  .content-card-title {
    min-height: 48px;
    font-size: 18px;
  }

  .content-card-subtitle {
    font-size: 17px;
  }

  .content-table th {
    width: 22%;
    padding: 7px 5px;
    font-size: 15px;
  }

  .content-table td {
    padding: 7px 6px;
    font-size: 17px;
  }

  .formula-seven-table th {
    width: 15%;
    padding: 3px 2px;
    font-size: 16px;
  }

  .formula-seven-table td:nth-child(2) {
    padding: 3px 2px;
    font-size: 16px;
    word-spacing: 1px;
  }

  .formula-seven-table td:nth-child(3) {
    width: 18%;
    padding: 3px 2px;
    font-size: 16px;
  }

  .formula-seven-prefix {
    margin-right: 2px;
  }

  .formula-seven-table span {
    margin: 0 2px;
  }

  .content-card-killer-table .content-card-title {
    min-height: 38px;
    font-size: 18px;
  }

  .killer-source-table th {
    width: 15%;
    padding: 3px 2px;
    font-size: 16px;
  }

  .killer-source-table td:nth-child(2) {
    padding: 3px 2px;
    font-size: 16px;
    word-spacing: 1px;
  }

  .killer-source-table td:nth-child(3) {
    width: 18%;
    padding: 3px 2px;
    font-size: 16px;
  }

  .killer-source-table strong {
    margin-right: 2px;
  }

  .killer-source-table span {
    margin: 0 1px;
  }

  .content-card-featured-table .content-card-title {
    min-height: 38px;
    font-size: 18px;
  }

  .featured-source-table th {
    width: 13%;
    padding: 3px 2px;
    font-size: 14px;
  }

  .featured-source-table td:nth-child(2),
  .featured-source-table td:nth-child(3),
  .featured-source-table td:nth-child(4) {
    padding: 3px 2px;
    font-size: 14px;
  }

  .featured-source-table td:nth-child(2) {
    width: 33%;
  }

  .featured-source-table td:nth-child(3) {
    width: 38%;
  }

  .featured-source-table td:nth-child(4) {
    width: 16%;
  }

  .featured-source-table strong {
    margin-right: 1px;
  }

  .featured-source-table span {
    margin: 0 1px;
  }

  .content-card-source-simple-table .content-card-title {
    min-height: 38px;
    font-size: 18px;
  }

  .source-simple-table th {
    width: 15%;
    padding: 3px 2px;
    font-size: 14px;
  }

  .source-simple-table td:nth-child(2),
  .source-simple-table td:nth-child(3) {
    padding: 3px 2px;
    font-size: 14px;
  }

  .source-simple-table td:nth-child(3) {
    width: 18%;
  }

  .source-simple-table span {
    margin: 0 1px;
  }

  .source-simple-label {
    margin-right: 1px;
  }

  .content-number {
    margin-right: 5px;
    font-size: 16px;
  }

  .content-zodiac {
    font-size: 20px;
  }

  .content-line-item {
    grid-template-columns: 1fr auto;
    gap: 4px 7px;
    font-size: 14px;
  }

  .content-line-item strong {
    grid-column: 1 / -1;
    grid-row: 2;
  }

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

  .content-source-lines {
    font-size: 18px;
  }

  .quick-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .feature-links {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 5px 6px;
    padding: 9px 8px 7px;
  }

  .feature-links a {
    height: 24px;
    padding: 0 2px;
    font-size: 12px;
  }

  .resource-strip-head {
    min-height: 32px;
    font-size: 14px;
  }

  .resource-strip-body {
    min-height: 40px;
    font-size: 18px;
  }

  .resource-arrow {
    font-size: 26px;
  }
}
