:root {
  --blue: #315597;
  --blue-dark: #274986;
  --cyan: #12bfe0;
  --line: #e9edf4;
  --stripe: #f1f5fc;
  --text: #252b36;
  --muted: #8d95a5;
  --orange: #ff930d;
  --red: #e22c2f;
  --green: #8bcf32;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Arial, "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: #ffffff;
}

a {
  color: #0000aa;
}

.site-shell {
  width: min(1280px, 100%);
  margin: 0 auto;
  border-left: 1px solid #d8e0ef;
  border-right: 1px solid #d8e0ef;
  background: #fff;
}

.draw-header {
  display: grid;
  grid-template-columns: 1fr 1.15fr 1fr;
  align-items: center;
  min-height: 78px;
  border-bottom: 1px solid #d8e0ef;
}

.brand-block,
.result-strip,
.countdown {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 14px;
  border-right: 1px solid var(--line);
}

.countdown {
  border-right: 0;
  font-size: 18px;
}

.latest-line strong {
  color: #d7192a;
  letter-spacing: 1px;
}

.flag-card {
  position: relative;
  width: 70px;
  height: 50px;
  border: 1px solid #e7d5a7;
  border-radius: 4px;
  display: grid;
  grid-template-columns: 1fr 1.6fr 1fr;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.14);
}

.flag-side {
  background: #d91920;
}

.maple {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #d91920;
  font-size: 22px;
}

.flag-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 2px 0;
  color: #fff6bd;
  font-size: 11px;
  text-align: center;
  background: linear-gradient(90deg, rgba(196, 117, 23, 0.95), rgba(244, 199, 82, 0.95));
}

.brand-ad {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 68px;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 7px;
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  text-decoration: none;
  background: linear-gradient(#f14339, #b4161c);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.35), 0 2px 4px rgba(0, 0, 0, 0.22);
}

.result-strip {
  gap: 9px;
}

.number-box,
.countdown strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 6px;
  color: #c76217;
  font-weight: 700;
  background: #f7f7f7;
  border: 1px solid #e9edf4;
}

.number-box.total,
.countdown strong {
  color: #fff;
  background: var(--orange);
  border-color: #ff8b00;
}

.math-symbol {
  color: #9aa1ad;
}

.tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 35px;
  height: 35px;
  border-radius: 50%;
  color: #fff;
  font-size: 18px;
  font-weight: 700;
}

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

.tag.orange {
  background: #ff7b1a;
}

.tab-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-bottom: 2px solid #1fb9d3;
}

.tab-button {
  height: 39px;
  border: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 15px;
  font-family: inherit;
  cursor: pointer;
  background: var(--blue);
}

.tab-button:nth-child(n + 5) {
  background: var(--blue-dark);
}

.tab-button.is-active {
  background: var(--cyan);
}

.tab-panel {
  display: none;
}

.tab-panel.is-active {
  display: block;
}

.banner-strip {
  display: grid;
  gap: 0;
  padding: 0;
  border-bottom: 0;
  background: #fff;
}

.banner-strip[hidden] {
  display: none;
}

.banner-ad {
  display: block;
  overflow: hidden;
  line-height: 0;
  border-radius: 0;
  background: #fff;
}

.banner-ad img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
}

.table-wrap {
  overflow-x: auto;
}

.draw-table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  table-layout: fixed;
}

.draw-table th,
.draw-table td {
  height: 42px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  text-align: center;
  font-size: 14px;
  font-weight: 400;
}

.draw-table th {
  color: var(--muted);
  background: #fff;
}

.draw-table tr:nth-child(even) td {
  background: var(--stripe);
}

.draw-table.compact {
  min-width: 780px;
}

.predict-table {
  min-width: 0;
}

.predict-table th,
.predict-table td {
  padding-left: 6px;
  padding-right: 6px;
}

.predict-table th:nth-child(1),
.predict-table td:nth-child(1) {
  width: 18%;
}

.predict-table th:nth-child(2),
.predict-table td:nth-child(2) {
  width: 23%;
}

.predict-table th:nth-child(3),
.predict-table td:nth-child(3) {
  width: 25%;
}

.predict-table th:nth-child(4),
.predict-table td:nth-child(4) {
  width: 16%;
}

.predict-table th:nth-child(5),
.predict-table td:nth-child(5) {
  width: 18%;
}

.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 24px;
  border-radius: 4px;
  color: #fff;
  font-size: 13px;
  background: #7196d5;
}

.chip.hot {
  background: #f16545;
}

.stat-board {
  display: block;
  padding: 8px;
  background: #fff;
}

.stat-section {
  margin-bottom: 8px;
  border: 1px solid #18a7f2;
  border-radius: 7px;
  overflow: hidden;
  background: #fff;
}

.stat-section h3 {
  margin: 0;
  padding: 7px 12px;
  color: #fff;
  font-size: 15px;
  line-height: 1;
  background: linear-gradient(90deg, #254f93, #477fe4);
}

.stat-row {
  display: grid;
  background: #e8f3fc;
}

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

.stat-cols-4 {
  grid-template-columns: repeat(4, 1fr);
}

.stat-cell {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 6px;
  min-height: 37px;
  padding: 0 12px;
  border-right: 1px solid #d8e5ef;
  border-bottom: 1px solid #d8e5ef;
  font-size: 13px;
  background: #fff;
}

.stat-cell:nth-child(4n + 1),
.stat-cols-2 .stat-cell:nth-child(2n + 1) {
  background: #eef7ff;
}

.stat-cell strong {
  color: #ff5a00;
  font-size: 13px;
}

.stat-cell em {
  color: #333;
  font-style: normal;
}

.history-list {
  display: block;
  padding: 0;
  background: #fff;
}

.history-card {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  overflow: hidden;
}

.history-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 54px;
  border-bottom: 1px solid var(--line);
  font-size: 18px;
}

.ball-row {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 1px;
  padding: 10px;
}

.ball-row span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  border: 1px solid #e6ebf4;
  border-radius: 3px;
  color: #516072;
  background: #fbfcff;
}

.calc-text {
  padding: 0 16px 14px;
  color: #586273;
  line-height: 1.8;
  text-align: center;
}

.history-stat {
  min-height: 760px;
  padding: 22px 20px 34px;
  color: #000;
  font-family: Arial, "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.72;
  border-top: 45px solid #3265c7;
  background: #fff;
}

.history-stat p {
  margin: 0 0 10px;
}

.history-stat-lines {
  margin-top: 24px;
}

.history-stat-lines p {
  margin-bottom: 16px;
}

.history-stat b {
  margin: 0 12px;
  color: #d5a4b4;
  font-weight: 400;
}

.history-stat h3 {
  margin: 22px 0 8px;
  font-size: 16px;
  font-weight: 400;
}

.history-number-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(150px, 260px));
  column-gap: 14px;
  row-gap: 2px;
}

.mini-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  margin-right: 10px;
  border-radius: 4px;
  color: #fff;
  font-family: Arial, sans-serif;
  font-size: 16px;
  background: #8fb8e8;
}

.mini-icon.blue {
  background: #0aa4e2;
  font-size: 13px;
  line-height: 1;
}

.predict-ok,
.predict-bad {
  font-size: 22px;
  font-weight: 700;
}

.predict-ok {
  color: #058a13;
}

.predict-bad {
  color: #f10000;
}

.notice-line {
  min-height: 44px;
  padding: 12px;
  color: #d7192a;
  text-align: center;
  border-bottom: 1px solid var(--line);
}

.secret-tool {
  min-height: 760px;
  background: #fff;
}

.secret-panel {
  color: #111;
  font-size: 12px;
}

.secret-title,
.secret-analyze {
  display: block;
  width: 100%;
  height: 26px;
  border: 0;
  color: #fff;
  line-height: 26px;
  text-align: center;
  background: #3366c8;
}

.secret-presets {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  min-height: 190px;
  padding: 8px 8px 18px;
}

.secret-presets div {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.secret-presets div:nth-child(2),
.secret-presets div:nth-child(3),
.secret-presets div:nth-child(4),
.secret-presets div:nth-child(5) {
  align-items: center;
}

.secret-presets button {
  min-width: 42px;
  height: 20px;
  border: 1px solid #c7cbd4;
  border-radius: 10px;
  color: #111;
  font-size: 11px;
  cursor: pointer;
  background: #fff;
}

.secret-presets button.is-selected {
  color: #fff;
  background: #4079da;
  border-color: #4079da;
}

.secret-range {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 8px;
}

.secret-range select {
  height: 22px;
  font-size: 12px;
}

.secret-analyze {
  margin: 0;
  font-size: 16px;
  cursor: pointer;
}

.secret-result {
  width: min(360px, 100%);
  padding: 8px 8px 40px;
  line-height: 1.9;
}

.secret-result p {
  margin: 0 0 10px;
}

.secret-result b {
  margin: 0 8px;
  color: #c995a5;
  font-weight: 400;
}

.secret-result h3 {
  margin: 18px 0 4px;
  font-size: 13px;
  font-weight: 400;
}

.secret-number-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(90px, 1fr));
  column-gap: 10px;
  max-width: 230px;
}

.secret-number-list b {
  margin: 0;
  color: #064fbb;
}

.ad-grid,
.source-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 14px;
}

.source-list {
  display: block;
  padding: 12px;
  background: #fff;
}

.source-rule-link {
  display: block;
  margin: 0 0 12px;
  color: #0000ff;
  text-align: center;
  font-size: 16px;
  font-weight: 700;
}

.source-card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.source-open-card {
  padding: 10px;
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(180deg, #093965, #6391bb);
  box-shadow: 0 2px 10px rgba(8, 45, 80, 0.24);
}

.source-open-card h3 {
  margin: 0 0 10px;
  text-align: center;
  font-size: 28px;
  line-height: 1.1;
}

.source-equation {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
  margin-bottom: 14px;
  font-size: 26px;
  font-weight: 700;
}

.source-equation span,
.source-equation strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border: 2px solid rgba(255, 255, 255, 0.75);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.13);
}

.source-equation strong {
  border-color: #ef4438;
  background: #ef4438;
}

.source-number-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  overflow: hidden;
  border-radius: 6px;
  border: 1px solid #103c69;
}

.source-number-grid span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 31px;
  border-right: 1px solid #103c69;
  border-bottom: 1px solid #103c69;
  color: #333;
  font-weight: 700;
  background: #fff;
}

.source-number-grid span.is-blue {
  color: #fff;
  background: #438fde;
}

.source-number-grid span.is-red {
  color: #fff;
  background: #f1463d;
}

.source-calc-title,
.source-open-card p {
  margin: 10px 0 0;
  padding: 10px 10px;
  border-radius: 6px;
  color: #fff;
  font-size: clamp(10px, 0.95vw, 15px);
  font-weight: 700;
  background: rgba(255, 255, 255, 0.13);
}

.source-open-card p {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
  letter-spacing: 0;
  text-align: center;
}

.source-calc-title {
  text-align: center;
  font-size: 18px;
}

.ad-card,
.source-card {
  display: block;
  min-height: 92px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--text);
  text-decoration: none;
  background: #fff;
}

.ad-card {
  border-color: #ffd39a;
  background: linear-gradient(180deg, #fffaf0, #fff);
}

.ad-card strong,
.source-card strong {
  display: block;
  margin-bottom: 8px;
  color: #d7192a;
  font-size: 18px;
}

.ad-card span,
.source-card span {
  color: #5f6876;
  line-height: 1.6;
}

.ad-card img {
  display: block;
  width: 100%;
  max-height: 120px;
  object-fit: cover;
  margin-bottom: 10px;
  border-radius: 3px;
}

.scratch-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.scratch-modal.is-open {
  display: flex;
}

.scratch-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(0, 0, 0, 0.78);
}

.scratch-card {
  position: relative;
  width: min(1000px, 94vw);
  max-height: 92vh;
  overflow: auto;
  border-radius: 3px;
  color: #fff;
  background: #ff3f4a;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.42);
}

.scratch-close {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 2;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.24);
}

.scratch-top {
  min-height: 250px;
  padding: 42px 32px 38px;
  text-align: center;
  background:
    radial-gradient(circle at 16% 18%, #fff8df 0 70px, transparent 72px),
    radial-gradient(circle at 82% 28%, #fff8df 0 50px, transparent 52px),
    linear-gradient(160deg, #ffe16a 0 36%, #ff631e 37% 66%, #ff3443 67%);
}

.scratch-title {
  color: #fff1e2;
  font-size: clamp(48px, 7vw, 82px);
  letter-spacing: 18px;
  text-shadow: 0 3px 2px rgba(126, 0, 0, 0.34);
}

.scratch-issue {
  width: min(600px, 78%);
  margin: 18px auto 0;
  padding: 18px;
  border: 4px solid #da9e4b;
  color: #fff;
  font-size: clamp(24px, 3.3vw, 38px);
  background: rgba(201, 28, 36, 0.72);
}

.scratch-issue span,
.scratch-bottom strong {
  color: #ffe837;
}

.scratch-body {
  position: relative;
  padding: 42px 70px;
  background:
    radial-gradient(circle, rgba(255,255,255,0.08) 0 8px, transparent 9px) 0 0 / 78px 78px,
    #888;
}

.scratch-body::before,
.scratch-body::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 28px;
  background: radial-gradient(circle at 16px 14px, #ff3f4a 0 15px, #fff 16px) 0 0 / 50px 28px repeat-x;
}

.scratch-body::before {
  top: 0;
}

.scratch-body::after {
  bottom: 0;
  transform: rotate(180deg);
}

.scratch-result {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(12px, 3vw, 34px);
  min-height: 220px;
  overflow: hidden;
  border-radius: 70% 18% 58% 24% / 20% 40% 30% 60%;
  color: #2c2c2c;
  font-size: clamp(42px, 7vw, 76px);
  background: #fff;
}

.scratch-result span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: clamp(72px, 9vw, 120px);
  height: clamp(72px, 9vw, 120px);
  border: 2px solid #d4d4d4;
  border-radius: 50%;
}

#scratchCanvas {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
}

.scratch-bottom {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 64px;
  margin: 24px 30px 32px;
  padding: 28px;
  border: 4px solid #f4be4d;
  color: #fff;
  font-size: clamp(22px, 3vw, 34px);
  background: rgba(204, 25, 32, 0.42);
}

.scratch-bottom button {
  min-width: 160px;
  height: 60px;
  border: 0;
  border-radius: 30px;
  color: #f24b45;
  font-size: 26px;
  cursor: pointer;
  background: #ffe7e7;
}

@media (max-width: 820px) {
  .draw-header {
    grid-template-columns: 1fr;
  }

  .brand-block,
  .result-strip,
  .countdown {
    min-height: 64px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    flex-wrap: wrap;
  }

  .tab-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .ad-grid,
  .source-list,
  .stat-board {
    grid-template-columns: 1fr 1fr;
  }

  .source-card-grid {
    grid-template-columns: 1fr 1fr;
  }

  .source-open-card h3 {
    font-size: 24px;
  }

  .source-equation {
    gap: 7px;
    font-size: 20px;
  }

  .source-equation span,
  .source-equation strong {
    width: 42px;
    height: 42px;
  }

  .scratch-bottom {
    flex-direction: column;
    gap: 18px;
  }
}

@media (max-width: 520px) {
  .brand-block {
    justify-content: flex-start;
  }

  .latest-line {
    font-size: 14px;
  }

  .number-box,
  .countdown strong {
    width: 36px;
    height: 36px;
  }

  .tag {
    width: 32px;
    height: 32px;
    font-size: 16px;
  }

  .tab-button {
    height: 42px;
  }

  .ad-grid,
  .source-list,
  .stat-board {
    grid-template-columns: 1fr;
  }

  .stat-cols-4,
  .stat-cols-2,
  .source-card-grid {
    grid-template-columns: 1fr;
  }

  .history-stat {
    padding: 22px 16px;
    font-size: 14px;
  }

  .history-number-list {
    grid-template-columns: 1fr;
  }

  .ball-row,
  .source-number-grid {
    grid-template-columns: repeat(5, 1fr);
  }

  .secret-presets {
    grid-template-columns: repeat(3, 1fr);
    row-gap: 10px;
  }

  .secret-presets div {
    align-items: center;
  }

  .secret-result {
    width: 100%;
  }

  .source-open-card p {
    font-size: clamp(8px, 2.2vw, 11px);
  }

  .scratch-card {
    width: 100%;
  }

  .scratch-top {
    min-height: 190px;
  }

  .scratch-title {
    letter-spacing: 8px;
  }

  .scratch-body {
    padding: 34px 20px;
  }

  .scratch-result {
    min-height: 150px;
    gap: 7px;
  }

  .scratch-bottom {
    margin: 16px;
    padding: 18px;
  }
}
