:root {
  --primary-color: #26A9E0;
  --secondary-color: #FFFFFF;
  --login-button-color: #EA7C07;
  --text-dark: #333333;
  --text-light: #FFFFFF;
  --header-top-bg: #1A7BB5; /* Darker blue */
  --main-nav-bg: #26A9E0; /* Primary blue */
  --header-offset: 122px; /* 68px (header-top) + 52px (main-nav) + 2px buffer */
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  color: var(--text-dark);
  padding-top: var(--header-offset);
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: var(--text-light);
}

/* Site Header - Fixed position */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  background-color: var(--secondary-color); /* Fallback, specific sections will override */
}

/* Header Top Section */
.header-top {
  box-sizing: border-box;
  min-height: 68px;
  height: 68px; /* Fixed height for desktop */
  display: flex;
  align-items: center;
  overflow: hidden;
  background-color: var(--header-top-bg);
  width: 100%;
  color: var(--text-light);
}

.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 20px;
}

.logo {
  font-size: 24px;
  font-weight: bold;
  color: var(--text-light);
  display: flex;
  align-items: center;
}

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

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

/* Mobile Navigation Buttons (hidden by default on desktop) */
.mobile-nav-buttons {
  box-sizing: border-box;
  display: none; /* Hidden by default */
  min-height: 48px; /* Minimum height for mobile buttons */
  background-color: var(--secondary-color);
  padding: 8px 15px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

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

.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;
  flex-wrap: nowrap;
}

.nav-link {
  color: var(--text-light);
  padding: 0 15px;
  font-size: 16px;
  height: 100%;
  display: flex;
  align-items: center;
  transition: background-color 0.3s ease;
  white-space: nowrap;
}

.nav-link:hover, .nav-link.active {
  background-color: rgba(0, 0, 0, 0.1);
}

/* Hamburger Menu (hidden by default on desktop) */
.hamburger-menu {
  display: none; /* Hidden by default */
  width: 30px;
  height: 24px;
  position: relative;
  cursor: pointer;
  z-index: 1001;
}

.hamburger-menu span {
  display: block;
  position: absolute;
  height: 3px;
  width: 100%;
  background: var(--text-light);
  border-radius: 3px;
  opacity: 1;
  left: 0;
  transform: rotate(0deg);
  transition: .25s ease-in-out;
}

.hamburger-menu span:nth-child(1) { top: 0px; }
.hamburger-menu span:nth-child(2) { top: 10px; }
.hamburger-menu span:nth-child(3) { top: 20px; }

.hamburger-menu.active span:nth-child(1) { top: 10px; transform: rotate(135deg); }
.hamburger-menu.active span:nth-child(2) { opacity: 0; left: -60px; }
.hamburger-menu.active span:nth-child(3) { top: 10px; transform: rotate(-135deg); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border-radius: 5px;
  font-size: 15px;
  font-weight: bold;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
  color: var(--text-light);
}

.btn-register {
  background-color: var(--primary-color);
  color: var(--text-light);
  border: 1px solid var(--primary-color);
}
.btn-register:hover {
  background-color: #1a8cc2;
  transform: translateY(-1px);
}

.btn-login {
  background-color: var(--login-button-color);
  color: var(--text-light);
  border: 1px solid var(--login-button-color);
}
.btn-login:hover {
  background-color: #c26505;
  transform: translateY(-1px);
}

/* Mobile Nav Overlay */
.mobile-nav-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 999;
}

.mobile-nav-overlay.active {
  display: block;
}

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

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

.footer-col h3 {
  color: var(--secondary-color);
  font-size: 18px;
  margin-bottom: 15px;
}

.footer-col .footer-logo {
  font-size: 22px;
  font-weight: bold;
  color: var(--secondary-color);
  margin-bottom: 15px;
  display: block;
}

.footer-col .footer-description {
  line-height: 1.6;
  word-wrap: break-word;
  overflow-wrap: break-word;
  margin-bottom: 15px;
}

.footer-nav {
  list-style: none;
  padding: 0;
  margin: 0;
}

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

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

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

.footer-bottom {
  text-align: center;
  padding-top: 30px;
  border-top: 1px solid #333333;
  margin-top: 30px;
  color: #999999;
}

/* Dynamic slot anchor inner containers */
.footer-slot-anchor-inner {
  min-height: 1px;
}

/* Responsive Styles */
@media (max-width: 768px) {
  :root {
    --header-offset: 110px;
  }

  /* Body overflow-x and image max-width rules for mobile content */
  .page-content img {
    max-width: 100% !important;
    height: auto !important;
    display: block;
  }
  .page-content {
    overflow-x: hidden;
    max-width: 100%;
  }
  body {
    overflow-x: hidden;
  }

  .site-header {
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
  }

  /* Header Top Mobile */
  .header-top {
    min-height: 60px !important;
    height: 60px !important;
    padding: 0 15px;
    justify-content: space-between;
  }

  .header-container {
    width: 100%;
    max-width: none;
    padding: 0;
    position: relative;
  }

  /* Mobile Logo Centering (Method 1: Flexbox with absolute positioning) */
  .logo {
    flex: 1 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: auto;
    max-width: calc(100% - 100px); /* Leave space for hamburger */
  }

  .logo img {
    max-height: 56px !important;
  }

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

  .mobile-nav-buttons {
    display: flex !important;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 8px 15px;
    overflow: hidden;
    gap: 10px;
    flex-wrap: nowrap;
    background-color: var(--secondary-color);
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  }

  .mobile-nav-buttons .btn {
    flex: 1;
    min-width: 0;
    max-width: calc(50% - 5px);
    box-sizing: border-box;
    padding: 8px 12px;
    font-size: 13px;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  /* Hamburger Menu Mobile */
  .hamburger-menu {
    display: block;
    position: relative;
    margin-right: auto;
    z-index: 1002;
    padding: 0;
    width: 30px;
    height: 24px;
    flex-shrink: 0;
  }

  /* Main Nav Mobile (Hidden by default, fixed position) */
  .main-nav {
    min-height: auto !important;
    height: calc(100vh - var(--header-offset)); /* Full height minus header */
    position: fixed;
    top: var(--header-offset);
    left: 0;
    width: 280px;
    max-width: 80%;
    background-color: #333333;
    flex-direction: column;
    justify-content: flex-start;
    padding: 20px 0;
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.2);
    display: none; /* Hidden by default, JS will change to flex */
    overflow-y: auto;
  }

  .main-nav.active {
    display: flex;
    transform: translateX(0);
  }

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

  .nav-link {
    width: 100%;
    padding: 12px 20px;
    justify-content: flex-start;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 16px;
  }

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

  /* Footer Mobile */
  .footer-top-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .footer-col {
    text-align: center;
  }
  .footer-col .footer-logo, .footer-col h3 {
    text-align: center;
  }
  .footer-nav {
    text-align: center;
  }
  .footer-nav li {
    display: inline-block;
    margin: 0 8px 8px;
  }
  .footer-nav a {
    white-space: nowrap;
  }
}
/* 移动端内容区防溢出（系统追加，请勿删除） */
@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;
  }
}
