/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 字体引入 */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600;700&family=Poppins:wght@400;600;700&family=Noto+Sans+SC:wght@400;500;700&display=swap');

/* 全局颜色变量 */
:root {
    --nws-blue: #0f3d8a;
    --nws-deep: #0a2454;
    --nws-white: #ffffff;
    --neon-purple: #b967ff;
    --electric-green: #00ff9d;
    --tech-blue: #0066ff;
    --gray-light: #f8f9fa;
    --gray-medium: #e9ecef;
    --gray-dark: #6c757d;
}

/* 基础字体样式 */
body {
    font-family: 'Noto Sans SC', sans-serif;
    background-color: var(--nws-white);
    color: #333;
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Poppins', 'Noto Sans SC', sans-serif;
    font-weight: 700;
}

/* 导航栏样式 - 固定在页面顶部 */
header {
    background-color: var(--nws-blue);
    color: white;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    margin: 0;
    padding: 0;
    height: 5rem;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.logo-icon {
    width: 15rem;
    height: 5rem;
    /* 可以根据需要调整圆角 */
    /*border-radius: 50%; /* 圆形 */
    /* 或者使用以下样式创建方形logo */
    border-radius: 0; 
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.logo-icon i {
    color: var(--nws-blue);
    font-size: 1.5rem;
}

.logo-text {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 1.5rem;
}

/* 响应式调整logo大小 */
@media (max-width: 768px) {
    /* 移动端独立设置header高度 */
    header {
        height: 4rem;
    }
    
    .header-container {
        padding: 0.5rem 1rem;
    }
    
    .logo-icon {
        width: 6rem;
        height: 3rem;
    }
    
    .logo-text {
        font-size: 1rem; /* 进一步缩小移动端文字 */
    }
}

/* 桌面端导航 */
.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: white;
    text-decoration: none;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
    padding: 0.5rem 0;
}

.nav-links a:hover {
    color: var(--electric-green);
}

.nav-links a.active {
    color: var(--electric-green);
}

.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--electric-green);
}

/* 移动端汉堡菜单 */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

/* 移动端导航菜单 */
.mobile-nav {
    display: none;
    background-color: var(--nws-deep);
    padding: 1rem 2rem;
}

.mobile-nav.active {
    display: block;
}

.mobile-nav-links {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.mobile-nav-links a {
    color: white;
    text-decoration: none;
    padding: 0.5rem 0;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 0.9rem; /* 缩小移动端导航链接文字 */
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.mobile-nav-links a:last-child {
    border-bottom: none;
}

.mobile-nav-links a:hover, .mobile-nav-links a.active {
    color: var(--electric-green);
}

/* 主内容区样式 */
main {
    min-height: 100vh;
}

/* 页脚样式 */
footer {
    background-color: var(--nws-blue);
    color: white;
    padding: 2.5rem 0;
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 1rem;
}

.footer-logo-icon {
    width: 2rem;
    height: 2rem;
    background-color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.footer-logo-icon i {
    color: var(--nws-blue);
    font-size: 1.2rem;
}

.footer-logo-text {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 1.2rem;
}

.footer-info p {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 0.5rem;
}

.footer-contact h4, .footer-social h4 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.contact-list {
    list-style: none;
}

.contact-list li {
    display: flex;
    align-items: center;
    margin-bottom: 0.8rem;
    color: rgba(255, 255, 255, 0.8);
}

.contact-list li i {
    width: 1.5rem;
    margin-right: 0.8rem;
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    transition: all 0.3s ease;
}

.social-links a:hover {
    background-color: var(--electric-green);
    color: var(--nws-blue);
    transform: translateY(-3px);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    margin-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}

/* 视频播放器样式 */
#employeeVideo {
    width: 100%;
    height: 100%;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
}

#employeeVideo:hover {
    box-shadow: 0 0 20px rgba(0, 102, 255, 0.3);
}

/* 视频容器样式 */
#employee-showcase .aspect-video {
    border-radius: 0.5rem;
    overflow: hidden;
}

/* 粒子动画背景 */
#particleCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

/* 首页背景 */
#welcome {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    overflow: hidden;
    margin-top: 0;
    padding-top: 0;
}

#welcome::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 61, 138, 0.9);
    z-index: -1;
}

/* 确保卡片和内容图层高于粒子背景 */
main > section,
.card,
footer {
    position: relative;
    z-index: 1;
}

/* 动画效果 */
@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-15px); }
    100% { transform: translateY(0px); }
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}

/* 渐显动画 */
.fade-in-section {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-in-section.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.btn-primary {
    background-color: var(--electric-green);
    color: var(--nws-blue);
}

.btn-primary:hover {
    background-color: #00e68c;
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 255, 157, 0.3);
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-secondary {
    background-color: transparent;
    border: 2px solid white;
    color: white;
}

.btn-secondary:hover {
    border-color: var(--electric-green);
    color: var(--electric-green);
    transform: scale(1.02);
}

.btn-secondary:active {
    transform: scale(0.98);
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--nws-blue);
    color: var(--nws-blue);
}

.btn-outline:hover {
    background-color: var(--nws-blue);
    color: white;
    transform: scale(1.02);
}

.btn-outline:active {
    transform: scale(0.98);
}

/* 卡片样式 */
.card {
    background-color: white;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    cursor: pointer;
    padding: 1.25rem;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
}

/* 员工来源地图样式 */
#sourceMap {
    position: relative;
    height: 100%;
    min-height: 420px;
}

#sourceMap-container {
    height: 420px;
    position: relative;
    margin-bottom: 10px;
}

#sourceMap-container .text-center {
    position: absolute;
    bottom: 10px;
    left: 0;
    right: 0;
    z-index: 10;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .header-container {
        padding: 1rem 1.5rem;
    }
    
    .nav-links {
        gap: 1.5rem;
    }
    
    /* 学校分布环形图图例样式 */
  #data-analysis .card {
      position: relative;
      overflow: visible;
  }
  
  /* 图例容器样式 */
  .school-legend-left,
  .school-legend-right {
      position: absolute;
      top: 50px; /* 避开标题 */
      transform: translateY(0);
      max-height: calc(100% - 60px); /* 减去标题高度 */
      overflow-y: auto;
      width: 25%;
      padding: 0 0.5rem;
      display: flex;
      flex-direction: column;
      gap: 0.5rem;
  }
  
  /* 左侧图例 */
  .school-legend-left {
      left: 0;
      align-items: flex-start;
  }
  
  /* 右侧图例 */
  .school-legend-right {
      right: 0;
      align-items: flex-end;
  }
  
  /* 图例项样式 */
  .legend-item {
      display: flex;
      align-items: center;
      gap: 0.5rem;
      padding: 0.25rem 0;
      cursor: pointer;
      font-size: 0.875rem;
      line-height: 1.4;
      transition: opacity 0.2s ease;
      width: 100%;
  }
  
  .legend-item:hover {
      opacity: 0.8;
  }
  
  /* 图例颜色块样式 */
  .legend-color {
      width: 12px;
      height: 12px;
      border-radius: 2px;
      display: inline-block;
      flex-shrink: 0;
  }
  
  /* 图例文本样式 */
  .legend-text {
      color: #333;
      font-family: 'Noto Sans SC', sans-serif;
      font-size: 0.875rem;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      flex-shrink: 1;
      min-width: 0;
  }
  
  /* 图例滚动条样式 */
  .school-legend-left::-webkit-scrollbar,
  .school-legend-right::-webkit-scrollbar {
      width: 4px;
  }
  
  .school-legend-left::-webkit-scrollbar-track,
  .school-legend-right::-webkit-scrollbar-track {
      background: #f1f1f1;
      border-radius: 2px;
  }
  
  .school-legend-left::-webkit-scrollbar-thumb,
  .school-legend-right::-webkit-scrollbar-thumb {
      background: #888;
      border-radius: 2px;
  }
  
  .school-legend-left::-webkit-scrollbar-thumb:hover,
  .school-legend-right::-webkit-scrollbar-thumb:hover {
      background: #555;
  }
  
  /* 移动端适配 */
  @media (max-width: 768px) {
      .school-legend-left,
      .school-legend-right {
          position: relative;
          width: 100%;
          top: auto;
          left: auto;
          right: auto;
          transform: none;
          max-height: 100px;
          overflow-y: auto;
      }
      
      .school-legend-left {
          margin-bottom: 0.5rem;
      }
      
      .school-legend-right {
          margin-top: 0.5rem;
      }
      
      /* 图表容器调整 */
      #schoolChart {
          max-width: 100% !important;
          margin: 1rem 0 !important;
      }
  }
  
  .footer-container {
        padding: 0 1.5rem;
    }
}

/* 更多响应式调整 */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .header-container {
        padding: 0.8rem 1rem;
    }
    
    .logo-text {
        font-size: 1rem; /* 再次确认移动端文字大小 */
    }
    
    .footer-container {
        padding: 0 1rem;
        grid-template-columns: 1fr;
    }
    
    .footer-info, .footer-contact, .footer-social {
        margin-bottom: 1.5rem;
    }
}

/* 工具类 */
.text-center {
    text-align: center;
}

.text-blue {
    color: var(--nws-blue);
}

.text-white {
    color: white;
}

.bg-gray-light {
    background-color: var(--gray-light);
}

.pulse-animation {
    animation: pulse 2s infinite;
}

.animate-float {
    animation: float 6s ease-in-out infinite;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--nws-blue);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--nws-deep);
}

/* 无障碍支持 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* 焦点样式 */
button:focus,
input:focus,
select:focus,
a:focus {
    outline: 2px solid var(--electric-green);
    outline-offset: 2px;
}

/* 图像样式 */
img {
    max-width: 100%;
    height: auto;
}

/* 模态框样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-content {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    max-width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.modal:not(.hidden) {
    opacity: 1;
    visibility: visible;
}

/* 图片可点击指示器 */
#modalPhoto {
    cursor: pointer;
    transition: transform 0.3s ease;
}

#modalPhoto:hover {
    transform: scale(1.02);
}

/* 大图预览模态框动画 */
#imagePreviewModal {
    opacity: 0;
    transition: opacity 0.3s ease;
}

#imagePreviewModal:not(.hidden) {
    opacity: 1;
}

/* 响应式标题大小 */
h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
}

h2 {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
}

h3 {
    font-size: clamp(1.2rem, 3vw, 1.8rem);
}

p {
    font-size: clamp(1rem, 2vw, 1.1rem);
}

/* 员工卡片网格 - 桌面端优化 */
#employeeGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.5rem;
}

/* 词云展示区域基础样式 */
#hobbyCloud {
  min-height: 300px;
}

/* 移动端适配 - 员工卡片网格布局优化 */
@media (max-width: 768px) {
  /* 移动端词云展示区域高度优化 */
  #hobbyCloud {
    min-height: 400px;
  }
  #employeeGrid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.8rem;
  }
  
  .card {
    padding: 0.6rem;
  }
  
  .card h3 {
    font-size: 0.9rem;
  }
  
  .card p {
    font-size: 0.75rem;
  }
  
  /* 数据分析图表字体优化 */
  #regionChart, #schoolChart, #majorChart {
    font-size: 0.7rem;
  }
  
  /* 词云展示区域优化 - 增加移动端高度 */
  #hobbyCloud {
    min-height: 300px;
  }
  
  /* 筛选控件优化 */
  #searchName, #filterDepartment, #filterMajor {
    font-size: 0.85rem;
    padding: 0.4rem 0.6rem;
  }
  
  /* 分页控件优化 */
  #pagination button, #pagination span {
    font-size: 0.85rem;
    padding: 0.3rem 0.6rem;
  }
  
  /* 欢迎页面文字大小优化 */
  .welcome-section h1 {
    font-size: 1.8rem;
  }
  
  .welcome-section p {
    font-size: 0.9rem;
  }
  
  /* 快速导航卡片优化 */
  .quick-nav-card {
    font-size: 0.85rem;
    padding: 1rem;
  }
  
  /* 团队文化板块优化 */
  .culture-section h2 {
    font-size: 1.4rem;
  }
  
  .culture-item h3 {
    font-size: 1.1rem;
  }
  
  .culture-item p {
    font-size: 0.85rem;
  }
}