:root {
  --ink: #10263b;
  --ink-soft: #536477;
  --muted: #83919d;
  --navy: #082f55;
  --navy-deep: #061f38;
  --red: #c9252d;
  --red-dark: #9e1720;
  --blue: #1675b8;
  --green: #2b9167;
  --gold: #e4b45e;
  --canvas: #f3f6f8;
  --paper: #fff;
  --line: #dfe6eb;
  --shadow: 0 18px 46px rgba(16, 38, 59, .09);
  --max: 1240px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  color: var(--ink);
  background: var(--canvas);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button { cursor: pointer; }
svg { display: block; }

.site-header {
  color: var(--ink);
  background: rgba(255, 255, 255, .98);
  border-bottom: 1px solid var(--line);
}

.header-main {
  display: flex;
  min-height: 76px;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  width: 43px;
  height: 43px;
  place-items: center;
  color: #fff;
  background: var(--red);
  border-radius: 13px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18),
    0 7px 18px rgba(201, 37, 45, .18);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -.05em;
}

.brand-title {
  display: block;
  font-size: 17px;
  font-weight: 750;
  letter-spacing: .02em;
}

.brand-subtitle {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 8px;
  font-weight: 600;
  letter-spacing: .13em;
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 9px;
}

.header-link {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  gap: 7px;
  padding: 0 11px;
  color: #5d6f7d;
  background: #fff;
  border: 1px solid #dbe3e8;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 650;
}

.header-link:hover { color: var(--red); border-color: #e4bbbb; }
.header-link svg { width: 14px; }
.header-link.admin svg { color: var(--red); }

.main-nav {
  display: flex;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
  gap: 34px;
}

.main-nav a {
  position: relative;
  display: flex;
  height: 47px;
  align-items: center;
  color: #5b6c7b;
  font-size: 12px;
  font-weight: 650;
}

.main-nav a:hover,
.main-nav a.active { color: var(--ink); }

.main-nav a.active::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 3px;
  background: var(--red);
  border-radius: 3px 3px 0 0;
  content: "";
}

.page-wrap {
  width: 100%;
  min-width: 0;
  flex: 1;
  max-width: var(--max);
  margin: 0 auto;
  padding: 31px 24px 58px;
}

.page-title-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 17px;
}

.page-eyebrow {
  margin-bottom: 7px;
  color: var(--red);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .17em;
}

.page-title-row h1 {
  margin: 0;
  font-size: 27px;
  font-weight: 760;
  letter-spacing: -.025em;
}

.page-title-row p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.data-source {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  color: #687a87;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 9px;
  font-weight: 650;
}

.data-source i {
  width: 5px;
  height: 5px;
  background: var(--gold);
  border-radius: 50%;
}

.data-source.connected { color: #3f745e; background: #eef7f2; border-color: #d8eade; }
.data-source.connected i { background: var(--green); }
.data-source.manual { color: #687a87; background: #f6f8f9; }
.data-source.manual i { background: #7f929f; }

.lottery-switcher {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  padding: 9px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 8px 28px rgba(16, 38, 59, .035);
  overflow-x: auto;
}

.lottery-tab {
  display: flex;
  flex: 1;
  min-width: 0;
  align-items: center;
  gap: 9px;
  padding: 9px 11px;
  color: #647584;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  text-align: left;
}

.lottery-tab:hover { background: #f7f9fa; color: var(--ink); }
.lottery-tab.active { color: var(--ink); background: #f8f1ed; border-color: #eddad0; }

.lottery-code {
  display: grid;
  flex: none;
  width: 31px;
  height: 31px;
  place-items: center;
  color: #82909c;
  background: #f1f4f6;
  border-radius: 8px;
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-size: 8px;
  font-weight: 700;
}

.lottery-tab.active .lottery-code { color: #fff; background: var(--red); }
.lottery-copy { min-width: 0; }
.lottery-copy strong { display: block; font-size: 11px; font-weight: 750; white-space: nowrap; }
.lottery-copy small { display: block; margin-top: 3px; color: #96a2ac; font-size: 8px; white-space: nowrap; }

.panel {
  min-width: 0;
  overflow: hidden;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 10px 32px rgba(16, 38, 59, .045);
}

.panel-head {
  display: flex;
  min-height: 59px;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 0 21px;
  border-bottom: 1px solid #e9eef1;
}

.panel-head h2,
.panel-head h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 750;
}

.panel-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 9px;
}

.page-stack { display: grid; gap: 18px; }
.two-col { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(280px, .7fr); gap: 18px; }

.filter-row {
  display: flex;
  align-items: center;
  gap: 9px;
}

.search-input,
.select-input {
  height: 32px;
  padding: 0 10px;
  color: var(--ink);
  background: #f8fafb;
  border: 1px solid #dce4e9;
  border-radius: 7px;
  outline: 0;
  font-size: 9px;
}

.search-input { width: 150px; }
.search-input:focus,
.select-input:focus { border-color: rgba(201, 37, 45, .5); background: #fff; }

.table-scroll { overflow-x: auto; }
.data-table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
}

.data-table th {
  height: 37px;
  padding: 0 12px;
  color: #96a2ac;
  background: #fbfcfc;
  font-size: 8px;
  font-weight: 650;
  text-align: left;
}

.data-table th:first-child,
.data-table td:first-child { padding-left: 21px; }
.data-table th:last-child,
.data-table td:last-child { padding-right: 21px; text-align: right; }

.data-table td {
  height: 53px;
  padding: 0 12px;
  color: #5b6d7b;
  border-top: 1px solid #edf1f3;
  font-size: 9px;
  white-space: nowrap;
}

.issue-text {
  color: var(--ink);
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-weight: 700;
}

.balls {
  display: flex;
  align-items: flex-start;
  gap: 5px;
}

.ball-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.ball {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  color: #fff;
  border-radius: 50%;
  box-shadow: inset 2px 2px 5px rgba(255, 255, 255, .18),
    0 2px 5px rgba(16, 38, 59, .12);
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-size: 9px;
  font-weight: 700;
}

.ball-zodiac {
  color: #8795a0;
  font-size: 7px;
  font-weight: 650;
  line-height: 1;
}

.ball.red { background: #c92d35; }
.ball.blue { background: #207ab2; }
.ball.green { background: #2c9069; }
.ball.special { border: 1.5px solid var(--gold); }
.ball.large { width: 53px; height: 53px; font-size: 18px; }

.status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #39785d;
  font-size: 8px;
  font-weight: 700;
}

.status::before { width: 5px; height: 5px; background: currentColor; border-radius: 50%; content: ""; }

.link-button {
  padding: 0;
  color: #6d7e8a;
  background: transparent;
  border: 0;
  font-size: 9px;
  font-weight: 650;
}

.link-button:hover { color: var(--red); }
.link-button:disabled { color: #b2bcc3; cursor: not-allowed; }

.empty-state {
  padding: 56px 20px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 16px 20px;
  border-bottom: 1px solid #edf1f3;
}

.summary-item {
  padding: 10px 12px;
  background: #f8fafb;
  border-radius: 9px;
}

.summary-item span { display: block; color: #8b99a4; font-size: 8px; }
.summary-item strong {
  display: block;
  margin-top: 5px;
  color: var(--ink);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.history-panel .summary-strip {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.history-panel .filter-row {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.history-year-overview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 0 20px 16px;
  border-bottom: 1px solid #edf1f3;
}

.history-year-overview > div {
  min-width: 0;
  padding: 12px;
  background: #fff;
  border: 1px solid #e6ecef;
  border-radius: 9px;
}

.history-year-overview span,
.history-year-overview small { display: block; }
.history-year-overview span { color: #8997a1; font-size: 8px; }
.history-year-overview strong {
  display: block;
  margin-top: 5px;
  color: var(--ink);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.history-year-overview small { margin-top: 4px; color: #a0aab2; font-size: 7px; }

.history-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 14px 20px;
  color: #7c8b96;
  border-top: 1px solid #edf1f3;
  font-size: 9px;
}

.history-pagination .link-button {
  min-height: 30px;
  padding: 0 11px;
  background: #f7f9fa;
  border: 1px solid #e1e8eb;
  border-radius: 7px;
}

.calendar-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 18px;
}

.calendar-card { padding: 20px; }
.calendar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.calendar-month {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  font-weight: 600;
}

.calendar-actions { display: flex; gap: 7px; }
.icon-button {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  color: #687986;
  background: #f5f7f8;
  border: 0;
  border-radius: 7px;
}

.icon-button:hover { color: var(--red); background: #fbf0ee; }
.icon-button svg { width: 13px; }

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.weekday {
  padding-bottom: 4px;
  color: #929ea8;
  font-size: 8px;
  font-weight: 700;
  text-align: center;
}

.calendar-day {
  position: relative;
  display: grid;
  min-height: 52px;
  place-items: center;
  color: #526472;
  background: #fafbfc;
  border: 1px solid transparent;
  border-radius: 9px;
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-size: 10px;
}

.calendar-day.out { color: #d0d7dc; background: transparent; }
.calendar-day.draw { color: var(--red); font-weight: 700; }
.calendar-day.draw::after {
  position: absolute;
  bottom: 7px;
  width: 4px;
  height: 4px;
  background: var(--red);
  border-radius: 50%;
  content: "";
}

.calendar-day.next {
  color: #fff;
  background: var(--red);
  box-shadow: 0 5px 13px rgba(201, 37, 45, .2);
}

.calendar-day.next::after { background: #fff; }
.calendar-day.selected { border-color: var(--red); }
.calendar-legend {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin-top: 16px;
  color: #8896a1;
  font-size: 8px;
}

.legend-item { display: flex; align-items: center; gap: 5px; }
.legend-item i { width: 5px; height: 5px; background: var(--red); border-radius: 50%; }
.legend-item span.box { width: 10px; height: 10px; background: #fae1db; border-radius: 3px; }

.selected-date {
  padding: 20px;
}

.selected-date .date-label {
  color: var(--red);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 32px;
  font-weight: 500;
}

.selected-date .date-meta { margin-top: 5px; color: var(--muted); font-size: 9px; }
.selected-date .balls { margin-top: 18px; flex-wrap: wrap; }
.selected-date .hint { margin-top: 18px; color: #8d99a3; font-size: 9px; line-height: 1.7; }

.trend-hero {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding: 16px;
  border-bottom: 1px solid #e9eef1;
}

.metric-card {
  padding: 13px;
  background: #f8fafb;
  border-radius: 10px;
}

.metric-card span { color: #8d9aa4; font-size: 8px; }
.metric-card strong { display: block; margin-top: 6px; font-size: 18px; }
.metric-card small { margin-left: 3px; color: #8e9aa4; font-size: 8px; }

.trend-content { padding: 21px; }
.section-label { margin: 0 0 13px; color: #738491; font-size: 10px; font-weight: 700; }
.heat-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 7px;
}

.heat-cell {
  display: grid;
  min-height: 49px;
  place-items: center;
  color: #fff;
  border-radius: 9px;
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-size: 9px;
  font-weight: 700;
  opacity: .35;
  text-align: center;
}

.heat-cell span { display: block; padding-top: 2px; font-size: 7px; font-weight: 500; opacity: .86; }
.heat-cell.red { background: var(--red); }
.heat-cell.blue { background: var(--blue); }
.heat-cell.green { background: var(--green); }

.distribution {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 26px;
}

.distribution-card { padding: 16px; background: #f9fafb; border-radius: 12px; }
.distribution-card h4 { margin: 0 0 13px; font-size: 10px; }
.distribution-row { margin-top: 10px; }
.distribution-row label { display: flex; justify-content: space-between; color: #788995; font-size: 8px; }
.progress { height: 7px; margin-top: 5px; overflow: hidden; background: #e8edf0; border-radius: 999px; }
.progress span { display: block; height: 100%; background: linear-gradient(90deg, #efb5b0, var(--red)); border-radius: inherit; }

.trend-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  padding: 13px 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.trend-overview {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.9fr);
  gap: 14px;
  margin-bottom: 14px;
}

.trend-latest-card {
  position: relative;
  overflow: hidden;
  padding: 18px;
  color: #fff;
  background:
    radial-gradient(circle at 88% 12%, rgba(232, 196, 119, .2), transparent 34%),
    radial-gradient(circle at 20% 110%, rgba(92, 178, 146, .16), transparent 38%),
    linear-gradient(135deg, #163f38, #0b2d29 58%, #071f1c);
  border: 1px solid rgba(204, 232, 219, .12);
  border-radius: 14px;
  box-shadow: 0 15px 34px rgba(8, 50, 43, .2);
}

.trend-latest-card::after {
  position: absolute;
  right: -54px;
  bottom: -76px;
  width: 210px;
  height: 210px;
  border: 1px solid rgba(216, 190, 126, .14);
  border-radius: 50%;
  box-shadow:
    0 0 0 25px rgba(216, 190, 126, .035),
    0 0 0 51px rgba(216, 190, 126, .025);
  content: "";
  pointer-events: none;
}

.trend-latest-card .eyebrow-label {
  position: relative;
  z-index: 1;
  color: #a9c9bd;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .1em;
}

.trend-latest-issue {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin-top: 8px;
  white-space: nowrap;
}

.trend-latest-issue > span {
  color: #dcebe5;
  font-family: "PingFang SC", "Hiragino Sans GB", sans-serif;
  font-size: 17px;
  font-weight: 600;
}

.trend-latest-issue > strong {
  color: #fff;
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-size: 31px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  letter-spacing: .015em;
  line-height: 1;
}

.trend-latest-date {
  position: relative;
  z-index: 1;
  display: block;
  margin-top: 7px;
  color: #9fc3b7;
  font-variant-numeric: tabular-nums;
  font-size: 8px;
}

.trend-latest-ball-row {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin-top: 16px;
}

.trend-latest-ball-row .ball-unit {
  color: #fff;
}

.trend-latest-ball-row .ball-zodiac {
  color: #e1c47e;
}

.trend-metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.trend-metric {
  padding: 15px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.trend-metric span { display: block; color: #84929d; font-size: 8px; }
.trend-metric strong { display: block; margin-top: 7px; font-size: 19px; }
.trend-metric small { margin-left: 4px; color: #8d9aa4; font-size: 8px; }
.trend-metric em { margin-left: 5px; color: var(--red); font-size: 10px; font-style: normal; }

.trend-controls-copy strong {
  display: block;
  font-size: 11px;
}

.trend-controls-copy span {
  display: block;
  margin-top: 4px;
  color: #8997a2;
  font-size: 8px;
}

.period-control {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #7a8a96;
  font-size: 9px;
}

.period-control select {
  height: 32px;
  padding: 0 9px;
  color: var(--ink);
  background: #f8fafb;
  border: 1px solid #dce4e9;
  border-radius: 7px;
  outline: 0;
}

.trend-group-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 22px 0 11px;
}

.trend-group-heading span {
  display: grid;
  width: 23px;
  height: 23px;
  place-items: center;
  color: var(--red);
  background: #fbeaea;
  border-radius: 7px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 9px;
  font-weight: 700;
}

.trend-group-heading h2 {
  margin: 0;
  font-size: 15px;
}

.trend-chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.trend-chart-card {
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 7px 26px rgba(16, 38, 59, .035);
}

.trend-chart-grid > .trend-chart-card:nth-child(5) {
  grid-column: 1 / -1;
}

.trend-chart-grid > .trend-chart-card:nth-child(5) .donut-layout {
  max-width: 620px;
  margin: 0 auto;
  grid-template-columns: minmax(190px, 250px) minmax(260px, 1fr);
}

.trend-chart-head {
  display: flex;
  min-height: 54px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 17px;
  border-bottom: 1px solid #edf1f3;
}

.trend-chart-head h3 {
  margin: 0;
  font-size: 12px;
}

.trend-chart-head p {
  margin: 4px 0 0;
  color: #8b98a2;
  font-size: 8px;
}

.period-pill {
  flex: none;
  padding: 5px 8px;
  color: #6f7f8c;
  background: #f4f7f9;
  border-radius: 6px;
  font-size: 8px;
  font-weight: 650;
}

.trend-chart-body {
  min-height: 228px;
  padding: 14px 14px 8px;
}

.trend-chart-body svg {
  width: 100%;
  height: auto;
}

.chart-empty {
  display: grid;
  min-height: 190px;
  place-items: center;
  color: #8997a2;
  font-size: 9px;
}

.donut-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  align-items: center;
  min-height: 205px;
  gap: 12px;
}

.donut-svg {
  max-width: 200px;
  margin: 0 auto;
}

.donut-center-value {
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-size: 18px;
  font-weight: 700;
  fill: var(--ink);
}

.donut-center-label {
  fill: #84929d;
  font-size: 8px;
}

.chart-legend-list {
  display: grid;
  gap: 6px;
}

.chart-legend-row {
  display: grid;
  grid-template-columns: 8px 1fr auto;
  align-items: center;
  gap: 7px;
  color: #6f808d;
  font-size: 8px;
}

.chart-legend-row i {
  width: 7px;
  height: 7px;
  border-radius: 2px;
}

.chart-legend-row strong {
  color: var(--ink);
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-size: 8px;
}

.trend-data-note {
  margin-top: 12px;
  color: #8996a0;
  font-size: 8px;
  line-height: 1.7;
}

.dividend-list { padding: 20px; }
.prize-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.prize-card { padding: 16px; background: #f8fafb; border-radius: 11px; }
.prize-card span { color: #8997a2; font-size: 8px; }
.prize-card strong { display: block; margin-top: 8px; font-family: Georgia, "Times New Roman", serif; font-size: 18px; font-weight: 500; }
.notice-box {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: 16px;
  padding: 13px;
  color: #81735e;
  background: #fbf6eb;
  border: 1px solid #eee0c3;
  border-radius: 10px;
  font-size: 9px;
  line-height: 1.65;
}

.notice-box svg { width: 14px; flex: none; color: var(--gold); }

.random-material-stack { display: grid; gap: 16px; }
.random-material-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 2px;
}

.random-material-head h2 {
  margin: 0;
  font-size: 19px;
}

.random-material-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 9px;
}

.random-badge,
.random-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 0 10px;
  color: var(--red);
  background: #fbeaea;
  border: 1px solid #f0d2d2;
  border-radius: 7px;
  font-size: 8px;
  font-weight: 700;
  white-space: nowrap;
}

.random-material-panel { padding-bottom: 18px; }

.random-number-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 8px;
  padding: 18px 20px 0;
}

.random-number {
  display: flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  color: #264058;
  background: #f6f9fb;
  border: 1px solid #e2e9ed;
  border-radius: 7px;
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .04em;
}

.data-library-panel {
  margin-top: 16px;
  padding-bottom: 20px;
}

.data-library-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid #e9eef1;
}

.data-library-head h2 {
  margin: 0;
  font-size: 17px;
}

.data-library-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.6;
}

.data-library-current {
  flex: none;
  padding: 7px 10px;
  color: #85601e;
  background: #fbf3df;
  border: 1px solid #ead8af;
  border-radius: 7px;
  font-size: 8px;
  font-weight: 700;
}

.data-library-tabs {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 5px;
  padding: 12px 20px 0;
}

.data-library-tabs button {
  display: flex;
  min-height: 32px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 2px;
  padding: 0 8px;
  color: #687a85;
  background: #f5f7f8;
  border: 1px solid #e5ebee;
  border-radius: 7px;
  font-size: 8px;
  font-weight: 700;
}

.data-library-tabs button strong {
  font-size: 8px;
}

.data-library-tabs button small {
  color: #93a0a8;
  font-size: 7px;
  font-weight: 500;
}

.data-library-tabs button.active {
  color: #fff;
  background: var(--red);
  border-color: var(--red);
}

.data-library-tabs button.active small {
  color: rgba(255, 255, 255, .72);
}

.data-library-tip {
  margin: 8px 20px 0;
  color: #89969f;
  font-size: 8px;
  line-height: 1.5;
}

.data-library-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 16px 20px 0;
  overflow: hidden;
  background: #f8fafb;
  border: 1px solid #e7edf0;
  border-radius: 12px;
}

.data-library-stat {
  min-width: 0;
  padding: 13px 14px;
  border-left: 1px solid #e7edf0;
}

.data-library-stat:first-child { border-left: 0; }
.data-library-stat span,
.data-library-stat small { display: block; }
.data-library-stat span { color: #8b99a3; font-size: 8px; }
.data-library-stat strong {
  display: block;
  margin-top: 5px;
  color: var(--ink);
  font-family: "Trebuchet MS", "PingFang SC", sans-serif;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.data-library-stat small { margin-top: 4px; color: #9aa5ad; font-size: 7px; }

.data-library-grid {
  display: block;
  padding: 12px 20px 0;
}

.data-library-card {
  display: none;
  min-width: 0;
  padding: 16px;
  background: #fff;
  border: 1px solid #e7edf0;
  border-radius: 12px;
}

.data-library-card.active { display: block; }

.data-library-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.data-library-card-head h3 {
  margin: 0;
  color: var(--ink);
  font-size: 12px;
}

.data-library-card-head p {
  margin: 4px 0 0;
  color: #8a98a3;
  font-size: 8px;
  line-height: 1.5;
}

.data-library-card-head > span {
  flex: none;
  padding: 4px 7px;
  color: #7d8c97;
  background: #fff;
  border: 1px solid #e1e8eb;
  border-radius: 6px;
  font-size: 7px;
  font-weight: 700;
}

.data-library-zodiac-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 13px;
}

.data-library-zodiac {
  min-width: 0;
  padding: 10px;
  background: #fff;
  border: 1px solid #e3eaed;
  border-radius: 9px;
}

.data-library-zodiac.current {
  background: #fffaf0;
  border-color: #dfbd72;
}

.data-library-zodiac > div:first-child {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 7px;
}

.data-library-zodiac strong {
  color: var(--red);
  font-size: 16px;
}

.data-library-zodiac span {
  color: #8c99a2;
  font-size: 7px;
}

.data-library-rows {
  display: grid;
  gap: 9px;
  margin-top: 13px;
}

.data-library-row {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
}

.data-library-row-label strong,
.data-library-row-label small { display: block; }
.data-library-row-label strong { color: #536976; font-size: 8px; }
.data-library-row-label small { margin-top: 3px; color: #9aa5ad; font-size: 7px; }

.data-library-numbers {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 1px 6px;
}

.data-library-numbers b {
  display: inline-flex;
  min-width: 20px;
  height: 22px;
  flex: none;
  align-items: center;
  justify-content: center;
  padding: 0 2px;
  color: #38515f;
  background: transparent;
  border-radius: 4px;
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-size: 8px;
  font-weight: 700;
}

.data-library-numbers b.current {
  color: #9e241f;
  background: #ffe8a8;
}

.random-secondary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.random-zodiac-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 18px 20px 0;
}

.random-zodiac {
  display: grid;
  min-height: 82px;
  place-items: center;
  color: var(--red);
  background: #fff8f6;
  border: 1px solid #f0d9d3;
  border-radius: 11px;
  font-size: 22px;
  font-weight: 750;
}

.random-head-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 18px 20px 0;
}

.random-head {
  display: grid;
  min-height: 82px;
  place-items: center;
  color: var(--ink);
  background: #f7fafb;
  border: 1px solid #dfe8ec;
  border-radius: 11px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 29px;
  font-weight: 600;
}

.random-head small {
  margin-top: -15px;
  color: #86949f;
  font-family: "PingFang SC", sans-serif;
  font-size: 8px;
  font-weight: 500;
}

.material-history-panel {
  overflow: hidden;
  border-top: 3px solid var(--red);
}

.material-history-head {
  display: flex;
  min-height: 62px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 20px;
  color: var(--ink);
  background: #fff;
}

.material-history-head h2 {
  margin: 0;
  font-size: 14px;
  color: var(--ink);
}

.material-history-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 8px;
}

.material-history-tabs {
  display: flex;
  padding: 3px;
  background: #f2f5f6;
  border-radius: 8px;
}

.material-history-tabs button {
  min-height: 30px;
  padding: 0 11px;
  color: #74828c;
  background: transparent;
  border: 0;
  border-radius: 6px;
  font-size: 8px;
  font-weight: 700;
}

.material-history-tabs button.active {
  color: #fff;
  background: var(--red);
}

.material-history-grid {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr) 112px;
}

.material-history-column-head {
  color: #75838e;
  background: #f3f6f7;
  border-bottom: 1px solid #dfe6ea;
  font-size: 7px;
  font-weight: 700;
  letter-spacing: .05em;
}

.material-history-column-head span {
  padding: 8px 12px;
  border-right: 1px solid #dfe6ea;
}

.material-history-column-head span:last-child {
  border-right: 0;
}

.material-history-row {
  background: #fff;
  border-bottom: 1px solid #e1e7ea;
}

.material-history-row:nth-child(even) {
  background: #fcfdfd;
}

.material-history-row.current {
  background: #fffaf0;
}

.material-history-row:last-child { border-bottom: 0; }

.material-history-legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px 15px;
  padding: 8px 20px;
  color: #76858f;
  background: #fbfcfc;
  border-bottom: 1px solid #e4eaed;
  font-size: 7px;
}

.material-history-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.material-history-legend i {
  width: 12px;
  height: 12px;
  background: #ffe590;
  border: 1px solid #e6cb70;
  border-radius: 2px;
}

.material-history-legend b {
  padding: 2px 5px;
  border-radius: 4px;
  font-size: 7px;
}

.material-history-legend b.is-hit {
  color: #237854;
  background: #e9f6ef;
}

.material-history-legend b.is-miss {
  color: #a34949;
  background: #faecec;
}

.material-history-issue {
  padding: 12px 10px 12px 18px;
  background: #fafbfc;
  border-right: 1px solid #e1e7ea;
}

.material-history-issue strong {
  display: block;
  color: var(--ink);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.material-history-issue small {
  display: block;
  margin-top: 4px;
  color: #8d9aa3;
  font-size: 7px;
  white-space: nowrap;
}

.material-history-content {
  min-width: 0;
  padding: 10px 13px;
  border-right: 1px solid #e1e7ea;
}

.material-history-data {
  margin-top: 0;
  padding: 0;
  color: #267ca4;
  background: transparent;
  border-radius: 0;
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.85;
  letter-spacing: .04em;
  overflow-wrap: anywhere;
}

.material-history-data b {
  display: inline-block;
  margin: 0 1px;
  padding: 1px 3px;
  font-weight: 700;
}

.material-history-data b.matched {
  color: #6d520d;
  background: #ffe590;
  border-radius: 2px;
}

.history-number-list {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 0 5px;
}

.history-zodiac-list b {
  color: #b42128;
  font-size: 15px;
}

.history-head-list {
  color: var(--ink);
  font-size: 15px;
}

.material-history-result {
  display: flex;
  align-content: center;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 3px;
  padding: 12px 10px;
}

.material-history-result > span {
  color: #8b989f;
  font-size: 7px;
}

.material-history-result strong {
  color: #425765;
  font-size: 11px;
  white-space: nowrap;
}

.material-history-result strong em {
  color: #b5222a;
  font-style: normal;
}

.material-history-result b {
  margin-left: 2px;
  padding: 3px 5px;
  border-radius: 4px;
  font-size: 9px;
}

.material-history-result b.is-hit {
  color: #237854;
  background: #e9f6ef;
}

.material-history-result b.is-miss {
  color: #a34949;
  background: #faecec;
}
}

.guide-overview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.guide-overview-item {
  position: relative;
  min-height: 92px;
  padding: 17px 18px;
  overflow: hidden;
  background: linear-gradient(145deg, #fff, #f8fafb);
  border: 1px solid #e2e9ee;
  border-radius: 14px;
  box-shadow: 0 8px 22px rgba(16, 38, 59, .045);
}

.guide-overview-item::after {
  position: absolute;
  top: 0;
  right: 0;
  width: 52px;
  height: 52px;
  background: radial-gradient(circle at top right, rgba(201, 37, 45, .09), transparent 68%);
  content: "";
}

.guide-overview-item.current {
  background: linear-gradient(145deg, #0a3154, #071f38);
  border-color: rgba(8, 47, 85, .5);
}

.guide-overview-item > span {
  display: block;
  color: #8a98a3;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .05em;
}

.guide-overview-item > strong {
  display: block;
  margin-top: 7px;
  color: var(--ink);
  font-family: "Trebuchet MS", "PingFang SC", sans-serif;
  font-size: 20px;
  line-height: 1.15;
}

.guide-overview-item > small {
  display: block;
  margin-top: 7px;
  color: #7d8d99;
  font-size: 8px;
  line-height: 1.45;
}

.guide-overview-item.current > span,
.guide-overview-item.current > small { color: #91aabe; }
.guide-overview-item.current > strong { color: #fff; }

.guide-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: stretch;
  gap: 18px;
  margin-bottom: 18px;
}

.guide-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 22px;
}

.guide-card-head,
.guide-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.guide-card-head .section-label,
.guide-section-head .section-label { margin-bottom: 5px; }
.guide-card h2,
.guide-section-head h2 { margin: 0; font-size: 16px; }
.guide-card > p { margin: 7px 0 0; color: var(--muted); font-size: 9px; line-height: 1.7; }

.guide-card-badge,
.guide-current-chip {
  flex: none;
  padding: 7px 10px;
  color: #805c20;
  background: #fbf3df;
  border: 1px solid #ead8af;
  border-radius: 7px;
  font-size: 8px;
  font-weight: 700;
}

.guide-draw-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 15px;
  padding: 16px;
  background: #f8fafb;
  border: 1px solid #edf1f3;
  border-radius: 11px;
}

.guide-draw-balls {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  gap: 6px;
}

.guide-draw-balls .ball { width: 29px; height: 29px; font-size: 10px; }
.guide-draw-balls .ball-zodiac { font-size: 8px; }

.guide-special-summary {
  min-width: 105px;
  padding-left: 16px;
  border-left: 1px solid #e2e8ec;
}

.guide-special-summary span,
.guide-special-summary small { display: block; }
.guide-special-summary span { color: #8d99a3; font-size: 8px; }
.guide-special-summary strong {
  display: block;
  margin: 4px 0 2px;
  color: var(--red);
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-size: 22px;
}
.guide-special-summary small { color: #667985; font-size: 8px; }

.step-list { display: grid; gap: 13px; margin-top: 18px; }
.step { display: flex; gap: 12px; }
.step-num {
  display: grid;
  flex: none;
  width: 28px;
  height: 25px;
  place-items: center;
  color: var(--red);
  background: #fbeaea;
  border-radius: 8px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 10px;
  font-weight: 700;
}

.step strong { display: block; font-size: 10px; }
.step p { margin: 4px 0 0; color: var(--muted); font-size: 8px; line-height: 1.65; }
.color-groups { display: grid; gap: 12px; margin-top: 17px; }
.color-group { padding: 13px; background: #f9fafb; border-radius: 10px; }
.color-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.color-group-head strong { display: flex; align-items: center; gap: 6px; font-size: 10px; }
.color-group-head > span { color: #94a0a9; font-size: 8px; }
.color-dot { width: 8px; height: 8px; border-radius: 50%; }
.color-dot.red { background: var(--red); }
.color-dot.blue { background: var(--blue); }
.color-dot.green { background: var(--green); }
.color-group p { margin: 7px 0 0; color: #748590; font-size: 8px; line-height: 1.7; }

.color-number-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 10px;
}

.color-number-list b {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  color: #fff;
  border-radius: 7px;
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-size: 7px;
}

.color-number-list b.red { background: #c92d35; }
.color-number-list b.blue { background: #207ab2; }
.color-number-list b.green { background: #2c9069; }

.guide-property-card {
  margin-bottom: 18px;
  padding: 22px;
}

.guide-section-head {
  align-items: center;
  margin-bottom: 17px;
}

.guide-section-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 9px;
}

.guide-property-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.guide-property-item {
  min-width: 0;
  min-height: 190px;
  padding: 15px;
  background: #f8fafb;
  border: 1px solid #e7edf0;
  border-radius: 11px;
}

.guide-property-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.guide-property-title > span {
  display: grid;
  width: 31px;
  height: 31px;
  flex: none;
  place-items: center;
  color: var(--red);
  background: #fbeaea;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 800;
}

.guide-property-title h3 { margin: 0; font-size: 11px; }
.guide-property-title p { margin: 3px 0 0; color: #8a98a3; font-size: 7px; line-height: 1.4; }
.guide-property-item > small { display: block; margin-top: 12px; color: #8b99a3; font-size: 7px; line-height: 1.55; }

.guide-zodiac-chips,
.guide-tail-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 13px;
}

.guide-zodiac-chips b,
.guide-tail-list b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 25px;
  height: 25px;
  color: #647783;
  background: #fff;
  border: 1px solid #e0e7eb;
  border-radius: 7px;
  font-size: 8px;
  font-weight: 700;
}

.guide-zodiac-chips b.active,
.guide-tail-list b.active {
  color: #8d5c18;
  background: #fff3d9;
  border-color: #e2bc71;
}

.guide-wave-chips {
  display: grid;
  gap: 7px;
  margin-top: 13px;
}

.guide-wave-chips > div {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 8px;
  background: #fff;
  border: 1px solid #e7edf0;
  border-radius: 7px;
}

.guide-wave-chips strong { font-size: 8px; }
.guide-wave-chips span { margin-left: auto; color: #8c99a2; font-size: 7px; }
.wave-swatch { width: 8px; height: 8px; border-radius: 50%; }
.wave-swatch.red { background: var(--red); }
.wave-swatch.blue { background: var(--blue); }
.wave-swatch.green { background: var(--green); }

.guide-head-list {
  display: grid;
  gap: 5px;
  margin-top: 13px;
}

.guide-head-list > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 7px;
  background: #fff;
  border: 1px solid #e7edf0;
  border-radius: 6px;
}

.guide-head-list strong { font-size: 8px; }
.guide-head-list span { color: #7e8e99; font-family: "Trebuchet MS", Arial, sans-serif; font-size: 7px; }
.guide-tail-list b span { margin-left: 3px; color: #a0aab2; font-size: 6px; }

.zodiac-map-card {
  padding: 22px;
}

.zodiac-map-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.zodiac-map-head h2 {
  margin: 0;
  font-size: 16px;
}

.zodiac-map-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 9px;
}

.zodiac-current-chip {
  flex: none;
  padding: 7px 10px;
  color: #8b6a2d;
  background: #fbf3df;
  border: 1px solid #ead8af;
  border-radius: 7px;
  font-size: 8px;
  font-weight: 700;
}

.zodiac-map-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 9px;
}

.zodiac-map-item {
  padding: 12px;
  background: #f8fafb;
  border: 1px solid #e6ecef;
  border-radius: 10px;
  transition: border-color .18s ease, box-shadow .18s ease;
}

.zodiac-map-item.current {
  background: #fffaf0;
  border-color: #dfbd72;
  box-shadow: 0 7px 18px rgba(174, 130, 45, .1);
}

.zodiac-map-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 9px;
}

.zodiac-map-title span {
  color: var(--red);
  font-size: 19px;
  font-weight: 750;
}

.zodiac-map-title small {
  color: #8a98a3;
  font-size: 7px;
}

.zodiac-number-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.zodiac-number-list b {
  display: grid;
  width: 23px;
  height: 23px;
  place-items: center;
  color: #fff;
  border-radius: 50%;
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-size: 7px;
  font-weight: 700;
}

.zodiac-number-list b.red { background: #c92d35; }
.zodiac-number-list b.blue { background: #207ab2; }
.zodiac-number-list b.green { background: #2c9069; }

.rule-list { margin: 16px 0 0; padding-left: 17px; color: #697b87; font-size: 9px; line-height: 1.9; }

.draw-dialog {
  width: min(470px, calc(100vw - 28px));
  padding: 0;
  border: 0;
  border-radius: 16px;
  box-shadow: 0 30px 80px rgba(6, 31, 56, .3);
}

.draw-dialog::backdrop { background: rgba(6, 31, 56, .5); backdrop-filter: blur(3px); }
.dialog-inner { padding: 22px; }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.dialog-head h3 { margin: 0; font-size: 17px; }
.dialog-head p { margin: 5px 0 0; color: var(--muted); font-size: 9px; }
.dialog-close { border: 0; background: #f5f7f8; border-radius: 7px; width: 28px; height: 28px; color: #70808d; }
.dialog-balls { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 20px; }
.dialog-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 18px; }
.dialog-meta div { padding: 11px; background: #f8fafb; border-radius: 8px; }
.dialog-meta span { display: block; color: #8b99a3; font-size: 8px; }
.dialog-meta strong { display: block; margin-top: 4px; font-size: 10px; }

.toast {
  position: fixed;
  z-index: 50;
  right: 22px;
  bottom: 22px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 14px;
  color: #fff;
  background: rgba(8, 47, 85, .97);
  border-radius: 9px;
  box-shadow: 0 12px 32px rgba(6, 31, 56, .24);
  font-size: 10px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: .18s ease;
}

.toast.show { opacity: 1; transform: none; }
.toast svg { width: 14px; color: #90d6b1; }

@media (max-width: 900px) {
  .two-col,
  .calendar-layout,
  .guide-grid,
  .random-secondary-grid { grid-template-columns: 1fr; }
  .guide-overview,
  .guide-property-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .trend-hero { grid-template-columns: repeat(2, 1fr); }
  .trend-overview { grid-template-columns: 1fr; }
  .trend-chart-grid { grid-template-columns: 1fr; }
  .zodiac-map-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .header-main { min-height: 67px; padding: 0 16px; }
  .brand-mark { width: 39px; height: 39px; border-radius: 12px; }
  .brand-title { font-size: 15px; }
  .brand-subtitle { display: none; }
  .header-link { width: 36px; padding: 0; justify-content: center; }
  .header-link span { display: none; }
  .header-link { font-size: 0; }
  .main-nav { overflow-x: auto; padding: 0 14px; gap: 19px; }
  .main-nav a { height: 44px; font-size: 11px; white-space: nowrap; }
  .page-wrap { padding: 22px 14px 42px; }
  .page-title-row { align-items: flex-start; }
  .page-title-row h1 { font-size: 23px; }
  .page-title-row p { max-width: 260px; line-height: 1.6; }
  .data-source { display: none; }
  .lottery-switcher { padding: 7px; }
  .lottery-tab { flex: none; min-width: 125px; }
  .filter-row { width: 100%; }
  .history-panel .filter-row { justify-content: flex-start; }
  .search-input { flex: 1; width: auto; }
  .panel-head { align-items: flex-start; flex-direction: column; padding: 14px 16px; }
  .history-table,
  .history-table tbody,
  .history-table tr,
  .history-table td { display: block; }
  .history-table { min-width: 0; }
  .history-table thead { display: none; }
  .history-table tr {
    display: grid;
    grid-template-columns: 1fr auto;
    row-gap: 9px;
    padding: 13px 16px;
    border-top: 1px solid #edf1f3;
  }
  .history-table tr:first-child { border-top: 0; }
  .history-table td,
  .history-table td:first-child,
  .history-table td:last-child {
    height: auto;
    padding: 0;
    border: 0;
    text-align: left;
  }
  .history-table td:nth-child(1) { order: 1; }
  .history-table td:nth-child(2) { order: 2; text-align: right; }
  .history-table td:nth-child(3) { grid-column: 1 / -1; order: 3; }
  .history-table td:nth-child(4) { order: 4; }
  .history-table td:nth-child(5) { order: 4; text-align: right; }
  .history-table .balls { justify-content: space-between; width: 100%; }
  .summary-strip { grid-template-columns: 1fr; padding: 12px 16px; }
  .history-panel .summary-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .history-year-overview { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 0 16px 14px; }
  .history-pagination { justify-content: center; padding: 13px 16px; }
  .calendar-card { padding: 15px; }
  .calendar-day { min-height: 43px; }
  .trend-hero { gap: 7px; padding: 12px; }
  .trend-content { padding: 16px; }
  .trend-controls { align-items: flex-start; flex-direction: column; }
  .period-control { width: 100%; justify-content: space-between; }
  .period-control select { flex: 1; }
  .trend-chart-card { border-radius: 12px; }
  .trend-chart-grid > .trend-chart-card:nth-child(5) { grid-column: auto; }
  .trend-chart-grid > .trend-chart-card:nth-child(5) .donut-layout {
    max-width: none;
    grid-template-columns: 155px 1fr;
  }
  .trend-chart-head { padding: 0 14px; }
  .trend-chart-body { min-height: 205px; padding: 10px 8px 5px; }
  .donut-layout { grid-template-columns: 155px 1fr; min-height: 180px; gap: 6px; }
  .donut-svg { max-width: 155px; }
  .heat-grid { gap: 5px; }
  .heat-cell { min-height: 42px; }
  .distribution { grid-template-columns: 1fr; }
  .prize-cards { grid-template-columns: 1fr; }
  .random-material-head { align-items: flex-start; }
  .random-badge { display: none; }
  .random-number-grid { grid-template-columns: repeat(12, minmax(0, 1fr)); padding: 14px 14px 0; gap: 4px; }
  .random-number { min-height: 30px; font-size: 10px; letter-spacing: 0; }
  .data-library-head { flex-direction: column; padding: 16px 14px; }
  .data-library-current { align-self: flex-start; }
  .data-library-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 12px 14px 0; }
  .data-library-tip { margin: 8px 14px 0; }
  .data-library-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 14px 14px 0; }
  .data-library-stat { border-top: 1px solid #e7edf0; }
  .data-library-stat:nth-child(-n+2) { border-top: 0; }
  .data-library-stat:nth-child(odd) { border-left: 0; }
  .data-library-grid { padding: 10px 14px 0; }
  .data-library-card { padding: 13px; border-radius: 10px; }
  .data-library-zodiac-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .data-library-zodiac { padding: 8px; }
  .data-library-zodiac strong { font-size: 15px; }
  .data-library-row { grid-template-columns: 55px minmax(0, 1fr); gap: 6px; }
  .data-library-numbers { gap: 1px 4px; }
  .data-library-numbers b { min-width: 18px; height: 20px; padding: 0 1px; font-size: 7px; }
  .random-zodiac-grid { grid-template-columns: repeat(2, 1fr); padding: 14px; gap: 6px; }
  .random-zodiac { min-height: 70px; }
  .random-head-grid { padding: 14px; gap: 6px; }
  .random-head { min-height: 70px; font-size: 25px; }
  .material-history-head { align-items: flex-start; flex-direction: column; padding: 14px; }
  .material-history-tabs { width: 100%; }
  .material-history-tabs button { flex: 1; padding: 0 5px; }
  .material-history-legend { align-items: flex-start; padding: 8px 14px; }
  .material-history-grid { grid-template-columns: 64px minmax(0, 1fr) 76px; }
  .material-history-column-head span { padding: 8px 6px; }
  .material-history-issue { padding: 10px 6px 10px 8px; }
  .material-history-issue strong { font-size: 9px; }
  .material-history-issue small { font-size: 6px; }
  .material-history-content { padding: 9px 7px; }
  .material-history-data { font-size: 10px; line-height: 1.8; letter-spacing: .02em; }
  .material-history-data b { margin: 0; padding: 1px 1px; }
  .history-number-list { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0 2px; }
  .history-zodiac-list b,
  .history-head-list { font-size: 12px; }
  .material-history-result { flex-direction: column; gap: 2px; padding: 9px 6px; }
  .material-history-result strong { font-size: 10px; }
  .material-history-result b { margin-left: 0; padding: 2px 3px; font-size: 7px; }
  .guide-overview { gap: 7px; margin-bottom: 12px; }
  .guide-overview-item { min-height: 84px; padding: 13px; border-radius: 11px; }
  .guide-overview-item > strong { margin-top: 6px; font-size: 17px; }
  .guide-overview-item > small { margin-top: 5px; line-height: 1.4; }
  .guide-grid { gap: 12px; margin-bottom: 12px; }
  .guide-card,
  .guide-property-card { padding: 16px; border-radius: 12px; }
  .guide-card-head,
  .guide-section-head { align-items: flex-start; flex-direction: column; gap: 9px; }
  .guide-draw-preview { align-items: stretch; flex-direction: column; padding: 13px; }
  .guide-draw-balls { justify-content: space-between; gap: 3px; }
  .guide-draw-balls .ball { width: 27px; height: 27px; }
  .guide-special-summary {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 11px 0 0;
    border-top: 1px solid #e2e8ec;
    border-left: 0;
  }
  .guide-special-summary strong { margin: 0; }
  .guide-property-grid { grid-template-columns: 1fr; gap: 8px; }
  .guide-property-item { min-height: 0; }
  .toast { right: 14px; bottom: 14px; left: 14px; justify-content: center; }
  .zodiac-map-card { padding: 17px; }
  .zodiac-map-head { flex-direction: column; }
  .zodiac-map-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
  }
}
