* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #eef1f5;
  color: #1f2937;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand { display: flex; flex-direction: column; line-height: 1.15; }
.brand-main { margin: 0; font-size: 20px; font-weight: 800; color: #111827; }
.brand-sub { font-size: 12px; color: #6b7280; letter-spacing: 1px; }
.meta { display: flex; align-items: center; gap: 16px; font-size: 14px; color: #6b7280; }
.auto { cursor: pointer; user-select: none; }

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  padding: 16px 24px;
  max-width: 1200px;
  margin: 0 auto;
}
.filters[hidden] { display: none; }
.filters select {
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
  font-size: 14px;
  min-width: 120px;
}
.filters .all { font-size: 14px; color: #374151; cursor: pointer; }

.board {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px 40px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(360px, 100%), 1fr));
  gap: 18px;
}
.empty {
  text-align: center;
  color: #9ca3af;
  padding: 60px 0;
  font-size: 16px;
}

.activity-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(0,0,0,0.05);
}

.activity-head {
  position: relative;
  padding: 14px 16px;
  border-bottom: 1px solid #f1f3f5;
}
.a-title { font-size: 17px; font-weight: 700; color: #111827; }
.a-info { font-size: 13px; color: #6b7280; margin-top: 4px; }
.a-badge {
  position: absolute;
  top: 14px;
  right: 16px;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
}
.badge-ongoing { background: #dcfce7; color: #15803d; }
.badge-ended { background: #f3f4f6; color: #6b7280; }
.badge-pending { background: #eef2ff; color: #4f46e5; }

.matches { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(380px, 100%), 1fr)); gap: 12px; padding: 14px 6px; }
.match-card {
  position: relative;
  display: block;
  padding: 14px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-left: 6px solid #9ca3af;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(0,0,0,0.05);
}
.mc-head { display: flex; align-items: center; margin-bottom: 8px; }
.mc-body { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; }
.match-card.clickable { cursor: pointer; transition: background .15s; }
.match-card.clickable:hover { background: #f8fafc; }
.status-ongoing.match-card { background: linear-gradient(90deg, rgba(22,163,74,.05), rgba(22,163,74,.05)); border-left-color: #16a34a; }
.status-completed.match-card { border-left-color: #9ca3af; }
.status-pending.match-card { border-left-color: #d1d5db; }
.mc-side { display: flex; flex-direction: row; flex-wrap: nowrap; gap: 8px; min-width: 0; }
.mc-side.left { align-items: flex-start; text-align: right; justify-content: flex-end; }
.mc-side.right { align-items: flex-start; text-align: left; justify-content: flex-start; }
.mc-player { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 14px; font-weight: 600; color: #374151; min-width: 0; }
.mc-avatar { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; background: #e5e7eb; }
.mc-name { display: inline-block; max-width: 48px; line-height: 1.25; text-align: center; overflow-wrap: anywhere; word-break: break-all; }
.mc-name.winner { color: #16a34a; }
.mc-center { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.mc-score { font-size: 30px; font-weight: 800; display: flex; align-items: center; gap: 8px; color: #111827; flex-wrap: nowrap; white-space: nowrap; }
.mc-score .winner { color: #16a34a; }
.mc-score .colon { color: #9ca3af; font-weight: 400; }
.mc-pending { font-size: 15px; color: #9ca3af; }
.mc-sets { display: flex; flex-wrap: wrap; gap: 3px; justify-content: center; }
.mc-sets .set { font-size: 12px; color: #4b5563; background: #f3f4f6; border-radius: 7px; padding: 2px 6px; }
.mc-status { font-size: 12px; padding: 3px 10px; border-radius: 999px; }
.mc-mno { font-size: 12px; color: #6b7280; font-weight: 700; letter-spacing: .5px; }
.status-ongoing .mc-status { background: #dcfce7; color: #15803d; }
.status-completed .mc-status { background: #f3f4f6; color: #6b7280; }
.status-pending .mc-status { background: #eef2ff; color: #4f46e5; }
.no-match { padding: 14px 0; color: #9ca3af; font-size: 14px; text-align: center; }

/* 活动列表（主页） */
.act-list-item {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-left: 6px solid #9ca3af;
  border-radius: 14px;
  padding: 0;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(0,0,0,0.05);
  transition: background .15s;
}
.act-list-item:hover { background: #f8fafc; }
.act-list-item.act-ongoing { border-left-color: #16a34a; }
.act-list-item.act-ended { border-left-color: #9ca3af; }
.act-list-item.act-pending { border-left-color: #d1d5db; }
.act-list-foot { padding: 0 16px 14px; }
.act-list-count { font-size: 13px; color: #6b7280; }
.a-circle { display: flex; align-items: center; gap: 6px; margin-top: 5px; font-size: 13px; color: #374151; }
.a-circle-avatar { width: 18px; height: 18px; border-radius: 50%; object-fit: cover; background: #e5e7eb; }
.a-circle-name { font-weight: 600; color: #2563eb; }

/* 单活动对阵表（详情） */
.detail-card { grid-column: 1 / -1; }
.detail-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 2px 12px; gap: 10px; }
.back-btn {
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #2563eb;
  font-size: 14px;
  border-radius: 10px;
  padding: 8px 14px;
  cursor: pointer;
}
.back-btn:hover { background: #f8fafc; }

/* 实时比分详情弹层 */
.overlay { position: fixed; inset: 0; background: rgba(15,23,42,.55); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 20px; }
.overlay[hidden] { display: none; }
.md-card { background: #fff; border-radius: 18px; width: 100%; max-width: 460px; padding: 22px; position: relative; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.md-close { position: absolute; top: 12px; right: 14px; border: none; background: transparent; font-size: 20px; color: #9ca3af; cursor: pointer; line-height: 1; }
.md-title { text-align: center; font-size: 16px; font-weight: 700; color: #111827; margin-bottom: 18px; }
.md-body { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; }
.md-side { display: flex; flex-direction: row; flex-wrap: wrap; gap: 16px; }
.md-side.left { align-items: flex-end; text-align: right; justify-content: flex-end; }
.md-side.right { align-items: flex-start; text-align: left; justify-content: flex-start; }
.md-player { display: flex; flex-direction: column; align-items: center; gap: 5px; font-size: 18px; font-weight: 700; color: #374151; }
.md-avatar { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; background: #e5e7eb; }
.md-player.winner { color: #16a34a; }
.md-player > span { display: inline-block; max-width: 72px; line-height: 1.25; text-align: center; overflow-wrap: anywhere; word-break: break-all; }
.md-center { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.md-score { font-size: 46px; font-weight: 900; display: flex; align-items: center; gap: 12px; color: #111827; }
.md-score .winner { color: #16a34a; }
.md-score .colon { color: #9ca3af; font-weight: 400; }
.md-pending { font-size: 18px; color: #9ca3af; }
.md-sets { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.md-sets .set { font-size: 13px; color: #4b5563; background: #f3f4f6; border-radius: 8px; padding: 3px 10px; }
.md-foot { margin-top: 18px; text-align: center; font-size: 13px; color: #6b7280; display: flex; align-items: center; justify-content: center; gap: 6px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #16a34a; display: inline-block; animation: livePulse 1.2s infinite; }
@keyframes livePulse { 0%,100% { opacity: 1; } 50% { opacity: .3; } }
.md-open {
  display: block;
  margin: 16px auto 0;
  text-align: center;
  font-size: 14px;
  color: #fff;
  background: linear-gradient(135deg, #4ecdc4, #3b82f6);
  border-radius: 12px;
  padding: 12px 0;
  text-decoration: none;
  box-shadow: 0 6px 16px rgba(59,130,246,.25);
}
.md-open:active { opacity: .88; }

@media (max-width: 480px) {
  .board { grid-template-columns: 1fr; padding: 0 14px 32px; }
  .filters { padding: 14px; }
}

/* 实时比分页：手机端防溢出，队友仍并排 */
@media (max-width: 480px) {
  .sv-board { padding: 16px 8px; }
  .sv-mid { flex: 0 0 auto; min-width: 80px; padding: 0 2px; }
  .sv-score { font-size: 34px; }
  .sv-players { flex-wrap: nowrap; gap: 3px; }
  .sv-avatar { width: 40px; height: 40px; }
  .sv-name { max-width: 46px; font-size: 13px; }
  .sv-result-set { font-size: 14px; }
  .sv-result-sets { flex-wrap: wrap; }
}

/* 对阵列表：窄屏把球员适当缩小，保证队友并排且不溢出 */
@media (max-width: 480px) {
  .mc-avatar { width: 40px; height: 40px; }
  .mc-name { max-width: 40px; font-size: 13px; }
  .mc-side { gap: 6px; }
  .mc-sets { max-width: 84px; }
}
