/* .wrap 宽度见 brand-theme.css 流体自适应 */

header { text-align: left; margin-bottom: 1.5rem; }
header h1 { margin: 0; font-size: 1.75rem; color: var(--accent); }
header .sub { margin: 0.35rem 0 0; font-size: 0.95rem; color: var(--muted); }

header.site-head {
  --site-head-h: 30px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: var(--site-head-h);
  text-align: left;
  margin-bottom: 1.5rem;
}

header.site-head .brand h1 {
  margin: 0;
  padding: 0;
  min-height: var(--site-head-h);
  display: flex;
  align-items: center;
  font-size: clamp(1.1rem, 4.5vw, 1.5rem);
  line-height: 1.15;
}

header.site-head .head-tools-floating {
  position: relative;
  top: auto;
  right: auto;
  z-index: 2;
  flex-shrink: 0;
  display: flex;
  flex-direction: row;
  align-items: center;
  align-self: center;
  height: var(--site-head-h);
  gap: 6px;
  margin: 0;
  padding: 0;
}

header.site-head .head-help-wrap,
header.site-head .head-menu-wrap {
  display: flex;
  align-items: center;
  height: var(--site-head-h);
}

/* ── 会员 / 激活码 ── */
.license-zone {
  padding: 10px 14px;
  margin-bottom: 12px;
}

.license-zone.hidden {
  display: none;
}

.license-zone.lz-collapsed {
  padding: 8px 14px;
}

.lz-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
}

.lz-label {
  flex-shrink: 0;
  font-size: 0.9rem;
  color: var(--muted);
  white-space: nowrap;
}

.license-preview {
  flex: 1;
  min-width: 0;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.license-zone.lz-collapsed .license-key-row {
  display: none;
}

.license-zone:not(.lz-collapsed) .license-key-row .license-preview {
  display: none;
}

.license-key-row {
  margin-top: 8px;
}

.device-code-display {
  flex: 1;
  min-width: 0;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 2px 0;
  background: transparent;
  border: none;
}

.license-key-row #licenseKey {
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: 6px 8px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
}

.lz-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.lz-action-btn {
  font-size: 0.88rem;
  line-height: 1.35;
  padding: 4px 0;
  white-space: nowrap;
}

.license-auto-hint {
  color: var(--muted);
  white-space: nowrap;
  font-size: 12px;
}

.license-auto-hint.hidden {
  display: none;
}

.license-zone.lz-collapsed .lz-extra {
  display: none;
}

.license-zone.lz-collapsed.lz-pin-extra .lz-extra {
  display: block;
  margin-top: 8px;
}

.license-zone.lz-pin-extra .hint.lz-extra {
  color: var(--lock-text, #be123c);
  font-weight: 600;
}

.license-zone.lz-pin-extra .lz-extra {
  color: var(--lock-text, #be123c);
}

.license-zone .hint.lz-extra {
  margin: 10px 0 0;
  font-size: 0.85rem;
  line-height: 1.45;
}

.lock-banner.hidden {
  display: none;
}

.file-pick-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.file-input-hidden {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
}

.file-pick-btn {
  margin: 0;
  cursor: pointer;
}

.file-pick-name {
  color: var(--muted);
  font-size: 0.9rem;
}

.upload-hint {
  margin: 0.75rem 0 0;
}

.card.disabled {
  opacity: 0.65;
  pointer-events: none;
}
.modes label { display: block; margin: 0.5rem 0; cursor: pointer; }
.opts { margin: 0.75rem 0; padding: 0.75rem; border-radius: 8px; }
.enhance-opts .enhance-check { display: flex; align-items: center; gap: 0.4rem; cursor: pointer; }
.enhance-opts .enhance-check input { width: auto; margin: 0; }

/* ── 5001 编辑区：左窄命令栏 · 右大画布（见 shared/网页产品标配.md §5001） ── */
#editCard .workspace {
  display: grid;
  grid-template-columns: minmax(188px, 220px) minmax(0, 1fr);
  gap: 0.75rem;
  align-items: start;
}
#editCard .workspace-panel {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.8125rem;
  line-height: 1.4;
  max-height: calc(100vh - 9.5rem);
  overflow-y: auto;
  padding-right: 0.15rem;
}
#editCard .modes label {
  margin: 0.3rem 0;
  font-size: 0.8125rem;
}
#editCard .opts {
  margin: 0.45rem 0;
  padding: 0.45rem 0.55rem;
}
#editCard .hint {
  font-size: 0.75rem;
  line-height: 1.4;
}
#editCard .btn {
  padding: 0.42rem 0.65rem;
  font-size: 0.8125rem;
}
#editCard .preset-btns,
#editCard .tool-btns {
  gap: 0.35rem;
}
#editCard .btn-row {
  gap: 0.45rem;
  margin-top: 0.45rem;
}
#editCard .workspace-canvas {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
#editCard .canvas-wrap {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-hover);
  line-height: 0;
  width: 100%;
  min-height: min(58vh, 520px);
  max-height: min(calc(100vh - 9rem), 80vh);
}
#editCard #canvas {
  display: block;
  max-width: 100%;
  height: auto;
  cursor: crosshair;
  touch-action: none;
}
#editCard .preview-box img {
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: none;
  object-fit: contain;
  margin: 0;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(260px, 320px) 1fr;
  gap: 1.25rem;
  align-items: start;
}
.workspace-panel {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  max-height: calc(100vh - 12rem);
  overflow-y: auto;
  padding-right: 0.25rem;
}
.workspace-canvas {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.canvas-wrap {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-hover);
  line-height: 0;
  max-height: min(calc(100vh - 11rem), 72vh);
  display: flex;
  justify-content: center;
  align-items: flex-start;
}
#canvas {
  display: block;
  max-width: 100%;
  height: auto;
  cursor: crosshair;
  touch-action: none;
}
#canvas.tool-rect { cursor: crosshair; }
#canvas.tool-brush { cursor: none; }
.tool-btns { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.5rem 0; }
.tool-btns .btn { margin-left: 0; }
.tool-btns .btn.active { background: var(--accent); color: #042f2e; }
#brushOpts { margin-top: 0.5rem; }
.btn {
  border: none;
  border-radius: 8px;
  padding: 0.65rem 1.25rem;
  font-size: 1rem;
  cursor: pointer;
}
.btn.secondary.active { background: var(--accent); color: #042f2e; }
.preset-btns { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.5rem; }
.preset-btns .btn { margin-left: 0; }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 0.75rem; }
.preview-box { margin-top: 0; }
.preview-box h3 { margin: 0 0 0.5rem; font-size: 0.95rem; }
.preview-box img {
  display: block;
  max-width: 100%;
  max-height: min(48vh, 420px);
  height: auto;
  object-fit: contain;
  margin: 0 auto;
  border-radius: 8px;
  border: 2px solid var(--accent);
}
.status:empty { display: none; }
.quota-shop-hint {
  margin: 0.65rem 0 0;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--lock-text, #be123c);
}
.quota-shop-hint.hidden { display: none; }
.quota-shop-hint a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.progress-wrap { margin-top: 0.75rem; }
.progress-wrap.hidden { display: none; }
.progress-wrap.indeterminate .progress-fill {
  width: 35%;
  animation: progress-slide 1.2s ease-in-out infinite;
}
@keyframes progress-slide {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(320%); }
}
.progress-label { font-size: 0.85rem; color: var(--accent); margin: 0.35rem 0 0; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 900px) {
  #editCard .workspace,
  .workspace { grid-template-columns: 1fr; }
  #editCard .workspace-panel,
  .workspace-panel { max-height: none; overflow: visible; }
  #editCard .canvas-wrap,
  .canvas-wrap { max-height: 55vh; min-height: 40vh; }
}
@media (max-width: 640px) { .grid2 { grid-template-columns: 1fr; } }

@media (max-width: 560px) {
  .lz-row {
    flex-wrap: wrap;
  }
  .lz-actions {
    width: 100%;
    justify-content: flex-end;
  }
  .lz-action-btn {
    min-height: 44px;
    padding: 8px 0;
  }
}

/* 结果对比：等比放大至列宽/视口，居中，可滚动查看全图 */
#resultCard .grid2 {
  align-items: start;
}
#resultCard .grid2 > div {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
#resultCard .result-frame {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  min-height: min(52vh, 480px);
  max-height: min(78vh, 860px);
  overflow: auto;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--input-bg, #0f172a);
}
#resultCard .grid2 img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: min(76vh, 840px);
  margin: 0 auto;
  object-fit: contain;
  border-radius: 6px;
}
.grid2 h3 { margin: 0 0 0.5rem; font-size: 0.95rem; }
#downloadBtn { display: inline-block; margin-top: 0.75rem; text-decoration: none; }
.note { text-align: center; }

#workCard.disabled { opacity: 0.55; pointer-events: none; }
