/* Moments Maker · 通用橡皮擦组件样式（刀 1）
   跟宿主页的 token 走（--ink / --ink-2 / --ink-3 / --hairline / --accent / --sel / --ice），宿主没定义时用裁剪器同款兜底值；
   按钮照站内 upbtn 胶囊、画布照魔棒台棋盘格，不另起色系。 */
.mme { --mme-ink: var(--ink, #292631); --mme-ink2: var(--ink-2, #716c78); --mme-ink3: var(--ink-3, #716c78);
       --mme-line: var(--hairline, rgba(41,38,49,.12)); --mme-accent: var(--accent, #292631);
       --mme-sel: var(--sel, #c9bedc); --mme-ice: var(--ice, #c8dee7);
       color: var(--mme-ink); min-width: 0; }
.mme *, .mme *::before, .mme *::after { box-sizing: border-box; }

.mme-pens { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 999px; background: #fff; border: 1px solid var(--mme-line); width: max-content; max-width: 100%; }
.mme-pen { min-height: 44px; font-size: 13px; font-weight: 600; padding: 7px 16px; border-radius: 999px; cursor: pointer; border: none; background: transparent; color: var(--mme-ink2); transition: all .15s; }
.mme-pen:hover { color: var(--mme-ink); }
.mme-pen.on { background: var(--mme-ink); color: #fff; }
.mme-pen:disabled { opacity: .5; cursor: not-allowed; }
.mme-badge { font-size: 10px; font-weight: 700; margin-left: 5px; padding: 1px 6px; border-radius: 999px; background: var(--mme-sel); color: var(--mme-ink); vertical-align: 1px; }
.mme-tooltip { font-size: 12px; color: var(--mme-ink3); margin: 8px 2px 10px; line-height: 1.7; }

/* 画布台：外框白卡，图层按缩放平移变换；棋盘格垫在图本身下面，擦掉的地方透出来（同魔棒台） */
.mme-view { position: relative; height: 460px; border-radius: 16px; overflow: hidden; border: 1px solid var(--mme-line);
            background: #fff; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
            cursor: crosshair; outline: none; }
.mme button:focus-visible, .mme input:focus-visible, .mme-view:focus-visible { outline: 2px solid var(--mme-ink); outline-offset: 3px; }
.mme-view.panning { cursor: grab; }
.mme-view.empty { cursor: default; }
.mme-layer { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }
.mme-view.empty .mme-layer, .mme-view.empty .mme-zoom { display: none; }
.mme-canvas, .mme-mask { position: absolute; left: 0; top: 0; display: block; max-width: none; image-rendering: auto; }
.mme-canvas { background: repeating-conic-gradient(#e3e7ee 0 25%, #f4f6fa 0 50%) 0 0 / 18px 18px; box-shadow: 0 1px 6px rgba(30,25,20,.12); }
.mme-mask { pointer-events: none; }
.mme-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center;
             font-size: 13px; color: var(--mme-ink3); line-height: 2; padding: 20px; }
.mme-view:not(.empty) .mme-empty { display: none; }
.mme-ring { position: absolute; pointer-events: none; border-radius: 50%; border: 1.5px solid rgba(41,38,49,.8);
            box-shadow: 0 0 0 1px rgba(255,255,255,.85); }
.mme-loupe { position: absolute; left: 10px; top: 10px; width: 132px; height: 132px; border-radius: 14px; pointer-events: none;
             border: 2px solid #fff; box-shadow: 0 4px 16px rgba(30,25,20,.28); background: #fff; }
.mme-loupe.right { left: auto; right: 10px; }
.mme-loupe[hidden], .mme-ring[hidden] { display: none; }
.mme-zoom { position: absolute; right: 10px; bottom: 10px; display: flex; align-items: center; gap: 2px; padding: 3px;
            border-radius: 999px; background: rgba(255,255,255,.92); border: 1px solid var(--mme-line); }
.mme-zoom button { font-size: 13px; font-weight: 700; min-width: 44px; height: 44px; padding: 0 8px; border-radius: 999px; border: none;
                   background: transparent; color: var(--mme-ink2); cursor: pointer; }
.mme-zoom button:hover { background: var(--mme-ice); color: var(--mme-ink); }
.mme-zoomval { font-size: 11.5px; font-weight: 700; color: var(--mme-ink2); min-width: 42px; text-align: center; }

.mme-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 12px; }
.mme-field { display: flex; flex-direction: column; gap: 4px; flex: 1 1 160px; min-width: 0; }
.mme-field span { font-size: 12.5px; font-weight: 600; color: var(--mme-ink2); }
.mme-field output { color: var(--mme-accent); font-weight: 700; margin-left: 4px; }
.mme-field input[type=range] { width: 100%; min-height: 44px; accent-color: var(--mme-accent); margin: 0; }
.mme-acts { gap: 8px; }
.mme-btn { min-height: 44px; font-size: 13px; font-weight: 600; padding: 8px 16px; border-radius: 999px; cursor: pointer;
           border: 1px solid var(--mme-line); background: #fff; color: var(--mme-ink2); transition: all .15s; }
.mme-btn:hover { background: var(--mme-ice); }
.mme-btn.solid { background: var(--mme-ink); color: #fff; border-color: var(--mme-ink); }
.mme-btn.solid:hover { background: #000; }
.mme-btn:disabled { opacity: .45; cursor: not-allowed; }
.mme-btn[hidden] { display: none; }
.mme-hold { -webkit-touch-callout: none; user-select: none; touch-action: none; }

.mme-repair { margin-top: 4px; }
.mme-repair[hidden] { display: none; }
.mme-paint { margin-top: 4px; }
.mme-paint[hidden] { display: none; }
.mme-chip { display: inline-block; width: 24px; height: 24px; border-radius: 7px; border: 1px solid var(--mme-line);
            box-shadow: inset 0 0 0 2px #fff; vertical-align: middle; }
.mme-painthex { font-size: 11.5px; font-weight: 700; color: var(--mme-ink2); font-variant-numeric: tabular-nums; }
.mme-note { font-size: 12px; color: var(--mme-ink3); line-height: 1.8; margin: 8px 2px 0; }
.mme-note a { color: var(--mme-accent); font-weight: 700; }
.mme-note[hidden] { display: none; }
.mme-card { margin-top: 10px; padding: 12px 14px; border-radius: 14px; border: 1.5px dashed var(--mme-sel); background: rgba(201,190,220,.12); }
.mme-card[hidden] { display: none; }
.mme-card p { font-size: 12px; line-height: 1.8; color: var(--mme-ink2); margin: 0; }
.mme-model-warn { color: #c0453f !important; margin-top: 6px !important; }
.mme-model-warn[hidden] { display: none; }
.mme-progress { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.mme-progress[hidden] { display: none; }
.mme-bar { flex: 1; height: 6px; border-radius: 999px; background: #fff; overflow: hidden; border: 1px solid var(--mme-line); }
.mme-bar i { display: block; height: 100%; width: 0; background: var(--mme-ink); transition: width .2s; }
.mme-progress output { font-size: 11.5px; font-weight: 700; color: var(--mme-ink2); min-width: 36px; }
.mme-notices { display: inline-block; margin-top: 8px; font-size: 10.5px; color: var(--mme-ink3); }
.mme-status { font-size: 12px; color: var(--mme-ink3); margin: 10px 2px 0; min-height: 1.6em; line-height: 1.7; }
.mme-status.err { color: #c0453f; }

@media (max-width: 899px) {
  .mme-view { height: min(62vh, 480px); }
}
/* 窄屏：胶囊排 max-content 会把 shrink-to-fit 的宿主列顶宽，强制 100% 让胶囊换行 */
@media (max-width: 520px) {
  .mme-pens { width: 100%; }
}
@media (max-width: 420px) {
  .mme-pen { padding: 7px 12px; font-size: 12.5px; }
  .mme-btn { padding: 8px 13px; }
  .mme-loupe { width: 112px; height: 112px; }
}
