*{box-sizing:border-box}
:root{
  --panel:#fff;
  --panel2:#f7f9ff;
  --text:#101828;
  --muted:#667085;
  --red:#d71920;
  --blue:#1267d8;
  --gold:#f6c343;
  --green:#13a35b;
  --orange:#f79009;
  --purple:#7a4df3;
  --line:#e5e7eb;
  --shadow:0 14px 35px rgba(3,10,30,.16);
  --radius:22px;
}
html{scroll-behavior:smooth;background:#07152f}
body{
  margin:0;
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",Arial,sans-serif;
  background:
    radial-gradient(circle at 20% 0%,rgba(246,195,67,.22),transparent 28%),
    linear-gradient(135deg,#06122a 0%,#091a3e 52%,#12091d 100%);
  color:var(--text);
}
.app-shell{max-width:1380px;margin:0 auto;padding:18px}
.topbar{color:#fff;display:flex;justify-content:space-between;gap:12px;align-items:center;padding:18px 4px 22px}
.brand{font-size:30px;font-weight:900;letter-spacing:.2px;line-height:1.15}.subtitle{color:rgba(255,255,255,.72);margin-top:5px;font-size:15px}.status-pill{padding:8px 12px;border:1px solid rgba(255,255,255,.18);border-radius:999px;background:rgba(255,255,255,.08);font-size:13px;white-space:nowrap;max-width:100%;overflow:hidden;text-overflow:ellipsis}.mobile-tabs{display:none}
main{display:flex;flex-direction:column;gap:16px}.hero-grid{display:grid;grid-template-columns:1.3fr .9fr;gap:16px}.card{background:var(--panel);border-radius:var(--radius);box-shadow:var(--shadow);padding:18px;overflow:hidden}.card-title-row{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:14px}h2{margin:0;font-size:20px;color:#101828}.expect-row{display:flex;justify-content:space-between;align-items:flex-end;color:var(--muted);font-size:15px;margin-bottom:18px;gap:10px}.expect-row b{font-size:22px;color:var(--red)}
.balls-row{display:flex;align-items:center;justify-content:center;gap:12px;padding:22px 8px;background:linear-gradient(180deg,#fff7f7,#fff);border-radius:18px;border:1px solid #ffe1e1}.ball{width:58px;height:58px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;font-size:26px;font-weight:900;color:#fff;background:linear-gradient(145deg,#ff6065,#c91018);box-shadow:inset 0 2px 5px rgba(255,255,255,.35),0 8px 18px rgba(215,25,32,.24)}.sum-ball{width:68px;height:68px;background:linear-gradient(145deg,#ffd66b,#e09b00);color:#5b2700}.plus{font-size:28px;font-weight:900;color:#98a2b3}.tag-row{display:flex;justify-content:center;gap:10px;flex-wrap:wrap;margin-top:16px}.tag{display:inline-flex;align-items:center;justify-content:center;min-width:56px;padding:7px 12px;border-radius:999px;font-weight:800;color:#fff;font-size:14px}.big{background:var(--red)}.small{background:var(--blue)}.odd{background:var(--orange)}.even{background:var(--green)}.combo{background:#344054}.refund{background:var(--purple)}.hidden{display:none!important}.countdown-box{margin:18px auto 0;max-width:260px;padding:11px 14px;border-radius:14px;background:#07152f;color:#fff;display:flex;justify-content:space-between;align-items:center}.countdown-box strong{color:var(--gold);font-size:24px;letter-spacing:.5px}.stats-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}.stat{background:var(--panel2);border:1px solid var(--line);border-radius:16px;padding:14px 12px;display:flex;flex-direction:column;gap:4px}.stat span{font-size:13px;color:var(--muted)}.stat b{font-size:24px}.refund-stat b{color:var(--purple)}.streak-box{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:12px;color:#344054;font-size:14px}.streak-box div{background:#fff8e6;border:1px solid #ffe6a3;border-radius:12px;padding:10px}.trend-card canvas{width:100%;background:#fbfcff;border:1px solid var(--line);border-radius:16px;display:block}.filters{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end;margin-bottom:12px}.input,.select{height:38px;border:1px solid #d0d5dd;border-radius:10px;padding:0 10px;background:#fff;color:#101828;font-size:14px}.input{width:130px}.btn{height:38px;border:none;border-radius:10px;padding:0 14px;background:var(--red);color:#fff;font-weight:800;cursor:pointer;font-size:14px}.btn:active{transform:scale(.98)}.btn.ghost{background:#eef2ff;color:#1d2939}.btn.small{height:32px;padding:0 10px;font-size:13px}.filter-toggle{display:none}.table-wrap{overflow:auto;border:1px solid var(--line);border-radius:16px;-webkit-overflow-scrolling:touch}table{width:100%;border-collapse:separate;border-spacing:0;min-width:980px}thead th{position:sticky;top:0;z-index:1;background:#111827;color:#fff;text-align:left;font-size:13px;padding:12px 10px;white-space:nowrap}tbody td{padding:11px 10px;border-bottom:1px solid var(--line);font-size:14px;white-space:nowrap}tbody tr:nth-child(even){background:#fafafa}tbody tr.latest-row{background:#fff4e5}.num-mini{display:inline-flex;width:26px;height:26px;border-radius:50%;align-items:center;justify-content:center;background:#ef4444;color:#fff;font-weight:800;margin-right:4px;font-size:13px}.badge{padding:4px 8px;border-radius:999px;color:#fff;font-weight:800;font-size:12px}.empty{text-align:center;color:var(--muted);padding:28px!important}.pager{display:flex;align-items:center;justify-content:center;gap:14px;margin-top:14px;color:var(--muted)}.history-cards{display:none}
@media(max-width:900px){
  body{background:linear-gradient(180deg,#171a14 0,#202622 260px,#f3f4f6 260px,#f3f4f6 100%)}
  .app-shell{padding:12px 8px 88px;max-width:100%;overflow-x:hidden}
  .topbar{display:block;padding:10px 8px 14px}.brand{font-size:22px}.subtitle{font-size:13px;margin-top:3px}.status-pill{display:block;margin-top:10px;width:100%;font-size:12px;padding:7px 10px;background:rgba(255,255,255,.12)}
  .mobile-tabs{position:sticky;top:0;z-index:20;display:grid;grid-template-columns:repeat(4,1fr);gap:6px;margin:0 0 10px;padding:8px;background:rgba(7,21,47,.9);backdrop-filter:blur(8px);border-radius:16px}.mobile-tabs a{text-decoration:none;color:#fff;text-align:center;font-size:13px;font-weight:800;padding:8px 0;border-radius:12px;background:rgba(255,255,255,.1)}
  main{gap:12px}.hero-grid{grid-template-columns:1fr;gap:12px}.card{border-radius:18px;padding:13px;box-shadow:0 8px 22px rgba(3,10,30,.12)}.card-title-row{margin-bottom:10px}.latest-title-row h2,.history-title-row h2{font-size:18px}h2{font-size:18px}.btn.small{height:34px;padding:0 12px}.expect-row{display:grid;grid-template-columns:1fr auto;font-size:13px;margin-bottom:12px}.expect-row b{font-size:20px}.expect-row span:last-child{font-size:12px;text-align:right}
  .balls-row{gap:5px;padding:14px 8px;border-radius:16px}.ball{width:42px;height:42px;font-size:22px;box-shadow:inset 0 2px 4px rgba(255,255,255,.35),0 6px 14px rgba(215,25,32,.22)}.sum-ball{width:48px;height:48px}.plus{font-size:18px}.tag-row{gap:8px;margin-top:12px}.tag{min-width:48px;padding:6px 11px;font-size:13px}.countdown-box{margin-top:14px;max-width:100%;border-radius:14px;padding:10px 14px}.countdown-box strong{font-size:24px}
  .stats-grid{grid-template-columns:repeat(2,1fr);gap:8px}.stat{padding:11px;border-radius:14px}.stat span{font-size:12px}.stat b{font-size:24px}.streak-box{grid-template-columns:1fr;gap:8px;font-size:13px}.trend-card canvas{height:190px}.compact-select{height:36px;max-width:128px;font-size:13px}
  .history-title-row{display:flex;align-items:center}.filter-toggle{display:inline-flex;align-items:center}.filters{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:0 0 12px}.filters.collapsed{display:none}.input,.select,.btn{width:100%;height:38px;font-size:13px}.table-wrap{display:none}.history-cards{display:flex;flex-direction:column;gap:9px}.history-item{border:1px solid #e7eaf0;border-radius:16px;background:#fff;padding:10px 11px}.history-item.latest{background:#fff8e6;border-color:#ffe0a3}.history-top{display:flex;justify-content:space-between;gap:10px;align-items:center;margin-bottom:8px}.history-time{font-weight:900;color:#111827;font-size:14px}.history-nbr{font-size:12px;color:#667085}.history-mid{display:flex;justify-content:space-between;align-items:center;gap:10px}.history-balls{display:flex;align-items:center;gap:4px;white-space:nowrap}.history-balls .num-mini{width:26px;height:26px;margin:0}.history-sum{display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;border-radius:50%;background:#f6c343;color:#4a2500;font-weight:900}.history-tags{display:flex;gap:5px;flex-wrap:wrap;justify-content:flex-end}.history-tags .badge{font-size:11px;padding:4px 7px}.pager{position:sticky;bottom:10px;background:rgba(255,255,255,.94);backdrop-filter:blur(10px);border:1px solid #edf0f4;border-radius:999px;padding:7px;box-shadow:0 8px 20px rgba(3,10,30,.12)}.pager .btn{width:auto;min-width:74px;height:34px}.pager span{font-size:12px}
}
@media(max-width:380px){
  .ball{width:38px;height:38px;font-size:20px}.sum-ball{width:44px;height:44px}.plus{font-size:16px}.card{padding:11px}.brand{font-size:21px}.history-tags{max-width:130px}
}


/* ===== Mobile Compact Patch v2: 降低各区块高度 ===== */
@media(max-width:900px){
  body{background:linear-gradient(180deg,#171a14 0,#202622 190px,#f3f4f6 190px,#f3f4f6 100%)}
  .app-shell{padding:8px 6px 74px}
  .topbar{padding:6px 6px 8px}
  .brand{font-size:20px;line-height:1.05}
  .subtitle{font-size:12px;margin-top:2px;line-height:1.2}
  .status-pill{margin-top:7px;font-size:11px;padding:5px 9px;line-height:1.25}
  .mobile-tabs{margin:0 0 8px;padding:6px;gap:5px;border-radius:13px}
  .mobile-tabs a{font-size:12px;padding:6px 0;border-radius:10px}
  main{gap:8px}
  .hero-grid{gap:8px}
  .card{border-radius:15px;padding:9px;box-shadow:0 5px 14px rgba(3,10,30,.10)}
  .card-title-row{margin-bottom:7px;gap:8px}
  h2,.latest-title-row h2,.history-title-row h2{font-size:16px;line-height:1.1}
  .btn.small{height:30px;padding:0 9px;font-size:12px;border-radius:9px}
  .expect-row{margin-bottom:7px;font-size:12px;line-height:1.15;gap:6px}
  .expect-row b{font-size:18px}
  .expect-row span:last-child{font-size:11px}
  .balls-row{gap:4px;padding:8px 6px;border-radius:13px}
  .ball{width:35px;height:35px;font-size:18px;box-shadow:inset 0 1px 3px rgba(255,255,255,.3),0 4px 9px rgba(215,25,32,.18)}
  .sum-ball{width:41px;height:41px;font-size:19px}
  .plus{font-size:15px}
  .tag-row{gap:6px;margin-top:8px}
  .tag{min-width:40px;padding:4px 9px;font-size:12px;line-height:1.1}
  .countdown-box{margin-top:8px;max-width:230px;border-radius:12px;padding:7px 11px;font-size:13px}
  .countdown-box strong{font-size:21px}
  .stats-grid{grid-template-columns:repeat(3,1fr);gap:6px}
  .stat{padding:7px 8px;border-radius:11px;gap:1px;min-height:54px}
  .stat span{font-size:11px;line-height:1.1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .stat b{font-size:19px;line-height:1.05}
  .streak-box{gap:6px;margin-top:7px;font-size:12px;line-height:1.2}
  .streak-box div{padding:6px 8px;border-radius:10px}
  .trend-card canvas{height:145px;border-radius:12px}
  .compact-select{height:30px;max-width:112px;font-size:12px;border-radius:9px}
  .filters{grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;margin-bottom:8px}
  .input,.select,.btn{height:32px;font-size:12px;border-radius:9px;padding:0 7px}
  .history-cards{gap:6px}
  .history-item{border-radius:12px;padding:7px 8px}
  .history-top{margin-bottom:5px;gap:6px}
  .history-time{font-size:13px;line-height:1.1}
  .history-nbr{font-size:11px}
  .history-mid{gap:6px}
  .history-balls{gap:3px}
  .history-balls .num-mini{width:22px;height:22px;font-size:11px}
  .history-sum{width:28px;height:28px;font-size:13px}
  .history-tags{gap:3px;max-width:150px}
  .history-tags .badge{font-size:10px;padding:3px 6px;line-height:1.1}
  .pager{bottom:6px;padding:5px;gap:8px}
  .pager .btn{height:30px;min-width:62px;font-size:12px}
  .pager span{font-size:11px}
}
@media(max-width:380px){
  .app-shell{padding-left:5px;padding-right:5px}
  .card{padding:8px;border-radius:14px}
  .brand{font-size:19px}
  .ball{width:32px;height:32px;font-size:17px}
  .sum-ball{width:38px;height:38px;font-size:18px}
  .plus{font-size:14px}
  .stats-grid{gap:5px}
  .stat{padding:6px;min-height:50px}
  .stat b{font-size:18px}
  .filters{grid-template-columns:repeat(2,minmax(0,1fr))}
}


/* ===== Small Number Light Blue Patch ===== */
.ball.num-small,
.num-mini.num-small{
  background:linear-gradient(145deg,#8ed7ff,#2f9eea)!important;
  color:#063453!important;
  box-shadow:inset 0 1px 4px rgba(255,255,255,.45),0 5px 12px rgba(47,158,234,.22)!important;
}
.sum-ball.sum-small,
.history-sum.sum-small,
.sum-pill.sum-small{
  background:linear-gradient(145deg,#bdeeff,#60bef3)!important;
  color:#07324a!important;
  box-shadow:inset 0 1px 4px rgba(255,255,255,.45),0 5px 12px rgba(96,190,243,.20)!important;
}
.sum-pill{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:30px;
  height:30px;
  border-radius:999px;
  padding:0 9px;
  background:linear-gradient(145deg,#ffd66b,#e09b00);
  color:#4a2500;
  font-weight:900;
}

/* ===== Feature Pack: streak / omission / export / backtest / risk ===== */
.feature-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px}
.mini-card .card-title-row,.compact-row{margin-bottom:10px}
.mini-grid,.bt-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
.mini-grid>div,.bt-grid>div{background:var(--panel2);border:1px solid var(--line);border-radius:14px;padding:10px 11px;min-height:56px}
.mini-grid span,.bt-grid span{display:block;font-size:12px;color:var(--muted);line-height:1.2;margin-bottom:4px}
.mini-grid b,.bt-grid b{font-size:20px;line-height:1.1;color:#101828}
.sum-omission-grid{display:grid;grid-template-columns:repeat(7,1fr);gap:6px;margin-top:10px}
.sum-omission-grid>div{background:#fbfcff;border:1px solid var(--line);border-radius:10px;padding:7px 4px;text-align:center}
.sum-omission-grid span{font-size:11px;color:var(--muted);display:block}.sum-omission-grid b{font-size:15px;color:#101828}
.risk-main{display:grid;grid-template-columns:120px 1fr;gap:12px;align-items:center}
.risk-level{height:64px;border-radius:16px;display:flex;align-items:center;justify-content:center;color:#fff;font-size:24px;font-weight:900;background:#12b76a}.risk-level.黄色{background:#f79009}.risk-level.橙色{background:#f97316}.risk-level.红色{background:#d71920}.risk-level.强红{background:#7f1d1d}.risk-level.normal,.risk-level.正常{background:#12b76a}
.risk-info{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}.risk-info>div{background:#f7f9ff;border:1px solid var(--line);border-radius:12px;padding:10px;font-size:13px;color:var(--muted)}.risk-info b{display:block;color:#101828;font-size:20px;margin-top:2px}.risk-sub{margin-top:10px;padding:9px 11px;background:#fff8e6;border:1px solid #ffe6a3;border-radius:12px;color:#5b3b00;font-size:13px}
.backtest-controls{display:grid;grid-template-columns:1fr 1.4fr 140px;gap:8px;margin-bottom:10px}.seq-input{width:100%}.history-actions{display:flex;gap:8px;align-items:center}.history-actions .btn{width:auto}
@media(max-width:900px){
  .feature-grid{grid-template-columns:1fr;gap:8px}.mini-grid,.bt-grid{grid-template-columns:repeat(3,1fr);gap:5px}.mini-grid>div,.bt-grid>div{border-radius:10px;padding:6px 7px;min-height:46px}.mini-grid span,.bt-grid span{font-size:10px;margin-bottom:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mini-grid b,.bt-grid b{font-size:16px}.sum-omission-grid{grid-template-columns:repeat(7,1fr);gap:4px;margin-top:7px}.sum-omission-grid>div{padding:5px 2px;border-radius:8px}.sum-omission-grid span{font-size:10px}.sum-omission-grid b{font-size:12px}.risk-main{grid-template-columns:82px 1fr;gap:8px}.risk-level{height:48px;border-radius:12px;font-size:17px}.risk-info{grid-template-columns:repeat(3,1fr);gap:5px}.risk-info>div{padding:6px;border-radius:9px;font-size:10px}.risk-info b{font-size:15px}.risk-sub{margin-top:7px;padding:6px 8px;border-radius:10px;font-size:11px;line-height:1.25}.backtest-controls{grid-template-columns:1fr;gap:6px;margin-bottom:7px}.seq-input{width:100%}.history-actions{gap:5px}.history-actions .btn{height:30px;font-size:12px;padding:0 9px}.filters{grid-template-columns:repeat(3,minmax(0,1fr))}.filter-toggle{display:inline-flex!important;align-items:center;justify-content:center}
}
@media(max-width:380px){.mini-grid,.bt-grid{grid-template-columns:repeat(2,1fr)}.sum-omission-grid{grid-template-columns:repeat(4,1fr)}.risk-info{grid-template-columns:1fr}.risk-main{grid-template-columns:76px 1fr}.filters{grid-template-columns:repeat(2,minmax(0,1fr))}}

/* v4: 回测/导出自定义期数优化 */
.v4-backtest-controls{grid-template-columns:1fr 1.4fr 110px 90px 110px 110px 100px!important;align-items:center}
@media(max-width:900px){.v4-backtest-controls{grid-template-columns:repeat(2,minmax(0,1fr))!important}.v4-backtest-controls .seq-input{grid-column:1/-1}.bt-grid{grid-template-columns:repeat(3,1fr)}}
@media(max-width:380px){.v4-backtest-controls{grid-template-columns:1fr!important}.bt-grid{grid-template-columns:repeat(2,1fr)}}


.bt-compare{margin-top:10px;border:1px solid var(--line);border-radius:14px;background:#fbfcff;padding:10px}
.bt-compare-title{font-weight:900;font-size:13px;color:#344054;margin-bottom:8px}
.bt-compare-grid{display:grid;grid-template-columns:repeat(6,1fr);gap:8px}
.bt-compare-grid div{background:#fff;border:1px solid var(--line);border-radius:12px;padding:8px}
.bt-compare-grid span{display:block;font-size:12px;color:var(--muted);margin-bottom:3px}
.bt-compare-grid b{font-size:15px}
@media(max-width:900px){.bt-compare-grid{grid-template-columns:repeat(3,1fr)}.bt-grid div span,.bt-compare-grid span{font-size:11px}.bt-grid div b,.bt-compare-grid b{font-size:14px}}


/* ===== Feature Pack v6: 组合连开 + 自定义期数 + 大小/单双回测 ===== */
.streak-limit-controls{display:flex;align-items:center;gap:6px}
.streak-limit-controls .compact-input{width:110px;height:30px;font-size:12px}
.streak-detail-grid{grid-template-columns:repeat(6,1fr)}
.mini-footnote{margin-top:7px;text-align:right;color:var(--muted);font-size:12px}
.v6-backtest-controls{grid-template-columns:105px 1fr 1.35fr 105px 90px 110px 110px 100px!important}
@media(max-width:900px){
  .streak-limit-controls{gap:4px}
  .streak-limit-controls .compact-select{max-width:88px}
  .streak-limit-controls .compact-input{width:92px;height:30px;font-size:11px;padding:0 6px}
  .streak-detail-grid{grid-template-columns:repeat(3,1fr)}
  .streak-detail-grid>div{min-width:0}
  .mini-footnote{font-size:10px;margin-top:5px}
  .v6-backtest-controls{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .v6-backtest-controls .seq-input{grid-column:1/-1}
}
@media(max-width:430px){
  .streak-detail-grid{grid-template-columns:repeat(2,1fr)}
  .streak-limit-controls{max-width:205px}
  .streak-limit-controls .compact-input{width:94px}
}
@media(max-width:380px){
  .v6-backtest-controls{grid-template-columns:1fr!important}
}


/* ===== Feature Pack v7: 合并组合最大连开 ===== */
.streak-detail-grid .group-streak{
  background:linear-gradient(180deg,#eef8ff,#f8fcff);
  border-color:#b9e2fb;
}
.streak-detail-grid .group-streak b{color:#0869a6}
.streak-detail-grid .group-streak span{white-space:normal;overflow:visible;text-overflow:clip}
@media(max-width:430px){
  .streak-detail-grid{grid-template-columns:repeat(2,1fr)}
  .streak-detail-grid .group-streak{min-height:49px}
}


/* ===== Feature Pack v8: 组合组赔率回测 ===== */
.combo-rule-note{
  margin:-2px 0 10px;
  padding:9px 11px;
  border:1px solid #b9e2fb;
  border-radius:12px;
  background:linear-gradient(180deg,#eef8ff,#f8fcff);
  color:#075985;
  font-size:12px;
  line-height:1.45;
}
.combo-rule-note b{color:#0c4a6e}
@media(max-width:900px){
  .combo-rule-note{margin:0 0 7px;padding:7px 8px;border-radius:9px;font-size:10.5px;line-height:1.35}
}

.sum-grid-title{
  grid-column:1/-1;
  background:#fff7ed!important;
  color:#9a3412;
  border-color:#fed7aa!important;
}
.sum-grid-title b{
  font-size:13px!important;
}

.limit-control{
  display:flex;
  align-items:center;
  gap:6px;
  flex-wrap:wrap;
  justify-content:flex-end;
}
.tiny-input{
  width:92px;
  height:34px;
  font-size:13px;
}
.combo-stat b{color:#344054}
.group-stat{
  background:#eef6ff!important;
  border-color:#bfdbfe!important;
}
.group-stat b{color:#0b5cad}
@media(max-width:900px){
  .stats-title-row{
    align-items:flex-start;
    gap:8px;
  }
  .limit-control{
    width:100%;
    justify-content:space-between;
  }
  .limit-control .select{
    flex:1;
    min-width:96px;
  }
  .limit-control .tiny-input{
    flex:1;
    min-width:110px;
    width:auto;
  }
}
