/**
 * form.css — 球路状态页专属样式
 * ===========================================================================
 * 命名空间 fm-*,与 b5-* / lg-* 完全隔离。
 * 继承 big5.css 的配色变量,不引入新色板,不引外部字体/图片。
 * 对比度全部按 WCAG AA(正文 ≥4.5:1,大字号 ≥3:1)校准。
 */

/* ── 布局:左侧球队列表 + 右侧详情 ─────────────────────────────────────── */
.fm-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

@media (max-width: 900px) {
  .fm-shell { grid-template-columns: 1fr; }
  .fm-aside { position: static !important; max-height: none !important; }
}

/* ── 左侧:球队选择列表 ───────────────────────────────────────────────── */
.fm-aside {
  position: sticky;
  top: 12px;
  background: var(--b5-card, #131a2b);
  border: 1px solid var(--b5-line, #263149);
  border-radius: 14px;
  padding: 12px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
}

.fm-aside-hd {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  color: var(--b5-dim, #93a3c4);
  text-transform: uppercase;
  padding: 2px 4px 10px;
  border-bottom: 1px solid var(--b5-line, #263149);
  margin-bottom: 8px;
}

.fm-tlist { display: flex; flex-direction: column; gap: 3px; }

.fm-titem {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 9px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--b5-fg, #e8eefc);
  font: inherit;
  font-size: 13.5px;
  text-align: left;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}

.fm-titem:hover { background: rgba(90, 130, 220, .13); }

.fm-titem:focus-visible {
  outline: 2px solid var(--b5-accent, #5b8cff);
  outline-offset: 1px;
}

.fm-titem.is-active {
  background: rgba(91, 140, 255, .17);
  border-color: rgba(91, 140, 255, .55);
}

.fm-titem-rank {
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  color: var(--b5-dim, #93a3c4);
  text-align: right;
}

.fm-titem.is-active .fm-titem-rank { color: var(--b5-accent, #5b8cff); }

.fm-titem-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 迷你球路条:最近 5 场 */
.fm-mini { display: inline-flex; gap: 2px; }

.fm-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  display: inline-block;
}

.fm-dot.is-W { background: #3fbf7f; }
.fm-dot.is-D { background: #b9922f; }
.fm-dot.is-L { background: #d15a5a; }
.fm-dot.is-none { background: #3a4460; }

/* ── 右侧:详情主区 ───────────────────────────────────────────────────── */
.fm-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.fm-card {
  background: var(--b5-card, #131a2b);
  border: 1px solid var(--b5-line, #263149);
  border-radius: 14px;
  padding: 16px 18px;
}

.fm-card-hd {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.fm-card-title { font-size: 15px; font-weight: 700; margin: 0; }

.fm-card-note { font-size: 12.5px; color: var(--b5-dim, #93a3c4); }

/* 球队标题区 */
.fm-hero-name {
  font-size: 26px;
  font-weight: 800;
  margin: 0 0 4px;
  letter-spacing: -.01em;
}

.fm-hero-sub {
  font-size: 13px;
  color: var(--b5-dim, #93a3c4);
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin: 0;
}

/* ── 样本池切换开关 ───────────────────────────────────────────────────── */
.fm-scope {
  display: inline-flex;
  border: 1px solid var(--b5-line, #263149);
  border-radius: 9px;
  overflow: hidden;
}

.fm-scope button {
  padding: 6px 13px;
  border: 0;
  background: transparent;
  color: var(--b5-dim, #93a3c4);
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
  transition: background .15s, color .15s;
}

.fm-scope button + button { border-left: 1px solid var(--b5-line, #263149); }
.fm-scope button:hover { color: var(--b5-fg, #e8eefc); background: rgba(90, 130, 220, .12); }

.fm-scope button.is-active {
  background: rgba(91, 140, 255, .2);
  color: #cfe0ff;
  font-weight: 700;
}

.fm-scope button:focus-visible { outline: 2px solid var(--b5-accent, #5b8cff); outline-offset: -2px; }

/* ── 关键数字网格 ─────────────────────────────────────────────────────── */
.fm-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 10px;
}

.fm-kpi {
  background: rgba(255, 255, 255, .035);
  border: 1px solid var(--b5-line, #263149);
  border-radius: 10px;
  padding: 10px 12px;
}

.fm-kpi-k {
  font-size: 11.5px;
  color: var(--b5-dim, #93a3c4);
  margin-bottom: 3px;
  letter-spacing: .02em;
}

.fm-kpi-v {
  font-size: 20px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}

.fm-kpi-x { font-size: 11.5px; color: var(--b5-dim, #93a3c4); margin-top: 2px; }

/* ── 球路序列条 ───────────────────────────────────────────────────────── */
.fm-seq { display: flex; flex-wrap: wrap; gap: 5px; }

.fm-seq-cell {
  width: 30px; height: 30px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  font-size: 12.5px;
  font-weight: 700;
  color: #08101f;
  cursor: default;
}

.fm-seq-cell.is-W { background: #45c98a; }
.fm-seq-cell.is-D { background: #d4ac48; }
.fm-seq-cell.is-L { background: #e07272; }
.fm-seq-cell.is-none { background: #303a52; color: #93a3c4; }

.fm-seq-legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--b5-dim, #93a3c4);
  margin-top: 10px;
}

.fm-seq-legend span { display: inline-flex; align-items: center; gap: 5px; }

.fm-swatch { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }

/* ── 特征信号卡 ───────────────────────────────────────────────────────── */
.fm-signals { display: flex; flex-direction: column; gap: 11px; }

.fm-sig {
  border: 1px solid var(--b5-line, #263149);
  border-left-width: 3px;
  border-radius: 10px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, .03);
}

.fm-sig.is-high { border-left-color: #e07272; background: rgba(224, 114, 114, .07); }
.fm-sig.is-mid  { border-left-color: #d4ac48; background: rgba(212, 172, 72, .06); }
.fm-sig.is-info { border-left-color: #5b8cff; background: rgba(91, 140, 255, .06); }
.fm-sig.is-weak { border-left-color: #6b7896; background: rgba(255, 255, 255, .025); }

.fm-sig-hd {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.fm-sig-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  letter-spacing: .03em;
  white-space: nowrap;
}

.fm-sig.is-high .fm-sig-tag { background: rgba(224, 114, 114, .22); color: #ffc9c9; }
.fm-sig.is-mid  .fm-sig-tag { background: rgba(212, 172, 72, .22); color: #ffe4a8; }
.fm-sig.is-info .fm-sig-tag { background: rgba(91, 140, 255, .22); color: #c8daff; }
.fm-sig.is-weak .fm-sig-tag { background: rgba(255, 255, 255, .1); color: #b3bdd4; }

.fm-sig-head { font-size: 14px; font-weight: 700; }

.fm-sig-detail {
  font-size: 13.5px;
  line-height: 1.72;
  color: #cbd6ef;
  margin: 0 0 7px;
}

.fm-sig-ev {
  font-size: 11.5px;
  color: var(--b5-dim, #93a3c4);
  font-variant-numeric: tabular-nums;
  padding-top: 6px;
  border-top: 1px dashed var(--b5-line, #263149);
}

.fm-empty {
  font-size: 13.5px;
  color: var(--b5-dim, #93a3c4);
  padding: 18px;
  text-align: center;
  border: 1px dashed var(--b5-line, #263149);
  border-radius: 10px;
  line-height: 1.7;
}

/* ── 比赛明细表 ───────────────────────────────────────────────────────── */
.fm-tw { overflow-x: auto; }

.fm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.fm-table th,
.fm-table td {
  padding: 8px 9px;
  text-align: center;
  border-bottom: 1px solid var(--b5-line, #263149);
  white-space: nowrap;
}

.fm-table th {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--b5-dim, #93a3c4);
  letter-spacing: .04em;
  background: rgba(255, 255, 255, .03);
  position: sticky;
  top: 0;
}

.fm-table tbody tr:hover td { background: rgba(90, 130, 220, .08); }
.fm-table td.fm-al { text-align: left; }
.fm-table .fm-self { font-weight: 700; color: #cfe0ff; }

.fm-pill {
  display: inline-block;
  min-width: 22px;
  padding: 1px 6px;
  border-radius: 5px;
  font-size: 11.5px;
  font-weight: 700;
  color: #08101f;
}

.fm-pill.is-W { background: #45c98a; }
.fm-pill.is-D { background: #d4ac48; }
.fm-pill.is-L { background: #e07272; }
.fm-pill.is-P { background: #8e9ab8; }
.fm-pill.is-O { background: #6fa8e8; }
.fm-pill.is-U { background: #a98edd; }
.fm-pill.is-none { background: #303a52; color: #93a3c4; }

.fm-tagx {
  display: inline-block;
  font-size: 10.5px;
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid var(--b5-line, #263149);
  color: var(--b5-dim, #93a3c4);
}

.fm-tagx.is-league { border-color: rgba(91, 140, 255, .5); color: #b9cfff; }

/* ── 未来赛程 ─────────────────────────────────────────────────────────── */
.fm-fx { display: flex; flex-direction: column; gap: 7px; }

.fm-fx-row {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  font-size: 13px;
  padding: 7px 10px;
  background: rgba(255, 255, 255, .03);
  border: 1px solid var(--b5-line, #263149);
  border-radius: 8px;
}

.fm-fx-date { color: var(--b5-dim, #93a3c4); font-variant-numeric: tabular-nums; font-size: 12px; }

/* ── 方法论说明 ───────────────────────────────────────────────────────── */
.fm-method { font-size: 13px; line-height: 1.78; color: #c3cee6; }
.fm-method p { margin: 0 0 9px; }
.fm-method strong { color: #e8eefc; }
.fm-method code {
  background: rgba(255, 255, 255, .07);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 12px;
}
.fm-method ul { margin: 0 0 9px; padding-left: 20px; }
.fm-method li { margin-bottom: 5px; }

.fm-roadmap {
  margin-top: 10px;
  padding: 11px 13px;
  border: 1px dashed rgba(91, 140, 255, .4);
  border-radius: 9px;
  background: rgba(91, 140, 255, .05);
  font-size: 12.5px;
  line-height: 1.7;
  color: #bfd0ee;
}

/* ── GM 专属刷新按钮 ───────────────────────────────────────────────────────
   仅 GM 层级可见。样式取克制路线:蓝色描边 + 深底,不用鲜艳渐变,
   避免在信息密集的卡头里抢视觉焦点。全部颜色取自 big5.css 既有变量。 */
.fm-refresh {
  flex: none;
  margin-left: auto;
  padding: 0.3rem 0.75rem;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--viz-home);
  background: rgba(111, 168, 232, 0.08);
  border: 1px solid rgba(111, 168, 232, 0.45);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.fm-refresh:hover:not(:disabled) {
  background: rgba(111, 168, 232, 0.16);
  border-color: rgba(111, 168, 232, 0.7);
}
.fm-refresh:focus-visible {
  outline: 2px solid var(--viz-home);
  outline-offset: 2px;
}
.fm-refresh:disabled {
  cursor: progress;
  opacity: 0.65;
}
/* 结果态:成功=绿,失败=红。仅描边与文字变色,不填充大块背景。 */
.fm-refresh[data-state="ok"] {
  color: var(--viz-good);
  border-color: rgba(78, 203, 78, 0.55);
  background: rgba(78, 203, 78, 0.1);
}
.fm-refresh[data-state="err"] {
  color: var(--viz-critical);
  border-color: rgba(238, 131, 130, 0.55);
  background: rgba(238, 131, 130, 0.1);
}
