*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --color-bg: #f0ebe3;
  --color-bg-secondary: #e8e0d5;
  --color-card: #ffffff;
  --color-border: #d4cbbf;
  --color-text: #2d2a24;
  --color-text-muted: #7a7266;
  --color-text-light: #a09888;
  --color-primary: #e63946;
  --color-primary-hover: #c1121f;
  --color-secondary: #1d3557;
  --color-accent: #f4a261;
  --color-gold: #e9c46a;
  --color-green: #2a9d8f;
  --color-team-兄弟: #fbb040;
  --gradient-hero: linear-gradient(135deg, #1d3557 0%, #e63946 100%);
  --gradient-card: linear-gradient(135deg, #e63946 0%, #f4a261 100%);
  --gradient-warm: linear-gradient(135deg, #f4a261 0%, #e9c46a 100%);
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  --spacing-2xl: 3rem;
  --spacing-3xl: 4rem;
  --radius-sm: 0.375rem;
  --radius-md: 0.625rem;
  --radius-lg: 1rem;
  --radius-xl: 1.25rem;
  --radius-full: 9999px;
  --container-max: 1280px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
  --shadow-card: 0 2px 8px rgba(0,0,0,0.06);
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans TC', 'PingFang TC', 'Microsoft JhengHei', sans-serif;
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; }
ul, ol { list-style: none; }

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--spacing-md);
}

.text-center { text-align: center; }

/* ===== Header ===== */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--gradient-hero);
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.header__logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header__logo-icon {
  width: 40px;
  height: 40px;
  background: var(--color-gold);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--color-secondary);
  transform: rotate(-10deg);
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.header__logo-text {
  font-size: 1.2rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.05em;
}

.header__logo-text span {
  color: var(--color-gold);
}

.header__nav {
  display: none;
}

.header__nav-list {
  display: flex;
  gap: var(--spacing-lg);
}

.header__nav-link {
  font-size: 0.9rem;
  font-weight: 500;
  color: rgba(255,255,255,0.8);
  padding: 0.5rem 0.25rem;
  border-bottom: 2px solid transparent;
  transition: all 0.25s;
}

.header__nav-link:hover,
.header__nav-link--active {
  color: #fff;
  border-bottom-color: var(--color-gold);
}

.header__mobile-toggle {
  display: flex;
  padding: var(--spacing-sm);
  background: none;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: var(--radius-md);
  color: #fff;
  cursor: pointer;
}

@media (min-width: 768px) {
  .header__nav { display: block; }
  .header__mobile-toggle { display: none; }
}

/* Mobile Navigation */
.mobile-nav {
  display: none;
  position: fixed;
  top: 64px;
  left: 0;
  right: 0;
  background: var(--color-secondary);
  border-bottom: 2px solid var(--color-primary);
  padding: var(--spacing-md);
  z-index: 99;
}

.mobile-nav--open { display: block; }

.mobile-nav__list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.mobile-nav__link {
  display: block;
  padding: var(--spacing-sm) 0;
  font-weight: 500;
  color: rgba(255,255,255,0.85);
}

/* ===== Footer ===== */
.footer {
  background: var(--color-secondary);
  color: rgba(255,255,255,0.85);
  margin-top: auto;
  position: relative;
}

.footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient-card);
}

.footer__inner {
  padding: var(--spacing-2xl) var(--spacing-lg);
}

@media (min-width: 768px) {
  .footer__inner { padding: var(--spacing-2xl) var(--spacing-xl); }
}

.footer__grid {
  display: grid;
  gap: var(--spacing-xl);
}

@media (min-width: 768px) {
  .footer__grid { grid-template-columns: 2fr 1fr 1fr 1fr; }
}

.footer__brand-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
}

.footer__brand-name span { color: var(--color-gold); }

.footer__brand-desc {
  margin-top: var(--spacing-md);
  font-size: 0.875rem;
  opacity: 0.7;
  line-height: 1.7;
}

.footer__title {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: var(--spacing-md);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-gold);
}

.footer__links {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.footer__link {
  font-size: 0.875rem;
  opacity: 0.7;
  transition: all 0.2s;
}

.footer__link:hover {
  opacity: 1;
  color: var(--color-gold);
  padding-left: 4px;
}

.footer__bottom {
  padding: var(--spacing-lg) 0;
  border-top: 1px solid rgba(255,255,255,0.1);
  text-align: center;
  font-size: 0.85rem;
  opacity: 0.6;
}

/* ===== Breadcrumb ===== */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-bottom: var(--spacing-lg);
  padding-top: var(--spacing-lg);
}

.breadcrumb__separator { color: var(--color-border); }

.breadcrumb__link { transition: color 0.2s; }
.breadcrumb__link:hover { color: var(--color-primary); }

.breadcrumb__current { color: var(--color-text); font-weight: 500; }

/* ===== Page Header ===== */
.page-header {
  padding: var(--spacing-xl) 0 var(--spacing-lg);
  border-bottom: 2px solid transparent;
  border-image: linear-gradient(90deg, var(--color-primary), var(--color-accent), var(--color-gold)) 1;
  margin-bottom: var(--spacing-xl);
}

.page-header__title { margin-bottom: var(--spacing-sm); }

.page-header__desc {
  color: var(--color-text-muted);
  font-size: 1.05rem;
}

/* ===== Team Profile ===== */
.team-profile {
  display: flex;
  align-items: center;
  gap: var(--spacing-xl);
  padding: var(--spacing-2xl) 0;
  flex-wrap: wrap;
}

.team-profile__logo {
  width: 100px;
  height: 100px;
  border-radius: var(--radius-lg);
  background: var(--color-card);
  border: 3px solid var(--color-team-兄弟);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  overflow: hidden;
  padding: 8px;
}

.team-profile__logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.team-profile__info {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
}

.team-profile__fullname {
  font-size: 2rem;
  font-weight: 800;
  color: var(--color-text);
}

.team-profile__stats {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-sm);
  margin-top: var(--spacing-xs);
}

.team-profile__stat {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0.2rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
}

.team-profile__stat--record {
  background: var(--color-team-兄弟);
  color: var(--color-secondary);
}

.team-profile__stat--pct {
  background: rgba(42,157,143,0.12);
  color: var(--color-green);
  border: 1px solid rgba(42,157,143,0.25);
}

.team-profile__stat--rank {
  background: rgba(230,57,70,0.1);
  color: var(--color-primary);
  border: 1px solid rgba(230,57,70,0.2);
}

.team-profile__stat-label {
  opacity: 0.7;
  font-weight: 400;
  font-size: 0.75rem;
}

.team-profile__league {
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

/* ===== Matchup Description Links ===== */
.matchup-desc {
  margin-top: 0.5rem;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
  color: var(--color-text-muted);
  line-height: 1.6;
}

.matchup-desc__link {
  display: inline-block;
  color: var(--color-primary);
  font-weight: 600;
  padding: 0.15rem 0.8rem;
  border: 1px solid var(--color-primary);
  border-radius: var(--radius-full);
  transition: all 0.25s;
  margin-right: 0.5rem;
}

.matchup-desc__link:hover {
  background: var(--color-primary);
  color: #fff;
  text-decoration: none;
}

.matchup-desc__count {
  font-weight: 600;
  color: var(--color-text);
}

@media (max-width: 480px) {
  .team-profile {
    flex-direction: column;
    text-align: center;
  }
  .team-profile__stats {
    justify-content: center;
  }
  .team-profile__fullname {
    font-size: 1.5rem;
  }
}

/* ===== Sections ===== */
.section { padding: var(--spacing-2xl) 0; }

@media (min-width: 768px) {
  .section { padding: var(--spacing-3xl) 0; }
}

.section--alt {
  background: var(--color-bg-secondary);
}

.section__header {
  margin-bottom: var(--spacing-xl);
}

.section__title {
  position: relative;
  margin-bottom: var(--spacing-xs);
}

.section__title::after {
  content: '';
  display: block;
  width: 50px;
  height: 3px;
  background: var(--gradient-card);
  border-radius: 2px;
  margin-top: var(--spacing-sm);
}

.text-center .section__title::after {
  margin-left: auto;
  margin-right: auto;
}

/* ===== Season Selector ===== */
.season-selector {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-lg);
  flex-wrap: wrap;
}

.season-selector__label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-muted);
}

.season-selector__buttons {
  display: flex;
  gap: var(--spacing-xs);
  flex-wrap: wrap;
}

.season-btn {
  padding: 0.4rem 0.9rem;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.season-btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.season-btn--active {
  background: var(--color-secondary);
  color: #fff;
  border-color: var(--color-secondary);
}

/* ===== Standings Table ===== */
.standings__table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-card);
  margin-bottom: var(--spacing-xl);
}

.standings__table {
  width: 100%;
  border-collapse: collapse;
  background: var(--color-card);
  font-size: 0.875rem;
  min-width: 650px;
}

.standings__table thead {
  background: var(--color-secondary);
}

.standings__table th {
  padding: 0.75rem 1rem;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: rgba(255,255,255,0.9);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  border-bottom: 3px solid var(--color-primary);
}

.standings__table th:first-child,
.standings__table td:first-child {
  text-align: left;
  font-weight: 600;
  padding-left: 1.25rem;
  min-width: 120px;
}

.standings__table td {
  padding: 0.75rem 1rem;
  text-align: center;
  border-bottom: 1px solid rgba(212,203,191,0.4);
}

.standings__table tbody tr:hover td {
  background: rgba(230,57,70,0.04);
}

.standings__table tbody tr:nth-child(even) td {
  background: rgba(240,235,227,0.5);
}

.standings__table tbody tr:nth-child(even):hover td {
  background: rgba(230,57,70,0.06);
}

.winner {
  font-weight: 700;
  color: var(--color-green);
}

.loser {
  color: var(--color-text-muted);
}

/* Team highlight in table */
.team-highlight {
  font-weight: 700;
  color: var(--color-team-兄弟);
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  transition: all 0.25s;
  cursor: pointer;
  border: none;
  gap: 0.5rem;
}

.btn--primary {
  background: var(--gradient-card);
  color: white;
  box-shadow: 0 4px 12px rgba(230,57,70,0.3);
}

.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(230,57,70,0.4);
}

/* ===== Schedule status badges ===== */
.status-badge {
  display: inline-block;
  padding: 0.2rem 0.7rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
}

.status-badge--completed {
  background: rgba(42,157,143,0.12);
  color: var(--color-green);
}

.status-badge--postponed {
  background: rgba(244,162,97,0.12);
  color: var(--color-accent);
}

.status-badge--upcoming {
  background: rgba(29,53,87,0.1);
  color: var(--color-secondary);
}

/* ===== Responsive ===== */
@media (max-width: 480px) {
  .standings__table {
    font-size: 0.8rem;
    min-width: 500px;
  }
  .standings__table th,
  .standings__table td {
    padding: 0.6rem 0.5rem;
  }
}