@charset "UTF-8";
body.crop-page {
  font-family: "Microsoft YaHei", "微软雅黑", "PingFang SC", system-ui, -apple-system, sans-serif;
  font-size: 15px;
  background: #F7F4EE;
  color: #1F1E1B;
  -webkit-font-smoothing: antialiased;
  --canvas: #F7F4EE;
  --canvas-rgb: 247, 244, 238;
  --canvas-soft: #F4F2EC;
  --canvas-soft-rgb: 244, 242, 236;
  --surface-card: #FFFFFF;
  --surface-card-rgb: 255, 255, 255;
  --surface-strong: #EDEBE3;
  --ink: #1F1E1B;
  --ink-rgb: 31, 30, 27;
  --body: #3A3833;
  --muted: #6E6B5F;
  --muted-soft: #9C9889;
  --hairline: #E0DDD1;
  --hairline-soft: #EDEBE3;
  --hairline-strong: #C9C5B6;
  --primary: #0F0F0D;
  --primary-rgb: 15, 15, 13;
  --primary-active: #1F1E1B;
  --on-primary: #F7F4EE;
  --gradient-peach-rgb: 168, 141, 96;
  --gradient-sky-rgb: 168, 141, 96;
  --gradient-mint-rgb: 168, 141, 96;
  --gradient-lavender-rgb: 168, 141, 96;
}
body.crop-page::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.035;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.5 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  mix-blend-mode: multiply;
}
body.crop-page ::selection {
  background: rgba(168, 141, 96, 0.2);
  color: #1F1E1B;
}
body.crop-page .btn {
  border-radius: 12px;
  letter-spacing: 0.04em;
}
body.crop-page .btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--on-primary);
}
body.crop-page .btn-primary:hover:not(:disabled) {
  background: #1F1E1B;
  border-color: #1F1E1B;
  color: var(--on-primary);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px -8px rgba(31, 30, 27, 0.28);
}
body.crop-page .btn-primary:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: inset 0 1px 2px rgba(31, 30, 27, 0.2);
}
body.crop-page .btn-accent {
  background: #1F1E1B;
  border-color: #1F1E1B;
  color: var(--on-primary);
  box-shadow: 0 2px 8px rgba(31, 30, 27, 0.12);
}
body.crop-page .btn-accent:hover:not(:disabled) {
  background: #8A7048;
  border-color: #8A7048;
  transform: translateY(-1px);
  box-shadow: 0 8px 22px -8px rgba(168, 141, 96, 0.35);
}
body.crop-page .btn-accent:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: inset 0 1px 2px rgba(31, 30, 27, 0.18);
}
body.crop-page {
  --crop-toolbar-offset: 52px;
}
body.crop-page .crop-app {
  --crop-toolbar-offset: 52px;
}
body.crop-page .crop-toolbar {
  background: rgba(250, 248, 243, 0.9);
  border-bottom: 1px solid rgba(201, 197, 182, 0.2);
  backdrop-filter: blur(16px) saturate(1.05);
  -webkit-backdrop-filter: blur(16px) saturate(1.05);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
}
body.crop-page .crop-toolbar__inner {
  gap: 8px;
  height: 52px;
  padding: 0 16px;
}
body.crop-page .crop-toolbar__zone {
  gap: 6px;
}
body.crop-page .crop-toolbar__divider {
  width: 1px;
  height: 18px;
  margin: 0 2px;
  background: rgba(201, 197, 182, 0.45);
  flex-shrink: 0;
}
body.crop-page .crop-toolbar__cluster {
  gap: 1px;
  padding: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(201, 197, 182, 0.24);
  box-shadow: none;
}
body.crop-page .crop-toolbar__cluster--tight {
  gap: 0;
}
body.crop-page .crop-toolbar__cluster--history, body.crop-page .crop-toolbar__cluster--actions {
  background: transparent;
  border: none;
  padding: 0;
  gap: 4px;
}
body.crop-page .crop-toolbar__segment {
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(201, 197, 182, 0.24);
  box-shadow: none;
}
body.crop-page .crop-toolbar__back {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: #6E6B5F;
  box-shadow: none;
}
body.crop-page .crop-toolbar__back:hover {
  color: #1F1E1B;
  background: rgba(255, 255, 255, 0.75);
  border: none;
  box-shadow: none;
  transform: none;
}
body.crop-page .crop-toolbar__back:hover svg {
  transform: none;
}
body.crop-page .crop-toolbar__back:active {
  background: rgba(255, 255, 255, 0.55);
  box-shadow: none;
}
body.crop-page .crop-toolbar__upload {
  padding: 7px 16px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  border-radius: 999px;
  border: 1px solid #0F0F0D;
  background: #0F0F0D;
  color: #F7F4EE;
  box-shadow: none;
}
body.crop-page .crop-toolbar__upload:hover:not(:disabled) {
  transform: none;
  filter: none;
  background: transparent;
  color: #0F0F0D;
  box-shadow: none;
}
body.crop-page .crop-toolbar__upload:active:not(:disabled) {
  filter: none;
  box-shadow: none;
}
body.crop-page .crop-toolbar__segment .btn-mode {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  border-radius: 999px;
  border: none;
  color: #6E6B5F;
}
body.crop-page .crop-toolbar__segment .btn-mode svg {
  opacity: 0.75;
}
body.crop-page .crop-toolbar__segment .btn-mode:hover:not(.active):not(:disabled) {
  color: #1F1E1B;
  background: rgba(255, 255, 255, 0.55);
  border: none;
  box-shadow: none;
}
body.crop-page .crop-toolbar__segment .btn-mode:hover:not(.active):not(:disabled) svg {
  transform: none;
  opacity: 1;
}
body.crop-page .crop-toolbar__segment .btn-mode.active {
  color: #1F1E1B;
  background: #fff;
  border: none;
  box-shadow: 0 1px 4px rgba(31, 30, 27, 0.07);
}
body.crop-page .crop-toolbar__segment .btn-mode.active svg {
  opacity: 1;
}
body.crop-page .crop-toolbar__segment .btn-mode.active::after {
  display: none;
}
body.crop-page .crop-toolbar__icon-btn {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 999px;
  color: #6E6B5F;
}
body.crop-page .crop-toolbar__icon-btn:hover:not(:disabled) {
  color: #1F1E1B;
  background: rgba(255, 255, 255, 0.75);
  border: none;
  box-shadow: none;
  transform: none;
}
body.crop-page .crop-toolbar__icon-btn:hover:not(:disabled) svg {
  transform: none;
}
body.crop-page .crop-toolbar__icon-btn:active:not(:disabled) {
  background: rgba(255, 255, 255, 0.55);
  box-shadow: none;
  transform: none;
}
body.crop-page .crop-toolbar__icon-btn.active {
  color: #8A7048;
  background: rgba(168, 141, 96, 0.12);
  border: none;
}
body.crop-page .crop-toolbar__icon-btn--label {
  width: auto;
  height: 32px;
  padding: 0 10px;
  gap: 5px;
  font-size: 12px;
  font-weight: 500;
}
body.crop-page .crop-toolbar__icon-btn--danger:hover:not(:disabled) {
  background: rgba(220, 80, 70, 0.08);
  border: none;
}
body.crop-page .crop-toolbar__ghost-btn {
  padding: 6px 11px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 999px;
  border: none;
  color: #6E6B5F;
}
body.crop-page .crop-toolbar__ghost-btn:hover:not(:disabled) {
  color: #1F1E1B;
  background: rgba(255, 255, 255, 0.75);
  border: none;
  box-shadow: none;
}
body.crop-page .crop-toolbar__ghost-btn:hover:not(:disabled) svg {
  transform: none;
}
body.crop-page .crop-toolbar__ghost-btn:active:not(:disabled) {
  background: rgba(255, 255, 255, 0.55);
  box-shadow: none;
}
body.crop-page .crop-toolbar__action-btn {
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.03em;
  border-radius: 999px;
  box-shadow: none;
}
body.crop-page .crop-toolbar__action-btn:hover:not(:disabled) {
  transform: none;
  filter: none;
}
body.crop-page .crop-toolbar .select-rotation-control {
  padding: 4px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(201, 197, 182, 0.24);
}
body.crop-page .crop-toolbar__zone--tools {
  border: none;
  background: transparent;
  box-shadow: none;
  padding: 0;
}
body.crop-page .crop-stage .canvas-area {
  background-color: #F4F2EC;
  background-image: radial-gradient(ellipse 80% 60% at 70% 0%, rgba(168, 141, 96, 0.1) 0%, transparent 55%), radial-gradient(ellipse 90% 70% at 50% 42%, rgba(255, 255, 255, 0.55) 0%, transparent 68%), radial-gradient(circle at center, rgba(31, 30, 27, 0.04) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 24px 24px;
}
body.crop-page .crop-stage #main-canvas {
  border-radius: 16px;
  border-color: rgba(201, 197, 182, 0.45);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.5), 0 8px 24px -12px rgba(31, 30, 27, 0.14);
}
body.crop-page .crop-stage .drop-overlay {
  border-radius: 20px;
}
body.crop-page .crop-stage .drop-overlay .drop-message {
  border-radius: 16px;
}
body.crop-page .crop-stage .empty-state.crop-empty {
  max-width: 340px;
}
body.crop-page .crop-stage .empty-state.crop-empty .crop-empty__dropzone {
  border-radius: 16px;
  border-color: rgba(201, 197, 182, 0.45);
  background: rgba(255, 255, 255, 0.78);
}
body.crop-page .crop-stage .empty-state.crop-empty .crop-empty__dropzone:hover {
  border-color: rgba(168, 141, 96, 0.35);
}
body.crop-page .crop-stage .empty-state.crop-empty .crop-empty__icon {
  color: #8A7048;
  background: rgba(168, 141, 96, 0.08);
}
body.crop-page .crop-stage .empty-state.crop-empty .crop-empty__title {
  font-family: "Microsoft YaHei", "微软雅黑", "PingFang SC", system-ui, -apple-system, sans-serif;
  color: #1F1E1B;
}
body.crop-page .crop-stage .empty-state.crop-empty .crop-empty__hint {
  color: #6E6B5F;
}
body.crop-page .crop-stage .empty-state.crop-empty .crop-empty__btn--primary {
  background: #0F0F0D;
  border-color: #0F0F0D;
  color: #F7F4EE;
}
body.crop-page .crop-stage .empty-state.crop-empty .crop-empty__btn--primary:hover {
  background: transparent;
  color: #0F0F0D;
}
body.crop-page .crop-stage .empty-state.crop-empty .crop-empty__btn--secondary {
  border-color: rgba(201, 197, 182, 0.55);
  color: #1F1E1B;
}
body.crop-page .crop-stage .empty-state.crop-empty .crop-empty__btn--secondary:hover {
  border-color: rgba(168, 141, 96, 0.4);
  background: rgba(255, 255, 255, 0.9);
}
body.crop-page .crop-stage .canvas-area.dragover .crop-empty__dropzone {
  border-color: rgba(168, 141, 96, 0.5);
  background: rgba(168, 141, 96, 0.04);
  box-shadow: 0 0 0 3px rgba(168, 141, 96, 0.1), 0 24px 56px -32px rgba(168, 141, 96, 0.15);
}
body.crop-page .crop-side-handle {
  border-radius: 0 12px 12px 0;
  background: color-mix(in srgb, var(--surface-card) 94%, transparent);
}
body.crop-page .crop-side-handle--right {
  border-radius: 12px 0 0 12px;
}
body.crop-page .crop-side-handle:hover::before, body.crop-page .crop-side-handle.is-active::before {
  background: #A88D60;
}
body.crop-page .crop-side-handle.is-active {
  color: #8A7048;
  border-color: rgba(168, 141, 96, 0.28);
}
body.crop-page .mode-panel-backdrop,
body.crop-page .layers-panel-backdrop {
  background: rgba(31, 30, 27, 0.12);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
body.crop-page .mode-panel,
body.crop-page .layers-panel {
  border-radius: 16px;
  border: 1px solid rgba(201, 197, 182, 0.22);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px) saturate(1.05);
  -webkit-backdrop-filter: blur(16px) saturate(1.05);
  box-shadow: 0 24px 64px -32px rgba(31, 30, 27, 0.14);
}
body.crop-page .mode-panel::before,
body.crop-page .layers-panel::before {
  display: none;
}
body.crop-page .mode-panel__head,
body.crop-page .layers-panel__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 14px 12px;
  border-bottom: 1px solid rgba(201, 197, 182, 0.2);
  background: transparent;
}
body.crop-page .layers-panel__head-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}
body.crop-page .mode-panel__eyebrow,
body.crop-page .layers-panel__eyebrow {
  margin: 0;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #8A7048;
}
body.crop-page .mode-panel__eyebrow::before,
body.crop-page .layers-panel__eyebrow::before {
  display: none;
}
body.crop-page .mode-panel__title,
body.crop-page .layers-panel__title {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: #1F1E1B;
  line-height: 1.25;
}
body.crop-page .mode-panel__sub,
body.crop-page .layers-panel__sub {
  margin: 0;
  font-size: 11px;
  line-height: 1.5;
  color: #6E6B5F;
}
body.crop-page .mode-panel__close,
body.crop-page .layers-panel__close {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: #6E6B5F;
  box-shadow: none;
}
body.crop-page .mode-panel__close:hover,
body.crop-page .layers-panel__close:hover {
  background: rgba(255, 255, 255, 0.8);
  border: none;
  color: #1F1E1B;
  transform: none;
}
body.crop-page .mode-panel__scroll,
body.crop-page .layers-panel__scroll {
  padding: 10px 12px 14px;
  scrollbar-color: rgba(201, 197, 182, 0.5) transparent;
}
body.crop-page .mode-panel__scroll::-webkit-scrollbar-thumb,
body.crop-page .layers-panel__scroll::-webkit-scrollbar-thumb {
  background: rgba(201, 197, 182, 0.45);
}
body.crop-page .mode-panel__scroll::-webkit-scrollbar-thumb:hover,
body.crop-page .layers-panel__scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(168, 141, 96, 0.4);
}
body.crop-page .mode-panel__section,
body.crop-page .layers-panel__section {
  margin-bottom: 18px;
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
}
body.crop-page .mode-panel__section:last-child,
body.crop-page .layers-panel__section:last-child {
  margin-bottom: 0;
}
body.crop-page .mode-panel__section + body.crop-page .mode-panel__section,
body.crop-page .mode-panel__section + body.crop-page .layers-panel__section,
body.crop-page .layers-panel__section + body.crop-page .mode-panel__section,
body.crop-page .layers-panel__section + body.crop-page .layers-panel__section {
  padding-top: 16px;
  border-top: 1px solid rgba(201, 197, 182, 0.18);
}
body.crop-page .mode-panel__group,
body.crop-page .layers-panel__group {
  margin: 0 0 8px;
  padding: 0;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: none;
  color: #6E6B5F;
}
body.crop-page .mode-panel__group::before,
body.crop-page .layers-panel__group::before {
  display: none;
}
body.crop-page .mode-panel__grid {
  gap: 5px;
}
body.crop-page .shape-item,
body.crop-page .tpl-item,
body.crop-page .rect-aspect-mode,
body.crop-page .rect-ratio-btn {
  border-radius: 8px;
  border: 1px solid rgba(201, 197, 182, 0.28);
  background: rgba(255, 255, 255, 0.85);
  box-shadow: none;
  transition: background 0.2s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s cubic-bezier(0.16, 1, 0.3, 1), color 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
body.crop-page .shape-item span,
body.crop-page .tpl-item span,
body.crop-page .rect-aspect-mode span,
body.crop-page .rect-ratio-btn span {
  font-size: 11px;
  letter-spacing: 0.01em;
}
body.crop-page .shape-item:hover,
body.crop-page .tpl-item:hover,
body.crop-page .rect-aspect-mode:hover,
body.crop-page .rect-ratio-btn:hover {
  background: #fff;
  border-color: rgba(168, 141, 96, 0.32);
  box-shadow: none;
  transform: none;
}
body.crop-page .shape-item:hover svg,
body.crop-page .tpl-item:hover svg,
body.crop-page .rect-aspect-mode:hover svg,
body.crop-page .rect-ratio-btn:hover svg {
  color: #8A7048;
}
body.crop-page .shape-item:hover span,
body.crop-page .tpl-item:hover span,
body.crop-page .rect-aspect-mode:hover span,
body.crop-page .rect-ratio-btn:hover span {
  color: #1F1E1B;
}
body.crop-page .shape-item.active,
body.crop-page .tpl-item.active,
body.crop-page .rect-aspect-mode.active,
body.crop-page .rect-ratio-btn.active {
  background: rgba(168, 141, 96, 0.1);
  border-color: rgba(168, 141, 96, 0.35);
  box-shadow: none;
}
body.crop-page .shape-item.active svg,
body.crop-page .shape-item.active span,
body.crop-page .tpl-item.active svg,
body.crop-page .tpl-item.active span,
body.crop-page .rect-aspect-mode.active svg,
body.crop-page .rect-aspect-mode.active span,
body.crop-page .rect-ratio-btn.active svg,
body.crop-page .rect-ratio-btn.active span {
  color: #8A7048;
}
body.crop-page .shape-item.active span,
body.crop-page .tpl-item.active span,
body.crop-page .rect-aspect-mode.active span,
body.crop-page .rect-ratio-btn.active span {
  font-weight: 500;
}
body.crop-page .tpl-item--accent {
  background: rgba(168, 141, 96, 0.06);
  border-color: rgba(168, 141, 96, 0.22);
}
body.crop-page .tpl-item--accent svg,
body.crop-page .tpl-item--accent span {
  color: #8A7048;
}
body.crop-page .tpl-item--danger {
  border-color: rgba(224, 86, 86, 0.2);
}
body.crop-page .tpl-item--danger:hover {
  background: rgba(224, 86, 86, 0.05);
  border-color: rgba(224, 86, 86, 0.32);
}
body.crop-page .layers-panel__list {
  border: none;
  background: transparent;
  padding: 0;
  gap: 3px;
  box-shadow: none;
}
body.crop-page .layers-panel__info {
  border-radius: 8px;
  border: 1px solid rgba(201, 197, 182, 0.22);
  background: rgba(255, 255, 255, 0.6);
  padding: 4px 10px 6px;
  box-shadow: none;
}
body.crop-page .layers-panel .image-info-body .info-row {
  padding: 8px 0;
  border-bottom-color: rgba(201, 197, 182, 0.2);
}
body.crop-page .layers-panel .image-info-body .info-label {
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: none;
  color: #6E6B5F;
}
body.crop-page .layers-panel .image-info-body .info-value {
  font-size: 12px;
  font-weight: 500;
  color: #1F1E1B;
}
body.crop-page .layers-panel .line-item,
body.crop-page .layers-panel .select-item {
  border-radius: 8px;
  padding: 7px 8px;
  border: 1px solid transparent;
  background: transparent;
  transition: background 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
body.crop-page .layers-panel .line-item:hover,
body.crop-page .layers-panel .select-item:hover {
  background: rgba(255, 255, 255, 0.85);
  border-color: rgba(201, 197, 182, 0.22);
  box-shadow: none;
}
body.crop-page .layers-panel .line-item.line-item--focused, body.crop-page .layers-panel .line-item.line-item--selected, body.crop-page .layers-panel .line-item.select-item--focused, body.crop-page .layers-panel .line-item.select-item--selected,
body.crop-page .layers-panel .select-item.line-item--focused,
body.crop-page .layers-panel .select-item.line-item--selected,
body.crop-page .layers-panel .select-item.select-item--focused,
body.crop-page .layers-panel .select-item.select-item--selected {
  background: rgba(168, 141, 96, 0.08);
  border-color: rgba(168, 141, 96, 0.25);
}
body.crop-page .layers-panel .line-item__icon {
  border-radius: 6px;
  background: rgba(168, 141, 96, 0.08);
  border: none;
  color: #8A7048;
}
body.crop-page .layers-panel .line-item--curve .line-item__icon {
  background: rgba(66, 98, 255, 0.08);
  color: #4262ff;
}
body.crop-page .layers-panel .empty-hint,
body.crop-page .mode-panel .empty-hint {
  padding: 16px 8px;
  font-size: 11px;
  color: #6E6B5F;
  background: transparent;
}
body.crop-page .layers-panel .empty-hint::before,
body.crop-page .mode-panel .empty-hint::before {
  display: none;
}
body.crop-page .multi-bar {
  margin-bottom: 6px;
  padding: 4px 6px 4px 10px;
  border-radius: 999px;
  background: rgba(168, 141, 96, 0.06);
  border: 1px solid rgba(168, 141, 96, 0.14);
  box-shadow: none;
}
body.crop-page .multi-bar__count {
  font-size: 10px;
  font-weight: 500;
  color: #8A7048;
}
body.crop-page .multi-bar__btn {
  border-radius: 999px;
  font-size: 10px;
  padding: 3px 9px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(201, 197, 182, 0.35);
}
body.crop-page .multi-bar__btn:hover {
  border-color: rgba(168, 141, 96, 0.35);
  color: #8A7048;
}
body.crop-page .multi-bar__btn--danger:hover {
  background: rgba(224, 86, 86, 0.06);
  border-color: rgba(224, 86, 86, 0.35);
  color: #c94a4a;
}
body.crop-page .crop-zoom-float {
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-card) 94%, transparent);
}
body.crop-page .crop-footer {
  background: rgba(255, 255, 255, 0.88);
  border-top-color: rgba(201, 197, 182, 0.45);
  backdrop-filter: blur(8px);
}
@media (max-width: 767px) {
  body.crop-page .crop-footer .footer-status-item {
    border-radius: 8px;
  }
}
body.crop-page .settings-modal__card {
  border-radius: 16px;
}
body.crop-page .settings-modal__tab.is-active {
  border-bottom-color: #8A7048;
}
body.crop-page .settings-modal .drawer-card,
body.crop-page .settings-modal .adv-card {
  border-radius: 12px;
}
body.crop-page .settings-modal .setting-input,
body.crop-page .settings-modal .setting-select-wrapper select,
body.crop-page .settings-modal .form-cell select {
  border-radius: 8px;
}
body.crop-page #crop-panel-overlay,
body.crop-page #batch-layout-modal-overlay,
body.crop-page #shortcuts-overlay {
  background: rgba(31, 30, 27, 0.32);
}
body.crop-page #crop-panel-overlay .crop-panel,
body.crop-page #shortcuts-overlay .shortcuts-modal,
body.crop-page #batch-layout-modal-overlay .batch-layout-modal {
  border-radius: 16px;
  border-color: rgba(201, 197, 182, 0.45);
}
body.crop-page #crop-panel-overlay .crop-panel-item {
  border-radius: 12px;
}
body.crop-page #batch-layout-modal-overlay .batch-layout-block,
body.crop-page #batch-layout-modal-overlay .batch-layout-modal-hint {
  border-radius: 12px;
}
body.crop-page #batch-layout-modal-overlay .batch-layout-btn {
  border-radius: 8px;
}
body.crop-page .crop-app {
  font-family: "Microsoft YaHei", "微软雅黑", "PingFang SC", system-ui, -apple-system, sans-serif;
}
body.crop-page .crop-region-count,
body.crop-page #btn-show-results .crop-result-badge {
  background: #1F1E1B;
}
body.crop-page .line-name-input {
  border-radius: 8px;
}

.crop-app {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  height: 100%;
  position: relative;
  --crop-toolbar-offset: 56px;
}

.crop-toolbar {
  flex-shrink: 0;
  z-index: 40;
  width: 100%;
  background: var(--surface-card);
  border-bottom: 1px solid var(--hairline-soft);
  box-shadow: 0 1px 0 rgba(var(--surface-card-rgb), 0.8);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--hairline) transparent;
  position: relative;
}
.crop-toolbar::-webkit-scrollbar {
  height: 4px;
}
.crop-toolbar::-webkit-scrollbar-thumb {
  background: var(--hairline);
  border-radius: 99px;
}
.crop-toolbar.is-overflowing {
  box-shadow: 0 1px 0 rgba(var(--surface-card-rgb), 0.8), inset -20px 0 12px -12px rgba(var(--ink-rgb), 0.06);
}

.crop-toolbar__inner {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  width: max-content;
  min-width: 100%;
  height: 56px;
  padding: 0 18px;
  box-sizing: border-box;
}

.crop-toolbar__zone {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}
.crop-toolbar__zone[data-zone=workflow] {
  margin-left: auto;
}
.crop-toolbar__zone--tools {
  flex: 0 0 auto;
  padding: 4px 8px 4px 6px;
  border-radius: 12px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--canvas-soft) 60%, transparent) 0%, color-mix(in srgb, var(--surface-card) 30%, transparent) 100%);
  border: 1px solid var(--hairline-soft);
  box-shadow: inset 0 1px 0 rgba(var(--surface-card-rgb), 0.45), 0 1px 2px rgba(var(--ink-rgb), 0.02);
}

.crop-toolbar__zone-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-soft);
  line-height: 1;
  flex-shrink: 0;
}
.crop-toolbar__zone-label--inline {
  padding: 0 2px;
}

.crop-toolbar__sep {
  width: 1px;
  height: 24px;
  background: linear-gradient(180deg, transparent 0%, var(--hairline) 50%, transparent 100%);
  flex-shrink: 0;
  opacity: 0.7;
}

.crop-toolbar__fill {
  display: none;
}

.crop-toolbar__cluster {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--canvas-soft) 60%, transparent) 0%, color-mix(in srgb, var(--surface-card) 30%, transparent) 100%);
  border: 1px solid var(--hairline-soft);
  box-shadow: inset 0 1px 0 rgba(var(--surface-card-rgb), 0.5), 0 1px 2px rgba(var(--ink-rgb), 0.02);
}
.crop-toolbar__cluster--tight {
  gap: 2px;
}
.crop-toolbar__cluster--actions {
  gap: 6px;
  padding: 4px;
  background: transparent;
  border: none;
  box-shadow: none;
}

.crop-toolbar__upload {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.005em;
  border-radius: 9px;
  gap: 6px;
  cursor: pointer;
  transition: transform 0.18s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.22s cubic-bezier(0.2, 0.8, 0.2, 1), filter 0.2s ease;
}
.crop-toolbar__upload:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.06);
  box-shadow: 0 1px 0 rgba(var(--surface-card-rgb), 0.5) inset, 0 8px 20px -8px rgba(var(--primary-rgb), 0.5);
}
.crop-toolbar__upload:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: inset 0 1px 2px rgba(var(--ink-rgb), 0.18), 0 0 0 transparent;
  filter: brightness(0.96);
}

.crop-toolbar__segment {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  border-radius: 12px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--canvas-soft) 60%, transparent) 0%, color-mix(in srgb, var(--surface-card) 30%, transparent) 100%);
  border: 1px solid var(--hairline-soft);
  box-shadow: inset 0 1px 0 rgba(var(--surface-card-rgb), 0.5), 0 1px 2px rgba(var(--ink-rgb), 0.02);
}
.crop-toolbar__segment .btn-mode {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  box-shadow: none;
  transform: none;
  transition: background 0.2s cubic-bezier(0.2, 0.8, 0.2, 1), color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.crop-toolbar__segment .btn-mode::before {
  display: none;
}
.crop-toolbar__segment .btn-mode svg {
  flex-shrink: 0;
  color: currentColor;
  transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.crop-toolbar__segment .btn-mode:hover:not(.active):not(:disabled) {
  color: var(--ink);
  background: var(--surface-card);
  border-color: var(--hairline-soft);
  box-shadow: 0 1px 0 rgba(var(--surface-card-rgb), 0.5) inset, 0 2px 4px -2px rgba(var(--ink-rgb), 0.06);
}
.crop-toolbar__segment .btn-mode:hover:not(.active):not(:disabled) svg {
  transform: scale(1.08);
}
.crop-toolbar__segment .btn-mode:active:not(.active):not(:disabled) {
  background: color-mix(in srgb, var(--surface-card) 92%, var(--canvas-soft));
  box-shadow: inset 0 1px 2px rgba(var(--ink-rgb), 0.06);
}
.crop-toolbar__segment .btn-mode.active {
  color: var(--ink);
  background: linear-gradient(180deg, var(--surface-card) 0%, color-mix(in srgb, var(--surface-card) 88%, var(--canvas-soft)) 100%);
  border-color: var(--hairline-soft);
  box-shadow: 0 1px 0 rgba(var(--surface-card-rgb), 0.7) inset, 0 1px 2px rgba(var(--ink-rgb), 0.08), 0 0 0 1px rgba(var(--primary-rgb), 0.18);
}
.crop-toolbar__segment .btn-mode.active svg {
  color: var(--ink);
}
.crop-toolbar__segment .btn-mode.active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -1px;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent 0%, var(--primary) 50%, transparent 100%);
  transform: translateX(-50%);
  box-shadow: 0 0 10px rgba(var(--primary-rgb), 0.55);
}
.crop-toolbar__segment .btn-mode:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.18), 0 1px 0 rgba(var(--surface-card-rgb), 0.7) inset;
}

.crop-toolbar__icon-btn {
  position: relative;
  width: 34px;
  height: 34px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.2s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.15s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.crop-toolbar__icon-btn svg {
  transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.crop-toolbar__icon-btn:hover:not(:disabled) {
  background: var(--surface-card);
  border-color: var(--hairline-soft);
  color: var(--ink);
  box-shadow: 0 1px 0 rgba(var(--surface-card-rgb), 0.6) inset, 0 2px 6px -2px rgba(var(--ink-rgb), 0.08);
}
.crop-toolbar__icon-btn:hover:not(:disabled) svg {
  transform: scale(1.08);
}
.crop-toolbar__icon-btn.active {
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 8%, var(--surface-card));
  border-color: color-mix(in srgb, var(--primary) 35%, var(--hairline-soft));
}
.crop-toolbar__icon-btn:active:not(:disabled) {
  background: color-mix(in srgb, var(--surface-card) 92%, var(--canvas-soft));
  box-shadow: inset 0 1px 2px rgba(var(--ink-rgb), 0.06);
  transform: translateY(0.5px);
}
.crop-toolbar__icon-btn:active:not(:disabled) svg {
  transform: scale(0.94);
}
.crop-toolbar__icon-btn:focus-visible {
  outline: none;
  border-color: rgba(var(--primary-rgb), 0.5);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.15);
}
.crop-toolbar__icon-btn--danger:hover:not(:disabled) {
  color: var(--semantic-error);
  background: rgba(var(--semantic-error-rgb), 0.07);
  border-color: rgba(var(--semantic-error-rgb), 0.18);
}
.crop-toolbar__icon-btn--danger:active:not(:disabled) {
  background: rgba(var(--semantic-error-rgb), 0.14);
  box-shadow: inset 0 1px 2px rgba(var(--semantic-error-rgb), 0.18);
}
.crop-toolbar__icon-btn--label {
  width: auto;
  height: 34px;
  padding: 0 12px;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
}

.crop-toolbar__ghost-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.2s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}
.crop-toolbar__ghost-btn svg {
  transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.crop-toolbar__ghost-btn:hover:not(:disabled) {
  background: var(--surface-card);
  border-color: var(--hairline-soft);
  color: var(--ink);
  box-shadow: 0 1px 0 rgba(var(--surface-card-rgb), 0.6) inset, 0 2px 6px -2px rgba(var(--ink-rgb), 0.06);
}
.crop-toolbar__ghost-btn:hover:not(:disabled) svg {
  transform: scale(1.08);
}
.crop-toolbar__ghost-btn:active:not(:disabled) {
  background: color-mix(in srgb, var(--surface-card) 92%, var(--canvas-soft));
  box-shadow: inset 0 1px 2px rgba(var(--ink-rgb), 0.06);
}
.crop-toolbar__ghost-btn:focus-visible {
  outline: none;
  border-color: rgba(var(--primary-rgb), 0.5);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.15);
}

.crop-toolbar__action-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.005em;
  border-radius: 9px;
  cursor: pointer;
  transition: transform 0.18s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.22s cubic-bezier(0.2, 0.8, 0.2, 1), filter 0.2s ease;
}
.crop-toolbar__action-btn.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.06);
  box-shadow: 0 1px 0 rgba(var(--surface-card-rgb), 0.5) inset, 0 8px 20px -8px rgba(var(--primary-rgb), 0.5);
}
.crop-toolbar__action-btn.btn-primary:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: inset 0 1px 2px rgba(var(--ink-rgb), 0.18), 0 0 0 transparent;
  filter: brightness(0.96);
}
.crop-toolbar__action-btn.btn-accent:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.06);
  box-shadow: 0 1px 0 rgba(var(--surface-card-rgb), 0.5) inset, 0 8px 22px -8px rgba(var(--ink-rgb), 0.35);
}
.crop-toolbar__action-btn.btn-accent:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: inset 0 1px 2px rgba(var(--ink-rgb), 0.18), 0 0 0 transparent;
  filter: brightness(0.94);
}

.crop-toolbar .select-rotation-control {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  width: auto;
  max-width: none;
  padding: 4px 10px;
  border-radius: 9px;
  background: var(--surface-card);
  border: 1px solid var(--hairline-soft);
  box-shadow: inset 0 1px 0 rgba(var(--surface-card-rgb), 0.5), 0 1px 2px rgba(var(--ink-rgb), 0.02);
}
.crop-toolbar .select-rotation-control .setting-label {
  display: inline;
  margin: 0;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--muted);
}
.crop-toolbar .select-rotation-control .setting-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  width: auto;
  min-width: 0;
}
.crop-toolbar .select-rotation-control .setting-slider {
  width: 88px;
  height: 4px;
  flex: 0 0 auto;
  margin: 0;
  -webkit-appearance: none;
  appearance: none;
  background: var(--hairline-strong);
  border-radius: 99px;
  outline: none;
  cursor: pointer;
}
.crop-toolbar .select-rotation-control .setting-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--ink);
  border: 2px solid var(--surface-card);
  box-shadow: 0 1px 3px rgba(var(--ink-rgb), 0.2);
  cursor: pointer;
}
.crop-toolbar .select-rotation-control .setting-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--ink);
  border: 2px solid var(--surface-card);
  box-shadow: 0 1px 3px rgba(var(--ink-rgb), 0.2);
  cursor: pointer;
}
.crop-toolbar .select-rotation-control .setting-slider:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.crop-toolbar .select-rotation-control .setting-value {
  font-size: 11px;
  font-weight: 600;
  min-width: 32px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

@media (max-width: 1200px) {
  .crop-toolbar__btn-text {
    display: none;
  }
  .crop-toolbar__segment .btn-mode span {
    display: none;
  }
  .crop-toolbar__segment .btn-mode {
    padding: 7px 10px;
  }
  .crop-toolbar__ghost-btn .crop-toolbar__btn-text,
  .crop-toolbar__ghost-btn > span {
    display: none;
  }
  .crop-toolbar__ghost-btn {
    width: 34px;
    height: 34px;
    padding: 0;
    gap: 0;
    justify-content: center;
    overflow: hidden;
  }
  .crop-toolbar__icon-btn--label {
    width: 34px;
    padding: 0;
  }
}
@media (max-width: 900px) {
  .crop-toolbar__zone-label--inline {
    display: none;
  }
}
@media (max-width: 768px) {
  .crop-app {
    --crop-toolbar-offset: 52px;
  }
  .crop-toolbar .select-rotation-control .setting-label {
    display: none;
  }
  .crop-toolbar .select-rotation-control {
    max-width: 120px;
    padding: 3px 8px;
    gap: 4px;
  }
  .crop-toolbar .select-rotation-control .setting-slider {
    width: 56px;
  }
  .crop-toolbar .select-rotation-control .setting-value {
    min-width: 26px;
    font-size: 10px;
  }
}
.crop-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.crop-main {
  flex: 1;
  min-height: 0;
  position: relative;
  display: flex;
  overflow: hidden;
}

.crop-stage {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  min-height: 0;
  position: relative;
  background: var(--canvas-soft);
  isolation: isolate;
}
.crop-stage .canvas-area {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background-color: var(--canvas-soft);
  background-image: radial-gradient(ellipse 90% 70% at 50% 42%, rgba(var(--surface-card-rgb), 0.55) 0%, transparent 68%), radial-gradient(ellipse 50% 40% at 18% 12%, rgba(var(--gradient-mint-rgb), 0.07) 0%, transparent 55%), radial-gradient(ellipse 45% 38% at 82% 78%, rgba(var(--gradient-lavender-rgb), 0.06) 0%, transparent 55%), radial-gradient(circle at center, rgba(var(--ink-rgb), 0.045) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 100% 100%, 24px 24px;
  background-position: center, center, center, center;
}
.crop-stage .canvas-wrapper {
  position: relative;
  flex: 1;
  width: 100%;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 28px 88px;
  box-sizing: border-box;
}
.crop-stage .canvas-wrapper:has(#empty-state:not([style*="display: none"]):not([style*="display:none"])) #main-canvas {
  display: none !important;
}
.crop-stage #main-canvas {
  border-radius: 12px;
  border: 1px solid var(--hairline-soft);
  box-shadow: 0 0 0 1px rgba(var(--surface-card-rgb), 0.4), 0 2px 8px rgba(var(--ink-rgb), 0.04), 0 16px 48px -12px rgba(var(--ink-rgb), 0.14);
  background-color: var(--surface-card);
  touch-action: none;
}
.crop-stage #main-canvas:hover {
  box-shadow: 0 0 0 1px rgba(var(--surface-card-rgb), 0.5), 0 4px 12px rgba(var(--ink-rgb), 0.06), 0 20px 56px -10px rgba(var(--ink-rgb), 0.18);
}
.crop-stage .drop-overlay {
  inset: 24px;
  border-radius: 20px;
  background: color-mix(in srgb, var(--primary) 6%, transparent);
  border: 2px dashed color-mix(in srgb, var(--primary) 42%, var(--hairline-soft));
  backdrop-filter: blur(2px);
}
.crop-stage .drop-overlay .drop-message {
  padding: 28px 36px;
  border: 1px solid var(--hairline-soft);
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface-card) 94%, transparent);
  box-shadow: 0 20px 56px -16px rgba(var(--ink-rgb), 0.2);
}
.crop-stage .drop-overlay .drop-message svg {
  color: var(--primary);
}

.crop-stage .empty-state.crop-empty {
  position: static;
  inset: unset;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 360px;
  margin: 0;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  transform: none;
  pointer-events: auto;
}
.crop-stage .empty-state.crop-empty .crop-empty__dropzone {
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: min(100%, 360px);
  padding: 36px 28px 32px;
  border-radius: 20px;
  border: 1px dashed color-mix(in srgb, var(--hairline) 70%, transparent);
  background: rgba(var(--surface-card-rgb), 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 24px 56px -36px rgba(var(--ink-rgb), 0.12);
  transition: border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}
.crop-stage .empty-state.crop-empty .crop-empty__dropzone:hover {
  border-color: color-mix(in srgb, var(--hairline-strong) 80%, transparent);
  box-shadow: 0 28px 64px -36px rgba(var(--ink-rgb), 0.14);
}
.crop-stage .empty-state.crop-empty .crop-empty__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  margin-bottom: 18px;
  border-radius: 14px;
  color: var(--muted);
  background: color-mix(in srgb, var(--canvas-soft) 80%, transparent);
}
.crop-stage .empty-state.crop-empty .crop-empty__title {
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1.35;
}
.crop-stage .empty-state.crop-empty .crop-empty__hint {
  margin: 0 0 22px;
  max-width: 26ch;
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
  line-height: 1.55;
}
.crop-stage .empty-state.crop-empty .crop-empty__actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  width: 100%;
}
.crop-stage .empty-state.crop-empty .crop-empty__btn {
  min-width: 112px;
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.crop-stage .empty-state.crop-empty .crop-empty__btn--primary {
  background: var(--primary);
  color: var(--on-primary);
  border-color: var(--primary);
}
.crop-stage .empty-state.crop-empty .crop-empty__btn--primary:hover {
  background: transparent;
  color: var(--primary);
}
.crop-stage .empty-state.crop-empty .crop-empty__btn--secondary {
  background: transparent;
  color: var(--ink);
  border-color: color-mix(in srgb, var(--hairline) 80%, transparent);
}
.crop-stage .empty-state.crop-empty .crop-empty__btn--secondary:hover {
  border-color: color-mix(in srgb, var(--hairline-strong) 90%, transparent);
  background: rgba(var(--surface-card-rgb), 0.9);
}
.crop-stage .empty-state.crop-empty .crop-empty__meta {
  margin: 18px 0 0;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.03em;
  color: var(--muted-soft);
  line-height: 1.4;
}

.crop-stage .canvas-area.dragover .crop-empty__dropzone {
  border-style: solid;
  border-color: color-mix(in srgb, var(--primary) 45%, transparent);
  background: color-mix(in srgb, var(--primary) 3%, var(--surface-card));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 8%, transparent), 0 24px 56px -32px rgba(var(--primary-rgb), 0.15);
}

.crop-zoom-float {
  position: absolute;
  right: 16px;
  bottom: 16px;
  z-index: 12;
  display: flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--hairline-soft);
  background: color-mix(in srgb, var(--surface-card) 92%, transparent);
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}
.crop-zoom-float.sidebar-section {
  border-radius: 999px;
  border: 1px solid var(--hairline-soft);
  padding: 6px 10px;
  margin: 0;
}
.crop-zoom-float .sidebar-title {
  display: none;
}
.crop-zoom-float .zoom-btns {
  display: flex;
  align-items: center;
  gap: 6px;
}
.crop-zoom-float #zoom-level {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  min-width: 44px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.settings-modal .drawer-card {
  padding: 0;
  gap: 0;
  border-radius: 12px;
  border: 1px solid var(--hairline-soft);
  background: var(--canvas-soft);
  box-shadow: none;
  min-width: 0;
  margin-bottom: 0;
  overflow: hidden;
}
.settings-modal .drawer-card:last-child {
  margin-bottom: 0;
}
.settings-modal .drawer-card > .sidebar-title {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 8px 14px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--muted);
  border-bottom: 1px solid var(--hairline-soft);
  background: transparent;
}
.settings-modal .drawer-card > .sidebar-title::before {
  display: none;
}

.settings-modal .drawer-form {
  display: flex;
  flex-direction: column;
}

.settings-modal .form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--hairline-soft);
  background: var(--surface-card);
}
.settings-modal .form-row:last-child {
  border-bottom: none;
}
.settings-modal .form-row--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.settings-modal .form-row--4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px 10px;
}
.settings-modal .form-row--toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
}
.settings-modal .form-row--toggle .setting-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: 0;
}

.settings-modal .form-cell {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.settings-modal .form-cell--emphasis {
  padding: 8px 10px;
  margin: -4px -6px 0;
  border-radius: 10px;
  border: 1px solid rgba(var(--ink-rgb), 0.14);
  background: rgba(var(--ink-rgb), 0.04);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}
.settings-modal .form-cell--emphasis .setting-label {
  color: var(--ink);
  font-weight: 600;
}
.settings-modal .form-cell--emphasis .setting-input {
  border-color: rgba(var(--ink-rgb), 0.22);
  background: var(--surface-card);
}

.settings-modal .setting-label__tip {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.02em;
  color: var(--ink);
  background: rgba(var(--ink-rgb), 0.08);
  border: 1px solid rgba(var(--ink-rgb), 0.12);
  border-radius: 999px;
  vertical-align: middle;
}

.settings-modal .field-hint {
  margin: 4px 0 0;
  font-size: 11px;
  line-height: 1.45;
  color: var(--muted-soft);
}
.settings-modal .field-hint--emphasis {
  color: var(--ink);
  font-weight: 500;
  padding-left: 8px;
  border-left: 2px solid var(--semantic-warn, #d99a2b);
}

.settings-modal .form-note {
  padding: 10px 14px 12px;
  font-size: 11px;
  line-height: 1.5;
  color: var(--muted-soft);
  border-top: 1px solid var(--hairline-soft);
  background: transparent;
}

.settings-modal .advanced-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 12px;
  padding: 0;
}

.settings-modal .advanced-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.settings-modal .advanced-col--fill {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
}

.settings-modal .adv-card {
  background: var(--canvas-soft);
  border: 1px solid var(--hairline-soft);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.settings-modal .adv-card__head {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 14px;
  background: transparent;
  border-bottom: 1px solid var(--hairline-soft);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink);
}
.settings-modal .adv-card__head svg {
  color: var(--muted-soft);
  flex-shrink: 0;
}
.settings-modal .adv-card__body {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  background: var(--surface-card);
  min-width: 0;
}

.settings-modal .adv-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--hairline-soft);
  min-width: 0;
}
.settings-modal .adv-row:last-child {
  border-bottom: none;
}
.settings-modal .adv-row__label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 400;
  color: var(--ink);
  flex: 1;
  min-width: 0;
}
.settings-modal .adv-row__label svg {
  color: var(--muted-soft);
  flex-shrink: 0;
  opacity: 0.85;
}
.settings-modal .adv-row__label span {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.settings-modal .adv-row--inline .setting-select-wrapper {
  flex: 0 0 auto;
  min-width: 110px;
}
.settings-modal .adv-row--inline .setting-select-wrapper select {
  width: auto;
  padding: 5px 28px 5px 9px;
  font-size: 13px;
  border-radius: 6px;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 7px center;
  cursor: pointer;
}
.settings-modal .adv-row--shape {
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding: 8px 14px;
}
.settings-modal .adv-row--shape .shape-picker {
  display: flex;
}
.settings-modal .adv-row--shape .shape-rotation {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.settings-modal .adv-row--shape .shape-rotation .adv-row__label {
  font-size: 12px;
  color: var(--muted);
}
.settings-modal .adv-row--shape .shape-rotation .adv-row__label span {
  font-size: 11px;
}
.settings-modal .adv-row--shape .shape-rotation .setting-slider {
  width: 100%;
}
.settings-modal .adv-row--2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 12px;
  padding: 8px 14px;
  border-bottom: none;
}
.settings-modal .adv-row--2:last-child {
  border-bottom: none;
}

.settings-modal .adv-slider-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.settings-modal .adv-slider-group .adv-row__label {
  font-size: 12px;
  color: var(--muted);
  flex: none;
}
.settings-modal .adv-slider-group .adv-row__label span {
  font-size: 11px;
}
.settings-modal .adv-slider-group .setting-slider {
  width: 100%;
}

.settings-modal .setting-label {
  display: block;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--muted);
  margin-bottom: 0;
}

.settings-modal .setting-input,
.settings-modal .setting-select-wrapper select,
.settings-modal .form-cell select {
  width: 100%;
  font-size: 13px;
  font-weight: 400;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--hairline-soft);
  background: var(--surface-card);
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.settings-modal .setting-input:hover,
.settings-modal .setting-select-wrapper select:hover,
.settings-modal .form-cell select:hover {
  border-color: var(--hairline);
}
.settings-modal .setting-input:focus,
.settings-modal .setting-select-wrapper select:focus,
.settings-modal .form-cell select:focus {
  outline: none;
  border-color: var(--hairline-strong);
  background: var(--surface-card);
}
.settings-modal .quality-slider {
  display: flex;
  align-items: center;
  gap: 8px;
}
.settings-modal .quality-slider input[type=range] {
  flex: 1;
  accent-color: var(--ink);
}
.settings-modal .quality-slider #quality-value {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  min-width: 32px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.settings-modal .naming-hint {
  margin-top: 2px;
  font-size: 11px;
  line-height: 1.4;
  color: var(--muted-soft);
}
.settings-modal .setting-slider {
  width: 100%;
  accent-color: var(--ink);
}

.settings-modal .image-info-body .info-row,
.layers-panel .image-info-body .info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--hairline-soft);
}
.settings-modal .image-info-body .info-row:last-child,
.layers-panel .image-info-body .info-row:last-child {
  border-bottom: none;
}
.settings-modal .image-info-body .info-label,
.layers-panel .image-info-body .info-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted-soft);
  flex-shrink: 0;
}
.settings-modal .image-info-body .info-value,
.layers-panel .image-info-body .info-value {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink);
  max-width: 160px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-modal .adv-card[data-adv-card=watermark] .adv-card__body {
  padding: 0 14px;
}
.settings-modal .adv-card[data-adv-card=watermark] .adv-card__body .watermark-upload-area {
  margin: 10px 0 0;
  width: 100%;
  box-sizing: border-box;
}
.settings-modal .adv-card[data-adv-card=watermark] .adv-card__body .adv-row--grid-label {
  padding: 8px 0 4px;
  border-bottom: none;
}
.settings-modal .adv-card[data-adv-card=watermark] .adv-card__body .watermark-position-grid {
  margin: 0 0 12px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.settings-modal .adv-card[data-adv-card=watermark] .adv-card__body .adv-row--2 {
  padding-left: 0;
  padding-right: 0;
  box-sizing: border-box;
}

.settings-modal .watermark-upload-area {
  width: auto;
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px dashed var(--hairline-soft);
  background: var(--canvas-soft);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: border-color 0.15s ease;
}
.settings-modal .watermark-upload-area:hover {
  border-color: var(--hairline);
}
.settings-modal .watermark-upload-area.has-file {
  border-style: solid;
  border-color: var(--hairline);
}
.settings-modal .watermark-upload-area .btn-sm {
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 6px;
  flex-shrink: 0;
}

.settings-modal .watermark-file-name {
  font-size: 12px;
  font-weight: 400;
  color: var(--muted-soft);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-modal .watermark-position-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  padding: 4px;
  border-radius: 10px;
  background: var(--hairline-soft);
  border: 1px solid var(--hairline-soft);
  box-sizing: border-box;
}

.settings-modal .wm-pos-btn {
  position: relative;
  width: 100%;
  min-width: 0;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: var(--surface-card);
  color: var(--muted);
  cursor: pointer;
  box-sizing: border-box;
  overflow: hidden;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}
.settings-modal .wm-pos-btn__dot {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--hairline);
  transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.settings-modal .wm-pos-btn__label {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 5px;
  font-size: 9px;
  font-weight: 500;
  line-height: 1;
  text-align: center;
  color: var(--muted-soft);
  user-select: none;
  pointer-events: none;
  transition: color 0.15s ease;
}
.settings-modal .wm-pos-btn[data-wm-pos=nw] .wm-pos-btn__dot {
  top: 30%;
  left: 30%;
}
.settings-modal .wm-pos-btn[data-wm-pos=n] .wm-pos-btn__dot {
  top: 30%;
  left: 50%;
  transform: translateX(-50%);
}
.settings-modal .wm-pos-btn[data-wm-pos=ne] .wm-pos-btn__dot {
  top: 30%;
  right: 30%;
}
.settings-modal .wm-pos-btn[data-wm-pos=w] .wm-pos-btn__dot {
  top: 50%;
  left: 30%;
  transform: translateY(-50%);
}
.settings-modal .wm-pos-btn[data-wm-pos=c] .wm-pos-btn__dot {
  top: 42%;
  left: 50%;
  transform: translate(-50%, -50%);
}
.settings-modal .wm-pos-btn[data-wm-pos=e] .wm-pos-btn__dot {
  top: 50%;
  right: 30%;
  transform: translateY(-50%);
}
.settings-modal .wm-pos-btn[data-wm-pos=sw] .wm-pos-btn__dot {
  bottom: 30%;
  left: 30%;
}
.settings-modal .wm-pos-btn[data-wm-pos=s] .wm-pos-btn__dot {
  bottom: 30%;
  left: 50%;
  transform: translateX(-50%);
}
.settings-modal .wm-pos-btn[data-wm-pos=se] .wm-pos-btn__dot {
  bottom: 30%;
  right: 30%;
}
.settings-modal .wm-pos-btn:hover {
  background: var(--canvas-soft);
}
.settings-modal .wm-pos-btn:hover .wm-pos-btn__dot {
  background: var(--muted);
}
.settings-modal .wm-pos-btn:hover .wm-pos-btn__label {
  color: var(--muted);
}
.settings-modal .wm-pos-btn.active {
  background: color-mix(in srgb, var(--ink) 5%, var(--surface-card));
  box-shadow: inset 0 0 0 1.5px var(--ink);
}
.settings-modal .wm-pos-btn.active .wm-pos-btn__dot {
  width: 6px;
  height: 6px;
  background: var(--ink);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--ink) 10%, transparent);
}
.settings-modal .wm-pos-btn.active .wm-pos-btn__label {
  color: var(--ink);
  font-weight: 600;
}
.settings-modal .wm-pos-btn:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--ink) 45%, transparent);
  outline-offset: -2px;
  z-index: 1;
}

.crop-footer {
  flex-shrink: 0;
  height: 36px;
  padding: 0 16px;
  background: var(--surface-card);
  border-top: 1px solid var(--hairline-soft);
  display: flex;
  align-items: center;
}
.crop-footer .footer-content {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0;
}
.crop-footer .footer-status {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.crop-footer .footer-status-item {
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.crop-footer .footer-text {
  font-size: 12px;
  color: var(--muted-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 768px) {
  .crop-footer .footer-text {
    display: none;
  }
}

#crop-panel-overlay,
#batch-layout-modal-overlay,
#shortcuts-overlay {
  z-index: 9000;
}

#crop-panel-overlay {
  padding: 20px;
  background: rgba(var(--canvas-deep-rgb), 0.45);
  backdrop-filter: blur(8px);
  font-family: "Inter", sans-serif;
}
#crop-panel-overlay .crop-panel {
  display: flex;
  flex-direction: column;
  max-width: 1000px;
  max-height: min(90vh, 860px);
  border-radius: 12px;
  border: 1px solid var(--hairline-soft);
  box-shadow: 0 12px 40px rgba(var(--ink-rgb), 0.12);
  font-family: inherit;
  animation: cropDrawerFade 0.24s ease;
}
#crop-panel-overlay .crop-panel-header {
  padding: 14px 18px 12px;
  border-bottom: 1px solid var(--hairline-soft);
  background: var(--surface-card);
}
#crop-panel-overlay .crop-panel-header h3 {
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
  color: var(--ink);
  gap: 8px;
}
#crop-panel-overlay .crop-panel-header h3 svg {
  width: 16px;
  height: 16px;
  color: var(--muted-soft);
  opacity: 1;
}
#crop-panel-overlay .crop-panel-header h3 .count-badge {
  font-family: inherit;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  background: var(--canvas-soft);
  border: 1px solid var(--hairline-soft);
  padding: 2px 8px;
  border-radius: 6px;
  margin-left: 2px;
}
#crop-panel-overlay .crop-panel-actions .btn-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--hairline-soft);
  color: var(--muted);
}
#crop-panel-overlay .crop-panel-actions .btn-icon:hover {
  color: var(--ink);
  border-color: var(--hairline);
  background: var(--canvas-soft);
}
#crop-panel-overlay .crop-panel-toolbar {
  padding: 10px 18px;
  gap: 12px 16px;
  border-bottom: 1px solid var(--hairline-soft);
  background: var(--canvas-soft);
  font-family: inherit;
  font-size: 13px;
}
#crop-panel-overlay .crop-panel-toolbar .panel-toolbar-check,
#crop-panel-overlay .crop-panel-toolbar .panel-toolbar-sort {
  color: var(--muted);
  font-weight: 400;
}
#crop-panel-overlay .crop-panel-toolbar .panel-sort-select {
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid var(--hairline-soft);
  background: var(--surface-card);
  font-family: inherit;
  font-size: 12px;
}
#crop-panel-overlay .crop-panel-toolbar .panel-sort-select:focus {
  box-shadow: 0 0 0 2px rgba(var(--ink-rgb), 0.08);
  border-color: var(--hairline-strong);
}
#crop-panel-overlay .crop-panel-toolbar .btn-sm {
  padding: 6px 12px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  border-radius: 8px;
  border: 1px solid var(--hairline-soft);
  background: var(--surface-card);
  color: var(--ink);
}
#crop-panel-overlay .crop-panel-toolbar .btn-sm:hover:not(:disabled) {
  border-color: var(--hairline);
  background: var(--surface-strong);
  transform: none;
}
#crop-panel-overlay .crop-panel-body {
  padding: 16px 18px;
  background: var(--surface-card);
}
#crop-panel-overlay .crop-panel-body--dark {
  background: var(--canvas-deep);
}
#crop-panel-overlay .crop-panel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}
#crop-panel-overlay .crop-panel-item {
  border-radius: 10px;
  border: 1px solid var(--hairline-soft);
  background: var(--surface-card);
  font-family: inherit;
  transition: border-color 0.15s ease;
}
#crop-panel-overlay .crop-panel-item::before {
  display: none;
}
#crop-panel-overlay .crop-panel-item:hover {
  border-color: var(--hairline);
  transform: none;
  box-shadow: none;
}
#crop-panel-overlay .crop-panel-item:hover .item-index {
  background: var(--ink);
  color: var(--on-primary);
}
#crop-panel-overlay .crop-panel-item:hover img {
  transform: none;
}
#crop-panel-overlay .crop-panel-item-toolbar {
  padding: 8px 10px;
  gap: 8px;
  border-bottom: 1px solid var(--hairline-soft);
  background: var(--canvas-soft);
}
#crop-panel-overlay .crop-panel-item-toolbar .panel-item-check {
  width: 16px;
  height: 16px;
  accent-color: var(--ink);
}
#crop-panel-overlay .crop-panel-item-toolbar .crop-panel-item-copy {
  margin-left: auto;
  padding: 4px 10px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 500;
  border-radius: 6px;
  border: 1px solid var(--hairline-soft);
  background: var(--surface-card);
  color: var(--muted);
}
#crop-panel-overlay .crop-panel-item-toolbar .crop-panel-item-copy:hover:not(:disabled) {
  color: var(--ink);
  border-color: var(--hairline);
  transform: none;
}
#crop-panel-overlay .crop-panel-item-preview {
  background: repeating-conic-gradient(var(--canvas-soft) 0% 25%, var(--hairline-soft) 0% 50%) 50%/12px 12px;
}
#crop-panel-overlay .crop-panel-item-preview::after {
  display: none;
}
#crop-panel-overlay .crop-panel-item img {
  max-height: 160px;
  transition: none;
}
#crop-panel-overlay .crop-panel-item-info {
  padding: 8px 10px;
  border-top: 1px solid var(--hairline-soft);
  background: var(--surface-card);
}
#crop-panel-overlay .crop-panel-item-info .item-index {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  font-family: inherit;
  font-size: 10px;
  font-weight: 600;
  background: var(--canvas-soft);
  color: var(--muted);
  transition: background 0.15s ease, color 0.15s ease;
}
#crop-panel-overlay .crop-panel-item-info .item-meta {
  font-family: inherit;
  font-size: 11px;
  font-weight: 400;
  color: var(--muted-soft);
  font-variant-numeric: tabular-nums;
}
#crop-panel-overlay .crop-panel-item-info .item-download {
  gap: 4px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--canvas-soft);
  border: 1px solid var(--hairline-soft);
  color: var(--ink);
}
#crop-panel-overlay .crop-panel-item-info .item-download:hover {
  background: var(--ink);
  color: var(--on-primary);
  border-color: var(--ink);
  transform: none;
  box-shadow: none;
}
#crop-panel-overlay .crop-panel-item-info .item-download svg {
  width: 12px;
  height: 12px;
}
#crop-panel-overlay .crop-panel-footer {
  padding: 12px 18px;
  border-top: 1px solid var(--hairline-soft);
  background: var(--canvas-soft);
  gap: 12px;
}
#crop-panel-overlay .crop-panel-footer .crop-panel-hint {
  font-family: inherit;
  font-size: 12px;
  font-weight: 400;
  color: var(--muted-soft);
}
#crop-panel-overlay .crop-panel-footer .crop-panel-hint::before {
  display: none;
}
#crop-panel-overlay .crop-panel-footer .btn-primary {
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 8px;
}

.crop-app .crop-panel-overlay .crop-panel {
  display: flex;
  flex-direction: column;
  max-height: 90vh;
}

.crop-app {
  font-family: "Inter", sans-serif;
}
.crop-app :focus-visible {
  outline: 2px solid rgba(var(--ink-rgb), 0.35);
  outline-offset: 2px;
}

.crop-toolbar__back {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 9px;
  border: 1px solid var(--hairline-soft);
  color: var(--muted);
  text-decoration: none;
  background: transparent;
  cursor: pointer;
  transition: background 0.2s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.18s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.crop-toolbar__back svg {
  transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.crop-toolbar__back:hover {
  color: var(--ink);
  border-color: var(--hairline);
  background: var(--surface-card);
  box-shadow: 0 1px 0 rgba(var(--surface-card-rgb), 0.6) inset, 0 2px 6px -2px rgba(var(--ink-rgb), 0.06);
  transform: translateX(-2px);
}
.crop-toolbar__back:hover svg {
  transform: scale(1.1);
}
.crop-toolbar__back:active {
  transform: translateX(0);
  background: color-mix(in srgb, var(--surface-card) 92%, var(--canvas-soft));
  box-shadow: inset 0 1px 2px rgba(var(--ink-rgb), 0.06);
}
.crop-toolbar__back:focus-visible {
  outline: none;
  border-color: rgba(var(--primary-rgb), 0.5);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.15);
}

.crop-toolbar__icon-btn:disabled,
.crop-toolbar__ghost-btn:disabled,
.crop-toolbar__back[aria-disabled=true] {
  opacity: 0.32;
  cursor: not-allowed;
  pointer-events: none;
  filter: saturate(0.6);
}

.crop-toolbar__action-btn {
  transition: transform 0.18s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.22s cubic-bezier(0.2, 0.8, 0.2, 1), filter 0.2s ease, opacity 0.2s ease;
}
.crop-toolbar__action-btn:disabled:not(.is-loading) {
  opacity: 0.4;
  cursor: not-allowed;
}
.crop-toolbar__action-btn.is-loading {
  opacity: 0.75;
  cursor: wait;
  pointer-events: none;
}

.crop-toolbar__spacer {
  flex: 1 1 auto;
  min-width: 16px;
}

.crop-toolbar__divider {
  width: 1px;
  height: 22px;
  flex-shrink: 0;
  margin: 0 4px;
  background: linear-gradient(180deg, transparent 0%, var(--hairline) 50%, transparent 100%);
  opacity: 0.65;
}

.crop-toolbar__segment.mode-switch {
  padding: 4px;
  gap: 2px;
}

.pre-init .crop-toolbar__segment.mode-switch .btn-mode.active {
  color: var(--muted) !important;
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
}

.pre-init .crop-toolbar__segment.mode-switch .btn-mode.active::after {
  display: none !important;
}

@media (prefers-reduced-motion: reduce) {
  .crop-toolbar__upload,
  .crop-toolbar__icon-btn,
  .crop-toolbar__icon-btn svg,
  .crop-toolbar__ghost-btn,
  .crop-toolbar__ghost-btn svg,
  .crop-toolbar__back,
  .crop-toolbar__back svg,
  .crop-toolbar__action-btn,
  .crop-toolbar__segment .btn-mode,
  .crop-toolbar__segment .btn-mode svg {
    transition: none !important;
    transform: none !important;
  }
}
#btn-show-results {
  position: relative;
}
#btn-show-results .crop-result-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  margin-left: 2px;
  border-radius: 99px;
  font-size: 10px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--on-primary);
  background: var(--ink);
  border: none;
}

.crop-footer .footer-status {
  gap: 0;
}
.crop-footer .footer-status-item {
  position: relative;
  padding: 0 12px;
  font-size: 11px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}
.crop-footer .footer-status-item:not(:last-child)::after {
  content: "";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 12px;
  background: var(--hairline-soft);
}
.crop-footer .footer-status-item:first-child {
  padding-left: 0;
}
.crop-footer .footer-text {
  font-size: 11px;
  color: var(--muted-soft);
  max-width: 50%;
}

.crop-zoom-float {
  bottom: 14px;
  transition: bottom 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

#shortcuts-overlay {
  padding: 24px;
  background: rgba(var(--canvas-deep-rgb), 0.45);
  backdrop-filter: blur(8px);
  font-family: "Inter", sans-serif;
}
#shortcuts-overlay .shortcuts-modal {
  max-width: 640px;
  border-radius: 12px;
  border: 1px solid var(--hairline-soft);
  box-shadow: 0 12px 40px rgba(var(--ink-rgb), 0.12);
  font-family: inherit;
}
#shortcuts-overlay .crop-panel-header {
  padding: 14px 18px 12px;
}
#shortcuts-overlay .crop-panel-header h3 {
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  gap: 8px;
}
#shortcuts-overlay .crop-panel-header h3 svg {
  width: 16px;
  height: 16px;
  opacity: 1;
  color: var(--muted-soft);
}
#shortcuts-overlay .shortcuts-body {
  padding: 12px 18px 18px;
}
#shortcuts-overlay .shortcuts-footer {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--hairline-soft);
  display: flex;
  justify-content: flex-end;
}
#shortcuts-overlay .shortcuts-grid {
  gap: 16px;
}
#shortcuts-overlay .shortcuts-col h4 {
  font-family: inherit;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--muted-soft);
  margin-bottom: 8px;
  padding-bottom: 6px;
}
#shortcuts-overlay .shortcut-row {
  font-family: inherit;
  font-size: 12px;
  color: var(--ink);
  padding: 4px 0;
}
#shortcuts-overlay .shortcut-row kbd {
  font-family: inherit;
  font-size: 11px;
  font-weight: 500;
  min-width: 24px;
  height: 22px;
  padding: 0 6px;
  border-radius: 5px;
  background: var(--canvas-soft);
  border-color: var(--hairline-soft);
  color: var(--muted);
}

#batch-layout-modal-overlay {
  padding: 20px;
  background: rgba(var(--canvas-deep-rgb), 0.45);
  backdrop-filter: blur(8px);
  font-family: "Inter", sans-serif;
}
#batch-layout-modal-overlay .batch-layout-modal {
  width: 100%;
  max-width: 400px;
  max-height: min(88vh, 560px);
  border-radius: 14px;
  border: 1px solid var(--hairline-soft);
  box-shadow: 0 24px 48px -12px rgba(var(--ink-rgb), 0.18), 0 8px 20px -8px rgba(var(--ink-rgb), 0.08);
  animation: fadeInScale 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
#batch-layout-modal-overlay .crop-panel-header {
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--hairline-soft);
}
#batch-layout-modal-overlay .crop-panel-header h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
}
#batch-layout-modal-overlay .crop-panel-header h3 svg {
  flex-shrink: 0;
  color: var(--muted-soft);
}
#batch-layout-modal-overlay .crop-panel-actions .btn-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
}
#batch-layout-modal-overlay .crop-panel-actions .btn-icon:hover {
  background: var(--canvas-soft);
}
#batch-layout-modal-overlay .batch-layout-modal-body {
  padding: 12px 16px 16px;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
}
#batch-layout-modal-overlay .batch-layout-modal-hint {
  margin: 0 0 14px;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.55;
  color: var(--muted);
  background: var(--canvas-soft);
  border: 1px solid var(--hairline-soft);
  border-radius: 10px;
}
#batch-layout-modal-overlay .batch-layout-block {
  padding: 12px;
  border: 1px solid var(--hairline-soft);
  border-radius: 12px;
  background: var(--surface-card);
}
#batch-layout-modal-overlay .batch-layout-block + .batch-layout-block {
  margin-top: 10px;
}
#batch-layout-modal-overlay .batch-layout-block__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
#batch-layout-modal-overlay .batch-layout-block__label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted-soft);
}
#batch-layout-modal-overlay .batch-layout-block__desc {
  margin: 0 0 10px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
}
#batch-layout-modal-overlay .batch-layout-block__actions--split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
#batch-layout-modal-overlay .batch-queue-count {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--canvas-soft);
  border: 1px solid var(--hairline-soft);
}
#batch-layout-modal-overlay .batch-layout-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  min-height: 36px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 500;
  border-radius: 9px;
  border: 1px solid var(--hairline-soft);
  background: var(--canvas-soft);
  color: var(--ink);
  transition: background 0.15s ease, border-color 0.15s ease;
}
#batch-layout-modal-overlay .batch-layout-btn svg {
  flex-shrink: 0;
  opacity: 0.72;
}
#batch-layout-modal-overlay .batch-layout-btn:hover:not(:disabled) {
  background: var(--surface-card);
  border-color: var(--hairline);
}
#batch-layout-modal-overlay .batch-layout-btn--pick {
  margin-bottom: 8px;
  border-style: dashed;
  color: var(--muted);
}
#batch-layout-modal-overlay .batch-layout-btn--pick:hover:not(:disabled) {
  color: var(--ink);
  border-color: color-mix(in srgb, var(--primary) 35%, var(--hairline));
  background: color-mix(in srgb, var(--primary) 4%, var(--canvas-soft));
}
#batch-layout-modal-overlay .batch-queue {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 132px;
  overflow-y: auto;
  border: 1px solid var(--hairline-soft);
  border-radius: 9px;
  background: var(--canvas-soft);
}
#batch-layout-modal-overlay .batch-queue__empty {
  padding: 14px 12px;
  text-align: center;
  font-size: 12px;
  color: var(--muted-soft);
  border: none;
  background: transparent;
}
#batch-layout-modal-overlay .batch-queue__item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--hairline-soft);
  background: var(--surface-card);
  cursor: grab;
}
#batch-layout-modal-overlay .batch-queue__item:last-child {
  border-bottom: none;
}
#batch-layout-modal-overlay .batch-queue__item.is-dragging {
  opacity: 0.45;
  cursor: grabbing;
}
#batch-layout-modal-overlay .batch-queue__item.is-drag-over {
  background: color-mix(in srgb, var(--primary) 6%, var(--surface-card));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 40%, transparent);
}
#batch-layout-modal-overlay .batch-queue__handle {
  flex: none;
  color: var(--muted-soft);
  font-size: 11px;
  line-height: 1;
  user-select: none;
  letter-spacing: -2px;
}
#batch-layout-modal-overlay .batch-queue__info {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
#batch-layout-modal-overlay .batch-queue__name {
  font-size: 12px;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#batch-layout-modal-overlay .batch-queue__size {
  font-size: 10px;
  color: var(--muted-soft);
}
#batch-layout-modal-overlay .batch-queue__remove,
#batch-layout-modal-overlay .batch-queue .batch-remove {
  flex-shrink: 0;
  border: none;
  background: transparent;
  color: var(--muted-soft);
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  width: 24px;
  height: 24px;
  padding: 0;
  border-radius: 6px;
  transition: background 0.15s ease, color 0.15s ease;
}
#batch-layout-modal-overlay .batch-queue__remove:hover,
#batch-layout-modal-overlay .batch-queue .batch-remove:hover {
  background: rgba(var(--semantic-error-rgb), 0.1);
  color: var(--semantic-error);
}
#batch-layout-modal-overlay .batch-layout-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-top: 1px solid var(--hairline-soft);
  background: var(--surface-card);
}
#batch-layout-modal-overlay .batch-layout-footer .batch-layout-footer-hint {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 11px;
  line-height: 1.4;
  color: var(--muted-soft);
}
#batch-layout-modal-overlay .batch-layout-footer .btn-primary {
  flex-shrink: 0;
  min-width: 108px;
  height: 36px;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 9px;
}

@media (max-width: 767px) {
  .crop-footer .footer-text {
    display: none;
  }
}
.crop-side-handle {
  position: fixed;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  z-index: 8002;
  overflow: visible;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  width: 32px;
  height: 56px;
  padding: 0;
  color: var(--muted);
  cursor: pointer;
  border: 1px solid var(--hairline-soft);
  border-left: none;
  border-radius: 0 10px 10px 0;
  background: color-mix(in srgb, var(--surface-card) 92%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 2px 10px rgba(var(--ink-rgb), 0.06), 0 1px 0 rgba(var(--surface-card-rgb), 0.55) inset;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease, transform 0.24s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, width 0.2s ease;
}
.crop-side-handle::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  width: 2px;
  height: 18px;
  transform: translateY(-50%);
  border-radius: 0 2px 2px 0;
  background: var(--hairline);
  opacity: 0.55;
  transition: background 0.2s ease, height 0.2s ease, opacity 0.2s ease;
}
.crop-side-handle__glyph {
  flex: none;
  display: block;
  color: inherit;
  transition: transform 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}
.crop-side-handle__label {
  position: absolute;
  top: 50%;
  left: calc(100% + 8px);
  transform: translateY(-50%) translateX(-4px);
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--hairline-soft);
  background: var(--surface-card);
  box-shadow: 0 4px 14px rgba(var(--ink-rgb), 0.1);
  font: 500 11px/1 var(--font-stack, "Inter", system-ui, sans-serif);
  color: var(--ink);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.18s ease, transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.crop-side-handle:hover {
  width: 34px;
  color: var(--ink);
  background: var(--surface-card);
  border-color: var(--hairline);
  transform: translateY(-50%) translateX(2px);
  box-shadow: 0 4px 16px rgba(var(--ink-rgb), 0.1), 0 1px 0 rgba(var(--surface-card-rgb), 0.7) inset;
}
.crop-side-handle:hover::before {
  height: 22px;
  background: var(--primary);
  opacity: 0.75;
}
.crop-side-handle:hover .crop-side-handle__glyph {
  transform: scale(1.06);
}
.crop-side-handle:hover .crop-side-handle__label {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}
.crop-side-handle:active {
  transform: translateY(-50%) translateX(1px) scale(0.97);
  transition-duration: 0.08s;
}
.crop-side-handle:active .crop-side-handle__glyph {
  transform: scale(0.94);
}
.crop-side-handle:focus-visible {
  outline: none;
  border-color: rgba(var(--primary-rgb), 0.4);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.12), 0 2px 10px rgba(var(--ink-rgb), 0.06);
}
.crop-side-handle.is-active {
  width: 34px;
  color: var(--primary);
  background: color-mix(in srgb, var(--surface-card) 96%, rgba(var(--primary-rgb), 0.06));
  border-color: rgba(var(--primary-rgb), 0.22);
  box-shadow: 0 4px 14px rgba(var(--primary-rgb), 0.12), 0 1px 0 rgba(var(--surface-card-rgb), 0.6) inset;
}
.crop-side-handle.is-active::before {
  height: 24px;
  background: var(--primary);
  opacity: 1;
}
@media (pointer: coarse) {
  .crop-side-handle {
    width: 36px;
    height: 60px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .crop-side-handle {
    transition: none;
    transform: translateY(-50%);
  }
  .crop-side-handle:hover {
    transform: translateY(-50%) translateX(1px);
  }
  .crop-side-handle__glyph, .crop-side-handle__label, .crop-side-handle::before {
    transition: none;
  }
}

.crop-app:has(.mode-panel.is-open) #crop-side-handle,
body:has(.mode-panel.is-open) #crop-side-handle {
  opacity: 0 !important;
  pointer-events: none !important;
  transform: translateY(-50%) translateX(-30px) !important;
}

.mode-panel-backdrop,
.layers-panel-backdrop {
  position: fixed;
  inset: 0;
  z-index: 8000;
  border: 0;
  padding: 0;
  margin: 0;
  background: rgba(var(--ink-rgb), 0.28);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
  cursor: default;
}
.mode-panel-backdrop:not([hidden]),
.layers-panel-backdrop:not([hidden]) {
  opacity: 1;
  pointer-events: auto;
}

.mode-panel {
  z-index: 8001;
  width: 272px;
  max-width: calc(100vw - 24px);
  height: clamp(360px, 60vh, 600px);
  top: 50%;
  margin-top: calc(clamp(360px, 60vh, 600px) / -2);
  display: flex;
  flex-direction: column;
  background: color-mix(in srgb, var(--surface-card) 97%, transparent);
  backdrop-filter: blur(16px) saturate(1.15);
  -webkit-backdrop-filter: blur(16px) saturate(1.15);
  border: 1px solid var(--hairline-soft);
  border-radius: 16px;
  box-shadow: 0 1px 0 rgba(var(--surface-card-rgb), 0.75) inset, 0 16px 40px -16px rgba(var(--ink-rgb), 0.14), 0 4px 12px -4px rgba(var(--ink-rgb), 0.06);
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: fixed;
  left: 12px;
  transform: translateX(calc(-100% - 20px));
}
.mode-panel__detail {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
.mode-panel[hidden] {
  display: none;
}
.mode-panel.is-open {
  transform: translateX(0);
}
.mode-panel__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 12px 12px;
  border-bottom: 1px solid var(--hairline-soft);
  background: color-mix(in srgb, var(--canvas-soft) 32%, transparent);
  flex: none;
}
.mode-panel__head > div {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  min-width: 0;
}
.mode-panel__eyebrow {
  margin: 0 0 8px;
  padding: 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
}
.mode-panel__eyebrow::before, .mode-panel__eyebrow::after {
  display: none;
}
.mode-panel__eyebrow {
  margin: 0;
  color: var(--primary);
  font-size: 10px;
  font-weight: 600;
}
.mode-panel__title {
  margin: 0;
  display: block;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1.25;
}
.mode-panel__sub {
  display: block;
  margin: 0;
  font-size: 11px;
  line-height: 1.4;
  color: var(--muted-soft);
}
.mode-panel__close {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: var(--surface-card);
  border: 1px solid var(--hairline-soft);
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.2s ease;
}
.mode-panel__close svg {
  width: 14px;
  height: 14px;
}
.mode-panel__close:hover {
  background: var(--canvas-soft);
  color: var(--ink);
  border-color: var(--hairline);
  transform: scale(1.04);
}
.mode-panel__close:focus-visible {
  outline: none;
  border-color: rgba(var(--primary-rgb), 0.45);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.12);
}
.mode-panel__scroll {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px 10px 14px;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--hairline) transparent;
}
.mode-panel__scroll::-webkit-scrollbar {
  width: 5px;
}
.mode-panel__scroll::-webkit-scrollbar-track {
  background: transparent;
}
.mode-panel__scroll::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--muted) 35%, transparent);
  border-radius: 99px;
}
.mode-panel__scroll::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--primary) 55%, transparent);
}
.mode-panel__pane {
  animation: modePanelFade 0.32s cubic-bezier(0.16, 1, 0.3, 1);
}
.mode-panel__pane[hidden] {
  display: none;
}
@keyframes modePanelFade {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.mode-panel__section {
  padding: 0 2px;
  margin-bottom: 16px;
}
.mode-panel__section:last-child {
  margin-bottom: 0;
}
.mode-panel__group {
  margin: 0 0 8px;
  padding: 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
}
.mode-panel__group::before, .mode-panel__group::after {
  display: none;
}
.mode-panel__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}

.rect-aspect-section[hidden] {
  display: none !important;
}

.rect-aspect-modes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 8px;
}

.rect-aspect-mode {
  padding: 8px 10px;
  border: 1px solid var(--hairline-soft);
  border-radius: 8px;
  background: var(--surface-card);
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.rect-aspect-mode:hover {
  border-color: var(--hairline);
  color: var(--ink);
}
.rect-aspect-mode.active {
  background: rgba(var(--primary-rgb), 0.08);
  border-color: rgba(var(--primary-rgb), 0.35);
  color: var(--ink);
  font-weight: 600;
}

.rect-aspect-presets {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.rect-aspect-presets[hidden] {
  display: none !important;
}
.rect-aspect-presets__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}

.rect-ratio-btn {
  padding: 7px 4px;
  border: 1px solid var(--hairline-soft);
  border-radius: 8px;
  background: var(--surface-card);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.rect-ratio-btn:hover {
  border-color: var(--hairline);
  color: var(--ink);
}
.rect-ratio-btn.active {
  background: rgba(var(--primary-rgb), 0.08);
  border-color: rgba(var(--primary-rgb), 0.35);
  color: var(--ink);
}

.rect-aspect-custom {
  display: flex;
  align-items: flex-end;
  gap: 6px;
}
.rect-aspect-custom__field {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  min-width: 0;
}
.rect-aspect-custom__field span {
  font-size: 10px;
  color: var(--muted-soft);
}
.rect-aspect-custom__field .setting-input {
  width: 100%;
  min-width: 0;
  padding: 6px 8px;
  font-size: 12px;
}
.rect-aspect-custom__sep {
  padding-bottom: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.rect-aspect-hint {
  margin: 0;
  font-size: 10px;
  line-height: 1.45;
  color: var(--muted-soft);
}

.shape-item,
.tpl-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 4px 7px;
  background: var(--surface-card);
  border: 1px solid var(--hairline-soft);
  border-radius: 8px;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, color 0.18s ease;
  min-height: 52px;
  overflow: hidden;
}
.shape-item svg,
.tpl-item svg {
  width: 18px;
  height: 18px;
  color: var(--muted);
  transition: color 0.18s ease;
}
.shape-item span,
.tpl-item span {
  font-size: 10px;
  color: var(--muted);
  font-weight: 500;
  transition: color 0.18s ease;
  line-height: 1.15;
  text-align: center;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.shape-item:hover,
.tpl-item:hover {
  background: var(--canvas-soft);
  border-color: var(--hairline);
  box-shadow: 0 2px 8px rgba(var(--ink-rgb), 0.06);
}
.shape-item:hover svg,
.tpl-item:hover svg {
  color: var(--ink);
}
.shape-item:hover span,
.tpl-item:hover span {
  color: var(--ink);
}
.shape-item:focus-visible,
.tpl-item:focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 22%, transparent);
}
.shape-item.active,
.tpl-item.active {
  background: rgba(var(--primary-rgb), 0.08);
  border-color: rgba(var(--primary-rgb), 0.35);
  box-shadow: 0 0 0 1px rgba(var(--primary-rgb), 0.12) inset;
}
.shape-item.active svg,
.tpl-item.active svg {
  color: var(--primary);
}
.shape-item.active span,
.tpl-item.active span {
  color: var(--primary);
  font-weight: 600;
}
.shape-item--accent,
.tpl-item--accent {
  background: rgba(var(--primary-rgb), 0.05);
  border-color: rgba(var(--primary-rgb), 0.18);
}
.shape-item--accent svg,
.tpl-item--accent svg {
  color: var(--primary);
}
.shape-item--accent span,
.tpl-item--accent span {
  color: var(--primary);
  font-weight: 600;
}
.shape-item--accent:hover,
.tpl-item--accent:hover {
  background: rgba(var(--primary-rgb), 0.1);
  border-color: rgba(var(--primary-rgb), 0.3);
}
.shape-item--danger,
.tpl-item--danger {
  background: rgba(var(--semantic-error-rgb), 0.05);
  border-color: rgba(var(--semantic-error-rgb), 0.18);
}
.shape-item--danger svg,
.tpl-item--danger svg {
  color: var(--semantic-error);
}
.shape-item--danger span,
.tpl-item--danger span {
  color: var(--semantic-error);
  font-weight: 600;
}
.shape-item--danger:hover,
.tpl-item--danger:hover {
  background: rgba(var(--semantic-error-rgb), 0.1);
  border-color: rgba(var(--semantic-error-rgb), 0.32);
}

.crop-side-handle--right {
  left: auto;
  right: 0;
  border-left: 1px solid var(--hairline-soft);
  border-right: none;
  border-radius: 10px 0 0 10px;
}
.crop-side-handle--right::before {
  left: auto;
  right: 0;
  border-radius: 2px 0 0 2px;
}
.crop-side-handle--right .crop-side-handle__label {
  left: auto;
  right: calc(100% + 8px);
  transform: translateY(-50%) translateX(4px);
}
.crop-side-handle--right:hover {
  transform: translateY(-50%) translateX(-2px);
}
.crop-side-handle--right:hover .crop-side-handle__label {
  transform: translateY(-50%) translateX(0);
}
.crop-side-handle--right:active {
  transform: translateY(-50%) translateX(-1px) scale(0.97);
}

.crop-app:has(.layers-panel.is-open) #crop-layers-handle,
body:has(.layers-panel.is-open) #crop-layers-handle {
  opacity: 0 !important;
  pointer-events: none !important;
  transform: translateY(-50%) translateX(30px) !important;
}

.layers-panel {
  z-index: 8001;
  width: 272px;
  max-width: calc(100vw - 24px);
  height: clamp(360px, 60vh, 600px);
  top: 50%;
  margin-top: calc(clamp(360px, 60vh, 600px) / -2);
  display: flex;
  flex-direction: column;
  background: color-mix(in srgb, var(--surface-card) 97%, transparent);
  backdrop-filter: blur(16px) saturate(1.15);
  -webkit-backdrop-filter: blur(16px) saturate(1.15);
  border: 1px solid var(--hairline-soft);
  border-radius: 16px;
  box-shadow: 0 1px 0 rgba(var(--surface-card-rgb), 0.75) inset, 0 16px 40px -16px rgba(var(--ink-rgb), 0.14), 0 4px 12px -4px rgba(var(--ink-rgb), 0.06);
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: fixed;
  right: 12px;
  transform: translateX(calc(100% + 20px));
}
.layers-panel__detail {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
.layers-panel[hidden] {
  display: none;
}
.layers-panel.is-open {
  transform: translateX(0);
}
.layers-panel__head {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "main  close" "sub   sub";
  align-items: start;
  column-gap: 10px;
  row-gap: 4px;
  padding: 14px 12px 12px;
  border-bottom: 1px solid var(--hairline-soft);
  background: color-mix(in srgb, var(--canvas-soft) 32%, transparent);
  flex: none;
}
.layers-panel__head-row {
  grid-area: main;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.layers-panel__eyebrow {
  margin: 0 0 8px;
  padding: 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
}
.layers-panel__eyebrow::before, .layers-panel__eyebrow::after {
  display: none;
}
.layers-panel__eyebrow {
  margin: 0;
  color: var(--primary);
  font-size: 10px;
  font-weight: 600;
}
.layers-panel__title {
  margin: 0;
  display: block;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1.25;
}
.layers-panel__sub {
  grid-area: sub;
  display: block;
  margin: 0;
  font-size: 11px;
  line-height: 1.4;
  color: var(--muted-soft);
}
.layers-panel__close {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: var(--surface-card);
  border: 1px solid var(--hairline-soft);
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.2s ease;
}
.layers-panel__close svg {
  width: 14px;
  height: 14px;
}
.layers-panel__close:hover {
  background: var(--canvas-soft);
  color: var(--ink);
  border-color: var(--hairline);
  transform: scale(1.04);
}
.layers-panel__close:focus-visible {
  outline: none;
  border-color: rgba(var(--primary-rgb), 0.45);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.12);
}
.layers-panel__close {
  grid-area: close;
}
.layers-panel__scroll {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px 10px 14px;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--hairline) transparent;
}
.layers-panel__scroll::-webkit-scrollbar {
  width: 5px;
}
.layers-panel__scroll::-webkit-scrollbar-track {
  background: transparent;
}
.layers-panel__scroll::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--muted) 35%, transparent);
  border-radius: 99px;
}
.layers-panel__scroll::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--primary) 55%, transparent);
}
.layers-panel__pane {
  animation: layersPanelFade 0.32s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes layersPanelFade {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.layers-panel__section {
  padding: 0 2px;
  margin-bottom: 14px;
}
.layers-panel__section:last-child {
  margin-bottom: 0;
}
.layers-panel__group {
  margin: 0 0 8px;
  padding: 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
}
.layers-panel__group::before, .layers-panel__group::after {
  display: none;
}
.layers-panel__list {
  list-style: none;
  margin: 0;
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border: 1px solid var(--hairline-soft);
  border-radius: 10px;
  background: color-mix(in srgb, var(--canvas-soft) 45%, transparent);
  min-height: 44px;
}
.layers-panel__info {
  padding: 2px 4px 0;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.55;
  border: 1px solid var(--hairline-soft);
  border-radius: 10px;
  background: color-mix(in srgb, var(--canvas-soft) 45%, transparent);
}

.layers-panel .line-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 6px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  color: var(--ink);
  background: transparent;
  border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.layers-panel .line-item:hover {
  background: var(--surface-card);
  border-color: var(--hairline-soft);
}
.layers-panel .line-item:focus-visible {
  outline: none;
  background: var(--canvas-soft);
  border-color: color-mix(in srgb, var(--primary) 45%, transparent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 18%, transparent);
}
.layers-panel .line-item.line-item--focused {
  background: rgba(var(--primary-rgb), 0.06);
  border-color: rgba(var(--primary-rgb), 0.28);
}
.layers-panel .line-item.line-item--selected {
  background: rgba(var(--primary-rgb), 0.1);
  border-color: rgba(var(--primary-rgb), 0.32);
}
.layers-panel .line-item .line-item__check {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin: 0;
  cursor: pointer;
}
.layers-panel .line-item .line-item__check input[type=checkbox] {
  appearance: none;
  -webkit-appearance: none;
  display: block;
  width: 14px;
  height: 14px;
  margin: 0;
  padding: 0;
  cursor: pointer;
  border: 1.5px solid color-mix(in srgb, var(--muted) 35%, var(--hairline));
  border-radius: 4px;
  background: var(--surface-card);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
}
.layers-panel .line-item .line-item__check input[type=checkbox]:hover {
  border-color: color-mix(in srgb, var(--primary) 45%, var(--hairline));
  background: color-mix(in srgb, var(--primary) 4%, var(--surface-card));
}
.layers-panel .line-item .line-item__check input[type=checkbox]:checked {
  border-color: var(--primary);
  background-color: var(--primary);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M2.5 6.2 4.8 8.5 9.5 3.8' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 10px 10px;
  box-shadow: none;
}
.layers-panel .line-item .line-item__check input[type=checkbox]:focus-visible {
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 0 0 2px color-mix(in srgb, var(--primary) 22%, transparent);
}
.layers-panel .line-item .line-item__check input[type=checkbox]:checked:focus-visible {
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 22%, transparent);
}
.layers-panel .line-item .line-item__check input[type=checkbox]:active {
  transform: scale(0.94);
}
.layers-panel .line-item + .layers-panel .line-item {
  margin-top: 0;
}
.layers-panel .line-item .line-item__icon {
  flex: none;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: var(--surface-card);
  border: 1px solid var(--hairline-soft);
  color: var(--muted);
}
.layers-panel .line-item .line-item__icon svg {
  width: 12px;
  height: 12px;
}
.layers-panel .line-item .line-item__content {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.layers-panel .line-item .line-item__main {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}
.layers-panel .line-item .line-item__pos {
  flex: none;
  font-size: 10px;
  font-weight: 500;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
  white-space: nowrap;
  padding: 1px 5px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--canvas-soft) 60%, transparent);
  transition: color 0.18s ease;
}
.layers-panel .line-item .line-item__pos--sub {
  font-size: 9px;
  font-weight: 450;
  opacity: 0.88;
}
.layers-panel .line-item.line-item--group .line-item__main {
  flex-wrap: wrap;
  row-gap: 2px;
}
.layers-panel .line-item .line-item__name {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 72px;
  font: inherit;
  font-size: 10px;
  font-weight: 500;
  color: var(--ink);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 1px 4px;
  outline: none;
  letter-spacing: 0.01em;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.layers-panel .line-item .line-item__name::placeholder {
  color: color-mix(in srgb, var(--muted) 60%, transparent);
  font-weight: 400;
}
.layers-panel .line-item .line-item__name:hover {
  background: color-mix(in srgb, var(--surface-card) 70%, transparent);
  border-color: color-mix(in srgb, var(--hairline) 50%, transparent);
}
.layers-panel .line-item .line-item__name:focus {
  background: var(--surface-card);
  border-color: color-mix(in srgb, var(--primary) 50%, transparent);
  color: var(--ink);
}
.layers-panel .line-item .line-item__remove {
  flex: none;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin-left: auto;
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: var(--muted-soft);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.15s ease, visibility 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.layers-panel .line-item .line-item__remove svg {
  width: 11px;
  height: 11px;
  stroke-width: 2.2;
}
.layers-panel .line-item .line-item__remove:hover {
  color: var(--semantic-error);
  background: color-mix(in srgb, var(--semantic-error) 10%, transparent);
}
.layers-panel .line-item:hover .line-item__remove, .layers-panel .line-item.line-item--focused .line-item__remove, .layers-panel .line-item:focus-within .line-item__remove {
  opacity: 0.55;
  visibility: visible;
  pointer-events: auto;
}
.layers-panel .line-item .line-item__remove:hover {
  opacity: 1;
}

.layers-panel .select-item {
  align-items: flex-start;
  padding: 6px 4px 6px 2px;
  gap: 6px;
}
.layers-panel .select-item .line-item__check {
  margin-top: 2px;
}
.layers-panel .select-item .select-item__icon {
  width: 16px;
  height: 16px;
  margin-top: 1px;
  border: none;
  background: transparent;
  color: var(--muted-soft);
}
.layers-panel .select-item .select-item__icon svg {
  width: 11px;
  height: 11px;
}
.layers-panel .select-item .select-item__main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.layers-panel .select-item .select-item__row {
  display: flex;
  align-items: baseline;
  gap: 0;
  min-width: 0;
  line-height: 1.35;
}
.layers-panel .select-item .select-item__label {
  flex: none;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: 0.01em;
}
.layers-panel .select-item .select-item__sep {
  flex: none;
  margin: 0 5px;
  font-size: 11px;
  color: var(--muted-soft);
  user-select: none;
}
.layers-panel .select-item .select-item__size {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.layers-panel .select-item .select-item__name {
  display: none;
  width: 100%;
  box-sizing: border-box;
  font: inherit;
  font-size: 10px;
  font-weight: 500;
  color: var(--ink);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 2px 4px;
  outline: none;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.layers-panel .select-item .select-item__name::placeholder {
  color: var(--muted-soft);
  font-weight: 400;
}
.layers-panel .select-item .select-item__name:focus {
  display: block;
  background: var(--surface-card);
  border-color: color-mix(in srgb, var(--primary) 40%, transparent);
}
.layers-panel .select-item:hover .select-item__name, .layers-panel .select-item.line-item--focused .select-item__name, .layers-panel .select-item:focus-within .select-item__name {
  display: block;
}
.layers-panel .select-item .line-item__remove {
  margin-top: 1px;
}

#select-list.layers-panel__list {
  padding: 3px;
  gap: 1px;
  min-height: 36px;
  border-radius: 8px;
  background: transparent;
  border-color: color-mix(in srgb, var(--hairline-soft) 80%, transparent);
}

.layers-panel .line-pair-hint {
  font-size: 9px;
  letter-spacing: 0.06em;
  color: var(--primary);
  opacity: 0.72;
  font-weight: 500;
  margin-left: 24px;
  padding-left: 0;
  display: block;
  line-height: 1.3;
}

.layers-panel .empty-hint,
.mode-panel .empty-hint {
  list-style: none;
  padding: 16px 10px;
  font-size: 11px;
  color: var(--muted-soft);
  text-align: center;
  font-style: normal;
  letter-spacing: 0.01em;
  border: none;
  border-radius: 6px;
  background: transparent;
  display: block;
  margin: 0;
}
.layers-panel .empty-hint::before,
.mode-panel .empty-hint::before {
  display: none;
}

.settings-modal {
  position: fixed;
  inset: 0;
  z-index: 8500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  font-family: "Inter", sans-serif;
}
.settings-modal[hidden] {
  display: none;
}
.settings-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(var(--canvas-deep-rgb), 0.42);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 0.25s ease;
}
.settings-modal__card {
  position: relative;
  z-index: 1;
  width: min(620px, 100%);
  max-height: min(88vh, 640px);
  display: flex;
  flex-direction: column;
  background: var(--surface-card);
  border: 1px solid var(--hairline-soft);
  border-radius: 16px;
  box-shadow: 0 28px 56px -16px rgba(var(--ink-rgb), 0.2), 0 10px 24px -10px rgba(var(--ink-rgb), 0.08);
  overflow: hidden;
  transform: translateY(12px) scale(0.98);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
}
.settings-modal.is-open .settings-modal__backdrop {
  opacity: 1;
}
.settings-modal.is-open .settings-modal__card {
  transform: translateY(0) scale(1);
  opacity: 1;
}
.settings-modal__head {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "main   close" "tabs   tabs";
  align-items: start;
  gap: 14px 12px;
  padding: 18px 18px 0;
  border-bottom: 1px solid var(--hairline-soft);
  flex: none;
}
.settings-modal__head-main {
  grid-area: main;
  min-width: 0;
}
.settings-modal__title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.settings-modal__title svg {
  flex-shrink: 0;
  color: var(--muted-soft);
}
.settings-modal__sub {
  margin: 4px 0 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
}
.settings-modal__close {
  grid-area: close;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.settings-modal__close:hover {
  background: var(--canvas-soft);
  color: var(--ink);
}
.settings-modal__tabs {
  grid-area: tabs;
  display: flex;
  align-items: stretch;
  gap: 0;
  margin: 0;
  padding: 0;
  border-bottom: none;
  width: 100%;
}
.settings-modal__tab {
  position: relative;
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 12px;
  margin-bottom: -1px;
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font: 500 13px/1 "Inter", sans-serif;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.settings-modal__tab svg {
  width: 14px;
  height: 14px;
  opacity: 0.55;
  flex-shrink: 0;
  transition: opacity 0.15s ease;
}
.settings-modal__tab:hover {
  color: var(--ink);
}
.settings-modal__tab:hover svg {
  opacity: 0.85;
}
.settings-modal__tab.is-active {
  color: var(--ink);
  font-weight: 600;
  border-bottom-color: var(--ink);
}
.settings-modal__tab.is-active svg {
  opacity: 1;
}
.settings-modal__scroll {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 18px 20px;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--hairline-soft) transparent;
}
.settings-modal__scroll::-webkit-scrollbar {
  width: 5px;
}
.settings-modal__scroll::-webkit-scrollbar-thumb {
  background: var(--hairline);
  border-radius: 4px;
}
.settings-modal__pane {
  animation: settingsModalFade 0.22s ease;
}
.settings-modal__pane[hidden] {
  display: none;
}
@keyframes settingsModalFade {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@media (max-width: 640px) {
  .settings-modal__card {
    max-height: calc(100vh - 32px);
    border-radius: 14px;
  }
  .settings-modal__scroll {
    padding: 14px 14px 18px;
  }
  .settings-modal .advanced-grid {
    grid-template-columns: 1fr;
  }
  .settings-modal .advanced-col--fill {
    grid-column: auto;
    grid-row: auto;
  }
  .settings-modal .form-row--4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.crop-app:has(.settings-modal.is-open) #btn-open-settings {
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 10%, transparent);
  border-color: color-mix(in srgb, var(--primary) 40%, transparent);
}

.multi-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  margin: 0 0 6px;
  border-radius: 8px;
  background: rgba(var(--primary-rgb), 0.06);
  border: 1px solid rgba(var(--primary-rgb), 0.14);
  font-size: 11px;
  color: var(--ink);
}
.multi-bar__count {
  flex: 1 1 auto;
  font-weight: 600;
  font-size: 11px;
  color: var(--primary);
}
.multi-bar__btn {
  flex: none;
  background: var(--surface-card);
  border: 1px solid var(--hairline-soft);
  color: var(--ink);
  font-size: 10px;
  font-weight: 500;
  padding: 4px 7px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.12s ease;
}
.multi-bar__btn:hover {
  background: var(--canvas-soft);
  border-color: var(--hairline);
}
.multi-bar__btn--danger {
  color: var(--semantic-error, #e05656);
  border-color: color-mix(in srgb, var(--semantic-error, #e05656) 28%, transparent);
}
.multi-bar__btn--danger:hover {
  background: color-mix(in srgb, var(--semantic-error, #e05656) 10%, transparent);
  border-color: var(--semantic-error, #e05656);
}

.crop-region-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  margin-left: 2px;
  border-radius: 99px;
  font-size: 10px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--on-primary);
  background: rgba(var(--ink-rgb), 0.72);
  border: 1px solid rgba(var(--surface-card-rgb), 0.35);
}
.crop-region-count[hidden] {
  display: none !important;
}

@media (max-width: 767px) {
  .crop-toolbar__action-btn .crop-region-count:not([hidden]) {
    display: none;
  }
}
#select-rotation-cluster[hidden] {
  display: none !important;
}

@media (max-width: 767px) {
  .crop-app {
    --crop-mobile-footer-h: calc(52px + env(safe-area-inset-bottom, 0px));
    --crop-mobile-dock-h: 44px;
    --crop-mobile-dock-gap: 8px;
    --crop-mobile-dock-bottom: calc(var(--crop-mobile-footer-h) + var(--crop-mobile-dock-gap));
  }
  .crop-footer {
    height: auto;
    min-height: var(--crop-mobile-footer-h);
    padding: 6px 10px;
    align-items: stretch;
  }
  .crop-footer .footer-content {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }
  .crop-footer .footer-status {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
    mask-image: linear-gradient(90deg, transparent, #000 6px, #000 calc(100% - 6px), transparent);
  }
  .crop-footer .footer-status::-webkit-scrollbar {
    display: none;
  }
  .crop-footer .footer-status-item {
    flex-shrink: 0;
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid var(--hairline-soft);
    background: var(--canvas-soft);
    font-size: 10px;
    font-weight: 500;
    line-height: 1.3;
    white-space: nowrap;
  }
  .crop-footer .footer-status-item::after {
    display: none;
  }
  .crop-footer .footer-status-item#status-zoom {
    display: none;
  }
  .crop-footer .footer-text {
    display: none;
  }
  .crop-zoom-float {
    position: fixed;
    left: 50%;
    right: auto;
    bottom: var(--crop-mobile-dock-bottom);
    transform: translateX(-50%);
    z-index: 8003;
    height: var(--crop-mobile-dock-h);
    padding: 0 8px;
    margin: 0;
    border-radius: 999px;
    background: color-mix(in srgb, var(--surface-card) 96%, transparent);
    box-shadow: 0 1px 0 rgba(var(--surface-card-rgb), 0.8) inset, 0 6px 20px rgba(var(--ink-rgb), 0.12);
  }
  .crop-zoom-float .zoom-btns {
    gap: 2px;
    height: 100%;
  }
  .crop-zoom-float .btn-sm {
    width: 34px;
    height: 34px;
    min-width: 34px;
    padding: 0;
    border-radius: 999px;
  }
  .crop-zoom-float #zoom-level {
    min-width: 42px;
    font-size: 11px;
    font-weight: 600;
  }
  .crop-zoom-float #btn-zoom-fit {
    display: none;
  }
  .crop-side-handle,
  .crop-side-handle--right {
    top: auto;
    bottom: var(--crop-mobile-dock-bottom);
    width: auto;
    min-width: 44px;
    max-width: 88px;
    height: var(--crop-mobile-dock-h);
    flex-direction: row;
    gap: 5px;
    padding: 0 10px;
    border: 1px solid var(--hairline-soft);
    border-radius: 999px;
    background: color-mix(in srgb, var(--surface-card) 96%, transparent);
    box-shadow: 0 1px 0 rgba(var(--surface-card-rgb), 0.8) inset, 0 6px 20px rgba(var(--ink-rgb), 0.1);
    z-index: 8002;
  }
  .crop-side-handle::before,
  .crop-side-handle--right::before {
    display: none;
  }
  .crop-side-handle {
    left: 10px;
    right: auto;
  }
  .crop-side-handle--right {
    right: 10px;
    left: auto;
  }
  .crop-side-handle__glyph {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
  }
  .crop-side-handle__label {
    position: static;
    transform: none;
    padding: 0;
    border: none;
    background: transparent;
    box-shadow: none;
    opacity: 1;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: auto;
  }
  .crop-side-handle:hover,
  .crop-side-handle--right:hover {
    width: auto;
    max-width: 88px;
    transform: translateY(-1px);
  }
  .crop-side-handle:active,
  .crop-side-handle--right:active {
    transform: translateY(0) scale(0.98);
  }
  .crop-app:has(.mode-panel.is-open) #crop-side-handle,
  body:has(.mode-panel.is-open) #crop-side-handle,
  .crop-app:has(.layers-panel.is-open) #crop-layers-handle,
  body:has(.layers-panel.is-open) #crop-layers-handle {
    transform: translateY(8px);
  }
  .mode-panel,
  .layers-panel {
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    top: auto !important;
    margin-top: 0 !important;
    bottom: 0;
    height: min(72vh, 560px);
    max-height: calc(100dvh - 56px - 8px);
    border-radius: 14px 14px 0 0;
    border-left: none;
    border-right: none;
    border-bottom: none;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    transform: translateY(100%) !important;
    transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .mode-panel.is-open,
  .layers-panel.is-open {
    transform: translateY(0) !important;
  }
  .mode-panel .mode-panel__head,
  .mode-panel .layers-panel__head,
  .layers-panel .mode-panel__head,
  .layers-panel .layers-panel__head {
    position: relative;
    padding-top: 16px;
  }
  .mode-panel .mode-panel__head::before,
  .mode-panel .layers-panel__head::before,
  .layers-panel .mode-panel__head::before,
  .layers-panel .layers-panel__head::before {
    content: "";
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 4px;
    border-radius: 99px;
    background: var(--hairline);
  }
  .crop-stage .canvas-wrapper {
    padding-bottom: calc(var(--crop-mobile-dock-bottom) + var(--crop-mobile-dock-h) + 16px);
  }
  .crop-toolbar .select-rotation-control {
    padding: 4px 8px;
    gap: 6px;
  }
  .crop-toolbar .select-rotation-control .setting-slider {
    width: 64px;
  }
}
@media (max-width: 380px) {
  .crop-side-handle__label {
    display: none;
  }
  .crop-side-handle,
  .crop-side-handle--right {
    max-width: 44px;
    padding: 0;
    justify-content: center;
  }
  .crop-zoom-float #zoom-level {
    min-width: 36px;
    font-size: 10px;
  }
}
.line-name-input {
  width: 72px;
  padding: 1px 4px;
  font-size: 11px;
  border: 1px solid var(--hairline);
  border-radius: 3px;
  background: var(--surface-strong);
  color: var(--ink);
  outline: none;
  margin: 0 4px;
  flex: none;
}
.line-name-input:focus {
  border-color: var(--primary);
  background: var(--surface-card);
}
