*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", sans-serif;
  background: #e8f5e9;
  color: #1e293b;
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
  line-height: 1.45;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

.page {
  min-height: 100vh;
  display: flex;
  justify-content: center;
}

.shell {
  width: 100%;
  max-width: 720px;
  background: #fff;
  min-height: 100vh;
  box-shadow: 0 0 24px rgba(0, 0, 0, 0.06);
}

/* —— 顶栏 —— */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #fff;
  border-bottom: 1px solid #e8f0e9;
  padding: 8px 10px 10px;
}

.header-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.badge-official {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  object-fit: contain;
  border-radius: 8px;
  display: block;
}

.domain-logo {
  flex: 1 1 auto;
  min-width: 0;
  font-size: clamp(22px, 5.5vw, 32px);
  font-weight: 900;
  letter-spacing: 0.03em;
  line-height: 1.15;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.domain-logo .domain-char {
  display: inline-block;
  transition: color 0.25s ease;
  text-shadow:
    -1px -1px 0 rgba(255, 255, 255, 0.85),
    1px 1px 0 rgba(0, 0, 0, 0.35),
    2px 2px 3px rgba(0, 0, 0, 0.28),
    0 0 1px rgba(0, 0, 0, 0.2);
}

.header-draw {
  display: flex;
  align-items: stretch;
  gap: 8px;
  width: 100%;
  flex-wrap: nowrap;
  padding-bottom: 2px;
}

.lottery-meta {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 5px;
  padding: 6px 10px;
  background: #f4faf4;
  border: 1px solid #c8e6c9;
  border-radius: 8px;
}

.lottery-name {
  font-size: clamp(14px, 3.2vw, 16px);
  font-weight: 800;
  color: #2e7d32;
  white-space: nowrap;
  line-height: 1.2;
}

.issue-pill {
  background: #f9a825;
  color: #fff;
  font-size: clamp(12px, 2.8vw, 13px);
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 4px;
  white-space: nowrap;
  line-height: 1.2;
}

.draw-balls {
  display: flex;
  align-items: stretch;
  gap: 4px;
  flex: 1 1 auto;
  min-width: 0;
}

.header-draw .ball {
  flex: 1 1 0;
  width: auto;
  min-width: 0;
  max-width: 72px;
  background: #fff;
  border-radius: 5px;
  text-align: center;
  overflow: hidden;
  border: 1px solid #e0e0e0;
}

.header-draw .ball__num {
  display: block;
  font-size: clamp(14px, 3.6vw, 18px);
  font-weight: 800;
  color: #fff;
  line-height: 1.35;
  padding: 4px 0;
}

.header-draw .ball__zodiac {
  display: block;
  font-size: clamp(10px, 2.4vw, 12px);
  color: #555;
  line-height: 1.4;
  background: #fff;
}

.header-draw .ball-plus {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  font-weight: 800;
  color: #888;
  font-size: clamp(14px, 3.2vw, 18px);
  padding: 0 2px;
}

.ball {
  width: 34px;
  background: #fff;
  border-radius: 4px;
  text-align: center;
  overflow: hidden;
  border: 1px solid #e0e0e0;
}

.ball__num {
  display: block;
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  line-height: 1.35;
  padding: 2px 0;
}

.ball__zodiac {
  display: block;
  font-size: 10px;
  color: #555;
  line-height: 1.4;
  background: #fff;
}

.ball__num.tone-red {
  background: #e53935;
}

.ball__num.tone-blue {
  background: #1e88e5;
}

.ball__num.tone-green {
  background: #43a047;
}

.ball-plus {
  font-weight: 700;
  color: #888;
  font-size: 14px;
  padding: 0 1px;
}

.ball.is-special .ball__num {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

/* —— 轮播 —— */
.banner {
  position: relative;
  overflow: hidden;
  background: #8b0000;
  aspect-ratio: 16 / 9;
}

.banner-track {
  display: flex;
  height: 100%;
  transition: transform 0.45s ease;
}

.banner-slide {
  flex: 0 0 100%;
  height: 100%;
  position: relative;
  background: #8b0000;
}

.banner-slide img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.banner-dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 8px;
  display: flex;
  justify-content: center;
  gap: 6px;
  pointer-events: none;
  z-index: 2;
}

.banner-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
}

.banner-dots span.is-active {
  background: #fff;
}

/* —— 最新开奖 —— */
.latest {
  background: #fff;
  margin: 0 0 12px;
  border: 3px solid #2e7d32;
  box-sizing: border-box;
}

.panel-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #2e7d32;
  color: #fff;
  padding: 8px 12px;
}

.panel-bar h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}

.panel-clock {
  font-size: 12px;
  opacity: 0.95;
  font-variant-numeric: tabular-nums;
}

.lottery-tabs {
  display: flex;
  gap: 0;
  padding: 12px 14px 0;
  background: #fff;
  box-sizing: border-box;
}

.lottery-tabs button {
  flex: 1;
  border: 1px solid #2e7d32;
  background: #fff;
  color: #2e7d32;
  font-size: 14px;
  font-weight: 700;
  padding: 8px 6px;
  cursor: pointer;
  font-family: inherit;
}

.lottery-tabs button:first-child {
  border-radius: 0;
}

.lottery-tabs button + button {
  border-left: none;
}

.lottery-tabs button:last-child {
  border-radius: 0;
}

.lottery-tabs button.is-active {
  background: #2e7d32;
  color: #fff;
}

.latest-body {
  border: none;
  margin: 0;
  padding: 12px 14px 16px;
  border-radius: 0;
}

.countdown-section {
  border: 1px dashed #2e7d32;
  padding: 10px 12px 12px;
  margin-bottom: 10px;
  background: #fff;
  box-sizing: border-box;
}

.countdown-line {
  margin: 0 0 10px;
  font-size: 13px;
  color: #333;
  text-align: center;
}

.countdown-line strong {
  color: #2e7d32;
}

.countdown-boxes {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 12px;
}

.cd-unit {
  text-align: center;
}

.cd-unit .num {
  min-width: 56px;
  padding: 12px 14px;
  background: #2e7d32;
  color: #fff;
  font-size: 28px;
  font-weight: 800;
  border-radius: 10px;
  font-variant-numeric: tabular-nums;
  display: inline-block;
}

.cd-unit .label {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  color: #666;
}

.latest-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
  padding: 8px 12px;
  font-size: 12px;
  color: #555;
  flex-wrap: wrap;
  border: 1px solid #2e7d32;
  background: #fff5f5;
  box-sizing: border-box;
}

.btn-history {
  display: inline-block;
  padding: 4px 10px;
  background: #fff;
  color: #2e7d32;
  border: 1px solid #2e7d32;
  border-radius: 0;
  font-size: 12px;
  font-weight: 600;
}

.latest-balls {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: clamp(2px, 1.2vw, 10px);
  flex-wrap: nowrap;
  width: 100%;
  box-sizing: border-box;
}

.latest-balls .ball {
  flex: 1 1 0;
  min-width: 0;
  max-width: 72px;
  width: auto;
  background: transparent;
  border: none;
  border-radius: 0;
  overflow: visible;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.latest-balls .ball__num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 1 / 1;
  height: auto;
  padding: 0;
  border-radius: 50%;
  box-sizing: border-box;
  font-size: clamp(11px, 4vw, 22px);
  font-weight: 800;
  color: #111827;
  line-height: 1;
  background-color: transparent;
  background-repeat: no-repeat;
  background-position: center center;
  background-size: 112% 112%;
  box-shadow: none;
}

.latest-balls .ball__num.tone-red {
  background-image: url("../img/ball-red.svg");
  background-color: transparent;
}

.latest-balls .ball__num.tone-blue {
  background-image: url("../img/ball-blue.svg");
  background-color: transparent;
}

.latest-balls .ball__num.tone-green {
  background-image: url("../img/ball-green.svg");
  background-color: transparent;
}

.latest-balls .ball__zodiac {
  font-size: clamp(9px, 2.8vw, 15px);
  font-weight: 600;
  color: #000;
  line-height: 1.2;
  background: transparent;
  white-space: nowrap;
}

.latest-balls .ball-plus {
  flex: 0 0 auto;
  align-self: center;
  padding: 0 1px;
  margin-bottom: 1.1em;
  font-size: clamp(14px, 4vw, 24px);
  font-weight: 700;
  color: #f97316;
  line-height: 1;
}

.latest-balls .ball.is-special .ball__num {
  box-shadow: none;
}

.tab-panel {
  display: none;
}

.tab-panel.is-active {
  display: block;
}

/* —— 主站下半区 —— */
.main-import {
  margin: 0 0 16px;
}

.domain-notice {
  display: flex;
  overflow: hidden;
  border: 1px solid #2e7d32;
  border-radius: 0;
  background: #fff;
  margin-bottom: 12px;
}

.domain-notice-label {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  min-height: 66px;
  padding: 6px 4px;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  background: #2e7d32;
  flex: 0 0 52px;
}

.domain-notice-body {
  flex: 1;
  min-width: 0;
}

.domain-notice-line {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 2px;
  min-height: 33px;
  padding: 6px 8px;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}

.domain-notice-line-title {
  background: #e8f5e9;
  border-bottom: 1px solid #c8e6c9;
}

.domain-notice-arrow {
  max-width: 18px;
  height: auto;
  margin-right: 4px;
}

.domain-banner-red {
  color: #e53935;
}

.domain-banner-blue {
  color: #1e88e5;
}

.domain-banner-green {
  color: #2e7d32;
}

.jb-mod {
  margin-bottom: 12px;
}

.mod-head {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #2e7d32;
  padding: 0 8px 0 0;
}

.mod-head .mod-title {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  padding: 10px 12px;
  background: transparent;
  font-size: 14px;
  line-height: 1.35;
}

.mod-more {
  flex: 0 0 auto;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  padding: 4px 10px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 4px;
  white-space: nowrap;
}

.mod-more:active {
  background: rgba(255, 255, 255, 0.15);
}

.jb-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.jb-list li a {
  display: block;
  padding: 10px 12px;
  border-bottom: 1px solid #eef5ee;
  font-size: 14px;
  font-weight: 700;
  color: #222;
  text-align: center;
  line-height: 1.4;
}

.jb-list li a:active {
  background: #f5faf5;
}

.jb-list .qishu {
  color: #2e7d32;
}

.jb-foot {
  padding: 10px 12px;
  background: #2e7d32;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}

.featured-body {
  padding: 12px;
  font-size: 15px;
  line-height: 1.7;
  color: #222;
  text-align: center;
  word-break: break-word;
  overflow-wrap: anywhere;
  background: #fff;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.featured-body img {
  max-width: 100%;
  height: auto;
  margin: 0 auto;
}

.featured-body article,
.featured-body .mod-record {
  max-width: 100%;
  box-sizing: border-box;
}

.featured-body table,
.featured-body table[width] {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  margin: 0 auto;
  table-layout: fixed !important;
}

.featured-body th,
.featured-body td,
.featured-body th[width],
.featured-body td[width] {
  width: auto !important;
  min-width: 0 !important;
  word-break: break-all;
  overflow-wrap: anywhere;
}

.recommend-mod {
  margin: 0 0 12px;
}

.recommend-mod .recommend-item {
  margin-bottom: 12px;
  overflow-x: auto;
  overflow-y: hidden;
}

.recommend-mod .recommend-item:last-child {
  margin-bottom: 0;
}

.recommend-badge {
  display: inline-block;
  vertical-align: middle;
  margin-right: 8px;
  padding: 2px 8px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
  color: #fff;
  background: #e53935;
  border-radius: 3px;
  letter-spacing: 1px;
}

.recommend-title-text {
  vertical-align: middle;
}

.main-import-frame {
  margin: 0 0 12px;
  border: 1px solid #c8e6c9;
  border-radius: 0;
  overflow: hidden;
  background: #fff;
}

.main-iframe {
  display: block;
  width: 100%;
  border: 0;
  min-height: 120px;
  overflow: hidden;
  background: #fff;
}

.site-declare {
  margin: 0;
  border: 1px solid #c8e6c9;
  background: #fff;
  padding: 14px 12px 20px;
  text-align: center;
}

.site-declare-title {
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 800;
  color: #2e7d32;
}

.site-declare-cont {
  margin: 0 0 8px;
  font-size: 13px;
  color: #555;
  line-height: 1.55;
  text-align: left;
}

.site-declare-domain {
  margin: 12px 0 6px;
  font-size: 13px;
  color: #333;
  font-weight: 700;
  line-height: 1.5;
}

.site-declare-copy {
  margin: 8px 0 0;
  font-size: 12px;
  color: #90a4ae;
}

/* —— 资料模块（兼容） —— */
.mod {
  margin: 0 0 16px;
  border: 1px solid #c8e6c9;
  border-radius: 0;
  overflow: hidden;
  background: #fff;
}

.mod-title {
  margin: 0;
  padding: 10px 12px;
  background: #2e7d32;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
}

.mod-body {
  padding: 0;
}

/* 占位页 */
.placeholder-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: #e8f5e9;
  padding: 24px;
  text-align: center;
}

.placeholder-page h1 {
  margin: 0;
  font-size: 18px;
  color: #2e7d32;
}

.placeholder-page a {
  color: #1565c0;
  font-weight: 700;
}

/* —— 历史开奖页 —— */
.history-body {
  background: #e8f5e9;
  height: 100%;
  overflow: hidden;
}

html:has(.history-body),
html:has(.history-body) body {
  height: 100%;
  overflow: hidden;
}

.history-page {
  height: 100%;
  min-height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
}

.history-shell {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  max-height: 100dvh;
  overflow: hidden;
  padding-bottom: 0;
}

.history-sticky {
  flex: 0 0 auto;
  z-index: 20;
  background: #fff;
}

.history-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: #fff;
  border: 1px solid #2e7d32;
  border-top: none;
}

.history-top {
  background: #fff;
  border: 1px solid #2e7d32;
  border-bottom: none;
}

.history-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid #c8e6c9;
}

.history-brand {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.history-domain {
  font-size: 14px;
  font-weight: 700;
  color: #1565c0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-back {
  flex: 0 0 auto;
  padding: 4px 12px;
  background: #2e7d32;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  border-radius: 4px;
  text-decoration: none;
}

.history-latest {
  padding: 10px 8px 12px;
}

.history-latest-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  padding: 0 4px;
}

.history-latest-meta .lottery-name {
  font-size: 15px;
  font-weight: 800;
  color: #1b5e20;
}

.history-datebar {
  background: #2e7d32;
  color: #fff;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 8px;
  border: 1px solid #2e7d32;
  border-top: none;
}

.history-filters {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 8px;
  padding: 10px 8px;
  background: #fff;
  border: 1px solid #2e7d32;
  border-top: none;
}

.history-filters select {
  width: 100%;
  padding: 8px 6px;
  border: 1px solid #81c784;
  border-radius: 4px;
  background: #fff;
  font-size: 13px;
  color: #222;
}

.history-loading {
  margin: 16px 8px;
  text-align: center;
  font-size: 14px;
  color: #666;
}

.history-list {
  border: none;
  background: #fff;
}

.history-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 8px;
  border-bottom: 1px solid #e0e0e0;
}

.history-item:nth-child(odd) {
  background: #fff8f8;
}

.history-item:nth-child(even) {
  background: #fff;
}

.history-item-meta {
  flex: 0 0 72px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.25;
}

.history-item-date {
  font-size: 12px;
  color: #444;
  font-variant-numeric: tabular-nums;
}

.history-item-issue {
  font-size: 13px;
  font-weight: 800;
  color: #111;
}

.history-item-balls {
  flex: 1 1 auto;
  min-width: 0;
}

.history-item-balls .ball__num {
  font-size: clamp(10px, 3.2vw, 16px);
}

.history-item-balls .ball__zodiac {
  font-size: clamp(8px, 2.2vw, 11px);
}

.history-item-balls .ball-plus {
  margin-bottom: 0.9em;
  font-size: clamp(12px, 3vw, 18px);
}

.history-empty {
  padding: 32px 12px;
  text-align: center;
  color: #888;
  font-size: 14px;
}

@media (max-width: 380px) {
  .history-item-meta {
    flex-basis: 64px;
  }

  .history-filters {
    grid-template-columns: 1fr;
  }
}
