:root {
  --bg: #eef3f8;
  --panel: #ffffff;
  --ink: #1a2636;
  --muted: #647386;
  --line: #b8c7d9;
  --line-soft: #d9e2ec;
  --head: #1e5f9e;
  --head-dark: #124b82;
  --tab: #e9f2fb;
  --league: #d7ebff;
  --live: #d91f2f;
  --finish: #286db6;
  --green: #0b7a4b;
  --warn: #f8efe2;
}

* { box-sizing: border-box; }
html { overflow-x: hidden; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  display: flex;
  flex-direction: column;
  font-family: Arial, "Microsoft Yahei", "PingFang SC", sans-serif;
  font-size: 12px;
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: inherit; }
h1, h2, h3, p { margin: 0; }
button, select, input { font: inherit; }
img { max-width: 100%; }
main { flex: 1 0 auto; }

.score-header {
  background: #0f477b;
  border-bottom: 1px solid #9fb6ce;
  color: #fff;
}

.score-header__top {
  background: linear-gradient(#2470af, #0f477b);
  border-bottom: 1px solid #073a69;
}

.score-header__channels {
  background: #f6f9fd;
  border-bottom: 1px solid #bed0e2;
  color: #173a5b;
}

.score-header__inner {
  align-items: center;
  display: flex;
  gap: 12px;
  margin: 0 auto;
  max-width: 1280px;
  min-width: 0;
  padding: 0 10px;
}

.score-header__inner--top {
  min-height: 48px;
}

.score-header__inner--channels {
  min-height: 34px;
}

.brand {
  align-items: center;
  display: flex;
  flex: 0 0 auto;
  gap: 7px;
  min-width: 162px;
  text-decoration: none;
}

.brand img {
  height: 30px;
  width: 30px;
}

.brand span {
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.main-nav {
  align-items: center;
  display: flex;
  flex: 1 1 auto;
  gap: 2px;
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.main-nav a {
  border-left: 1px solid rgba(255, 255, 255, .18);
  color: #eef7ff;
  display: inline-flex;
  font-size: 13px;
  font-weight: 700;
  justify-content: center;
  line-height: 1;
  min-width: 72px;
  padding: 17px 12px 16px;
  text-decoration: none;
  white-space: nowrap;
}

.main-nav a.active,
.main-nav a:hover {
  background: #fff;
  color: var(--head-dark);
}

.channel-nav {
  align-items: center;
  display: flex;
  flex: 1 1 auto;
  gap: 4px;
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.channel-nav a {
  border-right: 1px solid #d4e0eb;
  color: #244a70;
  display: inline-flex;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  padding: 10px 13px 9px;
  text-decoration: none;
  white-space: nowrap;
}

.channel-nav a:first-child {
  background: #e3f0fb;
  color: #0d4f87;
}

.channel-nav a:hover {
  background: #dbeafb;
  color: #0d4f87;
}

.channel-note {
  color: #6c7b8b;
  flex: 0 0 auto;
  white-space: nowrap;
}

.updated {
  color: #d7eafa;
  flex: 0 0 auto;
  text-align: right;
  white-space: nowrap;
}

.updated strong { color: #fff; }

.score-shell {
  margin: 0 auto;
  max-width: 1280px;
  padding: 8px 8px 24px;
  width: 100%;
}

.score-tools,
.score-panel,
.side-panel,
.article-page,
.article-list-item {
  background: var(--panel);
  border: 1px solid var(--line);
  min-width: 0;
}

.score-tools {
  margin-bottom: 8px;
}

.tool-line {
  align-items: center;
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  gap: 8px;
  min-height: 36px;
  padding: 5px 8px;
}

.tool-line:last-child { border-bottom: 0; }
.tool-line--compact { color: #33465c; flex-wrap: wrap; }
.tool-title { color: #183a5c; font-weight: 800; }
.muted { color: var(--muted); }

.segmented {
  align-items: center;
  display: inline-flex;
  gap: 4px;
}

.segmented button {
  background: var(--tab);
  border: 1px solid #9eb8d2;
  color: #173a5b;
  cursor: pointer;
  height: 25px;
  min-width: 58px;
  padding: 0 9px;
}

.segmented button.active,
.segmented button:hover {
  background: #195f9f;
  border-color: #0d4678;
  color: #fff;
  font-weight: 800;
}

.select-wrap {
  align-items: center;
  display: inline-flex;
  gap: 5px;
  margin-left: auto;
}

select {
  background: #fff;
  border: 1px solid #9eb8d2;
  color: var(--ink);
  height: 26px;
  max-width: 220px;
  padding: 0 24px 0 8px;
}

.summary-strip {
  align-items: center;
  background: #f8fbff;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 5px 8px;
}

.summary-strip span {
  background: #fff;
  border: 1px solid var(--line-soft);
  color: #33465c;
  min-width: 86px;
  padding: 4px 8px;
}

.summary-strip strong {
  color: #c51424;
  font-size: 14px;
}

.content-layout {
  align-items: start;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr);
}

.score-panel__head,
.side-head {
  align-items: center;
  background: linear-gradient(#f9fcff, #dbeafb);
  border-bottom: 1px solid var(--line);
  color: #183a5c;
  display: flex;
  justify-content: space-between;
  min-height: 30px;
  padding: 0 8px;
}

.score-panel__head strong,
.side-head strong {
  font-size: 14px;
}

.score-panel__head span {
  color: var(--muted);
}

.side-head a {
  color: #145b9d;
  font-weight: 700;
  text-decoration: none;
}

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.score-table {
  border-collapse: collapse;
  min-width: 900px;
  table-layout: fixed;
  width: 100%;
}

.score-table th {
  background: #f0f6fc;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line-soft);
  color: #27445f;
  font-weight: 800;
  height: 28px;
  text-align: center;
}

.score-table td {
  border-bottom: 1px solid #e2e8ef;
  border-right: 1px solid #edf1f5;
  height: 30px;
  padding: 4px 6px;
  text-align: center;
  vertical-align: middle;
}

.score-table tr:hover td {
  background: #fff8df;
}

.score-table .league-row td {
  background: var(--league);
  border-bottom-color: #abcce9;
  color: #164a78;
  font-weight: 800;
  height: 26px;
  text-align: left;
}

.league-count {
  color: var(--muted);
  font-weight: 400;
  margin-left: 8px;
}

.col-league { width: 92px; }
.col-time { width: 106px; }
.col-state { width: 72px; }
.col-team { width: 190px; }
.col-score { width: 82px; }
.col-half { width: 70px; }
.col-info { width: 72px; }

.cell-league {
  color: #285f95;
  font-weight: 700;
}

.cell-time {
  color: #46576a;
  white-space: nowrap;
}

.state-badge {
  color: #fff;
  display: inline-flex;
  font-weight: 800;
  justify-content: center;
  line-height: 19px;
  min-width: 48px;
  padding: 0 6px;
}

.state-badge.live { background: var(--live); }
.state-badge.finished { background: var(--finish); }
.state-badge.scheduled { background: #737f8c; }

.team-name {
  align-items: center;
  display: flex;
  gap: 5px;
  min-width: 0;
}

.team-name.home { justify-content: flex-end; }
.team-name.away { justify-content: flex-start; }

.team-name img {
  background: #f2f5f8;
  border: 1px solid #d7e0ea;
  height: 18px;
  object-fit: contain;
  width: 18px;
}

.team-name span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.score-value {
  color: #c91424;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0;
}

.score-value.pending {
  color: #6b7787;
  font-size: 13px;
}

.mobile-match-row {
  display: none;
}

.info-link {
  color: #145b9d;
  font-weight: 700;
  text-decoration: none;
}

.empty-cell,
.empty {
  color: var(--muted);
  padding: 18px;
  text-align: center;
}

.news-list {
  display: grid;
}

.news-panel-bottom {
  margin-top: 8px;
}

.news-panel-bottom .news-list {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.news-panel-bottom .site-note {
  text-align: center;
}

.news-card {
  border-bottom: 1px solid var(--line-soft);
  min-width: 0;
  padding: 9px 10px;
}

.news-card a {
  color: #1d2d42;
  display: block;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
  overflow: hidden;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.news-card a:hover { color: #145b9d; }

.news-card span,
.news-meta {
  color: var(--muted);
  display: block;
  font-size: 12px;
  margin-top: 5px;
}

.site-note {
  background: #fffdf4;
  border-top: 1px solid #ead8ad;
  color: #5d4a1a;
  line-height: 1.55;
  padding: 10px;
}

.site-note strong { display: block; margin-bottom: 4px; }

.back-link {
  color: #fff;
  font-size: 14px;
  text-decoration: none;
}

.article-page {
  margin: 12px auto 0;
  max-width: 860px;
  padding: clamp(20px, 4vw, 34px);
}

.article-page h2 {
  color: var(--ink);
  font-size: clamp(24px, 4vw, 34px);
  line-height: 1.3;
  margin: 14px 0 18px;
}

.article-page p {
  color: var(--ink);
  font-size: 16px;
  line-height: 1.8;
}

.article-origin {
  background: #195f9f;
  color: #fff;
  display: inline-flex;
  font-size: 15px;
  font-weight: 700;
  margin-top: 22px;
  padding: 12px 16px;
  text-decoration: none;
}

.article-page .article-note {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  margin-top: 28px;
  padding-top: 16px;
}

.article-hero {
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  margin: 12px 0 8px;
  min-width: 0;
  padding: 14px 16px;
}

.article-hero h2 {
  color: #173a5b;
  font-size: 20px;
  line-height: 1.25;
}

.article-hero span {
  background: #e3f0fb;
  border: 1px solid #b8cde1;
  color: #124b82;
  flex: 0 0 auto;
  font-weight: 800;
  padding: 5px 10px;
}

.article-list {
  display: grid;
  gap: 8px;
}

.article-list-item {
  padding: 18px;
}

.article-list-item h3 {
  font-size: 21px;
  line-height: 1.35;
  margin: 10px 0;
}

.article-list-item h3 a {
  color: var(--ink);
  text-decoration: none;
}

.article-list-item h3 a:hover { color: #145b9d; }

.article-list-item p {
  color: var(--ink);
  font-size: 15px;
  line-height: 1.75;
}

.site-footer {
  background: #e5edf5;
  border-top: 1px solid #b8c7d9;
  color: #5d6b7a;
  flex: 0 0 auto;
  line-height: 1.8;
  margin-top: 18px;
  padding: 18px 10px 22px;
  text-align: center;
  width: 100%;
}

.site-footer p {
  margin: 0 auto 6px;
  max-width: 980px;
}

.site-footer nav {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  justify-content: center;
  margin: 6px 0;
}

.site-footer a {
  color: #245f94;
  font-weight: 700;
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

@media (max-width: 900px) {
  .score-header__inner--top {
    align-items: stretch;
    flex-direction: column;
    gap: 7px;
    padding: 8px 6px 6px;
  }

  .brand {
    min-width: 0;
  }

  .main-nav {
    border-top: 1px solid rgba(255, 255, 255, .16);
    margin: 0 -6px;
    padding: 0 6px;
  }

  .main-nav a {
    border-left: 0;
    min-width: auto;
    padding: 11px 10px;
  }

  .updated {
    font-size: 12px;
    text-align: left;
  }

  .score-header__inner--channels { padding: 0 6px; }
  .channel-note { display: none; }
  .channel-nav a { padding: 10px 10px 9px; }

  .tool-line {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }

  .select-wrap {
    margin-left: 0;
    width: 100%;
  }

  select { max-width: none; width: 100%; }
  .content-layout { grid-template-columns: 1fr; }
  .score-panel,
  .side-panel,
  .score-tools {
    min-width: 0;
    width: 100%;
  }
  .side-panel { order: 2; }

  .news-panel-bottom .news-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .score-panel__head span {
    display: none;
  }

  .score-table {
    display: block;
    min-width: 0;
    width: 100%;
  }

  .score-table thead,
  .score-table tbody,
  .score-table tr,
  .score-table td {
    display: block;
  }

  .score-table thead {
    display: none;
  }

  .score-table tr {
    border-bottom: 1px solid #d7e2ed;
    position: relative;
  }

  .score-table .mobile-match-row {
    background: #fff;
    display: block !important;
  }

  .score-table .mobile-match-row td {
    border-right: 0;
    display: block !important;
    height: auto;
    padding: 8px;
    width: 100%;
  }

  .mobile-match-meta {
    align-items: center;
    color: #647386;
    display: grid;
    gap: 6px;
    grid-template-columns: minmax(0, 1fr) auto auto;
    line-height: 20px;
    margin-bottom: 5px;
  }

  .mobile-match-meta span:first-child {
    color: #285f95;
    font-weight: 800;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-match-meta b {
    color: #78889a;
    font-weight: 800;
    margin-right: 4px;
  }

  .mobile-state {
    align-items: center;
    display: inline-flex;
    justify-content: flex-end;
  }

  .mobile-state i {
    font-style: normal;
  }

  .mobile-match-main {
    align-items: center;
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(0, 1fr) 58px minmax(0, 1fr);
  }

  .mobile-team {
    min-width: 0;
  }

  .mobile-team em {
    color: #78889a;
    display: block;
    font-style: normal;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 4px;
    text-align: center;
  }

  .mobile-score {
    align-self: center;
    background: #fff5f5;
    border: 1px solid #f0c9cd;
    line-height: 26px;
    min-height: 28px;
    text-align: center;
  }

  .mobile-score-wrap {
    min-width: 0;
  }

  .mobile-score-wrap em {
    color: #78889a;
    display: block;
    font-style: normal;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 4px;
    text-align: center;
  }

  .mobile-match-main .team-name,
  .mobile-match-main .team-name.home,
  .mobile-match-main .team-name.away {
    justify-content: center;
  }

  .mobile-match-extra {
    border-top: 1px solid #edf1f5;
    color: #5f6f80;
    display: grid;
    gap: 6px;
    grid-template-columns: auto minmax(0, 1fr);
    line-height: 1.45;
    margin-top: 7px;
    padding-top: 7px;
    text-align: left;
  }

  .mobile-match-extra span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-match-extra b {
    color: #78889a;
    font-weight: 800;
    margin-right: 4px;
  }

  .team-name img {
    height: 16px;
    width: 16px;
  }

  .article-page,
  .article-list-item,
  .article-hero {
    padding: 14px;
  }
}

@media (max-width: 620px) {
  body {
    font-size: 12px;
  }

  .score-shell {
    padding: 6px 4px 16px;
    width: 100%;
  }

  .brand img {
    height: 26px;
    width: 26px;
  }

  .brand span {
    font-size: 16px;
  }

  .main-nav a,
  .channel-nav a {
    font-size: 12px;
  }

  .updated {
    display: none;
  }

  .segmented {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .segmented button {
    height: 30px;
    min-width: 0;
    width: 100%;
  }

  .summary-strip {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 6px;
  }

  .summary-strip span {
    align-items: center;
    display: flex;
    justify-content: space-between;
    min-width: 0;
    padding: 7px 8px;
    white-space: nowrap;
  }

  .score-panel__head,
  .side-head {
    min-height: 34px;
    padding: 6px 8px;
  }

  .tool-line--compact .muted {
    display: none;
  }

  .table-scroll {
    overflow-x: visible;
  }

  .score-table tr:not(.league-row) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 48px minmax(0, 1fr);
    grid-template-areas:
      "time state state"
      "home score away";
    gap: 0;
    padding: 5px 4px;
  }

  .score-table th,
  .score-table td {
    border: 0;
    height: 32px;
    padding: 4px;
  }

  .col-league { width: 1px; }
  .col-time { width: 52px; }
  .col-state { width: 40px; }
  .col-team { width: auto; }
  .col-score { width: 42px; }

  .score-table th:nth-child(1),
  .score-table td:nth-child(1),
  .score-table th:nth-child(7),
  .score-table th:nth-child(8),
  .score-table th:nth-child(9),
  .score-table td:nth-child(7),
  .score-table td:nth-child(8),
  .score-table td:nth-child(9) {
    display: none;
  }

  .score-table td:nth-child(2) {
    grid-area: time;
    color: #667789;
    height: 22px;
    text-align: left;
  }

  .score-table td:nth-child(3) {
    grid-area: state;
    height: 22px;
    text-align: right;
  }

  .score-table td:nth-child(4) {
    grid-area: home;
  }

  .score-table td:nth-child(5) {
    grid-area: score;
  }

  .score-table td:nth-child(6) {
    grid-area: away;
  }

  .score-table .league-row {
    display: block !important;
  }

  .score-table .league-row td {
    align-items: center;
    background: #d7ebff;
    color: #123f68;
    display: flex !important;
    font-size: 13px;
    font-weight: 900;
    height: auto;
    justify-content: space-between;
    line-height: 1.35;
    padding: 8px 10px;
    white-space: normal;
    width: 100%;
  }

  .league-count {
    color: #53687d;
    flex: 0 0 auto;
    font-size: 12px;
    margin-left: 8px;
  }

  .score-value {
    font-size: 14px;
  }

  .state-badge {
    font-size: 11px;
    min-width: 30px;
    padding: 0 4px;
  }

  .team-name {
    gap: 3px;
  }

  .team-name span {
    font-size: 12px;
  }

  .team-name.home,
  .team-name.away {
    justify-content: center;
    text-align: center;
  }

  .news-card a {
    white-space: normal;
  }

  .news-panel-bottom .news-list {
    grid-template-columns: 1fr;
  }

  .site-note {
    padding: 8px;
  }

  .article-hero {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .article-hero h2 {
    font-size: 18px;
  }

  .site-footer {
    margin-top: 10px;
    padding: 14px 10px 18px;
  }

  .site-footer p {
    text-align: left;
  }

  .site-footer nav {
    gap: 4px 12px;
  }
}

@media (max-width: 420px) {
  .score-table {
    min-width: 0;
    width: 100%;
  }

  .score-table tr:not(.league-row) {
    grid-template-columns: minmax(0, 1fr) 42px minmax(0, 1fr);
    padding: 5px 2px;
  }

  .col-time { width: 48px; }
  .col-state { width: 36px; }
  .col-score { width: 38px; }

  .team-name img {
    display: none;
  }

  .mobile-match-row .team-name img {
    display: block;
  }

  .cell-time {
    font-size: 10px;
    white-space: normal;
  }

  .team-name span {
    font-size: 11px;
  }

  .mobile-match-row .team-name span {
    font-size: 12px;
  }

  .mobile-match-main {
    gap: 5px;
    grid-template-columns: minmax(0, 1fr) 52px minmax(0, 1fr);
  }

  .mobile-match-extra {
    grid-template-columns: 1fr;
  }

  .main-nav,
  .channel-nav {
    scrollbar-width: none;
  }

  .main-nav::-webkit-scrollbar,
  .channel-nav::-webkit-scrollbar {
    display: none;
  }
}
