/* 图片裁剪 · 工具控件样式（源自 original/index.html，保持功能外观不变） */
.fmt-btn, .ratio-btn { padding: 6px 12px; font-size: 13px; border-radius: 8px; font-weight: 500; cursor: pointer; border: 1px solid #374151; background: #1a1d24; color: #9ca3af; transition: all .15s; }
.fmt-btn.active, .ratio-btn.active { background: #2563eb; color: #fff; border-color: #2563eb; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.fmt-btn:hover:not(.active), .ratio-btn:hover:not(.active) { border-color: #3b82f6; color: #60a5fa; }
.dim-input { width: 100%; background: #111827; border: 1px solid #374151; border-radius: 8px; color: #e5e7eb; padding: 6px 10px; font-size: 13px; }
.dim-input:focus { outline: none; border-color: #3b82f6; }
.btn-sm { padding: 7px 14px; border-radius: 9px; font-size: 12px; font-weight: 600; cursor: pointer; border: 1px solid #374151; background: #1a1d24; color: #d1d5db; transition: all .15s; }
.btn-sm:hover { border-color: #4b5563; }
.btn-sm.primary { background: #2563eb; border-color: #2563eb; color: #fff; }
.btn-sm.primary:hover { background: #1d4ed8; }
.btn-sm.danger { color: #f87171; }

.crop-stage { position: relative; background: #0b0d12; border-radius: 12px; overflow: hidden; user-select: none; touch-action: none; }
.crop-stage img { display: block; width: 100%; height: auto; pointer-events: none; }
.crop-shade { position: absolute; background: rgba(0,0,0,.55); pointer-events: none; }
.crop-box { position: absolute; border: 1.5px solid #3b82f6; box-shadow: 0 0 0 9999px rgba(0,0,0,.55); cursor: move; box-sizing: border-box; }
.crop-box .grid-line { position: absolute; background: rgba(255,255,255,.25); pointer-events: none; }
.handle { position: absolute; width: 12px; height: 12px; background: #fff; border: 1.5px solid #3b82f6; border-radius: 3px; z-index: 5; }
.handle.nw { left: -6px; top: -6px; cursor: nwse-resize; }
.handle.n  { left: 50%; top: -6px; margin-left: -6px; cursor: ns-resize; }
.handle.ne { right: -6px; top: -6px; cursor: nesw-resize; }
.handle.e  { right: -6px; top: 50%; margin-top: -6px; cursor: ew-resize; }
.handle.se { right: -6px; bottom: -6px; cursor: nwse-resize; }
.handle.s  { left: 50%; bottom: -6px; margin-left: -6px; cursor: ns-resize; }
.handle.sw { left: -6px; bottom: -6px; cursor: nesw-resize; }
.handle.w  { left: -6px; top: 50%; margin-top: -6px; cursor: ew-resize; }
.crop-stage.drawing { cursor: crosshair; }

.xy-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.xy-cell label { display: block; font-size: 11px; color: #9ca3af; margin-bottom: 4px; }

.preview-card { background: #111827; border: 1px solid #374151; border-radius: 12px; overflow: hidden; }
.preview-card .hd { padding: 8px 12px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #9ca3af; border-bottom: 1px solid #1f2937; }
.preview-card .hd.out { color: #3b82f6; }
.preview-card .img-box { height: 200px; display: flex; align-items: center; justify-content: center; background: #0b0d12; cursor: zoom-in; }
.preview-card img { max-width: 100%; max-height: 100%; object-fit: contain; }
.preview-card .ft { padding: 8px 12px; font-size: 12px; color: #9ca3af; display: flex; justify-content: space-between; gap: 8px; }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.pill.blue { background: rgba(59,130,246,.12); color: #60a5fa; border: 1px solid rgba(59,130,246,.25); }

.lb-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.88); z-index: 100; display: none; align-items: center; justify-content: center; flex-direction: column; gap: 12px; }
.lb-overlay.visible { display: flex; }
.lb-overlay img { max-width: 88vw; max-height: 76vh; border-radius: 10px; box-shadow: 0 10px 40px rgba(0,0,0,.6); }
.lb-close { position: absolute; top: 18px; right: 22px; width: 38px; height: 38px; border-radius: 999px; border: 1px solid #4b5563; background: #111827; color: #e5e7eb; font-size: 18px; cursor: pointer; }
.lb-label { color: #d1d5db; font-size: 13px; }
.lb-nav { display: flex; gap: 10px; }
.lb-nav button { padding: 6px 14px; border-radius: 8px; border: 1px solid #4b5563; background: #111827; color: #e5e7eb; cursor: pointer; }

@media (max-width: 640px) { .xy-grid { grid-template-columns: repeat(2, 1fr); } }
