/* ==========================================================================
   标签制作页 — 与主站同一套 2026-11 视觉系统
   左：规格表单（panel 卡片）  右：实时预览（sticky）
   ========================================================================== */

.lab-body {
  display: grid;
  grid-template-columns: minmax(360px, 460px) minmax(0, 1fr);
  gap: 26px;
  align-items: start;
}

.lab-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.lab-form textarea {
  font-family: var(--ff-mono);
  font-size: 12px;
  line-height: 1.65;
  min-height: 88px;
}

.lab-form code {
  font-family: var(--ff-mono);
}

/* ---------------- 预览区 ---------------- */
.lab-preview {
  min-width: 0;
  position: sticky;
  top: calc(var(--topbar-h) + 22px);
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px;
  box-shadow: var(--sh-1);
}

.preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.preview-head h2 {
  font-size: 15px;
  font-weight: 680;
  letter-spacing: -0.02em;
}

.preview-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.preview-tools select {
  width: auto;
  min-width: 84px;
  font-size: 12px;
  padding: 6px 30px 6px 10px;
  border-radius: var(--r-pill);
}

.preview-stage {
  background:
    repeating-conic-gradient(var(--canvas-2) 0% 25%, var(--surface-2) 0% 50%) 50% / 18px 18px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  overflow: auto;
}

.preview-stage canvas {
  display: block;
  background: #fff;
  border-radius: 3px;
  box-shadow: 0 2px 6px rgba(20, 18, 14, 0.08), 0 22px 48px -26px rgba(20, 18, 14, 0.34);
  max-width: 100%;
}

/* ---------------- 规格 chips ---------------- */
.spec-box {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.spec-box:empty {
  display: none;
}

.spec-chip {
  font-size: 11.5px;
  color: var(--ink-2);
  background: var(--canvas-2);
  border-radius: 6px;
  padding: 4px 9px;
  line-height: 1.5;
}

.spec-chip b {
  font-family: var(--ff-mono);
  font-weight: 600;
  color: var(--ink);
}

/* ---------------- 检查项 ---------------- */
.check-box {
  display: flex;
  flex-direction: column;
  gap: 5px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.check-box:empty {
  display: none;
}

.check-line {
  font-size: 12px;
  line-height: 1.55;
  color: var(--ink-2);
  padding: 6px 10px 6px 11px;
  border-radius: var(--r-xs);
  border-left: 2.5px solid var(--line-strong);
  background: var(--surface-2);
}

.check-ok {
  border-left-color: var(--ok);
  background: var(--ok-soft);
  color: #1f5c40;
}

.check-warn {
  border-left-color: #d9a326;
  background: var(--warn-soft);
  color: var(--warn);
}

.check-err {
  border-left-color: var(--danger);
  background: var(--danger-soft);
  color: var(--danger);
  font-weight: 560;
}

.barcode-flat {
  font-family: var(--ff-mono);
  letter-spacing: 0.06em;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 4px;
  padding: 0 4px;
}

/* ---------------- 效果图区块 ---------------- */
.mockup-box {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface-2);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mockup-box[hidden] {
  display: none;
}

.mockup-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.mockup-head h3 {
  font-size: 13.5px;
  font-weight: 660;
  letter-spacing: -0.015em;
}

.mockup-meta {
  font-family: var(--ff-mono);
  font-size: 10.5px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.mockup-stage {
  border-radius: var(--r-sm);
  background: #fff;
  border: 1px solid var(--line);
  padding: 8px;
  display: flex;
  justify-content: center;
}

.mockup-stage img {
  display: block;
  max-width: 100%;
  max-height: 460px;
  border-radius: 6px;
}

.mockup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.mockup-actions .ghost-btn {
  font-size: 11.5px;
  padding: 6px 11px;
}

/* ---------------- 操作区 ---------------- */
.lab-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 14px;
  box-shadow: var(--sh-2);
  position: sticky;
  bottom: 16px;
  z-index: 20;
}

.lab-actions .generate-btn {
  grid-column: 1 / -1;
}

.lab-actions .ghost-btn {
  justify-content: center;
  text-align: center;
}

/* ---------------- 响应式 ---------------- */
@media (max-width: 1180px) {
  .lab-body {
    grid-template-columns: minmax(0, 1fr);
  }

  .lab-preview {
    position: static;
  }

  .lab-actions {
    position: static;
  }
}

@media (max-width: 640px) {
  .lab-actions {
    grid-template-columns: 1fr;
  }

  .preview-stage {
    padding: 10px;
  }
}
