:root {
  --bg: #11110f;
  --panel: #191917;
  --panel-2: #21211e;
  --text: #f0ede4;
  --muted: #8e8c83;
  --line: rgba(255, 255, 255, 0.14);
  --acid: #d8ff3e;
  --orange: #ff5c35;
  --font: Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--text); background: var(--bg); font-family: var(--font); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }

.editor-header {
  width: min(1500px, calc(100% - 48px));
  height: 92px;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.editor-brand { display: flex; align-items: center; gap: 12px; font-size: 9px; font-weight: 800; letter-spacing: .12em; line-height: 1.05; }
.editor-brand b { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; color: #111; background: var(--acid); transform: rotate(-7deg); }
.back-link { font-size: 11px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.editor-shell { width: min(1500px, calc(100% - 48px)); margin: auto; padding: 90px 0 140px; }
.editor-intro { max-width: 860px; margin-bottom: 80px; }
.eyebrow { margin: 0 0 22px; color: var(--muted); font: 700 9px ui-monospace, monospace; letter-spacing: .15em; }
.editor-intro h1 { margin: 0; font-size: clamp(52px, 8vw, 122px); line-height: .88; letter-spacing: -.075em; }
.editor-intro h1 i { color: transparent; font-family: Georgia, "Songti SC", serif; font-weight: 400; -webkit-text-stroke: 1px var(--text); }
.editor-intro > p:last-child { max-width: 580px; margin: 38px 0 0; color: var(--muted); font-size: 14px; line-height: 1.8; }
.editor-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(360px, .65fr); gap: 32px; align-items: start; }
.editor-form { display: grid; gap: 18px; }
.form-section { padding: clamp(24px, 3.5vw, 48px); background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
.section-title { margin-bottom: 32px; display: flex; align-items: center; gap: 16px; }
.section-title > span { color: var(--acid); font: 700 9px ui-monospace, monospace; }
.section-title h2 { margin: 0; font-size: 24px; letter-spacing: -.04em; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px 18px; }
.field { min-width: 0; display: grid; gap: 9px; }
.field-wide { grid-column: 1 / -1; }
.field > span, .image-fields label span { color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .06em; }
.field small { color: #68675f; font-size: 9px; }
.field input, .field select, .field textarea, .path-input, .image-fields input {
  width: 100%;
  padding: 12px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  outline: 0;
  background: transparent;
  border-radius: 0;
}
.field textarea { resize: vertical; line-height: 1.6; }
.field input:focus, .field select:focus, .field textarea:focus, .image-fields input:focus { border-bottom-color: var(--acid); }
.field select option { color: #111; }
.folder-row { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 18px; }
.path-input { display: flex; align-items: center; }
.path-input em { color: var(--acid); font-style: normal; font: 11px ui-monospace, monospace; }
.path-input input { padding-left: 2px; border: 0; }
.file-picker { min-height: 48px; padding: 0 20px; display: flex; align-items: center; justify-content: center; color: #111; background: var(--acid); border-radius: 999px; font-size: 11px; font-weight: 800; }
.file-picker input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.editor-note { margin: 22px 0; padding: 13px 15px; color: #b6b3aa; background: #252521; border-left: 3px solid var(--orange); font-size: 10px; line-height: 1.7; }
.editor-note code, .editor-output code { color: var(--acid); font-family: ui-monospace, monospace; }
.image-list { display: grid; gap: 12px; }
.empty-images { padding: 46px 20px; color: #66645d; border: 1px dashed var(--line); border-radius: 8px; font-size: 11px; text-align: center; }
.image-item { padding: 12px; display: grid; grid-template-columns: 150px 1fr auto; gap: 16px; background: var(--panel-2); border: 1px solid transparent; border-radius: 8px; }
.image-item.is-dragging { opacity: .45; border-color: var(--acid); }
.image-preview { overflow: hidden; aspect-ratio: 4 / 3; background: #111; border-radius: 5px; }
.image-preview img { width: 100%; height: 100%; display: block; object-fit: cover; }
.image-fields { min-width: 0; display: grid; gap: 8px; }
.image-fields label { display: grid; gap: 2px; }
.image-path { overflow: hidden; color: var(--acid); font: 9px ui-monospace, monospace; text-overflow: ellipsis; white-space: nowrap; }
.image-fields input { padding: 7px 0; font-size: 11px; }
.image-actions { display: flex; align-items: flex-end; flex-direction: column; gap: 7px; }
.image-actions button { width: 30px; height: 30px; border: 1px solid var(--line); color: var(--text); background: transparent; border-radius: 50%; }
.image-actions button:hover { color: #111; background: var(--acid); }
.cover-choice { margin-bottom: auto; display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 9px; white-space: nowrap; }
.cover-choice input { accent-color: var(--acid); }
.editor-output { position: sticky; top: 20px; padding: clamp(26px, 3.5vw, 46px); background: #f0ede4; color: #151515; border-radius: 10px; }
.editor-output .eyebrow { color: #77746d; }
.editor-output h2 { margin: 0 0 24px; font-size: clamp(30px, 3vw, 48px); letter-spacing: -.055em; }
.editor-output ol { margin: 0 0 30px; padding-left: 18px; color: #65635c; font-size: 11px; line-height: 1.9; }
.editor-button { min-height: 46px; padding: 0 16px; border: 1px solid rgba(21,21,21,.2); color: #151515; background: transparent; border-radius: 999px; font-size: 10px; font-weight: 800; }
.editor-button:disabled { opacity: .35; cursor: not-allowed; }
.editor-button.primary { width: 100%; display: flex; align-items: center; justify-content: space-between; color: #fff; background: #151515; }
.editor-button.acid { background: var(--acid); border-color: #151515; }
#config-output { width: 100%; height: 270px; margin: 16px 0; padding: 16px; resize: vertical; border: 1px solid rgba(21,21,21,.18); outline: 0; background: #e5e1d6; border-radius: 6px; font: 9px/1.6 ui-monospace, monospace; }
.output-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.editor-status { min-height: 18px; margin: 14px 0 0; color: #68665f; font-size: 10px; text-align: center; }

@media (max-width: 980px) {
  .editor-layout { grid-template-columns: 1fr; }
  .editor-output { position: static; }
}

@media (max-width: 620px) {
  .editor-header, .editor-shell { width: calc(100% - 24px); }
  .editor-shell { padding-top: 60px; }
  .editor-brand span { display: none; }
  .editor-intro { margin-bottom: 50px; }
  .field-grid, .folder-row { grid-template-columns: 1fr; }
  .image-item { grid-template-columns: 92px 1fr; }
  .image-actions { grid-column: 1 / -1; align-items: center; flex-direction: row; }
  .cover-choice { margin: 0 auto 0 0; }
  .output-actions { grid-template-columns: 1fr; }
}
