/* =========================================================
   图片裁剪器（用户端 / 后台共用）
   独立样式表：颜色按各自主题的可用变量回退，避免互相污染
   ========================================================= */
.crop-mask {
  --cr-brand: var(--brand, var(--primary, #6a5ae0));
  --cr-surface: var(--surface, #fff);
  --cr-surface-2: var(--surface-2, #f2f1f6);
  --cr-surface-3: var(--surface-3, #e6e5ec);
  --cr-line: var(--line, #e8e6f0);
  --cr-ink-2: var(--ink-2, #5c5872);
  --cr-ink-3: var(--ink-3, #8d88a2);
  position: fixed; inset: 0; z-index: 200; display: none;
  align-items: center; justify-content: center; padding: 16px;
  background: rgba(22,20,36,.62);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.crop-mask.open { display: flex; animation: cropFade .22s cubic-bezier(.16,1,.3,1) both; }
@keyframes cropFade { from { opacity: 0; } to { opacity: 1; } }

.crop-card {
  width: 100%; max-width: 400px; background: var(--cr-surface);
  border-radius: 20px; padding: 20px 16px 16px;
  box-shadow: 0 2px 6px rgba(20,20,30,.08), 0 24px 48px rgba(20,20,30,.22);
  animation: cropIn .38s cubic-bezier(.34,1.3,.64,1) both;
  max-height: 94dvh; overflow-y: auto;
}
@keyframes cropIn { from { opacity: 0; transform: translateY(14px) scale(.95); } to { opacity: 1; transform: none; } }

.crop-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.crop-head b { font-size: 17px; font-weight: 800; letter-spacing: .3px; }
.crop-tip { font-size: 11px; color: var(--cr-ink-3); text-align: right; }

.crop-stage {
  position: relative; margin: 0 auto 14px; overflow: hidden;
  border-radius: 12px; background: #14121f; touch-action: none; cursor: grab;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
}
.crop-stage:active { cursor: grabbing; }
.crop-stage img {
  position: absolute; left: 50%; top: 50%; max-width: none; transform-origin: center;
  user-select: none; -webkit-user-select: none; -webkit-user-drag: none; will-change: transform;
}
.crop-guides {
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(to right,
      transparent calc(33.33% - .5px), rgba(255,255,255,.3) 0 calc(33.33% + .5px),
      transparent 0 calc(66.66% - .5px), rgba(255,255,255,.3) 0 calc(66.66% + .5px), transparent 0),
    linear-gradient(to bottom,
      transparent calc(33.33% - .5px), rgba(255,255,255,.3) 0 calc(33.33% + .5px),
      transparent 0 calc(66.66% - .5px), rgba(255,255,255,.3) 0 calc(66.66% + .5px), transparent 0);
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.5);
}

.crop-zoom { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.crop-zoom-btn {
  width: 34px; height: 34px; flex: none; border: 1px solid var(--cr-line); border-radius: 10px;
  background: var(--cr-surface-2); color: var(--cr-ink-2); font-size: 17px; line-height: 1;
  display: grid; place-items: center; cursor: pointer;
  transition: background .16s, transform .16s;
}
.crop-zoom-btn:active { transform: scale(.93); background: var(--cr-surface-3); }
.crop-zoom input[type="range"] {
  -webkit-appearance: none; appearance: none; flex: 1; height: 4px; border-radius: 999px;
  background: var(--cr-surface-3); outline: none; margin: 0;
}
.crop-zoom input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%;
  background: var(--cr-brand); border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(20,20,30,.25); cursor: pointer;
}
.crop-zoom input[type="range"]::-moz-range-thumb {
  width: 16px; height: 16px; border-radius: 50%; background: var(--cr-brand);
  border: 2px solid #fff; cursor: pointer;
}

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

/* 裁剪器内的按钮：与卡片一致，去掉硬阴影 */
.crop-actions .btn { box-shadow: none !important; }
.crop-actions .btn.ghost { border-color: var(--cr-line); }
