.tool-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 40px;
  background: var(--surface-card);
  border-bottom: 1px solid var(--hairline-soft);
  flex-shrink: 0;
}

.tool-nav-inner {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 12px;
  gap: 8px;
}

.tool-nav-back {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
  padding: 4px 8px;
  border-radius: 8px;
  transition: all 0.15s ease;
  flex-shrink: 0;
}
.tool-nav-back:hover {
  color: var(--ink);
  background: var(--surface-strong);
}

.tool-nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: 8px;
  padding-left: 8px;
  border-left: 1px solid var(--hairline-soft);
}

.tool-nav-link {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  padding: 4px 10px;
  border-radius: 8px;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.tool-nav-link:hover {
  color: var(--ink);
  background: var(--surface-strong);
}
.tool-nav-link.active {
  color: var(--primary);
  background: rgba(var(--primary-rgb), 0.1);
  font-weight: 600;
}

.tool-nav-spacer {
  flex: 1;
}

.tool-nav-theme {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}
.tool-nav-theme:hover {
  background: var(--surface-strong);
  color: var(--ink);
}
.tool-nav-theme .theme-icon-sun,
.tool-nav-theme .theme-icon-moon {
  width: 16px;
  height: 16px;
}

body.has-tool-nav #app {
  padding-top: 0;
}

.tool-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--canvas-soft);
}

.tool-page-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 24px;
  background: var(--surface-card);
  border-bottom: 1px solid var(--hairline-soft);
  flex-shrink: 0;
}

.tool-page-back {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--hairline);
  background: var(--surface-card);
  color: var(--ink);
  text-decoration: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.tool-page-back svg {
  width: 18px;
  height: 18px;
}
.tool-page-back:hover {
  background: var(--primary);
  color: var(--on-primary);
  border-color: var(--primary);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.25);
}

.tool-page-title {
  font-family: "Waldenburg", "Times New Roman", serif;
  font-size: 22px;
  font-weight: 300;
  color: var(--ink);
  letter-spacing: -0.5px;
}

.tool-page-body {
  flex: 1;
  display: flex;
  gap: 0;
  overflow: hidden;
}

.tool-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px;
  gap: 24px;
  overflow-y: auto;
}

.tool-sidebar {
  width: 300px;
  background: var(--surface-card);
  border-left: 1px solid var(--hairline-soft);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow-y: auto;
  flex-shrink: 0;
}

.tool-sidebar-left {
  border-left: none;
  border-right: 1px solid var(--hairline-soft);
}

.drop-zone {
  width: 100%;
  max-width: 560px;
  min-height: 200px;
  border: 2px dashed var(--hairline-strong);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 48px 24px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  background: var(--surface-card);
  color: var(--muted);
  position: relative;
}
.drop-zone svg {
  width: 48px;
  height: 48px;
  opacity: 0.5;
  transition: all 0.3s ease;
}
.drop-zone:hover, .drop-zone.dragover {
  border-color: var(--primary);
  background: rgba(var(--primary-rgb), 0.04);
  color: var(--ink);
}
.drop-zone:hover svg, .drop-zone.dragover svg {
  opacity: 1;
  color: var(--primary);
}
.drop-zone p {
  font-size: 15px;
  font-weight: 500;
}
.drop-zone .drop-hint {
  font-size: 13px;
  color: var(--muted-soft);
}
.drop-zone input[type=file] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.preview-area {
  width: 100%;
  max-width: 600px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.preview-area canvas, .preview-area img {
  max-width: 100%;
  max-height: 400px;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(var(--ink-rgb), 0.06);
  border: 1px solid var(--hairline-soft);
  background: var(--surface-card);
}

.compared-preview {
  display: flex;
  gap: 24px;
  width: 100%;
  max-width: 800px;
  flex-wrap: wrap;
  justify-content: center;
}

.compare-card {
  flex: 1;
  min-width: 250px;
  background: var(--surface-card);
  border: 1px solid var(--hairline-soft);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px;
  gap: 12px;
}
.compare-card-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--muted-soft);
}
.compare-card canvas, .compare-card img {
  max-width: 100%;
  max-height: 280px;
  border-radius: 6px;
}
.compare-card-info {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.control-group label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--muted-soft);
}

.control-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.control-slider {
  flex: 1;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--hairline-strong);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
.control-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  border: 2px solid var(--surface-card);
  box-shadow: 0 1px 4px rgba(var(--ink-rgb), 0.15);
}

.control-select {
  padding: 8px 28px 8px 12px;
  border: 1px solid var(--hairline-strong);
  border-radius: 9999px;
  background: var(--surface-card);
  color: var(--ink);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  transition: border-color 0.2s ease;
}
.control-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
}

.control-input {
  padding: 8px 14px;
  border: 1px solid var(--hairline-strong);
  border-radius: 9999px;
  background: var(--surface-card);
  color: var(--ink);
  font-size: 13px;
  font-family: inherit;
  width: 80px;
  text-align: center;
  transition: border-color 0.2s ease;
}
.control-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
}

.control-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  min-width: 42px;
  text-align: right;
  white-space: nowrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border: 1px solid var(--hairline-strong);
  border-radius: 9999px;
  background: var(--surface-card);
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(var(--ink-rgb), 0.08);
}

.btn-primary {
  background: var(--primary);
  color: var(--on-primary);
  border-color: var(--primary);
  font-weight: 500;
}
.btn-primary:hover:not(:disabled) {
  background: var(--primary-active);
  border-color: var(--primary-active);
  box-shadow: 0 8px 24px rgba(var(--primary-rgb), 0.25);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 12px;
  gap: 4px;
}
.btn-sm svg {
  width: 14px;
  height: 14px;
}

.btn-block {
  width: 100%;
  justify-content: center;
}

.empty-state {
  text-align: center;
  color: var(--muted);
  padding: 48px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.empty-state svg {
  width: 64px;
  height: 64px;
  opacity: 0.3;
  transition: opacity 0.3s ease;
}
.empty-state:hover svg {
  opacity: 0.45;
}
.empty-state p {
  font-size: 20px;
  font-weight: 300;
  color: var(--ink);
  letter-spacing: -0.5px;
  margin: 0;
}
.empty-state .empty-hint-sub {
  font-size: 14px;
  color: var(--muted);
  margin: 0;
  line-height: 1.5;
}
.empty-state .empty-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 18px;
}

.result-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  background: var(--surface-card);
  border: 1px solid var(--hairline-soft);
  border-radius: 12px;
  font-size: 13px;
  color: var(--muted);
}
.result-bar strong {
  color: var(--ink);
}
.result-bar .saved {
  color: var(--semantic-success);
  font-weight: 600;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--hairline-strong);
}
.status-dot.done {
  background: var(--semantic-success);
}
.status-dot.working {
  background: var(--primary);
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.4;
  }
}
@media (max-width: 768px) {
  .tool-page-body {
    flex-direction: column;
  }
  .tool-sidebar {
    width: 100%;
    border-left: none;
    border-top: 1px solid var(--hairline-soft);
    max-height: 40vh;
  }
  .tool-main {
    padding: 20px;
  }
  .compared-preview {
    flex-direction: column;
  }
  .tool-page-header {
    padding: 12px 16px;
  }
}
@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(-8px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
@keyframes pulseBadge {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(var(--primary-rgb), 0.25);
  }
  50% {
    box-shadow: 0 0 0 4px rgba(var(--primary-rgb), 0);
  }
}
@keyframes badgeBounce {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.2);
  }
}
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Inter", sans-serif;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.14px;
  line-height: 1.5;
  background: var(--canvas);
  color: var(--ink);
  min-height: 100vh;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  margin: 0;
  padding: 0;
  padding-top: env(safe-area-inset-top);
}

#app {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  padding-top: env(safe-area-inset-top);
}

select, input {
  user-select: auto;
}

select {
  -webkit-appearance: none;
  appearance: none;
  background: var(--surface-card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23777169' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center;
  border: 1px solid var(--hairline-strong);
  border-radius: 9999px;
  color: var(--ink);
  font-size: 13px;
  padding: 10px 32px 10px 14px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s ease;
}
select:hover {
  border-color: var(--hairline-strong);
  background-color: var(--surface-strong);
}
select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(var(--primary-rgb), 0.15);
}
select option {
  background: var(--surface-card);
  color: var(--ink);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border: 1px solid var(--hairline);
  border-radius: 9999px;
  background: var(--surface-card);
  color: var(--ink);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: 0.2px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}
.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.05), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.btn:hover:not(:disabled, .active) {
  background: var(--surface-strong);
  border-color: var(--hairline-strong);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}
.btn:hover:not(:disabled, .active)::before {
  opacity: 1;
}
.btn:active:not(:disabled) {
  background: var(--hairline-soft);
  border-color: var(--hairline);
  transform: translateY(0);
  box-shadow: none;
}
.btn:focus:not(:disabled) {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
}
.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  border-color: var(--hairline);
  transform: none;
}
.btn svg {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.btn:hover:not(:disabled) svg {
  transform: scale(1.1);
}
.btn span {
  line-height: 1;
}

.btn-primary {
  background: var(--ink);
  color: var(--on-primary);
  border-color: var(--ink);
  font-weight: 600;
  letter-spacing: 0.3px;
}
.btn-primary::before {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), transparent);
}
.btn-primary:hover:not(:disabled) {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--on-primary);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(163, 230, 53, 0.25);
}
.btn-primary:active:not(:disabled) {
  background: var(--primary-active);
  border-color: var(--primary-active);
  transform: translateY(0);
  box-shadow: none;
}

.btn-accent {
  background: linear-gradient(135deg, var(--primary), rgba(var(--primary-rgb), 0.9));
  color: var(--on-primary);
  border-color: var(--primary);
  font-weight: 600;
  letter-spacing: 0.3px;
  box-shadow: 0 2px 8px rgba(163, 230, 53, 0.2);
}
.btn-accent:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--primary-active), var(--primary));
  border-color: var(--primary-active);
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(163, 230, 53, 0.35);
}
.btn-accent:active:not(:disabled) {
  background: var(--primary);
  border-color: var(--primary);
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(163, 230, 53, 0.2);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
  padding: 8px 12px;
  font-weight: 500;
}
.btn-ghost:hover:not(:disabled) {
  background: var(--surface-strong);
  color: var(--ink);
  border-color: transparent;
  transform: translateY(-1px);
}
.btn-ghost:active:not(:disabled) {
  background: var(--hairline-soft);
  transform: translateY(0);
}

.btn-danger {
  color: var(--semantic-error);
  border-color: rgba(var(--semantic-error-rgb), 0.3);
  background: rgba(var(--semantic-error-rgb), 0.08);
}
.btn-danger:hover:not(:disabled) {
  background: rgba(var(--semantic-error-rgb), 0.12);
  color: var(--semantic-error);
  border-color: rgba(var(--semantic-error-rgb), 0.5);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(var(--semantic-error-rgb), 0.15);
}
.btn-danger:active:not(:disabled) {
  background: rgba(var(--semantic-error-rgb), 0.18);
  transform: translateY(0);
}

.btn-tool {
  width: 38px;
  height: 38px;
  justify-content: center;
  padding: 8px;
  border-radius: 50%;
  border: 1px solid var(--hairline);
  background: var(--surface-card);
  color: var(--muted);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  margin: 0 auto;
}
.btn-tool svg {
  width: 18px;
  height: 18px;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.btn-tool:hover:not(:disabled) {
  background: var(--primary);
  color: var(--on-primary);
  border-color: var(--primary);
  transform: translateY(-2px) scale(1.08);
  box-shadow: 0 6px 16px rgba(163, 230, 53, 0.25);
}
.btn-tool:active:not(:disabled) {
  background: var(--primary-active);
  border-color: var(--primary-active);
  transform: translateY(0) scale(1);
  box-shadow: none;
}

.btn-tool.btn-danger {
  border-color: rgba(var(--semantic-error-rgb), 0.3);
  color: var(--semantic-error);
}
.btn-tool.btn-danger:hover:not(:disabled) {
  background: var(--semantic-error);
  color: var(--on-primary);
  border-color: var(--semantic-error);
  box-shadow: 0 6px 16px rgba(var(--semantic-error-rgb), 0.3);
}
.btn-tool.btn-danger:active:not(:disabled) {
  background: rgba(var(--semantic-error-rgb), 0.85);
  border-color: var(--semantic-error);
}

.btn-sm {
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 500;
  min-width: 28px;
  height: 28px;
  font-family: inherit;
  border-radius: 9999px;
}

.btn-icon-btn {
  width: 36px;
  height: 36px;
  padding: 6px;
  justify-content: center;
  border: 1px solid var(--hairline);
  background: var(--surface-card);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.btn-icon-btn svg {
  width: 18px;
  height: 18px;
  color: var(--muted);
  transition: color 0.2s ease;
}
.btn-icon-btn:hover:not(:disabled) {
  background: var(--ink);
  border-color: var(--ink);
  transform: translateY(-1px) scale(1.05);
  box-shadow: 0 4px 12px rgba(var(--ink-rgb), 0.15);
}
.btn-icon-btn:hover:not(:disabled) svg {
  color: var(--on-primary);
}
.btn-icon-btn:active:not(:disabled) {
  background: var(--primary-active);
  border-color: var(--primary-active);
  transform: translateY(0) scale(1);
  box-shadow: none;
}

.split-line-btns {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.btn-block {
  width: 100%;
  justify-content: center;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0;
}

.btn-mode {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
  border-radius: 9999px;
  padding: 9px 18px;
  font-weight: 500;
  letter-spacing: 0.2px;
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.btn-mode::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(var(--gradient-mint-rgb), 0.08), rgba(var(--gradient-peach-rgb), 0.05));
  opacity: 0;
  transition: opacity 0.3s ease;
}
.btn-mode.active {
  background: linear-gradient(135deg, var(--ink), rgba(var(--ink-rgb), 0.95));
  color: var(--on-primary);
  border-color: var(--ink);
  box-shadow: 0 4px 12px rgba(var(--ink-rgb), 0.15);
  transform: translateY(-1px);
}
.btn-mode.active svg {
  color: var(--on-primary);
}
.btn-mode.active::before {
  opacity: 0;
}
.btn-mode:not(.active):hover:not(:disabled) {
  background: var(--surface-strong);
  color: var(--ink);
  border-color: var(--hairline);
  transform: translateY(-1px);
}
.btn-mode:not(.active):hover:not(:disabled)::before {
  opacity: 1;
}
.btn-mode:active:not(.active) {
  transform: translateY(0);
}

.input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--hairline-strong);
  border-radius: 8px;
  background: var(--surface-card);
  color: var(--ink);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}
.input::placeholder {
  color: var(--muted-soft);
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  padding: 0 20px;
  background: linear-gradient(135deg, rgba(var(--surface-card-rgb), 0.9) 0%, rgba(var(--surface-card-rgb), 0.85) 100%);
  backdrop-filter: blur(20px) saturate(1.2);
  border-bottom: 1px solid var(--hairline-soft);
  gap: 12px;
  flex-shrink: 0;
}
.toolbar .sidebar-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: var(--surface-strong);
  border-radius: 8px;
  cursor: pointer;
  color: var(--ink);
  transition: all 0.15s ease;
}
.toolbar .sidebar-toggle:hover {
  background: var(--primary);
  color: var(--on-primary);
}
.toolbar .toolbar-back {
  display: flex;
  align-items: center;
  margin-right: auto;
  position: relative;
}
.toolbar .toolbar-back .btn-back {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  color: var(--ink);
  text-decoration: none;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--surface-strong) 0%, var(--surface-card) 100%);
  border: 1px solid var(--hairline);
  box-shadow: 0 2px 8px rgba(var(--ink-rgb), 0.06), 0 1px 2px rgba(var(--ink-rgb), 0.04);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
}
.toolbar .toolbar-back .btn-back:hover {
  background: var(--primary);
  color: var(--on-primary);
  border-color: var(--primary);
  box-shadow: 0 4px 16px rgba(var(--primary-rgb), 0.25);
  transform: translateY(-2px);
}
.toolbar .toolbar-back .btn-back:active {
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(var(--ink-rgb), 0.08);
}
.toolbar .toolbar-back .btn-back:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.toolbar .toolbar-back .btn-back svg {
  width: 20px;
  height: 20px;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.open .toolbar .toolbar-back .btn-back {
  background: var(--primary);
  color: var(--on-primary);
  border-color: var(--primary);
}

.nav-menu-wrap {
  position: relative;
}

.nav-menu-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 200px;
  background: rgba(var(--surface-card-rgb), 0.96);
  border: 1px solid var(--hairline-soft);
  border-radius: 16px;
  box-shadow: 0 0 0 1px rgba(var(--ink-rgb), 0.03), 0 8px 16px -4px rgba(var(--ink-rgb), 0.08), 0 24px 48px -8px rgba(var(--ink-rgb), 0.12);
  padding: 6px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(0.97);
  transform-origin: top left;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
  backdrop-filter: blur(24px) saturate(1.3);
  z-index: 1000;
}
.open .nav-menu-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

.nav-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.nav-menu-item svg {
  width: 16px;
  height: 16px;
  opacity: 0.6;
  flex-shrink: 0;
}
.nav-menu-item:hover {
  background: rgba(var(--primary-rgb), 0.08);
  color: var(--primary);
}
.nav-menu-item:hover svg {
  opacity: 1;
}
.nav-menu-item.active {
  background: rgba(var(--primary-rgb), 0.1);
  color: var(--primary);
  font-weight: 600;
}
.nav-menu-item.active svg {
  opacity: 1;
}
.nav-menu-item--home {
  color: var(--muted);
}
.nav-menu-item--home:hover {
  color: var(--primary);
}

.nav-menu-divider {
  height: 1px;
  background: var(--hairline-soft);
  margin: 4px 8px;
}

.toolbar {
  position: relative;
  z-index: 10;
  box-shadow: 0 1px 8px rgba(var(--ink-rgb), 0.03);
}

.toolbar::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(var(--gradient-mint-rgb), 0.3), rgba(var(--gradient-peach-rgb), 0.2), transparent);
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.toolbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.toolbar-divider {
  width: 1px;
  height: 28px;
  background: linear-gradient(to bottom, transparent, var(--hairline-strong), transparent);
  margin: 0 8px;
  flex-shrink: 0;
}

.main-area {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.sidebar {
  width: 280px;
  background: var(--canvas-soft);
  border-right: 1px solid var(--hairline-soft);
  overflow-y: auto;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  padding: 12px;
  gap: 12px;
}

.sidebar-right {
  border-right: none;
  border-left: 1px solid var(--hairline-soft);
}

.sidebar-section {
  padding: 16px;
  border: 1px solid var(--hairline-soft);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--surface-card);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.sidebar-section:hover {
  border-color: var(--hairline);
}
.sidebar-section.actions {
  margin-top: auto;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--hairline-soft);
  background: var(--surface-card);
}

.sidebar-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.96px;
  color: var(--muted-soft);
  text-transform: uppercase;
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.sidebar-title::before {
  content: "";
  display: inline-block;
  width: 16px;
  height: 1px;
  background: var(--hairline-strong);
}

.shape-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 4px;
}

.btn-shape {
  width: 100%;
  aspect-ratio: 1;
  padding: 0;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--canvas-soft);
  border: 1px solid var(--hairline-soft);
  color: var(--muted);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}
.btn-shape:hover {
  background: var(--surface-strong);
  color: var(--ink);
  border-color: var(--hairline-strong);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(var(--ink-rgb), 0.06);
}
.btn-shape:hover::after {
  opacity: 1;
  transform: translateY(0);
}
.btn-shape.active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--on-primary);
  box-shadow: 0 4px 12px rgba(var(--ink-rgb), 0.15);
}
.btn-shape::after {
  content: attr(title);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: var(--ink);
  color: var(--on-primary);
  font-size: 11px;
  font-weight: 500;
  padding: 5px 10px;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 10;
  letter-spacing: 0;
}
.btn-shape svg {
  width: 18px;
  height: 18px;
}

.line-list {
  list-style: none;
  font-size: 13px;
}
.line-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  color: var(--ink);
  border: 1px solid transparent;
  margin-bottom: 2px;
  animation: slideInRight 0.3s ease backwards;
}
.line-list li:hover {
  background: var(--canvas-soft);
  border-color: var(--hairline-soft);
}
.line-list li.line-item--focused {
  outline: none;
  border-color: rgba(var(--primary-rgb), 0.3);
  background: rgba(var(--primary-rgb), 0.04);
}
.line-list li.active {
  background: rgba(var(--primary-rgb), 0.08);
  border-color: var(--primary);
}
.line-list li .line-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  flex-wrap: wrap;
}
.line-list li .line-pair-hint {
  font-size: 10px;
  font-weight: 500;
  color: var(--muted-soft);
  margin-left: 2px;
  white-space: nowrap;
}
.line-list li .line-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 10px;
  color: var(--on-primary);
  background: var(--ink);
  border-radius: 4px;
}
.line-list li .line-delete {
  opacity: 0;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  padding: 4px 6px;
  border-radius: 4px;
  transition: all 0.15s ease;
  line-height: 1;
  border: none;
  background: transparent;
}
.line-list li .line-delete:hover {
  opacity: 1 !important;
  color: var(--semantic-error);
  background: rgba(var(--semantic-error-rgb), 0.08);
}
.line-list li:hover .line-delete {
  opacity: 0.6;
}

.batch-queue {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  max-height: 180px;
  overflow-y: auto;
  font-size: 12px;
  color: var(--muted);
}
.batch-queue li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid var(--hairline-soft);
  margin-bottom: 6px;
  gap: 8px;
  background: var(--surface-card);
  transition: all 0.2s ease;
}
.batch-queue li:hover {
  border-color: var(--hairline);
}
.batch-queue .batch-remove {
  flex-shrink: 0;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.15s ease;
}
.batch-queue .batch-remove:hover {
  background: rgba(var(--semantic-error-rgb), 0.1);
  color: var(--semantic-error);
}

.empty-hint {
  color: var(--muted-soft);
  font-size: 13px;
  text-align: center;
  padding: 20px 12px;
  line-height: 1.5;
}
.empty-hint .empty-hint-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 8px 16px;
  background: var(--surface-strong);
  border: 1px solid var(--hairline-soft);
  border-radius: 9999px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}
.empty-hint .empty-hint-action:hover {
  background: var(--ink);
  color: var(--on-primary);
  border-color: var(--ink);
}

.image-info-body .info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid var(--hairline-soft);
}
.image-info-body .info-row:last-child {
  border-bottom: none;
}
.image-info-body .info-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted-soft);
  flex-shrink: 0;
}
.image-info-body .info-value {
  font-size: 12px;
  color: var(--muted);
  text-align: right;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 400;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  cursor: pointer;
}

.toggle-switch .toggle-slider {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--hairline);
  border: 1px solid var(--hairline-strong);
  border-radius: 11px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.toggle-switch .toggle-slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 2px;
  bottom: 2px;
  background: var(--surface-card);
  border-radius: 50%;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 1px 3px rgba(var(--ink-rgb), 0.1);
}

.toggle-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}
.toggle-label input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-label input:checked + .toggle-switch .toggle-slider {
  background: var(--primary);
  border-color: var(--primary);
}
.toggle-label input:checked + .toggle-switch .toggle-slider:before {
  transform: translateX(18px);
  background: var(--surface-card);
}

.snap-controls .setting-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0;
}

.sidebar-section .setting-item {
  margin-bottom: 14px;
}
.sidebar-section .setting-item:last-child {
  margin-bottom: 0;
}
.sidebar-section .setting-label {
  display: flex;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted-soft);
  text-transform: uppercase;
  letter-spacing: 0.96px;
  margin-bottom: 8px;
  align-items: center;
}
.sidebar-section .setting-select-wrapper {
  position: relative;
  width: 100%;
}
.sidebar-section .setting-select-wrapper select {
  width: 100%;
  padding: 10px 32px 10px 14px;
  background: var(--surface-strong);
  border: 1px solid var(--hairline-soft);
  border-radius: 8px;
  color: var(--ink);
  font-size: 14px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  font-family: inherit;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: inset 0 1px 2px rgba(var(--ink-rgb), 0.04);
}
.sidebar-section .setting-select-wrapper select:hover {
  border-color: var(--hairline-strong);
  background: var(--surface-card);
}
.sidebar-section .setting-select-wrapper select:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--surface-card);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
}
.sidebar-section .setting-select-wrapper select option {
  background: var(--surface-card);
  color: var(--ink);
  padding: 8px;
}
.sidebar-section .setting-select-wrapper::after {
  content: "";
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 4px solid var(--muted);
  pointer-events: none;
  z-index: 1;
}
.sidebar-section .setting-input {
  width: 100%;
  padding: 10px 14px;
  background: var(--surface-strong);
  border: 1px solid var(--hairline-soft);
  border-radius: 8px;
  color: var(--ink);
  font-size: 14px;
  font-family: inherit;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: inset 0 1px 2px rgba(var(--ink-rgb), 0.04);
}
.sidebar-section .setting-input:hover {
  border-color: var(--hairline-strong);
  background: var(--surface-card);
}
.sidebar-section .setting-input:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--surface-card);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
}
.sidebar-section .quality-slider {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
}
.sidebar-section .quality-slider input[type=range] {
  flex: 1;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--hairline);
  border-radius: 9999px;
  outline: none;
  cursor: pointer;
  transition: all 0.15s ease;
}
.sidebar-section .quality-slider input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  background: var(--surface-card);
  border: 2px solid var(--primary);
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 6px rgba(var(--ink-rgb), 0.15);
}
.sidebar-section .quality-slider input[type=range]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.25);
}
.sidebar-section .quality-slider input[type=range]::-webkit-slider-thumb:active {
  transform: scale(0.95);
}
.sidebar-section .quality-slider input[type=range]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: var(--surface-card);
  border: 2px solid var(--primary);
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 6px rgba(var(--ink-rgb), 0.15);
}
.sidebar-section .quality-slider span {
  font-size: 13px;
  color: var(--ink);
  min-width: 40px;
  text-align: right;
  font-family: inherit;
  font-weight: 600;
  padding: 4px 8px;
  background: var(--surface-strong);
  border-radius: 6px;
}
.sidebar-section .naming-hint {
  font-size: 11px;
  color: var(--muted-soft);
  margin-top: 6px;
  padding: 6px 10px;
  background: var(--canvas-soft);
  border-radius: 4px;
  font-family: inherit;
  line-height: 1.4;
}

.preset-templates {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--hairline-soft);
}
.preset-templates .template-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted-soft);
  text-transform: uppercase;
  letter-spacing: 0.96px;
  margin-bottom: 0;
  padding-left: 2px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  transition: color 0.2s;
}
.preset-templates .template-title:hover {
  color: var(--ink);
}
.preset-templates .template-title::after {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
  background: var(--muted-soft);
  transition: transform 0.2s ease;
}
.preset-templates.collapsed .template-title {
  margin-bottom: 0;
}
.preset-templates.collapsed .template-title::after {
  transform: rotate(-90deg);
}
.preset-templates.collapsed .template-grid {
  display: none;
}
.preset-templates .template-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 10px;
}
.preset-templates .template-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 6px;
  background: var(--canvas-soft);
  border: 1px solid var(--hairline-soft);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}
.preset-templates .template-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--gradient-mint), var(--gradient-peach));
  opacity: 0;
  transition: opacity 0.3s ease;
}
.preset-templates .template-btn:hover {
  background: var(--surface-strong);
  border-color: var(--hairline-strong);
  transform: translateY(-3px);
  box-shadow: 0 8px 20px -4px rgba(var(--ink-rgb), 0.08);
}
.preset-templates .template-btn:hover::before {
  opacity: 1;
}
.preset-templates .template-btn:hover svg {
  transform: scale(1.05);
}
.preset-templates .template-btn:active {
  transform: scale(0.96) translateY(0);
}
.preset-templates .template-btn svg {
  width: 36px;
  height: 36px;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.preset-templates .template-btn span {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.2px;
}

.canvas-area {
  flex: 1;
  overflow: auto;
  position: relative;
  background: var(--canvas);
  background-image: radial-gradient(ellipse at 30% 20%, rgba(var(--gradient-mint-rgb), 0.08) 0%, transparent 50%), radial-gradient(ellipse at 70% 80%, rgba(var(--gradient-lavender-rgb), 0.06) 0%, transparent 50%), linear-gradient(45deg, rgba(var(--primary-rgb), 0.012) 25%, transparent 25%), linear-gradient(-45deg, rgba(var(--primary-rgb), 0.012) 25%, transparent 25%), linear-gradient(45deg, transparent 75%, rgba(var(--primary-rgb), 0.012) 75%), linear-gradient(-45deg, transparent 75%, rgba(var(--primary-rgb), 0.012) 75%);
  background-size: 100% 100%, 100% 100%, 20px 20px, 20px 20px, 20px 20px, 20px 20px;
  background-position: 0 0, 0 0, 0 0, 0 10px, 10px -10px, -10px 0;
}

.canvas-wrapper {
  position: relative;
  min-width: 100%;
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
}

#main-canvas {
  display: block;
  cursor: crosshair;
  border-radius: 16px;
  border: 1px solid var(--hairline-soft);
  box-shadow: 0 1px 3px rgba(var(--ink-rgb), 0.04), 0 8px 32px -4px rgba(var(--ink-rgb), 0.06);
  background-color: var(--surface-card);
  transition: box-shadow 0.3s ease;
}
#main-canvas:hover {
  box-shadow: 0 1px 3px rgba(var(--ink-rgb), 0.04), 0 12px 40px -4px rgba(var(--ink-rgb), 0.1);
}

.empty-state {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: var(--muted);
  padding: 48px;
  background: var(--surface-card);
  border: 1px solid var(--hairline-soft);
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 4px 16px rgba(0, 0, 0, 0.04);
  transition: all 0.3s ease;
}
.empty-state p {
  font-size: 16px;
  color: var(--ink);
  font-weight: 500;
  line-height: 1.5;
  margin-bottom: 8px;
}
.empty-state .empty-hint-sub {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 24px;
  line-height: 1.5;
}
.empty-state .empty-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.drop-overlay {
  position: absolute;
  inset: 0;
  background: rgba(var(--gradient-mint-rgb), 0.08);
  border: 2px dashed rgba(var(--primary-rgb), 0.3);
  border-radius: 16px;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.canvas-area.dragover .drop-overlay {
  display: flex;
}
.drop-overlay .drop-message {
  text-align: center;
  color: var(--ink);
  padding: 32px;
  background: var(--surface-card);
  border-radius: 16px;
  box-shadow: 0 16px 48px -8px rgba(var(--ink-rgb), 0.1);
}
.drop-overlay .drop-message svg {
  margin-bottom: 12px;
  color: var(--primary);
}
.drop-overlay .drop-message p {
  font-size: 16px;
  font-weight: 500;
  color: var(--ink);
}
.drop-overlay .drop-message .drop-hint {
  font-size: 13px;
  color: var(--muted);
  margin-top: 6px;
}

.zoom-controls .zoom-btns {
  display: flex;
  align-items: center;
  gap: 6px;
}
.zoom-controls .zoom-btns #zoom-level {
  flex: 1;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  font-family: inherit;
  font-weight: 500;
  letter-spacing: 0.5px;
}

.statusbar {
  display: flex;
  align-items: center;
  height: 32px;
  padding: 0 16px;
  background: rgba(var(--surface-card-rgb), 0.9);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--hairline-soft);
  font-size: 12px;
  color: var(--muted);
  gap: 0;
  flex-shrink: 0;
  font-family: inherit;
}
.statusbar .status-segment {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  position: relative;
}
.statusbar .status-segment:not(:last-child)::after {
  content: "";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 16px;
  background: var(--hairline-soft);
}
.statusbar .status-segment::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--hairline-strong);
  transition: background 0.3s ease;
}
.statusbar .status-segment.active::before {
  background: var(--gradient-mint);
}
.statusbar .status-segment.highlight {
  color: var(--ink);
  font-weight: 500;
}
.statusbar .status-segment.highlight::before {
  background: var(--gradient-peach);
}

.crop-result-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  background: var(--gradient-peach);
  color: var(--ink);
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  margin-left: 4px;
}
.crop-result-badge:hover {
  background: var(--gradient-rose);
  transform: scale(1.1);
}

.btn-show-results {
  background: rgba(var(--primary-rgb), 0.06) !important;
  border: 1px solid rgba(var(--primary-rgb), 0.3) !important;
  color: var(--primary) !important;
  animation: pulseBadge 2s ease-in-out infinite;
}
.btn-show-results:hover {
  background: rgba(var(--primary-rgb), 0.1) !important;
  border-color: rgba(var(--primary-rgb), 0.45) !important;
  animation: none;
}
.btn-show-results .crop-result-badge {
  background: var(--gradient-peach);
  color: var(--ink);
  animation: badgeBounce 0.3s ease;
}
.btn-show-results .crop-result-badge:hover {
  background: var(--gradient-rose);
}

.crop-panel-overlay {
  position: fixed;
  inset: 0;
  background: rgba(var(--canvas-deep-rgb), 0.5);
  backdrop-filter: blur(20px) saturate(1.2);
  z-index: 500;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.crop-panel-overlay.active {
  display: flex;
  opacity: 1;
}

.batch-layout-overlay {
  z-index: 510;
}

.batch-layout-modal {
  max-width: 460px;
  border-radius: 24px;
}
.batch-layout-modal .crop-panel-header {
  padding: 20px 24px 16px;
  border-bottom: none;
}
.batch-layout-modal .crop-panel-header h3 {
  font-family: "Waldenburg", "Times New Roman", serif;
  font-size: 24px;
  font-weight: 300;
  letter-spacing: -0.5px;
}

.batch-layout-modal-body {
  padding: 0 24px 24px;
}

.batch-layout-modal-hint {
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
  margin: 0 0 24px;
  padding: 16px 20px;
  background: var(--canvas-soft);
  border-radius: 12px;
  border: 1px solid var(--hairline-soft);
}

.batch-actions--modal {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.batch-layout-modal-btn {
  width: 100%;
  justify-content: center;
  padding: 12px 20px;
  height: 44px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 12px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.batch-layout-modal-btn:hover:not(:disabled) {
  transform: translateY(-1px);
}
.batch-layout-modal-btn--primary {
  margin-top: 4px;
  height: 48px;
  font-size: 15px;
}

.batch-layout-file-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
.batch-layout-file-row .batch-layout-modal-btn {
  margin-bottom: 0;
}

.batch-layout-import-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: center;
}
.batch-layout-import-row .batch-layout-modal-btn {
  margin-bottom: 0;
}

.batch-queue-section {
  margin: 4px 0;
  padding: 16px;
  background: var(--canvas-soft);
  border-radius: 12px;
  border: 1px solid var(--hairline-soft);
}
.batch-queue-section .batch-queue-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.batch-queue-section .batch-queue-header .batch-queue-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted-soft);
  text-transform: uppercase;
  letter-spacing: 0.96px;
}
.batch-queue-section .batch-queue-header .batch-queue-count {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  background: var(--surface-card);
  padding: 3px 10px;
  border-radius: 9999px;
  border: 1px solid var(--hairline-soft);
}

.batch-queue {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 160px;
  overflow-y: auto;
  font-size: 13px;
  color: var(--muted);
}
.batch-queue li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid var(--hairline-soft);
  margin-bottom: 6px;
  gap: 8px;
  background: var(--surface-card);
  transition: all 0.2s ease;
}
.batch-queue li:hover {
  border-color: var(--hairline);
}
.batch-queue .batch-remove {
  flex-shrink: 0;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.15s ease;
}
.batch-queue .batch-remove:hover {
  background: rgba(var(--semantic-error-rgb), 0.1);
  color: var(--semantic-error);
}

.crop-panel {
  background: var(--surface-card);
  border: 1px solid var(--hairline);
  border-radius: 24px;
  width: 100%;
  max-width: 1000px;
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 40px 80px -20px rgba(var(--ink-rgb), 0.15), 0 12px 32px -8px rgba(var(--ink-rgb), 0.08);
  animation: fadeInScale 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}
.crop-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px 20px;
  border-bottom: 1px solid var(--hairline-soft);
  flex-shrink: 0;
  background: var(--surface-card);
}
.crop-panel-header h3 {
  font-family: "Waldenburg", "Times New Roman", serif;
  font-size: 28px;
  font-weight: 300;
  letter-spacing: -1px;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 12px;
  line-height: 1;
}
.crop-panel-header h3 svg {
  width: 24px;
  height: 24px;
  color: var(--muted);
  opacity: 0.6;
}
.crop-panel-header h3 .count-badge {
  font-family: "Inter", sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  background: var(--gradient-peach);
  padding: 5px 12px;
  border-radius: 9999px;
  letter-spacing: 0;
  margin-left: 4px;
}
.crop-panel-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.crop-panel-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 20px;
  padding: 14px 28px;
  border-bottom: 1px solid var(--hairline-soft);
  background: var(--canvas-soft);
  font-size: 13px;
}
.crop-panel-toolbar .panel-toolbar-check,
.crop-panel-toolbar .panel-toolbar-sort {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-weight: 500;
}
.crop-panel-toolbar .panel-sort-select {
  margin-left: 4px;
  font: inherit;
  padding: 6px 14px;
  border-radius: 9999px;
  border: 1px solid var(--hairline);
  background: var(--surface-card);
  color: var(--ink);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.crop-panel-toolbar .panel-sort-select:hover {
  border-color: var(--hairline-strong);
  background: var(--surface-strong);
}
.crop-panel-toolbar .panel-sort-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
}
.crop-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 28px;
}
.crop-panel-body--dark {
  background: var(--surface-dark-elevated);
}
.crop-panel-body--dark .crop-panel-item {
  border-color: rgba(var(--on-dark-rgb), 0.12);
  background: var(--surface-dark);
}
.crop-panel-body--dark .crop-panel-item img {
  background: repeating-conic-gradient(var(--surface-dark-elevated) 0% 25%, var(--surface-dark) 0% 50%) 50%/12px 12px;
}
.crop-panel-body--dark .crop-panel-item-toolbar {
  background: rgba(var(--on-dark-rgb), 0.06);
  border-color: rgba(var(--on-dark-rgb), 0.1);
}
.crop-panel-body--dark .crop-panel-item-info {
  background: var(--surface-dark);
  border-color: rgba(var(--on-dark-rgb), 0.1);
}
.crop-panel-body--dark .crop-panel-item .item-meta {
  color: rgba(var(--on-dark-rgb), 0.5);
}
.crop-panel-body--dark .crop-panel-item .item-index {
  background: rgba(var(--on-dark-rgb), 0.12);
  color: rgba(var(--on-dark-rgb), 0.7);
}
.crop-panel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}
.crop-panel-item {
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--hairline-soft);
  background: var(--surface-card);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  position: relative;
}
.crop-panel-item::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--gradient-mint), var(--gradient-peach), var(--gradient-lavender));
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: 2;
  border-radius: 16px 16px 0 0;
}
.crop-panel-item:hover {
  border-color: var(--hairline-strong);
  transform: translateY(-4px);
  box-shadow: 0 20px 48px -12px rgba(var(--ink-rgb), 0.1);
}
.crop-panel-item:hover::before {
  opacity: 1;
}
.crop-panel-item:hover .item-index {
  background: var(--ink);
  color: var(--on-primary);
}
.crop-panel-item-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--hairline-soft);
  background: var(--canvas-soft);
  flex-shrink: 0;
}
.crop-panel-item-toolbar .panel-item-check {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--ink);
}
.crop-panel-item-toolbar .crop-panel-item-copy {
  margin-left: auto;
}
.crop-panel-item-preview {
  cursor: pointer;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  position: relative;
  background: repeating-conic-gradient(var(--canvas-soft) 0% 25%, var(--hairline-soft) 0% 50%) 50%/12px 12px;
}
.crop-panel-item-preview::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(var(--ink-rgb), 0);
  transition: background 0.3s ease;
}
.crop-panel-item-preview:hover::after {
  background: rgba(var(--ink-rgb), 0.03);
}
.crop-panel-item img {
  width: 100%;
  display: block;
  max-height: 180px;
  object-fit: contain;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.crop-panel-item:hover img {
  transform: scale(1.03);
}
.crop-panel-item-info {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface-card);
  border-top: 1px solid var(--hairline-soft);
}
.crop-panel-item-info .item-index {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  background: var(--surface-strong);
  color: var(--muted);
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  font-family: "Inter", sans-serif;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.crop-panel-item-info .item-meta {
  font-size: 12px;
  color: var(--muted);
  font-family: "Inter", sans-serif;
}
.crop-panel-item-info .item-download {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--ink);
  font-weight: 500;
  text-decoration: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 6px 12px;
  border-radius: 9999px;
  background: var(--surface-strong);
}
.crop-panel-item-info .item-download:hover {
  color: var(--on-primary);
  background: var(--ink);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(var(--ink-rgb), 0.15);
}
.crop-panel-item-info .item-download svg {
  width: 13px;
  height: 13px;
}
.crop-panel-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 28px;
  border-top: 1px solid var(--hairline-soft);
  flex-shrink: 0;
  background: var(--canvas-soft);
}

.crop-panel-hint {
  font-size: 13px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
}
.crop-panel-hint::before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--gradient-mint);
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--hairline);
  border-radius: 50%;
  background: var(--surface-card);
  color: var(--muted);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.btn-icon:hover {
  background: var(--ink);
  color: var(--on-primary);
  border-color: var(--ink);
  transform: scale(1.1);
  box-shadow: 0 4px 16px rgba(var(--ink-rgb), 0.2);
}
.btn-icon svg {
  width: 14px;
  height: 14px;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(var(--canvas-deep-rgb), 0.45);
  backdrop-filter: blur(16px) saturate(1.2);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal {
  background: var(--surface-card);
  border: 1px solid var(--hairline);
  border-radius: 24px;
  padding: 24px;
  width: 400px;
  max-width: 90vw;
  box-shadow: 0 32px 64px -16px rgba(var(--ink-rgb), 0.12), 0 8px 24px -8px rgba(var(--ink-rgb), 0.06);
  animation: fadeInScale 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.modal h3 {
  margin-bottom: 16px;
  font-family: "Waldenburg", "Times New Roman", serif;
  font-size: 20px;
  font-weight: 300;
  color: var(--ink);
  letter-spacing: -0.3px;
}
.modal .input {
  margin-bottom: 16px;
}
.modal .modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.dragging-line {
  cursor: row-resize;
}

.dragging-vline {
  cursor: col-resize;
}

.dragging-select {
  cursor: move;
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--hairline-strong);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}

.header {
  flex-shrink: 0;
  background: rgba(var(--canvas-rgb), 0.8);
  backdrop-filter: blur(20px) saturate(1.2);
  border-bottom: 1px solid var(--hairline-soft);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 48px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  transition: all 0.2s;
}
.logo:hover {
  transform: translateX(2px);
}
.logo .logo-icon {
  width: 32px;
  height: 32px;
  background: var(--ink);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.logo:hover .logo-icon {
  transform: scale(1.05);
}
.logo .logo-text {
  font-family: "Waldenburg", "Times New Roman", serif;
  font-size: 13px;
  font-weight: 300;
  color: var(--on-primary);
  letter-spacing: 0;
}
.logo .logo-title {
  font-family: "Inter", sans-serif;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.2px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-link {
  padding: 8px 16px;
  border-radius: 9999px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.nav-link:hover {
  background: var(--surface-strong);
  color: var(--ink);
}
.nav-link.active {
  background: var(--ink);
  color: var(--on-primary);
}

.footer {
  background: var(--ink);
  border-top: none;
  padding: 0 32px;
  flex-shrink: 0;
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 32px;
  max-width: 100%;
}

.footer-status {
  display: flex;
  align-items: center;
  gap: 20px;
}

.footer-status-item {
  font-size: 12px;
  color: rgba(var(--on-primary-rgb), 0.7);
  font-weight: 500;
  white-space: nowrap;
}

.footer-text {
  font-size: 12px;
  color: rgba(var(--on-primary-rgb), 0.45);
  font-weight: 400;
}

.sidebar-collapse-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: none;
  background: none;
  color: var(--muted-soft);
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s ease;
  padding: 0;
}
.sidebar-collapse-btn:hover {
  background: var(--surface-strong);
  color: var(--ink);
}
.sidebar-collapse-btn svg {
  transition: transform 0.2s ease;
}

.sidebar-section.collapsed .sidebar-collapse-btn svg {
  transform: rotate(-90deg);
}

.sidebar-section.collapsed {
  gap: 0;
  padding: 12px 16px;
}

.sidebar-section-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all 0.3s ease;
  overflow: hidden;
}

.sidebar-section.collapsed .sidebar-section-body {
  max-height: 0;
  opacity: 0;
  margin-top: 0;
  padding: 0;
}

.sidebar-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
}

.select-rotation-control {
  margin-top: 4px;
}
.select-rotation-control .setting-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted-soft);
  text-transform: uppercase;
  letter-spacing: 0.96px;
  margin-bottom: 8px;
}
.select-rotation-control .setting-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.select-rotation-control .setting-slider {
  flex: 1;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--hairline-strong);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
.select-rotation-control .setting-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  border: 2px solid var(--on-primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}
.select-rotation-control .setting-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  min-width: 36px;
  text-align: right;
  white-space: nowrap;
}

.watermark-controls .setting-item {
  margin-bottom: 16px;
}
.watermark-controls .setting-item:last-child {
  margin-bottom: 0;
}
.watermark-controls .setting-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted-soft);
  text-transform: uppercase;
  letter-spacing: 0.96px;
  margin-bottom: 8px;
}

.watermark-upload-area {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--canvas-soft);
  border: 1px dashed var(--hairline-strong);
  border-radius: 12px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.watermark-upload-area:hover {
  border-color: var(--hairline);
  background: var(--surface-strong);
}
.watermark-upload-area.has-file {
  border-style: solid;
  border-color: rgba(var(--primary-rgb), 0.3);
  background: rgba(var(--primary-rgb), 0.04);
}

.watermark-file-name {
  font-size: 12px;
  color: var(--ink);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

.watermark-position-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.wm-pos-btn {
  width: 100%;
  height: 34px;
  border: 1px solid var(--hairline-soft);
  background: var(--surface-card);
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  color: var(--muted);
  position: relative;
  overflow: hidden;
}
.wm-pos-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(var(--gradient-mint-rgb), 0.05), rgba(var(--gradient-peach-rgb), 0.03));
  opacity: 0;
  transition: opacity 0.25s ease;
}
.wm-pos-btn:hover {
  background: var(--surface-strong);
  border-color: var(--hairline);
  color: var(--ink);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(var(--ink-rgb), 0.06);
}
.wm-pos-btn:hover::before {
  opacity: 1;
}
.wm-pos-btn.active {
  background: linear-gradient(135deg, var(--primary), rgba(var(--primary-rgb), 0.9));
  border-color: var(--primary);
  color: var(--on-primary);
  box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.2);
  transform: translateY(-1px);
}
.wm-pos-btn.active::before {
  opacity: 0;
}
.wm-pos-btn:active:not(.active) {
  transform: translateY(0);
}

.setting-slider {
  width: 100%;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--hairline);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
.setting-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--ink);
  cursor: pointer;
  border: 2px solid var(--on-primary);
  box-shadow: 0 2px 6px rgba(var(--ink-rgb), 0.15);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.setting-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 4px 12px rgba(var(--ink-rgb), 0.25);
}

.shortcuts-modal {
  max-width: 640px;
}

.shortcuts-body {
  padding: 20px 24px 24px;
}

.shortcuts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.shortcuts-col h4 {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.72px;
  color: var(--muted-soft);
  text-transform: uppercase;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--hairline-soft);
}

.shortcut-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 0;
  font-size: 13px;
  color: var(--ink);
}
.shortcut-row kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 24px;
  padding: 0 7px;
  background: var(--canvas-soft);
  border: 1px solid var(--hairline-strong);
  border-radius: 6px;
  font-family: "SF Mono", "Consolas", "Monaco", monospace;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
  box-shadow: 0 1px 0 var(--hairline);
}

.compare-view {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  justify-content: center;
  width: 100%;
  flex-wrap: wrap;
}
.compare-view .compare-col {
  flex: 1;
  min-width: 200px;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.compare-view .compare-col img, .compare-view .compare-col canvas {
  max-width: 100%;
  max-height: 340px;
  border-radius: 12px;
  border: 1px solid var(--hairline-soft);
  background: var(--surface-card);
}
.compare-view .compare-col .compare-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--muted-soft);
}
.compare-view .compare-col .compare-info {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}

.file-list-area {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 16px;
}

.file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  width: 100%;
}
.file-grid .file-card {
  background: var(--surface-card);
  border: 1px solid var(--hairline-soft);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px;
  gap: 6px;
  position: relative;
  transition: border-color 0.2s ease;
}
.file-grid .file-card:hover {
  border-color: var(--hairline-strong);
}
.file-grid .file-card--done {
  border-color: rgba(var(--semantic-success-rgb, 34, 197, 94), 0.3);
}
.file-grid .file-card--error {
  border-color: rgba(var(--semantic-error-rgb, 239, 68, 68), 0.3);
}
.file-grid .file-card-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 999px;
  background: var(--primary);
  color: var(--on-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.file-grid .file-card-badge--done {
  background: var(--semantic-success);
  color: #fff;
}
.file-grid .file-card-badge--error {
  background: var(--semantic-error);
  color: #fff;
}
.file-grid .file-card-placeholder {
  width: 100%;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--muted-soft);
  background: var(--surface-strong);
  border-radius: 6px;
}
.file-grid .file-card img {
  width: 100%;
  height: 100px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--hairline-soft);
}
.file-grid .file-card-name {
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 100%;
}
.file-grid .file-card-size {
  font-size: 10px;
  color: var(--muted-soft);
}
.file-grid .file-card-remove {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(var(--ink-rgb), 0.5);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
}
.file-grid .file-card-remove svg {
  width: 12px;
  height: 12px;
}
.file-grid .file-card-download {
  position: absolute;
  bottom: 6px;
  right: 6px;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: var(--primary);
  color: var(--on-primary);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
}
.file-grid .file-card:hover .file-card-remove {
  opacity: 1;
}
.file-grid .file-card:hover .file-card-download {
  opacity: 1;
}

.resize-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  overflow: auto;
}
.resize-preview img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 12px;
  border: 1px solid var(--hairline-soft);
}

.preset-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.preset-grid .preset-btn {
  padding: 6px 4px;
  font-size: 11px;
  border: 1px solid var(--hairline-strong);
  border-radius: 8px;
  background: var(--surface-strong);
  color: var(--ink);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: inherit;
  text-align: center;
  font-weight: 500;
}
.preset-grid .preset-btn:hover {
  background: var(--primary);
  color: var(--on-primary);
  border-color: var(--primary);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(var(--primary-rgb), 0.2);
}
.preset-grid .preset-btn:active {
  transform: translateY(0);
}

.result-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  border-bottom: 1px solid var(--hairline-soft);
}
.result-stat:last-child {
  border-bottom: none;
}
.result-stat .result-label {
  font-size: 12px;
  color: var(--muted);
}
.result-stat .result-value {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
}
.result-stat .result-value--good {
  color: var(--semantic-success);
}

.result-stat--highlight {
  padding: 8px 0;
}
.result-stat--highlight .result-label {
  font-weight: 500;
  color: var(--ink);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: var(--surface-card);
  border: 1px solid var(--hairline-strong);
  border-radius: 9999px;
  padding: 6px 14px;
  color: var(--muted);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.theme-toggle:hover {
  background: var(--surface-strong);
  color: var(--ink);
  transform: translateY(-1px);
}
.theme-toggle .theme-icon-sun,
.theme-toggle .theme-icon-moon {
  width: 16px;
  height: 16px;
}

@media (max-width: 768px) {
  .sidebar-toggle {
    display: flex !important;
  }
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    z-index: 200;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: none;
  }
  .sidebar.sidebar--open {
    transform: translateX(0);
    box-shadow: 8px 0 32px rgba(var(--ink-rgb), 0.2);
  }
  .sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(var(--ink-rgb), 0.4);
    z-index: 199;
  }
  .sidebar-backdrop.sidebar-backdrop--visible {
    display: block;
  }
  body {
    height: auto;
    min-height: 100vh;
    overflow: auto;
  }
  #app {
    flex: none;
    min-height: 100vh;
  }
  .header-content {
    padding: 0 20px;
    height: 48px;
  }
  .toolbar {
    height: auto;
    flex-wrap: wrap;
    padding: 8px 12px;
    gap: 4px;
  }
  .toolbar-group {
    flex-wrap: wrap;
  }
  .toolbar-actions {
    margin-left: 0;
  }
  .toolbar-divider {
    display: none;
  }
  .main-area {
    flex-direction: column;
  }
  .sidebar {
    width: 100%;
    max-height: 40vh;
    border-right: none;
    border-bottom: 1px solid var(--hairline-soft);
    flex-shrink: 0;
    padding: 8px;
    gap: 8px;
  }
  .sidebar-section {
    gap: 6px;
  }
  .canvas-area {
    flex: 1;
    min-height: 50vh;
  }
  .footer-content {
    flex-direction: column;
    height: auto;
    padding: 8px 0;
    gap: 4px;
  }
  .footer-status {
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
  }
  .shortcuts-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .crop-panel {
    width: calc(100vw - 32px);
    max-width: none;
    margin: 16px;
    max-height: calc(100vh - 32px);
    border-radius: 16px;
  }
  .crop-panel-body {
    padding: 16px;
  }
  .logo-title {
    display: none;
  }
}
#empty-state:not([style*="display: none"]) ~ #main-canvas {
  display: none !important;
}

#toast-container {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
  color: #fff;
  background: rgba(var(--ink-rgb), 0.85);
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 16px rgba(var(--ink-rgb), 0.15);
  transform: translateX(100%);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: auto;
  max-width: 320px;
}
.toast--visible {
  transform: translateX(0);
  opacity: 1;
}
.toast--success {
  background: rgba(34, 197, 94, 0.9);
}
.toast--error {
  background: rgba(239, 68, 68, 0.9);
}
.toast--info {
  background: rgba(var(--ink-rgb), 0.85);
}

.grid-canvas {
  display: grid;
  border-radius: 16px;
  box-shadow: 0 8px 32px -8px rgba(var(--ink-rgb), 0.1);
  transition: all 0.3s ease;
}

.grid-cell {
  position: relative;
  cursor: pointer;
  background: var(--surface-strong);
  border: 1px solid var(--hairline-soft);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}
.grid-cell:hover {
  background: var(--surface-card);
}
.grid-cell--filled:hover {
  border-color: rgba(var(--primary-rgb), 0.3);
}

.grid-cell-inner {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.grid-cell-inner img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
}

.grid-cell-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(var(--ink-rgb), 0.6);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease, background 0.2s ease;
}
.grid-cell-remove svg {
  width: 12px;
  height: 12px;
}
.grid-cell-remove:hover {
  background: var(--semantic-error);
}
.grid-cell--filled:hover .grid-cell-remove {
  opacity: 1;
}

.grid-cell-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted-soft);
  opacity: 0.4;
  transition: opacity 0.2s ease;
}
.grid-cell:hover .grid-cell-placeholder {
  opacity: 0.7;
  color: var(--primary);
}

.bg-color-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bg-color-picker {
  width: 32px;
  height: 32px;
  border: 2px solid var(--hairline-soft);
  border-radius: 8px;
  cursor: pointer;
  padding: 0;
  background: none;
  -webkit-appearance: none;
}
.bg-color-picker::-webkit-color-swatch-wrapper {
  padding: 2px;
}
.bg-color-picker::-webkit-color-swatch {
  border: none;
  border-radius: 3px;
}

.bg-color-presets {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.bg-color-preset {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  border: 2px solid var(--hairline-soft);
  cursor: pointer;
  transition: all 0.15s ease;
}
.bg-color-preset:hover {
  border-color: var(--hairline-strong);
  transform: scale(1.1);
}
.bg-color-preset.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(var(--primary-rgb), 0.3);
}

.crop-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(var(--canvas-deep-rgb), 0.6);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeInScale 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.crop-modal {
  background: var(--surface-card);
  border: 1px solid var(--hairline);
  border-radius: 24px;
  width: 780px;
  max-width: 95vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 32px 64px -16px rgba(var(--ink-rgb), 0.2);
}

.crop-modal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--hairline-soft);
  flex-wrap: wrap;
}
.crop-modal-header h3 {
  font-family: "Waldenburg", "Times New Roman", serif;
  font-size: 18px;
  font-weight: 300;
  color: var(--ink);
  letter-spacing: -0.3px;
  margin-right: 8px;
}

.crop-modal-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  flex: 1;
}
.crop-modal-toolbar .btn-sm {
  padding: 4px 10px;
  font-size: 12px;
  height: 28px;
  border-radius: 8px;
}

.crop-modal-close {
  width: 32px;
  height: 32px;
  border: none;
  background: var(--surface-strong);
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  flex-shrink: 0;
}
.crop-modal-close:hover {
  background: var(--semantic-error);
  color: white;
}

.crop-modal-body {
  flex: 1;
  overflow: hidden;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
}

.crop-preview-container {
  width: 100%;
  height: 100%;
  max-height: 60vh;
}
.crop-preview-container img {
  max-width: 100%;
  max-height: 60vh;
  display: block;
}

.crop-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-top: 1px solid var(--hairline-soft);
  background: var(--canvas-soft);
}

.crop-modal-info {
  font-size: 12px;
  color: var(--muted);
}

.crop-modal-actions {
  display: flex;
  gap: 8px;
}

.compress-list {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.compress-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--hairline-soft);
  flex-shrink: 0;
}

.compress-list-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.compress-list-count {
  font-size: 12px;
  color: var(--muted);
}

.compress-items {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.compress-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--surface-card);
  border: 1px solid var(--hairline-soft);
  border-radius: 12px;
  transition: all 0.2s ease;
}
.compress-item:hover {
  border-color: var(--hairline-strong);
  box-shadow: 0 2px 8px rgba(var(--ink-rgb), 0.04);
}
.compress-item--loading {
  border-color: rgba(var(--primary-rgb), 0.2);
}
.compress-item--processing {
  border-color: rgba(var(--primary-rgb), 0.3);
}
.compress-item--done {
  border-color: rgba(var(--semantic-success-rgb), 0.3);
}
.compress-item--error {
  border-color: rgba(var(--semantic-error-rgb), 0.3);
}

.compress-item-thumb {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--surface-strong);
  display: flex;
  align-items: center;
  justify-content: center;
}
.compress-item-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.compress-item-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--surface-strong), var(--hairline-soft));
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 0.6;
  }
  50% {
    opacity: 1;
  }
}
.compress-item-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.compress-item-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.compress-item-meta {
  font-size: 11px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.compress-item-sep {
  color: var(--hairline-strong);
}

.compress-item-compressed {
  color: var(--semantic-success);
  font-weight: 500;
}

.compress-item-status {
  font-size: 11px;
  font-weight: 500;
}
.compress-item--loading .compress-item-status {
  color: var(--primary);
}
.compress-item--processing .compress-item-status {
  color: var(--primary);
}
.compress-item--done .compress-item-status {
  color: var(--semantic-success);
}
.compress-item--error .compress-item-status {
  color: var(--semantic-error);
}

.compress-item-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.drop-hint {
  font-size: 12px;
  color: var(--muted-soft);
  margin-top: 4px;
}

.global-loading {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(var(--canvas-deep-rgb), 0.75);
  backdrop-filter: blur(16px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.global-loading--visible {
  opacity: 1;
  pointer-events: auto;
}
.global-loading .global-loading-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 48px 56px;
  background: var(--surface-card);
  border: 1px solid var(--hairline-soft);
  border-radius: 24px;
  box-shadow: 0 32px 64px -16px rgba(var(--ink-rgb), 0.2), 0 0 0 1px rgba(var(--ink-rgb), 0.04);
  animation: fadeInScale 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.global-loading .global-loading-spinner {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 3px solid var(--hairline-soft);
  border-top-color: var(--primary);
  animation: spin 0.9s linear infinite;
  position: relative;
}
.global-loading .global-loading-spinner::after {
  content: "";
  position: absolute;
  inset: -7px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: rgba(var(--primary-rgb), 0.25);
  animation: spin 1.3s linear infinite reverse;
}
.global-loading .global-loading-text {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.3px;
  text-align: center;
  line-height: 1.5;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/*# sourceMappingURL=main.css.map */
