/**
 * (c) 2025-2026 Y | 热点排行榜
 * 原创作品，保留所有权利。未经授权禁止复制、修改、分发。
 * Original work. All rights reserved.
 */
* { box-sizing: border-box; }

body {
    font-family: 'Segoe UI', 'Microsoft YaHei', Tahoma, sans-serif;
    background: #080c16;
    color: #e0e0e0;
    margin: 0;
    padding: 14px;
    min-height: 100vh;
}

.container { max-width: 1500px; width: 100%; margin: 0 auto; }

/* === 标题栏 === */
.header-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    background: #0f1525;
    border: 1px solid #1e2d45;
    border-radius: 14px;
    padding: 14px 22px;
    margin-bottom: 14px;
}
.header-left h1 { margin: 0; font-size: 1.3rem; font-weight: 700; color: #e0e0e0; }
.header-left .subtitle { font-size: 0.7rem; color: #555; display: block; margin-top: 2px; }
.lottery-logo { background: var(--gold-gradient); background-size: 200% auto; border-radius: 10px; display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; animation: goldShine 3s linear infinite; box-shadow: 0 8px 18px rgba(217,119,6,0.3); }
.lottery-logo i { color: #fef3c7; font-size: 1.2rem; }
.header-center { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.header-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.btn-refresh { background: #b91c1c; border: 1px solid #b91c1c; padding: 0.5rem 1.2rem; border-radius: 30px; font-weight: 600; color: white; cursor: pointer; transition: 0.2s; display: flex; align-items: center; gap: 0.4rem; }
.btn-refresh:hover { background: #dc2626; }
.header-status-row { display: flex; align-items: center; gap: 10px; }
.header-info-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; width: 100%; }
.data-status { font-size: 0.75rem; color: #94a3b8; white-space: nowrap; }
.schedule-timer { font-size: 0.75rem; color: #94a3b8; white-space: nowrap; }
.ver-badge { font-size: 0.7rem; padding: 2px 8px; border-radius: 10px; margin-left: 6px; vertical-align: middle; }
.ver-free { background: #1a2744; color: #8ab4f8; border: 1px solid #2a4a7f; }
.ver-member { background: #ff9800; color: #1a1a2e; border: 1px solid #ff9800; font-weight: bold; }
.ver-admin { background: #c62828; color: #fff; border: 1px solid #ef5350; font-weight: bold; }
.btn-backtest-hdr {
    background: #b91c1c !important; color: #fff !important; border: 1px solid #b91c1c !important;
    font-weight: 600 !important; padding: 0.5rem 1.2rem !important;
    border-radius: 30px; cursor: pointer; font-size: 0.82rem !important;
    white-space: nowrap;
}
.btn-backtest-hdr:hover { background: #dc2626 !important; }

/* 管理版算法升级标识 */
.algo-upgrade-badge {
    display: inline-block;
    background: #dc2626;
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    vertical-align: middle;
    margin: 0 2px;
    letter-spacing: 0.03em;
    animation: pulse 1.5s infinite;
}

/* === 通用卡片 === */
.card {
    background: #0f1525; border: 1px solid #1e2d45;
    border-radius: 14px; padding: 18px 22px; flex: 1;
}
.card h2 {
    margin: 0 0 12px 0; font-size: 1.3rem; color: #e0e0e0;
    border-bottom: 1px solid #1e2d45; padding-bottom: 9px;
    display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.card h2 span { font-weight: normal; }
.card-row { display: flex; gap: 14px; margin-bottom: 0.8rem; flex-wrap: wrap; }
.card-row > .card { flex: 1 1 0; min-width: 0; }

/* === 预测按钮（卡片标题内） === */
.btn-predict-inline {
    background: #b91c1c !important; color: #fff !important; border: 1px solid #b91c1c !important;
    font-weight: 600 !important; padding: 5px 12px !important;
    border-radius: 16px; cursor: pointer; font-size: 0.75rem;
    white-space: nowrap;
}


.param-inline { display: flex; align-items: center; gap: 4px; }
.param-inline label { font-size: 0.72rem; color: #999; white-space: nowrap; }
.param-inline input[type="number"] {
    width: 48px; padding: 3px 5px; border-radius: 5px;
    border: 1px solid #2a3a5c; background: #121827; color: #fff; font-size: 0.75rem;
}
.next-draw-date { font-size: 0.72rem; color: #999; white-space: nowrap; }

/* === 预测结果表格 === */
.predict-card { }
.predict-result-table {
    font-size: 0.82rem;
    background: #080c15; padding: 14px; border-radius: 10px; line-height: 1.9;
}
.predict-result-table table { width: 100%; border-collapse: collapse; }
.predict-result-table th { background: #121827; padding: 6px 4px; text-align: center; color: #94a3b8; font-weight: 600; border-bottom: 1px solid #1e2d45; white-space: nowrap; font-size: 0.82rem; }
.predict-result-table td { padding: 4px; text-align: center; border-bottom: 1px solid #151d30; font-family: 'Consolas','Courier New',monospace; }
.predict-result-table .ball-red { display: inline-block; width: 28px; height: 28px; line-height: 28px; background: #c62828; border-radius: 50%; color: #fff; font-size: 0.85rem; margin: 0 1px; text-align: center; font-weight: bold; }
.predict-result-table .ball-blue { display: inline-block; width: 28px; height: 28px; line-height: 28px; background: #1565c0; border-radius: 50%; color: #fff; font-size: 0.85rem; margin: 0 1px; text-align: center; font-weight: bold; }
.predict-result-table .backup-nums { color: #ccc; font-size: 0.75rem; }
.predict-result-table .backup-ball-red { display: inline-block; width: 28px; height: 28px; line-height: 28px; background: #c62828; border-radius: 50%; color: #fff; font-size: 0.85rem; margin: 0 1px; text-align: center; font-weight: bold; }
.predict-result-table .backup-ball-blue { display: inline-block; width: 28px; height: 28px; line-height: 28px; background: #1565c0; border-radius: 50%; color: #fff; font-size: 0.85rem; margin: 0 1px; text-align: center; font-weight: bold; }
.btn-add-to-bet {
    background: #b91c1c !important; color: #fff !important; border: 1px solid #b91c1c !important;
    padding: 2px 8px !important; border-radius: 10px !important;
    cursor: pointer; font-size: 0.75rem !important; font-weight: 600;
}
.btn-add-to-bet:hover { background: #dc2626 !important; }

#algorithmAnalysis { margin-top: 10px; font-size: 0.76rem; line-height: 1.6; color: #999; padding: 8px 10px; background: #080c15; border-radius: 8px; }
#algorithmAnalysis strong { color: #ff9800; }

/* === 投注方案 === */
#candidateSelector { min-width: 380px; flex: 1; }
#candidateSelector .card h2 { margin-bottom: 10px; }
.bet-header-controls { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.bet-param { display: flex; align-items: center; gap: 2px; font-size: 0.75rem; color: #999; }
.bet-param span { color: #ff9800; font-weight: bold; font-size: 0.88rem; min-width: 14px; text-align: center; }
.btn-adj {
    background: #b91c1c; color: #fff; border: 1px solid #b91c1c;
    padding: 0 6px !important; border-radius: 8px !important; cursor: pointer;
    font-size: 0.72rem !important; line-height: 18px; min-width: 20px;
}
.btn-adj:hover { background: #dc2626; }
.btn-gen-bet {
    background: #b91c1c !important; color: #fff !important; border: 1px solid #b91c1c !important;
    font-weight: 600 !important; padding: 4px 10px !important;
    border-radius: 14px; cursor: pointer; font-size: 0.75rem !important;
    white-space: nowrap;
    height: 26px; line-height: 1;
}
.btn-gen-bet:hover { background: #dc2626 !important; }
.btn-random-bet {
    background: #b91c1c !important; color: #fff !important; border: 1px solid #b91c1c !important;
    font-weight: 600 !important; padding: 4px 10px !important;
    border-radius: 14px; cursor: pointer; font-size: 0.75rem !important;
    white-space: nowrap; height: 26px; line-height: 1;
}
.btn-random-bet:hover { background: #dc2626 !important; }

.bet-placeholder { color: #666; text-align: center; padding: 20px; font-size: 0.82rem; background: #080c15; border-radius: 10px; }

/* 投注模式切换 */
.bet-mode-toggle { display: flex; gap: 0; margin: -8px 0 10px 0; }
.mode-btn {
    padding: 3px 14px; font-size: 0.72rem; border: 1px solid #2a3a5c;
    background: #121827; color: #94a3b8; cursor: pointer; font-family: inherit;
    transition: 0.2s;
}
.mode-btn:first-child { border-radius: 12px 0 0 12px; }
.mode-btn:last-child { border-radius: 0 12px 12px 0; }
.mode-btn.active { background: #b91c1c; color: #fff; border-color: #b91c1c; font-weight: 600; }

/* 胆拖号码展示 */
.bet-group .dan-red {
    display: inline-block; width: 28px; height: 28px; line-height: 28px;
    background: #b91c1c; border-radius: 50%; color: #fff; font-size: 0.82rem;
    margin: 0 1px; text-align: center; font-weight: bold; border: 2px solid #f59e0b;
}
.bet-group .tuo-red {
    display: inline-block; width: 28px; height: 28px; line-height: 28px;
    background: #c62828; border-radius: 50%; color: #fff; font-size: 0.82rem;
    margin: 0 1px; text-align: center; font-weight: bold;
}
.bet-group .dan-label { color: #f59e0b; font-size: 0.68rem; margin: 0 2px; }
.bet-group .tuo-label { color: #94a3b8; font-size: 0.68rem; margin: 0 2px; }

/* 投注组 */
#betGroups { margin-bottom: 8px; }
.bet-group { display: flex; align-items: center; gap: 3px; padding: 6px 0; border-bottom: 1px solid #151d30; flex-wrap: wrap; }
.bet-group .group-label { color: #888; font-size: 0.7rem; min-width: 30px; white-space: nowrap; }
.bet-group input[type="text"] {
    width: 28px; height: 28px; padding: 0; border-radius: 50%; text-align: center;
    border: 1px solid #2a3a5c; background: #121827; color: #fff;
    font-size: 0.85rem; font-family: 'Consolas','Courier New',monospace; font-weight: bold; line-height: 28px;
}
.bet-group input[type="text"]:focus { outline: 1px solid #ff9800; border-color: #ff9800; }
.bet-group input.bg-red { background: #c62828; color: #fff; border-color: #ef5350; }
.bet-group input.bg-dan { background: #b91c1c; color: #fff; border-color: #f59e0b; border-width: 2px; box-shadow: 0 0 4px rgba(245,158,11,0.4); }
.bet-group input.bg-tuo { background: #c62828; color: #fff; border-color: #ef5350; }
.bet-group input.bg-blue { background: #1565c0; color: #fff; border-color: #42a5f5; }
.bet-group .blue-sep { color: #4fc3f7; font-weight: bold; margin: 0 2px; font-size: 0.8rem; }
.bet-group .group-mult { font-size: 0.75rem; color: #94a3b8; margin-left: 6px; white-space: nowrap; display: inline-flex; align-items: center; gap: 2px; }
.bet-group .group-stats { font-size: 0.72rem; color: #94a3b8; margin-left: 8px; white-space: nowrap; }
.bet-group .group-cost { font-size: 0.9rem; color: #aaa; margin-left: 6px; white-space: nowrap; }
.bet-group .group-cost strong { color: #ff9800; font-size: 0.95rem; }
.bet-group .mult-input {
    width: 36px; height: 28px; padding: 0; border-radius: 5px; text-align: center;
    border: 1px solid #2a3a5c; background: #fff; color: #1a1a2e;
    font-size: 0.85rem; font-family: 'Consolas','Courier New',monospace; font-weight: bold; line-height: 28px;
}
.bet-group .mult-input:focus { outline: 1px solid #ff9800; border-color: #ff9800; }
.bet-group .btn-freq-bet {
    background: #b91c1c !important; color: #fff !important; border: 1px solid #b91c1c !important;
    font-weight: 600 !important; padding: 1px 8px !important;
    border-radius: 8px !important; cursor: pointer; font-size: 0.7rem !important; margin-left: 4px;
    transition: all 0.2s;
}
.bet-group .btn-freq-bet:hover { background: #dc2626 !important; }
.bet-group .btn-freq-bet.active {
    background: #fff !important; color: #b91c1c !important; border: 1px solid #b91c1c !important;
}
.bet-group .btn-del {
    background: #b91c1c !important; color: #fff !important; border: 1px solid #b91c1c !important;
    padding: 1px 6px !important; border-radius: 8px !important;
    cursor: pointer; font-size: 0.68rem !important; margin-left: 4px; font-weight: 600;
    transition: all 0.2s;
}
.bet-group .btn-del:hover { background: #dc2626 !important; }
.bet-group .btn-del.confirm {
    background: #fff !important; color: #b91c1c !important; border: 1px solid #b91c1c !important;
}

/* 投注汇总 */
.bet-summary {
    border-top: 2px solid #b91c1c; padding: 10px 14px;
    font-size: 0.85rem; color: #fff; line-height: 1.7;
    background: #b91c1c; border-radius: 0 0 14px 14px;
    margin: 8px -22px -18px -22px;
    font-weight: bold; text-align: center;
}
.bet-summary strong { color: #fff; }
#betShareActions { margin-top: 28px; }

/* === 走势图 === */
.chart-card { margin-bottom: 0.8rem; }
.chart-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.chart-header h2 { border-bottom: none; margin: 0; padding: 0; }
.chart-controls { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.chart-controls button { background: #b91c1c; color: #fff; border: 1px solid #b91c1c; padding: 4px 12px; border-radius: 12px; cursor: pointer; font-size: 0.78rem; font-weight: 600; }
.chart-controls button:hover { background: #dc2626; }
.chart-range-label { font-size: 0.78rem; color: #777; margin-left: 4px; white-space: nowrap; }
.chart-controls input[type="range"] { flex: 1; accent-color: #b91c1c; max-width: 200px; min-width: 80px; }
#chartRangeLabel { font-size: 0.78rem; color: #aaa; min-width: 75px; white-space: nowrap; }
#freqMonthLabel { font-size: 0.78rem; color: #777; min-width: 75px; white-space: nowrap; }
.chart-wrapper { width: 100%; height: 360px; position: relative; cursor: grab; }
.chart-wrapper:active { cursor: grabbing; }
.chart-wrapper canvas { width: 100% !important; height: 100% !important; }

/* === 统计分析视图 === */
.btn-stats-link {
    background: #b91c1c !important; color: #fff !important; border: 1px solid #b91c1c !important;
    font-weight: 600 !important; padding: 5px 14px !important;
    border-radius: 16px; cursor: pointer; font-size: 0.75rem;
    white-space: nowrap; text-decoration: none; display: inline-block;
    line-height: 1.4;
}
.btn-stats-link:hover { background: #dc2626 !important; }
.btn-mode-toggle {
    background: #b91c1c; color: #fff;
    border: 1px solid #b91c1c; font-weight: 600;
    padding: 5px 14px; border-radius: 16px; cursor: pointer;
    font-size: 0.75rem; white-space: nowrap; line-height: 1.4;
}
.btn-mode-toggle:hover { background: #dc2626; }
.btn-mode-toggle.active {
    background: #fff; color: #b91c1c; border-color: #fff; font-weight: 600;
}

/* 号码开关网格 */
.num-toggle-section { display: flex; align-items: center; gap: 8px; margin: 8px 0; flex-wrap: wrap; }
.num-toggle-label { font-size: 0.78rem; color: #ccc; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.num-toggle-label .toggle-hint { font-size: 0.65rem; color: #555; }
.num-toggle-label.feature-red { background: #c62828; color: #fff; padding: 4px 10px; border-radius: 6px; font-weight: bold; }
.num-toggle-label.feature-blue { background: #1565c0; color: #fff; padding: 4px 10px; border-radius: 6px; font-weight: bold; }
.num-toggle-grid { display: flex; flex-wrap: wrap; gap: 3px; user-select: none; }
.num-cell {
    width: 32px; height: 32px; border-radius: 6px; border: 1px solid #2a3a5c;
    background: #121827; color: #666; font-size: 0.75rem; font-weight: bold;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: background 0.1s, color 0.1s, border-color 0.1s;
    font-family: 'Consolas','Courier New',monospace;
}
.num-cell.red-on { background: #c62828; color: #fff; border-color: #ef5350; }
.num-cell.blue-on { background: #1565c0; color: #fff; border-color: #42a5f5; }
.num-cell.cold { border-style: dashed; border-width: 2px; }
.num-cell.dan-on { box-shadow: 0 0 6px rgba(245,158,11,0.7), inset 0 0 4px rgba(245,158,11,0.3); border-color: #f59e0b; }
.num-cell:hover { border-color: #ff9800; }

/* 频次走势图表 */
.freq-chart-row { position: relative; height: 300px; margin-bottom: 8px; }
.freq-chart-row canvas { width: 100% !important; height: 100% !important; }

.cell-label { font-size: 0.72rem; color: #999; text-align: center; margin-bottom: 2px; }

/* === 开奖号码 === */
#latestDraws table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
#latestDraws th { background: #121827; padding: 7px 5px; text-align: center; color: #94a3b8; font-weight: 600; border-bottom: 1px solid #1e2d45; white-space: nowrap; font-size: 0.85rem; }
#latestDraws td { padding: 5px; text-align: center; border-bottom: 1px solid #151d30; font-family: 'Consolas','Courier New',monospace; font-size: 0.85rem; }
#latestDraws tr:hover { background: rgba(255,255,255,0.02); }
#latestDraws .ball-red { display: inline-block; width: 28px; height: 28px; line-height: 28px; background: #c62828; border-radius: 50%; color: #fff; font-size: 0.85rem; margin: 0 1px; }
#latestDraws .ball-blue { display: inline-block; width: 28px; height: 28px; line-height: 28px; background: #1565c0; border-radius: 50%; color: #fff; font-size: 0.85rem; margin: 0 1px; }
.draws-scroll { }

/* === 特征分析 === */
#featureDisplay { font-size: 0.88rem; line-height: 2.1; color: #ccc; }
#featureDisplay strong { color: #ff9800; }

/* === 回测 === */
.backtest-card-full { margin-top: 0; }
.backtest-controls { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.backtest-controls .param-inline label { min-width: auto; white-space: nowrap; }
#btnBacktest { background: #ff9800 !important; color: #1a1a2e !important; font-weight: bold !important; }
#backtestSummary { background: #121827; padding: 14px; border-radius: 10px; font-size: 0.85rem; white-space: pre-wrap; line-height: 1.8; max-height: 220px; overflow-y: auto; }
#backtestDetails { max-height: 250px; overflow-y: auto; margin-top: 10px; }
#backtestDetails table { width: 100%; border-collapse: collapse; font-size: 0.76rem; }
#backtestDetails th { background: #121827; padding: 5px 3px; text-align: center; color: #ff9800; font-weight: normal; border-bottom: 2px solid #2a3a5c; }
#backtestDetails td { padding: 3px; text-align: center; border-bottom: 1px solid #151d30; }

/* 回测三栏对比 */
.backtest-triple { display: flex; gap: 1rem; }
.backtest-col { flex: 1; min-width: 0; background: rgba(255,255,255,0.03); border-radius: 12px; padding: 0.8rem; }
.backtest-col:not(:last-child) { border-right: 1px solid rgba(255,255,255,0.08); }
.backtest-col-title { font-size: 0.85rem; margin: 0 0 0.6rem; color: #e0e0e0; padding-bottom: 0.4rem; border-bottom: 1px solid rgba(255,255,255,0.08); }
.backtest-col .error-msg { font-size: 0.78rem; }
#backtestSummaryV1, #backtestSummaryV2, #backtestSummaryV3 { background: #121827; padding: 10px; border-radius: 8px; font-size: 0.78rem; white-space: pre-wrap; line-height: 1.7; max-height: 180px; overflow-y: auto; }
#backtestDetailsV1, #backtestDetailsV2, #backtestDetailsV3 { max-height: 220px; overflow-y: auto; margin-top: 8px; }
#backtestDetailsV1 table, #backtestDetailsV2 table, #backtestDetailsV3 table { width: 100%; border-collapse: collapse; font-size: 0.68rem; }
#backtestDetailsV1 th, #backtestDetailsV2 th, #backtestDetailsV3 th { background: #121827; padding: 4px 2px; text-align: center; color: #ff9800; font-weight: normal; border-bottom: 2px solid #2a3a5c; }
#backtestDetailsV1 td, #backtestDetailsV2 td, #backtestDetailsV3 td { padding: 2px; text-align: center; border-bottom: 1px solid #151d30; }

/* 回测对比汇总表 */
.bt-cmp-tbl { width: 100%; border-collapse: collapse; font-size: 0.78rem; background: rgba(255,255,255,0.02); border-radius: 8px; overflow: hidden; }
.bt-cmp-tbl th { background: #1a2740; padding: 6px 8px; text-align: center; color: #ff9800; font-weight: 600; border-bottom: 2px solid #2a3a5c; }
.bt-cmp-tbl td { padding: 5px 8px; text-align: center; border-bottom: 1px solid rgba(255,255,255,0.06); color: #c0c0c0; }
.bt-cmp-tbl td:first-child, .bt-cmp-tbl th:first-child { text-align: left; color: #94a3b8; }
.bt-cmp-tbl tr:hover td { background: rgba(255,255,255,0.03); }

@media (max-width: 900px) {
    .backtest-triple { flex-direction: column; gap: 1rem; }
    .backtest-col:not(:last-child) { border-right: none; border-bottom: 1px solid rgba(255,255,255,0.08); padding-bottom: 1rem; }
}

/* 算法版本选择器 */
.algo-version-select {
    background: #1a2332; color: #c0c0c0; border: 1px solid #2a3a5c;
    padding: 5px 10px; border-radius: 6px; font-size: 0.78rem;
    cursor: pointer; outline: none;
}
.algo-version-select:focus { border-color: #ff9800; }

/* === 通用 === */
button {
    background: #b91c1c; color: #fff; border: 1px solid #b91c1c;
    padding: 7px 14px; margin: 0; border-radius: 20px;
    cursor: pointer; font-size: 0.82rem; font-weight: 600; transition: transform 0.15s, background 0.15s;
}
button:hover { background: #dc2626; }
button:hover { transform: scale(1.02); }
.error-msg { color: #ef5350; background: rgba(239,83,80,0.1); padding: 10px; border-radius: 8px; border: 1px solid #ef535066; font-size: 0.82rem; }
input:focus, button:focus { outline: 1px solid #b91c1c55; }
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: #080c15; }
::-webkit-scrollbar-thumb { background: #2a3a5c; border-radius: 3px; }

/* === 响应式：平板/大屏手机 === */
@media (max-width: 768px) {
  .header-card { flex-direction: column; align-items: stretch; gap: 8px; }
  .header-left, .header-center { width: 100%; justify-content: flex-start; }
  .header-right { width: 100%; justify-content: flex-start; align-items: flex-start; flex-shrink: 1; }
  .chart-header { flex-wrap: wrap; }
  .chart-header .chart-controls { width: 100%; }
  .btn-mode-toggle { padding: 4px 8px; font-size: 0.7rem; }
  .btn-stats-link { padding: 4px 8px !important; font-size: 0.7rem; }
  .chart-wrapper { height: 280px; }
  .freq-chart-row { height: 240px; }
  .card-row { gap: 10px; }
  #candidateSelector { min-width: 0; }
  .bet-header-controls { flex-wrap: wrap; gap: 6px; }
}

/* === 响应式：小屏手机 === */
@media (max-width: 480px) {
  body { padding: 0.5rem; }
  .container { padding: 0; }
  .header { padding: 0.6rem 1rem; gap: 6px; }
  .header h1 { font-size: 1.2rem; }
  .logo-area { gap: 0.5rem; }
  .nav-tab { padding: 0.45rem 0.7rem; font-size: 0.72rem; }
  .nav-tabs { flex-wrap: wrap; justify-content: center; }
  .card-row { flex-direction: column; }
  .card-row > .card { flex: 1 1 auto; }
  .card { padding: 12px 14px; }
  .card h2 { font-size: 1rem; }
  .header-card { padding: 0.5rem 1rem; gap: 6px; }
  .header-left { gap: 0.5rem; }
  .header-left h1 { font-size: 1rem; }
  .header-right { flex-shrink: 1; }
  .lottery-logo { width: 28px; height: 28px; font-size: 1rem; border-radius: 8px; }
  .chart-wrapper { height: 240px; }
  .freq-chart-row { height: 200px; }
  .num-cell { width: 28px; height: 28px; font-size: 0.7rem; }
  .bt-colon { display: none; }
  .btn-adj { width: 28px; height: 28px; font-size: 0.85rem; min-width: 28px; }
  .btn-gen-bet, .btn-random-bet { height: 32px; padding: 4px 10px; font-size: 0.75rem; }
  .btn-backtest-hdr { padding: 0.5rem 0.8rem; font-size: 0.75rem; }
  .btn-add-to-bet, .btn-freq-bet { padding: 4px 10px; font-size: 0.75rem; }
  .btn-del { padding: 4px 10px; font-size: 0.75rem; }
  .btn-refresh { padding: 0.5rem 0.8rem; font-size: 0.75rem; }
  .algo-upgrade-badge { font-size: 0.5rem; padding: 1px 5px; }
  .btn-predict-inline { padding: 5px 12px; font-size: 0.78rem; }
  .predict-result-table th, .predict-result-table td { padding: 3px 2px; font-size: 0.7rem; }
  .predict-result-table .ball-red, .predict-result-table .ball-blue,
  .predict-result-table .backup-ball-red, .predict-result-table .backup-ball-blue { width: 22px; height: 22px; line-height: 22px; font-size: 0.65rem; border-radius: 50%; }
  .draws-scroll { overflow-x: auto; }
  #latestDraws table { white-space: nowrap; }
  #latestDraws th, #latestDraws td { padding: 3px 1px; font-size: 0.72rem; }
  #latestDraws .ball-red, #latestDraws .ball-blue { width: 24px; height: 24px; line-height: 24px; font-size: 0.75rem; font-weight: bold; margin: 0; }
  .bet-group { gap: 2px; padding: 4px 0; }
  .bet-group .group-label { font-size: 0.62rem; min-width: 24px; }
  .bet-group .group-mult { font-size: 0.65rem; margin-left: 2px; }
  .bet-group .group-stats { font-size: 0.62rem; margin-left: 4px; }
  .bet-group input[type="text"] { width: 22px; height: 22px; font-size: 0.65rem; line-height: 22px; }
  .bet-group .mult-input { width: 28px; height: 25px; font-size: 0.65rem; line-height: 25px; border-radius: 4px; }
  .bet-group .blue-sep { margin: 0 1px; font-size: 0.7rem; }
  .bet-group .group-cost { font-size: 0.75rem; }
  .bet-group .dan-label, .bet-group .tuo-label { font-size: 0.6rem; }
  .bet-group input.bg-dan { width: 22px; height: 22px; font-size: 0.65rem; line-height: 22px; border-width: 1.5px; }
  .bet-group input.bg-tuo { width: 22px; height: 22px; font-size: 0.65rem; line-height: 22px; }
  .footer-card { flex-direction: column; gap: 12px; text-align: center; padding: 0.8rem 1rem; }
  .footer-col { flex: none; }
  .footer-col h4 { font-size: 0.78rem; }
  .footer-col p { font-size: 0.75rem; }
  .footer-bottom { font-size: 0.68rem; }
  .chart-header { flex-wrap: wrap; gap: 4px; }
  .chart-header .chart-controls { width: 100%; flex: 1 1 100%; }
  .btn-mode-toggle { padding: 3px 6px; font-size: 0.65rem; }
  .btn-stats-link { padding: 3px 6px !important; font-size: 0.65rem; }
  .chart-controls { gap: 4px; }
  .chart-controls button { padding: 4px 8px; font-size: 0.7rem; }
  .chart-range-label { font-size: 0.68rem; }
  #chartRangeLabel { min-width: 60px; font-size: 0.7rem; }
  #freqMonthLabel { min-width: 60px; font-size: 0.7rem; }
  .bet-param { font-size: 0.7rem; }
  .bet-param span { font-size: 0.8rem; }
  .param-inline label { font-size: 0.68rem; }
  .param-inline input[type="number"] { width: 44px; font-size: 0.7rem; }
}

/* ==== 分享按钮 ==== */
.share-actions {
    margin-top: 10px; display: flex; justify-content: flex-end; gap: 5px;
}
.btn-share-image {
    background-image: linear-gradient(135deg, #f0d060 0%, #d4a017 50%, #fef3c7 100%);
    background-size: 200% auto;
    color: #7c2d00; border: none;
    font-weight: 700; padding: 0.3rem 0.8rem;
    border-radius: 20px; cursor: pointer; font-size: 0.78rem;
    box-shadow: 0 4px 15px rgba(212, 160, 23, 0.3);
    animation: goldShimmer 6s ease-in-out infinite;
    transition: box-shadow 0.2s, transform 0.2s;
}
.btn-share-image:hover {
    background-image: linear-gradient(135deg, #f0d060 0%, #d4a017 50%, #fef3c7 100%);
    background-size: 200% auto;
    box-shadow: 0 6px 20px rgba(212, 160, 23, 0.5); transform: translateY(-1px);
}
.btn-share-image i { margin-right: 3px; }
.share-actions .btn-donate-gold, .bet-share-actions .btn-donate-gold { margin-left: 0; }

/* ==== 分享弹窗 ==== */
.share-modal {
    position: fixed; inset: 0; z-index: 9999;
    display: flex; align-items: center; justify-content: center;
}
.share-modal-backdrop {
    position: absolute; inset: 0; background: rgba(0,0,0,0.7);
}
.share-modal-dialog {
    position: relative; background: #0d1220; border: 1px solid #1e2d45;
    border-radius: 16px; max-width: 380px; width: 90vw;
    max-height: 90vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.share-modal-title {
    display: flex; justify-content: space-between; align-items: center;
    padding: 14px 18px; border-bottom: 1px solid #1e2d45;
    font-size: 0.9rem; color: #e0e0e0; font-weight: 600;
}
.share-modal-close {
    background: none; border: none; color: #94a3b8; font-size: 1.5rem;
    cursor: pointer; line-height: 1; padding: 0 4px;
}
.share-modal-close:hover { color: #fff; }
.share-modal-body { padding: 16px; text-align: center; }
.share-modal-body img {
    max-width: 100%; border-radius: 12px; border: 1px solid #1e2d45;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
.share-modal-footer {
    display: flex; gap: 10px; padding: 0 18px 16px;
}
.btn-download-share, .btn-copy-link {
    flex: 1; padding: 10px 0; border-radius: 10px;
    font-size: 0.85rem; font-weight: 600; cursor: pointer; border: none;
    font-family: inherit; text-align: center;
}
.btn-download-share {
    background: #b91c1c; color: #fff;
}
.btn-download-share:hover { background: #dc2626; }
.btn-copy-link {
    background: #1a2540; color: #cbd5e1; border: 1px solid #2a3a60;
}
.btn-copy-link:hover { background: #243356; }

@media (max-width: 480px) {
    .btn-share-image { font-size: 0.75rem; padding: 0.3rem 0.7rem; }
    .share-modal-dialog { max-width: 95vw; }
}
