/* General styles and resets */
body {
  margin: 0;
  font-family: 'Arial', sans-serif;
  color: var(--text-main);
  background-color: var(--bg-color);
  line-height: 1.6;
  padding-top: var(--header-offset); /* Important: Body padding for fixed header */
  overflow-x: hidden; /* Prevent horizontal scroll on desktop */
}

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

ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* Color variables */
:root {
  --primary-color: #11A84E;
  --secondary-color: #22C768;
  --button-gradient: linear-gradient(180deg, #2AD16F 0%, #13994A 100%);
  --card-bg: #11271B;
  --bg-color: #08160F;
  --text-main: #F2FFF6;
  --text-secondary: #A7D9B8;
  --border-color: #2E7A4E;
  --glow-color: #57E38D;
  --gold-color: #F2C14E;
  --divider-color: #1E3A2A;
  --deep-green: #0A4B2C;
  
  /* Header offset calculation */
  --header-offset: 122px; /* Desktop: 68px (header-top) + 52px (main-nav) + 2px buffer */
}

/* Site Header - Fixed Navigation */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  background-color: var(--deep-green); /* Fallback, specific sections have their own */
  box-sizing: border-box;
  overflow-x: hidden; /* Prevent horizontal scroll within header */
}

/* Header Top Area (Desktop) */
.header-top {
  box-sizing: border-box;
  min-height: 68px;
  height: 68px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background-color: var(--deep-green); /* Specific color for header-top */
  width: 100%;
}

.header-container {
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 30px; /* Padding for desktop container */
}

.logo {
  font-size: 28px;
  font-weight: bold;
  color: var(--gold-color); /* Brand color for logo */
  text-shadow: 0 0 5px var(--glow-color);
  flex-shrink: 0; /* Prevent logo from shrinking */
}

/* Desktop Nav Buttons */
.desktop-nav-buttons {
  display: flex;
  gap: 12px;
  align-items: center;
}

.btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 25px;
  font-size: 15px;
  font-weight: bold;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  background: var(--button-gradient);
  color: var(--text-main);
  border: none;
}

.btn:hover {
  opacity: 0.9;
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4);
}

/* Main Navigation Area (Desktop) */
.main-nav {
  box-sizing: border-box;
  min-height: 52px;
  height: 52px;
  display: flex; /* Desktop default: flex */
  align-items: center;
  overflow: hidden;
  background-color: var(--primary-color); /* Specific color for main-nav */
  width: 100%;
}

.nav-container {
  box-sizing: border-box;
  height: 100%;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: row; /* Desktop default: row */
  justify-content: center;
  align-items: center;
  padding: 0 20px;
}

.nav-list {
  display: flex;
  gap: 25px; /* Spacing between desktop nav items */
}

.nav-list a {
  padding: 8px 0;
  font-size: 16px;
  font-weight: 500;
  color: var(--text-main);
  transition: color 0.3s ease;
  white-space: nowrap; /* Prevent nav items from wrapping */
}

.nav-list a:hover {
  color: var(--gold-color); /* Hover effect */
}

/* Mobile Nav Buttons (Hidden on Desktop) */
.mobile-nav-buttons {
  box-sizing: border-box;
  display: none; /* Desktop default: hidden */
  min-height: 48px; /* Placeholder height, actual height depends on content */
  background-color: var(--card-bg); /* Distinct background for mobile buttons */
  width: 100%;
  align-items: center; /* Vertically center buttons */
  justify-content: center; /* Horizontally center buttons */
  padding: 10px 15px; /* Padding for mobile button container */
  gap: 10px; /* Gap between buttons */
}

/* Hamburger Menu (Hidden on Desktop) */
.hamburger-menu {
  display: none; /* Desktop default: hidden */
  flex-direction: column;
  justify-content: space-between;
  width: 30px;
  height: 20px;
  cursor: pointer;
  z-index: 1001; /* Above header */
}

.hamburger-menu .bar {
  width: 100%;
  height: 3px;
  background-color: var(--text-main);
  transition: all 0.3s ease;
  border-radius: 2px;
}

/* Mobile Overlay (Hidden on Desktop) */
.mobile-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 999; /* Below menu, above main content */
  display: none; /* Hidden by default */
  opacity: 0;
  transition: opacity 0.3s ease;
}

.mobile-overlay.active {
  display: block;
  opacity: 1;
}

/* Footer Styles */
.site-footer {
  background-color: var(--card-bg); /* Footer background */
  padding: 40px 0 20px;
  color: var(--text-secondary);
  font-size: 14px;
  box-sizing: border-box;
  width: 100%;
}

.footer-top-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* 4 columns for desktop */
  gap: 30px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 30px;
  box-sizing: border-box;
}

.footer-col {
  padding-bottom: 20px; /* Consistent spacing */
}

.footer-logo {
  font-size: 24px;
  font-weight: bold;
  color: var(--gold-color);
  text-shadow: 0 0 3px var(--glow-color);
  margin-bottom: 15px;
  display: block;
}

.footer-description {
  margin-top: 0;
  line-height: 1.8;
  color: var(--text-secondary);
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.footer-heading {
  font-size: 18px;
  color: var(--text-main);
  margin-bottom: 20px;
  position: relative;
  padding-bottom: 10px;
}

.footer-heading::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 40px;
  height: 2px;
  background-color: var(--primary-color);
}

.footer-nav li {
  margin-bottom: 10px;
}

.footer-nav a {
  color: var(--text-secondary);
  transition: color 0.3s ease;
}

.footer-nav a:hover {
  color: var(--primary-color);
}

.footer-bottom {
  text-align: center;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid var(--divider-color);
  color: var(--text-secondary);
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 30px;
  padding-right: 30px;
}

/* Dynamic slot anchors - ensure visibility */
.footer-slot-anchor-inner {
  min-height: 1px; /* Ensure it takes up space even if empty */
  width: 100%;
}


/* Mobile Styles */
@media (max-width: 768px) {
  /* Header offset calculation for mobile */
  :root {
    --header-offset: 110px; /* Mobile: 60px (header-top) + 48px (mobile-nav-buttons) + 2px buffer */
  }

  /* Header Top Area (Mobile) */
  .header-top {
    min-height: 60px;
    height: 60px;
    padding-left: 15px; /* Smaller padding for mobile */
    padding-right: 15px;
  }

  .header-container {
    padding: 0; /* Remove container padding as header-top handles it */
    max-width: none; /* No max-width on mobile */
    width: 100%;
    position: relative; /* For absolute positioning of hamburger */
    display: flex; /* Use flex to align items */
    align-items: center;
    justify-content: space-between; /* Keep for general spacing if other elements are present */
  }

  .hamburger-menu {
    display: flex; /* Show hamburger on mobile */
    position: absolute; /* Position absolutely to not interfere with logo centering */
    left: 15px; /* Align with header-top padding */
    top: 50%;
    transform: translateY(-50%);
    z-index: 1001;
    flex-shrink: 0;
  }

  .hamburger-menu.active .bar:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }

  .hamburger-menu.active .bar:nth-child(2) {
    opacity: 0;
  }

  .hamburger-menu.active .bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }

  .logo {
    flex-grow: 1; /* Allow logo to take available space */
    display: flex; /* Make logo itself a flex container */
    justify-content: center; /* Center the text "7ball" inside the logo flex item */
    align-items: center;
    padding: 0; /* Remove previous padding to allow centering */
    font-size: 24px;
  }

  /* Hide desktop buttons on mobile */
  .desktop-nav-buttons {
    display: none !important;
  }

  /* Show mobile buttons on mobile */
  .mobile-nav-buttons {
    display: flex !important; /* Force display on mobile */
    min-height: 48px;
    height: auto; /* Allow height to adjust if text wraps */
    flex-wrap: nowrap; /* Ensure buttons stay in one row */
    align-items: center;
    justify-content: center;
    padding: 8px 15px; /* Smaller padding for mobile button container */
    background-color: var(--card-bg); /* Match header-top or a new color */
    border-top: 1px solid var(--divider-color);
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.2);
  }

  .mobile-nav-buttons .btn {
    flex: 1; /* Distribute space evenly */
    min-width: 0; /* Allow shrinking */
    max-width: calc(50% - 5px); /* Max width for two buttons with 10px gap */
    padding: 8px 12px; /* Smaller padding for mobile buttons */
    font-size: 13px; /* Smaller font size */
    white-space: normal; /* Allow text to wrap */
    word-wrap: break-word;
    overflow-wrap: break-word;
    border-radius: 20px;
  }

  /* Main Navigation Area (Mobile - Off-canvas) */
  .main-nav {
    display: none; /* Hidden by default for off-canvas */
    position: fixed;
    top: var(--header-offset); /* Below fixed header and mobile buttons */
    left: 0;
    width: 280px; /* Width of the off-canvas menu */
    height: calc(100% - var(--header-offset)); /* Full height below header */
    background-color: var(--card-bg); /* Menu background */
    flex-direction: column; /* Vertical menu items */
    padding: 20px 0;
    transform: translateX(-100%); /* Off-screen by default */
    transition: transform 0.3s ease;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.5);
    z-index: 1001; /* Above overlay */
    overflow-y: auto; /* Enable scrolling for long menus */
    -webkit-overflow-scrolling: touch;
  }

  .main-nav.active {
    display: flex; /* Show menu when active */
    transform: translateX(0); /* Slide into view */
  }

  .nav-container {
    flex-direction: column;
    align-items: flex-start;
    padding: 0 20px;
    max-width: none;
  }

  .nav-list {
    flex-direction: column;
    width: 100%;
    gap: 0; /* Remove gap for vertical list */
  }

  .nav-list li {
    width: 100%;
    border-bottom: 1px solid var(--divider-color);
  }

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

  .nav-list a {
    display: block;
    padding: 12px 0;
    font-size: 16px;
    color: var(--text-main);
  }

  /* Footer Mobile Styles */
  .footer-top-grid {
    grid-template-columns: 1fr; /* Single column on mobile */
    padding: 0 15px;
  }

  .footer-col {
    padding-bottom: 30px;
  }

  .footer-col:last-of-type {
    padding-bottom: 0;
  }

  .footer-bottom {
    padding-left: 15px;
    padding-right: 15px;
  }

  /* Mobile Content Overflow Protection */
  .page-content img {
    max-width: 100% !important;
    height: auto !important;
    display: block;
  }
  .page-content {
    overflow-x: hidden;
    max-width: 100%;
  }
  body {
    overflow-x: hidden;
  }
}
/* 移动端内容区防溢出（系统追加，请勿删除） */
@media (max-width: 768px) {
  .page-content img {
    max-width: 100% !important;
    height: auto !important;
    display: block;
  }
  .page-content {
    overflow-x: hidden;
    max-width: 100%;
  }
  body {
    overflow-x: hidden;
  }
}
/* 内容保护（系统追加，请勿删除） */
body {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}
input, textarea, select, [contenteditable="true"] {
  -webkit-user-select: text;
  -moz-user-select: text;
  user-select: text;
}
