/* 03 Match detail。数值出自 README《03 Match detail》,与 Quvix Flow.dc.html:624-931 逐条核对。
 *
 * 这一屏的信息层级:先"这场球是什么样"(hero / 八轴对比 / 阵容 / xG / 比分),再"我押什么"(盘口)。
 * 但哪一半在上是**未定的 IA 问题** —— 顶部的 Comparison first / Markets first 分段器用 CSS order
 * 换序,先留成可配置的,等有真实使用数据再收口(README 明说 "keep it configurable until you settle it")。 */

.md__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.md__back {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-size: 11px;
  color: var(--muted);
  transition: color 0.14s;
}
.md__back:hover {
  color: var(--lime);
}
.md__layout {
  display: flex;
  align-items: center;
  gap: 8px;
}
.seg {
  display: flex;
  padding: 2px;
  background: var(--bar);
  border: 1px solid var(--border);
  border-radius: 5px;
}
.seg__btn {
  border: none;
  border-radius: 4px;
  padding: 6px 11px;
  cursor: pointer;
  font-size: 11.5px;
  font-weight: 500;
  background: none;
  color: var(--muted);
  transition: all 0.14s;
}
.seg__btn.is-active {
  background: var(--lime-bg);
  color: var(--lime);
}

/* ===== hero ===== */
.hero {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 22px;
  padding: 22px 24px;
  background: linear-gradient(180deg, var(--hover), var(--panel));
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 16px;
}
.hero__side {
  display: flex;
  align-items: center;
  gap: 14px;
}
.hero__side--away {
  justify-content: flex-end;
  text-align: right;
}
.hero__names {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.hero__names--away {
  align-items: flex-end;
}
.hero__team {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.hero__form {
  display: flex;
  align-items: center;
  gap: 8px;
}
.hero__mid {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.hero__league {
  font-size: 11px;
  color: var(--muted2);
  letter-spacing: 0.08em;
}
.hero__time {
  font-size: 17px;
  font-weight: 600;
}
.hero__lock {
  font-size: 10px;
  color: var(--muted2);
}

/* 队徽:用 background-image 而不是 <img> —— 各家 crest 长宽比不一,contain 居中能统一占位方框,
 * <img> 还得再套一层容器。缺图时降级成缩写方块(.crest--fallback)。 */
.crest {
  flex: none;
  display: block;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}
.crest--fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  background: var(--card3);
  border: 1px solid var(--border);
  font-weight: 600;
  color: var(--muted);
}

/* 战绩点:W/D/L 三态,15×15,radius 3。README《Form pips》 */
.pip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  border-radius: 3px;
  font-size: 9px;
  font-weight: 600;
}
.pip--w {
  color: var(--lime);
  background: var(--lime-bg);
}
.pip--d {
  color: var(--muted);
  background: var(--hair2);
}
.pip--l {
  color: var(--red);
  background: var(--red-bg);
}

/* ===== 两个可换序的大块 ===== */
.md__blocks {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.md__study,
.md__markets {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.md__markets {
  gap: 10px;
}
.md__blocks.is-comparison-first .md__study {
  order: 1;
}
.md__blocks.is-comparison-first .md__markets {
  order: 2;
}
.md__blocks.is-markets-first .md__study {
  order: 2;
}
.md__blocks.is-markets-first .md__markets {
  order: 1;
}

/* ===== 卡片外壳 ===== */
.card {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  overflow: hidden;
}
.card__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-soft);
}
.card__aside {
  font-size: 9.5px;
  color: var(--muted2);
}

/* ===== 八轴强度对比 ===== */
.cmp {
  display: grid;
  grid-template-columns: 336px minmax(0, 1fr);
  gap: 20px;
  padding: 14px 18px 16px;
}
.cmp__left {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
/* 89.3% = 300/336,把 SVG 的 viewBox 比例锁进盒子,轴标签才能按百分比定位对齐。 */
.radar {
  position: relative;
  width: 100%;
  padding-top: 89.3%;
}
.radar__svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
/* 🔴 轴标签是绝对定位的 <span> 而不是 SVG <text>(README 明确要求):<text> 会跟着 viewBox
 *    一起缩放,字号就不再是 10.5px 了;HTML span 才能保住排版字号与字族。 */
.radar__label {
  position: absolute;
  white-space: nowrap;
  font-size: 10.5px;
  color: var(--muted);
  pointer-events: none;
}
.cmp__legend {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
}
.cmp__legend-item {
  display: flex;
  align-items: center;
  gap: 7px;
}
.cmp__swatch {
  width: 11px;
  height: 11px;
  border-radius: 3px;
  flex: none;
}
.cmp__swatch--home {
  background: var(--lime);
}
.cmp__swatch--away {
  background: var(--blue);
}
.cmp__legend-name {
  font-size: 11px;
  color: var(--muted);
}
.cmp__note {
  font-size: 9.5px;
  line-height: 1.6;
  color: var(--muted2);
  text-align: center;
}

.cmp__bars {
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.statrow {
  display: grid;
  grid-template-columns: 48px 1fr 172px 1fr 48px;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid var(--hair2);
}
.statrow__val {
  font-size: 12.5px;
  font-weight: 600;
}
.statrow__val--h {
  text-align: right;
}
.statrow__val--a {
  text-align: left;
}
.statrow__label {
  font-size: 10.5px;
  color: var(--muted);
  text-align: center;
  line-height: 1.3;
}
.statrow__track {
  height: 6px;
  background: var(--card2);
  border-radius: 3px;
  display: flex;
  overflow: hidden;
}
/* 主队条从右往左长,客队从左往右 —— 两条向中间的标签生长,才读得出是同一项的对峙。 */
.statrow__track--h {
  justify-content: flex-end;
}
.statrow__fill {
  height: 100%;
  border-radius: 3px;
}

/* ===== xG + 模型比分 ===== */
.md__pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.panel {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  padding: 15px 18px 17px;
}
.xg__total {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 14px 0 16px;
}
.xg__num {
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.xg__cap {
  font-size: 11px;
  color: var(--muted);
}
.xg__rows {
  display: flex;
  flex-direction: column;
  gap: 11px;
}
.xg__row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.xg__team {
  font-size: 11px;
  color: var(--muted);
  width: 74px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.xg__track {
  flex: 1;
  height: 8px;
  background: var(--card2);
  border-radius: 4px;
  overflow: hidden;
}
.xg__fill {
  height: 100%;
  border-radius: 4px;
}
.xg__fill--home {
  background: var(--lime);
}
.xg__fill--away {
  background: var(--blue);
}
.xg__val {
  font-size: 13px;
  font-weight: 600;
}

.sc__rows {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: 15px;
}
.sc__row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.sc__score {
  font-size: 15px;
  font-weight: 600;
  width: 42px;
}
.sc__track {
  flex: 1;
  height: 8px;
  background: var(--card2);
  border-radius: 4px;
  overflow: hidden;
}
.sc__fill {
  height: 100%;
  border-radius: 4px;
  background: var(--lime-dim);
}
.sc__prob {
  font-size: 12px;
  color: var(--muted);
}
.sc__note {
  margin: 14px 0 0;
  font-size: 10.5px;
  line-height: 1.45;
  color: var(--muted2);
}

/* ===== 盘口 ===== */
.mk__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}
.mk__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.mk {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  padding: 14px 15px 15px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.mk__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}
.mk__title {
  font-size: 12.5px;
  font-weight: 600;
}
.mk__badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 3px;
  color: var(--muted);
  background: var(--chip-bg);
}
/* ≥ +3.0% 才点亮 —— 低于这条线的价差在抽水与滑点里就被吃掉了,点亮会误导。 */
.mk__badge.is-hot {
  color: var(--lime);
  background: var(--lime-bg);
}
.mk__sels {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.mk__note {
  font-size: 9.5px;
  color: var(--muted2);
}
.sel {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 7px 9px;
  background: var(--row);
  border: 1px solid var(--border2);
  border-radius: 6px;
  cursor: pointer;
  color: var(--text);
  transition: all 0.14s;
  text-align: left;
}
.sel:hover {
  border-color: var(--lime-dim);
  background: var(--card2);
}
.sel__name {
  font-size: 12px;
  font-weight: 500;
  width: 52px;
  text-align: left;
}
.sel__odds {
  font-size: 12px;
  font-weight: 600;
  width: 38px;
  text-align: right;
}

/* 概率条 —— 全产品的核心图形。
 * 填充条 = 模型概率;那根 1.5px 竖线 = 去水后的市场共识。条子越过竖线 = 市场给低了。
 * 🔴 竖线不能做成条子的一部分:它是**另一个来源**的读数,视觉上必须是独立标记,
 *    否则用户会读成"这段是模型多出来的",而不是"两个价的对照"。 */
.pbar {
  flex: 1;
  position: relative;
  height: 16px;
  background: var(--bar);
  border-radius: 2px;
  overflow: hidden;
}
.pbar__model {
  position: absolute;
  inset: 0 auto 0 0;
  background: var(--bar-fill);
}
.pbar__tick {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1.5px;
  background: var(--muted);
}
.pbar__pct {
  position: absolute;
  left: 6px;
  top: 1px;
  font-size: 10.5px;
  color: var(--text);
}


/* ===== Line movement 曲线块(2026-08-12,扫描器 2/3) ===== */
.mov {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 14px;
  background: var(--panel);
}
.mov__chart {
  width: 100%;
  height: 200px;
  display: block;
}
.mov__line {
  fill: none;
  stroke-width: 1.8;
  vector-effect: non-scaling-stroke;
}
.mov__ref {
  stroke-width: 1;
  stroke-dasharray: 4 4;
  opacity: 0.55;
  vector-effect: non-scaling-stroke;
}
.mov__line--a { stroke: var(--lime); }
.mov__line--b { stroke: var(--muted2); }
.mov__line--c { stroke: var(--red); }
.mov__swatch.mov__line--a { background: var(--lime); }
.mov__swatch.mov__line--b { background: var(--muted2); }
.mov__swatch.mov__line--c { background: var(--red); }
.mov__ko {
  stroke: var(--border-str2);
  stroke-dasharray: 2 3;
  vector-effect: non-scaling-stroke;
}
.mov__tick {
  font-size: 9px;
  fill: var(--muted2);
  font-family: "IBM Plex Mono", monospace;
}
.mov__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-top: 8px;
}
.mov__key {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
}
.mov__swatch {
  width: 10px;
  height: 3px;
  border-radius: 2px;
  display: inline-block;
}
.mov__edge {
  margin: 8px 0 0;
  font-size: 11.5px;
}
/* 图例项是可点按钮(单选项聚焦):去按钮默认皮,聚焦态描边 */
button.mov__key {
  border: 1px solid transparent;
  border-radius: 6px;
  background: none;
  padding: 3px 7px;
  cursor: pointer;
  color: var(--text);
  transition: background 0.14s;
}
button.mov__key:hover {
  background: var(--hover);
}
button.mov__key.is-active {
  border-color: var(--lime);
  background: var(--lime-bg2);
}
