/* ============================================================
   en-editor.css — English editor light theme (remove.bg inspired)
   Linked from every new-layout page (all 23 locales). Selectors apply under
   html so no other locale is affected. Overrides the
   dark rules in editor.css while keeping every .ed-* functional id.
   ============================================================ */
html .editor-section {
  scroll-margin-top: 78px;
  padding: 0 20px 30px;
  /* escape the 1180px marketing container so the workspace can use the viewport.
     margin-left:50% + translateX(-50%) used to leave a phantom layout box on the
     right (transform doesn't shrink the flow box) → horizontal scroll on wide
     screens. Use a real negative margin instead: no overflow, still centered. */
  width: min(1500px, calc(100vw - 40px));
  margin-left: calc(50% - min(50vw - 20px, 750px));
}

html .editor-shell {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  grid-template-rows: auto auto auto auto;
  grid-template-areas:
    "toolbar toolbar"
    "stage   panel"
    "status  panel"
    "film    film";
  align-items: start;
  background: #ffffff;
  border: 1px solid #efebf6;
  border-radius: 20px;
  box-shadow: 0 12px 44px rgba(38, 30, 72, 0.08);
  overflow: hidden;
  color: #242739;
}
/* with no active tool the panel is hidden — don't leave an empty column */
html .editor-shell:has(.ed-panel[hidden]) {
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "toolbar"
    "stage"
    "status"
    "film";
}

/* ── toolbar: soft pill, light ─────────────────────────────── */
html .ed-toolbar {
  grid-area: toolbar;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border: 0;
  border-bottom: 1px solid #ece7f6;
  background: #fff;
  border-radius: 20px 20px 0 0;
  flex-wrap: wrap;
}
html .ed-tools { gap: 3px; }
html .ed-tool {
  gap: 7px;
  padding: 9px 14px;
  border-radius: 10px;
  color: #5e6178;
  font-size: 14px;
  font-weight: 600;
}
html .ed-tool:hover { background: #f6f3fb; color: #282b3f; }
html .ed-tool.active { background: #f4efff; color: #5b21b6; }
html .ed-ico { font-size: 16px; color: #71748a; }
html .ed-tool.active .ed-ico { color: #7c3aed; }
html .ed-ico-brush { font-weight: 700; }
html .ed-ico-effect { font-size: 17px; }
html .ed-tool-sep {
  width: 1px; height: 24px; background: #e9e4f2; margin: 0 6px;
}
html .ed-actions { gap: 8px; flex: 1; margin-left: 12px; }
/* 下载按钮紧跟工具图标；关闭按钮仍留在最右 */
html .ed-actions .ed-close { margin-left: auto; }
html .ed-icon-btn {
  width: 36px; height: 36px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: #61647b;
  font-size: 19px;
}
html .ed-icon-btn:hover:not(:disabled) { background: #f6f3fb; color: #5b21b6; }
html .ed-icon-btn:disabled { opacity: .3; }
html .ed-compare-top { font-size: 20px; }
html .ed-ico-compare { font-size: 19px; }
html .ed-close { font-size: 15px; color: #9799ad; }
html .ed-download {
  gap: 8px;
  padding: 10px 18px;
  border-radius: 10px;
  background: #7c3aed;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(124, 58, 237, .28);
}
html .ed-download:hover:not(:disabled) { background: #5b21b6; filter: none; }
html .ed-dl-bolt { font-size: 15px; }
html .ed-dl-caret { font-size: 11px; }

/* ── tool panel: dedicated column beside the canvas (never overlaps) ── */
html .ed-panel {
  grid-area: panel;
  position: static;
  width: auto;
  max-width: none;
  max-height: none;
  margin: 0;
  align-self: stretch;
  overflow-y: auto;
  border: 0;
  border-left: 1px solid #ece7f6;
  border-radius: 0;
  background: #fff;
  box-shadow: none;
}
html .ed-panel-body { padding: 18px; }
html .ed-panel-tip { color: #6c7088; font-size: 13px; }
html .ed-hint { color: #8a8da4; font-size: 12px; }
html .ed-divider { background: #ece7f6; margin: 14px 0; }
html .ed-primary {
  border-radius: 9px;
  background: #7c3aed;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}
html .ed-primary:hover:not(:disabled) { background: #5b21b6; filter: none; }
html .ed-sep { background: #e9e4f2; }
html .ed-group-label { color: #767991; }

/* move tool */
html .ed-ico-move { font-size: 16px; font-weight: 700; }
html .ed-move-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px;
  border: 1px solid #e7e2f1;
  border-radius: 12px;
  background: #fff;
}
html .ed-move-ico {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #f4efff;
  color: #7c3aed;
  font-size: 20px;
}
html .ed-move-copy b { display: block; color: #242739; font-size: 14px; margin-bottom: 3px; }
html .ed-move-copy p { color: #7c7f98; font-size: 12px; line-height: 1.5; }
html .ed-move-card + .ed-hint { margin: 12px 0 8px; }
html #edMoveStatus { margin-top: 10px; }
html .ed-canvas-wrap.edit-move #edCanvas { cursor: grab; touch-action: none; }
html .ed-canvas-wrap.edit-move.dragging #edCanvas { cursor: grabbing; }

/* brush */
html .ed-brush-copy b { color: #242739; }
html .ed-brush-copy p { color: #7c7f98; }
html .ed-bmode {
  border: 2px solid #e7e2f1;
  background: #fff;
  color: #535669;
  border-radius: 12px;
  font-weight: 600;
}
html .ed-bmode:hover { border-color: #cdbcf7; color: #5b21b6; }
html .ed-bmode.active { border-color: #7c3aed; background: #f4efff; color: #5b21b6; }
html .ed-bmode-ico { color: #7c3aed; }
html .ed-brush-size span,
html .ed-field { color: #535669; }
html .ed-field em { color: #8a8da4; }
html .ed-brush-size input[type=range],
html .ed-field input[type=range] { accent-color: #7c3aed; }
html .ed-switch-label { color: #343749; }
html .ed-switch-track { background: #dad5e7; }
html .ed-switch input:checked + .ed-switch-track { background: #7c3aed; }
html .ed-subject-btn {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 12px 14px;
  border: 1px solid #e7e2f1; border-radius: 11px;
  background: #fff; color: #2d3046; font-size: 13.5px; font-weight: 600;
  cursor: pointer;
}
html .ed-subject-btn:hover { border-color: #7c3aed; background: #faf7ff; }
html .ed-subject-ico { color: #7c3aed; font-size: 16px; }
html .ed-subject-arrow { margin-left: auto; color: #9b9dae; }

/* background panel */
html .ed-bgtabs {
  display: flex; gap: 4px; padding: 4px;
  background: #f6f3fb; border-radius: 10px; margin-bottom: 16px;
}
html .ed-bgtab {
  flex: 1; padding: 8px 0; border: 0; border-radius: 8px;
  background: transparent; color: #6c7088; font-size: 13px; font-weight: 600; cursor: pointer;
}
html .ed-bgtab.active { background: #fff; color: #5b21b6; box-shadow: 0 1px 4px rgba(38,30,72,.1); }
html .ed-swatch,
html .ed-color-wrap { border-color: #ded9eb; }
html .ed-swatch.active { border-color: #7c3aed; box-shadow: 0 0 0 2px rgba(124,58,237,.3); }
html .ed-scene { border-color: #ded9eb; }
html .ed-scene.active { border-color: #7c3aed; box-shadow: 0 0 0 2px rgba(124,58,237,.35); }
html .ed-gradient-label { flex: 0 0 100%; margin-top: 4px; }
html .ed-gradient { background-size: auto; }
html .ed-upload-bg {
  display: inline-block; margin-top: 12px; padding: 9px 14px;
  border: 1px dashed #cdbcf7; border-radius: 9px;
  color: #7c3aed; font-size: 13px; font-weight: 600; cursor: pointer;
}

/* ── Presets：按主体类型分组的背景预设 ───────────────────────── */
html .ed-bg-groups {
  display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 14px;
}
html .ed-bg-chip {
  padding: 6px 11px; border: 1px solid #ded9eb; border-radius: 999px;
  background: #fff; color: #60637a; font-size: 12px; font-weight: 600;
  cursor: pointer; line-height: 1.2; white-space: nowrap;
  transition: border-color .15s, background .15s, color .15s;
}
html .ed-bg-chip:hover { border-color: #cdbcf7; color: #5b21b6; }
html .ed-bg-chip.active {
  background: #7c3aed; border-color: #7c3aed; color: #fff;
  box-shadow: 0 2px 6px rgba(124,58,237,.25);
}
/* 分组标题独占一行，缩略图跟在其后，形成清晰的类型分区 */
html .ed-bg-group-label {
  flex: 0 0 100%; margin: 10px 0 2px; padding-top: 8px;
  border-top: 1px solid #ece7f6; color: #535669;
  font-size: 11.5px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase;
}
html .ed-bg-group-label:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
/* Presets 网格限高滚动，18 张预设 + 分组标题不把右侧面板撑得过长 */
html #edSceneGridAI {
  max-height: 320px; overflow-y: auto; align-content: flex-start;
  padding-right: 4px; scrollbar-width: thin;
}
html #edSceneGridAI .ed-scene {
  width: 52px; height: 44px; border-radius: 9px;
}
html #edSceneGridAI::-webkit-scrollbar { width: 6px; }
html #edSceneGridAI::-webkit-scrollbar-thumb { background: #dad5e7; border-radius: 3px; }
html .ed-upload-bg:hover { background: #faf7ff; }

/* effect panel */
html .ed-effect-row { margin-bottom: 4px; }
html .ed-beta {
  display: inline-block; margin-left: 4px; padding: 1px 6px;
  border-radius: 999px; background: #ece7f6; color: #7c7f98;
  font-size: 10px; font-weight: 700; vertical-align: middle;
}
html .ed-filter {
  border: 2px solid transparent; border-radius: 10px;
  background: #f8f6fd; color: #535669;
}
html .ed-filter.active { border-color: #7c3aed; color: #5b21b6; }

/* adjust panel */
html .ed-mini {
  border: 1px solid #e7e2f1; border-radius: 9px;
  background: #fff; color: #535669; font-size: 12px;
}
html .ed-mini:hover { background: #faf7ff; border-color: #cdbcf7; }
html .ed-chip-row { display: flex; gap: 6px; flex-wrap: wrap; }
html .ed-chip {
  padding: 7px 12px; border: 1px solid #e7e2f1; border-radius: 999px;
  background: #fff; color: #61647b; font-size: 12px; font-weight: 600; cursor: pointer;
}
html .ed-chip:hover { border-color: #cdbcf7; color: #5b21b6; }
html .ed-chip.active { border-color: #7c3aed; background: #f4efff; color: #5b21b6; }

/* design panel */
html .ed-text-input {
  border: 1px solid #e4dfef; border-radius: 9px;
  background: #fff; color: #242739;
}
html .ed-text-input::placeholder { color: #a5a7b8; }
html .editor-shell input[type=color] {
  border: 1px solid #e4dfef; border-radius: 9px; background: #fff;
}
html .ed-sticker-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px;
}
html .ed-sticker-grid button {
  padding: 9px 0; border: 1px solid #e7e2f1; border-radius: 10px;
  background: #fff; font-size: 22px; cursor: pointer;
}
html .ed-sticker-grid button:hover { border-color: #7c3aed; background: #faf7ff; }
html .ed-template-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
html .ed-template-grid button {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 8px 4px; border: 1px solid #e7e2f1; border-radius: 10px;
  background: #fff; color: #535669; font-size: 12px; cursor: pointer;
}
html .ed-template-grid button:hover { border-color: #7c3aed; }
html .ed-tpl-swatch { width: 100%; height: 34px; border-radius: 6px; border: 1px solid #efebf6; }

/* ── stage: light canvas well ──────────────────────────────── */
html .ed-stage {
  grid-area: stage;
  min-width: 0;
  min-height: 480px;
  padding: 26px;
  background:
    radial-gradient(700px 380px at 50% 25%, rgba(124,58,237,.045), transparent 70%),
    #fcfaff;
  border-radius: 0 0 18px 18px;
}
html .ed-drop-inner {
  border: 2px dashed #d2cce4;
  border-radius: 16px;
  color: #6c7088;
  background: #fff;
}
html .ed-dropzone.dragover .ed-drop-inner { border-color: #7c3aed; background: #faf7ff; }
html .ed-drop-ico { background: #7c3aed; }
html .ed-drop-inner h2 { color: #242739; }
html .ed-link { color: #7c3aed; }
html .ed-muted { color: #9799ad !important; }
html .ed-canvas-wrap { box-shadow: 0 8px 30px rgba(38,30,72,.14); border-radius: 10px; }
html .ed-busy { background: rgba(255,255,255,.82); color: #2d3046; }
html .ed-spinner { border-color: rgba(124,58,237,.25); border-top-color: #7c3aed; }

/* canvas tools in status bar: light */
html .ed-ct-btn {
  border: 1px solid #e7e2f1; background: #fff; color: #61647b;
}
html .ed-ct-btn:hover { background: #f4efff; color: #5b21b6; }
html .ed-ct-btn[aria-pressed="true"] {
  background: #f4efff; border-color: #7c3aed; color: #5b21b6;
}
html .ed-ct-zoom { color: #6c7088; }
html .ed-ct-sep { background: #e9e4f2; }

/* ── status bar ────────────────────────────────────────────── */
html .ed-statusbar {
  grid-area: status;
  min-width: 0;
  border-top: 1px solid #ece7f6;
  background: #fff;
  color: #7c7f98;
  border-radius: 0 0 18px 18px;
}

/* ── filmstrip: centered ＋ then thumbnails ────────────────── */
html .ed-filmstrip {
  grid-area: film;
  min-width: 0;
  justify-content: center;
  border-top: 1px solid #ece7f6;
  background: #fff;
  border-radius: 0 0 20px 20px;
  padding: 14px 16px;
}
html .ed-film-add {
  width: 58px; height: 58px;
  border: 1px dashed #c8c2dd; border-radius: 10px;
  background: #faf8fe; color: #6c7088; font-size: 26px;
}
html .ed-film-add:hover { border-color: #7c3aed; color: #7c3aed; background: #faf7ff; }
html .ed-film-item {
  border: 2px solid #e4dfef; border-radius: 10px; background: #faf8fe;
}
html .ed-film-item.active { border-color: #7c3aed; box-shadow: 0 0 0 2px rgba(124,58,237,.35); }
html .ed-film-item .ed-film-badge { background: #ece7f6; color: #535669; }
html .ed-film-item.done .ed-film-badge { background: #16a34a; color: #fff; }
html .ed-film-remove { background: rgba(38,30,72,.6); }

/* ── download menu: two tiers ──────────────────────────────── */
html .ed-menu {
  background: #fff;
  border: 1px solid #efebf6;
  border-radius: 14px;
  box-shadow: 0 14px 40px rgba(38,30,72,.16);
  padding: 8px;
  min-width: 260px;
}
html .ed-menu .ed-dl-tier {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 11px 12px; border: 0; border-radius: 9px;
  background: #fff; text-align: left; cursor: pointer;
}
html .ed-menu .ed-dl-tier:hover { background: #faf7ff; }
html .ed-dl-tier-ico {
  flex: 0 0 auto; width: 30px; height: 30px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  background: #f4efff; color: #7c3aed; font-size: 15px;
}
html .ed-dl-tier-body { display: flex; flex-direction: column; gap: 2px; flex: 1; }
html .ed-dl-tier-body b { font-size: 13.5px; color: #242739; }
html .ed-dl-tier-body em { font-style: normal; font-size: 12px; color: #8a8da4; }
html .ed-dl-tier-tag {
  flex: 0 0 auto; padding: 4px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 700;
}
html .ed-dl-tier-tag.free { background: #eef6ee; color: #1a7f37; }
html .ed-dl-tier-tag.unlock { background: #fff3d6; color: #9a6700; }
html .ed-dl-fmt {
  display: flex; gap: 4px; margin-top: 6px;
  padding-top: 8px; border-top: 1px solid #ece7f6;
}
html .ed-dl-fmt button {
  flex: 1; padding: 6px 0; border: 0; border-radius: 7px;
  background: #f8f6fd; color: #6c7088; font-size: 12px; cursor: pointer;
}
html .ed-dl-fmt button:hover { background: #f4efff; color: #5b21b6; }

html .ed-footer-note { color: #8a8da4; font-size: 12px; }
html .ed-footer-note a { color: #7c3aed; }

/* ── responsive: panel stacks above the canvas on narrow screens ── */
@media (max-width: 860px) {
  html .editor-shell {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "toolbar"
      "panel"
      "stage"
      "status"
      "film";
  }
  html .editor-shell:has(.ed-panel[hidden]) {
    grid-template-areas:
      "toolbar"
      "stage"
      "status"
      "film";
  }
  html .ed-panel {
    align-self: auto;
    border-left: 0;
    border-bottom: 1px solid #ece7f6;
  }
  html .ed-tool .ed-ico { display: inline; }
}
@media (max-width: 700px) {
  html .ed-tool { padding: 7px 9px; font-size: 12px; }
  html .ed-stage { min-height: 320px; padding: 14px; }
  html .ed-panel-body { padding: 12px; }
}

/* ── paid HD result: shown in the image area after render, button flips to Download ── */
html .ed-hd-overlay {
  position: absolute; inset: 0; z-index: 6;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px; overflow: hidden;
}
html .ed-hd-overlay[hidden] { display: none; }
html .ed-hd-overlay .ed-hd-checker {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: repeating-conic-gradient(#ebe6f3 0 25%, #fff 0 50%) 0 0 / 16px 16px;
}
html .ed-hd-overlay .ed-hd-checker img {
  max-width: 100%; max-height: 100%; object-fit: contain; display: block;
  box-shadow: 0 4px 24px rgba(38,30,72,.18);
}
html .ed-hd-badge {
  position: absolute; top: 10px; left: 10px; z-index: 7;
  background: #7c3aed; color: #fff; font-size: 11px; font-weight: 600;
  padding: 5px 10px; border-radius: 6px; letter-spacing: .2px;
}
/* paid tier tag in Download state */
html .ed-dl-tier-tag.ready,
html #dlPaidTag.ready { background: #1a7f37; color: #fff; }
/* HD image layered over the result compare stage */
html .ba-stage .ba-hd-img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: contain; z-index: 5; pointer-events: none;
}
html .ba-stage .ba-hd-img[hidden] { display: none; }
