/* General Reset & Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Arial', sans-serif;
  line-height: 1.6;
  color: #333333;
  background-color: #FFFFFF; /* Custom color for 'background' */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Header Offset for fixed header */
:root {
  --header-offset: 122px; /* 68px (header-top) + 52px (main-nav) + 2px buffer */
}
body {
  padding-top: var(--header-offset);
}

a {
  text-decoration: none;
  color: #26A9E0;
}

ul {
  list-style: none;
}

/* Site Header - Fixed Navigation */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 1000;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Header Top Area */
.header-top {
  background-color: #000000; /* Custom color #000000 for header-top, provides strong contrast */
  min-height: 68px;
  height: 68px;
  display: flex;
  align-items: center;
  overflow: hidden;
  color: #FFFFFF;
}

.header-container {
  width: 100%;
  height: 100%;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
}

.logo {
  font-size: 24px;
  font-weight: bold;
  color: #FFFFFF;
  text-transform: uppercase;
  display: block; /* Ensure it's a block for flex alignment */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.logo img {
  display: block;
  max-height: 60px; /* Matches header-top height */
  height: auto;
  width: auto;
  max-width: 280px;
  object-fit: contain;
}

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

.hamburger-menu span {
  display: block;
  height: 3px;
  width: 100%;
  background-color: #FFFFFF;
  border-radius: 2px;
  transition: all 0.3s ease-in-out;
}

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

/* Mobile Navigation Buttons (Desktop - Hidden) */
.mobile-nav-buttons {
  display: none; /* Hidden by default on desktop */
  box-sizing: border-box;
  min-height: 48px;
}

/* Main Navigation Area */
.main-nav {
  background-color: #26A9E0; /* Main color for main-nav, contrasts with header-top */
  min-height: 52px;
  height: 52px;
  display: flex; /* Display flex for desktop */
  align-items: center;
  overflow: hidden;
}

.main-nav .nav-container {
  width: 100%;
  height: 100%;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  padding: 0 20px;
}

.nav-link {
  color: #FFFFFF;
  padding: 10px 15px;
  font-weight: bold;
  white-space: nowrap;
  transition: background-color 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 5px;
  font-weight: bold;
  text-align: center;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
  text-decoration: none; /* Remove underline for buttons */
  white-space: nowrap;
}

.btn-login {
  background-color: #EA7C07; /* Custom color for login */
  color: #FFFFFF;
}

.btn-register {
  background-color: #26A9E0; /* Main color for register */
  color: #FFFFFF;
}

.btn:hover {
  transform: translateY(-2px);
  opacity: 0.9;
}

/* Overlay for mobile menu */
.overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 999;
  backdrop-filter: blur(2px);
}

/* Footer Styles */
.site-footer {
  background-color: #333333;
  color: #FFFFFF;
  padding: 40px 20px 20px;
  font-size: 14px;
}

.footer-top-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  max-width: 1200px;
  margin: 0 auto 30px;
}

.footer-col {
  padding: 10px 0;
}

.footer-logo {
  font-size: 20px;
  font-weight: bold;
  color: #FFFFFF;
  text-transform: uppercase;
  margin-bottom: 15px;
  display: block;
}

.footer-description {
  margin-top: 15px;
  color: #CCCCCC;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.footer-col h6 {
  font-size: 16px;
  margin-bottom: 15px;
  color: #26A9E0; /* Main color for footer headings */
}

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

.footer-nav a {
  color: #CCCCCC;
  transition: color 0.3s ease;
}

.footer-nav a:hover {
  color: #26A9E0; /* Main color on hover */
}

.footer-bottom {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid #444444;
  color: #AAAAAA;
  max-width: 1200px;
  margin: 0 auto;
}

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

  /* Header Top Area (Mobile) */
  .header-top {
    min-height: 60px !important;
    height: 60px !important;
  }

  .header-container {
    padding: 0 15px;
    width: 100%;
    max-width: none; /* Ensure full width on mobile */
    position: relative; /* For absolute positioning of logo if needed */
  }

  .hamburger-menu {
    display: flex; /* Show hamburger menu on mobile */
    z-index: 1002; /* Above logo and buttons */
  }

  .hamburger-menu.active span:nth-child(1) {
    transform: translateY(10px) rotate(45deg);
  }
  .hamburger-menu.active span:nth-child(2) {
    opacity: 0;
  }
  .hamburger-menu.active span:nth-child(3) {
    transform: translateY(-11px) rotate(-45deg);
  }

  .logo {
    flex: 1 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    font-size: 20px;
    position: absolute; /* Absolute positioning for precise centering */
    left: 50%;
    transform: translateX(-50%);
    height: 100%;
    max-width: calc(100% - 100px); /* Account for hamburger width */
  }

  .logo img {
    max-height: 56px !important; /* Matches mobile header-top height */
  }

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

  /* Mobile Navigation Buttons (Mobile - Visible) */
  .mobile-nav-buttons {
    display: flex !important; /* Show mobile buttons on mobile */
    min-height: 48px;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0 15px; /* Adjust padding for mobile */
    overflow: hidden;
    gap: 10px;
    flex-wrap: nowrap; /* Prevent buttons from wrapping */
    background-color: #333333; /* A neutral color for mobile button bar */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  }

  .mobile-nav-buttons .btn {
    flex: 1;
    min-width: 0; /* Allow flex items to shrink */
    max-width: calc(50% - 5px); /* Max width for two buttons with gap */
    box-sizing: border-box;
    padding: 8px 12px;
    font-size: 13px;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  /* Main Navigation Area (Mobile - Hidden by default) */
  .main-nav {
    display: none; /* Hidden by default */
    position: fixed;
    top: var(--header-offset); /* Start below the fixed header */
    left: 0;
    width: 70%; /* Adjust width as needed */
    height: calc(100vh - var(--header-offset)); /* Full height below header */
    background-color: #26A9E0; /* Main color */
    flex-direction: column;
    align-items: flex-start;
    padding: 20px;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.2);
    transform: translateX(-100%); /* Slide out to the left */
    transition: transform 0.3s ease-in-out;
    z-index: 1001;
    overflow-y: auto; /* Allow scrolling for long menus */
  }

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

  .main-nav .nav-container {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    max-width: none; /* Ensure full width */
    padding: 0;
  }

  .nav-link {
    width: 100%;
    padding: 12px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

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

  /* Overlay (Mobile - Active) */
  .overlay.active {
    display: block;
  }

  /* Prevent body scroll when menu is open */
  body.no-scroll {
    overflow: hidden;
  }

  /* Footer (Mobile) */
  .footer-top-grid {
    grid-template-columns: 1fr; /* Single column layout for footer on mobile */
    gap: 30px;
  }

  .footer-col {
    text-align: center;
  }

  .footer-col h6 {
    text-align: center;
  }

  .footer-nav {
    padding: 0;
  }

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

  .footer-nav a {
    display: block;
    padding: 5px 0;
  }

  /* 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;
  }
}
