/* ============== 基础 ============== */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #0a0e14;
  color: #e0e6ed;
  min-height: 100vh;
  font-size: 16px;
  line-height: 1.5;
}
.hidden { display: none !important; }
button { cursor: pointer; font-family: inherit; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; font-size: 16px; }
a { color: #ff7a45; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ============== 登录 ============== */
.login-layer { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: radial-gradient(circle at 30% 20%, #1a2332 0%, #0a0e14 60%); padding: 20px; }
.login-box { background: #131923; border: 1px solid #1f2a3a; border-radius: 16px; padding: 32px 28px; width: 100%; max-width: 420px; box-shadow: 0 20px 60px rgba(0,0,0,0.6); }
.login-logo { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }
.login-logo .logo-icon { width: 52px; height: 52px; background: linear-gradient(135deg, #ff7a45, #ff5a1f); border-radius: 12px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 26px; font-weight: 700; box-shadow: 0 4px 12px rgba(255,122,69,0.3); flex-shrink: 0; }
.login-logo h1 { color: #fff; font-size: 18px; }
.login-logo .subtitle { color: #6b7889; font-size: 12px; }
#passwordInput { width: 100%; padding: 14px; background: #0a0e14; border: 1px solid #1f2a3a; color: #fff; border-radius: 10px; font-size: 18px; text-align: center; letter-spacing: 4px; margin-bottom: 14px; outline: none; }
#passwordInput:focus { border-color: #ff7a45; }
.error { color: #e74c3c; text-align: center; margin-top: 10px; font-size: 14px; min-height: 20px; }

/* ============== 通用按钮 ============== */
.btn-primary { width: 100%; padding: 14px; background: linear-gradient(135deg, #ff7a45, #ff5a1f); color: #fff; border-radius: 10px; font-size: 15px; font-weight: 600; transition: transform 0.15s, box-shadow 0.15s; box-shadow: 0 4px 12px rgba(255,122,69,0.3); }
.btn-primary:active { transform: scale(0.98); }
.btn-orange { padding: 8px 16px; background: linear-gradient(135deg, #ff7a45, #ff5a1f); color: #fff; border-radius: 8px; font-size: 13px; font-weight: 600; transition: all 0.15s; box-shadow: 0 2px 8px rgba(255,122,69,0.2); }
.btn-orange:hover { box-shadow: 0 4px 12px rgba(255,122,69,0.4); }
.btn-orange:active { transform: scale(0.97); }
.btn-orange-outline { padding: 8px 16px; background: transparent; color: #ff7a45; border: 1px solid #ff7a45; border-radius: 8px; font-size: 13px; font-weight: 600; transition: all 0.15s; }
.btn-orange-outline:hover { background: rgba(255,122,69,0.1); }
.btn-mini { padding: 6px 12px; background: #1f2a3a; color: #c0c8d4; border-radius: 6px; font-size: 12px; transition: all 0.15s; }
.btn-mini:hover { background: #2a3a4f; color: #fff; }
.btn-mini:active { transform: scale(0.97); }
.btn-danger { background: #c0392b; color: #fff; }
.btn-danger:hover { background: #a93226; }

/* ============== 顶部 Header + Tab 合并卡片(大尺寸 PWA 友好) ============== */
.app-header-card {
  background: #131923;
  border: 1px solid #1f2a3a;
  border-radius: 14px;
  margin: 16px auto 0;
  max-width: 1400px;
  width: calc(100% - 32px);
  overflow: hidden;
  position: sticky;
  top: 16px;
  z-index: 100;
  box-shadow: 0 6px 28px rgba(0,0,0,0.4);
}
.app-header {
  padding: 24px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  min-height: 108px;
  border-bottom: 1px solid #1f2a3a;
}
.brand { display: flex; align-items: center; gap: 16px; min-width: 0; flex: 1; }
.brand .logo-icon {
  width: 64px; height: 64px;
  background: linear-gradient(135deg, #ff7a45, #ff5a1f);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 32px; font-weight: 700;
  box-shadow: 0 4px 16px rgba(255,122,69,0.5);
  flex-shrink: 0;
}
.brand-text { min-width: 0; flex: 1; }
.brand-text h1 {
  color: #fff; font-size: 22px; font-weight: 600;
  margin-bottom: 8px; display: flex; align-items: center; gap: 12px;
  flex-wrap: wrap; line-height: 1.2;
}
.badge-status {
  background: linear-gradient(135deg, #1a3a2d, #15301f);
  color: #2ecc71;
  padding: 4px 12px; border-radius: 10px;
  font-size: 12px; font-weight: 500;
  border: 1px solid rgba(46,204,113,0.2);
}
.brand-meta { color: #6b7889; font-size: 13px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.brand-meta b { color: #ff7a45; font-weight: 600; }
.meta-tag { background: #1f2a3a; color: #c0c8d4; padding: 3px 10px; border-radius: 6px; font-size: 12px; font-weight: 500; }
.meta-sep { color: #2a3a4f; }
.meta-status { color: #2ecc71; font-size: 12px; }
.header-right {
  text-align: right;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: rgba(255,122,69,0.1);
  border: 1px solid rgba(255,122,69,0.3);
  border-radius: 12px;
}
.header-cd-icon { font-size: 22px; }
.header-cd-text { text-align: right; }
.header-cd-label { color: #6b7889; font-size: 11px; line-height: 1; margin-bottom: 4px; letter-spacing: 0.5px; }
.header-cd-num { color: #ff7a45; font-size: 28px; font-weight: 700; font-family: "Courier New", monospace; line-height: 1; letter-spacing: -0.5px; }

/* Tab 导航(Header 卡片内) */
.tabs-nav {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  padding: 12px;
  gap: 8px;
}
.tab-btn {
  padding: 16px 14px;
  color: #6b7889;
  font-size: 16px;
  font-weight: 500;
  border-radius: 10px;
  transition: all 0.15s;
  white-space: nowrap;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.tab-btn:hover { color: #c0c8d4; background: rgba(255,255,255,0.04); }
.tab-btn.active {
  color: #fff;
  background: linear-gradient(135deg, #ff7a45, #ff5a1f);
  font-weight: 600;
  box-shadow: 0 3px 12px rgba(255,122,69,0.4);
}

/* ============== Tab Container ============== */
.tab-container { padding: 16px 16px 24px; max-width: 1400px; margin: 0 auto; width: 100%; }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ============== 卡片 ============== */
.card { background: #131923; border: 1px solid #1f2a3a; border-radius: 12px; padding: 20px; margin-bottom: 16px; }
.card h2 { color: #fff; font-size: 16px; font-weight: 600; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.card h3 { color: #fff; font-size: 14px; font-weight: 600; margin-bottom: 10px; }
.subtle { color: #6b7889; font-size: 13px; margin-bottom: 12px; }
.card-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.card-dot.red { background: #ff5a4d; }
.card-dot.orange { background: #ff7a45; }

/* ============== 杀号页布局 ============== */
.kill-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
.left-col { min-width: 0; }
.right-col { min-width: 0; }
@media (max-width: 1024px) { .kill-grid { grid-template-columns: 1fr; } }

/* ============== 最新开奖 + 倒计时 ============== */
.latest-header { display: flex; align-items: center; gap: 8px; }
.latest-header h2 { margin-bottom: 0; }
.live-tag { color: #e74c3c; font-size: 11px; background: rgba(231,76,60,0.1); padding: 2px 8px; border-radius: 10px; margin-left: auto; animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
.latest-info { margin: 8px 0 12px; }
.latest-period { color: #c0c8d4; font-size: 14px; }
.latest-period b { color: #ff7a45; font-size: 18px; margin: 0 4px; }
.latest-date { color: #6b7889; font-size: 13px; margin-left: 8px; }
.latest-balls { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.latest-balls .lb {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; color: #fff;
  position: relative;
  background:
    radial-gradient(circle at 30% 25%, rgba(255,255,255,0.6) 0%, rgba(255,255,255,0) 25%),
    radial-gradient(circle at 50% 50%, #ff6b5a 0%, #e74c3c 60%, #b8302a 100%);
  box-shadow:
    inset -2px -3px 4px rgba(0,0,0,0.4),
    inset 2px 2px 3px rgba(255,255,255,0.5),
    0 4px 8px rgba(0,0,0,0.4),
    0 0 12px rgba(255,90,77,0.3);
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
  letter-spacing: -0.5px;
  animation: lb-appear 0.4s ease backwards;
}
.latest-balls .lb::before {
  content: ""; position: absolute;
  top: 4px; left: 18%; width: 64%; height: 30%;
  background: radial-gradient(ellipse at center, rgba(255,255,255,0.55) 0%, rgba(255,255,255,0) 70%);
  border-radius: 50%;
  pointer-events: none;
}
.latest-balls .lb:nth-child(1) { animation-delay: 0.05s; }
.latest-balls .lb:nth-child(2) { animation-delay: 0.10s; }
.latest-balls .lb:nth-child(3) { animation-delay: 0.15s; }
.latest-balls .lb:nth-child(4) { animation-delay: 0.20s; }
.latest-balls .lb:nth-child(5) { animation-delay: 0.25s; }
.latest-balls .lb:nth-child(6) { animation-delay: 0.30s; }
.latest-balls .lb:nth-child(7) { animation-delay: 0.35s; }
.latest-balls .lb:nth-child(8) { animation-delay: 0.40s; }
.latest-balls .lb:nth-child(9) { animation-delay: 0.45s; }
.latest-balls .lb:nth-child(10) { animation-delay: 0.50s; }
.latest-balls .lb:nth-child(n+11) { animation-delay: 0.55s; }
@keyframes lb-appear {
  from { transform: scale(0.3) rotate(-180deg); opacity: 0; }
  to { transform: scale(1) rotate(0); opacity: 1; }
}
.latest-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 12px; background: #0a0e14; border-radius: 8px; margin: 12px 0; }
.latest-stats div { text-align: center; }
.latest-stats label { display: block; color: #e6e9ef; font-size: 12px; font-weight: 500; }
.latest-stats b { color: #ff7a45; font-size: 18px; font-weight: 700; }
.countdown-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.cd-cell { background: #0a0e14; border: 1px solid #1f2a3a; border-radius: 8px; padding: 10px; text-align: center; }
.cd-cell span { display: block; color: #ff7a45; font-size: 22px; font-weight: 700; font-family: "Courier New", monospace; }
.cd-cell label { color: #6b7889; font-size: 11px; }
.next-draw-info { color: #6b7889; font-size: 13px; text-align: center; margin-top: 10px; }
.next-draw-info b { color: #ff7a45; }

/* ============== 候选号码池 ============== */
.pool-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; flex-wrap: wrap; gap: 10px; }
.pool-header h2 { margin-bottom: 0; }
.pool-actions { display: flex; gap: 8px; }
.pool-grid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 6px; margin: 12px 0; }
.threshold-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  background: linear-gradient(135deg, #1a2332, #131923);
  border: 1px solid #1f2a3a;
  border-left: 3px solid #ff7a45;
  border-radius: 8px;
  margin-bottom: 12px;
  font-size: 12px;
  color: #c0c8d4;
  flex-wrap: wrap;
}
.threshold-row label { flex: 1; min-width: 200px; }
.threshold-row label b { color: #ff7a45; font-size: 14px; margin: 0 2px; }
.threshold-row input[type="range"] { width: 160px; accent-color: #ff7a45; }
.threshold-hint { color: #6b7889; font-size: 11px; }
@media (max-width: 640px) { .pool-grid { grid-template-columns: repeat(8, 1fr); } }
@media (max-width: 380px) { .pool-grid { grid-template-columns: repeat(6, 1fr); } }
/* ============ 立体号码球(高端彩票 App 风格) ============ */
.p-ball {
  width: 38px; height: 38px; margin: 0 auto;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; color: #fff;
  cursor: pointer; user-select: none;
  position: relative;
  border: none;
  /* 径向渐变:中心高光 → 边缘暗,形成球面感 */
  background:
    radial-gradient(circle at 30% 25%, rgba(255,255,255,0.6) 0%, rgba(255,255,255,0) 25%),
    radial-gradient(circle at 50% 50%, #ff6b5a 0%, #e74c3c 60%, #b8302a 100%);
  /* 三重阴影:外凸起 + 右下暗 + 左上亮 */
  box-shadow:
    inset -2px -3px 4px rgba(0,0,0,0.35),
    inset 2px 2px 3px rgba(255,255,255,0.4),
    0 3px 6px rgba(0,0,0,0.4),
    0 1px 2px rgba(0,0,0,0.2);
  transition: transform 0.12s, box-shadow 0.12s;
  text-shadow: 0 1px 2px rgba(0,0,0,0.4);
  letter-spacing: -0.5px;
}
.p-ball::before {
  /* 顶部反光高光 */
  content: ""; position: absolute;
  top: 4px; left: 18%; width: 64%; height: 30%;
  background: radial-gradient(ellipse at center, rgba(255,255,255,0.5) 0%, rgba(255,255,255,0) 70%);
  border-radius: 50%;
  pointer-events: none;
}
.p-ball:hover {
  transform: scale(1.12) translateY(-1px);
  box-shadow:
    inset -2px -3px 4px rgba(0,0,0,0.35),
    inset 2px 2px 3px rgba(255,255,255,0.5),
    0 5px 10px rgba(231,76,60,0.5),
    0 2px 4px rgba(0,0,0,0.3);
}
.p-ball:active { transform: scale(0.96); }
.p-ball.killed {
  background:
    radial-gradient(circle at 30% 25%, rgba(255,255,255,0.15) 0%, rgba(255,255,255,0) 30%),
    radial-gradient(circle at 50% 50%, rgba(80,80,80,0.6) 0%, rgba(40,40,40,0.8) 100%);
  color: #ff5a4d;
  text-decoration: line-through;
  text-decoration-color: #ff5a4d;
  box-shadow:
    inset 1px 1px 2px rgba(255,255,255,0.05),
    inset -1px -1px 2px rgba(0,0,0,0.4),
    0 0 0 1.5px rgba(255,90,77,0.5),
    0 1px 3px rgba(0,0,0,0.3);
  text-shadow: none;
  opacity: 0.75;
}
.p-ball .hit-badge {
  position: absolute;
  top: -3px; right: -3px;
  background: #ff5a4d;
  color: #fff;
  font-size: 8px;
  font-weight: 700;
  width: 14px; height: 14px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  z-index: 2;
  box-shadow: 0 0 4px rgba(255,90,77,0.5);
}
.p-ball .cnt { position: absolute; top: -2px; right: -2px; background: #ff7a45; color: #fff; font-size: 9px; padding: 1px 4px; border-radius: 8px; font-weight: 600; line-height: 1.2; }
.p-ball.killed .cnt { background: #4a5568; }
.p-ball.picked { box-shadow: 0 0 0 2px #2ecc71, 0 1px 4px rgba(46,204,113,0.3); }
.p-ball.picked-dan { box-shadow: 0 0 0 2px #2ecc71, 0 0 0 4px rgba(46,204,113,0.3); }
.p-ball.picked-tuo { box-shadow: 0 0 0 2px #4a90e2, 0 0 0 4px rgba(74,144,226,0.3); }
.pool-footer { display: flex; justify-content: space-between; align-items: center; padding: 12px; background: #0a0e14; border-radius: 8px; font-size: 13px; color: #c0c8d4; flex-wrap: wrap; gap: 8px; }
.pool-footer b { color: #ff7a45; font-size: 16px; margin: 0 4px; }
.pool-hint { color: #6b7889; font-size: 12px; }

/* ============== 公式触发列表 ============== */
.formulas-card { padding: 16px 20px; }
.formulas-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; flex-wrap: wrap; gap: 8px; }
.formulas-header h2 { margin-bottom: 0; }
.formulas-sub { color: #6b7889; font-size: 12px; }
.formulas-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; }
@media (max-width: 768px) { .formulas-grid { grid-template-columns: 1fr; } }
.formula-item { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; background: #0a0e14; border-radius: 6px; font-size: 13px; gap: 10px; }
.formula-name { color: #c0c8d4; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.formula-num { color: #6b7889; font-family: "Courier New", monospace; font-size: 12px; max-width: 50%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.formula-rate { background: #2ecc71; color: #0a0e14; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 700; flex-shrink: 0; }
.formula-rate.mid { background: #ff7a45; }
.formula-rate.low { background: #6b7889; }

/* ============== 智能选号(右栏) ============== */
.pick-config { margin-bottom: 10px; }
.pick-config-item { display: flex; align-items: center; gap: 8px; }
.pick-config-item label { color: #6b7889; font-size: 12px; min-width: 40px; }
.pick-config-item select { flex: 1; padding: 8px 10px; background: #0a0e14; color: #fff; border: 1px solid #1f2a3a; border-radius: 6px; font-size: 14px; outline: none; }
.pick-config-item select:focus { border-color: #ff7a45; }
.pick-mode-row { display: flex; gap: 4px; background: #0a0e14; padding: 4px; border-radius: 8px; margin-bottom: 12px; }
.mode-btn { flex: 1; padding: 8px; background: transparent; color: #6b7889; border-radius: 6px; font-size: 13px; transition: all 0.15s; }
.mode-btn.active { background: linear-gradient(135deg, #ff7a45, #ff5a1f); color: #fff; font-weight: 600; }
.pick-info { display: flex; justify-content: space-between; padding: 10px 12px; background: #0a0e14; border-radius: 8px; margin-bottom: 8px; font-size: 13px; color: #c0c8d4; }
.pick-info b { color: #ff7a45; }
.pick-section { padding: 8px 10px; background: #0a0e14; border-radius: 6px; margin-bottom: 10px; min-height: 24px; }
.pick-section-hint { color: #6b7889; font-size: 12px; }
.pick-section-hint b { color: #ff7a45; }
.dan-row { display: flex; flex-direction: column; gap: 10px; }
.dan-row > div { }
.dan-row label { display: block; color: #6b7889; font-size: 12px; margin-bottom: 4px; font-weight: 600; }
.dan-pool { display: flex; flex-wrap: wrap; gap: 4px; min-height: 28px; padding: 6px; background: #131923; border-radius: 4px; }
.dan-pool:empty::before { content: "暂无"; color: #4a5568; font-size: 11px; }
.dan-ball { width: 24px; height: 24px; background: linear-gradient(135deg, #ff5a4d, #c0392b); color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 10px; }
.dan-ball.dan-tuo { background: linear-gradient(135deg, #4a90e2, #357abd); }
.dan-hint { color: #6b7889; font-size: 11px; margin-top: 4px; }
.dan-hint b { color: #ff7a45; }
.dan-actions { display: flex; gap: 6px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed #1f2a3a; }
.multi-presets { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.mp-label { color: #6b7889; font-size: 12px; margin-right: 4px; }
.multi-presets button { font-size: 11px; padding: 4px 10px; }
.multi-warning { color: #ff5a4d; font-size: 12px; font-weight: 600; padding: 8px 10px; background: rgba(255,90,77,0.1); border: 1px solid #ff5a4d; border-radius: 6px; margin-top: 8px; }
.single-recs { margin-top: 10px; padding-top: 10px; border-top: 1px dashed #1f2a3a; }
.recs-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 8px; }
@media (max-width: 480px) { .recs-grid { grid-template-columns: 1fr; } }
.rec-item { background: #0a0e14; border: 1px solid #1f2a3a; border-radius: 6px; padding: 8px 10px; cursor: pointer; transition: all 0.15s; }
.rec-item:hover { border-color: #ff7a45; background: #131923; transform: translateY(-1px); }
.rec-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.rec-strategy { color: #ff7a45; font-weight: 600; font-size: 12px; }
.rec-score { color: #2ecc71; font-size: 10px; background: #1a3a2d; padding: 1px 6px; border-radius: 6px; font-weight: 600; }
.rec-balls { display: flex; flex-wrap: wrap; gap: 3px; margin: 6px 0; justify-content: flex-start; }
.rb { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 4px; background: linear-gradient(135deg, #ff5a4d, #c0392b); color: #fff; border-radius: 11px; font-size: 10px; font-weight: 700; }
.rec-detail-row { display: flex; gap: 6px; font-size: 10px; color: #6b7889; flex-wrap: wrap; }
.rec-detail-row b { color: #c0c8d4; font-weight: 600; }
.pick-empty { color: #6b7889; font-size: 13px; padding: 24px 12px; text-align: center; border: 1px dashed #1f2a3a; border-radius: 8px; margin-bottom: 12px; }
.pick-balls { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px; background: linear-gradient(180deg, #0f1320, #0a0e14); border-radius: 10px; min-height: 56px; margin-bottom: 12px; border: 1px solid rgba(255,255,255,0.04); }
.pick-balls .pb {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; color: #fff;
  position: relative;
  background:
    radial-gradient(circle at 30% 25%, rgba(255,255,255,0.55) 0%, rgba(255,255,255,0) 25%),
    radial-gradient(circle at 50% 50%, #ff6b5a 0%, #e74c3c 60%, #b8302a 100%);
  box-shadow:
    inset -2px -3px 4px rgba(0,0,0,0.35),
    inset 2px 2px 3px rgba(255,255,255,0.4),
    0 3px 6px rgba(0,0,0,0.4),
    0 1px 2px rgba(0,0,0,0.2);
  text-shadow: 0 1px 2px rgba(0,0,0,0.4);
  letter-spacing: -0.5px;
  transition: transform 0.12s;
  cursor: pointer;
}
.pick-balls .pb::before {
  content: ""; position: absolute;
  top: 3px; left: 18%; width: 64%; height: 30%;
  background: radial-gradient(ellipse at center, rgba(255,255,255,0.5) 0%, rgba(255,255,255,0) 70%);
  border-radius: 50%;
  pointer-events: none;
}
.pick-balls .pb:hover { transform: scale(1.1) translateY(-1px); }
.pick-balls .pb.pick-blue {
  background:
    radial-gradient(circle at 30% 25%, rgba(255,255,255,0.55) 0%, rgba(255,255,255,0) 25%),
    radial-gradient(circle at 50% 50%, #5dade2 0%, #3498db 60%, #1f618d 100%);
}
.pick-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 12px; background: #0a0e14; border-radius: 8px; margin-bottom: 12px; }
.pick-stats div { text-align: center; }
.pick-stats label { display: block; color: #6b7889; font-size: 11px; }
.pick-stats b { color: #ff7a45; font-size: 20px; font-weight: 700; }
.pick-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.pick-actions button { flex: 1; min-width: 60px; }
.pick-tip { color: #6b7889; font-size: 12px; margin-top: 10px; padding: 8px; background: rgba(255,122,69,0.05); border-left: 2px solid #ff7a45; border-radius: 4px; }

/* ============== 收藏 ============== */
.collect-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; flex-wrap: wrap; gap: 8px; }
.collect-header h2 { margin-bottom: 0; }
.collect-count { color: #6b7889; font-size: 12px; font-weight: 400; }
.collect-list { display: flex; flex-direction: column; gap: 8px; }
.collect-empty { color: #6b7889; font-size: 13px; padding: 20px; text-align: center; }
.collect-item { background: #0a0e14; border: 1px solid #1f2a3a; border-radius: 8px; padding: 10px 12px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.collect-label { color: #ff7a45; font-weight: 600; font-size: 13px; min-width: 50px; }
.collect-balls { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; min-width: 0; }
.collect-balls .cb { width: 26px; height: 26px; background: linear-gradient(135deg, #ff5a4d, #c0392b); color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 11px; }
.collect-actions { display: flex; gap: 4px; flex-shrink: 0; }
.collect-actions button { width: 30px; height: 30px; padding: 0; font-size: 13px; }

/* ============== 号码频率柱状图(详细版) ============== */
.freq-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; flex-wrap: wrap; gap: 8px; }
.freq-header h2 { margin-bottom: 0; }
.freq-mode { padding: 4px 10px; font-size: 12px; }
.freq-mode.active { background: linear-gradient(135deg, #ff7a45, #ff5a1f); color: #fff; }
.freq-controls { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; align-items: center; }
.freq-sort { background: #1f2a3a; color: #c0c8d4; border: 1px solid #2d3a4f; padding: 4px 10px; border-radius: 6px; font-size: 12px; }
.freq-chart {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 220px;
  padding: 20px 8px 8px;
  background: #0a0e14;
  border-radius: 8px;
  overflow-x: auto;
  position: relative;
}
.freq-chart::before {
  content: "次数";
  position: absolute;
  top: 4px; left: 8px;
  color: #4a5568;
  font-size: 10px;
}
.freq-bar {
  flex: 0 0 18px;
  min-width: 18px;
  background: linear-gradient(180deg, #ff7a45, #ff5a1f);
  border-radius: 3px 3px 0 0;
  position: relative;
  transition: all 0.2s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
}
.freq-bar:hover { transform: scaleY(1.05); filter: brightness(1.3); z-index: 5; }
.freq-bar.hot { background: linear-gradient(180deg, #e74c3c, #c0392b); box-shadow: 0 0 6px rgba(231,76,60,0.5); }
.freq-bar.cold { background: linear-gradient(180deg, #4a90e2, #357abd); box-shadow: 0 0 6px rgba(74,144,226,0.5); }
.freq-bar.selected { box-shadow: 0 0 0 2px #ff7a45, 0 0 12px rgba(255,122,69,0.6); }
.freq-bar .freq-num {
  position: absolute;
  top: -16px; left: 50%; transform: translateX(-50%);
  color: #8896a6; font-size: 9px; font-weight: 600;
  font-family: "Courier New", monospace;
  white-space: nowrap;
}
.freq-bar .freq-val {
  position: absolute;
  bottom: 2px; left: 50%; transform: translateX(-50%);
  color: #fff; font-size: 9px; font-weight: 700;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
  white-space: nowrap;
}
.freq-bar.hot .freq-num,
.freq-bar.cold .freq-num {
  color: #fff;
  font-weight: 700;
}

/* 悬停 tooltip */
.freq-tooltip {
  position: fixed;
  background: #131923;
  border: 1px solid #ff7a45;
  border-radius: 8px;
  padding: 10px 14px;
  color: #c0c8d4;
  font-size: 12px;
  pointer-events: none;
  z-index: 1000;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  min-width: 160px;
}
.freq-tooltip .tt-title { color: #ff7a45; font-size: 14px; font-weight: 700; margin-bottom: 6px; }
.freq-tooltip .tt-row { display: flex; justify-content: space-between; padding: 2px 0; gap: 12px; }
.freq-tooltip .tt-label { color: #6b7889; }
.freq-tooltip .tt-val { color: #c0c8d4; font-weight: 600; }


.analyze-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.analyze-header h2 { margin-bottom: 0; }
.analyze-progress { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.progress-bar { flex: 1; height: 6px; background: #1f2a3a; border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, #ff7a45, #2ecc71); border-radius: 3px; }
.analyze-progress span { color: #6b7889; font-size: 12px; }
.analyze-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 18px; }
@media (max-width: 640px) { .analyze-stats { grid-template-columns: repeat(2, 1fr); } }
.stat-tile { background: #0a0e14; border: 1px solid #1f2a3a; border-radius: 8px; padding: 14px 8px; text-align: center; }
.stat-tile.green { border-color: #2ecc71; }
.stat-tile.orange { border-color: #ff7a45; }
.stat-tile label { color: #6b7889; font-size: 11px; display: block; }
.stat-tile b { color: #ff7a45; font-size: 22px; font-weight: 700; display: block; margin-top: 4px; }
.stat-tile.green b { color: #2ecc71; }
.stat-tile.orange b { color: #ff7a45; }
.sub-h3 { color: #fff; font-size: 14px; margin: 14px 0 10px; }
.weight-list { display: flex; flex-wrap: wrap; gap: 6px; }
.weight-item { padding: 4px 10px; background: #0a0e14; border: 1px solid #1f2a3a; border-radius: 14px; font-size: 12px; color: #c0c8d4; font-family: "Courier New", monospace; }
.weight-item .arrow { margin-left: 4px; font-weight: 700; }
.weight-item .arrow.up { color: #2ecc71; }
.weight-item .arrow.down { color: #e74c3c; }

/* ============== 历史 ============== */
.history-toggle { display: flex; gap: 4px; background: #0a0e14; padding: 4px; border-radius: 8px; margin-bottom: 14px; max-width: 300px; }
.history-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 1024px) { .history-list { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .history-list { grid-template-columns: 1fr; } }
.history-card { background: #0a0e14; border: 1px solid #1f2a3a; border-radius: 10px; padding: 14px; transition: all 0.15s; }
.history-card:hover { border-color: #ff7a45; }
.hc-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.hc-period { color: #ff7a45; font-weight: 700; font-size: 14px; }
.hc-date { color: #6b7889; font-size: 12px; }
.hc-balls { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 10px; }
.hc-balls .hcb {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 11px; color: #fff;
  position: relative;
  background:
    radial-gradient(circle at 30% 25%, rgba(255,255,255,0.55) 0%, rgba(255,255,255,0) 25%),
    radial-gradient(circle at 50% 50%, #ff6b5a 0%, #e74c3c 60%, #b8302a 100%);
  box-shadow:
    inset -1.5px -2px 3px rgba(0,0,0,0.35),
    inset 1px 1px 2px rgba(255,255,255,0.4),
    0 2px 4px rgba(0,0,0,0.4);
  text-shadow: 0 1px 1px rgba(0,0,0,0.4);
}
.hc-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding-top: 10px; border-top: 1px solid #1f2a3a; }
.hc-stats div { text-align: center; }
.hc-stats label { color: #6b7889; font-size: 10px; display: block; }
.hc-stats b { color: #c0c8d4; font-size: 13px; }
.hc-stats b.red-text { color: #ff5a4d; }

/* ============== 分享 ============== */
.share-rules { list-style: none; color: #c0c8d4; }
.share-rules li { padding: 6px 0; padding-left: 20px; position: relative; font-size: 13px; }
.share-rules li::before { content: "•"; position: absolute; left: 0; color: #ff7a45; font-weight: 700; }
.share-rules b { color: #ff7a45; }
.query-row { display: flex; gap: 8px; margin-bottom: 12px; }
.query-row input { flex: 1; padding: 10px 12px; background: #0a0e14; border: 1px solid #1f2a3a; color: #fff; border-radius: 8px; outline: none; font-size: 13px; }
.query-row input:focus { border-color: #ff7a45; }
.share-create-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.share-create-header h3 { margin-bottom: 0; }
.slave-list { display: flex; flex-direction: column; gap: 10px; }
.slave-item { background: #0a0e14; border: 1px solid #1f2a3a; border-radius: 8px; padding: 12px; }
.slave-item-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; flex-wrap: wrap; gap: 8px; }
.slave-name { color: #fff; font-weight: 600; font-size: 14px; }
.slave-meta { color: #6b7889; font-size: 12px; margin-top: 2px; }
.slave-actions { display: flex; gap: 6px; }
.slave-link-box { background: #131923; border: 1px solid #1f2a3a; border-radius: 6px; padding: 8px 10px; font-family: "Courier New", monospace; font-size: 12px; color: #4a90e2; word-break: break-all; margin-bottom: 8px; }
.device-list { display: flex; flex-direction: column; gap: 4px; }
.device-item { display: flex; justify-content: space-between; align-items: center; padding: 6px 10px; background: #131923; border-radius: 6px; font-size: 12px; }
.device-label { color: #c0c8d4; }
.device-time { color: #6b7889; }
.empty-state { color: #6b7889; text-align: center; padding: 24px; font-size: 13px; }

/* ============== 设置 ============== */
.setting-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid #1f2a3a; flex-wrap: wrap; }
.setting-row:last-child { border-bottom: none; }
.setting-row label { color: #6b7889; font-size: 13px; min-width: 80px; }
.setting-row select { flex: 1; min-width: 140px; padding: 8px 12px; background: #0a0e14; border: 1px solid #1f2a3a; color: #fff; border-radius: 6px; font-size: 14px; outline: none; }
.setting-row select:focus { border-color: #ff7a45; }
.rules-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 8px; }
@media (max-width: 640px) { .rules-grid { grid-template-columns: 1fr; } }
.rule-group { background: #0a0e14; border: 1px solid #1f2a3a; border-radius: 8px; padding: 14px; }
.rule-group h3 { color: #ff7a45; margin-top: 0; margin-bottom: 10px; font-size: 14px; }
.rule-group label { display: flex; align-items: center; gap: 8px; padding: 6px 0; color: #c0c8d4; font-size: 13px; cursor: pointer; flex-wrap: wrap; }
.rule-group label.with-select { flex-wrap: wrap; }
.rule-group input[type="checkbox"] { accent-color: #ff7a45; width: 16px; height: 16px; flex-shrink: 0; }
.inline-select { background: #131923; color: #fff; border: 1px solid #1f2a3a; padding: 3px 8px; border-radius: 4px; font-size: 12px; margin-left: auto; }

/* ============== 弹窗 ============== */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.7); display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 20px; }
.modal-content { background: #131923; border: 1px solid #1f2a3a; border-radius: 12px; padding: 20px; width: 100%; max-width: 560px; max-height: 90vh; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.modal-content.modal-small { max-width: 360px; text-align: center; }
.modal-content h3 { color: #fff; margin-bottom: 10px; }
.modal-content p { color: #c0c8d4; font-size: 14px; margin-bottom: 10px; }
#importTextarea { width: 100%; background: #0a0e14; border: 1px solid #1f2a3a; color: #fff; border-radius: 6px; padding: 10px; font-family: "Courier New", monospace; font-size: 12px; outline: none; resize: vertical; }
.modal-actions { display: flex; gap: 10px; margin-top: 16px; justify-content: flex-end; }

/* ============== 移动端底部固定按钮 ============== */
.mobile-bottom-bar { display: none; position: fixed; bottom: 0; left: 0; right: 0; padding: 12px 16px; padding-bottom: calc(12px + env(safe-area-inset-bottom)); background: linear-gradient(180deg, transparent 0%, #0a0e14 30%); z-index: 50; gap: 8px; }
.mobile-bottom-bar button { flex: 1; padding: 12px; }
@media (max-width: 768px) { .mobile-bottom-bar { display: flex; } }

/* ============== 底部 ============== */
.footer { text-align: center; padding: 60px 20px 100px; color: #6b7889; font-size: 12px; border-top: 1px solid #1f2a3a; margin-top: 20px; }
.footer p { margin: 4px 0; }
.footer strong { color: #ff7a45; }

/* ============== Toast ============== */
.toast { position: fixed; top: 80px; left: 50%; transform: translateX(-50%); background: #131923; color: #fff; padding: 12px 20px; border-radius: 8px; border: 1px solid #ff7a45; z-index: 9999; box-shadow: 0 4px 20px rgba(255,122,69,0.3); font-size: 14px; max-width: 90vw; text-align: center; }

/* ============== 移动端 ============== */
@media (max-width: 640px) {
  .app-header-card { margin: 8px; border-radius: 10px; top: 8px; }
  .tab-container { padding: 8px 8px 100px; }
  .card { padding: 16px; }
  .app-header { padding: 12px 14px; min-height: 64px; gap: 10px; }
  .brand { gap: 10px; }
  .brand .logo-icon { width: 42px; height: 42px; font-size: 20px; border-radius: 10px; }
  .brand-text h1 { font-size: 14px; margin-bottom: 3px; }
  .brand-meta { font-size: 10px; gap: 5px; }
  .meta-tag { padding: 1px 6px; font-size: 10px; }
  .header-right { padding: 6px 10px; gap: 6px; }
  .header-cd-icon { font-size: 14px; }
  .header-cd-num { font-size: 16px; }
  .header-cd-label { font-size: 9px; }
  .tabs-nav { grid-template-columns: repeat(5, 1fr); padding: 5px; gap: 3px; }
  .tab-btn { padding: 9px 4px; font-size: 12px; gap: 2px; }
  .p-ball { font-size: 11px; width: 32px; height: 32px; }
  .lb, .pb, .cb, .hcb { font-size: 11px; }
  .latest-balls .lb { width: 30px; height: 30px; font-size: 12px; }
  .latest-stats b { font-size: 16px; }
  .cd-cell span { font-size: 18px; }
  .formulas-grid { grid-template-columns: 1fr; }
  .pick-actions button { font-size: 11px; padding: 6px 8px; }
}

/* ============ 公式回测表 ============ */
.backtest-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 10px;
}
.backtest-title { font-size: 15px; font-weight: 600; color: #e6e9ef; }
.backtest-select {
  background: #1a2030; color: #e6e9ef; border: 1px solid #2a3142;
  border-radius: 6px; padding: 4px 8px; font-size: 12px; cursor: pointer;
}
.backtest-meta { font-size: 11px; color: #6b7889; margin-bottom: 10px; }
.backtest-table {
  width: 100%; border-collapse: collapse; font-size: 12px;
  background: rgba(255,255,255,0.02); border-radius: 6px; overflow: hidden;
}
.backtest-table th, .backtest-table td {
  padding: 8px 6px; text-align: center; border-bottom: 1px solid rgba(255,255,255,0.04);
}
.backtest-table th { background: rgba(255,122,69,0.1); color: #ffb993; font-weight: 500; }
.backtest-table td { color: #c0c8d4; }
.bt-rank { color: #6b7889; font-weight: 600; width: 28px; }
.bt-correct { color: #2ecc71; }
.bt-wrong { color: #ff5b5b; }
.bt-good { color: #2ecc71; font-weight: 600; }
.bt-ok { color: #f0c54a; font-weight: 600; }
.bt-bad { color: #ff7a45; font-weight: 600; }
.bt-good-tag {
  display: inline-block; font-size: 10px; padding: 1px 5px;
  background: rgba(46,204,113,0.2); color: #2ecc71; border-radius: 3px; margin-left: 4px;
}
.bt-noise {
  display: inline-block; font-size: 10px; padding: 1px 5px;
  background: rgba(255,91,91,0.2); color: #ff5b5b; border-radius: 3px; margin-left: 4px;
}
.bt-bar {
  display: inline-block; width: 50%; height: 6px;
  background: rgba(255,255,255,0.05); border-radius: 3px;
  vertical-align: middle; margin-right: 6px;
}
.bt-bar-fill { height: 100%; border-radius: 3px; transition: width 0.3s; }
.bt-bar-fill.bt-good { background: linear-gradient(90deg, #2ecc71, #27ae60); }
.bt-bar-fill.bt-ok { background: linear-gradient(90deg, #f0c54a, #e0a830); }
.bt-bar-fill.bt-bad { background: linear-gradient(90deg, #ff5b5b, #c0392b); }
.backtest-hint {
  margin-top: 10px; padding: 10px; font-size: 11px; color: #9aa6b2;
  background: rgba(255,255,255,0.02); border-radius: 6px; line-height: 1.6;
}
.backtest-error {
  padding: 20px; text-align: center; color: #ff7a45; font-size: 13px;
}

/* ============ 通用 Modal ============ */
.modal-layer {
  display: none; position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.7); backdrop-filter: blur(4px);
  justify-content: center; align-items: center;
  animation: fadeIn 0.2s ease;
}
.modal-layer.show { display: flex; }
.modal-box {
  background: linear-gradient(180deg, #1a2030 0%, #141a26 100%);
  border: 1px solid #2a3142; border-radius: 12px;
  padding: 20px; max-width: 480px; width: 90%;
  max-height: 80vh; overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  animation: slideUp 0.3s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.reason-modal h3 {
  margin: 0 0 10px; font-size: 16px; color: #ffb993; text-align: center;
}
.reason-meta {
  font-size: 12px; color: #9aa6b2; margin-bottom: 12px; text-align: center;
}
.reason-yes { color: #ff5b5b; font-weight: 600; }
.reason-no { color: #2ecc71; font-weight: 600; }
.reason-list {
  list-style: none; padding: 0; margin: 12px 0;
}
.reason-list li {
  display: flex; gap: 10px; padding: 10px;
  background: rgba(255,255,255,0.03); border-radius: 6px;
  margin-bottom: 6px; border-left: 3px solid #ff7a45;
}
.reason-formula {
  flex: 0 0 90px; font-weight: 600; color: #ffb993; font-size: 13px;
}
.reason-detail {
  flex: 1; color: #c0c8d4; font-size: 12px; line-height: 1.5;
}
.reason-actions {
  display: flex; gap: 8px; justify-content: center; margin-top: 14px;
}
.btn-secondary {
  background: #2a3142; color: #c0c8d4; border: 1px solid #3a4252;
  border-radius: 6px; padding: 8px 16px; cursor: pointer; font-size: 13px;
}
.btn-secondary:hover { background: #3a4252; }
.btn-primary {
  background: linear-gradient(135deg, #ff7a45, #ff5722);
  color: white; border: none; border-radius: 6px;
  padding: 8px 16px; cursor: pointer; font-size: 13px; font-weight: 500;
}
.btn-primary:hover { box-shadow: 0 4px 12px rgba(255,122,69,0.4); }

/* ============ 回测表 - 行点击 / 权重列 ============ */
.bt-row { cursor: pointer; transition: background 0.15s; }
.bt-row:hover { background: rgba(255,122,69,0.08); }
.bt-on { color: #2ecc71; font-size: 14px; }
.bt-off { color: #555f70; font-size: 14px; }
.bt-count { color: #6b7889; font-size: 12px; font-weight: normal; margin-left: 6px; }
.bt-actions { display: flex; gap: 6px; margin: 10px 0; flex-wrap: wrap; }
.bt-action {
  background: #1a2030; color: #c0c8d4; border: 1px solid #2a3142;
  border-radius: 6px; padding: 6px 12px; font-size: 12px; cursor: pointer;
  transition: all 0.15s;
}
.bt-action:hover { background: #2a3142; }
.bt-action.primary {
  background: linear-gradient(135deg, #ff7a45, #ff5722); color: white;
  border-color: transparent; font-weight: 600;
}
.bt-action.primary:hover { box-shadow: 0 4px 12px rgba(255,122,69,0.4); }
.bt-weight { color: #ffb993; font-weight: 600; }

/* ============ 权重模式 toggle ============ */
.weight-mode-row {
  margin-top: 6px; background: rgba(255,255,255,0.02);
  border-radius: 6px; padding: 8px 10px;
}
.weight-mode-row label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.weight-mode-row input[type="checkbox"] {
  width: 16px; height: 16px; accent-color: #ff7a45; cursor: pointer;
}

/* ============ ROI 对比 ============ */
.roi-verdict {
  text-align: center; padding: 12px; margin: 10px 0;
  background: rgba(255,255,255,0.03); border-radius: 6px;
}
.roi-verdict b { font-size: 18px; }
.verdict-hint { color: #9aa6b2; font-size: 12px; margin-left: 8px; }

.roi-stats {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px;
  margin: 12px 0;
}
.roi-card {
  background: rgba(255,255,255,0.04); border: 1px solid #2a3142;
  border-radius: 8px; padding: 12px; text-align: center;
}
.roi-card.roi-diff {
  background: rgba(255,122,69,0.1); border-color: #ff7a45;
}
.roi-card label {
  display: block; font-size: 12px; color: #9aa6b2; margin-bottom: 6px;
}
.roi-main {
  font-size: 28px; font-weight: 700; color: #ffb993; line-height: 1.2;
}
.roi-sub { font-size: 14px; color: #6b7889; }
.roi-meta { font-size: 11px; color: #9aa6b2; margin: 4px 0; }
.roi-money { font-size: 12px; color: #c0c8d4; margin-top: 4px; }
@media (max-width: 600px) {
  .roi-stats { grid-template-columns: 1fr; }
}

/* ============ 杀号置信度 / 必杀号 ============ */
.p-ball.killed.conf-must {
  background: rgba(255, 91, 91, 0.45) !important;
  border-color: #ff2d2d !important;
  box-shadow: 0 0 8px rgba(255, 45, 45, 0.6);
  text-decoration: line-through;
  text-decoration-color: #ff2d2d;
}
.p-ball.killed.conf-strong {
  background: rgba(255, 91, 91, 0.3) !important;
  border-color: #ff5b5b !important;
  text-decoration: line-through;
}
.p-ball.killed.conf-medium {
  background: rgba(240, 197, 74, 0.18) !important;
  border-color: rgba(240, 197, 74, 0.5) !important;
  text-decoration: line-through;
  text-decoration-color: rgba(240, 197, 74, 0.7);
}
.p-ball.killed.conf-weak {
  background: rgba(255, 122, 69, 0.08) !important;
  border-color: rgba(255, 122, 69, 0.3) !important;
  text-decoration: line-through;
  text-decoration-color: rgba(255, 122, 69, 0.4);
}
.must-crown {
  position: absolute; top: -4px; right: -4px;
  font-size: 10px; color: #ffd700;
  text-shadow: 0 0 4px rgba(255, 215, 0, 0.8);
  animation: crown-pulse 2s infinite;
}
@keyframes crown-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

/* ============ 杀号战绩 ============ */
.kh-summary {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 8px; margin: 12px 0;
}
.kh-stat {
  background: rgba(255,255,255,0.04); border: 1px solid #2a3142;
  border-radius: 6px; padding: 10px; text-align: center;
}
.kh-stat.green { border-color: rgba(46,204,113,0.4); }
.kh-stat.red { border-color: rgba(255,91,91,0.4); }
.kh-stat label { display: block; font-size: 11px; color: #9aa6b2; margin-bottom: 4px; }
.kh-stat b { font-size: 20px; color: #ffb993; }
.kh-stat.green b { color: #2ecc71; }
.kh-stat.red b { color: #ff5b5b; }
@media (max-width: 600px) {
  .kh-summary { grid-template-columns: repeat(2, 1fr); }
}

/* ============ 专业感 ============ */
.brand-sub {
  font-size: 12px; font-weight: normal; color: #9aa6b2;
  margin-left: 4px;
}
.logo-icon {
  background: linear-gradient(135deg, #ff7a45, #ff5722) !important;
  font-weight: 800 !important;
  letter-spacing: -1px;
}

/* ============ 胆拖说明区 ============ */
.dan-info {
  background: linear-gradient(135deg, rgba(255,122,69,0.05), rgba(46,204,113,0.05));
  border: 1px solid rgba(255,122,69,0.2);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 10px;
  font-size: 12px;
  line-height: 1.7;
}
.dan-info-row { margin: 4px 0; }
.dan-info-label {
  color: #ffb993; font-weight: 600; margin-right: 6px;
}
.dan-info-text { color: #c0c8d4; }
.dan-info-text b { color: #ff7a45; }

.dan-toggle {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; color: #9aa6b2; cursor: pointer; padding: 4px 8px;
  background: rgba(255,255,255,0.04); border-radius: 4px;
}
.dan-toggle input { accent-color: #ff7a45; }

.dan-ball {
  background: linear-gradient(135deg, #2ecc71, #27ae60);
  color: white; font-weight: 600;
  padding: 6px 10px; border-radius: 6px; cursor: pointer;
  display: inline-block; margin: 2px;
  font-size: 13px; transition: transform 0.15s;
}
.dan-ball:hover { transform: scale(1.1); }
.dan-tuo { background: linear-gradient(135deg, #3498db, #2980b9); }

/* ============ 走势图 ============ */
.trend-legend {
  display: flex; gap: 12px; align-items: center; font-size: 11px;
  color: #9aa6b2; margin-bottom: 8px;
}
.legend-dot {
  display: inline-block; width: 10px; height: 10px;
  border: 1px solid #2a3142; border-radius: 2px; vertical-align: middle; margin-right: 3px;
}
.legend-dot.on { background: #ff7a45; border-color: #ff7a45; }
.trend-tip { margin-left: auto; color: #6b7889; }

.trend-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 2px 12px;
}
.trend-row {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 0; border-radius: 3px; transition: background 0.1s;
}
.trend-num {
  flex: 0 0 24px; font-size: 11px; color: #c0c8d4; font-weight: 600;
  text-align: right;
}
.trend-cells {
  display: flex; gap: 1px; flex: 1;
}
.trend-cell {
  flex: 1; height: 14px; background: #1a2030; border-radius: 1px;
  transition: all 0.15s;
}
.trend-cell.on { background: #ff7a45; }
.trend-cell.latest { box-shadow: 0 0 3px #ff7a45; }
.trend-cnt {
  flex: 0 0 36px; font-size: 10px; color: #9aa6b2; text-align: left;
}
@media (max-width: 600px) {
  .trend-grid { grid-template-columns: 1fr; }
}

/* ============ 冷热分区 ============ */
.ch-row { display: flex; gap: 12px; margin: 10px 0; }
.ch-section { flex: 1; }
.ch-section h4 { font-size: 12px; color: #ffb993; margin: 0 0 6px; }
.zone-list { display: flex; flex-direction: column; gap: 4px; }
.zone-bar {
  display: flex; align-items: center; gap: 6px; font-size: 11px;
}
.zone-label { flex: 0 0 36px; color: #c0c8d4; }
.zone-track {
  flex: 1; height: 12px; background: rgba(255,255,255,0.04);
  border-radius: 3px; overflow: hidden;
}
.zone-fill {
  height: 100%; background: linear-gradient(90deg, #ff7a45, #ff5722);
  transition: width 0.3s;
}
.zone-bar.hot .zone-fill { background: linear-gradient(90deg, #ff5b5b, #c0392b); }
.zone-bar.cold .zone-fill { background: linear-gradient(90deg, #3498db, #2980b9); }
.zone-bar.normal .zone-fill { background: linear-gradient(90deg, #2ecc71, #27ae60); }
.zone-val { flex: 0 0 50px; color: #9aa6b2; text-align: right; }
.zone-pct { color: #6b7889; font-size: 10px; }
.miss-list { display: flex; flex-wrap: wrap; gap: 4px; }
.miss-tag {
  display: inline-block; padding: 4px 8px; font-size: 11px;
  border-radius: 4px; cursor: pointer; font-weight: 500;
  transition: transform 0.1s;
}
.miss-tag:hover { transform: scale(1.08); }
.miss-tag.miss-high {
  background: rgba(52,152,219,0.2); color: #5dade2; border: 1px solid rgba(52,152,219,0.3);
}
.miss-tag.freq-high {
  background: rgba(255,91,91,0.2); color: #ff8080; border: 1px solid rgba(255,91,91,0.3);
}
@media (max-width: 600px) {
  .ch-row { flex-direction: column; }
}

/* ============ 选号战绩 / 跟单模式 ============ */
.ph-empty {
  text-align: center; padding: 30px 20px; color: #6b7889;
}
.ph-empty p { margin: 6px 0; }
.ph-nums {
  display: inline-block; font-size: 10px; color: #ffb993;
  max-width: 220px; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; vertical-align: middle;
}
.ph-wrong-list {
  font-size: 10px; color: #ff8080; max-width: 140px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ph-table { font-size: 11px; }
.ph-table th, .ph-table td { padding: 6px 4px; }

/* ============ 多机同步 / 通知 ============ */
.sync-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.sync-info {
  font-size: 12px; color: #9aa6b2; padding: 8px;
  background: rgba(255,255,255,0.03); border-radius: 6px; margin-top: 8px;
}
.sync-info b { color: #ffb993; }
.sync-detail { margin-top: 8px; }
.sync-detail summary {
  font-size: 12px; color: #9aa6b2; cursor: pointer; padding: 4px 0;
}
.sync-detail pre {
  font-size: 10px; background: #0f1320; padding: 10px; border-radius: 6px;
  max-height: 200px; overflow: auto; color: #c0c8d4;
}

.notif-opts { display: flex; flex-direction: column; gap: 6px; }
.notif-opts label { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #c0c8d4; cursor: pointer; }
.notif-opts input[type="checkbox"] { accent-color: #ff7a45; width: 16px; height: 16px; }

/* 倒计时变红(紧急) */
.cd-cell.urgent span {
  color: #ff5b5b !important;
  animation: blink 0.5s infinite;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ============ 加载骨架屏 ============ */
.data-skel {
  position: fixed; top: 60px; left: 0; right: 0;
  z-index: 999; text-align: center; padding: 20px;
  background: linear-gradient(180deg, rgba(20,26,38,0.95), rgba(20,26,38,0.7));
  backdrop-filter: blur(8px);
  animation: skel-fadein 0.3s ease;
}
.data-skel p {
  color: #ffb993; font-size: 13px; margin: 8px 0 0;
  animation: skel-pulse 1.5s infinite;
}
.skel-bar {
  display: inline-block; width: 200px; height: 4px;
  background: linear-gradient(90deg, #2a3142 0%, #ff7a45 50%, #2a3142 100%);
  background-size: 200% 100%;
  border-radius: 2px;
  animation: skel-shimmer 1.5s infinite;
}
@keyframes skel-fadein {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes skel-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
@keyframes skel-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ============ 手动杀号标识 ============ */
.p-ball.manual-killed {
  box-shadow:
    inset -2px -3px 4px rgba(0,0,0,0.35),
    inset 2px 2px 3px rgba(255,255,255,0.1),
    0 0 0 2.5px #2ecc71,        /* 绿色外圈 */
    0 0 8px rgba(46,204,113,0.5), /* 绿色光晕 */
    0 3px 6px rgba(0,0,0,0.4);
  animation: manual-pulse 2s infinite;
}
@keyframes manual-pulse {
  0%, 100% { box-shadow:
    inset -2px -3px 4px rgba(0,0,0,0.35),
    inset 2px 2px 3px rgba(255,255,255,0.1),
    0 0 0 2.5px #2ecc71,
    0 0 8px rgba(46,204,113,0.5),
    0 3px 6px rgba(0,0,0,0.4); }
  50% { box-shadow:
    inset -2px -3px 4px rgba(0,0,0,0.35),
    inset 2px 2px 3px rgba(255,255,255,0.1),
    0 0 0 2.5px #2ecc71,
    0 0 14px rgba(46,204,113,0.8),
    0 3px 6px rgba(0,0,0,0.4); }
}
.manual-hand {
  position: absolute; top: -4px; left: -4px;
  font-size: 11px; line-height: 1;
  z-index: 3;
  filter: drop-shadow(0 0 2px rgba(0,0,0,0.8));
  animation: hand-bob 1.5s infinite;
}
@keyframes hand-bob {
  0%, 100% { transform: rotate(-10deg); }
  50% { transform: rotate(10deg); }
}

/* ============ 登录提示 ============ */
.login-hint {
  text-align: center; padding: 8px 12px;
  border-radius: 6px; margin: 8px 0 0;
  font-size: 12px; font-weight: 500;
}
.login-hint.master-hint {
  background: rgba(255,122,69,0.1);
  color: #ffb993;
  border: 1px solid rgba(255,122,69,0.3);
}
.login-hint.slave-hint {
  background: rgba(52,152,219,0.1);
  color: #5dade2;
  border: 1px solid rgba(52,152,219,0.3);
}

/* ============ Logo 图片 ============ */
.logo-img {
  width: 56px; height: 56px;
  border-radius: 50%;
  filter: drop-shadow(0 4px 8px rgba(255, 122, 69, 0.4));
  animation: logo-bob 4s ease-in-out infinite;
}
.logo-img-header {
  width: 48px; height: 48px;
  filter: drop-shadow(0 2px 6px rgba(255, 122, 69, 0.4));
}
@keyframes logo-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
.login-logo { display: flex; align-items: center; gap: 14px; }
.brand { display: flex; align-items: center; gap: 12px; }

/* ============ Session 信息 ============ */
.session-info {
  text-align: center; font-size: 11px; color: #9aa6b2;
  margin: 4px 0 0; padding: 4px;
}
.session-info b { color: #2ecc71; font-weight: 600; }

/* ============ PWA 手机优化 ============ */

/* iOS 安全区适配(刘海/底部 home bar) */
@supports (padding: max(0px)) {
  body {
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }
  .app-header,
  .login-layer {
    padding-top: max(env(safe-area-inset-top), 12px);
  }
  /* 底部 tab 区域留 home indicator 空间 */
  .pick-actions,
  .pick-section,
  .pool-footer {
    padding-bottom: max(env(safe-area-inset-bottom), 12px);
  }
}

/* iOS 防止自动缩放 - 输入框 16px+ 字体 */
input, select, textarea, button {
  font-size: max(16px, 1em);
}

/* 触摸目标最小 44x44px (iOS HIG) */
button, .btn-mini, .btn-orange, .btn-primary,
.tab-btn, .mode-btn, .pick-actions button,
.miss-tag, .freq-tag, .pool-btn {
  min-height: 44px;
}

/* 横向滑动 - 防止卡片溢出 */
.pool-grid, .pick-balls, .hc-stats, .latest-stats {
  -webkit-overflow-scrolling: touch;
  touch-action: manipulation;
}

/* iOS 点击高亮去掉 */
* {
  -webkit-tap-highlight-color: transparent;
}

/* 防止长按选中 */
.no-select {
  -webkit-user-select: none;
  user-select: none;
}

/* 横屏适配(平板/横屏手机) */
@media (orientation: landscape) and (max-height: 500px) {
  .app-header { padding: 4px 12px; }
  .app-header h1 { font-size: 14px; }
  .login-box { max-width: 480px; padding: 16px; }
}

/* 超小屏(老 iPhone 5/SE 1) */
@media (max-width: 360px) {
  .p-ball, .pb, .picked { width: 32px; height: 32px; font-size: 11px; }
  .pool-grid { grid-template-columns: repeat(7, 1fr) !important; }
}

/* 大屏(平板) */
@media (min-width: 768px) {
  .pool-grid { grid-template-columns: repeat(10, 1fr) !important; max-width: 1000px; margin: 0 auto; }
  .pick-balls { max-width: 800px; margin: 12px auto; }
  .latest-balls .lb { width: 44px; height: 44px; font-size: 15px; }
}

/* 安卓 Chrome 地址栏跳动修复 */
html, body {
  overscroll-behavior-y: contain;
}

/* 输入框获取焦点时,防止 iOS 缩放 + 平滑滚动到视野 */
input:focus, select:focus, textarea:focus {
  font-size: 16px;
  outline: 2px solid #ff7a45;
  outline-offset: 1px;
}

/* 防止 modal 滚动穿透 */
.modal-layer.show {
  overscroll-behavior: contain;
  touch-action: none;
}

/* 优化点击延迟(已用 touch-action: manipulation) */
button, .tab-btn, .mode-btn, .p-ball, .pb, .miss-tag {
  touch-action: manipulation;
  -webkit-touch-callout: none;
}

/* 适配折叠屏 */
@media (min-width: 1024px) {
  .app-container { max-width: 1024px; margin: 0 auto; }
}

/* ============ 收藏工具栏 ============ */
.collect-toolbar {
  display: flex; gap: 6px; margin-bottom: 12px;
  padding: 8px; background: rgba(255,255,255,0.02);
  border-radius: 8px; flex-wrap: wrap;
}
.collect-toolbar .btn-mini { flex: 1; min-width: 100px; }
.collect-toolbar .btn-primary {
  background: linear-gradient(135deg, #ff7a45, #ff5722);
  color: white; border: none;
}
.collect-toolbar .btn-primary:hover { box-shadow: 0 4px 12px rgba(255,122,69,0.4); }
