/* =========================================================
 * profit.css — 盈利比页（复用 style.css 变量与赛程表基础样式）
 * ========================================================= */

.profit-filter { margin-bottom: 12px; }
.profit-filter .filter-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.profit-league-picker { position: relative; }
.profit-refresh { margin-left: auto; display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--ink-2); }
.profit-refresh #profitUpdated { color: var(--ink-3); white-space: nowrap; }
/* 在售/截止切换（与赛程页“显示截止场次”一致） */
.profit-cutoff-btn { white-space: nowrap; }
.profit-cutoff-btn.on { background: var(--green-600); border-color: var(--green-600); color: #fff; }
.profit-auto, .live-auto { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.profit-auto input { accent-color: var(--green-600); }

/* 赛事多选面板（复用 live 的 lp-* 样式，profit 面板沿用） */
#profitLeaguePanel .lp-list { max-height: 300px; }

/* 表格：列多，紧凑排布（消除横向拖动条：min-width 降到容器以内，各列按内容收紧） */
.profit-table { font-size: 12px; width: 100%; min-width: 0; border-collapse: collapse; }
.profit-table th, .profit-table td { padding: 5px 3px; text-align: center; white-space: nowrap; border-bottom: 1px solid var(--line); }
.profit-table thead tr:first-child th { background: #eef4ef; color: var(--green-800); font-weight: 600; border-bottom: 1px solid #cfe0d2; }
.profit-table thead .sub-head th { background: #f7faf7; color: var(--ink-2); font-weight: 500; font-size: 11px; }
.profit-table .col-no { width: 30px; }
.profit-table .col-league { width: 74px; }
.profit-table .col-time { width: 52px; line-height: 1.35; }
.profit-table .col-time small { color: var(--ink-3); font-size: 10px; }
.profit-table .col-team { width: 104px; max-width: 118px; overflow: hidden; text-overflow: ellipsis; }
/* 球队排名：弱化显示，主队名之前 / 客队名之后 */
.profit-table td small { color: #aab3bd; font-size: 10px; font-weight: 400; }
.profit-table .col-hcap { width: 30px; font-weight: 600; }
/* 让球配色与赛程页一致：受让(+)=绿，主让(-)=红，不让球(0)=灰 */
.profit-table .col-hcap .hcap.neg, .pc-row-vs .pc-hcap .hcap.neg { color: var(--red); }
.profit-table .col-hcap .hcap.pos, .pc-row-vs .pc-hcap .hcap.pos { color: var(--green-700); }
.profit-table .col-hcap .hcap.zero, .pc-row-vs .pc-hcap .hcap.zero { color: var(--ink-3); }
.profit-table .col-profit, .profit-table .col-bs, .profit-table .col-sp { min-width: 40px; }
.profit-table .col-profit, .profit-table .col-bs, .profit-table .col-sp { border-left: 1px solid #e6ece6; }
/* 胜/平/负（投注比例/欧赔）三项直接紧凑排列：单元格之间无竖线，仅保留与大小球分组之间的一条分隔线 */
.profit-table .col-odds { min-width: 40px; }
.profit-table tbody td.col-odds { border-left: none; padding-left: 2px; padding-right: 2px; }
.profit-table tbody td.col-odds:nth-last-child(3) { border-left: 1px solid #e6ece6; }
/* 即时SP列预留给未来付费内容，暂不显示数值，收窄为空占位 */
.profit-table .col-sp { display: none; }
/* 分析列：暂隐藏（原跳转他人站点），代码保留便于后续替换免费数据源 */
.profit-table .col-an { display: none; }
.profit-table .col-score { min-width: 52px; width: 52px; line-height: 1.25; }
.profit-table .col-score .sc-full, .profit-table .col-score .sc-half { display: block; font-variant-numeric: tabular-nums; }
.profit-table .col-score .sc-full { font-weight: 700; color: var(--ink); }
.profit-table .col-score .sc-half { font-size: 10px; color: var(--ink-3); }
/* 表头投注比例/欧赔切换下拉（参考浅蓝描边样式） */
.profit-table .odds-mode-select {
  appearance: none; -webkit-appearance: none;
  border: 1px solid #c3d4e6; border-radius: 5px; background: #fff;
  color: var(--ink); font-size: 12px; font-weight: 600; padding: 3px 22px 3px 9px;
  cursor: pointer; line-height: 1.3;
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%236b7f96'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 7px center;
}
.profit-table .odds-mode-select:focus { outline: 2px solid #9dc2ea; border-color: #6f9fd0; }
.profit-table .odds-mode-select option { font-weight: 500; }
.profit-table tbody tr:hover { background: #f6faf6; }
.profit-table .date-row td { background: #f0f5f1; color: var(--green-800); font-weight: 600; text-align: center; padding: 6px; }

/* 赛事标签 */
.profit-table .league-tag, .profit-card .league-tag { display: inline-block; padding: 1px 7px; border-radius: 4px; color: #fff; font-size: 11px; max-width: 110px; overflow: hidden; text-overflow: ellipsis; }

/* 盈利比数值：正绿负红（中国习惯：涨红跌绿，但这里是盈亏，盈=正用红表示获利更醒目；按球探口径盈利为红、亏损为绿） */
.profit-val { font-weight: 700; cursor: pointer; font-variant-numeric: tabular-nums; border-bottom: 1px dashed transparent; }
.profit-val:hover { border-bottom-color: currentColor; }
.profit-val.pos { color: var(--red); }
.profit-val.neg { color: #1a9d5a; }
.profit-val.zero { color: var(--ink-3); }
.profit-pk { cursor: pointer; color: var(--blue); font-weight: 600; }
/* 盘口升降档次数：升盘红、降盘绿（初盘→最新累计档数，每 0.25 球一档） */
.pk-move { font-weight: 700; white-space: nowrap; }
.pk-move.up { color: var(--red); }
.pk-move.down { color: var(--green-700); }
.profit-pk:hover, .profit-hint { text-decoration: underline dotted; }
.big-small-val { font-variant-numeric: tabular-nums; color: var(--ink-2); }
/* 已开奖场次北单SP已撤，按500欧赔估算的角标 */
.sp-src-euro { font-size: 9px; color: var(--ink-3); font-weight: 400; margin-left: 1px; }
/* 大小球三格可点击查看水位变化 */
.big-small-val[data-ds-detail] { cursor: pointer; }
.big-small-val[data-ds-detail]:hover { color: var(--blue); text-decoration: underline dotted; }
.odds-val { font-variant-numeric: tabular-nums; color: var(--ink-2); }
.sp-val { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ink); }
.analyze-link { color: var(--blue); text-decoration: none; font-weight: 600; }
.analyze-link:hover { text-decoration: underline; }
.score-dash { color: var(--ink-3); }

/* 懒加载中 */
.profit-loading { color: var(--green-600); font-size: 11px; }

/* 移动端卡片：按设计稿三行四列紧凑网格（赛程式） */
.profit-cards { display: none; }
.profit-card { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; margin-bottom: 6px; box-shadow: var(--shadow); }
.pc-row { display: grid; grid-template-columns: 26px 1.1fr 1.15fr 1.25fr; align-items: center; gap: 3px 6px; }
.pc-row + .pc-row { margin-top: 4px; }
/* 顶行 */
.pc-row-top { display: flex; align-items: center; gap: 6px; }
.pc-row-top .pc-no { color: var(--ink-3); font-size: 12px; font-weight: 600; }
.pc-row-top .league-tag { flex: 0 0 auto; }
.pc-row-top .pc-time { color: var(--ink-2); font-size: 11px; white-space: nowrap; }
.pc-row-top .pc-status-score { font-size: 12px; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pc-status-score.ss-pre { color: var(--ink-3); font-weight: 500; }
.pc-status-score.ss-live { color: #c98a00; }
.pc-status-score.ss-end { color: var(--red); }
/* 中行：主队 / 让球 / 客队（占满四列，让球居中窄列） */
.pc-row-vs { grid-template-columns: 1fr 44px 1fr; }
.pc-row-vs .pc-team { font-size: 13px; font-weight: 600; min-width: 0; line-height: 1.25; }
.pc-row-vs .pc-team small { display: inline; font-size: 10px; color: #aab3bd; font-weight: 400; margin: 0 2px; }
.pc-row-vs .pc-home { text-align: left; }
.pc-row-vs .pc-away { text-align: right; }
.pc-row-vs .pc-hcap { text-align: center; font-size: 14px; }
/* 底行：主队盈利 / 盘口 / 客队盈利（点击卡片即可看水位变化，不再需要「势」按钮） */
.pc-row-profit { grid-template-columns: 1fr 1.2fr 1fr; padding-top: 4px; border-top: 1px dashed var(--line); }
.pc-row-profit .pc-profit-item { font-size: 13px; min-width: 0; white-space: nowrap; }
.pc-row-profit .pc-pk { text-align: center; }
.pc-row-profit .pc-away-profit { text-align: right; }
.pc-row-profit .profit-pk { color: #1f5fa8; font-weight: 600; }
.pc-date { background: #f0f5f1; color: var(--green-800); font-weight: 600; padding: 8px 12px; border-radius: 6px; margin: 12px 0 8px; font-size: 12px; }

@media (max-width: 900px) {
  .table-card:has(#profitTable) .table-scroll { display: none; }
  .table-card:has(#profitTable) { padding: 10px; }
  .profit-cards { display: block; }
  .profit-filter .filter-row { gap: 8px; }
  .profit-filter .profit-odds-mode-group { display: none; }
  .profit-refresh #profitUpdated { display: none; }
  .profit-cutoff-btn { font-size: 11px; padding: 4px 8px; }
  /* 赛事筛选改为居中的浮层，不再贴着窄按钮溢出屏幕 */
  .profit-league-picker .league-panel {
    position: fixed; left: 12px; right: 12px; top: 50%; transform: translateY(-50%);
    width: auto; max-width: none; max-height: 80vh; z-index: 1200;
  }
  .profit-league-picker .lp-list { max-height: 52vh; }
  .profit-league-picker .lp-footer { position: sticky; bottom: 0; gap: 6px; padding: 8px 10px; }
  .profit-league-picker .lp-footer .lp-count { flex-basis: 100%; margin-right: 0; }
  .profit-league-picker .lp-footer button { padding: 4px 8px; font-size: 12px; }
}

/* 亚盘盈利比变化弹窗：每次变化一行，六列紧凑表 */
.modal-profit { position: fixed; inset: 0; z-index: 1000; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal-profit[hidden] { display: none; }
.pm-box { background: #fff; border-radius: 12px; width: 620px; max-width: 100%; max-height: 86vh; overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.profit-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 13px 18px; border-bottom: 1px solid var(--line); background: var(--green-600); color: #fff; flex: 0 0 auto; }
.profit-modal-head h3 { margin: 0; font-size: 14px; font-weight: 600; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pm-close { border: 0; background: none; color: #fff; font-size: 22px; line-height: 1; cursor: pointer; flex: 0 0 auto; }
.pm-body { padding: 0; overflow-y: auto; flex: 1 1 auto; }
.pm-table { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: 12px; }
.pm-table th, .pm-table td { padding: 8px 6px; text-align: center; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pm-table thead th { position: sticky; top: 0; background: #eef4ef; color: var(--green-800); font-weight: 600; z-index: 1; }
.pm-table .up { color: var(--red); font-weight: 600; }
.pm-table .down { color: #1a9d5a; font-weight: 600; }
.pm-table .flat { color: var(--ink-3); }
.pm-profit { font-weight: 700; }
.pm-time { color: var(--ink-2); font-size: 11px; }
.pm-table tbody tr:last-child td { background: #fafafa; color: var(--ink-2); }
.pm-empty { padding: 24px; text-align: center; color: var(--ink-3); font-size: 13px; }
.pm-summary { padding: 12px 14px; background: #f7faf7; border-bottom: 1px solid var(--line); font-size: 13px; text-align: center; }
.pm-summary b { font-variant-numeric: tabular-nums; }
@media (max-width: 900px) {
  .modal-profit { padding: 8px; }
  .pm-box { width: 100%; max-height: 92vh; border-radius: 10px; }
  .profit-modal-head { padding: 11px 12px; }
  .profit-modal-head h3 { font-size: 12px; }
  .pm-table { font-size: 10.5px; }
  .pm-table th, .pm-table td { padding: 6px 2px; }
  .pm-time { font-size: 9.5px; }
}

/* =========================================================
 * 盈利比新增：三模式按钮 / 北单SP模拟投注 / 庄家意图付费列
 * ========================================================= */
/* 表头三按钮切换（欧赔 / 投注比 / 北单SP） */
.odds-mode-tabs { display: inline-flex; align-items: center; gap: 2px; padding: 2px; background: #eef4ef; border-radius: 6px; }
/* 移动端表格整体隐藏，筛选栏补一组同款按钮（桌面隐藏） */
.odds-mode-tabs-m { display: none; }
.odds-mode-btn {
  border: 0; background: transparent; color: var(--ink-2); font-size: 12px; font-weight: 600;
  padding: 3px 9px; border-radius: 4px; cursor: pointer; line-height: 1.3; white-space: nowrap;
}
.odds-mode-btn:hover { color: var(--green-700); }
.odds-mode-btn.active { background: var(--green-600); color: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.12); }

/* 北单SP 可点选按钮：沿用 style.css 的 .sp-btn 基础，仅补尺寸 */
.profit-table .pf-sp-btn.sp-btn { min-width: 34px; padding: 3px 2px; font-size: 12px; }
.profit-table .pf-sp-btn.sp-btn:disabled { opacity: .75; }

/* 庄家意图列 */
.profit-table .col-intent { width: 104px; min-width: 96px; border-left: 1px solid #e6ece6; }
.profit-table tbody td.col-intent { padding-left: 3px; padding-right: 3px; }
.intent-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 3px;
  max-width: 100%; padding: 3px 5px; border-radius: 4px; border: 1px solid transparent;
  font-size: 11px; line-height: 1.3; white-space: nowrap; cursor: pointer;
}
.intent-btn.locked { background: #fff6e8; border-color: #ffd591; color: #b26a00; }
.intent-btn.locked:hover { background: #ffecc9; }
.intent-btn.revealed { background: #eef5ee; border-color: #cfe2d0; color: var(--green-800); font-weight: 600; cursor: default; }
.intent-badge { display: inline-block; padding: 0 4px; border-radius: 3px; font-size: 10px; font-weight: 700; color: #fff; line-height: 1.6; }
.intent-badge.red { background: #c62828; }
.intent-badge.black { background: #333; }
.intent-badge.locked { background: #7fa987; }
.intent-badge.na { background: #c4ccd2; }

/* 北单SP 模拟投注栏（贴底悬浮） */
.pf-bet-bar {
  position: sticky; bottom: 0; z-index: 30; margin-top: 8px; background: #fff;
  border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 -4px 16px rgba(0,0,0,.08);
}
.pf-bet-bar[hidden] { display: none; }
.pf-bet-inner { display: flex; align-items: center; gap: 12px; padding: 8px 12px; }
.pf-bet-summary { flex: 1 1 auto; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 24px; }
.pf-bet-empty { color: var(--ink-3); font-size: 12px; }
.pf-bet-chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 7px;
  background: #eef5ee; border: 1px solid #cfe2d0; border-radius: 4px;
  font-size: 12px; color: var(--green-800); white-space: nowrap;
}
.pf-bet-chip b { font-weight: 700; }
.pf-bet-chip .x { cursor: pointer; color: #c62828; font-style: normal; font-weight: 700; }
.pf-bet-actions { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.pf-bet-hint { font-size: 12px; color: var(--ink-2); white-space: nowrap; }
.pf-bet-hint b { color: #c62828; font-size: 14px; }

/* 移动端卡片：SP 行 / 庄家意图行 */
.pc-row-sp { grid-template-columns: 18px 1fr 18px 1fr 18px 1fr; }
.pc-row-sp .pc-sp-label { font-size: 11px; color: var(--ink-3); text-align: center; }
.pc-row-sp .pf-sp-btn.sp-btn { width: 100%; padding: 4px 0; }
.pc-row-intent { grid-template-columns: 54px 1fr; }
.pc-row-intent .pc-intent-label { font-size: 11px; color: var(--ink-3); }
.pc-row-intent .intent-btn { justify-content: space-between; width: 100%; }

/* 轻量提示 */
.pf-toast {
  position: fixed; left: 50%; top: 20px; transform: translate(-50%, -12px); z-index: 2000;
  padding: 9px 18px; background: rgba(33,45,36,.94); color: #fff; border-radius: 6px;
  font-size: 13px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
.pf-toast.show { opacity: 1; transform: translate(-50%, 0); }
.pf-toast.ok { background: rgba(30,110,60,.96); }
.pf-toast.warn { background: rgba(180,80,30,.96); }

@media (max-width: 900px) {
  .profit-table .col-intent { min-width: 76px; width: 76px; }
  .intent-btn { font-size: 10px; padding: 2px 3px; gap: 2px; }
  .intent-badge { font-size: 9px; padding: 0 3px; }
  .odds-mode-tabs { gap: 1px; padding: 2px; }
  .odds-mode-tabs-m { display: inline-flex; }
  .odds-mode-btn { font-size: 11px; padding: 3px 6px; }
  .pf-bet-inner { flex-wrap: wrap; padding: 8px; gap: 8px; }
  .pf-bet-actions { width: 100%; justify-content: space-between; }
}
