body.cabinet-workbench-page {
  margin: 0;
  min-height: 100vh;
  color: #152238;
  background:
    radial-gradient(circle at 8% -12%, rgba(47, 102, 245, 0.15), transparent 38%),
    radial-gradient(circle at 95% 2%, rgba(36, 90, 82, 0.14), transparent 34%),
    #eef3fb;
  font-family: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
}

body.cabinet-workbench-page .page-shell {
  max-width: 1780px;
  padding: 24px 18px 48px;
}

.cabinet-shell {
  display: grid;
  grid-template-columns: 430px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  margin-top: 18px;
}

.cabinet-rail {
  position: sticky;
  top: 18px;
  display: grid;
  gap: 14px;
  max-height: calc(100vh - 36px);
  overflow-y: auto;
  padding: 26px;
}

.cabinet-workspace {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.cabinet-panel {
  padding: 22px;
}

.cabinet-mode-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 6px;
  border: 1px solid var(--line, #d6e0ef);
  border-radius: 14px;
  background: #edf3ff;
}

.cabinet-mode-tab {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: #526680;
  min-height: 42px;
  font-weight: 800;
  cursor: pointer;
}

.cabinet-mode-tab.is-active {
  background: #fff;
  color: #18348f;
  border-color: #c9d6ef;
  box-shadow: 0 8px 18px rgba(31, 65, 128, 0.12);
}

.cabinet-guard {
  display: grid;
  gap: 10px;
  border: 1px solid #d4deed;
  border-radius: 14px;
  background: #f8fbff;
  padding: 14px;
}

.cabinet-guard-title {
  font-size: 14px;
  font-weight: 900;
  color: #173252;
}

.cabinet-guard-row {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 8px;
  font-size: 13px;
  line-height: 1.5;
  color: #526880;
}

.cabinet-guard-row b {
  color: #245a52;
}

.adjustment-preset-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.cabinet-preset-btn {
  appearance: none;
  border: 1px solid #d5dfef;
  border-radius: 10px;
  background: #fff;
  color: #29415f;
  min-height: 38px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.cabinet-preset-btn:hover {
  border-color: #8db0ff;
}

.cabinet-upload-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.cabinet-dropzone {
  position: relative;
  display: flex;
  min-height: 280px;
  border: 1.5px dashed #9eb7eb;
  border-radius: 18px;
  background: linear-gradient(180deg, #f9fbff, #edf4ff);
  overflow: hidden;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  text-align: center;
  color: #536b8b;
}

.cabinet-dropzone:hover,
.cabinet-dropzone.is-dragover {
  border-color: #5d86ff;
  box-shadow: 0 14px 34px rgba(48, 85, 160, 0.13);
}

.cabinet-dropzone-title {
  position: relative;
  z-index: 2;
  font-size: 20px;
  font-weight: 900;
  color: #173252;
}

.cabinet-dropzone-note {
  position: relative;
  z-index: 2;
  max-width: 320px;
  font-size: 14px;
}

.cabinet-upload-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cabinet-dropzone.has-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(8, 20, 40, 0.05), rgba(8, 20, 40, 0.38));
}

.cabinet-dropzone.has-image .cabinet-dropzone-title,
.cabinet-dropzone.has-image .cabinet-dropzone-note {
  color: #fff;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.35);
}

.cabinet-upload-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.cabinet-target-editor {
  display: grid;
  gap: 14px;
  margin-top: 18px;
  border: 1px solid #d8e2f1;
  border-radius: 16px;
  background: #f8fbff;
  padding: 16px;
}

.cabinet-target-stage {
  position: relative;
  display: flex;
  min-height: 460px;
  border: 1px solid #d8e2f1;
  border-radius: 14px;
  background: #eef3fb;
  overflow: hidden;
  align-items: center;
  justify-content: center;
}

.cabinet-target-stage img {
  width: 100%;
  height: 100%;
  max-height: 720px;
  object-fit: contain;
  background: #f1f5fb;
}

.cabinet-target-canvas {
  position: absolute;
  z-index: 4;
  cursor: grab;
  touch-action: none;
}

.cabinet-target-canvas.is-dragging {
  cursor: grabbing;
}

.cabinet-target-status {
  border: 1px solid #d8e2f1;
  border-radius: 12px;
  background: #fff;
  padding: 10px 12px;
  color: #526880;
  font-size: 13px;
  line-height: 1.5;
}

.cabinet-result-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
}

.cabinet-result-slot {
  min-width: 0;
}

.cabinet-result-label {
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 900;
  color: #526880;
}

.cabinet-result-image-wrap {
  position: relative;
  display: flex;
  min-height: 420px;
  border: 1px solid #d8e2f1;
  border-radius: 16px;
  background: #f7faff;
  overflow: hidden;
  align-items: center;
  justify-content: center;
}

.cabinet-result-image-wrap img {
  width: 100%;
  height: 100%;
  max-height: 680px;
  object-fit: contain;
  background: #f1f5fb;
}

.cabinet-mask-stage {
  position: relative;
}

.cabinet-mask-canvas {
  position: absolute;
  z-index: 3;
  cursor: crosshair;
  touch-action: none;
}

.cabinet-mask-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
  border: 1px solid #d8e2f1;
  border-radius: 14px;
  background: #f8fbff;
  padding: 12px;
}

.cabinet-mask-title {
  color: #173252;
  font-size: 14px;
  font-weight: 900;
}

.cabinet-mask-sub {
  color: #607493;
  font-size: 13px;
  margin-top: 4px;
}

.cabinet-brush-control {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #405875;
  font-size: 13px;
  font-weight: 800;
}

.cabinet-brush-control input {
  width: 150px;
}

.cabinet-active-task {
  margin-top: 12px;
  border: 1px solid #d8e2f1;
  border-radius: 12px;
  background: #f8fbff;
  padding: 12px;
  color: #526880;
  font-size: 14px;
  line-height: 1.6;
}

.cabinet-quality-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.cabinet-quality-item {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  border: 1px solid #d8e2f1;
  border-radius: 14px;
  background: #fff;
  padding: 12px;
  color: #405875;
  line-height: 1.5;
  font-size: 14px;
}

.cabinet-quality-index {
  display: inline-flex;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  background: #edf3ff;
  color: #1f4cad;
  font-weight: 900;
  font-size: 12px;
}

.cabinet-history-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.cabinet-task-card {
  display: grid;
  gap: 12px;
  border: 1px solid #d8e2f1;
  border-radius: 16px;
  background: #fff;
  padding: 12px;
  cursor: pointer;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.cabinet-task-card:hover {
  transform: translateY(-1px);
  border-color: #8db0ff;
}

.cabinet-task-card.is-active {
  border-color: #5d86ff;
  box-shadow: 0 0 0 3px rgba(93, 134, 255, 0.12);
}

.cabinet-task-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 12px;
  background: #eef3fb;
}

.cabinet-task-title {
  font-size: 15px;
  font-weight: 900;
  color: #173252;
}

.cabinet-task-meta,
.cabinet-task-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: #607493;
  font-size: 12px;
}

.cabinet-task-actions {
  justify-content: space-between;
  align-items: center;
}

.cabinet-task-actions .btn-ghost {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 12px;
}

.hidden {
  display: none !important;
}

@media (max-width: 1180px) {
  .cabinet-shell {
    grid-template-columns: 1fr;
  }

  .cabinet-rail {
    position: static;
    max-height: none;
  }
}

@media (max-width: 760px) {
  body.cabinet-workbench-page .page-shell {
    padding: 14px 10px 34px;
  }

  .cabinet-upload-grid,
  .cabinet-result-grid,
  .cabinet-quality-list {
    grid-template-columns: 1fr;
  }

  .cabinet-dropzone {
    min-height: 220px;
  }

  .cabinet-target-stage {
    min-height: 320px;
  }

  .cabinet-result-image-wrap {
    min-height: 300px;
  }
}
