/* 现代化头部样式 */
.modern-header {
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  border-bottom: 1px solid #cbd5e1;
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  margin-right: calc(-50vw + 50%);
  margin-top: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.header-container {
  max-width: min(2400px, 95vw);
  margin: 0 auto;
  padding: 0 max(1.5rem, 3vw);
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  width: 100%;
  box-sizing: border-box;
  gap: 2rem;
}

/* Logo样式 */
.logo-section {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: #1e293b;
  transition: opacity 0.2s ease;
}

/* 导航菜单样式 */
.nav-menu {
  flex-shrink: 0;
}

.logo-section:hover {
  text-decoration: none;
  color: #1e293b;
  opacity: 0.8;
}

.logo {
  width: 32px;
  height: 32px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-name {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
  color: #1e293b;
  letter-spacing: -0.025em;
}

.brand-tagline {
  font-size: 0.75rem;
  color: #64748b;
  margin: 0;
  font-weight: 400;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 0 0 auto;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 0 0 auto;
}

.nav-item {
  position: relative;
}

.nav-link {
  color: #475569;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  transition: all 0.2s ease;
  position: relative;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  color: #1e293b;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.nav-link.active {
  background: rgba(255, 255, 255, 0.8);
  color: #1e293b;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* 超宽屏优化 */
@media (min-width: 2560px) {
  .header-container {
    max-width: min(2800px, 95vw);
  }
}

/* 移动端汉堡菜单样式 */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-around;
  width: 30px;
  height: 30px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 1001;
}

.hamburger-line {
  width: 25px;
  height: 3px;
  background: #475569;
  border-radius: 2px;
  transition: all 0.3s ease;
  transform-origin: center;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(1) {
  transform: rotate(45deg) translate(6px, 6px);
}

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

.mobile-menu-toggle.active .hamburger-line:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

/* 移动端响应式 */
@media (max-width: 768px) {
  .header-container {
    padding: 0 1rem;
    height: 56px;
  }
  
  .mobile-menu-toggle {
    display: flex !important;
  }
  
  .main-nav {
    position: fixed;
    top: 56px;
    left: 0;
    width: 100%;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-bottom: 1px solid #cbd5e1;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
    flex-direction: column;
    padding: 1rem;
    gap: 0.5rem;
  }
  
  .main-nav.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }
  
  .nav-menu {
    flex-direction: column;
    width: 100%;
    gap: 0.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
  }
  
  .nav-item {
    width: 100%;
  }
  
  .nav-link {
    display: block;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border-radius: 8px;
    transition: all 0.2s ease;
  }
  
  .nav-link:hover {
    background: rgba(59, 130, 246, 0.1);
    color: rgba(59, 130, 246, 0.9);
  }
  
  .user-menu {
    margin-left: 0;
    margin-top: 0.5rem;
    width: 100%;
    justify-content: flex-start;
    order: 999; /* 确保在导航菜单之后显示 */
  }
  
  .user-menu-authenticated {
    width: 100%;
  }
  
  .user-avatar {
    width: 48px !important;
    height: 48px !important;
    font-size: 1.1rem !important;
    margin-bottom: 0.5rem;
  }
  
  .user-menu-guest {
    width: 100%;
  }
  
  .brand-name {
    font-size: 1.1rem;
  }
  
  .brand-tagline {
    display: none;
  }
}

@media (max-width: 480px) {
  .header-container {
    padding: 0 0.75rem;
    height: 52px;
  }
  
  .main-nav {
    top: 52px;
  }
  
  .brand-name {
    font-size: 1rem;
  }
  
  .nav-link {
    padding: 0.6rem 0.8rem;
    font-size: 0.9rem;
  }
}

/* 页面内容间距调整 */
.page-content {
  margin-top: 0;
}

/* 确保页面没有顶部边距 */
body {
  margin: 0 !important;
  padding: 0 !important;
}

/* 确保现代化头部页面没有顶部边距 */
.layout-page-with-modern-header {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

.layout-page-with-modern-header .page-content {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

/* 与现有样式的兼容性 */
.site-header {
  border: none;
  background: transparent;
}

/* 确保所有页面都使用相同的头部样式 */
.site-header .wrapper {
  max-width: 100%;
  margin: 0;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

/* 隐藏原始头部，使用现代化头部 */
.site-header .site-title,
.site-header .site-nav {
  display: none;
}

.site-header .wrapper {
  max-width: none;
  padding: 0;
}

.site-header .site-title {
  display: none;
}

.site-header .site-nav {
  display: none;
}
