/* ===== Reset & Variables ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --cream: #F5F0E8;
  --ink: #1F1B16;
  --muted-ink: #5C5146;
  --red-orange: #E85D26;
  --deep-blue: #123A5C;
  --cobalt: #1E5A8A;
  --surface: #E8E1D5;
  --highlight: #FFD166;
  --header-h: 64px;
  --container-w: 1200px;
  --radius-lg: 12px;
  --radius-md: 8px;
  --radius-sm: 4px;
  --cut-radius: 24px;
  --shadow-soft: 0 4px 16px rgba(18, 58, 92, 0.12);
  --shadow-lift: 0 8px 28px rgba(18, 58, 92, 0.22);
  --font-ui: system-ui, -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-head: 'Noto Sans SC', system-ui, -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Consolas, monospace;
}

html {
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.65;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  background: var(--cream);
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

#main-content {
  flex: 1;
  width: 100%;
}

img, svg, video {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--cobalt);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--red-orange);
  text-decoration: underline;
}

ul, ol {
  list-style: none;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-head);
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--ink);
}

p {
  margin-bottom: 1rem;
}

:focus-visible {
  outline: 3px solid var(--red-orange);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

[hidden] {
  display: none !important;
}

/* ===== Accessibility: Skip Link ===== */
.skip-link {
  position: fixed;
  top: -100%;
  left: 1rem;
  z-index: 300;
  background: var(--red-orange);
  color: #fff;
  padding: 0.65rem 1.1rem;
  border-radius: 0 0 10px 10px;
  font-weight: 700;
  font-size: 0.875rem;
  box-shadow: var(--shadow-lift);
  transition: top 0.25s ease;
}

.skip-link:focus {
  top: 0;
  color: #fff;
  text-decoration: none;
}

/* ===== Scroll Progress ===== */
.scroll-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: transparent;
  transform-origin: left center;
  transform: scaleX(0);
  pointer-events: none;
  z-index: 5;
}

/* ===== Header ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--deep-blue);
  color: var(--cream);
  box-shadow: 0 2px 12px rgba(18, 58, 92, 0.35);
}

.site-header::after {
  content: '';
  position: absolute;
  top: 0;
  right: 12%;
  width: 1px;
  height: 100%;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(255, 209, 102, 0.18) 30%,
    rgba(255, 209, 102, 0.18) 70%,
    transparent 100%
  );
  transform: skewX(-14deg);
  pointer-events: none;
}

.header-inner {
  position: relative;
  max-width: calc(var(--container-w) + 2rem);
  margin-inline: auto;
  padding: 0 1.25rem;
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

/* Brand */
.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-shrink: 0;
}

.brand-link {
  display: inline-flex;
  align-items: baseline;
  font-family: var(--font-head);
  font-size: 1.55rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--cream);
  text-decoration: none;
  white-space: nowrap;
}

.brand-link:hover {
  color: var(--cream);
  text-decoration: none;
}

.brand-mark {
  color: var(--red-orange);
  font-weight: 900;
}

.brand-name {
  color: var(--cream);
  font-weight: 900;
}

.brand-tagline {
  display: none;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: rgba(245, 240, 232, 0.55);
  border-left: 2px solid var(--red-orange);
  padding-left: 0.7rem;
  line-height: 1.3;
  white-space: nowrap;
}

/* Navigation */
.main-nav {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--deep-blue);
  padding: 0.75rem 1.25rem 1rem;
  box-shadow: 0 12px 24px rgba(18, 58, 92, 0.28);
  display: none;
  z-index: 90;
}

.main-nav[data-open] {
  display: block;
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-md) var(--radius-lg) var(--radius-md) var(--radius-lg);
  color: rgba(245, 240, 232, 0.82);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: background 0.2s ease, color 0.2s ease;
}

.nav-link:hover {
  background: rgba(245, 240, 232, 0.08);
  color: var(--cream);
  text-decoration: none;
}

.nav-link[aria-current="page"] {
  background: rgba(232, 93, 38, 0.24);
  color: var(--cream);
}

.nav-link[aria-current="page"] .nav-index {
  color: var(--highlight);
}

.nav-index {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 400;
  color: rgba(255, 209, 102, 0.75);
  line-height: 1;
}

/* Header extra */
.header-extra {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

.league-switcher {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.32rem 0.85rem;
  background: rgba(245, 240, 232, 0.1);
  border: 1px solid rgba(245, 240, 232, 0.18);
  border-radius: var(--radius-sm) var(--radius-lg) var(--radius-sm) var(--radius-lg);
  color: var(--cream);
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  user-select: none;
}

.league-caret {
  color: var(--highlight);
  font-size: 0.68rem;
  line-height: 1;
}

/* Nav Toggle */
.nav-toggle {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  gap: 4px;
  background: transparent;
  border: 1px solid rgba(245, 240, 232, 0.2);
  border-radius: var(--radius-sm) var(--radius-md) var(--radius-sm) var(--radius-md);
  cursor: pointer;
  padding: 0;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.nav-toggle:hover {
  background: rgba(245, 240, 232, 0.08);
  border-color: rgba(245, 240, 232, 0.35);
}

.nav-toggle-bar {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--cream);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease, background 0.3s ease;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
  background: var(--highlight);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
  background: var(--highlight);
}

/* ===== Footer ===== */
.site-footer {
  background: var(--deep-blue);
  color: var(--cream);
  margin-top: auto;
}

.site-footer::before {
  content: '';
  display: block;
  height: 4px;
  background: repeating-linear-gradient(
    90deg,
    var(--red-orange) 0 20px,
    transparent 20px 28px,
    var(--highlight) 28px 32px,
    transparent 32px 40px
  );
}

.footer-grid {
  max-width: calc(var(--container-w) + 2rem);
  margin-inline: auto;
  padding: 2.5rem 1.25rem 1.75rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

.footer-brand .brand {
  margin-bottom: 0.6rem;
}

.footer-tagline {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--highlight);
  margin-bottom: 0.4rem;
}

.footer-mission {
  font-size: 0.875rem;
  line-height: 1.6;
  color: rgba(245, 240, 232, 0.75);
  margin-bottom: 0.6rem;
}

.footer-trust {
  font-size: 0.85rem;
  line-height: 1.6;
  color: rgba(245, 240, 232, 0.55);
  border-left: 2px solid var(--red-orange);
  padding-left: 0.75rem;
  margin-bottom: 0;
}

.footer-heading {
  font-family: var(--font-head);
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: var(--highlight);
  text-transform: uppercase;
  margin-bottom: 0.9rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid rgba(245, 240, 232, 0.15);
}

.footer-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.3rem 0.75rem;
}

.footer-links a {
  color: rgba(245, 240, 232, 0.75);
  font-size: 0.9rem;
  padding: 0.2rem 0;
  transition: color 0.2s ease, padding-left 0.2s ease;
  display: inline-block;
}

.footer-links a:hover {
  color: var(--highlight);
  padding-left: 0.25rem;
  text-decoration: none;
}

.footer-contact p {
  font-size: 0.875rem;
  line-height: 1.6;
  color: rgba(245, 240, 232, 0.75);
  margin-bottom: 0.3rem;
  word-break: break-all;
}

.footer-service {
  margin-top: 0.5rem;
  font-size: 0.8rem !important;
  color: rgba(245, 240, 232, 0.45) !important;
  border-top: 1px solid rgba(245, 240, 232, 0.1);
  padding-top: 0.6rem;
}

.footer-bottom {
  border-top: 1px solid rgba(245, 240, 232, 0.12);
  background: rgba(0, 0, 0, 0.12);
}

.footer-bottom-inner {
  max-width: calc(var(--container-w) + 2rem);
  margin-inline: auto;
  padding: 1.1rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  font-size: 0.82rem;
  color: rgba(245, 240, 232, 0.55);
}

.footer-bottom-inner p {
  margin-bottom: 0;
}

.footer-meta-links {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.footer-meta-links a {
  color: rgba(245, 240, 232, 0.65);
  font-size: 0.82rem;
}

.footer-meta-links a:hover {
  color: var(--highlight);
  text-decoration: none;
}

.footer-meta-dot {
  color: rgba(245, 240, 232, 0.25);
}

.footer-icp {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: rgba(245, 240, 232, 0.4);
  letter-spacing: 0.03em;
}

/* ===== Back to Top ===== */
.back-to-top {
  position: fixed;
  bottom: 1.6rem;
  right: 1.6rem;
  width: 50px;
  height: 50px;
  background: var(--red-orange);
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-radius: 50% 50% var(--radius-sm) 50%;
  font-size: 1.3rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px) rotate(0.02deg);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease, background 0.2s ease;
  box-shadow: 0 6px 20px rgba(232, 93, 38, 0.4);
  z-index: 90;
}

.back-to-top:hover {
  background: #d64e1c;
}

.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top-icon {
  transform: translateY(-1px);
}

/* ===== Container & Layout ===== */
.container {
  width: 100%;
  max-width: calc(var(--container-w) + 2rem);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

.grid-split {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

/* ===== Section ===== */
.section {
  padding-block: 2.5rem;
}

.section-header {
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
  margin-bottom: 1.4rem;
  padding-bottom: 0.7rem;
  border-bottom: 2px solid var(--surface);
}

.section-index {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--red-orange);
  letter-spacing: 0.04em;
}

.section-title {
  font-family: var(--font-head);
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 900;
  color: var(--ink);
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 0;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1.2rem;
  border: 2px solid transparent;
  border-radius: var(--radius-sm) var(--radius-lg) var(--radius-sm) var(--radius-lg);
  font-family: var(--font-ui);
  font-size: 0.925rem;
  font-weight: 700;
  line-height: 1.3;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
  white-space: nowrap;
  user-select: none;
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--red-orange);
  color: #fff;
  border-color: var(--red-orange);
  box-shadow: 0 3px 12px rgba(232, 93, 38, 0.25);
}

.btn-primary:hover {
  background: #d64e1c;
  border-color: #d64e1c;
  color: #fff;
  box-shadow: 0 5px 18px rgba(232, 93, 38, 0.35);
}

.btn-outline {
  background: transparent;
  color: var(--cobalt);
  border-color: var(--cobalt);
}

.btn-outline:hover {
  background: rgba(30, 90, 138, 0.08);
  border-color: var(--deep-blue);
  color: var(--deep-blue);
  box-shadow: 0 3px 10px rgba(18, 58, 92, 0.1);
}

/* ===== Breadcrumb ===== */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  padding-block: 0.9rem;
  font-size: 0.85rem;
  color: var(--muted-ink);
}

.breadcrumb-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.breadcrumb-item + .breadcrumb-item::before {
  content: '→';
  color: rgba(92, 81, 70, 0.4);
  font-size: 0.75rem;
}

.breadcrumb-link {
  color: var(--cobalt);
}

.breadcrumb-link:hover {
  color: var(--red-orange);
  text-decoration: none;
}

.breadcrumb-item[aria-current="page"] {
  color: var(--muted-ink);
  font-weight: 600;
}

/* ===== Cards ===== */
.card {
  background: var(--surface);
  border-radius: var(--radius-md) var(--radius-lg) var(--radius-md) var(--radius-lg);
  padding: 1.25rem;
  border: 1px solid rgba(31, 27, 22, 0.06);
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.card:hover {
  box-shadow: var(--shadow-soft);
  transform: translateY(-2px);
}

.card-body > *:last-child {
  margin-bottom: 0;
}

.card-title {
  font-family: var(--font-head);
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--ink);
  margin-bottom: 0.5rem;
}

.card p {
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--muted-ink);
  margin-bottom: 0.75rem;
}

/* ===== Data Panel ===== */
.data-panel {
  background: var(--deep-blue);
  color: var(--cream);
  border-radius: var(--radius-lg) 32px var(--radius-lg) 32px;
  padding: 1.4rem 1.5rem;
  box-shadow: var(--shadow-soft);
}

.data-panel-title {
  font-family: var(--font-head);
  font-size: 1.05rem;
  font-weight: 900;
  color: var(--highlight);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.data-panel-title::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--red-orange);
  border-radius: 2px;
  transform: rotate(45deg);
}

.data-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.7rem;
}

.data-grid > * {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: rgba(245, 240, 232, 0.85);
  padding: 0.5rem 0.75rem;
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-sm);
  border-left: 3px solid rgba(255, 209, 102, 0.45);
  margin-bottom: 0;
}

/* ===== Tags ===== */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.28rem 0.8rem;
  border-radius: 100px;
  background: var(--surface);
  border: 1px solid transparent;
  font-family: var(--font-ui);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted-ink);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  user-select: none;
}

.tag:hover {
  background: var(--cream);
  border-color: rgba(31, 27, 22, 0.15);
}

.tag-active {
  background: var(--highlight);
  color: var(--ink);
  border-color: rgba(31, 27, 22, 0.2);
}

.tag-active:hover {
  background: var(--highlight);
  border-color: var(--ink);
}

/* ===== Divider ===== */
.divider {
  display: block;
  height: 3px;
  background: linear-gradient(
    to right,
    var(--red-orange) 0,
    var(--red-orange) 50px,
    var(--surface) 50px,
    var(--surface) 100%
  );
  border-radius: 2px;
  margin-block: 1.5rem;
}

/* ===== Image Placeholder ===== */
.image-placeholder {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius-md) var(--radius-lg) var(--radius-md) var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted-ink);
  font-size: 0.85rem;
  font-family: var(--font-ui);
  border: 1px dashed rgba(92, 81, 70, 0.25);
}

.image-placeholder::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: repeating-linear-gradient(
    -45deg,
    var(--red-orange) 0 6px,
    transparent 6px 12px
  );
  opacity: 0.6;
}

.image-placeholder-lg {
  aspect-ratio: 21 / 9;
}

/* ===== Text Utilities ===== */
.text-muted {
  color: var(--muted-ink);
  font-size: 0.875rem;
}

.text-highlight {
  color: var(--red-orange);
  font-weight: 700;
}

/* ===== Responsive: Tablet ===== */
@media (min-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr 1fr;
    gap: 2rem;
  }
  .grid-split {
    grid-template-columns: 240px 1fr;
    gap: 2rem;
  }
  .data-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .brand-tagline {
    display: inline-block;
  }
}

/* ===== Responsive: Desktop Nav ===== */
@media (min-width: 1024px) {
  .main-nav {
    position: static;
    display: block;
    background: transparent;
    box-shadow: none;
    padding: 0;
    flex: 1;
  }
  .nav-list {
    flex-direction: row;
    align-items: center;
    gap: 0.15rem;
    justify-content: center;
  }
  .nav-link {
    padding: 0.45rem 0.65rem;
    font-size: 0.9rem;
    border-radius: var(--radius-sm) var(--radius-md) var(--radius-sm) var(--radius-md);
  }
  .nav-toggle {
    display: none;
  }
  .header-inner {
    gap: 1.5rem;
  }
  .league-switcher {
    font-size: 0.78rem;
    padding: 0.3rem 0.7rem;
  }
}

/* ===== Responsive: Mobile Footer ===== */
@media (max-width: 767px) {
  .footer-bottom-inner {
    flex-direction: column;
    text-align: center;
    gap: 0.3rem;
  }
  .footer-meta-links {
    justify-content: center;
  }
  .footer-links {
    grid-template-columns: 1fr 1fr;
    gap: 0.2rem;
  }
  .site-header {
    --header-h: 56px;
  }
  .brand-link {
    font-size: 1.25rem;
  }
  .league-switcher {
    display: none;
  }
  .header-extra {
    gap: 0.4rem;
  }
  .section {
    padding-block: 1.5rem;
  }
  .card {
    padding: 1rem;
  }
  .back-to-top {
    bottom: 1rem;
    right: 1rem;
    width: 44px;
    height: 44px;
    font-size: 1.1rem;
  }
}

/* ===== Reduced Motion ===== */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
  .back-to-top {
    transform: none;
    opacity: 0;
  }
  .back-to-top.is-visible {
    opacity: 1;
    transform: none;
  }
}
