:root {
  color-scheme: light;
  --green: #12bd1e;
  --blue: #2d8fe4;
  --accent-start: #20a477;
  --accent-end: #187fa2;
  --accent-dark: #126d83;
  --accent-line: #b9dcd5;
  --accent-soft: #f1f9f7;
  --ink: #151515;
  --muted: #6d6d6d;
  --line: #e7e7e7;
  --panel: #ffffff;
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: #f3f3f3; }
body { margin: 0; color: var(--ink); background: #f3f3f3; }
button, a { font: inherit; }
button { cursor: pointer; }

.site-shell {
  width: min(100%, 800px);
  min-width: 320px;
  min-height: 100vh;
  margin: 0 auto;
  overflow: hidden;
  background: var(--panel);
  box-shadow: 0 0 22px rgba(0, 0, 0, .08);
}

.hero-module img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1280 / 333;
  object-fit: cover;
}

.navigation-module {
  padding: 12px 10px 10px;
  border-bottom: 8px solid #e4efed;
  background: linear-gradient(135deg, #f8fcfb 0%, #edf7f5 100%);
}
.navigation-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px 10px; }
.navigation-link {
  display: flex;
  min-width: 0;
  min-height: 30px;
  align-items: center;
  justify-content: center;
  padding: 5px 4px;
  overflow: hidden;
  border: 1px solid #218d8d;
  border-radius: 3px;
  color: #fff;
  background: linear-gradient(120deg, var(--accent-start) 0%, var(--accent-end) 100%);
  box-shadow: none;
  font-size: 14px;
  line-height: 1.15;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.navigation-link:hover, .navigation-link:focus-visible {
  color: #fff;
  background: linear-gradient(120deg, #178c69 0%, var(--accent-dark) 100%);
  outline: 2px solid #8ed4c6;
  outline-offset: 1px;
}

.draw-module { padding: 12px 10px 14px; border-bottom: 8px solid #f5f5f5; }
.lottery-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.lottery-tab {
  min-height: 34px;
  border: 0;
  border-radius: 5px;
  color: #111;
  background: #ededed;
  font-weight: 700;
}
.lottery-tab.is-active { color: #fff; background: var(--green); }
.lottery-tab:focus-visible { outline: 3px solid rgba(18, 189, 30, .35); outline-offset: 2px; }

.draw-summary { margin-top: 8px; border: 1px solid #e5e5e5; background: #fff; }
.draw-heading-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  min-height: 40px;
  padding: 6px 9px;
  font-size: 14px;
}
.history-toggle { justify-self: end; padding: 4px 0; color: #00a51a; text-decoration: none; }
.history-toggle:hover, .history-toggle:focus-visible { color: #087a19; text-decoration: underline; }

.number-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; padding: 10px 9px 8px; }
.number-card {
  position: relative;
  min-width: 0;
  padding: 7px 3px 5px;
  border-radius: 6px;
  color: #fff;
  text-align: center;
}
.number-card.red { background: #ef252b; }
.number-card.blue { background: var(--blue); }
.number-card.green { background: var(--green); }
.number-card.empty,
.number-card.pending { background: #afafaf; }
.number-card.pending .number-label { visibility: hidden; }
.number-card.special::before {
  content: "";
  position: absolute;
  top: 50%;
  left: -12px;
  width: 14px;
  height: 14px;
  transform: translateY(-50%);
  background:
    linear-gradient(#111, #111) center / 100% 2px no-repeat,
    linear-gradient(#111, #111) center / 2px 100% no-repeat;
}
.number-value { display: block; font-size: clamp(22px, 4.6vw, 34px); font-weight: 800; line-height: 1; }
.number-label {
  display: block;
  margin-top: 8px;
  padding: 4px 1px;
  overflow: hidden;
  border-radius: 2px;
  color: #111;
  background: #fff;
  font-size: clamp(12px, 2.8vw, 18px);
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
}
/* Text records: flat, compact rich text with the original red / yellow / blue palette. */
.content-module {
  padding: 2px 10px 16px;
  border-top: 1px solid #dddddd;
  background: #ffffff;
}
.content-card {
  scroll-margin-top: 8px;
  margin-top: 10px;
  overflow: hidden;
  border: 1px solid var(--accent-line);
  border-radius: 4px;
  background: #ffffff;
  box-shadow: none;
}
.content-break-image {
  margin: 10px 0 0;
  padding: 0;
  border: 0;
  background: transparent;
  line-height: 0;
}
.content-break-image-file {
  display: block;
  width: 100%;
  height: auto;
}
.content-title {
  margin: 0;
  padding: 6px 4px;
  border-bottom: 1px solid #aaaaaa;
  color: #ff0000;
  background: #ffff00;
  font-size: 21px;
  font-weight: 900;
  line-height: 1.45;
  text-align: center;
}
.content-body {
  color: #000000;
  background: #ffffff;
  text-align: center;
}
.content-records {
  --record-label: #0000ff;
  --record-picks: #ff0000;
  border-color: #aaaaaa;
  border-radius: 0;
}
article.content-records:nth-of-type(3n + 2) {
  --record-label: #ff0000;
  --record-picks: #0000ff;
}
article.content-records:nth-of-type(3n + 2) .content-title {
  color: #ffffff;
  background: #0000ff;
}
article.content-records:nth-of-type(3n) .content-title {
  color: #ffff00;
  background: #ff0000;
}
.content-records .content-body {
  padding: 0;
  font-family: Arial, "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.75;
}
.record-row {
  margin: 0;
  padding: 6px 5px;
  border-bottom: 1px dotted #bbbbbb;
  background: #ffffff;
}
.record-row:last-child { border-bottom: 0; }
.record-row strong { font-weight: 700; }
.record-issue { color: #000000; }
.record-label { color: var(--record-label); }
.record-picks {
  display: inline-block;
  max-width: 100%;
  color: var(--record-picks);
}
.record-row:first-child .record-picks {
  background: #ffff00;
}
.record-numbers {
  color: var(--record-picks);
  font-size: 1.06em;
  font-weight: 700;
  line-height: 1.7;
}
.record-number {
  display: inline;
  white-space: nowrap;
}
.record-data-highlight {
  color: #ff0000;
  background: #ffff00;
}
.record-outcome {
  display: inline-block;
  margin-left: .18em;
  white-space: nowrap;
}
.record-open { color: #000000; }
.record-result { color: #ff0000; }
.record-verdict {
  color: #ff0000;
  background: #ffff00;
}
.record-result[class*="-wrong"] { color: #0000ff; }
.record-row:first-child .record-result { color: #ff0000; }

/* Keep short records together, with no spread-out columns on wide screens. */
.seven-hit-meta,
.seven-hit-detail { display: inline; }
.winning-ten-label { margin: 0 2px; }
.triple-six-animals { color: #ff0000; }
.triple-six-numbers { color: #0000ff; }
.sixteen-code-numbers,
.winning-ten-numbers { margin: 0; }
.odd-even-three-choice.is-odd { color: #ff0000; }
.odd-even-three-choice.is-even { margin-left: .35em; color: #0000ff; }
.three-tail-plus { color: #000000; }
.one-wave-label,
.five-ten-label,
.hanging-twelve-label,
.golden-cicada-label { margin-right: .15em; }
.old-hu-eight-numbers { display: inline; }
.five-ten-precise { color: #ff0000; }

/* Explanatory animal tables remain plain text after the ten records. */
.yin-yang-legend,
.heaven-earth-guide,
.stroke-two-guide,
.home-wild-legends,
.three-kingdoms-legends {
  padding: 6px 4px;
  border-top: 1px solid #aaaaaa;
  background: #ffffff;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.8;
}
.yin-yang-rule,
.heaven-earth-rule,
.stroke-two-rule,
.home-wild-legend,
.three-kingdoms-legend {
  color: #0000ff;
}
.yin-yang-rule strong,
.heaven-earth-rule strong,
.stroke-two-rule strong,
.home-wild-legend strong,
.three-kingdoms-legend strong {
  margin-right: .3em;
  color: #ff0000;
}
.content-latest { color: #0000ff; font-weight: 700; }
.content-data-error {
  padding: 18px 6px;
  color: #ff0000;
  background: #ffffff;
  font-size: 18px;
  font-weight: 700;
  text-align: center;
}
.content-body.has-data-error > :not(.content-data-error) { display: none; }
.zodiac-image-body {
  display: block;
  padding: 0;
  border-left: 0;
  background: #ffffff;
  line-height: 0;
}
.zodiac-content-image {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}

.site-footer { padding: 12px 16px 20px; border-top: 1px solid var(--line); color: #777; font-size: 13px; line-height: 1.7; text-align: center; }
.site-disclaimer { margin: 8px 0 0; color: #555; }
.refresh-button {
  position: fixed;
  right: max(14px, calc((100vw - 800px) / 2 - 52px));
  bottom: 16%;
  z-index: 10;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: #08bc68;
  box-shadow: 0 5px 16px rgba(0, 0, 0, .18);
  font-size: 13px;
}
.refresh-button:disabled { opacity: .6; cursor: wait; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 520px) {
  .site-shell { min-width: 0; box-shadow: none; }
  .navigation-module, .draw-module { padding-right: 7px; padding-left: 7px; }
  .navigation-grid { gap: 5px; }
  .navigation-link { min-height: 28px; padding: 4px 2px; font-size: 12px; }
  .lottery-tab { min-height: 32px; font-size: 14px; }
  .draw-heading-row { font-size: 12px; }
  .number-grid { gap: 8px; padding-right: 5px; padding-left: 5px; }
  .number-card { padding: 6px 2px 4px; }
  .number-card.special::before {
    left: -7px;
    width: 6px;
    height: 6px;
    background-size: 100% 1px, 1px 100%;
  }
  .number-label { margin-top: 6px; padding: 3px 0; font-size: 11px; }
  .content-module { padding-right: 5px; padding-left: 5px; }
  .content-records { margin-top: 8px; }
  .content-title { padding: 5px 3px; font-size: 19px; }
  .content-records .content-body { font-size: 16px; line-height: 1.7; }
  .record-row { padding: 6px 3px; }
  .record-numbers { font-size: 1em; }
  .seven-hit-meta { display: block; }
  .yin-yang-legend,
  .heaven-earth-guide,
  .stroke-two-guide,
  .home-wild-legends,
  .three-kingdoms-legends { font-size: 15px; }
  .site-footer { padding-right: 70px; }
  .refresh-button { right: 10px; bottom: 11%; width: 44px; height: 44px; }
}

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
