/* 拼图工坊 · 切图工具 */
.hidden { display: none !important; }

.cut-body .size-label { font-variant-numeric: tabular-nums; }
.cut-name { font-size: 13.5px; font-weight: 600; color: var(--ink-2); max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 左侧 */
.cut-ratios { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.cut-ratio {
  border: 1px solid var(--line); background: #fff; border-radius: 9px;
  padding: 9px 0; font-size: 12.5px; color: var(--ink-2); transition: all .14s ease;
}
.cut-ratio:hover { border-color: #ffc9bd; }
.cut-ratio.on { border-color: var(--brand); color: var(--brand); font-weight: 700; background: #fff5f2; }

.cut-quick { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.cut-mini {
  border: 1px solid var(--line); background: #fff; border-radius: 10px;
  padding: 10px 8px; font-size: 12.5px; color: var(--ink-2); transition: all .14s ease;
}
.cut-mini:hover { border-color: #d8dbe8; background: #fafbff; }

.cut-rot-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }

.cut-range { width: 100%; margin: 2px 0 4px; accent-color: var(--brand); }
.rail-sub b { color: var(--ink); font-variant-numeric: tabular-nums; }

/* 舞台 */
.cut-stage-empty {
  position: absolute; inset: 0; margin: auto; width: min(520px, 78%); height: fit-content;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  padding: 40px 24px; border: 2px dashed #d9dce8; border-radius: 24px;
  background: rgba(255, 255, 255, .9); text-align: center; color: var(--ink-2);
}
.cut-stage-empty svg { color: var(--brand); }
.cut-stage-empty strong { font-size: 16px; margin-top: 6px; }
.cut-stage-empty span { font-size: 12.5px; color: var(--muted); }

.cut-sheet { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 40px 30px 70px; }
.cut-frame { position: relative; line-height: 0; box-shadow: 0 18px 50px rgba(20, 22, 28, .18); border-radius: 2px; overflow: hidden; }
.cut-frame canvas { display: block; border-radius: 2px; }

.cut-crop { position: absolute; cursor: move; box-shadow: 0 0 0 9999px rgba(12, 14, 20, .45); outline: 1.5px solid #fff; outline-offset: -1.5px; }
.cut-grid {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(255,255,255,.55) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,.55) 1px, transparent 1px);
  background-size: 33.333% 33.333%;
  background-position: 0 0;
  opacity: .9;
}
.cut-crop .hd {
  position: absolute; width: 11px; height: 11px; background: #fff; border-radius: 3px;
  box-shadow: 0 1px 3px rgba(0,0,0,.35); z-index: 3;
}
.hd-nw { left: -6px; top: -6px; cursor: nwse-resize; }
.hd-n  { left: 50%; top: -6px; margin-left: -5.5px; cursor: ns-resize; }
.hd-ne { right: -6px; top: -6px; cursor: nesw-resize; }
.hd-e  { right: -6px; top: 50%; margin-top: -5.5px; cursor: ew-resize; }
.hd-se { right: -6px; bottom: -6px; cursor: nwse-resize; }
.hd-s  { left: 50%; bottom: -6px; margin-left: -5.5px; cursor: ns-resize; }
.hd-sw { left: -6px; bottom: -6px; cursor: nesw-resize; }
.hd-w  { left: -6px; top: 50%; margin-top: -5.5px; cursor: ew-resize; }

.cut-size {
  position: absolute; left: 50%; bottom: -30px; transform: translateX(-50%);
  background: rgba(20, 22, 28, .76); color: #fff; font-size: 11.5px; line-height: 1;
  padding: 6px 10px; border-radius: 999px; white-space: nowrap; pointer-events: none;
}

/* 右侧 */
.cut-form { padding: 12px 14px 16px; }
.cut-field { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 12.5px; color: var(--muted); }
.cut-field span { width: 22px; }
.cut-field input {
  flex: 1; height: 34px; border: 1px solid var(--line); border-radius: 9px;
  padding: 0 10px; font-size: 13px; background: #fff; font-variant-numeric: tabular-nums;
}
.cut-field input:focus { outline: none; border-color: #ffc6b8; box-shadow: 0 0 0 3px rgba(255,90,54,.1); }
.cut-field em { font-style: normal; font-size: 11.5px; color: var(--muted); }
.cut-lock { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--ink-2); }
.cut-lock input { accent-color: var(--brand); }

.cut-bgs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; padding: 12px 14px 6px; }
.cut-bg {
  border: 1px solid var(--line); background: #fff; border-radius: 9px; padding: 9px 0;
  font-size: 12px; color: var(--ink-2);
}
.cut-bg.on { border-color: var(--brand); color: var(--brand); font-weight: 700; background: #fff5f2; }
.cut-bg[data-bg="transparent"] { background-image: linear-gradient(45deg, #e3e6ee 25%, transparent 25%), linear-gradient(-45deg, #e3e6ee 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #e3e6ee 75%), linear-gradient(-45deg, transparent 75%, #e3e6ee 75%); background-size: 10px 10px; background-position: 0 0, 0 5px, 5px -5px, -5px 0; }
.cut-color { grid-column: span 3; height: 32px; padding: 2px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.cut-tip { margin: 4px 14px 14px; font-size: 11.5px; color: var(--muted); }

/* 右栏：内容靠上，下一步固定在底部 */
.cut-body .ed-right .right-block { flex: 0 0 auto; }
.cut-body .ed-right .right-block + .right-block { border-top: 1px solid var(--line); }
.cut-body .ed-right .right-block:last-child { margin-top: auto; border-top: 1px solid var(--line); padding: 12px 14px 16px; }
.cut-act {
  width: 100%; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: #fff;
  font-size: 13.5px; font-weight: 700; color: var(--ink-2); transition: all .15s ease;
}
.cut-act:hover { background: #fafbff; border-color: #d8dbe8; }
.cut-act.primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; border-color: transparent;
  box-shadow: 0 6px 16px rgba(255, 72, 60, .22); margin-bottom: 10px;
}

@media (max-width: 1080px) {
  .ed-right { display: none; }
}

/* 移动端：左栏改为可横滑的工具条，舞台占满宽度 */
.cut-body .zoom-btn.wide { white-space: nowrap; }
@media (max-width: 760px) {
  .cut-body .ed-top { height: auto; padding: 8px 10px; flex-wrap: wrap; gap: 8px; }
  .cut-body .ed-top-center { order: 3; width: 100%; justify-content: flex-start; }
  .cut-body .ed-main { flex-direction: column; height: auto; min-height: calc(100vh - 110px); }
  .cut-body .ed-left {
    width: 100%; flex: 0 0 auto; border-right: 0; border-bottom: 1px solid var(--line); max-height: none;
  }
  /* cut-mobile-rail */
  .cut-body .rail-body {
    display: flex; gap: 14px; overflow-x: auto; padding: 10px 12px 14px;
    scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
  }
  .cut-body .rail-panel { flex: 0 0 246px; scroll-snap-align: start; padding: 0; }
  .cut-body .rail-title { margin-bottom: 8px; }
  .cut-body .ed-stage { flex: 1 1 auto; min-height: 58vh; }
  .cut-body .stage-toolbar { left: 50%; transform: translateX(-50%); bottom: 12px; }
  .cut-body .cut-sheet { padding: 22px 16px 64px; }
  .cut-body .cut-stage-empty { width: min(340px, 86%); padding: 26px 16px; }
}
