/* Xuanren Component Styles - Mobile Friendly Refactor */
.modal-xuanren {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.6);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.xr-box {
  width: 90%;
  max-width: 420px; /* Limit width for desktop but keep mobile fullish */
  height: 80vh;
  background: #fff;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

.xr-header {
  height: 50px;
  border-bottom: 1px solid #eee;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  flex-shrink: 0;
}

.xr-title {
  font-size: 16px;
  font-weight: 600;
  color: #333;
}

.xr-mode-badge {
  font-size: 11px;
  background: #f0f0f0;
  padding: 2px 6px;
  border-radius: 4px;
  color: #666;
  font-weight: normal;
  margin-left: 6px;
  vertical-align: middle;
}

.xr-close {
  font-size: 24px;
  color: #999;
  cursor: pointer;
  line-height: 1;
}

/* Single Column Body */
.xr-body-mobile {
  flex: 1;
  overflow-y: auto;
  background: #fff;
  -webkit-overflow-scrolling: touch;
}

.xr-list {
  padding-bottom: 16px;
}

.xr-item {
  display: flex;
  align-items: center;
  min-height: 48px; /* Slightly taller for touch targets */
  padding-right: 16px;
  cursor: pointer;
  border-bottom: 1px solid #f9f9f9;
  transition: background 0.1s;
}

.xr-item:active {
  background: #f5f5f5;
}

/* Dept Node Styles */
.xr-item.type-dept {
  color: #333;
  font-weight: 500;
}

.dept-arrow {
  display: inline-block;
  width: 24px;
  text-align: center;
  margin-right: 2px;
  color: #999;
  font-size: 12px;
  transition: transform 0.2s;
}

.dept-arrow.expanded {
  transform: rotate(90deg);
}

.dept-arrow.leaf {
  opacity: 0.3;
}

.dept-name {
  font-size: 15px;
}

.dept-count {
  font-size: 12px;
  color: #999;
  margin-left: 6px;
}

/* User Node Styles */
.xr-item.type-user {
  background: #fff;
}

.xr-item.type-user.selected {
  background: #f0f8ff;
}

.u-avt-small {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  margin-right: 10px;
}

.u-info-inline {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.u-name {
  font-size: 14px;
  color: #333;
  line-height: 1.3;
}

.u-job {
  font-size: 12px;
  color: #999;
  line-height: 1.2;
}

.u-check {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--blue, #007bff);
  font-weight: bold;
}

/* Footer */
.xr-footer {
  border-top: 1px solid #eee;
  padding: 12px 16px;
  background: #fff;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.xr-selected-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: #666;
  min-height: 24px;
}

.sel-avatars {
  display: flex;
  align-items: center;
}

.sel-avatars img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  margin-left: -8px;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px #eee;
}

.sel-avatars img:first-child {
  margin-left: 0;
}

.more-dot {
  margin-left: 4px;
  color: #999;
}

.xr-btns {
  display: flex;
  gap: 12px;
}

.xr-btn {
  flex: 1;
  height: 40px;
  border: none;
  border-radius: 6px;
  font-size: 15px;
  cursor: pointer;
  font-weight: 500;
}

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

.xr-btn.confirm {
  background: var(--blue, #007bff);
  color: #fff;
}

.xr-btn.confirm:disabled {
  background: #ccc;
  cursor: not-allowed;
}
