:root {
  --bg: #f3f5f8;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --line: #dfe5ec;
  --line-strong: #cbd5e1;
  --text: #172033;
  --muted: #667085;
  --muted-2: #8a95a6;
  --primary: #1f6feb;
  --primary-2: #0f9f8f;
  --danger: #e53935;
  --success: #15a865;
  --warning: #d98a00;
  --shadow: 0 12px 30px rgba(15, 23, 42, .08);
  --auto-ai-bg: url("/public/assets/auto/ai-neural-bg.opt.jpg");
  --auto-data-bg: url("/public/assets/auto/data-analysis-bg.opt.jpg");
  --auto-tech-bg: url("/public/assets/auto/tech-grid-bg.opt.jpg");
  --auto-card-bg-01: url("/public/assets/auto/card-bg-01.opt.jpg");
  --auto-card-bg-02: url("/public/assets/auto/card-bg-02.opt.jpg");
  --auto-card-bg-03: url("/public/assets/auto/card-bg-03.opt.jpg");
  --auto-card-bg-04: url("/public/assets/auto/card-bg-04.opt.jpg");
  --auto-card-bg-05: url("/public/assets/auto/card-bg-05.opt.jpg");
  --auto-card-bg-06: url("/public/assets/auto/card-bg-06.opt.jpg");
  --auto-card-bg-07: url("/public/assets/auto/card-bg-07.opt.jpg");
  --auto-card-bg-08: url("/public/assets/auto/card-bg-08.opt.jpg");
  --auto-card-bg-09: url("/public/assets/auto/card-bg-09.opt.jpg");
  --auto-card-bg-10: url("/public/assets/auto/card-bg-10.opt.jpg");
  --auto-draw-bg: url("/public/assets/auto/draw-result-bg.opt.jpg");
  --auto-modal-ai-bg: url("/public/assets/auto/modal-ai-bg-01.jpg");
  --auto-tab-macau-bg: url("/public/assets/auto/tab-macau.opt.jpg");
  --auto-tab-hongkong-bg: url("/public/assets/auto/tab-hongkong.opt.jpg");
  --auto-tab-new-macau-bg: url("/public/assets/auto/tab-new-macau.opt.jpg");
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  margin: 0;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(31, 111, 235, .08), rgba(31, 111, 235, 0) 280px),
    linear-gradient(90deg, rgba(248, 250, 252, .94), rgba(248, 250, 252, .9)),
    var(--auto-tech-bg) center top / cover fixed,
    var(--bg);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.45;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: .62;
}

body.modal-open {
  overflow: hidden;
}

.site-shell {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto 28px;
  display: grid;
  gap: 14px;
}

.hero,
.ai-push-section,
.formula-catalog,
.draw-section,
.formula-search-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}

.hero {
  min-height: 76px;
  padding: 6px 16px;
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(18, 76, 185, .92), rgba(13, 151, 160, .78)),
    var(--auto-ai-bg) center / cover,
    #173a70;
  color: #fff;
}

.site-brand {
  position: relative;
  z-index: 2;
  display: block;
  width: 190px;
  height: 64px;
  overflow: visible;
}

.site-brand img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto -60px -120px auto;
  width: 360px;
  height: 260px;
  background:
    linear-gradient(90deg, rgba(255,255,255,.14) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255,255,255,.12) 1px, transparent 1px);
  background-size: 22px 22px;
  transform: rotate(-10deg);
}

.hero h1,
.hero p {
  position: relative;
  z-index: 1;
}

.hero h1 {
  margin: 28px 0 6px;
  font-size: 30px;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: 0;
}

.hero p {
  margin: 0;
  color: rgba(255, 255, 255, .82);
  font-size: 14px;
}

.hero h1,
.hero p,
.ai-push-heading,
.formula-section-head {
  display: none !important;
}

.member-topbar {
  position: relative;
  inset: auto;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  justify-self: end;
  grid-column: 2;
  gap: 8px;
  max-width: calc(100% - 32px);
}

.member-greeting {
  max-width: 180px;
  overflow: hidden;
  color: rgba(255, 255, 255, .9);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-topbar button,
.member-list-head button,
.formula-search-form button,
.btn {
  min-height: 34px;
  border: 1px solid rgba(255, 255, 255, .42);
  border-radius: 6px;
  padding: 0 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .26), rgba(255, 255, 255, .08)),
    rgba(255, 255, 255, .12);
  color: #fff;
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 8px 18px rgba(15, 23, 42, .12);
}

.member-login-btn,
.btn,
.formula-search-form button {
  background: linear-gradient(135deg, #3b82f6, #6d5dfc 52%, #0f9f8f);
  border-color: rgba(255, 255, 255, .25);
}

.section-title,
.ai-push-heading,
.formula-section-head,
.draw-title,
.formula-search-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.ai-push-section,
.formula-catalog,
.draw-section,
.formula-search-section {
  padding: 16px;
}

.ai-push-heading strong,
.formula-section-head h2,
.draw-title h2,
.formula-search-head h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
  font-weight: 800;
}

.formula-search-head span {
  display: none;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  color: var(--primary);
  background: rgba(31, 111, 235, .1);
  font-size: 12px;
  font-weight: 800;
}

.ai-live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 5px rgba(21, 168, 101, .12);
}

.ai-lottery-tabs,
.formula-tabs,
.lottery-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 12px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.ai-lottery-tabs button,
.formula-tab,
.lottery-tab {
  min-width: 0;
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 7px 9px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  text-align: center;
}

.ai-lottery-tabs button.active,
.formula-tab.active,
.lottery-tab.active {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 6px 14px rgba(31, 111, 235, .2);
}

.ai-lottery-tabs button.macau.active,
.formula-tab.macau.active,
.lottery-tab.macau.active {
  background:
    linear-gradient(135deg, rgba(82, 54, 211, .76), rgba(124, 58, 237, .72)),
    var(--auto-tab-macau-bg) center / cover;
  border-color: #7c3aed;
  box-shadow: 0 8px 18px rgba(124, 58, 237, .22);
}

.ai-lottery-tabs button.hongkong.active,
.formula-tab.hongkong.active,
.lottery-tab.hongkong.active {
  background:
    linear-gradient(135deg, rgba(14, 165, 233, .72), rgba(15, 159, 143, .74)),
    var(--auto-tab-hongkong-bg) center / cover;
  border-color: #0ea5e9;
  box-shadow: 0 8px 18px rgba(14, 165, 233, .2);
}

.ai-lottery-tabs button.new-macau.active,
.formula-tab.new-macau.active,
.lottery-tab.new-macau.active {
  background:
    linear-gradient(135deg, rgba(245, 158, 11, .76), rgba(217, 119, 6, .76)),
    var(--auto-tab-new-macau-bg) center / cover;
  border-color: #d97706;
  box-shadow: 0 8px 18px rgba(217, 119, 6, .2);
}

.lottery-tab {
  display: grid;
  gap: 2px;
}

.lottery-tab small {
  color: inherit;
  opacity: .72;
  font-size: 12px;
  font-weight: 500;
}

.ai-prediction-panel,
.lottery-panel {
  display: none;
}

.ai-prediction-panel.active,
.lottery-panel.active {
  display: block;
}

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

.ai-prediction-card {
  --agent-color: var(--primary);
  min-width: 0;
  min-height: 220px;
  display: grid;
  grid-template-rows: 1fr auto auto;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--agent-color);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(15, 23, 42, .05);
}

.ai-card-top {
  display: flex;
  gap: 10px;
  min-width: 0;
}

.ai-card-logo {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--agent-color), rgba(255, 255, 255, .55));
}

.ai-card-info {
  min-width: 0;
  flex: 1;
}

.ai-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
}

.ai-card-head span {
  min-width: 0;
  overflow: hidden;
  color: var(--agent-color);
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-card-title-inline,
.ai-card-title-hidden {
  color: var(--text);
  font-weight: 800;
}

.ai-card-title-inline {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-card-title-hidden {
  display: none;
}

.ai-prediction-value,
.formula-prediction-value {
  min-width: 0;
  color: #b42318;
  font-size: 18px;
  font-weight: 900;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.ai-prediction-value {
  margin-top: 8px;
}

.ai-prediction-value.long-value,
.formula-prediction-value.long-value {
  font-size: 15px;
  line-height: 1.35;
}

.ai-card-foot,
.formula-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.ai-card-foot {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}

.hit-progress {
  display: grid;
  grid-template-columns: max-content minmax(48px, 1fr) max-content;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.hit-progress i {
  display: block;
  height: 5px;
  min-width: 42px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7edf4;
}

.hit-progress i em {
  display: block;
  width: var(--hit-rate, 0%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--primary-2));
}

.ai-performance,
.streak,
.recent-hit,
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  border-radius: 999px;
  white-space: nowrap;
}

.ai-performance {
  flex: 0 0 auto;
  padding: 4px 8px;
  color: var(--agent-color);
  background: #f3f7ff;
  font-size: 12px;
  font-weight: 900;
}

.ai-card-bottom {
  display: grid;
  gap: 10px;
}

.ai-card-bottom p {
  display: -webkit-box;
  min-height: 58px;
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.ai-view-btn,
.formula-view-btn,
.pager-btn,
.favorite-btn,
.like-btn,
.history-load-more,
.live-history-link {
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: linear-gradient(180deg, #fff, #f4f8ff);
  color: var(--text);
  font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 8px 18px rgba(15, 23, 42, .06);
}

.ai-view-btn,
.formula-view-btn {
  min-height: 32px;
  padding: 0 12px;
}

.ai-view-btn {
  color: var(--agent-color);
  border-color: var(--agent-color);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .22), rgba(255, 255, 255, 0)),
    linear-gradient(135deg, #2d9cdb, var(--agent-color));
}

.formula-icon-btn {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
}

.formula-icon-btn.is-active,
.formula-icon-btn:hover {
  color: #fff;
  background: var(--danger);
  border-color: var(--danger);
}

.formula-action-icon {
  line-height: 1;
}

.ai-card-actions {
  display: none !important;
}

.formula-catalog {
  counter-reset: formula-rank;
}

.formula-section-head {
  margin-bottom: 10px;
}

.lottery-grid,
.lottery-panel {
  min-width: 0;
}

.lottery-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  overflow: hidden;
}

.panel-title {
  display: none;
}

.formula-list {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.formula-catalog .lottery-panel .formula-list {
  grid-template-columns: 1fr;
  padding: 8px;
}

.ai-push-section,
.formula-catalog,
.formula-search-section {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .96), rgba(255, 255, 255, .92)),
    var(--auto-data-bg) center / cover;
}

.formula-card {
  position: relative;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.formula-catalog .lottery-panel .formula-card {
  counter-increment: formula-rank;
  display: grid;
  grid-template-columns: 42px minmax(140px, 1fr) minmax(260px, 420px) 92px 104px;
  grid-template-areas: "rank title progress streak action";
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 5px 8px 5px 0;
  overflow: hidden;
}

.formula-catalog .lottery-panel .formula-card::before {
  content: counter(formula-rank);
  grid-area: rank;
  justify-self: end;
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(255, 255, 255, .32);
  border-radius: 9px;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(15, 23, 42, .72), rgba(79, 70, 229, .72)),
    var(--auto-card-bg-05) center / cover;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .24), 0 6px 14px rgba(15, 23, 42, .16);
  font-size: 12px;
  font-weight: 900;
}

.formula-catalog .lottery-panel .formula-card:nth-of-type(1)::before {
  background:
    linear-gradient(135deg, rgba(255, 93, 100, .78), rgba(225, 29, 72, .76)),
    var(--auto-card-bg-01) center / cover;
}

.formula-catalog .lottery-panel .formula-card:nth-of-type(2)::before {
  background:
    linear-gradient(135deg, rgba(255, 189, 73, .78), rgba(217, 119, 6, .78)),
    var(--auto-card-bg-02) center / cover;
}

.formula-catalog .lottery-panel .formula-card:nth-of-type(3)::before {
  background:
    linear-gradient(135deg, rgba(49, 196, 141, .78), rgba(15, 118, 110, .78)),
    var(--auto-card-bg-03) center / cover;
}

.formula-catalog .lottery-panel .formula-main {
  display: contents;
}

.formula-catalog .lottery-panel .formula-head {
  grid-area: title;
  min-width: 0;
}

.formula-catalog .lottery-panel .formula-head strong {
  display: block;
  overflow: hidden;
  font-size: 14px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.formula-catalog .lottery-panel .badge,
.formula-catalog .lottery-panel .formula-prediction-value {
  display: none;
}

.formula-catalog .lottery-panel .formula-meta {
  display: contents;
}

.formula-catalog .lottery-panel .hit-progress {
  grid-area: progress;
  width: 100%;
  min-width: 0;
  grid-template-columns: max-content minmax(90px, 1fr) max-content;
  max-width: 420px;
}

.formula-catalog .lottery-panel .streak {
  grid-area: streak;
  justify-self: center;
  padding: 4px 8px;
  color: #fff;
  background: var(--danger);
  font-size: 12px;
  font-weight: 900;
}

.formula-catalog .lottery-panel .formula-view-btn {
  grid-area: action;
  justify-self: stretch;
  min-width: 0;
  min-height: 32px;
  color: var(--primary);
  border-color: rgba(31, 111, 235, .35);
}

.formula-catalog .lottery-panel .formula-card-actions {
  display: none !important;
}

.formula-catalog .lottery-panel .formula-likes {
  display: none !important;
}

.formula-card-note {
  display: none;
}

.ai-push-section [data-ai-card-like],
.formula-catalog [data-card-like],
.ai-push-section .formula-icon-btn,
.formula-catalog .formula-icon-btn {
  display: none !important;
}

.formula-card.is-pagination-hidden,
.ai-prediction-card.is-pagination-hidden {
  display: none !important;
}

.formula-search-section .formula-list,
.member-list-results {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.formula-search-results .formula-card,
.member-list-results .formula-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
}

.formula-search-results .formula-main,
.member-list-results .formula-main {
  min-width: 0;
}

.formula-search-results .formula-head,
.member-list-results .formula-head {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.formula-search-results .formula-head strong,
.member-list-results .formula-head strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.formula-search-results .formula-prediction-value,
.member-list-results .formula-prediction-value {
  margin-top: 6px;
  font-size: 14px;
}

.badge,
.recent-hit {
  min-height: 22px;
  padding: 0 8px;
  color: var(--warning);
  background: rgba(217, 138, 0, .12);
  font-size: 12px;
  font-weight: 800;
}

.formula-search-results .formula-meta,
.member-list-results .formula-meta {
  margin-top: 8px;
}

.formula-search-results .formula-likes,
.member-list-results .formula-likes {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.pager-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 14px;
}

.formula-pager-actions {
  margin-top: 7px;
  margin-bottom: 10px;
}

.pager-actions [hidden] {
  display: none !important;
}

.pager-btn {
  min-width: 116px;
  min-height: 36px;
  padding: 0 16px;
}

.pager-btn:hover,
.ai-view-btn:hover,
.formula-view-btn:hover,
.favorite-btn:hover,
.like-btn:hover,
.history-load-more:hover {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
}

.draw-section {
  overflow: hidden;
}

.lottery-result {
  min-height: 148px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.lottery-status,
.modal-loading,
.empty {
  display: grid;
  place-items: center;
  min-height: 120px;
  color: var(--muted);
  text-align: center;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .95), rgba(248, 251, 255, .88)),
    var(--auto-data-bg) center / cover;
}

.lottery-status.error {
  color: var(--danger);
}

.live-head {
  display: grid;
  gap: 8px;
  padding: 14px 14px 0;
}

.live-current-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.live-current {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.current-lottery-name,
.history-type-badge,
.modal-lottery {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  color: #fff;
  background: var(--primary);
  font-size: 12px;
  font-weight: 800;
}

.live-open-time,
.next-draw {
  color: var(--muted);
  font-size: 13px;
}

.next-draw b {
  color: var(--primary);
  font-size: 18px;
}

.live-history-link {
  min-height: 30px;
  padding: 0 10px;
  white-space: nowrap;
}

.live-balls,
.history-balls {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 9px;
  padding: 14px;
}

.live-balls {
  justify-content: center;
}

.live-ball-wrap,
.history-ball-wrap {
  display: grid;
  gap: 4px;
  justify-items: center;
  color: var(--muted);
  font-size: 12px;
}

.live-ball,
.history-ball {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border: 5px solid currentColor;
  border-radius: 50%;
  background: #fff;
  font-size: 20px;
  font-weight: 900;
}

.live-ball.red,
.history-ball.red {
  color: #ef4444;
}

.live-ball.blue,
.history-ball.blue {
  color: #1683d8;
}

.live-ball.green,
.history-ball.green {
  color: #13a85f;
}

.live-ball.black,
.history-ball.black {
  color: #64748b;
}

.live-plus,
.history-plus {
  align-self: center;
  color: var(--muted-2);
  font-size: 24px;
  font-weight: 900;
}

.formula-search-form {
  display: grid;
  grid-template-columns: 150px 160px minmax(0, 1fr) 88px;
  gap: 8px;
  margin-bottom: 10px;
}

.formula-search-form select,
.formula-search-form input,
.member-form input {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 0 10px;
  color: var(--text);
  background: #fff;
  outline: none;
}

.formula-search-form select {
  appearance: none;
  -webkit-appearance: none;
  min-height: 42px;
  padding: 0 42px 0 13px;
  color: #172033;
  background:
    linear-gradient(45deg, transparent 50%, #2563eb 50%) calc(100% - 18px) 18px / 7px 7px no-repeat,
    linear-gradient(135deg, rgba(255, 255, 255, .96), rgba(239, 246, 255, .92)),
    var(--auto-tab-hongkong-bg) center / cover;
  border-color: rgba(37, 99, 235, .28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .78), 0 8px 18px rgba(15, 23, 42, .06);
  font-weight: 800;
}

.formula-search-form select:hover {
  border-color: rgba(37, 99, 235, .48);
}

.formula-search-form select option {
  color: var(--text);
  background: #fff;
}

.formula-search-form select:focus,
.formula-search-form input:focus,
.member-form input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(31, 111, 235, .12);
}

.formula-search-status {
  min-height: 34px;
  color: var(--muted);
}

.formula-modal[hidden],
.history-modal[hidden] {
  display: none !important;
}

.formula-modal,
.history-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 20px;
}

.formula-modal:not(.member-modal) {
  z-index: 1040;
}

.formula-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .58);
  backdrop-filter: blur(4px);
}

.formula-dialog,
.history-dialog {
  position: relative;
  width: min(760px, 100%);
  max-height: min(820px, calc(100vh - 40px));
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, .3);
}

.history-dialog {
  width: min(980px, 100%);
}

.formula-modal-close {
  position: sticky;
  top: 10px;
  z-index: 2;
  float: right;
  width: 36px;
  height: 36px;
  margin: 10px 10px -46px 0;
  border: 0;
  border-radius: 50%;
  color: var(--text);
  background: #eef2f7;
  font-size: 24px;
  line-height: 1;
}

.formula-modal-body,
.history-modal-body {
  padding: 26px;
}

.formula-modal-body h2,
.history-modal-title h2 {
  margin: 10px 0 6px;
  font-size: 24px;
}

.modal-summary,
.history-modal-title p {
  margin: 0 0 16px;
  color: var(--muted);
}

.formula-modal-summary {
  display: none !important;
}

.modal-prediction {
  padding: 16px;
  border: 1px solid rgba(31, 111, 235, .18);
  border-radius: 8px;
  color: #b42318;
  background: #f8fbff;
  font-size: 20px;
  font-weight: 900;
  line-height: 1.65;
  text-align: center;
  overflow-wrap: anywhere;
}

.modal-prediction.has-calculation-prefix {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}

.prediction-calculation-prefix {
  color: #7b8794;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
}

.modal-section {
  margin-top: 18px;
}

.modal-section h3 {
  margin: 0 0 8px;
  font-size: 16px;
}

.modal-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.modal-section-head h3 {
  margin: 0;
}

.modal-content {
  color: var(--muted);
  line-height: 1.75;
  white-space: pre-wrap;
}

.modal-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 18px;
}

.modal-stat {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--muted);
  text-align: center;
}

.modal-stat strong {
  display: block;
  margin-top: 4px;
  color: var(--text);
  font-size: 18px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.modal-actions-inline {
  flex: 0 0 auto;
  margin-top: 0;
}

.favorite-btn,
.like-btn,
.history-load-more {
  min-height: 36px;
  padding: 0 14px;
}

.favorite-btn.is-favorite {
  color: #fff;
  background: var(--success);
  border-color: var(--success);
}

.prediction-history,
.ai-history-list,
.history-list {
  display: grid;
  gap: 8px;
}

.prediction-history-row,
.ai-history-row,
.history-row {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) minmax(140px, .7fr) 64px;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.history-row {
  grid-template-columns: 140px minmax(0, 1fr);
}

.history-meta strong,
.prediction-history-row strong,
.ai-history-row strong {
  white-space: nowrap;
}

.prediction-history-value,
.ai-history-pick {
  min-width: 0;
  color: #9a3412;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.hit-token {
  display: inline-block;
  margin: 0 2px;
  padding: 1px 6px;
  border-radius: 999px;
  color: #fff;
  background: #5b5ce2;
}

.prediction-status,
.ai-history-row .hit,
.ai-history-row .miss {
  justify-self: end;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.prediction-status.hit,
.ai-history-row .hit {
  color: #4f46e5;
  background: rgba(79, 70, 229, .12);
}

.prediction-status.miss,
.ai-history-row .miss {
  color: var(--danger);
  background: rgba(229, 57, 53, .1);
}

.prediction-status.pending {
  color: var(--warning);
  background: rgba(217, 138, 0, .12);
}

.member-dialog {
  width: min(560px, 100%);
}

.member-auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.member-auth-tabs button {
  min-height: 36px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.member-auth-tabs button.active {
  color: #fff;
  background: var(--primary);
}

.member-form {
  display: none;
  gap: 12px;
  margin-top: 16px;
}

.member-form.active {
  display: grid;
}

.member-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 700;
}

.captcha-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px;
  gap: 8px;
  align-items: center;
}

.captcha-row img {
  width: 96px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  object-fit: cover;
}

.member-auth-message {
  min-height: 24px;
  margin-top: 12px;
  color: var(--danger);
}

.member-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.member-list-head h2 {
  margin: 0;
}

.member-list-head button {
  color: var(--primary);
  background: #fff;
  border-color: var(--line-strong);
}

@media (max-width: 1100px) {
  .ai-prediction-grid {
    grid-template-columns: 1fr;
  }

  .formula-catalog .lottery-panel .formula-card {
    grid-template-columns: 40px minmax(96px, 1fr) minmax(180px, 340px) 84px 88px;
    grid-template-areas: "rank title progress streak action";
    gap: 8px;
  }

  .formula-catalog .lottery-panel .hit-progress {
    grid-template-columns: minmax(76px, max-content) minmax(58px, 1fr) minmax(74px, max-content);
  }
}

@media (max-width: 760px) {
  .site-shell {
    width: min(100% - 14px, 680px);
    margin: 0 auto 16px;
    gap: 10px;
  }

  .hero,
  .ai-push-section,
  .formula-catalog,
  .draw-section,
  .formula-search-section {
    border-radius: 8px;
  }

  .hero {
    min-height: 0;
    padding: 6px 8px;
    grid-template-columns: 120px minmax(0, 1fr);
    gap: 8px;
    align-items: center;
  }

  .site-brand {
    width: 120px;
    height: 40px;
  }

  .hero h1 {
    margin: 0 0 6px;
    font-size: 24px;
  }

  .member-topbar {
    position: relative;
    inset: auto;
    width: auto;
    justify-content: flex-end;
    justify-self: end;
    gap: 5px;
    max-width: 100%;
    overflow-x: visible;
    padding-bottom: 0;
  }

  .member-greeting {
    display: none;
  }

  .member-topbar button {
    flex: 0 0 auto;
    min-height: 32px;
    padding: 0 7px;
    font-size: 12px;
  }

  @media (max-width: 360px) {
    .hero {
      grid-template-columns: 78px minmax(0, 1fr);
      gap: 5px;
    }

    .site-brand {
      width: 78px;
      height: 26px;
    }

    .member-topbar {
      gap: 3px;
    }

    .member-topbar button {
      min-height: 30px;
      padding: 0 5px;
      font-size: 11px;
    }
  }

  .ai-push-section,
  .formula-catalog,
  .draw-section,
  .formula-search-section {
    padding: 10px;
  }

  .ai-lottery-tabs,
  .formula-tabs,
  .lottery-tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    padding: 4px;
  }

  .ai-lottery-tabs button,
  .formula-tab,
  .lottery-tab {
    min-height: 34px;
    padding: 6px 4px;
    font-size: 13px;
  }

  .lottery-tab small {
    display: none;
  }

  .ai-prediction-grid,
  .formula-search-section .formula-list,
  .member-list-results {
    grid-template-columns: 1fr;
  }

  .ai-prediction-card {
    min-height: 0;
    padding: 12px;
  }

  .ai-card-foot {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .hit-progress {
    grid-template-columns: minmax(54px, max-content) minmax(44px, 1fr) minmax(64px, max-content);
    gap: 5px;
    font-size: 11px;
  }

  .ai-performance {
    padding: 3px 7px;
    font-size: 12px;
  }

  .formula-catalog .lottery-panel .formula-list {
    padding: 6px;
    gap: 6px;
  }

  .formula-catalog .lottery-panel .formula-card {
    grid-template-columns: 28px minmax(54px, .7fr) minmax(72px, 1fr) 62px 68px;
    grid-template-areas: "rank title progress streak action";
    gap: 5px;
    min-height: 42px;
    padding: 5px 5px 5px 0;
  }

  .formula-catalog .lottery-panel .formula-card::before {
    width: 22px;
    height: 22px;
    border-radius: 5px;
    font-size: 11px;
  }

  .formula-catalog .lottery-panel .formula-head strong {
    font-size: 12px;
  }

  .formula-catalog .lottery-panel .hit-progress {
    grid-template-columns: max-content;
    justify-items: start;
    align-items: center;
    gap: 0;
  }

  .formula-catalog .lottery-panel .hit-progress span {
    display: none;
  }

  .formula-catalog .lottery-panel .hit-progress b {
    display: inline;
    white-space: nowrap;
    font-size: 11px;
  }

  .formula-catalog .lottery-panel .hit-progress i {
    display: none;
  }

  .formula-catalog .lottery-panel .streak {
    padding: 3px 5px;
    font-size: 11px;
  }

  .formula-catalog .lottery-panel .formula-view-btn {
    min-height: 28px;
    padding: 0 6px;
    font-size: 11px;
  }

  .formula-catalog .lottery-panel .formula-card-actions {
    display: none;
  }

  .formula-search-results .formula-card,
  .member-list-results .formula-card {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .formula-search-results .formula-likes,
  .member-list-results .formula-likes {
    display: none;
  }

  .formula-search-form {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .formula-search-form button {
    min-height: 40px;
  }

  .formula-search-form select,
  .formula-search-form input {
    min-height: 40px;
    font-size: 14px;
  }

  .live-current-row,
  .modal-actions,
  .member-list-head {
    align-items: stretch;
    flex-direction: column;
  }

  .live-balls,
  .history-balls {
    gap: 7px;
    padding: 10px;
  }

  .history-balls {
    flex-wrap: nowrap;
    justify-content: space-between;
    gap: 3px;
    padding: 8px 0 4px;
  }

  .live-ball,
  .history-ball {
    width: 42px;
    height: 42px;
    border-width: 4px;
    font-size: 17px;
  }

  .history-ball {
    width: 32px;
    height: 32px;
    border-width: 3px;
    font-size: 14px;
  }

  .history-ball-wrap {
    min-width: 0;
    gap: 2px;
  }

  .history-ball-wrap small {
    font-size: 8px;
    line-height: 1.1;
  }

  .history-plus {
    font-size: 14px;
    margin: 6px -1px 0;
  }

  .formula-modal,
  .history-modal {
    padding: 10px;
  }

  .formula-modal-body,
  .history-modal-body {
    padding: 22px 14px 16px;
  }

  .modal-stats,
  .prediction-history-row,
  .ai-history-row,
  .history-row {
    grid-template-columns: 1fr;
  }

  .modal-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin-top: 12px;
  }

  .modal-stat {
    padding: 8px 4px;
    font-size: 12px;
  }

  .modal-stat strong {
    font-size: 16px;
  }

  .modal-section-head {
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
  }

  .modal-section-head .modal-actions {
    margin-left: auto;
  }

  .modal-section-head .favorite-btn,
  .modal-section-head .like-btn {
    min-height: 32px;
    padding: 0 10px;
    font-size: 13px;
  }

  .prediction-history-row {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

  .prediction-history-row strong,
  .prediction-history-row .prediction-history-value,
  .prediction-history-row .prediction-history-draw {
    grid-column: 1;
  }

  .prediction-history-row .prediction-status {
    grid-column: 2;
    grid-row: 1 / span 3;
    align-self: center;
  }

  .ai-history-row {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

  .ai-history-row strong,
  .ai-history-row .ai-history-pick,
  .ai-history-row .ai-history-draw {
    grid-column: 1;
  }

  .ai-history-row .hit,
  .ai-history-row .miss {
    grid-column: 2;
    grid-row: 1 / span 3;
    align-self: center;
  }

  .prediction-status,
  .ai-history-row .hit,
  .ai-history-row .miss {
    justify-self: end;
  }
}

/* Draw and AI recommendation refresh: compact result card + logo rows. */
.draw-section {
  background: #fff;
  border-color: #d9e2ef;
  padding: 10px;
}

.draw-section .draw-title {
  display: none;
}

.draw-section .lottery-tabs {
  border: 0;
  background: #f3f7fc;
  margin: 0 0 10px;
}

.draw-section .lottery-tab {
  color: #475569;
  border-color: transparent;
}

.draw-section .lottery-tab span {
  display: none;
}

.draw-section .lottery-tab.active {
  background: #6d4cff;
  border-color: #6d4cff;
  color: #fff;
}

.draw-section .lottery-result {
  min-height: 0;
  border: 0;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .12);
}

.draw-section .live-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 4px 16px;
  padding: 12px 14px 0;
}

.draw-section .live-current-row {
  display: contents;
}

.draw-section .live-current {
  grid-column: 1;
  grid-row: 1;
  align-self: center;
  gap: 8px;
  font-size: 13px;
}

.draw-section .live-current strong {
  font-size: 16px;
}

.draw-section .live-history-link {
  grid-column: 4;
  grid-row: 1;
  justify-self: end;
  border: 0;
  color: #6d4cff;
  background: transparent;
}

.draw-section .live-open-time {
  grid-column: 2;
  grid-row: 1;
  align-self: center;
  white-space: nowrap;
}

.draw-section .next-draw {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
  text-align: right;
  white-space: nowrap;
}

.draw-section .live-balls {
  padding: 10px 10px 12px;
  gap: 10px;
}

.draw-section .live-ball {
  width: 46px;
  height: 46px;
  border-width: 4px;
  font-size: 19px;
}

.ai-push-section {
  padding: 12px;
}

.ai-push-heading {
  margin-bottom: 8px;
}

.ai-push-section .ai-lottery-tabs {
  max-width: none;
  margin-left: 0;
  margin-bottom: 12px;
  border-radius: 8px;
  padding: 5px;
}

.ai-push-section .ai-lottery-tabs button {
  min-height: 38px;
  border-radius: 6px;
  font-size: 14px;
}

.ai-push-section .ai-lottery-tabs button.active {
  background: linear-gradient(135deg, #4f46e5, #6d5dfc);
  border-color: #6d5dfc;
  box-shadow: none;
}

.draw-section .lottery-tab.macau.active,
.ai-push-section .ai-lottery-tabs button.macau.active {
  background:
    linear-gradient(135deg, rgba(82, 54, 211, .76), rgba(124, 58, 237, .72)),
    var(--auto-tab-macau-bg) center / cover;
  border-color: #7c3aed;
  box-shadow: 0 8px 18px rgba(124, 58, 237, .22);
}

.draw-section .lottery-tab.hongkong.active,
.ai-push-section .ai-lottery-tabs button.hongkong.active {
  background:
    linear-gradient(135deg, rgba(14, 165, 233, .72), rgba(15, 159, 143, .74)),
    var(--auto-tab-hongkong-bg) center / cover;
  border-color: #0ea5e9;
  box-shadow: 0 8px 18px rgba(14, 165, 233, .2);
}

.draw-section .lottery-tab.new-macau.active,
.ai-push-section .ai-lottery-tabs button.new-macau.active {
  background:
    linear-gradient(135deg, rgba(245, 158, 11, .76), rgba(217, 119, 6, .76)),
    var(--auto-tab-new-macau-bg) center / cover;
  border-color: #d97706;
  box-shadow: 0 8px 18px rgba(217, 119, 6, .2);
}

.ai-prediction-grid {
  grid-template-columns: 1fr;
  gap: 8px;
}

.ai-prediction-card {
  min-height: 0;
  grid-template-columns: minmax(0, 1fr) 120px;
  grid-template-rows: auto;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-top-width: 0;
}

.ai-card-top {
  align-items: center;
  gap: 12px;
}

.ai-card-logo {
  flex: 0 0 54px;
  width: 54px;
  height: 54px;
  overflow: hidden;
  border-radius: 50%;
  background: #f5f7fb;
  box-shadow: 0 8px 18px rgba(31, 111, 235, .18);
}

.ai-logo-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ai-card-info {
  display: grid;
  grid-template-columns: minmax(120px, .75fr) minmax(220px, 1fr);
  grid-template-areas:
    "head foot";
  align-items: center;
  gap: 4px 14px;
}

.ai-card-head {
  grid-area: head;
}

.ai-prediction-value {
  grid-area: value;
  display: none !important;
  margin-top: 0;
  font-size: 18px;
}

.ai-card-foot {
  grid-area: foot;
  display: grid;
  grid-template-columns: 1fr;
  gap: 5px;
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.ai-card-foot .hit-progress {
  grid-template-columns: max-content minmax(70px, 1fr) max-content;
}

.ai-performance {
  justify-self: start;
  color: #ef4444;
  background: rgba(239, 68, 68, .1);
}

.ai-card-bottom {
  justify-self: end;
}

.ai-view-btn {
  min-width: 106px;
  min-height: 36px;
  border-radius: 999px;
  color: #fff;
  background: var(--agent-color);
  border-color: var(--agent-color);
}

.ai-card-analysis {
  display: none;
}

/* Visual asset pass: make material textures visible without changing layout. */
.ai-push-section,
.formula-catalog,
.formula-search-section {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .82), rgba(246, 250, 255, .74)),
    var(--auto-data-bg) center / cover !important;
}

.ai-prediction-card,
.formula-card,
.lottery-panel {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, .96), rgba(248, 251, 255, .94)),
    var(--card-material-bg, var(--auto-card-bg-01)) center / cover !important;
  border-color: rgba(148, 163, 184, .34);
}

.ai-prediction-card:nth-child(10n + 1),
.formula-card:nth-child(10n + 1) { --card-material-bg: var(--auto-card-bg-01); }
.ai-prediction-card:nth-child(10n + 2),
.formula-card:nth-child(10n + 2) { --card-material-bg: var(--auto-card-bg-02); }
.ai-prediction-card:nth-child(10n + 3),
.formula-card:nth-child(10n + 3) { --card-material-bg: var(--auto-card-bg-03); }
.ai-prediction-card:nth-child(10n + 4),
.formula-card:nth-child(10n + 4) { --card-material-bg: var(--auto-card-bg-04); }
.ai-prediction-card:nth-child(10n + 5),
.formula-card:nth-child(10n + 5) { --card-material-bg: var(--auto-card-bg-05); }
.ai-prediction-card:nth-child(10n + 6),
.formula-card:nth-child(10n + 6) { --card-material-bg: var(--auto-card-bg-06); }
.ai-prediction-card:nth-child(10n + 7),
.formula-card:nth-child(10n + 7) { --card-material-bg: var(--auto-card-bg-07); }
.ai-prediction-card:nth-child(10n + 8),
.formula-card:nth-child(10n + 8) { --card-material-bg: var(--auto-card-bg-08); }
.ai-prediction-card:nth-child(10n + 9),
.formula-card:nth-child(10n + 9) { --card-material-bg: var(--auto-card-bg-09); }
.ai-prediction-card:nth-child(10n),
.formula-card:nth-child(10n) { --card-material-bg: var(--auto-card-bg-10); }

.draw-section .lottery-result {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, .94), rgba(247, 250, 255, .88)),
    var(--auto-draw-bg) center / cover !important;
}

.ai-view-btn,
.formula-view-btn,
.pager-btn,
.favorite-btn,
.like-btn,
.history-load-more,
.live-history-link,
.formula-search-form button,
.member-topbar button,
.btn {
  background-image:
    linear-gradient(135deg, rgba(255, 255, 255, .18), rgba(255, 255, 255, 0)),
    linear-gradient(135deg, rgba(31, 111, 235, .84), rgba(109, 93, 252, .84)),
    var(--auto-ai-bg) !important;
  background-size: cover;
  background-position: center;
  color: #fff;
  border-color: rgba(255, 255, 255, .32);
  text-shadow: 0 1px 1px rgba(15, 23, 42, .34);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .24), 0 10px 22px rgba(31, 111, 235, .18);
}

.formula-catalog .lottery-panel .formula-view-btn,
.formula-search-section .formula-view-btn,
.member-list-results .formula-view-btn {
  color: #fff;
  border-color: rgba(255, 255, 255, .32);
}

.ai-view-btn {
  background-image:
    linear-gradient(135deg, rgba(255, 255, 255, .2), rgba(255, 255, 255, 0)),
    linear-gradient(135deg, rgba(45, 156, 219, .86), rgba(109, 93, 252, .84)),
    var(--auto-ai-bg) !important;
}

@media (max-width: 760px) {
  .draw-section {
    padding: 8px;
    background: #fff;
  }

  .draw-section .live-head {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 4px 8px;
    padding: 10px 12px 0;
  }

  .draw-section .live-current {
    grid-column: 1;
    grid-row: 1;
    flex-wrap: nowrap;
    min-width: 0;
  }

  .draw-section .live-current strong {
    white-space: nowrap;
  }

  .draw-section .live-history-link {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    align-self: center;
    padding: 0;
    min-height: 24px;
    font-size: 13px;
  }

  .draw-section .live-open-time {
    grid-column: 1;
    grid-row: 2;
    white-space: nowrap;
  }

  .draw-section .next-draw {
    grid-column: 2;
    grid-row: 2;
    justify-self: end;
    text-align: right;
    white-space: nowrap;
    font-size: 12px;
  }

  .draw-section .next-draw b {
    font-size: 16px;
  }

  .draw-section .live-balls {
    flex-wrap: nowrap;
    justify-content: center;
    gap: 5px;
    padding: 14px 4px 16px;
  }

  .draw-section .live-ball-wrap {
    gap: 3px;
    font-size: 11px;
  }

  .draw-section .live-ball {
    width: clamp(34px, 9.6vw, 42px);
    height: clamp(34px, 9.6vw, 42px);
    border-width: 3px;
    font-size: clamp(15px, 4.2vw, 17px);
  }

  .draw-section .live-plus {
    font-size: 20px;
    margin-top: 7px;
  }

  .ai-push-section .ai-lottery-tabs {
    max-width: none;
  }

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

  .ai-card-info {
    grid-template-columns: 1fr;
    grid-template-areas:
      "head"
      "value"
      "foot";
  }

  .ai-card-foot {
    justify-items: center;
  }

  .ai-card-foot .hit-progress {
    width: 100%;
  }

  .ai-performance {
    justify-self: center;
  }

  .ai-card-bottom {
    justify-self: stretch;
  }

  .ai-view-btn {
    width: 100%;
  }
}

@media (min-width: 761px) {
  .ai-prediction-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
  }

  .ai-prediction-card {
    grid-template-columns: 1fr;
    align-items: stretch;
    min-height: 154px;
    gap: 8px;
    padding: 10px;
  }

  .ai-card-top {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    align-items: start;
    gap: 10px;
  }

  .ai-card-logo {
    width: 52px;
    height: 52px;
    flex-basis: 52px;
  }

  .ai-card-info {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "head streak"
      "foot foot";
    grid-template-rows: 52px auto;
    gap: 4px 8px;
  }

  .ai-card-head {
    align-items: start;
    align-self: center;
    justify-content: start;
    gap: 4px;
    flex-direction: column;
    font-size: 11px;
    line-height: 1.2;
  }

  .ai-card-title-inline {
    font-size: 14px;
  }

  .ai-card-head span {
    font-size: 13px;
  }

  .ai-prediction-value {
    display: none !important;
  }

  .ai-card-foot {
    display: contents;
  }

  .ai-card-foot .hit-progress {
    grid-area: foot;
    grid-template-columns: max-content minmax(32px, 1fr) max-content;
    font-size: 10px;
    display: grid;
  }

  .ai-performance {
    grid-area: streak;
    align-self: center;
    justify-self: end;
    padding: 2px 6px;
    font-size: 10px;
  }

  .ai-card-analysis {
    display: -webkit-box;
    min-height: 32px;
    margin: 0;
    overflow: hidden;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.45;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .ai-card-bottom {
    justify-self: stretch;
    align-self: end;
  }

  .ai-view-btn {
    width: 100%;
    min-height: 28px;
    border-radius: 4px;
    font-size: 12px;
  }

  .formula-catalog .lottery-panel .formula-list {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    padding: 10px;
  }

  .formula-catalog .lottery-panel .formula-card {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) auto;
    grid-template-areas:
      "rank title streak"
      "rank progress progress"
      "rank note note"
      "action action action";
    grid-template-rows: 52px auto 1fr auto;
    align-items: start;
    min-height: 154px;
    padding: 10px;
    gap: 6px 10px;
    overflow: hidden;
    border: 1px solid rgba(203, 213, 225, .9);
    border-radius: 6px;
    background:
      linear-gradient(90deg, rgba(255, 255, 255, .93), rgba(255, 255, 255, .84)),
      var(--card-material-bg, var(--auto-card-bg-01)) center / cover !important;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .06);
  }

  .formula-catalog .lottery-panel .formula-card::before {
    grid-area: rank;
    position: static;
    transform: none;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px 6px 0 0;
    align-self: center;
    justify-self: center;
    font-family: "STXingkai", "FZShuTi", "KaiTi", "Kaiti SC", cursive;
    font-size: 40px;
    line-height: 1;
    letter-spacing: 0;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 7px 14px rgba(15, 23, 42, .18);
  }

  .formula-catalog .lottery-panel .formula-head {
    height: 52px;
    align-self: center;
    display: flex;
    min-height: 38px;
    align-items: center;
  }

  .formula-catalog .lottery-panel .formula-head strong {
    font-size: 15px;
    line-height: 1.25;
  }

  .formula-catalog .lottery-panel .formula-card-note {
    grid-area: note;
    display: -webkit-box;
    margin: 0;
    overflow: hidden;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.45;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .formula-catalog .lottery-panel .hit-progress {
    grid-template-columns: max-content minmax(42px, 1fr) max-content;
    max-width: none;
    gap: 5px;
    font-size: 10px;
  }

  .formula-catalog .lottery-panel .streak {
    grid-area: streak;
    align-self: center;
    justify-self: end;
    padding: 3px 7px;
    border-radius: 999px;
    font-size: 11px;
  }

  .formula-catalog .lottery-panel .formula-view-btn {
    width: 100%;
    min-height: 28px;
    align-self: end;
    border-radius: 4px;
    font-size: 12px;
  }
}

.formula-catalog .lottery-panel .formula-view-btn,
.formula-search-section .formula-view-btn,
.member-list-results .formula-view-btn {
  color: #fff !important;
}

.draw-section .live-history-link {
  color: #fff !important;
  background-image:
    linear-gradient(135deg, rgba(255, 255, 255, .2), rgba(255, 255, 255, 0)),
    linear-gradient(135deg, #5b5ce2, #2563eb),
    var(--auto-ai-bg) !important;
  border: 1px solid rgba(255, 255, 255, .32);
  border-radius: 8px;
  padding: 0 12px;
  text-shadow: 0 1px 1px rgba(15, 23, 42, .36);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 8px 18px rgba(31, 111, 235, .18);
}


.formula-dialog:not(.member-dialog),
.history-dialog {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .93), rgba(246, 250, 255, .9)),
    var(--auto-card-bg-04) center / cover !important;
  border-color: rgba(148, 163, 184, .38);
}

.formula-modal-body,
.history-modal-body {
  background: #fff;
}

.modal-prediction,
.modal-stat,
.prediction-history-row,
.ai-history-row {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, .96), rgba(248, 251, 255, .92)),
    var(--auto-card-bg-08) center / cover !important;
  border-color: rgba(148, 163, 184, .34);
}
