.role-info-cards-container { display: flex; flex-wrap: wrap; gap: 16px; justify-content: flex-start; padding: 20px; } .role-item { background-color: #ffffff; border-radius: 16px; padding: 20px; box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); width: 280px; transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out; position: relative; } .role-item:hover { transform: translateY(-4px); box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15); } .role-info-create-role-button { background-color: #0a84ff; color: white; border: none; padding: 12px 24px; border-radius: 22px; cursor: pointer; font-size: 17px; font-weight: 600; box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); transition: background-color 0.3s, transform 0.2s; margin: 20px; } .role-info-create-role-button:hover { background-color: #0051a8; transform: translateY(-2px); } /* 弹出菜单样式 */ #role-action-menu { position: absolute; background-color: #ffffff; border: 1px solid #d1d1d6; border-radius: 12px; box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); padding: 12px; z-index: 1000; width: 150px; } #role-action-menu button { width: 100%; padding: 10px; background-color: #0a84ff; color: white; border: none; border-radius: 10px; cursor: pointer; font-size: 15px; margin-bottom: 8px; transition: background-color 0.3s; } #role-action-menu button:last-child { margin-bottom: 0; } #role-action-menu button:hover { background-color: #0051a8; } /* 模态框内按钮 */ .role-info-button { padding: 12px 24px; background-color: #34c759; color: white; border: none; border-radius: 12px; cursor: pointer; transition: background-color 0.3s, transform 0.2s; margin-bottom: 12px; font-size: 16px; font-weight: 500; } .role-info-button:hover { background-color: #28a745; transform: translateY(-2px); } .role-info-button-delete { background-color: #ff3b30; } .role-info-button-delete:hover { background-color: #c23321; } /* 创建角色模态框 */ .CreateRoleModal-modal { display: none; /* 隐藏模态框 */ position: fixed; z-index: 2000; /* 在最上层 */ left: 0; top: 0; width: 100%; /* 100% 宽 */ height: 100%; /* 100% 高 */ overflow: auto; /* 如果需要滚动条 */ background-color: rgba(0, 0, 0, 0.4); /* 半透明背景 */ } .CreateRoleModal-modal-content { background-color: #ffffff; margin: 10% auto; /* 居中 */ padding: 30px; border-radius: 20px; width: 90%; max-width: 500px; box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2); position: relative; } .CreateRoleModal-close { color: #8e8e93; position: absolute; top: 20px; right: 20px; font-size: 24px; font-weight: bold; cursor: pointer; transition: color 0.3s; } .CreateRoleModal-close:hover, .CreateRoleModal-close:focus { color: #ff3b30; } /* 表单元素 */ form label { display: block; margin-bottom: 8px; font-weight: 500; color: #3c3c43; } form input[type="text"] { width: 100%; padding: 10px 14px; margin-bottom: 16px; border: 1px solid #d1d1d6; border-radius: 12px; font-size: 16px; background-color: #f2f2f7; color: #1c1c1e; } form input[type="submit"], form button { background-color: #0a84ff; color: white; border: none; padding: 12px 24px; border-radius: 22px; cursor: pointer; font-size: 17px; font-weight: 600; transition: background-color 0.3s, transform 0.2s; } form input[type="submit"]:hover, form button:hover { background-color: #0051a8; transform: translateY(-2px); } /* 权限复选框容器 */ #permissionsContainer div { margin-bottom: 8px; /* 减少下方间距 */ } #permissionsContainer label { display: inline-block; /* 让复选框和文字同一行 */ margin-left: 8px; margin-bottom: 4px; /* 减少下方间距 */ font-weight: 400; color: #3c3c43; vertical-align: middle; /* 让标签和复选框对齐 */ } /* 子权限复选框容器 */ .role-sub-permissions { margin-left: 15px; /* 保持左侧缩进 */ margin-bottom: 4px; /* 减少子权限复选框的下方间距 */ } .role-sub-permissions input[type="checkbox"] + label { display: inline-block; /* 使标签和复选框同一行 */ margin-left: 8px; vertical-align: middle; padding: 0; /* 移除子权限项的内边距 */ } /* 父权限容器样式 */ .parent-permission { border-top: 1px solid #ccc; border-bottom: 1px solid #ccc; padding: 12px 0; } /* 移除第一个父权限容器的上边框 */ .permissionsContainer .parent-permission:first-child { border-top: none; } /* 移除最后一个父权限容器的下边框 */ .permissionsContainer .parent-permission:last-child { border-bottom: none; } /* 禁用按钮样式 */ .role-info-button-disabled { padding: 12px 24px; background-color: #c7c7cc; color: white; border: none; border-radius: 12px; cursor: not-allowed; font-size: 16px; text-align: center; } /* 置顶角色样式 */ .top-role { border: 2px solid #0a84ff; } /* 响应式调整 */ @media (max-width: 600px) { .role-info-cards-container { flex-direction: column; align-items: center; } .role-item { width: 90%; } .CreateRoleModal-modal-content { width: 95%; } } /* 优化模态框内权限部分的布局 */ .CreateRoleModal-modal-content form { display: flex; flex-direction: column; } .CreateRoleModal-modal-content form label { margin-bottom: 4px; /* 减少标签下方间距 */ } .CreateRoleModal-modal-content form input[type="text"] { margin-bottom: 12px; /* 调整输入框下方间距 */ }