/* ======= 白色背景配色变量 ======= */
:root {
  --bg-dark:    #ffffff;
  --bg-card:    #f8f9fc;
  --bg-card2:   #f0f2f7;
  --accent:     #c8920a;
  --accent2:    #1a6fe8;
  --text-main:  #1a1d2e;
  --text-muted: #6b7280;
  --border:     #dde1ee;
  --ball-blue:  #3d8bff;
  --ball-red:   #e84a4a;
  --ball-green: #3dc87a;
  --radius:     10px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: var(--bg-dark);
  color: var(--text-main);
  font-family: 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', sans-serif;
  min-height: 100vh;
}

/* ======= Tab 切换栏 ======= */
.tab-bar {
  display: flex;
  align-items: center;
  background: #fff;
  font-size: 0.875rem;
  font-weight: 700;
  border-bottom: 1px solid #e5e7eb;
}

.tab-item {
  flex: 1;
  padding: 10px 0;
  text-align: center;
  cursor: pointer;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}

.tab-active {
  color: #dc2626;
  border-bottom-color: #ef4444;
}

.tab-inactive {
  color: #6b7280;
  border-left: 1px solid #d1d5db;
  border-bottom-color: #d1d5db;
}

.tab-inactive:hover {
  color: #dc2626;
  border-bottom-color: #ef4444;
}

/* ======= 导航栏 ======= */
.nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  height: 60px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.05em;
}

.logo-icon { font-size: 1.4rem; }

.nav-links {
  list-style: none;
  display: flex;
  gap: 28px;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s;
}

.nav-links a:hover { color: var(--accent); }

/* ======= 广告轮播 ======= */
.ad-banner {
  position: relative;
  max-width: 960px;
  margin: 16px auto 0;
  padding: 0 16px;
  overflow: hidden;
  border-radius: var(--radius);
}

.ad-track {
  display: flex;
  transition: transform 0.45s ease;
}

.ad-slide {
  min-width: 100%;
  position: relative;
}

.ad-slide a {
  display: block;
  text-decoration: none;
  color: inherit;
}

.ad-slide img,
.ad-slide video {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  display: block;
}

.ad-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 10px 16px;
  background: linear-gradient(transparent, rgba(0,0,0,0.5));
  border-radius: 0 0 var(--radius) var(--radius);
  display: flex;
  align-items: center;
  gap: 10px;
}

.ad-title {
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
}

.ad-desc {
  color: rgba(255,255,255,0.8);
  font-size: 0.75rem;
}

.ad-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 8px;
}

.ad-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.ad-dot.active {
  background: var(--accent);
  transform: scale(1.25);
}

.ad-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-60%);
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,0.85);
  color: var(--text-main);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.12);
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 2;
}

.ad-banner:hover .ad-arrow { opacity: 1; }
.ad-prev { left: 24px; }
.ad-next { right: 24px; }
.ad-arrow:hover { background: #fff; }

/* ======= 主体区域 ======= */
.hero-section {
  max-width: 960px;
  margin: 32px auto;
  padding: 0 16px;
}

/* ======= 最新开奖卡片 ======= */
.latest-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 32px;
  margin-bottom: 28px;
  min-height: 190px;
}

.card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}

.label {
  font-size: 0.8rem;
  color: var(--text-muted);
  background: var(--bg-dark);
  padding: 3px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
}

.issue-no {
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent);
}

/* ——— 号码球 ——— */
.balls-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.ball {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 700;
  background: var(--bg-dark);
  border: 2px solid var(--border);
  transition: transform 0.2s;
  user-select: none;
}

.ball:hover { transform: scale(1.08); }

.ball.ball-blue  { background: var(--ball-blue);  color: #fff; border-color: var(--ball-blue);  box-shadow: 0 0 12px rgba(61,139,255,0.4); }
.ball.ball-red   { background: var(--ball-red);   color: #fff; border-color: var(--ball-red);   box-shadow: 0 0 12px rgba(232,74,74,0.4); }
.ball.ball-green { background: var(--ball-green); color: #fff; border-color: var(--ball-green); box-shadow: 0 0 12px rgba(61,200,122,0.4); }

.ball.ball-sum {
  width: 62px;
  height: 62px;
  font-size: 1.6rem;
  border-width: 3px;
}

.plus, .equals {
  color: var(--text-muted);
  font-size: 1.3rem;
  font-weight: 300;
}

/* ——— 结果标签 ——— */
.result-tags {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.tag {
  padding: 5px 18px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
  border: 1px solid transparent;
  letter-spacing: 0.05em;
}

.tag-size {
  background: rgba(200,146,10,0.1);
  color: var(--accent);
  border-color: rgba(200,146,10,0.45);
}

.tag-parity {
  background: rgba(26,111,232,0.1);
  color: var(--accent2);
  border-color: rgba(26,111,232,0.45);
}

.tag-group {
  background: rgba(61,200,122,0.1);
  color: #1a9e55;
  border-color: rgba(61,200,122,0.45);
}

.tag-pattern {
  background: rgba(150,100,220,0.1);
  color: #7c4dcc;
  border-color: rgba(150,100,220,0.45);
}

.tag-extreme {
  background: rgba(232,74,74,0.1);
  color: #d63030;
  border-color: rgba(232,74,74,0.45);
}

/* ——— 卡片底部 ——— */
.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.opentime { font-size: 0.82rem; color: var(--text-muted); }
.refresh-hint { font-size: 0.82rem; color: var(--text-muted); }
.error-tip { margin-top: 10px; color: #e84a4a; font-size: 0.85rem; }

/* ——— 下期预告 ——— */
.next-draw {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 8px 12px;
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.83rem;
}

.next-label {
  color: var(--text-muted);
  font-size: 0.75rem;
  background: var(--bg-dark);
  padding: 2px 8px;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.next-issue { font-weight: 600; color: var(--accent2); }
.next-time  { color: var(--text-muted); margin-left: auto; }

/* ——— 加载动画遮罩 ——— */
.loading-mask {
  position: absolute;
  inset: 0;
  background: rgba(248,249,252,0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
}

.spinner {
  width: 38px;
  height: 38px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ======= 历史列表 ======= */
.history-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.history-header {
  display: grid;
  grid-template-columns: 2fr 2.5fr 1fr 1fr 1fr 1.5fr 2fr;
  padding: 12px 20px;
  background: var(--bg-card2);
  font-size: 0.8rem;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  font-weight: 500;
  letter-spacing: 0.03em;
}

.history-list {
  list-style: none;
  max-height: 460px;
  overflow-y: auto;
}

.history-list::-webkit-scrollbar { width: 4px; }
.history-list::-webkit-scrollbar-track { background: var(--bg-card); }
.history-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.history-item {
  display: grid;
  grid-template-columns: 2fr 2.5fr 1fr 1fr 1fr 1.5fr 2fr;
  padding: 11px 20px;
  font-size: 0.88rem;
  border-bottom: 1px solid var(--border);
  align-items: center;
  transition: background 0.15s;
  cursor: default;
}

.history-item:last-child { border-bottom: none; }
.history-item:hover { background: var(--bg-card2); }

.history-item .item-issue { color: var(--text-muted); font-size: 0.82rem; }
.history-item .codes { color: var(--text-main); font-weight: 500; }
.history-item .item-sum { font-weight: 600; color: var(--accent); }
.history-item .time { color: var(--text-muted); font-size: 0.78rem; }

.history-empty {
  text-align: center;
  padding: 32px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.tag-sm {
  display: inline-block;
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--bg-dark);
  color: var(--text-muted);
  border: 1px solid var(--border);
  font-weight: 500;
}

.tag-sm.tag-big, .tag-sm.tag-odd {
  color: var(--accent);
  border-color: rgba(232,180,74,0.4);
  background: rgba(232,180,74,0.08);
}

.tag-sm.tag-small, .tag-sm.tag-even {
  color: var(--accent2);
  border-color: rgba(61,139,255,0.4);
  background: rgba(61,139,255,0.08);
}

.tag-sm.tag-pat {
  color: #7c4dcc;
  border-color: rgba(150,100,220,0.4);
  background: rgba(150,100,220,0.08);
}

.tag-sm.tag-extreme-sm {
  color: #d63030;
  border-color: rgba(232,74,74,0.4);
  background: rgba(232,74,74,0.08);
}

.pattern-cell {
  display: flex;
  gap: 4px;
  align-items: center;
  flex-wrap: wrap;
}

/* ======= 页脚 ======= */
.footer {
  text-align: center;
  padding: 28px 16px;
  color: var(--text-muted);
  font-size: 0.8rem;
  line-height: 2;
  border-top: 1px solid var(--border);
  margin-top: 40px;
}

/* ======= 响应式 ======= */
@media (max-width: 680px) {
  .nav-bar { padding: 0 16px; }
  .nav-links { display: none; }
  .latest-card { padding: 20px 16px; }

  .history-header,
  .history-item {
    grid-template-columns: 1fr 2fr 1fr 1fr;
  }

  .history-header span:nth-child(5),
  .history-item span:nth-child(5),
  .history-header span:nth-child(6),
  .history-item span:nth-child(6),
  .history-header span:nth-child(7),
  .history-item span:nth-child(7) {
    display: none;
  }

  .ball { width: 44px; height: 44px; font-size: 1.2rem; }
  .ball.ball-sum { width: 52px; height: 52px; font-size: 1.4rem; }
}

/* ======= 结果 / 预测快捷按钮 ======= */
.quick-action-section {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: -18px 0 12px 6px;
}

.quick-action-btn {
  min-width: 78px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid #dbe2ef;
  border-radius: 4px;
  background: #fff;
  color: #4b5563;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 7px rgba(15, 23, 42, 0.05);
  transition: all 0.18s ease;
}

.quick-action-btn:hover,
.quick-action-btn.active {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(232, 180, 74, 0.08);
  transform: translateY(-1px);
}

.quick-predict-btn:hover,
.quick-predict-btn.active {
  border-color: #8b5cf6;
  color: #7c3aed;
  background: rgba(139, 92, 246, 0.08);
}

.quick-icon { font-size: 0.92rem; }

.quick-panel {
  margin: 0 0 14px;
}

.quick-panel-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  padding: 13px 16px;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
}

.quick-panel-predict {
  background: linear-gradient(135deg, #ffffff 0%, #fbf7ff 100%);
}

.quick-panel-title {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.quick-panel-main {
  font-size: 0.96rem;
  color: var(--text-main);
  font-weight: 800;
}

.quick-panel-sub {
  margin-top: 5px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.quick-panel-tags {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.tag-sm.tag-group-mini {
  color: #16a34a;
  border-color: rgba(34, 197, 94, 0.38);
  background: rgba(34, 197, 94, 0.08);
}

@media (max-width: 680px) {
  .quick-action-section {
    margin: -14px 0 10px 6px;
  }
  .quick-action-btn {
    min-width: 78px;
    height: 34px;
  }
}

/* ======= 预测分类按钮：大小 / 单双 / 组合 / 杀组 ======= */
.prediction-tab-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
  margin-top: 12px;
  border-bottom: 1px solid #e5e7eb;
}

.prediction-tab-btn {
  height: 34px;
  border: 0;
  border-radius: 0;
  background: #d68600;
  color: #fff;
  font-size: 0.86rem;
  font-weight: 800;
  cursor: pointer;
  position: relative;
  transition: filter 0.18s ease, transform 0.18s ease;
}

.prediction-tab-btn:hover {
  filter: brightness(1.05);
}

.prediction-tab-btn.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: #ff1d1d;
}

.prediction-tab-content {
  padding: 10px 2px 0;
  font-size: 0.84rem;
  color: var(--text-main);
  font-weight: 700;
}

@media (max-width: 680px) {
  .prediction-tab-bar {
    gap: 6px;
    margin-left: -16px;
    margin-right: -16px;
  }
  .prediction-tab-btn {
    height: 32px;
    font-size: 0.82rem;
  }
}

/* ======= 大小预测表格 ======= */
.prediction-table-wrap {
  margin-top: 0;
  overflow-x: auto;
  background: #fff;
  border-top: 1px solid #e5e7eb;
}

.prediction-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 0.84rem;
  color: #334155;
}

.prediction-table th,
.prediction-table td {
  height: 36px;
  padding: 0 8px;
  text-align: center;
  border-right: 1px solid #e5e7eb;
  border-bottom: 1px solid #e5e7eb;
  white-space: nowrap;
}

.prediction-table th {
  background: #f3f4f6;
  color: #374151;
  font-weight: 600;
}

.prediction-table th:last-child,
.prediction-table td:last-child {
  border-right: 0;
}

.prediction-table .predict-big {
  color: #2563eb;
  font-weight: 800;
}

.prediction-table .predict-small {
  color: #ef4444;
  font-weight: 800;
}

.predict-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  line-height: 18px;
  font-size: 1rem;
  font-weight: 900;
}

.predict-status.hit {
  color: #22c55e;
}

.predict-status.miss {
  color: #ef4770;
  font-size: 1.25rem;
}

.predict-status.pending {
  color: #94a3b8;
}

@media (max-width: 680px) {
  .prediction-table {
    font-size: 0.8rem;
  }
  .prediction-table th,
  .prediction-table td {
    height: 34px;
    padding: 0 5px;
  }
}

/* ======= 预测列表复用原历史列表样式，仅调整列和值 ======= */
.prediction-size-section {
  margin-top: 0;
  border-radius: 0 0 var(--radius) var(--radius);
}

.prediction-size-header,
.prediction-size-item {
  grid-template-columns: 1.3fr 1.4fr 0.9fr 2fr 0.8fr;
}

.prediction-size-list {
  max-height: 360px;
}

.prediction-size-item .predict-big {
  color: #2563eb;
}

.prediction-size-item .predict-small {
  color: #ef4444;
}

@media (max-width: 680px) {
  .prediction-size-header,
  .prediction-size-item {
    grid-template-columns: 1.15fr 1.2fr 0.75fr 1.55fr 0.55fr;
  }

  .prediction-size-header span:nth-child(5),
  .prediction-size-item span:nth-child(5) {
    display: inline-flex;
  }
}

/* prediction-polish-20260716：预测区域美化，保留原列表风格 */
.quick-panel {
  margin: 0 0 18px;
}

.quick-panel-card.quick-panel-predict {
  overflow: hidden;
  padding: 0;
  border-radius: 14px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.quick-panel-predict > .quick-panel-title,
.quick-panel-predict > .quick-panel-main,
.quick-panel-predict > .quick-panel-sub,
.quick-panel-predict > .quick-panel-tags {
  padding-left: 16px;
  padding-right: 16px;
}

.quick-panel-predict > .quick-panel-title {
  padding-top: 14px;
  color: #64748b;
  font-weight: 700;
}

.quick-panel-predict > .quick-panel-main {
  margin-top: 2px;
  color: #0f172a;
  letter-spacing: 0.01em;
}

.quick-panel-predict > .quick-panel-sub {
  color: #94a3b8;
}

.quick-panel-predict > .quick-panel-tags {
  margin-top: 11px;
  margin-bottom: 12px;
}

.prediction-tab-bar {
  gap: 0;
  margin: 0;
  padding: 0 8px;
  background: #f1f5f9;
  border-top: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
}

.prediction-tab-btn {
  height: 38px;
  margin: 0 4px;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(180deg, #d99400 0%, #c47a00 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.25);
}

.prediction-tab-btn.active {
  background: linear-gradient(180deg, #f0a400 0%, #d98a00 100%);
}

.prediction-tab-btn.active::after {
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: #ef2020;
}

.prediction-size-section {
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.prediction-size-header {
  padding: 11px 14px;
  background: #f8fafc;
  color: #64748b;
  border-bottom: 1px solid #e2e8f0;
  font-weight: 700;
}

.prediction-size-list {
  max-height: 392px;
  background: #ffffff;
}

.prediction-size-item {
  padding: 12px 14px;
  border-bottom: 1px solid #edf2f7;
  background: #fff;
}

.prediction-size-item:nth-child(even) {
  background: #fbfdff;
}

.prediction-size-item:hover {
  background: #fff7e6;
}

.prediction-size-item .codes {
  color: #334155;
  font-weight: 700;
}

.prediction-size-item .item-sum.predict-big,
.prediction-size-item .item-sum.predict-small {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 22px;
  border-radius: 999px;
  font-size: 0.82rem;
}

.prediction-size-item .item-sum.predict-big {
  color: #2563eb;
  background: rgba(37, 99, 235, 0.1);
  border: 1px solid rgba(37, 99, 235, 0.22);
}

.prediction-size-item .item-sum.predict-small {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.22);
}

.predict-status {
  border-radius: 50%;
}

.predict-status.hit {
  width: 20px;
  height: 20px;
  color: #fff;
  background: #22c55e;
  font-size: 0.86rem;
}

.predict-status.miss {
  width: 20px;
  height: 20px;
  color: #fff;
  background: #ef4770;
  font-size: 1.05rem;
}

.predict-status.pending {
  width: 20px;
  height: 20px;
  color: #94a3b8;
  background: #f1f5f9;
}

@media (max-width: 680px) {
  .quick-panel-predict > .quick-panel-title,
  .quick-panel-predict > .quick-panel-main,
  .quick-panel-predict > .quick-panel-sub,
  .quick-panel-predict > .quick-panel-tags {
    padding-left: 12px;
    padding-right: 12px;
  }

  .prediction-tab-bar {
    margin-left: 0;
    margin-right: 0;
    padding: 0 5px;
  }

  .prediction-tab-btn {
    margin: 0 3px;
    height: 34px;
  }

  .prediction-size-header,
  .prediction-size-item {
    padding-left: 8px;
    padding-right: 8px;
    grid-template-columns: 1.05fr 1.05fr 0.75fr 1.55fr 0.55fr;
  }
}

/* predict-inner-polish-20260716：预测表内部显示美化 */
.prediction-size-header,
.prediction-size-item {
  grid-template-columns: 1.08fr 1.15fr 1.78fr 1.62fr 0.62fr;
}

.prediction-size-header span,
.prediction-size-item span {
  min-width: 0;
}

.prediction-predict-cell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex-wrap: wrap;
  width: 100%;
  line-height: 1.2;
}

.prediction-value-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 900;
  white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.55);
}

.prediction-value-pill.predict-big {
  color: #1d4ed8;
  background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%);
  border: 1px solid rgba(37, 99, 235, 0.28);
}

.prediction-value-pill.predict-small {
  color: #dc2626;
  background: linear-gradient(180deg, #fff1f2 0%, #ffe4e6 100%);
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.prediction-plus {
  color: #94a3b8;
  font-weight: 900;
  font-size: 0.78rem;
  margin: 0 -1px;
}

.prediction-size-item .codes {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quick-panel-predict .prediction-size-list {
  border-top: 0;
}

.quick-panel-predict .prediction-size-item {
  min-height: 42px;
}

@media (max-width: 680px) {
  .prediction-size-header,
  .prediction-size-item {
    grid-template-columns: 0.9fr 0.95fr 1.58fr 1.25fr 0.45fr;
    column-gap: 2px;
  }

  .prediction-value-pill {
    min-width: 30px;
    height: 20px;
    padding: 0 6px;
    font-size: 0.72rem;
  }

  .prediction-plus {
    font-size: 0.72rem;
  }
}

/* mobile-final-polish-20260716：整体手机端居中、对齐、显示完整优化 */
html, body {
  width: 100%;
  overflow-x: hidden;
}

#app {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  background: #fff;
}

.hero-section {
  width: 100%;
  max-width: 960px;
  margin-left: auto;
  margin-right: auto;
}

.card-header,
.card-footer,
.next-draw,
.quick-action-section,
.quick-panel-main,
.quick-panel-sub,
.quick-panel-tags {
  text-align: center;
}

.balls-row,
.result-tags,
.quick-panel-tags {
  justify-content: center;
}

.quick-action-section {
  justify-content: flex-start;
  padding-left: 2px;
}

.quick-panel-card {
  width: 100%;
}

.prediction-size-header,
.prediction-size-item {
  align-items: center;
  text-align: center;
}

.prediction-size-header > span,
.prediction-size-item > span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

.prediction-size-item .item-issue,
.prediction-size-item .time {
  color: #64748b;
  font-weight: 600;
}

.prediction-size-item .codes {
  justify-content: center;
  text-align: center;
}

.prediction-size-item .pattern-cell {
  justify-content: center;
}

.history-header > span,
.history-item > span {
  min-width: 0;
}

@media (max-width: 680px) {
  #app {
    max-width: 100%;
  }

  .nav-bar {
    height: 56px;
    padding: 0 16px;
  }

  .nav-logo {
    width: 100%;
    justify-content: flex-start;
  }

  .ad-banner {
    margin-top: 12px;
    padding: 0 14px;
    border-radius: 8px;
  }

  .tab-item {
    padding: 11px 0;
  }

  .hero-section {
    padding: 0 12px;
  }

  .latest-card {
    margin: 14px 0 22px;
    padding: 18px 14px;
    border-radius: 12px;
  }

  .card-header {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
  }

  .balls-row {
    gap: 7px;
    flex-wrap: nowrap;
  }

  .plus,
  .equals {
    margin: 0 1px;
  }

  .ball {
    width: 42px;
    height: 42px;
    font-size: 1.1rem;
  }

  .ball.ball-sum {
    width: 48px;
    height: 48px;
    font-size: 1.25rem;
  }

  .result-tags {
    gap: 8px;
  }

  .tag {
    padding: 5px 14px;
    min-width: 52px;
    text-align: center;
  }

  .card-footer {
    flex-direction: column;
    gap: 6px;
    align-items: center;
  }

  .next-draw {
    justify-content: center;
    flex-wrap: wrap;
    text-align: center;
  }

  .next-time {
    width: 100%;
    margin-left: 0;
    text-align: center;
  }

  .quick-action-section {
    margin: -10px 0 10px;
    padding-left: 0;
    justify-content: flex-start;
  }

  .quick-action-btn {
    min-width: 78px;
    height: 34px;
  }

  .quick-panel {
    margin-bottom: 12px;
  }

  .quick-panel-card.quick-panel-predict {
    border-radius: 12px;
  }

  .quick-panel-main {
    font-size: 0.92rem;
    line-height: 1.45;
  }

  .quick-panel-sub {
    font-size: 0.76rem;
    line-height: 1.45;
  }

  .prediction-tab-bar {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
    padding: 0 6px;
  }

  .prediction-tab-btn {
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 0 2px;
    font-size: 0.8rem;
    text-align: center;
  }

  /* 预测表手机端：保证 期号/时间/预测/号码/结果 五列完整显示 */
  .prediction-size-header,
  .prediction-size-item {
    display: grid;
    grid-template-columns: 1.08fr 0.98fr 1.88fr 1.12fr 0.52fr;
    column-gap: 3px;
    padding-left: 5px;
    padding-right: 5px;
    text-align: center;
  }

  .prediction-size-header {
    font-size: 0.73rem;
    padding-top: 9px;
    padding-bottom: 9px;
  }

  .prediction-size-item {
    min-height: 44px;
    padding-top: 8px;
    padding-bottom: 8px;
    font-size: 0.76rem;
  }

  /* 覆盖原历史列表移动端隐藏列规则，预测表 5 列都要显示 */
  .prediction-size-header span:nth-child(5),
  .prediction-size-item span:nth-child(5),
  .prediction-size-header span:nth-child(6),
  .prediction-size-item span:nth-child(6),
  .prediction-size-header span:nth-child(7),
  .prediction-size-item span:nth-child(7) {
    display: flex !important;
  }

  .prediction-size-item .item-issue,
  .prediction-size-item .time {
    font-size: 0.72rem;
  }

  .prediction-size-item .codes {
    font-size: 0.72rem;
    max-width: 100%;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .prediction-predict-cell {
    gap: 2px;
    justify-content: center;
  }

  .prediction-value-pill {
    min-width: 25px;
    height: 19px;
    padding: 0 4px;
    font-size: 0.68rem;
    border-radius: 9px;
  }

  .prediction-plus {
    font-size: 0.68rem;
    margin: 0 -1px;
  }

  .predict-status.hit,
  .predict-status.miss,
  .predict-status.pending {
    width: 18px;
    height: 18px;
    min-width: 18px;
  }

  .predict-status.miss {
    font-size: 0.95rem;
  }

  /* 主历史列表手机端也做对齐，不影响预测表 */
  .history-section:not(.prediction-size-section) {
    border-radius: 12px;
  }

  .history-section:not(.prediction-size-section) .history-header,
  .history-section:not(.prediction-size-section) .history-item {
    grid-template-columns: 1.05fr 1.7fr 0.7fr 0.8fr;
    padding-left: 10px;
    padding-right: 10px;
    text-align: center;
    column-gap: 4px;
  }

  .history-section:not(.prediction-size-section) .history-header > span,
  .history-section:not(.prediction-size-section) .history-item > span {
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .history-section:not(.prediction-size-section) .codes {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .footer {
    margin-top: 22px;
    padding: 22px 12px;
  }
}

/* ======= 实时统计面板 ======= */
.quick-stats-btn:hover,
.quick-stats-btn.active {
  border-color: #059669;
  color: #047857;
  background: rgba(5, 150, 105, 0.08);
}

.quick-panel-stats {
  padding: 14px 16px;
  background: linear-gradient(135deg, #ffffff 0%, #f0fdf4 100%);
}

/* 统计网格 */
.stats-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 10px 0 4px;
}

.stats-grid-5 {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin: 10px 0 4px;
}

.stats-section-title {
  font-size: 0.76rem;
  color: #64748b;
  font-weight: 700;
  margin: 14px 0 6px;
  padding-left: 2px;
}

/* 统计单元格 */
.stats-cell {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 6px;
  text-align: center;
  transition: all 0.2s;
}

.stats-cell-sm {
  padding: 7px 4px;
}

.stats-cell-label {
  display: block;
  font-size: 0.78rem;
  color: #64748b;
  font-weight: 600;
  margin-bottom: 2px;
}

.stats-cell-val {
  display: block;
  font-size: 1.3rem;
  font-weight: 900;
  color: #334155;
  line-height: 1.2;
}

.stats-cell-sm .stats-cell-val {
  font-size: 1.05rem;
}

.stats-cell-sub {
  display: block;
  font-size: 0.65rem;
  color: #94a3b8;
  margin-top: 1px;
}

/* 热号（刚出）高亮 */
.stats-cell.stats-hot {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border-color: #4ade80;
}

.stats-cell.stats-hot .stats-cell-val {
  color: #16a34a;
}

/* 数值遗漏网格 */
.stats-num-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin: 4px 0;
}

.stats-num-cell {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 5px 2px;
  text-align: center;
}

.stats-num-cell.stats-num-hot {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border-color: #4ade80;
}

.stats-num-cell.stats-num-cold {
  background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
  border-color: #fb923c;
}

.stats-num-val {
  display: block;
  font-size: 0.95rem;
  font-weight: 900;
  color: #334155;
  line-height: 1.2;
}

.stats-num-count {
  display: block;
  font-size: 0.62rem;
  color: #94a3b8;
  margin-top: 1px;
}

.stats-num-today {
  display: block;
  font-size: 0.6rem;
  color: #6b7280;
  font-weight: 500;
}

.stats-num-hot .stats-num-val {
  color: #16a34a;
}

.stats-num-cold .stats-num-val {
  color: #ea580c;
}

/* 今日统计 */
.stats-today-grid {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 4px 0;
}

@media (max-width: 680px) {
  .quick-panel-stats {
    padding: 12px 10px;
  }

  .stats-grid-4 {
    gap: 5px;
  }

  .stats-grid-5 {
    gap: 4px;
  }

  .stats-cell {
    padding: 8px 3px;
    border-radius: 6px;
  }

  .stats-cell-label {
    font-size: 0.7rem;
  }

  .stats-cell-val {
    font-size: 1.1rem;
  }

  .stats-cell-sm .stats-cell-val {
    font-size: 0.9rem;
  }

  .stats-cell-sub {
    font-size: 0.6rem;
  }

  .stats-section-title {
    font-size: 0.72rem;
    margin: 10px 0 4px;
  }

  .stats-num-grid {
    grid-template-columns: repeat(7, 1fr);
    gap: 3px;
  }

  .stats-num-cell {
    padding: 4px 1px;
    border-radius: 4px;
  }

  .stats-num-val {
    font-size: 0.8rem;
  }

  .stats-num-count {
    font-size: 0.57rem;
  }
}

@media (max-width: 390px) {
  .hero-section {
    padding: 0 8px;
  }

  .prediction-size-header,
  .prediction-size-item {
    grid-template-columns: 1fr 0.88fr 1.95fr 1fr 0.46fr;
    column-gap: 2px;
    padding-left: 3px;
    padding-right: 3px;
  }

  .prediction-size-header {
    font-size: 0.68rem;
  }

  .prediction-size-item {
    font-size: 0.71rem;
  }

  .prediction-value-pill {
    min-width: 23px;
    height: 18px;
    padding: 0 3px;
    font-size: 0.64rem;
  }

  .prediction-size-item .codes {
    font-size: 0.68rem;
  }

  .prediction-size-item .item-issue,
  .prediction-size-item .time {
    font-size: 0.68rem;
  }
}

/* compact-draw-footer-20260716：下期信息合并到开奖时间行，节省空间 */
.compact-draw-footer {
  gap: 12px;
  flex-wrap: wrap;
}

.next-inline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.next-inline .next-label {
  color: var(--text-muted);
  font-size: 0.74rem;
  background: var(--bg-dark);
  padding: 2px 8px;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.next-inline .next-issue {
  font-weight: 700;
  color: var(--accent2);
}

.next-inline .next-time {
  margin-left: 0;
  color: var(--text-muted);
}

@media (max-width: 680px) {
  .compact-draw-footer {
    display: grid;
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 6px;
  }

  .next-inline {
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 0.78rem;
  }
}

/* header-opentime-20260716：开奖时间放到最新开奖标题下方 */
.header-opentime {
  margin-top: -6px;
  margin-bottom: 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.84rem;
  font-weight: 500;
}

.compact-draw-footer {
  justify-content: center;
}

@media (max-width: 680px) {
  .header-opentime {
    margin-top: -2px;
    margin-bottom: 13px;
    font-size: 0.8rem;
  }
}
