/* ============ 基础变量与重置 ============ */
:root {
  --primary: #2F6BFF;
  --secondary: #6FA3FF;
  --btn-gradient: linear-gradient(180deg, #4A8BFF 0%, #2F6BFF 100%);
  --card-bg: #FFFFFF;
  --bg: #F4F7FB;
  --text-main: #1F2D3D;
  --border-color: #D6E2FF;
  --glow: #A5C4FF;
  --header-offset: 122px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  padding-top: var(--header-offset);
  font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
  color: var(--text-main);
  background-color: var(--bg);
  line-height: 1.6;
}
a { text-decoration: none; color: inherit; }
ul { list-style: none; margin: 0; padding: 0; }
img { max-width: 100%; height: auto; }

/* ============ 页头：悬浮固定 ============ */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 1000;
  box-shadow: 0 4px 18px rgba(31, 45, 61, 0.18);
}

/* ---- 顶部区域 header-top ---- */
.header-top {
  width: 100%;
  height: 68px;
  min-height: 68px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background-color: var(--primary);
  background-image: linear-gradient(90deg, #2F6BFF 0%, #2353CC 100%);
  border-bottom: 1px solid rgba(255,255,255,0.12);
}
.header-container {
  width: 100%;
  height: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.logo {
  display: inline-block;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #FFFFFF;
  text-transform: lowercase;
  line-height: 1;
  white-space: nowrap;
}
.logo:hover { color: var(--glow); }
.logo img {
  display: block;
  max-height: 60px;
  height: auto;
  width: auto;
  max-width: 280px;
  object-fit: contain;
}

/* ---- 按钮通用 ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 9px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
  box-sizing: border-box;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.05); }
.btn-login {
  background: transparent;
  color: #FFFFFF;
  border: 1px solid rgba(255,255,255,0.85);
}
.btn-login:hover { background: rgba(255,255,255,0.16); color: #FFFFFF; }
.btn-register {
  background: linear-gradient(180deg, #FFFFFF 0%, #E8F0FF 100%);
  color: var(--primary);
  box-shadow: 0 3px 12px rgba(165, 196, 255, 0.55);
}
.btn-register:hover { color: #2353CC; }

.desktop-nav-buttons {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* 桌面端默认隐藏移动端按钮条 */
.mobile-nav-buttons {
  display: none;
  min-height: 48px;
  box-sizing: border-box;
}

/* ---- 主导航条 main-nav ---- */
.main-nav {
  width: 100%;
  height: 52px;
  min-height: 52px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background-color: #FFFFFF;
  background-image: linear-gradient(180deg, #FFFFFF 0%, #EDF3FF 100%);
  border-bottom: 1px solid var(--border-color);
}
.nav-container {
  width: 100%;
  height: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  position: relative;
}
.nav-menu {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 4px;
  flex-wrap: nowrap;
  margin: 0 auto;
}
.nav-menu li { display: inline-block; }
.nav-menu li a {
  display: inline-block;
  padding: 6px 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  border-radius: 6px;
  white-space: nowrap;
  transition: color 0.2s ease, background-color 0.2s ease;
}
.nav-menu li a:hover,
.nav-menu li a.active {
  color: var(--primary);
  background-color: #E3ECFF;
}
/* 导航条中的动作按钮（桌面显式隐藏第二组重复按钮） */
.nav-actions { display: none; }

/* 汉堡按钮：桌面隐藏 */
.hamburger-menu {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 30px;
  height: 22px;
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  z-index: 1001;
}
.hamburger-menu span {
  display: block;
  width: 100%;
  height: 3px;
  border-radius: 2px;
  background-color: var(--text-main);
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.hamburger-menu.active span:nth-child(1) { transform: translateY(9.5px) rotate(45deg); }
.hamburger-menu.active span:nth-child(2) { opacity: 0; }
.hamburger-menu.active span:nth-child(3) { transform: translateY(-9.5px) rotate(-45deg); }

/* 遮罩层：默认隐藏 */
.mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 999;
  margin: 0;
  padding: 0;
  top: 0;
}
.mobile-overlay.active { opacity: 1; visibility: visible; }

/* ============ 页脚 ============ */
.site-footer {
  background-color: #0F1E3D;
  background-image: linear-gradient(180deg, #132B57 0%, #0B1730 100%);
  color: #D9E4F7;
  margin-top: 40px;
  font-size: 14px;
}
.footer-top-row { width: 100%; }
.footer-top-grid {
  max-width: 1200px;
  margin: 0 auto;
  padding: 44px 24px 28px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 28px;
}
.footer-col { min-width: 0; }
.footer-about { display: flex; flex-direction: column; }
.footer-logo {
  display: inline-block;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #FFFFFF;
  margin-bottom: 12px;
  line-height: 1;
}
.footer-logo:hover { color: var(--glow); }
.footer-description {
  margin: 0 0 12px;
  font-size: 13.5px;
  line-height: 1.7;
  color: #B9C9E6;
  word-wrap: break-word;
  overflow-wrap: break-word;
}
.footer-title {
  margin: 0 0 14px;
  font-size: 16px;
  font-weight: 700;
  color: #FFFFFF;
  position: relative;
  padding-bottom: 8px;
}
.footer-title::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 36px;
  height: 2px;
  background: var(--secondary);
  border-radius: 2px;
}
.footer-nav { display: flex; flex-direction: column; gap: 8px; }
.footer-nav a {
  color: #B9C9E6;
  font-size: 13.5px;
  transition: color 0.2s ease, padding-left 0.2s ease;
}
.footer-nav a:hover { color: var(--glow); padding-left: 3px; }

.footer-slot-anchor-inner { min-height: 1px; }
.footer-dynamic-col { min-height: 1px; }

.footer-mid-area {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 20px;
}
.footer-slot-mid { min-height: 1px; }
.footer-mid-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 8px;
}
.footer-slot-bottom { max-width: 1200px; margin: 0 auto; padding: 0 24px; min-height: 1px; }

.footer-bottom {
  margin-top: 18px;
  background: rgba(0, 0, 0, 0.28);
  border-top: 1px solid rgba(165, 196, 255, 0.18);
  text-align: center;
  padding: 16px 24px;
}
.footer-bottom p {
  margin: 0;
  font-size: 13px;
  color: #A9BCDD;
  line-height: 1.5;
}

/* ============ 移动端 ============ */
@media (max-width: 768px) {
  :root { --header-offset: 110px; }

  .header-top {
    height: 60px !important;
    min-height: 60px !important;
  }
  .header-container {
    width: 100%;
    max-width: none;
    padding-left: 15px;
    padding-right: 15px;
  }
  .logo {
    flex: 1 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    font-size: 22px;
  }
  .logo img { max-height: 56px !important; }

  .desktop-nav-buttons { display: none !important; }

  .mobile-nav-buttons {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 6px 15px;
    overflow: hidden;
    gap: 10px;
    flex-wrap: nowrap;
    background-color: #EDF3FF;
    border-bottom: 1px solid var(--border-color);
    min-height: 48px;
  }
  .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;
  }
  .mobile-nav-buttons .btn-login {
    background: #FFFFFF;
    color: var(--primary);
    border: 1px solid var(--primary);
  }
  .mobile-nav-buttons .btn-login:hover { background: #E3ECFF; color: var(--primary); }
  .mobile-nav-buttons .btn-register {
    background: var(--btn-gradient);
    color: #FFFFFF;
    box-shadow: 0 3px 10px rgba(47, 107, 255, 0.35);
  }
  .mobile-nav-buttons .btn-register:hover { color: #FFFFFF; }

  .main-nav {
    height: 48px !important;
    min-height: 48px !important;
    display: flex;
    background-color: #FFFFFF;
  }
  .nav-container {
    width: 100%;
    max-width: none;
    padding: 0 15px;
    justify-content: space-between;
  }
  .hamburger-menu { display: flex !important; }
  .nav-actions { display: none !important; }

  /* 移动端菜单：默认隐藏 */
  .nav-menu {
    display: none;
    position: fixed;
    top: var(--header-offset);
    left: 0;
    width: 82%;
    max-width: 320px;
    height: calc(100vh - var(--header-offset));
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    gap: 0;
    margin: 0;
    padding: 18px 16px 40px;
    background-color: #FFFFFF;
    box-shadow: 6px 0 24px rgba(15, 23, 42, 0.22);
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 1001;
  }
  .nav-menu li { display: block; width: 100%; }
  .nav-menu li a {
    display: block;
    width: 100%;
    padding: 12px 14px;
    font-size: 15px;
    border-radius: 8px;
    border-bottom: 1px solid #EEF3FF;
    white-space: normal;
  }
  /* 移动端菜单：激活显示（display 与 transform 必须同时设置） */
  .nav-menu.active {
    display: flex;
    transform: translateX(0);
  }
  .mobile-overlay.active { display: block; }

  /* 页脚移动端：单列 */
  .footer-top-grid {
    grid-template-columns: 1fr;
    gap: 22px;
    padding: 32px 16px 22px;
  }
  .footer-mid-area { padding: 0 16px 16px; }
  .footer-mid-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-slot-bottom { padding: 0 16px; }
  .footer-bottom { padding: 14px 16px; }

  /* 移动端内容区防溢出 */
  .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.no-scroll { overflow: 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;
}
