/* 整体布局样式 */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

#app {
    height: 100vh;
}

#contentContainer {
    height: 100%;
    overflow: hidden;
    /* 确保内容不会溢出到header上方 */
    position: relative;
}

/* 头部导航栏固定高度 */
header {
    height: 4rem !important; /* 64px */
    min-height: 4rem !important;
    flex-shrink: 0 !important;
    position: relative !important;
    z-index: 50 !important;
}

/* 确保主内容区域正确布局 */
#mainContent {
    display: flex !important;
    flex-direction: column !important;
    height: 100vh !important;
    /* overflow: hidden !important; */
}

/* 内容区域占满剩余空间 */
#mainContent > div:last-child {
    flex: 1 !important;
    min-height: 0 !important;
    overflow: hidden !important;
}

/* 确保侧边栏过渡效果平滑 */
.sidebar-transition {
    transition: all 0.3s ease-in-out;
}

/* 主内容区域过渡效果 */
#mainContent {
    transition: all 0.3s ease-in-out;
    margin-left: 16rem; /* 默认展开状态下的左边距 */
    width: calc(100% - 16rem); /* 默认展开状态下的宽度 */
    height: 100vh; /* 占满视口高度 */
}

/* 侧边栏折叠时的主内容区域样式 */
#mainContent.sidebar-collapsed {
    margin-left: 4rem; /* 折叠状态下的左边距 */
    width: calc(100% - 4rem); /* 折叠状态下的宽度 */
}

/* 侧边栏展开时的主内容区域样式 */
#mainContent.sidebar-expanded {
    margin-left: 16rem; /* 展开状态下的左边距 */
    width: calc(100% - 16rem); /* 展开状态下的宽度 */
}

/* 移动设备上的主内容区域样式 */
@media (max-width: 768px) {
    #mainContent {
        margin-left: 0 !important; /* 移动设备上没有左边距 */
        width: 100% !important; /* 移动设备上宽度为100% */
    }
}

/* 确保菜单激活指示器正确显示 */
.menu-active-indicator {
    width: 4px;
    height: 24px;
    border-radius: 0 4px 4px 0;
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    transition: all 0.2s ease;
}

/* 确保菜单项内容正确对齐 */
.sidebar-menu-item {
    display: flex;
    align-items: center;
    position: relative;
    padding-left: 12px;
    width: 100%;
    height: 100%;
}

/* 确保菜单项内的图标和文本正确对齐 */
.sidebar-menu-item i {
    position: relative;
    z-index: 1;
    margin-left: 8px;
    /* 调整图标位置，使其底一点 */
    display: flex;
    align-items: center;
    height: 100%;
    margin-top: 1px;
}

.sidebar-menu-item span {
    position: relative;
    z-index: 1;
    margin-left: 8px;
}

/* 确保菜单项在激活状态下的样式正确 */
.bg-blue-50 .menu-active-indicator {
    background-color: #3b82f6 !important;
}

/* 确保菜单项在激活状态下的指示器正确显示 */
a.bg-blue-50 .sidebar-menu-item .menu-active-indicator {
    display: block;
}

/* 非激活状态下隐藏指示器 */
a:not(.bg-blue-50) .sidebar-menu-item .menu-active-indicator {
    display: none;
}

/* 侧边栏折叠状态下隐藏指示器 */
#sidebar.collapsed .menu-active-indicator {
    display: none;
}

/* 折叠按钮样式 */
.toggle-btn {
    cursor: pointer;
    padding: 8px 10px;
    border-radius: 4px;
    background-color: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
    position: relative; /* 确保按钮有正确的定位 */
    z-index: 60; /* 确保按钮在最上层 */
    margin-left: 0; /* 强制左边距为0 */
}

.toggle-btn:hover {
    background-color: #e5e7eb;
}

.toggle-btn i {
    font-size: 1rem;
    color: #4b5563;
    transition: transform 0.3s ease;
}

/* 折叠按钮图标动画 */
.sidebar-icon {
    transition: transform 0.3s ease, color 0.3s ease;
}

#sidebar.collapsed ~ .flex-1 .sidebar-icon.fa-chevron-left {
    color: #3b82f6;
    transform: rotate(180deg);
}

#sidebar:not(.collapsed) ~ .flex-1 .sidebar-icon.fa-grip-lines {
    color: #4b5563;
}

/* 侧边栏折叠状态样式 */
.collapsed .transition-opacity {
    opacity: 0;
    visibility: hidden;
    display: none;
}

.sidebar-expanded .transition-opacity {
    opacity: 1;
    visibility: visible;
    display: inline;
}

/* 确保图标在折叠状态下居中 */
.collapsed .fa-leaf,
.collapsed .w-4.h-4 {
    margin-right: 0;
    margin-left: 0;
}

/* 侧边栏折叠状态下的菜单项居中 */
#sidebar.collapsed .sidebar-menu-item {
    padding-left: 0;
    justify-content: center;
}

#sidebar.collapsed .sidebar-menu-item i {
    margin-left: 0;
    margin-right: 0;
}

/* 折叠状态下所有菜单链接和按钮居中 */
#sidebar.collapsed a,
#sidebar.collapsed button {
    justify-content: center !important;
    text-align: center;
}

/* 折叠状态下的菜单项容器居中 */
#sidebar.collapsed li,
#sidebar.collapsed .flex.items-center {
    justify-content: center;
}

/* 品牌图标在折叠状态下居中 */
#sidebar.collapsed .h-5.w-5 {
    margin-left: 0;
    margin-right: 0;
}

/* 品牌标识容器居中 */
#sidebar.collapsed .flex.items-center.justify-between,
#sidebar.collapsed .flex.items-center {
    justify-content: center !important;
}

/* 确保所有图标在折叠状态下居中 */
#sidebar.collapsed i,
#sidebar.collapsed .fas,
#sidebar.collapsed .fa {
    margin-left: 0 !important;
    margin-right: 0 !important;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* 折叠状态下的图标父容器居中 */
#sidebar.collapsed .w-4,
#sidebar.collapsed .h-4,
#sidebar.collapsed .w-5,
#sidebar.collapsed .h-5 {
    margin-left: auto;
    margin-right: auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* 折叠状态下的子菜单（二级菜单）居中 */
#sidebar.collapsed .pl-8 {
    padding-left: 0 !important;
}

#sidebar.collapsed .pl-8 li,
#sidebar.collapsed .pl-8 a {
    justify-content: center !important;
    text-align: center;
    padding-left: 0;
    padding-right: 0;
}

#sidebar.collapsed .pl-8 .sidebar-menu-item {
    justify-content: center;
    padding-left: 0;
}

#sidebar.collapsed .pl-8 i {
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* 侧边栏内容过渡优化 */
#sidebar .transition-opacity {
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 品牌图标位置过渡 */
#sidebar .h-5.w-5 {
    transition: margin 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 菜单项图标过渡 */
#sidebar .sidebar-menu-item i {
    transition: margin 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 用户头像按钮样式 */
.user-avatar-container {
    position: relative;
    z-index: 1000;
}

.user-avatar {
    height: 2rem;
    width: 2rem;
    border-radius: 9999px;
    object-fit: cover;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.2s;
}

.user-avatar:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.user-avatar-placeholder {
    height: 2rem;
    width: 2rem;
    border-radius: 9999px;
    background-color: #3b82f6;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.2s;
}

.user-avatar-placeholder:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* 用户下拉菜单样式 */
.user-dropdown-menu {
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 0.5rem;
    z-index: 1001;
    width: 200px;
    min-width: 200px;
    background-color: white;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

/* 菜单图标间距 */
.menu-icon {
    margin-right: 12px;
}

/* 页面标题样式 */
.page-title {
    font-weight: 500;
    color: #4B5563;
    display: inline-block;
}

/* 面包屑导航样式（在header内） */
.admin-breadcrumb-nav-inline {
    width: 100%;
}

.admin-breadcrumb-list-inline {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
}

.admin-breadcrumb-item {
    display: flex;
    align-items: center;
}

.admin-breadcrumb-link {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #3b82f6;
    text-decoration: none;
    font-size: 16px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.admin-breadcrumb-link:hover {
    background-color: #eff6ff;
    color: #2563eb;
}

.admin-breadcrumb-link i {
    font-size: 12px;
}

.admin-breadcrumb-item-current {
    color: #6b7280;
    font-size: 14px;
    padding: 4px 8px;
}

.admin-breadcrumb-current-text {
    color: #000;
    font-weight: 500;
    font-size: 16px;
}

.admin-breadcrumb-separator {
    display: flex;
    align-items: center;
    margin: 0 4px;
    color: #9ca3af;
    font-size: 12px;
}

.admin-breadcrumb-separator i {
    font-size: 10px;
}

/* 主内容区域样式 */
.main-content-header {
    position: static;
    z-index: 1;
}

/* 确认对话框样式 */
.confirm-dialog-overlay {
    display: none;
} 

/* 确保侧边栏在桌面端正确显示 */
@media (min-width: 1024px) {
    #sidebar {
        transform: none;
    }
} 