@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@500;600;700&family=Roboto:wght@400;500;700&display=swap');

:root {
  --green: #1B4332;
  --orange: #FF6D00;
  --purple: #7B2D8E;
  --bg: #F8F9FA;
  --white: #FFFFFF;
  --sidebar-w: 320px;
  --max: 1200px;
}

*, *::before, *::after { box-sizing: border-box; }

body.m4-body {
  margin: 0;
  font-family: 'Roboto', sans-serif;
  background: var(--bg);
  color: #333;
  line-height: 1.6;
}

h1, h2, h3, .m4-display {
  font-family: 'Oswald', sans-serif;
  font-weight: 600;
  letter-spacing: 0.3px;
}

a { color: inherit; text-decoration: none; }

/* Top horizontal nav */
.m4-header {
  background: var(--green);
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: 0 2px 12px rgba(27,67,50,0.2);
}

.m4-header-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  gap: 16px;
}

.m4-logo a {
  color: #fff;
  font-family: 'Oswald', sans-serif;
  font-weight: 700;
  font-size: 1.3rem;
}

.m4-nav {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
}

.m4-nav a {
  color: rgba(255,255,255,0.9);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.m4-nav a:hover {
  color: #fff;
  border-bottom-color: var(--orange);
}

.m4-menu-toggle {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.4rem;
  cursor: pointer;
  padding: 4px 8px;
}

/* Page shell */
.m4-wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 20px 20px 40px;
}

.m4-page {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 20px 40px;
}

/* 70/30 dual column layout */
.m4-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--sidebar-w);
  gap: 24px;
  align-items: start;
}

.m4-main { min-width: 0; }

.m4-sidebar {
  position: sticky;
  top: 84px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.m4-panel {
  background: var(--white);
  border-radius: 10px;
  padding: 16px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  transition: transform 0.2s, box-shadow 0.2s;
}

.m4-panel:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}

.m4-panel h3 {
  margin: 0 0 12px;
  font-size: 1rem;
  color: var(--green);
  border-bottom: 2px solid var(--orange);
  padding-bottom: 8px;
}

/* News carousel + list */
.m4-news-split {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 14px;
  margin-bottom: 24px;
}

.m4-news-hero {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  display: block;
  transition: transform 0.25s, box-shadow 0.25s;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

.m4-news-hero:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 28px rgba(27,67,50,0.15);
}

.m4-news-hero img {
  width: 100%;
  height: 240px;
  object-fit: cover;
  display: block;
}

.m4-news-hero-title {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 18px;
  background: linear-gradient(transparent, rgba(27,67,50,0.88));
  color: #fff;
  font-family: 'Oswald', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
}

.m4-news-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.m4-news-list a {
  background: var(--white);
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 0.88rem;
  border-left: 3px solid var(--orange);
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

.m4-news-list a:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.08);
}

.m4-section {
  font-size: 1.15rem;
  color: var(--green);
  margin: 20px 0 12px;
  padding-left: 10px;
  border-left: 4px solid var(--orange);
}

/* Video grid */
.m4-video-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-bottom: 8px;
}

.m4-video-card {
  background: var(--white);
  border-radius: 10px;
  overflow: hidden;
  transition: transform 0.25s, box-shadow 0.25s;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}

.m4-video-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 24px rgba(0,0,0,0.1);
}

.m4-video-card img {
  width: 100%;
  height: 110px;
  object-fit: cover;
  background: #ddd;
}

.m4-video-card div {
  padding: 10px 12px 4px;
  font-size: 0.85rem;
}

.m4-video-card span {
  display: block;
  padding: 0 12px 10px;
  font-size: 0.75rem;
  color: #888;
}

/* Sidebar widgets */
.m4-league-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid #f0f0f0;
  transition: transform 0.2s;
}

.m4-league-row:hover { transform: translateX(4px); }
.m4-league-row img { width: 32px; height: 32px; object-fit: contain; }
.m4-league-row span { font-size: 0.85rem; color: #444; }

.m4-player-row, .m4-team-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid #f0f0f0;
  transition: transform 0.2s;
}

.m4-player-row:hover, .m4-team-row:hover { transform: translateX(4px); }
.m4-player-row img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--orange);
}
.m4-team-row img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}
.m4-rank {
  color: var(--orange);
  font-family: 'Oswald', sans-serif;
  font-weight: 700;
  min-width: 22px;
}

.m4-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.m4-tags a {
  padding: 5px 12px;
  background: rgba(123,45,142,0.08);
  color: var(--purple);
  border-radius: 999px;
  font-size: 0.8rem;
  transition: transform 0.2s, background 0.2s, color 0.2s;
}

.m4-tags a:hover {
  transform: translateY(-2px);
  background: var(--purple);
  color: #fff;
}

/* Contest list overrides */
.m4-body .site-subtitle {
  color: var(--orange);
  font-family: 'Roboto', sans-serif;
  font-weight: 400;
  font-size: 16px;
  margin-left: 8px;
}

.m4-body .match_filter_item.on a {
  background: var(--green) !important;
  color: #fff !important;
}

.m4-body .info_right.start a {
  background: var(--orange) !important;
  color: #fff !important;
}

.m4-body .header, .m4-body .second-header { display: none !important; }

.m4-main .match {
  background: var(--white);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 20px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

/* Footer */
.m4-footer.footer-wrapper {
  background: var(--green);
  color: rgba(255,255,255,0.9);
}

.m4-footer p, .m4-footer .footer-desc {
  text-align: center;
  color: rgba(255,255,255,0.9);
}

.m4-footer a { color: #fff; }

/* Breadcrumb */
.m4-breadcrumb {
  padding: 14px 0;
  font-size: 0.85rem;
  color: #888;
}

.m4-breadcrumb a { color: var(--green); }

/* Detail pages */
.m4-detail-layout, .m4-list-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--sidebar-w);
  gap: 24px;
  align-items: start;
}

.m4-detail-main, .m4-list-main {
  background: var(--white);
  border-radius: 10px;
  padding: 24px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  min-width: 0;
}

.m4-detail h1 {
  margin: 0 0 12px;
  font-size: 1.5rem;
  color: var(--green);
  line-height: 1.4;
}

.m4-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.85rem;
  color: #999;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid #eee;
}

.m4-detail-meta a { color: var(--orange); }

.m4-detail-body {
  line-height: 1.8;
  word-break: break-word;
}

.m4-detail-body a { color: var(--orange); }

.m4-detail-video {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  margin-bottom: 18px;
  border-radius: 8px;
  overflow: hidden;
  background: #111;
}

.m4-detail-video iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: none;
}

.m4-record-play {
  display: inline-block;
  padding: 10px 20px;
  background: var(--orange);
  color: #fff !important;
  border-radius: 6px;
  font-weight: 700;
  margin: 12px 0;
}

.m4-prenext {
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid #eee;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.88rem;
}

.m4-prenext a { color: #555; }
.m4-prenext a:hover { color: var(--orange); }

.m4-aside-box {
  background: var(--white);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  transition: transform 0.2s, box-shadow 0.2s;
}

.m4-aside-box:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.08);
}

.m4-aside-box h3 {
  margin: 0 0 10px;
  font-size: 0.95rem;
  color: var(--green);
  border-bottom: 2px solid var(--orange);
  padding-bottom: 8px;
}

.m4-aside-link {
  display: block;
  padding: 7px 0;
  font-size: 0.82rem;
  color: #555;
  border-bottom: 1px solid #f5f5f5;
}

.m4-aside-link:hover { color: var(--orange); }

.m4-aside-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.m4-aside-tags a {
  padding: 4px 10px;
  background: rgba(123,45,142,0.08);
  color: var(--purple);
  border-radius: 999px;
  font-size: 0.75rem;
}

.m4-aside-tags a:hover {
  background: var(--purple);
  color: #fff;
}

.m4-list-aside {
  position: sticky;
  top: 84px;
}

/* List pages */
.m4-list-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}

.m4-list-head h1 {
  margin: 0;
  font-size: 1.35rem;
  color: var(--green);
}

.m4-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.m4-filters span {
  padding: 6px 14px;
  background: var(--bg);
  border: 1px solid #ddd;
  border-radius: 999px;
  font-size: 0.82rem;
  cursor: pointer;
}

.m4-filters span.on {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
}

.m4-list-row {
  display: flex;
  gap: 16px;
  background: var(--white);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 12px;
  transition: transform 0.25s, box-shadow 0.25s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.m4-list-row:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}

.m4-list-row img {
  width: 140px;
  height: 90px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
  background: #ddd;
}

.m4-list-body { flex: 1; min-width: 0; }
.m4-list-body h3 { margin: 0 0 6px; font-size: 1rem; color: var(--green); }
.m4-list-body p { margin: 0 0 8px; font-size: 0.85rem; color: #666; }
.m4-list-meta {
  font-size: 0.78rem;
  color: #999;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.m4-list-meta .tag { color: var(--purple); }

/* 分页 */
.m4-body .fenye {
  display: flex;
  justify-content: center;
  padding: 24px 0 8px;
  margin-top: 8px;
  clear: both;
}

.m4-body .fenye ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
  justify-content: center;
}

.m4-body .fenye ul li {
  display: inline-block;
  margin: 0;
}

.m4-body .fenye ul li a {
  display: block;
  padding: 8px 14px;
  font-size: 0.85rem;
  font-family: 'Roboto', sans-serif;
  color: var(--green);
  background: var(--white);
  border: 1px solid #ddd;
  border-radius: 6px;
  text-decoration: none;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.m4-body .fenye ul li a:hover {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
}

.m4-body .fenye ul li.active a {
  background: var(--orange);
  color: #fff;
  border-color: var(--orange);
}

.m4-body ul.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin: 24px 0 0;
  padding: 0;
  justify-content: center;
  clear: both;
}

.m4-body ul.pagination li {
  display: inline-block;
  float: none;
  height: auto;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: none;
}

.m4-body ul.pagination li a {
  display: block;
  padding: 8px 14px;
  font-size: 0.85rem;
  color: var(--green);
  background: var(--white);
  border: 1px solid #ddd;
  border-radius: 6px;
  text-decoration: none;
}

.m4-body ul.pagination li.active {
  background: transparent;
  border: none;
}

.m4-body ul.pagination li.active a {
  background: var(--orange);
  color: #fff;
  border-color: var(--orange);
}

.m4-body ul.pagination li a:hover {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
}

.m4-related-card {
  display: block;
  background: var(--white);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 10px;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

.m4-related-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 14px rgba(0,0,0,0.08);
}

.m4-related-card img {
  width: 100%;
  height: 80px;
  object-fit: cover;
  background: #ddd;
}

.m4-related-card p {
  padding: 8px 10px;
  font-size: 0.82rem;
  margin: 0;
}

/* Column list grid overrides */
.m4-body .container { max-width: var(--max); width: 100% !important; }
.m4-body .position { background: var(--bg); }

.m4-body .container.flex-between:has(.ny_leftside) {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 20px 32px;
  display: grid !important;
  grid-template-columns: 120px minmax(0, 1fr) var(--sidebar-w);
  gap: 16px;
  float: none !important;
}

.m4-body .container.flex-between:not(:has(.ny_leftside)) {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 20px;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) var(--sidebar-w);
  gap: 24px;
  float: none !important;
}

.m4-body .container.flex-between:has(.ny_leftside) .ny_leftside {
  position: static !important;
  left: auto !important;
  width: 100% !important;
  float: none !important;
}

.m4-body .container.flex-between:has(.ny_leftside) .ny_leftside .all {
  background: var(--green);
  width: 100%;
}

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

.m4-body .container_left .match-item {
  flex-direction: row !important;
  flex-wrap: nowrap !important;
}

.m4-main .match_zhibo_list { display: block; }

@media (max-width: 900px) {
  .m4-menu-toggle { display: block; }

  .m4-nav {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--green);
    flex-direction: column;
    padding: 12px 20px 20px;
    gap: 0;
    box-shadow: 0 8px 16px rgba(0,0,0,0.15);
  }

  .m4-nav.open { display: flex; }
  .m4-nav a { padding: 12px 0; border-bottom: 1px solid rgba(255,255,255,0.1); }
  .m4-header { position: relative; }
  .m4-header-inner { position: relative; flex-wrap: wrap; }

  .m4-layout,
  .m4-detail-layout,
  .m4-list-layout {
    grid-template-columns: 1fr;
  }

  .m4-sidebar, .m4-list-aside {
    position: static;
  }

  .m4-news-split { grid-template-columns: 1fr; }
  .m4-video-grid { grid-template-columns: 1fr; }
  .m4-list-row { flex-direction: column; }
  .m4-list-row img { width: 100%; height: 160px; }

  .m4-body .container.flex-between:has(.ny_leftside),
  .m4-body .container.flex-between:not(:has(.ny_leftside)) {
    grid-template-columns: 1fr;
  }
  .m4-body .container.mt10.flex-between {
    grid-template-columns: 1fr;
  }
}

/* 赛事详情页 */
.m4-body .match_allinfo .top {
  background: linear-gradient(135deg, var(--green), #2d6a4f);
  border-radius: 10px 10px 0 0;
}

.m4-body .match_allinfo .top,
.m4-body .match_allinfo .top p,
.m4-body .match_allinfo .qiudui_name { color: #fff; }

.m4-body .match_analysis .senav span.on {
  background: var(--orange);
  color: #fff;
}

.m4-body .zhibo_btn .redirectLink {
  background: var(--orange);
  color: #fff !important;
  padding: 8px 16px;
  border-radius: 6px;
  margin: 4px;
  display: inline-block;
}

.m4-body .container.mt10.flex-between {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 20px 40px;
  display: grid !important;
  gap: 24px;
  float: none !important;
}

.m4-body .position .container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 12px 20px;
  font-size: 0.85rem;
}

.m4-body .position .crumb { color: var(--green); }
