@layer utilities {
  .menu-active {
    @apply bg-primary/10 text-primary border-l-4 border-primary font-medium;
  }
  .tab-active {
    @apply border-primary text-primary shadow-tab font-medium;
  }
  .content-auto {
    content-visibility: auto;
  }
  .border-subtle {
    @apply border border-light-2;
  }
  .has-submenu-indicator::after {
    content: '';
    position: absolute;
    right: 2px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background-color: #165DFF;
  }
}

/* 基础样式 */
body {
  font-family: 'Inter', system-ui, sans-serif;
  overflow: hidden;
  height: 100vh;
}

/* 滚动条样式优化 */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
  transition: background 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: #a1a1a1;
}

/* 内容区域iframe样式 */
.content-iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* 页签内容区域过渡 */
.tab-content {
  transition: opacity 0.2s ease-in-out;
}

.tab-content.hidden {
  display: none;
}

/* 动画效果 */
.fade-in {
  animation: fadeIn 0.3s ease-in-out;
}

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

/* 平滑过渡 */
.tab-item, #menu-container a, #sidebar, .menu-text, .menu-header, .submenu-container {
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 调整后的大小的页签按钮样式 */
.tab-item {
  padding: 0.5rem 1.25rem !important; /* 减小内边距 */
  font-size: 0.75rem !important; /* 减小字体大小 */
  height: 38px !important; /* 固定高度变小 */
}

.tab-item i {
  width: 14px !important; /* 减小图标宽度 */
  height: 14px !important; /* 减小图标高度 */
  margin-right: 0.5rem !important; /* 减小图标与文字间距 */
}

.tab-item .close-tab {
  width: 16px !important; /* 减小关闭按钮大小 */
  height: 16px !important;
  margin-left: 0.25rem !important; /* 减小与文字的间距 */
}

.tab-item .close-tab i {
  font-size: 12px !important; /* 减小关闭图标大小 */
  width: 12px !important;
  height: 12px !important;
  margin-right: 0 !important;
}

/* 用户下拉菜单样式 */
.user-dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 5px;
  width: 180px;
  background: white;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 100;
  overflow: hidden;
  transform-origin: top right;
  transform: scale(0.95);
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s ease;
}

.dropdown-menu.show {
  transform: scale(1);
  opacity: 1;
  pointer-events: all;
}

.dropdown-item {
  display: flex;
  align-items: center;
  padding: 10px 15px;
  color: #1D2129;
  text-decoration: none;
  transition: background 0.2s ease;
}

.dropdown-item:hover {
  background-color: #F2F3F5;
}

.dropdown-item i {
  margin-right: 8px;
  width: 16px;
  text-align: center;
}

.dropdown-divider {
  height: 1px;
  background-color: #E5E6EB;
  margin: 5px 0;
}

.user-status {
  position: relative;
}

.status-indicator {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 30%;
  height: 30%;
  border-radius: 50%;
  background-color: #00B42A;
  border: 2px solid white;
}

/* 加载遮罩样式 */
.auth-loading {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

/* 二级菜单样式 */
.has-submenu {
  position: relative;
}

.submenu-toggle {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  color: #86909C;
  cursor: pointer;
  transition: all 0.2s ease;
}

.submenu-toggle:hover {
  background-color: #F2F3F5;
  color: #165DFF;
}

.submenu-toggle.rotate {
  transform: translateY(-50%) rotate(90deg);
}

.submenu-container {
  padding-left: 1.5rem;
  overflow: hidden;
  max-height: 0;
}

.submenu-container.expanded {
  max-height: 500px;
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
}

.submenu-item {
  padding-left: 1.5rem !important;
}

/* 移动端侧边栏样式 */
@media (max-width: 1023px) {
  #sidebar {
    z-index: 900;
  }
  
  #sidebar {
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
  }
}

/* 增强的菜单激活状态 */
#menu-container a.menu-active {
  background-color: rgba(22, 93, 255, 0.1);
  color: #165DFF;
  font-weight: 500;
}

/* 增强的标签激活状态 */
.tab-item.tab-active {
  border-bottom-color: #165DFF;
  color: #165DFF;
  font-weight: 500;
  box-shadow: 0 2px 4px rgba(22, 93, 255, 0.1);
}
    