/* 图片拼接页专属样式 */

.page-splice {
  max-width: 1180px;
}

.page-splice.is-editing {
  max-width: 1280px;
  padding-top: 12px;
  padding-bottom: 16px;
}

.page-splice.is-editing .header,
.page-splice.is-editing .seo-content,
.page-splice.is-editing .footer {
  display: none !important;
}

.page-splice.is-editing .panel {
  padding: 14px;
}

.splice-workspace[hidden] {
  display: none !important;
}

.splice-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 18px;
  margin-top: 4px;
}

.splice-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.splice-stage {
  position: relative;
  height: var(--splice-stage-h, min(52vh, 520px));
  min-height: 220px;
  border-radius: 16px;
  overflow: auto;
  background:
    linear-gradient(45deg, #e8edf3 25%, transparent 25%) 0 0 / 16px 16px,
    linear-gradient(-45deg, #e8edf3 25%, transparent 25%) 0 8px / 16px 16px,
    linear-gradient(45deg, transparent 75%, #e8edf3 75%) 8px -8px / 16px 16px,
    linear-gradient(-45deg, transparent 75%, #e8edf3 75%) -8px 0 / 16px 16px,
    #f4f7fb;
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}

.splice-stage canvas {
  display: block;
  max-width: 100%;
  max-height: 100%;
  box-shadow: 0 8px 28px rgba(24, 33, 43, 0.12);
  border-radius: 4px;
}

.splice-stage-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.splice-meta {
  font-size: 0.82rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.splice-meta strong {
  color: var(--ink);
  font-weight: 600;
}

.splice-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 64px;
  padding: 4px 0;
}

.splice-thumb {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid transparent;
  background: #fff;
  cursor: grab;
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(24, 33, 43, 0.08);
}

.splice-thumb:hover {
  border-color: rgba(15, 118, 110, 0.35);
}

.splice-thumb.dragging {
  opacity: 0.45;
}

.splice-thumb.drag-over {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.25);
}

.splice-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.splice-thumb .thumb-num {
  position: absolute;
  left: 4px;
  top: 4px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.92);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.splice-thumb .thumb-remove {
  position: absolute;
  right: 2px;
  top: 2px;
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 999px;
  background: rgba(24, 33, 43, 0.65);
  color: #fff;
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s;
  display: grid;
  place-items: center;
  padding: 0;
}

.splice-thumb:hover .thumb-remove {
  opacity: 1;
}

.splice-sidebar {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  max-height: calc(var(--splice-stage-h, 52vh) + 200px);
  overflow: hidden;
}

.splice-sidebar-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-right: 2px;
}

.side-block {
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
}

.side-block h3 {
  margin: 0 0 10px;
  font-size: 0.88rem;
  font-weight: 600;
}

.seg {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.seg-btn {
  appearance: none;
  border: 1px solid var(--line);
  background: #f8fafc;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.78rem;
  cursor: pointer;
  color: var(--muted);
  transition: all 0.15s;
}

.seg-btn:hover {
  border-color: rgba(15, 118, 110, 0.3);
  color: var(--ink);
}

.seg-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
  font-size: 0.75rem;
  color: var(--muted);
}

.field:last-child {
  margin-bottom: 0;
}

.field > span {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.field > span em {
  font-style: normal;
  color: var(--ink);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.field select,
.field input[type="range"],
.field input[type="color"] {
  width: 100%;
}

.field select {
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 10px;
  font-size: 0.88rem;
  color: var(--ink);
  background: #fff;
  font-family: inherit;
}

.field select:focus {
  outline: none;
  border-color: rgba(15, 118, 110, 0.45);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.field input[type="range"] {
  accent-color: var(--accent);
}

.field input[type="color"] {
  height: 36px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
}

.field input[type="color"]:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.hint {
  margin: 8px 0 0;
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.5;
}

.check-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--ink);
  cursor: pointer;
}

.check-inline input {
  accent-color: var(--accent);
}

.side-actions {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
}

.btn-block {
  width: 100%;
}

.side-actions-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

#quality-field[hidden],
#grid-cols-block[hidden],
#unify-block[hidden],
#square-block[hidden],
#align-block[hidden] {
  display: none !important;
}

@media (max-width: 900px) {
  .splice-layout {
    grid-template-columns: 1fr;
  }

  .splice-sidebar {
    max-height: min(70vh, 640px);
  }

  .splice-stage {
    height: min(42vh, 360px);
  }
}
