/**
 * AdminLayout 样式
 */

.layout {
  min-height: 100vh;
  background: var(--color-canvas);
}

/* 加载状态 */
.loadingContainer {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-canvas);
}

/* 侧边栏 */
.sider {
  background: var(--color-layout) !important;
  border-right: 1px solid var(--color-border-soft);
}

.logo {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 600;
  color: var(--color-text-strong);
  border-bottom: 1px solid var(--color-border-soft);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  padding: 0 16px;
}

.menu {
  background: transparent !important;
  border: none !important;
}

.menu :global(.ant-menu-item),
.menu :global(.ant-menu-submenu-title) {
  margin: 4px 8px !important;
  border-radius: var(--radius-sm) !important;
  pointer-events: auto !important;
  cursor: pointer !important;
}

.menu :global(.ant-menu-item-selected) {
  background: var(--color-primary) !important;
  color: var(--color-text-inverse) !important;
}

/* 确保子菜单可展开 */
.menu :global(.ant-menu-submenu-arrow) {
  pointer-events: none !important;
}

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

.headerLeft {
  display: flex;
  align-items: center;
  gap: 16px;
}

.collapseBtn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--color-text-base);
  font-size: 18px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background var(--motion-fast);
}

.collapseBtn:hover {
  background: var(--color-surface-muted);
}

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

.breadcrumbLink {
  color: var(--color-text-muted);
  cursor: pointer;
  transition: color var(--motion-fast);
}

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

.breadcrumbCurrent {
  color: var(--color-text-base);
  font-weight: 500;
}

.breadcrumbSeparator {
  margin: 0 8px;
  color: var(--color-text-muted);
}

.headerRight {
  display: flex;
  align-items: center;
  gap: 16px;
}

.userTrigger {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: background var(--motion-fast);
}

.userTrigger:hover {
  background: var(--color-surface-muted);
}

.userName {
  font-size: 14px;
  color: var(--color-text-base);
}

/* 内容区 */
.content {
  padding: 24px;
  min-height: calc(100vh - 64px);
  max-width: var(--page-max-width);
  width: 100%;
  margin: 0 auto;
}

/* 响应式 */
@media (max-width: 1024px) {
  .content {
    padding: 16px;
  }
}

/* 跳过链接 - 可访问性 */
.skipLink {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--color-primary);
  color: var(--color-text-inverse);
  padding: 8px 16px;
  z-index: 1000;
  transition: top 0.2s;
  text-decoration: none;
  border-radius: 0 0 4px 0;
  pointer-events: auto;
}

.skipLink:focus {
  top: 0;
  outline: 3px solid var(--color-primary);
  outline-offset: 2px;
}

/* 侧边栏层级 */
.sider {
  z-index: 100;
}

/* 确保布局不被遮挡 */
.layout {
  position: relative;
}

/* 移动端抽屉样式 */
.mobileDrawer :global(.ant-drawer-header) {
  border-bottom: 1px solid var(--color-border-soft);
}

.mobileDrawer :global(.ant-drawer-body) {
  padding: 0;
}
