@import '../../styles/shangjia-xym-common.wxss';

.role-page {
  min-height: 100vh;
  background: linear-gradient(180deg, #f7dc51 0%, #fff 28%, #fff8e1 100%);
  box-sizing: border-box;
}

.role-nav {
  padding: 0 24rpx 16rpx;
}

.nav-back {
  width: 60rpx;
  font-size: 48rpx;
  color: #333;
}

.nav-title {
  font-size: 34rpx;
  font-weight: 700;
  color: #343434;
}

.nav-link {
  width: 60rpx;
  text-align: right;
  font-size: 28rpx;
  color: #c9a962;
}

.role-scroll {
  height: calc(100vh - 120rpx);
}

.role-tip {
  font-size: 24rpx;
  color: #888;
  margin: 20rpx 24rpx;
}

.role-empty {
  text-align: center;
  padding: 80rpx 24rpx;
  font-size: 26rpx;
  color: #999;
}

.role-card {
  background: #fff;
  border-radius: 16rpx;
  padding: 24rpx;
  margin: 0 24rpx 20rpx;
  box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.06);
}

.role-name {
  font-size: 30rpx;
  font-weight: 600;
  color: #333;
}

.role-tag {
  font-size: 22rpx;
  color: #999;
}

.role-sub {
  display: block;
  margin-top: 8rpx;
  font-size: 24rpx;
  color: #666;
}

/* 弹层：独立根节点，全屏 fixed */
.role-mask {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
}

.role-mask-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
}

.role-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: #fff;
  border-radius: 24rpx 24rpx 0 0;
  padding: 32rpx 24rpx calc(24rpx + env(safe-area-inset-bottom));
  z-index: 1001;
  max-height: 85vh;
  box-sizing: border-box;
}

.panel-title {
  font-size: 32rpx;
  font-weight: 600;
  color: #333;
}

.panel-role-name {
  display: block;
  margin-top: 8rpx;
  margin-bottom: 16rpx;
  font-size: 26rpx;
  color: #888;
}

.perm-scroll {
  width: 100%;
}

.perm-row {
  padding: 20rpx 8rpx;
  border-bottom: 1rpx solid #f0f0f0;
  min-height: 88rpx;
  box-sizing: border-box;
}

.perm-row.perm-on {
  background: #fffbf0;
}

.perm-text {
  flex: 1;
  padding-right: 16rpx;
}

.perm-name {
  display: block;
  font-size: 28rpx;
  color: #333;
  line-height: 1.4;
}

.perm-code {
  display: block;
  margin-top: 4rpx;
  font-size: 22rpx;
  color: #999;
}

.perm-check {
  width: 48rpx;
  height: 48rpx;
  line-height: 48rpx;
  text-align: center;
  font-size: 32rpx;
  color: #c9a962;
  font-weight: 700;
  border: 2rpx solid #ddd;
  border-radius: 8rpx;
  flex-shrink: 0;
}

.perm-on .perm-check {
  border-color: #c9a962;
  background: #c9a962;
  color: #fff;
}

.perm-empty {
  padding: 40rpx 0;
  text-align: center;
  font-size: 26rpx;
  color: #999;
}

.name-input {
  border: 1rpx solid #eee;
  padding: 20rpx;
  margin: 16rpx 0;
  border-radius: 8rpx;
  font-size: 28rpx;
}

.panel-btns {
  margin-top: 24rpx;
  gap: 16rpx;
}

.panel-btn {
  flex: 1;
  margin: 0;
  padding: 0;
  height: 88rpx;
  line-height: 88rpx;
  font-size: 30rpx;
  border-radius: 12rpx;
  border: none;
}

.panel-btn::after {
  border: none;
}

.panel-btn.cancel {
  background: #f5f5f5;
  color: #666;
}

.panel-btn.ok {
  background: #c9a962;
  color: #fff;
}

.btn-hover {
  opacity: 0.85;
}
