/* 大乐透智能选号 - 样式 */

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

:root {
  --bg-1: #0f0c29;
  --bg-2: #302b63;
  --bg-3: #24243e;
  --accent-1: #ff6b6b;
  --accent-2: #feca57;
  --accent-3: #4facfe;
  --accent-4: #00f2fe;
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.7);
  --text-muted: rgba(255, 255, 255, 0.5);
  --glass-bg: rgba(255, 255, 255, 0.08);
  --glass-border: rgba(255, 255, 255, 0.15);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  --hot-color: linear-gradient(135deg, #ff6b6b 0%, #feca57 100%);
  --warm-color: linear-gradient(135deg, #feca57 0%, #ff9ff3 100%);
  --cold-color: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: linear-gradient(135deg, var(--bg-1) 0%, var(--bg-2) 50%, var(--bg-3) 100%);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* 背景光晕 */
.bg-orbs {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.4;
}
.orb-1 { width: 400px; height: 400px; background: #ff6b6b; top: -100px; left: -100px; }
.orb-2 { width: 500px; height: 500px; background: #4facfe; bottom: -150px; right: -150px; }
.orb-3 { width: 300px; height: 300px; background: #feca57; top: 40%; left: 50%; }

/* 头部 */
.header {
  position: relative;
  z-index: 10;
  padding: 24px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}
.logo { display: flex; align-items: center; gap: 12px; }
.logo-icon { font-size: 36px; }
.logo h1 { font-size: 24px; font-weight: 700; }
.draw-info {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}
.draw-label { font-size: 11px; color: var(--text-muted); }
.draw-period { font-size: 20px; font-weight: 700; color: var(--accent-2); }
.draw-date { font-size: 12px; color: var(--text-secondary); }

/* 玻璃态卡片 */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  box-shadow: var(--glass-shadow);
}

/* 主内容 */
.main {
  position: relative;
  z-index: 5;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 40px;
}

/* 操作区 */
.actions {
  padding: 16px 20px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

/* 最新开奖结果卡片 */
.latest-draw {
  padding: 20px 24px;
  margin-bottom: 20px;
  background: linear-gradient(135deg, rgba(255,107,107,0.08), rgba(254,202,87,0.08), rgba(79,172,254,0.08));
  border: 1px solid rgba(254,202,87,0.25);
}
.latest-draw-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}
.latest-draw-title {
  display: flex;
  align-items: center;
  gap: 10px;
}
.latest-draw-icon {
  font-size: 28px;
}
.latest-draw-title h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}
.latest-draw-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}
.draw-period-big {
  font-size: 22px;
  font-weight: 700;
  color: var(--accent-2);
  font-family: monospace;
}
.draw-date-big {
  font-size: 12px;
  color: var(--text-secondary);
}
.latest-draw-balls {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding: 12px 0;
}
.balls-block {
  display: flex;
  align-items: center;
  gap: 12px;
}
.balls-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
  min-width: 36px;
}
.balls-divider {
  font-size: 20px;
  color: var(--text-muted);
  font-weight: 700;
}
.latest-draw-balls .ball {
  width: 42px;
  height: 42px;
  font-size: 16px;
}
.latest-draw-balls .ball-back {
  width: 36px;
  height: 36px;
  font-size: 14px;
}
.latest-draw-countdown {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 13px;
  color: var(--text-secondary);
  flex-wrap: wrap;
}
.countdown-label {
  color: var(--text-muted);
}
.countdown-time {
  font-family: monospace;
  font-size: 15px;
  font-weight: 700;
  color: var(--accent-4);
}
.countdown-refresh {
  margin-left: auto;
}
.latest-draw.is-stale .draw-period-big {
  color: var(--accent-1);
  animation: pulse 2s infinite;
}
.latest-draw.is-stale .countdown-time {
  color: var(--accent-1);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* 按钮 */
.btn {
  border: none;
  padding: 10px 18px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  font-family: inherit;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  color: #fff;
}
.btn-secondary {
  background: linear-gradient(135deg, var(--accent-3), var(--accent-4));
  color: #fff;
}
.btn-ghost {
  background: var(--glass-bg);
  color: var(--text-primary);
  border: 1px solid var(--glass-border);
}
.btn-block { width: 100%; justify-content: center; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,0.3); }
.btn:active { transform: translateY(0); }
.btn-icon { font-size: 16px; }

/* 5 组号卡片 */
.groups {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}
.group-card {
  padding: 24px;
  position: relative;
  overflow: hidden;
  animation: slideUp 0.4s ease both;
}
.group-card:nth-child(1) { animation-delay: 0.05s; }
.group-card:nth-child(2) { animation-delay: 0.1s; }
.group-card:nth-child(3) { animation-delay: 0.15s; }
.group-card:nth-child(4) { animation-delay: 0.2s; }
.group-card:nth-child(5) { animation-delay: 0.25s; }

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.group-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}
.group-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-3), var(--accent-4));
  font-weight: 700;
  font-size: 14px;
}
.group-strategy {
  font-size: 12px;
  color: var(--text-secondary);
  padding: 4px 10px;
  background: rgba(255,255,255,0.05);
  border-radius: 12px;
}

/* 号码球 */
.balls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.ball {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  color: #fff;
  position: relative;
  box-shadow: inset 0 -4px 6px rgba(0,0,0,0.2), 0 4px 8px rgba(0,0,0,0.3);
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}
.ball-front {
  background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
}
.ball-back {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  width: 36px;
  height: 36px;
  font-size: 14px;
}
.ball-divider {
  width: 1px;
  height: 28px;
  background: rgba(255,255,255,0.2);
  margin: 0 4px;
}

/* 备注 */
.group-remark {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.1);
}
.remark-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.remark-label {
  color: var(--text-muted);
  min-width: 56px;
}
.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  margin-left: 4px;
}
.tag-hot { background: rgba(255,107,107,0.2); color: #ff6b6b; }
.tag-warm { background: rgba(254,202,87,0.2); color: #feca57; }
.tag-cold { background: rgba(79,172,254,0.2); color: #4facfe; }
.tag-info { background: rgba(255,255,255,0.08); color: var(--text-secondary); }

/* 冷热统计 */
.stats-panel {
  padding: 24px;
  margin-bottom: 24px;
}
.stats-panel h2 { font-size: 18px; margin-bottom: 12px; }
.stats-panel h3 { font-size: 14px; color: var(--text-secondary); margin-bottom: 12px; }
.stats-section { margin-bottom: 20px; }

/* 标题 + 期数切换 同行 */
.stats-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
}
.stats-header h2 { margin-bottom: 0; }
.stats-period-switch {
  display: inline-flex;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
}
.period-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.2s;
}
.period-btn:hover { color: #fff; }
.period-btn.active {
  background: linear-gradient(135deg, #ef4444 0%, #f59e0b 100%);
  color: #fff;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.35);
}

/* 冷热图例 */
.stats-legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding: 10px 14px;
  background: rgba(255,255,255,0.04);
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.06);
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
}
.legend-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid transparent;
  flex-shrink: 0;
}
.legend-dot.hot { background: #ef4444; border-color: #fca5a5; }
.legend-dot.warm { background: #f59e0b; border-color: #fcd34d; }
.legend-dot.cold { background: #3b82f6; border-color: #93c5fd; }

.ball-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(52px, 1fr));
  gap: 10px;
}
.ball-grid-back {
  grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
}

/* 冷热球:3 档清晰实色 + 边框 + 角标 */
.stat-ball {
  aspect-ratio: 1;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 15px;
  color: #fff;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
  border: 3px solid transparent;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}
/* 热号:亮红 + 亮红边 */
.stat-ball.hot {
  background: #ef4444;
  border-color: #fca5a5;
  box-shadow: 0 0 0 1px #ef4444, 0 2px 8px rgba(239, 68, 68, 0.4);
}
/* 温号:橙 */
.stat-ball.warm {
  background: #f59e0b;
  border-color: #fcd34d;
  box-shadow: 0 2px 6px rgba(245, 158, 11, 0.3);
}
/* 冷号:蓝 */
.stat-ball.cold {
  background: #3b82f6;
  border-color: #93c5fd;
  box-shadow: 0 0 0 1px #3b82f6, 0 2px 8px rgba(59, 130, 246, 0.35);
}
.stat-ball:hover {
  transform: scale(1.12);
  z-index: 2;
}
.stat-ball .stat-count {
  font-size: 10px;
  font-weight: 600;
  opacity: 0.95;
  margin-top: 1px;
  letter-spacing: 0.3px;
}
/* 冷热角标 */
.stat-ball::after {
  position: absolute;
  top: -3px;
  right: -3px;
  font-size: 9px;
  width: 14px;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #fff;
  color: #1f2937;
  font-weight: 800;
  line-height: 1;
}
.stat-ball.hot::after { content: "🔥"; background: #fef2f2; }
.stat-ball.cold::after { content: "❄"; background: #eff6ff; }
.stat-ball.warm::after { content: ""; }

/* 副链接列表 */
.shares-panel { padding: 24px; }
.shares-panel h2 { font-size: 18px; margin-bottom: 8px; }
.shares-hint { font-size: 13px; color: var(--text-secondary); margin-bottom: 16px; }
.share-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.share-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(255,255,255,0.04);
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  gap: 12px;
  flex-wrap: wrap;
}
.share-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
}
.share-token { font-family: monospace; color: var(--accent-4); font-size: 13px; }
.share-info { color: var(--text-muted); font-size: 11px; }
.share-actions { display: flex; gap: 6px; }

/* 弹窗 */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
[hidden] { display: none !important; }
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(8px);
}
.modal-content {
  position: relative;
  padding: 32px;
  max-width: 400px;
  width: 100%;
  text-align: center;
  animation: popIn 0.3s ease;
}
@keyframes popIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}
.modal-icon { font-size: 48px; margin-bottom: 12px; }
.modal-content h2 { font-size: 20px; margin-bottom: 8px; }
.modal-hint { font-size: 13px; color: var(--text-secondary); margin-bottom: 20px; }
.modal-content input[type="password"],
.modal-content input[type="text"] {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--glass-border);
  background: rgba(255,255,255,0.05);
  color: var(--text-primary);
  border-radius: 10px;
  font-size: 16px;
  text-align: center;
  font-family: inherit;
  margin-bottom: 12px;
  letter-spacing: 4px;
}
.modal-content input:focus { outline: none; border-color: var(--accent-3); }
.modal-error { color: var(--accent-1); font-size: 12px; min-height: 18px; margin-bottom: 8px; }
.share-url-box {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
.share-url-box input {
  flex: 1;
  font-size: 12px !important;
  letter-spacing: 0 !important;
  text-align: left !important;
  font-family: monospace !important;
}

/* 副链接模式横幅 */
.share-mode-banner {
  padding: 12px 20px;
  margin-bottom: 20px;
  background: linear-gradient(135deg, rgba(254,202,87,0.2), rgba(255,107,107,0.2));
  border: 1px solid rgba(254,202,87,0.3);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
}

/* 底部 */
.footer {
  text-align: center;
  padding: 20px;
  font-size: 12px;
  color: var(--text-muted);
  position: relative;
  z-index: 5;
}

/* 响应式 */
@media (max-width: 768px) {
  .header { padding: 16px; }
  .logo h1 { font-size: 18px; }
  .draw-info { align-items: flex-start; }
  .main { padding: 0 12px 24px; }
  .groups { grid-template-columns: 1fr; }
  .ball { width: 38px; height: 38px; font-size: 14px; }
  .ball-back { width: 32px; height: 32px; font-size: 12px; }
  .actions { padding: 12px; }
  .btn { padding: 8px 14px; font-size: 13px; }
  .modal-content { padding: 24px; }
}

/* ===== 收藏按钮(卡片右上角) ===== */
.group-card { position: relative; }
.fav-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  z-index: 2;
  transition: transform .15s, background .15s;
}
.fav-btn:hover { transform: scale(1.15); background: rgba(255, 255, 255, 0.18); }
.fav-btn.is-fav { background: rgba(255, 80, 100, 0.18); border-color: rgba(255, 80, 100, 0.4); }
.fav-btn.is-fav:hover { background: rgba(255, 80, 100, 0.28); }

/* 卡片底部操作区(复制按钮) */
.group-actions {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed rgba(255, 255, 255, 0.12);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.group-actions .btn { flex: 1; min-width: 120px; }

/* 收藏数量徽章 */
.fav-count {
  font-size: 12px;
  color: var(--text-muted);
  margin-left: 4px;
}

/* 收藏面板 */
.favorites-panel {
  margin: 0 auto 24px;
  padding: 20px 24px;
  border-radius: 16px;
  position: relative;
  z-index: 5;
}
.fav-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.fav-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}
.fav-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 14px;
}
.fav-item .fav-period {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: auto;
  font-weight: normal;
}

/* 复制提示 toast */
.copy-toast {
  position: fixed;
  left: 50%;
  bottom: 40px;
  transform: translateX(-50%) translateY(20px);
  background: rgba(20, 20, 35, 0.95);
  color: #fff;
  padding: 12px 22px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  max-width: 90vw;
  text-align: center;
  word-break: break-all;
}
.copy-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ===== 设备管理面板 ===== */
.devices-panel { margin: 0 auto 24px; padding: 20px 24px; border-radius: 16px; position: relative; z-index: 5; }
.devices-panel-hint { font-size: 12px; color: var(--text-muted); }
.glass-inner {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 12px;
}
.device-link-card { transition: border-color .15s; }
.device-link-card:hover { border-color: rgba(255, 255, 255, 0.18); }
.device-link-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  flex-wrap: wrap;
  gap: 8px;
}
.device-link-info { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.device-link-token {
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.06);
  padding: 3px 8px;
  border-radius: 5px;
}
.device-link-created { font-size: 11px; color: var(--text-muted); }
.device-link-status {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  white-space: nowrap;
}
.device-link-status.is-empty { background: rgba(150, 150, 150, 0.15); color: rgba(255, 255, 255, 0.6); }
.device-link-status.is-partial { background: rgba(80, 180, 255, 0.18); color: rgb(120, 200, 255); }
.device-link-status.is-full { background: rgba(255, 80, 80, 0.2); color: rgb(255, 130, 130); }

.device-list { padding: 6px 0; }
.device-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 13px;
  flex-wrap: wrap;
}
.device-row:first-child { border-top: none; }
.device-row.is-current { background: rgba(80, 180, 255, 0.08); border-radius: 6px; padding: 8px 10px; margin: 0 -10px; }
.device-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}
.device-name {
  font-weight: 700;
  font-size: 14px;
  color: #fff;
}
.device-hash {
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
}
.device-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.device-time { font-size: 11px; color: var(--text-muted); }
.device-tag {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 10px;
  background: rgba(80, 200, 120, 0.2);
  color: rgb(120, 220, 150);
}
.device-rename, .device-remove, .device-remove-btn {
  font-size: 11px;
  padding: 4px 10px;
}
.btn-danger {
  background: rgba(255, 80, 80, 0.15);
  color: rgb(255, 130, 130);
  border: 1px solid rgba(255, 80, 80, 0.3);
}
.btn-danger:hover {
  background: rgba(255, 80, 80, 0.25);
  border-color: rgba(255, 80, 80, 0.5);
}
.device-empty { font-size: 12px; color: var(--text-muted); padding: 6px 0; }
.device-link-actions {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
  text-align: right;
}
.device-toggle {
  font-size: 11px;
  padding: 4px 10px;
  margin-left: 8px;
}

/* 查询任意副链接 */
.device-search-box {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  padding: 12px;
  background: rgba(80, 180, 255, 0.06);
  border: 1px solid rgba(80, 180, 255, 0.18);
  border-radius: 10px;
}
.device-search-box input {
  flex: 1;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  color: #fff;
  font-size: 13px;
  font-family: ui-monospace, SFMono-Regular, monospace;
  outline: none;
}
.device-search-box input:focus {
  border-color: rgba(80, 180, 255, 0.5);
  background: rgba(0, 0, 0, 0.4);
}
.device-search-box input::placeholder {
  color: rgba(255, 255, 255, 0.4);
  font-family: system-ui, -apple-system, sans-serif;
}
#deviceSearchResult { margin-bottom: 16px; }
#deviceSearchResult .fav-empty { padding: 20px; }

/* 选组数选择器 */
.group-count-picker {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px 4px 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  margin-left: 4px;
}
.picker-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-right: 4px;
}
.picker-btn {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.65);
  padding: 5px 12px;
  font-size: 13px;
  border-radius: 5px;
  cursor: pointer;
  transition: all .15s;
  font-weight: 500;
}
.picker-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}
.picker-btn.active {
  background: rgba(80, 180, 255, 0.22);
  color: rgb(120, 200, 255);
  font-weight: 600;
}

/* 开奖号码统计行 */
.latest-draw-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding: 12px 0;
  margin-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}
.stat-label {
  font-size: 11px;
  color: var(--text-muted);
}
.stat-val {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  font-family: ui-monospace, SFMono-Regular, monospace;
}
@media (max-width: 768px) {
  .latest-draw-stats { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .group-count-picker { margin-left: 0; margin-top: 6px; }
}

/* 历史开奖记录面板 */
.history-panel { margin: 0 auto 24px; padding: 20px 24px; border-radius: 16px; position: relative; z-index: 5; }
.history-panel-hint { font-size: 12px; color: var(--text-muted); }
.history-list {
  max-height: 540px;
  overflow-y: auto;
  padding-right: 4px;
}
.history-list::-webkit-scrollbar { width: 6px; }
.history-list::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.04); border-radius: 3px; }
.history-list::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.18); border-radius: 3px; }
.history-list::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.28); }
.history-table { display: flex; flex-direction: column; gap: 4px; }
.history-row {
  display: grid;
  grid-template-columns: 80px 110px 1fr 1fr;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  font-size: 13px;
  transition: background .15s;
}
.history-row:hover { background: rgba(255, 255, 255, 0.07); }
.history-head {
  background: rgba(80, 180, 255, 0.1);
  border-color: rgba(80, 180, 255, 0.2);
  font-weight: 600;
  font-size: 12px;
  color: var(--text-muted);
  position: sticky;
  top: 0;
  z-index: 1;
}
.history-head:hover { background: rgba(80, 180, 255, 0.1); }
.h-period { font-family: ui-monospace, SFMono-Regular, monospace; font-weight: 600; color: #fff; }
.h-date { font-size: 12px; color: rgba(255, 255, 255, 0.7); }
.h-balls { display: flex; gap: 3px; flex-wrap: wrap; }
.h-ball {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  font-family: ui-monospace, SFMono-Regular, monospace;
}
.h-ball-front { background: linear-gradient(135deg, #ff5e62, #ff2d55); }
.h-ball-back { background: linear-gradient(135deg, #4facfe, #00c4ff); }
@media (max-width: 768px) {
  .history-row { grid-template-columns: 70px 1fr; gap: 6px; }
  .history-row .h-date, .history-row .h-balls:nth-of-type(2) { grid-column: 2; }
  .history-row .h-balls:first-of-type { grid-column: 1 / -1; }
}
