/* ===== 主页特定样式 ===== */

/* ===== 布局样式 ===== */

/* 主布局容器 */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

/* 侧边栏样式 */
.sidebar {
    width: var(--sidebar-width);
    background: #001529;
    color: #fff;
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    transition: all 0.3s ease;
}

.sidebar.collapsed {
    width: 80px;
}

.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid #1f2937;
    padding: 0 20px;
}

.sidebar-logo {
    font-size: 20px;
    font-weight: bold;
    color: #fff;
    text-decoration: none;
}

.sidebar-nav {
    padding: 20px 0;
}

.nav-item {
    list-style: none;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: rgba(255, 255, 255, 0.65);
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.nav-link:hover {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.1);
}

.nav-link.active {
    color: #fff;
    background-color: var(--primary-color);
    border-left-color: #fff;
}

.nav-icon {
    margin-right: 12px;
    font-size: 16px;
    width: 16px;
    text-align: center;
}

/* 主内容区域 */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    transition: margin-left 0.3s ease;
}

.sidebar.collapsed + .main-content {
    margin-left: 80px;
}

.collapsed-flyout {
    background: #001529;
    border: 1px solid #1f2937;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-medium);
    min-width: 200px;
    z-index: 1001;
    padding: 6px;
}
.collapsed-flyout::after {
    content: "";
    position: absolute;
    top: 12px;
    left: -9px;
    width: 0;
    height: 0;
    border-top: 9px solid transparent;
    border-bottom: 9px solid transparent;
    border-right: 9px solid #1f2937;
}
.collapsed-flyout::before {
    content: "";
    position: absolute;
    top: 12px;
    left: -8px;
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-right: 8px solid #001529;
}

.collapsed-flyout-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.collapsed-flyout-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    background: none;
    border: none;
    border-radius: var(--border-radius);
    padding: 10px 16px;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.85);
}

.collapsed-flyout-item:hover {
    background-color: rgba(255, 255, 255, 0.10);
}

.collapsed-flyout-item i {
    width: 16px;
    text-align: center;
    color: rgba(255, 255, 255, 0.85);
}

.collapsed-flyout-item span {
    flex: 1;
    color: rgba(255, 255, 255, 0.85);
}

/* 顶部导航栏 */
.header {
    height: var(--header-height);
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    box-shadow: var(--shadow-light);
    position: sticky;
    top: 0;
    z-index: 999;
}

.header-left {
    display: flex;
    align-items: center;
}

.sidebar-toggle {
    background: none;
    border: none;
    font-size: 18px;
    color: var(--text-color);
    cursor: pointer;
    padding: 8px;
    margin-right: 16px;
    border-radius: var(--border-radius);
    transition: background-color 0.3s ease;
}

.sidebar-toggle:hover {
    background-color: var(--border-light);
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 3px;
}

.breadcrumb-item {
    position: relative;
}

.breadcrumb-item:not(:last-child)::after {
    content: '/';
    margin-left: 8px;
    color: var(--text-muted);
}

.breadcrumb-item:last-child {
    color: var(--text-color);
    font-weight: 500;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-info {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: var(--border-radius);
    transition: background-color 0.3s ease;
}

.user-info:hover {
    background-color: var(--border-light);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    margin-right: 8px;
    background-color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: bold;
}

/* 用户下拉菜单样式 */
.user-dropdown {
    position: relative;
    display: inline-block;
}

.user-info span {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-color);
    margin-right: 4px;
}

.user-info i {
    font-size: 12px;
    color: var(--text-muted);
    transition: transform 0.3s ease;
}

.user-dropdown.active .user-info i {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-medium);
    min-width: 160px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    margin-top: 8px;
}

.dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: var(--text-color);
    text-decoration: none;
    font-size: 14px;
    transition: background-color 0.3s ease;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.dropdown-item:hover {
    background-color: var(--bg-light);
}

.dropdown-item i {
    margin-right: 8px;
    font-size: 14px;
    width: 16px;
    text-align: center;
}

.dropdown-divider {
    height: 1px;
    background-color: var(--border-light);
    margin: 4px 0;
}

.dropdown-item.logout {
    color: #dc3545;
}

.dropdown-item.logout:hover {
    background-color: #fff5f5;
}



/* 响应式设计 */
@media (max-width: 768px) {
    .dropdown-menu {
        right: -8px;
        min-width: 140px;
    }
}

/* 页面内容区域 */
.page-content {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
}

.page-header {
    margin-bottom: 24px;
}

.page-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 8px;
}

.page-description {
    color: var(--text-secondary);
    font-size: 14px;
}

/* 子菜单样式 */
.nav-submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background-color: rgba(255, 255, 255, 0.05);
}

.nav-submenu.show {
    max-height: 500px;
}

.nav-submenu .nav-link {
    padding-left: 3rem;
    font-size: 0.9rem;
    border-left: 2px solid transparent;
}

.nav-submenu .nav-link:hover {
    border-left-color: var(--primary-color);
    background-color: rgba(255, 255, 255, 0.1);
}

.nav-submenu .nav-link.active {
    border-left-color: var(--primary-color);
    background-color: rgba(255, 255, 255, 0.15);
}

/* 菜单箭头样式 */
.nav-arrow {
    margin-left: auto;
    transition: transform 0.3s ease;
    font-size: 0.8rem;
}

.nav-item.expanded .nav-arrow {
    transform: rotate(90deg);
}

.nav-item.has-children > .nav-link {
    position: relative;
}

/* 侧边栏折叠时的子菜单处理 */
.sidebar.collapsed .nav-submenu {
    display: none;
}

.sidebar.collapsed .nav-arrow {
    display: none;
}

/* 侧边栏折叠时隐藏文本，只显示图标 */
.sidebar.collapsed .nav-link span {
    display: none;
}

.sidebar.collapsed .sidebar-logo {
    font-size: 0;
    overflow: hidden;
}

.sidebar.collapsed .sidebar-logo i {
    font-size: 24px;
}

.sidebar.collapsed .sidebar-header {
    padding: 0 10px;
    justify-content: center;
}

.sidebar.collapsed .nav-link {
    padding: 12px 0;
    justify-content: center;
}

.sidebar.collapsed .nav-icon {
    margin-right: 0;
    font-size: 18px;
}

/* 布局响应式设计 */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .sidebar.collapsed + .main-content {
        margin-left: 0;
    }
    
    .page-content {
        padding: 16px;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 0 16px;
    }
    
    .page-content {
        padding: 12px;
    }
}