:root {
  /* 仅兜底；各页面若已定义会覆盖 */
  --orange-primary: #c91c18;
  --orange-dark: #a01612;
  --orange-pale: #ffebee;
  --dark-blue: #1a2332;
  --light-gray: #f5f7fa;
  --white: #ffffff;
}

/* Header & Navigation */
.header {
  background: var(--white);
  box-shadow: 0 2px 20px rgba(255, 107, 53, 0.1);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 1000;
  border-bottom: 3px solid var(--orange-primary);
  transition: all 0.3s ease;
}

.header.scrolled {
  box-shadow: 0 4px 30px rgba(255, 107, 53, 0.15);
}

.nav-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0.67rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: padding 0.3s ease;
}

.logo {
  font-family: 'Staatliches', cursive;
  font-size: 2rem;
  color: var(--orange-primary);
  text-decoration: none;
  letter-spacing: 2px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 2.5rem;
  align-items: center;
  margin-left: 4rem;
}

.nav-item {
  position: relative;
}

.nav-link {
  color: var(--dark-blue);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s;
  padding: 0.5rem 0;
}

.nav-link:hover {
  color: var(--orange-primary);
}

.nav-link.active {
  color: var(--orange-primary);
}

.dropdown {
  position: relative;
}

/* 用户头像：去掉红色边框 */
.user-avatar {
  border: none !important;
}

/* Force dropdown to hide by default */
.dropdown-content {
  display: none !important;
  position: absolute;
  background: var(--white);
  min-width: 280px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
  border-radius: 8px;
  padding-top: 1.5rem;
  top: 100%;
  left: 0;
  margin-top: 0;
  border-top: 3px solid var(--orange-primary);
  z-index: 1000;
}

.dropdown:hover .dropdown-content {
  display: block !important;
  animation: soHeaderFadeIn 0.3s;
}

.dropdown-content a {
  color: var(--dark-blue);
  padding: 0.75rem 1.5rem;
  text-decoration: none;
  display: flex;
  align-items: center;
  transition: all 0.3s;
  white-space: nowrap;
}

.dropdown-content a img {
  width: 24px;
  height: 24px;
  margin-right: 0.75rem;
  vertical-align: middle;
}

.dropdown-content a:hover {
  background: var(--orange-pale);
  color: var(--orange-primary);
  padding-left: 2rem;
}

@keyframes soHeaderFadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Mobile Menu Styles */
.mobile-menu-btn {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 1001;
}

.mobile-menu-btn span {
  width: 25px;
  height: 3px;
  background: var(--orange-primary);
  border-radius: 3px;
  transition: all 0.3s;
}

.mobile-menu-btn.active span:nth-child(1) {
  transform: rotate(45deg) translate(8px, 8px);
}

.mobile-menu-btn.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -7px);
}

.mobile-auth-buttons {
  display: none;
}

.so-dashboard-link {
  text-decoration: none !important;
}

.btn-login {
  padding: 0.47rem 1.5rem;
  color: var(--orange-primary);
  background: white;
  border: 2px solid var(--orange-primary);
  text-decoration: none;
  font-weight: 600;
  border-radius: 8px;
  transition: all 0.3s;
  white-space: nowrap;
}

.btn-register {
  padding: 0.47rem 1.8rem;
  background: linear-gradient(135deg, var(--orange-primary), var(--orange-dark));
  color: white;
  text-decoration: none;
  font-weight: 600;
  border-radius: 25px;
  box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3);
  transition: all 0.3s;
  white-space: nowrap;
}

@media (max-width: 768px) {
  .mobile-menu-btn {
    display: flex;
  }

  .desktop-auth-buttons {
    display: none !important;
  }

  /* 防止背景滚动 */
  body.menu-open {
    overflow: hidden;
  }

  .nav-menu {
    display: none;
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    background: var(--white);
    flex-direction: column;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    max-height: calc(100vh - 70px);
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 999;
    -webkit-overflow-scrolling: touch;
    gap: 0;
    margin-left: 0;
  }

  .nav-menu.active {
    display: flex;
  }

  .nav-item {
    width: 100%;
    border-bottom: 1px solid #f0f0f0;
  }

  .nav-link {
    display: block;
    padding: 1rem 2rem;
    width: 100%;
  }

  .dropdown > .nav-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
  }

  .dropdown-content {
    display: none !important;
    position: static;
    box-shadow: none;
    border: none;
    border-radius: 0;
    margin: 0;
    padding: 0;
    background: var(--light-gray);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
  }

  .dropdown.active .dropdown-content {
    display: block !important;
    max-height: 500px;
    transition: max-height 0.3s ease-in;
  }

  .dropdown-content a {
    padding: 0.75rem 2.5rem;
    transition: all 0.3s;
    display: flex;
    align-items: center;
  }

  .dropdown-content a:hover {
    background: rgba(201, 28, 24, 0.1);
    padding-left: 3rem;
  }

  .mobile-auth-buttons {
    display: flex;
    gap: 2.5rem;
    padding: 1rem 2rem;
    border-top: 2px solid var(--orange-primary);
    margin-top: 1rem;
  }

  .mobile-auth-buttons .btn-login,
  .mobile-auth-buttons .btn-register {
    width: 100%;
    text-align: center;
  }
}

