:root {
  --bg: #f3f5f8;
  --card: #fff;
  --text: #1f2933;
  --muted: #7b8794;
  --line: #e4e7eb;
  --brand: #0b7a4b;
  --brand-dark: #08583a;
  --live: #e12d39;
  --hd: #10241b;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.6 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--brand); }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* header */
.hd { background: var(--hd); color: #fff; position: sticky; top: 0; z-index: 10; }
.hd-in { display: flex; align-items: center; height: 54px; gap: 24px; }
.logo { font-size: 20px; font-weight: 700; letter-spacing: 1px; white-space: nowrap; }
.logo:hover { color: #fff; }
.nav { display: flex; gap: 4px; overflow-x: auto; }
.nav a { padding: 6px 12px; border-radius: 4px; color: rgba(255,255,255,.8); white-space: nowrap; }
.nav a:hover { color: #fff; background: rgba(255,255,255,.08); }
.nav a.on { color: #fff; background: var(--brand); }

.main { padding-top: 16px; padding-bottom: 24px; min-height: 60vh; }
.crumb { color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.crumb a:hover { color: var(--brand); }
.page-title { font-size: 22px; margin: 0 0 12px; }

/* box */
.box { background: var(--card); border-radius: 8px; margin-bottom: 16px; overflow: hidden; box-shadow: 0 1px 2px rgba(16,36,27,.05); }
.box-hd { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.box-hd h2 { margin: 0; font-size: 16px; border-left: 3px solid var(--brand); padding-left: 8px; line-height: 1.2; }
.more { color: var(--muted); font-size: 13px; }
.empty { color: var(--muted); text-align: center; padding: 32px 16px; margin: 0; }

/* match list */
.ml { list-style: none; margin: 0; padding: 0; }
.m + .m { border-top: 1px solid var(--line); }
.m-in { display: grid; grid-template-columns: 52px 110px 1fr 70px 1fr 64px; align-items: center; gap: 8px; padding: 12px 16px; }
.m-in:hover { background: #f7faf8; color: inherit; }
.m-time { font-weight: 600; font-variant-numeric: tabular-nums; }
.m-lg { color: var(--muted); font-size: 13px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.m-team { display: flex; align-items: center; gap: 8px; min-width: 0; }
.m-team .nm { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.m-home { justify-content: flex-end; text-align: right; }
.m-score { text-align: center; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.is-live .m-score { color: var(--live); }
.m-st { text-align: right; }
.tl { width: 24px; height: 24px; border-radius: 50%; object-fit: contain; flex: none; }
.tl-txt { display: inline-flex; align-items: center; justify-content: center; background: #e6f2ec; color: var(--brand); font-size: 12px; font-weight: 700; }
.tag { display: inline-block; font-style: normal; font-size: 12px; padding: 0 6px; border-radius: 3px; color: var(--muted); background: #f0f2f5; line-height: 20px; }
.tag-live { color: #fff; background: var(--live); }
.tag-ing { color: var(--live); background: #fde8ea; }

/* pager */
.pager { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 8px 0 16px; }
.pager a, .pager span { min-width: 36px; padding: 6px 10px; text-align: center; border-radius: 4px; background: var(--card); border: 1px solid var(--line); }
.pager .cur { background: var(--brand); border-color: var(--brand); color: #fff; }

/* detail */
.board { background: linear-gradient(135deg, #0d3b27, #10241b); color: #fff; border-radius: 8px; padding: 16px; margin-bottom: 16px; text-align: center; }
.board-meta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; font-size: 13px; color: rgba(255,255,255,.75); }
.board-meta .tag { background: rgba(255,255,255,.12); color: #fff; }
.board-meta .tag-ing { background: var(--live); }
.board-main { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; margin: 16px 0 8px; }
.board-team { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.board-team img { width: 64px; height: 64px; object-fit: contain; background: #fff; border-radius: 50%; padding: 6px; }
.board-team strong { font-size: 18px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-team small { color: rgba(255,255,255,.6); }
.big-txt { width: 64px; height: 64px; border-radius: 50%; background: rgba(255,255,255,.15); display: flex; align-items: center; justify-content: center; font-size: 26px; font-weight: 700; }
.board-score { font-size: 40px; font-weight: 800; font-variant-numeric: tabular-nums; padding: 0 12px; }
.board-title { font-size: 15px; font-weight: 400; color: rgba(255,255,255,.8); margin: 4px 0 0; }

.player { position: relative; background: #000; aspect-ratio: 16 / 9; width: 100%; }
.player iframe, .player video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
.player-tip { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #9aa5b1; padding: 16px; text-align: center; }
.srcs { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 16px 16px; }
.src { cursor: pointer; font: inherit; padding: 6px 14px; border-radius: 4px; border: 1px solid var(--brand); background: #fff; color: var(--brand); }
.src:hover { background: #e6f2ec; color: var(--brand); }
.src.on { background: var(--brand); color: #fff; }
.src-link i { font-style: normal; margin-left: 4px; }

.info { margin: 0; }
.info > div { display: flex; border-bottom: 1px solid var(--line); }
.info > div:last-child { border-bottom: 0; }
.info dt, .info dd { margin: 0; padding: 10px 16px; }
.info dt { flex: none; width: 110px; color: var(--muted); }
.info dd { flex: 1; min-width: 0; }

.nf { padding: 48px 16px; text-align: center; }
.nf a { color: var(--brand); }

.ft { color: var(--muted); font-size: 12px; text-align: center; padding: 24px 0 32px; }
.ft p { margin: 4px 0; }

@media (max-width: 720px) {
  .hd-in { gap: 12px; }
  .logo { font-size: 17px; }
  .m-in { grid-template-columns: 44px 1fr 56px 1fr; grid-template-areas: "time lg lg st" "time home score away"; row-gap: 4px; padding: 10px 12px; }
  .m-time { grid-area: time; }
  .m-lg { grid-area: lg; font-size: 12px; }
  .m-st { grid-area: st; }
  .m-home { grid-area: home; }
  .m-score { grid-area: score; }
  .m-away { grid-area: away; }
  .tl { width: 20px; height: 20px; }
  .board-score { font-size: 30px; }
  .board-team strong { font-size: 15px; }
  .board-team img, .big-txt { width: 52px; height: 52px; }
}

/* 比分刷新时闪一下（live.js 加 live-changed） */
@keyframes live-flash { 0%, 100% { background-color: transparent; } 50% { background-color: #FFE58F; } }
.live-changed { animation: live-flash 1s ease-in-out 3; border-radius: 4px; }

/* 完场后直播信号区的提示 */
.empty.ended { color: var(--text, #333); font-weight: 600; }

/* 比分列表（内置 score-row 等）配色 */
:root { --sc-accent: #0b7a4b; --sc-on: #fff; --sc-live: #e12d39; --sc-radius: 6px; }

/* 手机端：缩小字号和间距，队名放不下时换行，尽量完整显示 */
@media (max-width: 480px) {
  .m-in { grid-template-columns: 38px minmax(0, 1fr) 46px minmax(0, 1fr); column-gap: 6px; padding: 10px 8px; }
  .m-team { gap: 4px; }
  .m-team img { width: 16px; height: 16px; }
  .m-team .nm { font-size: 13px; white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; line-height: 1.3; }
}

/* 手机端：长队名不截断，换行完整显示 */
@media (max-width: 480px) {
  .board-team strong { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; line-height: 1.3; }
}

/* 热门比赛标记（后台设为热门或属于热门联赛），手机上只显示火苗 */
.m-fire { display: inline-flex; align-items: center; gap: 1px; margin-left: 4px; padding: 0 6px 0 4px; border-radius: 9px; background: linear-gradient(90deg, #ff8a1f, #ff3b30); color: #fff; font: normal 700 11px/17px -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; letter-spacing: 0; vertical-align: middle; white-space: nowrap; text-transform: none; animation: m-fire-glow 1.8s ease-in-out infinite; }
.m-fire::before { content: "🔥"; font-size: 11px; line-height: 1; }
@keyframes m-fire-glow { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 80, 30, .35); } 50% { box-shadow: 0 0 0 4px rgba(255, 80, 30, 0); } }
@media (max-width: 480px) {
  .m-fire { padding: 0 3px; font-size: 0; gap: 0; margin-left: 2px; }
  .m-fire::before { font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) { .m-fire { animation: none; } }

/* 热门比赛：火苗跳动；整行左侧一抹淡淡的火光缓慢明暗，叠在原有背景上，不改变原样式 */
.m-fire::before { display: inline-block; transform-origin: 50% 85%; animation: m-flicker 1.3s ease-in-out infinite; }
@keyframes m-flicker {
  0%, 100% { transform: scale(1) rotate(-4deg); filter: brightness(1); }
  25% { transform: scale(1.1, 1.2) rotate(3deg); filter: brightness(1.2); }
  50% { transform: scale(.95, 1.04) rotate(-2deg); filter: brightness(.95); }
  75% { transform: scale(1.06, 1.14) rotate(4deg); filter: brightness(1.15); }
}
.m-hotrow { animation: m-ember 3.2s ease-in-out infinite; }
@keyframes m-ember {
  0%, 100% { box-shadow: inset 3px 0 0 rgba(255, 98, 40, .7), inset 90px 0 70px -52px rgba(255, 140, 50, .16); }
  50% { box-shadow: inset 3px 0 0 rgba(255, 64, 30, .9), inset 130px 0 90px -60px rgba(255, 112, 40, .26); }
}
tr.m-hotrow { animation: none; }
tr.m-hotrow > td { animation: m-ember-td 3.2s ease-in-out infinite; }
tr.m-hotrow > td:first-child { box-shadow: inset 3px 0 0 rgba(255, 80, 30, .8); }
@keyframes m-ember-td { 0%, 100% { background-color: rgba(255, 150, 60, .05); } 50% { background-color: rgba(255, 120, 40, .11); } }
@media (prefers-reduced-motion: reduce) {
  .m-fire::before, .m-hotrow, tr.m-hotrow > td { animation: none; }
  .m-hotrow { box-shadow: inset 3px 0 0 rgba(255, 98, 40, .7), inset 90px 0 70px -52px rgba(255, 140, 50, .16); }
}

/* 播放页球队名链接到球队搜索页 */
.m-tlink { color: inherit; text-decoration: none; border-bottom: 1px dashed currentColor; }
.m-tlink:hover { opacity: .8; border-bottom-style: solid; }

/* 导航 5 项：手机上 logo 一行、导航一行，一屏放下 */
@media (max-width: 720px) {
  .hd-in { flex-wrap: wrap; height: auto; row-gap: 4px; padding-top: 8px; padding-bottom: 6px; }
  .nav { width: 100%; overflow: visible; gap: 2px; }
  .nav a { flex: 1 0 auto; padding: 6px 4px; font-size: 14px; text-align: center; }
}
/* 联赛名链接 */
.m-lg .hd-lg:hover { color: var(--brand); }
.m-md { white-space: nowrap; }
@media (max-width: 480px) { .m-in { grid-template-columns: 42px minmax(0, 1fr) 46px minmax(0, 1fr); } .m-time { font-size: 12px; } }

/* 热门标记：本模板专属样式（⚡ 热门），覆盖上面通用的 🔥 热门；手机上只显示图标 */
.m-fire { --m-hot-lb: 11px; gap: 2px; font-size: 0; background: linear-gradient(90deg,#0b7a4b,#19b36b); color: #fff; border: 0; border-radius: 3px; animation: m-hot-glow 1.8s ease-in-out infinite; }
.m-fire::before { content: "⚡"; display: inline-block; transform-origin: 50% 50%; animation: m-hot-ic 1.4s ease-in-out infinite; }
.m-fire::after { content: "热门"; font-size: var(--m-hot-lb); line-height: 1; }
@keyframes m-hot-glow { 0%, 100% { box-shadow: 0 0 0 0 rgba(11,122,75, .35); } 50% { box-shadow: 0 0 0 4px rgba(11,122,75, 0); } }
@keyframes m-hot-ic { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
@media (max-width: 480px) { .m-fire { --m-hot-lb: 0; gap: 0; } }
@media (prefers-reduced-motion: reduce) { .m-fire, .m-fire::before { animation: none; } }
