/* 全网玩法 /football-plans 页面自有样式（fp-*），红金数据台 P2 候选 2026-11-28。
   共享令牌与组件在 /store-assets/ds.css（@layer ds-*），本文件只用 --ds- 令牌：
   无 hex、无 !important、无 backdrop-filter / blur、无无限动画、无全屏 fixed 层。
   写在 fp-page 层：它排在 ds-* 各层之后，同名属性以本页为准。 */
@layer fp-page {

/* ---------------------------------------------------------------- 页头 */
.fp-date { display: inline-flex; align-items: center; gap: var(--ds-sp-2); font: var(--ds-text-dense); color: var(--ds-muted); white-space: nowrap; }
.fp-date .ds-field { width: 168px; }
.fp-date .ds-input { width: 100%; padding: 0 10px; font-variant-numeric: tabular-nums; }
.fp-date .ds-input[readonly] { cursor: default; }
.ds-pagehead__meta > .ds-tag { margin-left: var(--ds-sp-2); }
.fp-banner { margin-top: var(--ds-sp-4); }
#snapInfo { anchor-name: --fp-tip-snap; }
#tipSnap { position-anchor: --fp-tip-snap; }
#ruleInfo { anchor-name: --fp-tip-rule; }
#tipRule { position-anchor: --fp-tip-rule; }

/* ---------------------------------------------------------------- 指标条：两条横线之间 */
.fp-kpi { margin-top: var(--ds-sp-5); border-top: 1px solid var(--ds-line); border-bottom: 1px solid var(--ds-line); }

/* ---------------------------------------------------------------- 高置信参考（只收 中 / 高，如实计数） */
.fp-hc { margin-top: var(--ds-sp-6); }
.fp-hc__note { margin: 0 0 var(--ds-sp-3); font: var(--ds-text-body); color: var(--ds-ink); }
.fp-hc__note .ds-muted { margin-left: var(--ds-sp-1); font: var(--ds-text-dense); }
.fp-hc__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: var(--ds-sp-3); }
.fp-card { container: fp-card / inline-size; min-width: 0; padding: var(--ds-sp-4) var(--ds-sp-5); }
.fp-card__in {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--ds-sp-3) var(--ds-sp-4);
  grid-template-areas: "id id" "pk pk" "why why" "go go";
}
.fp-card__id { grid-area: id; min-width: 0; }
.fp-card__mk { display: flex; align-items: center; gap: var(--ds-sp-2); min-width: 0; font: var(--ds-text-meta); color: var(--ds-muted); }
.fp-card__mk b { flex: none; font: var(--ds-text-label); font-weight: var(--ds-fw-semibold); color: var(--ds-ink-2); }
.fp-card__mk > span:not(.ds-tag) { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fp-card__mk .ds-tag { flex: none; margin-left: auto; }
.fp-card__teams { margin-top: 4px; font: var(--ds-text-h3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fp-card__no { margin-right: 6px; color: var(--ds-muted); font-weight: var(--ds-fw-medium); font-variant-numeric: tabular-nums; }
.fp-card__pick { grid-area: pk; display: flex; align-items: center; flex-wrap: wrap; gap: var(--ds-sp-3); min-width: 0; padding-top: 6px; }
.fp-card__why {
  grid-area: why; min-width: 0; font: var(--ds-text-dense); color: var(--ds-ink-2);
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
}
.fp-card__in > .fp-go { grid-area: go; justify-self: start; }
.fp-card--skel { display: grid; gap: var(--ds-sp-3); align-content: center; min-height: 168px; }
@container fp-card (min-width: 560px) {
  .fp-card__in { grid-template-areas: "id id" "pk go" "why why"; }
  .fp-card__in > .fp-go { justify-self: end; }
}
.fp-hc__low { margin-top: var(--ds-sp-2); }
.fp-low { display: grid; margin: 0; padding: 0; list-style: none; }
.fp-low > li {
  display: grid; grid-template-columns: 96px minmax(0, 240px) minmax(0, 1fr) auto auto; align-items: center; gap: var(--ds-sp-3);
  min-height: 44px; border-top: 1px solid var(--ds-line); font: var(--ds-text-dense);
}
.fp-low > li:first-child { border-top: 0; }
.fp-low b { color: var(--ds-ink); font-weight: var(--ds-fw-semibold); }
.fp-low__who { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fp-low__pk { color: var(--ds-ink-2); font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- 比赛玩法：筛选 + 按开赛时间排序的折叠行 */
.fp-filterbar { margin-bottom: var(--ds-sp-3); }
.fp-list { background: var(--ds-surface); border: 1px solid var(--ds-line); border-radius: var(--ds-r-md); overflow: clip; }
.fp-list--empty { background: none; border: 0; }
.fp-lhead, .fp-m__sum, .fp-skel-row {
  display: grid; grid-template-columns: 44px 104px minmax(0, 360px) minmax(0, 1fr) 72px 16px; align-items: center; column-gap: var(--ds-sp-3);
  padding: 0 var(--ds-sp-4);
}
.fp-lhead { height: var(--ds-thead-h); background: var(--ds-surface-2); border-bottom: 1px solid var(--ds-line); font: var(--ds-text-label); color: var(--ds-muted); }
.fp-lhead > :nth-child(5) { text-align: end; }
.fp-skel-row { height: 48px; border-top: 1px solid var(--ds-line); }
.fp-skel-row:first-child { border-top: 0; }
.fp-m + .fp-m { border-top: 1px solid var(--ds-line); }
.fp-m__sum { min-height: 48px; cursor: pointer; list-style: none; }
.fp-m__sum::-webkit-details-marker { display: none; }
@media (hover: hover) { .fp-m__sum:hover { background: var(--ds-surface-2); } }
.fp-m__no { font: var(--ds-fw-semibold) var(--ds-fs-13)/var(--ds-lh-13) var(--ds-font-sans); color: var(--ds-ink-2); font-variant-numeric: tabular-nums; }
.fp-m__ko { font: var(--ds-text-dense); color: var(--ds-ink); white-space: nowrap; }
.fp-m__ko small { margin-right: 4px; font: inherit; color: var(--ds-muted); }
.fp-m__teams { min-width: 0; font: var(--ds-text-h4); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fp-m__lg { min-width: 0; font: var(--ds-text-dense); color: var(--ds-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fp-m__n { font: var(--ds-text-dense); color: var(--ds-muted); text-align: end; white-space: nowrap; }
.fp-m__chev { color: var(--ds-faint); transition: transform var(--ds-dur-2) var(--ds-ease-out); }
.fp-m[open] > .fp-m__sum .fp-m__chev { transform: rotate(90deg); color: var(--ds-ink-2); }
.fp-m[open] > .fp-m__sum { box-shadow: inset 0 -1px 0 var(--ds-line); }
.fp-m__body { container: fp-mk / inline-size; padding: 0 var(--ds-sp-4) var(--ds-sp-2) calc(var(--ds-sp-4) + 44px + var(--ds-sp-3)); }
.fp-empty { padding: var(--ds-sp-3) 0; font: var(--ds-text-dense); color: var(--ds-muted); }

/* 展开后的内表：玩法 | 当前官方赔率 | AI 选择 | 置信度 | 查看分析 */
.fp-mk th { position: static; background: none; }
.fp-mk th:nth-child(1) { width: 136px; padding-left: 0; }
.fp-mk th:nth-child(2) { width: 52%; }
.fp-mk th:nth-child(4) { width: 72px; }
.fp-mk th:nth-child(5) { width: 112px; }
.fp-mk td { height: auto; padding-top: var(--ds-sp-3); padding-bottom: var(--ds-sp-3); vertical-align: top; }
.fp-mk td:first-child { padding-left: 0; }
.fp-mk__name { font: var(--ds-text-h4); white-space: nowrap; line-height: 28px; }
.fp-mk__name small { display: block; font: var(--ds-text-meta); color: var(--ds-muted); }
.fp-mk__odds .ds-cell-chips { gap: 6px; }
.fp-mk__t { display: block; margin-top: 6px; font: var(--ds-text-meta); color: var(--ds-muted); }
.fp-mk__none { font: var(--ds-text-dense); color: var(--ds-muted); line-height: 28px; }
.fp-mk__ai { min-width: 0; }
.fp-pick { display: flex; align-items: center; flex-wrap: wrap; gap: 4px var(--ds-sp-2); font: var(--ds-text-h4); line-height: 28px; }
.fp-mk__conf, .fp-mk__go { line-height: 28px; }
.fp-mk__go { text-align: end; }
.fp-all { height: 28px; color: var(--ds-link); }

/* ---------------------------------------------------------------- 查看分析 */
.fp-dlg { display: grid; gap: var(--ds-sp-4); }
.fp-dlg .ds-kv { grid-template-columns: 6.5em minmax(0, 1fr); }
.fp-dlg .ds-kv dd .ds-muted { font: var(--ds-text-dense); }
.fp-dlg p, .fp-dlg li { font: var(--ds-text-body); color: var(--ds-ink-2); overflow-wrap: anywhere; }
.fp-dlg ul { margin: 2px 0 0; padding-left: 1.2em; }
.fp-dlg__h { margin: 0 0 2px; font: var(--ds-text-label); color: var(--ds-muted); }
.fp-dlg__sec + .fp-dlg__sec { margin-top: var(--ds-sp-3); }
.fp-switch { display: flex; align-items: center; gap: var(--ds-sp-3); font: var(--ds-text-dense); color: var(--ds-muted); }
.fp-switch .ds-field { flex: 1; min-width: 0; }
.fp-switch .ds-input { width: 100%; }
.fp-lane { border-top: 1px solid var(--ds-line); }
.fp-lane > summary { flex-wrap: wrap; }
.fp-lane__pick { font: var(--ds-text-h4); color: var(--ds-ink); }
.fp-lane > .ds-disclosure__body { padding-left: var(--ds-sp-6); }
.fp-lane__meta { margin-bottom: var(--ds-sp-2); }
.fp-times { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--ds-sp-3); margin: 0; padding: var(--ds-sp-3) 0 0; border-top: 1px solid var(--ds-line); }
.fp-times dt { font: var(--ds-text-meta); color: var(--ds-muted); }
.fp-times dd { margin: 2px 0 0; font: var(--ds-fs-13)/var(--ds-lh-13) var(--ds-font-mono); color: var(--ds-ink); overflow-wrap: anywhere; }
.ds-dialog__title small { word-break: keep-all; }

/* ---------------------------------------------------------------- 页面底部：两个折叠区 + 附注 */
.fp-end { margin-top: var(--ds-sp-8); }
.fp-end .ds-footnote { margin-top: var(--ds-sp-4); }
.fp-saved + .fp-end { margin-top: 0; }
.fp-guide { margin: 0; }
.fp-guide > div { display: grid; grid-template-columns: 7em minmax(0, 1fr); gap: var(--ds-sp-3); padding: var(--ds-sp-2) 0; border-top: 1px solid var(--ds-line); }
.fp-guide > div:first-child { border-top: 0; padding-top: 0; }
.fp-guide dt { color: var(--ds-ink); font-weight: var(--ds-fw-semibold); }
.fp-guide dd { margin: 0; }
.fp-review { display: grid; gap: var(--ds-sp-2); }
.fp-review__row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px var(--ds-sp-3); font: var(--ds-text-dense); }
.fp-review__score { font: var(--ds-text-h4); font-variant-numeric: tabular-nums; }
.fp-actions { display: flex; flex-wrap: wrap; gap: var(--ds-sp-2); margin-top: var(--ds-sp-3); }
.fp-export { margin: var(--ds-sp-3) 0 0; padding: var(--ds-sp-4); white-space: pre-wrap; overflow-wrap: anywhere; font: var(--ds-text-dense); background: var(--ds-surface-2); border: 1px solid var(--ds-line); border-radius: var(--ds-r-md); }

/* ---------------------------------------------------------------- 手机 ≤599：触控区 ≥44 */
@media (max-width: 599px) {
  .ds-pagehead { gap: var(--ds-sp-3); }
  .ds-pagehead__actions { width: 100%; flex-wrap: wrap; }
  .fp-date { flex: 1 1 180px; min-width: 0; }
  .ds-pagehead__actions .ds-btn { flex: none; }
  .fp-date .ds-field { flex: 1; width: auto; }
  .fp-date .ds-input, .ds-pagehead__actions .ds-btn { height: var(--ds-touch); }
  .fp-kpi { margin-top: var(--ds-sp-4); }
  .fp-kpi .ds-stat { flex: 1 1 0; min-width: 0; }
  .fp-hc { margin-top: var(--ds-sp-4); }
  .fp-hc__note .ds-muted { display: block; margin: 2px 0 0; }
  .fp-card { padding: var(--ds-sp-3) var(--ds-sp-4) 14px; }
  .fp-card__in { gap: var(--ds-sp-2) var(--ds-sp-3); grid-template-areas: "id id" "pk go" "why why"; }
  .fp-card__mk > span:not(.ds-tag) { display: none; }
  .fp-card__teams { margin-top: 2px; }
  .fp-card .ds-chip--lg { height: 36px; }
  .fp-card__in > .fp-go { justify-self: end; height: var(--ds-touch); }
  .fp-low > li { grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: "mk cf go" "who who go" "pk pk go"; gap: 0 var(--ds-sp-2); padding: var(--ds-sp-2) 0; }
  .fp-low > li > :nth-child(1) { grid-area: mk; }
  .fp-low > li > :nth-child(2) { grid-area: who; }
  .fp-low > li > :nth-child(3) { grid-area: pk; }
  .fp-low > li > :nth-child(4) { grid-area: cf; }
  .fp-low > li > :nth-child(5) { grid-area: go; height: var(--ds-touch); }
  .fp-filterbar { margin-inline: calc(-1 * var(--ds-gutter)); }
  .fp-filterbar .ds-filters { padding-inline: var(--ds-gutter); }
  .fp-filterbar .ds-filter { height: var(--ds-touch); }
  .fp-lhead { display: none; }
  .fp-m__sum, .fp-skel-row {
    grid-template-columns: 36px auto minmax(0, 1fr) auto 16px; grid-template-areas: "no tm tm tm ch" "no ko lg n ch";
    row-gap: 2px; column-gap: var(--ds-sp-2); min-height: 56px; padding: var(--ds-sp-2) var(--ds-sp-3) var(--ds-sp-2) var(--ds-sp-4);
  }
  .fp-skel-row { height: 56px; grid-template-areas: "no tm tm tm ch" "no ko ko ko ch"; }
  .fp-skel-row > :nth-child(1) { grid-area: no; } .fp-skel-row > :nth-child(2) { grid-area: ko; }
  .fp-skel-row > :nth-child(3) { grid-area: tm; } .fp-skel-row > :nth-child(4) { display: none; }
  .fp-m__no { grid-area: no; }
  .fp-m__teams { grid-area: tm; }
  .fp-m__ko { grid-area: ko; font: var(--ds-text-meta); }
  .fp-m__lg { grid-area: lg; font: var(--ds-text-meta); }
  .fp-m__n { grid-area: n; font: var(--ds-text-meta); }
  .fp-m__chev { grid-area: ch; }
  .fp-m__body { padding: 0; }
  .fp-all, .fp-mk__go .ds-btn { height: var(--ds-touch); }
  .fp-dlg .ds-kv { grid-template-columns: minmax(0, 1fr); gap: 2px var(--ds-sp-4); }
  .fp-dlg .ds-kv dd { margin-bottom: var(--ds-sp-2); }
  .fp-switch { display: grid; gap: 4px; }
  .fp-switch .ds-input, .ds-dialog__foot .ds-btn { height: var(--ds-touch); }
  .fp-lane > .ds-disclosure__body { padding-left: 0; }
  .fp-times { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ds-dialog.fp-full { height: 100dvh; max-height: 100dvh; border-radius: 0; }
  .ds-dialog.fp-full[open] { display: flex; flex-direction: column; }
  .ds-dialog.fp-full > .ds-dialog__body { flex: 1 0 auto; align-content: start; }
  .ds-footer__brand button, .ds-footer__brand a { display: inline-flex; align-items: center; min-height: var(--ds-touch); }
  .ds-topbar__tools > .ds-btn { height: var(--ds-touch); }
  .ds-topbar .ds-brand { min-height: var(--ds-touch); }
  .ds-menu__row .ds-seg > button { height: var(--ds-touch); }
  .ds-dialog__head > .ds-iconbtn::before { inset: 0; }
}
/* 内表在窄容器里改成每个玩法一块：AI 结论在官方赔率上方，每个玩法只留一行更新时间 */
@container fp-mk (max-width: 599px) {
  .fp-mk, .fp-mk > tbody { display: block; }
  .fp-mk > thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .fp-mk tbody tr {
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "nm tm cf" "ai ai go" "od od od";
    align-items: center; gap: 2px var(--ds-sp-2); padding: 10px var(--ds-sp-3) 14px var(--ds-sp-4);
    border-top: 1px solid var(--ds-line);
  }
  .fp-mk tbody tr:first-child { border-top: 0; }
  .fp-mk td { display: block; height: auto; padding: 0; border: 0; background: none; }
  .fp-mk td.fp-mk__name { grid-area: nm; display: flex; align-items: baseline; gap: 6px; line-height: var(--ds-lh-14); }
  .fp-mk__name small { display: inline; }
  .fp-mk td.fp-mk__odds { display: contents; }
  .fp-mk__odds > .ds-cell-chips, .fp-mk__odds > .fp-mk__none { grid-area: od; margin-top: 6px; }
  .fp-mk__t { grid-area: tm; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .fp-mk__t::before { content: "· "; color: var(--ds-faint); }
  .fp-mk__conf { grid-area: cf; justify-self: end; line-height: 20px; }
  .fp-mk td.fp-mk__ai { grid-area: ai; }
  .fp-pick { font: var(--ds-text-h3); }
  .fp-pick::before { content: attr(data-model); font: var(--ds-text-label); color: var(--ds-muted); }
  .fp-mk__go { grid-area: go; line-height: 1; margin-right: -4px; }
}

/* ---------------------------------------------------------------- 打印：只打清洁导出预览（与线上一致） */
@media print {
  .ds-topbar, .ds-tabbar, .ds-footer, .ds-pagehead, .fp-kpi, .fp-hc, #marketResults, .fp-end, #statusMessage, #analysisJobStatus, #savedPlanList, #savedExportActions, .fp-saved > summary, .ds-dialog { display: none; }
  .ds-app, .ds-page, .fp-saved { margin: 0; padding: 0; max-width: none; border: 0; background: none; }
  .fp-saved > .ds-disclosure__body { padding: 0; }
}

/* 带 hidden 属性的元素一律不显示（本层排在 ds-components 之后，需要再声明一次） */
.fp-main [hidden], .ds-topbar [hidden], .fp-dlg [hidden] { display: none; }
}
