:root {
  color-scheme: dark;
  font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: #09101a;
  color: #f8fafc;
  line-height: 1.5;
  font-size: 16px;
}
* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  background: #07121d;
}

.page-shell {
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 12px 24px;
}

.top-banner {
  width: 100%;
  margin: 16px auto 0;
  border-radius: 10px;
  overflow: hidden;
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.24);
}

.top-banner-link {
  display: block;
}

.top-banner-image {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
}

.top-header {
  display: grid;
  grid-template-columns: auto minmax(220px, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 18px 16px;
  margin-top: 16px;
  border-radius: 26px;
  background: linear-gradient(180deg, #09121d 0%, #0b1724 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.28);
}

.header-left,
.header-center,
.header-right {
  display: flex;
  align-items: center;
}

.header-left {
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  margin-left: -4px;
}

@media (min-width: 881px) {
  .header-left {
    margin-left: -8px;
    padding-left: 2px;
  }

  .issue-box {
    min-width: 150px;
  }

  .issue-controls .mipai-btn {
    min-width: 108px;
  }
}

.header-center {
  flex: 1;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 12px;
  min-width: 0;
  padding: 0;
}

.header-right {
  justify-content: flex-end;
  min-width: 0;
}

.left-badge {
  display: flex;
  align-items: center;
  gap: 10px;
}

.badge-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 60px;
  height: 36px;
  border-radius: 18px;
  background: #ffb02e;
  color: #0f172a;
  font-size: 1.1rem;
  font-weight: 800;
  padding: 0 14px;
}

.badge-number {
  color: #f8fafc;
  font-size: 1.2rem;
  font-weight: 800;
}

.issue-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.issue-select {
  position: relative;
}

.issue-box {
  min-width: 140px;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #f8fafc;
  text-align: center;
  font-weight: 700;
  font-size: 1.1rem;
  cursor: pointer;
  user-select: none;
}

#latestIssueBadge {
  user-select: none;
}

.issue-box:hover {
  background: rgba(255, 255, 255, 0.08);
}

.issue-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 50;
  min-width: 170px;
  max-width: min(220px, calc(100vw - 24px));
  max-height: 280px;
  overflow-y: auto;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(8, 15, 25, 0.97);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
  padding: 6px;
}

.issue-dropdown-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  margin: 2px 0;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: #f8fafc;
  font-size: 0.95rem;
  cursor: pointer;
}

.issue-dropdown-item:hover,
.issue-dropdown-item.active {
  background: rgba(255, 255, 255, 0.1);
}

.issue-dropdown-empty {
  padding: 8px 10px;
  color: #94a3b8;
  font-size: 0.95rem;
}

.issue-controls button,
.issue-controls .mipai-btn {
  border-radius: 14px;
  min-width: 42px;
  height: 40px;
  padding: 0 14px;
  font-size: 0.95rem;
  color: #f8fafc;
  background: #0f1a2d;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.issue-controls .mipai-btn {
  min-width: 100px;
  height: 42px;
  padding: 0 20px;
  border-radius: 999px;
  font-size: 1.15rem;
  font-weight: 700;
  background: #dc2626;
  border: none;
  color: #ffffff;
}

.issue-controls .mipai-btn:hover {
  background: #b91c1c;
}

.hidden-select {
  display: none;
}

.mini-btn,
.small-btn,
.mipai-btn,
button {
  background: #13203a;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #f8fafc;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}

.mini-btn,
.small-btn {
  width: 34px;
  height: 34px;
}

.mipai-btn {
  min-width: 100px;
  height: 42px;
  padding: 0 20px;
  border-radius: 999px;
  font-size: 1.15rem;
  font-weight: 700;
  background: #dc2626;
  border: none;
  color: #ffffff;
}

.mipai-btn:hover {
  background: #b91c1c;
}

.countdown-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 0;
  border-radius: 12px;
  background: transparent;
  border: none;
  box-shadow: none;
  flex-wrap: nowrap;
}

.countdown-label {
  color: #acc4f5;
  font-size: 1.2rem;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}

.countdown-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.countdown-status {
  position: absolute;
  left: 15px;
  display: none;
  align-items: center;
  justify-content: center;
  color: #ff3546;
  font-size: 1.5rem;
  font-weight: 700;
  white-space: nowrap;
  animation: countdown-blink 0.6s infinite;
}

#mipaiStatus {
  color: #ffe07d;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

@keyframes countdown-blink {
  0%, 49% {
    opacity: 1;
  }
  50%, 100% {
    opacity: 0.3;
  }
}

.countdown-hidden {
  display: none !important;
}

.countdown-status.visible {
  display: flex;
}

.countdown-boxes {
  display: flex;
  gap: 10px;
  align-items: center;
}

.countdown-boxes.hidden {
  visibility: hidden;
}

.countdown-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.countdown-block {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  height: 52px;
  padding: 0 10px;
  border-radius: 16px;
  background: #0f1d32;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.countdown-value {
  display: inline-block;
  font-size: 2.8rem;
  font-weight: 900;
  color: #fafafa;
}

.countdown-unit {
  display: inline-block;
  font-size: 1.1rem;
  font-weight: 700;
  color: #96a9d7;
}


.latest-panel {
  min-width: 0;
  width: auto;
  max-width: none;
  padding: 0 4px;
  background: transparent;
  border: none;
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  flex-wrap: nowrap;
}

.latest-expression-row {
  flex: 0 0 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 2px;
  flex-wrap: nowrap;
  justify-content: flex-end;
  padding: 2px 4px;
  border-radius: 12px;
  background: transparent;
  border: none;
}

.top-header .latest-expression-row .expression-block {
  min-width: 42px;
  height: 36px;
  padding: 0 8px;
  font-size: 1.5rem;
}

.top-header .latest-expression-row .expression-block.operator {
  min-width: 12px;
  padding: 0 2px;
  font-size: 1.2rem;
}

.top-header .latest-expression-row .expression-block.total {
  min-width: 46px;
  height: 36px;
  padding: 0 8px;
  font-size: 1.5rem;
}

.expression-block {
  min-width: 54px;
  height: 44px;
  padding: 0 12px;
  border-radius: 12px;
  background: #13203d;
  color: #f8fafc;
  font-size: 1.8rem;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12);
}

.results-table .expression-block {
  min-width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #f8fafc;
  font-size: 1.05rem;
  font-weight: 800;
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.14);
}

.results-table .expression-block.operator {
  min-width: 12px;
  height: auto;
  padding: 0 4px;
  background: transparent;
  color: #94a8c7;
  font-size: 1rem;
  font-weight: 700;
  border: none;
  box-shadow: none;
}

.results-table .expression-block.total {
  min-width: 30px;
  height: 30px;
  padding: 0;
  background: transparent;
  color: #d8e2f4;
  font-size: 1.05rem;
  border: none;
  box-shadow: none;
}

.results-table .expression-block.blue {
  background: rgba(27, 108, 238, 0.12);
  border-color: rgba(50, 103, 189, 0.36);
  color: #54a4ff;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.14);
}

.results-table .expression-block.red {
  background: rgba(117, 30, 30, 0.12);
  border-color: rgba(107, 46, 46, 0.36);
  color: #ee6363;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.14);
}

.expression-block.operator {
  min-width: auto;
  height: auto;
  padding: 0 5px;
  background: transparent;
  color: #94a8c7;
  font-size: 1.6rem;
  font-weight: 700;
  border: none;
  box-shadow: none;
}

.expression-block.total {
  min-width: 54px;
  height: 44px;
  padding: 0 12px;
  background: #13203d;
  color: #ffffff;
  font-size: 1.8rem;
  border: none;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.expression-block.total.blue {
  background: #1b6cee;
  box-shadow: 0 10px 20px rgba(59, 130, 246, 0.32);
}

.expression-block.total.red {
  background: #dc2626;
  box-shadow: 0 10px 20px rgba(248, 113, 113, 0.32);
}

.results-table .expression-block.total.blue,
.results-table .expression-block.total.red {
  background: transparent;
  color: #d8e2f4;
  border: none;
  box-shadow: none;
}

.expression-block.blue,
.tag.blue {
  background: #1b6cee;
  color: #ffffff;
  border: none;
  box-shadow: none;
}

.expression-block.red,
.tag.red {
  background: #dc2626;
  color: #ffffff;
  border: none;
  box-shadow: none;
}

.history-digit.blue,
.history-digit.red {
  border: none;
  box-shadow: none;
  font-weight: 800;
}

.history-digit.blue {
  color: #0b89ff;
  background: rgba(29, 78, 216, 0.15);
}

.history-digit.red {
  color: #ff1d1d;
  background: rgba(220, 38, 38, 0.15);
}

.history-total.blue,
.history-total.red {
  background: transparent;
  color: #d8e2f4;
  border: none;
  box-shadow: none;
}

.history-operator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 10px;
  font-size: 1.2rem;
  color: #d8e2f4;
  margin: 0 2px;
}

.history-digit,
.history-total {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  margin: 0;
  padding: 0 6px;
  border-radius: 10px;
  border: none;
  font-weight: 700;
  background: transparent;
  color: #d8e2f4;
  font-size: 1.2rem;
}

.results-table th:first-child,
.results-table td:first-child {
  font-size: 14px;
}

.results-table .history-digit,
.results-table .history-total {
  min-width: 15px;
  padding: 0 0.2px;
  font-size: 1rem;
}

.results-table .history-operator {
  min-width: 4px;
  font-size: 1rem;
  margin: 0 0.2px;
}

.history-total {
  min-width: 36px;
}

.shape-part.blue {
  color: #dbeafe;
}

.shape-part.red {
  color: #fecaca;
}

.latest-tags {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
  margin: 0;
  padding: 0;
}

.tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 1.6rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  background: #172b44;
  color: #f8fafc;
  border: none;
  box-shadow: none;
}

.tag.blue {
  background: #1d4ed8;
  color: #ffffff;
}

.tag.red {
  background: #dc2626;
  color: #ffffff;
}

.tag.green {
  background: #22c55e;
  color: #ffffff;
}

.tag.purple {
  background: rgba(135, 24, 163, 0.15);
  color: #be4dff;
}

.tag.yellow {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
}

.tag.deep-red {
  background: rgba(167, 61, 144, 0.15);
  color: #fd27bd;
}

.tag.orange {
  background: rgba(241, 159, 5, 0.2);
  border-color: rgba(251, 191, 36, 0.32);
  color: #ffb625;
}

.tag.green {
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.32);
  color: #d1fae5;
}

@media (max-width: 880px) {
  .top-header {
    grid-template-columns: 1fr;
    padding: 16px 14px;
    justify-items: center;
  }

  .header-left,
  .header-center,
  .header-right {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  .header-left {
    align-items: center;
    margin-left: 0;
    padding-left: 0;
  }

  .issue-controls {
    justify-content: center;
  }

  .countdown-row {
    width: 100%;
    justify-content: center;
  }

  .latest-panel {
    justify-content: center;
    width: 100%;
    align-items: center;
    gap: 4px;
    flex-wrap: nowrap;
  }

  .latest-expression-row {
    justify-content: center;
    width: auto;
    margin-right: 4px;
  }

  .latest-tags {
    justify-content: center;
    width: auto;
    gap: 4px;
  }

  .latest-panel > .latest-expression-row,
  .latest-panel > .latest-tags {
    display: inline-flex;
    vertical-align: middle;
  }

  .data-table th,
  .data-table td {
    padding: 10px 8px;
    font-size: 0.95rem;
  }
}

.tab-nav {
  margin: 12px 0 0;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.tab-button {
  flex: 1 1 0;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #0d1a2f;
  color: #c0d0f3;
  padding: 10px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
  font-size: 1.05rem;
  font-weight: 600;
}

.tab-button.active {
  background: #3b5bff;
  color: #ffffff;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.container {
  width: min(1200px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 0;
}

.panel {
  background: #0b1724;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 14px;
  margin-top: 12px;
}

.panel-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: #f8fafc;
}

.table-wrap {
  overflow-x: auto;
  margin-bottom: 10px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 0;
  table-layout: fixed;
  margin: 0 auto;
}

.data-table th,
.data-table td {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #d8e2f4;
  text-align: center;
  vertical-align: middle;
}

.data-table td {
  word-break: break-word;
  min-width: 0;
}

.data-table th {
  word-break: keep-all;
}

  .trend-controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 12px;
  }

  .trend-count-btn {
    min-width: 74px;
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: #0d1a2f;
    color: #cbd5e1;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
  }

  .trend-count-btn.active {
    background: #3b5bff;
    color: #ffffff;
    border-color: rgba(59, 91, 255, 0.8);
  }

  .trend-count-btn:hover {
    background: rgba(59, 91, 255, 0.15);
  }


.results-table td .tag,
.results-table th .tag {
  font-size: 1.05rem;
  padding: 6px 12px;
}

@media (max-width: 768px) {
  html, body {
    overflow-x: auto;
  }

  body {
    width: 100%;
    min-width: 0;
    margin: 0 auto;
  }

  .page-shell {
    max-width: 100%;
    width: 100%;
    padding: 0 6px 20px;
  }

  .container {
    width: 100%;
  }

  .panel {
    overflow: visible;
  }

  .tab-nav {
    gap: 6px;
  }

  .tab-button {
    padding: 8px 10px;
    font-size: 0.92rem;
  }

  .trend-controls {
    justify-content: center;
    gap: 6px;
  }

  .trend-count-btn {
    min-width: 60px;
    padding: 8px 10px;
    font-size: 0.88rem;
  }

  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .data-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
  }

  .data-table th,
  .data-table td,
  .data-table .tag,
  .data-table .expression-block,
  .data-table .history-digit,
  .data-table .history-total,
  .data-table .history-operator {
    white-space: nowrap;
  }

  .data-table th,
  .data-table td {
    padding: 7px 5px;
    font-size: 0.82rem;
    text-align: center;
    vertical-align: middle;
  }

  .results-table td .tag,
  .results-table th .tag {
    padding: 4px 6px;
    font-size: 0.78rem;
  }

  .results-table .history-digit,
  .results-table .history-total {
    min-width: 14px;
    padding: 0 2px;
    font-size: 0.88rem;
  }

  .results-table .history-operator {
    margin: 0 1px;
  }

  .results-table .expression-block {
    min-width: auto;
    padding: 0 2px;
  }
}

.results-table thead th {
  font-size: 14px;
  line-height: 1.2;
}

@media (max-width: 680px) {
  .results-table {
    table-layout: auto;
    width: auto;
  }

  .results-table th,
  .results-table td {
    padding: 4px 2px;
    font-size: 0.84rem;
    white-space: nowrap;
  }

  .results-table thead th {
    font-size: 14px;
    line-height: 1.2;
  }

  .results-table thead th:first-child {
    font-size: 14px;
  }

  .results-table th:nth-child(3),
  .results-table td:nth-child(3) {
    font-size: 14px;
    overflow: visible;
    padding: 0 1px 0 2px;
    text-align: left;
  }

  .results-table td:nth-child(3) .expression-block,
  .results-table td:nth-child(3) .history-digit,
  .results-table td:nth-child(3) .history-total {
    justify-content: flex-start;
    padding-left: 2px;
  }

  .results-table th:nth-child(4),
  .results-table td:nth-child(4),
  .results-table th:nth-child(5),
  .results-table td:nth-child(5),
  .results-table th:nth-child(6),
  .results-table td:nth-child(6) {
    font-size: 14px;
    padding: 1px 1px;
  }

  .results-table .tag {
    padding: 0 1px;
  }

  .results-table .expression-block,
  .results-table .history-digit,
  .results-table .history-total {
    padding: 0 0.5px;
    font-size: 0.82rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .results-table .expression-block.total,
  .results-table .history-total {
    min-width: 16px;
    padding: 0 1px;
  }

  .results-table .history-operator {
    margin: 0 0.3px;
    font-size: 0.78rem;
  }
}

@media (max-width: 520px) {
  .results-table {
    table-layout: auto;
    width: auto;
  }

  .results-table th,
  .results-table td {
    padding: 2px 1px;
    font-size: 0.7rem;
    white-space: nowrap;
  }

  .results-table thead th {
    font-size: 14px;
    line-height: 1.2;
  }

  .results-table thead th:first-child {
    font-size: 14px;
  }

  .results-table th:nth-child(3),
  .results-table td:nth-child(3) {
    font-size: 14px;
    overflow: visible;
    padding: 0 1px;
    text-align: center;
  }

  .results-table th:nth-child(4),
  .results-table td:nth-child(4) {
    font-size: 14px;
    padding: 1px 1px;
    text-align: center;
  }

  .results-table td:nth-child(3) {
    font-size: 14px;
    overflow: visible;
    padding: 0 1px;
  }

  /* Mobile: enlarge the three digits before '=' and remove their background (仅限号码列) */
  .results-table td:nth-child(3) .history-digit,
  .results-table td:nth-child(3) .expression-block {
    font-size: 1.15rem;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 2px;
    min-width: 0;
  }

  .results-table th:nth-child(4),
  .results-table td:nth-child(4) {
    font-size: 14px;
    padding: 1px 1px;
  }

  .results-table th:nth-child(5),
  .results-table td:nth-child(5),
  .results-table th:nth-child(6),
  .results-table td:nth-child(6) {
    font-size: 14px;
    padding: 1px 1px;
  }

  .results-table .tag {
    min-width: 16px;
    padding: 0 1px;
    font-size: 0.72rem;
  }

  .results-table .history-digit,
  .results-table .history-total {
    min-width: 14px;
    padding: 0 1px;
    font-size: 0.78rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .results-table .history-total {
    padding-left: 2px;
    padding-right: 2px;
    min-width: 18px;
    font-weight: 700;
  }

  .results-table .history-operator {
    margin: 0 0.3px;
    min-width: 2px;
    font-size: 0.72rem;
  }

  .results-table .expression-block {
    min-width: auto;
    padding: 0 1px;
    font-size: 0.78rem;
  }

  .results-table {
    min-width: 100%;
  }
}

.data-table th {
  background: #0c1726;
  color: #f8fafc;
  font-weight: 700;
  font-size: 1.05rem;
}

.trend-small-large,
.trend-single-double {
  font-size: 0.88rem;
  padding: 4px 8px;
  min-width: auto;
}

.data-table tbody tr:nth-child(odd) {
  background: rgba(255, 255, 255, 0.03);
}

.data-table tbody tr.selected {
  background: linear-gradient(90deg, rgba(59, 130, 246, 0.28) 0%, rgba(37, 99, 235, 0.18) 100%);
  box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.3);
}

.data-table tbody tr.selected td {
  color: #f8fafc;
  font-weight: 700;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.stats-table-card {
   background: #0d1728;
   border: 1px solid rgba(255, 255, 255, 0.08);
   border-radius: 18px;
   padding: 18px;
 }
 
 .stats-table-header {
   display: grid;
   grid-template-columns: repeat(4, minmax(0, 1fr));
   gap: 12px;
   margin-bottom: 12px;
 }
 
 .stats-table-header-compact {
   grid-template-columns: repeat(2, minmax(0, 1fr));
 }
 
 .stats-table {
   width: 100%;
   border-collapse: collapse;
 }
 
 .stats-table th,
 .stats-table td {
   border: 1px solid rgba(255, 255, 255, 0.08);
   padding: 10px 12px;
   text-align: center;
   color: #d8e2f4;
 }
 
 .stats-table th {
   background: #0c1726;
   color: #f8fafc;
   font-weight: 700;
 }
 
 .stats-table td:first-child,
 .stats-table td:nth-child(3) {
   color: #f8fafc;
   font-weight: 700;
   font-size: 1.03rem;
 }
 
 .stats-count {
   color: #f8fafc;
 }
 
 .stats-count.red {
   color: #f87171;
 }
 
 .forecast-correct {
   background: #dc2626;
   color: #ffffff;
   border-radius: 999px;
   padding: 2px 8px;
   display: inline-block;
 }
 
 .forecast-wrong {
   background: #2563eb;
   color: #ffffff;
   border-radius: 999px;
   padding: 2px 8px;
   display: inline-block;
 }

.number-value.red {
  color: #f87171;
}

.site-footer {
  margin-top: 18px;
  padding: 18px 0;
  text-align: center;
  font-size: 0.95rem;
  color: #90a9c8;
}

.mipai-mask {
  position: fixed;
  inset: 0;
  background: rgba(148, 163, 184, 0.35);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  z-index: 30;
}

.mipai-mask.hidden {
  display: none;
}

.mipai-card {
  position: relative;
  width: min(560px, calc(100% - 32px));
  max-height: 85vh;
  padding: 24px 20px;
  border-radius: 24px;
  background:
    radial-gradient(circle at 18% 12%, rgba(255, 225, 180, 0.28), transparent 10%),
    radial-gradient(circle at 80% 20%, rgba(255, 205, 90, 0.22), transparent 8%),
    linear-gradient(135deg, rgba(255, 215, 0, 0.08) 0%, transparent 4%, transparent 96%, rgba(255, 215, 0, 0.08) 100%),
    radial-gradient(circle at top, rgba(255, 255, 255, 0.14), transparent 28%),
    linear-gradient(180deg, #d02526 0%, #9a1111 45%, #610a0d 100%);
  background-size: cover;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.32);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow: hidden;
}

.mipai-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: linear-gradient(135deg, rgba(255,255,255,0.05) 12.5%, transparent 12.5%, transparent 50%, rgba(255,255,255,0.05) 50%, rgba(255,255,255,0.05) 62.5%, transparent 62.5%, transparent 100%);
  background-size: 24px 24px;
  opacity: 0.12;
  pointer-events: none;
}

.mipai-card::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -8px;
  width: 160%;
  height: 120px;
  transform: translateX(-50%);
  background: radial-gradient(circle at center, rgba(255, 255, 255, 0.12), transparent 45%);
  opacity: 0.45;
  filter: blur(18px);
  pointer-events: none;
}

.mipai-card .gold-shine {
  content: '';
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  top: 56px;
  background: linear-gradient(90deg, transparent 15%, rgba(255, 215, 0, 0.22) 30%, rgba(255, 215, 0, 0.5) 50%, rgba(255, 215, 0, 0.22) 70%, transparent 85%);
  filter: blur(0.5px);
  pointer-events: none;
}

.mipai-card .gold-shine.secondary {
  top: auto;
  bottom: 56px;
}

.mipai-card .gold-spot {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 241, 179, 0.95) 0%, rgba(255, 204, 86, 0.9) 50%, rgba(221, 141, 13, 0.55) 100%);
  box-shadow: 0 0 18px rgba(255, 182, 46, 0.28);
  pointer-events: none;
}

.mipai-card .gold-spot:nth-of-type(1) {
  top: 24px;
  left: 18px;
}

.mipai-card .gold-spot:nth-of-type(2) {
  top: 22px;
  right: 20px;
}

.mipai-card .gold-spot:nth-of-type(3) {
  bottom: 24px;
  left: 20px;
}

.mipai-card .gold-spot:nth-of-type(4) {
  bottom: 26px;
  right: 22px;
}

.mipai-header {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

.mipai-countdown-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 0;
  flex-wrap: nowrap;
}

.mipai-countdown-label {
  color: #fce7e7;
  font-size: 1.2rem;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}

.mipai-countdown-boxes {
  display: flex;
  gap: 10px;
  align-items: center;
}

.mipai-countdown-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.mipai-countdown-block {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  height: 48px;
  padding: 0 10px;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.24);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.mipai-countdown-value {
  display: inline-block;
  font-size: 2.4rem;
  font-weight: 900;
  color: #fafafa;
}

.mipai-countdown-unit {
  display: inline-block;
  font-size: 1.1rem;
  font-weight: 700;
  color: #ffe4e4;
}

.mipai-status {
  min-height: 24px;
  color: #ffe07d;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  animation: mipai-blink 0.6s infinite;
}

@keyframes mipai-blink {
  0%, 49% {
    opacity: 1;
  }
  50%, 100% {
    opacity: 0.3;
  }
}

.mipai-content {
  position: relative;
  width: 100%;
  background: linear-gradient(135deg, rgba(100, 15, 15, 0.98) 0%, rgba(55, 8, 8, 0.95) 100%);
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), inset 0 -2px 10px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px;
}

.mipai-issue-label {
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff1f1;
  text-align: center;
  min-height: 30px;
  line-height: 1.5;
}
/* make sure issue label stays above inner box */
.mipai-issue-label {
  position: relative;
  z-index: 12;
  background: transparent;
}

.mipai-scratch-wrapper {
  position: relative;
  width: 100%;
  height: 150px;
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(180deg, #f4f5f7 0%, #eceef2 100%);
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06), 0 14px 34px rgba(0, 0, 0, 0.14);
}

.mipai-result {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  text-align: center;
  pointer-events: none;
  padding: 16px 12px;
  border-radius: 12px;
  background: transparent;
  overflow: hidden;
}

#mipaiExpression {
  font-size: 1.4rem;
  font-weight: 800;
  color: #3b5bff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex-wrap: nowrap;
  white-space: nowrap;
  word-break: keep-all;
  max-width: 100%;
  width: 100%;
  height: 100%;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

/* Mipai: make the expression text red and enlarge numbers */
/* Mipai: make the expression text red, force single line, and tighten spacing */
#mipaiExpression {
  color: #ef4444;
  justify-content: center;
  align-items: center;
  flex-wrap: nowrap;
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
  gap: 2px;
}

/* Remove the pale pink highlight behind the scratched result text */
#mipaiExpression {
  background: transparent;
  color: #b91c1c;
  padding: 8px 10px;
  border-radius: 12px;
  box-shadow: none;
  margin-top: 0;
}

#mipaiExpression .history-digit,
#mipaiExpression .history-total,
#mipaiExpression .history-operator {
  color: #b91c1c;
}

#mipaiExpression .history-digit,
#mipaiExpression .history-total {
  color: #ff0000;
  font-weight: 900;
  font-size: calc(1.2rem * 6.2);
  line-height: 1;
  padding: 0 6px;
  margin: 0;
  background: transparent;
}

#mipaiExpression .history-operator {
  color: #ff0202;
  font-size: calc(1.2rem * 3.8);
  font-weight: 800;
  padding: 0 4px;
  margin: 0;
}

/* Ensure the mipai result area can scroll if content overflows */
.mipai-result {
  overflow: auto;
}

/* Remove background and shadow from numbers in mipai result */
.mipai-result .expression-block {
  background: transparent;
  border: none;
  box-shadow: none;
  color: #ff2d2d;
  min-width: 34px;
  height: 44px;
  padding: 0 8px;
  font-size: 4.8rem;
  font-weight: 900;
  line-height: 1.05;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  letter-spacing: 0.01em;
}

.mipai-result .expression-block.operator {
  color: #ff2d2d;
  min-width: 16px;
  height: auto;
  padding: 0 4px;
  font-size: 2.8rem;
  font-weight: 800;
}

.mipai-result .expression-block.total,
.mipai-result .expression-block.total.blue,
.mipai-result .expression-block.total.red {
  background: transparent;
  border: none;
  box-shadow: none;
  color: #ff2d2d;
  min-width: 40px;
  height: 44px;
  padding: 0 8px;
  font-size: 4.8rem;
  font-weight: 900;
}

.mipai-result .expression-block.blue,
.mipai-result .expression-block.red,
.mipai-result .expression-block.total.blue,
.mipai-result .expression-block.total.red {
  background: transparent;
  border: none;
  box-shadow: none;
  color: #ff2d2d;
}

.mipai-scratch {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20"><circle cx="10" cy="10" r="8" fill="white" opacity="0.8"/></svg>') 10 10, auto;
  border-radius: 12px;
  z-index: 10;
}

.mipai-close-btn,
.mipai-refresh-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 98px;
  height: 42px;
  color: #ffffff;
  border: none;
  padding: 0 20px;
  font-size: 1.1rem;
  font-weight: 700;
  border-radius: 10px;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.15s ease;
  white-space: nowrap;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.18);
}

.mipai-close-btn {
  background: #6b7280;
  color: #f8fafc;
}

.mipai-refresh-btn {
  background: #f59e0b;
  color: #050505;
}

.mipai-close-btn:hover,
.mipai-refresh-btn:hover {
  opacity: 0.9;
}

.mipai-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin: 0 auto;
  background: transparent;
  padding: 0 10px;
}

.mipai-title {
  font-size: 1.35rem;
  color: #f8fafc;
  margin-bottom: 12px;
}

.mipai-subtitle {
  color: #b8c8e4;
  margin-bottom: 22px;
}

button:focus,
select:focus {
  outline: 2px solid rgba(91, 163, 255, 0.35);
  outline-offset: 2px;
}

@media (max-width: 980px) {
  .top-banner {
    margin-top: 12px;
  }
  .top-header {
    flex-direction: column;
    align-items: stretch;
  }

  .header-right {
    justify-content: center;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .top-header {
    padding: 16px;
  }

  .header-left,
  .header-center,
  .header-right {
    width: 100%;
  }

  .issue-controls {
    flex-wrap: wrap;
  }

  .issue-controls select {
    width: 100%;
  }

  .tab-nav {
    justify-content: space-between;
  }

  .data-table th,
  .data-table td {
    padding: 10px 12px;
    font-size: 0.94rem;
  }
}

@media (max-width: 520px) {
  .data-table th,
  .data-table td {
    padding: 6px 8px;
    font-size: 0.88rem;
  }
}

body.mipai .tab-nav,
body.mipai main,
body.mipai footer {
  display: none;
}

body.mipai .top-header {
  border-radius: 0 0 22px 22px;
}

body.mipai .latest-panel,
body.mipai .header-right {
  display: none !important;
}
