/* ============================================================
   头像上传剪裁组件（前后台共用）
   自包含 .crop-modal，不依赖前台 .modal-mask / 后台 .modal-overlay
   ============================================================ */

.crop-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  box-sizing: border-box;
}
.crop-modal.show {
  opacity: 1;
  pointer-events: auto;
}

.crop-dialog {
  width: 100%;
  max-width: 340px;
  background: #fff;
  border-radius: 16px;
  padding: 20px;
  box-sizing: border-box;
}

.crop-title {
  font-size: 16px;
  font-weight: 600;
  color: #222;
  text-align: center;
  margin-bottom: 16px;
}

.crop-viewport {
  position: relative;
  width: min(260px, 78vw);
  height: min(260px, 78vw);
  margin: 0 auto;
  overflow: hidden;
  background: #f2f3f5;
  border-radius: 12px;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.crop-img {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
  max-width: none;
  will-change: transform;
  cursor: grab;
}
.crop-img:active {
  cursor: grabbing;
}

.crop-zoom-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
}
.crop-zoom-row span {
  font-size: 13px;
  color: #888;
  white-space: nowrap;
}
.crop-zoom-row input[type="range"] {
  flex: 1;
  /* 缩放滑块强调色走单色主题：绑定主文字黑，不引入蓝色 */
  accent-color: var(--c-text);
}

.crop-actions {
  display: flex;
  gap: 12px;
}
.crop-actions .btn {
  flex: 1;
}

/* 头像编辑区（表单内） */
.avatar-edit {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 4px;
}
.avatar-edit-preview {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  background: #f2f3f5;
  border: 1px solid #eee;
  flex-shrink: 0;
}
.avatar-edit-info {
  flex: 1;
  min-width: 0;
}
.avatar-edit-tip {
  font-size: 12px;
  color: #999;
  margin-top: 4px;
}
