/* ============================================================
   竞彩情报站 · 兼容层样式
   ------------------------------------------------------------
   base.html 模板（about / methodology / disclaimer）仍在使用旧类名。
   本文件把这些类按首页模板 v2.2 设计令牌等值重写，保证全站观感统一
   （2026-10-03 起令牌与视觉均对齐 v2.2，比赛搜索页已下线）。
   顺序：须在 site.css 之后加载。
   ============================================================ */

.t2 { font-size: 14px; }
.t3 { font-size: 14px; }
.t4 { font-size: 16px; font-weight: 600; }
.t5 { font-size: 20px; font-weight: 600; }
.t6 { font-size: 26px; font-weight: 700; }
.muted { color: hsl(var(--muted-foreground)); }
.ta-r { text-align: right; }
.ta-c { text-align: center; }
.ta-l { text-align: left; }

.c-win { color: hsl(var(--win)); }
.c-draw { color: hsl(var(--draw)); }
.c-lose { color: hsl(var(--lose)); }

/* ---- 卡片（对齐 v2.2：纯白圆角卡，无边框，靠画布色差分层） ---- */
.card { background: hsl(var(--card)); border: none; border-radius: 12px; padding: 20px 24px; margin-bottom: 24px; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid hsl(var(--border)); }
.page-title { font-size: 20px; font-weight: 700; margin: 8px 0 16px; }
.page-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 8px 0 16px; }
.empty { color: hsl(var(--muted-foreground)); padding: 24px 0; text-align: center; }

/* ---- 场次列表 ---- */
.badge-diff { background: hsl(var(--win)); color: #fff; border-radius: 6px; padding: 0 8px; font-weight: 600; }
.chip { background: hsl(var(--muted)); border-radius: 6px; padding: 0 8px; font-size: 12px; color: hsl(var(--muted-foreground)); white-space: nowrap; }
.chip-dan { background: hsl(var(--win)); color: #fff; }
.score-wrap { overflow-x: auto; }
.score-table { border-top: 1px solid hsl(var(--border)); min-width: 760px; }
.score-head, .score-row {
  display: grid; grid-template-columns: 96px 116px 64px minmax(0, 1fr) 80px minmax(0, 1fr) 100px 100px;
  gap: 8px; align-items: center;
}
.score-head { padding: 8px; font-size: 12px; color: hsl(var(--muted-foreground)); background: hsl(var(--muted) / .5); }
.score-row { padding: 12px 8px; border-top: 1px solid hsl(var(--border)); }
.score-row:hover { background: hsl(var(--muted) / .3); }
.cell-league { display: flex; flex-direction: column; line-height: 1.35; min-width: 0; }
.jc-no { font-style: normal; font-size: 12px; color: hsl(var(--muted-foreground)); white-space: nowrap; }
.row-time { font-size: 16px; font-weight: 500; white-space: nowrap; }
.row-status { font-size: 12px; }
.st-live { font-weight: 600; }
.team-cell { font-size: 16px; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.score-cell { font-size: 16px; font-weight: 700; }
.row-metric { font-size: 12px; }

/* ---- 联赛 / 磁贴 ---- */
.empty-leagues { margin-top: 16px; }
.league-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.league-card { border: 1px solid hsl(var(--border)); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 4px; }
.league-card:hover { border-color: hsl(var(--brand)); background: hsl(var(--muted) / .4); }
.lib-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 12px; }
.lib-tile { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 4px; border-radius: 10px; border: 1px solid transparent; }
.lib-tile:hover { border-color: hsl(var(--border)); background: hsl(var(--muted) / .4); }
.lib-mark { width: 44px; height: 44px; border-radius: 6px; background: hsl(var(--muted)); display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: 14px; }
.lib-count { font-size: 10px; }

/* ---- 积分榜（旧表格） ---- */
.standings-panel { margin-top: 12px; }
.panel-meta { margin-bottom: 8px; }
.st-table { border: 1px solid hsl(var(--border)); border-radius: 6px; overflow: hidden; }
.st-head, .st-row { display: grid; grid-template-columns: 64px minmax(0, 1fr) 72px; gap: 8px; padding: 4px 12px; align-items: center; }
.st-head { background: hsl(var(--muted) / .5); font-size: 12px; color: hsl(var(--muted-foreground)); }
.st-row { border-top: 1px solid hsl(var(--border)); }
.st-rank { display: inline-flex; align-items: center; gap: 4px; color: hsl(var(--muted-foreground)); }
.st-team { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zone-dot { display: inline-block; width: 4px; height: 14px; border-radius: 999px; flex: none; }
.st-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 8px; }
.st-legend span { display: inline-flex; align-items: center; gap: 4px; }
.st-row:nth-child(2) .st-rank { color: hsl(var(--win)); font-weight: 700; }
.st-row:nth-child(3) .st-rank, .st-row:nth-child(4) .st-rank { color: hsl(var(--foreground)); font-weight: 700; }

/* ---- 比赛详情 ---- */
.match-hero-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.status-badge { border-radius: 999px; padding: 1px 8px; font-size: 12px; background: hsl(var(--muted)); color: hsl(var(--muted-foreground)); }
.st-scheduled { background: hsl(var(--brand) / .12); color: hsl(var(--brand)); }
.st-finished { background: hsl(var(--muted)); }
.match-vs { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; padding: 12px 0; }
.side { text-align: center; }
.team-name { font-size: 26px; font-weight: 700; }
.vs-mid { text-align: center; }
.vs .score { font-size: 26px; font-weight: 700; }
.market-block { border-top: 1px solid hsl(var(--border)); padding: 12px 0; }
.market-title { margin-bottom: 8px; }
.odds-table { width: 100%; border-collapse: collapse; }
.odds-table th, .odds-table td { text-align: left; padding: 4px 8px; border-bottom: 1px solid hsl(var(--border)); }
.odds-table thead th { font-size: 12px; color: hsl(var(--muted-foreground)); background: hsl(var(--muted) / .5); }
.odds-table tbody th { font-weight: 600; white-space: nowrap; }
.support-row { display: flex; gap: 24px; flex-wrap: wrap; }
.sup-cell { display: flex; flex-direction: column; gap: 2px; }
.payload { background: hsl(var(--muted) / .5); border: 1px solid hsl(var(--border)); border-radius: 6px; padding: 8px 12px; font-size: 12px; overflow-x: auto; font-family: ui-monospace, Consolas, monospace; white-space: pre-wrap; word-break: break-all; max-height: 320px; overflow-y: auto; }

/* ---- 长文 ---- */
.prose p, .prose li { margin-bottom: 8px; }
.prose h2 { margin: 16px 0 8px; }
.prose a { color: hsl(var(--brand)); font-weight: 600; }
.prose a:hover { text-decoration: underline; }
.prose ul, .prose ol { padding-left: 24px; margin: 8px 0; }

@media (max-width: 720px) {
  .match-vs { grid-template-columns: 1fr; text-align: center; }
  .lib-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ============================================================
   比赛详情页（.md-* 类名体系）
   ------------------------------------------------------------
   头部卡 + 五页签；主内容区留空待填。
   数值与 site.css 的 --hm-radius / 间距体系对齐（4/8/12/16/24）。
   ============================================================ */
.md-root { --md-radius: 4px; --md-badge: 44px; --md-card-radius: 12px; }

/* ---- 头部卡外壳 ---- */
.md-head {
  border: 1px solid hsl(var(--border));
  border-radius: var(--md-radius);
  background: hsl(var(--card));
  overflow: hidden;
}

/* ---- 顶部信息条 ---- */
.md-head-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  min-height: 44px; padding: 8px 16px;
  border-bottom: 1px solid hsl(var(--border));
}

/* ---- 比分行：队徽 · 队名 · 比分 ---- */
.md-head-vs {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center; gap: 16px;
  padding: 24px 40px;
}
.md-team { display: flex; flex-direction: column; align-items: center; gap: 10px; min-width: 0; }
.md-team-badge {
  display: block; width: var(--md-badge); height: var(--md-badge); flex: none;
  border: 1px solid hsl(var(--border)); border-radius: 50%;
  background: hsl(var(--muted));
}
.md-team-badge img {
  display: block; width: 100%; height: 100%;
  border-radius: 50%; object-fit: contain;
}
.md-team-name {
  font-size: 20px; font-weight: 600; line-height: 28px;
  text-align: center; max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* 比分行中列：比分数字分列「VS + 状态徽章」竖排块两侧。
   justify-content:center：容器宽于内容时（移动端单列布局）auto 轨道不再吸收自由空间，
   数字贴边散开 → 三列收紧整体居中。 */
.md-score {
  display: grid; grid-template-columns: auto auto auto;
  align-items: center; justify-content: center; column-gap: 16px;
}
.md-score-mid { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.md-score-num {
  font-size: 30px; font-weight: 700; line-height: 1;
  font-variant-numeric: tabular-nums; letter-spacing: 1px;
}
.md-score-vs { color: hsl(var(--muted-foreground)); font-size: 26px; }
.md-score-state {
  display: inline-flex; align-items: center; height: 22px; padding: 0 10px;
  border-radius: var(--md-radius); background: hsl(var(--muted));
  font-size: 12px; line-height: 1; color: hsl(var(--muted-foreground));
  white-space: nowrap;
}

/* ---- 五页签 ---- */
.md-tabs { display: grid; grid-template-columns: repeat(5, 1fr); border-top: 1px solid hsl(var(--border)); }
.md-tab {
  min-width: 0; height: 46px;
  display: inline-flex; align-items: center; justify-content: center;
  /* padding-top 2px：补偿 line-height:1 下中文字体度量盒（ascent/descent）不对称
     造成的视觉偏上（实测文字盒 padTop12/padBottom15 → 修正后 13.5/13.5）。 */
  padding: 2px 8px 0; margin: 0; cursor: pointer; font-family: inherit;
  font-size: 14px; line-height: 1; white-space: nowrap;
  color: hsl(var(--muted-foreground));
  background: hsl(var(--card)); border: 0; border-bottom: 2px solid transparent;
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.md-tab + .md-tab { border-left: 1px solid hsl(var(--border)); }
.md-tab:hover { color: hsl(var(--brand)); }
.md-tab[aria-selected="true"] { color: hsl(var(--brand)); font-weight: 600; border-bottom-color: hsl(var(--brand)); background: hsl(var(--brand) / .04); }

/* ---- 主内容区（留空容器） ---- */
.md-main { margin-top: 16px; }
.md-panel[hidden] { display: none; }
.md-panel:not([hidden]) { display: block; }

/* 面板内通用卡片（2026-09-26 定稿）：单层**纯白圆角卡**，无边框、无投影。
   页面画布浅灰（--background），白卡靠色差自然分层；
   比赛头部 .md-head 仍用 --md-radius(4px) 白底细边，不随本卡变化。 */
.md-card {
  background: hsl(var(--card));
  border-radius: var(--md-card-radius);
  overflow: hidden;
}
.md-card + .md-card { margin-top: 16px; }
.md-card-header {
  display: flex; align-items: center; justify-content: space-between;
  height: 48px; padding: 0 16px; border-bottom: 1px solid hsl(var(--border));
}
.md-card-header h2 {
  font-size: 15px; font-weight: 600; line-height: 1.2;
  padding-left: 12px; border-left: 3px solid hsl(var(--brand));
}
.md-card-body { padding: 16px; }
.md-empty {
  padding: 48px 16px; text-align: center;
  font-size: 13px; color: hsl(var(--muted-foreground));
}

/* ---- 页脚返回 ---- */
.md-foot { margin: 16px 0 24px; font-size: 14px; }
.md-back { color: hsl(var(--brand)); }
.md-back:hover { text-decoration: underline; }

@media (max-width: 720px) {
  .md-head-vs { grid-template-columns: 1fr; gap: 12px; padding: 16px; }
  .md-team { flex-direction: row; justify-content: center; gap: 8px; }
  .md-team-badge { width: 32px; height: 32px; }
  .md-team-name { font-size: 17px; line-height: 24px; }
  .md-tabs { grid-template-columns: repeat(5, minmax(88px, 1fr)); overflow-x: auto; }
  .md-tab { padding: 2px 14px 0; }
}
