/* =========================================================
 * live.css — 即时比分页（复用 style.css 变量与赛程表基础样式）
 * ========================================================= */

/* 筛选区 */
.live-filter { margin-bottom: 12px; }
.live-filter .filter-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }

/* 赛事多选面板 */
.live-league-picker { position: relative; }
.league-picker-btn { border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: 6px; padding: 6px 12px; font-size: 13px; cursor: pointer; min-width: 130px; text-align: left; }
.league-picker-btn:hover { border-color: var(--green-600); }
.lpb-arrow { float: right; color: var(--ink-3); }
.league-panel { position: absolute; top: calc(100% + 6px); left: 0; z-index: 500; width: 560px; max-width: 92vw; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 36px rgba(0,0,0,.18); overflow: hidden; }
.lp-tabs { display: flex; gap: 18px; padding: 10px 14px 0; border-bottom: 1px solid var(--line); }
.lp-tab { border: 0; background: none; padding: 6px 2px 10px; font-size: 13px; color: var(--ink-2); cursor: pointer; border-bottom: 2px solid transparent; }
.lp-tab.active { color: var(--green-700); border-bottom-color: var(--green-600); font-weight: 600; }
/* 彩种直达标签：北京单场可用，竞彩足球暂不可点 */
.lp-tab-lottery { color: #b23a2b; }
.lp-tab-lottery.active { color: #b23a2b; border-bottom-color: #b23a2b; }
.lp-tab-disabled, .lp-tab-disabled:hover { color: #bbb !important; cursor: not-allowed; opacity: .65; border-bottom-color: transparent !important; }
.lp-quick { display: flex; gap: 8px; padding: 10px 14px; flex-wrap: wrap; }
.lp-quick button { border: 1px solid var(--line); background: #f7f8fa; color: var(--ink-2); border-radius: 14px; padding: 3px 12px; font-size: 12px; cursor: pointer; }
.lp-quick button:hover { border-color: var(--green-600); color: var(--green-700); }
.lp-list { max-height: 320px; overflow-y: auto; padding: 4px 14px 10px; }
.lp-group { margin-top: 8px; }
.lp-gtitle { font-size: 12px; color: var(--ink-3); font-weight: 600; padding: 4px 0 6px; border-bottom: 1px dashed var(--line); }
.lp-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.lp-chip { border: 1px solid var(--line); background: #fff8f2; color: var(--ink-2); border-radius: 14px; padding: 3px 10px 3px 6px; font-size: 12px; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; }
.lp-chip .lp-check { width: 15px; height: 15px; border: 1px solid #f0a868; border-radius: 50%; color: transparent; font-size: 10px; line-height: 13px; text-align: center; background: #ff7a45; }
.lp-chip.selected .lp-check { color: #fff; }
.lp-chip:not(.selected) { background: #f7f8fa; }
.lp-chip:not(.selected) .lp-check { background: #fff; border-color: #bbb; }
.lp-footer { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--line); background: #fafbfc; flex-wrap: wrap; }
.lp-count { font-size: 12px; color: var(--ink-3); margin-right: auto; }
.lp-footer button { border: 1px solid var(--line); background: #fff; color: var(--ink-2); border-radius: 6px; padding: 4px 12px; font-size: 12px; cursor: pointer; }
.lp-footer .lp-ok { background: var(--green-600); border-color: var(--green-600); color: #fff; }
.live-refresh { margin-left: auto; display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--ink-2); }
.live-refresh #liveUpdated { color: var(--ink-3); flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-auto { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.live-auto input { accent-color: var(--green-600); }
.btn-mini { border: 1px solid var(--line); background: #fff; color: var(--green-700); border-radius: 6px; padding: 4px 12px; font-size: 12px; cursor: pointer; }
.btn-mini:hover { border-color: var(--green-600); }
.btn-mini:disabled { opacity: .6; cursor: default; }

/* 表格：复用 match-table，补充即时列 */
.live-table .col-status { min-width: 62px; }
.live-table .col-score { min-width: 120px; }
/* 排名徽标移入主/客队列后适当加宽，避免队名与徽标挤压换行 */
.live-table .col-team { width: 118px; min-width: 118px; }
.live-table .live-team-cell .team-rank { margin: 0 3px 0 0; }
.live-table .live-team-away .team-rank { margin: 0 0 0 3px; }
/* 彩种子页面场次序（北京单场/竞彩足球/竞彩篮球，最左列；取官方场次编号，不自造） */
.live-table .col-bdnum { width: 68px; min-width: 68px; text-align: center; }
.live-table .live-bdnum { text-align: center; font-weight: 700; color: var(--green-700); font-variant-numeric: tabular-nums; white-space: nowrap; }
.live-table .live-score { font-variant-numeric: tabular-nums; }
.live-score b { font-size: 15px; color: var(--ink); }
.live-score small { color: var(--ink-3); font-size: 11px; font-weight: 400; }
.live-pending { color: var(--ink-3); font-size: 12px; }

/* 状态标签 */
.live-status { display: inline-block; padding: 2px 7px; border-radius: 10px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.live-status.ls-live { background: #ffe9e9; color: #d0021b; }
.live-status.ls-end { background: #eef1f4; color: #6b7681; }
.live-status.ls-pre { background: var(--green-100); color: var(--green-700); }
.live-status.ls-break { background: #fff4e5; color: #c47f00; }

/* 欧赔：三列之间无竖线 */
.live-table .live-odd { border-right: 0 !important; font-variant-numeric: tabular-nums; color: var(--ink); }

/* 角球 / 亚盘 */
.live-corner, .live-asian, .live-rec { text-align: center; font-size: 12px; color: var(--ink-2); }
/* 付费推荐入口占位（后续替换为具体内容） */
.rec-entry { display: inline-flex; align-items: center; gap: 2px; color: #b87900; background: #fff7e8; border: 1px solid #f0d9a8; border-radius: 10px; padding: 1px 7px; font-size: 11px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.rec-entry:hover { background: #ffefcf; border-color: #d9a94a; }
.rec-arrow { font-size: 13px; line-height: 1; }
.live-corner .na, .live-asian .na, .live-odd .na { color: var(--ink-3); }
.asian-val { color: var(--blue); font-weight: 600; }
.sp-val { color: var(--ink); font-variant-numeric: tabular-nums; }
.live-pk .asian-val { font-size: 12px; }
.live-team-cell .team-rank { color: var(--ink-3); background: #eef1f4; border-radius: 3px; padding: 0 3px; font-size: 10px; font-weight: 600; white-space: nowrap; vertical-align: middle; }

/* 比分列内的半场比分：全场（半场），如 6-0（2-0） */
.score-half { display: inline-block; margin-left: 3px; color: var(--ink-3); font-size: 12px; font-weight: 400; white-space: nowrap; }

/* 比分变化 5 秒高亮：持续醒目黄色底 + 呼吸，肉眼可见 */
.live-row.live-changed, .live-card.live-changed { animation: liveHold 5s ease-out 1 both; }
@keyframes liveHold {
  0%, 88% { background: #fff2a8; box-shadow: inset 0 0 0 2px #f5c400; }
  94% { background: #fffbe0; box-shadow: inset 0 0 0 1px #f5d873; }
  100% { background: transparent; box-shadow: none; }
}
/* 比分单元格变化标记：旧→新 ▲，红色醒目 */
.score-num { color: var(--ink); }
.score-flag { display: inline-block; margin-left: 6px; font-size: 11px; font-weight: 700; color: #d0021b; white-space: nowrap; animation: flagPulse 1s ease-in-out infinite; }
.score-flag s { color: var(--ink-3); font-weight: 400; }
/* 只标红变化的一侧，未变化方与连字符保持默认色 */
.score-flag .sc-new, .score-toast .sc-score .sc-new { color: var(--ink); }
.score-flag .score-diff, .score-toast .sc-score .score-diff { color: #d0021b; font-weight: 800; }
.score-dash { color: inherit; }
@keyframes flagPulse { 0%,100% { opacity: 1; } 50% { opacity: .45; } }
.live-card .lc-score .score-flag { display: block; margin: 2px 0 0; font-size: 10px; }

/* 进球方球队名：持续 5 秒醒目底色（参考球探网进球提示），仅作用在进球一侧 */
.team-name.goal-team {
  display: inline-block; padding: 1px 6px; margin: -1px -2px; border-radius: 4px;
  animation: goalGlow 5s ease-in-out 1 both;
}
@keyframes goalGlow {
  0%, 84% { background: #ffe066; color: #7a4b00; box-shadow: 0 0 0 2px #ffc107; font-weight: 700; }
  92% { background: #fff6cf; box-shadow: 0 0 0 1px #ffe08a; }
  100% { background: transparent; box-shadow: none; }
}

/* 盘口/水位/分钟变化：变化单元格红色闪烁数秒后恢复，提示数据在实时变动 */
.live-odd.odd-changed, .live-status.odd-changed, .lc-foot .odd-changed {
  animation: oddFlash 5s ease-out 1 both; border-radius: 4px;
}
@keyframes oddFlash {
  0%, 80% { background: #ffe1e1; color: #d0021b; box-shadow: inset 0 0 0 1px #ff9a9a; font-weight: 700; }
  90% { background: #fff5f5; box-shadow: inset 0 0 0 1px #ffd0d0; }
  100% { background: transparent; box-shadow: none; }
}

/* 移动端卡片 */
.live-cards { display: none; }
.live-card { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin: 8px 10px; background: #fff; }
.lc-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.lc-num { font-weight: 700; color: var(--ink); }
.lc-bdnum { min-width: 22px; text-align: center; font-weight: 700; color: var(--green-700); font-variant-numeric: tabular-nums; white-space: nowrap; }
.lc-time { margin-left: auto; font-size: 12px; color: var(--ink-3); }
.lc-mid { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 14px; }
.lc-team { display: inline-flex; align-items: center; gap: 2px; min-width: 0; }
.lc-team .team-rank { font-size: 9px; padding: 0 2px; margin: 0; background: #eef1f4; color: var(--ink-3); border-radius: 3px; font-weight: 600; white-space: nowrap; }
.lc-team .team-name { min-width: 0; }
.lc-score { font-size: 17px; font-variant-numeric: tabular-nums; flex: 0 0 auto; }
.lc-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); font-size: 12px; color: var(--ink-2); }

/* 事件弹窗 */
/* 比分/事件弹窗：视口顶部正中、置顶最前 */
.live-toast {
  position: fixed; left: 0; right: 0; top: 16px; bottom: auto; margin: 0 auto; z-index: 9999;
  width: max-content; min-width: 260px; max-width: min(340px, calc(100vw - 24px));
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 12px 36px rgba(0,0,0,.28); overflow: hidden;
  animation: toastIn .25s ease-out;
}
@keyframes toastIn { from { transform: translateY(-20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.live-toast .lt-title {
  background: linear-gradient(135deg, var(--green-700), var(--green-900));
  color: #fff; padding: 8px 12px; font-size: 13px; font-weight: 600;
  display: flex; justify-content: space-between; cursor: default;
}
.live-toast .lt-title span { opacity: .8; font-size: 11px; cursor: pointer; }
.live-toast .lt-body { padding: 12px; font-size: 13px; line-height: 1.7; color: var(--ink); }
.live-toast .lt-body b { color: var(--red); }
.live-toast .lt-body i { color: var(--ink-3); font-style: normal; }
/* 比分变化弹窗 */
.score-toast .lt-title { background: linear-gradient(135deg, #d0021b, #a80016); }
.score-toast .sc-body { text-align: center; padding: 14px 12px 12px; }
.score-toast .sc-league { font-size: 12px; color: var(--ink-2); margin-bottom: 4px; }
.score-toast .sc-league i { color: var(--ink-3); font-style: normal; }
.score-toast .sc-teams { font-size: 14px; font-weight: 600; color: var(--ink); margin-bottom: 8px; }
.score-toast .sc-vs { color: var(--ink-3); font-weight: 400; font-size: 12px; margin: 0 2px; }
.score-toast .sc-score { display: flex; align-items: center; justify-content: center; gap: 12px; font-variant-numeric: tabular-nums; }
.score-toast .sc-score s { font-size: 18px; color: var(--ink-3); }
.score-toast .sc-score em { font-size: 16px; color: var(--ink-3); font-style: normal; }
.score-toast .sc-score .sc-new { font-size: 28px; font-weight: 800; }
.score-toast .lt-more { margin-top: 8px; font-size: 11px; color: var(--ink-3); }

/* 移动端 */
@media (max-width: 560px) {
  /* 新增"即时比分"后导航变4项，压缩顶部栏避免横向溢出 */
  .topbar-inner { gap: 4px; padding: 0 8px; }
  .main-nav { gap: 0; margin-left: 2px; }
  .nav-btn { padding: 6px 5px; font-size: 11px; white-space: nowrap; }
  .brand-text { font-size: 12px; }
  .brand-logo { font-size: 14px; }
  .topbar-tools .icon-btn:last-child { display: none; }
  .topbar-tools { gap: 4px; }
  .topbar-tools .icon-btn { padding: 4px; }
}

@media (max-width: 720px) {
  .live-filter .filter-row { gap: 8px; }
  .live-refresh { margin-left: 0; width: 100%; }
  .live-table { display: none; }
  .live-cards { display: block; }
  .live-toast { left: 12px; right: 12px; top: 12px; bottom: auto; width: auto; max-width: none; margin: 0; }
  /* 移动端改为视口内居中弹层：原 right:0 相对窄按钮容器定位，导致弹窗向左溢出被裁切 */
  .league-panel {
    position: fixed; left: 3vw; right: 3vw; top: 50%; transform: translateY(-50%);
    width: auto; max-width: none; max-height: 80vh; overflow-y: auto; z-index: 1000;
  }
  .league-picker-btn { min-width: 108px; }
  .lp-footer button { padding: 4px 8px; }
}

/* ---- 即时比分：4 个独立分类页签 ---- */
.live-subtabs { display: flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.live-subtabs a {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 7px 16px; border: 1px solid var(--line); border-radius: 6px;
  background: #fff; color: var(--ink-2); font-size: 13px; font-weight: 600;
  text-decoration: none; white-space: nowrap;
}
.live-subtabs a:hover { color: var(--green-700); border-color: var(--green-600); }
.live-subtabs a.active { background: var(--green-600); border-color: var(--green-600); color: #fff; }
@media (max-width: 720px) {
  .live-subtabs { gap: 5px; }
  .live-subtabs a { flex: 1 1 calc(50% - 3px); padding: 7px 4px; font-size: 12px; }
}
