﻿/* 基础重置与通用样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: #333333;
  background-color: #ffffff;
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  overflow: hidden;
}

/* 全局色彩变量 - 方便复用和维护 */
:root {
  /* 主色调：品牌蓝（修正深浅逻辑，保持色相统一） */
  --primary-color: #00a8e8;
  --primary-light: #69C1D8;    /* 你偏好的浅青蓝 */
  --primary-dark: #007BA7;     /* 主色加深版，逻辑一致 */
  
  /* 强调色：品牌红（统一色相，区分深浅） */
  --accent-color: #C30D23;     /* 悬停红色 */
  --accent-light: #F8E0E3;     /* 浅背景版，低饱和度 */
  --accent-dark: #A00A1D;      /* 深版，hover/按压态 */
  
  /* 中性色：页面背景、文本、分割等 */
  --neutral-white: #ffffff;
  --neutral-gray-light: #f5f5f5;
  --neutral-gray: #999999;     /* 下滑后文字颜色 */
  --neutral-gray-dark: #666666;
  --neutral-black: #000000;
  
  /* 深色背景（PROJECTS 区块） */
  --dark-bg: #0a101f;
  
  /* 字体大小变量 */
  --font-xs: 12px;
  --font-sm: 14px;
  --font-base: 18px;
  --font-lg: 20px;
  --font-xl: 24px;
  --font-xxl: 36px;
  --font-xxxl: 48px;
  
  /* 间距变量 */
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
  --spacing-xxl: 48px;
  --spacing-xxxl: 64px;
  
  /* 圆角与阴影 */
  --radius-sm: 4px;
  --radius-md: 8px;
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 8px rgba(0,0,0,0.15);
}

/* 布局样式 */
.container {
  width: 100%;
  max-width: 1650px;
  margin: 0 auto;
  padding: 0 var(--spacing-md);
}

/* ========== 导航栏核心样式 ========== */
.nav-bar {
  width: 100%;
  height: 80px;
  background: #ffffff; 
  backdrop-filter: blur(12px); 
  -webkit-backdrop-filter: blur(12px); 
  border-bottom: 1px solid rgba(255, 255, 255, 0.2); 
  position: fixed;
  top: 0;
  left: 0;
  z-index: 999;
  transition: background 0.4s ease, color 0.3s ease, box-shadow 0.3s ease;
}

/* 【下滑状态】中国红 -> 紫色 -> 工业蓝 渐变 */
.nav-bar.scrolled {
  background: linear-gradient(to right, #C8102E 0%, #7D2181 50%, #004B9B 100%);
  backdrop-filter: none; /* 下滑后取消模糊 */
  -webkit-backdrop-filter: none;
  border-bottom: none;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

/* 默认透明导航：浅色logo显示，深色滚动logo隐藏 */
.nav-logo .logo-dark {
  display: none;
}
.nav-logo .logo-light {
  display: block;
}

/* 页面滚动后scrolled：切换logo显示状态 */
.nav-bar.scrolled .logo-light {
  display: none;
}
.nav-bar.scrolled .logo-dark {
  display: block;
}

/* 导航栏容器 - 水平布局 */
.nav-bar .container {
  height: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Logo样式 - 调整大小 */
.nav-logo {
  display: block;
  width: 120px; /* 可根据实际logo调整 */
  height: auto;
}

.nav-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* 导航主菜单容器 */
.nav-main {
  display: flex;
  align-items: center;
  gap: var(--spacing-xl);
}

/* 导航菜单项（含下拉） */
.nav-menu {
  display: flex;
  gap: var(--spacing-xl);
  list-style: none;
}

.nav-item {
  position: relative; /* 下拉菜单定位基准 */
  height: 80px;
  display: flex;
  align-items: center;
}

.nav-link {
  color: #111111; /* 默认白色文字 */
  text-decoration: none;
  font-size: var(--font-base);
  font-weight: 500;
  transition: color 0.3s ease; /* 文字颜色过渡 */
  padding: var(--spacing-sm) 0;
}

/* 【关键修复】悬停效果单独定义，不受JS内联样式影响 */
.nav-link:hover {
  color: var(--accent-color) !important; /* 悬停变红，!important确保优先级 */
}

/* 【新增】滚动后导航文字颜色 */
.nav-bar.scrolled .nav-link {
  color: var(--neutral-gray); /* 下滑后灰色文字 */
}

/* 下拉菜单样式 */
.nav-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  background-color: var(--neutral-white);
  min-width: 200px;
  box-shadow: var(--shadow-md);
  border-radius: var(--radius-sm);
  padding: var(--spacing-md) 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.3s ease;
  z-index: 9999;
}

.nav-item:hover .nav-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-dropdown-item {
  list-style: none;
}

.nav-dropdown-link {
  display: block;
  color: var(--neutral-gray-dark);
  text-decoration: none;
  padding: var(--spacing-sm) var(--spacing-lg);
  font-size: var(--font-sm);
  transition: background-color 0.2s ease, color 0.2s ease;
}

.nav-dropdown-link:hover {
  background-color: var(--accent-light);
  color: var(--accent-color);
}

/* 导航右侧图标区（语言+搜索） */
.nav-icons {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

.nav-icon {
  width: 24px; /* 图标大小统一调整 */
  height: 24px;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.nav-bar.scrolled .icon-earth img,
.nav-bar.scrolled .icon-search img {
  filter: invert(0.5);
  transition: filter 0.3s ease;
}

.nav-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.nav-icon:hover {
  opacity: 0.8;
}

.nav-divider {
  color: #592B88; /* 默认白色分隔符 */
  font-size: var(--font-lg);
  line-height: 1;
  transition: color 0.3s ease; /* 颜色过渡 */
  font-weight: bold;
}

/* 【新增】滚动后分隔符颜色 */
.nav-bar.scrolled .nav-divider {
  color: var(--neutral-gray); /* 下滑后灰色分隔符 */
}

/* 汉堡菜单（移动端）- 默认隐藏 */
.hamburger-menu {
  display: none;
  width: 30px;
  height: 30px;
  cursor: pointer;
  flex-direction: column;
  justify-content: space-between;
}

.hamburger-line {
  width: 100%;
  height: 2px;
  background-color: var(--neutral-white); /* 默认白色线条 */
  border-radius: 1px;
  transition: all 0.3s ease; /* 颜色过渡 */
}

/* 【新增】滚动后汉堡菜单线条颜色 */
.nav-bar.scrolled .hamburger-line {
  background-color: var(--neutral-gray); /* 下滑后灰色线条 */
}


/* ===================================================
   PC端 语言下拉选择组件 (Language Dropdown)
   =================================================== */

/* 确保父级图标具备定位基准与指针手势 */
.nav-icon.icon-earth {
  position: relative;
  cursor: pointer;
  user-select: none;
}

/* 下拉菜单面板主体 */
.lang-dropdown {
  position: absolute;
  top: calc(100% + 16px);
  right: -10px; /* 对齐微调 */
  width: 140px;
  background-color: #ffffff;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.06);
  padding: 6px 0;
  z-index: 1000;
  
  /* 默认隐藏与平滑浮现动画 */
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
  pointer-events: none;
}

/* 顶部小三角形指示箭头 */
.lang-dropdown::before {
  content: "";
  position: absolute;
  top: -6px;
  right: 18px;
  width: 10px;
  height: 10px;
  background-color: #ffffff;
  transform: rotate(45deg);
  border-left: 1px solid rgba(0, 0, 0, 0.06);
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

/* 展开激活态 */
.lang-dropdown.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

/* 单个语言选项行 */
.lang-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  font-size: 0.85rem;
  color: #444444;
  cursor: pointer;
  transition: all 0.2s ease;
}

.lang-item:hover {
  background-color: #f7f9fa;
  color: #c81e3a; /* 悬停呈品牌红 */
}

/* 当前选中的激活状态 */
.lang-item.active {
  color: #c81e3a;
  font-weight: 600;
  background-color: #fdf5f6;
  position: relative;
}

/* 激活项左侧品牌渐变指示竖条 */
.lang-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, #c81e3a 0%, #1b2685 100%);
}

/* 语言简称微标 (EN / CN) */
.lang-tag {
  font-size: 0.72rem;
  font-weight: 500;
  color: #999999;
  background-color: #eeeeee;
  padding: 2px 5px;
  border-radius: 3px;
  transition: all 0.2s ease;
}

.lang-item.active .lang-tag {
  background: linear-gradient(90deg, #c81e3a 0%, #1b2685 100%);
  color: #ffffff;
}

/* 选项间细分割线 */
.lang-divider {
  height: 1px;
  background-color: #f0f2f5;
  margin: 3px 0;
}

/* ===================================================
   响应式约束：仅在 PC 端生效，移动端/平板端隐藏
   =================================================== */
@media (max-width: 1024px) {
  .lang-dropdown {
    display: none !important; /* 移动端完全禁用此弹出浮层 */
  }
}


/* 移动端导航菜单（展开态）- 默认隐藏 */
.mobile-nav {
  position: fixed;
  top: 0;
  right: 0;
  width: 280px;
  height: 100vh;
  background-color: var(--neutral-white);
  z-index: 9999;
  padding: var(--spacing-xl);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  box-shadow: -2px 0 10px rgba(0,0,0,0.1);
  overflow-y: auto;
}

.mobile-nav.active {
  transform: translateX(0);
}

.mobile-nav-close {
  width: 30px;
  height: 30px;
  position: absolute;
  top: var(--spacing-xl);
  right: var(--spacing-xl);
  cursor: pointer;
  font-size: 26px;
  line-height: 1;
}

/* 移动端侧边栏用户登录模块 */
.mobile-user-panel {
  margin-top: 10px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--neutral-gray-light);
}
.mobile-user-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
}
.mobile-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid #2563eb;
}
.mobile-user-name {
  font-size: var(--font-base);
  font-weight: 600;
}
.mobile-user-email {
  font-size: var(--font-xs);
  color: var(--neutral-gray);
}
.mobile-user-menu {
  margin-top: 12px;
}
.mobile-user-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  font-size: var(--font-sm);
  color: var(--neutral-gray-dark);
  cursor: pointer;
}
.mobile-user-menu-item.logout {
  color: #ef4444;
  margin-top: 8px;
  border-top: 1px solid var(--neutral-gray-light);
  padding-top: 12px;
}

.mobile-nav-menu {
  margin-top: var(--spacing-lg);
  list-style: none;
}

.mobile-nav-item {
  margin-bottom: var(--spacing-lg);
  border-bottom: 1px solid var(--neutral-gray-light);
  padding-bottom: var(--spacing-md);
}

.mobile-nav-link {
  color: var(--neutral-black);
  text-decoration: none;
  font-size: var(--font-lg);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mobile-dropdown {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  margin-top: var(--spacing-sm);
}

.mobile-dropdown.active {
  max-height: 800px;
}

.mobile-dropdown-item {
  margin-bottom: var(--spacing-sm);
}

.mobile-dropdown-link {
  color: var(--neutral-gray-dark);
  text-decoration: none;
  font-size: var(--font-base);
  padding-left: var(--spacing-md);
  display: block;
  line-height: 1.6;
}

/* ========== 导航栏右侧用户头像下拉菜单 全局样式 ========== */
.top-header-user {
  position: relative;
  display: none; /* 默认未登录隐藏 */
  margin-left: 16px;
}

/* 个人信息组件卡片 */
.user-profile-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 6px 6px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid #e2e8f0;
  border-radius: 30px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  transition: all 0.3s ease;
}

.nav-bar.scrolled .user-profile-wrapper {
  background: #fff;
}

.user-profile-wrapper:hover {
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
  border-color: #cbd5e1;
}

/* 用户头像 */
.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #2563eb;
}

/* 用户姓名 */
.user-display-name {
  font-size: 14px;
  font-weight: 600;
  color: #1e293b;
}

/* 悬浮下拉菜单容器 */
.user-dropdown-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 220px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
  padding: 8px 0;
  z-index: 999;

  /* 默认隐藏与过渡效果 */
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* 鼠标悬停显示下拉 */
.user-profile-wrapper:hover .user-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* 下拉头部邮箱 */
.dropdown-header {
  padding: 8px 16px;
  border-bottom: 1px solid #f1f5f9;
}
.dropdown-user-email {
  font-size: 12px;
  color: #64748b;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 下拉菜单项 */
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: 13px;
  color: #334155;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s;
}
.dropdown-item:hover {
  background-color: #f8fafc;
  color: #2563eb;
}
.dropdown-item.logout {
  color: #ef4444;
  border-top: 1px solid #f1f5f9;
  margin-top: 4px;
}
.dropdown-item.logout:hover {
  background-color: #fef2f2;
}

/* ========== Footer区域样式 ========== */
.footer {
  /* 匹配截图：红色→紫红→紫色→深蓝色渐变 */
  background: linear-gradient(to right, #ee062d, #991b62, #622185, #1b2999);
  padding: var(--spacing-xl) 0 0;
  color: #ffffff; /* 全部字体改为白色 */
}

.footer .container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4rem; /* 拉大左右部分间隔 */
}

/* 左侧区域：Logo+公司信息 */
.footer-left {
  flex: 0 0 660px; /* 固定基础宽度，和右侧拉开距离 */
  min-width: 300px;
}

/* Logo大小调整 */
.footer-logo {
  width: 120px;
  margin-bottom: var(--spacing-lg);
}
.footer-logo img {
  width: 100%;
  height: auto;
  display: block;
}

.footer-company {
  font-size: var(--font-lg);
  font-weight: 700;
  margin-bottom: var(--spacing-md);
}

/* 联系方式，使用图片图标 */
.footer-contact {
  margin-bottom: var(--spacing-xl);
  line-height: 2;
}
.contact-icon {
  width: 18px;
  height: 18px;
  vertical-align: middle;
  margin-right: 8px;
}

/* 右侧区域：页面列表+二维码 */
.footer-right {
  flex: 1;
  min-width: 500px;
}

/* 页面列表布局 */
.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  margin-bottom: var(--spacing-lg);
}
.column-box span {
  margin-right: 30px;
}
.link-column {
  min-width: 120px;
  margin-bottom: var(--spacing-md);
}
.link-column h4 {
  font-size: var(--font-base);
  font-weight: 700;
  margin-bottom: var(--spacing-md);
}
.link-column ul {
  list-style: none;
}
.link-column ul li {
  margin-bottom: var(--spacing-xs);
}
.link-column ul li a {
  color: #ffffff; /*链接文字白色*/
  text-decoration: none;
  font-size: var(--font-sm);
  transition: opacity 0.2s ease;
}
.link-column ul li a:hover {
  opacity: 0.7;
}

/* 二维码 + 圆角 */
.footer-qrcode {
  position: relative;
  top: 20%;
  width: 100px;
  margin-left: auto;
  z-index: 15;
}
.footer-qrcode img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px; /*二维码圆角*/
}

/* 底部版权：通栏黑色背景，独占一行 */
.footer-copyright {
  width: 100%;
  background-color: #000000;
  padding-top: 20px;
  padding-bottom: 40px;
  margin-top: 24px;
  font-size: var(--font-sm);
  opacity: 0.9;
}
.footer-copyright p {
  margin:0;
}

/* ========== 响应式设计（手机+平板 完整自适应） ========== */
/* 平板适配 769px ~ 992px */
@media (min-width:769px) and (max-width: 992px) {
  /* 隐藏桌面端菜单和图标 */
  .nav-menu, .nav-icons {
    display: none;
  }
  /* 显示汉堡菜单 */
  .hamburger-menu {
    display: flex;
  }
  .footer-right {
    min-width: 100%; /* 平板下右侧占满宽度 */
  }
  .link-column {
    min-width: 150px; /* 增大列宽，提升可读性 */
  }
  /* 导航高度小幅缩小 */
  .nav-bar {
    height: 70px;
  }
  .nav-item {
    height:70px;
  }
}

/* 手机端核心适配 <768px */
@media (max-width: 768px) {
  /* 导航全局适配 */
  .nav-bar {
    height: 64px;
  }
  .nav-logo {
    width: 90px;
  }
  /* 桌面菜单、用户全名完全隐藏 */
  .nav-menu, .nav-icons {
    display: none;
  }
  .hamburger-menu {
    display: flex;
  }
  .user-display-name {
    display: none !important;
  }
  /* 头像下拉菜单手机偏移，防止超出屏幕 */
  .user-dropdown-menu {
    right: -20px;
    width: 190px;
  }

  /* Footer 手机端堆叠 */
  .footer-left, .footer-right {
    min-width: 100%;
  }
  .footer-links {
    flex-direction: column;
    gap: var(--spacing-md);
  }
  .footer-qrcode {
    margin: 24px auto 0;
  }

  

  .footer-contact p {
    word-break: break-all; 
  }
  .footer {
    padding: var(--spacing-lg) 0;
  }
  .footer-company {
    font-size: var(--font-base);
  }

    /* 联系方式手机端每项单独换行 */
  .column-box {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }
  .footer-contact p .contact-icon {
    display: inline-block;
    min-width: 22px;
  }
}

/* 桌面端隐藏移动端侧边栏 */
@media (min-width: 993px) {
  .mobile-nav {
    display: none !important;
  }
  .mobile-user-panel {
    display: none;
  }
}
