* {
  box-sizing: border-box;
}

:root {
  /* Dark Mode (Default) */
  --bg-gradient-top: #1f2a44;
  --bg-gradient-mid: #121520;
  --bg-gradient-bot: #0b0d14;
  --text-main: #e6e9f2;
  --text-muted: #8b93a9;
  --text-bright: #ffffff;
  --text-accent: #9cc3ff;
  --panel-bg: #151a26;
  --card-bg: #1b2131;
  --card-bg-hover: rgba(255, 255, 255, 0.05);
  --border-color: #262f45;
  --border-muted: #232a3a;
  --tab-bg: #1c2231;
  --tab-active-bg: #2a3348;
  --accent-blue: #5a78ff;
  --shadow-main: rgba(0, 0, 0, 0.35);
  --hero-bg: rgba(27, 33, 49, 0.4);
}

@media (prefers-color-scheme: light) {
  :root {
    --bg-gradient-top: #f0f4f8;
    --bg-gradient-mid: #ffffff;
    --bg-gradient-bot: #f7fafc;
    --text-main: #2d3748;
    --text-muted: #718096;
    --text-bright: #1a202c;
    --text-accent: #3182ce;
    --panel-bg: #ffffff;
    --card-bg: #f7fafc;
    --card-bg-hover: rgba(0, 0, 0, 0.02);
    --border-color: #e2e8f0;
    --border-muted: #edf2f7;
    --tab-bg: #edf2f7;
    --tab-active-bg: #e2e8f0;
    --accent-blue: #4299e1;
    --shadow-main: rgba(0, 0, 0, 0.1);
    --hero-bg: rgba(226, 232, 240, 0.5);
  }
}
a:link {
  color: var(--text-accent);
}
a:visited {
  color: var(--text-accent);
}
body {
  margin: 0;
  font-family: "Inter", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text-main);
  background: radial-gradient(circle at top, var(--bg-gradient-top) 0%, var(--bg-gradient-mid) 45%, var(--bg-gradient-bot) 100%);
  background-attachment: fixed;
}

code {
  font-family: "SFMono-Regular", "Menlo", "Consolas", monospace;
  background: var(--tab-bg);
  padding: 2px 6px;
  border-radius: 6px;
  color: var(--text-accent);
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 32px 48px 24px;
  border-bottom: 1px solid var(--border-muted);
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 20px;
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 16px;
  transition: all 0.2s ease;
  background: transparent;
  margin-left: -16px;
}

.brand-link:hover {
  background: var(--card-bg-hover);
}

.site-logo {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--text-accent);
}

.brand-title {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: 4px;
  color: var(--text-accent);
}

.brand-subtitle {
  margin-top: 8px;
  color: var(--text-muted);
}

.tagline {
  font-size: 18px;
  color: var(--text-main);
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 24px 60px;
}

.tabs {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
}

.tab {
  flex: 1;
  background: var(--tab-bg);
  color: var(--text-main);
  border: 1px solid transparent;
  padding: 10px 18px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 15px;
  text-align: center;
}

.tab:hover {
  border-color: var(--accent-blue);
}

.tab.is-active {
  background: var(--tab-active-bg);
  border-color: var(--accent-blue);
  color: var(--text-bright);
}

.panel {
  display: none;
  background: var(--panel-bg);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  padding: 28px;
  box-shadow: 0 16px 36px var(--shadow-main);
}

.panel.is-active {
  display: block;
}

h2 {
  margin-top: 0;
  color: var(--text-bright);
}

h3 {
  margin-top: 24px;
  color: var(--text-main);
}

p {
  color: var(--text-main);
  line-height: 1.7;
}

.intro-layout {
  display: flex;
  gap: 40px;
  align-items: center;
}

.intro-content {
  flex: 1;
}

.intro-logo-area {
  flex: 0 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
}

.intro-large-logo {
  width: 240px;
  height: 240px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 20px 40px var(--shadow-main);
  border: 4px solid var(--text-accent);
}

.info-cards {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.card {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 16px;
  border: 1px solid var(--border-color);
}

.card-label {
  font-size: 13px;
  color: var(--text-muted);
}

.card-value {
  margin-top: 8px;
  font-size: 18px;
  color: var(--text-bright);
  font-weight: 600;
}

.section-block {
  margin-top: 24px;
}

.schedule-image {
  margin-top: 16px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  background: var(--bg-gradient-bot);
}

.schedule-image img {
  width: 100%;
  display: block;
}

.hint {
  margin-top: 12px;
  font-size: 13px;
  color: #8b93a9;
}

.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.legend {
  font-size: 13px;
  color: #9aa4be;
  display: flex;
  gap: 12px;
  align-items: center;
}

.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 4px;
}

.dot-completed {
  background: #4ade80;
}

.dot-upcoming {
  background: #facc15;
}

.dot-live {
  background: #fb7185;
}

.results-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin-top: 16px;
}

.match-list {
  display: grid;
  gap: 12px;
}

.match-card {
  border-radius: 14px;
  padding: 14px;
  border: 1px solid var(--border-color);
  background: var(--card-bg);
  transition: all 0.2s ease;
}

.match-card:hover {
  background: var(--card-bg-hover);
  border-color: var(--accent-blue);
  transform: translateY(-2px);
}

.match-card-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.match-meta {
  display: flex;
  justify-content: space-between;
  color: var(--text-muted);
  font-size: 13px;
}

.match-teams {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
}

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

.team-right {
  justify-content: flex-end;
  text-align: right;
}

.team img {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--bg-gradient-bot);
}

.team-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-main);
}

.score {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-bright);
}

.score-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
  min-width: 90px;
}

.score-sep {
  color: var(--text-muted);
  font-weight: 600;
  text-align: center;
}

.score-win {
  color: #4ade80;
}

.score-lose {
  color: #fb7185;
}

.score-neutral {
  color: var(--text-bright);
}

.match-extra {
  margin-top: 10px;
  font-size: 12px;
  color: #8b93a9;
}

.data-links {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  color: #9aa4be;
}

.site-footer {
  text-align: center;
  color: var(--text-muted);
  padding: 24px;
  border-top: 1px solid var(--border-muted);
}

.standings-table {
  margin-top: 16px;
  border-radius: 16px;
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid var(--border-color);
  background: var(--card-bg);
  display: grid;
  grid-template-columns: minmax(2ch, 0.5fr) minmax(80px, 1.2fr) minmax(3ch, 0.6fr) minmax(3ch, 0.6fr)   minmax(140px, 1.6fr);
  gap: 0 12px;
}

.standings-table > .standings-head,
.standings-table > .standings-body,
.standings-table .standings-row {
  display: contents;
}

.standings-table > .standings-head > *,
.standings-table .standings-row > * {
  padding: 12px 0;
  border-bottom: 1px solid var(--border-color);
  align-self: center;
}

.standings-table > .standings-head > * {
  background: var(--tab-active-bg);
  padding: 12px 16px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-main);
}

.standings-table .standings-row > * {
  padding: 12px 16px;
}

.standings-table .standings-row:last-child > * {
  border-bottom: none;
}

.standings-table .standings-row.standings-qualified > * {
  background: rgba(72, 187, 120, 0.12);
}

.standings-table .standings-row.standings-qualified:hover > * {
  background: rgba(72, 187, 120, 0.18);
}

.standings-table .standings-row-link:hover > * {
  background: rgba(255, 255, 255, 0.05);
}

.standings-table .standings-row-link.standings-qualified:hover > * {
  background: rgba(72, 187, 120, 0.18);
}

.standings-body .standings-row > * {
  color: var(--text-main);
}

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

.standings-team img {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  object-fit: cover;
  background: #0f1320;
}

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

.standings-muted {
  color: #9aa4be;
  font-size: 13px;
}

.standings-row-link {
  text-decoration: none;
  transition: background-color 0.2s;
}

.standings-row-link:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

.standings-rank-col {
  font-weight: 600;
  color: var(--text-main);
  min-width: 2ch;
}

.standings-row.standings-qualified {
  background: rgba(72, 187, 120, 0.12);
}

.standings-row.standings-qualified:hover {
  background: rgba(72, 187, 120, 0.18);
}

.detail-page {
  max-width: 960px;
  margin: 0 auto;
  padding: 40px 24px 60px;
}

.detail-card {
  background: var(--panel-bg);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 16px 36px var(--shadow-main);
}

.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

/* New Match Header Hero */
.match-header-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 30px 20px;
  background: var(--hero-bg);
  border-radius: 20px;
  margin-bottom: 20px;
  border: 1px solid var(--border-color);
}

.hero-team {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}

.hero-team img {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  object-fit: cover;
  background: var(--bg-gradient-bot);
  box-shadow: 0 8px 16px var(--shadow-main);
}

.hero-team-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-bright);
}

.clickable-team {
  text-decoration: none;
  transition: transform 0.2s, background-color 0.2s;
  border-radius: 12px;
  padding: 10px;
}

.clickable-team:hover {
  background-color: rgba(255, 255, 255, 0.05);
  transform: translateY(-2px);
}

.hero-score-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 150px;
}

.hero-score-wrap {
  display: flex;
  align-items: center;
  gap: 15px;
}

.hero-score {
  font-size: 48px;
  font-weight: 800;
  font-family: "SFMono-Regular", "Menlo", "Consolas", monospace;
  color: var(--text-bright);
}

.hero-score-sep {
  font-size: 32px;
  color: var(--text-muted);
  font-weight: 700;
}

.hero-status {
  font-size: 14px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.hero-replay-link {
  margin-top: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-blue);
  color: #ffffff !important;
  padding: 6px 16px;
  border-radius: 20px;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.2s;
  box-shadow: 0 4px 10px rgba(90, 120, 255, 0.2);
}

.hero-replay-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(90, 120, 255, 0.3);
  filter: brightness(1.1);
}

.replay-icon {
  font-size: 12px;
}

.match-sub-meta {
  display: flex;
  justify-content: center;
  gap: 20px;
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 20px;
  background: var(--hero-bg);
  padding: 8px 16px;
  border-radius: 20px;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
}

/* Detail Layout Grid */
.detail-layout-grid {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 24px;
}

.detail-section {
  margin-bottom: 30px;
}

.detail-section h3 {
  margin: 0 0 16px;
  font-size: 18px;
  border-left: 4px solid #5a78ff;
  padding-left: 12px;
}

/* Map Tabs */
.section-header-with-tabs {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.map-tabs {
  display: flex;
  gap: 8px;
}

.map-tab-btn {
  background: var(--tab-bg);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.map-tab-btn:hover {
  background: var(--tab-active-bg);
  color: var(--text-bright);
}

.map-tab-btn.active {
  background: var(--accent-blue);
  color: #ffffff;
  border-color: var(--accent-blue);
}

/* Small Lists for side and maps */
.small-list {
  font-size: 13px;
}

.small-list li {
  padding: 4px 0 !important;
  border-bottom: 1px dashed var(--border-color) !important;
}

.bp-team {
  font-weight: 600;
  color: var(--text-accent);
}

.bp-action {
  color: var(--text-muted);
  font-style: italic;
  font-size: 12px;
}

.bp-side {
  color: var(--text-bright);
  font-weight: 600;
  margin-left: 4px;
  background: var(--tab-active-bg);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11px;
}

.stats-tables-grid.stacked {
  grid-template-columns: 1fr !important;
  gap: 30px;
}

.font-mono {
  font-family: "SFMono-Regular", "Menlo", "Consolas", monospace;
}

.detail-back {
  color: var(--text-accent);
  text-decoration: none;
  font-size: 14px;
}

.detail-section {
  margin-top: 20px;
}

.detail-section h3 {
  margin-top: 0;
}

.detail-list {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
  color: var(--text-main);
}

.detail-list li {
  padding: 6px 0;
  border-bottom: 1px dashed var(--border-color);
}

.detail-list li:last-child {
  border-bottom: none;
}

/* Stats Table Styles */
.stats-container {
  margin-top: 12px;
}

.map-stats {
  margin-bottom: 24px;
}

.map-stats h4 {
  color: var(--text-accent);
  margin: 0 0 10px;
  font-size: 16px;
}

.stats-tables-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.team-stats-name {
  color: var(--text-bright);
  font-weight: 600;
  margin-bottom: 8px;
  font-size: 14px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: var(--card-bg);
}

.stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  text-align: left;
  min-width: 300px;
}

.stats-table th,
.stats-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-color);
}

.stats-table th {
  background: var(--tab-active-bg);
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.5px;
}

.stats-table tr:last-child td {
  border-bottom: none;
}

.stats-table tbody tr:hover {
  background: var(--card-bg-hover);
}

.diff-pos {
  color: #4ade80;
  font-weight: 600;
}

.diff-neg {
  color: #fb7185;
  font-weight: 600;
}

@media (max-width: 900px) {
  .intro-layout {
    flex-direction: column-reverse;
    text-align: center;
  }

  .intro-large-logo {
    width: 180px;
    height: 180px;
    margin-bottom: 20px;
  }

  .detail-layout-grid {
    grid-template-columns: 1fr;
  }
  
  .detail-side-content {
    order: -1;
  }

  .hero-score {
    font-size: 36px;
  }

  .hero-team img {
    width: 48px;
    height: 48px;
  }

  .stats-tables-grid {
    grid-template-columns: 1fr;
  }
}

/* Team Page Styles */
.team-header-hero {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-color);
}

.team-header-hero img {
  width: 100px;
  height: 100px;
  border-radius: 20px;
  object-fit: cover;
  background: var(--bg-gradient-bot);
  box-shadow: 0 12px 24px var(--shadow-main);
}

.team-header-info h1 {
  margin: 0;
  font-size: 32px;
  color: var(--text-bright);
}

.team-header-info p {
  margin: 4px 0 0;
  color: var(--text-muted);
  letter-spacing: 2px;
  text-transform: uppercase;
  font-size: 14px;
}

.team-layout-grid {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 32px;
}

.sub-label {
  font-size: 12px;
  color: #8b93a9;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
}

.small-match-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.small-match-item {
  display: block;
  text-decoration: none;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 12px;
  transition: all 0.2s;
}

.small-match-item:hover {
  background: var(--card-bg-hover);
  border-color: var(--accent-blue);
  transform: translateX(4px);
}

.small-match-info {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.small-match-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.small-match-opponent {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-main);
}

.small-match-opponent img {
  width: 24px;
  height: 24px;
  border-radius: 4px;
}

.small-match-score {
  font-weight: 700;
  color: var(--text-bright);
  font-family: "SFMono-Regular", "Menlo", "Consolas", monospace;
  font-size: 14px;
}

@media (max-width: 800px) {
  .team-layout-grid {
    grid-template-columns: 1fr;
  }
  
  .team-header-hero {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 720px) {
  .site-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .results-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Member Tags */
.member-tag {
  display: inline-block;
  padding: 2px 6px;
  font-size: 11px;
  border-radius: 4px;
  margin-left: 8px;
  font-weight: 600;
  text-transform: uppercase;
  background: rgba(90, 120, 255, 0.15);
  color: var(--accent-blue);
  border: 1px solid rgba(90, 120, 255, 0.3);
  vertical-align: middle;
}

.member-tag.sub {
  background: rgba(139, 147, 169, 0.15);
  color: var(--text-muted);
  border: 1px solid rgba(139, 147, 169, 0.3);
}
