:root {
  /* 基础 */
  --bg-color: #121212;
  --text-color: #e0e6f0;
  --border-color: #383d4e;

  /* 导航栏 */
  --nav-bg: #1e1e1e;
  --nav-link: #ccd6e8;
  --nav-link-hover: #7ba5e9;

  /* 主题色 */
  --primary: #5a9cff;
  --primary-alt: #7ba5e9;
  --secondary: #68a7ff;

  /* 表格 */
  --table-header-bg: #4974c7;

  /* 通知 */
  --notify-bg: #1e1e1e;
  --notify-text: #e0e6f0;
  --notify-border: #383d4e;
  --notify-hover: #2d3341;

  /* 按钮 */
  --btn-text: #ffffff;
  --btn-save: #2a9d5d;
  --btn-save-hover: #238b51;
  --btn-edit: #4974c7;
  --btn-edit-hover: #3a65b8;
  --btn-delete: #d34c42;
  --btn-delete-hover: #c33d33;

  /* 表单 */
  --form-bg: #1e1e1e;
  --input-border: #383d4e;
  --input-focus: #5a9cff;
  --form-padding: 20px;
  --form-radius: 8px;

  --nav-bg-color: #171926;

  --orange-color: #ff9800;
}

[data-theme="light"] {
  /* 基础 */
  --bg-color: #ffffff;
  --text-color: #445578;
  --border-color: #e8eeff;

  /* 导航栏 */
  --nav-bg: #f8faff;
  --nav-link: #445578;
  --nav-link-hover: #68a7ff;

  /* 主题色 */
  --primary: #7ba5e9;
  --primary-alt: #5582d6;
  --secondary: #68a7ff;

  /* 表格 */
  --table-header-bg: #68a7ff;

  /* 通知 */
  --notify-bg: #ffffff;
  --notify-text: #445578;
  --notify-border: #e8eeff;
  --notify-hover: #f0f7ff;

  /* 按钮 */
  --btn-text: #ffffff;
  --btn-save: #3aac6e;
  --btn-save-hover: #2e9e5f;
  --btn-edit: #68a7ff;
  --btn-edit-hover: #5a9cff;
  --btn-delete: #e05c52;
  --btn-delete-hover: #d34c42;

  /* 表单 */
  --form-bg: #f8fbff;
  --input-border: #e8eeff;
  --input-focus: #7ba5e9;

  --nav-bg-color: #dfe4ff;
}

/* 全局基础样式 */
body {
  margin: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  padding-top: 0; /* 移除顶部padding */
  max-width: 100%;
  overflow-x: hidden; /* Prevent horizontal scrolling */
}

/* 导航栏 - 更新为普通定位，不固定在顶部 */
#navbar {
  background-color: var(--nav-bg-color);
  border-bottom: 1px solid var(--border-color);
  padding: 0.6rem 0;
  box-shadow: 0 2px 10px rgba(91, 134, 229, 0.1);
  position: relative; /* Changed from fixed to relative */
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: auto;
  box-sizing: border-box;
  width: 100%;
}
#nav_select_list{
  max-width: 100%;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
}
/* Dark theme navbar adjustments */
[data-theme="dark"] #navbar {
  background-color: #171926;
  border-bottom-color: var(--border-color);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

/* container 居中和宽度限制 */
#navbar .container {
  max-width: 1400px; /* 调整为与employee-data-layout相同 */
  width: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  height: 100%;
  box-sizing: border-box;
}

/* logo 样式 */
.logo {
  height: 40px;
  width: auto;
  display: block;
  margin-right: 15px;
  transition: transform 0.3s ease;
}

.logo:hover {
  transform: scale(1.05);
}

/* 导航选择列表 */
#nav_select_list {
  display: flex;
  gap: 2.5rem;
}

/* ul 去默认样式，改成水平排列 */
#nav_select_list ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 2.5rem;
}

/* li 只用于包裹 */
#nav_select_list li {
  margin: 0;
  padding: 0;
}

/* 链接样式 */
.nav-link {
  text-decoration: none;
  color: var(--nav-link-color);
  font-weight: 600;
  font-size: 1rem;
  display: inline-block;
  transition: all 0.3s ease;
  padding: 6px 12px;
  border-radius: 6px;
  position: relative;
}

/* 悬停效果 */
.nav-link:hover {
  color: var(--nav-link-hover-color);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--nav-link-hover-color);
  transition: width 0.3s ease;
}

[data-theme="dark"] .nav-link::after {
  background-color: var(--form-bg);
}

.nav-link:hover::after {
  width: 100%;
}

.nav-link.active {
  color: var(--nav-link-hover-color);
  background-color: var(--primary-light);
}

[data-theme="dark"] .nav-link.active {
  background-color: #212336;
}

.nav-link.active::after {
  width: 100%;
}

#nav_contorl_panel {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 15px;
}

/* username 样式 */
#username {
  display: inline-block;
  color: var(--username-color);
  font-size: 1rem;
  font-weight: 500;
  padding-right: 1rem;
  border-right: 2px solid var(--border-color);
}

/* ping_ms 样式 */
#ping_ms {
  font-size: 0.8rem;
  color: var(--ping-color);
  background-color: var(--light-bg);
  padding: 3px 6px;
  border-radius: 10px;
}

#notification-bell {
  cursor: pointer;
  font-size: 24px;
  color: var(--nav-link-color);
  transition: all 0.3s ease;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  position: relative;
}

[data-theme="dark"] #notification-bell {
  color: #bcc5d9;
}

#notification-bell:hover {
  color: var(--nav-link-hover-color);
  background-color: var(--primary-light);
}

#notification-count {
  position: absolute;
  top: 0;
  right: 0;
  background-color: var(--danger-color);
  color: white;
  font-size: 10px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

/* Theme switcher */
.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--nav-link-color);
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  transition: all 0.3s ease;
}

[data-theme="dark"] .theme-toggle {
  color: #bcc5d9;
}

.theme-toggle:hover {
  color: var(--nav-link-hover-color);
  background-color: var(--primary-light);
}

[data-theme="dark"] .theme-toggle:hover {
  color: var(--form-bg);
  background-color: #212336;
}

/* 弹窗动画 */
@keyframes fadeInScale {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.85); }
  100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* 弹窗容器 */
#custom-notify-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: var(--bg-color);
  color: var(--text-color);
  min-width: 320px;
  max-width: 90vw;
  max-height: 70vh;
  overflow-y: auto;
  padding: 1.5rem;
  box-shadow: 0 5px 15px rgba(0,0,0,0.2);
  border-radius: 10px;
  z-index: 1100;
  font-family: 'Segoe UI', sans-serif;
  animation: fadeInScale 0.25s ease forwards;
  border: 1px solid var(--border-color);
}

[data-theme="dark"] #custom-notify-popup {
  box-shadow: 0 5px 25px rgba(0, 0, 0, 0.4);
}

/* 关闭按钮 */
#custom-notify-popup button.close-btn {
  position: absolute;
  top: 12px;
  right: 15px;
  background: transparent;
  border: none;
  font-size: 1.2rem;
  color: var(--text-color);
  cursor: pointer;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

#custom-notify-popup button.close-btn:hover {
  background-color: var(--notify-close-hover-bg);
  color: var(--danger-color);
}

/* 标题 */
#custom-notify-popup h3 {
  margin-top: 0;
  margin-bottom: 1rem;
  user-select: none;
  color: var(--secondary-color);
  font-weight: 600;
  border-bottom: 2px solid var(--form-bg);
  padding-bottom: 8px;
}

/* 通知链接列表 */
#custom-notify-popup div.content {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  padding: 10px 0;
}

#custom-notify-popup div.content a {
  color: var(--nav-link-color);
  text-decoration: none;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 5px;
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
}

#custom-notify-popup div.content a:hover {
  color: var(--nav-link-hover-color);
  background-color: var(--primary-light);
  border-left-color: var(--form-bg);
  transform: translateX(3px);
}

[data-theme="dark"] #custom-notify-popup div.content a:hover {
  background-color: #212336;
}

/* 遮罩层 */
#custom-notify-mask {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 1090;
  backdrop-filter: blur(3px);
}

.push-popup {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%) scale(0.9);
  background-color: var(--table-header-bg);
  color: white;
  padding: 12px 20px;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(91, 134, 229, 0.25);
  z-index: 1050;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
}

.push-popup.show {
  opacity: 1;
  transform: translateX(-50%) scale(1);
  pointer-events: auto;
}

.push-popup.fade-out {
  opacity: 0;
  transform: translateX(-50%) scale(0.95);
}

#status-mask {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  animation: fadeIn 0.3s ease-out;
}

.loading-logo {
  width: 80px;
  height: 80px;
  animation: pulse 1.5s infinite ease-in-out;
  border-radius: 8px;
}

@keyframes pulse {
  0%   { transform: scale(1); opacity: 0.6; }
  50%  { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); opacity: 0.6; }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Ensure content doesn't stretch beyond its container */
.content-wrapper {
  max-width: 100%;
  overflow-x: hidden;
}

/* 添加响应式适配 */
@media (max-width: 992px) {
  #navbar {
    padding: 0.5rem 0;
  }
  
  #nav_select_list {
    gap: 1rem;
  }
  
  #nav_select_list ul {
    gap: 0.8rem;
  }

  .nav-link {
    font-size: 0.9rem;
    padding: 5px 8px;
  }
  
  #base_container {
    padding: 0 0.75rem;
  }
  .nav_bar_contorl_panel{
    display: none;
  }
  #nav_contorl_panel #username,
  #nav_contorl_panel #ping_ms{
    display: none;
  }
}
