/* 通用后台布局样式 */
:root {
  --sidebar-width: 240px;
  --header-height: 60px;
  --primary-color: #1890ff;
  --sidebar-bg: #001529;
  --sidebar-hover: #112240;
  --header-bg: #ffffff;
  --content-bg: #f0f2f5;
  --border-color: #e8e8e8;
  --text-primary: #262626;
  --text-secondary: #8c8c8c;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: var(--content-bg);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

/* 主布局容器 */
.layout-container {
  display: flex;
  min-height: 100vh;
}

/* 左侧菜单 */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--sidebar-bg);
  color: white;
  position: fixed;
  left: 0;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 1000;
  transition: transform 0.3s ease;
}

.sidebar-header {
  height: var(--header-height);
  padding: 0 20px;
  background-color: var(--sidebar-bg);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-header h1 {
  font-size: 18px;
  font-weight: 500;
  color: white;
  margin: 0;
  letter-spacing: 0.5px;
}

.sidebar-menu {
  padding: 10px 0;
}

.menu-item {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  color: rgba(255, 255, 255, 0.65);
  text-decoration: none;
  transition: all 0.2s;
  border-left: 3px solid transparent;
  cursor: pointer;
  font-size: 14px;
  user-select: none;
}

.menu-item:hover {
  background-color: var(--sidebar-hover);
  color: white;
  border-left-color: var(--primary-color);
}

.menu-item.active {
  background-color: var(--sidebar-hover);
  color: white;
  border-left-color: var(--primary-color);
  font-weight: 500;
}

.menu-item.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.menu-item.has-children {
  position: relative;
}

.menu-item-text {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
}

.menu-arrow {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
}

.menu-item.expanded .menu-arrow {
  transform: rotate(90deg);
}

.menu-group {
  margin-top: 10px;
}

.menu-group-title {
  padding: 10px 20px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.menu-children {
  padding-left: 0;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
}

.menu-item.expanded + .menu-children {
  max-height: 2000px;
  transition: max-height 0.3s ease-in;
}

.menu-children .menu-item {
  padding-left: 40px;
  font-size: 14px;
}

.menu-children .menu-children .menu-item {
  padding-left: 60px;
  font-size: 13px;
}

/* 主内容区 */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* 顶部头部 */
.header {
  height: var(--header-height);
  background-color: var(--header-bg);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 14px;
}

.breadcrumb a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s;
}

.breadcrumb a:hover {
  color: var(--primary-color);
}

.breadcrumb-separator {
  color: var(--text-secondary);
  margin: 0 4px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.user-info:hover {
  background-color: #f5f5f5;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 500;
  font-size: 14px;
}

.user-name {
  font-size: 14px;
  color: var(--text-primary);
  font-weight: 500;
}

.user-role {
  font-size: 12px;
  color: var(--text-secondary);
}

.notification-wrapper {
  position: relative;
}

.notification-icon {
  position: relative;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 4px;
  transition: background-color 0.2s;
  font-size: 14px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.notification-icon:hover {
  background-color: #f5f5f5;
}

.notification-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  background-color: #ff4d4f;
  color: white;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
}

.notification-badge:empty {
  display: none;
}

.notification-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 360px;
  max-height: 480px;
  background-color: white;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: none;
  flex-direction: column;
  z-index: 1000;
}

.notification-panel.show {
  display: flex;
}

.notification-header {
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.notification-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
  color: var(--text-primary);
}

.notification-mark-all {
  background: none;
  border: none;
  color: var(--primary-color);
  cursor: pointer;
  font-size: 14px;
  padding: 0;
  transition: opacity 0.2s;
}

.notification-mark-all:hover {
  opacity: 0.7;
}

.notification-list {
  flex: 1;
  overflow-y: auto;
  max-height: 400px;
}

.notification-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  transition: background-color 0.2s;
  display: flex;
  gap: 12px;
}

.notification-item:hover {
  background-color: #fafafa;
}

.notification-item.unread {
  background-color: #f0f7ff;
}

.notification-item.unread:hover {
  background-color: #e6f4ff;
}

.notification-item-content {
  flex: 1;
  min-width: 0;
}

.notification-item-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.notification-item-text {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notification-item-time {
  font-size: 12px;
  color: var(--text-secondary);
}

.notification-item-dot {
  width: 8px;
  height: 8px;
  background-color: var(--primary-color);
  border-radius: 50%;
  margin-top: 6px;
  flex-shrink: 0;
}

.notification-item.read .notification-item-dot {
  display: none;
}

.notification-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border-color);
  text-align: center;
}

.notification-footer a {
  color: var(--primary-color);
  text-decoration: none;
  font-size: 14px;
}

.notification-footer a:hover {
  text-decoration: underline;
}

.notification-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 14px;
}

/* 内容区域 */
.content {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
}

.page-title {
  font-size: 20px;
  font-weight: 500;
  color: var(--text-primary);
  margin: 0 0 24px 0;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  .menu-toggle {
    display: block;
  }
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--text-primary);
  padding: 8px;
  margin-right: 12px;
}

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

.sidebar::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
}

.sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}

