@import url('https://fonts.googleapis.com/css2?family=Baloo+2:wght@600;700&family=Quicksand:wght@400;600;700&display=swap');

:root {
  --sun: #FF9F43;
  --dream: #6C5CE7;
  --cream: #FFF9F0;
  --bubble: #00D2D3;
}

body.s3-body {
  margin: 0;
  font-family: 'Quicksand', sans-serif;
  background: var(--cream);
  color: #444;
  line-height: 1.6;
  overflow-x: hidden;
  max-width: 100%;
}

html { overflow-x: hidden; }

h1, h2, h3, .s3-display {
  font-family: 'Baloo 2', cursive;
  font-weight: 700;
}

.s3-header {
  background: linear-gradient(135deg, var(--sun), var(--dream));
  padding: 16px 0;
}

.s3-header-inner {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  box-sizing: border-box;
}

.s3-logo a {
  font-family: 'Baloo 2', cursive;
  font-size: 1.8rem;
  color: #fff;
  text-decoration: none;
}

.s3-nav {
  display: flex;
  gap: 16px;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}

.s3-nav a {
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  background: rgba(255,255,255,0.2);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.9rem;
}

.s3-nav a:hover { background: rgba(255,255,255,0.35); }

.s3-parent-ctrl {
  background: var(--bubble);
  color: #fff;
  text-align: center;
  padding: 8px;
  font-size: 0.8rem;
}

.s3-courses {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 16px 0;
  box-sizing: border-box;
}

.s3-courses h2 {
  color: var(--dream);
  font-size: 1.6rem;
  margin-bottom: 16px;
}

.s3-course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
}

.s3-course-card {
  background: #fff;
  border-radius: 20px;
  padding: 20px;
  text-align: center;
  text-decoration: none;
  color: inherit;
  border: 3px solid var(--sun);
  transition: transform 0.2s;
}

.s3-course-card:hover { transform: scale(1.03); }

.s3-course-icon {
  font-size: 2.5rem;
  margin-bottom: 8px;
}

.s3-course-card h3 {
  margin: 0;
  font-size: 1.1rem;
  color: var(--dream);
}

.s3-main {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 16px;
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 24px;
  box-sizing: border-box;
}

.s3-main > div {
  min-width: 0;
}

.s3-main > aside {
  min-width: 280px;
}

.s3-h1-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.s3-h1-row h1 { margin: 0; font-size: 1.6rem; color: var(--sun); }
.s3-body .site-subtitle { color: var(--dream); font-family: 'Quicksand', sans-serif; font-size: 0.95rem; }

.s3-timeline {
  background: #fff;
  border-radius: 20px;
  padding: 20px;
  border: 2px dashed var(--bubble);
}

.s3-timeline h2 { color: var(--sun); font-size: 1.3rem; margin: 0 0 16px; }

.s3-timeline-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-left: 3px solid var(--dream);
  margin-left: 8px;
  padding-left: 16px;
  text-decoration: none;
  color: inherit;
}

.s3-timeline-date {
  font-size: 0.75rem;
  color: var(--bubble);
  font-weight: 700;
  min-width: 70px;
}

.s3-badges {
  background: #fff;
  border-radius: 20px;
  padding: 20px;
  border: 2px solid var(--dream);
}

.s3-badges h2 { color: var(--dream); font-size: 1.2rem; margin: 0 0 12px; }

.s3-badge-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.s3-badge {
  background: var(--cream);
  border-radius: 12px;
  padding: 12px;
  text-align: center;
  text-decoration: none;
  color: inherit;
  font-size: 0.8rem;
}

.s3-badge-emoji { font-size: 1.8rem; display: block; margin-bottom: 4px; }

.s3-calendar {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 0 16px 32px;
  box-sizing: border-box;
}

.s3-calendar-box {
  background: #fff;
  border-radius: 20px;
  padding: 20px;
  border: 3px solid var(--bubble);
}

.s3-calendar-box h2 { color: var(--bubble); margin: 0 0 12px; font-size: 1.3rem; }

.s3-cal-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  text-align: center;
}

.s3-cal-day {
  padding: 10px 4px;
  border-radius: 10px;
  font-size: 0.85rem;
  background: var(--cream);
}

.s3-cal-day.active { background: var(--sun); color: #fff; font-weight: 700; }

.s3-footer {
  background: var(--dream);
  color: #fff;
  text-align: center;
  padding: 28px 20px;
  width: 100%;
}

.s3-footer .container { width: 100%; max-width: 1200px; margin: 0 auto; text-align: center; }
.s3-footer p { text-align: center; margin: 5px 0; }
.s3-footer a { color: var(--sun); }

.s3-footer.footer-wrapper,
.s3-footer .footer-desc,
.s3-footer p { text-align: center; }
.s3-body .position { background: var(--cream); }
.s3-body .lmtit .lmname { font-family: 'Baloo 2', cursive; color: var(--sun); }
.s3-body .bgwhite, .s3-body .main { background: #fff; border-radius: 16px; }

.s3-body .match_filter_item.on a,
.s3-body .match_filter_item.active a { background: var(--sun) !important; color: #fff !important; }
.s3-body .info_right.start a { background: var(--bubble) !important; color: #fff !important; }

.s3-page-bar { display: flex; align-items: center; width: 100%; margin-bottom: 12px; }
.s3-page-bar h1 { margin: 0; font-size: 1.5rem; color: var(--sun); }

/* 修复 a3.css 固定宽度导致横向滚动，同时保持桌面端横向布局 */
.s3-body .container {
  width: 100% !important;
  max-width: 1200px;
  padding: 0 16px;
  box-sizing: border-box;
}

.s3-body .container.flex-between {
  display: flex;
  flex-wrap: nowrap;
  gap: 20px;
  align-items: flex-start;
  justify-content: space-between;
}

.s3-body .match_list,
.s3-body .match_zhibo_list,
.s3-body .match_box {
  max-width: 100%;
}

.s3-body .match > div[style*="flex"] {
  flex-wrap: wrap;
  max-width: 100%;
  gap: 8px;
}

.s3-body .match > div[style*="flex"] h1 {
  font-size: 1.2rem;
  margin: 0;
}

.s3-body .site-subtitle {
  word-break: break-word;
}

.s3-body .lmtit {
  flex-wrap: wrap;
  max-width: 100%;
}

.s3-body .lmsenav,
.s3-body #match_filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.s3-cal-days {
  overflow-x: auto;
}

.s3-cal-day {
  word-break: break-all;
  font-size: 0.75rem;
}

/* 桌面端：恢复左右分栏 + 赛事行横向排列 */
@media (min-width: 901px) {
  .s3-body .container.flex-between .container_left {
    width: calc(100% - 360px) !important;
    max-width: 820px;
    flex: 1;
    min-width: 0;
    float: none !important;
  }

  .s3-body .container.flex-between .container_right {
    width: 340px !important;
    flex-shrink: 0;
    float: none !important;
  }

  .s3-body .match-item {
    flex-wrap: nowrap !important;
  }

  .s3-body .match-item .info_left {
    width: auto !important;
    justify-content: flex-start !important;
  }

  .s3-body .match-item .info_center {
    width: auto !important;
    flex: 1;
    min-width: 0;
  }
}

@media (max-width: 900px) {
  .s3-main { grid-template-columns: 1fr; }
  .s3-main > aside { min-width: 0; }

  .s3-body .container.flex-between {
    flex-wrap: wrap;
  }

  .s3-body .container_left,
  .s3-body .container_right {
    width: 100% !important;
    float: none !important;
  }

  .s3-body .match,
  .s3-body .match_list {
    overflow-x: auto;
  }
}
