/* 比赛、赛果：左侧筛选 + 右侧按日期分组的列表 */
.schedule-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: var(--site-gap);
  align-items: start;
}

.schedule-side {
  position: sticky;
  top: calc(var(--header-h) + var(--space-lg));
  display: flex;
  flex-direction: column;
  gap: var(--site-gap);
  min-width: 0;
}

.schedule-main { min-width: 0; }
.results-list-panel { display: flex; flex-direction: column; gap: var(--site-gap); }

/* 左侧筛选 */
.filter-nav { display: flex; flex-direction: column; padding: var(--space-xs) 0 var(--space-sm); }

.filter-nav a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  min-height: 36px;
  padding: 6px var(--space-lg);
  color: var(--text-secondary);
  font-size: var(--font-sm);
  transition: background var(--transition-fast), color var(--transition-fast);
}

.filter-nav a:hover { color: var(--text-primary); background: var(--bg-hover); }
.filter-nav a.active { color: var(--accent); background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); font-weight: 500; }
/* 赛事筛选每一项：名称占满一行，日期小字放在下面（以前名称和日期挤在一行，侧栏一窄名称就只剩几个字） */
.filter-nav a:has(.match-filter-date) { flex-direction: column; align-items: flex-start; justify-content: center; gap: 1px; }
.filter-nav a .match-filter-name { max-width: 100%; }
.filter-nav-label { padding: var(--space-sm) var(--space-lg) 2px; color: var(--text-muted); font-size: var(--font-xs); font-weight: 600; }
.match-filter-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.match-filter-date { flex: 0 0 auto; color: var(--text-muted); font-size: var(--font-xs); }

/* 日历 */
.match-calendar { padding: var(--space-xs) var(--space-md) var(--space-md); }
.match-calendar-head { display: flex; align-items: center; justify-content: space-between; height: 44px; }

.match-calendar-head a {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  font-size: 20px;
  line-height: 1;
}

.match-calendar-head a:hover { color: var(--text-primary); background: var(--bg-hover); }
.match-calendar-head strong { font-size: var(--font-md); }
.match-calendar-weekdays, .match-calendar-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; }
.match-calendar-weekdays span { padding: 4px 0; color: var(--text-muted); font-size: 10px; text-align: center; }
.match-calendar-days { display: grid; gap: 2px; }

.match-calendar-week a {
  height: 32px;
  display: grid;
  place-items: center;
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  font-size: var(--font-sm);
  font-variant-numeric: tabular-nums;
  transition: background var(--transition-fast);
}

.match-calendar-week a:hover { color: var(--text-primary); background: var(--bg-hover); }
.match-calendar-week a.muted { color: var(--text-muted); opacity: .6; }
.match-calendar-week a.today { color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); font-weight: 600; }
.match-calendar-week a.active { color: var(--accent-contrast); background: var(--accent); font-weight: 600; }

.match-calendar-clear {
  display: block;
  margin-top: var(--space-sm);
  padding: 7px;
  color: var(--text-secondary);
  background: var(--surface-soft);
  border-radius: var(--radius-md);
  font-size: var(--font-sm);
  text-align: center;
}

.match-calendar-clear:hover { color: var(--text-primary); }
.mobile-match-event-filter, .mobile-result-event-filter { display: none; }

/* 日期分组小标题 */
.schedule-day-head {
  padding: 7px var(--space-lg);
  color: var(--text-secondary);
  background: var(--surface-soft);
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  font-size: var(--font-xs);
  font-weight: 600;
}

.match-schedule-list > .schedule-day-head:first-child,
.result-list > .schedule-day-head:first-child { border-top: 0; }
.schedule-day-head.live { color: var(--live); }
.result-time { white-space: nowrap; word-break: keep-all; }  /* 赛果日期一行写完，不折行 */

/* 比赛行：时间 | 两支队伍 | 赛事 */
.match-schedule-row {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) minmax(0, 240px);
  align-items: center;
  gap: var(--space-lg);
  padding: 10px var(--space-lg);
  color: var(--text-primary);
  border-top: 1px solid var(--border-color);
  transition: background var(--transition-fast);
}

.schedule-day-head + .match-schedule-row { border-top: 0; }
.match-schedule-row:hover { color: var(--text-primary); background: var(--bg-hover); }
.match-schedule-time { display: grid; justify-items: start; gap: 4px; }
.match-time-text { font-size: var(--font-lg); font-weight: 600; font-variant-numeric: tabular-nums; }

.match-bo,
.result-bo {
  padding: 1px 6px;
  color: var(--text-muted);
  background: var(--surface-soft);
  border-radius: var(--radius-sm);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
}

.match-schedule-teams { display: grid; gap: 6px; min-width: 0; }
.match-schedule-team { display: flex; align-items: center; gap: var(--space-sm); min-width: 0; }
.match-schedule-team .team-name { overflow: hidden; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.match-schedule-meta { display: grid; justify-items: end; gap: 2px; min-width: 0; text-align: right; }
.match-schedule-event { max-width: 100%; overflow: hidden; color: var(--text-secondary); font-size: var(--font-sm); text-overflow: ellipsis; white-space: nowrap; }
.match-schedule-date { color: var(--text-muted); font-size: var(--font-xs); }

/* 赛果行：队伍1 比分 队伍2 | 赛事 | 赛制 */
.result-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 200px) 44px;
  align-items: center;
  gap: var(--space-lg);
  min-height: 48px;
  padding: 6px var(--space-lg);
  color: var(--text-primary);
  border-top: 1px solid var(--border-color);
  transition: background var(--transition-fast);
}

.schedule-day-head + .result-row { border-top: 0; }
.result-row:hover { color: var(--text-primary); background: var(--bg-hover); }
.result-score-group { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: var(--space-md); min-width: 0; }
.result-team-cell { display: flex; align-items: center; gap: var(--space-sm); min-width: 0; }
.result-team-cell.team-left { justify-content: flex-end; text-align: right; }
.result-team-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result-team-name.won { font-weight: 600; }
.result-team-name.lost { color: var(--text-muted); }

.result-big-score {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 64px;
  height: 30px;
  padding: 0 10px;
  background: var(--surface-soft);
  border-radius: var(--radius-md);
  font-size: var(--font-lg);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.result-win { color: var(--color-green); }
.result-lose { color: var(--color-red); }
.result-score-colon { color: var(--text-muted); font-weight: 400; }
.result-event { overflow: hidden; color: var(--text-muted); font-size: var(--font-xs); text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.result-bo { justify-self: end; }

/* 横屏平板、中等窗口：信息不掉行——赛事、日期仍在每行右边，只是那一栏窄一点（以前这里会掉到队名下面、居中，左边空一大块） */
@media (max-width: 1080px) {
  .schedule-layout { grid-template-columns: 220px minmax(0, 1fr); }
  .match-schedule-row { grid-template-columns: 70px minmax(0, 1fr) minmax(0, 170px); gap: var(--space-md); }
  .result-row { grid-template-columns: minmax(0, 1fr) minmax(0, 150px) 40px; gap: var(--space-md); }
}

/* 竖屏平板（761–960）：比赛页保留日历侧栏，收窄到 200px；
   赛果页左边只有赛事筛选，换成列表上方的下拉框（和手机同一个），列表占满宽度，队名不会被挤成几个字 */
@media (max-width: 960px) {
  .schedule-layout { grid-template-columns: 200px minmax(0, 1fr); }
  .schedule-layout.results-schedule-layout { grid-template-columns: minmax(0, 1fr); }
  .results-schedule-layout .results-filter-sidebar { display: none; }

  .mobile-result-event-filter {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    color: var(--text-muted);
    font-size: var(--font-sm);
  }

  .mobile-result-event-filter label { flex: 0 0 auto; white-space: nowrap; }
  .mobile-result-event-filter select { flex: 1 1 0; min-width: 0; max-width: 360px; }
}

@media (max-width: 760px) {
  .schedule-layout { grid-template-columns: minmax(0, 1fr); }
  .schedule-side { position: static; }
  .match-side-panel, .results-filter-sidebar { display: none; }

  /* 手机上日历只留当前这一周，翻月按钮和赛事下拉做成好点的大小 */
  .match-calendar-week:not(.is-current) { display: none; }
  .match-calendar-head a { width: 44px; height: 44px; }
  .match-calendar-clear { margin-top: var(--space-sm); }

  .mobile-match-event-filter,
  .mobile-result-event-filter {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-top: var(--space-sm);
    color: var(--text-muted);
    font-size: var(--font-sm);
  }

  .mobile-match-event-filter label,
  .mobile-result-event-filter label {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .mobile-match-event-filter select,
  .mobile-result-event-filter select {
    flex: 1 1 0;
    min-width: 0;
    height: 42px;
    font-size: var(--font-md);
  }

  .match-schedule-row { grid-template-columns: 60px minmax(0, 1fr); gap: var(--space-md); padding: 10px var(--space-md); }
  /* 手机：赛事和日期放在队名下面、靠左，和队名对齐 */
  .match-schedule-meta { grid-column: 2; justify-items: start; text-align: left; }
  .match-time-text { font-size: var(--font-md); }
  .schedule-day-head { padding: 7px var(--space-md); }

  .result-row { grid-template-columns: minmax(0, 1fr) auto; gap: 4px var(--space-sm); padding: 8px var(--space-md); }
  .result-score-group { grid-column: 1 / -1; gap: var(--space-sm); }
  .result-big-score { min-width: 54px; height: 28px; font-size: var(--font-md); }
  .result-event { grid-column: 1; grid-row: 2; text-align: left; }
  .result-bo { grid-column: 2; grid-row: 2; }
}
