/**
 * 主布局样式
 * 
 * @author Agions
 * @date 2024
 */

.layout {
  min-height: 100vh;
}

.header {
  position: fixed;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 24px;
  height: 64px;
  background-color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  z-index: 1000;
  transition: all 0.3s;
  
  :global(.ant-layout-header) {
    padding: 0;
  }
}

.headerLeft, .headerRight {
  display: flex;
  align-items: center;
}

.headerRight {
  gap: 12px;
}

.logo {
  display: flex;
  align-items: center;
  cursor: pointer;
  margin-right: 24px;
  user-select: none;
  transition: all 0.3s;
  
  &:hover {
    opacity: 0.9;
  }
}

.logoIcon {
  font-size: 24px;
  color: #FF5252;
  margin-right: 8px;
}

.logoText {
  font-size: 20px;
  font-weight: 600;
  color: #1E88E5;
  background: linear-gradient(90deg, #1E88E5, #7986CB);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.pageTitle {
  font-size: 16px;
  font-weight: 500;
  color: rgba(0, 0, 0, 0.65);
  border-left: 1px solid rgba(0, 0, 0, 0.1);
  padding-left: 24px;
  height: 22px;
  line-height: 22px;
}

.menuButton {
  margin-right: 16px;
  font-size: 18px;
}

.mainContainer {
  padding-top: 64px;
}

.sider {
  background-color: #fff;
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.02);
  position: fixed;
  height: 100vh;
  left: 0;
  top: 64px;
  z-index: 100;
  transition: all 0.3s;
  overflow: auto;
  
  :global(.ant-layout-sider-children) {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 64px);
  }
  
  :global(.ant-menu-item) {
    display: flex;
    align-items: center;
    padding-left: 24px !important;
    transition: all 0.3s;
    margin: 4px 0;
    border-radius: 0 24px 24px 0;
    
    &:hover {
      background-color: rgba(30, 136, 229, 0.05);
    }
    
    :global(.anticon) {
      font-size: 18px;
    }
  }
  
  :global(.ant-menu-item-selected) {
    background-color: rgba(30, 136, 229, 0.1) !important;
    color: #1E88E5 !important;
    font-weight: 500;
    
    &::after {
      display: none;
    }
  }
  
  :global(.ant-menu-divider) {
    margin: 8px 16px !important;
    background-color: rgba(0, 0, 0, 0.06);
  }
}

.content {
  transition: all 0.3s;
  background-color: #f5f7fa;
  min-height: 100vh;
  padding-top: 16px;
}

.contentInner {
  padding: 24px;
  min-height: calc(100vh - 64px - 80px); // 减去头部和页脚高度
}

// 暗色模式
:global(.dark) {
  .header {
    background-color: #1c1c1c;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  }
  
  .sider {
    background-color: #1c1c1c;
    
    :global(.ant-menu-item) {
      &:hover {
        background-color: rgba(255, 255, 255, 0.03);
      }
    }
    
    :global(.ant-menu-item-selected) {
      background-color: rgba(30, 136, 229, 0.2) !important;
    }
    
    :global(.ant-menu-divider) {
      background-color: rgba(255, 255, 255, 0.06);
    }
  }
  
  .content, .contentInner {
    background-color: #121212;
  }
  
  .pageTitle {
    color: rgba(255, 255, 255, 0.85);
    border-left-color: rgba(255, 255, 255, 0.1);
  }
}

// 响应式设计
@media (max-width: 768px) {
  .header {
    padding: 0 16px;
  }
  
  .contentInner {
    padding: 16px;
  }
}

// 滚动条样式
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

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

::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
}

:global(.dark) {
  ::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.2);
  }
}

.avatarContainer {
  cursor: pointer;
  transition: all 0.3s;
  
  &:hover {
    opacity: 0.8;
  }
}

.avatar {
  background: linear-gradient(135deg, #1E88E5, #7986CB);
  color: #fff;
}

.iconButton {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: all 0.3s ease;
  width: 36px;
  height: 36px;
  border-radius: 18px;
  
  &:hover {
    transform: scale(1.05);
    background-color: rgba(0, 0, 0, 0.03);
  }
  
  :global(.dark) & {
    &:hover {
      background-color: rgba(255, 255, 255, 0.05);
    }
  }
}

.mainMenu {
  height: 100%;
  border-right: 0;
  background-color: transparent;
}

.drawerHeader {
  display: flex;
  align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.mobileDrawer {
  :global(.ant-drawer-body) {
    padding: 0;
  }
  
  :global(.ant-drawer-header) {
    background-color: #fff;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    padding: 12px 24px;
    
    :global(.dark) & {
      background-color: #1c1c1c;
      border-bottom-color: rgba(255, 255, 255, 0.06);
    }
  }
}

.footer {
  margin-top: 24px;
  padding: 16px 24px 24px;
  text-align: center;
  background: transparent;
}

.footerContent {
  max-width: 1200px;
  margin: 0 auto;
}

.footerLinks {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 16px;
  
  a {
    color: rgba(0, 0, 0, 0.65);
    transition: all 0.3s;
    
    &:hover {
      color: #1E88E5;
    }
    
    :global(.dark) & {
      color: rgba(255, 255, 255, 0.65);
      
      &:hover {
        color: #90CAF9;
      }
    }
  }
}

.copyright {
  color: rgba(0, 0, 0, 0.45);
  font-size: 14px;
}

// 暗色模式扩展
:global(.dark) {
  .footerLinks a {
    color: rgba(255, 255, 255, 0.45);
    
    &:hover {
      color: #1890ff;
    }
  }
  
  .copyright {
    color: rgba(255, 255, 255, 0.45);
  }
  
  .iconButton {
    &:hover {
      background-color: rgba(255, 255, 255, 0.08);
    }
  }
} 