* { margin: 0; padding: 0; box-sizing: border-box; }
:root { color-scheme: dark; }
body {
  font-family: 'SansSC', system-ui, sans-serif;
  background: #17140f; color: #efe9dd;
  min-height: 100dvh;
}
.hidden { display: none !important; }
.overlay {
  position: fixed; inset: 0; z-index: 10;
  background: rgba(12, 10, 7, .92);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.panel { text-align: center; width: min(420px, 100%); }
.panel h1 { font-size: 20px; letter-spacing: .3em; margin-bottom: 24px; font-weight: 400; }
.panel input[type=password] {
  width: 100%; padding: 12px 16px; font-size: 16px;
  background: #241f17; border: 1px solid #4a4237; border-radius: 8px; color: inherit;
}
.panel button { margin-top: 14px; }
.err { color: #d98a7a; margin-top: 10px; min-height: 1.2em; font-size: 14px; }

#editor {
  max-width: 960px; margin: 0 auto; padding: 16px;
  display: grid; gap: 16px;
}
@media (min-width: 760px) {
  #editor { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; padding-top: 32px; }
}

#stage-wrap { position: relative; }
#stage {
  width: 100%; aspect-ratio: 3 / 4; display: block;
  background: #241f17; border-radius: 10px;
  touch-action: none; /* 手势交给 pointer events */
}
#drop-hint {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 6px;
  color: #8d8271; text-align: center; pointer-events: none; line-height: 1.8;
}

#controls { display: grid; gap: 14px; }
.row { display: grid; gap: 8px; }
.row label { font-size: 13px; color: #8d8271; letter-spacing: .1em; }
.row input, .row select {
  padding: 10px 12px; font-size: 15px; width: 100%;
  background: #241f17; border: 1px solid #4a4237; border-radius: 8px; color: inherit;
}
.row:has(#ai-btn) { grid-template-columns: 1fr; }
.row #sub-copy { width: 100%; }
button {
  padding: 11px 18px; font-size: 15px; cursor: pointer;
  background: #302a20; border: 1px solid #4a4237; border-radius: 8px; color: inherit;
}
button:disabled { opacity: .5; cursor: wait; }
button.primary {
  background: #b79c6b; border-color: #b79c6b; color: #17140f; font-weight: 600;
  letter-spacing: .2em;
}
#ai-btn { justify-self: start; }
#result-img { width: min(70vw, 380px); border-radius: 8px; margin-bottom: 12px; }
input[type=range] { accent-color: #b79c6b; padding: 0; }

/* ---- 批量模式 ---- */
#batch-panel { display: none; }
body.batch-on #batch-panel { display: grid; gap: 14px; }
body.batch-on #editor { grid-template-columns: 1fr; max-width: 1200px; }
@media (min-width: 760px) {
  body.batch-on #controls { grid-template-columns: 1fr 1fr; align-items: end; }
}
body.batch-on #stage-wrap, body.batch-on #row-main, body.batch-on #row-zoom,
body.batch-on #ai-btn, body.batch-on #export-btn { display: none; }
body.batch-edit #batch-panel { display: none; }
body.batch-edit #stage-wrap { display: block; }
body.batch-edit #row-zoom { display: grid; }

#batch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.batch-item img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 8px; cursor: pointer; display: block; }
.batch-item input {
  margin-top: 6px; width: 100%; padding: 8px 10px; font-size: 13px;
  background: #241f17; border: 1px solid #4a4237; border-radius: 6px; color: inherit;
}
#batch-progress { color: #8d8271; min-height: 1.2em; font-size: 14px; }
#batch-back { position: absolute; top: 10px; left: 10px; z-index: 2; }
#next-modal { margin-right: 10px; }
